/* The market train on Home (js/train.js). The scene is a lit "display" in every theme; the logo's colours draw the train
   (blue body lines, magenta engine, cyan wheels and rail, orange hubs and couplers); green / grey windows carry the
   meaning and never mix with the brand colours. 3D is plain CSS (skewed roof and side faces, a ground plane in
   perspective, shadows), so it works where WebGL does not (remote desktops). */
/* Home with the train: the train and the Bitcoin / gold cards beside it; under it (two to a row) when the page is
   narrow - also when the watchlist rail is docked, since this follows the page's own width */
.home-top { container-type: inline-size; margin: 0 0 16px; }
.home-top-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.home-top .train { margin: 0; }
.mkt-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
@container (min-width: 1100px) {
  .home-top-in { grid-template-columns: minmax(0, 1fr) 240px; }
  .home-top-in.solo, .home-top-in:not(:has(.mkt-side)) { grid-template-columns: minmax(0, 1fr); }
  .mkt-side { grid-template-columns: 1fr; position: sticky; top: 76px; }
}
/* lent to the docked watchlist rail: its foot, cards one under the other */
.mkt-side.in-rail { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); position: static; }
/* in the rail the cards are small, side by side: name, change, price, range and trend (the rest on hover / the stock page) */
.mkt-side.in-rail .ms-card { padding: 7px 9px; gap: 3px; }
.mkt-side.in-rail .ms-renko, .mkt-side.in-rail .ms-card > small, .mkt-side.in-rail .ms-opt { display: none; }
.mkt-side.in-rail .ms-px { font-size: 0.9375rem; }
.mkt-side.in-rail .ms-name span { display: none; }   /* narrow: the proxy ETF goes beside the price instead */
.ms-sym { display: none; }
.mkt-side.in-rail .ms-sym { display: inline; font-size: 0.625rem; font-weight: 500; color: var(--faint); }
.mkt-side.in-rail .ms-name { font-size: 0.78125rem; }
.mkt-side.in-rail .ms-h em { font-size: 0.6875rem; }
.mkt-side.in-rail .ms-trend { font-size: 0.6875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-side.in-rail .ms-trend .muted { display: none; }
.mkt-side.in-rail .ms-range { margin-top: 2px; height: 4px; }
.mkt-side.in-rail .ms-range i { top: -3px; height: 10px; }
.rail-title { flex: 1; font-size: 0.875rem; }
.mkt-side.in-rail .ms-card { background: var(--deck-2); }
.ms-card { background: var(--deck); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ms-h { display: flex; align-items: baseline; gap: 8px; }
.ms-name { color: var(--text); font-size: 0.875rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-name span { color: var(--faint); font-size: 0.75rem; font-weight: 500; }
.ms-h em { margin-left: auto; font-style: normal; font-size: 0.75rem; font-weight: 700; }
.ms-px { font-size: 1.125rem; font-weight: 800; }
.ms-range { position: relative; height: 6px; border-radius: 3px; margin: 4px 0 0; background: linear-gradient(90deg, var(--bear), var(--warn) 50%, var(--bull)); opacity: .85; }
.ms-range i { position: absolute; top: -4px; width: 3px; height: 14px; margin-left: -1.5px; border-radius: 2px; background: var(--text); }
.ms-card small { font-size: 0.6875rem; }
.ms-trend { font-size: 0.75rem; font-weight: 600; }
.ms-trend .muted { font-weight: 400; }
.ms-renko .ix-renko { width: 100%; height: 54px; }
.ms-opt { font-size: 0.6875rem; line-height: 1.45; color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 6px; }
.ms-opt b { color: var(--text); }
.ms-opt a { margin-left: 4px; white-space: nowrap; }

.train {
  --tr-blue: #3D5AFE; --tr-cyan: #00E5FF; --tr-mag: #D500F9; --tr-orange: #FF9100; --tr-red: #FF1744;
  --tr-sky1: #0d1830; --tr-sky2: #0a1222; --tr-body: #121b31; --tr-ink: #e8eefc; --tr-dim: #94a3c4;
  margin: 0 0 16px; padding: 14px 16px 12px;
}
.tr-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 10px; }
.tr-title { flex: 1 1 300px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.tr-title h2 { margin: 0; font-size: 0.9375rem; font-weight: 700; }
.tr-title .hint { font-size: 0.75rem; color: var(--muted); }
.tr-ctl { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-ctl .seg button { padding: 5px 10px; font-size: 0.75rem; }
.tr-empty, .tr-note { font-size: 0.8125rem; color: var(--muted); padding: 10px 0; }
.tr-note { padding: 0 0 8px; }

/* ---- the scene ---- */
.tr-scene { position: relative; border-radius: 12px; color: var(--tr-ink); overflow: hidden;
  background: radial-gradient(120% 90% at 70% 0%, rgba(61,90,254,.22), transparent 60%), linear-gradient(180deg, var(--tr-sky1), var(--tr-sky2)); }
.tr-legend { display: flex; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; padding: 8px 12px 0; font-size: 0.6875rem; color: var(--tr-dim); }
.tr-legend b { color: var(--tr-ink); }
.tr-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: #334155; margin: 0 4px -1px 6px; }
.tr-dot.on { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.7); }
.tr-dot.dn { background: #dc2626; box-shadow: 0 0 6px rgba(239,68,68,.6); }
.tr-rail-wrap { overflow-x: auto; overflow-y: hidden; padding: 40px 16px 24px; scrollbar-width: thin; }
.tr-train { position: relative; display: flex; align-items: flex-end; width: max-content; min-width: 100%; padding: 0 30px 30px 8px;
  transform: rotate(var(--tilt)); transform-origin: 50% 100%; transition: transform .6s ease; }
/* ground plane in perspective: sleepers and the cyan rail */
.tr-ground { position: absolute; left: -60px; right: -60px; bottom: 6px; height: 36px; z-index: 0; transform-origin: 50% 0;
  transform: perspective(420px) rotateX(58deg);
  background: linear-gradient(180deg, transparent 0 9px, var(--tr-cyan) 9px 11px, transparent 11px 25px, var(--tr-cyan) 25px 27px, transparent 27px),
              repeating-linear-gradient(90deg, rgba(61,90,254,.85) 0 7px, transparent 7px 22px), linear-gradient(180deg, #16223e, #0c1426);
  box-shadow: 0 18px 30px rgba(0,0,0,.55); border-radius: 3px; opacity: .95; }

/* ---- the opening gap (Home: train gap): yesterday's close as a dashed shadow rail ---- */
.tr-gapb { display: inline-block; margin: 2px 0 6px; padding: 3px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; border: 1px solid; }
.tr-gapb.up { color: var(--bull); border-color: color-mix(in srgb, var(--bull) 55%, transparent); background: color-mix(in srgb, var(--bull) 12%, transparent); }
.tr-gapb.dn { color: var(--bear); border-color: color-mix(in srgb, var(--bear) 55%, transparent); background: color-mix(in srgb, var(--bear) 12%, transparent); }
.tr-shadow { position: absolute; left: -60px; right: -190px; bottom: 34px; height: 0; z-index: 0; pointer-events: none; }
.tr-shadow .line { position: absolute; left: 0; right: 0; border-top: 2px dashed; opacity: .9; }
.tr-shadow .band { position: absolute; left: 0; right: 0; height: var(--off); }
.tr-shadow span { position: absolute; right: 8px; font-size: 0.6875rem; color: var(--muted); white-space: nowrap; }
.tr-shadow.dn .line { bottom: var(--off); border-color: var(--bear); }
.tr-shadow.dn .band { bottom: 0; background: color-mix(in srgb, var(--bear) 12%, transparent); }
.tr-shadow.dn span { bottom: calc(var(--off) + 4px); }
.tr-shadow.up .line { top: var(--off); border-color: var(--bull); }
.tr-shadow.up .band { top: 0; background: color-mix(in srgb, var(--bull) 12%, transparent); }
.tr-shadow.up span { top: calc(var(--off) + 4px); }

/* ---- a car ---- */
.tr-car { position: relative; z-index: 1; flex: none; display: flex; flex-direction: column; align-items: stretch; margin-bottom: 2px; }
.tr-box { position: relative; width: var(--w); height: 128px; box-sizing: border-box; padding: 5px 6px 6px; display: flex; flex-direction: column; gap: 4px;
  border: 2px solid var(--tr-blue); border-radius: 7px; background: linear-gradient(180deg, #1b2747 0%, var(--tr-body) 55%, #0c1424 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 -10px 18px rgba(0,0,0,.35), 0 12px 16px rgba(0,0,0,.45); }
.tr-roof { position: absolute; left: -2px; right: -2px; bottom: 100%; height: 9px; transform-origin: 0 100%; transform: skewX(-45deg);
  background: linear-gradient(180deg, #34477e, #22305a); border: 2px solid var(--tr-blue); border-bottom: 0; border-radius: 3px 3px 0 0; }
.tr-side { position: absolute; left: 100%; top: -2px; bottom: -2px; width: 9px; transform-origin: 0 0; transform: skewY(-45deg);
  background: linear-gradient(90deg, #0d1528, #070c18); border: 2px solid var(--tr-blue); border-left: 0; }
.tr-name { display: flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 2px; border: 0; background: none; color: var(--tr-ink);
  font: 700 0.6875rem/1 var(--font); letter-spacing: .02em; cursor: pointer; overflow: hidden; }
.tr-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-name b { margin-left: auto; font-size: 0.6875rem; }
.tr-name:hover span { text-decoration: underline; }
.tr-seats { flex: 1; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 3px; min-height: 0; }
.tr-seat, .tr-more { min-width: 0; padding: 0; border: 0; border-radius: 3px; overflow: hidden; white-space: nowrap; font: 700 0.5625rem/1 var(--font); letter-spacing: .01em; }
.tr-seat { cursor: pointer; background: #334155; color: #cbd5e1; box-shadow: inset 0 1px 0 rgba(255,255,255,.07); }
.tr-seat.on { background: #22c55e; color: #052e16; box-shadow: 0 0 7px rgba(34,197,94,.55), inset 0 1px 0 rgba(255,255,255,.35); }
.tr-seat.dn { background: #dc2626; color: #fff1f2; box-shadow: 0 0 6px rgba(239,68,68,.45), inset 0 1px 0 rgba(255,255,255,.2); }
.tr-seat:hover { outline: 1px solid var(--tr-ink); }
.tr-seat.mv { position: relative; }
.tr-seat.mv::after { content: ""; position: absolute; top: 0; right: 0; border: 4px solid transparent; border-top-color: #FF9100; border-right-color: #FF9100; }
.tr-pax .mv b::after { content: " ⚡"; color: #FF9100; font-size: .8em; }
.tr-seat.me { outline: 2px solid #fff; outline-offset: 1px; position: relative; z-index: 1; }
.tr-more { display: grid; place-items: center; background: #0b1222; color: var(--tr-dim); }
.tr-wheels { display: flex; justify-content: space-around; margin-top: -7px; padding: 0 10px; position: relative; z-index: 2; }
.tr-wheels i { width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%; border: 3px solid var(--tr-cyan);
  background: radial-gradient(circle, var(--tr-orange) 0 3px, #0b0e14 4px); box-shadow: 0 3px 4px rgba(0,0,0,.6), 0 0 6px rgba(0,229,255,.35); }
.tr-tag { position: absolute; left: 0; right: 0; top: calc(100% + 6px); text-align: center; font-size: 0.625rem; font-weight: 700; color: #ff6b81; white-space: nowrap; }
.tr-mv { position: absolute; left: 50%; bottom: calc(100% + 14px); transform: translateX(-50%); font-size: 0.6875rem; font-weight: 800; white-space: nowrap; }
.tr-coupler { flex: none; width: 9px; height: 4px; margin-bottom: 26px; border-radius: 2px; background: var(--tr-orange); position: relative; z-index: 1; }
.tr-coupler.drag { width: 22px; background: repeating-linear-gradient(90deg, var(--tr-red) 0 4px, transparent 4px 7px); }
.tr-car.sel .tr-box { border-color: #fff; }
/* the engine: magenta lines, a cab nose with a headlight */
.tr-car.engine { flex-direction: column; }
.tr-car.engine .tr-box, .tr-car.engine .tr-roof, .tr-car.engine .tr-side { border-color: var(--tr-mag); }
.tr-car.engine .tr-box { background: linear-gradient(180deg, #2b1f5c 0%, #1b1640 55%, #120d2a 100%); }
.tr-car.engine .tr-roof { background: linear-gradient(180deg, #5a2a86, #3a1d61); }
.tr-car.engine .tr-tag { color: #e879f9; }
/* downhill the engine leads the way down: red instead of the logo's magenta */
.tr-car.engine.down .tr-box, .tr-car.engine.down .tr-roof, .tr-car.engine.down .tr-side, .tr-car.engine.down .tr-nose { border-color: var(--tr-red); }
.tr-car.engine.down .tr-box { background: linear-gradient(180deg, #5c1a24 0%, #3d1119 55%, #2a0b11 100%); }
.tr-car.engine.down .tr-roof { background: linear-gradient(180deg, #8a2433, #5c1a24); }
.tr-car.engine.down .tr-nose { background: linear-gradient(90deg, #3d1119, #b91c1c); }
.tr-car.engine.down .tr-tag { color: #ff6b81; }
.tr-nose { position: absolute; left: calc(var(--w) - 2px); bottom: 15px; width: 40px; height: 78px; border: 2px solid var(--tr-mag); border-left: 0;
  border-radius: 0 28px 6px 0; background: linear-gradient(90deg, #2b1f5c, var(--tr-blue)); box-shadow: 8px 10px 14px rgba(0,0,0,.4); }
.tr-nose i { position: absolute; right: 6px; top: 16px; width: 9px; height: 9px; border-radius: 50%; background: #fff7cc; box-shadow: 0 0 10px 4px rgba(255,236,150,.75), 30px 0 40px 10px rgba(255,236,150,.18); }
.tr-car.engine { margin-right: 40px; }

/* ---- the route: the benchmark's path through the stops ---- */
.tr-route { margin-top: 10px; padding: 8px 4px 2px; }
.tr-route-h { font-size: 0.6875rem; margin-bottom: 4px; }
.tr-route .k, .tr-tiles .k, .tr-card .k { font-size: 0.625rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tr-prof { position: relative; height: 72px; margin: 0 28px; }
.tr-prof svg { position: absolute; inset: 0; width: 100%; height: 72px; }
.tr-area { fill: rgba(0,229,255,.10); }
.tr-path, .tr-done { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.tr-path { stroke: var(--line); }
.tr-done { stroke: #00b8d4; }
.tr-pk { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--faint); }
.tr-pk.done { background: #00b8d4; }
.tr-pk b { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 0.625rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tr-pk.now b { color: var(--text); font-weight: 800; }
.tr-loco { position: absolute; width: 26px; height: 12px; margin: -17px 0 0 -13px; border-radius: 3px 8px 3px 3px; background: linear-gradient(90deg, #3D5AFE, #D500F9); border: 2px solid #00E5FF; }
.tr-stops { position: relative; height: 46px; margin: 2px 28px 0; }
.tr-stops button { position: absolute; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 44px; min-height: 44px;
  padding: 2px 0 0; border: 0; background: none; color: var(--muted); font: 600 0.6875rem/1 var(--font); cursor: pointer; }
.tr-stops button i { width: 12px; height: 12px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--faint); background: var(--deck); }
.tr-stops button small { font-size: 0.625rem; color: #b07de8; white-space: nowrap; }
.tr-stops button.on { color: var(--text); }
.tr-stops button.on i { border-color: var(--text); background: #00b8d4; }

/* ---- tiles ---- */
.tr-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.tr-tiles > div { background: var(--deck-2); border-radius: 9px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-tiles b { font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-tiles b small { font-weight: 500; color: var(--muted); font-size: 0.6875rem; }
.tr-tiles > div > small { font-size: 0.6875rem; color: var(--muted); }
.tr-tiles b.tr-eng { color: #b07de8; white-space: normal; }

/* ---- tabs below ---- */
.tr-tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--line-soft); margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.tr-tabs button { white-space: nowrap; flex: none; }
.tr-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 8px 2px; color: var(--muted); font: 700 0.75rem/1 var(--font); cursor: pointer; }
.tr-tabs button.on { color: var(--text); border-bottom-color: var(--brass); }
.tr-tab { padding-top: 10px; font-size: 0.8125rem; }
.tr-tab h3 { margin: 0 0 6px; font-size: 0.75rem; font-weight: 700; }
.tr-tab .muted { font-size: 0.75rem; margin: 0 0 6px; }
.tr-tab .faint { font-size: 0.6875rem; color: var(--faint); margin: 6px 0 0; }
.tr-rot { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr); gap: 16px; }
.tr-bump { position: relative; margin: 6px 64px 22px 46px; }
.tr-bump svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tr-bl { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; opacity: .75; }
.tr-bl.me { stroke-width: 3.5; opacity: 1; }
.tr-bx { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--line-soft); }
.tr-bx.now { background: var(--brass); }
.tr-bx b { position: absolute; top: 100%; margin-top: 6px; left: 50%; transform: translateX(-50%); font-size: 0.625rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tr-bump-k { position: absolute; left: -46px; font-size: 0.625rem; font-weight: 700; }
.tr-bump-k.tr-bk-top { top: 0; color: #b07de8; } .tr-bump-k.tr-bk-bot { bottom: 0; color: var(--bear); }
.tr-bend { position: absolute; left: 100%; margin-left: 8px; transform: translateY(-50%); padding: 0; border: 0; background: none; font: 700 0.6875rem/1 var(--font); white-space: nowrap; cursor: pointer; min-height: 20px; }
.tr-events { display: flex; flex-direction: column; gap: 8px; }
.tr-ev { display: flex; gap: 10px; align-items: flex-start; background: var(--deck-2); border-radius: 8px; padding: 8px 10px; }
.tr-ev span { flex: none; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-weight: 800; font-size: 0.75rem; background: var(--line-soft); color: var(--muted); }
.tr-ev span.blue { background: color-mix(in srgb, var(--brass) 20%, transparent); color: var(--brass); }
.tr-ev span.up { background: color-mix(in srgb, var(--bull) 18%, transparent); color: var(--bull); }
.tr-ev span.down { background: color-mix(in srgb, var(--bear) 18%, transparent); color: var(--bear); }
.tr-ev p { margin: 0; font-size: 0.75rem; line-height: 1.45; color: var(--muted); }
.tr-ev p b { color: var(--text); }
.tr-in > p { margin: 0 0 8px; line-height: 1.5; }
.tr-pax { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.tr-pax button { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--deck-2); color: var(--text); text-align: left; cursor: pointer; min-width: 0; }
.tr-pax button i { flex: none; width: 6px; height: 26px; border-radius: 2px; background: var(--faint); }
.tr-pax button.on i { background: var(--bull); }
.tr-pax button.dn i { background: var(--bear); }
.tr-pax button span { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tr-pax button b { font-size: 0.75rem; }
.tr-pax button small { font-size: 0.625rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-pax button em { font-style: normal; font-size: 0.625rem; color: var(--muted); }
.tr-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tr-board .faint { grid-column: 1 / -1; }
.tr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font: 700 0.75rem/1 var(--font); }
.tr-foot { margin: 10px 0 0; font-size: 0.6875rem; color: var(--faint); }

/* ---- the scorecard as of the stop ---- */
.tr-card { scroll-margin-top: 80px; outline: none; margin-top: 10px; border: 1px solid var(--brass); border-radius: 10px; padding: 12px 14px; background: var(--deck); }
.tr-card-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 10px; }
.tr-sym { font-size: 1rem; font-weight: 800; color: var(--text); }
.tr-px { font-size: 0.875rem; font-weight: 700; }
.tr-px small { font-size: 0.75rem; font-weight: 600; }
.tr-asof { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--muted); }
.tr-asof b { color: var(--text); }
.tr-card-g { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tr-card-g > div { background: var(--deck-2); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tr-card-g small { font-size: 0.6875rem; line-height: 1.4; }
.tr-ch { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tr-ch b { font-size: 0.75rem; }
.tr-bricks { position: relative; height: 64px; background: var(--deck); border-radius: 6px; overflow: hidden; }
.tr-bricks i { position: absolute; border-radius: 2px; }
.tr-bricks i.u { background: var(--bull); } .tr-bricks i.d { background: var(--bear); }
.tr-hc { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.tr-hc div { text-align: center; padding: 6px 0; border-radius: 6px; background: var(--deck); display: flex; flex-direction: column; gap: 2px; }
.tr-hc b { font-size: 0.8125rem; color: var(--faint); }
.tr-hc .ok { background: color-mix(in srgb, var(--bull) 13%, transparent); } .tr-hc .ok b { color: var(--bull); }
.tr-hc .no b { color: var(--muted); }
.tr-hc small { font-size: 0.5625rem; color: var(--muted); }
.tr-rng { position: relative; height: 24px; margin-top: 4px; }
.tr-rng::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 2px; background: var(--line); }
.tr-rng .band { position: absolute; left: 22%; width: 56%; top: 3px; height: 18px; border-radius: 5px; background: color-mix(in srgb, var(--wait) 15%, transparent); border: 1px solid color-mix(in srgb, var(--wait) 55%, transparent); }
.tr-rng .dot { position: absolute; left: 50%; top: 5px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--text); }
.tr-rng-l { display: flex; justify-content: space-between; font-size: 0.625rem; color: var(--muted); }
.tr-next { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-top: 10px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; font-size: 0.75rem; color: var(--muted); }
.tr-next .k { color: var(--warn); }
.tr-card-a { display: flex; gap: 8px; margin-top: 10px; }

@media (max-width: 900px) {
  .tr-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-rot, .tr-card-g, .tr-board { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .train { padding: 12px 10px; }
  .tr-legend span:first-child, .tr-legend span:last-child { display: none; }
  .tr-bump { margin-right: 74px; }
}
