/* =========================================================================
   Admin app layout. Builds on site.css (tokens, themes, and the UI
   components: .btn, .icon-btn, .switch, .seg, .menu, form fields). Only
   admin-specific layout lives here; anything reusable goes in site.css.
   Theme: <html class="theme-auto"> follows the device (Studio / Darkroom);
   the account menu can force one (data-theme), remembered per browser.
   ========================================================================= */

:root { --top-h: 56px; --side-w: 248px; --panel-w: 320px; }
body.app { font-size: 0.875rem; line-height: 1.5; overflow-x: hidden; }
/* Zero-specificity reset, so any component's own margin wins. */
:where(.app) :is(h1, h2, h3, p) { margin: 0; }
.app :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Fields --------------------------------------------------------------- */
.app input[type=text], .app input[type=password], .app input[type=month], .app input[type=email], .app input[type=number], .app textarea, .app select {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px;
  background-color: var(--surface); color: var(--ink); font: inherit; margin: 0;
}
.app textarea { height: auto; min-height: 64px; padding: 8px 10px; resize: vertical; }
.app select { padding-right: 36px; background-position: right 10px center; }
.app input.invalid { border-color: var(--danger) !important; }
/* (.form-field, not .field: site.css styles the public contact form's .field.) */
.form-field { display: grid; gap: 5px; margin-bottom: 14px; }
.form-field > label, .form-field > .label { font-size: 0.8125rem; color: var(--ink-2); margin: 0; }
.hint { color: var(--ink-3); font-size: 0.75rem; line-height: 1.45; }
.hint.warn, .mode-note.warn { color: var(--danger); }
.mode-note { color: var(--ink-2); font-size: 0.8125rem; margin-top: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* Text field with a fixed prefix, e.g. "noasnapped.com/" + web address. */
.prefix { display: flex; align-items: center; height: 36px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); overflow: hidden; }
.prefix > span { flex: none; max-width: 65%; padding-left: 10px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app .prefix input { border: 0; height: 100%; padding-left: 1px; background: none; }
.app .prefix input:focus { box-shadow: none; }
.prefix:focus-within { border-color: var(--accent); }
/* Password field + Show/Hide (site.css .pw-field/.pw-toggle). */
.pw-field { position: relative; }
.app .pw-field input { padding-right: 64px; }
/* Switch row: label + one-line hint on the left, switch on the right. */
.sw-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); margin: 0; cursor: pointer; }
.sw-row + .sw-row:last-child, .sw-row.last { border-bottom: 1px solid var(--line); }
.sw-row b { display: block; font-weight: 500; color: var(--ink); }
.sw-row .hint { display: block; margin-top: 2px; }
.sw-row .switch { margin-top: 1px; }

/* ---- Top bar ------------------------------------------------------------- */
.app-top {
  position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 20px;
  padding: 0 20px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.app-top .brand { font: 500 19px/1 var(--serif); letter-spacing: 0.005em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.app-top .brand:hover { color: var(--ink-2); }
.app-nav { display: flex; gap: 2px; }
.app-nav .tab { border: 0; background: none; padding: 7px 12px; border-radius: 4px; color: var(--ink-3); font: inherit; white-space: nowrap; cursor: pointer; }
.app-nav .tab:hover { color: var(--ink); }
.app-nav .tab.active { color: var(--ink); background: var(--bg-2); }
.app-top .spacer { flex: 1; }
.status { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 340px; color: var(--ink-3); font-size: 0.8125rem; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex: none; }
.status .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status.dirty::before { background: var(--accent); }
.status.ok::before { background: var(--ok); }
.status.error { color: var(--danger); }
.status.error::before { background: var(--danger); }
.top-actions { display: flex; align-items: center; gap: 6px; }

/* Notices that need action (sign-in expired, fell behind another tab):
   float under the top bar, layout unchanged. */
.notice-bar {
  position: fixed; top: calc(var(--top-h) + 12px); left: 50%; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow); color: var(--ink); font-size: 0.875rem;
}
.notice-bar .btn { flex: none; }

/* Account menu (admin.js showSignedIn) */
.account { position: relative; }
.account-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; height: 34px; padding: 0 6px 0 8px; border: 0; border-radius: 4px;
  background: none; color: var(--ink-2); font: inherit; cursor: pointer; }
.account-btn:hover, .account-btn[aria-expanded="true"] { background: var(--bg-2); color: var(--ink); }
.account-btn .em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-btn .i { width: 16px; height: 16px; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 240px; }

/* ---- Collections workspace: sidebar · photos · settings ------------------- */
.workspace { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) var(--panel-w); min-height: calc(100vh - var(--top-h)); }
.ws-side, .ws-panel { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; }
.ws-side { border-right: 1px solid var(--line); padding: 14px 10px 40px; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 8px 8px; }
.side-head h2 { font: 500 0.8125rem/1 var(--sans); color: var(--ink-3); }
.side-actions { display: inline-flex; align-items: center; gap: 4px; }
.reorder-btn { display: none; } /* phones only (below) */

/* Sheet: a full-screen panel that slides up (phones), e.g. Reorder collections.
   Same motion as the drawers (--dur-drawer); the page behind is inert. */
.sheet {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  background: var(--bg); transform: translateY(100%); visibility: hidden;
  transition: transform var(--dur-drawer) var(--ease), visibility 0s var(--dur-drawer);
}
.sheet.open { transform: none; visibility: visible; transition: transform var(--dur-drawer) var(--ease), visibility 0s; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 6px; border-bottom: 0; }
.sheet-head h2 { font: 400 24px/1.2 var(--serif); }
.sheet-lead { padding: 0 14px 10px; }
body.sheet-open { overflow: hidden; }

/* Reorder rows: big touch targets (grip + arrows are 44px). */
.reorder-list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0 6px 40px; border-top: 1px solid var(--line); }
.reorder-row { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 6px 4px; border-bottom: 1px solid var(--line); background: var(--bg); }
.reorder-row .grip { display: inline-grid; place-items: center; width: 36px; height: 44px; flex: none; color: var(--ink-3); touch-action: none; cursor: grab; }
.reorder-row img, .reorder-row .ph { width: 44px; height: 44px; flex: none; object-fit: cover; border-radius: 3px; background: var(--photo-bg); }
.reorder-row .t { flex: 1; min-width: 0; }
.reorder-row b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reorder-row small { color: var(--ink-3); font-size: 0.75rem; display: inline-flex; align-items: center; gap: 4px; }
.reorder-row small .i { width: 13px; height: 13px; }
.reorder-row .icon-btn { width: 44px; height: 44px; }
.reorder-row .icon-btn .i { width: 19px; height: 19px; }
.reorder-row.dragging:not(.lifted) { opacity: 0.4; }
.reorder-row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.reorder-row.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.coll-list { display: flex; flex-direction: column; gap: 1px; }
.coll-item { position: relative; display: flex; align-items: center; border-radius: 5px; }
.coll-item:hover, .coll-item.active { background: var(--bg-2); }
.coll-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; background: none;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer; border-radius: 5px; }
.coll-pick img, .coll-pick .ph { width: 36px; height: 36px; flex: none; object-fit: cover; border-radius: 3px; background: var(--photo-bg); }
.coll-pick .t { flex: 1; min-width: 0; }
.coll-pick b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coll-item.active .coll-pick b { font-weight: 600; }
.coll-pick small { color: var(--ink-3); font-size: 0.75rem; }
.coll-pick .flag { color: var(--ink-3); display: inline-flex; }
.coll-pick .flag .i { width: 15px; height: 15px; }
/* Reorder arrows: shown on hover/focus (always on touch screens). */
.coll-move { display: flex; padding-right: 4px; opacity: 0; }
.coll-item:hover .coll-move, .coll-item:focus-within .coll-move { opacity: 1; }
@media (hover: none) { .coll-move { opacity: 1; } }
.coll-move .icon-btn { width: 24px; height: 24px; }
.coll-move .i { width: 14px; height: 14px; }
.side-empty { padding: 8px; color: var(--ink-3); }
/* Drag to reorder (collections, categories): a line where it will land. */
.coll-item[draggable="true"] { cursor: grab; }
.coll-item.dragging, .cat-row.dragging:not(.lifted) { opacity: 0.4; }
.coll-item.drop-before, .cat-row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.coll-item.drop-after, .cat-row.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }


.ws-main { position: relative; min-width: 0; padding: 26px 32px 80px; }
.ws-empty { padding: 80px 0; text-align: center; color: var(--ink-3); }
.ws-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.ws-head h1 { font: 400 34px/1.1 var(--serif); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.ws-head .btns { display: flex; gap: 8px; flex: none; }
.ws-meta { color: var(--ink-3); margin-bottom: 20px; }
.ws-meta a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.ws-meta a:hover { color: var(--ink); border-color: var(--ink-3); }
.ws-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--ink-3); font-size: 0.8125rem; }
.ws-toolbar .spacer { flex: 1; }

/* Whole photo area accepts dropped files; this shows while dragging. */
.ws-main.hot::after {
  content: "Drop to add photos"; position: absolute; inset: 12px; z-index: 5; display: grid; place-items: center;
  border: 2px dashed var(--accent); border-radius: 6px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  color: var(--ink); font-size: 1rem; pointer-events: none;
}
.drop { margin-bottom: 16px; padding: 16px; border: 1px dashed var(--line); border-radius: 4px; text-align: center; color: var(--ink-3); font-size: 0.8125rem; cursor: pointer; }
.drop:hover { border-color: var(--ink-3); color: var(--ink-2); }

/* Upload progress + activity log */
.up-progress { margin-bottom: 14px; }
.up-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink-2); }
.up-bar { margin-top: 8px; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.up-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s ease; }
.log { margin-bottom: 12px; font-size: 0.75rem; color: var(--ink-3); max-height: 96px; overflow: auto; }
.log:empty { display: none; }
.log div { padding: 1px 0; }
.log .err { color: var(--danger); }
.log .ok { color: var(--ok); }

/* Photo grid: real shapes, no crop (flex-grow = aspect ratio). */
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.thumbs::after { content: ""; flex-grow: 999; }
.thumb { position: relative; flex-basis: calc(var(--ar, 1.5) * 160px); flex-grow: var(--ar, 1.5); aspect-ratio: var(--ar, 1.5);
  overflow: hidden; border-radius: 2px; background: var(--photo-bg); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb[draggable="true"] { cursor: grab; }
.thumb.dragging { opacity: 0.35; }
.thumb.drop-before { box-shadow: -4px 0 0 var(--accent); }
.thumb.drop-after { box-shadow: 4px 0 0 var(--accent); }
.thumb .tools { position: absolute; inset: 0; display: flex; align-items: flex-start; gap: 4px; padding: 6px;
  background: linear-gradient(to bottom, rgba(0,0,0,.45), transparent 45%); opacity: 0; transition: opacity 0.15s; }
.thumb:hover .tools, .thumb:focus-within .tools { opacity: 1; }
@media (hover: none) { .thumb .tools { opacity: 1; } }
.thumb .tools .spacer { flex: 1; }
.thumb .tools button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px;
  background: rgba(0,0,0,.5); color: #fff; cursor: pointer; }
.thumb .tools button:hover:not(:disabled) { background: rgba(0,0,0,.78); }
.thumb .tools button:disabled { opacity: 0.35; cursor: default; }
.thumb .tools .i { width: 15px; height: 15px; }
.thumb .star.on { color: #f5c518; }
.thumb .star.on .i { fill: currentColor; }
/* A starred photo shows its star without hovering. */
.thumb .star-mark { position: absolute; top: 12px; left: 12px; color: #f5c518; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.thumb .star-mark .i { width: 15px; height: 15px; fill: currentColor; }
.thumb:hover .star-mark, .thumb:focus-within .star-mark { display: none; }
.thumb .hd { position: absolute; right: 7px; bottom: 7px; padding: 3px 5px; border-radius: 3px; background: rgba(0,0,0,.55);
  color: #fff; font: 600 10px/1 var(--sans); letter-spacing: 0.04em; }
/* Centered, so it never covers the star or the HD mark. */
.thumb .pending { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none;
  padding: 3px 9px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 0.6875rem; font-weight: 500;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); }

/* ---- Collection settings panel (drawer below 1100px) --------------------- */
.ws-panel { border-left: 1px solid var(--line); padding: 20px 20px 60px; background: var(--bg); }
.ws-panel h3 { font: 500 0.8125rem/1 var(--sans); color: var(--ink-3); margin: 26px 0 12px; }
.ws-panel h3:first-of-type { margin-top: 0; }
/* Always toggleable: ✕ hides it, the Settings button brings it back. */
.panel-close { position: absolute; top: 12px; right: 12px; }
.panel-btn[aria-expanded="true"] { background: var(--bg-2); border-color: var(--line); }
/* Wide windows: hiding/showing slides the column (its content keeps its width
   and is clipped, so it slides rather than squeezes). Animated only after a
   click (body.panel-anim), never on load. */
body.panel-hidden .workspace { grid-template-columns: var(--side-w) minmax(0, 1fr) 0px; }
#panel-body { width: calc(var(--panel-w) - 40px); }
.ws-panel { overflow-x: hidden; }
.workspace { overflow-x: clip; } /* the hidden panel's padding mustn't widen the page (clip keeps sticky working) */
body.panel-hidden .ws-panel { visibility: hidden; border-left-color: transparent; }
body.panel-anim .workspace { transition: grid-template-columns var(--dur-drawer) var(--ease); }
body.panel-anim .ws-panel { transition: visibility 0s; }
body.panel-anim.panel-hidden .ws-panel { transition: visibility 0s var(--dur-drawer), border-color 0s var(--dur-drawer); }
.covers { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin-top: 10px; }
.slot { position: relative; border-radius: 3px; overflow: hidden; background: var(--photo-bg); cursor: pointer; }
.slot-body { position: relative; display: grid; place-items: center; width: 100%; height: 100%; min-height: 72px; }
.slot.land { aspect-ratio: 3 / 2; } .slot.port { aspect-ratio: 4 / 5; }
.slot-body img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot-body .ph { color: var(--ink-2); font-size: 0.75rem; } /* on --photo-bg, --ink-3 falls short of AA */
.slot-name { position: absolute; left: 6px; bottom: 6px; z-index: 1; padding: 2px 6px; border-radius: 3px; background: rgba(0,0,0,.55); color: #fff; font-size: 0.6875rem; }
.slot-body .replace { position: absolute; right: 6px; bottom: 6px; z-index: 1; padding: 2px 6px; border-radius: 3px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 0.6875rem; opacity: 0; transition: opacity .15s; }
.slot:hover .replace, .slot:focus-within .replace { opacity: 1; }
.panel-danger { margin-top: 28px; }
.scrim { display: none; }

/* ---- Categories ----------------------------------------------------------- */
/* Categories and Site settings line up with the Collections content: a
   sidebar-wide left column (empty here), then the content. */
.page { max-width: calc(var(--side-w) + 32px + 760px); padding: 26px 32px 80px calc(var(--side-w) + 32px); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.page-head h1 { font: 400 34px/1.1 var(--serif); letter-spacing: -0.01em; }
.page-sub { color: var(--ink-3); margin-bottom: 22px; max-width: 60ch; }
.cat-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.cat-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.app .cat-row .cat-name { flex: 1; border-color: transparent; background: none; font-size: 0.9375rem; }
.app .cat-row .cat-name:hover { border-color: var(--line); }
.cat-row .cat-url { color: var(--ink-3); font-size: 0.75rem; white-space: nowrap; }
.cat-row .cat-del { color: var(--danger); }
.cat-grip { display: inline-grid; place-items: center; width: 24px; height: 30px; color: var(--ink-3); cursor: grab; touch-action: none; }
.cat-grip:hover { color: var(--ink); }
.cat-grip .i { width: 16px; height: 16px; }

/* ---- Site settings -------------------------------------------------------- */
.settings { display: grid; grid-template-columns: var(--side-w) minmax(0, 760px); gap: 32px; padding: 26px 32px 100px 0; }
.snav { position: sticky; top: calc(var(--top-h) + 26px); align-self: start; display: flex; flex-direction: column; gap: 1px; padding: 0 10px; }
.snav a { padding: 7px 10px; border-radius: 4px; color: var(--ink-2); text-decoration: none; }
.snav a:hover { background: var(--bg-2); color: var(--ink); }
.snav a.active { background: var(--bg-2); color: var(--ink); }
.sec { padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--top-h) + 20px); }
.sec:last-child { border-bottom: 0; }
.sec h2 { font: 400 24px/1.2 var(--serif); margin-bottom: 4px; }
.sec h3.sub { font: 500 0.875rem/1.3 var(--sans); color: var(--ink); margin: 26px 0 6px; }
.sec > .lead { color: var(--ink-3); margin-bottom: 16px; max-width: 62ch; }
.set { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; align-items: start; padding: 10px 0; }
.set > .label { padding-top: 8px; color: var(--ink-2); }
.set > .label small { display: block; color: var(--ink-3); font-size: 0.75rem; }
.seg-desc { margin-top: 8px; color: var(--ink-3); font-size: 0.8125rem; }
.wm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.wm-grid .set { grid-template-columns: 110px minmax(0, 1fr); }
.wm-preview canvas { width: 100%; height: auto; display: block; border-radius: 3px; background: var(--photo-bg); }
.range { width: 100%; margin: 8px 0 0; accent-color: var(--accent); }
.color-row { display: flex; flex-wrap: wrap; gap: 14px; }
.color-input { display: flex; align-items: center; gap: 8px; }
.color-input > span { min-width: 72px; color: var(--ink-2); }
.color-input input[type=color] { width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); cursor: pointer; }
.app .color-input input[type=text] { width: 100px; font-family: ui-monospace, monospace; text-transform: uppercase; }
.asset-slots { display: flex; flex-wrap: wrap; gap: 10px; }
.asset-slots .slot { width: 220px; height: 96px; border: 1px solid var(--line); }
.asset-slots .slot.dark { background: #2a2a2a; }
.asset-slots .slot.dark .ph { color: #bbb; }
.asset-slots .slot-body img { object-fit: contain; padding: 14px; }
.asset-slots .slot.square { width: 96px; }
.font-preview { font-family: var(--serif); font-size: 1.75rem; line-height: 1.2; margin-top: 22px; }
/* The body font previews here only (--sans set on this element), so the admin's own text stays put. */
.font-preview-body { font-family: var(--sans); font-size: 1rem; line-height: 1.65; margin-top: 18px; max-width: 48ch; color: var(--ink-2); }
.asset-slots .slot.tall { height: 160px; }
/* A photo slot (page-not-found photo, About headshot): once chosen, the whole
   photo at its own shape, no frame; empty, the outlined box to click. */
.asset-slots .slot.photo.filled { height: auto; border: 0; background: none; }
.asset-slots .slot.photo.filled .slot-body img { position: static; display: block; width: 100%; height: auto; padding: 0; }
textarea.tall { min-height: 220px; }
/* Account settings: storage totals (a meter against the plan) + breakdown. */
.acct-value { padding-top: 8px; overflow-wrap: anywhere; }
.usage-total { font-size: 0.9375rem; }
.usage-total strong { font: 400 30px/1.1 var(--serif); margin-right: 4px; }
.meter { height: 6px; margin: 14px 0 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; max-width: 520px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.meter > span.some { min-width: 6px; } /* any use shows, even a tiny share */
.meter.warn > span { background: var(--danger); }
.usage-list { margin: 18px 0 12px; border-top: 1px solid var(--line); max-width: 520px; }
.usage-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.usage-row small { display: block; color: var(--ink-3); font-size: 0.75rem; }
.usage-row .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Plans (Account settings; QA U32): one table, a column per plan, rows only
   for what differs; the recommended column is tinted top to bottom. */
.plans-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 18px; }
.plans-save { color: var(--ink-3); font-size: 0.8125rem; }
.plans-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.plans-corner { width: 26%; }
.plans-table th.plan { vertical-align: top; text-align: left; font-weight: 400; padding: 14px 14px 18px; border-bottom: 1px solid var(--line); }
.plans-table th.plan > span { display: block; }
.plans-table .rec { background: var(--bg-2); }
.plans-table th.rec { border-radius: 6px 6px 0 0; }
.plans-table tbody tr:last-child td.rec { border-radius: 0 0 6px 6px; }
/* Text in ink, color in the dot: a site's brand color isn't always readable as small text. */
.plan-flag { min-height: 1.4em; font-size: 0.75rem; font-weight: 500; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.plan-flag:not(:empty)::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.plan-name { font: 400 22px/1.2 var(--serif); }
.plan-pitch { min-height: calc(1.45em * 3); margin-top: 4px; color: var(--ink-3); font-size: 0.8125rem; line-height: 1.45; }
.plan-price { margin-top: 12px; color: var(--ink-3); font-size: 0.8125rem; }
.plan-price b { font: 400 34px/1 var(--serif); color: var(--ink); margin-right: 2px; font-variant-numeric: tabular-nums; }
.plan-billed { min-height: calc(1.45em * 2); margin-top: 6px; color: var(--ink-3); font-size: 0.75rem; line-height: 1.45; }
.plan-saves { display: block; color: var(--ink-2); }
.plans-table th.plan .btn, .plan-current { margin-top: 12px; }
.plan-current { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; font-size: 0.8125rem; color: var(--ink); }
.plan-current .i, .plans-includes .i { width: 16px; height: 16px; flex: none; color: var(--accent); }
.plans-table tbody th { text-align: left; font-weight: 400; color: var(--ink-2); padding: 12px 14px 12px 0; border-bottom: 1px solid var(--line); }
.plans-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink); font-variant-numeric: tabular-nums; }
.plans-msg { margin-top: 14px; }
.plans-includes { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.plans-includes li { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-2); }
.plans-includes .i { margin-top: 3px; }

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 1100px) {
  :root { --side-w: 220px; }
  .workspace, body.panel-hidden .workspace { grid-template-columns: var(--side-w) minmax(0, 1fr); transition: none; }
  #panel-body { width: auto; }
  /* A drawer: slides in from the right over a fading scrim, and back out. */
  .ws-panel, body.panel-anim .ws-panel, body.panel-hidden .ws-panel, body.panel-anim.panel-hidden .ws-panel {
    position: fixed; top: var(--top-h); right: 0; bottom: 0; z-index: 25; width: min(340px, 92vw); height: auto;
    border-left-color: var(--line); box-shadow: var(--shadow); transform: translateX(100%); visibility: hidden;
    transition: transform var(--dur-drawer) var(--ease), visibility 0s var(--dur-drawer); }
  body.panel-open .ws-panel, body.panel-open.panel-hidden .ws-panel, body.panel-anim.panel-open.panel-hidden .ws-panel {
    transform: none; visibility: visible; transition: transform var(--dur-drawer) var(--ease), visibility 0s; }
  .scrim { display: block; position: fixed; inset: var(--top-h) 0 0 0; z-index: 20; background: rgba(0,0,0,.28);
    opacity: 0; visibility: hidden; transition: opacity var(--dur-drawer) var(--ease), visibility 0s var(--dur-drawer); }
  body.panel-open .scrim { opacity: 1; visibility: visible; transition: opacity var(--dur-drawer) var(--ease), visibility 0s; }
  .status { max-width: 200px; }
}
@media (max-width: 900px) {
  .app-top { gap: 10px; padding: 0 12px; }
  .status .txt { display: none; }
  .account-btn .em { display: none; }
}
@media (max-width: 760px) {
  :root { --top-h: 104px; }
  .settings { grid-template-columns: 1fr; gap: 0; }
  .snav { display: none; }
  .app-top { flex-wrap: wrap; height: auto; min-height: var(--top-h); padding: 10px 12px 0; row-gap: 6px; }
  .app-nav { order: 9; width: 100%; overflow-x: auto; padding-bottom: 6px; }
  .workspace { grid-template-columns: 1fr; }
  .ws-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 8px; }
  .coll-list { flex-direction: row; overflow-x: auto; gap: 4px; }
  .coll-item { flex: none; }
  .coll-pick { padding: 4px 8px 4px 4px; }
  .coll-move { display: none; }
  .reorder-btn { display: inline-flex; }
  .coll-item.drop-before { box-shadow: inset 2px 0 0 var(--accent); }
  .coll-item.drop-after { box-shadow: inset -2px 0 0 var(--accent); }
  .ws-main, .page, .settings { padding: 18px 14px 80px; max-width: none; }
  .ws-head h1, .page-head h1 { font-size: 28px; }
  /* Title on its own line, buttons under it: side by side squeezed it mid-word. */
  .ws-head { flex-wrap: wrap; align-items: flex-start; row-gap: 12px; }
  .ws-head h1 { flex: 1 1 100%; }
  .set, .wm-grid, .wm-grid .set { grid-template-columns: 1fr; gap: 6px; }
  /* Plans: three plan columns; each row's label moves above its values. */
  .plans-table, .plans-table thead, .plans-table tbody { display: block; }
  .plans-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plans-corner, .plans-table th.plan > .plan-pitch { display: none; }
  /* Buttons line up at the bottom, however the price lines wrap. */
  .plans-table th.plan { display: flex; flex-direction: column; align-items: flex-start; padding: 12px 10px 14px; }
  .plans-table th.plan .btn, .plan-current { margin-top: auto; }
  .plan-billed { min-height: 0; margin-bottom: 12px; }
  .plan-name { font-size: 18px; }
  .plan-price b { font-size: 26px; }
  .plans-table tbody tr { border-bottom: 1px solid var(--line); }
  .plans-table tbody th { grid-column: 1 / -1; padding: 12px 0 2px; border-bottom: 0; font-size: 0.8125rem; color: var(--ink-3); }
  .plans-table tbody td { padding: 2px 10px 12px; border-bottom: 0; }
  .plans-table tbody tr:last-child td.rec { border-radius: 0 0 6px 6px; }
  .set > .label { padding-top: 0; }
  .thumb { flex-basis: calc(var(--ar, 1.5) * 110px); }
  /* The header wraps here, so the settings drawer covers the whole screen. */
  .ws-panel, body.panel-anim .ws-panel, body.panel-hidden .ws-panel, body.panel-anim.panel-hidden .ws-panel { top: 0; z-index: 40; width: 100vw; }
  .scrim { inset: 0; z-index: 35; }
}

/* ---- Sign-in page (QA T3; login.html) ---------------------------------- */
body.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); color: var(--ink); }
.auth { width: 100%; max-width: 380px; }
.auth-site { color: var(--ink-3); margin: 0 0 6px; min-height: 1.4em; }
.auth h1 { font: 400 30px/1.2 var(--serif); margin: 0 0 18px; }
.auth-lead { color: var(--ink-2); margin: 0 0 18px; }
.auth .form-field { margin-bottom: 14px; }
.auth .btn.primary { width: 100%; justify-content: center; }
.auth-alt { margin: 18px 0 0; font-size: 0.875rem; color: var(--ink-2); }
.auth-alt a { color: var(--ink-2); text-decoration: underline; }
.auth-msg { margin: 14px 0 0; color: var(--danger); min-height: 1.4em; }
.auth-msg:empty { margin: 0; }
.auth-note { margin: 14px 0 0; color: var(--ink-2); }
.auth-note:empty { display: none; }
.auth-hint { margin: 14px 0 0; color: var(--ink-3); font-size: 0.875rem; }
.auth-row { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.auth-link { font: inherit; color: var(--ink-2); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.auth-link:hover, .auth-alt a:hover { color: var(--ink); }
.auth-link:disabled { color: var(--ink-3); cursor: default; }
/* The code: big, spaced digits, one width so they line up. */
.app .auth-code { font-size: 1.5rem; letter-spacing: 0.2em; font-variant-numeric: tabular-nums; text-align: center; }

/* ---- Editors, Close site (QA T3, T18) ----------------------------------- */
.editor-list { list-style: none; margin: 0 0 10px; padding: 0; border-top: 1px solid var(--line); }
.editor-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.editor-email { flex: 1 1 220px; overflow-wrap: anywhere; }
.editor-role { color: var(--ink-2); min-width: 4.5em; }
.editor-actions { display: flex; gap: 6px; }
.editor-add { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.editor-add .form-field { flex: 1 1 240px; margin: 0; }
.close-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.close-form .form-field { flex: 0 1 280px; margin: 0; }
.close-form .mode-note { flex-basis: 100%; margin: 0; }

/* ---- Platform console (QA T3; superadmin.html) ---------------------------- */
.console-main { max-width: 1120px; margin: 0 auto; padding: 28px 20px 80px; }
.console-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.console-head h1 { font: 400 28px/1.2 var(--serif); }
.sites-table { width: 100%; border-collapse: collapse; margin-bottom: 28px; }
.sites-table th, .sites-table td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.sites-table thead th { font-weight: 500; color: var(--ink-3); font-size: 0.8125rem; }
.sites-table tbody tr { cursor: pointer; }
.sites-table tbody tr:hover, .sites-table tbody tr.selected { background: var(--bg-2); }
.sites-table td:first-child, .sites-table th:first-child { padding-left: 10px; }
.sites-table button.site-open { all: unset; cursor: pointer; font-weight: 500; color: var(--ink); }
.sites-table button.site-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sites-table small { display: block; color: var(--ink-3); }
.site-status { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--bg-2); color: var(--ink-2); font-size: 0.75rem; }
.site-status.paused, .site-status.closed { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.console-panel { border-top: 1px solid var(--line); padding-top: 24px; }
.console-panel .sec h2 { font-size: 22px; }
.chip-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip-list li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border: 1px solid var(--line); border-radius: 99px; }
.chip-list .icon-btn { width: 24px; height: 24px; }
.inline-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.inline-form .form-field { flex: 1 1 200px; margin: 0; }
.audit-list { list-style: none; margin: 0; padding: 0; font-size: 0.8125rem; }
.audit-list li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.audit-list time { color: var(--ink-3); }
@media (max-width: 760px) {
  .sites-table .wide { display: none; }
  .audit-list li { grid-template-columns: 1fr; gap: 2px; }
}
