/* Tunestead app — shared stylesheet for every server-rendered page.
   Tokens: site/index.html :root (2026-08-24 approved design), mirrored in
   docs/design-handoff-2026-09-03/designs/tunestead-theme.css. Components follow
   the handoff README's "Components (specs, not code)" section.
   No inline styles anywhere: the CSP is style-src 'self'. */

/* ---------- tokens ---------- */
:root {
  --ground: #0B0908;
  --page: #0D0B0A;
  --card: #141412;
  --hover: #1C1B18;
  --line: #2A2A26;
  --edge: #322B24;
  --dial: #423F38;
  --field-line: #6A6459;
  --ink: #F2EDE6;
  --body-ink: #E4DED5;
  --muted: #A2988B;
  --signal: #FF6A00;
  --signal-bright: #FF8A2B;
  --signal-soft: rgba(255, 106, 0, 0.13);
  --signal-edge: rgba(255, 106, 0, 0.35);
  --glow: rgba(255, 106, 0, 0.32);
  --tag-ink: #FFD3B0;
  --ok: #9FD58B;
  --warn: #E8C46A;
  --err: #E08F8F;
  --info: #8FB6E0;
  --display: 'Bricolage Grotesque', 'Arial Black', sans-serif;
  --body: 'Source Serif 4', Georgia, serif;
  --mono: 'Spline Sans Mono', 'Courier New', monospace;
  --r-control: 8px;
  --r-card: 10px;
  --r-chip: 6px;
  --dur: 140ms;
}

/* ---------- base ---------- */
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  min-height: 100svh;
}
::selection { background: var(--signal); color: var(--ground); }
a { color: var(--signal-bright); text-decoration: none; }
a:hover { color: var(--signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code, kbd, .mono { font-family: var(--mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.svg-defs { position: absolute; width: 0; height: 0; }

/* ---------- type helpers ---------- */
.mono-label {
  font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.13em; text-transform: uppercase;
}
.mono-note {
  font-family: var(--mono); font-size: 0.8rem;
  letter-spacing: 0.01em; line-height: 1.6; color: var(--muted);
}
.field-label {
  font-family: var(--mono); font-size: 0.85rem;
  letter-spacing: 0.02em; color: var(--muted);
}
.lit { color: var(--signal-bright); }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.err { color: var(--err); }
.info { color: var(--info); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hash { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); overflow-wrap: anywhere; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- page column ---------- */
.page {
  position: relative;
  width: min(66rem, 100% - 3rem);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 3.6vw, 3.5rem) 4rem;
  background: var(--page);
  border-left: 1px solid var(--edge);
  border-right: 1px solid var(--edge);
  min-height: 100svh;
}
.page.wide { width: min(80rem, 100% - 3rem); }
.page.narrow { width: min(56rem, 100% - 3rem); }
.atmosphere {
  position: absolute; top: 0; left: 0; right: 0; height: 40rem;
  pointer-events: none; z-index: 0;
  background: radial-gradient(50rem 26rem at 78% -6rem, var(--signal-soft), transparent 65%);
}
.page > *:not(.atmosphere) { position: relative; z-index: 1; }

/* ---------- app nav ---------- */
.appnav {
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
  padding: 1.1rem 0; border-bottom: 1px solid var(--line);
}
.appnav .lockup { display: flex; align-items: center; gap: 0.7rem; color: var(--ink); }
.appnav .lockup strong { font-family: var(--display); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }
.appnav .chip.admin { color: var(--ground); background: var(--signal); border-color: var(--signal); }
.appnav .tabs { display: flex; align-items: center; gap: 1.4rem; margin-left: 0.5rem; }
.appnav .tabs a {
  font-family: var(--display); font-weight: 700; font-size: 0.92rem; color: var(--muted);
  padding: 0.35rem 0; border-bottom: 2px solid transparent; white-space: nowrap;
}
.appnav .tabs a:hover { color: var(--ink); }
.appnav .tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--signal); }
.appnav .right { display: flex; align-items: center; gap: 1.1rem; }
.appnav .readout-inline { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.appnav .readout-inline b { color: var(--ink); font-weight: 500; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: #2A2A26; border: 1px solid var(--dial);
  font-family: var(--display); font-weight: 700; font-size: 0.95rem; color: var(--ink);
}
.avatar.lg { width: 56px; height: 56px; font-size: 1.4rem; }
.avatar.xl { width: 120px; height: 120px; font-size: 3rem; }
.appnav form { display: inline; }
.appnav .ghost { padding: 0.35rem 0.6rem; }

/* ---------- chips, badges, tags ---------- */
.chip {
  display: inline-flex; align-items: center; white-space: nowrap;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-chip); padding: 0.45rem 0.75rem;
}
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 0.55rem;
  border-radius: var(--r-chip); border: 1px solid; white-space: nowrap;
  font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--muted); background: #1C1B18; border-color: var(--line);
}
.badge.green { color: var(--ok); background: rgba(159, 213, 139, 0.12); border-color: rgba(159, 213, 139, 0.35); }
.badge.yellow { color: var(--warn); background: rgba(232, 196, 106, 0.12); border-color: rgba(232, 196, 106, 0.35); }
.badge.red { color: var(--err); background: rgba(224, 143, 143, 0.12); border-color: rgba(224, 143, 143, 0.35); }
.badge.blue { color: var(--info); background: rgba(143, 182, 224, 0.12); border-color: rgba(143, 182, 224, 0.35); }
.badge.brand { color: var(--signal-bright); background: var(--signal-soft); border-color: var(--signal-edge); }
.tag {
  display: inline-flex; align-items: center; height: 28px; padding: 0 0.85rem; border-radius: 999px;
  font-size: 0.875rem; color: var(--muted); background: transparent; border: 1px solid var(--line);
}
.tag.active, .tag[aria-current="true"] { color: var(--tag-ink); background: var(--signal-soft); border-color: var(--signal-edge); }
.tag:hover { border-color: var(--dial); color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.9rem 1.7rem; border: 0; border-radius: var(--r-control); cursor: pointer;
  background: var(--signal); color: var(--ground);
  font-family: var(--display); font-weight: 700; font-size: 0.94rem; line-height: 1.1;
  box-shadow: 0 0 24px var(--glow); white-space: nowrap;
  transition: background var(--dur) ease, transform var(--dur) ease, border-color var(--dur) ease;
}
.btn:hover { background: var(--signal-bright); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.55; cursor: wait; transform: none; }
.btn.small { padding: 0.7rem 1.25rem; font-size: 0.88rem; }
.btn.xs { padding: 0.45rem 0.85rem; font-size: 0.8rem; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--field-line); box-shadow: none; }
.btn.secondary:hover { background: var(--hover); border-color: var(--muted); }
.btn.secondary:focus-visible { outline-color: var(--signal); }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { color: var(--ink); background: var(--hover); }
.btn.ghost:focus-visible { outline-color: var(--signal); }
.btn.danger { background: var(--err); color: var(--ground); box-shadow: none; }
.btn.danger:hover { background: #E9A3A3; }
.btn.danger:focus-visible { outline-color: var(--ink); }
.btn.outline-circle {
  width: 36px; height: 36px; padding: 0; border-radius: 50%;
  background: transparent; color: var(--signal); border: 1px solid var(--field-line); box-shadow: none;
}
.btn.outline-circle:hover { border-color: var(--signal); background: var(--signal-soft); }
.btn.outline-circle.lg { width: 40px; height: 40px; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

/* ---------- forms ---------- */
form { margin: 0; }
.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.field label { color: var(--muted); }
.field .hint { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); line-height: 1.5; }
.control, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; height: 2.5rem; padding: 0 0.9rem; border-radius: var(--r-control);
  background: var(--card); border: 1px solid var(--field-line); color: var(--ink);
  font-size: 0.95rem; line-height: 1.4;
}
textarea { height: auto; min-height: 6rem; padding: 0.7rem 0.9rem; resize: vertical; }
select { color-scheme: dark; cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--signal); outline-offset: 1px; border-color: transparent; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--err); }
input[aria-invalid="true"]:focus { outline-color: var(--err); }
.control.lg, .auth-form input { height: 3rem; font-size: 1rem; padding: 0 1rem; }
.form-row { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.form-row .field { flex: 1 1 12rem; }
.form-stack { display: flex; flex-direction: column; gap: 1.1rem; }
.form-msg { min-height: 1.5rem; font-size: 0.95rem; color: var(--muted); }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--err); }
.check { display: flex; align-items: flex-start; gap: 0.6rem; color: var(--body-ink); font-size: 0.95rem; }
.check input { width: 1.05rem; height: 1.05rem; margin-top: 0.25rem; accent-color: var(--signal); flex-shrink: 0; }
.inline-form { display: inline; }

/* switch: a POST button that reads as a toggle (no JS needed) */
.switch {
  display: inline-flex; align-items: center; gap: 0.7rem; padding: 0; border: 0; background: transparent;
  color: var(--ink); font-family: var(--body); font-size: 0.95rem; cursor: pointer; text-align: left;
}
.switch .track {
  position: relative; width: 40px; height: 22px; border-radius: 11px; flex-shrink: 0;
  background: var(--dial); border: 1px solid var(--field-line); transition: background var(--dur) ease;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink); transition: transform var(--dur) ease;
}
.switch[aria-pressed="true"] .track { background: var(--signal); border-color: var(--signal); }
.switch[aria-pressed="true"] .track::after { transform: translateX(18px); background: var(--ground); }
.switch .state { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.switch[aria-pressed="true"] .state { color: var(--signal-bright); }

/* ---------- cards, panels, spec sheets ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 1.9rem 2rem; display: flex; flex-direction: column; gap: 1rem;
}
.card.tight { padding: 1.3rem 1.5rem; gap: 0.8rem; }
.card h2, .card h3 { font-family: var(--display); font-weight: 700; line-height: 1.2; }
.card h3 { font-size: 1.15rem; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card.export { border-color: var(--signal-edge); box-shadow: 0 0 24px rgba(255, 106, 0, 0.08); }
.dashed {
  border: 1px dashed var(--field-line); border-radius: var(--r-card); padding: 1.4rem 1.6rem;
  color: var(--muted);
}
.empty { border: 1px dashed var(--field-line); border-radius: var(--r-card); padding: 2.4rem 1.6rem; text-align: center; }
.icon-plate {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  background: var(--signal-soft); border: 1px solid var(--signal-edge);
}
.icon-plate.lg { width: 56px; height: 56px; }
.icon-plate svg { width: 20px; height: 20px; }
.icon-plate.lg svg { width: 26px; height: 26px; }
dl.spec {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); margin: 0;
}
dl.spec > div {
  display: grid; grid-template-columns: 13rem 1fr; gap: 1rem; padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--line);
}
dl.spec > div:first-child { border-top: 0; }
dl.spec dt { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); padding-top: 0.25rem; }
dl.spec dd { margin: 0; font-size: 0.98rem; color: var(--body-ink); min-width: 0; }
dl.spec.compact > div { grid-template-columns: 6.5rem 1fr; padding: 0.6rem 0.9rem; gap: 0.75rem; }
dl.spec.compact dd { font-size: 0.92rem; line-height: 1.5; }
dl.spec.compact dt { font-size: 0.66rem; }
.identity .sub { line-height: 1.5; }

/* ---------- readouts (StatReadout) ---------- */
.readouts { display: flex; flex-wrap: wrap; gap: 2.2rem; padding: 1.4rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.readout { display: flex; flex-direction: column; gap: 0.2rem; }
.readout .value { font-family: var(--mono); font-size: 1.5rem; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.readout .value.warn { color: var(--warn); }
.readout .value.err { color: var(--err); }
.readout .value small { font-size: 0.85rem; color: var(--muted); }
.readout .label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); }
.readouts.plain { border: 0; padding: 0; gap: 1.6rem; }

/* ---------- page headers ---------- */
.pagehead { padding: 2.6rem 0 1.6rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.pagehead .eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; color: var(--muted); }
.pagehead .eyebrow .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--dial); }
h1 {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05;
  font-size: clamp(2rem, 3.4vw, 3rem); margin: 0.6rem 0 0; text-wrap: balance;
}
h1.form-title { font-size: 2.6rem; }
h2.section { font-family: var(--display); font-weight: 700; font-size: 1.4rem; line-height: 1.15; letter-spacing: -0.01em; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 42em; margin-top: 0.6rem; }

/* filters: a row of links with counts */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; align-items: center; padding: 0.4rem 0 1rem; }
.filters a { font-family: var(--display); font-weight: 700; font-size: 0.92rem; color: var(--muted); }
.filters a[aria-current="true"] { color: var(--ink); border-bottom: 2px solid var(--signal); }
.filters a .count { font-family: var(--mono); font-weight: 400; font-size: 0.78rem; color: var(--muted); margin-left: 0.35rem; }
.filters .spacer { flex: 1; }
.filters .search { width: 18rem; }

/* ---------- lists / tables ---------- */
.table { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.table .row { display: grid; align-items: center; gap: 1rem; padding: 0.85rem 1.25rem; border-top: 1px solid var(--line); min-width: 0; }
.table .row:first-child { border-top: 0; }
.table .head { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); padding: 0.7rem 1.25rem; }
.table a.row { color: inherit; }
.table a.row:hover { background: var(--hover); }
.table .row.selected { background: var(--card); box-shadow: inset 2px 0 0 var(--signal); }
.table .title { font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--ink); min-width: 0; }
.table .meta { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); }
.table .cell { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; font-size: 0.95rem; color: var(--body-ink); }
.table .cell > * { min-width: 0; max-width: 100%; }
.table .cell > .between { width: 100%; }
.table .cell.mono { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.table .cell.num { text-align: right; }
.table .who { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.table .row.users { grid-template-columns: minmax(0, 1fr) 7rem 5rem 5rem 6rem; }
.table .row.waitlist { grid-template-columns: 3rem minmax(0, 1fr) 9rem 7rem 7rem; }
.table .row.invites { grid-template-columns: 3rem minmax(0, 1fr) 9rem 7rem 7rem; }
.table .row.audit { grid-template-columns: 6.5rem 4.5rem 12rem 1fr; align-items: start; }
.table .row.audit .cell { font-size: 0.9rem; overflow-wrap: anywhere; }
.table .row.tracks { grid-template-columns: minmax(0, 1fr) 8rem 8.5rem 4.5rem 4.5rem 7rem; }
.table .row.reports { grid-template-columns: minmax(0, 1fr) 4rem; }
.table .row.sessions { grid-template-columns: minmax(0, 1fr) 9rem 7rem; }
.table .foot { padding: 0.7rem 1.25rem; border-top: 1px solid var(--line); }
.rank { font-family: var(--display); font-weight: 800; font-size: 1.1rem; color: var(--muted); }

/* ---------- layouts ---------- */
.split { display: grid; gap: 1.5rem; align-items: start; }
.split.rail-right { grid-template-columns: minmax(0, 1fr) 29rem; }
.split.rail-right.narrow { grid-template-columns: minmax(0, 1fr) 17rem; }
.split.rail-right.mid { grid-template-columns: minmax(0, 1fr) 22rem; }
.split.queue { grid-template-columns: 24rem minmax(0, 1fr); }
.split.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 1.25rem; }
.stack.tight { gap: 0.75rem; }
.rail { display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 1.25rem; }
.section-gap { margin-top: 2.2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.identity { display: flex; align-items: center; gap: 1rem; }
.identity .name { font-family: var(--display); font-weight: 700; font-size: 1.25rem; line-height: 1.15; }
.identity .sub { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* quota bars */
.bar { height: 4px; background: var(--dial); border-radius: 2px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--signal); border-radius: 2px; }
.bar > span.warn { background: var(--warn); }
.bar > span.err { background: var(--err); }
.bar > span.ok { background: var(--ok); }
.bar > span.w-0 { width: 0; } .bar > span.w-5 { width: 5%; } .bar > span.w-10 { width: 10%; } .bar > span.w-15 { width: 15%; }
.bar > span.w-20 { width: 20%; } .bar > span.w-25 { width: 25%; } .bar > span.w-30 { width: 30%; } .bar > span.w-35 { width: 35%; }
.bar > span.w-40 { width: 40%; } .bar > span.w-45 { width: 45%; } .bar > span.w-50 { width: 50%; } .bar > span.w-55 { width: 55%; }
.bar > span.w-60 { width: 60%; } .bar > span.w-65 { width: 65%; } .bar > span.w-70 { width: 70%; } .bar > span.w-75 { width: 75%; }
.bar > span.w-80 { width: 80%; } .bar > span.w-85 { width: 85%; } .bar > span.w-90 { width: 90%; } .bar > span.w-95 { width: 95%; }
.bar > span.w-100 { width: 100%; }
.quota { display: flex; flex-direction: column; gap: 0.35rem; }
.quota .between { font-size: 0.9rem; }

/* ---------- dial / scrubber ---------- */
.dial .scale {
  position: relative; height: 24px;
  background:
    repeating-linear-gradient(to right, var(--dial) 0 1px, transparent 1px 9px) 0 100% / 100% 9px no-repeat,
    repeating-linear-gradient(to right, var(--dial) 0 1px, transparent 1px 46px) 0 100% / 100% 18px no-repeat;
}
.dial .needle { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--signal); box-shadow: 0 0 16px var(--glow), 0 0 4px var(--signal); }
.dial .range { position: absolute; top: 0; bottom: 0; background: rgba(224, 143, 143, 0.35); border-left: 1px solid var(--err); border-right: 1px solid var(--err); }
.dial .caption { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.6rem; color: var(--muted); }
.player { display: flex; align-items: center; gap: 1.2rem; }
.player .play {
  width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--signal); color: var(--ground);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 24px var(--glow); flex-shrink: 0;
}
.player .play:hover { background: var(--signal-bright); }
.player .dial { flex: 1; min-width: 0; }
audio.native { width: 100%; color-scheme: dark; }

/* ---------- audit / moderation specifics ---------- */
.who-human { color: var(--signal-bright); }
.who-agent { color: var(--info); }
.who-system { color: var(--muted); }
.action-name { font-family: var(--mono); font-size: 0.8rem; color: var(--ink); }
.report-card { border-top: 1px solid var(--line); padding: 0.9rem 0; }
.report-card:first-child { border-top: 0; padding-top: 0; }
.report-card .head { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); }
.report-card blockquote { margin: 0.4rem 0 0; color: var(--body-ink); font-size: 0.98rem; }
.reason-radio { display: flex; flex-direction: column; gap: 0.6rem; }
.reason-radio label { display: flex; gap: 0.8rem; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: var(--r-card); cursor: pointer; }
.reason-radio label:has(input:checked) { border-color: var(--signal-edge); background: rgba(255, 106, 0, 0.06); }
.reason-radio input { accent-color: var(--signal); margin-top: 0.3rem; }
.reason-radio .desc { font-size: 0.9rem; color: var(--muted); }

/* ---------- flash + confirm ---------- */
.flash { padding: 0.9rem 1.2rem; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--card); font-size: 0.95rem; margin-top: 1.2rem; }
.flash.ok { border-color: rgba(159, 213, 139, 0.35); color: var(--ok); }
.flash.err { border-color: rgba(224, 143, 143, 0.35); color: var(--err); }
.confirm-box { border: 1px solid rgba(224, 143, 143, 0.35); }
.confirm-box .field label { color: var(--err); }
dialog { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1.6rem 1.8rem; max-width: 30rem; }
dialog::backdrop { background: rgba(11, 9, 8, 0.7); }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: 100svh; display: grid; place-items: center; padding: 2rem 0; }
.auth-card { width: min(26rem, 100%); display: flex; flex-direction: column; gap: 1.4rem; }
.auth-card h1 { font-size: 2rem; margin: 0; }
.auth-card .lockup { display: flex; align-items: center; gap: 0.7rem; color: var(--ink); margin-bottom: 0.4rem; }
.auth-card .lockup strong { font-family: var(--display); font-weight: 800; font-size: 1.2rem; }
.auth-form { display: flex; flex-direction: column; gap: 1.1rem; }
.qr { background: var(--ink); border-radius: var(--r-card); padding: 0.8rem; width: fit-content; }
.qr svg { display: block; width: 180px; height: 180px; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem 1.2rem; font-family: var(--mono); font-size: 0.9rem; color: var(--ink); }

/* ---------- member side: library, upload, profile ---------- */
.table .row.library { grid-template-columns: minmax(0, 1fr) 8rem 5rem 4.5rem 4.5rem 2rem; }
.table .row.catalog { grid-template-columns: 2.4rem 40px minmax(0, 1fr) 12rem 7rem 5rem 4rem; }
.table .row.catalog .outline-circle { width: 36px; height: 36px; font-size: 0.8rem; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.9rem;
  padding: 3.4rem 2rem; border: 1px dashed var(--field-line); border-radius: var(--r-card);
  background: rgba(255, 106, 0, 0.04);
}
.dropzone[aria-disabled="true"] { opacity: 0.85; }
.dropzone .drop-title { font-family: var(--display); font-weight: 700; font-size: 1.25rem; }
.profile-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.6rem; align-items: start; padding: 2.6rem 0 1.6rem; }
.profile-head h1 { font-size: 3rem; margin: 0.4rem 0 0; }
.profile-head .lede { max-width: 36em; }
.appnav a.chip { color: var(--ground); }
.appnav a.chip:hover { background: var(--signal-bright); border-color: var(--signal-bright); }
@media (max-width: 40rem) {
  .profile-head { grid-template-columns: 1fr; }
  .profile-head .avatar.xl { width: 72px; height: 72px; font-size: 1.8rem; }
  .profile-head h1 { font-size: 2.2rem; }
}

/* ---------- 2FA enrolment: manual key, code actions, print ---------- */
.key-block {
  font-family: var(--mono); font-size: 1.05rem; letter-spacing: 0.12em; line-height: 1.7;
  color: var(--ink); background: var(--ground); border: 1px solid var(--line); border-radius: var(--r-control);
  padding: 0.8rem 1rem; overflow-wrap: anywhere; user-select: all;
}
.btn .icon { width: 16px; height: 16px; flex-shrink: 0; }
.btn .icon path, .btn .icon rect { stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.code-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media print {
  body { background: #fff; color: #000; }
  body > *:not(.page), .page > *:not(.auth-wrap), .auth-wrap > *:not(.auth-card), .auth-card > *:not(.printable) { display: none !important; }
  .page { border: 0; background: #fff; width: auto; padding: 0; min-height: 0; }
  .auth-wrap { min-height: 0; display: block; padding: 0; }
  .auth-card { width: auto; }
  .printable, .printable * { color: #000 !important; background: #fff !important; border-color: #000 !important; }
  .printable .no-print { display: none !important; }
  .codes { font-size: 1.1rem; }
}

/* ---------- footer ---------- */
footer.appfoot { border-top: 1px solid var(--line); padding: 1.6rem 0 0; margin-top: 3rem; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 63.75rem) {
  .split.rail-right, .split.rail-right.narrow, .split.rail-right.mid, .split.queue, .split.two { grid-template-columns: 1fr; }
  .rail { position: static; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .appnav { flex-wrap: wrap; }
}
@media (max-width: 40rem) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .table .row { grid-template-columns: 1fr !important; gap: 0.35rem; }
  .table .head { display: none; }
  .table .cell.num { text-align: left; }
  .appnav .readout-inline { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
