/* =============================================================================
 * The Living Curriculum Map — /curriculum/map/
 * -----------------------------------------------------------------------------
 * Light-only, on purpose. The page shell reuses the curriculum hub's palette
 * (--navy / --teal / --ink / --cream) so the map reads as part of the site; the
 * graph field itself is a deep navy instrument panel set into that shell.
 * There is deliberately NO prefers-color-scheme block anywhere in this file.
 * ========================================================================== */

:root {
  /* Shared with curriculum/index.html */
  --navy: #15487f;
  --teal: #205fa6;
  --green: #1c6b52;
  --cream: #eaf0f7;
  --ink: #14223a;
  --muted: #4b5870;
  --line: rgba(20, 34, 58, 0.12);
  --card: #ffffff;
  --surface-2: #f3f7fc;

  /* The instrument field */
  --field: #0a1c35;
  --field-line: rgba(163, 197, 240, 0.18);
  --on-field: #e9f1fd;
  --on-field-dim: #a9c2e2;
  --glass: rgba(9, 26, 48, 0.82);

  --focus: #b45309;
  --focus-on-dark: #ffd166;
  /* Text-safe live-signal red: 5.4:1 on white, 5.0:1 on --surface-2. The
     brighter #d94a2b below is decorative fill only. */
  --hot: #c23a19;
  --hot-fill: #d94a2b;

  --font-display: "Outfit", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;

  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;
  --shadow: 0 18px 44px rgba(10, 28, 53, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a {
  color: var(--teal);
  text-decoration: none;
}
a:hover {
  color: var(--navy);
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.field :focus-visible,
.rail :focus-visible,
.index :focus-visible {
  outline-color: var(--focus-on-dark);
}

.skiplink {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--card);
  color: var(--navy);
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 0 0 var(--r-md) 0;
}
.skiplink:focus {
  left: 0;
}

.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;
}

/* ------------------------------------------------------------------- shell */

.app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100dvh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 26px);
  flex-wrap: wrap;
  padding: 12px clamp(14px, 2.4vw, 26px);
  background: linear-gradient(180deg, #ffffff, #f4f8fd);
  border-bottom: 1px solid var(--line);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.back:hover {
  border-color: var(--teal);
  text-decoration: none;
}

.titles {
  min-width: 0;
}
.eyebrow {
  margin: 0;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
}
.titles h1 {
  margin: 1px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.1vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.018em;
  line-height: 1.15;
  color: var(--ink);
}

.tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ search */

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: min(340px, 68vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0 14px;
  min-height: 46px;
}
.search:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(32, 95, 166, 0.18);
}
.search svg {
  flex: 0 0 auto;
  color: var(--muted);
}
.search input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}

.results {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  z-index: 60;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  max-height: 52vh;
  overflow: auto;
}
.result {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.result.is-active,
.result:hover {
  background: var(--surface-2);
}
.result-id {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: var(--dot, var(--navy));
  white-space: nowrap;
}
.result-name {
  font-size: 14px;
  color: var(--ink);
}

/* ------------------------------------------------------------ zoom buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.zoomgroup {
  display: flex;
  gap: 6px;
}

/* ------------------------------------------------------------------- stage */

.stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 310px) minmax(0, 1fr);
  min-height: 0;
  background: var(--field);
}

/* ------------------------------------------------------------------- rail */

.rail {
  overflow-y: auto;
  padding: 18px 16px 40px;
  background: linear-gradient(180deg, #ffffff, #f2f6fc);
  border-right: 1px solid var(--line);
  min-height: 0;
}

.rail h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
}

.rail-block {
  padding: 0 0 20px;
  margin: 0 0 20px;
  border-bottom: 1px solid var(--line);
}
.rail-block:last-child {
  border-bottom: 0;
}

.rail-sub {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.rail-quiet {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  background: var(--surface-2);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 11px 13px;
}

.stuck {
  display: grid;
  gap: 8px;
}

.stuck-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--dot, var(--hot-fill));
  border-radius: var(--r-sm);
  background: var(--card);
  font: inherit;
  cursor: pointer;
}
.stuck-item:hover {
  border-color: var(--teal);
  border-left-color: var(--dot, var(--hot-fill));
  background: var(--surface-2);
}
.stuck-id {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13.5px;
  color: var(--ink);
}
.stuck-bar {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: rgba(20, 34, 58, 0.09);
  overflow: hidden;
}
.stuck-fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--hot-fill), #f08a3c);
}
.stuck-why {
  font-size: 12.5px;
  color: var(--muted);
}

.scrub-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.scrub-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: var(--teal);
}
input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
  min-height: 30px;
}
.scrub-note {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.cohort-note {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.legend {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
  font-size: 13.5px;
}
.legend li {
  display: flex;
  align-items: center;
  gap: 9px;
}
.lg-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(20, 34, 58, 0.06);
}
.lg-count {
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}
.lv-share {
  min-width: 40px;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--hot);
  font-variant-numeric: tabular-nums;
}

.edgekey {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.edgekey li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 12.5px;
  color: var(--muted);
}
.edgekey b {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
}
.ek-line {
  height: 0;
  margin-top: 9px;
  border-top: 3px solid var(--navy);
  border-radius: 3px;
}
.ek-line.supporting {
  border-top-width: 2px;
  opacity: 0.75;
}
.ek-line.fluency {
  border-top-width: 2px;
  border-top-style: dashed;
  opacity: 0.7;
}

/* ------------------------------------------------------------------- field */

.field {
  position: relative;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}
.field canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
.field:focus-visible {
  outline: 3px solid var(--focus-on-dark);
  outline-offset: -3px;
}

.fieldhelp {
  position: absolute;
  top: 12px;
  right: 12px;
  max-width: 250px;
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--field-line);
  color: var(--on-field-dim);
  font-size: 11.5px;
  line-height: 1.45;
  pointer-events: none;
  backdrop-filter: blur(9px);
}

.hover-chip {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: grid;
  gap: 1px;
  max-width: 330px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--field-line);
  backdrop-filter: blur(9px);
  pointer-events: none;
}
.hover-chip strong {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--on-field);
}
.hover-chip span {
  font-size: 13px;
  color: var(--on-field);
}
.hover-chip em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--on-field-dim);
}

.zoomdock {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  gap: 7px;
}
.zoomdock .btn {
  background: var(--glass);
  border-color: var(--field-line);
  color: var(--on-field);
  backdrop-filter: blur(9px);
  font-size: 17px;
}
.zoomdock .btn:hover {
  color: var(--focus-on-dark);
  border-color: var(--focus-on-dark);
}
.zoomdock .btn.fit {
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* Standards index — the accessible mirror of the canvas. Present for screen
   readers at all times, revealed visually the moment keyboard focus lands. */
.index {
  position: absolute;
  left: 12px;
  top: 12px;
  width: min(330px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--glass);
  border: 1px solid var(--field-line);
  backdrop-filter: blur(11px);
  opacity: 0;
  transform: translateX(-10px);
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
  z-index: 12;
}
.index:focus-within {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.index-head {
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--field-line);
}
.index-head p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--on-field);
}
.index-head span {
  font-size: 11.5px;
  color: var(--on-field-dim);
}
.index ol {
  margin: 0;
  padding: 6px;
  list-style: none;
  overflow-y: auto;
}
.idx-item {
  display: grid;
  gap: 1px;
  width: 100%;
  text-align: left;
  padding: 8px 11px;
  border: 0;
  border-left: 3px solid var(--dot, #58b6ff);
  border-radius: var(--r-sm);
  background: transparent;
  font: inherit;
  color: var(--on-field);
  cursor: pointer;
}
.idx-item:hover,
.idx-item:focus-visible {
  background: rgba(120, 175, 240, 0.16);
}
.idx-id {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12.5px;
}
.idx-name {
  font-size: 13px;
}
.idx-meta {
  font-size: 11px;
  color: var(--on-field-dim);
}

/* ------------------------------------------------------------------- panel */

.panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100%);
  z-index: 40;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--card);
  border-left: 1px solid var(--line);
  box-shadow: -22px 0 54px rgba(6, 18, 36, 0.32);
  animation: panel-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.panel[hidden] {
  display: none;
}
@keyframes panel-in {
  from {
    transform: translateX(26px);
    opacity: 0;
  }
}

.panel-close {
  position: sticky;
  top: 10px;
  float: right;
  margin: 10px 12px 0 0;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}
.panel-close:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.pnl-head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--card));
}
.pnl-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
}
.chip-domain {
  color: var(--card);
  background: var(--accent, var(--navy));
  border-color: transparent;
}
.chip-core {
  color: #7c2d12;
  background: #fef0e2;
  border-color: #f2c9a4;
}
.chip-supporting {
  color: #15487f;
  background: #e6eefa;
  border-color: #b9cfea;
}
.chip-fluency {
  color: #1c6b52;
  background: #e3f4ed;
  border-color: #a8d9c7;
}
.pnl-id {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--accent, var(--navy));
}
.pnl-title {
  margin: 2px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}
.pnl-full {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
}

.pnl-body {
  padding: 4px 22px 40px;
}
.pnl-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.pnl-section:last-of-type {
  border-bottom: 0;
}
.pnl-h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
}
.pnl-h4 {
  margin: 14px 0 6px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.pnl-hint {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}
.pnl-empty {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}
.pnl-count {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* --------------------------------------------------- the prerequisite trace */

.trace {
  margin: 0;
  padding: 0;
  list-style: none;
  position: relative;
}
.trace::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--navy), rgba(21, 72, 127, 0.12));
}
.trace-tier {
  margin: 14px 0 6px 26px;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.trace-tier:first-child {
  margin-top: 0;
}
.trace-step {
  position: relative;
  display: grid;
  grid-template-columns: 26px 1fr;
  margin-bottom: 10px;
}
.trace-rail {
  position: relative;
}
.trace-dot {
  position: absolute;
  left: 1px;
  top: 15px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--navy);
}
.trace-step[data-strength="core"] .trace-dot {
  border-color: #c2410c;
}
.trace-step[data-strength="fluency"] .trace-dot {
  border-color: var(--green);
}
.trace-card {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.trace-step[data-strength="core"] .trace-card {
  border-left-color: #c2410c;
  background: #fff8f2;
}
.trace-step[data-strength="fluency"] .trace-card {
  border-left-color: var(--green);
  background: #f1faf6;
}
.trace-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.trace-why {
  margin: 0 0 5px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
.trace-via {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
}

.std-link {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 4px 8px;
  margin-left: -8px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
}
.std-link:hover {
  background: rgba(32, 95, 166, 0.1);
}
.std-link-id {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13.5px;
  color: var(--dot, var(--navy));
}
.std-link-lg .std-link-id {
  font-size: 15px;
}
.std-link-name {
  font-size: 13.5px;
}

.unlocks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}
.unlock-step {
  display: flex;
  align-items: center;
  gap: 8px;
}
.unlock-step.depth-2 {
  padding-left: 18px;
  opacity: 0.86;
}
.unlock-depth {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.misc-list,
.live-list,
.asset-list,
.cov-list,
.cov-flags {
  margin: 0;
  padding: 0;
  list-style: none;
}
.misc-item {
  padding: 11px 13px;
  margin-bottom: 8px;
  border: 1px solid #f0d3bd;
  border-radius: var(--r-sm);
  background: #fff7f0;
}
.misc-label {
  margin: 0 0 3px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: #7c2d12;
}
.misc-watch {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
}
.misc-es {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.live-item {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.live-share {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--hot);
  min-width: 42px;
  font-variant-numeric: tabular-nums;
}
.live-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
}

.asset-link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: var(--r-sm);
}
.asset-link:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.asset-title {
  font-size: 14px;
  color: var(--teal);
  font-weight: 600;
}
.asset-link:hover .asset-title {
  text-decoration: underline;
}
.asset-meta {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.cov-row {
  display: grid;
  grid-template-columns: 150px 1fr 26px;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
}
.cov-zero {
  opacity: 0.62;
}
.cov-name {
  color: var(--ink);
}
.cov-bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(20, 34, 58, 0.08);
  overflow: hidden;
}
.cov-fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--navy), var(--teal));
}
.cov-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.cov-flags {
  margin-top: 10px;
  display: grid;
  gap: 5px;
}
.cov-flags li {
  font-size: 12.5px;
  color: #7c2d12;
  background: #fff4ea;
  border: 1px dashed #eec6a6;
  border-radius: var(--r-sm);
  padding: 7px 10px;
}

.tt-wrap {
  overflow-x: auto;
}
.tt {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.tt th,
.tt td {
  text-align: left;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tt th {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.tt-lesson {
  white-space: normal;
}

.forge-btn {
  display: grid;
  gap: 2px;
  margin-top: 22px;
  padding: 15px 18px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--navy), #1d6ea8);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(21, 72, 127, 0.28);
}
.forge-btn:hover {
  color: #ffffff;
  text-decoration: none;
  filter: brightness(1.07);
}
.forge-kicker {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
}
.forge-sub {
  font-size: 12.5px;
  opacity: 0.9;
}

/* -------------------------------------------------------------- boot states */

.boot {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 30px;
  text-align: center;
  background: var(--field);
  color: var(--on-field);
}
.boot h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
}
.boot p {
  margin: 0;
  max-width: 46ch;
  color: var(--on-field-dim);
  font-size: 14.5px;
}
.boot-link {
  color: var(--focus-on-dark);
  font-weight: 700;
  text-decoration: underline;
}
.boot-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(169, 194, 226, 0.25);
  border-top-color: #58b6ff;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* -------------------------------------------------------- plain-text fallback */

.fallback {
  padding: clamp(24px, 5vw, 48px);
  max-width: 1100px;
  margin: 0 auto;
  background: var(--cream);
}
.fallback h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0 0 6px;
}
.fallback > p {
  color: var(--muted);
  max-width: 70ch;
}
.fb-std {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin: 0 0 12px;
}
.fb-std h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 2px;
  color: var(--navy);
}
.fb-std p {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
}
.fb-std ul {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .stage {
    grid-template-columns: minmax(0, 264px) minmax(0, 1fr);
  }
  .panel {
    width: min(410px, 100%);
  }
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }
  .app {
    height: auto;
    min-height: 100dvh;
  }
  .topbar {
    position: sticky;
    top: 0;
  }
  .tools {
    width: 100%;
    margin-left: 0;
  }
  .search {
    min-width: 0;
    flex: 1;
  }
  .stage {
    display: block;
  }
  .field {
    height: 62dvh;
    min-height: 380px;
  }
  .rail {
    border-right: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  .fieldhelp {
    display: none;
  }
  .index {
    max-height: min(56dvh, calc(62dvh - 24px));
  }
  .panel {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 84dvh;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    box-shadow: 0 -18px 50px rgba(6, 18, 36, 0.34);
    animation-name: sheet-in;
  }
  @keyframes sheet-in {
    from {
      transform: translateY(30px);
      opacity: 0;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
