:root {
  --paper: #f6f3ec; --ink: #1b1a17; --muted: #6b665c; --faint: #b9b2a3; --gold: #b0841f; --rule: #ddd6c7;
  --ok: #2f6b3a; --bad: #9b2c22; --field: #fffdf8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper: #121110; --ink: #ece6d8; --muted: #9a9384; --faint: #4a463e; --gold: #d8a93a; --rule: #2a2723; --ok: #7fbf87; --bad: #e38b7f; --field: #1a1916; }
}
:root[data-theme="dark"] { --paper: #121110; --ink: #ece6d8; --muted: #9a9384; --faint: #4a463e; --gold: #d8a93a; --rule: #2a2723; --ok: #7fbf87; --bad: #e38b7f; --field: #1a1916; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 18px/1.6 "Newsreader", Georgia, serif; }
a { color: inherit; text-underline-offset: 3px; text-decoration-color: var(--faint); }
a:hover { text-decoration-color: var(--gold); }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 13px; letter-spacing: .01em; }
header, main, footer { max-width: 760px; margin: 0 auto; padding: 0 16px; }
header { display: flex; justify-content: space-between; align-items: baseline; padding-top: 22px; }
header .word { font-style: italic; font-size: 20px; text-decoration: none; }
header nav a { margin-left: 18px; text-decoration: none; color: var(--muted); }
header nav a:hover { color: var(--ink); }
.stage { position: relative; width: 100%; max-width: 980px; margin: 8px auto 0; aspect-ratio: 1 / 1; max-height: 82vh; }
#book { width: 100%; height: 100%; display: block; touch-action: manipulation; }
#tip { position: absolute; pointer-events: none; background: var(--paper); border: 1px solid var(--rule); padding: 2px 8px; color: var(--muted); }
#status { text-align: center; color: var(--muted); margin: 4px 16px 0; }
.caption { text-align: center; color: var(--muted); font-style: italic; max-width: 560px; margin: 18px auto 0; }
h1 { font-weight: 400; font-size: 44px; line-height: 1.1; margin: 72px 0 12px; }
h2 { font-weight: 400; font-size: 28px; margin: 64px 0 8px; }
p { margin: 0 0 16px; }
.lede { font-size: 21px; }
#drop { border: 1px dashed var(--faint); border-radius: 6px; padding: 14px; background: var(--field); }
#drop[data-over] { border-color: var(--gold); }
textarea { width: 100%; min-height: 120px; border: 0; background: transparent; color: var(--ink); resize: vertical; outline: none; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
button { font: inherit; font-size: 16px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; }
button:disabled { opacity: .35; cursor: not-allowed; }
label.file { color: var(--muted); cursor: pointer; text-decoration: underline; text-decoration-color: var(--faint); }
label.file input { display: none; }
#result { margin-top: 12px; min-height: 1.6em; }
#result[data-state="ok"] { color: var(--ok); }
#result[data-state="bad"] { color: var(--bad); }
#consent-row { margin-top: 10px; color: var(--muted); font-size: 16px; }
#consent-row input { margin-right: 8px; accent-color: var(--gold); }
.small { font-size: 15px; color: var(--muted); }
footer { margin-top: 96px; padding-bottom: 48px; border-top: 1px solid var(--rule); padding-top: 18px; color: var(--muted); font-size: 15px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
article h1 { font-size: 34px; margin-top: 48px; }
article h2 { font-size: 23px; margin-top: 40px; }
article table { border-collapse: collapse; width: 100%; font-size: 16px; margin: 0 0 16px; }
article th, article td { text-align: left; border-bottom: 1px solid var(--rule); padding: 6px 8px 6px 0; }
article ol { padding-left: 22px; font-size: 16px; }
@media (max-width: 560px) { body { font-size: 17px; } h1 { font-size: 34px; margin-top: 48px; } header nav a { margin-left: 12px; } .lede { font-size: 19px; } }
#checks { list-style: none; padding: 0; margin: 8px 0 0; font-size: 16px; }
#checks li { padding: 2px 0; }
#checks li[data-state="ok"] { color: var(--ok); }
#checks li[data-state="bad"] { color: var(--bad); }
#checks li[data-state="wait"] { color: var(--muted); }
