/* ============================================================================
   NTSE Premium Station Display — v2
   Designed for 16:9 TV panels (1080p → 4K) viewed from platform distance.

   Readability rules baked in:
   • Near-black background + high-luminance text (WCAG ~10:1 on primary text).
   • Devanagari never clips: every Hindi element gets line-height ≥ 1.4 and
     breathing padding (matras like ि ी ें ु need headroom above AND below).
   • Status is triple-coded: color + left rail + text, so it survives cheap
     TV panels with crushed colors.
   ========================================================================== */

:root {
  --bg-0: #04070f;
  --bg-1: #0a1020;
  --bg-2: #101a33;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-line: rgba(255, 255, 255, 0.10);
  --ink: #ffffff;
  --ink-dim: #c2d0ea;      /* brighter than v1 — readable from the platform */
  --ink-faint: #8093b5;

  --accent: #6d8cff;
  --accent-2: #3ad0ff;

  /* Chrome slots — themes may override; default to the accent pair. */
  --head-grad-a: var(--accent);
  --head-grad-b: var(--accent-2);
  --head-ink: #041022;
  --num: var(--accent-2);
  --clock-ink: var(--accent-2);
  --pf-grad-a: var(--accent-2);
  --pf-grad-b: var(--accent);
  --pf-ink: #041022;

  /* Status colors: saturated + luminous, spaced far apart in hue so they
     stay distinct even on washed-out panels. */
  --ok: #2bf08e;
  --ok-bg: rgba(43, 240, 142, 0.16);
  --late: #ffc233;
  --late-bg: rgba(255, 194, 51, 0.16);
  --vlate: #ff4d63;
  --vlate-bg: rgba(255, 77, 99, 0.18);
  --info: #45d6ff;
  --info-bg: rgba(69, 214, 255, 0.16);
  --muted: #93a3c4;
  --muted-bg: rgba(147, 163, 196, 0.13);

  --hindi-gold: #ffd980;   /* classic railway-board amber for Devanagari */

  --row-h: clamp(52px, 8.2vh, 104px);
  --pad: clamp(14px, 2.2vw, 42px);
  --radius: clamp(10px, 1vw, 18px);

  --font: "Segoe UI", "Inter", system-ui, -apple-system, "Noto Sans", Arial, sans-serif;
  --font-hi: "Nirmala UI", "Noto Sans Devanagari", "Mangal", var(--font);
  --mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
}

/* Theme accents (per-token `theme` selects one) */
body[data-theme="indigo"] { --accent: #6d8cff; --accent-2: #3ad0ff; }
body[data-theme="teal"]   { --accent: #2fd8c4; --accent-2: #57e08a; }
body[data-theme="amber"]  { --accent: #ffb84d; --accent-2: #ff8a5b; }
body[data-theme="rose"]   { --accent: #ff7aa8; --accent-2: #b98bff; }

/* Ruby — the premium red: deep maroon→crimson tonal gradients for chrome,
   champagne gold for numerals/clock. Red chrome is kept DEEP so the bright
   red "very late / cancelled" status still stands apart. */
body[data-theme="ruby"] {
  --accent: #e02348;
  --accent-2: #ff5c74;
  --bg-1: #150710;
  --bg-2: #241019;
  --head-grad-a: #7c0f24;
  --head-grad-b: #d92645;
  --head-ink: #ffffff;
  --num: #f7c86d;
  --clock-ink: #ffd27a;
  --pf-grad-a: #e02348;
  --pf-grad-b: #8f1330;
  --pf-ink: #ffffff;
  --hindi-gold: #ffdf94;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.2px;
}

/* Every Devanagari block: tall line box + headroom so matras never clip. */
.stn-name-hi, .title-hi, .name-hi, .grid-head .hi, .marquee-track {
  line-height: 1.5;
  padding-top: 0.08em;
  padding-bottom: 0.08em;
}

body::before { /* ambient aurora — slow, GPU-cheap, tinted by the theme */
  content: "";
  position: fixed; inset: -10%;
  background:
    radial-gradient(120vw 80vh at 12% -10%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 60%),
    radial-gradient(90vw 70vh at 100% 0%, color-mix(in srgb, var(--accent-2) 9%, transparent), transparent 55%),
    radial-gradient(80vw 60vh at 50% 110%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  z-index: -1;
  animation: aurora 40s ease-in-out infinite alternate;
}
@keyframes aurora {
  from { transform: translate3d(-1.5%, 0, 0) scale(1.02); }
  to   { transform: translate3d(1.5%, -1%, 0) scale(1.05); }
}

.board {
  height: 100vh;
  height: 100dvh; /* mobile browsers: exclude the URL bar */
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  padding: clamp(10px, 1.6vh, 26px) var(--pad) clamp(8px, 1.2vh, 18px);
  gap: clamp(8px, 1.2vh, 16px);
}

/* ── Header ───────────────────────────────────────────────────────────── */
.topbar {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--pad);
  padding: clamp(10px, 1.6vh, 20px) clamp(14px, 1.8vw, 30px);
  background: linear-gradient(120deg, var(--bg-2), rgba(16,26,51,0.45));
  border: 1px solid var(--panel-line);
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* Signature sheen: a light bar sweeps the header every 9s */
.topbar::after {
  content: "";
  position: absolute; top: 0; bottom: 0; width: 18%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.07), transparent);
  transform: skewX(-18deg);
  animation: sheen 9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sheen {
  0%, 55% { left: -30%; }
  85%, 100% { left: 130%; }
}

.brand { display: flex; align-items: center; gap: clamp(10px, 1.2vw, 22px); }

/* Waving Indian flag (animated GIF). The art has a white background, so it
   sits on a soft white rounded chip — reads as a framed flag on the dark board. */
.flag-wrap {
  display: flex; align-items: center; justify-content: center; flex: none;
  background: #ffffff;
  border-radius: clamp(8px, 0.8vw, 14px);
  padding: clamp(2px, 0.25vw, 5px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.14);
  overflow: hidden;
}
.flag-gif {
  display: block;
  height: clamp(48px, 5.4vw, 92px);
  width: auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Railway crest — white chip like the flag so the navy artwork reads on dark */
.rail-chip {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: #ffffff;
  border-radius: clamp(8px, 0.8vw, 14px);
  /* same chip height as the flag: identical padding + identical image height */
  padding: clamp(2px, 0.25vw, 5px) clamp(4px, 0.4vw, 8px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.14);
}
.rail-logo {
  display: block;
  height: clamp(48px, 5.4vw, 92px);
  width: auto;
}

/* Center block = the station name, big and unmissable */
.title-block { text-align: center; min-width: 0; }
.stn-name {
  font-size: clamp(26px, 3.2vw, 58px);
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 18px color-mix(in srgb, var(--accent) 40%, transparent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stn-name-hi {
  font-family: var(--font-hi);
  font-size: clamp(16px, 1.9vw, 34px);
  color: var(--hindi-gold);
  font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.clock-block { text-align: right; }
.clock {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(28px, 3.5vw, 62px);
  font-weight: 700;
  color: var(--clock-ink);
  letter-spacing: 1px;
  animation: clockGlow 3s ease-in-out infinite;
}
@keyframes clockGlow {
  0%, 100% { text-shadow: 0 0 18px color-mix(in srgb, var(--clock-ink) 35%, transparent); }
  50%      { text-shadow: 0 0 34px color-mix(in srgb, var(--clock-ink) 60%, transparent); }
}
.date { font-size: clamp(12px, 1.2vw, 22px); color: var(--ink-dim); font-weight: 600; line-height: 1.35; }

/* ── Grid (head + rows share template) ────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns:
    clamp(92px, 9vw, 200px)    /* train no */
    minmax(0, 1fr)             /* name — soaks up leftover space */
    clamp(110px, 10.5vw, 220px)/* arrival */
    clamp(110px, 10.5vw, 220px)/* departure */
    clamp(60px, 5.8vw, 126px)  /* pf */
    clamp(220px, 20vw, 440px); /* status — long texts like cancel reasons fit */
  align-items: center;
  gap: clamp(6px, 0.9vw, 18px);
  padding: 0 clamp(14px, 1.6vw, 30px);
}

.grid-head {
  position: relative;
  overflow: hidden;
  min-height: clamp(46px, 6.2vh, 82px);
  padding-top: clamp(4px, 0.5vh, 8px);
  padding-bottom: clamp(4px, 0.5vh, 8px);
  background: linear-gradient(90deg, var(--head-grad-a), var(--head-grad-b));
  color: var(--head-ink);
  border-radius: var(--radius);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(13px, 1.2vw, 23px);
  letter-spacing: 1px;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--head-grad-b) 35%, transparent),
              inset 0 1px 0 rgba(255,255,255,0.22);
}
.grid-head .hi {
  display: block;
  font-family: var(--font-hi);
  font-size: 0.78em;
  font-weight: 800;
  opacity: 0.95;
  text-transform: none;
  letter-spacing: 0;
}
.grid-head > div { line-height: 1.25; }
.c-time, .c-pf { text-align: center; }

/* ── Rows — split-flap inspired entrance ──────────────────────────────── */
.rows {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 0.7vh, 12px);
  padding-top: clamp(4px, 0.6vh, 10px);
  perspective: 1100px;
}

.row {
  height: var(--row-h);
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-left: 6px solid transparent;
  border-radius: var(--radius);
  transform-origin: 50% 0;
  /* Each row flaps down like a solari board, staggered via --i (set by JS) */
  animation: flapIn 0.65s cubic-bezier(.25,.9,.3,1.15) both;
  animation-delay: calc(var(--i, 0) * 90ms);
  transition: background 0.3s;
}
.row:nth-child(even) { background: rgba(255,255,255,0.025); }

@keyframes flapIn {
  0%   { opacity: 0; transform: rotateX(-75deg); }
  55%  { opacity: 1; transform: rotateX(9deg); }
  78%  { transform: rotateX(-4deg); }
  100% { opacity: 1; transform: rotateX(0); }
}

/* status accents on the row */
.row.s-ON_TIME      { border-left-color: var(--ok); }
.row.s-RUNNING_LATE { border-left-color: var(--late); }
.row.s-ARRIVED      { border-left-color: var(--info); }
.row.s-DEPARTED     { border-left-color: var(--muted); opacity: 0.55; }
.row.s-CANCELLED    { border-left-color: var(--vlate); background: var(--vlate-bg); }
.row.s-DIVERTED,
.row.s-RESCHEDULED  { border-left-color: var(--vlate); }

/* Very-late rows breathe a soft red so they're spottable from far away */
.row.vlate {
  border-left-color: var(--vlate);
  animation: flapIn 0.65s cubic-bezier(.25,.9,.3,1.15) both,
             lateBreathe 2.6s ease-in-out infinite 0.8s;
  animation-delay: calc(var(--i, 0) * 90ms), calc(var(--i, 0) * 90ms + 0.8s);
}
@keyframes lateBreathe {
  0%, 100% { box-shadow: none; }
  50%      { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--vlate) 45%, transparent),
                         0 0 22px color-mix(in srgb, var(--vlate) 18%, transparent); }
}

.c-no .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(19px, 2vw, 40px);
  font-weight: 800;
  color: var(--num);
  letter-spacing: 0.5px;
}

.c-name { min-width: 0; }
.name-en {
  font-size: clamp(17px, 1.8vw, 36px);
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.name-hi {
  font-family: var(--font-hi);
  font-size: clamp(14px, 1.35vw, 27px);
  color: var(--hindi-gold);
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.s-CANCELLED .name-en { text-decoration: line-through; text-decoration-color: var(--vlate); }

.c-time { text-align: center; line-height: 1.2; }
.t-main {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(18px, 1.9vw, 38px);
  font-weight: 700;
}
.t-sub { font-size: clamp(11px, 0.95vw, 18px); color: var(--ink-faint); font-weight: 600; }
.t-late { color: var(--late); }
.t-vlate { color: var(--vlate); }
.t-none { color: var(--ink-faint); }

/* Platform: solid accent block + dark numeral — the single most-glanced cell,
   so give it maximum contrast and a soft beacon pulse. */
.c-pf { text-align: center; }
.pf-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: clamp(42px, 3.6vw, 74px);
  height: clamp(38px, 3.5vw, 66px);
  padding: 0 clamp(6px, 0.6vw, 12px);
  border-radius: 12px;
  font-size: clamp(20px, 2vw, 42px);
  font-weight: 900;
  color: var(--pf-ink);
  background: linear-gradient(160deg, var(--pf-grad-a), var(--pf-grad-b));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18) inset,
              0 4px 16px color-mix(in srgb, var(--pf-grad-a) 30%, transparent);
  animation: pfPulse 4s ease-in-out infinite;
}
@keyframes pfPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255,255,255,0.18) inset,
                         0 4px 14px color-mix(in srgb, var(--pf-grad-a) 22%, transparent); }
  50%      { box-shadow: 0 0 0 1px rgba(255,255,255,0.24) inset,
                         0 4px 26px color-mix(in srgb, var(--pf-grad-a) 45%, transparent); }
}
.pf-badge.empty { background: none; box-shadow: none; animation: none; color: var(--ink-faint); font-weight: 700; }

.c-status { text-align: left; }
.pill {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: clamp(6px, 0.8vh, 13px) clamp(11px, 1.1vw, 22px);
  border-radius: 999px;
  font-size: clamp(14px, 1.4vw, 28px);
  font-weight: 800;
  line-height: 1.3;
  max-width: 100%;
  border: 1px solid transparent;
}
.pill .pin { width: 0.65em; height: 0.65em; border-radius: 50%; flex: none; background: currentColor; box-shadow: 0 0 12px currentColor; }
.pill .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pill.p-ok    { color: var(--ok);   background: var(--ok-bg);   border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.pill.p-late  { color: var(--late); background: var(--late-bg); border-color: color-mix(in srgb, var(--late) 35%, transparent); }
.pill.p-vlate { color: var(--vlate);background: var(--vlate-bg);border-color: color-mix(in srgb, var(--vlate) 40%, transparent); }
.pill.p-info  { color: var(--info); background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 35%, transparent); }
.pill.p-muted { color: var(--muted);background: var(--muted-bg);border-color: color-mix(in srgb, var(--muted) 30%, transparent); }
.pill.blink   { animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.45; } }

/* Cancellation reason — small single line under the pill, never wraps */
.status-sub {
  margin-top: 2px;
  font-size: clamp(10px, 0.85vw, 16px);
  font-weight: 600;
  color: var(--vlate);
  opacity: 0.85;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.c-status { min-width: 0; }

.empty-state {
  display: flex; align-items: center; justify-content: center;
  height: 100%;
  color: var(--ink-faint);
  font-family: var(--font-hi);
  font-size: clamp(18px, 2vw, 40px);
  font-weight: 700;
  line-height: 1.5;
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--pad);
  padding: clamp(8px, 1.1vh, 16px) clamp(14px, 1.8vw, 30px);
  background: linear-gradient(120deg, var(--bg-2), rgba(16,26,51,0.4));
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
}
.powered {
  display: flex; align-items: center;
  gap: clamp(8px, 0.9vw, 18px);
}
.powered-label {
  font-size: clamp(12px, 1.15vw, 22px);
  font-weight: 700;
  color: var(--ink-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}
/* Logo artwork is black — float it on a soft white chip so it reads on the
   dark board without recoloring the brand. */
.powered-chip {
  display: inline-flex; align-items: center;
  background: #fff;
  border-radius: clamp(6px, 0.6vw, 12px);
  padding: clamp(4px, 0.5vh, 8px) clamp(8px, 0.8vw, 16px);
  box-shadow: 0 2px 14px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.12);
}
.powered-chip img {
  display: block;
  height: clamp(22px, 3.2vh, 46px);
  width: auto;
}

.status-bar {
  display: flex; align-items: center; gap: clamp(6px, 0.7vw, 14px);
  font-size: clamp(11px, 1.05vw, 20px);
  font-weight: 600;
  color: var(--ink-dim);
  white-space: nowrap;
}
.status-bar .sep { color: var(--ink-faint); }
.page-info { color: var(--accent-2); font-weight: 700; }
.page-info:not(:empty)::after { content: "·"; color: var(--ink-faint); margin-left: clamp(6px, 0.7vw, 14px); }

/* Live dot: radar ping — an expanding ring says "alive" without reading text */
.dot {
  position: relative;
  width: 0.75em; height: 0.75em; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 12px var(--ok);
}
.dot::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid var(--ok);
  animation: ping 2.2s cubic-bezier(0, 0.6, 0.4, 1) infinite;
}
@keyframes ping {
  0%   { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(3.2); opacity: 0; }
}
.dot.stale { background: var(--late); box-shadow: 0 0 12px var(--late); }
.dot.stale::after { border-color: var(--late); }
.dot.down  { background: var(--vlate); box-shadow: 0 0 12px var(--vlate); }
.dot.down::after { border-color: var(--vlate); animation-duration: 1.1s; }
.status-bar.stale #connText { color: var(--late); }
.status-bar.down #connText  { color: var(--vlate); }

/* ── Boot / error overlay ─────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4,7,15,0.92);
  backdrop-filter: blur(4px);
  transition: opacity 0.4s;
}
.overlay.hide { opacity: 0; pointer-events: none; }
.overlay-card { text-align: center; color: var(--ink-dim); font-size: clamp(16px, 1.6vw, 28px); font-weight: 600; line-height: 1.5; }
.spinner {
  width: clamp(40px, 4vw, 72px); height: clamp(40px, 4vw, 72px);
  margin: 0 auto clamp(14px, 1.4vw, 24px);
  border: 4px solid rgba(255,255,255,0.12);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.overlay.error .spinner { animation: none; border: none; }
.overlay.error .spinner::before { content: "⚠"; font-size: clamp(40px, 4vw, 72px); color: var(--vlate); }

/* ── Accessibility / panel quirks ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .row, .row.vlate, .topbar::after, .flag, .clock, .pf-badge,
  .dot::after, body::before { animation: none !important; }
}

/* Portrait / small-screen: stack a little tighter (some boards are 9:16) */
@media (max-aspect-ratio: 1/1) {
  .rail-chip { display: none; } /* keep flag + centered station name + clock */
}

/* ── Responsive: tablets (≤1000px) — same 6-column layout, compacted ──── */
@media (max-width: 1000px) {
  :root { --row-h: 62px; --pad: 10px; --radius: 10px; }
  .grid {
    grid-template-columns: 62px minmax(0, 1fr) 72px 72px 44px 106px;
    gap: 6px;
    padding: 0 10px;
  }
  .grid-head { min-height: 44px; font-size: 11px; }
  .c-no .num { font-size: 17px; }
  .name-en { font-size: 15px; }
  .name-hi { font-size: 12px; }
  .t-main { font-size: 15px; }
  .t-sub { font-size: 10px; }
  .pf-badge { min-width: 36px; height: 32px; font-size: 16px; border-radius: 8px; }
  .pill { font-size: 11px; padding: 4px 8px; }
  .stn-name { font-size: 22px; }
  .stn-name-hi { font-size: 14px; }
  .clock { font-size: 24px; }
  .date { font-size: 11px; }
  .flag-gif { height: 40px; }
}

/* ── Responsive: phones (≤640px) — rows become 2-line cards ───────────── */
@media (max-width: 640px) {
  :root { --row-h: 118px; } /* approx card height, keeps pagination math right */

  .topbar { grid-template-columns: auto 1fr auto; gap: 10px; padding: 8px 12px; }
  .rail-chip { display: none; }
  .stn-name { font-size: 19px; }
  .stn-name-hi { font-size: 12px; }
  .clock { font-size: 20px; }
  .date { display: none; }
  .flag-gif { height: 34px; }

  /* Column header row is meaningless once cells rewrap — labels move into cells.
     NOTE: the board's row template must collapse with it, else the footer
     inherits the 1fr track meant for .rows. */
  .grid-head { display: none; }
  .board { grid-template-rows: auto 1fr auto; }

  .row { height: auto; }
  .row .grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    row-gap: 4px;
    column-gap: 10px;
    padding: 10px 12px;
    align-items: center;
  }
  /* line 1: number · name · platform  |  line 2: arrival · departure · status */
  .c-no     { grid-column: 1; grid-row: 1; }
  .c-name   { grid-column: 2; grid-row: 1; }
  .c-pf     { grid-column: 3; grid-row: 1; justify-self: end; }
  .c-time:nth-child(3) { grid-column: 1; grid-row: 2; text-align: left; }
  .c-time:nth-child(4) { grid-column: 2; grid-row: 2; text-align: left; }
  .c-status { grid-column: 3; grid-row: 2; justify-self: end; }

  /* In-cell labels replace the hidden column header */
  .c-time:nth-child(3)::before,
  .c-time:nth-child(4)::before {
    display: block;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--ink-faint);
    text-transform: uppercase;
  }
  .c-time:nth-child(3)::before { content: "Arr · आगमन"; font-family: var(--font-hi); }
  .c-time:nth-child(4)::before { content: "Dep · प्रस्थान"; font-family: var(--font-hi); }

  .footer { grid-template-columns: 1fr; gap: 8px; padding: 8px 12px; }
  .powered { justify-content: center; }
  .status-bar { justify-content: center; flex-wrap: wrap; }
}
