/* Exam Scribe. One typeface (Atkinson Hyperlegible, made by the Braille Institute for easy reading),
   calm pine green for actions, recording red used only for recording. Large targets for touch and for
   people who don't live in software. */
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); }

:root {
  --bg: #eef2f1;
  --panel: #ffffff;
  --ink: #16262b;
  --muted: #53656a;
  --line: #d3dcda;
  --line-strong: #b5c3c0;
  --accent: #0f6b5e;
  --accent-hover: #0b574c;
  --accent-ink: #ffffff;
  --accent-soft: #e0efeb;
  --record: #c0392b;
  --record-soft: #fbe9e6;
  --good: #1d6f3f;
  --good-bg: #e3f2e8;
  --warn: #7f5400;
  --warn-bg: #fff2d4;
  --bad: #b3261e;
  --bad-bg: #fdeceb;
  --info-bg: #e6f0ee;
  --hl: #fff0a8;
  --focus: #1b74d4;
  --radius: 10px;
  --font: "Atkinson Hyperlegible", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101719;
    --panel: #172124;
    --ink: #e4ecea;
    --muted: #97a9a5;
    --line: #2a3a3d;
    --line-strong: #3d5155;
    --accent: #4fb8a4;
    --accent-hover: #6fcab8;
    --accent-ink: #062520;
    --accent-soft: #163330;
    --record: #f0776a;
    --record-soft: #3a1c19;
    --good: #6ccf94;
    --good-bg: #15301f;
    --warn: #f0c060;
    --warn-bg: #33290f;
    --bad: #f28b82;
    --bad-bg: #3a1b19;
    --info-bg: #18302d;
    --hl: #4a4216;
    --focus: #7db6ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 18px; letter-spacing: -0.01em; }
h2 { font-size: 20px; line-height: 1.3; margin: 0 0 10px; }
h3 { font-size: 17px; margin: 0 0 8px; }
p { margin: 0 0 8px; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--panel); padding: 8px 12px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 0 20px; min-height: 64px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 18px; height: 18px; border-radius: 50%; background: var(--record); box-shadow: 0 0 0 4px var(--record-soft); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; align-items: stretch; align-self: stretch; flex: 1; }
.nav a { display: flex; align-items: center; padding: 0 14px; min-height: 64px; color: var(--muted); text-decoration: none;
  font-weight: 700; border-bottom: 3px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a.on { color: var(--accent); border-bottom-color: var(--accent); }
.nav .nav-gap { flex: 1; }
.nav a.nav-minor { font-weight: 400; font-size: 15px; padding: 0 10px; }
.user { display: flex; gap: 14px; align-items: center; }
.who { display: flex; flex-direction: column; line-height: 1.25; text-align: right; font-size: 14px; }
.who-roles { color: var(--muted); font-size: 13px; }

.app { padding: 24px 20px 48px; }
.app:focus { outline: none; }
.page { max-width: 980px; margin: 0 auto; }
.page.wide { max-width: 1440px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.bad-text { color: var(--bad); }
.empty { padding: 28px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.title-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.title-row h1 { margin: 0; }

/* Forms */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.label { font-size: 14px; font-weight: 700; color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); }
input[type=text], input[type=email], input:not([type]), select, textarea {
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; min-height: 44px; background: var(--panel); width: 100%;
}
input[type=text]:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
input:disabled, select:disabled { opacity: 0.6; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { margin-top: 2px; }
.consent { margin-top: 12px; padding: 12px 14px; background: var(--warn-bg); border-radius: 8px; }

/* Buttons */
[hidden] { display: none !important; }
button, .button { cursor: pointer; border-radius: 8px; padding: 10px 18px; min-height: 44px; border: 1px solid transparent;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; line-height: 1.2; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
.primary, .button.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover:not(:disabled), a.button.primary:hover { background: var(--accent-hover); }
.secondary, .button.secondary { background: var(--panel); border-color: var(--line-strong); color: var(--ink); }
.secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.danger { background: var(--record); color: #fff; }
.link { background: none; color: var(--accent); padding: 6px 8px; min-height: 0; font-weight: 700; }
.link:hover { text-decoration: underline; }
.big { padding: 14px 26px; font-size: 18px; min-height: 54px; }
.small-btn { padding: 6px 12px; font-size: 14px; min-height: 36px; }

/* Tags, badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge.neutral, .badge.done { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.badge.busy { background: var(--info-bg); color: var(--accent); }
.badge.action { background: var(--warn-bg); color: var(--warn); }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.count { background: var(--bad-bg); color: var(--bad); padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); vertical-align: 2px; }

/* Home */
.home .greeting { font-size: 30px; margin-bottom: 20px; }
.record-hero { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 24px; margin-bottom: 28px; }
.record-button { display: inline-flex; align-items: center; gap: 16px; padding: 18px 30px 18px 22px; border-radius: 999px;
  background: var(--record); color: #fff; font-size: 22px; font-weight: 700; text-decoration: none; min-height: 72px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15); }
.record-button:hover { filter: brightness(1.06); }
.rec-dot { width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 7px var(--record), 0 0 0 2px #fff; }
.record-hint { flex: 1; min-width: 240px; max-width: 52ch; margin: 0; color: var(--muted); font-size: 17px; }
.record-hero.compact { padding: 14px 18px; border-radius: var(--radius); }
.record-hero.compact .record-button { font-size: 17px; min-height: 52px; padding: 10px 20px 10px 14px; gap: 12px; }
.record-hero.compact .rec-dot { width: 20px; height: 20px; box-shadow: inset 0 0 0 5px var(--record), 0 0 0 2px #fff; }
.record-hero.compact .record-hint { font-size: 15px; }
.home-section { margin-bottom: 30px; }
.home-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.home-head h2 { margin: 0; }
.home-section.lead .home-head h2 { font-size: 23px; }
.home-count { font-weight: 700; color: var(--muted); }
.home-all { margin-left: auto; font-weight: 700; }
.home-empty { margin: 0; padding: 14px 18px; background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.home-foot { margin-top: -8px; }
.work-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.work-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; min-height: 72px; color: var(--ink); text-decoration: none;
  border-top: 1px solid var(--line); }
.work-row:first-child { border-top: 0; }
.work-row:hover { background: var(--info-bg); }
.home-section.lead .work-row { min-height: 84px; }
.wr-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.wr-title { font-weight: 700; font-size: 17px; }
.wr-meta { color: var(--muted); font-size: 15px; }
.wr-note { color: var(--warn); font-size: 14px; font-weight: 700; }
.wr-note.quiet { color: var(--muted); font-weight: 400; }
.work-row:hover .wr-action { background: var(--accent-hover); }
.wr-action { flex: none; pointer-events: none; }
@media (max-width: 600px) {
  .work-row { flex-wrap: wrap; }
  .wr-action { width: 100%; }
  .record-button { width: 100%; justify-content: center; }
}

/* Lists, tabs, tables */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 14px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 700; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.tab.tab-aside { margin-left: auto; font-weight: 400; }
.table { width: 100%; border-collapse: collapse; background: var(--panel); }
.list > .table { border: 1px solid var(--line); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table th { font-size: 14px; color: var(--muted); font-weight: 700; background: var(--bg); }
.table.small th, .table.small td { padding: 8px 10px; font-size: 15px; }
.table tr.click { cursor: pointer; }
.table tr.click:hover { background: var(--info-bg); }
.table .num { text-align: right; white-space: nowrap; }
.table select { min-width: 180px; }
.row > select, .row > input[type=text] { width: auto; flex: 1 1 220px; }
.row > .field { flex: 1 1 180px; margin-bottom: 0; }
.row > input[type=file] { flex: 1 1 220px; }
.list { overflow-x: auto; }

.meta { display: flex; flex-wrap: wrap; gap: 10px 32px; margin-bottom: 14px; }
.meta > div { display: flex; flex-direction: column; }
.banner { padding: 12px 16px; border-radius: 8px; margin-bottom: 10px; }
.banner p:last-child { margin-bottom: 0; }
.banner .row { margin-top: 6px; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.warn select { color: var(--ink); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.info { background: var(--info-bg); }
.banner.good { background: var(--good-bg); color: var(--good); }

.recorder .rec-row { display: flex; align-items: baseline; gap: 16px; margin-bottom: 10px; }
.timer { font: 700 44px/1 var(--font); font-variant-numeric: tabular-nums; }
.rec-status.live { color: var(--record); font-weight: 700; }
.rec-status.paused { color: var(--warn); font-weight: 700; }
.meter { height: 12px; background: var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.meter-fill { height: 100%; width: 0; background: var(--good); transition: width 0.1s linear; }
.meter-fill.low { background: var(--warn); }
.meter-fill.paused { background: var(--muted); }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 12px 0; }
.progress-fill { height: 100%; width: 0; background: var(--accent); }
.preview, .player { width: 100%; margin: 8px 0; }




.review { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1000px) { .review { grid-template-columns: minmax(0, 1fr); } }
.note { font: 14px/20px var(--mono); min-height: 520px; resize: vertical; white-space: pre-wrap; }
.note[readonly] { background: var(--bg); }
.sticky { position: sticky; top: 64px; max-height: calc(100vh - 80px); display: flex; flex-direction: column; }
.transcript { overflow-y: auto; flex: 1; min-height: 200px; }
.seg { padding: 6px 8px; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; border-left: 3px solid transparent; }
.seg:hover { background: var(--info-bg); }
.seg.clin { border-left-color: var(--accent); }
.seg.pat { border-left-color: var(--good); }
.seg.hl { background: var(--hl); }
.seg-meta { font: 12px var(--mono); color: var(--muted); }

.findings h3 { margin-bottom: 12px; }
.finding { border: 1px solid var(--line); border-left-width: 4px; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; }
.finding.f-blocker { border-left-color: var(--bad); }
.finding.f-review { border-left-color: var(--warn); }
.finding.f-closed { opacity: 0.65; border-left-color: var(--good); }
.finding-head { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.sev { font-size: 14px; font-weight: 700; }
.sev.blocker { color: var(--bad); }
.sev.review { color: var(--warn); }
.excerpt { display: block; text-align: left; background: var(--bg); border: 1px dashed var(--line); font: 13px var(--mono); margin: 6px 0; width: 100%; white-space: pre-wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.chip { background: var(--info-bg); color: var(--accent); padding: 4px 12px; border-radius: 999px; font-size: 14px; min-height: 32px; font-weight: 700; }
.reason { flex: 1; min-width: 220px; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.attest { max-width: 520px; }
.discard summary { cursor: pointer; color: var(--muted); }
.history summary { cursor: pointer; color: var(--muted); margin: 8px 0; }

.toast { position: fixed; right: 16px; bottom: 16px; max-width: 420px; padding: 12px 16px; border-radius: 8px;
  background: var(--ink); color: var(--bg); box-shadow: 0 4px 16px rgba(0,0,0,0.2); z-index: 20; }
.toast.error { background: var(--bad); color: #fff; }
.toast.good { background: var(--good); color: #fff; }


.work-status { margin-top: 12px; white-space: pre-wrap; }
.prior { font: 13px/18px var(--mono); }
.copy-sections { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; }

/* Recording playback bar, fixed to the bottom of the review screen */
.playbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 12px; z-index: 15;
  width: min(760px, calc(100% - 24px)); background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.playbar-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.playbar .play { min-width: 72px; }
.playbar .scrub { flex: 1; min-width: 160px; accent-color: var(--accent); }
.playbar .time { font: 13px var(--mono); color: var(--muted); white-space: nowrap; }
.playbar .speed { width: auto; padding: 4px 6px; }
.playbar .clip { margin-left: auto; }
.playbar .volume { flex: 1; min-width: 140px; max-width: 280px; accent-color: var(--accent); }
.playbar .vol-label { min-width: 56px; color: var(--muted); font-variant-numeric: tabular-nums; }
.playbar .mute { min-width: 84px; }
.page.wide:has(~ .playbar) { padding-bottom: 170px; }
body:has(.playbar) .toast { bottom: 180px; }

.file-list { margin: 8px 0; padding-left: 22px; }
.file-list li { padding: 4px 0; }
.file-list .file-name { font: 13px var(--mono); }
.file-list button { margin-left: 6px; }
.passage { margin: 12px 0; padding: 12px 16px; border-left: 4px solid var(--accent); background: var(--info-bg); border-radius: 6px; line-height: 1.6; }

/* QuantumCore cases */
.page-viewer { max-height: 70vh; overflow: auto; }
.src-page { border-top: 1px solid var(--line); padding: 8px 0; }
.page-text, pre.doc { white-space: pre-wrap; word-break: break-word; font: 13px/1.5 var(--mono); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin: 6px 0; }
pre.doc { font-family: inherit; font-size: 14px; max-height: 70vh; overflow: auto; }
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 20; display: flex; justify-content: flex-end; }
.overlay-card { background: var(--panel); width: min(720px, 100%); height: 100%; overflow: auto; padding: 16px; }
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin-bottom: 6px; }
.qa { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.title-row-form { border-top: 1px solid var(--line); padding: 8px 0; }
.who-name { min-width: 160px; font-weight: 600; }
input.short { width: 110px; }
details.card > summary { cursor: pointer; }
details.card[open] > summary { margin-bottom: 12px; }
@media (max-width: 600px) {
  .card table.table { display: block; overflow-x: auto; }
}
input[type=file] { max-width: 100%; }
.sev.confirm { color: var(--accent); }
.finding.f-confirm { border-left-color: var(--accent); }
.card.inset { background: var(--bg); margin: 8px 0; }

@media (max-width: 860px) {
  .topbar { gap: 0 12px; padding: 8px 12px 0; }
  .user { margin-left: auto; }
  .nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nav a { min-height: 48px; white-space: nowrap; }
  .nav .nav-gap { flex: 0 0 12px; }
}
@media (max-width: 600px) {
  .app { padding: 18px 16px 40px; }
  h1, .home .greeting { font-size: 24px; }
  .who-roles { display: none; }
  .timer { font-size: 34px; }
  .card { padding: 16px; }
  .tab.tab-aside { margin-left: 0; }
}
.record { background: var(--record); color: #fff; }
.record:hover:not(:disabled) { filter: brightness(1.06); }
.rec-dot.small { width: 18px; height: 18px; box-shadow: inset 0 0 0 5px var(--record), 0 0 0 2px #fff; }
