:root {
  --bg: #faf9f6; --panel: #ffffff; --ink: #1c1b18; --muted: #5f5c56; --line: #e6e3dc;
  --accent: #c2410c; --accent-ink: #ffffff; --warn-bg: #fbefe7; --warn-ink: #7a3a10;
  --bad: #c2362b; --good: #1d7a45;
}
/* Nov 21: light by default */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 46rem; margin: 0 auto; padding: 2rem 1rem 4rem; }
.brand { margin: 0 0 1.5rem; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); }
h1 { margin: 0 0 0.5rem; font-size: 2rem; line-height: 1.15; text-wrap: balance; }
h2 { margin: 2rem 0 0.5rem; font-size: 1.25rem; line-height: 1.25; text-wrap: balance; }
h3 { margin: 1.5rem 0 0.4rem; font-size: 1rem; }
p { margin: 0.5rem 0; }
.lead { font-size: 1.1rem; }
.promise { border-left: 3px solid var(--accent); padding: 0.25rem 0 0.25rem 0.9rem; }
a { color: var(--accent); }

#drop {
  display: block; margin-top: 1.5rem; padding: 2rem 1rem; text-align: center; cursor: pointer;
  background: var(--panel); border: 2px dashed var(--line); border-radius: 14px;
}
#drop.over { border-color: var(--accent); }
#drop.busy { opacity: 0.6; cursor: progress; }
#drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-title { display: block; font-weight: 600; font-size: 1.1rem; }
.drop-sub { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.9rem; }
#picker { display: block; margin: 1rem auto 0; max-width: 100%; font: inherit; color: inherit; }
.sample-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; color: var(--muted); }
select, button, textarea { font: inherit; color: inherit; }
select { max-width: 100%; padding: 0.4rem 0.5rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
button {
  padding: 0.5rem 0.9rem; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:focus-visible, select:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#status { min-height: 1.6rem; color: var(--muted); font-size: 0.95rem; }
#status[data-kind="ready"] { color: var(--good); }
#status[data-kind="error"] { color: var(--bad); }

#result:empty { display: none; }
#result { margin-top: 1.5rem; padding: 1rem 1.25rem 1.25rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
#result h2 { margin-top: 0.25rem; }
.synthetic { padding: 0.5rem 0.75rem; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.meta, .note { color: var(--muted); font-size: 0.92rem; }
.error { color: var(--bad); font-weight: 600; }
.ok { color: var(--good); font-weight: 600; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
th, td { padding: 0.4rem 0.6rem 0.4rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
/* Schibsted Grotesk's tnum also makes "." and "," full width ("5 . 8s"): text cells read as prose */
td[data-label="Cause"], td[data-label="Example evidence"] { font-variant-numeric: normal; }
ol, ul { padding-left: 1.25rem; }
li { margin: 0.3rem 0; }
.worst { list-style: none; padding-left: 0; }
.worst > li { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.your-id { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
textarea {
  display: block; width: 100%; margin: 0.5rem 0; padding: 0.6rem; resize: vertical;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  font: 0.85rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.cta { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); font-weight: 600; }
.how { margin-top: 2.5rem; }
.how p, .how li { color: var(--muted); }

/* File picker: the native control, styled to match the page's buttons. */
#picker::file-selector-button {
  margin-right: 0.75rem; padding: 0.5rem 0.9rem; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600;
}
#picker:disabled::file-selector-button { opacity: 0.5; cursor: not-allowed; }

/* Share column: a bar scaled to the largest cause, then the number. */
.causes .track { display: inline-block; width: 3.5rem; height: 0.5rem; margin-right: 0.4rem; vertical-align: middle;
  background: var(--line); border-radius: 4px; overflow: hidden; }
.causes .bar { display: block; height: 100%; background: var(--accent); }
.causes td:first-child { font-weight: 600; }
.causes td[data-label="Share"] { white-space: nowrap; }

/* Phones: each cause becomes a small card instead of a squeezed six-column table. */
@media (max-width: 560px) {
  .causes thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .causes, .causes tbody, .causes tr, .causes td { display: block; width: 100%; }
  .causes tr { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
  .causes td { border: 0; padding: 0.1rem 0; }
  .causes td:first-child { font-size: 1rem; }
  .causes td:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); }
  .causes .track { width: 5rem; }
}

/* All flagged: cause chips, search, CSV download, the list. */
.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0; }
.chip { padding: 0.3rem 0.7rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--ink); font-weight: 500; font-size: 0.88rem; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.flag-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
.flag-tools input { flex: 1 1 14rem; min-width: 0; padding: 0.45rem 0.6rem; font: inherit; color: inherit;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.flag-tools input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.flagged > tr:not(.detail) > td:first-child { white-space: nowrap; font-weight: 600; }
.st-bad { color: var(--bad); font-weight: 600; }
.st-maybe { color: var(--muted); }

/* Per-call timeline */
button.disclose { padding: 0; background: none; color: var(--accent); font-weight: 600; text-decoration: underline; }
button.disclose::after { content: " \25B8"; text-decoration: none; display: inline-block; }
button.disclose[aria-expanded="true"]::after { content: " \25BE"; }
/* max-width: 0 keeps the timeline from widening the list; its own wrapper scrolls instead */
tr.detail > td { max-width: 0; width: 100%; padding: 0.25rem 0 0.75rem; background: var(--bg); }
.timeline table { font-size: 0.85rem; }
.timeline td.over { color: var(--bad); font-weight: 700; }
.stack { display: flex; width: 6rem; height: 0.6rem; border-radius: 3px; overflow: hidden; background: var(--line); }
.seg { display: inline-block; height: 0.6rem; }
.legend .seg { width: 0.8rem; border-radius: 2px; vertical-align: middle; }
.seg.stt { background: #6b8fd6; } .seg.llm { background: #d19a3a; }
.seg.tool { background: #8a6bd6; } .seg.tts { background: #3aa58a; }
.timeline td, .timeline th { white-space: nowrap; }

.join{margin:20px 0 0;padding:16px 18px;border:1px solid var(--line, #dde3de);border-radius:12px}
.join h3{margin:0 0 6px;font-size:17px}.join p{margin:0 0 12px}
.join .btn{display:inline-block;padding:10px 16px;border-radius:8px;font-weight:600;text-decoration:none;background:var(--accent, #0f7a5a);color:#fff}

/* Cancel while a file is being checked */
.check-cancel { margin: 4px 0 12px; font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 999px; border: 1px solid currentColor; background: transparent; color: inherit; cursor: pointer; }
.check-cancel[hidden] { display: none; }
