/* Seek the Deep: one visual system for phone first, then wide screens.
   Layout: single column with a bottom tab bar; side rail and two columns on wide screens.
   One dark "next step" block per screen is the loudest thing; gold marks the one action to take. */
:root {
  --bg: #e6ece9;
  --surface: #fbfcfb;
  --surface-2: #edf2ef;
  --surface-3: #dbe5e0;
  --line: #c6d2cc;
  --line-strong: #84999a;
  --ink: #12232b;
  --ink-2: #3d535d;
  --action: #f0bd4f;
  --action-hover: #f5ca68;
  --on-action: #1d1a0d;
  --action-edge: #a8760d;
  --link: #0a6173;
  --focus: #0a7fa0;
  --good: #17703f;
  --good-bg: #d9eee1;
  --warn: #7a5000;
  --warn-bg: #f9ebc4;
  --bad: #a3301c;
  --bad-bg: #f9e1da;
  --info: #17587a;
  --info-bg: #d9eaf4;
  --note: #5a4688;
  --note-bg: #e9e2f4;
  --disabled-bg: #dae3df;
  --disabled-fg: #586c75;
  --chrome: #14272e;
  --on-chrome: #ecf2ef;
  --on-chrome-2: #a9bcb6;
  --scrim: rgba(8, 20, 26, .62);
  --gl: max(16px, env(safe-area-inset-left, 0px));
  --gr: max(16px, env(safe-area-inset-right, 0px));
  --r: 4px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d171b;
    --surface: #15242b;
    --surface-2: #1b2e36;
    --surface-3: #253942;
    --line: #2c424b;
    --line-strong: #587079;
    --ink: #e9f0ed;
    --ink-2: #b2c3be;
    --action: #f0bd4f;
    --action-hover: #f6cb6b;
    --on-action: #1d1a0d;
    --action-edge: #8d640c;
    --link: #6fd0e3;
    --focus: #6fd0e3;
    --good: #72d69d;
    --good-bg: #17352a;
    --warn: #f0c35f;
    --warn-bg: #382d11;
    --bad: #ff9f88;
    --bad-bg: #3b1f1a;
    --info: #85c9ea;
    --info-bg: #12313f;
    --note: #c3b3f0;
    --note-bg: #2b2442;
    --disabled-bg: #24373f;
    --disabled-fg: #95aaa4;
    --chrome: #081115;
    --on-chrome: #ecf2ef;
    --on-chrome-2: #9db1ab;
    --scrim: rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d171b;
  --surface: #15242b;
  --surface-2: #1b2e36;
  --surface-3: #253942;
  --line: #2c424b;
  --line-strong: #587079;
  --ink: #e9f0ed;
  --ink-2: #b2c3be;
  --action: #f0bd4f;
  --action-hover: #f6cb6b;
  --on-action: #1d1a0d;
  --action-edge: #8d640c;
  --link: #6fd0e3;
  --focus: #6fd0e3;
  --good: #72d69d;
  --good-bg: #17352a;
  --warn: #f0c35f;
  --warn-bg: #382d11;
  --bad: #ff9f88;
  --bad-bg: #3b1f1a;
  --info: #85c9ea;
  --info-bg: #12313f;
  --note: #c3b3f0;
  --note-bg: #2b2442;
  --disabled-bg: #24373f;
  --disabled-fg: #95aaa4;
  --chrome: #081115;
  --on-chrome: #ecf2ef;
  --on-chrome-2: #9db1ab;
  --scrim: rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-width: 320px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding-block: 0;
  padding-left: var(--gl);
  padding-right: var(--gr);
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; border-radius: var(--r); }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
a { color: var(--link); text-underline-offset: 3px; }
svg { vertical-align: middle; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
h4 { font-size: 16px; font-weight: 700; }
p + p { margin-top: 8px; }
.hidden, [hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Text roles */
.label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.muted, .help-text, .subtle { color: var(--ink-2); font-size: 14px; }
.help-text { margin-top: 8px; line-height: 1.45; }
.fine-print { color: var(--ink-2); font-size: 13px; margin-top: 12px; }
.error-text { color: var(--bad); font-size: 14px; font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

/* App frame */
.app { max-width: 720px; margin: 0 auto; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); min-height: 100svh; }
.loading { padding: 40px 0; color: var(--ink-2); }

/* Header: tag, two utility buttons, company, cash, clock */
.top { padding: 4px 0 12px; }
.top-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 8px; min-height: 44px; }
.tag { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.tag b { color: var(--ink); font-weight: 800; }
.top-actions { display: flex; gap: 2px; margin-right: -8px; margin-left: auto; }
.link-btn { min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: var(--link); font-size: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; position: relative; }
.link-btn[data-alert]::after { content: ""; position: absolute; top: 9px; right: 3px; width: 10px; height: 10px; background: var(--bad); border: 2px solid var(--bg); border-radius: 50%; }
.company { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.company-name { display: flex; align-items: center; min-width: 0; flex: 1; }
.company-name h1 { font-size: 22px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; letter-spacing: -.02em; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; background: transparent; color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }
.company-name .icon-btn { margin-left: -4px; }
.cash { text-align: right; flex: none; }
.cash .label { display: block; line-height: 1.1; }
.cash strong { display: block; font-size: 24px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.clock-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.clock-line > span { white-space: nowrap; }
.save-status { font-weight: 600; }
.save-status.error-text { font-weight: 700; }

/* Stock strip */
.stock-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 6px 0 7px; border-top: 1px solid var(--line); }
.stock { position: relative; display: flex; flex-direction: column; gap: 1px; min-width: 0; min-height: 46px; padding: 4px 6px 7px; text-align: left; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); color: var(--ink); overflow: hidden; }
.stock:hover { border-color: var(--line-strong); }
.stock-name { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; line-height: 1.2; color: var(--ink-2); white-space: nowrap; }
.swatch { width: 9px; height: 9px; flex: none; background: var(--product, var(--line-strong)); border: 1px solid rgba(0, 0, 0, .35); }
.stock-value { display: block; font-size: 17px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; color: var(--ink); }
.stock-cap { display: none; font-size: 12px; color: var(--ink-2); line-height: 1.2; white-space: nowrap; }
.stock-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--surface-3); overflow: hidden; }
.stock-bar > i { display: block; height: 100%; width: 0; background: var(--product, var(--ink-2)); }
.stock.is-full { border-color: var(--warn); }
.stock.is-full .stock-cap { color: var(--warn); font-weight: 700; }
.stock.no-tank { border-style: dashed; background: transparent; }
.stock.no-tank .stock-value { color: var(--ink-2); }

/* Screens */
.screen { animation: reveal .16s ease-out; }
@keyframes reveal { from { opacity: .6; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 12px; }
.screen-head p { font-size: 14px; color: var(--ink-2); }
.stack { display: grid; gap: 14px; }
.stack-lg { display: grid; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { min-width: 0; }
.panel { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.panel + .panel { margin-top: 14px; }
.side-stack { display: grid; gap: 14px; min-width: 0; }

/* The single most important block of a screen */
.next { padding: 18px 16px 16px; border-radius: var(--r); background: var(--chrome); color: var(--on-chrome); border: 1px solid var(--line-strong); }
.next .label { color: var(--on-chrome-2); }
.next h2 { margin-top: 4px; font-size: 21px; }
.next p { margin-top: 6px; color: var(--on-chrome); opacity: .9; font-size: 15px; }
.next .btn { margin-top: 14px; }
.next .also { margin-top: 10px; font-size: 14px; color: var(--on-chrome-2); }
.next .also button { min-height: 44px; padding: 0 2px; border: 0; background: transparent; color: var(--on-chrome); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

/* Buttons: gold is the one action to take, outlined is everything else */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border: 2px solid var(--ink); border-radius: var(--r); background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { border-color: transparent; background: var(--action); color: var(--on-action); box-shadow: 0 3px 0 var(--action-edge); }
.btn-primary:hover { background: var(--action-hover); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--action-edge); }
.btn-secondary { border-color: var(--line-strong); }
.btn-small { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--link); text-decoration: underline; text-underline-offset: 4px; padding: 0 10px; }
.btn-quiet:hover { background: var(--surface-2); }
.btn-danger { border-color: var(--bad); color: var(--bad); }
.btn[disabled], .btn[disabled]:hover { border-color: var(--line); background: var(--disabled-bg); color: var(--disabled-fg); box-shadow: none; cursor: not-allowed; transform: none; text-decoration: none; }
.saving .btn, .saving .stock, .saving .offer { pointer-events: none; }

/* Status pills: a square dot plus the word, so colour is never the only signal */
.status-pill { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 3px 8px; border-radius: 2px; background: var(--good-bg); color: var(--good); font-size: 13px; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.status-pill::before { content: ""; width: 7px; height: 7px; background: currentColor; }
.status-pill[data-state="outbound"], .status-pill[data-state="processing"], .status-pill[data-state="busy"], .status-pill[data-state="queued"] { background: var(--warn-bg); color: var(--warn); }
.status-pill[data-state="returning"], .status-pill[data-state="delivered"] { background: var(--info-bg); color: var(--info); }
.status-pill[data-state="upgrading"], .status-pill[data-state="under construction"] { background: var(--note-bg); color: var(--note); }
.status-pill[data-state="idle"], .status-pill[data-state="paused"], .status-pill[data-state="used"], .status-pill[data-state="not built"], .status-pill[data-state="needs wagons"] { background: var(--surface-3); color: var(--ink-2); }
.status-pill[data-state="needs wagons"] { background: var(--bad-bg); color: var(--bad); }
.tone-tag { display: inline-block; padding: 2px 7px; border-radius: 2px; background: var(--warn-bg); color: var(--warn); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.tone-tag.good { background: var(--good-bg); color: var(--good); }

/* Notices */
.note { padding: 12px 14px; border-radius: var(--r); background: var(--info-bg); color: var(--ink); font-size: 14px; }
.note strong { font-weight: 700; }
.note.warn { background: var(--warn-bg); }
.note.bad { background: var(--bad-bg); }
.note.good { background: var(--good-bg); }
.note p + p { margin-top: 4px; }
.summary-banner { display: flex; align-items: flex-start; gap: 6px; margin-top: 12px; padding: 4px 4px 4px 14px; border-radius: var(--r); background: var(--good-bg); font-size: 14px; }
.summary-banner > div { flex: 1; min-width: 0; padding: 8px 0; }
.summary-banner strong { display: block; margin-bottom: 2px; }
.summary-banner .icon-btn { margin: 0; }

/* Label / value rows instead of a wall of boxes */
.kv { display: grid; margin: 0; }
.kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv > div:last-child { border-bottom: 0; }
.kv dt, .kv span.k { color: var(--ink-2); min-width: 0; }
.kv dd, .kv strong { margin: 0; font-weight: 700; text-align: right; }
.kv .sub { display: block; font-weight: 400; font-size: 13px; color: var(--ink-2); }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0 2px; margin-top: 4px; border-top: 2px solid var(--ink); }
.total span { font-weight: 700; }
.total strong { font-size: 28px; line-height: 1.1; font-weight: 800; color: var(--good); letter-spacing: -.02em; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fact { min-width: 0; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); }
.fact .k { display: block; font-size: 13px; color: var(--ink-2); }
.fact strong { display: block; font-size: 19px; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }

/* Progress */
.progress-copy { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 10px 0 6px; font-size: 14px; }
.progress-copy strong { font-weight: 700; text-align: right; }
.progress-copy .real { display: block; font-size: 12px; font-weight: 400; color: var(--ink-2); }
.progress-track { height: 12px; overflow: hidden; border-radius: 2px; background: var(--surface-3); }
.progress-fill { height: 100%; background: var(--action); min-width: 2px; transition: width .3s linear; }
.journey .progress-fill { background: var(--good); }

/* Segmented control and chips */
.segmented { display: flex; min-width: 0; border: 2px solid var(--ink); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.segmented button { border-radius: 0; flex: 1; min-width: 0; min-height: 46px; padding: 0 10px; border: 0; background: transparent; font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; }
.segmented button + button { border-left: 1px solid var(--line-strong); }
.segmented button.active { background: var(--ink); color: var(--surface); }
.segmented button:not(.active):hover { background: var(--surface-2); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(-1 * var(--gr)) 0 calc(-1 * var(--gl)); padding: 2px var(--gr) 6px var(--gl); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); font-size: 14px; font-weight: 700; }
.chip.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip small { font-size: 12px; font-weight: 600; opacity: .85; }

/* Pinned bar: navigation and stored products stay in view while a screen scrolls. */
.dock { position: sticky; top: 0; z-index: 30; margin: 0 calc(-1 * var(--gr)) 10px calc(-1 * var(--gl)); padding: env(safe-area-inset-top, 0px) var(--gr) 0 var(--gl); background: var(--surface); border-bottom: 1px solid var(--line-strong); box-shadow: 0 8px 10px -9px rgba(0, 0, 0, .45); }
.dock-cash { display: none; }
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tab { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 6px; border: 0; border-radius: 0; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 700; white-space: nowrap; }
.tab svg { width: 20px; height: 20px; flex: none; }
.tab:hover { background: var(--surface-2); }
.tab.active { color: var(--ink); background: var(--surface-2); box-shadow: inset 0 -3px 0 var(--action); }
.tab .dot { flex: none; width: 9px; height: 9px; background: var(--action); border-radius: 50%; }

/* City screen */
.city-card { margin-left: calc(-1 * var(--gl)); margin-right: calc(-1 * var(--gr)); border-left: 0; border-right: 0; border-radius: 0; padding: 0; background: var(--surface); overflow: hidden; }
.city-card .card-head { margin: 0; padding: 12px var(--gr) 10px var(--gl); }
.city-map { position: relative; background: #c4cf9e; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.city-map svg { display: block; width: 100%; height: auto; }
.city-map [data-facility] { cursor: pointer; }
.map-caption { padding: 10px var(--gr) 12px var(--gl); font-size: 14px; color: var(--ink-2); }
.map-caption b { color: var(--ink); }
.goal .bar-label { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0 6px; font-size: 14px; }
.goal .bar-label strong { font-weight: 700; }
.upgrade-queue { display: grid; gap: 8px; padding: 0; margin: 10px 0 0; list-style: none; }
.upgrade-queue li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); }
.upgrade-queue li > div { flex: 1 1 140px; min-width: 0; }
.upgrade-queue strong { display: block; font-size: 15px; }
.upgrade-queue small { display: block; color: var(--ink-2); font-size: 13px; }

/* Refinery screen */
.plant-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 6px; margin-bottom: 14px; }
.flow-node { min-width: 0; padding: 8px 6px; border-radius: var(--r); background: var(--surface-2); text-align: center; font-size: 13px; line-height: 1.25; }
.flow-node b { display: block; font-size: 16px; font-weight: 800; }
.flow-node.here { background: var(--surface); outline: 2px solid var(--ink); }
.flow-arrow { color: var(--ink-2); font-weight: 800; }
.plant-art { display: block; width: 100%; max-height: 92px; margin: 0 0 12px; background: var(--surface-2); border-radius: var(--r); }
.field { display: grid; gap: 6px; font-size: 15px; font-weight: 700; }
.qty-controls { display: flex; gap: 8px; align-items: stretch; }
.qty-controls input { flex: 1; min-width: 0; }
input, select { min-width: 0; max-width: 100%; min-height: 48px; padding: 0 12px; border: 2px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink); font-size: 18px; font-weight: 700; }
input[type="file"] { min-height: 0; padding: 10px; font-size: 14px; font-weight: 400; width: 100%; }
select { font-size: 16px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.sentence { padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); font-size: 16px; line-height: 1.4; }
.sentence strong { font-weight: 800; }
.sentence .meta { display: block; margin-top: 4px; font-size: 14px; color: var(--ink-2); }

/* Sell screen */
.vehicle-bar { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; }
.vehicle-bar .info { flex: 1; min-width: 0; }
.vehicle-bar strong { display: block; font-size: 17px; overflow-wrap: anywhere; }
.vehicle-bar small { display: block; color: var(--ink-2); font-size: 14px; }
.offer-list { display: grid; gap: 10px; }
.offer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); text-align: left; color: var(--ink); }
.offer:hover { border-color: var(--ink); background: var(--surface-2); }
.offer:active { transform: translateY(1px); }
.offer .o-top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.offer .o-top .p { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.offer h4 { font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
.offer .o-pay { grid-row: 2 / span 2; grid-column: 2; align-self: center; text-align: right; font-size: 22px; font-weight: 800; color: var(--good); letter-spacing: -.02em; line-height: 1.1; }
.offer .o-pay small { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.offer .o-meta { grid-column: 1; font-size: 14px; color: var(--ink-2); }
.offer.is-locked { border-style: dashed; border-color: var(--line); background: transparent; cursor: default; color: var(--ink-2); }
.offer.is-locked:hover { background: transparent; border-color: var(--line); }
.offer.is-locked .o-pay { color: var(--ink-2); font-size: 18px; }
.offer.is-best { border: 2px solid var(--ink); padding: 11px 13px; }
details.more { margin-top: 12px; }
details.more > summary { display: flex; align-items: center; min-height: 44px; padding: 0 2px; font-weight: 700; color: var(--link); cursor: pointer; }
details.more[open] > summary { margin-bottom: 8px; }
.train-formation { display: flex; align-items: center; gap: 5px; min-height: 64px; padding: 14px 8px; overflow-x: auto; background: var(--surface-2); border-radius: var(--r); margin: 4px 0 14px; }
.locomotive, .wagon { position: relative; flex: none; display: block; height: 32px; border: 2px solid var(--ink); background: #b57240; box-shadow: 0 4px 0 var(--line-strong); }
.locomotive { width: 70px; background: var(--ink); border-right: 9px solid var(--ink-2); }
.wagon { width: 52px; background: var(--surface-3); }
.ship-art { display: block; margin: 4px auto 14px; max-width: 100%; }

/* Toast */
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); width: max-content; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: var(--r); background: var(--chrome); color: var(--on-chrome); border: 1px solid var(--line-strong); font-size: 15px; font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: opacity .16s, transform .16s; text-align: center; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

.footer-note { margin: 22px 0 0; font-size: 13px; color: var(--ink-2); }

/* Phone */
@media (max-width: 600px) {
  .city-card { border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Test-only tools (skip the waiting): dashed and quiet so they never read as the main action */
.test-btn { border: 1px dashed var(--line-strong); background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 700; justify-self: start; align-self: start; }
.test-btn:hover { background: var(--surface-2); color: var(--ink); }
.test-strip { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding: 2px 2px 2px 10px; border: 1px dashed var(--line-strong); border-radius: var(--r); font-size: 13px; color: var(--ink-2); }
.card > .test-btn, .upgrades .test-btn, .journey .test-btn { margin-top: 10px; }

@media (max-width: 360px) {
  .tag { letter-spacing: .05em; font-size: 11px; }
  .link-btn { padding: 0 8px; }
  .company-name h1 { font-size: 20px; }
  .cash strong { font-size: 21px; }
}
