:root {
  --ink: #21333c;
  --muted: #4d5b5e;
  --paper: #f7f0df;
  --panel: #fffaf0;
  --panel-strong: #efe3c8;
  --glass: #cfe7e8;
  --glass-deep: #8bbbc1;
  --rail: #6f5a45;
  --steel: #254a5c;
  --steel-2: #356b77;
  --civic: #557b5f;
  --growth: #9ac7aa;
  --moss: #6d8d68;
  --sun: #f4c76f;
  --brass: #c99145;
  --rust: #d89051;
  --ceramic: #e7d8b7;
  --danger: #a8463f;
  --storm: #596c9d;
  --cloud: #eef7f4;
  --line: rgba(33, 51, 60, 0.16);
  --shadow: 0 18px 42px rgba(33, 51, 60, 0.16);
  --brass-dark: #8d642f;
  --brass-light: #f0cf87;
  --glass-light: #edf9f5;
  --steel-dark: #173844;
  --ledger: #fff6df;
  --signal-glow: 0 0 16px rgba(244, 199, 111, 0.68);
  /* Claude Design reconciliation — Inter retained; new accent/status/scale tokens only.
     --muted is intentionally NOT touched; the design system's warm caption color is --caption. */
  --teal: #2a7d8c;
  --status-healthy: #2f9e8f;
  --status-damaged: #c0613a;
  --status-repairing: #e0a23f;
  --caption: #8a8276;
  --body-warm: #5a5145;
  --radius: 11px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --elev-flat: 0 1px 4px rgba(33, 51, 60, 0.1);
  --elev-raised: 0 14px 30px -14px rgba(33, 51, 60, 0.18);
  --elev-float: 0 24px 60px -28px rgba(33, 51, 60, 0.22);
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 82% 4%, rgba(244, 199, 111, 0.28), transparent 16rem),
    linear-gradient(180deg, #cfe3e6 0, #eef7f4 18rem, #f7f0df 42rem),
    var(--paper);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 44px;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 82px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: max(14px, env(safe-area-inset-top)) 14px 12px;
  border-bottom: 1px solid rgba(37, 74, 92, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(247, 240, 223, 0.9)),
    var(--panel);
  backdrop-filter: blur(16px);
}

.brand-row,
.section-heading,
.card-topline,
.progress-row,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-row h1,
.section-heading h2,
.building-card h3,
.route-card h3,
.contract-card h3,
.hero-card h3,
.crew-card h3,
.dispatch-card h3,
.league-hero h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand-row h1 {
  color: var(--steel);
  font-size: 1.18rem;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--steel-2);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.save-chip,
.district,
.zone-chip,
.status-badge,
.mission-badge,
.resource-token {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(37, 74, 92, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.82);
  color: var(--steel);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.art-icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.nav-svg {
  width: 25px;
  height: 25px;
}

.resource-icon {
  width: 20px;
  height: 20px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.resource-pill {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0 8px;
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid rgba(37, 74, 92, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 248, 233, 0.88)),
    var(--panel);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.46);
}

.resource-mark {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(37, 74, 92, 0.08);
  color: var(--steel);
}

.resource-pill strong {
  color: var(--steel);
  font-size: 1rem;
}

.resource-pill span {
  color: var(--muted);
  font-size: 0.72rem;
}

.resource-name {
  color: var(--ink) !important;
  font-weight: 900;
}

.resource-rate {
  grid-column: 2 / span 2;
}

.main-surface {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 14px;
}

.view-stack {
  display: grid;
  gap: 14px;
}

.notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(168, 70, 63, 0.22);
  border-left: 5px solid var(--rust);
  border-radius: 8px;
  background: #fff8e9;
  color: var(--ink);
  font-weight: 800;
}

.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(37, 74, 92, 0.16);
  background: rgba(255, 250, 240, 0.96);
  backdrop-filter: blur(16px);
}

.tab-button {
  position: relative;
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  padding: 6px 2px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
}

.tab-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 28px;
  border-radius: 8px;
  background: rgba(37, 74, 92, 0.08);
  color: var(--steel);
}

.tab-button.active {
  border-color: rgba(37, 74, 92, 0.18);
  background: #eef5ef;
  color: var(--ink);
}

.tab-button.active .tab-icon {
  background: var(--steel);
  color: white;
}

.section-band,
.dispatch-form,
.league-form,
.league-hero {
  padding: 14px;
  border: 1px solid rgba(37, 74, 92, 0.15);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.92), rgba(239, 227, 200, 0.58)),
    var(--panel);
}

.section-heading h2,
.league-hero h2 {
  font-size: 1.05rem;
}

.section-heading > span {
  color: var(--steel);
  font-weight: 950;
}

.quiet-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.42;
}

.station-diorama {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  border: 1px solid rgba(37, 74, 92, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(circle at 82% 12%, rgba(244, 199, 111, 0.42), transparent 7rem),
    linear-gradient(180deg, #9fcbd1 0%, #d8ede8 58%, #f3dfb4 100%);
  box-shadow: var(--shadow);
}

.diorama-sky,
.diorama-bridges,
.slot-layer,
.floating-island,
.skyrail-train--scene,
.signal-lamp {
  position: absolute;
}

.diorama-sky {
  inset: 0;
}

.diorama-sun {
  position: absolute;
  top: 28px;
  right: 32px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 11px rgba(244, 199, 111, 0.18);
}

.diorama-bridges {
  inset: 0;
  width: 100%;
  height: 100%;
}

.bridge {
  fill: none;
  stroke: var(--rail);
  stroke-width: 10;
  stroke-linecap: round;
}

.bridge-back {
  opacity: 0.28;
}

.bridge-front {
  stroke-width: 12;
}

.bridge-ties {
  fill: none;
  stroke: rgba(90, 63, 49, 0.58);
  stroke-width: 6;
  stroke-linecap: round;
}

.floating-island {
  border-radius: 52% 48% 40% 42%;
  background:
    linear-gradient(180deg, var(--growth) 0 38%, var(--moss) 39% 60%, #5a3f31 61% 64%, #7f5c40 65%),
    var(--moss);
}

.island-back {
  right: 0;
  bottom: 102px;
  width: 178px;
  height: 76px;
  opacity: 0.72;
}

.island-front {
  right: 5%;
  bottom: 24px;
  left: 6%;
  height: 132px;
  box-shadow: 0 24px 46px rgba(90, 63, 49, 0.18);
}

.slot-layer {
  inset: 0;
}

.diorama-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 94px;
  z-index: 4;
}

.slot-large {
  width: 126px;
  z-index: 7;
}

.slot-medium {
  width: 104px;
  z-index: 6;
}

.slot-small {
  width: 78px;
}

.slot-tall {
  width: 82px;
  z-index: 8;
}

.signal-lamp {
  width: 10px;
  height: 26px;
  border-radius: 5px;
  background: var(--steel);
  z-index: 10;
}

.signal-lamp::before {
  position: absolute;
  top: -7px;
  left: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 16px rgba(244, 199, 111, 0.75);
  content: "";
}

.lamp-a {
  left: 22%;
  bottom: 92px;
}

.lamp-b {
  right: 23%;
  bottom: 100px;
}

.skyrail-train--scene {
  bottom: 88px;
  left: 5%;
  width: 188px;
  z-index: 11;
}

.skyrail-train--strip {
  width: 178px;
  max-width: 100%;
}

.train-shadow {
  stroke: rgba(33, 51, 60, 0.24);
  stroke-width: 7;
  stroke-linecap: round;
}

.train-engine {
  fill: var(--steel);
}

.train-cabin,
.train-car {
  fill: var(--rust);
}

.train-car-b {
  fill: var(--ceramic);
}

.train-window {
  fill: var(--glass);
}

.train-brass {
  fill: none;
  stroke: var(--brass);
  stroke-width: 4;
  stroke-linecap: round;
}

.train-wheel {
  fill: var(--ink);
}

.train-sun {
  fill: var(--sun);
}

.building-sprite {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.building-badge {
  display: grid;
  place-items: center;
  width: 76px;
  height: 62px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(207, 231, 232, 0.28), rgba(201, 145, 69, 0.16)),
    rgba(255, 250, 240, 0.72);
  border: 1px solid rgba(37, 74, 92, 0.12);
}

.building-badge .building-sprite {
  width: 92px;
}

.sprite-shadow {
  fill: rgba(33, 51, 60, 0.2);
}

.sprite-pad {
  fill: #8faf82;
}

.ghost-pad {
  fill: rgba(85, 123, 95, 0.3);
}

.sprite-rail,
.sprite-railmark,
.sprite-frame,
.sprite-smoke,
.sprite-construction,
.sprite-activity {
  fill: none;
  stroke: var(--steel);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sprite-rail {
  stroke: var(--rail);
}

.sprite-stone {
  fill: url("#stone-central-station");
  fill: var(--ceramic);
}

.sprite-roof,
.sprite-steel {
  fill: var(--steel);
}

.sprite-glass {
  fill: var(--glass);
}

.sprite-brass,
.sprite-sun,
.sprite-lamp,
.sprite-crown {
  fill: var(--sun);
}

.sprite-rust,
.sprite-awning,
.sprite-banner {
  fill: var(--rust);
}

.sprite-crate {
  fill: #b78a52;
}

.sprite-leaf {
  fill: var(--growth);
}

.sprite-water,
.sprite-stripe {
  fill: none;
  stroke: var(--glass-deep);
  stroke-width: 5;
  stroke-linecap: round;
}

.signal-dot,
.sprite-lamp {
  opacity: 0.9;
}

.building-card-visual {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.checklist {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.check-item.done {
  color: var(--civic);
}

.building-grid,
.route-list,
.contract-grid,
.hero-grid,
.crew-grid,
.project-grid {
  display: grid;
  gap: 12px;
}

.building-card,
.route-card,
.contract-card,
.hero-card,
.crew-card,
.dispatch-card,
.project-meter {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(37, 74, 92, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(239, 227, 200, 0.68)),
    var(--panel);
  box-shadow: 0 10px 24px rgba(33, 51, 60, 0.08);
}

.building-card p,
.route-card p,
.contract-card p,
.hero-card p,
.crew-card p,
.dispatch-card p,
.league-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.42;
}

.card-topline {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-list {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.visual-line,
.input-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.resource-token.compact {
  min-height: 24px;
  padding: 0 7px;
  font-size: 0.72rem;
}

.cost-line,
.reward-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 8px;
  color: var(--steel);
  font-size: 0.83rem;
  font-weight: 900;
}

.fee-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 12px 0;
  padding: 9px 10px;
  border: 1px solid rgba(37, 74, 92, 0.12);
  border-radius: 8px;
  background: rgba(207, 231, 232, 0.2);
  color: var(--steel);
  font-size: 0.8rem;
  font-weight: 900;
}

.primary-action,
.secondary-action,
.danger-action {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 950;
}

.primary-action {
  background:
    linear-gradient(180deg, #356b77, #254a5c),
    var(--steel);
  color: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.secondary-action {
  border-color: rgba(37, 74, 92, 0.18);
  background: #eaf2ed;
  color: var(--steel);
}

.danger-action {
  border-color: rgba(168, 70, 63, 0.24);
  background: #fff1ed;
  color: var(--danger);
}

.progress {
  overflow: hidden;
  width: 100%;
  height: 11px;
  border-radius: 8px;
  background: rgba(37, 74, 92, 0.12);
  box-shadow: inset 0 1px 2px rgba(33, 51, 60, 0.12);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--civic), var(--sun));
}

.progress-row {
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.skyrail-map {
  position: relative;
  overflow: hidden;
  min-height: 390px;
  border: 1px solid rgba(37, 74, 92, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(circle at 86% 18%, rgba(244, 199, 111, 0.34), transparent 8rem),
    linear-gradient(180deg, #b7d7dc, #edf4ec 60%, #f1dfbb);
  box-shadow: var(--shadow);
}

.map-bridges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.zone-wash {
  opacity: 0.16;
}

.zone-wash.zone-core {
  fill: var(--growth);
}

.zone-wash.zone-chartered {
  fill: var(--brass);
}

.zone-wash.zone-frontier {
  fill: var(--rust);
}

.rail-line {
  fill: none;
  stroke: var(--rail);
  stroke-width: 10;
  stroke-linecap: round;
}

.rail-anchors {
  fill: none;
  stroke: rgba(90, 63, 49, 0.54);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-risk {
  stroke: var(--storm);
  stroke-dasharray: 18 13;
}

.rail-ties {
  fill: none;
  stroke: rgba(90, 63, 49, 0.46);
  stroke-width: 5;
  stroke-linecap: round;
}

.map-node {
  position: absolute;
  display: grid;
  place-items: center;
  width: 86px;
  min-height: 78px;
  margin: -38px 0 0 -43px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--steel);
}

.map-node svg {
  width: 72px;
  height: 60px;
  filter: drop-shadow(0 7px 10px rgba(33, 51, 60, 0.18));
}

.node-island {
  fill: var(--growth);
}

.node-rail {
  fill: none;
  stroke: var(--rail);
  stroke-width: 4;
  stroke-linecap: round;
}

.node-signal {
  fill: var(--sun);
  stroke: white;
  stroke-width: 3;
}

.node-hazard {
  fill: var(--danger);
}

.node-label,
.node-stability {
  display: block;
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
}

.node-stability {
  color: var(--muted);
  font-size: 0.58rem;
}

.map-node.is-locked {
  opacity: 0.48;
}

.map-node.zone-frontier .node-island,
.zone-chip.zone-frontier {
  background: rgba(216, 144, 81, 0.16);
  color: #75433b;
}

.map-node.zone-stormwild .node-island,
.zone-chip.zone-stormwild {
  background: rgba(89, 108, 157, 0.16);
  color: var(--storm);
}

.map-node.zone-stormwild .node-island {
  fill: #8790b8;
}

.map-node.zone-frontier .node-island {
  fill: #c58a62;
}

.route-card.locked {
  background: #eee6d4;
}

.route-thumbnail {
  overflow: hidden;
  height: 104px;
  margin: -4px -4px 12px;
  border: 1px solid rgba(37, 74, 92, 0.12);
  border-radius: 8px;
  background: #cfe3e6;
}

.route-thumbnail svg {
  width: 100%;
  height: 100%;
}

.thumb-sky {
  fill: #cfe3e6;
}

.thumb-sun {
  fill: var(--sun);
}

.thumb-cloud {
  fill: rgba(238, 247, 244, 0.82);
}

.thumb-island {
  fill: var(--growth);
}

.thumb-rail,
.thumb-wind {
  fill: none;
  stroke: var(--rail);
  stroke-width: 4;
  stroke-linecap: round;
}

.thumb-hazard {
  fill: var(--danger);
}

.route-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.route-meta span {
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(37, 74, 92, 0.08);
  color: var(--steel);
  font-size: 0.78rem;
  font-weight: 900;
}

.form-grid,
.number-grid,
.reputation-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.form-grid,
.number-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.economy-panel {
  display: grid;
  gap: 14px;
}

.economy-grid,
.flag-grid,
.economy-columns {
  display: grid;
  gap: 10px;
}

.economy-grid,
.flag-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.economy-tile,
.flag-pill {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(37, 74, 92, 0.13);
  border-radius: 8px;
  background: rgba(255, 248, 233, 0.86);
}

.economy-tile span,
.flag-pill span,
.ledger-row span,
.ledger-row em,
.category-list span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.economy-tile strong,
.flag-pill strong,
.ledger-row strong,
.category-list strong {
  display: block;
  margin-top: 4px;
  color: var(--steel);
  font-size: 0.86rem;
}

.flag-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.flag-pill.disabled strong {
  color: var(--civic);
}

.flag-pill.enabled strong {
  color: var(--danger);
}

.economy-columns {
  grid-template-columns: 1fr;
}

.category-list,
.ledger-list {
  display: grid;
  gap: 8px;
}

.category-list > div,
.ledger-row {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(37, 74, 92, 0.11);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
}

.ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
}

.ledger-row em {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
  font-style: normal;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

select,
input {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid rgba(37, 74, 92, 0.22);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.check-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 12px 0;
}

.check-toggle input {
  width: 20px;
  min-height: 20px;
}

.insurance-select {
  margin-top: 12px;
}

.train-strip {
  display: grid;
  grid-template-columns: minmax(130px, 180px) 1fr;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid rgba(37, 74, 92, 0.12);
  border-radius: 8px;
  background: rgba(207, 231, 232, 0.22);
}

.dispatch-hero-panel {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid rgba(37, 74, 92, 0.12);
  border-radius: 8px;
  background: rgba(255, 248, 233, 0.82);
}

.dispatch-hero-panel .hero-portrait,
.dispatch-hero-panel .hero-image {
  width: 72px;
  min-height: 72px;
  height: 72px;
}

.dispatch-hero-panel .hero-emblem {
  width: 28px;
  height: 28px;
}

.dispatch-hero-panel h3 {
  margin: 4px 0 0;
  color: var(--steel);
  font-size: 1rem;
}

.dispatch-hero-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.32;
}

.train-loadout {
  display: grid;
  gap: 8px;
}

.loadout-meter {
  position: relative;
  overflow: hidden;
  min-height: 28px;
  border-radius: 8px;
  background: rgba(37, 74, 92, 0.12);
}

.loadout-meter span {
  display: block;
  height: 28px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brass), var(--sun));
}

.loadout-meter.guard-meter span {
  background: linear-gradient(90deg, var(--steel), var(--glass-deep));
}

.loadout-meter em {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 950;
}

.dispatch-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.dispatch-preview > div,
.preview-tile {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(37, 74, 92, 0.13);
  border-radius: 8px;
  background: #fff8e9;
}

.preview-tile {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 2px 8px;
  align-items: center;
}

.preview-tile strong,
.preview-tile span {
  display: block;
}

.preview-tile strong {
  color: var(--steel);
  font-size: 0.96rem;
}

.preview-tile span {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.74rem;
}

.preview-tile--total {
  border-color: rgba(201, 145, 69, 0.42);
  background: #fff3d5;
}

.preview-tile--repair {
  border-color: rgba(85, 123, 95, 0.42);
  background: rgba(237, 249, 245, 0.78);
}

.preview-tile--guidance {
  border-color: rgba(47, 158, 143, 0.44);
  background: rgba(237, 249, 245, 0.88);
}

.preview-tile.is-short {
  border-color: rgba(168, 70, 63, 0.5);
  background: rgba(255, 241, 237, 0.94);
}

.preview-tile.is-short strong,
.preview-shortfall {
  color: var(--danger);
}

.preview-shortfall {
  grid-column: 2;
  font-size: 0.72rem;
  font-weight: 950;
}

.combat-panel {
  display: grid;
  gap: 12px;
  border-color: rgba(168, 70, 63, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.94), rgba(207, 231, 232, 0.34)),
    var(--panel);
}

.combat-layout {
  display: grid;
  gap: 12px;
}

.combat-stage {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  border: 1px solid rgba(37, 74, 92, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(207, 231, 232, 0.74), rgba(247, 240, 223, 0.88)),
    repeating-linear-gradient(112deg, rgba(111, 90, 69, 0.12) 0 2px, transparent 2px 22px);
}

.combat-stage .skyrail-v2-host {
  z-index: 0;
}

.combat-stage-fallback {
  background: transparent;
}

.combat-rails {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.combat-rail-shadow,
.combat-rail-main,
.combat-rail-ties {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.combat-rail-shadow {
  stroke: rgba(33, 51, 60, 0.18);
  stroke-width: 10;
}

.combat-rail-main {
  stroke: var(--rail);
  stroke-width: 6;
}

.combat-rail-ties {
  stroke: rgba(90, 63, 49, 0.54);
  stroke-width: 3;
}

.combat-marker {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  margin: -21px 0 0 -21px;
  border: 2px solid rgba(255, 250, 240, 0.86);
  border-radius: 8px;
  background: var(--panel);
  color: var(--steel);
  box-shadow: 0 9px 16px rgba(33, 51, 60, 0.18);
}

.combat-marker span {
  font-size: 0.72rem;
  font-weight: 950;
}

.combat-marker em {
  color: var(--muted);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 900;
}

.combat-marker--train {
  width: 62px;
  background: var(--steel);
  color: white;
}

.combat-marker--friendly {
  background: #eaf2ed;
  color: var(--civic);
}

.combat-marker--hostile {
  background: #fff1ed;
  color: var(--danger);
}

.combat-marker--system {
  background: #eef6f5;
  color: var(--steel);
}

.combat-marker--hazard {
  background: rgba(89, 108, 157, 0.18);
  color: var(--storm);
}

.combat-objective-list,
.combat-squad-rail,
.combat-orders,
.combat-result-grid,
.combat-log {
  display: grid;
  gap: 8px;
}

.combat-objective,
.combat-squad-chip,
.combat-result-grid > div,
.combat-log span {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(37, 74, 92, 0.13);
  border-radius: 8px;
  background: rgba(255, 248, 233, 0.78);
}

.combat-objective strong {
  display: block;
  margin: 4px 0 8px;
  color: var(--steel);
  font-size: 0.86rem;
}

.combat-objective.is-complete {
  border-color: rgba(85, 123, 95, 0.36);
  background: rgba(154, 199, 170, 0.18);
}

.combat-objective.is-failed {
  border-color: rgba(168, 70, 63, 0.34);
  background: #fff1ed;
}

.combat-squad-rail {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.combat-squad-chip {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
}

.combat-squad-chip span {
  grid-row: 1 / span 2;
}

.combat-squad-chip strong,
.combat-squad-chip em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-squad-chip strong {
  color: var(--steel);
  font-size: 0.84rem;
}

.combat-squad-chip em,
.combat-result-grid span,
.combat-log span {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.combat-orders,
.combat-control-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.combat-order-button {
  min-width: 0;
}

.combat-result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.combat-result-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--steel);
}

.combat-log span {
  display: block;
}

.empty-state {
  padding: 14px;
  border: 1px dashed rgba(37, 74, 92, 0.26);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.62);
  color: var(--muted);
  font-weight: 800;
}

.contract-card.ready {
  border-color: rgba(85, 123, 95, 0.5);
}

.contract-card.claimed {
  opacity: 0.74;
}
.contract-card.is-journey-contract,
.contract-card.is-selected {
  border-color: rgba(201, 145, 69, 0.5);
  box-shadow:
    inset 0 0 0 2px rgba(244, 199, 111, 0.18),
    0 12px 24px rgba(33, 51, 60, 0.08);
}

.journey-contract-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(244, 199, 111, 0.24);
  color: var(--brass-dark);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.league-hero {
  background:
    linear-gradient(135deg, rgba(85, 123, 95, 0.14), rgba(244, 199, 111, 0.2)),
    var(--panel);
}

.hero-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
}

.hero-portrait {
  position: relative;
  width: 92px;
  min-height: 104px;
}

.hero-svg {
  display: block;
  width: 92px;
  height: 104px;
  overflow: visible;
}

.hero-frame {
  stroke: rgba(255, 250, 240, 0.9);
  stroke-width: 3;
}

.hero-sky {
  fill: rgba(238, 247, 244, 0.28);
}

.hero-halo,
.hero-collar {
  fill: var(--sun);
}

.hero-face {
  fill: #d7a87d;
}

.hero-eye {
  fill: var(--ink);
}

.hero-mouth {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
}

.hero-tool {
  fill: rgba(255, 250, 240, 0.86);
  stroke: var(--steel);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-emblem {
  position: absolute;
  right: -4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--steel);
  color: white;
}

.hero-card.locked .hero-svg {
  filter: grayscale(0.82);
  opacity: 0.62;
}

.hero-card.available {
  border-color: rgba(216, 144, 81, 0.52);
}

.crew-card {
  position: relative;
  padding-left: 66px;
}

.crew-card-icon {
  position: absolute;
  top: 15px;
  left: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--steel);
  color: white;
}

.button-row {
  margin-top: 10px;
}

.button-row > button {
  width: auto;
  flex: 1;
}

.debug-row {
  flex-wrap: wrap;
}

.debug-row > button {
  flex: 1 1 94px;
}

.log-list {
  display: grid;
  gap: 8px;
}

.log-entry {
  padding: 10px 12px;
  border-left: 4px solid var(--steel-2);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.35;
}

.log-entry.success,
.log-entry.league,
.log-entry.contract {
  border-left-color: var(--civic);
}

.log-entry.setback {
  border-left-color: var(--danger);
}

.town-expansion-board {
  border-color: rgba(141, 100, 47, 0.38);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.84), rgba(229, 220, 198, 0.76)),
    linear-gradient(90deg, rgba(154, 183, 161, 0.16), rgba(207, 231, 232, 0.16));
}

.expansion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.expansion-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid rgba(141, 100, 47, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.92), rgba(207, 231, 232, 0.64)),
    repeating-linear-gradient(90deg, rgba(141, 100, 47, 0.08) 0 1px, transparent 1px 22px);
  box-shadow: inset 0 1px 0 rgba(255, 250, 240, 0.76), 0 10px 20px rgba(33, 51, 60, 0.09);
}

.expansion-card h3 {
  margin: 8px 0 4px;
  font-size: 1rem;
}

.expansion-card p {
  margin: 0;
  max-width: 48ch;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.expansion-card.is-available {
  border-color: rgba(189, 145, 68, 0.58);
}

.expansion-status {
  min-width: 86px;
  padding: 8px 10px;
  border: 1px solid rgba(37, 74, 92, 0.24);
  border-radius: 999px;
  background: rgba(207, 231, 232, 0.58);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.station-diorama {
  min-height: 360px;
  background: #b8dbe1;
  isolation: isolate;
}

.station-diorama::after {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.02), rgba(33, 51, 60, 0.12)),
    radial-gradient(circle at 50% 50%, transparent 42%, rgba(33, 51, 60, 0.14));
  content: "";
}

.station-diorama-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.town-expansion-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.town-expansion-layer.is-available {
  opacity: 0.42;
  transform-origin: var(--expansion-anchor-x, 50%) var(--expansion-anchor-y, 50%);
}

.town-expansion-layer.is-revealed,
.town-expansion-layer.is-complete {
  opacity: 1;
  transform-origin: var(--expansion-anchor-x, 50%) var(--expansion-anchor-y, 50%);
}

.town-expansion-layer.is-revealed {
  opacity: 1;
}

.slot-layer {
  z-index: 7;
  pointer-events: none;
}

.diorama-slot {
  width: 66px;
  pointer-events: auto;
}

.slot-large {
  width: 108px;
}

.slot-medium {
  width: 82px;
}

.slot-small {
  width: 62px;
}

.slot-tall {
  width: 72px;
}

.diorama-slot .building-sprite {
  z-index: 1;
  opacity: 0.8;
  filter: drop-shadow(0 7px 8px rgba(33, 51, 60, 0.22));
  transform: scale(0.72);
  transform-origin: center bottom;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    filter 160ms ease;
}

.diorama-slot.is-available .building-sprite {
  opacity: 0.62;
  filter: saturate(0.72) drop-shadow(0 5px 6px rgba(33, 51, 60, 0.18));
}

.diorama-slot.is-under_construction .building-sprite,
.diorama-slot.is-upgrading .building-sprite {
  opacity: 0.72;
  filter: sepia(0.12) saturate(0.8) drop-shadow(0 7px 8px rgba(33, 51, 60, 0.24));
}

.diorama-slot:hover .building-sprite,
.diorama-slot:focus-visible .building-sprite {
  opacity: 0.98;
  filter: drop-shadow(0 10px 12px rgba(33, 51, 60, 0.28));
  transform: scale(0.82);
}

.construction-overlay,
.survey-stakes,
.complete-hook {
  position: absolute;
  inset: 8% 4% 0;
  z-index: 3;
  pointer-events: none;
}

.construction-frame {
  position: absolute;
  inset: 8% 10% 20%;
  border: 2px solid rgba(141, 100, 47, 0.78);
  border-top-width: 4px;
  background:
    linear-gradient(90deg, transparent 0 28%, rgba(141, 100, 47, 0.52) 28% 32%, transparent 32% 64%, rgba(141, 100, 47, 0.52) 64% 68%, transparent 68%),
    linear-gradient(135deg, transparent 0 43%, rgba(37, 74, 92, 0.42) 44% 48%, transparent 49%);
  box-shadow: 0 5px 9px rgba(33, 51, 60, 0.2);
}

.construction-meter {
  position: absolute;
  right: 10%;
  bottom: 9%;
  left: 10%;
  height: 5px;
  border: 1px solid rgba(37, 74, 92, 0.38);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(85, 123, 95, 0.86) var(--construction-progress, 0%), rgba(255, 250, 240, 0.54) 0),
    rgba(207, 231, 232, 0.62);
}

.survey-stakes::before,
.survey-stakes::after {
  position: absolute;
  bottom: 10%;
  width: 4px;
  height: 34%;
  border-radius: 2px;
  background: rgba(141, 100, 47, 0.76);
  box-shadow: 0 4px 7px rgba(33, 51, 60, 0.18);
  content: "";
}

.survey-stakes::before {
  left: 25%;
  transform: rotate(-9deg);
}

.survey-stakes::after {
  right: 25%;
  transform: rotate(9deg);
}

.complete-hook {
  display: none;
}

.building-sprite {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  margin: 0;
  overflow: visible;
}

.building-sprite-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.building-sprite.is-locked .building-sprite-img {
  opacity: 0.82;
  filter: saturate(0.65) contrast(0.9);
}

.building-sprite-fallback {
  position: absolute;
  inset: 25% 18% 18%;
  z-index: -1;
  border-radius: 50%;
  background: rgba(37, 74, 92, 0.08);
}

.building-badge {
  overflow: visible;
}

.building-badge .building-sprite {
  width: 88px;
  height: 88px;
  margin: -14px -6px;
}

.skyrail-train {
  display: block;
  object-fit: contain;
}

.skyrail-train--scene {
  right: auto;
  bottom: 21%;
  left: 48%;
  z-index: 8;
  width: 178px;
  height: auto;
  filter: drop-shadow(0 8px 9px rgba(33, 51, 60, 0.28));
  transform: translate(-50%, 0);
}

.skyrail-train--strip {
  width: 190px;
  height: auto;
  max-width: 100%;
  aspect-ratio: 3 / 1;
}

.route-thumbnail {
  position: relative;
  height: 118px;
  background: #cfe3e6;
}

.route-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.route-thumbnail.is-locked .route-thumb-img,
.map-node.is-locked .map-node-art img {
  opacity: 0.58;
  filter: grayscale(0.75) saturate(0.7);
}

.map-node {
  width: 96px;
  min-height: 96px;
  margin: -48px 0 0 -48px;
}

.map-node-art {
  display: block;
  overflow: hidden;
  width: 88px;
  height: 74px;
  border: 2px solid rgba(255, 250, 240, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fffaf0, #cfe7e8),
    #d7ece8;
  box-shadow: 0 8px 13px rgba(33, 51, 60, 0.22);
}

.map-node-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.map-node.zone-core .map-node-art {
  background:
    linear-gradient(180deg, #fffaf0, #d6ecdd),
    #d6ecdd;
}

.map-node.zone-chartered .map-node-art {
  background:
    linear-gradient(180deg, #fffaf0, #efddb8),
    #efddb8;
}

.map-node.zone-frontier .map-node-art {
  background:
    linear-gradient(180deg, #fffaf0, #ecc5a5),
    #ecc5a5;
}

.map-node.zone-stormwild .map-node-art {
  background:
    linear-gradient(180deg, #fffaf0, #bec7e2),
    #bec7e2;
}

.node-signal-pip {
  position: absolute;
  top: 3px;
  right: 8px;
  width: 17px;
  height: 17px;
  border: 2px solid white;
  border-radius: 999px;
  background: var(--sun);
  box-shadow: 0 0 13px rgba(244, 199, 111, 0.82);
}

.hero-image {
  display: block;
  width: 92px;
  height: 104px;
  border: 3px solid rgba(255, 250, 240, 0.92);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 10px 20px rgba(33, 51, 60, 0.16);
}

.hero-image.is-locked,
.hero-card.locked .hero-image {
  opacity: 0.62;
  filter: grayscale(0.82);
}

.crew-card {
  padding-left: 78px;
}

.crew-card-icon {
  width: 52px;
  height: 52px;
  background: transparent;
}

.crew-badge-img {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(33, 51, 60, 0.2));
}

/* Portable Skyrail material system overrides. */
.material-icon {
  display: block;
  overflow: visible;
  color: var(--steel);
  filter: drop-shadow(0 1px 0 rgba(255, 250, 240, 0.7));
}

.material-icon .icon-plate {
  fill: rgba(255, 250, 240, 0.58);
  stroke: rgba(37, 74, 92, 0.13);
  stroke-width: 1.2;
}

.material-icon .icon-body {
  stroke-width: 1.9;
}

.icon-shadow {
  fill: rgba(33, 51, 60, 0.18);
  stroke: none;
}

.icon-brass {
  fill: var(--brass);
  stroke: var(--brass-dark);
  stroke-width: 1.4;
}

.icon-brass-line {
  fill: none;
  stroke: var(--brass-dark);
  stroke-width: 2.1;
}

.icon-ring-line {
  stroke: rgba(141, 100, 47, 0.72);
  stroke-width: 1.45;
}

.icon-steel {
  fill: var(--steel);
  stroke: var(--steel-dark);
  stroke-width: 1.2;
}

.icon-steel-line {
  fill: none;
  stroke: var(--steel-dark);
  stroke-width: 2;
}

.icon-glass {
  fill: var(--glass);
  stroke: var(--glass-deep);
  stroke-width: 1.25;
}

.icon-glass-line,
.icon-glass-facet {
  fill: none;
  stroke: rgba(53, 107, 119, 0.72);
  stroke-width: 1.15;
}

.icon-glass-facet {
  stroke: rgba(237, 249, 245, 0.82);
  stroke-width: 1;
}

.icon-ceramic,
.icon-paper {
  fill: var(--ceramic);
  stroke: rgba(90, 63, 49, 0.35);
  stroke-width: 1.2;
}

.icon-crate {
  fill: #b78a52;
  stroke: #7f5c40;
  stroke-width: 1.2;
}

.icon-leaf {
  fill: var(--growth);
  stroke: var(--civic);
  stroke-width: 1.2;
}

.icon-stone {
  fill: #b9ad92;
  stroke: rgba(90, 63, 49, 0.42);
  stroke-width: 1.15;
}

.icon-stone-light {
  fill: none;
  stroke: rgba(255, 250, 240, 0.6);
  stroke-width: 1;
}

.icon-rivet,
.icon-produce {
  fill: var(--brass-light);
  stroke: rgba(141, 100, 47, 0.58);
  stroke-width: 0.75;
}

.icon-produce--tomato {
  fill: #d89051;
  stroke: rgba(168, 70, 63, 0.58);
}

.icon-produce--sunfruit {
  fill: var(--sun);
}

.icon-stamp-line,
.icon-rail-tie,
.icon-rail-joint,
.icon-signal-tower {
  fill: none;
  stroke: var(--steel-dark);
  stroke-width: 1.45;
}

.icon-stamp-line {
  stroke: rgba(33, 51, 60, 0.76);
}

.icon-rail-joint {
  stroke: rgba(255, 250, 240, 0.76);
}

.icon-highlight {
  fill: none;
  stroke: rgba(255, 250, 240, 0.78);
  stroke-width: 1.1;
}

.icon-signal,
.icon-signal-fill {
  fill: var(--sun);
  stroke: rgba(141, 100, 47, 0.72);
  stroke-width: 1.1;
  filter: drop-shadow(0 0 4px rgba(244, 199, 111, 0.85));
}

.icon-danger {
  fill: var(--rust);
  stroke: var(--danger);
  stroke-width: 1.3;
}

.icon-ink-fill {
  fill: var(--ink);
}

.icon-paper-line {
  fill: none;
  stroke: var(--panel);
  stroke-width: 2.3;
}

.resource-icon--marks .icon-plate {
  fill: rgba(244, 199, 111, 0.2);
  stroke: rgba(141, 100, 47, 0.24);
}

.resource-icon--food .icon-plate {
  fill: rgba(154, 199, 170, 0.18);
  stroke: rgba(85, 123, 95, 0.22);
}

.resource-icon--materials .icon-plate {
  fill: rgba(231, 216, 183, 0.28);
  stroke: rgba(90, 63, 49, 0.18);
}

.resource-icon--energy .icon-plate {
  fill: rgba(207, 231, 232, 0.24);
  stroke: rgba(53, 107, 119, 0.2);
}

.resource-icon--parts .icon-plate {
  fill: rgba(37, 74, 92, 0.1);
  stroke: rgba(33, 51, 60, 0.2);
}

.resource-icon--favor .icon-plate {
  fill: rgba(85, 123, 95, 0.14);
  stroke: rgba(85, 123, 95, 0.22);
}

.thin {
  stroke-width: 1.3;
}

.topbar {
  border-bottom-color: rgba(141, 100, 47, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(247, 240, 223, 0.9)),
    radial-gradient(circle at 12% 0, rgba(207, 231, 232, 0.65), transparent 18rem),
    var(--panel);
  box-shadow: 0 10px 28px rgba(33, 51, 60, 0.08);
}

.save-chip,
.district,
.zone-chip,
.status-badge,
.mission-badge,
.resource-token {
  border-color: rgba(141, 100, 47, 0.25);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.92), rgba(231, 216, 183, 0.55)),
    var(--ledger);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 1px 0 rgba(33, 51, 60, 0.04);
}

.resource-pill {
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 0 10px;
  min-height: 72px;
  padding: 10px;
  border-color: rgba(141, 100, 47, 0.22);
  background:
    linear-gradient(135deg, rgba(237, 249, 245, 0.72), rgba(255, 246, 223, 0.92)),
    radial-gradient(circle at 95% 8%, rgba(244, 199, 111, 0.24), transparent 3.6rem),
    var(--panel);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.55),
    0 8px 18px rgba(33, 51, 60, 0.07);
}

.resource-mark {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(141, 100, 47, 0.32);
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgba(255, 250, 240, 0.92), rgba(207, 231, 232, 0.46)),
    radial-gradient(circle at 50% 25%, rgba(244, 199, 111, 0.42), transparent 70%);
  color: var(--steel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 5px 10px rgba(33, 51, 60, 0.1);
}

.resource-icon {
  width: 30px;
  height: 30px;
}

.resource-pill strong {
  align-self: start;
  color: var(--steel-dark);
  font-size: 1.08rem;
}

.resource-rate {
  align-self: end;
  padding-top: 3px;
  border-top: 1px solid rgba(37, 74, 92, 0.09);
}

.tabbar {
  border-top-color: rgba(141, 100, 47, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(239, 227, 200, 0.96)),
    var(--panel);
  box-shadow: 0 -9px 22px rgba(33, 51, 60, 0.09);
}

.tab-button {
  border-radius: 8px;
  color: var(--steel);
}

.tab-icon {
  width: 36px;
  height: 32px;
  border: 1px solid rgba(37, 74, 92, 0.12);
  background:
    linear-gradient(180deg, rgba(237, 249, 245, 0.9), rgba(231, 216, 183, 0.48)),
    var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.tab-button.active {
  border-color: rgba(201, 145, 69, 0.5);
  background:
    linear-gradient(180deg, rgba(244, 199, 111, 0.26), rgba(207, 231, 232, 0.35)),
    rgba(255, 250, 240, 0.72);
}

.tab-button.active .tab-icon {
  background:
    radial-gradient(circle at 76% 18%, rgba(244, 199, 111, 0.75), transparent 0.72rem),
    linear-gradient(180deg, var(--steel-2), var(--steel));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    var(--signal-glow);
}

.tab-button.active .material-icon .icon-plate {
  fill: rgba(237, 249, 245, 0.18);
  stroke: rgba(255, 250, 240, 0.2);
}

.tab-button.active .icon-brass-line,
.tab-button.active .icon-steel-line {
  stroke: var(--brass-light);
}

.tab-button.active .icon-steel,
.tab-button.active .icon-ceramic,
.tab-button.active .icon-paper {
  fill: rgba(255, 250, 240, 0.92);
}

.section-band,
.dispatch-form,
.league-form,
.league-hero,
.building-card,
.route-card,
.contract-card,
.hero-card,
.crew-card,
.dispatch-card,
.project-meter,
.economy-tile,
.flag-pill,
.category-list > div,
.ledger-row {
  border-color: rgba(141, 100, 47, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.97), rgba(239, 227, 200, 0.58)),
    var(--ledger);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 10px 24px rgba(33, 51, 60, 0.07);
}

.section-heading {
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(141, 100, 47, 0.16);
}

.section-heading > span,
.work-order-count {
  min-width: 42px;
  padding: 4px 8px;
  border: 1px solid rgba(141, 100, 47, 0.24);
  border-radius: 8px;
  background: rgba(237, 249, 245, 0.58);
  text-align: center;
}

.current-order {
  display: grid;
  gap: 7px;
  margin: 12px 0 13px;
  padding: 12px 13px;
  border: 1px solid rgba(37, 74, 92, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(237, 249, 245, 0.92), rgba(255, 250, 240, 0.8)),
    rgba(207, 231, 232, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.current-order p {
  margin: 0;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.42;
}

.signal-chip {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(141, 100, 47, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(244, 199, 111, 0.3), rgba(255, 250, 240, 0.84)),
    var(--panel);
  color: var(--steel);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.checklist {
  gap: 8px;
}

.check-item {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid rgba(141, 100, 47, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.48);
  color: var(--muted);
}

.check-item:last-child {
  border-bottom: 1px solid rgba(141, 100, 47, 0.14);
}

.check-item.is-current {
  border-color: rgba(37, 74, 92, 0.28);
  background:
    linear-gradient(180deg, rgba(237, 249, 245, 0.72), rgba(255, 250, 240, 0.82)),
    var(--panel);
  box-shadow: inset 4px 0 0 var(--steel-2);
}

.check-node,
.check-item span.check-node {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(37, 74, 92, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(237, 249, 245, 0.8), rgba(255, 250, 240, 0.92)),
    var(--panel);
  color: var(--steel);
  font-size: 0.62rem;
  font-weight: 950;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.check-copy,
.check-item span.check-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
}

.check-label {
  display: block;
  flex: 1 1 auto;
  width: auto;
  height: auto;
  min-width: 0;
  border: 0;
  border-radius: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 950;
  line-height: 1.2;
}

.check-hint,
.check-item span.check-hint {
  display: block;
  width: auto;
  height: auto;
  min-width: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.check-item.done .check-node {
  border-color: rgba(85, 123, 95, 0.46);
  background:
    radial-gradient(circle at 65% 18%, rgba(244, 199, 111, 0.72), transparent 0.55rem),
    linear-gradient(180deg, var(--civic), #42684c);
  color: white;
  box-shadow: var(--signal-glow);
}

.check-item.done .check-label {
  color: var(--civic);
}

.progress,
.loadout-meter {
  border: 1px solid rgba(37, 74, 92, 0.11);
  background:
    linear-gradient(180deg, rgba(237, 249, 245, 0.72), rgba(139, 187, 193, 0.22)),
    rgba(37, 74, 92, 0.08);
}

.progress span,
.loadout-meter span {
  background:
    linear-gradient(90deg, rgba(85, 123, 95, 0.95), rgba(244, 199, 111, 0.95)),
    var(--civic);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.loadout-meter.guard-meter span {
  background: linear-gradient(90deg, var(--steel), var(--glass-deep));
}

.primary-action {
  border-color: rgba(23, 56, 68, 0.45);
  background:
    linear-gradient(180deg, #3d7782, var(--steel-dark)),
    var(--steel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 7px 13px rgba(33, 51, 60, 0.12);
}

.secondary-action {
  border-color: rgba(141, 100, 47, 0.22);
  background:
    linear-gradient(180deg, rgba(237, 249, 245, 0.88), rgba(231, 216, 183, 0.58)),
    var(--panel);
}

.danger-action {
  background:
    linear-gradient(180deg, #fff8f2, #f1d9cc),
    #fff1ed;
}

.preview-tile,
.empty-state,
.fee-line,
.route-meta span {
  border-color: rgba(141, 100, 47, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.92), rgba(237, 249, 245, 0.42)),
    var(--ledger);
}

.station-name {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.nav-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid rgba(255, 250, 240, 0.92);
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 0.64rem;
  line-height: 1;
}

.town-alerts,
.building-detail-panel,
.route-detail-panel,
.rail-link-panel,
.convoy-panel,
.lines-contracts,
.identity-panel,
.league-node-detail {
  display: grid;
  gap: 12px;
}

.alert-grid,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alert-chip,
.filter-chip,
.mini-link-button {
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid rgba(141, 100, 47, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(231, 216, 183, 0.48)),
    var(--ledger);
  color: var(--steel);
  font-size: 0.78rem;
  font-weight: 900;
}

.alert-chip.is-active,
.filter-chip.active {
  border-color: rgba(201, 145, 69, 0.62);
  background:
    linear-gradient(180deg, rgba(244, 199, 111, 0.34), rgba(207, 231, 232, 0.4)),
    var(--ledger);
}

.alert-chip.is-returned {
  border-color: rgba(85, 123, 95, 0.42);
  background: rgba(154, 199, 170, 0.18);
}

.town-convoy-summary {
  padding: 10px;
  border: 1px solid rgba(37, 74, 92, 0.13);
  border-radius: 8px;
  background: rgba(237, 249, 245, 0.54);
}

.town-convoy-summary p,
.issuer-line {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.town-action-queue,
.milestone-panel {
  display: grid;
  gap: 12px;
}

.town-action-queue {
  border-color: color-mix(in srgb, var(--civic) 28%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper) 84%, transparent), color-mix(in srgb, var(--panel) 94%, transparent)),
    var(--panel);
}

.town-action-list,
.milestone-list {
  display: grid;
  gap: 8px;
}

.town-action-item,
.milestone-entry {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--paper) 82%, var(--panel));
}

.town-action-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.town-action-copy,
.milestone-entry > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.town-action-copy strong,
.milestone-entry strong {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.16;
}

.town-action-copy > span:not(.signal-chip),
.town-action-copy em,
.milestone-entry span:not(.check-node) {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.32;
}

.town-action-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.town-action-controls > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.town-action-button {
  min-width: 92px;
}

.milestone-entry {
  grid-template-columns: 32px minmax(0, 1fr);
}

.milestone-entry .check-node {
  width: 28px;
  height: 28px;
  color: var(--paper);
  background: var(--civic);
}

.lines-toolbar {
  gap: 10px;
}

.filter-row.compact .filter-chip {
  min-height: 44px;
  font-size: 0.72rem;
}

.lines-context-grid {
  display: grid;
  gap: 12px;
}

.route-card.is-selected,
.route-detail-panel.is-selected,
.rail-link-panel.is-selected {
  border-color: rgba(201, 145, 69, 0.58);
  box-shadow:
    inset 0 0 0 2px rgba(244, 199, 111, 0.24),
    0 12px 24px rgba(33, 51, 60, 0.08);
}

.map-node.is-selected .map-node-art {
  border-color: var(--sun);
  box-shadow:
    0 0 0 3px rgba(244, 199, 111, 0.28),
    0 8px 13px rgba(33, 51, 60, 0.22);
}


.map-node.is-journey-target .map-node-art {
  border-color: rgba(201, 145, 69, 0.76);
  box-shadow:
    0 0 0 3px rgba(244, 199, 111, 0.26),
    0 8px 13px rgba(33, 51, 60, 0.22);
}
.map-node.has-convoy .node-signal-pip {
  background: var(--steel);
  box-shadow: 0 0 0 4px rgba(37, 74, 92, 0.16);
}

.map-node.has-contract::after {
  position: absolute;
  right: 5px;
  bottom: 22px;
  width: 13px;
  height: 13px;
  border: 2px solid white;
  border-radius: 3px;
  background: var(--brass);
  content: "";
}

.visual-hook {
  display: none;
}

.skyrail-v2-scene {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  isolation: isolate;
}

.station-diorama--v2,
.skyrail-map--v2,
.league-network-map--v2 {
  min-height: clamp(330px, 68vw, 520px);
  background:
    radial-gradient(circle at 82% 12%, rgba(244, 199, 111, 0.28), transparent 7rem),
    linear-gradient(180deg, #a8d3d8 0%, #e4f1ea 58%, #f0dcae 100%);
}

.station-diorama--v2 {
  aspect-ratio: 16 / 10;
}

.skyrail-map--v2,
.league-network-map--v2 {
  aspect-ratio: 16 / 9;
}

.skyrail-v2-host {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.skyrail-v2-host canvas,
.skyrail-v2-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

.skyrail-v2-static-base {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.skyrail-v2-static-base--town {
  background:
    radial-gradient(ellipse at 9% 22%, rgba(238, 247, 244, 0.38) 0 7%, transparent 8%),
    radial-gradient(ellipse at 92% 24%, rgba(238, 247, 244, 0.3) 0 8%, transparent 9%),
    linear-gradient(180deg, #abd9de 0%, #dcefe8 62%, #decfa9 100%);
}

.static-town-island,
.static-town-rail {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.static-town-island {
  bottom: 4%;
  width: min(86%, 1050px);
  height: 44%;
  border-radius: 50% 50% 35% 36%;
  background:
    linear-gradient(180deg, #76a866 0 44%, #5b7d64 45% 66%, #426251 67%),
    #6f9c62;
  box-shadow:
    inset 0 9px 0 rgba(239, 231, 207, 0.62),
    0 28px 46px rgba(33, 51, 60, 0.16);
}

.static-town-rail {
  bottom: 22%;
  width: min(78%, 930px);
  height: 17%;
  border-top: 7px solid rgba(196, 143, 59, 0.9);
  border-bottom: 3px solid rgba(24, 57, 68, 0.82);
  border-radius: 50%;
}

.static-town-rail--lower {
  bottom: 17%;
  width: min(74%, 880px);
  border-top-color: rgba(24, 57, 68, 0.62);
  border-bottom-color: rgba(196, 143, 59, 0.84);
}

.skyrail-v2-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(207, 231, 232, 0.86), rgba(247, 240, 223, 0.72)),
    var(--paper);
  color: var(--steel);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
}

.skyrail-v2-fallback[hidden] {
  display: none;
}

.skyrail-v2-host.is-ready .skyrail-v2-fallback {
  display: none;
}

.slot-layer--v2 {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.diorama-slot--v2 {
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 98px;
  min-height: 64px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  box-shadow: none;
}

.diorama-slot--v2 .v2-slot-pin {
  position: relative;
  display: block;
  width: 18px;
  height: 32px;
  border: 1px solid rgba(90, 63, 49, 0.5);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(244, 199, 111, 0.9), rgba(141, 100, 47, 0.86));
  box-shadow: 0 5px 8px rgba(33, 51, 60, 0.22);
}

.diorama-slot--v2 .v2-slot-pin::before {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 42px;
  height: 5px;
  border-radius: 2px;
  background: rgba(37, 74, 92, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 250, 240, 0.32);
  content: "";
  transform: translateX(-50%);
}

.diorama-slot--v2 .v2-slot-label {
  max-width: 104px;
  padding: 4px 6px;
  border: 1px solid rgba(141, 100, 47, 0.22);
  border-radius: 6px;
  background: rgba(255, 250, 240, 0.82);
  color: var(--ink);
  font-size: 0.62rem;
  font-weight: 950;
  line-height: 1.05;
  overflow-wrap: anywhere;
  box-shadow: 0 4px 10px rgba(33, 51, 60, 0.12);
}

.diorama-slot--v2.is-complete .v2-slot-pin,
.diorama-slot--v2.is-revealed .v2-slot-pin {
  opacity: 0.26;
}

.diorama-slot--v2.is-complete .v2-slot-label {
  opacity: 0.72;
}

.diorama-slot--v2:hover .v2-slot-label,
.diorama-slot--v2:focus-visible .v2-slot-label,
.diorama-slot--v2.is-selected .v2-slot-label {
  border-color: rgba(201, 145, 69, 0.72);
  background: rgba(255, 250, 240, 0.96);
}

.diorama-slot--v2 .construction-overlay--v2 {
  inset: auto;
  top: -8px;
  width: 72px;
  height: 42px;
}

.diorama-slot--v2 .survey-stakes {
  inset: 8px 18px 20px;
}

.map-bridges--v2-hit-layer {
  z-index: 3;
  pointer-events: none;
}

.map-bridges--v2-hit-layer .rail-link-hit {
  pointer-events: stroke;
}

.map-node--v2,
.convoy-marker,
.route-hazard,
.route-contract-marker {
  z-index: 5;
}

.league-network-map--v2 .skyrail-v2-host {
  z-index: 0;
}

.league-node-art--v2 {
  width: 22px;
  height: 18px;
  border: 1px solid rgba(90, 63, 49, 0.34);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(37, 74, 92, 0.8) 0 28%, transparent 28% 36%, rgba(201, 145, 69, 0.82) 36% 64%, transparent 64% 72%, rgba(85, 123, 95, 0.72) 72%),
    rgba(255, 250, 240, 0.74);
}

.league-project-fill--v2 {
  z-index: 3;
}


.map-bridges {
  z-index: 1;
}

.rail-traffic-layer {
  pointer-events: none;
}

.rail-traffic {
  fill: none;
  stroke: rgba(244, 199, 111, 0.48);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 18 76;
}

.rail-traffic--frontier {
  stroke: rgba(201, 145, 69, 0.42);
}

.rail-traffic--storm {
  stroke: rgba(207, 231, 232, 0.34);
}

.route-selection-glow,
.rail-link-art,
.route-hazard,
.route-contract-marker {
  position: absolute;
  display: block;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.route-selection-glow {
  z-index: 2;
  width: 104px;
  height: 104px;
  opacity: 0.82;
}

.rail-link-art {
  z-index: 2;
  width: 92px;
  opacity: 0.88;
}

.rail-link-art img,
.route-hazard,
.route-contract-marker {
  width: 100%;
  height: auto;
}

.rail-link-art--locked {
  opacity: 0.44;
  filter: grayscale(0.65);
}

.route-hazard {
  z-index: 4;
  width: 38px;
  filter: drop-shadow(0 5px 8px rgba(33, 51, 60, 0.22));
}

.route-contract-marker {
  z-index: 4;
  width: 34px;
  filter: drop-shadow(0 5px 8px rgba(33, 51, 60, 0.18));
}

.rail-link-hit {
  fill: none;
  stroke: rgba(255, 250, 240, 0.01);
  stroke-linecap: round;
  stroke-width: 28;
  cursor: pointer;
  pointer-events: stroke;
}

.rail-link-hit.is-selected {
  stroke: rgba(244, 199, 111, 0.68);
  stroke-width: 18;
}
.rail-link-hit.is-journey-target {
  stroke: rgba(201, 145, 69, 0.48);
  stroke-width: 20;
}

.rail-link-hit.is-journey-target.is-selected {
  stroke: rgba(244, 199, 111, 0.72);
}

.rail-link-hit.is-damaged,
.rail-link-hit.is-under_repair {
  stroke-dasharray: 18 10;
}

.rail-link-hit.has-repair-progress.is-selected {
  stroke: rgba(85, 123, 95, 0.72);
}

.rail-link-hit.is-open.is-selected {
  stroke: rgba(85, 123, 95, 0.62);
}

.rail-link-hit.is-locked {
  cursor: not-allowed;
  opacity: 0.45;
}

.rail-link-line.is-journey-target,
.rail-link-heal.is-journey-target {
  filter: drop-shadow(0 0 4px rgba(244, 199, 111, 0.86));
}
/* Visible per-link status stroke (sits under the wide transparent hit path). */
.rail-link-line {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  pointer-events: none;
}
.rail-link-line.is-open {
  stroke: rgba(47, 158, 143, 0.7); /* --status-healthy */
}
.rail-link-line.is-locked {
  stroke: rgba(37, 74, 92, 0.2);
  stroke-dasharray: 4 12;
}
/* Static state encoding (no looping motion — respects the calm-motion policy);
   colors track the design-system status tokens. */
.rail-link-line.is-damaged {
  stroke: rgba(192, 97, 58, 0.88); /* --status-damaged */
  stroke-dasharray: 7 11;
}
.rail-link-line.is-under_repair {
  stroke: rgba(224, 162, 63, 0.92); /* --status-repairing */
  stroke-dasharray: 16 9;
}
/* Reclaim progress "heals" the span from 0->100% (mirrors the panel meter).
   A one-shot transition on change, not a looping animation. */
.rail-link-heal {
  fill: none;
  stroke: rgba(47, 158, 143, 0.95); /* --status-healthy */
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--repair-pct, 0));
  transition: stroke-dashoffset 0.6s ease;
  pointer-events: none;
}

.skyrail-map.has-link-selection .rail-link-line:not(.is-selected),
.skyrail-map.has-link-selection .rail-link-heal:not(.is-selected) {
  opacity: 0.4;
}

.rail-link-access-list {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}

.rail-link-access-button {
  position: absolute;
  left: var(--link-x);
  top: var(--link-y);
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: transparent;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.rail-link-access-button::before {
  position: absolute;
  inset: 13px;
  border-radius: inherit;
  background: rgba(37, 74, 92, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 250, 240, 0.68);
  content: "";
  opacity: 0;
}

.rail-link-access-button:hover::before,
.rail-link-access-button:focus-visible::before {
  opacity: 1;
}

.rail-link-access-button:focus-visible {
  outline: 3px solid rgba(244, 199, 111, 0.88);
  outline-offset: 2px;
}

.rail-link-access-button.is-open::before {
  background: rgba(85, 123, 95, 0.95);
}

.rail-link-access-button.is-damaged::before {
  background: rgba(168, 70, 63, 0.95);
}

.rail-link-access-button.is-under_repair::before {
  background: rgba(201, 145, 69, 0.95);
}
.rail-link-access-button.is-journey-target::before {
  opacity: 1;
  background: rgba(201, 145, 69, 0.95);
  box-shadow:
    0 0 0 3px rgba(255, 250, 240, 0.78),
    0 0 0 7px rgba(244, 199, 111, 0.22);
}

/* Lines legend chip row. */
.rail-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
}
.rail-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}
.rail-legend-item::before {
  content: "";
  width: 22px;
  height: 6px;
  border-radius: 999px;
  background: var(--swatch, var(--muted));
  box-shadow: inset 0 0 0 1px rgba(24, 57, 68, 0.16);
}
.rail-legend-item.is-open { --swatch: rgba(47, 158, 143, 0.7); }
.rail-legend-item.is-damaged { --swatch: rgba(192, 97, 58, 0.88); }
.rail-legend-item.is-damaged::before {
  background: repeating-linear-gradient(90deg, var(--swatch) 0 7px, transparent 7px 12px);
  box-shadow: none;
}
.rail-legend-item.is-under_repair { --swatch: rgba(224, 162, 63, 0.92); }
.rail-legend-item.is-under_repair::before {
  background: repeating-linear-gradient(90deg, var(--swatch) 0 13px, transparent 13px 20px);
  box-shadow: none;
}

/* League co-op bands — "needs a hand" deficit chips (real data; honest empty states elsewhere). */
.league-needs-hand {
  border-color: rgba(85, 123, 95, 0.3);
  background: linear-gradient(180deg, rgba(237, 249, 245, 0.5), rgba(255, 250, 240, 0.92));
}
.need-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.need-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(85, 123, 95, 0.28);
  background: rgba(154, 199, 170, 0.18);
  color: var(--steel);
  font-size: 0.78rem;
  font-weight: 700;
}

.league-contribution-preview {
  display: grid;
  gap: 5px;
  min-height: 54px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--civic) 34%, var(--line));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--civic) 14%, var(--paper));
  color: var(--steel);
}

.league-contribution-preview strong {
  font-size: 0.84rem;
  font-weight: 950;
}

.league-contribution-preview > span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.league-contribution-preview.has-contribution {
  border-color: color-mix(in srgb, var(--civic) 58%, var(--line));
  background: color-mix(in srgb, var(--civic) 21%, var(--paper));
}
.league-identity-band h2 {
  margin: 2px 0 0;
}

/* Resource pill fullness bar. */
.resource-fill {
  grid-column: 2 / -1;
  align-self: center;
  height: 4px;
  margin-top: 2px;
  border-radius: 999px;
  background: rgba(37, 74, 92, 0.12);
  overflow: hidden;
}
.resource-fill > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--steel);
}
.resource-pill strong small {
  margin-left: 1px;
  color: var(--muted);
  font-size: 0.72em;
  font-weight: 600;
}

/* Town and Lines Dawnline journey guide. */
.town-reclaim-cta {
  border-color: rgba(168, 70, 63, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 246, 240, 0.9), rgba(255, 250, 240, 0.96));
}

.town-reclaim-cta .primary-action {
  width: 100%;
}

.journey-guide {
  display: grid;
  gap: 10px;
  border-color: rgba(85, 123, 95, 0.34);
  background:
    linear-gradient(180deg, rgba(237, 249, 245, 0.88), rgba(255, 250, 240, 0.96)),
    var(--panel);
}

.lines-journey-guide {
  border-color: rgba(201, 145, 69, 0.34);
}

.journey-guide.is-complete {
  border-color: rgba(85, 123, 95, 0.42);
}

.objective-blockers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.objective-blockers span {
  padding: 5px 8px;
  border: 1px solid rgba(168, 70, 63, 0.28);
  border-radius: 999px;
  background: rgba(255, 241, 237, 0.9);
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 900;
}

.recommended-dispatch {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(47, 158, 143, 0.34);
  border-radius: 8px;
  background: rgba(237, 249, 245, 0.84);
}

.recommended-dispatch > span:first-child,
.dispatch-guidance > span:first-child {
  color: var(--civic);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.recommended-dispatch strong,
.dispatch-guidance strong {
  color: var(--steel);
  font-size: 0.9rem;
}

.recommended-dispatch em,
.dispatch-guidance em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.dispatch-guidance {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(47, 158, 143, 0.36);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(237, 249, 245, 0.92), rgba(255, 250, 240, 0.9));
}

.journey-pay-line {
  margin: 0;
  color: var(--steel);
  font-size: 0.78rem;
  font-weight: 900;
}

.journey-progress {
  display: grid;
  gap: 7px;
}

.journey-step-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--journey-steps, 4), minmax(76px, 1fr));
  gap: 6px;
  padding: 2px 0;
  overflow-x: auto;
  isolation: isolate;
}

.journey-step-row::before,
.journey-step-row::after {
  position: absolute;
  left: 11%;
  top: 50%;
  z-index: 0;
  width: 78%;
  height: 2px;
  border-radius: 999px;
  background: rgba(37, 74, 92, 0.14);
  content: "";
  transform: translateY(-50%);
}

.journey-step-row::after {
  width: var(--journey-done, 0%);
  background: rgba(85, 123, 95, 0.55);
}

.journey-step {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 6px;
  border: 1px solid rgba(37, 74, 92, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.92);
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: left;
  overflow-wrap: anywhere;
}

.journey-step-glyph {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(37, 74, 92, 0.12);
  color: var(--steel);
  font-size: 0.62rem;
}

.journey-step-label {
  min-width: 0;
}

.journey-step.is-done {
  border-color: rgba(85, 123, 95, 0.42);
  background: rgba(154, 199, 170, 0.24);
  color: var(--civic);
}

.journey-step.is-done .journey-step-glyph {
  background: rgba(85, 123, 95, 0.18);
  color: var(--civic);
}

.journey-step.is-current {
  border: 2px solid rgba(201, 145, 69, 0.72);
  background: rgba(244, 199, 111, 0.32);
  color: var(--steel);
}

.journey-step.is-current .journey-step-glyph {
  background: rgba(201, 145, 69, 0.24);
  color: var(--steel);
}

.journey-step.is-upcoming {
  opacity: 0.62;
}

.journey-step.is-next {
  border-style: dashed;
}

.journey-action-row {
  flex-wrap: wrap;
  margin-top: 2px;
}

.journey-action-row .primary-action,
.journey-action-row .secondary-action {
  flex: 1 1 auto;
  width: 100%;
  min-height: 44px;
}

.journey-panel-echo {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(201, 145, 69, 0.34);
  border-radius: 8px;
  background: rgba(244, 199, 111, 0.18);
  color: var(--steel);
}

.journey-panel-echo > span:first-child {
  color: var(--brass-dark);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.journey-panel-copy {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.rail-repair-meter {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(85, 123, 95, 0.24);
  border-radius: 8px;
  background: rgba(237, 249, 245, 0.58);
}

.rail-repair-meter.is-complete {
  border-color: rgba(85, 123, 95, 0.46);
  background: rgba(154, 199, 170, 0.2);
}

.rail-repair-meter .quiet-copy {
  margin: 0;
}

.convoy-marker {
  position: absolute;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  min-height: 44px;
  margin: -25px 0 0 -25px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: 0 8px 14px rgba(33, 51, 60, 0.24);
}

.convoy-marker img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.convoy-marker.is-selected {
  box-shadow:
    0 0 0 4px rgba(244, 199, 111, 0.28),
    0 8px 14px rgba(33, 51, 60, 0.24);
}

.compact-contract-grid {
  grid-template-columns: 1fr;
}

.league-network-map {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  border: 1px solid rgba(37, 74, 92, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(circle at 72% 24%, rgba(244, 199, 111, 0.32), transparent 8rem),
    linear-gradient(180deg, #c6dde0, #eff6ef 62%, #f1dfbb);
  box-shadow: var(--shadow);
}


.league-network-links {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.league-link {
  fill: none;
  stroke: rgba(37, 74, 92, 0.45);
  stroke-linecap: round;
  stroke-width: 8;
}

.league-link.project-link {
  stroke: rgba(85, 123, 95, 0.62);
}

.league-link.warning-link {
  stroke: rgba(168, 70, 63, 0.54);
  stroke-dasharray: 18 12;
}

.league-node {
  position: absolute;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  width: 118px;
  min-height: 100px;
  margin: -50px 0 0 -59px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--steel);
  font-size: 0.76rem;
  font-weight: 950;
  text-align: center;
  box-shadow: none;
}

.league-node-art {
  display: block;
  width: 88px;
  height: 78px;
  filter: drop-shadow(0 9px 12px rgba(33, 51, 60, 0.24));
}

.league-node-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.league-node-label {
  display: block;
  max-width: 116px;
  padding: 3px 6px;
  border: 1px solid rgba(141, 100, 47, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.78);
  overflow: hidden;
  color: var(--ink);
  font-size: 0.62rem;
  line-height: 1.05;
  text-align: center;
  overflow-wrap: anywhere;
}

.league-node.is-selected {
  border-color: rgba(201, 145, 69, 0.68);
  box-shadow:
    0 0 0 4px rgba(244, 199, 111, 0.22),
    0 9px 18px rgba(33, 51, 60, 0.14);
}

.league-node.is-under_threat,
.league-node-detail.under-threat {
  border-color: rgba(168, 70, 63, 0.38);
}

.league-project-fill {
  position: absolute;
  left: 76%;
  top: 34%;
  z-index: 1;
  width: 118px;
  height: 12px;
  border: 1px solid rgba(85, 123, 95, 0.42);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(85, 123, 95, 0.52) calc(var(--project-progress, 0) * 100%), rgba(255, 250, 240, 0.1) 0),
    linear-gradient(180deg, rgba(255, 250, 240, 0.62), rgba(207, 231, 232, 0.18));
  box-shadow: 0 5px 10px rgba(33, 51, 60, 0.12);
  transform: translate(-50%, -50%) rotate(-7deg);
  pointer-events: none;
}

.league-network-links .league-link {
  stroke-dasharray: 22 14;
}

.identity-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.identity-summary > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(141, 100, 47, 0.16);
  border-radius: 8px;
  background: rgba(237, 249, 245, 0.48);
}

.identity-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.identity-summary strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--steel);
  font-size: 0.9rem;
}

.identity-form {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(141, 100, 47, 0.16);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.audio-toggle {
  display: inline-grid;
  width: 44px;
  height: 44px;
  min-width: 44px;
  place-items: center;
  border: 1px solid rgba(141, 100, 47, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(237, 249, 245, 0.92), rgba(203, 225, 217, 0.82)),
    var(--ceramic);
  color: var(--steel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 8px 18px rgba(23, 56, 68, 0.14);
}

.audio-toggle:focus-visible {
  outline: 3px solid rgba(58, 172, 178, 0.42);
  outline-offset: 2px;
}

.audio-svg {
  width: 24px;
  height: 24px;
}

.audio-settings-panel {
  gap: 14px;
}

.compact-action {
  width: auto;
  min-width: 92px;
  padding: 9px 12px;
}

.audio-slider-grid {
  display: grid;
  gap: 10px;
}

.audio-slider-row {
  display: grid;
  grid-template-columns: minmax(78px, 0.7fr) minmax(116px, 1.6fr) 48px;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid rgba(37, 74, 92, 0.14);
  border-radius: 8px;
  background: rgba(237, 249, 245, 0.5);
}

.audio-slider-row span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.audio-slider-row strong {
  color: var(--steel);
  font-size: 0.82rem;
  text-align: right;
}

.audio-slider-row input[type="range"] {
  width: 100%;
  min-width: 0;
  accent-color: var(--glass);
}


/* Existing asset integration for playable screens. */
.view-surface--town,
.view-surface--lines,
.view-surface--league,
.view-surface--company {
  position: relative;
}

/* Static-art screens use the host .scene-fallback-img as the single image backdrop. These
   neutral scene backgrounds only show if that image fails to load. */

.station-diorama--v2 {
  background: linear-gradient(180deg, #a8d3d8 0%, #e4f1ea 58%, #f0dcae 100%);
}

.skyrail-map--v2 {
  background: linear-gradient(180deg, #b7d7dc, #edf4ec 60%, #f1dfbb);
}

.league-network-map--v2 {
  background: linear-gradient(180deg, #c6dde0, #eff6ef 62%, #f1dfbb);
}

.skyrail-v2-fallback {
  display: block;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.scene-fallback-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.skyrail-v2-fallback::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(33, 51, 60, 0.02), rgba(33, 51, 60, 0.16));
  content: "";
}

.scene-fallback-caption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  max-width: min(74%, 320px);
  padding: 7px 9px;
  border: 1px solid rgba(255, 250, 240, 0.58);
  border-radius: 8px;
  background: rgba(33, 51, 60, 0.72);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(33, 51, 60, 0.2);
}

.skyrail-v2-host.is-static-art .scene-fallback-caption,
.skyrail-v2-host.is-static-art .skyrail-v2-static-base {
  display: none;
}

.route-detail-panel > .route-thumbnail {
  height: clamp(126px, 28vw, 178px);
  margin: 0 0 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.36);
}

.rail-link-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 94px;
  margin: 10px 0;
  overflow: hidden;
  border: 1px solid rgba(37, 74, 92, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(207, 231, 232, 0.56), rgba(255, 248, 233, 0.78)),
    url("/assets/art/routes/rail-bridge.webp") center / cover no-repeat;
}

.rail-link-visual img {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(33, 51, 60, 0.2));
}

.rail-link-visual__span {
  position: relative;
  z-index: 1;
  width: min(92%, 420px);
  max-height: 94px;
}

.rail-link-visual__prop {
  position: absolute;
  left: 50%;
  bottom: 6px;
  z-index: 2;
  width: clamp(58px, 18vw, 92px);
  height: clamp(58px, 18vw, 92px);
  transform: translateX(-50%);
  pointer-events: none;
}

.rail-link-visual span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  padding: 4px 7px;
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.84);
  color: var(--steel);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.rail-link-visual--damaged,
.rail-link-visual--under_repair {
  background:
    linear-gradient(180deg, rgba(216, 144, 81, 0.24), rgba(255, 248, 233, 0.78)),
    url("/assets/art/routes/rail-damaged.webp") center / cover no-repeat;
}

.league-node-art--v2 {
  width: 78px;
  height: 66px;
  border: 0;
  background: transparent;
}

.league-node-art--v2 img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 9px 12px rgba(33, 51, 60, 0.24));
}

.league-node--project .league-node-art--v2 {
  width: 92px;
  height: 74px;
}

.league-hero {
  background:
    linear-gradient(90deg, rgba(255, 250, 240, 0.9) 0 52%, rgba(255, 250, 240, 0.7)),
    url("/assets/art/league/league-project-glow.webp") right center / contain no-repeat,
    var(--panel);
}

.scene-floating-label,
.diorama-slot--v2 .v2-slot-label,
.map-node .node-label,
.map-node .node-stability,
.league-node-label {
  display: none;
}

.map-node,
.league-node,
.diorama-slot--v2 {
  user-select: none;
}

@media (max-width: 699px) {
  .topbar {
    padding: max(8px, env(safe-area-inset-top)) 10px 8px;
  }

  .brand-row {
    gap: 8px;
  }

  .brand-row h1 {
    font-size: 1.05rem;
  }

  .eyebrow {
    margin-bottom: 1px;
    font-size: 0.64rem;
  }

  .station-name {
    margin-top: 1px;
    font-size: 0.7rem;
  }

  .resource-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
  }

  .resource-pill {
    grid-template-columns: 28px minmax(0, 1fr);
    grid-template-rows: 11px 16px 10px 3px;
    gap: 1px 6px;
    align-content: center;
    min-height: 58px;
    padding: 6px;
  }

  .resource-mark {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .resource-icon {
    width: 22px;
    height: 22px;
  }

  .resource-name,
  .resource-pill strong,
  .resource-rate,
  .resource-fill {
    grid-column: 2;
    min-width: 0;
  }

  .resource-pill .resource-name {
    grid-row: 1;
    overflow: hidden;
    font-size: 0.6rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .resource-pill strong {
    grid-row: 2;
    align-self: center;
    overflow: hidden;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .resource-pill strong small {
    font-size: 0.58em;
  }

  .resource-pill .resource-rate {
    grid-row: 3;
    align-self: center;
    padding-top: 0;
    overflow: hidden;
    border-top: 0;
    font-size: 0.58rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .resource-fill {
    grid-row: 4;
    align-self: stretch;
    height: 3px;
    margin-top: 0;
  }
}

@media (min-width: 700px) {
  .app-shell {
    padding-bottom: 0;
    padding-left: 96px;
  }

  .topbar {
    padding: 18px 24px;
  }

  .brand-row h1 {
    font-size: 1.42rem;
  }

  .resource-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .resource-pill {
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-rows: 12px 19px 10px 4px;
    gap: 1px 8px;
    align-content: center;
  }

  .resource-pill .resource-mark {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: center;
    width: 34px;
    height: 34px;
  }

  .resource-pill .resource-name,
  .resource-pill strong,
  .resource-pill .resource-rate,
  .resource-pill .resource-fill {
    grid-column: 2;
    min-width: 0;
  }

  .resource-pill .resource-name {
    grid-row: 1;
    overflow: hidden;
    font-size: 0.66rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .resource-pill strong {
    grid-row: 2;
    justify-self: start;
    align-self: center;
    overflow: hidden;
    font-size: 0.86rem;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .resource-pill .resource-rate {
    grid-row: 3;
    align-self: center;
    padding-top: 0;
    overflow: hidden;
    border-top: 0;
    font-size: 0.58rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .resource-pill .resource-fill {
    grid-row: 4;
    align-self: stretch;
    height: 4px;
    margin-top: 0;
  }

  .main-surface {
    padding: 22px;
  }

  .tabbar {
    top: 0;
    right: auto;
    width: 86px;
    grid-template-columns: 1fr;
    align-content: start;
    padding: 16px 8px;
    border-top: 0;
    border-right: 1px solid rgba(37, 74, 92, 0.16);
  }

  .tab-button {
    min-height: 66px;
  }

  .station-diorama {
    min-height: 430px;
  }

  .building-grid,
  .route-list,
  .contract-grid,
  .hero-grid,
  .crew-grid,
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid,
  .number-grid,
  .dispatch-preview,
  .reputation-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .economy-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lines-context-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .combat-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  }

  .combat-squad-rail,
  .combat-orders,
  .combat-result-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .identity-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .slot-large {
    width: 128px;
  }

  .slot-medium {
    width: 104px;
  }

  .slot-small {
    width: 80px;
  }

  .slot-tall {
    width: 92px;
  }
}

@media (min-width: 1040px) {
  .building-grid,
  .route-list,
  .contract-grid,
  .hero-grid,
  .crew-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .station-diorama {
    min-height: 500px;
  }
}

@media (max-width: 420px) {
  .resource-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .resource-pill {
    min-height: 58px;
  }

  .station-diorama {
    min-height: 350px;
  }

  .skyrail-map--v2,
  .league-network-map--v2 {
    aspect-ratio: auto;
    height: min(72vh, 390px);
    min-height: 300px;
  }

  .diorama-slot {
    transform: translate(-50%, -50%) scale(0.86);
  }

  .map-node {
    width: 76px;
    margin-left: -38px;
  }

  .map-node-art {
    width: 76px;
    height: 52px;
  }

  .node-label {
    max-width: 76px;
  }

  .train-strip {
    grid-template-columns: 1fr;
  }

  .hero-card {
    grid-template-columns: 84px 1fr;
  }

  .hero-portrait,
  .hero-image {
    width: 80px;
  }

  .hero-image {
    height: 94px;
  }

  .crew-card {
    padding-left: 72px;
  }

  .crew-card-icon,
  .crew-badge-img {
    width: 48px;
    height: 48px;
  }

  .league-node {
    width: 96px;
    min-height: 86px;
    margin: -43px 0 0 -48px;
    grid-template-columns: 1fr;
    font-size: 0.7rem;
  }

  .league-node-art {
    width: 70px;
    height: 62px;
  }

  .league-node-label {
    max-width: 94px;
    font-size: 0.56rem;
  }

  .expansion-card {
    grid-template-columns: 1fr;
  }

  .expansion-card .primary-action,
  .expansion-status {
    width: 100%;
  }
}

/* Desktop Lines: persistent detail panel beside the map (layout-only — reuses the existing
   rail-link panel, access-list, and dim-others). Column ratio / breakpoint / sticky travel to be
   tuned in-browser. Sits after the 700px/1040px blocks so it wins at wide widths. */
@media (min-width: 1080px) {
  .view-surface--lines {
    grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.9fr);
    align-items: start;
    gap: 16px;
  }
  .view-surface--lines > .skyrail-map {
    grid-column: 1;
    grid-row: 2;
  }
  .view-surface--lines > .lines-context-grid {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr);
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow: auto;
  }
  .view-surface--lines > .section-band,
  .view-surface--lines > .lines-contracts,
  .view-surface--lines > .route-list {
    grid-column: 1 / -1;
  }
}

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

  .route-selection-glow,
  .route-hazard,
  .route-contract-marker,
  .rail-link-art,
  .league-project-fill {
    transform: translate(-50%, -50%) !important;
  }

  .town-expansion-layer,
  .construction-overlay,
  .skyrail-v2-host canvas,
  .skyrail-v2-canvas,
  .skyrail-train--scene.is-moving {
    animation: none !important;
  }
}
/* Clarity feedback: objective cards route the player toward the next action. */
.current-objective[data-objective-click-target="true"] {
  cursor: pointer;
}

.current-objective[data-objective-click-target="true"]:hover,
.current-objective[data-objective-click-target="true"]:focus-within {
  border-color: rgba(47, 158, 143, 0.48);
  box-shadow:
    inset 0 0 0 2px rgba(47, 158, 143, 0.12),
    0 14px 30px rgba(33, 51, 60, 0.1);
}

/* Dramatic but calm town expansion state: visible land claims over the static town painting. */
.town-expansion-plate-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.town-expansion-plate {
  position: absolute;
  z-index: calc(3 + var(--expansion-layer, 1));
  display: grid;
  place-items: center;
  width: clamp(118px, 16vw, 172px);
  min-height: 82px;
  color: var(--steel);
  text-align: center;
  transform: translate(-50%, -50%);
}

.town-expansion-ring {
  position: absolute;
  inset: 3px 6px;
  border: 2px dashed rgba(141, 100, 47, 0.64);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255, 250, 240, 0.5), rgba(244, 199, 111, 0.22) 46%, transparent 68%);
  box-shadow: 0 10px 24px rgba(33, 51, 60, 0.12);
}

.town-expansion-plate.is-revealed .town-expansion-ring,
.town-expansion-plate.is-complete .town-expansion-ring {
  border-style: solid;
  border-color: rgba(47, 158, 143, 0.76);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(237, 249, 245, 0.86), rgba(47, 158, 143, 0.22) 48%, rgba(244, 199, 111, 0.16) 68%, transparent 76%);
  box-shadow:
    0 0 0 5px rgba(255, 250, 240, 0.58),
    0 16px 30px rgba(33, 51, 60, 0.16);
}

.town-expansion-plate.is-complete .town-expansion-ring {
  border-color: rgba(85, 123, 95, 0.82);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(237, 249, 245, 0.94), rgba(85, 123, 95, 0.28) 52%, rgba(244, 199, 111, 0.16) 70%, transparent 78%);
}

.town-expansion-plate.is-recent-reveal .town-expansion-ring,
.town-expansion-plate.is-recent-complete .town-expansion-ring {
  box-shadow:
    0 0 0 6px rgba(255, 250, 240, 0.72),
    0 0 0 12px rgba(244, 199, 111, 0.24),
    0 18px 34px rgba(33, 51, 60, 0.2);
}

.town-expansion-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  max-width: 132px;
  padding: 6px 8px;
  border: 1px solid rgba(37, 74, 92, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.88);
  box-shadow: 0 8px 16px rgba(33, 51, 60, 0.12);
}

.town-expansion-copy strong {
  color: var(--steel);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1.05;
}

.town-expansion-copy em {
  color: var(--muted);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

/* Town building-map feedback: show actual building art, construction state, and completion payoff. */
.diorama-slot--v2 {
  min-height: 116px;
}

.diorama-slot--v2 .v2-slot-art {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: end center;
  width: 76px;
  height: 76px;
  margin-top: -2px;
  pointer-events: none;
  filter: drop-shadow(0 10px 13px rgba(33, 51, 60, 0.26));
}

.diorama-slot--v2 .v2-slot-art .building-sprite {
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0.96;
  transform: none;
}

.diorama-slot--v2 .v2-slot-art .building-sprite-img {
  object-fit: contain;
}

.diorama-slot--v2.is-available .v2-slot-art .building-sprite {
  opacity: 0.72;
  filter: saturate(0.78) contrast(0.92);
}

.diorama-slot--v2.is-under_construction .v2-slot-art .building-sprite,
.diorama-slot--v2.is-upgrading .v2-slot-art .building-sprite {
  opacity: 0.84;
  filter: sepia(0.16) saturate(0.9);
}

.diorama-slot--v2.is-complete .v2-slot-art .building-sprite {
  opacity: 1;
  filter: saturate(1.08) contrast(1.03);
}

.diorama-slot--v2.is-recent-complete .v2-slot-art {
  border-radius: 999px;
  box-shadow:
    0 0 0 6px rgba(237, 249, 245, 0.46),
    0 0 0 12px rgba(244, 199, 111, 0.18),
    0 14px 24px rgba(33, 51, 60, 0.18);
}

.diorama-slot--v2 .v2-slot-label {
  position: relative;
  z-index: 4;
}

.diorama-slot--v2 .construction-overlay--v2 {
  z-index: 5;
}

.construction-state-label,
.complete-state-label {
  position: relative;
  z-index: 2;
  color: var(--steel);
  font-size: 0.58rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.diorama-slot--v2 .construction-state-label {
  position: absolute;
  left: 50%;
  top: -18px;
  padding: 3px 6px;
  border: 1px solid rgba(141, 100, 47, 0.3);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.9);
  transform: translateX(-50%);
}

.complete-hook {
  top: 36px;
  right: 8px;
  bottom: auto;
  left: 8px;
  display: grid;
  min-height: 28px;
  place-items: center;
  border: 1px solid rgba(85, 123, 95, 0.42);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(237, 249, 245, 0.94), rgba(154, 199, 170, 0.72));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 8px 14px rgba(33, 51, 60, 0.16);
}

.complete-hook::before {
  position: absolute;
  left: 8px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(47, 158, 143, 0.92);
  content: "";
}

.training-status-list {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.training-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid rgba(47, 158, 143, 0.28);
  border-radius: 8px;
  background: rgba(237, 249, 245, 0.78);
}

.training-status-row span {
  color: var(--civic);
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.training-status-row strong {
  color: var(--steel);
  font-size: 0.82rem;
}

.training-status-row em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 850;
}

/* Journey guide density and stepper refinements. */
.journey-guide {
  gap: var(--space-3);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--elev-raised);
}

.lines-journey-guide {
  border-color: color-mix(in srgb, var(--brass) 38%, var(--line));
}

.journey-guide-heading {
  align-items: start;
}

.journey-guide .quiet-copy {
  margin: 0;
}

.journey-guide.is-compact .journey-progress,
.journey-guide.is-compact .journey-reward-row {
  display: none;
}

.journey-guide.is-complete {
  padding: var(--space-3);
  border-color: color-mix(in srgb, var(--civic) 42%, var(--line));
}

.journey-complete-band {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: space-between;
}

.journey-complete-copy {
  min-width: 0;
}

.journey-complete-copy h2 {
  margin: 0;
  font-size: clamp(0.92rem, 1vw, 1.08rem);
  line-height: 1.2;
}

.journey-guide.is-complete .signal-chip,
.journey-complete-band .primary-action {
  flex: 0 0 auto;
}

.journey-complete-band .primary-action {
  width: auto;
  min-height: 44px;
  padding-inline: var(--space-3);
}

.journey-step-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--journey-steps, 4), minmax(76px, 1fr));
  gap: var(--space-2);
  padding: var(--space-1) 0;
  overflow-x: auto;
  isolation: isolate;
}

.journey-step-row::before,
.journey-step-row::after {
  position: absolute;
  left: 11%;
  top: 20px;
  z-index: 0;
  width: 78%;
  height: 3px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--line) 82%, var(--panel));
  content: "";
}

.journey-step-row::after {
  width: var(--journey-done, 0%);
  background: var(--civic);
}

.journey-step {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 44px;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: var(--space-1);
  padding: 6px var(--space-1);
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--panel));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--paper) 72%, var(--panel));
  color: var(--ink);
  box-shadow: none;
}

.journey-step-glyph {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--line) 70%, var(--panel));
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0;
}

.journey-step-label {
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.journey-step.is-done {
  background: color-mix(in srgb, var(--civic) 16%, var(--panel));
  border-color: color-mix(in srgb, var(--civic) 42%, var(--line));
}

.journey-step.is-done .journey-step-glyph {
  background: var(--civic);
  color: var(--paper);
}

.journey-step.is-current {
  border: 2px solid var(--brass);
  background: color-mix(in srgb, var(--brass) 18%, var(--panel));
  box-shadow: var(--elev-flat);
}

.journey-step.is-current .journey-step-glyph {
  background: var(--brass);
  color: var(--ink);
}

.journey-step.is-upcoming {
  opacity: 0.62;
}

.journey-step.is-next {
  opacity: 1;
  border: 2px dashed var(--brass);
  background: color-mix(in srgb, var(--brass) 12%, var(--panel));
}

.journey-reward-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.journey-reward-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 30px;
  padding: 0 var(--space-2);
  border: 1px solid color-mix(in srgb, var(--civic) 36%, var(--line));
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--civic) 16%, var(--panel));
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
}

.journey-action-row {
  margin-top: 0;
}

.journey-action-row .primary-action {
  width: 100%;
  min-height: 46px;
  background: var(--ink);
  color: var(--paper);
}

.journey-panel-echo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid color-mix(in srgb, var(--brass) 42%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brass) 18%, var(--panel));
  color: var(--ink);
}

.journey-panel-echo > span:first-child {
  color: var(--brass-dark);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.journey-panel-echo strong {
  font-size: 0.8rem;
}

.journey-contract-chip {
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--brass) 22%, var(--panel));
  white-space: nowrap;
}

/* Town map declutter: state should read as a transient cue, not permanent signage. */
.town-expansion-plate {
  width: clamp(62px, 9vw, 112px);
  min-height: clamp(38px, 6vw, 64px);
  opacity: 0.42;
}

.town-expansion-plate.is-recent-reveal,
.town-expansion-plate.is-recent-complete {
  opacity: 0.9;
}

.town-expansion-ring {
  inset: 10px 14px;
  border-width: 1px;
  border-color: color-mix(in srgb, var(--brass) 48%, transparent);
  background: color-mix(in srgb, var(--brass) 9%, transparent);
  box-shadow: none;
}

.town-expansion-plate.is-revealed .town-expansion-ring,
.town-expansion-plate.is-complete .town-expansion-ring {
  border-color: color-mix(in srgb, var(--civic) 52%, transparent);
  background: color-mix(in srgb, var(--civic) 10%, transparent);
  box-shadow: none;
}

.town-expansion-plate.is-recent-reveal .town-expansion-ring,
.town-expansion-plate.is-recent-complete .town-expansion-ring {
  border-width: 2px;
  background: color-mix(in srgb, var(--brass) 16%, transparent);
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--paper) 42%, transparent),
    0 10px 18px color-mix(in srgb, var(--ink) 14%, transparent);
}

.town-expansion-copy {
  display: none;
}

.diorama-slot--v2.is-complete:not(.is-recent-complete) .v2-slot-art {
  opacity: 0.96;
  filter: drop-shadow(0 8px 11px color-mix(in srgb, var(--ink) 20%, transparent));
}

.diorama-slot--v2.is-complete:not(.is-recent-complete):hover .v2-slot-art,
.diorama-slot--v2.is-complete:not(.is-recent-complete):focus-visible .v2-slot-art,
.diorama-slot--v2.is-complete:not(.is-recent-complete).is-selected .v2-slot-art {
  opacity: 1;
  filter: drop-shadow(0 10px 13px color-mix(in srgb, var(--ink) 24%, transparent));
}

.complete-hook {
  top: 24px;
  right: 18px;
  bottom: 18px;
  left: 18px;
  min-height: 0;
  border: 2px solid color-mix(in srgb, var(--civic) 62%, var(--paper));
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--civic) 18%, transparent), transparent 68%);
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--paper) 46%, transparent),
    0 12px 22px color-mix(in srgb, var(--ink) 16%, transparent);
}

.complete-hook::before,
.complete-state-label {
  display: none;
}

/* Plain Town foundation base: the live build surface should not be a prebuilt city painting. */
.skyrail-v2-host--town.is-static-art .skyrail-v2-static-base {
  display: block;
}

.skyrail-v2-host--town.is-static-art .skyrail-v2-fallback--town {
  display: none;
}

.skyrail-v2-static-base--town {
  background:
    radial-gradient(ellipse at 12% 18%, color-mix(in srgb, var(--cloud) 72%, transparent) 0 8%, transparent 9%),
    radial-gradient(ellipse at 88% 22%, color-mix(in srgb, var(--cloud) 58%, transparent) 0 10%, transparent 11%),
    linear-gradient(180deg, var(--glass-deep) 0%, var(--cloud) 56%, var(--panel-strong) 100%);
}

.static-town-island {
  bottom: 3%;
  z-index: 1;
  width: min(88%, 1080px);
  height: 62%;
  border-radius: 52% 48% 38% 39%;
  background:
    radial-gradient(ellipse at 46% 28%, color-mix(in srgb, var(--paper) 62%, transparent) 0 18%, transparent 19%),
    linear-gradient(180deg, color-mix(in srgb, var(--growth) 78%, var(--paper)) 0 38%, var(--moss) 39% 58%, color-mix(in srgb, var(--ink) 44%, var(--moss)) 59% 100%);
  box-shadow:
    inset 0 10px 0 color-mix(in srgb, var(--paper) 58%, transparent),
    0 28px 44px color-mix(in srgb, var(--ink) 18%, transparent);
}

.static-town-island::before {
  position: absolute;
  inset: 14% 10% 34%;
  border: 1px solid color-mix(in srgb, var(--brass) 24%, transparent);
  border-radius: 48% 52% 42% 44%;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--rail) 24%, transparent) 1px, transparent 1px) 0 0 / 74px 100%,
    linear-gradient(0deg, color-mix(in srgb, var(--rail) 16%, transparent) 1px, transparent 1px) 0 0 / 100% 48px,
    color-mix(in srgb, var(--paper) 46%, transparent);
  content: "";
}

.static-town-island::after {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 17%;
  height: 16%;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  content: "";
}

.static-town-rail {
  z-index: 2;
  bottom: 40%;
  width: min(76%, 920px);
  height: 19%;
  border-top: 6px solid color-mix(in srgb, var(--brass) 74%, var(--rail));
  border-bottom: 3px solid color-mix(in srgb, var(--ink) 72%, var(--rail));
  opacity: 0.82;
}

.static-town-rail--upper {
  transform: translateX(-50%) rotate(-4deg);
}

.static-town-rail--lower {
  bottom: 31%;
  width: min(70%, 840px);
  transform: translateX(-50%) rotate(6deg);
  opacity: 0.66;
}

.static-town-foundation-grid {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.town-foundation-pad {
  position: absolute;
  z-index: calc(3 + var(--pad-layer, 1));
  width: 76px;
  height: 48px;
  border: 1px solid color-mix(in srgb, var(--rail) 38%, transparent);
  border-radius: 48% 52% 44% 46%;
  background:
    radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--paper) 64%, transparent) 0 45%, transparent 46%),
    color-mix(in srgb, var(--ceramic) 70%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--paper) 70%, transparent),
    0 9px 14px color-mix(in srgb, var(--ink) 14%, transparent);
  transform: translate(-50%, -50%) rotate(-4deg);
}

.town-foundation-pad--large {
  width: 128px;
  height: 76px;
}

.town-foundation-pad--medium {
  width: 104px;
  height: 62px;
}

.town-foundation-pad--small {
  width: 78px;
  height: 48px;
}

.town-foundation-pad--tall {
  width: 68px;
  height: 74px;
}

.town-foundation-pad.is-available,
.town-foundation-pad.is-revealed {
  border-style: dashed;
  background:
    radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--brass) 12%, transparent) 0 44%, transparent 45%),
    color-mix(in srgb, var(--paper) 42%, transparent);
}

.town-foundation-pad.is-under_construction,
.town-foundation-pad.is-upgrading {
  border-color: color-mix(in srgb, var(--brass) 72%, var(--line));
  background: color-mix(in srgb, var(--brass) 22%, var(--paper));
}

.town-foundation-pad.is-complete {
  border-color: color-mix(in srgb, var(--civic) 46%, var(--line));
  background: color-mix(in srgb, var(--civic) 14%, var(--paper));
}

.town-loading-art-candidate {
  pointer-events: none;
}
/* Extracted Town base materials: modular substrate under live building sprites. */
.town-base-material-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.town-base-material {
  position: absolute;
  z-index: calc(2 + var(--base-layer, 1));
  display: block;
  max-width: none;
  height: auto;
  object-fit: contain;
  opacity: 0.96;
  filter: drop-shadow(0 16px 22px color-mix(in srgb, var(--ink) 16%, transparent));
  transform: translate(-50%, -50%) rotate(var(--base-rotate, 0deg));
  transform-origin: center;
  user-select: none;
}

.static-town-island {
  z-index: 0;
  opacity: 0.42;
}

.static-town-island::before,
.static-town-island::after,
.static-town-rail {
  display: none;
}

.static-town-foundation-grid {
  z-index: 5;
  pointer-events: none;
}

.town-foundation-pad {
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.town-foundation-pad.is-available,
.town-foundation-pad.is-revealed,
.town-foundation-pad.is-under_construction,
.town-foundation-pad.is-upgrading,
.town-foundation-pad.is-complete {
  background: transparent;
}

.town-foundation-pad-img {
  position: absolute;
  inset: -88% -112%;
  display: block;
  width: 324%;
  height: 276%;
  max-width: none;
  object-fit: contain;
  opacity: 0.78;
  filter: drop-shadow(0 8px 11px color-mix(in srgb, var(--ink) 14%, transparent));
  transform: rotate(4deg);
  transform-origin: center;
  user-select: none;
}

.town-foundation-pad.is-under_construction .town-foundation-pad-img,
.town-foundation-pad.is-upgrading .town-foundation-pad-img {
  opacity: 0.94;
  filter: drop-shadow(0 10px 13px color-mix(in srgb, var(--brass) 24%, transparent));
}

.town-foundation-pad.is-complete .town-foundation-pad-img {
  opacity: 0.58;
}

.town-foundation-pad--large .town-foundation-pad-img {
  inset: -72% -82%;
  width: 264%;
  height: 236%;
}

.town-foundation-pad--tall .town-foundation-pad-img {
  inset: -78% -126%;
  width: 352%;
  height: 256%;
}

/* Live Three.js Town scene: the renderer draws every building itself, so the DOM
   slot layer must not paint a second flat sprite over the top of it. The buttons
   stay in place as pointer and keyboard hit targets, and their labels stay
   legible, but their artwork and the CSS foundation substrate are suppressed. */
.station-diorama.has-live-scene .diorama-slot--v2 .v2-slot-art,
.station-diorama.has-live-scene .static-town-foundation-grid,
.station-diorama.has-live-scene .town-base-material-layer,
.station-diorama.has-live-scene .static-town-island {
  display: none;
}

.station-diorama.has-live-scene .diorama-slot--v2 .v2-slot-label {
  font-size: 12px;
}
