/* enyu/static/app.css -- the page (spec 7.1): the 恩语 side panel at its
   native proportions on the right, the player on the left. Reproduced by
   inspection of the extension's stylesheet: the dark palette, the 3 px
   radius, and two type voices -- the system grotesque for what the software
   says, a Song serif for what the preacher said. System faces only. */
:root {
  color-scheme: dark;
  --ink: #0F131A;          /* ground */
  --ink-raised: #171D27;   /* wells, menus, anything lifted off the ground */
  --ink-hover: #1E2531;
  --ink-sunken: #0A0D13;   /* the frame: header, chat bar */
  --rule: #232A36;
  --rule-strong: #333D4D;
  --paper: #E9E4DA;        /* sermon text: warm, never white */
  --paper-dim: #A0A7B3;    /* interface text: cool, so the two never merge */
  --paper-faint: #848C9A;
  --gild: #C9A55D;
  --gild-bright: #E0BC74;
  --gild-soft: rgba(201, 165, 93, 0.13);
  --match: rgba(228, 180, 70, 0.42);
  --danger: #E2716A;
  --danger-bg: rgba(226, 113, 106, 0.13);
  --success: #74C08E;
  --radius: 3px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Source Han Sans SC', system-ui, sans-serif;
  --font-read: 'Iowan Old Style', Charter, 'Songti SC', 'Songti TC', STSong, 'Noto Serif CJK SC', 'Source Han Serif SC', SimSun, Georgia, serif;
  --mono: 'SF Mono', Menlo, Consolas, monospace;
  --panel-width: 400px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font); font-size: 13px; line-height: 1.6;
  color: var(--paper); background: var(--ink); overflow: hidden;
}
body.is-booting #app, body.is-booting #signin { visibility: hidden; }
button { font-family: inherit; }
[hidden] { display: none !important; }

/* ── the two voices ─────────────────────────────────────────────── */
.stage-title, .video-title, .result-title, .moment-text, .list-title, .section-title, .section-hook,
.summary-body, .transcript-text, .chat-turn-answer, .clip-text, .hero-heading h1 { font-family: var(--font-read); }

/* ── sign-in ────────────────────────────────────────────────────── */
.signin { max-width: 360px; margin: 18vh auto 0; padding: 0 24px; display: flex; flex-direction: column; gap: 12px; }
.signin .brand-name { font-size: 28px; font-weight: 600; letter-spacing: 0.02em; margin: 0; }
.signin-lead { color: var(--paper-dim); margin: 0 0 8px; }
.signin-form { display: flex; flex-direction: column; gap: 8px; }
.signin-message { color: var(--paper-dim); min-height: 1.6em; margin: 0; }

/* ── layout ─────────────────────────────────────────────────────── */
.app { display: flex; height: 100vh; }
.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px 20px; overflow-y: auto; }
.panel {
  width: var(--panel-width); flex: 0 0 var(--panel-width); height: 100vh;
  display: flex; flex-direction: column; border-left: 1px solid var(--rule); background: var(--ink); position: relative;
}
@media (max-width: 900px) {
  .app { flex-direction: column; height: auto; }
  body { overflow: auto; }
  .stage { flex: none; overflow-y: visible; }
  .panel { width: 100%; flex: none; height: auto; min-height: 70vh; border-left: none; border-top: 1px solid var(--rule); }
  /* Under the video, only the player and the clip bar: the chips (the Contents tab
     has them), the references and the title (the header has it) would push the
     tabs off a phone's screen. */
  .stage .stage-title, .stage .markers, .stage .references { display: none; }
  /* The video screen only (spec 7.3): scrolling the transcript/tabs below should
     not carry the player off screen with them. The finder's own placeholder in
     the same box is left to scroll normally. */
  body.screen-video .stage { position: sticky; top: 0; z-index: 5; background: var(--ink); border-bottom: 1px solid var(--rule); }
  /* Below it, pinned in order so a long transcript never carries them off: Back
     and the title, the tabs, and the transcript's search. Each sticks where the
     layer above ends, at heights the page measures (--pin-*: the player is
     taller as video than as audio). The brand band slides under the player; it
     comes back, with Settings, at the top of the page. */
  body.screen-video .header { position: sticky; top: calc(var(--pin-stage, 0px) - var(--pin-brand, 0px)); z-index: 4; }
  body.screen-video .tab-bar { position: sticky; top: calc(var(--pin-stage, 0px) + var(--pin-header, 0px) - var(--pin-brand, 0px)); z-index: 3; }
  /* The page scrolls here, not the list: a clipping panel would pin the search
     to itself, a box that never moves. */
  body.screen-video .transcript-panel { overflow: visible; }
  body.screen-video .transcript-search-bar { position: sticky; top: calc(var(--pin-stage, 0px) + var(--pin-header, 0px) - var(--pin-brand, 0px) + var(--pin-tabs, 0px)); z-index: 2; }
}

/* ── the stage ──────────────────────────────────────────────────── */
.stage-title { font-size: 17px; margin: 0; min-height: 1.4em; }
.player-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--ink-sunken); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.player-box iframe, .player-box #player { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Opaque: it covers YouTube's own message (a sign-in check, say) instead of printing over it. */
.player-error { position: absolute; inset: 0; margin: 0; background: var(--ink-sunken); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--paper-dim); padding: 16px; text-align: center; }
.player-error a { color: var(--gild); }
.player-box.is-audio { aspect-ratio: auto; }
.audio-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.audio-box audio { width: 100%; }
.audio-status { margin: 0; color: var(--paper-dim); font-size: 13px; }
.audio-youtube { color: var(--gild); font-size: 13px; }
.audio-offer { display: flex; gap: 12px; align-items: center; margin: 8px 0 0; }
.audio-note { margin: 6px 0 0; color: var(--paper-dim); font-size: 12px; }
.settings-check { display: flex; gap: 8px; align-items: center; color: var(--paper-dim); font-size: 14px; }
.clip-bounds { margin: 0; color: var(--paper-dim); font-size: 12px; }
.stage-empty { color: var(--paper-faint); margin: 0; }
.markers { display: flex; flex-wrap: wrap; gap: 4px; }
.marker {
  border: 1px solid var(--rule); background: transparent; color: var(--paper-dim); border-radius: 999px;
  padding: 3px 10px; font-size: 11.5px; cursor: pointer; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.marker:hover { border-color: var(--rule-strong); color: var(--paper); }
.marker.playing { background: var(--gild-soft); color: var(--gild-bright); border-color: var(--gild); }
.marker-time { font-variant-numeric: tabular-nums; color: var(--gild); margin-right: 6px; }
.references { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.references-label { color: var(--paper-faint); font-size: 11px; margin-right: 4px; }
.reference { border: none; background: var(--ink-raised); color: var(--paper-dim); border-radius: var(--radius); padding: 2px 8px; font-size: 11.5px; cursor: pointer; }
.reference:hover { color: var(--gild-bright); }

/* ── header ─────────────────────────────────────────────────────── */
.header { display: flex; flex-direction: column; border-bottom: 1px solid var(--rule); background: var(--ink-sunken); flex-shrink: 0; }
/* The brand on its own row, the artwork filling the width behind it: the
   local brand.jpg under /app/ (drop the file in enyu/static/), over a dark
   ground that stands in until it loads. The selected video has its own row. */
.brand-band {
  position: relative; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; min-height: 96px;
  background: var(--ink-sunken) url("brand.jpg") center bottom / cover no-repeat;   /* the lower part of the picture: rain on the leaves */
}
.brand-band::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 13, 19, 0.82) 0%, rgba(10, 13, 19, 0.35) 45%, rgba(10, 13, 19, 0.05) 100%); pointer-events: none; }
.brand-band > * { position: relative; }
.brand-btn { background: none; border: none; padding: 0; margin: 0; display: inline-flex; align-items: center; color: var(--paper); cursor: pointer; }
.brand-name { font-family: var(--font-read); font-size: 26px; font-weight: 600; letter-spacing: 0.12em; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }
.video-bar { display: flex; align-items: center; gap: 10px; padding: 8px 16px; min-height: 44px; border-top: 1px solid var(--rule); }
.back-pill {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 12px; background: var(--gild-soft); color: var(--gild);
  border: 1px solid var(--gild); border-radius: 999px; font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.back-pill:hover { background: rgba(201, 165, 93, 0.22); }
.video-info { flex: 1; min-width: 0; }
.video-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.video-duration { font-size: 11px; color: var(--paper-dim); margin: 0; }
.icon-btn { background: rgba(10, 13, 19, 0.55); border: none; cursor: pointer; color: var(--paper); padding: 6px; border-radius: 50%; display: flex; align-items: center; }
.icon-btn:hover { color: var(--paper); background: var(--ink-raised); }

/* ── banners and status ────────────────────────────────────────── */
.banner { margin: 8px 12px 0; padding: 6px 10px; border-radius: var(--radius); font-size: 11.5px; }
.banner-warn { background: var(--gild-soft); color: var(--gild-bright); border: 1px solid rgba(201, 165, 93, 0.35); }
.banner-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(226, 113, 106, 0.35); }
.status-block { color: var(--paper-dim); font-size: 11.5px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.status-block .provenance { color: var(--paper-faint); }
.status-block .error { color: var(--danger); }
.legend { margin: 0 12px 4px; font-size: 10.5px; color: var(--paper-faint); }
.legend .swatch-passage, .legend .swatch-match { display: inline-block; width: 10px; height: 10px; vertical-align: middle; margin-right: 4px; border-radius: 2px; }
.legend .swatch-passage { background: var(--gild-soft); border: 1px solid var(--gild); }
.legend .swatch-match { background: var(--match); }

/* ── settings ───────────────────────────────────────────────────── */
.settings { position: absolute; inset: 0; background: var(--ink); z-index: 20; display: flex; flex-direction: column; }
.settings-topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px; border-bottom: 1px solid var(--rule); }
.settings-title { margin: 0; font-size: 16px; font-weight: 500; }
.settings-close { width: 28px; height: 28px; border: none; border-radius: 50%; background: rgba(233, 228, 218, 0.06); color: var(--paper); cursor: pointer; font-size: 16px; }
.settings-body { flex: 1; overflow-y: auto; padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 8px; }
.settings-header { font-size: 12px; font-weight: 500; }
.settings-divider { height: 1px; background: var(--rule); margin: 6px 0 2px; }
.settings-email { margin: 0; color: var(--paper-dim); }
.settings-hint { margin: 0; font-size: 11px; color: var(--paper-faint); }
.usage { border-collapse: collapse; font-size: 11.5px; }
.usage td { padding: 2px 10px 2px 0; color: var(--paper-dim); }
.usage td:first-child { color: var(--paper); }
.lang-switch { display: flex; gap: 8px; margin: 8px 0 0; }
.lang-switch button[aria-pressed="true"] { border-color: var(--gild); color: var(--gild); }

/* ── inputs and buttons ────────────────────────────────────────── */
.field-label { display: block; font-size: 12px; font-weight: 500; color: var(--paper-dim); margin-bottom: 4px; }
.text-input {
  width: 100%; padding: 7px 10px; background: var(--ink-sunken); border: 1px solid var(--rule); border-radius: var(--radius);
  color: var(--paper); font-family: var(--font); font-size: 13px; outline: none;
}
.text-input::placeholder { color: var(--paper-faint); }
.text-input:focus { border-color: var(--gild); box-shadow: 0 0 0 3px var(--gild-soft); }
.textarea { resize: vertical; }
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 12px; border-radius: var(--radius);
  font-size: 12px; cursor: pointer; border: 1px solid var(--rule);
}
.btn-primary { background: var(--gild); color: var(--ink); border-color: var(--gild); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--gild-bright); }
.btn-secondary { background: var(--ink-raised); color: var(--paper); }
.btn-secondary:hover:not(:disabled) { background: var(--ink-hover); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.5; cursor: default; }
.btn-link { background: none; border: none; color: var(--gild); cursor: pointer; padding: 0; font-size: inherit; }
.btn-link:hover { color: var(--gild-bright); }
:where(button, a, input, select, textarea):focus-visible { outline: 2px solid var(--gild); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px; }

/* ── finder ─────────────────────────────────────────────────────── */
.finder { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 24px 20px 32px; display: flex; flex-direction: column; gap: 12px; }
/* The finder scrolls as a whole; its children keep their height. Without this
   a flex column squeezes the topic list to nothing once results exist below
   it, and a letter click shows no candidates on the second visit. */
.finder > * { flex-shrink: 0; }
.hero-heading h1 { font-size: 29px; font-weight: 700; line-height: 1.2; letter-spacing: -0.025em; margin: 0; }
.hero-accent { color: var(--gild); }
.search-row { display: flex; gap: 6px; }
.query { height: 40px; font-size: 14px; }
.search-go {
  height: 40px; padding: 0 14px; border: 1px solid var(--gild); border-radius: var(--radius); background: var(--gild); color: var(--ink);
  font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.search-go .search-dots { display: none; }
.search-go.is-busy .search-go-label { display: none; }
.search-go.is-busy .search-dots { display: inline-flex; }
.search-dots { display: inline-flex; gap: 3px; align-items: center; }
.search-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.35; animation: dots 1s infinite; }
.search-dots i:nth-child(2) { animation-delay: 0.2s; }
.search-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes dots { 0%, 80%, 100% { opacity: 0.35; } 40% { opacity: 1; } }
/* Loading, so the page never looks finished before it is: the Search button's dots,
   centred while sign-in is checked, then above the lists until they arrive. */
.boot-loading { position: fixed; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center; color: var(--gild); }
.boot-loading .search-dots { gap: 6px; }
.boot-loading .search-dots i { width: 8px; height: 8px; }
.finder-loading { display: flex; gap: 8px; align-items: center; margin: 12px 0; color: var(--paper-dim); font-size: 13px; }
.finder-loading .search-dots { color: var(--gild); }
.topic-rail { display: flex; flex-wrap: wrap; gap: 3px; }
.topic-letter, .topic-chip {
  background: transparent; border: 1px solid var(--rule); color: var(--paper-dim); border-radius: 999px; padding: 4px 11px;
  font-size: 12px; line-height: 1.5; cursor: pointer; white-space: nowrap; flex: 0 0 auto;
}
.topic-letter { width: 32px; padding: 4px 0; text-align: center; }
.topic-letter:disabled { opacity: 0.28; cursor: default; }
.topic-letter:hover:not(:disabled), .topic-chip:hover { border-color: var(--rule-strong); color: var(--paper); }
.topic-letter.active, .topic-chip.picked { background: var(--gild-soft); color: var(--gild-bright); border-color: var(--gild); }
.topic-chips { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow-y: auto; }
.topic-chip-wrap { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.topic-aliases { font-size: 10px; color: var(--paper-faint); }
.topic-show-all { background: none; border: none; color: var(--gild); cursor: pointer; padding: 0; text-align: left; font-size: 11.5px; }
/* ── the finder's lists (right-pane design, 2026-09-30): one heading, one row ──
   Recent and Highlights, and the search results' heading, read alike: a heading over
   a rule, then ruled rows of [lead | title over meta | ⋯]. A gold lead is a time the
   row plays from; a faint one is when the reader opened it. */
.recents-label { font-size: 11px; color: var(--paper-faint); }
.finder.is-searching .hero-heading { display: none; }
.list-section { display: flex; flex-direction: column; margin-top: 12px; }
.list-head { display: flex; align-items: baseline; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.list-heading { margin: 0; flex: 1; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--paper-dim); }
.recents-more { padding: 10px 12px; margin: -10px -12px; font-size: 12px; }
.list-row { display: flex; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--rule); }
.list-main {
  flex: 1; min-width: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 10px; align-items: baseline;
  padding: 8px 0; border: none; background: none; text-align: left; color: inherit; cursor: pointer; border-radius: var(--radius);
}
.list-main:hover:not(:disabled) { background: var(--ink-raised); }
.list-main:hover:not(:disabled) .list-title { color: var(--gild-bright); }
.list-main:disabled { cursor: default; opacity: 0.6; }
.list-lead { font-size: 11px; color: var(--paper-faint); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
.highlight-row .list-lead { color: var(--gild); }
.list-body { display: flex; flex-direction: column; min-width: 0; }
.list-title { font-size: 14px; line-height: 1.5; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { font-size: 11px; color: var(--paper-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-more {
  flex: 0 0 36px; width: 36px; height: 36px; border: none; background: none; color: var(--paper-faint);
  border-radius: var(--radius); font-size: 16px; line-height: 1; cursor: pointer;
}
.row-more:hover, .row-more[aria-expanded="true"] { color: var(--gild-bright); background: var(--gild-soft); }
.row-actions { flex-basis: 100%; display: flex; gap: 18px; padding: 0 0 8px 58px; font-size: 12.5px; }
.btn-link.danger { color: var(--danger); }
.btn-link:disabled { color: var(--paper-faint); cursor: default; }
.list-rename { flex: 1; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; column-gap: 8px; align-items: center; padding: 6px 0; }
.list-rename .list-lead { color: var(--gild); }
.list-rename .highlight-name { height: 32px; font-family: var(--font-read); font-size: 14px; }
.list-empty { margin: 0; padding: 12px 0 12px 58px; font-size: 12px; color: var(--paper-faint); border-bottom: 1px solid var(--rule); }
.results-head { margin-top: 4px; }
/* all highlights: the finder gives the pane to them, grouped by video */
.shelves.is-highlights-all > :not(#highlights) { display: none; }
.finder.is-highlights-all #highlights { margin-top: 0; gap: 10px; }
.is-highlights-all .list-head { align-items: center; gap: 12px; }
.list-back { flex: 0 0 auto; }
.is-highlights-all .list-heading { flex: 0 0 auto; font-size: 15px; letter-spacing: 0; color: var(--paper); }
.list-count { flex: 1; font-size: 12px; color: var(--paper-faint); }
.highlight-filter { height: 36px; }
.list-groups { display: flex; flex-direction: column; }
.list-group { display: flex; flex-direction: column; padding-top: 14px; }
.list-group-head { display: flex; align-items: baseline; gap: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--rule); }
.list-group-title { margin: 0; flex: 1; min-width: 0; font-family: var(--font-read); font-size: 12.5px; font-weight: 400; color: var(--paper-dim);
                    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-group-meta { flex: 0 0 auto; font-size: 11px; color: var(--paper-faint); }
.results-head .list-heading { flex: 0 0 auto; }
.results-head .search-status { flex: 1; }
.results-head .btn-link { padding: 10px 12px; margin: -10px -12px; font-size: 12px; }   /* a 44 px target, laid out as the word */
.search-status { margin: 0; font-size: 11.5px; color: var(--paper-dim); }
.result-meta { font-size: 10.5px; color: var(--paper-dim); margin: 3px 0 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.result-actions { display: flex; gap: 8px; align-items: center; }
.result-analyze { background: transparent; border: 1px solid var(--rule-strong); color: var(--paper-dim); border-radius: 999px; font-size: 11px; padding: 2px 10px; cursor: pointer; }
.result-analyze:hover { border-color: var(--gild); color: var(--gild-bright); background: var(--gild-soft); }
.result-toggle { border: none; background: none; color: var(--paper-faint); font-size: 11px; cursor: pointer; padding: 2px 0; }
.result-toggle:hover { color: var(--gild-bright); }
.moment { display: grid; grid-template-columns: 46px 1fr auto; column-gap: 10px; align-items: baseline; border: none; background: none; text-align: left; padding: 5px 0 5px 2px; border-radius: var(--radius); cursor: pointer; color: var(--paper-dim); }
.moment:hover { background: var(--ink-raised); }
.moment-time { font-size: 11px; color: var(--gild); font-variant-numeric: tabular-nums lining-nums; text-align: right; }
.moment-text { font-size: 12.5px; }
.arms { display: inline-flex; gap: 3px; }
.arm { font-size: 9.5px; border: 1px solid var(--rule); border-radius: 999px; padding: 0 6px; color: var(--paper-faint); text-transform: lowercase; }
mark { background: var(--match); color: var(--paper); border-radius: 2px; padding: 0 1px; }

/* ── video view ─────────────────────────────────────────────────── */
.video { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tab-bar { display: flex; background: var(--ink-sunken); border-bottom: 1px solid var(--rule); flex-shrink: 0; }
.tab { flex: 1; padding: 9px 4px; font-size: 11.5px; font-weight: 500; color: var(--paper-faint); background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--paper); background: var(--gild-soft); }
.tab.active { color: var(--gild); border-bottom-color: var(--gild); font-weight: 600; }
.tab-panel { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px; }
.sections { display: flex; flex-direction: column; }
.section { display: block; width: 100%; text-align: left; border: none; border-bottom: 1px solid var(--rule); background: none; padding: 7px 2px; cursor: pointer; color: var(--paper); }
.section:hover { background: var(--ink-raised); }
.section.playing { background: var(--gild-soft); }
.section-time { font-size: 11px; color: var(--gild); font-variant-numeric: tabular-nums; }
.section-title { font-size: 13px; font-weight: 600; margin: 0; }
.section-hook { font-size: 12px; color: var(--paper-dim); margin: 0; }
/* the outline (Plan 6): notes above, the hierarchy, the summary and questions below */
.notes { display: flex; flex-direction: column; gap: 4px; margin: 0 0 8px; padding: 6px 8px; border-left: 2px solid var(--gild); background: var(--ink-raised); }
.note { margin: 0; font-size: 12px; color: var(--paper-dim); }
.section-sub { padding-left: 22px; }
.section-sub .section-title { font-weight: 500; }
.section-framing .section-title { font-weight: 400; color: var(--paper-dim); }
.section-ordinal { color: var(--gild); margin-right: 4px; font-variant-numeric: tabular-nums; }
.section-role { font-size: 11px; color: var(--paper-faint); margin-left: 6px; }
.outline-summary { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--rule); font-size: 12.5px; }
.outline-thesis { margin: 0 0 6px; font-weight: 600; }
.outline-items { margin: 0; padding-left: 18px; }
.outline-items li { margin: 2px 0; }
.outline-closing { margin: 6px 0 0; color: var(--paper-dim); }
.outline-questions { margin: 8px 0 0; padding-left: 18px; }
.outline-missing { margin: 6px 0 0; font-size: 11.5px; color: var(--paper-faint); }
.attempts { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; margin-top: 8px; }
.attempt { border: none; background: none; color: var(--paper-dim); text-align: left; padding: 2px 0; cursor: pointer; }
.attempt:hover, .attempt.selected { color: var(--gild-bright); }
.summary-body { font-size: 13px; line-height: 1.7; }
.summary-body h1, .summary-body h2, .summary-body h3 { font-size: 14px; margin: 12px 0 4px; }
.summary-body p, .summary-body ul, .summary-body ol { margin: 0 0 8px; }
.summary-body code { font-family: var(--mono); font-size: 12px; background: var(--ink-raised); padding: 0 3px; border-radius: 2px; }
.summary-body pre { font-family: var(--mono); font-size: 12px; background: var(--ink-raised); padding: 8px; overflow-x: auto; }
.summary-body a { color: var(--gild); }
.transcript-panel { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
/* A bar around the box, so pinned on a phone the lines scroll under it, not past its margins. */
.transcript-search-bar { padding: 8px 12px; background: var(--ink); }
.transcript-search { width: 100%; }
.transcript-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 12px; display: flex; flex-direction: column; position: relative; }
.transcript-line { display: grid; grid-template-columns: 52px 1fr; column-gap: 8px; padding: 3px 4px; border-radius: var(--radius); }
.transcript-line.passage { background: var(--gild-soft); box-shadow: inset 2px 0 0 var(--gild); }
.transcript-line.playing { background: var(--ink-hover); box-shadow: inset 2px 0 0 var(--gild-bright); }
.transcript-line.passage.playing { background: rgba(201, 165, 93, 0.22); }
.transcript-line.playing .transcript-time { color: var(--gild-bright); font-weight: 600; }
.transcript-time { font-size: 11px; color: var(--gild); font-variant-numeric: tabular-nums; cursor: pointer; border: none; background: none; text-align: right; padding: 0; }
.transcript-text { font-size: 13px; }
.transcript-panel .actions { padding: 8px 12px; }
.selection-actions { position: fixed; z-index: 30; display: flex; gap: 6px; }
.selection-btn { background: var(--gild); color: var(--ink); border: none; border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); }
.chat-panel { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 10px; }
.chat-turn-question { color: var(--paper-dim); font-size: 12.5px; margin: 0; }
.chat-turn-answer { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.claim { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.claim-text { font-size: 13px; }
.cite { border: 1px solid var(--gild); background: none; color: var(--gild); border-radius: 999px; font-size: 10.5px; padding: 0 7px; cursor: pointer; font-family: var(--font); }
.cite:hover { background: var(--gild-soft); }
.badge { font-size: 9.5px; border-radius: 999px; padding: 0 6px; border: 1px solid var(--rule); color: var(--paper-faint); font-family: var(--font); }
.badge.unsupported { border-color: var(--danger); color: var(--danger); }
.chat-note { font-size: 10.5px; color: var(--paper-faint); margin: 0; }
.chat-turn.pending .chat-turn-answer { color: var(--paper-faint); font-style: italic; }
.chat-bar { margin: 0 10px 12px; border-radius: 16px; border: 1px solid rgba(0, 0, 0, 0.32); background: var(--ink-raised); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.32); display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0; }
#chat-input { width: 100%; padding: 12px 14px 4px; border: none; outline: none; font-size: 13px; font-family: var(--font); color: var(--paper); background: transparent; }
#chat-input::placeholder { color: var(--paper-faint); }
.chat-bar-actions { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px 8px; }
.chat-send { width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--gild); color: var(--ink); cursor: pointer; font-weight: 700; }
.chat-send:hover:not(:disabled) { background: var(--gild-bright); }
.chat-send:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── dialogs ────────────────────────────────────────────────────── */
.dialog { background: var(--ink-raised); color: var(--paper); border: 1px solid var(--rule-strong); border-radius: 6px; padding: 18px 20px; width: min(92vw, 440px); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.dialog-heading { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.dialog-title { margin: 0; font-size: 12.5px; color: var(--paper-dim); }
.dialog-range { margin: 4px 0 8px; font-size: 12px; color: var(--gild); font-variant-numeric: tabular-nums; }
.dialog-text { margin: 0 0 8px; font-size: 13px; }
.clip-text { max-height: 30vh; overflow-y: auto; white-space: pre-wrap; background: var(--ink-sunken); padding: 8px; border-radius: var(--radius); }
.dialog-note { margin: 0; font-size: 11px; color: var(--paper-faint); }
.dialog-cap { margin: 6px 0 0; font-size: 12px; color: var(--danger); }
.dialog-status { margin: 8px 0 0; font-size: 12px; color: var(--paper-dim); display: flex; align-items: center; gap: 8px; }
.dialog-status.is-error { color: var(--danger); }
.dialog-status:not(.is-busy) .search-dots { display: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ── Settings: API tokens and administration (Plan 7) ────────────── */
.token-new, .admin-grant { display: flex; gap: 6px; align-items: center; }
.token-new .text-input, .admin-grant .text-input { flex: 1; min-width: 0; }
.token-secret { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--gild); border-radius: var(--radius); background: var(--gild-soft); }
.token-secret .text-input { font-family: var(--mono); font-size: 11.5px; }
.token-list, .admin-list { display: flex; flex-direction: column; gap: 4px; }
.token-row, .admin-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 4px 0; border-bottom: 1px solid var(--rule); }
.token-name, .admin-email { color: var(--paper); }
.token-meta { color: var(--paper-faint); font-size: 11px; flex: 1; }
.admin-role { display: inline-flex; align-items: center; gap: 4px; color: var(--paper-dim); font-size: 11.5px; }

/* ── the contents editor, history and notices (Plan 7) ───────────── */
.notice { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 8px; margin-bottom: 8px;
          border: 1px solid var(--gild); border-radius: var(--radius); background: var(--gild-soft); color: var(--paper); font-size: 12px; }
.editor { display: flex; flex-direction: column; gap: 8px; }
.edit-row { display: flex; flex-wrap: wrap; gap: 4px 6px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.edit-row .edit-title, .edit-row .edit-hook, .edit-row .edit-item, .edit-row .edit-line { flex: 1 1 100%; min-width: 0; }
.edit-row .edit-kind, .edit-row .edit-role, .edit-row .edit-parent { flex: 1 1 30%; min-width: 0; }
.edit-row .edit-ordinal { flex: 0 0 56px; }
.edit-hook, .edit-thesis, .edit-closing { min-height: 44px; resize: vertical; }
.edit-errors { margin: 4px 0; padding-left: 18px; color: var(--danger); font-size: 12px; }
.history { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.history-row { display: flex; align-items: baseline; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--rule); }
.history-label { flex: 1; color: var(--paper-dim); font-size: 12px; }
.transcript-note { padding: 4px 12px 0; }
.transcript-line.tx-changed { background: var(--gild-soft); }
.transcript-line.tx-refused { box-shadow: inset 2px 0 0 var(--danger); }
.tx-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tx-edit { width: 100%; min-height: 1.6em; resize: vertical; font-family: var(--font-read); font-size: 13px; }
.tx-original { color: var(--paper-dim); font-size: 12px; }
.tx-revert { align-self: flex-start; font-size: 12px; }
.tx-view-line { color: var(--paper-dim); font-size: 12px; padding: 2px 0; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; font-size: 12px; }
.compare-label { margin: 0 0 4px; color: var(--paper-faint); }
.compare ol { margin: 0; padding-left: 18px; }

/* ── shelves (thumbnail shelves design, 2026-10-01) ─────────────────
   Strips of picture cards: in the stage on a computer, in the panel on a phone. */
.shelves { display: flex; flex-direction: column; min-width: 0; }
.strip { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding: 10px 0 8px; }
.card { flex: 0 0 150px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-main { display: flex; flex-direction: column; gap: 4px; padding: 0; border: none; background: none; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.card-main:disabled { cursor: default; opacity: 0.55; }
.card-main:hover:not(:disabled) .card-title { color: var(--gild-bright); }
.card-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--ink-raised); border: 1px solid var(--rule); }
.thumb { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 8px; background: var(--ink-raised); border-top: 2px solid var(--gild); }
.thumb-fallback-title { font-family: var(--font-read); font-size: 12px; line-height: 1.35; color: var(--paper); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-badge { position: absolute; right: 4px; bottom: 4px; padding: 0 5px; border-radius: 2px; background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.card-badge.is-time { left: 4px; right: auto; background: var(--gild); color: var(--ink); }
.card-title { font-size: 13px; line-height: 1.4; color: var(--paper); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: 11px; color: var(--paper-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-head { align-items: center; }
.strip-arrows { display: flex; gap: 4px; }
.strip-arrow { width: 28px; height: 24px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: none; color: var(--gild); cursor: pointer; }
.strip-arrow:disabled { opacity: 0.35; cursor: default; }
.shelves .list-empty { padding-left: 0; }
.card-more { align-self: flex-end; margin-top: -4px; }
.strip-panel { border: 1px solid var(--rule); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 8px; background: var(--ink-raised); }
.strip-panel-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.strip-panel-title { margin: 0; flex: 1; min-width: 0; font-family: var(--font-read); font-size: 13px; font-weight: 400; color: var(--paper); }
.strip-panel .row-actions { padding: 4px 0; }
/* A computer's finder screen: the stage holds the shelves, not an empty player.
   The player box moves off-screen, never display: none, so a video loaded before
   Back keeps playing (thumbnail shelves design §4.6). */
body.finder-stage .stage > .player-box { position: absolute; left: -10000px; top: 0; width: 480px; }
body.finder-stage .stage > :not(.player-box):not(.now-playing):not(.stage-empty):not(.shelves) { display: none; }
.now-playing { display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin-bottom: 4px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--ink-raised); }
.now-playing-title { flex: 1; min-width: 0; font-family: var(--font-read); color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
  .card { flex-basis: 120px; }
  .strip-arrows { display: none; }
  .finder.is-highlights-all > :not(#shelves) { display: none; }
}
.results-head { align-items: center; }
.result-quote { margin: 0; font-family: var(--font-read); font-size: 12px; line-height: 1.4; color: var(--paper-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result-quote mark { background: var(--match); color: var(--paper); }
.card .result-meta { margin: 0; gap: 6px; }
.card .result-actions { gap: 10px; }
.moments-panel .moment { width: 100%; }
