@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Zen+Maru+Gothic:wght@500;700;900&display=swap');

/* Mr H's Learning Hub theme — generated from the design system (tokens.json + components/bundle.css). Source: https://claude.ai/artifact/X8fab1w6N6R4ErPuMokSeU. Do not hand-edit tokens; change the design system and regenerate. */
/* Components regenerated 2026-11-27 from bundle.css sha256 ca97e6b769931668c88fab1156699857d51ac385657ab185aad76995171eb16a (minus the .lh-preview helpers). */
:root, [data-theme="light"] {
  --paper: #f6f1e5;
  --surface: #fffcf5;
  --surface-sunk: #ece3cf;
  --stage: #efe5cf;
  --ink: #2a2520;
  --ink-muted: #5f5548;
  --ink-faint: #857867;
  --line: #dccfb4;
  --outline: #2a2520;
  --control-border: #8a7d69;
  --primary: #1f6e94;
  --on-primary: #ffffff;
  --primary-soft: #d9ecf5;
  --primary-ink: #185b7b;
  --gold: #e2b23a;
  --on-gold: #2a2520;
  --gold-soft: #f7e6b5;
  --gold-ink: #6e5108;
  --red: #b83f34;
  --on-red: #ffffff;
  --red-soft: #f6ddd7;
  --red-ink: #9a3128;
  --brown: #7a5236;
  --brown-soft: #efe2cf;
  --brown-ink: #6b4529;
  --focus: #1f6e94;
  --state-mastered: var(--gold);
  --state-shaky: var(--brown);
  --state-gap: var(--red);
  --state-learning: var(--primary);
  --spool-ivory: #f1ead9;
  --spool-tan: #c9b48a;
  --spool-brown: #7a5236;
  --spool-charcoal: #3b3d42;
  --spool-red: #c0453a;
  --spool-gold: #e2b23a;
  --spool-blue: #2a8fbd;
  --art-line: #2b2b2b;
  --strand-rune: #3b3d42;
  --strand-wave: #2a8fbd;
  --strand-flux: #c0453a;
  --strand-chance: #7a5236;
  --strand-prism: #957f50;
  --strand-star: #e2b23a;
  --lip: 0 3px 0 #2a2520;
  --lip-pressed: 0 1px 0 #2a2520;
  --raise: 0 2px 0 rgba(42,37,32,0.10), 0 8px 24px rgba(42,37,32,0.08);
  --overlay: 0 24px 64px rgba(42,37,32,0.28);
  --pixel-drop: 4px 4px 0 #2a2520;
  --pixel-lip: 3px 3px 0 #2a2520;
  --pixel-lip-pressed: 1px 1px 0 #2a2520;
  color-scheme: light;
}
[data-theme="dark"] {
  --paper: #191714;
  --surface: #24211c;
  --surface-sunk: #12100e;
  --stage: #7a6f5e;
  --ink: #f3ecdc;
  --ink-muted: #bdb09a;
  --ink-faint: #8d8270;
  --line: #3b362e;
  --outline: #0b0a08;
  --control-border: #7b7262;
  --primary: #6cbfe3;
  --on-primary: #0e2230;
  --primary-soft: #1c3442;
  --primary-ink: #8fd0ec;
  --gold: #e8bd4f;
  --on-gold: #241c08;
  --gold-soft: #3d3218;
  --gold-ink: #f0cf78;
  --red: #e27566;
  --on-red: #2a0d09;
  --red-soft: #43231e;
  --red-ink: #f19a8c;
  --brown: #c39a70;
  --brown-soft: #3a2d22;
  --brown-ink: #dcb994;
  --focus: #8fd0ec;
  --state-mastered: var(--gold);
  --state-shaky: var(--brown);
  --state-gap: var(--red);
  --state-learning: var(--primary);
  --spool-ivory: #f1ead9;
  --spool-tan: #c9b48a;
  --spool-brown: #7a5236;
  --spool-charcoal: #3b3d42;
  --spool-red: #c0453a;
  --spool-gold: #e2b23a;
  --spool-blue: #2a8fbd;
  --art-line: #2b2b2b;
  --strand-rune: #a9adb6;
  --strand-wave: #5fb6dc;
  --strand-flux: #e27566;
  --strand-chance: #c39a70;
  --strand-prism: #c9b48a;
  --strand-star: #e8bd4f;
  --lip: 0 3px 0 #0b0a08;
  --lip-pressed: 0 1px 0 #0b0a08;
  --raise: 0 2px 0 rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.35);
  --overlay: 0 24px 64px rgba(0,0,0,0.6);
  --pixel-drop: 4px 4px 0 #0b0a08;
  --pixel-lip: 3px 3px 0 #0b0a08;
  --pixel-lip-pressed: 1px 1px 0 #0b0a08;
  color-scheme: dark;
}
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  --font-display: "Zen Maru Gothic", "Nunito", ui-rounded, system-ui, sans-serif;
  --font-body: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-pixel: "Pixelify Sans", "Zen Maru Gothic", "Nunito", ui-rounded, system-ui, sans-serif;
}

/* Mr H's Learning Hub: components. Plain CSS on the tokens; no framework.
   Class prefix lh-. Theme: <html data-theme="light|dark">; follow the OS with the snippet in README. */

body { margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 24px; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
.lh-display { font-family: var(--font-display); }
.lh-muted { color: var(--ink-muted); }
.lh-caption { font: 800 12px/16px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
:where(a) { color: var(--primary-ink); text-underline-offset: 3px; }
:where(a, button, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Button ---------- */
.lh-btn { -webkit-appearance: none; appearance: none; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-5); border: 2px solid var(--outline); border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink); box-shadow: var(--lip);
  font: 800 16px/1 var(--font-body); cursor: pointer; text-decoration: none; transition: transform .06s, box-shadow .06s; }
.lh-btn:active { transform: translateY(2px); box-shadow: var(--lip-pressed); }
.lh-btn--primary { background: var(--primary); color: var(--on-primary); }
.lh-btn--reward { background: var(--gold); color: var(--on-gold); }
.lh-btn--danger { background: var(--red); color: var(--on-red); }
.lh-btn--quiet { border-color: transparent; background: transparent; box-shadow: none; color: var(--primary-ink); padding: 0 var(--space-3); }
.lh-btn--quiet:hover { background: var(--primary-soft); }
.lh-btn--sm { min-height: 36px; padding: 0 var(--space-4); font-size: 14px; }
.lh-btn--block { width: 100%; }
.lh-btn[disabled], .lh-btn[aria-disabled="true"] { background: var(--surface-sunk); color: var(--ink-faint); border-color: var(--line); box-shadow: none; cursor: not-allowed; transform: none; }
.lh-btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Card ---------- */
.lh-card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--raise); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); color: var(--ink); }
.lh-card--toy { border: 2px solid var(--outline); box-shadow: var(--lip); }
.lh-card__eyebrow { font: 800 12px/16px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); margin: 0; }
.lh-card__title { font: 700 24px/30px var(--font-display); margin: 0; }
.lh-card__body { margin: 0; color: var(--ink); }
.lh-card__footer { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; margin-top: var(--space-2); }
a.lh-card { text-decoration: none; transition: transform .12s; }
a.lh-card:hover { transform: translateY(-2px); }

/* ---------- Creature stage (the disc a creature stands on) ---------- */
.lh-stage { position: relative; display: grid; place-items: end center; aspect-ratio: 1; border-radius: 50%; background: var(--stage); overflow: visible; }
.lh-stage .lh-creature { width: 112%; height: auto; margin-bottom: -6%; display: block; }
.lh-creature { display: block; overflow: visible; }

/* ---------- Skill tile ---------- */
.lh-tile { --tile-ring: var(--line); --tile-wash: var(--surface); --strand: var(--strand-rune);
  position: relative; display: grid; grid-template-columns: 72px 1fr; grid-template-rows: auto auto 1fr; column-gap: var(--space-3);
  width: 100%; max-width: 300px; box-sizing: border-box; padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
  text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--tile-wash); border: 2px solid var(--outline); border-radius: var(--radius-md); box-shadow: var(--lip);
  transition: transform .06s, box-shadow .06s; }
.lh-tile:active { transform: translateY(2px); box-shadow: var(--lip-pressed); }
.lh-tile::before { content: ""; position: absolute; left: -2px; right: -2px; top: -2px; height: 8px; border-radius: var(--radius-md) var(--radius-md) 0 0; background: var(--strand); border: 2px solid var(--outline); border-bottom: 0; }
.lh-tile__stage { grid-row: 1 / span 3; width: 72px; align-self: center; margin-top: 6px; }
.lh-tile__id { margin-top: 8px; font: 700 13px/18px var(--font-body); letter-spacing: 0; text-transform: none; color: var(--ink-muted); }
.lh-tile__name { font: 700 17px/22px var(--font-display); margin: 2px 0 var(--space-2); }
.lh-tile__status { align-self: end; }
.lh-tile[data-state="not_started"] .lh-tile__stage { filter: grayscale(1); opacity: .55; }
.lh-tile[data-state="mastered"] { --tile-wash: var(--gold-soft); }
.lh-tile[data-state="shaky"] { --tile-wash: var(--brown-soft); }
.lh-tile[data-state="gap"] { --tile-wash: var(--red-soft); }
.lh-tile[data-state="gap"] .lh-tile__stage .lh-stage { box-shadow: 0 0 0 4px var(--red); }
.lh-tile[data-state="shaky"] .lh-tile__stage .lh-stage { outline: 3px dashed var(--brown); outline-offset: 2px; }
.lh-tile[data-state="mastered"] .lh-tile__stage .lh-stage { box-shadow: 0 0 0 4px var(--gold), 0 0 0 6px var(--outline); }
.lh-tile[aria-current="true"] { outline: 3px solid var(--primary); outline-offset: 3px; }
.lh-tile__start { position: absolute; top: -12px; right: 10px; }
.lh-tile--compact { grid-template-columns: 52px 1fr; max-width: none; padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2); }
.lh-tile--compact .lh-tile__stage { width: 52px; }
.lh-tile--compact .lh-tile__name { font-size: 15px; line-height: 20px; margin-bottom: 4px; }

/* ---------- Chip (state and strand) ---------- */
.lh-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px; border-radius: var(--radius-pill);
  font: 800 13px/1 var(--font-body); background: var(--surface-sunk); color: var(--ink-muted); white-space: nowrap; width: max-content; }
.lh-chip svg { width: 18px; height: 18px; flex: none; }
.lh-chip--mastered { background: var(--ink); color: var(--paper); }
.lh-chip--shaky { background: var(--surface); color: var(--brown-ink); box-shadow: inset 0 0 0 2px var(--brown); }
.lh-chip--gap { background: var(--red); color: var(--on-red); }
.lh-chip--learning { background: var(--primary-soft); color: var(--primary-ink); }
.lh-chip--start { background: var(--primary); color: var(--on-primary); border: 2px solid var(--outline); height: 24px; box-shadow: 0 2px 0 var(--outline); }
.lh-chip--strand { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.lh-chip--strand::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--strand); box-shadow: 0 0 0 1.5px var(--outline); }

/* ---------- Badge (one per stage) ---------- */
.lh-badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin: 0; padding: var(--space-3) var(--space-4); list-style: none; background: var(--surface-sunk); border-radius: var(--radius-lg); width: 100%; max-width: 100%; box-sizing: border-box; overflow: visible; }
@media (min-width: 600px) { .lh-badges { display: flex; flex-wrap: wrap; justify-content: center; width: max-content; } }
.lh-badge { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 64px; text-align: center; }
.lh-badge__medal { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; box-sizing: border-box;
  border: 2px solid var(--outline); background: var(--gold); box-shadow: var(--lip); }
.lh-badge__medal svg { width: 34px; height: 34px; }
.lh-badge__label { font: 800 12px/16px var(--font-body); letter-spacing: .04em; color: var(--ink); }
.lh-badge__meta { font: 600 11px/14px var(--font-body); color: var(--ink-muted); margin-top: -4px; }
.lh-badge[data-earned="false"] .lh-badge__medal { background: var(--surface); border: 2px dashed var(--control-border); box-shadow: none; }
.lh-badge[data-earned="false"] .lh-badge__medal svg { opacity: .35; filter: grayscale(1); }
.lh-badge[data-earned="false"] .lh-badge__label { color: var(--ink-muted); }
.lh-badge[data-current="true"] .lh-badge__medal { background: var(--primary-soft); border: 2px solid var(--primary); box-shadow: 0 0 0 4px var(--paper), 0 0 0 6px var(--primary); }
.lh-badge[data-current="true"] .lh-badge__medal svg { opacity: 1; filter: none; }
.lh-badge__ring { position: relative; }

/* ---------- Progress meter ---------- */
.lh-meter { height: 12px; border-radius: var(--radius-pill); background: var(--surface-sunk); box-shadow: inset 0 0 0 2px var(--line); overflow: hidden; }
.lh-meter > span { display: block; height: 100%; background: var(--gold); border-right: 2px solid var(--outline); border-radius: var(--radius-pill); }

/* ---------- Modal ---------- */
.lh-scrim { position: relative; display: grid; place-items: center; padding: var(--space-6) var(--space-4); background: rgba(20, 16, 12, .55); }
.lh-modal { width: 100%; max-width: 480px; box-sizing: border-box; background: var(--surface); color: var(--ink); border: 2px solid var(--outline); border-radius: var(--radius-xl); box-shadow: var(--overlay); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.lh-modal__title { font: 700 24px/30px var(--font-display); margin: 0; }
.lh-modal__close { position: absolute; }
.lh-modal__actions { display: flex; gap: var(--space-3); justify-content: flex-end; flex-wrap: wrap; margin-top: var(--space-2); }
.lh-modal--sheet { max-width: none; border-radius: var(--radius-xl) var(--radius-xl) 0 0; border-bottom: 0; padding: var(--space-3) var(--space-5) var(--space-5); }
.lh-modal--sheet::before { content: ""; align-self: center; width: 44px; height: 5px; border-radius: 3px; background: var(--line); }

/* ---------- Form ---------- */
.lh-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lh-label { font: 800 15px/20px var(--font-body); color: var(--ink); }
.lh-help { font: 600 14px/20px var(--font-body); color: var(--ink-muted); margin: 0; }
.lh-error { font: 700 14px/20px var(--font-body); color: var(--red-ink); margin: 0; display: flex; gap: 6px; align-items: center; }
.lh-error svg { width: 18px; height: 18px; flex: none; }
.lh-input, .lh-select, .lh-textarea { -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 100%; min-height: 48px; padding: 10px 14px;
  font: 600 16px/24px var(--font-body); color: var(--ink); background: var(--surface); border: 2px solid var(--control-border); border-radius: var(--radius-md); }
.lh-textarea { min-height: 104px; resize: vertical; }
.lh-input::placeholder, .lh-textarea::placeholder { color: var(--ink-faint); }
.lh-input:focus, .lh-select:focus, .lh-textarea:focus { border-color: var(--primary); outline: 3px solid var(--focus); outline-offset: 1px; }
.lh-field[data-invalid="true"] .lh-input { border-color: var(--red); background: var(--red-soft); }
.lh-input--code { font: 900 24px/32px var(--font-display); letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.lh-select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.lh-score { display: inline-flex; gap: 6px; }
.lh-score input { position: absolute; opacity: 0; pointer-events: none; }
.lh-score label { min-width: 48px; height: 48px; display: grid; place-items: center; border: 2px solid var(--control-border); border-radius: var(--radius-md); font: 800 18px/1 var(--font-display); cursor: pointer; background: var(--surface); color: var(--ink); }
.lh-score input:checked + label { background: var(--primary); color: var(--on-primary); border-color: var(--outline); box-shadow: 0 2px 0 var(--outline); }
.lh-score input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Choice card (starter pick) */
.lh-choice { position: relative; display: block; cursor: pointer; }
.lh-choice input { position: absolute; opacity: 0; pointer-events: none; }
.lh-choice__card { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-5) var(--space-4) var(--space-4); border: 2px solid var(--outline); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--lip); text-align: center; transition: transform .1s; }
.lh-choice input:checked + .lh-choice__card { background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary), var(--lip); transform: translateY(-4px); }
.lh-choice input:focus-visible + .lh-choice__card { outline: 3px solid var(--focus); outline-offset: 4px; }

/* ---------- Touch targets and phone text floor (27 Nov 2026) ---------- */
/* Anything pressed on a touch screen is at least 44px tall; chips that only label stay small. */
@media (pointer: coarse) {
  .lh-btn--sm { min-height: 44px; }
  button.lh-chip, a.lh-chip, label.lh-chip, .lh-chip[role="button"], .lh-chip[tabindex] { height: auto; min-height: 44px; padding-top: 0; padding-bottom: 0; }
  .lh-btn--quiet { min-height: 44px; }
}
/* Phones: nothing a student reads is under 13px. */
@media (max-width: 599px) {
  .lh-caption, .lh-card__eyebrow { font-size: 13px; line-height: 18px; }
  .lh-badge__label { font-size: 13px; line-height: 18px; }
  .lh-badge__meta { font-size: 13px; line-height: 18px; margin-top: -2px; }
  .lh-chip { font-size: 14px; }
}

/* ---------- Plan editor (added 2026-11-29, plan-editor): plan table + row cards, row status, skill picker,
   unsaved-changes note, empty state, field counter, quiet danger button. Tokens only; no new tokens. ---------- */
.pe { container: plan / inline-size; position: relative; display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.pe svg { flex: none; }
.pe-head { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; justify-content: space-between; }
.pe-pick { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: flex-end; flex: 1 1 420px; min-width: 0; }
.pe-pick .lh-field { flex: 0 1 260px; }
.pe-meta { font: 600 14px/20px var(--font-body); color: var(--ink-muted); margin: 0; padding-bottom: 12px; }
.pe-acts { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.pe-note { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--primary-soft); color: var(--ink); border: 2px solid var(--primary); }
.pe-note__txt { display: flex; gap: var(--space-2); align-items: flex-start; flex: 1 1 320px; margin: 0; }
.pe-note__txt svg { width: 18px; height: 18px; margin-top: 3px; color: var(--primary-ink); }
.pe-wrap { overflow-x: auto; max-width: 100%; border: 2px solid var(--line); border-radius: var(--radius-md); }
.ptable { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 20px; }
.ptable th { text-align: left; font: 800 12px/16px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); padding: var(--space-2) var(--space-3); background: var(--surface-sunk); white-space: nowrap; }
.ptable td { padding: var(--space-2) var(--space-3); border-top: 1px solid var(--line); vertical-align: top; }
.ptable tr.is-now td { background: var(--primary-soft); }
.ptable tr.is-past td { color: var(--ink-muted); }
.c-title { min-width: 10em; font-weight: 700; overflow-wrap: anywhere; }
.c-hw { min-width: 11em; overflow-wrap: anywhere; }
.c-done { min-width: 7em; overflow-wrap: anywhere; }
.c-dates { white-space: nowrap; }
.skills { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.skill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--radius-pill); background: var(--surface-sunk); color: var(--ink); font: 700 12px/1 var(--font-body); white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); }
.st { display: inline-flex; gap: 6px; align-items: center; font-weight: 800; white-space: nowrap; }
.st svg { width: 18px; height: 18px; flex: none; }
.st--past { color: var(--ink-muted); }
.st--now { color: var(--primary-ink); }
.st--next, .st--up { color: var(--ink); }
.mark { display: inline-flex; gap: 4px; align-items: center; font: 800 12px/16px var(--font-body); color: var(--brown-ink); margin-top: 4px; }
.mark svg { width: 14px; height: 14px; flex: none; }
.rowacts { display: flex; gap: var(--space-1); justify-content: flex-end; }
.rowacts .lh-btn { min-height: 36px; padding: 0 var(--space-2); }
.pe-cards { display: none; flex-direction: column; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.pcard { border: 2px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); background: var(--surface); min-width: 0; }
.pcard.is-now { border-color: var(--primary); background: var(--primary-soft); }
.pcard__top { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; justify-content: space-between; font: 600 14px/20px var(--font-body); color: var(--ink-muted); }
.pcard__title { font-weight: 800; margin: 0; overflow-wrap: anywhere; }
.pcard__kv { margin: 0; font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.pcard__kv b { color: var(--ink-muted); font-weight: 800; }
.pcard__acts { display: flex; gap: var(--space-2); }
.pcard__acts .lh-btn { flex: 1 1 0; min-height: 44px; }
.pe-tools { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); background: var(--surface-sunk); border-radius: var(--radius-md); }
.pe-tools__row { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; }
.pe-shift { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-weight: 700; }
.pe-shift .lh-input { width: 88px; min-height: 40px; padding: 6px 10px; }
.pe-sep { flex: 1 1 auto; }
.pe-empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-6) var(--space-5); border: 2px dashed var(--control-border); border-radius: var(--radius-lg); text-align: left; }
.pe-empty__t { font: 700 19px/24px var(--font-display); margin: 0; display: flex; gap: var(--space-2); align-items: center; }
.pe-empty__t svg { width: 20px; height: 20px; }
.pe-confirm { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-weight: 800; color: var(--red-ink); }
.btn-danger-q { color: var(--red-ink) !important; }
.btn-danger-q:hover { background: var(--red-soft) !important; }
@container plan (max-width: 759px) {
  .pe-wrap { display: none; }
  .pe-cards { display: flex; }
  .pe-acts { width: 100%; }
  .pe-acts .lh-btn { flex: 1 1 auto; }
}
/* Row dialog: a centred modal, a bottom sheet on phones. The scrim is a child of body. */
.pe-scrim { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding: var(--space-6) var(--space-4); overflow-y: auto; background: color-mix(in srgb, var(--outline) 60%, transparent); }
.pe-modal { position: relative; max-width: 640px; }
.pe-modal svg { flex: none; }
.pe-modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.pe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.count { font: 600 13px/18px var(--font-body); color: var(--ink-muted); text-align: right; margin-left: auto; white-space: nowrap; }
.count.is-over { color: var(--red-ink); font-weight: 800; }
.picked { display: flex; flex-wrap: wrap; gap: var(--space-2); min-height: 44px; align-items: center; }
.pickchip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px 0 12px; border-radius: var(--radius-pill); border: 2px solid var(--primary); background: var(--primary-soft); color: var(--primary-ink); font: 800 13px/1 var(--font-body); cursor: pointer; }
.pickchip svg { width: 16px; height: 16px; flex: none; }
.results { list-style: none; margin: 0; padding: 0; border: 2px solid var(--line); border-radius: var(--radius-md); max-height: 220px; overflow: auto; }
.results li + li { border-top: 1px solid var(--line); }
.res { display: flex; width: 100%; gap: var(--space-3); align-items: center; justify-content: space-between; min-height: 44px; padding: var(--space-1) var(--space-3); background: transparent; border: 0; color: var(--ink); font: 600 14px/20px var(--font-body); text-align: left; cursor: pointer; }
.res:hover { background: var(--primary-soft); }
.res[disabled] { color: var(--ink-muted); cursor: not-allowed; background: transparent; }
.res code { font: 800 13px/18px var(--font-body); color: var(--primary-ink); }
.lh-field[data-invalid="true"] .lh-select, .lh-field[data-invalid="true"] .lh-textarea { border-color: var(--red); background: var(--red-soft); }
.errsum { display: flex; gap: var(--space-2); align-items: flex-start; padding: var(--space-3); border-radius: var(--radius-md); background: var(--red-soft); color: var(--red-ink); font-weight: 700; border: 2px solid var(--red); margin: 0; }
.errsum svg { width: 18px; height: 18px; margin-top: 3px; }
.errsum ul { margin: var(--space-1) 0 0; padding-left: 20px; }
.modal-foot { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.modal-foot .pe-sep { flex: 1 1 auto; }
@media (max-width: 599px) {
  .pe-scrim { align-items: flex-end; padding: var(--space-6) 0 0; }
  .pe-modal { max-width: none; max-height: calc(100vh - var(--space-6)); overflow-y: auto; border-radius: var(--radius-xl) var(--radius-xl) 0 0; border-bottom: 0; padding: var(--space-4) var(--space-4) var(--space-5); }
  .pe-grid { grid-template-columns: minmax(0, 1fr); }
  .modal-foot .lh-btn { flex: 1 1 40%; }
  .modal-foot .pe-sep { display: none; }
}
@media (pointer: coarse) {
  .rowacts .lh-btn, .pe-shift .lh-input { min-height: 44px; }
}

/* ---------- Pixel accent (added 2026-12-03, question bank option B). Opt in with class lh-pixel on a wrapper
   (the question bank puts it on <body>). Same tokens, colours, body font and components; only corners, shadows,
   headings and captions change. Creatures and the lh-stage disc stay smooth. The page loads Pixelify Sans itself:
   <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@500;600&display=swap">
   (not in this file's @import, so pages without the accent fetch nothing extra). ---------- */
.lh-pixel :is(.lh-card, .lh-btn, .lh-input, .lh-select, .lh-textarea, .lh-chip, .lh-meter, .lh-meter > span, .lh-modal, .lh-tile, .lh-score label, .lh-choice__card) { border-radius: 0; }
.lh-pixel .lh-card { border: 2px solid var(--outline); box-shadow: var(--pixel-drop); }
.lh-pixel .lh-btn { box-shadow: var(--pixel-lip); }
.lh-pixel .lh-btn:active { transform: translate(2px, 2px); box-shadow: var(--pixel-lip-pressed); }
.lh-pixel .lh-btn--quiet, .lh-pixel .lh-btn--quiet:active, .lh-pixel .lh-btn[disabled], .lh-pixel .lh-btn[aria-disabled="true"] { box-shadow: none; }
.lh-pixel :is(h1, h2, h3, .lh-display, .lh-card__title, .lh-modal__title, .lh-tile__name) { font-family: var(--font-pixel); font-weight: 600; letter-spacing: 0; }
.lh-pixel :is(.lh-caption, .lh-card__eyebrow) { font-family: var(--font-pixel); font-weight: 500; font-size: 14px; line-height: 18px; letter-spacing: .08em; }
.lh-pixel__band { height: 8px; background: repeating-conic-gradient(var(--primary) 0 25%, var(--surface) 0 50%) 0 0 / 8px 8px; }
svg.lh-pxicon { width: 14px; height: 14px; flex: none; vertical-align: -2px; shape-rendering: crispEdges; }
/* Difficulty pips: 5 pips plus a word, never the pips alone. Round by default, square inside .lh-pixel. */
.lh-pips { display: inline-flex; align-items: center; gap: var(--space-2); font: 800 14px/20px var(--font-body); color: var(--ink); }
.lh-pips__row { display: inline-flex; gap: 4px; }
.lh-pips__row > i { width: 10px; height: 10px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--ink-muted); }
.lh-pips__row > i.is-on { background: var(--ink); border-color: var(--ink); }
.lh-pixel .lh-pips__row > i { border-radius: 0; }
