:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #2a2622;
  --muted: #7a7168;
  --accent: #b4442c;
  --accent-text: #ffffff;
  --border: #e6dfd5;
  --ok: #2f7d4f;
  --bad: #b4442c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1917;
    --surface: #25221f;
    --text: #ece6de;
    --muted: #a39a90;
    --accent: #e0775d;
    --accent-text: #1b1917;
    --border: #3a3530;
    --ok: #6cc08d;
    --bad: #e0775d;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.5;
}
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.brand { font-family: Literata, Georgia, serif; font-weight: 600; font-size: 1.25rem; }
.brand small { color: var(--muted); font-size: .7rem; font-family: Inter, sans-serif; margin-left: 4px; }
main { max-width: 680px; margin: 0 auto; padding: 16px; }
h1 { font-family: Literata, Georgia, serif; font-size: 1.6rem; margin: 16px 0 8px; }
h2 { font-size: 1.1rem; margin-top: 32px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; display: grid; gap: 12px;
}
label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px; width: 100%;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
button {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 8px;
  padding: 12px 16px; background: var(--accent); color: var(--accent-text);
}
button:disabled { opacity: .5; cursor: wait; }
button.link { background: none; color: var(--muted); padding: 4px 8px; font-weight: 400; }
.error { color: var(--bad); margin: 0; min-height: 1em; }
.list { list-style: none; padding: 0; display: grid; gap: 8px; }
.list button {
  width: 100%; text-align: left; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); font-weight: 400;
}
.list small { color: var(--muted); display: block; }
.logline { color: var(--muted); font-style: italic; }
.chapter { font-family: Literata, Georgia, serif; font-size: 1.12rem; line-height: 1.75; }
.chapter h3 { font-family: Inter, sans-serif; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 32px 0 8px; }
.chapter p { margin: 0 0 1em; white-space: pre-wrap; }
.past-choice { font-size: .9rem; border-left: 3px solid var(--border); padding: 4px 12px; margin: 8px 0 24px; color: var(--muted); }
.past-choice.ok { border-color: var(--ok); }
.past-choice.bad { border-color: var(--bad); }
.decision .q { font-weight: 600; margin: 0; }
.decision button { text-align: left; font-weight: 400; }
.status { color: var(--muted); font-style: italic; margin: 16px 0; }
.meta { color: var(--muted); font-size: .8rem; margin-top: 32px; }
