:root {
  --bg: #faf8f4; --fg: #1d1b18; --muted: #6b665d; --line: #ddd7cc; --panel: #ffffff;
  --accent: #8a4b14; --accent-fg: #ffffff; --ok: #2e7d32; --err: #b3261e; --note: #fff4e0;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #171614; --fg: #ece8e1; --muted: #a59f94; --line: #3a3732; --panel: #201e1b;
          --accent: #d08a44; --accent-fg: #171614; --ok: #7cc47f; --err: #f2867c; --note: #2d261c; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; } h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel); }
.top nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.brand { font-weight: 600; text-decoration: none; color: var(--fg); }
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
main.narrow { max-width: 420px; } main.prose { max-width: 760px; }
.lead { font-size: 1.05rem; } .muted { color: var(--muted); } .ok { color: var(--ok); } .error { color: var(--err); }
.hidden { display: none; }
.note { background: var(--note); border: 1px solid var(--line); border-radius: 6px; padding: .6rem .8rem; }
code.secret { font-size: 1.1rem; user-select: all; }
.stack { display: flex; flex-direction: column; gap: .8rem; } .stack label { display: flex; flex-direction: column; gap: .2rem; }
.row { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }
.check { flex-direction: row !important; align-items: center; gap: .4rem; }
input, textarea { font: inherit; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--fg); }
button, .button { font: inherit; display: inline-block; padding: .45rem .9rem; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-fg); text-decoration: none; cursor: pointer; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button.link { background: none; border: none; padding: 0; color: var(--accent); text-decoration: underline; }
form.inline { display: inline; }
table.list { width: 100%; border-collapse: collapse; margin: 1rem 0; }
table.list th, table.list td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr.practice td { background: var(--note); } table.list tr.disabled td { opacity: .5; }
table.grid td, table.grid th { text-align: center; } table.grid td:first-child, table.grid th:first-child { text-align: left; }
table.compact td, table.compact th { padding: .2rem .5rem; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
@media (max-width: 700px) { table.list { display: block; overflow-x: auto; } }

/* the scroll page: viewer on the left, panel on the right */
body.viewerpage { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.work { flex: 1; display: flex; min-height: 0; }
.work iframe { flex: 1; border: 0; min-width: 0; background: #000; }
.panel { width: 330px; flex: none; overflow-y: auto; padding: 1rem; border-left: 1px solid var(--line); background: var(--panel); font-size: .95rem; }
.panel h1 { font-size: 1.2rem; }
.save { font-weight: 600; } .save.bad { color: var(--err); } .save.good { color: var(--ok); }
.next { margin: .8rem 0; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar { height: 100%; width: 0; background: var(--accent); }
.warnings { padding-left: 1.1rem; } .warnings button { margin-left: .3rem; }
.keys { padding-left: 1.1rem; color: var(--muted); }
.panel table { width: 100%; border-collapse: collapse; } .panel td, .panel th { padding: .2rem .3rem; border-bottom: 1px solid var(--line); text-align: left; }
@media (max-width: 800px) { .work { flex-direction: column; } .panel { width: auto; max-height: 40vh; border-left: 0; border-top: 1px solid var(--line); } }
.journeys { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-top: 1rem; }
.journey { display: block; padding: 1.2rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--fg); text-decoration: none; }
.journey:hover { border-color: var(--accent); }
.journey h2 { margin-top: 0; color: var(--accent); }
.note-text { white-space: pre-wrap; max-width: 28rem; overflow-wrap: anywhere; }
