:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --sunken: #fbfaf7;
  --chip-bg: #f0eee8;
  --text: #15161a;
  --muted: #5a5e68;
  --line: #e4e2dc;
  --line-strong: #cfccc4;
  --ink: #15161a;
  --ink-text: #ffffff;
  --accent: #c2255c;
  --accent-ink: #ffffff;
  --mark-on: rgba(0, 0, 0, 0.45);
  --mark-off: #ffe7a0;
  --mark-off-line: #b7791f;
  --error: #c92a2a;
  --success: #2b8a3e;
  --footer-bg: #15161a;
  --footer-text: #b9bcc4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(21, 22, 26, 0.04), 0 12px 32px -12px rgba(21, 22, 26, 0.14);
  --header-h: 64px;
  color-scheme: light;
}
/* Dark colours follow the system unless the header switch picked a theme (static/theme.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #111216;
    --surface: #1a1b20;
    --sunken: #15161a;
    --chip-bg: #25272d;
    --text: #ecedf0;
    --muted: #a0a4ad;
    --line: #2c2e35;
    --line-strong: #3d4048;
    --ink: #ecedf0;
    --ink-text: #111216;
    --accent: #f06595;
    --accent-ink: #111216;
    --mark-on: rgba(160, 166, 178, 0.4);
    --mark-off: #5c3d1e;
    --mark-off-line: #e8a13a;
    --error: #ff8787;
  --success: #69db7c;
    --success: #69db7c;
    --footer-bg: #0b0c0f;
    --footer-text: #a0a4ad;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #111216;
  --surface: #1a1b20;
  --sunken: #15161a;
  --chip-bg: #25272d;
  --text: #ecedf0;
  --muted: #a0a4ad;
  --line: #2c2e35;
  --line-strong: #3d4048;
  --ink: #ecedf0;
  --ink-text: #111216;
  --accent: #f06595;
  --accent-ink: #111216;
  --mark-on: rgba(160, 166, 178, 0.4);
  --mark-off: #5c3d1e;
  --mark-off-line: #e8a13a;
  --error: #ff8787;
  --success: #69db7c;
  --footer-bg: #0b0c0f;
  --footer-text: #a0a4ad;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -12px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

@font-face {
  font-family: 'Geist'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/geist-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/geist-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist Mono'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/geist-mono-latin-wght-normal.woff2) format('woff2');
}
:root { --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  overflow-wrap: break-word;
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; gap: 8px 24px; min-height: var(--header-h); }
.logo { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.logo-mark { display: block; flex: none; }
.lm-bg { fill: var(--ink); }
.lm-bar { fill: var(--ink-text); }
.lm-accent { fill: #c2255c; }
.site-footer .lm-bg { fill: #fff; }
.site-footer .lm-bar { fill: #15161a; }
.site-header nav { display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.logo, .header-actions { flex: none; }
.site-header nav a { white-space: nowrap; text-decoration: none; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-size: 0.95rem; }
.site-header nav a:hover { color: var(--text); background: var(--chip-bg); }
.site-header nav a[aria-current='page'] { color: var(--text); background: var(--chip-bg); font-weight: 600; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.header-actions .btn { padding: 9px 16px; font-size: 0.94rem; background: var(--ink); color: var(--ink-text); border-color: transparent; }
.header-actions .btn:hover { opacity: 0.88; }
.header-link { text-decoration: none; padding: 8px 4px; color: var(--muted); font-size: 0.95rem; white-space: nowrap; }
.header-link:hover, .header-link[aria-current='page'] { color: var(--text); }
.header-link[aria-current='page'] { font-weight: 600; }
.theme-changing, .theme-changing * { transition: none !important; }
.theme-button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.theme-button:hover { color: var(--text); border-color: var(--line-strong); }
@media (max-width: 960px) {
  /* Logo and actions on the first row; the tool links get a full-width row that scrolls sideways. */
  .site-header .wrap { flex-wrap: wrap; padding-top: 10px; gap: 6px 12px; }
  .site-header nav {
    order: 2; flex: 1 0 100%; margin: 0 -16px; padding: 0 16px 8px; overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
  }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav a { padding: 8px 10px; }
}

/* Hero with the tool beside the copy */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 72px; }
.hero h1 { font-size: clamp(2.25rem, 4.4vw, 3.5rem); line-height: 1.12; letter-spacing: -0.035em; margin: 0 0 20px; }
/* The headline blacks out its own key word. */
.redacted { display: inline-block; line-height: 0.86; padding: 0 6px; border-radius: 4px; background: var(--ink); color: var(--ink); }
.lead { color: var(--muted); font-size: 1.19rem; max-width: 520px; margin: 0; }
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 32px; padding-bottom: 40px; }
  .lead { font-size: 1rem; margin-bottom: 0; }
}
/* Once a file is open the editor takes the whole width and the marketing copy steps aside. */
.hero:has(.workspace:not([hidden])) { grid-template-columns: minmax(0, 1fr); padding: 0; max-width: none; }
.hero:has(.workspace:not([hidden])) .hero-copy { display: none; }

.tool { min-height: 260px; min-width: 0; }
.btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px; padding: 10px 16px; min-height: 40px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { border-color: var(--line-strong); }
.btn.primary { background: var(--ink); color: var(--ink-text); border-color: transparent; width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 12px; }
.btn.primary:hover { opacity: 0.9; }
.btn.primary:disabled { opacity: 0.55; cursor: progress; }
.btn[aria-busy='true'] { opacity: 0.6; pointer-events: none; cursor: progress; }
.btn.ghost { padding: 6px 12px; min-height: 36px; font-size: 0.9rem; }

/* File intake */
.intake { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 12px; box-shadow: var(--shadow); }
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  min-height: 300px; padding: 32px 24px; cursor: pointer; border-radius: 12px; gap: 12px;
  border: 1.5px dashed var(--line-strong); background: var(--sunken); transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); }
.drop.over { background: color-mix(in srgb, var(--accent) 6%, var(--sunken)); }
.drop-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--ink); color: var(--ink-text); }
.drop-icon svg { display: block; }
.drop-title { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.drop-or { color: var(--muted); font-size: 0.95rem; }
.drop-sub { color: var(--muted); font-size: 0.875rem; max-width: 420px; }
.drop-or kbd {
  font: 400 0.75rem var(--mono); padding: 2px 6px; color: var(--text);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface);
}
.paste { display: grid; gap: 8px; margin: 14px 4px 4px; }
.paste label { font-weight: 600; font-size: 0.92rem; }
/* With a keyboard the shortcut covers pasting, so the box is only for touch screens (and the text page). */
@media (hover: hover) and (pointer: fine) { .paste:not(.always) { display: none; } }
/* Touch screens can neither drop files nor use the shortcut. */
@media (hover: none), (pointer: coarse) { .drop-here, .drop-or { display: none; } .paste textarea { font-size: 16px; } }
@media (max-width: 640px) { .drop { min-height: 0; padding: 28px 16px; gap: 10px; } .drop-icon { width: 48px; height: 48px; border-radius: 12px; } .drop-title { font-size: 1.125rem; } .drop-sub { font-size: 0.8125rem; } .intake { border-radius: 18px; padding: 10px; box-shadow: none; } }
textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
}
textarea { resize: vertical; }

.status { margin: 12px 0; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.status.error { border-color: var(--error); color: var(--error); }
.panel .status { margin: 12px 0 4px; font-size: 0.92rem; }
.panel-foot .status { margin: 0; }
.status.busy { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--accent); font-weight: 600; }
.status.busy::before {
  content: ''; flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status.success { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--success); background: color-mix(in srgb, var(--success) 8%, var(--surface)); font-weight: 600; }
.status.success::before {
  content: ''; flex: none; width: 18px; height: 18px; background: var(--success);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.5 12.5l5 5L19.5 7' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4.5 12.5l5 5L19.5 7' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (prefers-reduced-motion: reduce) { .status.busy::before { animation-duration: 2.4s; } }
.warn { margin: 0; font-size: 0.92rem; }
.consent { margin: 14px 0 4px; padding: 14px; border: 1.5px solid var(--accent); border-radius: 12px; display: grid; gap: 10px; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.consent p { margin: 0; font-size: 0.92rem; }
.warn-text { margin: 0 0 10px; }
.warn-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Editor: while a file is open the page becomes an app, with the review panel down the left and the preview beside it. */
.doc-bar { display: none; }
body.editing .site-header { position: sticky; top: 0; z-index: 30; }
body.editing .site-header nav, body.editing .site-footer, body.editing main > section:not(.hero) { display: none; }
body.editing .doc-bar { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; padding-left: 16px; border-left: 1px solid var(--line); }
body.editing .site-header .wrap { max-width: none; padding: 0 20px; }
.doc-type { flex: none; font: 500 0.6875rem var(--mono); padding: 3px 7px; border-radius: 5px; background: var(--chip-bg); }
.doc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.doc-bar .btn { flex: none; margin-left: auto; }
.doc-bar .btn svg { display: block; }
body.editing .hero { max-width: none; padding: 0; }
.workspace { display: grid; grid-template-columns: 380px minmax(0, 1fr); align-items: start; }
.panel {
  display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line);
  position: sticky; top: var(--header-h); overflow: hidden;
  height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
}
.panel-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 20px; overscroll-behavior: contain; }
.panel-body > .status:first-child { margin-top: 0; }
.panel-foot { flex: none; display: grid; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.panel-foot .row { margin: 0; }
.btn-icon svg { display: block; }
.stage { min-width: 0; padding: 0 24px 48px; }
.preview-bar {
  position: sticky; top: var(--header-h); z-index: 5; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 0 -24px 24px; padding: 10px 24px; min-height: 48px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 0.8125rem;
}
.key { display: flex; align-items: center; gap: 8px; }
.swatch { width: 14px; height: 10px; border-radius: 2px; background: var(--mark-on); }
.swatch.off { background: var(--mark-off); outline: 1px dashed var(--mark-off-line); outline-offset: -1px; }
.tabs { display: none; }
/* Pages read best at about a sheet's width; the spreadsheet grid takes the whole column. */
.preview:not(:has(.sheet-view)) { max-width: 880px; margin: 0 auto; }
@media (max-width: 900px) {
  body.editing .site-header .wrap { flex-wrap: nowrap; padding: 0 8px 0 16px; min-height: 56px; gap: 10px; }
  body.editing .header-actions { display: none; }
  body.editing .site-header .logo { font-size: 0; gap: 0; }
  body.editing .doc-bar { padding-left: 0; border-left: 0; }
  body.editing .site-header { border-bottom: 0; }
  .panel-body > h3:first-of-type { display: none; }
  body.editing .doc-type { display: none; }
  .doc-bar .btn.ghost { border: 0; background: none; min-height: 44px; }
  .doc-bar .btn svg { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .tabs {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; position: sticky; top: 56px; z-index: 6;
    padding: 0 16px 10px; background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .tabs button { font: inherit; font-size: 0.875rem; font-weight: 600; min-height: 40px; border-radius: 10px; cursor: pointer; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
  .tabs button[aria-selected='true'] { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
  .panel { position: static; height: auto; overflow: visible; border-right: 0; background: none; }
  .panel-body { overflow: visible; padding: 16px; }
  /* The preview tab keeps the panel's status and consent prompt above the preview. */
  .workspace[data-view='preview'] .panel-body > :not(.status, .consent) { display: none; }
  .workspace[data-view='preview'] .panel-body:not(:has(> .status:not([hidden]), > .consent:not([hidden]))) { display: none; }
  .workspace[data-view='found'] .stage { display: none; }
  .stage { padding: 0 16px 24px; }
  .preview-bar { top: 106px; margin: 0 -16px 16px; padding: 8px 16px; min-height: 40px; }
  /* On a phone the download stays at the bottom of the screen. */
  .panel-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, 0.25); }
  /* One control per line: the check, the style, then the download button. */
  .panel-foot { gap: 8px; }
  .panel-foot > .status, .panel-foot > .warn { order: -2; }
  .panel-foot > .check-row { white-space: nowrap; }
  .panel-foot > .transcript { order: 1; }
  .panel-foot .style-row select { min-height: 40px; }
  .panel-foot .btn.primary { white-space: nowrap; font-size: 1rem; min-height: 52px; padding: 12px; }
  body:has(.workspace:not([hidden])) { padding-bottom: 180px; }
  .sel-add { bottom: 180px; }
}
.panel .btn.transcript { width: 100%; padding: 10px 16px; }
.panel h3 { font-size: 0.875rem; font-weight: 600; margin: 28px 0 10px; }
.panel-body > h3:first-of-type { margin-top: 0; }
.types { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; align-items: center; font-size: 0.8125rem; font-weight: 500; min-height: 34px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; background: var(--surface); color: var(--muted); }
.chip:hover { border-color: var(--line-strong); }
.chip:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The checkbox stays for keyboards and screen readers; the pill shows its state. */
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.findings { margin-bottom: 4px; display: grid; gap: 8px; }
.group { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.group summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; display: flex; align-items: center; gap: 8px; list-style: none; padding: 10px 12px; background: var(--sunken); }
.group[open] summary { border-bottom: 1px solid var(--line); }
.group summary::-webkit-details-marker { display: none; }
.group input, .finding input { accent-color: var(--ink); width: 16px; height: 16px; margin: 0; flex: none; }
.count { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.finding { display: flex; gap: 10px; align-items: center; padding: 8px 12px; font-size: 0.9rem; cursor: pointer; }
.finding + .finding { border-top: 1px solid var(--line); }
.finding:hover { background: var(--sunken); }
.finding .ftext { overflow-wrap: anywhere; flex: 1; font-family: var(--mono); font-size: 0.82rem; }
.finding.off .ftext { color: var(--muted); text-decoration: line-through; }
.finding small { color: var(--muted); }
.public-pref { display: flex; gap: 8px; align-items: center; margin: 0; padding: 10px 12px; border: 1px dashed var(--mark-off-line); border-radius: 10px; background: var(--mark-off); font-size: 0.9rem; cursor: pointer; }
.public-pref input, .check-row input { accent-color: var(--ink); }
.row.check-row { color: var(--text); }
.check-row input { width: 18px; height: 18px; margin: 0; flex: none; }
.empty, .manual-count, .hint { color: var(--muted); font-size: 0.9rem; }
.empty { margin: 0; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.row { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: 0.9rem; color: var(--muted); }
.row select { flex: 1; }
.meta { margin: 22px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }
.meta dl { display: grid; grid-template-columns: minmax(84px, max-content) 1fr; gap: 4px 12px; margin: 0; font-size: 0.88rem; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.meta details { margin-top: 8px; }
.meta details dl { margin-top: 8px; max-height: 240px; overflow: auto; }
.meta summary { cursor: pointer; font-size: 0.9rem; }
.notes { padding-left: 18px; color: var(--muted); font-size: 0.85rem; margin: 16px 0 0; }
.notes:empty { display: none; }

.preview { min-width: 0; }
.preview .hint { margin-top: 0; }
.page { position: relative; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(21, 22, 26, 0.1), 0 8px 24px -10px rgba(21, 22, 26, 0.18); background: #fff; border-radius: 3px; overflow: hidden; line-height: 0; }
.page canvas { width: 100%; height: auto; display: block; }
.page-overlay { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.text-preview {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 0.9rem;
  max-height: 80vh; overflow: auto;
}
.text-preview.flow { font-family: inherit; font-size: 1rem; }
.text-preview.flow .unit { margin-bottom: 0.6em; }
.sheet { margin-bottom: 16px; }
.sheet .docx-wrapper { background: none; padding: 0; }
.sheet .docx-wrapper > section.docx { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); margin-bottom: 16px; }
.sheet .slide-page { position: relative; overflow: hidden; contain: paint; width: fit-content; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); margin-bottom: 16px; color: #000; }
/* The slide background sits at z-index -1, which needs the slide to stack its own layers. */
.sheet .slide { isolation: isolate; }
/* Slides can be dark, so a light edge shows where a highlight is. */
.sheet .slide-page mark.on { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6); }
.sheet .page.placed { margin: 0; box-shadow: none; background: none; }
.sheet .page.placed canvas { height: 100%; }
/* The pages stay white in dark mode, so highlights keep their light colors. */
.sheet mark.on { background: rgba(0, 0, 0, 0.45); color: inherit; }
.sheet mark.off { background: #ffe7a0; color: #1a1a1a; }
.unit-section { font-family: inherit; font-size: 0.95rem; margin: 20px 0 8px; }
.unit-section:first-child { margin-top: 0; }
.para .at { border: 0; background: none; padding: 0; color: var(--muted); font: inherit; font-size: 0.85rem; font-variant-numeric: tabular-nums; cursor: pointer; }
.para .at:hover { color: var(--accent); text-decoration: underline; }

.audio-view { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.player { width: 100%; display: block; margin-bottom: 12px; }
.timeline { position: relative; height: 44px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); cursor: crosshair; touch-action: none; overflow: hidden; }
.stretch { position: absolute; top: 0; bottom: 0; padding: 0; border: 0; border-radius: 3px; background: var(--mark-on); cursor: pointer; }
.stretch.off { background: var(--mark-off); outline: 1px dashed var(--mark-off-line); outline-offset: -1px; }
.stretch.manual { background: var(--accent); }
.stretch.ghost { background: var(--accent); opacity: 0.4; pointer-events: none; }
.pointer { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--muted); opacity: 0.6; pointer-events: none; }
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); pointer-events: none; }
.timeline-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; margin-top: 4px; }
mark { cursor: pointer; border-radius: 3px; padding: 0 1px; }
mark.on { background: var(--mark-on); color: inherit; }
mark.off { background: var(--mark-off); color: inherit; outline: 1px dashed var(--mark-off-line); }
mark.saying { outline: 2px solid var(--accent); }
.sel-add {
  position: fixed; bottom: 16px; left: 0; right: 0; margin: 0 auto; z-index: 10;
  display: flex; gap: 8px; padding: 8px; width: max-content; max-width: calc(100% - 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}
.sel-add .btn { width: auto; white-space: nowrap; }

/* Landing sections */
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.point { padding: 36px 32px; display: flex; flex-direction: column; gap: 8px; }
.point:first-child { padding-left: 0; }
.point:last-child { padding-right: 0; }
.point + .point { border-left: 1px solid var(--line); }
.point h3 { margin: 0; font-size: 1.08rem; }
.point p { margin: 0; color: var(--muted); }
@media (max-width: 800px) {
  .points { grid-template-columns: minmax(0, 1fr); }
  .point, .point:first-child, .point:last-child { padding: 22px 0; }
  .point + .point { border-left: 0; border-top: 1px solid var(--line); }
}
.section { padding-top: 88px; }
.section > h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: -0.025em; margin: 0 0 32px; }
@media (max-width: 640px) { .section { padding-top: 56px; } .section > h2 { margin-bottom: 20px; } }
.faq { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px 48px; align-items: start; padding-bottom: 32px; }
.faq > h2 { margin: 0; }
.faq-list { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.0625rem; }
.faq p { color: var(--muted); margin: 10px 0 0; max-width: 640px; }
@media (max-width: 800px) { .faq { grid-template-columns: minmax(0, 1fr); } }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color 0.15s; }
.card:hover { border-color: var(--line-strong); }
.card span { color: var(--muted); font-size: 0.92rem; }
.prose { max-width: 760px; padding-top: 48px; padding-bottom: 48px; }
.prose h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -0.03em; }
.prose h2 { margin-top: 2em; }
.prose p { color: var(--text); }
.prose li { margin-bottom: 6px; }
.prose .updated { color: var(--muted); font-size: 0.9rem; margin-top: 3em; }

/* Footer */
.site-footer { background: var(--footer-bg); color: var(--footer-text); margin-top: 88px; padding: 56px 0; font-size: 0.92rem; }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr); gap: 32px; }
.site-footer h2 { font-size: 0.95rem; color: #fff; margin: 0 0 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer strong { color: #fff; font-size: 1.125rem; }
.site-footer .logo { gap: 10px; }
.site-footer p { max-width: 320px; }
@media (max-width: 700px) { .site-footer .wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

.plans { margin: 16px 0 32px; }
.plans + .plans { margin-top: -16px; }
.plan { gap: 10px; }
.plan .plan-price { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.plan .btn { min-height: 48px; border-radius: 12px; }
.pricing { padding-top: 48px; padding-bottom: 48px; }
.pricing h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -0.03em; margin: 0 0 24px; }
.pricing h2 { margin: 48px 0 0; }
.pricing h2 + p { margin: 6px 0 0; color: var(--muted); }
.pricing .plans { margin: 0; align-items: stretch; }
.plan small { font-size: 0.95rem; font-weight: 500; color: var(--muted); }
.plan .plan-covers { color: var(--text); font-size: 1rem; }
.plan .btn { margin: 6px 0 4px; }
.plan-points { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; color: var(--muted); font-size: 0.92rem; }
.plan-points li { display: flex; align-items: center; gap: 8px; margin: 0; }
.plan-points svg { flex: none; color: var(--accent); }
.plan.main { border: 2px solid var(--ink); padding: 19px; position: relative; }
.plan.main:hover { border-color: var(--ink); }
.plan-badge { position: absolute; top: -12px; left: 18px; padding: 2px 10px; border-radius: 999px; background: var(--ink); color: var(--ink-text) !important; font-size: 0.8rem !important; font-weight: 600; }
.packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.pack { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'name price' 'covers buy'; align-items: center; gap: 4px 12px; padding: 16px 20px; }
.pack + .pack { border-left: 1px solid var(--line); }
.pack strong { grid-area: name; }
.pack span { grid-area: covers; color: var(--muted); font-size: 0.9rem; }
.pack .pack-price { grid-area: price; justify-self: end; color: var(--text); font-size: 1.15rem; font-weight: 700; }
.pack .btn { grid-area: buy; min-height: 36px; padding: 6px 18px; }
@media (max-width: 800px) {
  .packs { grid-template-columns: minmax(0, 1fr); }
  .pack + .pack { border-left: 0; border-top: 1px solid var(--line); }
}
.credit-table { width: 100%; max-width: 760px; margin-top: 16px; border-collapse: collapse; }
.credit-table th, .credit-table td { text-align: left; vertical-align: top; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); }
.credit-table th { font-weight: 600; width: 45%; }
.credit-table td { color: var(--muted); }
/* Short pages (404, account): one centred block filling the space between header and footer. */
.solo { min-height: min(680px, calc(100svh - var(--header-h))); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-top: 48px; padding-bottom: 64px; }
.solo h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -0.03em; margin: 0 0 12px; }
#account { width: 100%; }
.solo #account { display: flex; justify-content: center; }
.auth-card { width: min(100%, 420px); padding: 32px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.6rem; letter-spacing: -0.02em; margin: 0 0 24px; text-align: center; }
.auth-card .status { margin: 0 0 16px; }
.auth-card p { margin: 0 0 10px; }
.auth-card .btn { width: 100%; min-height: 48px; border-radius: 12px; }
.auth-card .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.account-view { padding: 40px 0 72px; }
.account-head { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.account-head h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -0.03em; }
.account-view > .status { margin: 0 0 16px; }
.account-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; }
.account-side { display: grid; gap: 20px; }
.panel-card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.panel-card h2 { margin: 0 0 16px; font-size: 1.1rem; letter-spacing: -0.01em; }
.panel-card > .btn { margin-top: 16px; }
.panel-card .muted { color: var(--muted); margin: 0; }
.offers { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.offer { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 14px 16px; }
.offer + .offer { border-top: 1px solid var(--line); }
.offer strong { display: block; }
.offer span { color: var(--muted); font-size: 0.875rem; }
.offer .offer-price { color: var(--text); font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.offer small { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.offer .btn { min-width: 104px; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--ink-text); font-weight: 700; }
.link-button { flex: none; font: inherit; font-size: 0.875rem; color: var(--muted); background: none; border: 0; padding: 8px 0 8px 8px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: var(--text); }
@media (max-width: 860px) { .account-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .account-view { padding: 24px 0 48px; } .panel-card { padding: 20px 16px; border-radius: 16px; } .offer { gap: 10px; padding: 12px; } .offer .btn { min-width: 0; padding: 8px 14px; } .offer small { display: block; } }
.total { display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px; }
.total-num { font-size: 3rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.total-label { color: var(--muted); }
.meters { display: flex; flex-direction: column; gap: 10px; }
.meter { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--sunken); }
.meter-head { display: flex; justify-content: space-between; gap: 12px; }
.meter-head strong { font-variant-numeric: tabular-nums; }
.meter-bar { height: 6px; margin-top: 10px; border-radius: 999px; background: var(--chip-bg); overflow: hidden; }
.meter-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.meter-note { margin: 6px 0 0; color: var(--muted); font-size: 0.875rem; }
.or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 0.875rem; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.signin { display: flex; flex-direction: column; gap: 10px; }
.signin input { font: inherit; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text); }
.signin input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn.google svg { flex: none; }
@media (max-width: 640px) { .solo { justify-content: flex-start; min-height: 0; padding-top: 40px; } .auth-card { padding: 24px 20px; border-radius: 16px; } }
.btn.google[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
.cell-bar { display: flex; align-items: baseline; gap: 12px; min-height: 38px; padding: 8px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cell-ref { flex: none; min-width: 3em; color: var(--muted); font-variant-numeric: tabular-nums; }
.cell-text { flex: 1; min-width: 0; max-height: 7.5em; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.sheet-view { height: min(70vh, 640px); min-height: 360px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); margin-bottom: 16px; }
.para { display: flex; gap: 0.5em; align-items: baseline; }
.para .unit { flex: 1; }
/* Each word reaches over the space after it, so a highlight running through words has no gaps. */
.w { cursor: pointer; padding-right: 0.3em; margin-right: -0.3em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
@media (hover: hover) { .w:hover { text-decoration: underline; } }
.w.speaking { --tint: var(--accent); background: linear-gradient(to right, color-mix(in srgb, var(--tint) calc(var(--a0, 1) * 28%), transparent), color-mix(in srgb, var(--tint) calc(var(--a1, 1) * 28%), transparent) var(--said, 100%), transparent calc(var(--said, 100%) + 15%)); }

/* Cookie consent (static/analytics.js) */
.footer-link { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.footer-link:hover { color: #fff; text-decoration: underline; }
.consent-bar {
  position: fixed; z-index: 50; left: 16px; right: 16px; bottom: 16px; margin: 0 auto; max-width: 560px;
  display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.consent-bar p { margin: 0; flex: 1; font-size: 0.92rem; }
.consent-actions { display: flex; gap: 8px; flex-shrink: 0; }
.consent-bar .btn.dark { background: var(--ink); color: var(--ink-text); border-color: transparent; }
.consent-bar .btn.dark:hover { opacity: 0.9; }
@media (max-width: 520px) {
  .consent-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .consent-actions .btn { flex: 1; }
}
