[hidden] { display: none !important; }
:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  --ground: #F1F3F2;
  --ink: #16202B;
  --slate: #56616B;
  --faded: #7B858D;
  --accent: #8C1D2F;
  --accent-ink: #FFFFFF;
  --panel: #DCE1E0;
  --field: #FFFFFF;
  --rule: #CDD4D6;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #111A1F; --ink: #E6EBEC; --slate: #A6B0B5; --faded: #6E7A81;
    --accent: #E07A88; --accent-ink: #16202B; --panel: #1D2930; --field: #17222A; --rule: #2B3A42;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #111A1F; --ink: #E6EBEC; --slate: #A6B0B5; --faded: #6E7A81;
  --accent: #E07A88; --accent-ink: #16202B; --panel: #1D2930; --field: #17222A; --rule: #2B3A42;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: inherit; }
html { height: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }
body { height: 100%; margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }

.app { height: 100%; max-width: 1600px; margin: 0 auto; padding: 24px 40px 28px; display: flex; flex-direction: column; }
.top { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 34px; }
.brand { font-size: 16px; font-weight: 600; }
.rec { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--slate); }
.rec::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 2s ease-in-out infinite; }
.rec.off::before { background: var(--faded); animation: none; }
@keyframes pulse { 50% { opacity: .35; } }
.top-links { display: flex; align-items: center; gap: 22px; }
.toplink { background: none; border: 0; padding: 6px 0; font-size: 15px; font-weight: 500; cursor: pointer; }
.toplink:hover { color: var(--accent); }

.stage { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 600px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); column-gap: 32px; }
.left, .right { min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.right { align-items: flex-end; gap: 10px; }
.column { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding-top: 22px; }
.column.wide { grid-column: 1 / -1; grid-row: 1; width: 100%; max-width: 1080px; justify-self: center; }
body[data-view="compare"] .left, body[data-view="compare"] .right { display: none; }

.intro { margin: 0; font-size: 16px; color: var(--slate); }
.piece { margin: 6px 0 0; font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--slate); }
.scroll { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 18px 0 0 -26px; padding: 0 4px 20px 26px; scrollbar-width: thin; }
body[data-view="ready"] .scroll.overflow { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 72px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 72px), transparent); }

.text { font-family: var(--serif); font-size: 28px; line-height: 1.5; }
.text.prose { font-size: 26px; }
.text.small { font-size: 25px; }
.block + .block { margin-top: 24px; }
.line { position: relative; padding-left: 1.1em; text-indent: -1.1em; transition: color .25s ease; }
.line.indent { padding-left: 2.3em; }
.line.read, .text.faded .line { color: var(--faded); }
.line.current::before { content: ""; position: absolute; left: -22px; top: .62em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.line.clickable { cursor: pointer; }
.line.clickable:hover { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 6px; }

.big { margin: 0; font-family: var(--serif); font-size: 44px; line-height: 1.25; }
.big.faded { color: var(--faded); }
.stress { font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 8px; }
.statement { margin: 18px 0 0; font-family: var(--serif); font-size: 40px; line-height: 1.25; }
.statement.small { font-size: 30px; }
.rules { margin-top: 34px; display: flex; flex-direction: column; gap: 14px; font-size: 17px; line-height: 1.45; }
.rules p { margin: 0; }
.spacer { flex: 1 1 auto; }

.dots { margin-top: 22px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--faded); transition: background-color .2s ease, border-color .2s ease; }
.dot.on { background: var(--ink); border-color: var(--ink); }
.dots-label { margin-left: 8px; font-size: 15px; color: var(--slate); }
.demo { margin-top: 24px; border-radius: 16px; background: var(--panel); padding: 28px 32px; display: flex; flex-direction: column; gap: 14px; }
.demo ol { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 10px; font-size: 17px; line-height: 1.45; }
.demo-cap { margin: 0; font-size: 13px; color: var(--slate); }

.bottom { flex: 0 0 auto; display: flex; flex-direction: column; gap: 16px; padding-top: 14px; }
.instr { display: flex; flex-direction: column; gap: 4px; }
.lead { margin: 0; font-size: 18px; font-weight: 500; }
.sub { margin: 0; font-size: 15px; line-height: 1.45; color: var(--slate); }
.hint { margin: 0; font-size: 14px; color: var(--slate); }
.notice { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--panel); font-size: 15px; line-height: 1.45; }
.done-head, .countdown { margin: 0; font-family: var(--serif); font-size: 32px; line-height: 1.2; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 26px; border-radius: 26px; border: 1.5px solid transparent; font-size: 17px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.secondary { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn.secondary:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.btn.sm { height: 44px; padding: 0 20px; border-radius: 22px; font-size: 15px; }
.btn:disabled { opacity: .6; cursor: default; }
.link { background: none; border: 0; padding: 4px 0; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link.quiet { color: var(--slate); font-size: 14px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.totals { margin: 0; max-width: 230px; font-size: 15px; line-height: 1.5; color: var(--slate); }
.camtoggle { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 4px; border: 0; background: none; color: var(--slate); font-size: 15px; cursor: pointer; }
.preview { width: 240px; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: var(--panel); transform: scaleX(-1); }
.player { margin-top: 4px; }
.player video, .cmp video { display: block; width: 100%; max-height: 52vh; border-radius: 12px; background: #000; }
.player audio, .cmp audio { display: block; width: 100%; }

.save { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.save-form { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 14px; color: var(--slate); }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
input[type="email"] { width: 320px; max-width: 100%; height: 52px; padding: 0 20px; border-radius: 26px; border: 1.5px solid var(--faded); background: var(--field); font-size: 16px; }
input[type="email"]::placeholder { color: var(--faded); }
.field-error { margin: 0; font-size: 14px; color: var(--accent); }

.rec-list { list-style: none; margin: 16px 0 0; padding: 0; }
.rec-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--rule); }
.rec-row:last-child { border-bottom: 1px solid var(--rule); }
.rec-title { margin: 0; font-family: var(--serif); font-size: 20px; }
.rec-day { margin-right: 8px; font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--slate); }
.rec-meta { margin: 4px 0 0; font-size: 14px; color: var(--slate); }
.rec-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.compare { margin-top: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.cmp { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.cmp figcaption { font-size: 15px; font-weight: 500; }

.proto { position: relative; }
.proto-btn { padding: 4px 12px; border: 1px dashed var(--faded); border-radius: 14px; background: none; font-size: 13px; color: var(--slate); cursor: pointer; }
.proto-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 310px; padding: 18px; border: 1px solid var(--rule); border-radius: 14px; background: var(--field); box-shadow: 0 14px 36px rgba(10, 16, 20, .16); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.proto-title { margin: 0; font-size: 15px; font-weight: 600; }
.proto-panel select { height: 40px; max-width: 180px; padding: 0 10px; border: 1.5px solid var(--faded); border-radius: 10px; background: var(--field); }

.toast-wrap { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: flex-end; padding: 0 36px calc(84px + env(safe-area-inset-bottom, 0px)); pointer-events: none; }
.toast { margin: 0; max-width: 340px; padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--ground); font-size: 15px; line-height: 1.4; box-shadow: 0 10px 30px rgba(10, 16, 20, .2); }
dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; background: var(--ground); color: var(--ink); box-shadow: 0 24px 60px rgba(10, 16, 20, .28); }
dialog::backdrop { background: rgba(10, 16, 20, .45); }
.dlg { display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.dlg-title { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 400; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  .rec::before { animation: none; }
  .line, .dot { transition: none; }
}
@media (max-width: 960px) {
  .app { padding: 16px 20px 20px; }
  .stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .left { order: 2; padding-top: 12px; }
  .right { display: none; }
  .scroll { margin-left: -18px; padding-left: 18px; }
  .line.current::before { left: -15px; }
  .text { font-size: 24px; }
  .text.prose, .text.small { font-size: 22px; }
  .big { font-size: 34px; }
  .statement { font-size: 31px; }
  .compare { grid-template-columns: minmax(0, 1fr); }
  .top-links { gap: 14px; }
  .toast-wrap { justify-content: center; padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .toast { max-width: 100%; }
}

.demo video { display: block; width: 100%; border-radius: 12px; background: #000; }
.dlg .notice { margin: 0; }
