/* Research Journal. Light by default, dark on request (~/theme-kit); every colour is a variable
   chosen for both themes, with text at 4.5:1 or better against its background.
   Three kinds of words get three looks, so they are never confused:
     the source's words   teal rule, serif         .src-words / .prov.src
     my thinking          amber label              .prov.me
     AI suggestions       violet card              .ai-card / .prov.ai                         */

:root {
  --bg: #f6f4ef; --surface: #ffffff; --surface-2: #f0ede6; --ink: #1d2025; --muted: #5a606b;
  --line: #ddd8cd; --accent: #2b5d8c; --accent-ink: #ffffff; --accent-soft: #e6eef6;
  --src: #1f6b78; --src-bg: #eef6f6; --ai: #6a43b8; --ai-bg: #f4effc; --me: #8a5a00; --me-bg: #fbf3e2;
  --ok: #1d7445; --ok-bg: #e7f4ec; --warn: #8f5200; --warn-bg: #fdf1e1; --bad: #b3261e; --bad-bg: #fdecea;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 2px 10px rgba(0, 0, 0, .04);
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --tk-bg: var(--surface); --tk-fg: var(--ink); --tk-line: var(--line);
}
:root[data-theme="dark"] {
  --bg: #131417; --surface: #1c1e22; --surface-2: #25272c; --ink: #ebe9e4; --muted: #a4a9b3;
  --line: #363940; --accent: #82b2e6; --accent-ink: #0f1a26; --accent-soft: #1d2a38;
  --src: #6cc0cc; --src-bg: #15282b; --ai: #c0a8f5; --ai-bg: #231d32; --me: #e2b25c; --me-bg: #2a2214;
  --ok: #6fd69a; --ok-bg: #16291e; --warn: #eab36a; --warn-bg: #2d2214; --bad: #f4928a; --bad-bg: #321a19;
  --shadow: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--sans); }
a { color: var(--accent); }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 4px 0 6px; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0; }
h3 { font-size: 1rem; margin: 0; }
p { margin: .4em 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
.noscript { padding: 24px; }

/* ---------------------------------------------------------------- chrome */
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
  .top { background: color-mix(in srgb, var(--bg) 96%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; white-space: nowrap; }
.brand img { border-radius: 7px; }
.tabs { display: flex; gap: 2px; margin: 0 auto; }
.tabs a { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; min-height: 40px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--accent-soft); color: var(--accent); }
.tab-icon { display: none; font-size: 1.15rem; line-height: 1; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); color: var(--ink); text-decoration: none; font-weight: 700; font-size: .85rem; border: 1px solid var(--line);
}
main { max-width: 920px; margin: 0 auto; padding: 20px max(18px, env(safe-area-inset-right)) 80px max(18px, env(safe-area-inset-left)); }
main[aria-busy="true"] { opacity: .65; transition: opacity .2s .15s; }
main:focus { outline: none; }
.loading { color: var(--muted); }

@media (max-width: 899px) { .brand span { display: none; } }
@media (max-width: 719px) {
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; justify-content: space-around;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .tabs a { flex-direction: column; gap: 0; padding: 4px 6px; font-size: .72rem; border-radius: 10px; min-height: 48px; justify-content: center; }
  .tab-icon { display: block; }
  /* A backdrop-filter on the header would make it the containing block for the fixed tab bar,
     pinning the bar to the header instead of the bottom of the screen. */
  .top { justify-content: space-between; background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.45rem; }
  .capture-btn { padding: 6px 12px; }
}

/* ---------------------------------------------------------------- controls */
.btn {
  font: inherit; font-weight: 600; font-size: .95rem; min-height: 44px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; line-height: 1.2;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small { min-height: 36px; padding: 4px 12px; font-size: .88rem; }
.btn.link { border-color: transparent; background: none; color: var(--accent); padding: 4px 8px; min-height: 36px; }
.btn.link:hover { text-decoration: underline; }
.btn.danger { color: var(--bad); }
.btn.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
:root[data-theme="dark"] .btn.danger-fill { color: #1b0e0d; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
input, select, textarea {
  font: inherit; font-size: 17px; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px;
}
textarea { line-height: 1.55; resize: vertical; min-height: 90px; display: block; }
textarea.grow { overflow: hidden; resize: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 0; }
::placeholder { color: var(--muted); opacity: .85; }
input[type="radio"], input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; padding: 0; flex: none; accent-color: var(--accent); }
fieldset .row { margin: 8px 0; align-items: flex-start; flex-wrap: nowrap; }
.title-edit {
  font-size: 1.55rem; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; border-color: transparent; background: transparent;
  padding: 4px 6px; margin: 2px -7px 4px; min-height: 0; width: calc(100% + 14px);
}
.title-edit:hover { border-color: var(--line); }
.title-wrap { margin: 0; font-size: inherit; }
.page-head select { width: auto; min-height: 36px; padding: 4px 10px; font-size: .9rem; }
.page-head input[type="text"] { margin-top: 4px; }
.done-state .row { justify-content: center; margin-top: 12px; }
.field { display: grid; gap: 6px; margin: 14px 0; }
.field > span, .field > legend { font-weight: 600; font-size: .95rem; padding: 0; }
fieldset.field { border: 0; padding: 0; min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.hint, .meta { color: var(--muted); font-size: .92rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.error { color: var(--bad); font-weight: 600; }
.chip {
  font: inherit; font-size: .88rem; border: 1px dashed var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 4px 12px; min-height: 34px; cursor: pointer;
}
.chip:hover { color: var(--accent); border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { font: inherit; font-size: .92rem; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); padding: 6px 14px; min-height: 40px; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; letter-spacing: .01em;
  padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.ai { background: var(--ai-bg); color: var(--ai); }
.badge.kind { text-transform: capitalize; }
.ai-card .badge, .notice .badge { white-space: normal; line-height: 1.35; padding: 3px 9px; }

/* who wrote it */
.prov { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; border-radius: 6px; padding: 1px 7px; vertical-align: 2px; }
.prov.src { color: var(--src); background: var(--src-bg); }
.prov.me { color: var(--me); background: var(--me-bg); }
.prov.ai { color: var(--ai); background: var(--ai-bg); }
.src-words {
  font-family: var(--serif); font-size: 1.06rem; line-height: 1.55; margin: 6px 0; padding: 10px 14px;
  background: var(--src-bg); border-left: 4px solid var(--src); border-radius: 4px 10px 10px 4px; white-space: pre-wrap;
}
.claimed { font-family: var(--serif); margin: 6px 0; padding: 8px 12px; border-left: 4px solid var(--muted); border-radius: 4px 10px 10px 4px; background: var(--surface); white-space: pre-wrap; }
.claimed.found { border-left: 4px solid var(--src); background: var(--src-bg); }
.claimed.not_found { border-left-color: var(--bad); }

/* ---------------------------------------------------------------- page parts */
.lede { font-size: 1.1rem; color: var(--muted); margin-top: 0; }
.crumbs { font-size: .92rem; margin-bottom: 4px; }
.crumbs a { text-decoration: none; }
.page-head { margin-bottom: 8px; }
.page-head .kicker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 18px 0; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.panel-head h2 { flex: 1; }
details.panel > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary h2 { flex: 1; }
details.panel > summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
details.panel:not([open]) > summary::after { transform: rotate(-90deg); }
.more { display: inline-block; margin-top: 8px; font-weight: 600; text-decoration: none; }
.empty { color: var(--muted); font-style: italic; }
.danger-zone { margin-top: 36px; padding-top: 12px; border-top: 1px solid var(--line); }

.start-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.start {
  text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; cursor: pointer; box-shadow: var(--shadow); min-height: 96px;
}
.start:hover { border-color: var(--accent); }
.start strong { display: block; font-size: 1.02rem; margin-bottom: 4px; color: var(--accent); }
.start span { color: var(--muted); font-size: .92rem; }
@media (max-width: 719px) { .start-grid { grid-template-columns: 1fr; } .start { min-height: 0; } }
.loop { margin: 6px 0 0; padding-left: 1.3em; }
.loop li { margin: 6px 0; }

.cards { display: grid; gap: 10px; margin-top: 8px; }
.card {
  display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; color: inherit; text-decoration: none;
}
.panel .card { background: var(--bg); }
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 4px; font-size: 1.02rem; line-height: 1.35; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.group-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 6px; }

/* ---------------------------------------------------------------- the person's sections */
.sec { padding: 12px 0; border-top: 1px solid var(--line); }
.sec:first-child { border-top: 0; }
.sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sec-title { flex: 1; font-size: 1rem; }
.sec-status { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.sec-status.bad { color: var(--bad); font-weight: 700; }
.sec-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.sec-notice { background: var(--warn-bg); color: var(--ink); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.sec-notice .other-version { white-space: pre-wrap; background: var(--surface); border-radius: 8px; padding: 8px 10px; margin: 6px 0; max-height: 240px; overflow: auto; }
.sec.attention { border-left: 4px solid var(--me); padding-left: 12px; margin-left: -16px; }
.locked { background: var(--me-bg); border-radius: 10px; padding: 10px 14px; }
.locked-text { white-space: pre-wrap; margin: 0 0 6px; }
.skipped { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.depth { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; }

/* ---------------------------------------------------------------- media, quotes, thoughts */
.player { margin: 6px 0 10px; }
.player.video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.player.video iframe, .player.video .yt-holder { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player audio, .player video { width: 100%; border-radius: 10px; }
.capture-bar { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; margin: 8px 0; }
.capture-bar textarea { min-height: 44px; }
@media (max-width: 560px) { .capture-bar { grid-template-columns: 1fr auto; } .capture-bar .time-chip { grid-column: 1 / -1; justify-self: start; } }
.time-chip {
  font: inherit; font-variant-numeric: tabular-nums; font-weight: 700; font-size: .9rem; min-height: 44px; padding: 6px 12px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; white-space: nowrap;
}
.time-chip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.time {
  font: inherit; font-variant-numeric: tabular-nums; font-weight: 700; font-size: .85rem; color: var(--accent);
  background: var(--accent-soft); border: 0; border-radius: 6px; padding: 2px 8px; cursor: pointer; text-decoration: none;
}
span.time { cursor: default; color: var(--muted); background: var(--surface-2); }
.thoughts { list-style: none; padding: 0; margin: 8px 0 0; }
.thought { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.thought:first-child { border-top: 0; }
.thought p { margin: 0; white-space: pre-wrap; }
.thought .time-slot { min-width: 3.6em; padding-top: 2px; }
.row-actions { display: flex; gap: 2px; flex-wrap: wrap; }
.quotes { display: grid; gap: 14px; margin-top: 10px; }
.quote { margin: 0; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.quote:last-child { border-bottom: 0; padding-bottom: 0; }
.quote figcaption { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.my-reading { margin: 8px 0 0; padding: 8px 12px; background: var(--me-bg); border-radius: 10px; }
.my-reading p { margin: 4px 0 0; white-space: pre-wrap; }
.chapter { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; margin: 10px 0; background: var(--bg); }
.chapter > summary { cursor: pointer; font-weight: 700; padding: 8px 0; min-height: 40px; }
.chapter .panel { box-shadow: none; margin: 6px 0; }
.source-text { min-height: 180px; font-family: var(--serif); }

/* ---------------------------------------------------------------- connections */
.conns { list-style: none; padding: 0; margin: 8px 0 0; }
.conn { padding: 8px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.conn:first-child { border-top: 0; }
.conn .rel { color: var(--muted); font-size: .9rem; }
.conn a { font-weight: 600; }
.conn-note { flex-basis: 100%; margin: 0; color: var(--ink); font-size: .95rem; white-space: pre-wrap; }
.conn-actions { margin-left: auto; }
.pick-list { list-style: none; padding: 0; margin: 8px 0; max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.pick-list li { border-top: 1px solid var(--line); }
.pick-list li:first-child { border-top: 0; }
.pick-list button { width: 100%; text-align: left; font: inherit; background: none; border: 0; color: var(--ink); padding: 10px 12px; cursor: pointer; display: flex; gap: 8px; align-items: center; min-height: 44px; }
.pick-list button:hover, .pick-list button[aria-pressed="true"] { background: var(--accent-soft); }
.sentence { display: grid; gap: 8px; margin: 10px 0; }
.sentence .item { font-weight: 700; }

/* ---------------------------------------------------------------- AI */
.ai-panel .intro { margin-top: 2px; }
.tools { display: grid; gap: 10px; margin: 12px 0; }
.tool { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.tool-text { flex: 1 1 260px; }
.tool .gate { flex: 1 1 100%; margin: 0; color: var(--warn); font-weight: 600; font-size: .92rem; }
.review { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 14px 0; background: var(--bg); }
.review-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.review-head h3 { flex: 1; }
.steps { padding-left: 1.3em; margin: 8px 0; }
.steps > li { margin: 10px 0; }
.prompt-text { white-space: pre-wrap; font: .85rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; max-height: 300px; overflow: auto; }
.snapshot { white-space: pre-wrap; background: var(--me-bg); border-radius: 10px; padding: 10px 12px; margin: 6px 0; }
.notice { border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: var(--warn-bg); }
.notice.ok { background: var(--ok-bg); }
.notice.bad { background: var(--bad-bg); }
.ai-card { background: var(--ai-bg); border: 1px solid var(--line); border-left: 4px solid var(--ai); border-radius: 6px 12px 12px 6px; padding: 12px 14px; margin: 12px 0; }
.f-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.f-point { margin: 6px 0; font-size: 1.02rem; }
.f-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 10px; margin: 8px 0; font-size: .94rem; }
.f-meta dt { color: var(--muted); font-weight: 600; }
.f-meta dd { margin: 0; }
.f-q { margin: 8px 0; padding: 8px 10px; background: var(--surface); border-radius: 8px; }
.decide { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; align-items: center; }
.decide .btn[aria-pressed="true"].accept { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.decide .btn[aria-pressed="true"].reject { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.decide .btn[aria-pressed="true"].revise { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.my-note textarea { min-height: 60px; background: var(--surface); }
.raw { white-space: pre-wrap; font-size: .9rem; }
.ai-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ---------------------------------------------------------------- dialogs, toast, auth */
dialog {
  border: 0; border-radius: 18px; padding: 0; width: min(640px, calc(100vw - 20px)); max-height: calc(100dvh - 32px);
  background: var(--surface); color: var(--ink); box-shadow: 0 12px 48px rgba(0, 0, 0, .3); display: flex; flex-direction: column;
}
dialog:not([open]) { display: none; }
dialog.wide { width: min(820px, calc(100vw - 20px)); }
dialog::backdrop { background: rgba(10, 12, 16, .45); }
.dlg-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { flex: 1; font-size: 1.15rem; }
/* min-height: 0 lets the body shrink and scroll inside the dialog, keeping the title bar in place */
.dlg-body { padding: 6px 20px 18px; overflow: auto; -webkit-overflow-scrolling: touch; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.dlg-foot.inline { padding: 14px 0 0; border-top: 0; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 50;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; max-width: calc(100vw - 32px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}
.toast.bad { background: var(--bad); color: #fff; }
@media (max-width: 719px) { .toast { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.auth { max-width: 420px; margin: 7vh auto 0; }
.auth h1 { margin-top: 10px; }
.auth-icon { border-radius: 14px; }
.auth .btn.primary { width: 100%; margin-top: 8px; }
.results { list-style: none; padding: 0; }
.results li { padding: 10px 0; border-top: 1px solid var(--line); }
.results li:first-child { border-top: 0; }
.results a { font-weight: 700; text-decoration: none; }
.results p { margin: 2px 0 0; }
mark { background: color-mix(in srgb, var(--warn) 28%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.done-state { text-align: center; padding: 12px 0; }
.version { margin-top: 40px; text-align: center; }

@media print {
  .top, .tabs, .toast, .btn, .chip, .sec-tools, .capture-bar, .player { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}
