/* Taalboek: Delft porcelain palette. Colour carries meaning: cobalt marks
   de-words, oranje marks het-words, everywhere a noun appears. */
:root {
  --bg: #F3F6FA;
  --surface: #FFFFFF;
  --sunk: #E9EEF5;
  --ink: #172033;
  --muted: #5A6377;
  --line: #D6DEEA;
  --delft: #1F4E9E;
  --delft-ink: #FFFFFF;
  --delft-soft: #E1EAF8;
  --oranje: #C2570F;
  --oranje-soft: #FBE8D8;
  --good: #2C7A50;
  --good-soft: #DFF1E6;
  --bad: #B23A3A;
  --bad-soft: #F8E1E1;
  --focus: #1F4E9E;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1524;
    --surface: #161F33;
    --sunk: #1C2740;
    --ink: #E5EAF4;
    --muted: #98A3BA;
    --line: #2A3652;
    --delft: #86A9EC;
    --delft-ink: #0E1524;
    --delft-soft: #1E2D50;
    --oranje: #F0995A;
    --oranje-soft: #3A2616;
    --good: #6CC495;
    --good-soft: #17352A;
    --bad: #EE8A8A;
    --bad-soft: #3D1C22;
    --focus: #86A9EC;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1524; --surface: #161F33; --sunk: #1C2740; --ink: #E5EAF4; --muted: #98A3BA;
  --line: #2A3652; --delft: #86A9EC; --delft-ink: #0E1524; --delft-soft: #1E2D50;
  --oranje: #F0995A; --oranje-soft: #3A2616; --good: #6CC495; --good-soft: #17352A;
  --bad: #EE8A8A; --bad-soft: #3D1C22; --focus: #86A9EC; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
}
a { color: var(--delft); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.loading { color: var(--muted); padding: 48px 0; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 24px;
  padding: 28px 18px 20px; border-right: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 0 8px; }
.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--delft); color: var(--delft-ink); font: 700 22px/1 var(--serif); padding-bottom: 3px;
}
.brand-name { font: 700 1.3rem/1 var(--serif); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; flex-direction: column; padding: 8px 10px; border-radius: var(--r-sm);
  text-decoration: none; color: var(--ink); font-weight: 600; line-height: 1.25;
}
.nav a small { font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.nav a:hover { background: var(--sunk); }
.nav a[aria-current="page"] { background: var(--delft-soft); color: var(--delft); }
.sync { margin-top: auto; font-size: 0.82rem; color: var(--muted); padding: 0 8px; }
.sync strong { color: var(--ink); font-weight: 600; }
.sync button { margin-top: 8px; }
.signout { font-size: 0.82rem; color: var(--muted); padding: 0 8px; }
.view { padding: 40px clamp(16px, 4vw, 56px) 80px; max-width: 1120px; width: 100%; min-width: 0; }
.view:focus { outline: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .side {
    position: sticky; z-index: 5; height: auto; flex-direction: row; align-items: center;
    gap: 12px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .brand { padding: 0; }
  .brand-name { display: none; }
  .side { min-width: 0; }
  .nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 6px 10px; }
  .nav a small, .sync, .signout { display: none; }
  .view { padding: 24px 16px 64px; }
  h1 { font-size: 1.6rem; }
}

/* ---------- common pieces ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 60ch; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; }
.section { margin-top: 40px; }
.section > h2 { margin-bottom: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--delft); border-color: var(--delft); color: var(--delft-ink); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--delft); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn-quiet:hover { color: var(--ink); border-color: var(--line); }
.btn-sm { padding: 5px 10px; font-size: 0.88rem; }
.btn:disabled { opacity: 0.5; cursor: default; }
.speak {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--delft); flex: none;
}
.speak:hover { background: var(--delft-soft); }
.speak svg { width: 16px; height: 16px; }
.no-speech .speak { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-size: 0.9rem; color: var(--ink);
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.search {
  width: 100%; max-width: 360px; padding: 9px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface);
}
.empty { padding: 32px 0; color: var(--muted); }

/* gender colours */
.art { font-family: var(--serif); font-weight: 400; font-style: italic; }
.g-de { color: var(--delft); }
.g-het { color: var(--oranje); }
.stars { color: var(--muted); letter-spacing: 1px; font-size: 0.85rem; white-space: nowrap; }
.stars b { color: #C9930B; font-weight: 400; }
.reg { font-size: 0.78rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; white-space: nowrap; }
.box-pips { display: inline-flex; gap: 3px; vertical-align: middle; }
.box-pips i { width: 7px; height: 7px; border-radius: 2px; background: var(--line); }
.box-pips i.on { background: var(--delft); }
.due-tag { font-size: 0.78rem; color: var(--oranje); font-weight: 600; white-space: nowrap; }

/* ---------- today ---------- */
.today-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 960px) { .today-grid { grid-template-columns: minmax(0, 1fr); } }
.wotd { padding: 32px; position: relative; overflow: hidden; }
.wotd .label { font-size: 0.9rem; color: var(--muted); margin: 0 0 18px; }
.wotd .word { font: 600 clamp(2.6rem, 7vw, 4.4rem)/1 var(--serif); letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 0.3em; flex-wrap: wrap; }
.wotd .word .art { font-size: 0.55em; }
.wotd .meaning { font-size: 1.15rem; margin: 14px 0 0; max-width: 46ch; }
.wotd .example { font-family: var(--serif); margin: 22px 0 0; padding-left: 14px; border-left: 3px solid var(--delft-soft); max-width: 60ch; }
.wotd .actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; align-items: center; }
.wotd.het .example { border-left-color: var(--oranje-soft); }

.due-card { display: flex; flex-direction: column; gap: 14px; }
.due-count { font: 600 3rem/1 var(--serif); }
.due-card p { margin: 0; color: var(--muted); }
.due-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.due-list li { background: var(--sunk); border-radius: var(--r-sm); padding: 3px 9px; font-family: var(--serif); }

.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin-top: 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.stats div { padding: 16px 18px; border-left: 1px solid var(--line); }
.stats div:first-child { border-left: 0; }
.stats b { display: block; font: 600 1.7rem/1.1 var(--serif); }
.stats span { color: var(--muted); font-size: 0.88rem; }
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div { border-left: 0; border-top: 1px solid var(--line); }
  .stats div:nth-child(-n+2) { border-top: 0; }
  .stats div:nth-child(even) { border-left: 1px solid var(--line); }
}

.boxes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; align-items: end; height: 150px; }
.boxes .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.boxes .bar { width: 100%; max-width: 64px; background: var(--delft); border-radius: 4px 4px 0 0; min-height: 2px; }
.boxes .n { font-weight: 600; }
.boxes .cap { font-size: 0.82rem; color: var(--muted); text-align: center; line-height: 1.2; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.recent li:first-child { border-top: 0; padding-top: 0; }
.recent .w { font-family: var(--serif); font-weight: 600; }
.recent .e { color: var(--muted); font-size: 0.9rem; text-align: right; }

/* ---------- word lists ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-bottom: 18px; }
.toolbar .chips { flex: 1 1 auto; }
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.row { border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row-head {
  width: 100%; display: grid; grid-template-columns: minmax(150px, 240px) minmax(0, 1fr) 210px; gap: 16px; align-items: center;
  padding: 14px 18px; background: none; border: 0; text-align: left; cursor: pointer;
}
.row-head:hover { background: var(--sunk); }
.row:first-child .row-head { border-radius: var(--r-md) var(--r-md) 0 0; }
.row-head .w { font: 600 1.2rem/1.25 var(--serif); }
.lemma { font: 400 0.8em var(--serif); color: var(--muted); white-space: nowrap; }
.row-head .e { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-head .m { display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
@media (max-width: 640px) {
  .row-head { grid-template-columns: 1fr auto; gap: 2px 12px; }
  .row-head .e { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .row-head .m .stars { display: none; }
}
.row-body { padding: 4px 18px 20px; display: none; }
.row[data-open="true"] .row-body { display: block; }
.row[data-open="true"] .row-head { background: var(--sunk); }
.detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 760px) { .detail { grid-template-columns: minmax(0, 1fr); } }
.detail dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 0.92rem; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.detail .ex { font-family: var(--serif); display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; }
.detail .type { margin: 0; }

/* ---------- grammar ---------- */
.gram { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; }
.toc { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li a { display: block; padding: 6px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink); font-size: 0.93rem; line-height: 1.3; }
.toc li a:hover { background: var(--sunk); }
.toc li a[aria-current="true"] { background: var(--delft-soft); color: var(--delft); font-weight: 600; }
.toc .grp { font-size: 0.82rem; color: var(--muted); padding: 14px 10px 4px; }
.toc .sub a { padding-left: 22px; }
.toc .search { margin-bottom: 10px; max-width: none; }
.toc-mobile { display: none; }
@media (max-width: 860px) {
  .gram { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .toc-mobile { display: block; margin-bottom: 18px; }
  .toc-mobile select { width: 100%; padding: 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); }
}

.prose { font-family: var(--serif); font-size: 1.06rem; line-height: 1.7; max-width: 70ch; }
.prose p, .prose ul, .prose ol, .prose table { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.25em 0; }
.prose h2, .prose h3 { margin: 1.5em 0 0.5em; }
.prose table { border-collapse: collapse; font-family: var(--sans); font-size: 0.93rem; display: block; overflow-x: auto; max-width: 100%; }
.prose th, .prose td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--sunk); font-weight: 600; }
.prose strong { font-weight: 700; }
.prose s, .prose del { color: var(--bad); }
.prose code { font-size: 0.9em; background: var(--sunk); padding: 1px 5px; border-radius: 4px; }
.article-head { margin-bottom: 18px; }
.article-head .muted { font-size: 0.9rem; margin-top: 6px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.pager a { text-decoration: none; max-width: 45%; }
.pager small { display: block; color: var(--muted); }

/* ---------- flashcards ---------- */
.setup { display: flex; flex-wrap: wrap; gap: 18px 32px; margin-bottom: 24px; }
.setup .field { display: flex; flex-direction: column; gap: 8px; }
.setup .field > span { font-size: 0.88rem; color: var(--muted); }
.card-stage { max-width: 640px; margin: 0 auto; }
.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 18px; }
.progress i { display: block; height: 100%; background: var(--delft); transition: width 0.25s; }
.flash {
  min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  text-align: center; padding: 36px 28px; cursor: pointer; border-width: 1px; border-top: 6px solid var(--line);
  border-radius: var(--r-lg); width: 100%;
}
.flash.de { border-top-color: var(--delft); }
.flash.het { border-top-color: var(--oranje); }
.flash .front { font: 600 clamp(2rem, 6vw, 3rem)/1.15 var(--serif); }
.flash .front .art { font-size: 0.6em; }
.flash .back { font-size: 1.2rem; }
.flash .ex { font-family: var(--serif); color: var(--muted); max-width: 48ch; }
.flash .hint { font-size: 0.85rem; color: var(--muted); }
.card-actions { display: flex; justify-content: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.card-actions .btn { min-width: 150px; }
.btn-good { background: var(--good-soft); border-color: var(--good-soft); color: var(--good); }
.btn-bad { background: var(--bad-soft); border-color: var(--bad-soft); color: var(--bad); }
.kbd { font-size: 0.8rem; color: var(--muted); text-align: center; margin-top: 14px; }
kbd { font: 0.8rem var(--sans); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); }

/* ---------- quiz ---------- */
.q-stage { max-width: 680px; }
.q-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.9rem; margin-bottom: 10px; }
.q-prompt { font-size: 1.05rem; margin: 0 0 6px; color: var(--muted); }
.q-subject { font: 600 clamp(1.7rem, 5vw, 2.4rem)/1.2 var(--serif); margin: 0 0 24px; }
.q-sentence { font: 400 clamp(1.3rem, 4vw, 1.7rem)/1.5 var(--serif); margin: 0 0 8px; }
.q-sentence .blank { display: inline-block; min-width: 4ch; border-bottom: 2px solid var(--delft); color: var(--delft); }
.options { display: grid; gap: 10px; }
.option {
  display: flex; gap: 14px; align-items: center; text-align: left; padding: 14px 16px;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 1.02rem;
}
.option:hover:not(:disabled) { border-color: var(--delft); }
.option .k { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 5px; background: var(--sunk); font-size: 0.8rem; color: var(--muted); }
.option.right { border-color: var(--good); background: var(--good-soft); }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option:disabled { cursor: default; }
.option.dutch { font-family: var(--serif); font-size: 1.15rem; }
.dehet { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dehet .option { justify-content: center; font: italic 1.6rem var(--serif); padding: 22px; }
.dehet .option.de-opt { color: var(--delft); }
.dehet .option.het-opt { color: var(--oranje); }
.answer-line { display: flex; gap: 10px; flex-wrap: wrap; }
.answer-line input {
  flex: 1 1 240px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface); font: 1.15rem var(--serif);
}
.answer-line input.right { border-color: var(--good); background: var(--good-soft); }
.answer-line input.wrong { border-color: var(--bad); background: var(--bad-soft); }
.hintline { color: var(--muted); font-size: 0.92rem; margin: 10px 0 0; }
.feedback { margin-top: 20px; padding: 16px 18px; border-radius: var(--r-md); border-left: 4px solid; }
.feedback.ok { background: var(--good-soft); border-color: var(--good); }
.feedback.no { background: var(--bad-soft); border-color: var(--bad); }
.feedback p { margin: 0 0 6px; }
.feedback p:last-child { margin-bottom: 0; }
.feedback .ex { font-family: var(--serif); }
.next-row { margin-top: 18px; display: flex; gap: 10px; align-items: center; }
.score-big { font: 600 4rem/1 var(--serif); }
.mistakes { list-style: none; padding: 0; margin: 0; }
.mistakes li { padding: 12px 0; border-top: 1px solid var(--line); }
.mistakes li:first-child { border-top: 0; }
.mistakes .yours { color: var(--bad); }
.mistakes .corr { color: var(--good); font-weight: 600; }
.history { list-style: none; padding: 0; margin: 0; }
.history > li { border-top: 1px solid var(--line); }
.history > li:first-child { border-top: 0; }
.history summary { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; cursor: pointer; list-style: none; }
.history summary::-webkit-details-marker { display: none; }
.history .sc { font-weight: 600; white-space: nowrap; }
.history .body { padding: 4px 0 16px; }
.src { font-size: 0.78rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; margin-left: 8px; }

/* ---------- writing ---------- */
.essay-list { list-style: none; padding: 0; margin: 0; }
.essay-list li { border-top: 1px solid var(--line); }
.essay-list li:first-child { border-top: 0; }
.essay-list a { display: flex; justify-content: space-between; gap: 16px; padding: 14px 4px; text-decoration: none; color: var(--ink); }
.essay-list a:hover .t { color: var(--delft); }
.essay-list .t { font: 600 1.1rem var(--serif); }
.essay-list .s { color: var(--muted); font-size: 0.88rem; white-space: nowrap; }
.essay-list .p { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: minmax(0, 1fr); } }
.prompt-card h3 { margin-bottom: 6px; }
.prompt-card p { margin: 0; color: var(--muted); }
.title-input {
  width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent;
  font: 600 1.5rem var(--serif); padding: 8px 0; margin: 18px 0 10px;
}
.title-input:focus { outline: none; border-bottom-color: var(--delft); }
.essay-text {
  width: 100%; min-height: 380px; resize: vertical; padding: 18px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); font: 1.12rem/1.75 var(--serif);
}
.essay-text:focus { outline: none; border-color: var(--delft); }
.side-panel { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 24px; }
.side-panel h3 { font-size: 1rem; margin-bottom: 8px; }
.targets { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.targets li { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 6px 10px; border-radius: var(--r-sm); background: var(--sunk); }
.targets li .w { font-family: var(--serif); font-weight: 600; }
.targets li .e { font-size: 0.82rem; color: var(--muted); text-align: right; }
.targets li.used { background: var(--good-soft); }
.targets li.used .w::before { content: "✓ "; color: var(--good); }
.meter { font-size: 0.9rem; color: var(--muted); }
.meter b { color: var(--ink); }
.save-state { font-size: 0.85rem; color: var(--muted); }
.editor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }

/* ---------- reading ---------- */
.story-list, .story-teaser { display: flex; flex-direction: column; }
.story-row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 16px 4px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.story-row:first-child { border-top: 0; }
.story-teaser .story-row { padding: 0; }
.story-row:hover .t { color: var(--delft); }
.story-row .lvl { justify-self: start; font-size: 0.8rem; font-weight: 600; color: var(--delft); background: var(--delft-soft); border-radius: var(--r-sm); padding: 3px 8px; white-space: nowrap; }
.story-main { display: flex; flex-direction: column; min-width: 0; }
.story-row .t { font: 600 1.25rem/1.3 var(--serif); }
.story-row .p { color: var(--muted); font-size: 0.92rem; }
.story-row .s { color: var(--muted); font-size: 0.85rem; text-align: right; white-space: nowrap; }
@media (max-width: 640px) {
  .story-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .story-row .s { text-align: left; white-space: normal; }
}
.reader { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; align-items: start; }
@media (max-width: 960px) { .reader { grid-template-columns: minmax(0, 1fr); } .reader .side-panel { position: static; } }
.story-title { font-size: clamp(2rem, 5vw, 2.8rem); }
.story { max-width: 68ch; margin-top: 8px; }
.para { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; margin-bottom: 1.1em; }
.para-tools { display: flex; flex-direction: column; gap: 6px; align-items: center; padding-top: 4px; }
.en-btn {
  width: 32px; height: 22px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface);
  font-size: 0.7rem; font-weight: 700; color: var(--muted); cursor: pointer; padding: 0;
}
.en-btn[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.story .nl { font: 1.18rem/1.8 var(--serif); margin: 0; }
.story .en { font-size: 0.98rem; line-height: 1.6; color: var(--muted); margin: 8px 0 0; padding-left: 12px; border-left: 2px solid var(--line); }
.lw { cursor: pointer; font-weight: 700; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.lw:hover { text-decoration-color: currentColor; }
.pop {
  position: absolute; z-index: 40; width: min(320px, calc(100vw - 16px)); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; box-shadow: 0 10px 30px rgba(15, 25, 50, 0.18);
  font-size: 0.95rem;
}
.pop-item + .pop-item { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.pop-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font: 1.15rem var(--serif); }
.pop a { font-size: 0.85rem; display: inline-block; margin-top: 6px; }
.questions { padding-left: 1.4em; margin: 0; }
.questions li { margin-bottom: 18px; }
.questions .nl { font: 1.1rem/1.6 var(--serif); margin: 0 0 8px; }
.questions .answer { margin: 0; padding: 10px 14px; background: var(--good-soft); border-radius: var(--r-sm); font-family: var(--serif); }
.word-chip { text-decoration: none; font-family: var(--serif); }
.gloss { margin: 0; font-size: 0.92rem; }
.gloss dt { font: 600 1rem var(--serif); margin-top: 10px; }
.gloss dt:first-child { margin-top: 0; }
.gloss dd { margin: 2px 0 0; color: var(--muted); }
.fold { margin-top: 20px; }
.fold summary { cursor: pointer; font-weight: 600; }

/* ---------- comparisons ---------- */
.cmp-list { display: flex; flex-direction: column; }
.cmp-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 4px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.cmp-row:first-child { border-top: 0; }
.cmp-row:hover .cmp-terms { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px; }
.cmp-terms { font: 600 1.3rem/1.35 var(--serif); }
.cmp-row .s { color: var(--muted); font-size: 0.85rem; text-align: right; white-space: nowrap; }
.vs { font: italic 400 0.75em var(--serif); color: var(--muted); margin: 0 0.45em; }
.cmp-title { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.cmp-prose table { font-size: 0.95rem; }
.cmp-prose table th:not(:first-child) { font-family: var(--serif); font-size: 1.05rem; }
.cmp-prose td:first-child { color: var(--muted); white-space: nowrap; }
.cmp-options { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (max-width: 640px) { .cmp-row { flex-direction: column; align-items: flex-start; gap: 4px; } .cmp-row .s { text-align: left; } }

/* ---------- log ---------- */
.log { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .log { grid-template-columns: minmax(0, 1fr); } }
.entry { padding: 0 0 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.entry h2 { margin-bottom: 12px; }
.entry h2 small { display: block; font: 400 0.85rem var(--sans); color: var(--muted); margin-top: 4px; }
.commits { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; }
.commits li { padding: 8px 0; border-top: 1px solid var(--line); }
.commits li:first-child { border-top: 0; }
.commits time { display: block; color: var(--muted); font-size: 0.8rem; }

/* ---------- toast & login ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: var(--r-sm); font-size: 0.92rem;
  transition: opacity 0.2s, transform 0.2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.login { max-width: 340px; margin: 14vh auto 0; padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.login h1 { margin: 6px 0 18px; }
.login label { font-size: 0.9rem; color: var(--muted); }
.login input { padding: 11px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); }
.login .btn { margin-top: 8px; }
.form-error { color: var(--bad); margin: 0; font-size: 0.9rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
