/*
 * The archive inside an account, phase 4b (Karol 2026-10-09): direction "C+", the file manager
 * everyone already knows (left navigation, "+ New", breadcrumbs, tiles then files, details pane),
 * with B's plain-language aids and A's full-screen viewer. Built on design proposal C
 * (/home/ubuntu/docs/design/archive-redesign-2026-10-09/c). Strict CSP: no inline handlers; the
 * account's brand colour arrives as --brand on <html>. Fonts self-hosted (SIL OFL 1.1, licences
 * in /site/fonts): Atkinson Hyperlegible Next (interface), Atkinson Hyperlegible Mono (catalogue
 * numbers), Newsreader (titles).
 */
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/site/fonts/atkinson-next-latin-var.woff2?v=654b7f80f348) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Atkinson Hyperlegible Next'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/site/fonts/atkinson-next-latin-ext-var.woff2?v=0a34c85c373d) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Atkinson Hyperlegible Mono'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/site/fonts/atkinson-mono-latin-var.woff2?v=15caef4b6d89) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Atkinson Hyperlegible Mono'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/site/fonts/atkinson-mono-latin-ext-var.woff2?v=e709fc379f93) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/site/fonts/newsreader-latin-var.woff2?v=15acbc105ddd) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/site/fonts/newsreader-latin-ext-var.woff2?v=342d831f5390) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;

  --bg: #F4F3EF; --surface: #FFFFFF; --surface-2: #EFEDE7; --surface-3: #E6E3DB;
  /* --field-line: the edges of fields, switches and the search box, 3:1 or more on the surface (audit X-4, 2026-10-30). */
  --line: #E1DED6; --line-strong: #C9C5BA; --field-line: #8A8577; --ink: #182026; --ink-2: #3A454C; --muted: #5C676D;
  --brand: #1D5C58;
  --accent: var(--brand); --accent-ink: #FFFFFF; --accent-hover: color-mix(in srgb, var(--brand) 82%, #000);
  --soft: color-mix(in srgb, var(--accent) 11%, var(--surface));
  --soft-2: color-mix(in srgb, var(--accent) 20%, var(--surface));
  --danger: #B3261E; --danger-soft: #FBE9E7; --ok: #1E6E43; --ok-soft: #E3F2E8; --warn: #7F5200; --warn-soft: #FBF0D9;
  --focus: var(--brand); --scrim: rgba(18, 22, 25, .45);
  --shadow-1: 0 1px 2px rgba(20, 24, 28, .06), 0 1px 1px rgba(20, 24, 28, .04);
  --shadow-2: 0 8px 28px rgba(20, 24, 28, .14), 0 2px 6px rgba(20, 24, 28, .08);
  --r-sm: 6px; --r: 10px; --r-lg: 14px;
  --sidebar: clamp(268px, 16.75rem, 340px); --details: 340px; --top: 64px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111416; --surface: #181C1F; --surface-2: #20262A; --surface-3: #283035;
    --line: #2A3237; --line-strong: #3B454C; --field-line: #6B767D; --ink: #ECEEEF; --ink-2: #C5CBCF; --muted: #9BA5AB;
    --accent: color-mix(in oklab, var(--brand) 45%, #fff); --accent-ink: #0B1413; --accent-hover: color-mix(in oklab, var(--brand) 30%, #fff); --focus: color-mix(in oklab, var(--brand) 30%, #fff);
    --danger: #F2A49C; --danger-soft: #3A1E1C; --ok: #8FD3A8; --ok-soft: #173225; --warn: #E8C27A; --warn-soft: #36290F;
    --scrim: rgba(0, 0, 0, .6); --shadow-2: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111416; --surface: #181C1F; --surface-2: #20262A; --surface-3: #283035;
  --line: #2A3237; --line-strong: #3B454C; --field-line: #6B767D; --ink: #ECEEEF; --ink-2: #C5CBCF; --muted: #9BA5AB;
  --accent: color-mix(in oklab, var(--brand) 45%, #fff); --accent-ink: #0B1413; --accent-hover: color-mix(in oklab, var(--brand) 30%, #fff); --focus: color-mix(in oklab, var(--brand) 30%, #fff);
  --danger: #F2A49C; --danger-soft: #3A1E1C; --ok: #8FD3A8; --ok-soft: #173225; --warn: #E8C27A; --warn-soft: #36290F;
  --scrim: rgba(0, 0, 0, .6); --shadow-2: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 1rem/1.5 var(--font); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
#banner-slot { flex: none; }
a, button, input, select, textarea, label, summary { touch-action: manipulation; -webkit-tap-highlight-color: color-mix(in srgb, var(--accent) 18%, transparent); }
@media (pointer: fine) { html { overscroll-behavior: none; } }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--accent); color: var(--accent-ink); border-radius: var(--r); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 28px; height: 28px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* catalogue number: a small archive label, the one recurring "object" of the interface */
.catno { display: inline-flex; align-items: center; gap: 6px; font: 500 .875rem/1 var(--mono); letter-spacing: .01em; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 4px 7px 4px 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.catno::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-strong); }
.catno.big { font-size: .875rem; padding: 6px 9px 6px 8px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .9375rem; text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s, box-shadow .15s; touch-action: manipulation; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
/* Dark: the main button lighter and bolder than the pale accent, so it never looks switched off (UI-24). */
:root[data-theme="dark"] .btn.primary { background: color-mix(in oklab, var(--brand) 22%, #fff); border-color: color-mix(in oklab, var(--brand) 22%, #fff); font-weight: 700; }
:root[data-theme="dark"] .btn.primary:hover { background: color-mix(in oklab, var(--brand) 10%, #fff); border-color: color-mix(in oklab, var(--brand) 10%, #fff); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn.primary { background: color-mix(in oklab, var(--brand) 22%, #fff); border-color: color-mix(in oklab, var(--brand) 22%, #fff); font-weight: 700; }
  :root:not([data-theme="light"]) .btn.primary:hover { background: color-mix(in oklab, var(--brand) 10%, #fff); border-color: color-mix(in oklab, var(--brand) 10%, #fff); }
}
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
:root[data-theme="dark"] .btn.danger.solid { color: #1a0d0c; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: .875rem; }
.btn.lg { min-height: 48px; padding: 0 22px; font-size: 1rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); flex: none; touch-action: manipulation; }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn[aria-pressed="true"] { background: var(--soft-2); color: var(--accent); }
.linkbtn:hover { text-decoration-thickness: 2px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr) auto; grid-template-rows: var(--top) minmax(0, 1fr); flex: 1; min-height: 0; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--s3); padding: 0 max(var(--s4), env(safe-area-inset-right)) 0 max(var(--s3), env(safe-area-inset-left)); background: var(--bg); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; width: calc(var(--sidebar) - 24px); min-width: 0; padding: 6px 8px; border-radius: var(--r); color: var(--ink); text-decoration: none; }
.brand:hover { background: var(--surface-2); }
.brand > span { min-width: 0; }
.brand .mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font: 600 1.125rem/1 var(--serif); flex: none; }
.brand .name { display: block; font: 600 1.125rem/1.15 var(--serif); letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .sub { display: block; font: 500 .875rem/1.2 var(--font); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.brand img { height: 30px; width: auto; max-width: 200px; object-fit: contain; }
.brand .logo-dark { display: none; }
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand .logo-light { display: none; } :root:not([data-theme="light"]) .brand .logo-dark { display: block; } }

.search { flex: 1 1 auto; max-width: 560px; position: relative; display: flex; align-items: center; }
.search input { width: 100%; height: 44px; padding: 0 52px 0 48px; border: 1px solid var(--field-line); border-radius: 24px; background: var(--surface-3); color: var(--ink); font-size: 1rem; transition: background-color .15s, box-shadow .15s; }
.search input::placeholder { color: var(--muted); }
.search input:hover { background: color-mix(in srgb, var(--surface-3) 70%, var(--line-strong)); }
.search input:focus { outline: none; background: var(--surface); border-color: var(--field-line); box-shadow: var(--shadow-2); }
.search > .i { position: absolute; left: 16px; color: var(--muted); pointer-events: none; }
.search .search-opts { position: absolute; right: 4px; }
.search-hint { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); padding: 8px; z-index: 30; }
.search-hint .row { text-decoration: none; display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 6px; text-align: left; color: var(--ink); }
.search-hint .row:hover, .search-hint .row.active { background: var(--surface-2); }
.search-hint h3 { font: 600 .875rem/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 6px; }
/* search suggestions (Karol 2026-10-10): categories, tags, numbers, items with a small picture */
.search-hint { max-height: min(70vh, 540px); overflow-y: auto; overscroll-behavior: contain; }
.search-hint .row { min-height: 40px; cursor: pointer; }
.search-hint .row .i { flex: none; color: var(--muted); }
.search-hint .row .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hint .row .t mark { background: none; color: inherit; font-weight: 700; }
.search-hint .row .n { flex: none; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.search-hint .row .thumbmini { flex: none; width: 40px; height: 40px; border-radius: 6px; background: var(--surface-3); overflow: hidden; display: grid; place-items: center; }
.search-hint .row .thumbmini img { width: 100%; height: 100%; object-fit: cover; }
.search-hint .row.all { border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; margin-top: 4px; }
.search-hint .empty-row { padding: 9px 10px; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
/* Help with its word (the web menu, W-5): the top bar keeps search, Help and the account; the management places are in the sidebar's Manage group (Karol Q3). */
.textbtn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 0; border-radius: 20px; background: none; color: var(--ink-2);
  font-weight: 600; font-size: .90625rem; text-decoration: none; white-space: nowrap; }
.textbtn:hover, .textbtn[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
.search { max-width: 640px; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--soft-2); color: var(--accent); font-weight: 700; font-size: .875rem; flex: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.5rem; }
.avatar.sm { width: 28px; height: 28px; font-size: .875rem; }
.avatarbtn { border: 0; background: none; padding: 2px; border-radius: 50%; }
.avatarbtn:hover .avatar { box-shadow: 0 0 0 4px var(--surface-3); }
.menubtn { display: none; }

/* sidebar */
.sidebar { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3) var(--s3) 64px; overflow-y: auto; overscroll-behavior: contain; }
.newbtn { flex: none; display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; height: 52px; padding: 0 22px 0 16px; margin: 2px 0 8px; border: 0; border-radius: 16px; background: var(--surface); color: var(--ink); font-weight: 700; font-size: .96875rem; box-shadow: var(--shadow-1), 0 0 0 1px var(--line); transition: box-shadow .15s, background-color .15s; }
.newbtn:hover { box-shadow: var(--shadow-2); background: var(--soft); }
.newbtn .i { color: var(--accent); width: 24px; height: 24px; stroke-width: 2.2; }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.nav a, .nav button.navlink { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 40px; padding: 0 14px; border: 0; border-radius: 20px; background: none; color: var(--ink-2); text-decoration: none; font-size: .9375rem; font-weight: 500; text-align: left; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--soft-2); color: var(--ink); font-weight: 700; }
.nav a[aria-current="page"] .i { color: var(--accent); }
.nav .count { margin-left: auto; font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav a[aria-current="page"] .count, .tree .row[aria-current] .count { color: var(--ink-2); } /* on the tint: 4.5:1 or more (audit W-12; muted was 4.22:1) */
.nav .badge { margin-left: auto; }
.badge.warn { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 35%, transparent); }
.nav a.unsorted .i { color: var(--warn); }
.navlabel { font: 700 .875rem/1 var(--font); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 14px 14px 6px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.side-sep { height: 1px; background: var(--line); margin: 6px 6px; }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: .875rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* category tree */
.tree-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.tree-wrap > * { min-width: 0; }
.tree-filter { position: relative; margin: 0; }
.sidebar > * { min-width: 0; flex-shrink: 0; }
.tree-filter input { width: 100%; height: 36px; padding: 0 10px 0 34px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--surface); font-size: .90625rem; }
.tree-filter .i { position: absolute; left: 10px; top: 8px; color: var(--muted); width: 18px; height: 18px; }
.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.trow { display: flex; align-items: center; gap: 2px; min-height: 36px; border-radius: 18px; padding-right: 10px; position: relative; }
.trow:hover { background: var(--surface-2); }
.trow.current { background: var(--soft-2); }
.trow.current > a { font-weight: 700; color: var(--ink); }
.trow.drop-target { background: var(--soft-2); box-shadow: inset 0 0 0 2px var(--accent); }
.trow .tog { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: 4px; border: 0; background: none; border-radius: 50%; color: var(--muted); flex: none; }
.trow .tog:hover { background: var(--surface-3); color: var(--ink); }
.trow .tog .i { transition: transform .15s; width: 16px; height: 16px; }
.trow .tog[aria-expanded="true"] .i { transform: rotate(90deg); }
.trow .tog.leaf { visibility: hidden; }
.trow > a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 0; color: var(--ink-2); text-decoration: none; font-size: .90625rem; }
.trow > a .i { color: var(--muted); width: 18px; height: 18px; }
.trow > a .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .count { font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tree .tree { padding-left: 22px; }
.tree mark { background: color-mix(in srgb, var(--accent) 25%, transparent); color: inherit; border-radius: 2px; }
.tree-more { font-size: .875rem; color: var(--muted); padding: 6px 14px; }
.storage { margin-top: auto; padding: 14px 10px 4px; font-size: .875rem; color: var(--muted); }
.meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin: 8px 0 6px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* main */
.main { min-width: 0; overflow-y: auto; scroll-padding-bottom: 96px; overscroll-behavior: contain; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; margin-right: var(--s3); box-shadow: 0 0 0 1px var(--line); position: relative; scroll-padding-top: 120px; }
.main:focus { outline: none; }
.app.no-details .main { margin-right: var(--s3); }
.page { padding: var(--s4) var(--s5) var(--s6); max-width: 1600px; }
.page.narrow { max-width: 980px; }
.sticky-head { position: sticky; top: 0; z-index: 5; background: var(--surface); }
.pagehead { position: sticky; top: 0; z-index: 5; background: var(--surface); padding: var(--s4) var(--s5) var(--s2); display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s2) var(--s4); }
.pagehead .titles { flex: 1 1 320px; min-width: 0; }
.pagehead h1, .h1 { font: 500 1.75rem/1.15 var(--serif); letter-spacing: -.01em; color: var(--ink); }
.pagehead .lede { color: var(--muted); font-size: .9375rem; margin-top: 4px; }
.crumbs ol { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: .875rem; }
.crumbs li { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); }
.crumbs li + li::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; opacity: .7; }
.crumbs a { color: var(--ink-2); text-decoration: none; padding: 2px 6px; border-radius: 6px; }
.crumbs a:hover { background: var(--surface-2); color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { padding: 2px 6px; color: var(--ink); font-weight: 600; }
.viewtools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg { justify-self: start; align-self: start; display: inline-flex; border: 1px solid var(--line-strong); border-radius: 20px; overflow: hidden; }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 0; background: transparent; color: var(--ink-2); font-size: .875rem; font-weight: 600; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--soft-2); color: var(--ink); }
.seg button:hover { background: var(--surface-2); }

.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 4px var(--s5) 10px; background: var(--surface); }
.sticky-head .pagehead { position: static; }
.sticky-head .selbar { position: static; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink-2); font-size: .875rem; font-weight: 600; white-space: nowrap; text-decoration: none; }
.chip:hover { background: var(--surface-2); }
.chip.on { background: var(--soft-2); border-color: transparent; color: var(--ink); }
.chip .i { width: 16px; height: 16px; }
.chip .x { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: -6px; border-radius: 50%; }
.chip .x:hover { background: var(--surface-3); }
.tagchip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--surface-2); color: var(--ink-2); font-size: .875rem; text-decoration: none; border: 1px solid var(--line); }
a.tagchip:hover { background: var(--soft-2); color: var(--ink); }
.tagchip button { border: 0; background: none; padding: 0; margin-right: -4px; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--muted); }
.tagchip button:hover { background: var(--surface-3); color: var(--ink); }
.resultline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .875rem; color: var(--muted); margin-left: auto; }

.section { margin: 18px 0 8px; display: flex; align-items: baseline; gap: 10px; }
.section h2 { font: 700 .875rem/1 var(--font); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.section .more { margin-left: auto; font-size: .875rem; }

/* category / folder tiles: Drive's folder row */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tile { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 10px 8px 14px; border-radius: var(--r); background: var(--surface-2); color: var(--ink); text-decoration: none; border: 1px solid transparent; position: relative; }
.tile:hover { background: var(--surface-3); }
.tile.drop-target { border-color: var(--accent); background: var(--soft-2); }
.tile .ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; flex: none; background: var(--surface); color: var(--accent); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.tile .ico img { width: 100%; height: 100%; object-fit: cover; }
.tile.folder .ico { background: transparent; box-shadow: none; color: var(--ink-2); }
.tile.folder.unfilled { background: transparent; border: 1px dashed var(--line); }
.tile.folder.unfilled:hover { background: var(--surface-2); border-color: var(--accent); }
.tile.folder.unfilled .ico { color: var(--muted); }
.tile.folder.unfilled .t span { color: var(--accent); font-weight: 600; }
.tile .t { min-width: 0; flex: 1; }
.tile .t b { display: block; font-weight: 600; font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .t span { font-size: .875rem; color: var(--muted); }
.tile .lock { color: var(--muted); }

/* file grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; border-radius: var(--r); background: var(--surface-2); border: 1px solid transparent; transition: background-color .12s, border-color .12s, box-shadow .12s; }
.card:hover { background: var(--surface-3); }
.card.selected { background: var(--soft-2); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.card.dragging { opacity: .5; }
.card .open { display: flex; flex-direction: column; color: inherit; text-decoration: none; border-radius: var(--r); flex: 1; }
.card .open:focus-visible { outline-offset: 0; }
.thumb { position: relative; aspect-ratio: 4 / 3; margin: 8px 8px 0; border-radius: 7px; overflow: hidden; background: var(--surface-3); }
.thumb picture { display: block; width: 100%; height: 100%; }
.thumb > img { width: 100%; height: 100%; object-fit: cover; }
.card .meta { padding: 10px 12px 12px; display: grid; gap: 6px; }
.card .cap { font-size: .90625rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; overflow-wrap: anywhere; }
.card .sub { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--muted); min-width: 0; }
.card .sub .catno { font-size: .875rem; padding: 3px 6px 3px 5px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card .check, .row-check { position: absolute; top: 14px; left: 14px; z-index: 2; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); opacity: 0; transition: opacity .12s; cursor: pointer; }
.card .check input, .row-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.card:hover .check, .card .check:focus-within, .card.selected .check, .grid.selecting .card .check { opacity: 1; }
@media (hover: none) { .card .check { opacity: 1; } }
.card .more { position: absolute; top: 12px; right: 12px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #182026; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); opacity: 0; display: grid; place-items: center; border: 0; }
.card:hover .more, .card .more:focus-visible, .card .more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .card .more { opacity: 1; } }
.typebadge { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 12px; background: rgba(12, 16, 18, .72); color: #fff; font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.typebadge .i { width: 14px; height: 14px; }
.statusbadge { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: .875rem; font-weight: 700; }
.statusbadge.processing { background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-1); }
.statusbadge.failed { background: var(--danger); color: #fff; }
.thumb.processing > img { filter: blur(6px) saturate(.4); transform: scale(1.06); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* thumbnails for things that are not photos */
.doc-thumb { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(160deg, #E9E4D8, #D9D2C1); }
.doc-thumb .paper { width: 58%; height: 84%; background: #FBF9F3; box-shadow: 0 2px 8px rgba(40, 30, 10, .18); padding: 10% 9%; display: flex; flex-direction: column; gap: 6%; transform: rotate(-1.5deg); }
.doc-thumb .paper i { display: block; height: 3px; border-radius: 2px; background: #B8AF9C; }
.doc-thumb .paper i:nth-child(1) { width: 60%; background: #8D8370; height: 4px; }
.doc-thumb .paper i:nth-child(3n) { width: 82%; }
.doc-thumb .paper i:nth-child(4n) { width: 70%; }
.audio-thumb { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 0 12%; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 35%, #1b2226), #11171a); }
.audio-thumb i { display: block; width: 3px; border-radius: 2px; background: rgba(255, 255, 255, .8); }
.film-play { position: absolute; inset: 0; display: grid; place-items: center; }
.film-play span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(12, 16, 18, .6); color: #fff; backdrop-filter: blur(2px); }

/* list view */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.table { width: 100%; border-collapse: collapse; font-size: .90625rem; }
.table th { text-align: left; font-weight: 700; font-size: .875rem; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; white-space: nowrap; }
.table th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.table th button:hover { color: var(--ink); }
.table td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.selected { background: var(--soft); }
.table .namecell { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.table .namecell img, .table .namecell .mini { width: 48px; height: 36px; border-radius: 5px; object-fit: cover; flex: none; position: relative; overflow: hidden; background: var(--surface-3); }
.table .namecell a { color: var(--ink); font-weight: 600; text-decoration: none; }
.table .namecell a:hover { text-decoration: underline; }
.table td.check, .table th.check { width: 44px; padding-right: 0; }
.table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.table td.actions { text-align: right; white-space: nowrap; width: 1%; }
.table .sub { font-size: .875rem; color: var(--muted); }

/* selection bar (replaces the head while items are selected) */
.selbar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px var(--s5) 0; padding: 6px 8px 6px 6px; border-radius: 28px; background: var(--soft-2); }
.selbar .count { font-weight: 700; margin: 0 10px 0 2px; }
[data-act="select-mode"][aria-pressed="true"] { background: var(--soft-2); color: var(--ink); } /* "Select" while choosing (W-2) */
.selbar .sp { flex: 1; }

/* pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .90625rem; color: var(--muted); }
.pager nav { display: flex; gap: 4px; flex-wrap: wrap; }
.pager a, .pager span.cur { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 20px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.pager a:hover { background: var(--surface-2); }
.pager span.cur { background: var(--soft-2); color: var(--ink); }

/* details pane */
.details { width: var(--details); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; margin-right: var(--s3); box-shadow: 0 0 0 1px var(--line); padding: 0 0 24px; }
.app.no-details .details { display: none; }
.details-head { position: sticky; top: 0; background: var(--surface); z-index: 2; display: flex; align-items: center; gap: 8px; padding: 14px 10px 10px 18px; }
.details-head h2 { flex: 1; font: 600 1rem/1.3 var(--font); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.details-body { padding: 0 18px; display: grid; gap: 16px; }
.details .preview { border-radius: var(--r); overflow: hidden; background: var(--surface-3); aspect-ratio: 4 / 3; position: relative; }
.details .preview img { width: 100%; height: 100%; object-fit: cover; }
.details .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.details h3, .card-h3 { font: 700 .875rem/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
dl.props { margin: 0; display: grid; grid-template-columns: minmax(7em, max-content) minmax(0, 1fr); gap: 8px 12px; font-size: .90625rem; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
dl.props dd .catno { max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; } /* a long number at Larger breaks at its dashes, inside the pane (Q13) */
dl.props.wide { grid-template-columns: minmax(9.5em, max-content) minmax(0, 1fr); } /* in em: the labels grow with Text size (Q13) */
.stack { position: relative; height: 150px; }
.stack img { position: absolute; width: min(60%, 220px); height: 120px; object-fit: cover; border-radius: 8px; box-shadow: var(--shadow-2); border: 3px solid var(--surface); }
.stack img:nth-child(1) { left: 6%; top: 18px; transform: rotate(-6deg); }
.stack img:nth-child(2) { left: 20%; top: 8px; transform: rotate(2deg); }
.stack img:nth-child(3) { left: 34%; top: 20px; transform: rotate(7deg); }
.access-list { display: grid; gap: 10px; }
.person-line { display: flex; align-items: center; gap: 10px; font-size: .90625rem; min-width: 0; }
.person-line .who { min-width: 0; flex: 1; }
.person-line .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-line .who span { display: block; font-size: .875rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: .875rem; }
.feed li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.feed time { display: block; color: var(--muted); font-size: .875rem; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: .875rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill.accent { background: var(--soft-2); color: var(--ink); border-color: transparent; }
.pill.role-administrator { background: var(--ink); color: var(--surface); border-color: transparent; }
.pill.role-manager { background: var(--soft-2); color: var(--ink); border-color: transparent; }

/* forms */
.form { display: grid; gap: 20px; }
.fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin: 0; display: grid; gap: 16px; background: var(--surface); min-width: 0; }
.fieldset > legend, .fieldset > .legend { font: 600 1.1875rem/1.2 var(--serif); padding: 0 6px; margin-left: -6px; color: var(--ink); }
.fieldset .legend-sub { color: var(--muted); font-size: .90625rem; margin-top: -8px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-weight: 700; font-size: .90625rem; color: var(--ink); }
.field .opt { font-weight: 400; color: var(--muted); }
.field .hint { font-size: 1rem; color: var(--muted); } /* hints and errors at body size (audit W-3) */
.field .error { font-size: 1rem; color: var(--danger); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--field-line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: 1rem; }
.textarea { min-height: 104px; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--ink) 40%, var(--line-strong)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b757b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.switch { display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
/* [type] so a switch keeps its size inside a table or a list that sizes its checkboxes (the panel's People, 2026-10-29). */
.switch input[type="checkbox"] { appearance: none; flex: none; width: 44px; height: 26px; border-radius: 13px; background: var(--field-line); position: relative; margin: 1px 0 0; transition: background-color .15s; cursor: pointer; }
.switch input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
.switch input[type="checkbox"]:checked { background: var(--accent); }
.switch input[type="checkbox"]:checked::after { transform: translateX(18px); }
.switch input[type="checkbox"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }
.switch .txt b { display: block; font-weight: 700; font-size: .9375rem; }
.switch .txt span { display: block; color: var(--muted); font-size: .875rem; }
.radiocards { display: grid; gap: 10px; }
.radiocards.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Three cards need room: where their box is narrow (a person's page beside its side panels) they stand one under the other. */
.fieldset:has(> .radiocards.cols3) { container-type: inline-size; }
@container (max-width: 620px) { .radiocards.cols3 { grid-template-columns: 1fr; } }
.radiocard { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line-strong); border-radius: var(--r); cursor: pointer; background: var(--surface); }
.radiocard:hover { background: var(--surface-2); }
.radiocard:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--soft); }
.radiocard:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.radiocard input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.radiocard b { display: block; font-size: .9375rem; }
.radiocard span { display: block; font-size: .875rem; color: var(--muted); margin-top: 2px; }
.check-line { display: flex; align-items: center; gap: 10px; font-size: .9375rem; cursor: pointer; }
.check-line input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.tagsinput { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; padding: 6px 8px; border: 1px solid var(--field-line); border-radius: var(--r-sm); background: var(--surface); }
.tagsinput:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.tagsinput input { flex: 1; min-width: 120px; border: 0; outline: none; background: none; height: 30px; font-size: 1rem; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .875rem; color: var(--muted); }
.suggest button { border: 1px dashed var(--line-strong); background: none; border-radius: 14px; height: 28px; padding: 0 10px; font-size: .875rem; color: var(--ink-2); }
.suggest button:hover { background: var(--surface-2); border-style: solid; }

/* category picker (tree with search) used in dialogs and forms */
.picker { border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.picker .pk-search { position: relative; border-bottom: 1px solid var(--line); }
.picker .pk-search input { width: 100%; height: 44px; border: 0; padding: 0 12px 0 40px; background: var(--surface); font-size: .9375rem; }
.picker .pk-search input:focus { outline: none; box-shadow: inset 0 -2px 0 var(--accent); }
.picker .pk-search .i { position: absolute; left: 12px; top: 12px; color: var(--muted); }
.picker .pk-list { max-height: 280px; overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.pk-row { content-visibility: auto; contain-intrinsic-size: auto 38px; display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 8px; border-radius: 6px; font-size: .9375rem; }
.pk-row:hover { background: var(--surface-2); }
.pk-row.sub { padding-left: 34px; }
.pk-row .pk-tog { width: 26px; height: 26px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; color: var(--muted); flex: none; margin-left: -4px; }
.pk-row .pk-tog .i { width: 16px; height: 16px; transition: transform .15s; }
.pk-row .pk-tog[aria-expanded="true"] .i { transform: rotate(90deg); }
.pk-row label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; padding: 8px 0; }
.pk-row input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
.pk-row .n { margin-left: auto; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.pk-row .path { color: var(--muted); font-size: .875rem; }
.pk-row.indet label { font-weight: 600; }
.pk-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: .875rem; color: var(--ink-2); }

/* dialogs */
dialog { border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: hidden; }
dialog.wide { width: min(760px, calc(100vw - 32px)); }
dialog::backdrop { background: var(--scrim); }
dialog[open] { display: flex; flex-direction: column; animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.dlg-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 8px 24px; }
.dlg-head h2 { flex: 1; font: 500 1.4375rem/1.2 var(--serif); }
.dlg-head > div { flex: 1; min-width: 0; }
.dlg-head p { color: var(--muted); font-size: .9375rem; margin-top: 4px; }
.dlg-head p + p { margin-top: 10px; } /* paragraphs of one text (P10 choice) */
.dlg-body { padding: 8px 24px 16px; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 16px; }
.dlg-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 14px 24px 20px; border-top: 1px solid var(--line); }
.dlg-foot .left { margin-right: auto; color: var(--muted); font-size: .875rem; }
.dlg-foot .btn, .dlg-head .iconbtn { min-height: 44px; }
.dlg-head .iconbtn { min-width: 44px; }
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); font-size: .90625rem; color: var(--ink-2); }
.callout .i { flex: none; margin-top: 1px; }
.callout.warn { background: var(--warn-soft); color: var(--ink); }
.callout.warn .i { color: var(--warn); }
.callout.danger { background: var(--danger-soft); color: var(--ink); }
.callout.danger .i { color: var(--danger); }
.callout.ok { background: var(--ok-soft); color: var(--ink); }
.callout.ok .i { color: var(--ok); }
.callout.info .i { color: var(--accent); }

/* popover menus */
.menu { overscroll-behavior: contain; position: fixed; z-index: 60; min-width: 220px; max-width: 320px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); animation: pop .12s ease-out; }
.menu [role="menuitem"], .menu [role="menuitemradio"] { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; background: none; border-radius: 6px; text-align: left; color: var(--ink); font-size: .9375rem; text-decoration: none; }
.menu [role="menuitem"]:hover, .menu [role="menuitem"]:focus, .menu [role="menuitemradio"]:hover, .menu [role="menuitemradio"]:focus { background: var(--surface-2); outline: none; }
/* A ring for the keyboard (audit W-4): the tint alone was 1.17:1. */
.menu [role="menuitem"]:focus-visible, .menu [role="menuitemradio"]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.menu [role="menuitem"] .i, .menu [role="menuitemradio"] .i { color: var(--ink-2); }
.menu [role="menuitem"].danger, .menu [role="menuitem"].danger .i { color: var(--danger); }
.menu [role="menuitem"] kbd { margin-left: auto; }
.menu [role="menuitemradio"][aria-checked="true"] { font-weight: 700; }
.menu [role="menuitemradio"] .tick { margin-left: auto; color: var(--accent); }
.menu [role="separator"] { height: 1px; background: var(--line); margin: 6px 4px; }
.menu .mhead { padding: 10px 12px 8px; font-size: .875rem; color: var(--muted); }
.menu .mhead b { display: block; color: var(--ink); font-size: .9375rem; }
kbd { font: 600 .875rem/1 var(--mono); padding: 3px 6px; border-radius: 4px; border: 1px solid var(--line-strong); border-bottom-width: 2px; color: var(--ink-2); background: var(--surface); }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 14px; min-height: 48px; max-width: min(560px, calc(100vw - 32px)); padding: 8px 8px 8px 18px; border-radius: var(--r); background: #1F2629; color: #F2F4F5; box-shadow: var(--shadow-2); font-size: .9375rem; animation: pop .18s ease-out; }
:root[data-theme="dark"] .toast { background: #E9ECEE; color: #182026; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: #E9ECEE; color: #182026; } :root:not([data-theme="light"]) .toast button { color: #1A5BA6; } }
.toast .i { color: #9FD9B4; }
:root[data-theme="dark"] .toast .i { color: var(--ok); }
.toast button { border: 0; background: none; color: #A9DCF7; font-weight: 700; padding: 8px 10px; border-radius: 6px; }
:root[data-theme="dark"] .toast button { color: #1A5BA6; }
.toast button:hover { background: rgba(255, 255, 255, .08); }
.toast .toast-x { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; margin-left: -6px; color: inherit; opacity: .8; } /* stays until closed (X-1) */

/* banners */
.banner { display: flex; align-items: center; gap: 12px; padding: 10px 16px; font-size: .90625rem; background: var(--warn-soft); color: var(--ink); border-bottom: 1px solid var(--line); grid-column: 1 / -1; }
.banner .i { color: var(--warn); }
.banner.info { background: var(--soft); }
.banner.info .i { color: var(--accent); }

/* empty, error, loading */
.empty { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 56px 16px; max-width: 520px; margin: 0 auto; }
.empty .art { width: 132px; height: 104px; display: grid; place-items: center; border-radius: 20px; background: var(--surface-2); color: var(--accent); margin-bottom: 6px; position: relative; }
.empty .art .i { width: 48px; height: 48px; stroke-width: 1.4; }
.empty h2 { font: 500 1.5rem/1.2 var(--serif); }
.empty p { color: var(--muted); }
.empty .acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.empty ul, .empty ol { text-align: left; color: var(--ink-2); margin: 4px 0 0; padding-left: 20px; font-size: .9375rem; }
.empty.error .art { color: var(--danger); background: var(--danger-soft); }
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--r-lg); padding: 32px 20px; text-align: center; display: grid; justify-items: center; gap: 10px; background: var(--surface); transition: background-color .15s, border-color .15s; }
.dropzone.over { border-color: var(--accent); background: var(--soft); }
.dropzone .i.lg { color: var(--accent); width: 40px; height: 40px; }
.dropzone b { font-size: 1.0625rem; }
.skel { background: var(--surface-3); animation: pulse 1.3s ease-in-out infinite alternate; border-radius: 6px; }
@keyframes pulse { from { opacity: 1; } to { opacity: .45; } }
.skel-card { border-radius: var(--r); background: var(--surface-2); padding: 8px; display: grid; gap: 10px; }
.skel-card .skel:first-child { aspect-ratio: 4 / 3; }
.skel.line { height: 12px; }
.skel.line.short { width: 60%; }
.drop-overlay { position: absolute; inset: 8px; z-index: 30; display: grid; place-items: center; border: 3px dashed var(--accent); border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 85%, transparent); pointer-events: none; }
.drop-overlay div { display: grid; justify-items: center; gap: 8px; font-size: 1.125rem; font-weight: 700; background: var(--accent); color: var(--accent-ink); padding: 18px 26px; border-radius: var(--r-lg); box-shadow: var(--shadow-2); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 var(--s5); overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .9375rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* item viewer (Drive-style overlay) */
.viewer { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 64px minmax(0, 1fr); background: #0E1113; color: #EEF1F2; }
.viewer .vbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: linear-gradient(#0E1113, rgba(14, 17, 19, .92)); }
.viewer .vbar h1 { font: 600 1rem/1.3 var(--font); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .vbar .catno { background: rgba(255, 255, 255, .08); color: #DDE2E4; border-color: rgba(255, 255, 255, .14); }
.viewer .vbar .catno::before { background: #0E1113; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.viewer .vbar .sp { flex: 1; }
.viewer .vbar .iconbtn, .viewer .stage .iconbtn { color: #DDE2E4; }
.viewer .vbar .iconbtn:hover, .viewer .stage .iconbtn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.viewer .iconbtn[aria-pressed="true"] { background: rgba(255, 255, 255, .16); color: #fff; }
.viewer .vbar .btn, .viewer .stage .btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: #F2F4F5; }
.viewer .vbar .btn:hover, .viewer .stage .btn:hover { background: rgba(255, 255, 255, .16); }
/* "← Back to <object>" when the item was opened from an object's page (App\Archive\ReturnPath): a long name is shortened. */
.viewer .vbar .back-to { flex: none; max-width: min(34ch, 40vw); }
.viewer .vbar .back-to span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .vbar .btn.primary, .viewer .stage .btn.primary { background: #F2F4F5; color: #0E1113; border-color: #F2F4F5; }
.viewer .vbar .btn.primary:hover, .viewer .stage .btn.primary:hover { background: #fff; }
.stage { position: relative; display: grid; place-items: center; padding: 16px 72px 56px; min-height: 0; min-width: 0; }
.stage > img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.stage .nav-prev, .stage .nav-next { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.stage .nav-prev { left: 14px; }
.stage .nav-next { right: 14px; }
.stage .nav-prev:hover, .stage .nav-next:hover { background: rgba(255, 255, 255, .22); }
.stage .pos { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); font-size: .875rem; color: #DDE2E4; background: rgba(0, 0, 0, .62); padding: 4px 12px; border-radius: 14px; font-variant-numeric: tabular-nums; }
.player { position: relative; width: min(100%, 1100px); aspect-ratio: 4 / 3; max-height: 100%; background: #000; border-radius: 4px; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.player.wide { aspect-ratio: 16 / 9; }
.player img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.player .bigplay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 76px; height: 76px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: #0E1113; display: grid; place-items: center; }
.player .bigplay .i { width: 32px; height: 32px; }
.player .controls { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 24px 14px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); font-size: .875rem; font-variant-numeric: tabular-nums; }
.player .bar { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .3); position: relative; }
.player .bar span { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: #fff; border-radius: 3px; transform: scaleX(0); transform-origin: left center; }
.player.playing .bar span { animation: play 30s linear forwards; }
@keyframes play { to { transform: scaleX(1); } }
.player.playing .bigplay { opacity: 0; pointer-events: none; }
.audio-stage { width: min(100%, 760px); padding: 32px; border-radius: var(--r-lg); background: #1A2023; display: grid; gap: 20px; }
.audio-stage .wave { display: flex; align-items: center; gap: 2px; height: 120px; }
.audio-stage .wave i { flex: 1; border-radius: 2px; background: #5D6A70; }
.audio-stage .wave i.played { background: #EEF1F2; }
.audio-stage .row { display: flex; align-items: center; gap: 14px; font-variant-numeric: tabular-nums; color: #B9C1C5; }
.audio-stage .play { width: 56px; height: 56px; border-radius: 50%; border: 0; background: #F2F4F5; color: #0E1113; display: grid; place-items: center; }
.audio-stage h2 { font: 500 1.5rem/1.25 var(--serif); color: #fff; }
.pdf-stage { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; width: min(100%, 980px); height: calc(100dvh - 64px - 88px); }
.pdf-pages { display: grid; align-content: start; gap: 10px; overflow-y: auto; }
.pdf-pages button { border: 2px solid transparent; padding: 0; background: #FBF9F3; aspect-ratio: 1 / 1.414; border-radius: 3px; position: relative; color: #555; font-size: .875rem; }
.pdf-pages button[aria-current="true"] { border-color: #86B7F2; }
.pdf-pages button .pn { position: absolute; bottom: -20px; left: 0; right: 0; color: #B9C1C5; }
.pdf-pages { padding-bottom: 24px; gap: 28px; }
.pdf-pages .lines { display: grid; gap: 5px; padding: 18% 14%; }
.pdf-pages .lines i { display: block; height: 2px; background: #B8AF9C; border-radius: 1px; }
.pdf-pages .lines i:nth-child(3n) { width: 70%; }
.pdf-page { background: #FBF9F3; color: #2A2620; aspect-ratio: 1 / 1.414; max-height: 100%; margin: 0 auto; padding: 7% 8%; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); font: 400 1.0625rem/1.7 var(--serif); overflow: hidden; width: auto; height: 100%; }
.pdf-page .addr { text-align: right; font-style: italic; margin-bottom: 1.5em; }
.pdf-page p + p { margin-top: .9em; }
.vinfo { width: 380px; overflow-y: auto; background: var(--surface); color: var(--ink); padding: 20px 22px 32px; display: grid; align-content: start; gap: 18px; border-radius: var(--r-lg) 0 0 0; }
.viewer.noinfo .vinfo { display: none; }
.vinfo h2 { font: 500 1.5rem/1.2 var(--serif); }
.vinfo dl.props.wide { grid-template-columns: 124px 1fr; }
.catblock { display: grid; gap: 6px; font-size: .90625rem; }
.catblock .label { color: var(--muted); }
.catline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.transcript { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; font-size: .90625rem; }
.transcript summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.transcript p { margin-top: 8px; }
.vinfo .desc { color: var(--ink-2); font-size: .96875rem; }
.vinfo .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.notice { font-size: .875rem; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.notice .i { flex: none; margin-top: 2px; }

/* edit item */
.edit-layout { display: grid; grid-template-columns: minmax(300px, 5fr) minmax(0, 7fr); gap: 28px; align-items: start; }
.edit-preview { position: sticky; top: 16px; display: grid; gap: 12px; }
.edit-preview .frame { border-radius: var(--r-lg); overflow: hidden; background: #0E1113; aspect-ratio: 4 / 3; display: grid; place-items: center; position: relative; }
.edit-preview .frame img { width: 100%; height: 100%; object-fit: contain; }
.edit-preview .frame .doc-thumb, .edit-preview .frame .audio-thumb { border-radius: 0; }
.edit-preview .filebox { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); font-size: .875rem; }
.savebar { position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px var(--s5); margin: 24px calc(-1 * var(--s5)) calc(-1 * var(--s6)); background: var(--surface); border-top: 1px solid var(--line); }
.savebar .state { margin-right: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .90625rem; }
.savebar .state.dirty { color: var(--warn); font-weight: 700; }
/* More of the page after the bar (the tree's "Take them out of the tree", an item's "Replace the file", Versions):
   the bar does not reach into the page's bottom padding, so that content starts below it, not under it (Daniel 2026-10-29). */
.page :has(.savebar):has(~ :is(section, p, div, form):not([hidden])) .savebar,
.savebar:has(~ :is(section, p, div):not([hidden])) { margin-bottom: 0; }
.datepick { display: grid; gap: 10px; }
.danger-zone { border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line)); border-radius: var(--r-lg); padding: 18px 20px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.danger-zone div { flex: 1 1 260px; }
.danger-zone b { display: block; font-size: 1rem; }
.danger-zone span { color: var(--muted); font-size: .90625rem; }

/* upload panel (bottom-right, Drive style) */
.uppanel { position: fixed; right: 24px; bottom: 0; z-index: 50; width: 380px; max-width: calc(100vw - 16px); background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-2), 0 0 0 1px var(--line); display: flex; flex-direction: column; max-height: 60vh; }
.uppanel .uphead { display: flex; align-items: center; gap: 6px; padding: 10px 8px 10px 18px; background: var(--ink); color: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.uppanel .uphead b { flex: 1; font-size: .9375rem; }
.uppanel .uphead .iconbtn { color: var(--surface); }
.uppanel .uphead .iconbtn:hover { background: rgba(127, 127, 127, .25); }
.uppanel .upsub { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: var(--surface-2); font-size: .875rem; color: var(--ink-2); }
.uppanel .upsub .linkbtn { margin-left: auto; }
.uppanel ul { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; }
.uppanel.min ul, .uppanel.min .upsub, .uppanel.min .upfoot { display: none; }
.uprow { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 8px 12px 8px 18px; font-size: .875rem; }
.uprow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.uprow .st { grid-column: 2; font-size: .875rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.uprow .st.err { color: var(--danger); font-weight: 600; }
.uprow .st.ok { color: var(--ok); }
.uprow .upcopy { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--ink); font-size: .875rem; }
.uprow .upcopy > .i { color: var(--warn); }
.uprow .upcopy .tx { flex: 1 1 200px; font-weight: 600; }
.uprow .upcopy .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.uprow .upcopy .btn { min-height: 44px; }
.uprow .pbar { grid-column: 2; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.uprow .pbar span { display: block; height: 100%; background: var(--accent); }
.uprow .act { grid-row: 1 / span 3; grid-column: 3; }
.upfoot { padding: 12px 18px 14px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.upfoot .btn { flex: 1; }

/* overview */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: grid; gap: 4px; background: var(--surface); text-decoration: none; color: inherit; }
a.kpi:hover { background: var(--surface-2); }
.kpi .lbl { font-size: .875rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi .val { font: 500 2.125rem/1.1 var(--serif); font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi .foot { font-size: .875rem; color: var(--muted); }
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; background: var(--surface); display: grid; gap: 14px; align-content: start; min-width: 0; }
.panel h2 { font: 500 1.25rem/1.2 var(--serif); }
.cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.stackbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; background: var(--surface); }
.stackbar span { display: block; height: 100%; }
.stackbar span:first-child { border-radius: 7px 0 0 7px; }
.stackbar span:last-child { border-radius: 0 7px 7px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .875rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.s1 { background: #2a78d6; } .s2 { background: #eb6834; } .s3 { background: #1baf7a; } .s4 { background: #eda100; }
:root[data-theme="dark"] .s1 { background: #3987e5; } :root[data-theme="dark"] .s2 { background: #d95926; } :root[data-theme="dark"] .s3 { background: #199e70; } :root[data-theme="dark"] .s4 { background: #c98500; }
.attn { list-style: none; margin: 0; padding: 0; display: grid; }
.attn li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.attn li:first-child { border-top: 0; padding-top: 0; }
.attn .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--warn-soft); color: var(--warn); }
.attn .ico.ok { background: var(--ok-soft); color: var(--ok); }
.attn .ico.danger { background: var(--danger-soft); color: var(--danger); }
.attn .t { flex: 1; min-width: 0; }
.attn .t b { display: block; font-size: .9375rem; }
.attn .t span { font-size: .875rem; color: var(--muted); }
/* Previews not made (Karol 2026-10-14): each failed item with its reason and what to do. */
.failed-previews { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.failed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.failed-head h3 { margin: 0; font: 600 .9375rem/1.3 var(--sans); }
.failed-list { list-style: none; margin: 0; padding: 0; display: grid; }
.failed-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.failed-list li:first-child { border-top: 0; }
.failed-list .who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.failed-list .who b { font-size: .9375rem; }
.failed-list .who .small { font-size: .875rem; }
.failed-list .why { grid-column: 1; margin: 0; font-size: .875rem; color: var(--danger); }
.failed-list .meta { grid-column: 1; font-size: .875rem; color: var(--muted); }
.failed-list .actions { grid-column: 2; grid-row: 1 / span 3; display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 860px) { .failed-list li { grid-template-columns: minmax(0, 1fr); } .failed-list .actions { grid-column: 1; grid-row: auto; justify-content: flex-start; margin-top: 6px; } }
.stage .empty .why { color: #F3C7C2; font-size: .9375rem; }
.strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.strip a { display: block; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; position: relative; background: var(--surface-3); }
.strip img { width: 100%; height: 100%; object-fit: cover; }

/* categories manager */
.mgr { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.mgr-head, .mgr-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 80px 150px 160px 44px; align-items: center; gap: 10px; padding: 0 10px 0 6px; }
.mgr-head { min-height: 42px; font-size: .875rem; font-weight: 700; color: var(--muted); background: var(--surface); border-bottom: 1px solid var(--line); }
.mgr-row { min-height: 54px; border-bottom: 1px solid var(--line); background: var(--surface); }
.mgr-row:last-child { border-bottom: 0; }
.mgr-row:hover { background: var(--surface-2); }
.mgr-row.sel { background: var(--soft); }
.mgr-row.sub { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.mgr-row.sub .nm { padding-left: 30px; }
.mgr-row.drop-before { box-shadow: inset 0 3px 0 var(--accent); }
.mgr-row.drop-into { box-shadow: inset 0 0 0 2px var(--accent); background: var(--soft); }
.mgr-row .handle { cursor: grab; color: var(--muted); display: grid; place-items: center; width: 28px; height: 36px; border: 0; background: none; border-radius: 6px; }
.mgr-row .handle:hover { background: var(--surface-3); color: var(--ink); }
.mgr-row .nm { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mgr-row .nm > span:last-child:not(.mobile-sub) { min-width: 0; display: grid; }
.mgr-row .nm .cover { width: 40px; height: 30px; border-radius: 5px; object-fit: cover; flex: none; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.mgr-row .nm .cover img { width: 100%; height: 100%; object-fit: cover; }
.mgr-row .nm button.namebtn { border: 0; background: none; padding: 6px 0; text-align: left; font-weight: 600; font-size: .9375rem; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgr-row .nm button.namebtn:hover { text-decoration: underline; }
.mgr-row .num { color: var(--ink-2); font-size: .90625rem; }
.mgr-row .sf { color: var(--ink-2); font-size: .875rem; line-height: 1.35; padding: 6px 0; }
.mgr-row .sf a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.mgr-row .sf a:hover { color: var(--accent); text-decoration-color: currentColor; }
.mgr-row .tog { width: 28px; height: 28px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; color: var(--muted); flex: none; }
.mgr-row .tog .i { width: 16px; height: 16px; transition: transform .15s; }
.mgr-row .tog[aria-expanded="true"] .i { transform: rotate(90deg); }
.mgr-row .tog.leaf { visibility: hidden; }
.mgr-row input.rename { height: 36px; border: 1px solid var(--accent); border-radius: 6px; padding: 0 8px; font-weight: 600; width: min(100%, 340px); background: var(--surface); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.sidecard { position: sticky; top: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 16px; background: var(--surface);
  /* Every row its own height: in a card that scrolls on its own (.split > .sidecard) the cover's row (an aspect-ratio box
     with overflow hidden, minimum height 0) shrank, and the cover was painted over the heading and Name (Karol 2026-10-24). */
  grid-auto-rows: max-content; align-content: start; }
/* Save and See its items: apart, on one row or wrapped, big enough for a thumb (OA-UI1). */
.sidecard .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sidecard .actions .btn { min-height: 44px; }
.sidecard .coverbig { aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); position: relative; }
.sidecard .coverbig img { width: 100%; height: 100%; object-fit: cover; }
.flist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.flist li { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 4px 0 10px; border-radius: 8px; background: var(--surface-2); font-size: .90625rem; }
.flist li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* people */
.ptable .namecell { min-width: 240px; }
.ptable .perm { color: var(--muted); } /* text, so it breaks between "Look · Download · Add files", never inside one (was inline-flex) */
.ptable .perm .on { color: var(--ink); white-space: nowrap; }
.reqs { display: grid; gap: 14px; }
.req { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 20px; background: var(--surface); }
.req h3 { font: 600 1.125rem/1.25 var(--font); }
.req .facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .90625rem; color: var(--ink-2); margin-top: 6px; }
.req .facts span { display: inline-flex; align-items: center; gap: 6px; }
.req blockquote { margin: 0; grid-column: 1 / -1; padding: 10px 14px; border-left: 3px solid var(--line-strong); color: var(--ink-2); font-size: .9375rem; background: var(--surface-2); border-radius: 0 8px 8px 0; }
.req .acts { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.person-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.person-top .who { flex: 1; min-width: 220px; }
.person-top h1 { font: 500 1.875rem/1.15 var(--serif); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.chosen { display: flex; flex-wrap: wrap; gap: 6px; }
.linkbox { display: flex; gap: 8px; align-items: center; }
.linkbox .input { font-family: var(--mono); font-size: .875rem; }
.qr { width: 148px; height: 148px; background: #fff; padding: 10px; border-radius: 8px; border: 1px solid var(--line); }

/* phone bottom bar */
.bottomnav { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { :root { --details: 300px; } .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 1100px) {
  .app { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .details { position: fixed; right: 12px; top: 76px; bottom: 0; z-index: 25; box-shadow: var(--shadow-2), 0 0 0 1px var(--line); }
  .edit-layout { grid-template-columns: 1fr; }
  .edit-preview { position: static; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split { grid-template-columns: 1fr; }
  .sidecard { position: static; }
  .cols { grid-template-columns: 1fr; }
  .vinfo { width: 330px; }
}
@media (max-width: 860px) {
  :root { --top: 56px; }
  body { font-size: 1rem; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--top) minmax(0, 1fr); height: 100dvh; }
  .topbar { padding: 0 6px 0 4px; gap: 4px; }
  .menubtn { display: inline-flex; }
  .brand { width: auto; flex: 1 1 auto; padding: 4px; }
  .brand > span { min-width: 0; }
.brand .mark { width: 32px; height: 32px; font-size: 1rem; }
  .brand .name { font-size: 1.0625rem; }
  .brand .sub { display: none; }
  .brand img { height: 26px; }
  .search { position: absolute; left: 0; right: 0; top: 0; height: var(--top); padding: 4px 8px; background: var(--bg); display: none; max-width: none; z-index: 5; }
  .search.open { display: flex; }
  .search input { height: 46px; }
  .search > .i { left: 24px; }
  .search .search-opts { right: 12px; }
  .top-actions .hide-phone { display: none; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); z-index: 70; background: var(--bg); box-shadow: var(--shadow-2); transform: translateX(-105%); transition: transform .2s ease; padding-top: 16px; }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 65; background: var(--scrim); }
  .main { margin: 0; border-radius: 0; box-shadow: none; padding-bottom: 72px; }
  .details { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 82dvh; margin: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; z-index: 66; padding-bottom: 88px; }
  .app.no-details .main { margin: 0; }
  .pagehead { padding: 12px 16px 6px; }
  .pagehead h1, .h1 { font-size: 1.5rem; }
  .page { padding: 12px 16px 28px; }
  /* Chips wrap onto a second line at phone width (mobile-design, round 4 #12): a chip cut at the edge gave no sign of more. */
  .filterbar { padding: 4px 16px 10px; top: 0; position: relative; }
  .filterbar .resultline { display: none; }
  .tabs { margin: 0 16px; }
  .selbar { margin: 8px 12px 0; border-radius: 20px; }
  .selbar .sp { display: none; } /* the bar keeps its words and wraps (audit W-2) */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card .meta { padding: 8px 10px 10px; }
  .card .cap { font-size: .875rem; }
  .card .sub .yr { display: none; }
  .card .check { top: 12px; left: 12px; }
  .card .more { top: 10px; right: 10px; }
  .tiles { grid-template-columns: 1fr; gap: 8px; }
  .row2, .row3, .grid2 { grid-template-columns: minmax(0, 1fr); } /* never wider than the phone (UI-21) */
  .radiocards.cols3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi .val { font-size: 1.75rem; }
  .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .edit-preview { grid-template-columns: 1fr; }
  /* Right above the bottom nav: the main area's 72 px bottom padding already lifts a sticky bar, so only
     the nav's safe-area part is added (UI-6; it floated 72 px higher with fields showing between). */
  .savebar { margin: 20px -16px -28px; padding: 10px 16px; bottom: calc(env(safe-area-inset-bottom) - 8px); }
  .savebar .state { flex-basis: 100%; }
  .savebar .btn { flex: 1; }
  .viewer { grid-template-columns: 1fr; grid-template-rows: 56px auto auto; overflow-y: auto; }
  .viewer .vbar { position: sticky; top: 0; z-index: 2; padding: 0 4px; }
  .viewer .vbar .catno, .viewer .vbar .hide-phone { display: none; }
  .stage { padding: 8px 0 44px; min-height: 52vh; }
  .stage > img { max-height: 60vh; box-shadow: none; }
  .stage .nav-prev, .stage .nav-next { top: auto; bottom: 0; transform: none; width: 44px; height: 44px; }
  .stage .nav-prev { left: 8px; } .stage .nav-next { right: 8px; }
  .stage .pos { bottom: 10px; }
  .vinfo { width: auto; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 20px 16px 40px; }
  .viewer.noinfo .vinfo { display: grid; }
  .pdf-stage { grid-template-columns: 1fr; height: auto; }
  .pdf-pages { display: none; }
  .pdf-page { width: 92vw; height: auto; font-size: .875rem; }
  .audio-stage { margin: 0 12px; padding: 20px; }
  .uppanel { right: 8px; left: 8px; width: auto; bottom: 64px; border-radius: var(--r-lg); }
  .uppanel .uphead { border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .toasts { bottom: 80px; }
  body.viewer-open .bottomnav { display: none; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
  .bottomnav a, .bottomnav button { display: grid; justify-items: center; align-content: center; gap: 3px; border: 0; background: none; color: var(--muted); font-size: min(.875rem, 15px); font-weight: 600; text-decoration: none; } /* the bar's five words fit at Larger (Q13) */
  .bottomnav a[aria-current="page"] { color: var(--ink); }
  .bottomnav a[aria-current="page"] .i { color: var(--accent); }
  .bottomnav .fab { width: 52px; height: 52px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; margin-top: -18px; box-shadow: var(--shadow-2); }
  .bottomnav .fab .i { width: 26px; height: 26px; }
  /* tables become stacked rows */
  .table.stack-phone thead { display: none; }
  .table.stack-phone, .table.stack-phone tbody, .table.stack-phone tr, .table.stack-phone td { display: block; width: 100%; }
  .table.stack-phone tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 12px; border-bottom: 1px solid var(--line); }
  .table.stack-phone td { border: 0; padding: 0; }
  .table.stack-phone td.hide-phone { display: none; }
  .table.stack-phone td.check { display: none; }
  .table.stack-phone.selecting tr { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .table.stack-phone.selecting td.check { display: grid; place-items: center; grid-column: 1; grid-row: 1 / span 2; width: 44px; min-height: 44px; }
  .table.stack-phone.selecting td.first, .table.stack-phone.selecting td.line2 { grid-column: 2; }
  .table.stack-phone.selecting td.actions { grid-column: 3; }
  .table.stack-phone td.first { grid-column: 1; }
  .table.stack-phone td.actions { grid-column: 2; grid-row: 1; }
  .table.stack-phone td.line2 { grid-column: 1 / -1; font-size: .875rem; color: var(--muted); }
  .table.stack-phone .namecell { min-width: 0; }
  .table-wrap { border-left: 0; border-right: 0; border-radius: 0; margin: 0 -16px; }
  .mgr-head { display: none; }
  .mgr-row { grid-template-columns: 24px minmax(0, 1fr) 44px; padding: 6px 6px 6px 2px; }
  .mgr-row .num, .mgr-row .vis, .mgr-row .sf { display: none; }
  .mgr-row .handle { width: 24px; }
  .mgr-row .mobile-sub { display: block; font-size: .875rem; color: var(--muted); font-weight: 400; }
  .req { grid-template-columns: 1fr; }
  .req .acts { justify-content: stretch; }
  .req .acts .btn { flex: 1; }
  dialog { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  dialog.wide { width: 100vw; }
  .dlg-head { padding: 18px 16px 6px; }
  .dlg-body { padding: 8px 16px 14px; }
  .dlg-foot { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
  .dlg-foot .btn { flex: 1; }
  .dlg-foot .left { flex-basis: 100%; }
  dl.props, dl.props.wide { grid-template-columns: 110px 1fr; }
}
.mobile-sub { display: none; }
@media (min-width: 861px) { .only-phone { display: none !important; } }

@media (forced-colors: active) {
  .card.selected, .trow.current, .nav a[aria-current="page"] { outline: 2px solid Highlight; }
  .switch input[type="checkbox"] { border: 1px solid CanvasText; }
}

/* small utility hooks used instead of inline style attributes (strict CSP) */
[data-gap] { margin-top: 16px; }
[data-block] { display: block; }
[data-span] { grid-column: 1 / -1; }
.section[data-flat] { margin: 0; }
.logo-prev { display: flex; align-items: center; min-height: 72px; padding: 16px; border-radius: var(--r); border: 1px solid var(--line); }
.logo-prev.light { background: #FFFFFF; color: #182026; }
.logo-prev.dark { background: #111416; color: #ECEEEF; }
.logo-prev .brand { width: auto; pointer-events: none; color: inherit; }
.logo-prev img { height: 30px; width: auto; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 8px; vertical-align: -2px; }
ol.form { padding-left: 20px; }
ol.form li { padding-left: 4px; }
.vtags { display: flex; flex-wrap: wrap; gap: 6px; }
@media print { .sidebar, .topbar, .bottomnav, .toasts { display: none !important; } }

dl.props dd.catline { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

[draggable="true"] { -webkit-user-select: none; user-select: none; }
label.card:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.trow, .mgr-row { content-visibility: auto; contain-intrinsic-size: auto 40px; }
@media (max-width: 860px) {
  .sticky-head { position: static; }
  .savebar .state { display: none; }
  .savebar .state.dirty { display: flex; }
  .savebar button[value=next] { display: none; }
  .toasts { top: 64px; bottom: auto; }
  .viewer { grid-template-columns: minmax(0, 1fr); }
  .pdf-stage { height: auto; }
}

/* ---------- phase 4b additions ---------- */
/* Text size (audit Q13, Karol 2026-10-30): Standard · Large · Larger in My account and the account menu, remembered per
   browser. Every text size is in rem, so this and the browser's own text size both reach it. */
:root[data-text="large"] { font-size: 125%; }
:root[data-text="larger"] { font-size: 150%; }
.menu [role="menuitemradio"][aria-checked="false"] .tick { visibility: hidden; }
.menu .mlabel { display: flex; align-items: center; gap: 8px; padding: 8px 12px 2px; color: var(--muted); font-size: .875rem; font-weight: 700; }
.text-size-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.text-size-row .lbl { font-weight: 700; }
/* Help where it is needed (B): a disclosure that explains the page in plain words. */
.help { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: .9375rem; }
.help > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; cursor: pointer; font-weight: 700; color: var(--accent); list-style: none; }
.help > summary::-webkit-details-marker { display: none; }
.help[open] > summary { border-bottom: 1px solid var(--line); }
.help .help-body { padding: 12px 16px 14px; display: grid; gap: 8px; color: var(--ink-2); }
/* Flash messages from the server, shown as a toast until JS takes over. */
.flash { margin: 12px var(--s5) 0; }
/* Filmstrip under the viewer stage (A). */
.filmstrip { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 6px; justify-content: center; padding: 8px 12px; overflow-x: auto; scrollbar-width: none; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.filmstrip a { flex: none; width: 64px; height: 48px; border-radius: 4px; overflow: hidden; opacity: .6; border: 2px solid transparent; }
.filmstrip a:hover { opacity: .9; }
.filmstrip a[aria-current="true"] { opacity: 1; border-color: #fff; }
.filmstrip img { width: 100%; height: 100%; object-fit: cover; }
.stage.with-strip { padding-bottom: 80px; }
.stage.with-strip .pos { bottom: 70px; }
/* Decade scrubber for family archives (A). */
.decades { display: flex; flex-wrap: wrap; gap: 6px; }
.seg a { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 12px; border-radius: 0; border: 0; color: var(--ink-2); text-decoration: none; }
.seg a + a { border-left: 1px solid var(--line-strong); }
.seg a[aria-current="true"] { background: var(--soft-2); color: var(--ink); }
.seg a:hover { background: var(--surface-2); }
.thumb .no-preview { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .875rem; }
.thumb picture, .thumb picture img { width: 100%; height: 100%; object-fit: cover; }
.namecell .mini picture img { width: 100%; height: 100%; object-fit: cover; }
.menu form { margin: 0; }
.menu .mhead .mono { display: block; font-size: .875rem; }
.thumb .hover-clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; }
.thumb .hover-clip.on { opacity: 1; }
.stage picture.vmedia { display: contents; }
.stage picture.vmedia img, .stage video.vmedia { max-width: 100%; max-height: calc(100dvh - 64px - 40px); width: auto; height: auto; object-fit: contain; border-radius: 2px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); background: #000; }
.stage.with-strip picture.vmedia img, .stage.with-strip video.vmedia { max-height: calc(100dvh - 64px - 120px); }
.stage .empty { color: #EEF1F2; }
.stage .empty .art { background: rgba(255, 255, 255, .08); color: #EEF1F2; }
.stage .empty p { color: #B9C1C5; }
.audio-stage audio { width: 100%; }
.vbar form { margin: 0; }
.vinfo .strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vinfo .feed time { display: block; }
.viewer-open { overflow: hidden; }
@media (max-width: 860px) { .stage picture.vmedia img, .stage video.vmedia { max-height: 60vh; } .filmstrip { display: none; } .stage.with-strip { padding-bottom: 44px; } .stage.with-strip .pos { bottom: 10px; } }
.seg .segopt { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; font-size: .90625rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg .segopt + .segopt { border-left: 1px solid var(--line-strong); }
.seg .segopt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg .segopt:has(input:checked) { background: var(--soft-2); color: var(--ink); }
.seg .segopt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
select.select[size] { height: auto; padding: 4px; background-image: none; }
select.select[size] option { padding: 6px 8px; border-radius: 4px; }
input.input + select.select { margin-top: 6px; }
.edit-preview .frame picture { display: contents; }
.edit-preview .frame .audio-thumb { position: absolute; }
.filebox form { margin: 0; }
.callout b { display: block; }
.mgr-row .updown { display: flex; gap: 2px; }
.mgr-row .iconbtn.sm { width: 36px; height: 36px; border-radius: 6px; } /* side by side, 36 px (audit W-6; were 24×18 stacked) */
.mgr-row .i.up { transform: rotate(-90deg); }
.mgr-row .i.down { transform: rotate(90deg); }
.mgr-row a.tog { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--muted); }
.mgr-row a.tog[aria-expanded="true"] .i { transform: rotate(90deg); }
.mgr-row a.namebtn { padding: 6px 0; font-weight: 600; font-size: .9375rem; color: var(--ink); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgr-row a.namebtn:hover { text-decoration: underline; }
.mgr .empty { padding: 40px 16px; }
.covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.cover-opt { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--surface-2); border: 2px solid transparent; cursor: pointer; }
.cover-opt input { position: absolute; opacity: 0; }
.cover-opt:has(input:checked) { border-color: var(--accent); }
.cover-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.cover-opt img, .cover-opt picture { width: 100%; height: 100%; object-fit: cover; }
.coverbig picture, .coverbig picture img { width: 100%; height: 100%; object-fit: cover; }
.danger-zone .form { gap: 12px; width: 100%; }
.sidecard .h1 { font-size: 1.5rem; }
.flist form { margin: 0; }
.filterbar .tree-filter { flex: 0 1 360px; }
@media (min-width: 861px) { .mgr-head, .mgr-row { grid-template-columns: 28px minmax(0, 1fr) 80px 110px 150px 44px; } } /* not on a phone: it hid the name column (W7) */

/* Category picker (people: invite, approve, edit), ported from phase 4 with the new tokens */

.cat-picker { max-width: 900px; margin: 0 0 4px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.cat-picker > summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; cursor: pointer; list-style: none; border-radius: 12px; }
.cat-picker > summary::-webkit-details-marker { display: none; }
.cat-picker > summary:hover { background: var(--surface-2); }
.cat-picker .cat-icon { color: var(--accent); }
.cat-title { min-width: 0; color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-value { margin-left: auto; padding: 3px 12px; border-radius: 999px; background: var(--soft-2); color: var(--ink); font-size: .875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-value.none { background: transparent; box-shadow: inset 0 0 0 1px var(--danger); color: var(--danger); }
.cat-chev { flex: none; color: var(--muted); transition: transform .2s ease; }
.cat-picker[open] > .cat-chev, .cat-picker[open] > summary .cat-chev { transform: rotate(180deg); }
.cat-picker[open] > summary { border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; }
.cat-body { padding: 6px 16px 14px; }
.cat-all { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.cat-filter { position: relative; margin: 12px 0 6px; }
.cat-filter svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.cat-filter input { width: 100%; max-width: 420px; min-height: 42px; padding: 0 14px 0 38px; border: 1px solid var(--field-line); border-radius: 999px; background: var(--surface-2); color: var(--ink); font: inherit; }
.cat-tree { margin: 6px 0 8px; padding: 0; list-style: none; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
.cat-node { border-bottom: 1px solid var(--line); }
.cat-node:last-child { border-bottom: 0; }
.cat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 46px; }
.cat-check { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; color: var(--ink-2); cursor: pointer; }
.cat-check input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.cat-check.root { color: var(--ink); font-weight: 700; }
.cat-check input:disabled + span { color: var(--muted); }
.cat-toggle { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; margin-left: auto; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: .875rem; cursor: pointer; }
.cat-toggle:hover { background: var(--surface-2); color: var(--ink); }
.cat-toggle svg { transition: transform .2s ease; }
.cat-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.cat-subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; margin: 0 0 10px 8px; padding: 0 0 0 20px; border-left: 2px solid var(--line); list-style: none; }
.cat-subs[hidden] { display: none; }
.cat-empty { margin: 8px 0; color: var(--muted); }
.cat-choose .hint { margin: 8px 0 0; }


.cat-picker > summary { color: var(--ink); }
.chipx { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-size: .875rem; font-weight: 700; white-space: nowrap; }
.req .avatar { flex: none; }
.req-head { display: flex; gap: 14px; align-items: flex-start; }
.admin-note { display: none; }
/* One column that never grows past the page: the role cards' widest line made it 4 px too wide at 375 (UI-21). */
.invite-form { grid-template-columns: minmax(0, 1fr); }
.invite-form:has(input[name=role][value=administrator]:checked) [data-may],
.invite-form:has(input[name=role][value=administrator]:checked) [data-category-picker] { display: none; }
.invite-form:has(input[name=role][value=administrator]:checked) [data-admin-note] { display: flex; }
.may { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; gap: 12px; }
.may legend { margin-bottom: 4px; padding: 0; font-weight: 700; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .90625rem; color: var(--ink-2); align-items: center; }
.facts > span { display: inline-flex; align-items: center; gap: 6px; }
.quote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--line-strong); color: var(--ink-2); font-size: .9375rem; background: var(--surface-2); border-radius: 0 8px 8px 0; }
.req .acts { grid-column: 1 / -1; }
.radiocard > span { display: grid; gap: 2px; }
.filterbar .select { width: auto; min-height: 36px; padding: 0 34px 0 12px; font-size: .90625rem; }
.filterbar .btn { min-height: 36px; }
.filterbar .input.date { width: auto; flex: none; min-height: 36px; padding: 0 10px; font-size: .90625rem; } /* not the bar's full width on a computer */

/* ---------- phase 5: OneLegacy visit and "view as" bar (Karol K6) ---------- */
body.has-entrybar { --entrybar-h: 40px; }
.entrybar { flex: none; position: relative; z-index: 45; display: flex; align-items: center; gap: 10px; height: var(--entrybar-h, 40px); padding: 0 max(var(--s3), env(safe-area-inset-right)) 0 max(var(--s4), env(safe-area-inset-left)); font-size: .90625rem; line-height: 1.2; }
.entrybar p { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.entrybar b { font-weight: 700; }
.entrybar form { flex: none; margin: 0; }
.entrybar .i { flex: none; }
.entrybar.operator { background: var(--ink); color: var(--bg); }
.entrybar.operator .i { color: color-mix(in srgb, var(--bg) 70%, var(--brand)); }
.entrybar.viewing { background: var(--warn-soft); color: var(--ink); border-bottom: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line)); }
.entrybar.viewing .i { color: var(--warn); }
.barbtn { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font-weight: 700; font-size: .875rem; white-space: nowrap; cursor: pointer; }
.entrybar.operator .barbtn { border-color: color-mix(in srgb, var(--bg) 45%, transparent); }
.entrybar.operator .barbtn:hover { background: color-mix(in srgb, var(--bg) 14%, transparent); }
.entrybar.viewing .barbtn { border-color: color-mix(in srgb, var(--warn) 60%, transparent); }
.entrybar.viewing .barbtn:hover { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.entrybar .barbtn:focus-visible { outline-color: currentColor; }
/* Phase 6: the archive is a read-only preview of the old one. */
.entrybar.preview { background: color-mix(in srgb, var(--brand) 12%, var(--bg)); color: var(--ink); border-bottom: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); }
.entrybar.preview .i { color: var(--brand); }
.entrybar.preview .barbtn { border-color: color-mix(in srgb, var(--brand) 55%, transparent); text-decoration: none; }
.entrybar.preview .barbtn:hover { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.entrybar .show-phone { display: none; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* The item viewer covers the screen; it starts under the bar. */
body.has-entrybar .viewer { top: var(--entrybar-h); }
@media (max-width: 600px) {
  .entrybar { gap: 8px; font-size: .875rem; }
  .entrybar .hide-phone, .entrybar .ro { display: none; }
  .entrybar .show-phone { display: inline; }
  .entrybar.viewing p::after { content: " · read only"; }
}
.notice-page { max-width: 620px; margin: 0 auto; padding: var(--s6) var(--s4); display: grid; gap: var(--s4); overflow: auto; }
.person-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
form.inline { display: inline; margin: 0; }
/* Phase 6 (Q6-1): an item kept as a smaller copy until its original is added; discreet, explained on hover and focus. */
.om { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: 6px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--warn); cursor: help; vertical-align: middle; flex: none; }
.om .i { width: 15px; height: 15px; }
.om-tip { position: absolute; z-index: 30; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 240px; padding: 6px 9px; border-radius: 6px; background: var(--ink); color: var(--bg); font-size: .875rem; font-weight: 500; line-height: 1.35; text-align: left; white-space: normal; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s; }
.om:hover .om-tip, .om:focus-visible .om-tip, .card .open:focus-visible .om .om-tip { opacity: 1; visibility: visible; }
.thumb .om { position: absolute; left: 8px; bottom: 8px; margin: 0; width: 24px; height: 24px; background: rgba(12, 16, 18, .66); color: #fff; }
.thumb .om .om-tip { left: 0; transform: none; max-width: 200px; }
.om-add { margin-left: 8px; font-size: .875rem; }
.original-box { display: grid; gap: 10px; }

/* Decade bar of family archives (Karol 2026-10-10): one row of decades with counts; scrolls sideways on a phone. */
.decadebar { display: flex; gap: 6px; margin: 0 0 var(--s4); padding: 2px 2px 6px; overflow-x: auto; scrollbar-width: thin; scroll-snap-type: x proximity; }
.decadebar a { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 72px; min-height: 48px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink-2); text-decoration: none; scroll-snap-align: start; }
.decadebar a b { font-size: .90625rem; font-weight: 700; white-space: nowrap; }
.decadebar a .num { font-size: .875rem; color: var(--muted); }
.decadebar a:hover { background: var(--surface-2); }
.decadebar a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.decadebar a[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.decadebar a[aria-current="true"] .num { color: inherit; opacity: .85; }
.decadebar a.nd b { font-weight: 600; }
@media (forced-colors: active) { .decadebar a[aria-current="true"] { border: 2px solid Highlight; } }

/* Drop files anywhere (Karol 2026-10-10): a frame over the page while files are dragged; it never takes the pointer,
   so a category tile under it still says where the files go. */
.drop-overlay { position: fixed; inset: 0; z-index: 80; pointer-events: none; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); outline: 3px dashed var(--accent); outline-offset: -10px; }
.drop-overlay[hidden] { display: none; }
.drop-card { display: grid; justify-items: center; gap: 8px; max-width: 420px; padding: 24px 28px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-2); text-align: center; }
.drop-card .i.lg { width: 40px; height: 40px; color: var(--accent); }
.drop-card b { font-size: 1.125rem; }
.drop-card span { color: var(--muted); font-size: .90625rem; }
.dropping [data-drop-category]:hover { outline: 3px solid var(--accent); outline-offset: 2px; }
.uppanel .callout { margin: 8px 12px; }
.uppanel .upfoot .small { font-size: .875rem; }
@media (max-width: 860px) { .uppanel { right: 8px; left: 8px; width: auto; bottom: calc(72px + env(safe-area-inset-bottom)); border-radius: var(--r-lg); } }
@media (prefers-reduced-motion: no-preference) { .drop-card { animation: pop .16s ease-out; } }

/* Full titles (Stewart, 2026-10-10: "Is it possible to see the full titles"): category names wrap
   instead of being cut with "…"; picture captions show up to three lines and the rest on hover. */
.tile { align-items: flex-start; }
.tile .ico { margin-top: 2px; }
.tile .t b { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.3; }
.trow > a .label { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.3; }
.trow > a { align-items: flex-start; }
.trow > a > .i { margin-top: 1px; flex: none; }
.trow .tog { align-self: flex-start; margin-top: 4px; }
.trow > .count { align-self: flex-start; margin-top: 10px; }
.mgr-row a.namebtn, .mgr-row .nm button.namebtn { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; line-height: 1.3; }
.card .cap { -webkit-line-clamp: 3; }
.details-head h2 { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }

/* Items without a file (Karol 2026-10-10): an empty mount. The paper of the archive with a fine
   hatch, a dashed window where the picture would sit, the item's type in it. Neutral on purpose:
   nothing is broken, a file is simply not here yet. Same sleeve in the cards, the list, the strips,
   the item page and the edit page; the darker variant on the viewer's black. */
.nofile { --nf-paper: var(--surface-3); --nf-window: var(--surface-2); --nf-edge: var(--line-strong); --nf-hatch: color-mix(in srgb, var(--line-strong) 45%, transparent); --nf-ink: var(--muted);
  position: absolute; inset: 0; display: grid; padding: 9%; background: var(--nf-paper) repeating-linear-gradient(135deg, var(--nf-hatch) 0 1px, transparent 1px 8px); }
.nofile .sleeve { display: grid; place-items: center; border: 1.5px dashed var(--nf-edge); border-radius: 5px; background: var(--nf-window); color: var(--nf-ink); }
.nofile .sleeve .i { width: 30%; height: auto; max-width: 40px; min-width: 14px; aspect-ratio: 1; stroke-width: 1.5; }
.namecell .mini .nofile, .filmstrip .nofile { padding: 4px; }
.namecell .mini .nofile .sleeve, .filmstrip .nofile .sleeve { border-width: 1px; border-radius: 3px; }
.namecell .mini .nofile .sleeve .i, .filmstrip .nofile .sleeve .i { width: 16px; }
.filmstrip a { position: relative; }
.nofile.lg { position: relative; inset: auto; width: min(340px, 70vw); aspect-ratio: 4 / 3; padding: 22px; border-radius: 14px; }
.nofile.lg .sleeve { border-width: 2px; border-radius: 8px; }
.nofile.lg .sleeve .i { width: 56px; max-width: none; stroke-width: 1.25; }
.stage .nofile, .filmstrip .nofile, .edit-preview .frame .nofile { --nf-paper: #171C1F; --nf-window: #1D2326; --nf-edge: rgba(255, 255, 255, .24); --nf-hatch: rgba(255, 255, 255, .05); --nf-ink: #A7B0B5; }
.edit-preview .frame .nofile.lg { width: 72%; }
.stage .nofile-stage { gap: 14px; padding: 24px 16px; }
.stage .nofile-stage h2 { margin-top: 6px; }
.stage .nofile-stage p { max-width: 34ch; }

/* The "No file" marker: a quiet pill, explained on hover and focus like the original-missing mark. */
.om.nf { width: auto; height: 22px; gap: 4px; padding: 0 9px; border-radius: 11px; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); font-size: .875rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.thumb .om.nf { left: auto; right: 8px; width: auto; height: 24px; background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line-strong); }
.thumb .om.nf .om-tip { left: auto; right: 0; }
.vinfo .om.nf { margin-left: 0; }
button.om.nf:hover { background: var(--surface-3); color: var(--ink); }
button.om:focus .om-tip { opacity: 1; visibility: visible; } /* a tap on a phone shows it too */

/* The request for the file on the item page (Karol 2026-10-10), for those who may edit and add
   files: one quiet line under the viewer's bar, never over the picture; its own grid row, so it
   is there from the first paint (no shift). */
.viewer.with-ombar { grid-template-rows: 64px auto minmax(0, 1fr); }
.ombar { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 7px max(16px, env(safe-area-inset-right)) 7px max(16px, env(safe-area-inset-left));
  background: #151A1D; color: #C9D0D3; border-top: 1px solid rgba(255, 255, 255, .06); border-bottom: 1px solid rgba(255, 255, 255, .06); font-size: .90625rem; line-height: 1.35; }
.ombar > .i { flex: none; width: 18px; height: 18px; color: #E8C27A; }
.ombar p { flex: 1; min-width: 0; margin: 0; }
.ombar .ask { margin-left: .25em; color: #F2F4F5; font-weight: 700; }
.ombar .btn { flex: none; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .24); color: #F2F4F5; }
.ombar .btn:hover { background: rgba(255, 255, 255, .16); }
.ombar .btn:focus-visible { outline: 2px solid #F2F4F5; outline-offset: 2px; }
@media (max-width: 860px) {
  .viewer.with-ombar { grid-template-rows: 56px auto auto auto; }
  .ombar { flex-wrap: wrap; row-gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .ombar p { flex-basis: calc(100% - 28px); }
  .ombar .btn { margin-left: 28px; }
}
@media (forced-colors: active) { .nofile .sleeve { border-color: CanvasText; } .om.nf { border: 1px solid CanvasText; } .ombar { border-bottom: 1px solid CanvasText; } }

/* The small "i" next to a role or a switch (Karol 2026-10-11, docs/phases/people-and-joining.md):
   a 22 px ring with an italic serif "i" (44 px to touch), and a popover placed by archive.js with
   position: fixed, so no table or panel clips it and nothing around it moves. */
.why { position: relative; display: inline-flex; flex: none; vertical-align: middle; }
.why-btn { position: relative; display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%;
  background: var(--surface); color: var(--ink-2); font: italic 600 .875rem/1 var(--serif); cursor: help; touch-action: manipulation; transition: background-color .15s, border-color .15s, color .15s; }
.why-btn::before { content: ""; position: absolute; inset: -11px; border-radius: 50%; } /* a 44 px target, drawn 22 px */
.why-btn:hover, .why-btn[aria-expanded="true"] { background: var(--soft-2); border-color: var(--accent); color: var(--ink); }
.why-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.why-pop { position: fixed; z-index: 60; top: 0; left: 0; width: max-content; max-width: min(320px, calc(100vw - 24px)); padding: 12px 14px 13px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); font: 400 .875rem/1.45 var(--font); text-align: left; white-space: normal; letter-spacing: 0; text-transform: none; }
.why-pop:not([hidden]) { display: grid; gap: 8px; }
.why-pop::before { content: ""; position: absolute; left: var(--why-arrow, 18px); width: 10px; height: 10px; background: var(--surface); border: 1px solid var(--line); transform: rotate(45deg); }
.why-pop[data-side="below"]::before { top: -6px; border-right: 0; border-bottom: 0; }
.why-pop[data-side="above"]::before { bottom: -6px; border-left: 0; border-top: 0; }
.why-title { display: block; font: 600 1rem/1.2 var(--serif); }
.why-list { display: grid; gap: 4px; }
.why-head { display: block; font: 700 .875rem/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 1px; }
.why-li { position: relative; display: block; padding-left: 20px; color: var(--ink-2); }
.why-li::before { position: absolute; left: 0; top: 0; width: 14px; text-align: center; font-weight: 700; }
.why-li.ok::before { content: "✓"; color: var(--ok); }
.why-li.no::before { content: "–"; color: var(--muted); }
.why-note { display: block; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
@media (prefers-reduced-motion: no-preference) { .why-pop:not([hidden]) { animation: why-in .12s ease-out; } }
@keyframes why-in { from { opacity: 0; transform: translateY(var(--why-from, 3px)); } }
@media (forced-colors: active) { .why-btn, .why-pop, .why-pop::before { border-color: CanvasText; } }
/* Next to a switch: the label keeps its width, the "i" sits at the end of its first line. */
.with-why { display: flex; align-items: flex-start; gap: 10px; }
.with-why > .switch, .with-why > label { flex: 1; min-width: 0; }
.with-why > .why { margin-top: 2px; }
/* On a role card: in the top right corner, the card's words keep clear of it. */
.radiocard-wrap { position: relative; display: grid; }
.radiocard-wrap > .radiocard { padding-right: 46px; }
/* Administrator until the password is typed (P2): the card says so and links to it. */
.radiocard.locked { cursor: default; background: var(--surface-2); }
.radiocard.locked .linkbtn { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-weight: 600; }
.radiocard-wrap > .why { position: absolute; top: 12px; right: 12px; }
.with-why:has(> .cat-all) { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.with-why > .cat-all { border-bottom: 0; padding-bottom: 0; }
.cat-choose > .with-why { margin-top: 8px; }
.cat-choose > .with-why > .hint { margin: 0; }

/* Asking to join (docs/phases/people-and-joining.md): the one switch as a bar above the requests,
   and the form's settings: each "Who are you?" choice is a numbered card that folds to one line. */
.joinbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 18px; }
.joinbar-form { flex: 1 1 360px; min-width: 0; }
.joinbar > .muted { margin: 0; }
.joining { display: grid; gap: 20px; }
.joining .usual > div { display: grid; gap: 8px; justify-items: start; }
.join-choices { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: none; }
.choice { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.choice--new { border-style: dashed; border-color: var(--line-strong); background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.choice-set { border: 0; margin: 0; padding: 14px 16px; min-width: 0; display: grid; gap: 12px; }
.choice-head { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.choice-n { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 6px; border-radius: 50%; background: var(--soft-2); color: var(--ink); font: 600 .9375rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.choice--new .choice-n { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); font-family: var(--font); }
.choice-head .field { margin: 0; }
.choice-remove { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; color: var(--ink-2); font-size: .90625rem; cursor: pointer; }
.choice-remove input { width: 18px; height: 18px; accent-color: var(--danger); }
.choice:has(.choice-remove input:checked) { opacity: .6; }
.choice:has(.choice-remove input:checked) .choice-head .input { text-decoration: line-through; }
.choice-gives > summary { cursor: pointer; padding: 6px 0 2px 44px; color: var(--ink-2); font-size: .90625rem; list-style-position: inside; }
.choice-gives > summary b { color: var(--ink); }
.choice-gives[open] > summary { margin-bottom: 12px; }
.choice-body { display: grid; gap: 14px; padding-left: 44px; }
.choice-body .radiocards.cols3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.textarea.mono { font-family: var(--mono); font-size: .90625rem; }
.prefill { margin: 0; font-size: .90625rem; }
@media (max-width: 760px) {
  .choice-head { grid-template-columns: minmax(0, 1fr) auto; }
  .choice-n { display: none; }
  .choice-gives > summary, .choice-body { padding-left: 0; }
  .choice-body .radiocards.cols3 { grid-template-columns: 1fr; }
}

/* Emails (People › Emails; docs/phases/archive-emails.md): a list of the archive's emails with the
   look they share, and an editor: the words and the placeholders on the left, the email itself on
   the right in a frame like a mail app's reading pane (sticky while the words scroll). */
.mail-index { display: grid; gap: 22px; }
.look-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.look-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.look-card__text b { display: block; font: 600 1.125rem/1.25 var(--serif); }
.look-card__text > span { display: block; color: var(--muted); font-size: .875rem; margin-top: 2px; }
.look-swatch { display: grid; grid-template-rows: 22px 2px 1fr; width: 76px; height: 62px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.look-swatch__head { background: #0A161D; }
.look-swatch__rule { background: #C9A96E; }
.look-swatch__body { display: grid; align-content: center; gap: 4px; padding: 5px 9px; }
.look-swatch__body > span { display: block; height: 3px; border-radius: 2px; background: #d9dcd6; }
.look-swatch__body > span:nth-child(2) { width: 70%; }
.look-swatch__body > .look-swatch__btn { width: 26px; height: 7px; border-radius: 4px; background: #C9A96E; }
/* The picture at the top of the emails (E11–E14): each choice shows a small email top in the look's colours. */
.look-top { display: grid; gap: 16px; }
.look-picks { grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 8px; }
.look-pick { padding: 10px; gap: 10px; touch-action: manipulation; }
.look-pick input { margin-top: 2px; }
.radiocard .look-pick__body { display: grid; gap: 3px; min-width: 0; margin: 0; color: var(--ink); flex: 1; }
.radiocard .look-pick__body > b { margin-top: 7px; font-size: .90625rem; line-height: 1.3; }
.radiocard .look-pick__note { font-size: .875rem; line-height: 1.4; text-wrap: pretty; overflow-wrap: anywhere; }
.radiocard .look-thumb, .look-thumb { display: grid; place-items: center; align-content: center; gap: 3px; height: 56px; margin: 0; padding: 7px 10px; border-radius: 7px; border-top: 3px solid var(--look-accent, #c9a96e); background: var(--look-header, #0a161d); box-shadow: inset 0 0 0 1px rgb(0 0 0 / 8%); overflow: hidden; }
.radiocard .look-thumb span, .look-thumb span { margin: 0; color: inherit; font-size: inherit; }
.look-thumb img { display: block; max-width: 100%; max-height: 30px; width: auto; height: auto; object-fit: contain; }
.radiocard .look-thumb__pic, .look-thumb__pic { display: grid; place-items: center; max-width: 100%; min-width: 0; }
.radiocard .look-thumb__pic.is-card, .look-thumb__pic.is-card { padding: 4px 7px; border-radius: 5px; background: #fff; }
.look-thumb__pic.is-card img { max-height: 24px; }
.look-thumb img.look-thumb__crest { max-height: 24px; }
.radiocard .look-thumb .look-thumb__name, .look-thumb__name { max-width: 100%; color: var(--look-ink, #f2eee6); font: 400 .875rem/1.15 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radiocard .look-thumb .look-thumb__name.is-large, .look-thumb__name.is-large { font-size: 1.0625rem; }
.radiocard .look-thumb .look-thumb__add, .look-thumb__add { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--look-ink, #f2eee6) 70%, transparent); color: var(--look-ink, #f2eee6); }
.look-thumb__add .spinner { color: var(--look-ink, #f2eee6); }
.look-own { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.look-top:not(:has(input[value="own"]:checked)) .look-own { display: none; }
.look-own__pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.look-own__pick input[type=file] { max-width: 100%; font-size: .875rem; }
.look-own__wait { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--ink-2); font-size: .875rem; }
.look-own__wait .spinner { color: var(--accent); }
.look-own .switch .txt span { line-height: 1.45; text-wrap: pretty; }
.look-proof { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.look-proof__tile { display: grid; gap: 6px; margin: 0; min-width: 0; }
.look-proof__tile .look-thumb.is-proof { height: 84px; }
.look-proof__tile .look-thumb.is-proof img { max-height: 52px; }
.look-proof__tile .look-thumb__pic.is-card img { max-height: 42px; }
.look-proof__tile figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .875rem; color: var(--muted); }
.look-proof__tile figcaption .pill { font-size: .875rem; }
.look-proof__tile.is-on .look-thumb { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px var(--accent); }
.look-size { display: grid; gap: 6px; justify-items: start; }
.look-size .label { font-weight: 600; font-size: .90625rem; }
.look-top:has(.look-picks input[value="crest"]:checked, .look-picks input[value="name"]:checked) .look-size { display: none; }
.look-seg__opt { position: relative; display: inline-flex; touch-action: manipulation; }
.look-seg__opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.look-seg__opt span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: .875rem; }
.look-seg__opt:has(input:checked) span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.look-seg__opt:has(input:focus-visible) span { outline: 2px solid var(--focus); outline-offset: 1px; }
.look-seg__opt:has(input:disabled) { opacity: .55; }
@media (max-width: 400px) { .look-proof { grid-template-columns: 1fr; } }
.mail-group h2 { font: 600 .875rem/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.mail-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.mail-list li + li { border-top: 1px solid var(--line); }
.mail-list a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; min-height: 64px; padding: 12px 16px; color: var(--ink); text-decoration: none; }
.mail-list a:hover { background: var(--surface-2); }
.mail-list a > .i:first-child { color: var(--muted); }
.mail-list__text b { display: block; font-weight: 700; }
.mail-list__text span { display: block; color: var(--muted); font-size: .875rem; }
.mail-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 640px); gap: 24px 28px; align-items: start; }
.mail-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.mail-form:has(> .ph-box:not(.compact)) { grid-template-columns: minmax(0, 1fr) 220px; }
.mail-form > .fieldset, .mail-form > .callout, .mail-form > .savebar { grid-column: 1; }
.mail-form > .savebar { grid-column: 1 / -1; }
.mail-form > .ph-box { grid-column: 2; grid-row: 1 / span 3; position: sticky; top: 12px; }
.mail-form > .ph-box.compact { grid-column: 1; grid-row: auto; position: static; }
.ph-box.compact .ph-list { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 16px; }
.mail-form .was { font-size: .875rem; color: var(--muted); }
.mail-form .was summary { cursor: pointer; width: fit-content; }
.mail-form .was p { margin: 4px 0 0; padding: 8px 10px; border-left: 3px solid var(--line-strong); background: var(--surface-2); border-radius: 0 6px 6px 0; white-space: pre-line; }
.ph-box { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; background: var(--surface); display: grid; gap: 8px; }
.ph-box h2 { font: 600 1rem/1.2 var(--serif); }
.ph-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ph-list li { display: grid; gap: 2px; font-size: .875rem; color: var(--ink-2); }
.ph-chip { justify-self: start; min-height: 32px; padding: 3px 10px; border: 1px dashed color-mix(in srgb, var(--accent) 60%, var(--line-strong)); border-radius: 6px; background: var(--soft); color: var(--ink); font: 600 .875rem/1.2 var(--mono); cursor: copy; touch-action: manipulation; }
.ph-chip:hover { background: var(--soft-2); border-style: solid; }
.ph-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ph-list .req { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 4px; background: var(--warn-soft); color: var(--warn); font-size: .875rem; }
.mail-preview { position: sticky; top: 12px; display: grid; gap: 10px; min-width: 0; }
.mail-preview__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mail-preview__bar h2 { font: 600 1.1875rem/1.2 var(--serif); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-3); }
.seg__btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: .875rem; touch-action: manipulation; }
.seg__btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg__btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.mail-meta { margin: 0; display: grid; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; border-bottom: 0; background: var(--surface); font-size: .875rem; }
.mail-meta div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; }
.mail-meta dt { color: var(--muted); }
.mail-meta dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.mail-meta + .mail-preview__status:empty { display: none; }
.mail-preview__status { margin: 0; font-size: .875rem; color: var(--muted); }
.mail-preview__status.bad { color: var(--danger); font-weight: 600; }
.mail-frame { margin-top: -10px; border: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); background: #EDEDE7; overflow: hidden; display: grid; justify-items: center; transition: background-color .15s; }
.mail-frame iframe { display: block; width: 100%; height: 560px; border: 0; background: #EDEDE7; transition: width .2s ease; }
.mail-frame.phone { padding: 16px 0; background: var(--surface-3); }
.mail-frame.phone iframe { width: 375px; max-width: 100%; border-radius: 18px; box-shadow: 0 0 0 8px #1b1f22, var(--shadow-2); }
.mail-text summary { cursor: pointer; font-weight: 600; font-size: .875rem; }
.mail-text pre { margin: 8px 0 0; padding: 12px; max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font: .875rem/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.mail-versions { grid-column: 1; display: grid; gap: 10px; justify-items: start; }
.mail-versions h2 { font: 600 1.1875rem/1.2 var(--serif); }
.version-list { list-style: none; margin: 0; padding: 0; width: 100%; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.version-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: .875rem; }
.version-list li + li { border-top: 1px solid var(--line); }
.colour-field { display: inline-flex; align-items: center; gap: 10px; }
.colour-field input[type=color] { width: 52px; height: 40px; padding: 2px; border: 1px solid var(--field-line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .mail-frame iframe { transition: none; } }
@media (max-width: 1180px) {
  .mail-editor { grid-template-columns: minmax(0, 1fr); }
  .mail-preview { position: static; }
  .mail-versions { grid-column: auto; }
}
@media (max-width: 760px) {
  .mail-form { grid-template-columns: minmax(0, 1fr); }
  .mail-form > .ph-box { grid-column: 1; grid-row: auto; position: static; }
  .look-card, .mail-list a { grid-template-columns: auto minmax(0, 1fr) auto; }
  .look-card > .pill, .mail-list a > .pill { grid-column: 2; grid-row: 2; justify-self: start; }
}
/* The panel's email editor: the emails as a list on the left. */
.mail-panel { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.mail-nav { position: sticky; top: 12px; display: grid; gap: 2px; }
.mail-nav__group { margin: 12px 0 4px 10px; font: 700 .875rem/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.mail-nav__item { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); text-align: left; }
.mail-nav__item .i { margin-top: 2px; flex: none; color: var(--muted); }
.mail-nav__item b { display: block; font-weight: 600; color: var(--ink); }
.mail-nav__item span span { display: block; font-size: .875rem; color: var(--muted); }
.mail-nav__item:hover { background: var(--surface-2); }
.mail-nav__item[aria-current="page"] { background: var(--soft-2); }
.mail-nav__item:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.mail-main { display: grid; gap: 16px; min-width: 0; }
.mail-main__head h2 { font: 500 1.5rem/1.2 var(--serif); }
.mail-main .mail-editor { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1280px) { .mail-main .mail-editor { grid-template-columns: minmax(0, 1fr) minmax(340px, 500px); } }
@media (max-width: 900px) { .mail-panel { grid-template-columns: minmax(0, 1fr); } .mail-nav { position: static; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } .mail-nav__group { grid-column: 1 / -1; } }
.mail-preview-wrap { display: grid; gap: 12px; min-width: 0; align-content: start; }
.mail-preview-wrap .mail-preview { position: static; }
.art-mail { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--soft); color: var(--accent); }

/* Captions over several lines (Stewart 2026-10-11): the box wraps and grows as you type; the item page keeps the lines. */
.textarea.caption-field { min-height: 0; resize: vertical; field-sizing: content; overflow-wrap: anywhere; }
.caption-lines { white-space: pre-line; }

/* Back above the subcategories (Stewart 2026-10-11). */
.backlink { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 7px 12px 7px 8px; min-height: 36px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink); font-size: .875rem; font-weight: 600; text-decoration: none; max-width: 100%; }
.backlink span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backlink:hover { background: var(--hover, rgb(127 127 127 / 10%)); }
.backlink:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* The category editor beside a long list (Karol 2026-10-11): never taller than the screen, its own
   scroll, so its lower part (Save, delete) is there without scrolling through the whole list. */
.split > .sidecard { max-height: calc(100dvh - var(--top) - 32px); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
@media (max-width: 1100px) { .split > .sidecard { position: static; max-height: none; overflow: visible; } }

/* Films fill the stage, keeping their shape (Stewart 2026-10-11: a 640 × 480 film stayed small in the middle). */
.stage video.vmedia.fill { aspect-ratio: var(--ar); height: auto; width: min(100%, calc((100dvh - 64px - 40px) * var(--ar))); max-height: none; }
.stage.with-strip video.vmedia.fill { width: min(100%, calc((100dvh - 64px - 120px) * var(--ar))); }
@media (max-width: 860px) { .stage video.vmedia.fill { width: min(100%, calc(60vh * var(--ar))); } }

/* "Rotate left / right" of a photo (Karol 2026-10-11): two buttons; the old picture dimmed with
   "Turning the photo…" over it until the new previews are ready. */
.rotate-tools { display: flex; align-items: center; gap: 2px; }
.rotate-tools form { display: contents; }
.edit-preview .rotate-tools { gap: 8px; flex-wrap: wrap; }
.i.flip { transform: scaleX(-1); }
.turning { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; background: rgba(14, 17, 19, .86); color: #F2F4F5; font-size: .9375rem; white-space: nowrap; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); pointer-events: none; z-index: 1; }
.stage:has(> .turning) > picture img, .frame:has(> .turning) > picture img { opacity: .5; transition: opacity .3s; }

/* The Bin (Stewart via Karol 2026-10-14): a small form folded under its own button (Empty the bin with the
   short name typed; Restore into a category when the item's was deleted). Works without JavaScript. */
.rowpop > summary { list-style: none; cursor: pointer; }
.rowpop > summary::-webkit-details-marker { display: none; }
.rowpop[open] > summary { background: var(--surface-2); }
.rowpop .pop { display: grid; gap: 8px; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-align: left; white-space: normal; width: min(360px, 100%); }
.rowpop .pop label, .rowpop .pop b { font-weight: 700; font-size: .90625rem; color: var(--ink); }
.rowpop .pop p { font-size: .875rem; }
.rowpop .pop .error { font-size: 1rem; color: var(--danger); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.rowpop .pop .btn { justify-self: start; }
.table td.actions .rowpop .pop { margin-left: auto; width: 320px; max-width: calc(100vw - 48px); }
.pagehead .emptybin { position: relative; }
.pagehead .emptybin .pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 6; width: min(380px, calc(100vw - 32px)); box-shadow: var(--shadow-2); }
.pill.emptying .i { animation: bin-spin 1.2s linear infinite; }
@keyframes bin-spin { to { transform: rotate(360deg); } }
@media (max-width: 860px) { .pagehead .emptybin .pop { position: static; width: 100%; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .pill.emptying .i { animation: none; } }

/* OneLegacy marketing on an item page, for operators inside the archive (docs/phases/growth-brochures.md B48). */
/* OneLegacy marketing: a small folded button at the foot of an item page (B51). */
.mkt { align-self: start; border: 1px solid var(--line); border-radius: var(--r, 8px); font-size: .875rem; }
.mkt > summary { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 40px; padding: 6px 10px; font-size: .875rem; white-space: nowrap; cursor: pointer; list-style: none; color: var(--muted); font-weight: 600; }
.mkt > summary::-webkit-details-marker { display: none; }
.mkt > summary::after { content: ""; width: 7px; height: 7px; margin-left: auto; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.mkt[open] > summary::after { transform: rotate(-135deg); }
.mkt-state { font-weight: 400; font-size: .875rem; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.mkt-body { display: grid; gap: 10px; padding: 4px 12px 12px; }
.mkt-on { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: .875rem; }
.mkt-form { display: grid; gap: 10px; }
.mkt-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mkt-check { display: flex; gap: 8px; align-items: flex-start; font-size: .875rem; }
.mkt-check input { margin: 3px 0 0; width: 18px; height: 18px; flex: none; }
@media (max-width: 480px) { .mkt-dates { grid-template-columns: 1fr; } }

/* A panel's buttons (a person's Signing in): side by side with room between them, wrapping on a phone. */
.panel > .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.panel > .actions > form { display: contents; }

/* Full copy in parts on Overview (docs/phases/delete-archive.md E13): one button per ZIP, part 1 first. */
.full-copy .copy-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.full-copy .copy-parts li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }

/* "About this year (not sure)" under the year on the edit page (docs/phases/mobile-app.md MS-1b G-G). */
.year-about { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.95em; cursor: pointer; }
.year-about input { width: 18px; height: 18px; margin: 0; }

/* "Leave this archive" on My account (docs/phases/mobile-app.md MS-3). */
.leave-files { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.leave-files legend { font-weight: 600; margin-bottom: 6px; }
.leave-files label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* Favourites (round 2 A5): the heart on an item's page, filled in the archive's accent when on. */
.fav-btn[aria-pressed="true"] { color: var(--accent); }
.fav-btn[aria-pressed="true"] .i { fill: currentColor; }

/* Touch screens (audit W-6, Karol 2026-10-30): 44 px for small buttons, the ticks, "⋯" and a tag's ✕. */
@media (pointer: coarse) {
  .btn.sm { min-height: 44px; }
  .iconbtn { width: 44px; height: 44px; }
  .card .check { width: 44px; height: 44px; top: 6px; left: 6px; }
  .card .check input { width: 22px; height: 22px; }
  .card .more { width: 44px; height: 44px; top: 6px; right: 6px; }
  .tagchip button { position: relative; }
  .tagchip button::after { content: ""; position: absolute; inset: -12px; } /* 44 px to press, the chip stays 28 px */
  .table td.check input { width: 22px; height: 22px; }
}

/* Hits above the search's files: objects of the Collection, people of the family tree (audit X-2); was archive-collection.css. */
.search-objects { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-bottom: 8px; }
.sobj { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r); background: var(--surface-2); color: inherit; text-decoration: none; }
.sobj:hover { background: var(--surface-3); }
.sobj .mini { width: 56px; height: 42px; flex: none; border-radius: 6px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); position: relative; }
.sobj .mini img { width: 100%; height: 100%; object-fit: cover; }
.sobj .t { display: grid; gap: 3px; min-width: 0; }
.sobj .t b { font-size: .90625rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sobj .sub { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--muted); }
.sobj .catno { font-size: .875rem; padding: 3px 6px 3px 5px; }

/* "More (optional)" on Add files (audit Q9): the tags, folded away. */
.more-opt > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-weight: 700; color: var(--accent); }
.more-opt[open] > summary { margin-bottom: 8px; }

/* Lines of at most 68 characters (audit W-11): ledes, the paragraphs of a form's sections, hints, callouts. */
.lede, .fieldset > p, .fieldset .hint, .legend-sub, .callout, .help .help-body p { max-width: 68ch; }
/* A short window (or 200 % zoom): the heads scroll away instead of taking half the height (W-11). */
@media (max-height: 700px) {
  .sticky-head, .pagehead, .filterbar, .selbar, .viewer .vbar { position: static; }
}



/* Memories and "Connected with" ("+ Add" v2, openapi 1.21–1.22; mobile-design's web §1): kept at the end of the file (hotfix's merges). */
.memories-block { display: grid; gap: 10px; }
.memories-h { font-family: var(--serif, inherit); font-size: 1.375rem; font-weight: 500; margin: 0; }
.memories { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.memory { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 72px; padding: 10px 16px 10px 10px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.memory.playing { background: var(--soft); border-color: var(--accent); }
.memory-play { width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: #fff; cursor: pointer; }
.memory-play:disabled { opacity: .45; cursor: default; }
.memory-play .pause, .memory.playing .memory-play .play { display: none; }
.memory.playing .memory-play .pause { display: block; }
.memory-text { display: grid; gap: 2px; min-width: 0; }
.memory-t { font-weight: 700; color: inherit; text-decoration: none; }
.memory-t:hover { text-decoration: underline; }
.memory-sub { color: var(--muted); font-size: .875rem; }
.memory-seek { display: none; align-items: center; gap: 10px; margin-top: 6px; }
.memory.started .memory-seek { display: flex; }
.memory-seek input { flex: 1; min-width: 0; accent-color: var(--accent); }
.memory-now { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.memory.started .memory-len { visibility: hidden; }
.memory-len { color: var(--muted); font-size: .875rem; }
.memories-app { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .875rem; margin: 0; }
.memories-block.compact { background: var(--surface-2); border-radius: var(--r); padding: 12px; }
.memories-block.compact .memory { min-height: 0; grid-template-columns: auto minmax(0, 1fr); padding: 8px; }
.memories-block.compact .memory-play { width: 44px; height: 44px; }
@media (max-width: 600px) {
  .memory { grid-template-columns: auto minmax(0, 1fr); }
  .memory-play { width: 48px; height: 48px; }
  .memory-len { display: none; }
}
.connected { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.connected-names { display: grid; gap: 4px; }
.added-in-app { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .875rem; margin: 10px 0 0; }
/* "Change what you added" (an object, + Add v2 web §5) */
.ch-photos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.ch-photos > li { width: 160px; display: grid; gap: 6px; }
.ch-photos.pick > li { width: 120px; }
.ch-pic { display: block; border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-2); }
.ch-pic img { width: 100%; height: 100%; object-fit: cover; }
.ch-acts { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.ch-pick { display: grid; gap: 4px; cursor: pointer; }
.ch-add { margin-top: 12px; }
.ch-chosen { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.ch-find { display: flex; gap: 8px; }
.ch-find .input { flex: 1; min-width: 0; }
.memories-rule { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.ev-memories { max-width: 760px; margin: 18px 0; }
/* A recording's "About this …" card (+ Add v2 web §2) */
.about-card { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); text-decoration: none; margin-bottom: 16px; max-width: min(520px, 100%); box-sizing: border-box; justify-self: start; min-width: 0; }
/* On the viewer's dark audio stage the card keeps the page's ink (the stage's light text was unreadable on it). */
.about-card:hover { border-color: var(--accent); }
.about-pic { width: 96px; height: 72px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--soft-2, var(--surface-2)); flex: none; }
.about-pic img { width: 100%; height: 100%; object-fit: cover; }
.about-t { display: grid; gap: 2px; min-width: 0; justify-items: start; overflow-wrap: anywhere; }
/* A narrow phone gives the words the room (the number cannot wrap); the memories rows hide their picture there too (§1). */
@media (max-width: 480px) { .about-pic { display: none; } }
.about-t .eyebrow { font-size: .875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.memory-mono { display: grid; place-items: center; width: 100%; height: 100%; background: var(--soft-2, var(--soft)); font-family: var(--serif, inherit); font-size: 2.125rem; color: var(--accent); }

/* ================= The web menu (audit W-5; mobile-design's web-menu spec, Karol Q1–Q4, 2026-10-30) ================= */
/* ---- The sidebar: fixed places, one "To look at", the Bin ---- */
.nav a { min-height: 40px; padding-block: 6px; line-height: 1.25; }
.nav a > span:not(.badge):not(.count) { min-width: 0; }
.nav a.look .badge { background: var(--accent); color: var(--accent-ink); }
.nav a.look .quiet { margin-left: auto; font-size: .875rem; color: var(--muted); font-weight: 500; }
.navlabel .linkbtn { text-transform: none; letter-spacing: 0; }

/* ---- "To look at": the page ---- */
.look-page { display: grid; gap: 28px; max-width: 860px; }
.look-sec { display: grid; gap: 10px; }
.look-sec > h2 { font: 600 1.25rem/1.2 var(--serif); }
.look-sec > p { color: var(--muted); font-size: .9375rem; margin-top: -4px; }
.look-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.look-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 6px 16px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: var(--r-lg); background: var(--surface); }
.look-row .disc { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent); }
.look-row .disc .i { width: 24px; height: 24px; }
.look-row.tidy .disc { background: var(--surface-2); color: var(--ink-2); }
.look-row h3 { font-size: 1.0625rem; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.look-row h3 .badge { background: var(--accent); color: var(--accent-ink); }
.look-row.tidy h3 .n { font-weight: 500; color: var(--muted); font-size: .9375rem; }
.look-row p { color: var(--ink-2); font-size: .9375rem; margin-top: 2px; }
.look-row .parts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; font-size: .9375rem; }
.look-row .parts a { font-weight: 600; }
.look-done { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--ok-soft); color: var(--ink); }
.look-done .i { color: var(--ok); width: 28px; height: 28px; flex: none; }
@media (max-width: 860px) { .look-row { grid-template-columns: 44px minmax(0, 1fr); } .look-row .btn { grid-column: 2; justify-self: start; } .look-row .disc { width: 44px; height: 44px; } }

/* ---- Day one ---- */
.tree-start { padding: 4px 14px 8px; font-size: .9375rem; color: var(--muted); display: grid; gap: 6px; justify-items: start; }

/* ---- Phone: the bottom bar and its two sheets ---- */
@media (max-width: 860px) {
  .menubtn { display: none !important; }
  .bottomnav.four { grid-template-columns: repeat(4, 1fr); }
  .bottomnav.two { grid-template-columns: repeat(2, 1fr); } /* a Genealogist's visit: Family · More */
  .bottomnav .bn-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
    font-size: .8125rem; font-weight: 700; display: grid; place-items: center; }
  .bottomnav > * { position: relative; }
  .bottomnav .i { width: 24px; height: 24px; }
  .sheet { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; overflow-y: auto; }
  .sheet-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 8px 10px 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .sheet-head h2 { font: 600 1.375rem/1.2 var(--serif); }
  .sheet-close { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border: 0; border-radius: 22px; background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: .9375rem; }
  .sheet-body { padding: 12px 12px 96px; display: grid; gap: 14px; }
  .sheet .grp { background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
  .sheet .grp-h { font: 700 .875rem/1 var(--font); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 0; }
  .sheet .row { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 16px; color: var(--ink); text-decoration: none; font-size: 1.0625rem; font-weight: 600; border-top: 1px solid var(--line); }
  .sheet .grp > .row:first-child { border-top: 0; }
  .sheet .row .i { color: var(--accent); width: 24px; height: 24px; flex: none; }
  .sheet .row .go { margin-left: auto; color: var(--muted); width: 18px; height: 18px; }
  .sheet .row .badge { margin-left: auto; }
  .sheet .row .badge + .go { margin-left: 4px; }
  .sheet .row.look { background: var(--soft); }
  .sheet .row small { display: block; font-size: .875rem; font-weight: 500; color: var(--muted); }
  .sheet .seg { margin-left: auto; display: inline-flex; border: 1px solid var(--field-line); border-radius: 20px; overflow: hidden; }
  .sheet .seg button { min-height: 40px; padding: 0 12px; border: 0; background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: .9375rem; }
  .sheet .seg button[aria-pressed="true"] { background: var(--soft-2); color: var(--ink); font-weight: 700; }
  .sheet .sw { margin-left: auto; width: 52px; height: 32px; border-radius: 16px; background: var(--line-strong); position: relative; flex: none; }
  .sheet .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); }
  .addsheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: var(--surface); border-radius: 20px 20px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-2); display: grid; gap: 12px; }
  .addsheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); justify-self: center; }
  .addsheet-head { display: flex; align-items: center; justify-content: space-between; }
  .addsheet-head h2 { font: 600 1.375rem/1.2 var(--serif); }
  .tiles2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .addsheet .tile { display: grid; gap: 8px; align-content: start; min-height: 108px; padding: 14px; border-radius: var(--r-lg); background: var(--surface-2); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1rem; line-height: 1.25; }
  .addsheet .tile .i { width: 28px; height: 28px; color: var(--accent); }
  .addsheet .tile small { font-weight: 500; color: var(--muted); font-size: .875rem; }
  .addsheet .tile.wide { grid-column: 1 / -1; min-height: 0; grid-template-columns: 28px 1fr; align-items: center; }
}

/* What the mock-ups leave to the build: the Night mode tick, the switch when on, sheets that obey [hidden], the page
   behind a sheet that does not scroll, and the phone's Categories screen (the sidebar, full width, with Back). */
.menu [role="menuitemcheckbox"] .tick { margin-left: auto; color: var(--accent); }
.menu [role="menuitemcheckbox"][aria-checked="false"] .tick { visibility: hidden; }
.side-head { display: none; }
@media (max-width: 860px) {
  .sidebar .hide-phone { display: none !important; }
  .sidebar { width: 100%; box-shadow: none; padding-top: 0; }
  .side-head { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 1; margin: 0 calc(-1 * var(--s3)); padding: 10px var(--s3); background: var(--bg); border-bottom: 1px solid var(--line); }
  .side-head h2 { font: 600 1.375rem/1.2 var(--serif); }
  .sheet[hidden], .addsheet[hidden], .sheet-scrim[hidden] { display: none; }
  body.sheet-open { overflow: hidden; }
  .sheet-scrim { position: fixed; inset: 0; z-index: 75; background: var(--scrim); }
  .sheet button.row { width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: none; font: inherit; font-size: 1.0625rem; font-weight: 600; text-align: left; cursor: pointer; }
  .sheet form { margin: 0; }
  .sheet [role="switch"][aria-checked="true"] .sw { background: var(--accent); }
  .sheet [role="switch"][aria-checked="true"] .sw::after { left: 23px; }
  .sheet .row span:not(.badge):not(.seg):not(.sw) { min-width: 0; }
  .sheet .row[role="group"] { flex-wrap: wrap; }
  .sheet .seg { flex-wrap: nowrap; }
  .sheet-head h2:focus, .addsheet-head h2:focus { outline: none; }
}
@media (min-width: 861px) { .sheet, .addsheet, .sheet-scrim { display: none !important; } }

/* A memory's Delete (round 4 #12): a quiet text button under its line, as the app does at large text sizes. */
.memory-del { margin: 4px 0 0; }
.memory-del .btn { min-height: 36px; padding-inline: 8px; margin-inline-start: -8px; }
.memory-about { font-size: .875rem; font-weight: 400; }
/* The voice-note badge (round 4 #12): a dark disc at the bottom right of a tile (the top right is the card's "More"), opposite
   the type pill; a small microphone after a row's name. */
.voicebadge { position: absolute; bottom: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(12, 16, 18, .72); color: #fff; pointer-events: none; }
.voicebadge .i { width: 16px; height: 16px; }
.voicemark { display: inline-flex; color: var(--muted); margin-inline-start: 6px; vertical-align: middle; }
.memories-more { margin: 16px 0 0; }
.grid.selecting .voicebadge { display: none; }
.table .namecell .memory-about a { font-weight: 400; color: var(--accent); text-decoration: underline; }
.namecell .mini .mini-mic { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted); }

/* Manage › Timeline (round 4 #35): the whole tree on the page, not a scrolling box. */
.timeline-cats .cat-tree { max-height: none; overflow: visible; }

/* #97 part 3 (web-heritage spec §5.6g): My account's "You in the family tree" row */
.me-you-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 4px; color: var(--ink); text-decoration: none; border-radius: 10px; }
.me-you-row .lbl { font-weight: 600; }
.me-you-row .val { margin-left: auto; color: var(--muted); text-align: right; overflow-wrap: anywhere; }
a.me-you-row:hover { background: var(--soft, rgba(0, 0, 0, .04)); }
a.me-you-row .i { flex: none; color: var(--accent); }
