/* Candidate Match design system: see DESIGN.md.
   Editorial ledger. Warm ink on off-white, Newsreader 300 display, IBM Plex Sans body, JetBrains Mono ledger.
   Colour only ever means a reviewer. */
:root {
  --canvas: #f5f5f5;
  --canvas-soft: #fafafa;
  --card: #ffffff;
  --strong: #f0efed;
  --ink: #0c0a09;
  --primary: #292524;
  --primary-active: #0c0a09;
  --on-primary: #ffffff;
  --graphite: #57534e;
  --muted: #777169;
  --muted-soft: #a8a29e;
  --hair: #e7e5e4;
  --hair-strong: #d6d3d1;
  --mark-ring: rgba(41, 37, 36, .35);
  --error: #dc2626;
  --success: #16a34a;
  --bloom: .9;
  --top-bg: #0c0a09;
  --top-fg: #fafafa;
  --top-muted: #a8a29e;

  --mint: #a7e5d3;
  --peach: #f4c5a8;
  --lavender: #c8b8e0;
  --sky: #a8c8e8;
  --rose: #e8b8c4;

  --serif: 'Newsreader', 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', ui-sans-serif, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --r-xs: 4px; --r-md: 8px; --r-lg: 16px; --r-xl: 24px; --r-pill: 9999px;
  --shadow: 0 12px 40px rgba(12, 10, 9, .07);
  --header-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0c0a09; --canvas-soft: #141210; --card: #1c1917; --strong: #292524;
    --ink: #fafafa; --primary: #fafafa; --primary-active: #ffffff; --on-primary: #0c0a09;
    --graphite: #c9c5c1; --muted: #a8a29e; --muted-soft: #777169;
    --hair: #292524; --hair-strong: #44403c; --mark-ring: rgba(250, 250, 250, .35);
    --error: #f87171; --success: #4ade80; --bloom: .45;
    --top-bg: #fafafa; --top-fg: #0c0a09; --top-muted: #57534e;
    --shadow: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--canvas); color: var(--graphite); font: 400 16px/1.5 var(--sans); letter-spacing: .08px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--ink); text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 400; }
code { font: 12px var(--mono); background: var(--strong); padding: 1px 6px; border-radius: var(--r-xs); }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .44px; text-transform: uppercase; }
.label { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .44px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.serif { font-family: var(--serif); font-weight: 300; color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- reviewer marks ---------- */
.mark {
  --c: var(--strong);
  width: 16px; height: 16px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  background: var(--c); box-shadow: inset 0 0 0 1.5px var(--mark-ring);
  font: 500 9px/1 var(--mono); color: #0c0a09; text-transform: uppercase; letter-spacing: 0;
  position: relative; cursor: default;
}
.mark.md { width: 20px; height: 20px; font-size: 9px; }
.mark.lg { width: 32px; height: 32px; font-size: 10px; }
.mark.xl { width: 44px; height: 44px; font-size: 12px; }
.mark.mint { --c: var(--mint); } .mark.peach { --c: var(--peach); } .mark.lavender { --c: var(--lavender); }
.mark.sky { --c: var(--sky); } .mark.rose { --c: var(--rose); }
.mark.pass { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); color: transparent; }
.mark.pass::after { content: ""; position: absolute; left: 18%; right: 18%; top: 50%; height: 1.5px; background: var(--muted); transform: translateY(-50%) rotate(-45deg); }
.mark.hidden { background: transparent; box-shadow: inset 0 0 0 1.5px var(--hair-strong); color: transparent; }
.marks { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.more-marks { height: 24px; padding: 0 9px; border-radius: var(--r-pill); border: 0; background: var(--strong); color: var(--ink); font: 500 11px var(--mono); cursor: pointer; }

/* ---------- header ---------- */
.topbar { height: var(--header-h); display: flex; align-items: center; gap: 28px; padding: 0 24px; background: color-mix(in srgb, var(--canvas) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--hair); position: sticky; top: 0; z-index: 20; }
.brand { flex: none; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-name { font: 300 22px var(--serif); letter-spacing: -.2px; }
.nav { display: flex; gap: 22px; }
.nav a { text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500; letter-spacing: 0; padding: 4px 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.spacer { flex: 1; }
.select {
  appearance: none; height: 40px; border: 1px solid var(--hair-strong); background: transparent; border-radius: var(--r-pill);
  padding: 0 36px 0 18px; min-width: 0; flex: 0 1 260px; max-width: 260px; text-overflow: ellipsis; font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--ink); cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.user-chip { flex: none; display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 4px 12px 4px 4px; border-radius: var(--r-pill); font-size: 15px; font-weight: 500; color: var(--ink); }
.user-chip:hover { background: var(--strong); }
.badge { display: inline-flex; align-items: center; gap: 6px; background: var(--strong); color: var(--ink); font: 500 11px/1.4 var(--mono); letter-spacing: .44px; text-transform: uppercase; padding: 5px 10px; border-radius: var(--r-pill); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 19px; border-radius: var(--r-pill); border: 1px solid var(--hair-strong); background: transparent; color: var(--ink); font-size: 15px; font-weight: 500; letter-spacing: 0; line-height: 1; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); padding: 0 20px; }
.btn-primary:hover { background: var(--primary-active); border-color: var(--primary-active); }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- swipe page ---------- */
.swipe-page { display: grid; grid-template-columns: 1fr 320px; height: calc(100dvh - var(--header-h)); }
.deck-col { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 20px 24px 0; overflow: hidden; }
.deck-col > * { width: 100%; max-width: 460px; }
.pulse { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: 14px; }
.pulse b { color: var(--ink); font-weight: 500; }
.deck { position: relative; flex: 1; min-height: 0; }
.edge { position: absolute; inset: 0; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-xl); transition: transform .2s ease-out, opacity .2s; }
.card {
  position: absolute; inset: 0; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-xl); box-shadow: var(--shadow);
  overflow: hidden; touch-action: pan-y; user-select: none; will-change: transform;
}
.card.dragging { cursor: grabbing; }
.card.exit-left { transition: transform .16s ease-in, opacity .16s ease-in; }
.card.exit-right { transition: transform .24s ease-in, opacity .24s ease-in; }
.card.settle { transition: transform .2s ease-out; }
.card-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }

.hero { min-height: 100%; display: flex; flex-direction: column; padding: 24px 28px 14px; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.portrait { width: 84px; height: 84px; border-radius: 50%; margin: 20px 0 16px; background: var(--strong); display: grid; place-items: center; overflow: hidden; flex: none; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait span { font: 300 34px var(--serif); color: var(--ink); letter-spacing: -.5px; }
.cand-name { position: relative; display: inline-block; font: italic 300 40px/1.05 var(--serif); letter-spacing: -.8px; color: var(--ink); }
.cand-name::after { content: ""; position: absolute; left: -2px; right: 100%; top: 54%; height: 1px; background: var(--ink); transition: right .14s ease-in; }
.card.struck .cand-name::after { right: -2px; }
.headline { margin: 8px 0 0; color: var(--graphite); font-size: 15px; }
.facts { margin-top: 10px; color: var(--muted); }
.hero-body { display: flex; flex-direction: column; gap: 22px; margin-top: 22px; flex: 1; }
.roles { list-style: none; margin: 0; padding: 0; }
.roles li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-top: 1px solid var(--hair); }
.roles li:last-child { border-bottom: 1px solid var(--hair); }
.roles b { font-weight: 500; color: var(--ink); }
.roles small { color: var(--muted); font-size: 14px; text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 14px; letter-spacing: 0; padding: 4px 12px; border-radius: var(--r-pill); background: var(--strong); color: var(--graphite); }
.chip.key { background: transparent; color: var(--ink); font-weight: 500; box-shadow: inset 0 0 0 1px var(--ink); }
.chip.key::before { content: "★"; font-size: 9px; margin-right: 5px; vertical-align: 1px; }
.edu { color: var(--ink); font-weight: 500; }
.edu small { color: var(--muted); font-weight: 400; font-size: 14px; }
.more-hint { margin-top: auto; align-self: center; border: 0; background: none; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 12px 2px; }
@media (prefers-reduced-motion: no-preference) { .more-hint { animation: nudge 2.6s ease-in-out infinite; } }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

.detail { background: var(--canvas-soft); border-top: 1px solid var(--hair); padding: 32px 28px; display: flex; flex-direction: column; gap: 32px; }
.section-title { font: 300 26px var(--serif); color: var(--ink); margin-bottom: 12px; }
.detail p { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 14px 0; border-top: 1px solid var(--hair); }
.timeline li:last-child { border-bottom: 1px solid var(--hair); }
.timeline strong { display: block; font-weight: 500; color: var(--ink); }
.timeline small { color: var(--muted); }
.timeline p { margin-top: 6px; font-size: 15px; }
.cover { font: italic 300 21px/1.45 var(--serif); color: var(--ink); }
.cv-btn { align-self: flex-start; }

/* stamp: your reviewer mark landing on the card */
.stamp { position: absolute; top: 22px; right: 22px; z-index: 5; opacity: 0; transform: scale(1.6) rotate(var(--rot, -6deg)); pointer-events: none; transition: opacity .12s, transform .24s cubic-bezier(.2, 1.4, .4, 1); }
.stamp.on { opacity: 1; transform: scale(1) rotate(var(--rot, -6deg)); }
.drag-hint { position: absolute; top: 26px; left: 28px; z-index: 5; opacity: 0; pointer-events: none; }

.actions { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 18px 0 10px; }
.round { width: 58px; height: 58px; border-radius: 50%; border: 1px solid var(--hair-strong); background: var(--card); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: transform .15s, border-color .15s, background .15s; text-decoration: none; }
.round:hover { transform: translateY(-2px); border-color: var(--ink); }
.round:active { transform: scale(.96); }
.round svg { width: 22px; height: 22px; }
.round.yes { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.round.yes:hover { background: var(--primary-active); }
.round.small { width: 44px; height: 44px; color: var(--muted); }
.round.small svg { width: 17px; height: 17px; }
.round:disabled, .round[aria-disabled="true"] { opacity: .35; cursor: default; transform: none; pointer-events: none; }
.keys { text-align: center; color: var(--muted); padding-bottom: 14px; }
.kbd { border: 1px solid var(--hair-strong); border-radius: var(--r-xs); padding: 0 4px; }

.empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; border: 1px dashed var(--hair-strong); border-radius: var(--r-xl); }
.empty h2 { font: 300 36px var(--serif); letter-spacing: -.4px; margin-bottom: 10px; }
.empty p { margin: 0; }

/* match moment: inline, no modal */
.match-moment { position: absolute; inset: 0; z-index: 30; pointer-events: none; display: grid; place-items: center; opacity: 0; transition: opacity .25s ease-out; }
.match-moment.on { opacity: 1; }
.match-moment .bloom { position: absolute; width: 360px; height: 300px; }
.match-moment .bloom span { position: absolute; width: 220px; height: 220px; border-radius: 50%; filter: blur(46px); opacity: var(--bloom); transition: transform .6s cubic-bezier(.2, 1.3, .4, 1); }
.match-moment .word { position: relative; text-align: center; transform: translateY(8px); opacity: 0; transition: opacity .35s ease-out .15s, transform .6s cubic-bezier(.2, 1.3, .4, 1) .1s; }
.match-moment.on .word { opacity: 1; transform: none; }
.match-moment .word b { display: block; font: italic 300 64px/1 var(--serif); letter-spacing: -1.6px; color: var(--ink); font-weight: 300; }
.match-moment .word span { display: block; margin-top: 10px; font-size: 15px; color: var(--ink); }

/* activity column */
.activity { border-left: 1px solid var(--hair); background: var(--canvas-soft); padding: 24px 22px; overflow-y: auto; }
.activity h2 { font: 300 26px var(--serif); margin-bottom: 4px; }
.activity .sub { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--hair); color: var(--graphite); }
.feed li .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed li .t { margin-left: auto; color: var(--muted-soft); flex: none; }
.feed li.hidden { color: var(--muted-soft); }
.feed li.mine .who { color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .feed li.wake { animation: wake .16s ease-out both; }
}
@keyframes wake { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.feed-empty { color: var(--muted); font-size: 14px; padding: 12px 0; border-top: 1px solid var(--hair); }
.legend { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--hair); display: grid; gap: 8px; }
.legend div { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); }
.legend small { color: var(--muted); font-size: 13px; }
.note { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--canvas) 80%, transparent); backdrop-filter: blur(12px); }
.overlay[hidden] { display: none; }
.panel { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: 32px; }
.panel h1 { font: 300 40px var(--serif); letter-spacing: -.6px; margin-bottom: 8px; }
.panel p { margin: 0 0 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--ink); }
.field input, .field textarea { min-height: 44px; border: 1px solid var(--hair-strong); background: var(--card); border-radius: var(--r-md); padding: 11px 16px; font-weight: 400; font-size: 16px; color: var(--ink); }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.field.invalid input { border-color: var(--error); }
.error { color: var(--error); font-size: 14px; min-height: 20px; margin-bottom: 8px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; display: flex; align-items: center; gap: 10px; background: var(--primary); color: var(--on-primary); padding: 11px 18px 11px 12px; border-radius: var(--r-pill); font-size: 15px; font-weight: 500; letter-spacing: 0; transition: .25s; z-index: 60; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast .marks { gap: 0; }
.toast .marks .mark + .mark { margin-left: -6px; }

/* ---------- rankings ---------- */
.page { max-width: 1040px; margin: 0 auto; padding: 64px 24px 96px; }
.page-head { margin-bottom: 40px; }
.page-head h1 { font: 300 64px/1.05 var(--serif); letter-spacing: -1.92px; }
.page-head p { margin: 14px 0 0; max-width: 580px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 40px; }
.stat { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 22px 24px; }
.stat b { display: block; font: 300 48px/1 var(--serif); letter-spacing: -.96px; color: var(--ink); margin-bottom: 10px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { height: 36px; border: 1px solid var(--hair-strong); background: transparent; padding: 0 16px; border-radius: var(--r-pill); cursor: pointer; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--ink); }
.tab:hover { border-color: var(--ink); }
.tab[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.tab .n { opacity: .55; margin-left: 6px; font: 500 12px var(--mono); }
.awaiting { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 14px 18px; border: 1px dashed var(--hair-strong); border-radius: var(--r-lg); font-size: 15px; }
.awaiting a { margin-left: auto; }

.ledger { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-xl); padding: 0 28px; }
.lrow { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 120px 56px; align-items: center; gap: 18px; padding: 20px 0; border-top: 1px solid var(--hair); }
.lrow:first-child { border-top: 0; }
.lrow .num { font: 300 28px var(--serif); color: var(--muted-soft); }
.lrow .who { min-width: 0; }
.lrow .who h3 { font: italic 300 26px/1.15 var(--serif); }
.lrow .who .sub { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .who .links { display: flex; gap: 14px; margin-top: 6px; font-size: 14px; }
.lrow .who .links a { color: var(--graphite); }
.lrow .lvl-name { text-align: right; color: var(--muted); }
.lrow .lvl { font: italic 300 40px/1 var(--serif); color: var(--ink); text-align: right; }
.lrow.l0 .lvl, .lrow.l1 .lvl { color: var(--muted-soft); }
.lrow.l3::before { content: ""; position: absolute; left: -28px; top: 18px; bottom: 18px; width: 2px; background: var(--ink); }
.lrow.l4 { background: var(--top-bg); margin: 12px -14px; padding: 24px 14px; border-radius: var(--r-lg); border-top: 0; overflow: hidden; }
.lrow.l4 + .lrow { border-top: 0; }
.lrow.l4 .who h3, .lrow.l4 .lvl { color: var(--top-fg); }
.lrow.l4 .num, .lrow.l4 .who .sub, .lrow.l4 .lvl-name { color: var(--top-muted); }
.lrow.l4 .who .links a { color: var(--top-fg); }
.lrow.l4 .glow { position: absolute; right: 80px; top: -70px; width: 340px; height: 220px; pointer-events: none; }
.lrow.l4 .glow span { position: absolute; width: 170px; height: 170px; border-radius: 50%; filter: blur(48px); opacity: .55; }
.lrow.l4 > *:not(.glow) { position: relative; }
.lrow.flash { animation: flash 1.8s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 3px var(--ink); } to { box-shadow: 0 0 0 0 transparent; } }
.list-empty { padding: 48px 0; text-align: center; }

.settings { margin-top: 88px; }
.settings h2 { font: 300 40px var(--serif); letter-spacing: -.4px; margin-bottom: 8px; }
.settings > p { margin: 0 0 24px; }
.settings-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.settings-card { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 24px; }
.sync-box { font-size: 15px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.sync-box strong { color: var(--ink); font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  .card.exit-left, .card.exit-right, .card.settle, .edge, .stamp, .match-moment, .match-moment .word, .match-moment .bloom span { transition: none !important; }
}

@media (max-width: 900px) {
  .mode-badge { display: none; }
  .topbar { gap: 18px; }
  .swipe-page { grid-template-columns: 1fr; height: auto; }
  .deck-col { height: calc(100dvh - var(--header-h)); padding: 14px 16px 0; }
  .activity { border-left: 0; border-top: 1px solid var(--hair); }
}
@media (max-width: 720px) {
  .topbar { padding: 0 16px; gap: 12px; }
  .brand-name, .user-chip .name, .mode-badge { display: none; }
  .nav { gap: 14px; }
  .select { min-width: 0; flex: 0 1 140px; max-width: 140px; padding-left: 14px; }
  .user-chip { padding: 2px; flex: none; }
  .hero { padding: 20px 20px 12px; }
  .cand-name { font-size: 32px; }
  .detail { padding: 28px 20px; }
  .page { padding-top: 40px; }
  .page-head h1 { font-size: 44px; letter-spacing: -1px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat b { font-size: 36px; }
  .ledger { padding: 0 16px; }
  .lrow { grid-template-columns: 28px minmax(0, 1fr) 40px; gap: 12px; }
  .lrow .marks-cell { grid-column: 2 / 3; }
  .lrow .lvl-name { display: none; }
  .lrow .lvl { grid-row: 1; grid-column: 3; font-size: 30px; }
  .lrow.l3::before { left: -16px; }
  .lrow.l4 { margin: 10px -8px; padding: 20px 8px; }
  .settings-grid { grid-template-columns: 1fr; }
}

/* ---------- CV page ---------- */
.cv-body { background: var(--canvas); }
.cv-bar {
  position: sticky; top: 0; z-index: 20; height: var(--header-h);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: color-mix(in srgb, var(--canvas) 90%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}
.cv-back { flex: none; color: var(--ink); }
.cv-title { min-width: 0; flex: 1; }
.cv-name { font: italic 300 24px/1.1 var(--serif); letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-sub { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.cv-download { flex: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.cv-main { max-width: 860px; margin: 0 auto; padding: 16px 16px calc(120px + env(safe-area-inset-bottom)); }
.cv-status { color: var(--muted); padding: 4px 4px 12px; min-height: 28px; }
.cv-pages { display: flex; flex-direction: column; gap: 16px; }
.cv-sheet { margin: 0; background: #ffffff; border: 1px solid var(--hair); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }
.cv-sheet canvas { display: block; width: 100%; height: auto; }
.cv-profile { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-xl); padding: 28px 24px; }
.cv-profile .section-title { margin-top: 28px; }
.cv-profile > p { margin: 0; }
.cv-note { display: inline-block; background: var(--strong); color: var(--ink); padding: 5px 10px; border-radius: var(--r-pill); margin: 0 0 20px; }
.cv-decide {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--canvas) 92%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--hair);
}
.cv-decide[hidden] { display: none; }
.cv-decide-label { margin-right: auto; display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 500; }
@media (min-width: 900px) {
  .cv-decide { justify-content: center; }
  .cv-decide-label { margin-right: 12px; }
}
.cv-body .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
.synopsis-src { margin-top: 10px; color: var(--muted); }

/* ---------- sign-in, setup, team ---------- */
.login-help { margin: 18px 0 0 !important; font-size: 14px; color: var(--muted); }
.setup-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.setup-page .panel { max-width: 440px; }
.setup-email { display: inline-block; margin-bottom: 20px; }
.team-list { list-style: none; margin: 0 0 20px; padding: 0; }
.team-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hair); flex-wrap: wrap; }
.team-list li:last-child { border-bottom: 1px solid var(--hair); }
.team-list .who { min-width: 0; flex: 1; }
.team-list .who b { display: block; font-weight: 500; color: var(--ink); }
.team-list .who small { color: var(--muted); font-size: 14px; }
.team-list .btn { height: 34px; padding: 0 14px; font-size: 14px; }
.status-active { color: var(--ink); }
.link-box { flex-basis: 100%; display: flex; gap: 8px; }
.link-box input { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--hair-strong); border-radius: var(--r-md); padding: 0 10px; font: 12px var(--mono); color: var(--ink); background: var(--canvas-soft); }
.link-box + small { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--hair-strong); border-radius: var(--r-md); padding: 0 14px; background: var(--card); color: var(--ink); }
.settings-card h3 { font: 300 24px var(--serif); margin-bottom: 6px; }
.settings-card > p { margin: 0 0 16px; font-size: 14px; }
.settings-grid + .settings-grid { margin-top: 16px; }

/* ---------- notes: sheet, tags, dictation, team notes ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; background: color-mix(in srgb, var(--canvas) 55%, transparent); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s ease-out; }
.sheet-backdrop.open { opacity: 1; }
.sheet {
  width: 100%; max-width: 560px; max-height: min(88dvh, 760px); display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--hair); border-bottom: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow);
  transform: translateY(24px); transition: transform .24s ease-out;
}
.sheet-backdrop.open .sheet { transform: none; }
@media (min-width: 720px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-bottom: 1px solid var(--hair); border-radius: var(--r-xl); }
}
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 8px; }
.sheet-head .label { margin-bottom: 4px; }
.sheet-name { font: italic 300 30px/1.1 var(--serif); letter-spacing: -.4px; }
.sheet-body { padding: 8px 24px 4px; overflow-y: auto; }
.sheet-body .label { margin: 16px 0 8px; }
.tag-chips .tag { border: 0; cursor: pointer; font: inherit; font-size: 14px; }
.tag-chips .tag:hover { box-shadow: inset 0 0 0 1px var(--hair-strong); }
.tag-chips .tag.on { background: transparent; color: var(--ink); font-weight: 500; box-shadow: inset 0 0 0 1px var(--ink); }
.tag-chips .tag.on::before { content: "✓"; font-size: 11px; margin-right: 5px; }
.note-input { position: relative; }
.note-input textarea {
  width: 100%; min-height: 128px; resize: vertical; border: 1px solid var(--hair-strong); border-radius: var(--r-md);
  background: var(--card); color: var(--ink); padding: 12px 16px 12px; padding-right: 76px; font-size: 16px; line-height: 1.5;
}
.note-input textarea:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.note-input .mic { position: absolute; right: 10px; bottom: 12px; width: 52px; height: 52px; }
.note-input .mic.recording { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
@media (prefers-reduced-motion: no-preference) {
  .note-input .mic.recording { animation: listening 1.4s ease-in-out infinite; }
}
@keyframes listening { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 30%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
.rec-status { min-height: 18px; margin-top: 8px; color: var(--muted); }
.sheet-hint { margin: 10px 0 14px; font-size: 13px; color: var(--muted); }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hair); }
.saved-state { color: var(--muted); }

.round.note { position: relative; }
.round.note.has-note::after { content: ""; position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }

.team-notes { list-style: none; margin: 0; padding: 0; }
.team-notes li { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--hair); }
.team-notes li:last-child { border-bottom: 1px solid var(--hair); }
.team-notes .chips { margin: 6px 0; }
.team-notes .chip { font-size: 13px; padding: 2px 10px; }
.team-notes p { margin: 6px 0 0; color: var(--graphite); font-size: 15px; }
.note-meta { color: var(--muted); }
.notes-hidden { color: var(--muted); margin: 8px 0 0; }
.notes-toggle { background: none; border: 0; padding: 0; cursor: pointer; color: var(--graphite); text-decoration: underline; text-underline-offset: 3px; font: inherit; font-size: 14px; }
.lrow .row-notes { grid-column: 2 / -1; }
.lrow.l4 .row-notes, .lrow.l4 .notes-toggle { color: var(--top-fg); }
.cv-team-notes { margin-top: 24px; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-xl); padding: 22px 24px; }
.cv-team-notes .section-title { margin-bottom: 4px; }
.btns-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- hold to talk ---------- */
.round.voice { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.round.voice.recording { background: var(--primary); border-color: var(--primary); color: var(--on-primary); transform: scale(1.08); }
@media (prefers-reduced-motion: no-preference) {
  .round.voice.recording { animation: listening 1.4s ease-in-out infinite; }
}
.voice-panel {
  position: absolute; left: 50%; bottom: 112px; z-index: 25; width: calc(100% - 32px); max-width: 460px;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 14px 16px; transition: opacity .2s ease-out, transform .2s ease-out;
}
.voice-panel.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.vp-head { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.vp-who { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }
.vp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .vp-dot { animation: blink 1s ease-in-out infinite; }
}
@keyframes blink { 50% { opacity: .25; } }
.vp-text { margin: 8px 0 0; color: var(--ink); font-size: 16px; line-height: 1.45; max-height: 7.3em; overflow-y: auto; }
.vp-placeholder { color: var(--muted-soft); }
.vp-pending { color: var(--muted); }
.vp-hint { margin-top: 8px; color: var(--muted); }
.vp-tags { margin-top: 10px; }
.vp-tags .chips { margin-top: 6px; }
.vp-tags .tag { border: 0; cursor: pointer; font: inherit; font-size: 14px; }
.vp-tags .tag.on { background: transparent; color: var(--ink); font-weight: 500; box-shadow: inset 0 0 0 1px var(--ink); }
.vp-tags .tag.on::before { content: "✓ "; font-size: 11px; }
.vp-sub { color: var(--muted); }
.vp-actions { display: flex; justify-content: flex-end; gap: 16px; margin-top: 12px; }
.vp-actions button { background: none; border: 0; padding: 4px 0; cursor: pointer; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); }
.vp-actions .vp-edit { color: var(--graphite); text-decoration: underline; text-underline-offset: 3px; font-weight: 400; }
@media (max-width: 720px) {
  .actions { gap: 12px; }
}
@media (hover: none), (max-width: 720px) {
  .keys { display: none; }
}
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.team-card { grid-column: 1 / -1; }
.overlay .brand-name, .setup-page .brand-name { display: inline; }
