@charset "UTF-8";

:root {
  --ui-bg: #0b1311;
  --ui-panel: #131f1b;
  --ui-panel-2: #182722;
  --ui-panel-3: #1d2e28;
  --ui-border: rgba(232, 220, 194, 0.12);
  --ui-border-strong: rgba(232, 220, 194, 0.2);
  --ui-text: #f0e9da;
  --ui-text-soft: #ced2c6;
  --ui-muted: #929e94;
  --ui-muted-2: #6f7d73;
  --red: #ae3d2e;
  --red-bright: #cf5a45;
  --red-deep: #82281f;
  --blue: #59727a;
  --blue-soft: #8ca3a5;
  --gold: #c6a265;
  --gold-soft: #dfc491;
  --map-paper: #e7ddc6;
  --map-ink: #263b32;
  --font-ui: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --font-display: "KaiTi", "STKaiti", "Kaiti SC", "FangSong", serif;
  --font-map: "FangSong", "STFangsong", "SimSun", "Songti SC", serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ui-text);
  font-family: var(--font-ui);
  background:
    radial-gradient(ellipse at 12% -12%, rgba(100, 127, 101, 0.2), transparent 42%),
    radial-gradient(ellipse at 90% 112%, rgba(118, 73, 48, 0.14), transparent 44%),
    var(--ui-bg);
  -webkit-font-smoothing: antialiased;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:focus-visible,
summary:focus-visible,
input:focus-visible + .switch {
  outline: 2px solid var(--gold-soft);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

::selection {
  color: #fff9e9;
  background: var(--red);
}

.app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  min-height: 600px;
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto minmax(300px, 1fr);
  align-items: center;
  flex: 0 0 74px;
  padding: 0 22px;
  border-bottom: 1px solid var(--ui-border);
  background: rgba(11, 19, 17, 0.92);
}

.topbar::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  width: 30%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(198, 162, 101, 0.45));
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-seal {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  color: #f4e6c8;
  border: 1px solid rgba(245, 229, 199, 0.62);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 50%),
    #a2372b;
  box-shadow:
    inset 0 0 0 3px #a2372b,
    inset 0 0 0 4px rgba(247, 229, 197, 0.5);
  font-family: var(--font-display);
  font-size: 25px;
  line-height: 1;
  transform: rotate(-1.5deg);
}

.brand-seal::before,
.brand-seal::after {
  position: absolute;
  width: 4px;
  height: 4px;
  content: "";
  border: 1px solid rgba(247, 232, 202, 0.55);
}

.brand-seal::before {
  top: 4px;
  left: 4px;
  border-right: 0;
  border-bottom: 0;
}

.brand-seal::after {
  right: 4px;
  bottom: 4px;
  border-top: 0;
  border-left: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-overline {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 2.35px;
  white-space: nowrap;
}

.brand h1 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 3px;
  line-height: 1;
  white-space: nowrap;
}

.brand h1 span {
  color: var(--ui-text-soft);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 2.6px;
}

.command-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: center;
  min-width: 0;
  color: var(--ui-muted);
  font-size: 11px;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.meta-date {
  padding: 5px 9px;
  color: var(--gold-soft);
  border: 1px solid rgba(198, 162, 101, 0.3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
}

.meta-rule {
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ui-border-strong), transparent);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 9px;
}

.ghost-btn,
.solid-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 3px;
  font-size: 12px;
  letter-spacing: 0.7px;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.ghost-btn {
  color: var(--ui-text-soft);
  border: 1px solid var(--ui-border);
  background: rgba(255, 255, 255, 0.015);
}

.ghost-btn:hover {
  border-color: var(--ui-border-strong);
  background: rgba(255, 255, 255, 0.045);
}

.solid-btn {
  gap: 9px;
  color: #fff0d2;
  border: 1px solid rgba(255, 238, 207, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent),
    #9d3529;
  box-shadow: 0 6px 18px rgba(110, 31, 25, 0.25);
}

.solid-btn:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), transparent),
    #b13e30;
}

.solid-btn:active {
  transform: translateY(1px);
}

.solid-btn kbd {
  padding: 1px 4px;
  color: rgba(255, 242, 216, 0.7);
  border: 1px solid rgba(255, 238, 210, 0.3);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.5;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  padding: 14px 16px 16px;
}

.map-shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background: var(--ui-panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 50px;
  gap: 20px;
  padding: 0 13px 0 16px;
  border-bottom: 1px solid var(--ui-border);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.018), transparent 42%),
    rgba(18, 30, 26, 0.98);
}

.toolbar-title {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 9px;
  color: var(--ui-text-soft);
  font-size: 12px;
  letter-spacing: 1.5px;
}

.live-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-bright);
  box-shadow: 0 0 0 4px rgba(207, 90, 69, 0.1);
}

.live-dot::after {
  position: absolute;
  inset: -4px;
  content: "";
  border: 1px solid rgba(207, 90, 69, 0.35);
  border-radius: 50%;
  animation: livePulse 2.6s ease-out infinite;
}

.toolbar-code {
  padding-left: 9px;
  color: var(--ui-muted-2);
  border-left: 1px solid var(--ui-border);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1.1px;
}

.toolbar-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--ui-muted);
  font-size: 10px;
  letter-spacing: 0.4px;
}

.toolbar-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
}

.legend-dot--red {
  background: var(--red-bright);
  box-shadow: 0 0 0 2px rgba(207, 90, 69, 0.15);
}

.legend-dot--blue {
  background: #729298;
  box-shadow: 0 0 0 2px rgba(114, 146, 152, 0.15);
}

.legend-stroke {
  display: inline-block;
  width: 18px;
  height: 1px;
  background: linear-gradient(90deg, var(--red-bright) 0 55%, transparent 55% 70%, var(--red-bright) 70%);
}

.legend-rail {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 6px;
  background: repeating-linear-gradient(90deg, #b8a987 0 2px, transparent 2px 5px);
}

.legend-rail::before {
  position: absolute;
  top: 2px;
  left: 0;
  width: 18px;
  height: 1px;
  content: "";
  background: #b8a987;
}

.legend-slot {
  display: grid;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  place-items: center;
  color: var(--gold-soft);
  border: 1px dashed rgba(198, 162, 101, 0.5);
  font-family: var(--font-mono);
  font-size: 8px;
  font-style: normal;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 4px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 9px;
  color: var(--ui-muted);
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  font-size: 10px;
  letter-spacing: 0.5px;
  transition: 160ms ease;
}

.tool-btn:hover,
.tool-btn[aria-expanded="true"] {
  color: var(--ui-text);
  border-color: var(--ui-border);
  background: rgba(255, 255, 255, 0.04);
}

.tool-btn--icon {
  width: 28px;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 15px;
}

.zoom-value {
  min-width: 34px;
  color: var(--ui-muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  text-align: center;
}

.map-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(70, 87, 72, 0.18), transparent 70%),
    #101a17;
  isolation: isolate;
}

#sandbox {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.map-stage.is-panning #sandbox {
  cursor: grabbing;
}

.map-stage.is-panning .unit {
  cursor: grabbing;
}

.map-zoom-badge {
  position: absolute;
  bottom: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  color: rgba(242, 235, 219, 0.68);
  border: 1px solid rgba(232, 220, 194, 0.13);
  border-radius: 3px;
  background: rgba(12, 22, 18, 0.79);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  font-size: 9px;
  letter-spacing: 0.9px;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.zoom-crosshair {
  position: relative;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(223, 196, 145, 0.55);
  border-radius: 50%;
}

.zoom-crosshair::before,
.zoom-crosshair::after {
  position: absolute;
  content: "";
  background: rgba(223, 196, 145, 0.6);
}

.zoom-crosshair::before {
  top: 5px;
  left: -3px;
  width: 16px;
  height: 1px;
}

.zoom-crosshair::after {
  top: -3px;
  left: 5px;
  width: 1px;
  height: 16px;
}

.map-stage[data-stage="5"] .map-zoom-badge {
  opacity: 0;
}

.mobile-map-hint {
  display: none;
}

/* ---------- Map SVG ---------- */

.cartouche {
  pointer-events: none;
}

.cartouche-kicker {
  fill: #8b7654;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 2px;
}

.cartouche-title {
  fill: #263b32;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 3px;
}

.cartouche-sub {
  fill: #665f4f;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 1.3px;
}

.cartouche-seal-text {
  fill: #f5e9d2;
  font-family: var(--font-display);
  font-size: 11px;
  text-anchor: middle;
}

.terrain-hill {
  fill: #d1d4bc;
  opacity: 0.65;
}

.terrain-hill--faint {
  fill: #d8d4bc;
  opacity: 0.35;
}

.terrain-hill--south {
  fill: #d4d2b9;
  opacity: 0.28;
}

.contours {
  fill: none;
  stroke: #7d8068;
  stroke-width: 1.1;
  stroke-dasharray: 1 5;
  opacity: 0.25;
}

.ridges {
  fill: none;
  stroke: #7f8064;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.terrain-label {
  fill: #756f59;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 7px;
  opacity: 0.65;
}

.terrain-label--faint {
  font-size: 25px;
  opacity: 0.16;
  letter-spacing: 11px;
}

.sea-label {
  fill: #637f7b;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 8px;
  opacity: 0.7;
}

.sea-waves {
  fill: none;
  stroke: #6d8f89;
  stroke-width: 1;
  opacity: 0.3;
}

.coastline {
  fill: none;
  stroke: #7f9187;
  stroke-width: 1.3;
  opacity: 0.55;
}

.lake-shapes {
  fill: #b7cfca;
  stroke: #7b9c99;
  stroke-width: 1.1;
  opacity: 0.7;
}

.lake-lines {
  fill: none;
  stroke: #6f938f;
  stroke-width: 1;
  opacity: 0.26;
}

.river {
  fill: none;
  stroke: #9ec1bd;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 8;
  opacity: 0.67;
}

.river--canal {
  stroke: #a5c6c1;
  stroke-width: 12;
  opacity: 0.72;
}

.river--thin {
  stroke-width: 4.3;
  opacity: 0.5;
}

.river--dry {
  stroke-dasharray: 10 7;
  opacity: 0.25;
}

.railway {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.railway--base {
  stroke: #83755f;
  stroke-width: 5.3;
  opacity: 0.8;
}

.railway--tie {
  stroke: #efe6d2;
  stroke-width: 2.4;
  stroke-dasharray: 6 7;
  opacity: 0.95;
}

.map-tag {
  pointer-events: none;
}

.map-tag rect {
  fill: rgba(240, 231, 211, 0.94);
  stroke: rgba(104, 91, 69, 0.28);
  stroke-width: 1;
}

.map-tag text {
  fill: #6c5e47;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 2.2px;
  text-anchor: middle;
}

.map-tag--minor rect {
  fill: rgba(240, 231, 211, 0.8);
}

.map-tag--minor text {
  font-size: 11px;
  letter-spacing: 1.8px;
}

.water-tag {
  pointer-events: none;
}

.water-tag text {
  fill: #618983;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 4px;
}

.water-tag--small text {
  font-size: 12px;
  letter-spacing: 2px;
}

.place {
  cursor: help;
}

.place-dot {
  fill: #425e54;
  stroke: #f0e6d0;
  stroke-width: 1.4;
}

.place-ring {
  fill: none;
  stroke: #344f46;
  stroke-width: 1.5;
  transform: scale(1.2);
  transform-box: fill-box;
  transform-origin: center;
}

.place-halo {
  fill: rgba(68, 93, 81, 0.12);
  stroke: #61776b;
  stroke-width: 1;
  stroke-dasharray: 2 3;
  transform: scale(1.08);
  transform-box: fill-box;
  transform-origin: center;
}

.place-dot {
  transform: scale(1.4);
  transform-box: fill-box;
  transform-origin: center;
  transition:
    r 180ms ease,
    transform 180ms ease;
}

.place:hover .place-dot {
  r: 5px;
}

.place--key .place-name {
  fill: #65352d;
}

.place--key .place-dot {
  fill: #91362c;
}

.place--key .place-ring {
  stroke: #91362c;
}

.place--xuzhou .place-dot {
  fill: #812f27;
}

.place-name {
  fill: #273d34;
  font-family: var(--font-map);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1.5px;
  paint-order: stroke;
  stroke: rgba(235, 225, 205, 0.93);
  stroke-width: 3.5px;
  stroke-linejoin: round;
  pointer-events: none;
}

.place-name--xl {
  fill: #1d332b;
  font-size: 34px;
  letter-spacing: 4px;
}

.place-name--large {
  font-size: 22px;
  letter-spacing: 2px;
}

.place-name--small {
  fill: #4e5f54;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  stroke-width: 3px;
}

.place-roman {
  fill: #65766b;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 2px;
  paint-order: stroke;
  stroke: rgba(235, 225, 205, 0.92);
  stroke-width: 3px;
}

/* ---------- Generated units ---------- */

.layer-units {
  transition: opacity 220ms ease;
}

.unit {
  cursor: pointer;
  transition:
    opacity 380ms ease,
    filter 260ms ease;
}

.unit .unit-plate,
.unit .unit-bar,
.unit .unit-name,
.unit .unit-sub,
.unit .unit-symbol {
  pointer-events: none;
}

.unit-plate {
  stroke-width: 1.15;
  filter: url(#plateShadow);
  transition:
    stroke-width 180ms ease,
    fill 180ms ease;
}

.unit--kmt .unit-plate {
  fill: #e4e7e1;
  stroke: #566f74;
  stroke-width: 1.35;
}

.unit--kmt .unit-bar {
  fill: #4c686d;
}

.unit--kmt .unit-name {
  fill: #213e45;
}

.unit--kmt .unit-sub {
  fill: #617277;
}

.unit--kmt .unit-symbol {
  fill: #4c686d;
}

.unit--pla .unit-plate {
  fill: #f1dfc5;
  stroke: #9e3d31;
  stroke-width: 1.35;
}

.unit--pla .unit-bar {
  fill: #a33a2e;
}

.unit--pla .unit-name {
  fill: #762a23;
}

.unit--pla .unit-sub {
  fill: #7f6258;
}

.unit--pla .unit-symbol {
  fill: #a33a2e;
}

.unit--ghost .unit-plate {
  fill: rgba(235, 227, 208, 0.72);
  stroke: #8b7547;
  stroke-dasharray: 6 5;
}

.unit--ghost .unit-bar {
  fill: #8b7547;
}

.unit--ghost .unit-name {
  fill: #6c5a38;
}

.unit--ghost .unit-sub {
  fill: #897b5e;
}

.unit--ghost .unit-symbol {
  fill: #8b7547;
}

.unit--ghost .unit-plate {
  filter: none;
}

.unit-name {
  font-family: var(--font-map);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-anchor: middle;
}

.unit-sub {
  font-family: var(--font-ui);
  font-size: 12.2px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-anchor: middle;
}

.unit--compact .unit-name {
  font-size: 21px;
  letter-spacing: 1px;
}

.unit--compact .unit-sub {
  font-size: 10.8px;
}

.unit.is-dim {
  opacity: 0.5;
}

.unit.is-unrevealed {
  display: none;
}

.unit.is-focus .unit-plate {
  stroke-width: 2.2;
}

.unit.is-focus .unit-symbol {
  filter: url(#softGlow);
}

.unit:hover .unit-plate {
  stroke-width: 2.4;
}

.unit:focus {
  outline: none;
}

.unit:focus .unit-plate {
  stroke: #c7a466;
  stroke-width: 2.6;
}

.unit-hit {
  fill: transparent;
}

.unit-flag-note {
  font-family: var(--font-ui);
  font-size: 8.5px;
  letter-spacing: 1px;
  opacity: 0.65;
}

/* ---------- Generated routes ---------- */

.route-group {
  opacity: 0;
  transition: opacity 420ms ease;
  pointer-events: none;
}

.route-group.is-active {
  opacity: 1;
}

.route {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
  paint-order: stroke;
  filter: drop-shadow(0 1px 0 rgba(239, 229, 209, 0.7));
}

.route--red {
  stroke: #a7372b;
}

.route--red-soft {
  stroke: #b95a4b;
}

.route--enemy {
  stroke: #576d6e;
  stroke-dasharray: 10 8;
  opacity: 0.75;
}

.route--ghost {
  stroke: #8f7441;
  stroke-dasharray: 8 8;
  opacity: 0.82;
}

.route--retreat {
  stroke: #6c6251;
  stroke-dasharray: 7 7;
  stroke-width: 3;
  opacity: 0.7;
}

.route--block {
  stroke: #a7372b;
  stroke-width: 9;
  stroke-linecap: butt;
  opacity: 0.82;
  stroke-dasharray: 2 7;
}

.route-group.is-active .route--enemy,
.route-group.is-active .route--ghost,
.route-group.is-active .route--retreat {
  animation: dashMarch 11s linear infinite;
}

.route-label {
  pointer-events: none;
}

.route-label rect {
  fill: rgba(241, 232, 213, 0.95);
  stroke-width: 1;
}

.route-label text {
  font-family: var(--font-ui);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-anchor: middle;
}

.route-label--red rect {
  stroke: rgba(154, 52, 41, 0.5);
}

.route-label--red text {
  fill: #853126;
}

.route-label--enemy rect {
  fill: rgba(236, 236, 225, 0.9);
  stroke: rgba(74, 99, 100, 0.38);
}

.route-label--enemy text {
  fill: #4c6364;
}

.route-label--ghost rect {
  fill: rgba(241, 232, 213, 0.88);
  stroke: rgba(139, 117, 71, 0.5);
}

.route-label--ghost text {
  fill: #7b653d;
}

.route-label--small text {
  font-size: 13px;
  letter-spacing: 0.4px;
}

.route-label--label-only rect {
  display: none;
}

.route-label--label-only text {
  font-size: 15px;
  paint-order: stroke;
  stroke: rgba(238, 228, 208, 0.94);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.encirclement {
  fill: none;
  stroke: #a7372b;
  stroke-width: 4.5;
  stroke-dasharray: 12 8;
  opacity: 0.85;
  filter: drop-shadow(0 0 4px rgba(167, 55, 43, 0.18));
}

.encircle-tick {
  fill: none;
  stroke: #a7372b;
  stroke-width: 3;
  stroke-linecap: round;
}

/* ---------- A / B checkpoints ---------- */

.checkpoint-layer {
  transition: opacity 200ms ease;
}

.checkpoint-layer.is-layer-hidden {
  display: none;
}

.checkpoint {
  cursor: pointer;
}

.checkpoint-hit {
  fill: transparent;
  pointer-events: all;
}

.checkpoint-leader {
  fill: none;
  stroke: #8c3a2f;
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  opacity: 0.65;
}

.checkpoint-box {
  fill: #eee2cb;
  stroke: #8c3a2f;
  stroke-width: 1.8;
  stroke-dasharray: 5 3;
  filter: url(#plateShadow);
  transition:
    fill 220ms ease,
    stroke 220ms ease;
}

.checkpoint-letter {
  fill: #8c3a2f;
  font-family: var(--font-map);
  font-size: 30px;
  font-weight: 700;
  pointer-events: none;
}

.checkpoint-pulse {
  fill: none;
  stroke: #a33a2d;
  stroke-width: 1.4;
  stroke-dasharray: 3 4;
  animation: targetPulse 2.8s ease-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.checkpoint-dot {
  fill: #a33a2d;
  stroke: #f2e8d3;
  stroke-width: 2;
}

.checkpoint-answer {
  opacity: 0;
  transition: opacity 280ms ease;
  pointer-events: none;
}

.checkpoint-answer rect {
  fill: #17312a;
  stroke: #d8c092;
  stroke-width: 1;
}

.checkpoint-answer text {
  fill: #f7ecd7;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.6px;
}

.checkpoint--b .checkpoint-answer text {
  font-size: 15px;
}

.map-stage.is-answer-revealed .checkpoint-box {
  fill: #9f372b;
  stroke: #f1dfc3;
}

.map-stage.is-answer-revealed .checkpoint-letter {
  fill: #f8edd8;
}

.map-stage.is-answer-revealed .checkpoint-answer {
  opacity: 1;
}

.checkpoint:hover .checkpoint-box,
.checkpoint:focus .checkpoint-box {
  stroke-width: 3;
}

.checkpoint:focus {
  outline: none;
}

/* ---------- Map furniture ---------- */

.map-furniture {
  pointer-events: none;
}

.north-arrow circle {
  fill: rgba(238, 229, 209, 0.5);
  stroke: rgba(70, 82, 68, 0.35);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.north-arrow path {
  fill: #42574d;
  stroke: #ede3cf;
  stroke-width: 1;
}

.north-arrow text {
  fill: #42574d;
  font-family: var(--font-map);
  font-size: 15px;
  letter-spacing: 2px;
}

.scale-bar {
  fill: #5b6658;
  stroke: #5b6658;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.5px;
}

.scale-bar line {
  stroke: #5b6658;
  stroke-width: 1;
}

.scale-bar text {
  fill: #5b6658;
}

.edition-note {
  fill: #776f5e;
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.8px;
  opacity: 0.7;
}

.corner-marks {
  fill: none;
  stroke: #63705f;
  stroke-width: 1;
  opacity: 0.4;
}

/* ---------- Tooltip / dossier / quiz ---------- */

.tooltip {
  position: fixed;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 260px;
  padding: 9px 11px;
  color: var(--ui-text);
  border: 1px solid rgba(223, 196, 145, 0.22);
  border-radius: 4px;
  background: rgba(14, 25, 21, 0.95);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.tooltip strong {
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.8px;
}

.tooltip span {
  color: var(--ui-muted);
  font-size: 10px;
  line-height: 1.6;
}

.dossier {
  position: absolute;
  z-index: 18;
  top: 16px;
  right: 16px;
  width: min(344px, calc(100% - 32px));
  max-height: calc(100% - 110px);
  overflow: auto;
  padding: 22px 20px 19px 24px;
  color: var(--ui-text);
  border: 1px solid rgba(223, 196, 145, 0.26);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 44%),
    rgba(17, 31, 26, 0.96);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(15px);
  animation: dossierIn 220ms ease both;
}

.dossier-rail {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--blue);
}

.dossier-close {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 25px;
  height: 25px;
  color: var(--ui-muted);
  border-radius: 50%;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 1;
}

.dossier-close:hover {
  color: var(--ui-text);
  background: rgba(255, 255, 255, 0.06);
}

.dossier-eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 1.4px;
}

.dossier h3 {
  margin: 0 0 5px;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: 1.4px;
}

.dossier-location {
  margin: 0 0 15px;
  color: var(--ui-muted);
  font-size: 11px;
  letter-spacing: 0.4px;
}

.dossier blockquote {
  margin: 0;
  padding: 12px 0 12px 13px;
  color: var(--ui-text-soft);
  border-left: 1px solid rgba(198, 162, 101, 0.38);
  font-family: var(--font-map);
  font-size: 15px;
  line-height: 1.8;
}

.dossier-note {
  margin: 14px 0 0;
  color: var(--ui-muted);
  font-size: 11px;
  line-height: 1.75;
}

.quiz-strip {
  position: absolute;
  z-index: 16;
  right: 50%;
  bottom: 16px;
  width: min(672px, calc(100% - 32px));
  padding: 12px 14px;
  color: var(--ui-text);
  border: 1px solid rgba(223, 196, 145, 0.23);
  background:
    linear-gradient(90deg, rgba(163, 58, 46, 0.12), transparent 35%),
    rgba(15, 28, 23, 0.94);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
  transform: translateX(50%);
  animation: stripIn 280ms ease both;
}

.quiz-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.quiz-kicker {
  color: var(--gold-soft);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 1.3px;
}

.quiz-hint {
  color: var(--ui-muted);
  font-size: 9px;
  letter-spacing: 0.5px;
}

.quiz-strip-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.quiz-slot {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.quiz-letter {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  place-items: center;
  color: var(--gold-soft);
  border: 1px dashed rgba(223, 196, 145, 0.4);
  font-family: var(--font-mono);
  font-size: 13px;
}

.quiz-slot strong {
  display: block;
  min-height: 18px;
  color: var(--ui-text);
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.8px;
  line-height: 1.1;
}

.quiz-slot small {
  display: block;
  margin-top: 3px;
  color: var(--ui-muted);
  font-size: 9px;
}

.quiz-divider {
  width: 1px;
  height: 32px;
  flex: 0 0 1px;
  background: var(--ui-border);
}

.quiz-toggle {
  height: 31px;
  margin-left: auto;
  padding: 0 13px;
  color: #f3e6cc;
  border: 1px solid rgba(215, 184, 130, 0.3);
  background: rgba(163, 58, 46, 0.32);
  font-size: 10px;
  letter-spacing: 0.7px;
  white-space: nowrap;
  transition: 160ms ease;
}

.quiz-toggle:hover {
  background: rgba(163, 58, 46, 0.55);
}

.map-stage.is-answer-revealed .quiz-slot strong {
  color: var(--gold-soft);
}

.map-stage.is-answer-revealed .quiz-slot small {
  color: var(--ui-text-soft);
}

.present-exit {
  position: absolute;
  z-index: 25;
  top: 13px;
  right: 14px;
  height: 30px;
  padding: 0 12px;
  color: var(--ui-text-soft);
  border: 1px solid var(--ui-border-strong);
  background: rgba(15, 27, 23, 0.85);
  font-size: 10px;
  letter-spacing: 0.8px;
  backdrop-filter: blur(8px);
}

.projection-caption {
  position: absolute;
  z-index: 14;
  bottom: 16px;
  left: 16px;
  display: none;
  flex-direction: column;
  gap: 4px;
  max-width: 480px;
  padding: 10px 13px;
  border-left: 2px solid var(--red-bright);
  background: rgba(15, 27, 23, 0.88);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.projection-caption span {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1.2px;
}

.projection-caption strong {
  color: var(--ui-text);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

/* ---------- Timeline ---------- */

.timeline {
  display: flex;
  align-items: center;
  flex: 0 0 76px;
  gap: 18px;
  padding: 0 18px;
  border-top: 1px solid var(--ui-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.012), transparent),
    rgba(15, 26, 22, 0.98);
}

.timeline-intro {
  display: flex;
  flex: 0 0 72px;
  flex-direction: column;
  gap: 4px;
  padding-right: 14px;
  border-right: 1px solid var(--ui-border);
}

.timeline-intro span {
  color: var(--ui-muted-2);
  font-size: 8px;
  letter-spacing: 1.3px;
}

.timeline-intro strong {
  color: var(--ui-text-soft);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1.5px;
}

.timeline-track {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.timeline-line {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: 17px;
  left: 17px;
  height: 1px;
  background: var(--ui-border);
  transform: translateY(-50%);
}

.timeline-line > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  transition: width 380ms ease;
}

.timeline-step {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex: 1;
  gap: 8px;
  min-width: 0;
  height: 48px;
  padding: 0 6px;
  color: var(--ui-muted);
  border-radius: 3px;
  background: transparent;
  text-align: left;
  transition: color 180ms ease;
}

.timeline-step:hover {
  color: var(--ui-text-soft);
}

.timeline-dot {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  place-items: center;
  color: var(--ui-muted-2);
  border: 1px solid var(--ui-border-strong);
  border-radius: 50%;
  background: #111d19;
  font-family: var(--font-mono);
  font-size: 8px;
  transition:
    color 200ms ease,
    border-color 200ms ease,
    background 200ms ease,
    box-shadow 200ms ease;
}

.timeline-date {
  color: var(--ui-muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.timeline-label {
  overflow: hidden;
  color: inherit;
  font-size: 10px;
  letter-spacing: 0.4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-step.is-active {
  color: var(--ui-text);
}

.timeline-step.is-active .timeline-dot {
  color: #fff1d8;
  border-color: var(--red-bright);
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(174, 61, 46, 0.11);
}

.timeline-step.is-active .timeline-date {
  color: var(--gold);
}

.timeline-step.is-past .timeline-dot {
  color: var(--gold-soft);
  border-color: rgba(198, 162, 101, 0.45);
}

/* ---------- Briefing panel ---------- */

.briefing-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background:
    radial-gradient(circle at 100% 0, rgba(92, 117, 88, 0.14), transparent 35%),
    var(--ui-panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}

.panel-head {
  flex: 0 0 54px;
  padding: 0 16px;
  border-bottom: 1px solid var(--ui-border);
  background: rgba(255, 255, 255, 0.012);
}

.panel-tabs {
  display: flex;
  height: 100%;
  gap: 20px;
}

.panel-tab {
  position: relative;
  height: 100%;
  padding: 0 1px;
  color: var(--ui-muted);
  background: transparent;
  font-size: 11px;
  letter-spacing: 0.6px;
  transition: color 180ms ease;
}

.panel-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  content: "";
  background: transparent;
  transition: background 180ms ease;
}

.panel-tab:hover {
  color: var(--ui-text-soft);
}

.panel-tab.is-active {
  color: var(--ui-text);
}

.panel-tab.is-active::after {
  background: var(--red-bright);
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(198, 162, 101, 0.22) transparent;
  scrollbar-width: thin;
}

.panel-body::-webkit-scrollbar {
  width: 6px;
}

.panel-body::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(198, 162, 101, 0.2);
}

.panel-view {
  display: none;
  padding: 24px 22px 30px;
  animation: contentIn 260ms ease both;
}

.panel-view.is-active {
  display: block;
}

.step-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.step-number {
  display: flex;
  align-items: baseline;
  min-width: 58px;
  flex-direction: column;
  color: var(--gold-soft);
  font-family: var(--font-mono);
  line-height: 1;
}

.step-number span {
  font-size: 35px;
  letter-spacing: -2px;
}

.step-number small {
  margin-top: 5px;
  color: var(--ui-muted-2);
  font-size: 8px;
  letter-spacing: 1px;
}

.step-heading-copy {
  min-width: 0;
}

.step-kicker,
.question-kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 1.3px;
}

.step-heading h2,
.question-heading h2 {
  margin: 0;
  color: var(--ui-text);
  font-family: var(--font-display);
  font-size: clamp(24px, 2vw, 29px);
  font-weight: 700;
  letter-spacing: 1.7px;
  line-height: 1.3;
}

.step-summary {
  margin: 18px 0 21px;
  color: var(--ui-text-soft);
  font-size: 13px;
  line-height: 1.85;
  text-align: justify;
}

.source-quote {
  position: relative;
  margin: 0 0 23px;
  padding: 16px 16px 14px 18px;
  overflow: hidden;
  border: 1px solid rgba(198, 162, 101, 0.13);
  border-left: 2px solid rgba(198, 162, 101, 0.6);
  background: rgba(255, 255, 255, 0.025);
}

.quote-mark {
  position: absolute;
  top: -10px;
  right: 9px;
  color: rgba(198, 162, 101, 0.1);
  font-family: Georgia, serif;
  font-size: 76px;
  line-height: 1;
}

.source-quote blockquote {
  position: relative;
  margin: 0;
  color: #d9d4c5;
  font-family: var(--font-map);
  font-size: 14.5px;
  line-height: 1.88;
}

.source-quote figcaption {
  position: relative;
  margin-top: 10px;
  color: var(--ui-muted-2);
  font-size: 9px;
  letter-spacing: 0.6px;
}

.content-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}

.content-label span {
  flex: 0 0 auto;
  color: var(--ui-muted);
  font-size: 9px;
  letter-spacing: 1.7px;
}

.content-label i {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--ui-border), transparent);
}

.point-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.point-list li {
  position: relative;
  padding-left: 15px;
  color: var(--ui-text-soft);
  font-size: 12px;
  line-height: 1.7;
}

.point-list li::before {
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 4px;
  height: 4px;
  content: "";
  border: 1px solid var(--gold);
  transform: rotate(45deg);
}

.point-list li b {
  color: var(--ui-text);
  font-weight: 600;
}

.teacher-prompt {
  position: relative;
  margin-top: 20px;
  padding: 13px 14px 13px 16px;
  border: 1px dashed rgba(198, 162, 101, 0.26);
  background: rgba(198, 162, 101, 0.045);
}

.prompt-label {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 1.6px;
}

.teacher-prompt p {
  margin: 0;
  color: #d8d1c1;
  font-family: var(--font-map);
  font-size: 14px;
  line-height: 1.7;
}

.map-cue {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  color: var(--ui-muted);
  border-top: 1px solid var(--ui-border);
}

.cue-icon {
  position: relative;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 1px;
  border: 1px solid rgba(207, 90, 69, 0.6);
  border-radius: 50%;
}

.cue-icon::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: var(--red-bright);
}

.cue-label {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 1.4px;
}

.map-cue p:last-child {
  margin: 0;
  color: var(--ui-muted);
  font-size: 11px;
  line-height: 1.7;
}

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 59px;
  padding: 0 16px;
  border-top: 1px solid var(--ui-border);
  background: rgba(0, 0, 0, 0.09);
}

.step-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 31px;
  padding: 0 10px;
  color: var(--ui-muted);
  border: 1px solid transparent;
  background: transparent;
  font-size: 10px;
  letter-spacing: 0.7px;
  transition: 160ms ease;
}

.step-btn:hover:not(:disabled) {
  color: var(--ui-text);
  border-color: var(--ui-border);
}

.step-btn:disabled {
  opacity: 0.32;
  cursor: default;
}

.step-btn--primary {
  color: #f7e8cc;
  border-color: rgba(198, 162, 101, 0.25);
  background: rgba(198, 162, 101, 0.09);
}

.step-btn--primary:hover:not(:disabled) {
  border-color: rgba(198, 162, 101, 0.42);
  background: rgba(198, 162, 101, 0.15);
}

.step-dots {
  display: flex;
  gap: 5px;
}

.step-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ui-border-strong);
  transition: background 180ms ease;
}

.step-dots i.is-active {
  background: var(--red-bright);
}

/* ---------- Question view ---------- */

.question-heading {
  padding-bottom: 18px;
}

.question-heading p {
  margin: 12px 0 0;
  color: var(--ui-muted);
  font-size: 11px;
  line-height: 1.75;
}

.exam-option {
  position: relative;
  margin: 4px 0 16px;
  padding: 14px 15px 14px 43px;
  color: var(--ui-text-soft);
  border: 1px solid var(--ui-border);
  background: rgba(255, 255, 255, 0.022);
  font-family: var(--font-map);
  font-size: 14px;
  line-height: 1.8;
}

.exam-option p {
  margin: 0;
}

.exam-option-letter {
  position: absolute;
  top: 13px;
  left: 14px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--red-bright);
  border: 1px solid rgba(207, 90, 69, 0.42);
  font-family: var(--font-mono);
  font-size: 10px;
}

.blank-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.blank-card {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  align-items: flex-start;
  padding: 11px 12px;
  color: var(--ui-text);
  border: 1px solid var(--ui-border);
  background:
    linear-gradient(150deg, rgba(198, 162, 101, 0.07), transparent 60%),
    rgba(255, 255, 255, 0.02);
  text-align: left;
  transition:
    border-color 180ms ease,
    background 180ms ease;
}

.blank-card:hover {
  border-color: rgba(198, 162, 101, 0.32);
  background:
    linear-gradient(150deg, rgba(198, 162, 101, 0.1), transparent 60%),
    rgba(255, 255, 255, 0.03);
}

.blank-card-letter {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 10px;
}

.blank-card-label {
  margin-top: 12px;
  color: var(--ui-muted);
  font-size: 9px;
  letter-spacing: 0.6px;
}

.blank-card-value {
  display: block;
  margin-top: 4px;
  color: var(--ui-text-soft);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.7px;
  line-height: 1.2;
}

.blank-card.is-revealed .blank-card-value {
  color: var(--gold-soft);
}

.blank-card-foot {
  margin-top: auto;
  padding-top: 8px;
  color: var(--ui-muted-2);
  font-size: 9px;
}

.reveal-main {
  width: 100%;
  height: 36px;
  margin: 10px 0 17px;
  color: #f4e5c9;
  border: 1px solid rgba(198, 162, 101, 0.25);
  background: rgba(198, 162, 101, 0.08);
  font-size: 10px;
  letter-spacing: 1px;
  transition: 180ms ease;
}

.reveal-main:hover {
  border-color: rgba(198, 162, 101, 0.4);
  background: rgba(198, 162, 101, 0.14);
}

.verdict {
  overflow: hidden;
  border: 1px solid rgba(207, 90, 69, 0.22);
  background: rgba(142, 51, 40, 0.08);
}

.verdict.is-locked,
.answer-key.is-locked,
.option-notes.is-locked {
  display: none;
}

.verdict-head {
  display: flex;
  gap: 11px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(207, 90, 69, 0.14);
}

.verdict-stamp {
  flex: 0 0 auto;
  height: 22px;
  padding: 2px 7px;
  color: #f4dfce;
  border: 1px solid rgba(207, 90, 69, 0.45);
  font-size: 9px;
  letter-spacing: 0.7px;
}

.verdict-head strong {
  display: block;
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 600;
}

.verdict-head p {
  margin: 5px 0 0;
  color: var(--ui-text-soft);
  font-size: 10.5px;
  line-height: 1.65;
}

.logic-chain {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px;
}

.logic-step {
  display: flex;
  gap: 9px;
}

.logic-step > span {
  flex: 0 0 auto;
  padding-top: 1px;
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 8px;
}

.logic-step p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.logic-step b {
  color: var(--ui-text-soft);
  font-weight: 600;
}

.answer-key {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(198, 162, 101, 0.2);
  background: rgba(198, 162, 101, 0.055);
}

.answer-key-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
}

.answer-mark {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  color: #f4e9d4;
  border: 1px solid rgba(198, 162, 101, 0.35);
  border-radius: 50%;
  background: rgba(198, 162, 101, 0.14);
  font-family: var(--font-mono);
  font-size: 14px;
}

.answer-key-top div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.answer-key-top span {
  color: var(--ui-muted);
  font-size: 9px;
  letter-spacing: 0.6px;
}

.answer-key-top strong {
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-size: 24px;
}

.answer-key > p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 10.5px;
  line-height: 1.75;
}

.option-notes {
  margin-top: 13px;
  border-top: 1px solid var(--ui-border);
  color: var(--ui-muted);
  font-size: 10.5px;
  line-height: 1.7;
}

.option-notes summary {
  padding: 13px 0 5px;
  color: var(--ui-text-soft);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.option-notes p {
  margin: 7px 0;
}

.option-notes b {
  color: var(--ui-text-soft);
  font-weight: 600;
}

.evidence-note {
  margin-top: 18px;
  padding: 12px 13px;
  border-left: 2px solid var(--gold);
  background: rgba(255, 255, 255, 0.018);
}

.evidence-note span {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 1.5px;
}

.evidence-note p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 10.5px;
  line-height: 1.7;
}

/* ---------- Sources view ---------- */

.source-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-list details {
  border: 1px solid var(--ui-border);
  background: rgba(255, 255, 255, 0.018);
}

.source-list summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 13px;
  color: var(--ui-text-soft);
  list-style: none;
  cursor: pointer;
  font-size: 11px;
}

.source-list summary::-webkit-details-marker {
  display: none;
}

.source-list summary::after {
  width: 5px;
  height: 5px;
  margin-left: auto;
  content: "";
  border-right: 1px solid var(--ui-muted);
  border-bottom: 1px solid var(--ui-muted);
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.source-list details[open] summary::after {
  transform: rotate(225deg);
}

.source-list summary span {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  color: var(--gold-soft);
  border: 1px solid rgba(198, 162, 101, 0.3);
  font-family: var(--font-map);
  font-size: 11px;
}

.source-list details p {
  margin: 0;
  padding: 0 14px 14px 42px;
  color: var(--ui-muted);
  font-family: var(--font-map);
  font-size: 13.5px;
  line-height: 1.85;
}

.source-summary {
  margin-top: 16px;
  padding: 13px 14px;
  border-left: 2px solid var(--red-bright);
  background: rgba(174, 61, 46, 0.055);
}

.source-summary span {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 1.5px;
}

.source-summary p {
  margin: 0;
  color: var(--ui-text-soft);
  font-family: var(--font-map);
  font-size: 14px;
  line-height: 1.75;
}

.source-disclaimer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--ui-border);
}

.source-disclaimer p {
  margin: 0;
  color: var(--ui-muted-2);
  font-size: 9.5px;
  line-height: 1.75;
}

.source-disclaimer b {
  color: var(--ui-muted);
  font-weight: 500;
}

/* ---------- Layers popover ---------- */

.layer-popover {
  position: fixed;
  z-index: 80;
  width: 252px;
  padding: 14px 14px 12px;
  color: var(--ui-text);
  border: 1px solid rgba(223, 196, 145, 0.22);
  background: rgba(15, 27, 23, 0.97);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
  animation: popoverIn 160ms ease both;
}

.layer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--ui-border);
}

.layer-head strong {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 1.2px;
}

.layer-head button {
  width: 22px;
  height: 22px;
  color: var(--ui-muted);
  border-radius: 50%;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 15px;
}

.layer-head button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.layer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 35px;
  color: var(--ui-muted);
  font-size: 10.5px;
  cursor: pointer;
}

.layer-row > span {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
}

.layer-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch {
  position: relative;
  width: 29px;
  height: 16px;
  flex: 0 0 29px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  transition: 180ms ease;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 50%;
  background: var(--ui-muted-2);
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.layer-row input:checked + .switch {
  border-color: rgba(198, 162, 101, 0.34);
  background: rgba(198, 162, 101, 0.13);
}

.layer-row input:checked + .switch::after {
  background: var(--gold-soft);
  transform: translateX(13px);
}

.layer-tip {
  margin: 8px 0 0;
  padding-top: 9px;
  color: var(--ui-muted-2);
  border-top: 1px solid var(--ui-border);
  font-size: 9px;
  line-height: 1.6;
}

/* ---------- Modal / toast ---------- */

.modal-backdrop {
  position: fixed;
  z-index: 400;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(4, 9, 7, 0.72);
  backdrop-filter: blur(9px);
}

.help-modal {
  position: relative;
  width: min(570px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 30px 32px 27px;
  border: 1px solid rgba(223, 196, 145, 0.22);
  background:
    radial-gradient(circle at 100% 0, rgba(198, 162, 101, 0.08), transparent 35%),
    #14211c;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.55);
  animation: modalIn 220ms ease both;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 27px;
  height: 27px;
  color: var(--ui-muted);
  border-radius: 50%;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 18px;
}

.modal-close:hover {
  color: var(--ui-text);
  background: rgba(255, 255, 255, 0.06);
}

.eyebrow {
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1.8px;
}

.help-modal h2 {
  margin: 9px 0 10px;
  font-family: var(--font-display);
  font-size: 29px;
  letter-spacing: 2px;
}

.help-lead {
  margin: 0 0 21px;
  color: var(--ui-muted);
  font-size: 11px;
  line-height: 1.8;
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px 21px;
}

.help-key {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 7px;
  color: var(--gold-soft);
  border: 1px solid rgba(198, 162, 101, 0.23);
  font-family: var(--font-mono);
  font-size: 9px;
}

.help-grid p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 10px;
  line-height: 1.7;
}

.help-tip {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 2px solid var(--red-bright);
  background: rgba(174, 61, 46, 0.055);
}

.help-tip span {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 8px;
  letter-spacing: 1.3px;
}

.help-tip p {
  margin: 0;
  color: var(--ui-text-soft);
  font-family: var(--font-map);
  font-size: 13px;
  line-height: 1.7;
}

.help-confirm {
  margin-top: 22px;
  height: 36px;
}

.toast {
  position: fixed;
  z-index: 300;
  top: 152px;
  left: 50%;
  padding: 9px 14px;
  color: var(--ui-text);
  border: 1px solid rgba(223, 196, 145, 0.25);
  background: rgba(15, 27, 23, 0.96);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
  font-size: 10px;
  letter-spacing: 0.5px;
  transform: translateX(-50%);
  animation: toastIn 180ms ease both;
}

/* ---------- Presentation mode ---------- */

.is-presenting .topbar {
  display: none;
}

.is-presenting .workspace {
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
}

.is-presenting .briefing-panel {
  display: none;
}

.is-presenting .map-shell {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.is-presenting .map-toolbar {
  flex-basis: 46px;
}

.is-presenting .timeline {
  flex-basis: 68px;
}

.is-presenting .timeline-intro {
  display: none;
}

.is-presenting .projection-caption {
  display: flex;
}

.is-presenting .map-stage[data-stage="5"] .projection-caption {
  display: none;
}

.is-presenting .quiz-strip {
  bottom: 14px;
}

.is-presenting .dossier {
  top: 66px;
}

/* ---------- Animations ---------- */

@keyframes livePulse {
  0% {
    opacity: 0.8;
    transform: scale(0.7);
  }
  75%,
  100% {
    opacity: 0;
    transform: scale(1.55);
  }
}

@keyframes dashMarch {
  to {
    stroke-dashoffset: -180;
  }
}

@keyframes targetPulse {
  0%,
  100% {
    opacity: 0.85;
    transform: scale(0.9);
  }
  55% {
    opacity: 0.2;
    transform: scale(1.35);
  }
}

@keyframes contentIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dossierIn {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes stripIn {
  from {
    opacity: 0;
    transform: translate(50%, 7px);
  }
  to {
    opacity: 1;
    transform: translate(50%, 0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes popoverIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, -5px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
  .workspace {
    padding: 12px;
  }

  .toolbar-legend {
    gap: 10px;
  }

  .command-meta {
    display: none;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .timeline {
    gap: 9px;
    padding: 0 12px;
  }

  .timeline-intro {
    display: none;
  }

  .timeline-date {
    display: none;
  }

  .timeline-step {
    gap: 6px;
  }

  .panel-view {
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (max-width: 1020px) {
  .app {
    height: 100dvh;
    min-height: 0;
  }

  .topbar {
    flex-basis: 66px;
    padding: 0 16px;
  }

  .brand h1 {
    font-size: 21px;
    letter-spacing: 2px;
  }

  .brand-overline {
    font-size: 7px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
    padding: 10px;
  }

  .map-shell {
    height: 100%;
    min-height: 0;
  }

  .map-stage {
    min-height: 0;
  }

  .toolbar-legend {
    display: none;
  }

  .timeline-label {
    font-size: 9px;
  }
}

@media (max-width: 760px) {
  .app {
    height: 100dvh;
    min-height: 0;
  }

  .topbar {
    flex-basis: auto;
    min-height: 62px;
    padding: 9px 12px;
  }

  .brand {
    gap: 9px;
  }

  .brand-seal {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 20px;
  }

  .brand h1 {
    gap: 6px;
    font-size: 18px;
    letter-spacing: 1px;
  }

  .brand h1 span {
    font-size: 8px;
    letter-spacing: 1px;
  }

  .brand-overline {
    display: none;
  }

  .ghost-btn {
    display: inline-flex;
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 0;
  }

  .ghost-btn::before {
    content: "?";
    font-family: var(--font-mono);
    font-size: 12px;
  }

  .solid-btn {
    height: 30px;
    padding: 0 10px;
    font-size: 10px;
  }

  .solid-btn kbd {
    display: none;
  }

  .workspace {
    grid-template-rows: minmax(0, 1fr);
    padding: 7px;
  }

  .map-shell {
    height: 100%;
    min-height: 0;
  }

  .map-toolbar {
    flex-basis: 44px;
    gap: 8px;
    padding: 0 7px 0 11px;
  }

  .toolbar-code {
    display: none;
  }

  .toolbar-title {
    font-size: 10px;
  }

  .tool-btn {
    height: 30px;
    padding: 0 7px;
  }

  .tool-btn--icon {
    width: 30px;
  }

  .zoom-value {
    min-width: 28px;
  }

  .map-stage {
    min-height: 0;
  }

  .map-zoom-badge {
    display: none;
  }

  .mobile-map-hint {
    position: absolute;
    z-index: 10;
    bottom: 8px;
    left: 10px;
    display: block;
    padding: 5px 8px;
    color: rgba(239, 230, 212, 0.7);
    border: 1px solid rgba(223, 196, 145, 0.16);
    background: rgba(14, 25, 21, 0.82);
    font-size: 8px;
    letter-spacing: 0.4px;
    pointer-events: none;
    backdrop-filter: blur(6px);
  }

  .timeline {
    flex-basis: 67px;
    gap: 2px;
    padding: 0 7px;
  }

  .timeline-step {
    flex-direction: column;
    gap: 3px;
    height: 58px;
    justify-content: center;
    padding: 0 2px;
    text-align: center;
  }

  .timeline-dot {
    width: 23px;
    height: 23px;
    flex-basis: 23px;
    font-size: 7px;
  }

  .timeline-label {
    width: 100%;
    font-size: 8px;
    letter-spacing: 0;
    text-align: center;
  }

  .timeline-line {
    top: 24px;
  }

  .quiz-strip {
    display: none;
  }

  .projection-caption {
    display: none !important;
  }

  .help-modal {
    padding: 26px 20px 22px;
  }

  .help-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .layer-popover {
    width: min(252px, calc(100vw - 20px));
  }
}

@media (max-height: 720px) and (min-width: 1021px) {
  .topbar {
    flex-basis: 62px;
  }

  .workspace {
    padding-top: 9px;
    padding-bottom: 10px;
  }

  .timeline {
    flex-basis: 65px;
  }

  .panel-view {
    padding-top: 18px;
    padding-bottom: 22px;
  }

  .step-summary {
    margin-top: 12px;
    margin-bottom: 15px;
  }

  .source-quote {
    margin-bottom: 17px;
    padding-top: 12px;
    padding-bottom: 11px;
  }

  .teacher-prompt {
    margin-top: 14px;
  }

  .map-cue {
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Units injected dynamically keep map stacking in SVG order. */

.source-disclaimer a {
  color: var(--gold-soft);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Classroom projection redesign ---------- */
:root {
  --ui-bg: #0d1512;
  --ui-panel: #14201b;
  --ui-panel-2: #1a2922;
  --ui-border: rgba(238, 230, 210, 0.18);
  --ui-border-strong: rgba(238, 230, 210, 0.32);
  --ui-text: #fffaf0;
  --ui-text-soft: #e2e5dc;
  --ui-muted: #b7c0b7;
  --ui-muted-2: #96a399;
  --red-bright: #e16a54;
  --gold: #d6b577;
  --gold-soft: #f0d39c;
}

body {
  background: var(--ui-bg);
}

.topbar {
  flex-basis: 80px;
  padding: 0 24px;
  background: #0d1512;
}

.topbar::after,
.brand-seal::before,
.brand-seal::after {
  display: none;
}

.brand-seal {
  border: 0;
  background: #a2372b;
  box-shadow: none;
  font-family: var(--font-ui);
  font-weight: 700;
  transform: none;
}

.brand-overline {
  display: none;
}

.brand h1 {
  font-family: var(--font-ui);
  font-size: 29px;
  letter-spacing: 1.5px;
}

.brand h1 span {
  color: var(--ui-text-soft);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.command-meta {
  color: var(--ui-text-soft);
  font-size: 15px;
  letter-spacing: 0;
}

.meta-date {
  color: var(--gold-soft);
  border-color: rgba(240, 211, 156, 0.42);
  font-size: 13px;
}

.meta-rule {
  display: none;
}

.ghost-btn,
.solid-btn {
  height: 44px;
  padding: 0 19px;
  border-radius: 5px;
  font-size: 16px;
  letter-spacing: 0;
}

.ghost-btn {
  color: var(--ui-text-soft);
  border-color: var(--ui-border-strong);
  background: transparent;
}

.solid-btn {
  color: #fff;
  border-color: #bc4c3b;
  background: #a93d2f;
  box-shadow: none;
  font-weight: 700;
}

.solid-btn:hover {
  background: #bd4939;
}

.solid-btn kbd {
  padding: 2px 6px;
  color: #fff;
  font-size: 11px;
}

.workspace {
  padding: 12px 14px 14px;
}

.map-shell {
  border-color: var(--ui-border);
  border-radius: 7px;
  box-shadow: none;
}

.map-toolbar {
  flex-basis: 58px;
  gap: 16px;
  padding: 0 16px 0 20px;
  background: #14201b;
}

.toolbar-title {
  gap: 10px;
  color: var(--ui-text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.live-dot {
  width: 8px;
  height: 8px;
  box-shadow: none;
}

.live-dot::after {
  display: none;
}

.toolbar-code {
  color: var(--ui-muted);
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0;
}

.toolbar-legend {
  gap: 22px;
  color: var(--ui-text-soft);
  font-size: 16px;
  letter-spacing: 0;
}

.legend-dot {
  width: 10px;
  height: 10px;
  flex-basis: 10px;
  box-shadow: none;
}

.legend-stroke {
  height: 3px;
}

.toolbar-actions {
  gap: 6px;
}

.tool-btn {
  height: 40px;
  padding: 0 13px;
  color: var(--ui-text-soft);
  border-color: transparent;
  border-radius: 4px;
  font-size: 16px;
  letter-spacing: 0;
}

.tool-btn:hover,
.tool-btn[aria-expanded="true"] {
  color: #fff;
  border-color: var(--ui-border-strong);
  background: #24352d;
}

.tool-btn--icon {
  width: 38px;
  font-size: 22px;
}

.tool-btn--mode {
  color: var(--gold-soft);
  border-color: rgba(240, 211, 156, 0.38);
}

.zoom-value {
  min-width: 46px;
  color: var(--ui-text-soft);
  font-size: 13px;
}

.map-stage {
  background: #101a17;
}

.stage-brief {
  position: absolute;
  z-index: 36;
  top: 20px;
  left: 20px;
  width: min(480px, calc(100% - 40px));
  padding: 18px 20px 17px;
  color: var(--ui-text);
  border-left: 5px solid var(--red-bright);
  background: rgba(13, 24, 19, 0.95);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.stage-brief-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 9px;
  font-size: 15px;
  line-height: 1.4;
}

.stage-brief-meta span:first-child {
  color: var(--gold-soft);
  font-weight: 700;
}

.stage-brief-meta span:last-child {
  color: var(--ui-text-soft);
}

.stage-brief h2 {
  margin: 0;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 31px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.35;
}

.stage-brief p {
  margin: 10px 0 0;
  color: #e1e5dd;
  font-size: 18px;
  line-height: 1.65;
}

.map-zoom-badge {
  bottom: 16px;
  left: 16px;
  padding: 9px 12px;
  color: #f1f2eb;
  border-color: var(--ui-border);
  border-radius: 4px;
  background: rgba(13, 24, 19, 0.92);
  box-shadow: none;
  backdrop-filter: none;
  font-size: 13px;
  letter-spacing: 0;
}

.zoom-crosshair {
  display: none;
}

/* Remove decorative detail that competes with teaching content. */
.cartouche,
.contours,
.ridges,
.terrain-label--faint,
.sea-waves,
.corner-marks {
  display: none;
}

.terrain-hill {
  opacity: 0.36;
}

.terrain-label {
  font-family: var(--font-ui);
  font-weight: 600;
  opacity: 0.5;
}

.place-name {
  fill: #172d24;
  font-family: var(--font-ui);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  stroke: #f1e7d2;
  stroke-width: 5px;
}

.place-name--xl {
  font-size: 42px;
}

.place-name--large {
  font-size: 30px;
}

.place-name--small {
  fill: #344a3f;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.3px;
  stroke-width: 4.5px;
}

.place-roman,
.edition-note {
  display: none;
}

.unit-name {
  font-family: var(--font-ui);
  font-size: 30px;
  letter-spacing: 0.5px;
}

.unit-sub {
  fill: #46564e;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

.unit--compact .unit-name {
  font-size: 24px;
  letter-spacing: 0;
}

.unit--compact .unit-sub {
  font-size: 13.5px;
}

.unit--kmt .unit-sub {
  fill: #435c61;
}

.unit--pla .unit-sub {
  fill: #714d43;
}

.unit.is-dim {
  opacity: 0.38;
}

.unit.is-focus .unit-plate {
  stroke-width: 3px;
}

.unit.is-focus .unit-symbol {
  filter: none;
}

.route {
  stroke-width: 5px;
}

.route-label text {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0;
}

.route-label--small text {
  font-size: 16px;
}

.route-label--label-only text {
  font-size: 18px;
}

.timeline {
  flex-basis: 104px;
  gap: 16px;
  padding: 0 16px;
  background: #111c17;
}

.timeline-intro {
  flex-basis: 118px;
  gap: 3px;
  padding-right: 16px;
}

.timeline-intro span {
  color: var(--gold-soft);
  font-size: 13px;
  letter-spacing: 0.5px;
}

.timeline-intro strong {
  color: var(--ui-text);
  font-family: var(--font-ui);
  font-size: 22px;
  letter-spacing: 0.5px;
}

.timeline-intro small {
  color: var(--ui-muted);
  font-size: 12px;
  white-space: nowrap;
}

.timeline-step {
  gap: 9px;
  height: 64px;
  padding: 0 9px;
  color: #c0c9c0;
  border-radius: 5px;
}

.timeline-step:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.timeline-dot {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  color: var(--ui-text-soft);
  border-color: var(--ui-border-strong);
  background: #18251f;
  font-size: 12px;
  font-weight: 700;
}

.timeline-date {
  color: var(--ui-muted);
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0;
}

.timeline-label {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
}

.timeline-step.is-active {
  color: #fff;
  background: rgba(190, 70, 52, 0.18);
  box-shadow: inset 0 0 0 1px rgba(225, 106, 84, 0.5);
}

.timeline-step.is-active .timeline-dot {
  color: #fff;
  border-color: #e16a54;
  background: #ae4032;
  box-shadow: none;
}

.timeline-step.is-active .timeline-date {
  color: var(--gold-soft);
}

.timeline-step.is-past .timeline-dot {
  color: #e3d5b7;
  border-color: rgba(227, 213, 183, 0.45);
}

.stage-nav-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  margin-left: 12px;
}

.stage-nav-btn {
  min-width: 104px;
  height: 46px;
  padding: 0 15px;
  color: var(--ui-text-soft);
  border: 1px solid var(--ui-border-strong);
  border-radius: 5px;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.stage-nav-btn:hover:not(:disabled) {
  color: #fff;
  background: #24352d;
}

.stage-nav-btn--primary {
  color: #fff;
  border-color: #b34a3a;
  background: #a93d2f;
}

.stage-nav-btn--primary:hover:not(:disabled) {
  background: #bd4939;
}

.stage-nav-btn:disabled {
  opacity: 0.42;
  cursor: default;
}

.tooltip {
  max-width: 340px;
  padding: 13px 15px;
  background: #102019;
  backdrop-filter: none;
}

.tooltip strong {
  font-family: var(--font-ui);
  font-size: 18px;
}

.tooltip span {
  color: var(--ui-text-soft);
  font-size: 14px;
}

.dossier {
  top: 20px;
  right: 20px;
  width: min(410px, calc(100% - 40px));
  padding: 26px 24px 23px 28px;
  background: #14251e;
  backdrop-filter: none;
}

.dossier-close {
  width: 38px;
  height: 38px;
  font-size: 24px;
}

.dossier-eyebrow {
  color: var(--gold-soft);
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0;
}

.dossier h3 {
  font-family: var(--font-ui);
  font-size: 30px;
}

.dossier-location,
.dossier-note {
  color: var(--ui-text-soft);
  font-size: 15px;
}

.dossier blockquote {
  color: #f2eadb;
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.8;
}

.layer-popover {
  width: 300px;
  padding: 16px;
  background: #14251e;
  backdrop-filter: none;
}

.layer-head strong {
  font-family: var(--font-ui);
  font-size: 19px;
}

.layer-head button {
  width: 34px;
  height: 34px;
  font-size: 22px;
}

.layer-row {
  min-height: 46px;
  color: var(--ui-text-soft);
  font-size: 15px;
}

.layer-tip {
  color: var(--ui-muted);
  font-size: 13px;
}

.help-modal {
  width: min(780px, 100%);
  padding: 32px 34px 30px;
  background: #14211c;
}

.eyebrow {
  color: var(--gold-soft);
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.5px;
}

.help-modal h2 {
  font-family: var(--font-ui);
  font-size: 32px;
  letter-spacing: 0.5px;
}

.help-lead {
  color: var(--ui-text-soft);
  font-size: 16px;
  line-height: 1.75;
}

.help-grid--steps {
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.help-grid--steps > div {
  padding: 16px;
  border: 1px solid var(--ui-border);
  background: #1a2922;
}

.help-key {
  margin-bottom: 10px;
  padding: 0;
  color: var(--gold-soft);
  border: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
}

.help-grid p {
  color: var(--ui-text-soft);
  font-size: 14px;
  line-height: 1.75;
}

.advanced-controls {
  margin-top: 18px;
  border-top: 1px solid var(--ui-border);
  border-bottom: 1px solid var(--ui-border);
}

.advanced-controls summary {
  padding: 15px 0;
  color: var(--ui-text);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}

.advanced-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  padding: 0 0 16px;
}

.advanced-grid p {
  margin: 0;
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.7;
}

.advanced-grid b {
  display: block;
  color: var(--ui-text-soft);
}

.help-tip {
  padding: 14px 16px;
}

.help-tip span {
  color: var(--gold-soft);
  font-size: 13px;
}

.help-tip p {
  font-family: var(--font-ui);
  font-size: 14px;
}

.help-confirm {
  height: 44px;
}

.toast {
  padding: 12px 18px;
  font-size: 15px;
}

.is-presenting .place-name--small,
.is-presenting .map-zoom-badge {
  display: none;
}

.is-presenting .stage-brief {
  top: 18px;
  left: 18px;
  width: min(480px, calc(100% - 36px));
  padding: 14px 18px;
}

.is-presenting .stage-brief h2 {
  font-size: 25px;
}

.is-presenting .stage-brief p {
  display: none;
}

.is-presenting .map-toolbar {
  flex-basis: 56px;
}

@media (max-width: 1280px) {
  .stage-brief {
    width: min(420px, calc(100% - 40px));
  }

  .stage-brief h2 {
    font-size: 26px;
  }

  .timeline {
    gap: 8px;
  }

  .timeline-step {
    gap: 6px;
    padding: 0 6px;
  }

  .timeline-label {
    font-size: 14px;
  }

  .stage-nav-actions {
    gap: 6px;
    margin-left: 6px;
  }

  .stage-nav-btn {
    min-width: 82px;
    padding: 0 10px;
    font-size: 13px;
  }
}

@media (max-width: 1020px) {
  .topbar {
    flex-basis: 70px;
  }

  .brand h1 {
    font-size: 25px;
  }

  .brand h1 span {
    font-size: 12px;
  }

  .map-toolbar {
    flex-basis: 54px;
  }

  .toolbar-title {
    font-size: 15px;
  }

  .stage-brief {
    top: 14px;
    left: 14px;
    padding: 14px 16px;
  }

  .stage-brief h2 {
    font-size: 24px;
  }

  .stage-brief p {
    font-size: 14px;
  }

  .timeline {
    flex-basis: 92px;
  }

  .timeline-step {
    height: 58px;
  }

  .timeline-dot {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .timeline-label {
    font-size: 13px;
  }

  .stage-nav-actions {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 64px;
  }

  .brand h1 {
    font-size: 21px;
  }

  .brand h1 span {
    font-size: 11px;
  }

  .ghost-btn {
    width: 36px;
    height: 36px;
  }

  .solid-btn {
    height: 38px;
    font-size: 13px;
  }

  .map-toolbar {
    flex-basis: 50px;
  }

  .toolbar-title {
    font-size: 14px;
  }

  .tool-btn {
    height: 34px;
    font-size: 12px;
  }

  .tool-btn--icon {
    width: 34px;
  }

  .stage-brief,
  .is-presenting .stage-brief {
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
    padding: 12px 14px;
  }

  .stage-brief-meta {
    margin-bottom: 5px;
    font-size: 11px;
  }

  .stage-brief h2,
  .is-presenting .stage-brief h2 {
    font-size: 21px;
  }

  .stage-brief p {
    display: none;
  }

  .timeline {
    flex-basis: 84px;
    padding: 0 7px;
  }

  .timeline-track {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .timeline-track::-webkit-scrollbar {
    display: none;
  }

  .timeline-step {
    min-width: 90px;
    height: 68px;
  }

  .timeline-label {
    font-size: 13px;
  }

  .timeline-dot {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 10px;
  }

  .help-grid--steps,
  .advanced-grid {
    grid-template-columns: 1fr;
  }

  .help-modal h2 {
    font-size: 27px;
  }

  .help-lead {
    font-size: 14px;
  }
}

@media (max-height: 760px) and (min-width: 1021px) {
  .topbar {
    flex-basis: 68px;
  }

  .timeline {
    flex-basis: 88px;
  }

  .timeline-step {
    height: 56px;
  }

  .stage-brief {
    padding: 14px 17px;
  }

  .stage-brief h2 {
    font-size: 25px;
  }

  .stage-brief p {
    margin-top: 7px;
    font-size: 14px;
  }
}

@media (max-width: 1500px) and (min-width: 761px) {
  .timeline-date {
    display: none;
  }

  .stage-brief {
    width: min(390px, calc(100% - 40px));
    padding: 15px 18px;
  }

  .stage-brief h2 {
    font-size: 27px;
  }

  .stage-brief p {
    display: none;
  }

  .city3d--minor,
  .city3d--medium,
  .city3d--water,
  .city3d--rail {
    display: none;
  }
}
