/* Trains page (inc/templates/trains.php) */
.trains-page { --led: #ffd166; }
/* ---------- Trains page ---------- */
.tr-hero { padding-block: clamp(1.6rem, 3.5vw, 2.8rem) clamp(1.4rem, 3vw, 2.2rem); position: relative; overflow: hidden; }
.tr-hero::before { content: ""; position: absolute; right: -10%; top: -45%; width: 60%; aspect-ratio: 1; border-radius: 46% 54% 50% 50% / 55% 45% 55% 45%; background: var(--sea); opacity: 0.12; }
.tr-hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.tr-hero .wrap > * { min-width: 0; }
@media (max-width: 880px) { .tr-hero .wrap { grid-template-columns: 1fr; } }
.code { display: inline-flex; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem; }
.code b { font-family: var(--font-display); font-size: 0.9rem; letter-spacing: 0.08em; background: var(--navy); color: #fff; padding: 0.3rem 0.6rem; border-radius: 8px; }
.tr-hero h1 .thin { font-weight: 300; display: block; }
.tr-hero .lede { margin-top: 1rem; color: var(--muted); max-width: 52ch; }
.clockrow { display: flex; align-items: baseline; gap: 0.8rem; margin-top: 1.2rem; flex-wrap: wrap; }
.clock { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.8rem, 3vw, 2.4rem); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.daytype { font-weight: 700; color: var(--muted); font-size: 0.92rem; }

/* next train */
.next { background: var(--navy); color: #fff; border-radius: var(--r); padding: clamp(1.3rem, 2.6vw, 1.9rem); box-shadow: 10px 10px 0 var(--sky); position: relative; }
.next .lbl { font-family: var(--font-display); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sky); }
.next .big { display: flex; align-items: baseline; gap: 0.9rem; margin-top: 0.5rem; flex-wrap: wrap; }
.next .mins { font-family: var(--font-display); font-weight: 800; font-size: clamp(3.4rem, 7vw, 5rem); line-height: 0.9; color: var(--led); font-variant-numeric: tabular-nums; }
.next .unit { font-family: var(--font-display); font-size: 1.3rem; font-weight: 500; }
.next .meta { margin-top: 0.7rem; color: #cfe0f2; font-size: 0.98rem; }
.next .meta b { color: #fff; }
.next .after { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid rgba(255,255,255,0.18); display: flex; gap: 0.5rem; flex-wrap: wrap; font-size: 0.9rem; color: #cfe0f2; }
.next .after span { background: rgba(255,255,255,0.1); border-radius: 999px; padding: 0.25rem 0.7rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }

/* boards */
.boards { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.2rem; }
.boards > * { min-width: 0; }
@media (max-width: 880px) { .boards { grid-template-columns: 1fr; } }
.board { background: #0b1830; color: #fff; border-radius: var(--r); padding: 1.2rem 1.3rem 1rem; border: 2px solid #0b1830; }
.board h2 { font-size: 1.25rem; color: #fff; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.board h2 small { font-family: var(--font-body); font-size: 0.8rem; font-weight: 700; color: #8fa8c6; letter-spacing: 0; }
.board table { width: 100%; border-collapse: collapse; margin-top: 0.8rem; font-variant-numeric: tabular-nums; }
.board th { text-align: left; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: #8fa8c6; font-weight: 800; padding: 0 0 0.45rem; }
.board td { padding: 0.55rem 0; border-top: 1px solid rgba(255,255,255,0.09); font-size: 0.98rem; }
.board td.t { font-family: var(--font-display); font-weight: 800; color: var(--led); width: 4.6rem; font-size: 1.08rem; }
.board td.d b { display: block; font-weight: 800; }
.board td.d span { font-size: 0.82rem; color: #9fb6d2; }
.board td.c { text-align: right; font-weight: 800; color: var(--sky); white-space: nowrap; }
.board .note { margin-top: 0.7rem; font-size: 0.8rem; color: #8fa8c6; }

/* line map */
.lm-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toggle { display: inline-flex; background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 4px; }
.toggle button { border: 0; background: none; font: 800 0.88rem var(--font-body); padding: 0.45rem 0.9rem; border-radius: 999px; cursor: pointer; color: var(--fg); }
.toggle button.on { background: var(--fg); color: var(--bg); }
.linemap { padding: 1.2rem 1rem 0.8rem; overflow: hidden; }
.linemap svg { width: 100%; height: auto; display: block; }
.lm-legend { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: 0.86rem; color: var(--muted); padding: 0.4rem 0.6rem 0; }
.lm-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 0.4rem; vertical-align: -1px; }
.lm-status { font-weight: 700; font-size: 0.92rem; color: var(--muted); font-variant-numeric: tabular-nums; }
svg .track { stroke: var(--line); stroke-width: 6; stroke-linecap: round; fill: none; }
svg .stn { fill: var(--surface); stroke: var(--fg); stroke-width: 2.5; }
svg .stn.end { fill: var(--fg); }
svg .sl { font: 700 12.5px var(--font-body); fill: var(--fg); }
svg .sl.dim { fill: var(--muted); font-weight: 600; }
svg .tout { fill: var(--sea); }
svg .tret { fill: var(--taste); }
svg .tlabel { font: 800 10px var(--font-body); fill: #fff; text-anchor: middle; dominant-baseline: central; }

/* grid sections */
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.g3 > *, .g2 > * { min-width: 0; }
@media (max-width: 900px) { .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .g3, .g2 { grid-template-columns: 1fr; } }
.sec-head { display: grid; gap: 0.5rem; margin-bottom: 1.2rem; max-width: 62ch; }
.stat { padding: 1.1rem 1.2rem; }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.3rem); font-weight: 800; line-height: 1; color: var(--sea); font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 0.4rem; font-weight: 700; font-size: 0.92rem; }
.stat small { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }
.jt { padding: 0.4rem 1.2rem; }
.jt li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-top: 1px solid var(--line); }
.jt li:first-child { border-top: 0; }
.jt ul { list-style: none; margin: 0; padding: 0; }
.jt b { font-variant-numeric: tabular-nums; }
.box { padding: 1.2rem 1.3rem; display: grid; gap: 0.55rem; align-content: start; }
.box h3 { margin-bottom: 0.2rem; }
.box p, .box li { font-size: 0.95rem; color: var(--muted); }
.box ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.3rem; }
.price { display: flex; align-items: baseline; gap: 0.5rem; }
.price b { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; }
.change { display: grid; grid-template-columns: auto 1fr; gap: 0.8rem; align-items: start; padding: 1rem 1.1rem; }
.change .dot { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--ink-on-color); font-size: 0.85rem; }
.change p { font-size: 0.92rem; color: var(--muted); margin-top: 0.2rem; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 5.2rem 1fr; gap: 1rem; padding: 0.75rem 0; border-top: 1px solid var(--line); }
.timeline b { font-family: var(--font-display); font-size: 1.25rem; color: var(--sea); }
.timeline p { color: var(--muted); font-size: 0.95rem; }
.fac { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.7rem; }
.fac div { padding: 0.85rem 1rem; display: flex; gap: 0.7rem; align-items: start; }
.fac i { font-style: normal; font-size: 1.15rem; line-height: 1.3; }
.fac b { display: block; font-size: 0.95rem; }
.fac span { font-size: 0.86rem; color: var(--muted); }
.disclaimer { font-size: 0.86rem; color: var(--muted); margin-top: 1rem; }

/* Bits shared with the old stand-alone page */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel { background: var(--surface); border: 2px solid var(--fg); border-radius: var(--r); box-shadow: 8px 8px 0 var(--sky); }
.muted { color: var(--muted); }
.trains-page section { padding-block: clamp(2rem, 4.5vw, 3.6rem); }
.trains-page h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); }
.trains-page .sec-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); }
.trains-page .board h2 { font-size: 1.25rem; color: #fff; }
.trains-page .kicker { color: var(--sea); }
