/*
 * Admin, in the Asket family layout (Zapket Social / Zapket Flow):
 *   top bar 40 px (app, where you are, quick tools) · sidebar 248 px, the same on every page
 *   · the page's own toolbar 52 px under it · content on the grouped background in flat cards.
 * Sidebar labels show from 1024 px; between 768 and 1023 it is an icon rail; phones get a tab bar.
 */
@import url("base.css");

.admin { --topbar-h: 40px; background: var(--bg); }

/* ── Top bar ──────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 4px; height: var(--topbar-h); padding: 0 8px;
  background: var(--material); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--separator);
}
.topbar-home { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--r-m); color: var(--label); }
.topbar-home:hover { background: var(--fill-3); text-decoration: none; }
.topbar .wordmark { font-size: 15px; }
.crumb-sep { color: var(--label-3); margin: 0 2px; }
.crumb { font-size: var(--text-footnote); color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .btn-icon { --h: 32px; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--selection); color: var(--tint-text); font-size: var(--text-caption); font-weight: 600; letter-spacing: 0; }
summary.avatar { cursor: pointer; list-style: none; margin-left: 4px; }
summary.avatar::-webkit-details-marker, .popover > summary::-webkit-details-marker { display: none; }
.topbar-account { display: none; }

/* Popovers built on <details>: the menu floats, one open at a time (see admin_foot). */
.popover { position: relative; }
.popover > summary { list-style: none; cursor: pointer; }
.popover > .menu { position: absolute; z-index: 60; min-width: 232px; display: grid; gap: 1px; }
.topbar-account > .menu { top: calc(100% + 6px); right: 0; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 0 10px; border: 0; border-radius: var(--r-m); background: none; color: var(--label); font-size: var(--text-footnote); text-align: left; text-decoration: none; cursor: pointer; }
.menu-item .icon { width: 16px; height: 16px; color: var(--label-2); }
.menu-item:hover, .menu-item:focus-visible { background: var(--tint-fill); color: var(--on-tint); text-decoration: none; outline: none; }
.menu-item:hover .icon, .menu-item:focus-visible .icon { color: inherit; }
.menu form { margin: 0; }
.menu-who { display: grid; gap: 1px; padding: 6px 10px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--separator); }
.menu-who strong { font-size: var(--text-footnote); }
.menu-who span { font-size: var(--text-caption); color: var(--label-2); }

.company-switch .select { --field-h: 28px; min-height: 28px; width: auto; max-width: 220px; font-size: var(--text-footnote); font-weight: 600; background-color: var(--fill-3); border-color: transparent; }
.trial-pill { margin-right: 6px; padding: 4px 10px; border-radius: 999px; background: var(--selection); color: var(--tint-text); font-size: var(--text-caption); font-weight: 600; white-space: nowrap; }
.trial-pill:hover { text-decoration: none; filter: brightness(0.97); }
.trial-pill.soon { background: var(--amber-tint); color: var(--amber); }
.plan-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 20px 0 0; padding: 14px 16px; border-radius: var(--r-l); background: var(--amber-tint); color: var(--amber); }
.plan-banner span { flex: 1 1 320px; color: var(--label); }
@media (max-width: 767px) { .company-switch .select { max-width: 140px; } .trial-pill { display: none; } }

/* ── Sidebar ──────────────────────────────────────────────── */

.admin-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100dvh - var(--topbar-h)); }
.admin-nav {
  position: sticky; top: var(--topbar-h); height: calc(100dvh - var(--topbar-h));
  display: flex; flex-direction: column; background: var(--sidebar); border-right: 1px solid var(--separator);
}
.nav-scroll { flex: 1; overflow-y: auto; padding: 8px; }
.nav-group { margin: 20px 8px 4px; font-size: var(--text-caption); line-height: var(--lh-caption); font-weight: 600; color: var(--label-2); }
.nav-gap { height: 16px; }
.admin-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px;
  border-radius: var(--r-m); color: var(--label); font-size: var(--text-body);
}
.admin-nav a:hover { background: var(--fill-3); text-decoration: none; }
.admin-nav a[aria-current="page"] { background: var(--selection); font-weight: 600; }
.admin-nav a .icon { width: 18px; height: 18px; color: var(--label-2); }
.admin-nav a[aria-current="page"] .icon { color: var(--tint-text); }
.admin-nav .badge { margin-left: auto; }
.nav-account { border-top: 1px solid var(--separator); padding: 8px; }
.nav-account > summary { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; }
.nav-account > summary:hover, .nav-account[open] > summary { background: var(--fill-3); }
.nav-account .avatar { width: 32px; height: 32px; }
.nav-account .who { flex: 1; min-width: 0; display: grid; }
.nav-account .who strong { font-size: var(--text-footnote); line-height: var(--lh-footnote); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-account .who span { font-size: var(--text-caption); line-height: var(--lh-caption); color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-account .chevrons { width: 16px; height: 16px; color: var(--label-3); }
.nav-account > .menu { bottom: calc(100% - 2px); left: 8px; right: 8px; }

/* ── Page toolbar and content ─────────────────────────────── */

.admin-main { min-width: 0; padding: 0 24px 48px; }
.admin-full .admin-main { padding: 0; }

.page-head {
  position: sticky; top: var(--topbar-h); z-index: 20;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  min-height: 52px; margin: 0 -24px 20px; padding: 8px 24px;
  background: var(--material); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--separator);
}
.page-head > div:first-child { min-width: 0; }
.page-head h1 { margin: 0; font-size: var(--text-title3); line-height: var(--lh-title3); font-weight: 600; }
.page-head p { margin: 0; font-size: var(--text-footnote); line-height: var(--lh-footnote); color: var(--label-2); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 220px; max-width: 320px; }
.toolbar .select { width: auto; }

.card { background: var(--surface); border-radius: var(--r-l); }
.card-pad { padding: 20px; }
.card h2 { margin: 0 0 12px; font-size: var(--text-title3); line-height: var(--lh-title3); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; align-items: start; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 40%), 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 16px; color: var(--label); transition: background-color var(--fast); }
a.stat:hover { text-decoration: none; background: color-mix(in srgb, var(--surface) 92%, var(--label)); }
.stat .label { font-size: var(--text-footnote); line-height: var(--lh-footnote); color: var(--label-2); }
.stat .value { font-size: var(--text-title1); line-height: var(--lh-title1); font-weight: 600; margin-top: 4px; }

/* Grouped forms: label leading, control trailing, sections as cards */
.form-section { margin-bottom: 24px; }
.form-section > h2 { margin: 0 4px 8px; font-size: var(--text-title3); line-height: var(--lh-title3); font-weight: 600; }
.form-section > .desc { margin: -4px 4px 10px; font-size: var(--text-footnote); line-height: var(--lh-footnote); color: var(--label-2); }
.admin .group-row { --row-h: 48px; }
.admin .group-row > label:first-child, .admin .group-row > .row-label { flex: 0 0 200px; font-weight: 500; }
.admin .group-row .control { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.admin .group-row .control .input, .admin .group-row .control .select { max-width: 340px; }
.admin .group-row.stack { flex-direction: column; align-items: stretch; }

/* ── Tables ───────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: var(--text-caption); line-height: var(--lh-caption); font-weight: 600; color: var(--label-2); padding: 10px 12px; border-bottom: 1px solid var(--separator); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--separator); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--fill-4); }
.table tr.clickable:focus-visible { outline: none; }
.table tr.clickable:focus-visible td { background: var(--selection); }
.table .thumbcell { width: 56px; }
.table .thumbcell img { height: 36px; width: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08); }
.table strong { font-weight: 600; }
.table .muted { color: var(--label-2); }
.table .sub { display: block; font-size: var(--text-footnote); line-height: var(--lh-footnote); color: var(--label-2); margin-top: 1px; }
.table a { color: var(--tint-text); }

/* ── Sheets (edit tile, import): header, scrolling body, footer with actions trailing ── */

dialog.drawer {
  width: min(620px, calc(100vw - 32px)); max-height: min(88dvh, 900px); margin: auto;
  border: 0; padding: 0; border-radius: var(--r-xl);
  background: var(--surface-raised); color: var(--label); box-shadow: var(--shadow-3);
}
dialog.drawer::backdrop { background: rgb(0 0 0 / 0.4); }
dialog.drawer[open] { display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--separator); }
.drawer-head h2 { margin: 0; font-size: var(--text-title3); line-height: var(--lh-title3); font-weight: 600; flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; display: grid; gap: 16px; align-content: start; }
.drawer-foot { display: flex; gap: 8px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--separator); }
.drawer-foot .spacer { flex: 1; }
@media (max-width: 639px) {
  dialog.drawer { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.check input { width: 16px; height: 16px; accent-color: var(--tint-fill); }
fieldset.finish-avail { border: 0; margin: 0; padding: 0; min-width: 0; }
.finish-checks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.finish-checks label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--fill-3); font-size: var(--text-footnote); font-weight: 600; cursor: pointer; }
.finish-checks label:has(input:checked) { background: var(--selection); color: var(--tint-text); box-shadow: inset 0 0 0 1.5px var(--tint-ui); }
.finish-checks label:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.finish-checks input { width: 14px; height: 14px; margin: 0; accent-color: var(--tint-fill); }
@media (pointer: coarse) { .finish-checks label { min-height: 40px; } }

/* Faces */
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.face { position: relative; border-radius: var(--r-m); background: var(--bg); padding: 8px 6px 4px; display: grid; gap: 6px; justify-items: center; }
.face img { height: 80px; width: auto; max-width: 100%; object-fit: contain; border-radius: 2px; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.12); }
.face .face-tools { display: flex; gap: 0; }
.face .face-tools button, .face .fx-add { width: 28px; height: 28px; border: 0; border-radius: var(--r-s); background: transparent; display: grid; place-items: center; color: var(--label-2); cursor: pointer; font-size: 13px; }
.face .face-tools button:hover, .face .fx-add:hover { background: var(--fill-3); color: var(--label); }
.face .face-tools .icon { width: 15px; height: 15px; }
@media (pointer: coarse) { .face .face-tools button, .face .fx-add { width: 40px; height: 40px; } }

/* Import */
.dropzone { display: grid; place-items: center; gap: 6px; text-align: center; padding: 32px 16px; border: 1.5px dashed var(--field-border); border-radius: var(--r-l); color: var(--label-2); background: var(--bg); transition: border-color var(--fast), background var(--fast); }
.dropzone.over { border-color: var(--tint-ui); background: var(--selection); }
.dropzone strong { color: var(--label); font-size: var(--text-title3); font-weight: 600; }
.dropzone span { max-width: 52ch; }
.dropzone input[type=file] { display: none; }
.import-list { display: grid; gap: 8px; }
.import-item { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px; border-radius: var(--r-l); background: var(--bg); }
.import-item .strip { display: flex; gap: 4px; flex-wrap: wrap; max-width: 140px; align-content: start; }
.import-item .strip img { height: 44px; width: auto; border-radius: 2px; }
.import-item .fields { display: grid; gap: 6px; }
.import-item .fields .form-row { grid-template-columns: 1.4fr 1fr; gap: 6px; }
.import-item .notes { font-size: var(--text-footnote); color: var(--label-2); }
.import-item .notes .bad { color: var(--red); }
.import-item.done { opacity: .55; }
.import-item.needs { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--orange, #c93400) 45%, transparent); }
.import-item .select[aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--tint-fill); color: var(--label-2); }
.size-note { font-size: var(--text-footnote); line-height: 1.4; }
.size-note.ok { color: var(--green); }
.size-note.need { color: var(--label); font-weight: 500; }
.size-note.warn { color: var(--label); }
.size-note.warn .check { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-weight: 500; }
.size-note.bad { color: var(--red); font-weight: 500; }
.import-bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 8px; padding: 10px 12px; border-radius: var(--r-l); background: var(--selection); font-size: var(--text-footnote); font-weight: 500; }
.import-bulk .spacer { flex: 1; }
.import-bulk .bulk-label { display: flex; align-items: center; gap: 8px; }
.import-bulk .select { width: auto; min-width: 170px; }
.progress { height: 4px; border-radius: 2px; background: var(--fill-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--tint-fill); width: 0; transition: width var(--base); }

/* Rooms */
.room-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.room-item { overflow: hidden; display: flex; flex-direction: column; }
.room-item .ph { aspect-ratio: 3 / 2; background: var(--stage); display: block; }
.room-item .ph img { width: 100%; height: 100%; object-fit: cover; }
.room-item .body { padding: 12px 16px 8px; display: flex; align-items: center; gap: 8px; }
.room-item .body .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item .sub { color: var(--label-2); font-size: var(--text-footnote); margin-top: 1px; }
.room-item .actions { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 10px 12px; }

/* Filter chips (quote requests) */
.chips { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.chip { min-height: 28px; padding: 0 12px; border-radius: 999px; background: var(--fill-3); color: var(--label); font-size: var(--text-footnote); font-weight: 600; display: inline-flex; align-items: center; }
.chip:hover { background: var(--fill-2); text-decoration: none; }
.chip[aria-pressed="true"] { background: var(--label); color: var(--window); }
@media (pointer: coarse) { .chip { min-height: 40px; } }

.onboard { margin-bottom: 16px; }
.onboard h2 { margin-bottom: 2px; }
.ob-steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.ob-steps li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-m); background: var(--bg); }
.ob-steps li > div { flex: 1; min-width: 0; display: grid; }
.ob-steps li span:not(.ob-n):not(.pill) { font-size: var(--text-footnote); color: var(--label-2); }
.ob-n { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--separator); font-weight: 600; font-size: var(--text-footnote); }
.ob-steps li.done .ob-n { background: var(--green-tint); color: var(--green); box-shadow: none; }
.ob-steps li.done strong { color: var(--label-2); }

/* ── Plan & billing ─────────────────────────────────────── */

.billing { max-width: 960px; display: grid; gap: 8px; }
.plan-now { display: grid; gap: 16px; margin-bottom: 16px; }
.now-line { margin: 8px 0 0; color: var(--label-2); max-width: 60ch; }
.usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 0; }
.usage div { padding: 12px 14px; border-radius: var(--r-m); background: var(--bg); }
.usage dt { font-size: var(--text-caption); color: var(--label-2); }
.usage dd { margin: 2px 0 0; font-weight: 600; }
.plan-now .btn-plain { justify-self: start; }
.plans-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 4px 12px; }
.plans-head h2 { margin: 0; font-size: var(--text-title3); }
.plans-head .segmented { min-width: 300px; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.plan-card.featured { box-shadow: inset 0 0 0 1.5px var(--tint-ui); }
.plan-flag { position: absolute; top: -10px; left: 20px; padding: 2px 10px; border-radius: 999px; background: var(--tint-fill); color: var(--on-tint); font-size: var(--text-caption); font-weight: 600; }
.plan-card h3 { margin: 0; font-family: var(--font); font-size: var(--text-title3); }
.plan-card .price { margin: 0; font-size: var(--text-title1); line-height: var(--lh-title1); font-weight: 700; }
.plan-card .price small { font-size: var(--text-footnote); font-weight: 500; color: var(--label-2); }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; flex: 1; font-size: var(--text-footnote); }
.plan-list li { position: relative; padding-left: 20px; }
.plan-list li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 9px; height: 5px; border-left: 1.8px solid var(--green); border-bottom: 1.8px solid var(--green); transform: rotate(-45deg); }
.plan-list li.no { color: var(--label-3); }
.plan-list li.no::before { border: 0; top: 8px; width: 8px; height: 1.8px; background: var(--label-4); transform: none; }

/* ── Asket: companies ───────────────────────────────────── */

.co-state { white-space: nowrap; }
.co-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.lib-grid { display: grid; gap: 12px; }
.lib-card { padding: 16px 20px; }
.lib-card h3 { margin: 0; font-family: var(--font); font-size: var(--text-body); }
.lib-card .grants { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.grant { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border-radius: 999px; background: var(--fill-3); font-size: var(--text-footnote); font-weight: 600; cursor: pointer; }
.grant:has(input:checked) { background: var(--selection); color: var(--tint-text); box-shadow: inset 0 0 0 1.5px var(--tint-ui); }
.grant input { margin: 0; accent-color: var(--tint-fill); }

/* ── Room editor ──────────────────────────────────────────── */

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: calc(100dvh - var(--topbar-h)); }
.editor-stage { position: relative; background: var(--stage); overflow: hidden; min-width: 0; }
.editor-toolbar { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 5; display: flex; gap: 8px; align-items: center; pointer-events: none; flex-wrap: wrap; }
.editor-toolbar > * { pointer-events: auto; }
.glass, .editor-toolbar .group { background: var(--material); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); box-shadow: var(--shadow-2); }
.editor-toolbar .group { display: flex; gap: 0; padding: 2px; border-radius: 10px; overflow: visible; }
.editor-toolbar .btn { --control-h: 28px; background: transparent; }
.editor-toolbar .btn:hover { background: var(--fill-3); }
.editor-toolbar .btn[aria-pressed="true"] { background: var(--selection); color: var(--tint-text); }
.editor-toolbar .btn-icon { width: 28px; min-width: 28px; }
.editor-toolbar > .btn { --control-h: 32px; background: var(--material); box-shadow: var(--shadow-2); }
.editor-toolbar .zoom { min-width: 44px; text-align: center; font-size: var(--text-footnote); font-weight: 600; align-self: center; }
.editor-viewport { position: absolute; inset: 0; touch-action: none; }
.editor-viewport.panning { cursor: grabbing; }
.editor-canvas-wrap { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.editor-canvas-wrap canvas { display: block; width: 100%; height: 100%; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.2); }
.editor-svg { position: absolute; left: 0; top: 0; overflow: visible; }
.editor-svg .clip { fill: rgb(10 99 209 / 0.07); stroke: #2b8fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.editor-svg .clip.other { fill: none; stroke: rgb(255 255 255 / 0.6); stroke-dasharray: 4 4; }
.editor-svg .quad { fill: none; stroke: #ff9f0a; stroke-width: 2; vector-effect: non-scaling-stroke; }
.editor-svg .grid line { stroke: rgb(255 159 10 / 0.85); stroke-width: 1; vector-effect: non-scaling-stroke; }
.editor-svg .edge-hit { stroke: transparent; stroke-width: 14; vector-effect: non-scaling-stroke; cursor: copy; }
.editor-svg .handle { fill: #fff; stroke: #2b8fff; stroke-width: 2; vector-effect: non-scaling-stroke; cursor: grab; }
.editor-svg .handle.quad-h { stroke: #ff9f0a; }
.editor-svg .handle.sel { fill: #2b8fff; }
.editor-svg .handle.quad-h.sel { fill: #ff9f0a; }
.editor-svg .handle-label { font-family: var(--font-mono); font-weight: 600; fill: #fff; paint-order: stroke; stroke: rgb(0 0 0 / 0.65); pointer-events: none; }
.editor-hint { position: absolute; left: 12px; bottom: 12px; z-index: 5; padding: 8px 12px; border-radius: 12px; font-size: var(--text-footnote); line-height: var(--lh-footnote); max-width: min(560px, calc(100% - 24px)); color: var(--label); }
.editor-hint kbd { font: 600 11px var(--font-mono); padding: 1px 5px; border-radius: 4px; background: var(--fill-3); }

.editor-panel { display: flex; flex-direction: column; min-height: 0; background: var(--sidebar); border-left: 1px solid var(--separator); }
.editor-panel-head { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 12px 8px 8px; border-bottom: 1px solid var(--separator); }
.editor-panel-head .title { flex: 1; font-weight: 600; font-size: var(--text-title3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-panel-body { flex: 1; overflow-y: auto; padding: 4px 16px 16px; }
.editor-panel-body .section { padding: 14px 0; border-top: 1px solid var(--separator); }
.editor-panel-body .section:first-child { border-top: 0; }
.editor-panel-body .section-title { margin: 0; font-size: var(--text-body); font-weight: 600; }
.editor-panel-foot { padding: 10px 16px; border-top: 1px solid var(--separator); display: flex; gap: 8px; align-items: center; }
.editor-panel-foot .status { flex: 1; font-size: var(--text-footnote); color: var(--label-2); }
.surface-list { display: grid; gap: 2px; }
.surface-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; min-height: 36px; border-radius: var(--r-m); background: transparent; border: 0; text-align: left; width: 100%; color: var(--label); }
.surface-row:hover { background: var(--fill-3); }
.surface-row[aria-pressed="true"] { background: var(--selection); font-weight: 600; }
.surface-row .kind { font-size: var(--text-caption); color: var(--label-2); font-weight: 400; }
.surface-row .dims { margin-left: auto; font-size: var(--text-caption); color: var(--label-2); font-weight: 400; }
.mode-switch { margin: 10px 0; }
.layer-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--separator); }
.layer-row:last-child { border-bottom: 0; }
.layer-row .lthumb { width: 54px; height: 36px; border-radius: var(--r-s); background: var(--fill-3) center / cover no-repeat; flex: none; }
.layer-row .ltext { flex: 1; min-width: 0; }
.layer-row .lname { font-weight: 600; }
.layer-row .ldesc { font-size: var(--text-caption); line-height: var(--lh-caption); color: var(--label-2); }
.layer-row input[type=file] { display: none; }
.calib { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-l); background: var(--surface); }
.calib .form-row { grid-template-columns: 1fr 1fr; }
.inline-inputs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inline-inputs .input { width: 68px; }
.inline-inputs { flex-wrap: nowrap; }
.inline-inputs .range { flex: 1; width: auto; min-width: 0; }

/* ── QR stickers ──────────────────────────────────────────── */

.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.sticker { margin: 0; padding: 16px; border-radius: var(--r-l); background: #fff; color: #141414; display: grid; justify-items: center; gap: 8px; text-align: center; break-inside: avoid; }
.sticker canvas { width: 150px; height: 150px; image-rendering: pixelated; }
.sticker figcaption { display: grid; gap: 2px; }
.sticker strong { font-size: 14px; }
.sticker span { font-size: 11px; color: #5b5954; }
.sticker em { font-style: normal; font-size: 10px; color: #6b6963; }
@media print {
  .topbar, .admin-nav, .admin-tabbar, .no-print, .toast, .page-head { display: none !important; }
  .admin-shell { display: block; }
  .admin-main { padding: 0; }
  body { background: #fff; }
  .stickers { grid-template-columns: repeat(3, 1fr); gap: 6mm; }
  .sticker { border: 1px dashed #999; }
}

/* ── Sign in: the family's auth frame (dot grid, soft accent glow, one card) ── */

.auth { min-height: 100dvh; background: var(--bg); }
.auth-backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: var(--bg); }
.auth-backdrop::before {
  content: ""; position: absolute; inset: 0; background-size: 24px 24px;
  background-image: radial-gradient(circle at 1px 1px, var(--grid-dot) 1px, transparent 1.5px);
  -webkit-mask-image: radial-gradient(ellipse 90% 75% at 50% 35%, #000 25%, transparent 85%);
  mask-image: radial-gradient(ellipse 90% 75% at 50% 35%, #000 25%, transparent 85%);
}
.auth-glow { position: absolute; top: -14rem; right: -10rem; width: 38rem; height: 38rem; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in oklab, var(--tint) 16%, transparent), transparent); animation: auth-drift 24s ease-in-out infinite alternate; }
.auth-glow.second { top: auto; right: auto; bottom: -16rem; left: -12rem; width: 32rem; height: 32rem; opacity: 0.7; animation-duration: 30s; animation-direction: alternate-reverse; }
@keyframes auth-drift { to { transform: translate(-7rem, 9rem) scale(1.12); } }
.auth-frame { position: relative; z-index: 1; min-height: 100dvh; display: flex; flex-direction: column; }
.auth-head { width: 100%; max-width: 1152px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; }
.auth-head .brand { display: flex; align-items: center; gap: 10px; color: var(--label); }
.auth-head .brand:hover { text-decoration: none; }
.auth-head .app-icon { width: 32px; height: 32px; }
.auth-head .wordmark { font-size: 22px; }
.auth-head .brand img { height: 32px; width: auto; }
.auth-head p { margin: 0; font-size: var(--text-footnote); color: var(--label-2); }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 16px 40px; }
.auth-card {
  width: min(384px, 100%); padding: 28px; display: grid; gap: 16px;
  border: 1px solid var(--separator); border-radius: var(--r-xl);
  background: color-mix(in oklab, var(--surface-raised) 90%, transparent);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 12px 32px -12px rgb(0 0 0 / 0.14);
  animation: auth-rise 420ms var(--ease) both;
}
@keyframes auth-rise { from { opacity: 0; transform: translateY(8px); } }
.auth-card h1 { margin: 0; font-size: var(--text-title1); line-height: var(--lh-title1); font-weight: 700; letter-spacing: -0.01em; }
.auth-card .lede { margin: -10px 0 4px; color: var(--label-2); }
.auth-card form { display: grid; gap: 14px; }
.signup-card { width: min(440px, 100%); }
.trial-chip { justify-self: start; margin: 0; padding: 4px 10px; border-radius: 999px; background: var(--selection); color: var(--tint-text); font-size: var(--text-caption); font-weight: 600; }
.auth-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding: 0 16px 24px; font-size: var(--text-caption); color: var(--label-2); }
@media (prefers-reduced-transparency: reduce) { .auth-card { background: var(--surface-raised); -webkit-backdrop-filter: none; backdrop-filter: none; } }
@media (max-width: 639px) { .auth-main { align-items: flex-start; padding-top: 12px; } .auth-card { padding: 20px; } }

/* ── Sign in and sign up, matched to Zapket's: pointer-lit dots, password eye, divider, split sign-up ── */
.auth-backdrop::after {
  content: ""; position: absolute; inset: 0; background-size: 24px 24px;
  background-image: radial-gradient(circle at 1px 1px, var(--tint) 1.4px, transparent 2px);
  -webkit-mask-image: radial-gradient(220px circle at var(--spot-x, 50%) var(--spot-y, 30%), #000, transparent 70%);
  mask-image: radial-gradient(220px circle at var(--spot-x, 50%) var(--spot-y, 30%), #000, transparent 70%);
  opacity: 0; transition: opacity 400ms var(--ease);
}
.auth-backdrop.is-lit::after { opacity: 0.75; }
@media (min-width: 640px) { .auth-head { padding: 20px 32px; } .auth-card { padding: 32px; } }
.auth-card .lede { margin: -10px 0 6px; }
.pw { position: relative; }
.pw .input { padding-right: 40px; }
.pw .btn-icon { position: absolute; top: 0; bottom: 0; right: 4px; margin: auto 0; width: 30px; min-width: 30px; height: 30px; border-radius: 6px; }
.pw .btn-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pw .btn-icon .off { display: none; }
.pw .btn-icon[aria-pressed="true"] .on { display: none; }
.pw .btn-icon[aria-pressed="true"] .off { display: block; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; color: var(--label-3); font-size: var(--text-caption); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--separator); }
.auth-card > .btn-block { justify-content: center; }
.auth-spinner { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: auth-spin 700ms linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
.btn[aria-busy="true"] { gap: 8px; }

.auth-split { width: min(1000px, 100%); display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 64px; align-items: center; }
.auth-split .auth-card { width: 100%; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.trial-chip { display: inline-flex; align-items: center; gap: 6px; }
.trial-chip svg, .ticks svg, .pitch-list svg, .pitch-status svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trial-chip svg { width: 14px; height: 14px; }
.ticks { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 2px 0 0; padding: 0; list-style: none; font-size: var(--text-caption); color: var(--label-2); }
.ticks li { display: inline-flex; align-items: center; gap: 5px; }
.ticks svg { width: 14px; height: 14px; color: var(--green); }
.fine { margin: 0; text-align: center; font-size: var(--text-caption); line-height: var(--lh-caption); color: var(--label-2); }

.auth-pitch { display: grid; gap: 28px; }
.auth-pitch h2 { margin: 0; max-width: 15ch; font-size: 2.125rem; line-height: 1.18; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.pitch-card { max-width: 448px; display: grid; gap: 10px; padding: 16px; border: 1px solid var(--separator); border-radius: var(--r-xl);
  background: color-mix(in oklab, var(--surface-raised) 90%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.pitch-top { display: flex; align-items: center; gap: 12px; }
.pitch-avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #1f7a5a; color: #fff; font-size: var(--text-footnote); font-weight: 600; }
.pitch-who { flex: 1; min-width: 0; line-height: 1.25; }
.pitch-who b { display: block; font-size: var(--text-footnote); }
.pitch-who span { font-size: var(--text-caption); color: var(--label-2); }
.pitch-card p { margin: 0; font-size: var(--text-footnote); line-height: var(--lh-footnote); }
.pitch-swatch { display: flex; gap: 10px; align-items: center; }
.pitch-swatch i { width: 44px; height: 44px; flex: none; border-radius: 6px; background:
  linear-gradient(135deg, rgba(255,255,255,.55), transparent 55%),
  repeating-linear-gradient(118deg, #ddd8cf 0 7px, #e9e5dd 7px 9px, #d3cdc2 9px 16px); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .08); }
.pitch-status { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 6px; background: var(--green-tint); color: var(--green); font-size: var(--text-caption); font-weight: 600; }
.pitch-status svg { width: 14px; height: 14px; }
.pitch-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.pitch-list li { display: flex; align-items: center; gap: 12px; font-size: var(--text-body, 1rem); }
.pitch-list span.ic { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--selection); color: var(--tint-text); }
.pitch-list svg { width: 16px; height: 16px; }
.pitch-price { margin: 0; font-size: var(--text-footnote); color: var(--label-2); }
.pitch-price b { color: var(--label); }
.auth-foot a { color: var(--label-2); }
.auth-foot a:hover { color: var(--label); text-decoration: none; }
@media (max-width: 899px) { .auth-split { grid-template-columns: minmax(0, 440px); justify-content: center; } .auth-pitch { display: none; } }
@media (max-width: 479px) { .field-row { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .auth-glow, .auth-card { animation: none; } .auth-backdrop::after { display: none; } }

/* ── Phone tab bar ────────────────────────────────────────── */

.admin-tabbar { display: none; }

/* ── Widths ───────────────────────────────────────────────── */

/* 768–1023: the sidebar becomes an icon rail (names in tooltips). */
@media (max-width: 1023px) {
  .admin-shell { grid-template-columns: 64px minmax(0, 1fr); }
  .nav-label, .nav-group, .nav-account .who, .nav-account .chevrons { display: none; }
  .admin-nav a { justify-content: center; padding: 0; height: 40px; position: relative; }
  .admin-nav .badge { position: absolute; top: 2px; right: 4px; min-width: 16px; height: 16px; font-size: 10px; }
  .admin-nav ul + ul, .nav-gap { margin-top: 12px; }
  .nav-account > summary { justify-content: center; }
  .nav-account > .menu { left: 8px; right: auto; }
}

/* Phones: no sidebar; account in the top bar, sections in a tab bar. */
@media (max-width: 767px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-nav { display: none; }
  .topbar-account { display: block; }
  .crumb-sep, .crumb { display: none; }
  .admin-main { padding: 0 16px calc(88px + env(safe-area-inset-bottom)); }
  .page-head { margin: 0 -16px 16px; padding: 8px 16px; }
  .admin-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(5, 1fr); height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--material); -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
    border-top: 1px solid var(--separator);
  }
  .admin-tabbar > a, .tab-more > summary { display: grid; justify-items: center; align-content: center; gap: 2px; height: 56px; color: var(--label-2); font-size: var(--text-caption); line-height: 1; }
  .admin-tabbar .icon { width: 24px; height: 24px; }
  .admin-tabbar > a:hover { text-decoration: none; }
  .admin-tabbar [aria-current="page"] { color: var(--tint-text); font-weight: 600; }
  .tab-more > .menu { bottom: calc(100% + 8px); right: 8px; }
  .admin-full .admin-tabbar { display: none; }
  .editor { grid-template-columns: 1fr; grid-template-rows: 55dvh auto; height: auto; }
  .form-row { grid-template-columns: 1fr; }
  .admin .group-row { flex-wrap: wrap; }
  .admin .group-row > label:first-child, .admin .group-row > .row-label { flex-basis: 100%; }
  .admin .group-row .control { justify-content: flex-start; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
