/* Whozit app: the same system as the site (Hanken Grotesk + Fragment Mono; peach = a known name, blue = an unknown voice).
   Shared by app.html, account.html, signup.html and signin.html. */
@font-face { font-family: "Hanken Grotesk"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/hanken-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/hanken-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/hanken-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-weight: 800; font-style: normal; font-display: swap; src: url("/fonts/hanken-grotesk-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Fragment Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/fragment-mono-latin-400-normal.woff2") format("woff2"); }

:root {
  --bg: #F4F4F1;
  --fg: #111214;
  --muted: #676A71;
  --line: #DCDCD7;
  --blue: #3246E6;
  --peach: #B04A16;          /* the site's #C2551F is 4.1:1 on --bg; this is 5.0:1 (AA for text) */
  --chip: #FFFFFF;
  --edge: #7E8087;           /* borders of fields and checkboxes: 3:1 or better on --bg and --chip */
  --bad: #B3261E;
  --tint: #ECECE7;           /* hover and selected rows */
  --sans: "Hanken Grotesk", "Helvetica Neue", system-ui, sans-serif;
  --mono: "Fragment Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0E0F12; --fg: #F0F0EC; --muted: #9A9DA5; --line: #26282E; --blue: #8F9BFF; --peach: #FFB38A; --chip: #17191D; --edge: #7A7D86; --bad: #FF8A80; --tint: #1D2025; color-scheme: dark; } }
:root[data-theme="dark"] { --bg: #0E0F12; --fg: #F0F0EC; --muted: #9A9DA5; --line: #26282E; --blue: #8F9BFF; --peach: #FFB38A; --chip: #17191D; --edge: #7A7D86; --bad: #FF8A80; --tint: #1D2025; color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 .9375rem/1.55 var(--sans); }
h1, h2, h3, p { margin: 0; }
a { color: var(--fg); text-underline-offset: 3px; }
a:hover { color: var(--blue); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.skip { position: absolute; left: 12px; top: -60px; background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 999px; z-index: 100; text-decoration: none; font-weight: 600; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--blue) 28%, transparent); }

/* ---- header: the small wordmark, then Account and Sign out ---- */
.site { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 59px; padding: 12px clamp(16px, 3vw, 32px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; background: var(--bg); }
.wordmark { font-weight: 800; letter-spacing: -.07em; font-size: 1.625rem; line-height: 1; text-decoration: none; color: var(--fg); padding: 4px 0; }
.wordmark:hover { color: var(--fg); }
.site nav { display: flex; align-items: center; gap: 20px; font-size: .9375rem; }
.site nav a, .linkbtn { color: var(--muted); text-decoration: none; font: inherit; background: none; border: 0; padding: 6px 0; cursor: pointer; }
.site nav a:hover, .linkbtn:hover { color: var(--fg); text-decoration: underline; }
.site nav a[aria-current="page"] { color: var(--fg); }

/* ---- buttons: pills, like the site ---- */
.btn { font: 600 .875rem/1.2 var(--sans); padding: 10px 18px; min-height: 40px; border-radius: 999px; border: 2px solid var(--fg); background: var(--fg); color: var(--bg); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { color: var(--bg); opacity: .88; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--edge); }
.btn.ghost:hover { color: var(--fg); border-color: var(--fg); opacity: 1; }
.btn.blue { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn.blue:hover { color: var(--blue); opacity: 1; background: color-mix(in srgb, var(--blue) 9%, transparent); }
.btn.peach { background: transparent; color: var(--peach); border-color: var(--peach); }
.btn.peach:hover { color: var(--peach); opacity: 1; background: color-mix(in srgb, var(--peach) 9%, transparent); }
.btn.go { background: var(--blue); border-color: var(--blue); color: #fff; }
:root[data-theme="dark"] .btn.go { color: #0E0F12; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.go { color: #0E0F12; } }
.btn.go:hover { color: #fff; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, transparent); opacity: 1; }
.btn.sm { min-height: 32px; padding: 5px 14px; font-size: .8125rem; }
.btn:disabled, .mini:disabled { opacity: .45; cursor: default; }
.btn:focus-visible, .mini:focus-visible { outline-offset: 3px; }
.mini { font: 500 .8125rem/1.2 var(--sans); padding: 4px 11px; min-height: 28px; border-radius: 999px; border: 1px solid var(--edge); background: transparent; color: var(--fg); cursor: pointer; }
.mini:hover { border-color: var(--fg); }
.play { font: 500 .8125rem/1 var(--mono); min-width: 32px; min-height: 28px; padding: 3px 7px; border: 1px solid var(--line); background: var(--chip); color: var(--fg); border-radius: 999px; cursor: pointer; }
.play:hover { border-color: var(--fg); }

/* ---- fields ---- */
input[type=text], input[type=email], input[type=password], select { font: inherit; color: var(--fg); background: var(--chip); border: 1px solid var(--edge); border-radius: 10px; padding: 8px 12px; min-height: 40px; max-width: 100%; }
select { padding-right: 8px; }
input::placeholder { color: var(--muted); opacity: 1; }
input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); flex: none; }
label.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

/* ---- layout of the app page ---- */
body.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px clamp(16px, 3vw, 32px); border-bottom: 1px solid var(--line); }
.bar .spacer { margin-left: auto; }
#notice { margin: 0; padding: 10px clamp(16px, 3vw, 32px); background: var(--chip); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#notice .msg { flex: 1 1 260px; }
main#main { flex: 1; min-height: 0; display: grid; grid-template-columns: 330px minmax(0, 1fr); }
#list-pane { border-right: 1px solid var(--line); overflow: auto; min-height: 0; }
#detail-pane { overflow: auto; min-height: 0; padding: clamp(14px, 2.4vw, 28px) clamp(14px, 3vw, 32px) 80px; }
#detail { max-width: 920px; outline: none; }
.back { display: none; margin-bottom: 8px; }
.list-title { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.list-title h2 { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.day { padding: 14px 16px 4px; font: 400 .75rem var(--mono); color: var(--muted); }
.m { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; border-left: 3px solid transparent; padding: 9px 16px 9px 13px; cursor: pointer; }
.m:hover { background: var(--tint); }
.m[aria-current="true"] { background: var(--chip); border-left-color: var(--fg); }
.m .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m .s { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; font-size: .8125rem; color: var(--muted); }
.m progress { width: 100%; }
.empty-list { padding: 16px; color: var(--muted); }

/* ---- chips: status, in the system's two colours ---- */
.chip { display: inline-flex; align-items: center; gap: 5px; font: 500 .75rem/1.3 var(--sans); padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--chip); color: var(--muted); white-space: nowrap; }
.chip.ok { color: var(--peach); border-color: var(--peach); }
.chip.need { color: var(--blue); border-color: var(--blue); }
.chip.busy { color: var(--fg); }
.chip.bad { color: var(--bad); border-color: var(--bad); }
.chip.check { color: var(--peach); border-color: var(--peach); border-style: dashed; }
.chip.busy::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
@media (prefers-reduced-motion: no-preference) { .chip.busy::before { animation: pulse 1.4s ease-in-out infinite; } @keyframes pulse { 50% { opacity: .25; } } }

/* ---- cards and text ---- */
.card { background: var(--chip); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-bottom: 14px; }
.card.alt { border-color: var(--blue); }
.card.known { border-color: var(--peach); }
.card h2, .card h3 { font-weight: 600; letter-spacing: -.02em; }
.card h2 { font-size: 1.25rem; }
.card h3 { font-size: 1.0625rem; }
.card > p, .card .lede { margin-top: 6px; }
.row { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.row.end { justify-content: flex-end; }
.row .push { margin-left: auto; }
.q { color: var(--blue); }                       /* "?" and "Speaker 2?": a voice nobody has named */
.known-name { color: var(--peach); }
.err { color: var(--bad); white-space: pre-wrap; }
.todo { color: var(--blue); }
.small { font-size: .8125rem; }
code, .code { font-family: var(--mono); font-size: .8125rem; }

/* the start page */
.hero { padding: clamp(18px, 3vw, 30px); }
.hero h1 { font-size: clamp(1.9rem, 4.6vw, 3.1rem); font-weight: 600; letter-spacing: -.04em; line-height: 1.04; text-wrap: balance; }
.hero .lead { font-size: 1.0625rem; color: var(--muted); max-width: 52ch; margin-top: 12px; }
.hero .ctas { display: flex; gap: 10px 12px; flex-wrap: wrap; align-items: center; margin-top: 20px; }
.example { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ln { display: flex; gap: 10px; align-items: baseline; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; font-size: .9375rem; flex-wrap: wrap; }
.ln .t { font: .75rem var(--mono); color: var(--muted); }
.ln b { font-weight: 600; color: var(--peach); }
.ln b.q { color: var(--blue); }
.steps { margin: 8px 0 0; padding-left: 20px; }
.steps li { margin: 8px 0; }
.eg-label { font: .75rem var(--mono); color: var(--muted); margin-top: 28px; }

/* ---- who's talking (one transcript's voices) ---- */
.vrow { display: grid; grid-template-columns: minmax(80px, 110px) auto minmax(0, 1fr) auto auto; gap: 8px 14px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line); }
.vrow:first-of-type { border-top: 0; }
.vlab { font-weight: 600; padding-top: 7px; overflow-wrap: anywhere; }
.vlab.known { color: var(--peach); }
.vlab.unknown { color: var(--blue); }
.clips { display: flex; gap: 4px; flex-wrap: wrap; padding-top: 5px; }
.namecell { min-width: 0; }
.namecell .nm { width: 100%; max-width: 280px; }
.take { margin-top: 4px; font-size: .8125rem; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.speech { padding-top: 7px; color: var(--muted); font-size: .8125rem; white-space: nowrap; }
details.more { position: relative; }
details.more summary { list-style: none; cursor: pointer; min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--chip); }
details.more summary::-webkit-details-marker { display: none; }
details.more summary:hover { border-color: var(--fg); color: var(--fg); }
details.more .menu { position: absolute; right: 0; z-index: 5; background: var(--chip); border: 1px solid var(--edge); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 240px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); font-size: .875rem; }

/* ---- Name people ---- */
.person-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.person-head .who { font-weight: 600; font-size: 1.125rem; letter-spacing: -.02em; color: var(--blue); }
.now { color: var(--blue); font-size: .8125rem; }
.members { margin: 10px 0 4px; display: grid; gap: 0; }
.member { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.member:first-child { border-top: 0; }
.member .what { min-width: 0; overflow-wrap: anywhere; }
.cliplist { grid-column: 2 / -1; display: grid; gap: 6px; padding: 2px 0 4px; }
.cliprow { display: flex; gap: 8px 12px; align-items: baseline; }
.cliprow .play { flex: none; }
.cliptext { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.saverow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.saverow .nm { width: min(260px, 100%); }

/* ---- transcript ---- */
.bulk { position: sticky; top: -1px; background: var(--chip); padding: 8px 0; z-index: 2; display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.turns { margin: 0; padding: 0; list-style: none; }
.turn { display: grid; grid-template-columns: 34px 9.5rem 3.2rem minmax(0, 1fr); gap: 6px 10px; padding: 7px 4px; border-bottom: 1px dashed var(--line); align-items: start; border-radius: 8px; }
.fixing .turn { grid-template-columns: 22px 34px 9.5rem 3.2rem minmax(0, 1fr); }
.turn .lab { font-weight: 600; overflow-wrap: anywhere; padding-top: 2px; }
.turn .lab.known { color: var(--peach); }
.turn .lab.unknown { color: var(--blue); }
.turn .lab.plain { color: var(--muted); }
.turn .tm { color: var(--muted); font: .75rem var(--mono); padding-top: 5px; }
.turn.hl { background: color-mix(in srgb, var(--blue) 14%, transparent); }
.turn.out .words { color: var(--muted); text-decoration: line-through; }
.outnote { font-size: .8125rem; color: var(--muted); }
.flag { margin-top: 4px; font-size: .8125rem; color: var(--peach); display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.w { cursor: default; }
.splitmode .w { cursor: crosshair; border-radius: 3px; }
.splitmode .w:hover, .splitmode .w:focus-visible { background: color-mix(in srgb, var(--blue) 22%, transparent); }
.md { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: .8125rem/1.6 var(--mono); margin: 8px 0 0; }
.titlein { flex: 1 1 240px; max-width: 480px; font-weight: 600; font-size: 1.0625rem; }
table.lib { border-collapse: collapse; width: 100%; margin-top: 6px; }
table.lib td, table.lib th { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.lib th { font: 500 .75rem var(--mono); color: var(--muted); }

/* ---- name-box suggestions ---- */
#picker { position: fixed; z-index: 50; display: none; overflow: auto; max-height: 280px; background: var(--chip); border: 1px solid var(--edge); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .16); font-size: .9375rem; padding: 4px; }
#picker div { padding: 7px 12px; cursor: pointer; white-space: nowrap; border-radius: 8px; }
#picker div.hi, #picker div:hover { background: var(--tint); }

/* ---- overlays ---- */
/* Toasts sit over the header bar (which stays put), so they never cover a name chip, a button or the transcript. */
#toast { position: fixed; top: 9px; left: 50%; transform: translate(-50%, -8px); width: min(560px, calc(100vw - 32px)); height: 41px; display: flex; align-items: center; justify-content: center; background: var(--fg); color: var(--bg); padding: 0 18px; border-radius: 999px; z-index: 60; opacity: 0; pointer-events: none; font-weight: 500; font-size: .8125rem; line-height: 1.25; text-align: center; }
#toast span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: no-preference) { #toast { transition: opacity .2s, transform .2s; } }
#drop { position: fixed; inset: 0; background: color-mix(in srgb, var(--blue) 12%, transparent); border: 3px dashed var(--blue); display: none; align-items: center; justify-content: center; font-size: 1.375rem; font-weight: 600; color: var(--blue); z-index: 40; pointer-events: none; }
dialog.dlg { border: 1px solid var(--edge); border-radius: 18px; padding: 20px 22px; width: min(480px, calc(100vw - 32px)); color: var(--fg); background: var(--chip); }
dialog.dlg::backdrop { background: rgba(0, 0, 0, .45); }
dialog.dlg h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; margin-bottom: 8px; }
.dlg-msg { white-space: pre-wrap; margin-bottom: 12px; }
.dlg-text { white-space: pre-wrap; max-height: 40vh; overflow: auto; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px 14px; margin: 8px 0 14px; }
dialog.dlg input[type=text] { width: 100%; }
progress { appearance: none; -webkit-appearance: none; height: 6px; border: 0; border-radius: 999px; background: var(--line); overflow: hidden; display: block; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--blue); }
progress::-moz-progress-bar { background: var(--blue); }

/* ---- account page ---- */
.page { max-width: 760px; margin: 0 auto; padding: clamp(18px, 4vw, 40px) clamp(16px, 3vw, 32px) 80px; }
.page h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 600; letter-spacing: -.04em; line-height: 1.1; margin-bottom: 18px; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 10px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.meter { margin-top: 8px; }
.cmd { position: relative; margin-top: 8px; }
.cmd pre { margin: 0; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; font: .8125rem/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.danger-zone { border-color: var(--bad); }
.danger-zone h2 { color: var(--bad); }
.form-grid { display: grid; gap: 10px; max-width: 360px; margin-top: 10px; }
.form-grid label { font-weight: 500; font-size: .875rem; }

/* ---- small screens: the list and the detail take turns ---- */
@media (max-width: 860px) {
  #toast { top: 0; left: 0; width: 100%; height: 59px; border-radius: 0; transform: none; padding: 0 16px; }
  #toast.show { transform: none; }
  body.app { height: auto; display: block; }
  main#main { display: block; }
  #list-pane { border-right: 0; overflow: visible; }
  #detail-pane { overflow: visible; padding: 14px 14px 80px; }
  main#main[data-view="list"] #detail-pane { display: none; }
  main#main[data-view="detail"] #list-pane { display: none; }
  main#main[data-view="detail"] .back { display: inline-block; }
  main#main[data-empty="1"] .back { display: none; }
  .bar .spacer { margin-left: 0; }
  .vrow { grid-template-columns: minmax(0, 1fr) auto; }
  .vrow .vlab { grid-column: 1; padding-top: 0; }
  .vrow .more-cell { grid-column: 2; grid-row: 1; justify-self: end; }
  .vrow .clips { grid-column: 1 / -1; padding-top: 0; }
  .vrow .namecell { grid-column: 1 / -1; }
  .vrow .speech { grid-column: 1 / -1; padding-top: 0; }
  .namecell .nm { max-width: none; }
  .turn, .fixing .turn { grid-template-columns: 34px minmax(0, 1fr); }
  .turn .lab { grid-column: 2; }
  .turn .tm { display: none; }
  .turn .body { grid-column: 2; }
  .fixing .turn { grid-template-columns: 22px 34px minmax(0, 1fr); }
  .fixing .turn .lab, .fixing .turn .body { grid-column: 3; }
  .member { grid-template-columns: 26px minmax(0, 1fr); }
  .member .secs { display: none; }
  .cliplist { grid-column: 2; }
  .cliprow { flex-wrap: wrap; }
  .cliptext { flex: 1 1 100%; }
  details.more .menu { right: -4px; min-width: min(250px, calc(100vw - 48px)); }
  .bar .btn { flex: 1 1 auto; }
  .site nav { gap: 14px; }
}
@media (min-width: 861px) {
  .turn .body { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

.lib-head { margin-top: 16px; }
.limits { margin-top: 12px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.meter progress { width: 100%; max-width: 360px; }

.sample-list { list-style: none; margin: 12px 0; padding: 0; }
.sample-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.sample-list li:first-child { border-top: 0; }
.card progress { width: 100%; }
.titlebtn { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 0; padding: 4px 0; cursor: pointer; }
.titlebtn:hover { color: var(--fg); text-decoration: underline; }
.row > h2 { flex: 1 1 12rem; min-width: 0; }
