/* Copied from docs/1974-design-system/components.css, the source of truth. Do not edit here:
   change the original and copy it over again (see README.md). */
/* ==========================================================================
   1974 — Components
   Requires tokens.css. ink.js adds the photocopy filter for line art.
   All classes are prefixed `od-` (Original D&D, 1974).

   Accessibility rules baked in:
   - Every interactive element has a hit area of at least --tap-min (48px).
   - Every face is a clean text face. No distortion filters, no rotation.
   - Nothing relies on colour alone: states also change shape, text or icon.
   - Focus is a 3px ring in --focus (≥3:1 against every surface).
   ========================================================================== */

/* ---------- Base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body.od {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  -webkit-text-size-adjust: 100%;
}

.od :focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.od-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Typography ------------------------------------------------- */
.od-logo {                        /* Wordmark only. Rye is decorative: never for headings or UI.
                                     Min 24px (logos are exempt from contrast rules, WCAG 1.4.3). */
  font-family: var(--font-logo);
  font-weight: 400;
  font-size: max(var(--fs-xl), 1em);
  line-height: 1;
  letter-spacing: .02em;
  color: var(--text);
}
.od-display {                     /* Screen title. Soft 70s serif, like a module cover */
  font-family: var(--font-souvenir);
  font-variation-settings: var(--souvenir-axes);
  font-weight: 900;
  font-size: var(--fs-3xl);
  line-height: var(--lh-tight);
  letter-spacing: -.01em;
  margin: 0;
}
.od-title {                       /* Section / card title */
  font-family: var(--font-souvenir);
  font-variation-settings: var(--souvenir-axes);
  font-weight: 800;
  font-size: var(--fs-xl);
  line-height: var(--lh-snug);
  margin: 0;
}
.od-heading {                     /* Rulebook heading: caps, heavy rule beneath */
  font-family: var(--font-souvenir);
  font-variation-settings: var(--souvenir-axes);
  font-weight: 900;
  font-size: var(--fs-lg);
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom: var(--bw-heavy) solid var(--line-strong);
  padding-bottom: 2px;
  margin: 0 0 var(--sp-3);
}
.od-tome {                        /* Lore, read-aloud boxes, long prose */
  font-family: var(--font-tome);
  font-size: var(--fs-lg);
  line-height: var(--lh-body);
}
.od-tome--drop::first-letter {
  font-family: var(--font-tome);
  font-weight: 700;
  float: left;
  font-size: 3.2em;
  line-height: .8;
  padding: .06em .08em 0 0;
  color: var(--danger);
}
.od-type {                        /* Monospace: house rules, tables, DM notes */
  font-family: var(--font-type);
  font-size: var(--fs-md);
  line-height: 1.45;
}
.od-pencil {                      /* Anything the player entered (graphite colour) */
  font-family: var(--font-pencil);
  color: var(--pencil);
  font-size: var(--fs-hand);
  line-height: 1.1;
}
.od-label {                       /* UI label: small caps-style, always bold */
  font-family: var(--font-ui);
  font-stretch: 85%;
  font-weight: 800;
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Buttons ---------------------------------------------------- */
.od-btn {
  --btn-bg: var(--primary);
  --btn-ink: var(--primary-ink);
  --btn-edge: var(--c-ink);
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap-min);
  min-width: var(--tap-min);
  padding: .5em 1.1em;
  font-family: var(--font-souvenir);
  font-variation-settings: var(--souvenir-axes);
  font-weight: 800;
  font-size: var(--fs-md);
  line-height: 1.1;
  color: var(--btn-ink);
  background: var(--btn-bg);
  border: var(--bw) solid var(--btn-edge);
  border-radius: var(--r-none);
  box-shadow: var(--shadow-print);
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-quick), box-shadow var(--dur-quick);
}
.od-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--shadow-ink); }
.od-btn:disabled,
.od-btn[aria-disabled="true"] {   /* flat, and the edge goes dashed: not colour alone */
  --btn-bg: var(--surface-2); --btn-ink: var(--text-muted); --btn-edge: var(--text-muted);
  border-style: dashed;
  box-shadow: none; cursor: not-allowed; transform: none;
}
.od-btn--danger  { --btn-bg: var(--danger);  --btn-ink: var(--danger-ink); }
.od-btn--success { --btn-bg: var(--success); --btn-ink: var(--success-ink); }
.od-btn--ghost   { --btn-bg: transparent; --btn-ink: var(--text); --btn-edge: var(--line-strong); box-shadow: none; }
.od-btn--block   { display: flex; width: 100%; }
.od-btn--icon    { padding: 0; width: var(--tap-min); }
.od-btn svg      { width: 1.4em; height: 1.4em; flex: none; }

/* Die button: the number is the label, the shape is decoration */
.od-die {
  appearance: none; cursor: pointer;
  display: inline-grid; place-items: center;
  width: 64px; height: 64px;
  padding: 0;
  background: none; border: 0;
  color: var(--text);
  position: relative;
  font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes);
  font-weight: 900; font-size: var(--fs-md);
  -webkit-tap-highlight-color: transparent;
}
.od-die svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--surface); stroke: currentColor; stroke-width: 2.5; stroke-linejoin: round; }
.od-die span { position: relative; }
.od-die:active svg { fill: var(--surface-2); }
.od-die[aria-pressed="true"] { color: var(--primary-ink); }
.od-die[aria-pressed="true"] svg { fill: var(--primary); stroke: var(--line-strong); }

/* Roll result: big number, typed breakdown underneath */
.od-roll { display: grid; justify-items: center; gap: var(--sp-1); text-align: center; }
.od-roll__total {
  font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes);
  font-weight: 900; font-size: 5rem; line-height: 1;
}
.od-roll__total.is-rolling { animation: od-settle var(--dur-med) var(--ease-roll); }
.od-roll__math { font-family: var(--font-type); color: var(--text-muted); }
@keyframes od-settle { 0% { transform: rotate(-14deg) scale(.7); opacity: .2; } 100% { transform: none; opacity: 1; } }

/* ---------- Tags ------------------------------------------------------- */
.od-tag {
  display: inline-flex; align-items: center; gap: .4em;
  font-family: var(--font-ui); font-stretch: 85%; font-weight: 800;
  font-size: var(--fs-xs); letter-spacing: var(--tracking-label); text-transform: uppercase;
  padding: .25em .6em;
  border: var(--bw) solid currentColor;
  color: var(--text);
  white-space: nowrap;
}
.od-tag--solid  { background: var(--text); color: var(--bg); border-color: var(--text); }
.od-tag--danger { background: var(--danger); color: var(--danger-ink); border-color: var(--danger); }
.od-tag--primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); } /* "✓ Chosen" */
.od-tag--code {                   /* module code box: "B7" */
  font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes);
  font-weight: 900; font-size: var(--fs-md); letter-spacing: 0; text-transform: none;
  border-radius: var(--r-code); border-width: var(--bw-heavy);
}

/* ---------- App chrome ------------------------------------------------- */
.od-appbar {
  display: flex; align-items: center; gap: var(--sp-2);
  min-height: 56px;
  padding: 0 var(--sp-2);
  background: var(--bg);
  border-bottom: var(--bw-heavy) double var(--line-strong);
}
.od-appbar__title { flex: 1; min-width: 0; font-size: var(--fs-lg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-appbar .od-btn--icon { box-shadow: none; border-color: transparent; background: transparent; color: var(--text); }

.od-tabbar {                      /* bottom navigation */
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--bg);
  border-top: var(--bw-heavy) double var(--line-strong);
  padding-bottom: env(safe-area-inset-bottom);
}
.od-tabbar a {
  display: grid; justify-items: center; align-content: center; gap: 2px;
  min-height: 60px;
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-ui); font-stretch: 85%; font-weight: 800;
  font-size: var(--fs-xs); letter-spacing: .04em; text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
}
.od-tabbar svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.od-tabbar a[aria-current="page"] { color: var(--text); }
.od-tabbar a[aria-current="page"] svg { fill: color-mix(in srgb, var(--primary) 35%, transparent); }
.od-tabbar a[aria-current="page"] span { border-bottom: var(--bw-heavy) solid currentColor; }

/* Index tabs (like the tabbed sections of a DM screen) */
.od-tabs { display: flex; gap: var(--sp-1); border-bottom: var(--bw) solid var(--line-strong); overflow-x: auto; scrollbar-width: none; }
.od-tab {
  appearance: none; cursor: pointer; flex: none;
  min-height: var(--tap-min);
  padding: 0 var(--sp-4);
  font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes);
  font-weight: 700; font-size: var(--fs-md);
  color: var(--text-muted);
  background: transparent;
  border: var(--bw) solid transparent; border-bottom: 0;
  margin-bottom: calc(-1 * var(--bw));
}
.od-tab[aria-selected="true"] {
  color: var(--text); background: var(--bg);
  border-color: var(--line-strong);
  font-weight: 900;
}
.od-tabpanel { padding: var(--sp-4) 0; }

/* List rows (spells, gear, bestiary index) */
.od-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.od-list > li { border-bottom: 1px solid var(--line); }
.od-row {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 56px; padding: var(--sp-2) var(--sp-1);
  color: inherit; text-decoration: none;
}
.od-row__main { flex: 1; min-width: 0; }
.od-row__title { font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes); font-weight: 800; display: block; }
.od-row__meta { font-family: var(--font-type); font-size: var(--fs-sm); color: var(--text-muted); display: block; }
.od-row__end { font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes); font-weight: 900; font-size: var(--fs-lg); }

/* ---------- Paper objects --------------------------------------------- */
/* All paper is bone-coloured with ink, whatever the theme, so these set
   their own local tokens. */
.od-paper {
  --bg: var(--c-bone);              /* so reversed-out pieces (solid tags) work on paper */
  --surface: #fff;
  --surface-2: var(--c-parchment);
  --text: var(--c-ink);
  --text-muted: #4a4038;            /* 8.1:1 on bone */
  --line: #b9ab8c;
  --line-strong: var(--c-ink);
  --pencil: var(--c-pencil);
  --primary: var(--c-module-blue); --primary-ink: var(--c-bone);
  --danger: var(--c-dragon);       --danger-ink: var(--c-bone);
  --success: var(--c-module-green); --success-ink: var(--c-bone);
  --focus: var(--c-module-blue);
  background: var(--c-bone);
  color: var(--c-ink);
  border: var(--bw) solid var(--c-ink);
  box-shadow: var(--shadow-print-lg);
}

.od-card { padding: var(--sp-4); }

/* Module cover (B/X & 1e): coloured band, code box, ink art */
.od-module { --band: var(--c-module-blue); display: flex; flex-direction: column; color: var(--c-ink); text-decoration: none; }
.od-module--green { --band: var(--c-module-green); }
.od-module--red   { --band: var(--c-dragon); }
.od-module--amber { --band: var(--c-lamp); }          /* a draft: still at the printer */
.od-module--amber .od-module__band,
.od-module--amber .od-module__band .od-tag--code { color: var(--c-ink); }
.od-module__band {
  background: var(--band); color: var(--c-bone);
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: var(--bw) solid var(--c-ink);
}
.od-module__band .od-tag--code { color: var(--c-bone); }
.od-module__title {
  font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes);
  font-weight: 800; font-size: var(--fs-lg); line-height: 1.1;
}
.od-module__art {
  aspect-ratio: 4 / 3;
  margin: var(--sp-3);
  border: var(--bw) solid var(--c-ink);
  background: #fff; overflow: hidden;
}
.od-module__art svg { display: block; width: 100%; height: 100%; }
.od-module__foot {
  font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes);
  font-weight: 600; font-size: var(--fs-sm);
  padding: 0 var(--sp-3) var(--sp-3);
  display: flex; justify-content: space-between; gap: var(--sp-3);
}

/* Monster entry (AD&D 1e Monster Manual format) */
.od-monster { padding: var(--sp-4); }
.od-monster__name {
  font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes);
  font-weight: 900; font-size: var(--fs-xl);
  text-transform: uppercase; letter-spacing: .02em;
  margin: 0 0 var(--sp-3);
  border-bottom: var(--bw-heavy) solid var(--c-ink);
}
.od-monster__stats {
  margin: 0;
  display: grid; grid-template-columns: max-content 1fr; gap: 2px var(--sp-3);
  font-family: var(--font-ui); font-stretch: 85%;
  font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .03em;
}
.od-monster__stats dt { font-weight: 800; }
.od-monster__stats dt::after { content: ":"; }
.od-monster__stats dd { margin: 0; font-weight: 500; }
.od-monster__desc { font-family: var(--font-tome); font-size: var(--fs-md); line-height: 1.5; margin: var(--sp-3) 0 0; }
.od-monster__desc + .od-monster__desc { text-indent: 1.5em; margin-top: 0; }
.od-monster__art { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto var(--sp-3); border: var(--bw) solid var(--c-ink); background: #fff; }
@media (min-width: 600px) { .od-monster--wide .od-monster__art { float: right; width: 42%; margin: 0 0 var(--sp-2) var(--sp-3); } .od-monster--wide .od-monster__stats { display: block; } }

/* Dungeon map (the blue one) */
.od-map { background: var(--c-map-blue); border: var(--bw-heavy) solid var(--c-ink); padding: var(--sp-2); margin: 0; }
.od-map svg { display: block; width: 100%; height: auto; }
.od-map__key {                    /* ink on map blue: 5.0:1 */
  display: flex; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap;
  font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes);
  font-weight: 800; color: var(--c-ink); font-size: var(--fs-sm);
  padding: var(--sp-2) var(--sp-1) 0;
}

/* Random table */
.od-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.od-table caption { text-align: left; margin-bottom: var(--sp-2); }
.od-table th {
  font-family: var(--font-ui); font-stretch: 85%; font-weight: 900;
  font-size: var(--fs-xs); letter-spacing: var(--tracking-label); text-transform: uppercase;
  text-align: left; padding: var(--sp-2);
  border-top: var(--bw-heavy) solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
}
.od-table td { padding: var(--sp-2); font-family: var(--font-type); vertical-align: top; }
.od-table tbody tr:nth-child(odd) td { background: color-mix(in srgb, var(--text) 7%, transparent); }
.od-table tbody tr:last-child td { border-bottom: var(--bw-heavy) solid var(--line-strong); }
.od-table .num { text-align: right; white-space: nowrap; }
.od-table td:first-child { white-space: nowrap; }
/* tbody in the selector so it outranks the zebra stripe */
.od-table tbody tr.is-rolled td { background: var(--primary); color: var(--primary-ink); }
.od-table tbody tr.is-rolled td:first-child::before { content: "▸ "; }

/* DM's note / alert: typed on an index card; icon + word carry the meaning */
.od-note {
  --note: var(--primary);
  display: grid; grid-template-columns: auto 1fr; gap: var(--sp-1) var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface);
  border: var(--bw) solid var(--line-strong);
  border-left: 10px solid var(--note);
  font-family: var(--font-type); font-size: var(--fs-md);
}
.od-note__icon { width: 24px; height: 24px; margin-top: 2px; color: var(--note); }
.od-note__icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.od-note strong { font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes); font-weight: 900; display: block; }
.od-note p { margin: 0; }
.od-note--success { --note: var(--success); }
.od-note--warning { --note: var(--warning); }
.od-note--danger  { --note: var(--danger); }

/* ---------- Character record sheet (forms) --------------------------- */
.od-sheet { padding: var(--sp-4); position: relative; }
.od-sheet__title {
  font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes);
  font-weight: 900; font-size: var(--fs-xl); text-transform: uppercase; text-align: center;
  border-bottom: var(--bw-heavy) solid var(--c-ink); margin: 0 0 var(--sp-4); padding-bottom: var(--sp-1);
}
.od-sheet__head {
  font-family: var(--font-type); text-transform: uppercase; font-size: var(--fs-sm);
  background: var(--c-ink); color: var(--c-bone);
  padding: 2px var(--sp-2); margin: 0 0 var(--sp-2);
  font-weight: 400;
}

.od-field { display: flex; flex-direction: column; }
.od-field > label,
.od-field > .od-field__label {   /* label sits under the line, like a printed form */
  font-family: var(--font-type); font-size: var(--fs-xs); text-transform: uppercase;
  color: var(--text-muted); order: 2;
}
.od-input, .od-select, .od-textarea {
  font: inherit;
  font-family: var(--font-pencil);
  font-size: var(--fs-hand);
  line-height: 1.2;
  color: var(--pencil);
  background: transparent;
  border: 0;
  border-bottom: var(--bw) solid var(--line-strong);   /* ≥3:1 non-text contrast */
  border-radius: 0;
  min-height: var(--tap-min);
  padding: 0 2px;
  width: 100%;
}
.od-input:focus-visible, .od-select:focus-visible, .od-textarea:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
  background-color: color-mix(in srgb, var(--focus) 10%, transparent);
}
.od-input[aria-invalid="true"] { border-bottom: var(--bw-heavy) dashed var(--danger); }
.od-field__error { order: 3; font-family: var(--font-type); font-size: var(--fs-sm); color: var(--danger); }
.od-field__error::before { content: "✗ "; }
.od-select {
  appearance: none; cursor: pointer; padding-right: 1.5rem;
  background: no-repeat right 4px center / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 10'%3E%3Cpath d='M1 1l6 7 6-7' fill='none' stroke='%23120d0b' stroke-width='2.4'/%3E%3C/svg%3E");
}
.od-select option { font-family: var(--font-ui); font-size: 1rem; color: var(--c-ink); }
.od-textarea { border: 0; min-height: 8rem; resize: vertical; background: var(--tex-ruled); line-height: 2rem; padding-top: 0; }

.od-check {
  display: inline-flex; gap: var(--sp-3); align-items: center;
  min-height: var(--tap-min);
  cursor: pointer; font-family: var(--font-type); font-size: var(--fs-md);
}
.od-check input {
  appearance: none; margin: 0; flex: none;
  width: 28px; height: 28px;
  border: var(--bw) solid var(--line-strong);
  background: var(--surface);
  display: grid; place-items: center;
  cursor: pointer;
}
.od-check input::after {
  content: ""; width: 18px; height: 18px;
  background: var(--pencil);
  clip-path: polygon(10% 0, 50% 38%, 90% 0, 100% 12%, 62% 50%, 100% 88%, 90% 100%, 50% 62%, 10% 100%, 0 88%, 38% 50%, 0 12%);
  transform: scale(0);
}
.od-check input:checked::after { transform: scale(1); }

/* Ability score row. B/X order: STR INT WIS DEX CON CHA */
.od-ability {
  display: grid; grid-template-columns: 1fr 3.25rem 3rem; align-items: center; gap: var(--sp-2);
  padding: 2px 0;
}
.od-ability__name { font-family: var(--font-type); text-transform: uppercase; font-size: var(--fs-sm); line-height: 1.15; }
.od-ability__name small { display: block; font-size: var(--fs-xs); color: var(--text-muted); text-transform: none; }
.od-ability__score,
.od-save output {
  font-family: var(--font-pencil); color: var(--pencil); font-size: var(--fs-hand); line-height: 1.6;
  text-align: center;
  border: var(--bw) solid var(--line-strong); background: var(--surface);
}
.od-ability__mod { font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes); font-weight: 800; text-align: center; }

.od-save {
  display: grid; grid-template-columns: 1fr 3.25rem; align-items: center; gap: var(--sp-2);
  font-family: var(--font-type); font-size: var(--fs-sm); text-transform: uppercase; padding: 2px 0;
}

/* Boxes you cross off: hit points, spell slots, torches. Real checkboxes. */
.od-track { border: 0; margin: 0; padding: 0; min-width: 0; }
.od-track legend { padding: 0; margin-bottom: var(--sp-2); }
.od-track__boxes { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.od-track__box { position: relative; width: 36px; height: 36px; display: grid; place-items: center; }
.od-track__box::before {          /* expands the hit area to 44px without spacing them out */
  content: ""; position: absolute; inset: -4px;
}
.od-track input {
  appearance: none; margin: 0; cursor: pointer;
  width: 100%; height: 100%;
  border: var(--bw) solid var(--line-strong);
  background: var(--surface);
  display: grid; place-items: center;
}
.od-track input::after {
  content: ""; width: 70%; height: 70%; background: var(--pencil);
  clip-path: polygon(10% 0, 50% 38%, 90% 0, 100% 12%, 62% 50%, 100% 88%, 90% 100%, 50% 62%, 10% 100%, 0 88%, 38% 50%, 0 12%);
  transform: scale(0);
}
.od-track input:checked::after { transform: scale(1); }
.od-track--slots input { border-radius: 50%; }
.od-track__summary { font-family: var(--font-type); font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--sp-1); }

/* Stepper: big +/- for HP, gold, ammo */
.od-stepper { display: inline-grid; grid-template-columns: var(--tap-min) minmax(4.5rem, auto) var(--tap-min); align-items: stretch; border: var(--bw) solid var(--line-strong); }
.od-stepper button {
  appearance: none; border: 0; background: var(--surface-2); color: var(--text); cursor: pointer;
  font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes); font-weight: 900; font-size: var(--fs-xl);
  min-height: var(--tap-min);
}
.od-stepper button:first-child { border-right: var(--bw) solid var(--line-strong); }
.od-stepper button:last-child  { border-left:  var(--bw) solid var(--line-strong); }
.od-stepper output { display: grid; place-items: center; font-family: var(--font-pencil); font-size: var(--fs-hand); color: var(--pencil); background: var(--surface); padding: 0 var(--sp-2); }

/* ---------- App patterns ------------------------------------------------ */
/* Built only from the primitives above, for the screens the 1974 app has. */

/* A choice (edition, race, class, alignment, spell) as a paper card. The chosen
   one gets a heavy module-blue edge, a deeper shadow and a "✓ Chosen" tag; one
   the player can't take sits flat with its name struck through. */
.od-choice { padding: var(--sp-4); box-shadow: var(--shadow-print); display: grid; gap: var(--sp-3); }
.od-choice[aria-pressed="true"],
.od-choice.is-chosen { border: 4px solid var(--c-module-blue); box-shadow: var(--shadow-print-lg); }
.od-choice[aria-disabled="true"] { box-shadow: none; }
.od-choice[aria-disabled="true"] .od-choice__title { text-decoration: line-through 2px; text-decoration-color: var(--text-muted); }
.od-choice__head { display: flex; align-items: baseline; gap: var(--sp-2); }
.od-choice__title {
  flex: 1; margin: 0;
  font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes);
  font-weight: 800; font-size: var(--fs-xl); line-height: var(--lh-snug);
}
.od-choice__body { font-family: var(--font-tome); font-size: var(--fs-md); color: var(--text-muted); margin: 0; }

/* A labelled box on the record sheet: the label typed, the figure pencilled. */
.od-stat { background: var(--surface); border: var(--bw) solid var(--line-strong); padding: var(--sp-2) var(--sp-3); }
.od-stat__label { display: block; font-family: var(--font-type); font-size: var(--fs-xs); text-transform: uppercase; color: var(--text-muted); }
.od-stat__value {
  display: block; color: var(--pencil);
  font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes);
  font-weight: 900; font-size: var(--fs-2xl); line-height: 1.1;
}
.od-stat__value small { font-family: var(--font-ui); font-weight: 400; font-size: var(--fs-md); color: var(--text-muted); }

/* Segmented control: the chosen segment is reversed out in ink and underlined. */
.od-seg { display: inline-flex; border: var(--bw) solid var(--line-strong); margin: 0; padding: 0; }
.od-seg button {
  appearance: none; cursor: pointer; border: 0; background: transparent; color: var(--text);
  min-height: var(--tap-min); min-width: 72px; padding: 0 var(--sp-3);
  font-family: var(--font-souvenir); font-variation-settings: var(--souvenir-axes); font-weight: 800; font-size: var(--fs-md);
}
.od-seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); text-decoration: underline 2px; text-underline-offset: 3px; }

/* The wizard's step bar: ghost Back, the step count, primary Next, over a double rule. */
.od-steps {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4) var(--sp-2);
  background: var(--bg); border-top: var(--bw-heavy) double var(--line-strong);
}
.od-steps__count { text-align: center; }

/* A low-emphasis action ("Discard", "View my characters"): an underlined label. */
.od-link {
  appearance: none; background: none; border: 0; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; min-height: var(--tap-min);
  font-family: var(--font-ui); font-stretch: 85%; font-weight: 800;
  font-size: var(--fs-xs); letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--primary); text-decoration: underline 1px; text-underline-offset: 3px;
}
.od-link--danger { color: var(--danger); }

/* Offline banner: lamp amber across the top, with an icon and words. */
.od-banner {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: var(--warning); color: var(--warning-ink);
  border-bottom: var(--bw) solid var(--line-strong);
  font-family: var(--font-ui); font-stretch: 85%; font-weight: 800;
  font-size: var(--fs-xs); letter-spacing: var(--tracking-label); text-transform: uppercase;
}

/* ---------- Utilities -------------------------------------------------- */
/* Third-generation photocopy, for line art */
.od-xerox   { filter: url(#od-xerox) contrast(1.2); }

/* Users who asked for more contrast or less decoration get it clean */
@media (prefers-contrast: more) {
  .od-xerox { filter: none; }
  .od-textarea { background: none; border-bottom: var(--bw) solid var(--line-strong); }
  :root { --text-muted: var(--text); }
}

/* Windows High Contrast / forced colours: keep the shapes visible */
@media (forced-colors: active) {
  .od-track input:checked::after, .od-check input:checked::after { background: CanvasText; forced-color-adjust: none; }
  .od-tab[aria-selected="true"], .od-tabbar a[aria-current="page"] span,
  .od-seg button[aria-pressed="true"] { text-decoration: underline 3px; }
  .od-choice.is-chosen, .od-choice[aria-pressed="true"] { border-color: Highlight; }
}
