/* ===== TRANSIT PAGE =====
   Built for reading at a glance: the planets are the first thing on the page,
   numbers line up (tabular figures), and every state is carried by words as
   well as colour, so it reads the same in print, in both themes and to a
   screen reader. */
.tr-wrap { padding: 6.5rem 0 1rem; position: relative; z-index: 1; }
.tr-wrap button { font: inherit; color: inherit; cursor: pointer; }
.tr-num, .tr-c-lon, .tr-c-speed, .tr-c-nak, .tr-etable td, .tr-evtm, .tr-pv { font-variant-numeric: tabular-nums; }
.tr-g { font-family: 'Segoe UI Symbol', 'Noto Sans Symbols', 'DejaVu Sans', sans-serif; font-variant-emoji: text; color: var(--gold-ink); display: inline-block; width: 1.15em; text-align: center; }

.tr-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem 1.5rem; }
.tr-head h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; }
.tr-asat { font-family: var(--font-ui); font-size: 0.9rem; color: var(--ink-faded); margin-top: 0.25rem; }
.tr-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tr-btn { font-family: var(--font-ui) !important; font-size: 0.85rem; padding: 0.45rem 0.9rem; border: 1px solid var(--parchment-edge); background: var(--parchment-dark); border-radius: 6px; min-height: 40px; }
.tr-btn:hover, .tr-step:hover, .tr-chip:hover, .tr-fchip:hover, .tr-moon:hover { border-color: var(--gold-ink); }

/* moment bar: stays in reach while scrolling the list */
.tr-bar { position: sticky; top: 64px; z-index: 5; margin-top: 1rem; padding: 0.6rem 0; background: var(--parchment-deep); border-bottom: 1px solid var(--parchment-edge); display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; align-items: center; }
.tr-moment { display: flex; align-items: center; gap: 0.35rem; flex-wrap: nowrap; }
.tr-step { min-width: 40px; min-height: 40px; border: 1px solid var(--parchment-edge); background: var(--parchment-dark); border-radius: 6px; font-size: 1.15rem; line-height: 1; }
.tr-dtwrap input { font-family: var(--font-ui); font-size: 0.95rem; padding: 0.45rem 0.5rem; min-height: 40px; border: 1px solid var(--parchment-edge); background: var(--parchment-dark); color: var(--ink); border-radius: 6px; color-scheme: dark; }
[data-theme="light"] .tr-dtwrap input { color-scheme: light; }
.tr-now { font-family: var(--font-ui) !important; font-size: 0.85rem; font-weight: 600; min-height: 40px; padding: 0 0.9rem; border-radius: 6px; border: 1px solid var(--gold-ink); background: transparent; color: var(--gold-ink) !important; }
.tr-now[aria-pressed="true"] { background: var(--gold-ink); color: var(--parchment-deep) !important; }
.tr-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; }
.tr-chip { font-family: var(--font-ui) !important; font-size: 0.78rem; padding: 0.3rem 0.7rem; min-height: 32px; border-radius: 999px; border: 1px solid var(--parchment-edge); background: var(--parchment-mid); }
.tr-chip-more { border-style: dashed; }
.tr-slide { grid-column: 1 / -1; }
.tr-slide input { width: 100%; accent-color: var(--gold-ink); }

/* tabs */
.tr-tabs { display: flex; gap: 0.25rem; margin-top: 1rem; border-bottom: 1px solid var(--parchment-edge); overflow-x: auto; scrollbar-width: none; }
.tr-tabs button { font-family: var(--font-ui) !important; font-size: 0.95rem; background: none; border: 0; border-bottom: 3px solid transparent; padding: 0.6rem 1rem; min-height: 44px; color: var(--ink-faded) !important; white-space: nowrap; }
.tr-tabs button[aria-selected="true"] { color: var(--ink) !important; border-bottom-color: var(--gold-ink); font-weight: 600; }
.tr-panels { padding-top: 1.25rem; }
.tr-h2 { font-family: var(--font-ui); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faded); margin: 0 0 0.6rem; }
.tr-note { font-family: var(--font-ui); font-size: 0.85rem; color: var(--ink-dim); margin: 0.6rem 0; line-height: 1.55; }
.tr-lead { max-width: 60ch; margin-bottom: 0.9rem; }
.tr-rel { font-family: var(--font-ui); font-size: 0.78rem; color: var(--ink-dim); }
.tr-link { background: none; border: 0; padding: 0; color: var(--gold-ink) !important; text-decoration: underline; text-underline-offset: 3px; font-family: var(--font-ui) !important; font-size: 0.85rem; }

/* Now */
.tr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }
.tr-main { display: flex; flex-direction: column; }
.tr-mob { display: none; }
.tr-side { position: sticky; top: 150px; }
.tr-nextup { margin-bottom: 1.25rem; padding: 0.9rem 1rem; border: 1px solid var(--parchment-edge); border-left: 3px solid var(--gold-ink); border-radius: 8px; background: var(--parchment-dark); }
.tr-nextup ul { list-style: none; }
.tr-evbtn { display: flex; flex-wrap: wrap; gap: 0.15rem 0.6rem; width: 100%; text-align: left; background: none; border: 0; padding: 0.35rem 0; border-top: 1px solid var(--parchment-mid); font-family: var(--font-ui) !important; font-size: 0.92rem; }
.tr-nextup li:first-child .tr-evbtn { border-top: 0; }
.tr-evd { color: var(--ink-faded); min-width: 5.5rem; }
.tr-evt { font-weight: 500; }
.tr-evw { margin-left: auto; color: var(--ink-faded); }

.tr-rowhead, .tr-rowbtn { display: grid; grid-template-columns: 7.5rem 8.5rem minmax(8rem, 1fr) 4.5rem minmax(10.5rem, 1.1fr) 1.2rem; gap: 0.75rem; align-items: center; }
.tr-nxd { white-space: nowrap; }
.tr-rowhead { font-family: var(--font-ui); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim); padding: 0 0.75rem 0.4rem; }
.tr-row { border: 1px solid var(--parchment-edge); border-radius: 8px; margin-bottom: 0.4rem; background: var(--parchment-dark); }
.tr-row.is-open { border-color: var(--gold-ink); }
.tr-rowbtn { width: 100%; text-align: left; background: none; border: 0; padding: 0.6rem 0.75rem; min-height: 48px; font-family: var(--font-ui) !important; font-size: 0.95rem; border-radius: 8px; }
.tr-c-name { font-weight: 600; white-space: nowrap; }
.tr-c-lon { font-weight: 500; white-space: nowrap; }
.tr-c-nak, .tr-c-next { color: var(--ink-faded); }
.tr-c-speed { color: var(--ink-dim); font-size: 0.85rem; text-align: right; }
.tr-chev { width: 0.55rem; height: 0.55rem; border-right: 2px solid var(--ink-dim); border-bottom: 2px solid var(--ink-dim); transform: rotate(45deg); justify-self: end; margin-top: -0.2rem; transition: transform 0.15s; }
.tr-row.is-open .tr-chev { transform: rotate(225deg); margin-top: 0.2rem; }
.tr-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0 0.75rem 0.55rem 2.05rem; margin-top: -0.25rem; }
.tr-badge { font-family: var(--font-ui); font-size: 0.72rem; font-weight: 600; padding: 0.12rem 0.5rem; border-radius: 4px; border: 1px solid var(--parchment-edge); background: var(--parchment-mid); color: var(--ink-faded); }
.tr-retro { color: #E07A6B; border-color: currentColor; background: transparent; }
[data-theme="light"] .tr-retro { color: var(--vermillion); }
.tr-comb { color: var(--gold-ink); border-color: var(--gold-ink); }
.tr-soon { border-style: dashed; }
.tr-detail { padding: 0.25rem 0.75rem 0.8rem 2.05rem; border-top: 1px solid var(--parchment-mid); font-family: var(--font-ui); font-size: 0.88rem; }
.tr-dl { display: grid; grid-template-columns: 9.5rem 1fr; gap: 0.75rem; padding: 0.3rem 0; border-bottom: 1px dotted var(--parchment-mid); }
.tr-dt { color: var(--ink-dim); font-size: 0.8rem; }
.tr-detail .tr-link { margin-top: 0.55rem; }

.tr-today { margin-top: 1.75rem; }
.tr-today .tr-h2 + .tr-pgrid { margin-bottom: 1.25rem; }
.tr-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.5rem; }
.tr-pcard { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.6rem 0.75rem; border: 1px solid var(--parchment-edge); border-radius: 8px; background: var(--parchment-dark); font-family: var(--font-ui); }
.tr-pcard.is-now { border-color: var(--vermillion); }
.tr-pv { font-size: 0.95rem; font-weight: 500; line-height: 1.35; }
.tr-chog { margin-top: 0.75rem; font-family: var(--font-ui); font-size: 0.9rem; }
.tr-chog summary { cursor: pointer; color: var(--gold-ink); min-height: 40px; display: flex; align-items: center; }
.tr-ctable { width: 100%; max-width: 32rem; border-collapse: collapse; margin-top: 0.4rem; }
.tr-ctable th, .tr-ctable td { text-align: left; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--parchment-mid); }
.tr-ctable tr.is-now td { background: var(--parchment-mid); font-weight: 600; }

.tr-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.tr-chart-head .tr-h2 { margin: 0; }
.tr-seg { display: inline-flex; border: 1px solid var(--parchment-edge); border-radius: 6px; overflow: hidden; }
.tr-seg button { font-family: var(--font-ui) !important; font-size: 0.8rem; background: var(--parchment-dark); border: 0; padding: 0.35rem 0.7rem; min-height: 36px; }
.tr-seg button + button { border-left: 1px solid var(--parchment-edge); }
.tr-seg button[aria-pressed="true"] { background: var(--gold-ink); color: var(--parchment-deep) !important; font-weight: 600; }
.tr-chart { background: var(--parchment-dark); border: 1px solid var(--parchment-edge); border-radius: 8px; padding: 6px; }
.tr-chart svg { display: block; width: 100%; height: auto; }
.tr-cs-sign { font-family: var(--font-ui); font-size: 10px; fill: var(--ink-dim); }
.tr-cs-num { font-family: var(--font-ui); font-size: 10px; fill: var(--ink-dim); }
.tr-cs-pl { font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; fill: var(--ink); }
.tr-cs-mid { font-family: var(--font-display); font-size: 16px; fill: var(--gold-ink); }
.tr-cs-mid2 { font-family: var(--font-ui); font-size: 11px; fill: var(--ink-faded); }

/* Upcoming */
.tr-filters { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; margin-bottom: 1rem; }
.tr-fchips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tr-fchip { font-family: var(--font-ui) !important; font-size: 0.8rem; padding: 0.3rem 0.7rem; min-height: 36px; border-radius: 999px; border: 1px solid var(--parchment-edge); background: var(--parchment-dark); color: var(--ink-faded) !important; }
.tr-fchip[aria-pressed="true"] { border-color: var(--gold-ink); color: var(--ink) !important; background: var(--parchment-mid); }
.tr-fchip[aria-pressed="true"]::before { content: '\2713\00a0'; color: var(--gold-ink); }
.tr-sel { font-family: var(--font-ui); font-size: 0.85rem; display: inline-flex; align-items: center; gap: 0.4rem; }
.tr-sel select { font-family: var(--font-ui); font-size: 0.9rem; min-height: 38px; padding: 0.3rem 0.5rem; border: 1px solid var(--parchment-edge); background: var(--parchment-dark); color: var(--ink); border-radius: 6px; max-width: 100%; }
.tr-month { font-family: var(--font-display); font-weight: 500; font-size: 1.25rem; margin: 1.25rem 0 0.4rem; color: var(--gold-ink); }
.tr-evlist { list-style: none; border: 1px solid var(--parchment-edge); border-radius: 8px; background: var(--parchment-dark); }
.tr-evlist li + li { border-top: 1px solid var(--parchment-mid); }
.tr-ev { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 0.75rem; align-items: baseline; width: 100%; text-align: left; background: none; border: 0; padding: 0.55rem 0.8rem; font-family: var(--font-ui) !important; }
.tr-ev:hover { background: var(--parchment-mid); }
.tr-evwhen { display: flex; flex-direction: column; line-height: 1.3; }
.tr-evwhen .tr-evd { font-weight: 600; color: var(--ink); min-width: 0; }
.tr-evtm { font-size: 0.8rem; color: var(--ink-faded); }
.tr-evbody { display: flex; flex-direction: column; line-height: 1.35; }
.tr-evm { font-family: var(--font-ui); font-size: 0.8rem; color: var(--ink-dim); display: block; margin-top: 0.1rem; }

/* Gochar */
.tr-moons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.35rem; max-width: 46rem; }
.tr-moon { font-family: var(--font-ui) !important; font-size: 0.85rem; min-height: 40px; border: 1px solid var(--parchment-edge); background: var(--parchment-dark); border-radius: 6px; }
.tr-moon[aria-checked="true"] { background: var(--gold-ink); color: var(--parchment-deep) !important; border-color: var(--gold-ink); font-weight: 600; }
.tr-gcards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 1rem 0; }
.tr-gcard { border: 1px solid var(--parchment-edge); border-radius: 8px; background: var(--parchment-dark); padding: 0.8rem 1rem; font-family: var(--font-ui); }
.tr-gcard h3 { font-family: var(--font-ui); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faded); margin-bottom: 0.3rem; }
.tr-gcard .tr-note { margin: 0.4rem 0 0; }
.tr-toggle { font-family: var(--font-ui); font-size: 0.88rem; display: inline-flex; gap: 0.45rem; align-items: center; min-height: 40px; }
.tr-toggle input { accent-color: var(--gold-ink); width: 18px; height: 18px; }
.tr-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tr-tablewrap:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 2px; }
.tr-gtable, .tr-etable { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: 0.9rem; }
.tr-gtable caption, .tr-etable caption { text-align: left; font-size: 0.82rem; color: var(--ink-faded); padding-bottom: 0.4rem; }
.tr-gtable th, .tr-gtable td, .tr-etable th, .tr-etable td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--parchment-mid); vertical-align: top; }
.tr-gtable thead th, .tr-etable thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-dim); font-weight: 600; border-bottom: 1px solid var(--parchment-edge); }
.tr-gtag { font-weight: 500; }
.tr-gtag.is-good span { color: var(--patina-soft); }
.tr-gtag.is-hard span { color: var(--vermillion); }
[data-theme="light"] .tr-gtag.is-good span { color: var(--patina); }

/* Table */
.tr-tablebar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 0.75rem; }
.tr-tcap { font-family: var(--font-ui); font-size: 0.82rem; color: var(--ink-faded); margin: 0 0 0.4rem; }
.tr-tablebar .tr-h2 { margin: 0; min-width: 9.5rem; text-align: center; font-size: 0.95rem; color: var(--ink); }
.tr-etable { font-size: 0.82rem; white-space: nowrap; }
.tr-etable tbody th { font-weight: 600; position: sticky; left: 0; background: var(--parchment-deep); }
.tr-etable tbody tr:nth-child(7n) td, .tr-etable tbody tr:nth-child(7n) th { border-bottom-color: var(--parchment-edge); }

.tr-method { margin: 2rem 0 0.5rem; border-top: 1px solid var(--parchment-edge); padding-top: 0.75rem; font-family: var(--font-ui); font-size: 0.9rem; }
.tr-method summary { cursor: pointer; color: var(--gold-ink); min-height: 40px; display: flex; align-items: center; }
.tr-method p { margin: 0.5rem 0; max-width: 75ch; color: var(--ink-faded); line-height: 1.6; }

/* settings */
.tr-dialog { margin: auto; border: 1px solid var(--parchment-edge); border-radius: 12px; background: var(--parchment-dark); color: var(--ink); width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; }
.tr-dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
.tr-setform { padding: 1.1rem 1.25rem 1.25rem; font-family: var(--font-ui); font-size: 0.92rem; }
.tr-setform h2 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 0.5rem; }
.tr-setform fieldset { border: 0; border-top: 1px solid var(--parchment-edge); padding: 0.7rem 0 0.4rem; margin: 0; }
.tr-setform legend { font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faded); padding-right: 0.5rem; }
.tr-setform label { display: flex; align-items: center; gap: 0.5rem; min-height: 36px; }
.tr-setform input[type=radio], .tr-setform input[type=checkbox] { accent-color: var(--gold-ink); width: 18px; height: 18px; flex: none; }
.tr-setform .tr-sel { display: flex; flex-wrap: wrap; }
.tr-city { position: relative; }
.tr-city input { width: 100%; font-family: var(--font-ui); font-size: 0.95rem; min-height: 42px; padding: 0.4rem 0.6rem; border: 1px solid var(--parchment-edge); background: var(--parchment-deep); color: var(--ink); border-radius: 6px; }
.tr-city .place-suggestions { position: absolute; left: 0; right: 0; top: 100%; z-index: 3; }
.tr-setbtns { display: flex; justify-content: flex-end; margin-top: 0.75rem; }

.tr-toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1rem); opacity: 0; pointer-events: none; background: var(--ink); color: var(--parchment-deep); font-family: var(--font-ui); font-size: 0.9rem; padding: 0.6rem 1rem; border-radius: 8px; transition: opacity 0.2s, transform 0.2s; z-index: 50; max-width: calc(100vw - 32px); }
.tr-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.tr-content { padding: 1.5rem 0 3rem; }
.tr-content h2 { margin-top: 2rem; }
.tr-content p, .tr-content li { max-width: 72ch; }

@media (max-width: 1100px) {
  .tr-grid { grid-template-columns: minmax(0, 1fr); }
  .tr-side { position: static; max-width: 420px; }
}
@media (max-width: 760px) {
  .tr-wrap { padding-top: 5.5rem; }
  .tr-desk { display: none !important; }
  .tr-bar { grid-template-columns: minmax(0, 1fr); position: static; }   /* too tall to pin on a phone */
  .tr-bar > * { min-width: 0; }
  /* date box on its own row; previous day, Now and next day share the row below */
  .tr-moment { flex-wrap: wrap; }
  .tr-dtwrap { order: -1; flex: 1 1 100%; min-width: 0; }
  .tr-dtwrap input { width: 100%; min-width: 0; font-size: 16px; }
  .tr-moment .tr-step, .tr-moment .tr-now { flex: 1 1 0; font-family: var(--font-ui); font-size: 0.95rem; }
  .tr-mob { display: inline; }
  .tr-wide { display: none; }
  /* the positions first on a phone; what is coming next sits under them */
  .tr-rows { order: 1; } .tr-nextup { order: 2; margin: 1rem 0 0; } .tr-today { order: 3; }
  .tr-head { flex-wrap: nowrap; align-items: flex-start; }
  .tr-actions { flex-wrap: nowrap; }
  .tr-actions .tr-btn { padding: 0.35rem 0.6rem; font-size: 0.8rem; min-height: 36px; }
  .tr-chips { justify-content: flex-start; }
  .tr-chip { white-space: nowrap; }
  .tr-rowhead { display: none; }
  .tr-rowbtn { grid-template-columns: minmax(0, 1fr) auto 1.2rem; grid-template-areas: "name lon chev" "nak next chev"; gap: 0.1rem 0.75rem; }
  .tr-c-name { grid-area: name; } .tr-c-lon { grid-area: lon; text-align: right; } .tr-chev { grid-area: chev; }
  .tr-c-nak { grid-area: nak; font-size: 0.83rem; } .tr-c-next { grid-area: next; font-size: 0.83rem; text-align: right; }
  .tr-c-speed { display: none; }
  .tr-badges, .tr-detail { padding-left: 0.75rem; }
  .tr-dl { grid-template-columns: 1fr; gap: 0; }
  .tr-evw { margin-left: 0; width: 100%; }
  .tr-ev { grid-template-columns: 4.5rem 1fr; }
  .tr-ev > .tr-rel { grid-column: 2; }
  .tr-moons { grid-template-columns: repeat(3, 1fr); }
  .tr-gcards { grid-template-columns: 1fr; }
  .tr-side { max-width: none; }
  .tr-pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .tr-chev, .tr-toast { transition: none; } }

@media print {
  .navbar, .site-footer, footer, .tr-actions, .tr-bar, .tr-tabs, .tr-method, .tr-seg, .tr-link, .tr-chog summary, .tr-filters, .tr-tablebar button, .tr-tablebar .tr-sel, .tr-content, .tr-toast, .nv-gate, .booking-bar { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  body::before { display: none !important; }
  .tr-wrap { padding-top: 0; }
  .tr-grid { grid-template-columns: 1fr 260px; gap: 1rem; }
  .tr-side { position: static; }
  .tr-row, .tr-pcard, .tr-nextup, .tr-chart, .tr-evlist { background: #fff !important; border-color: #999 !important; break-inside: avoid; }
  .tr-chog[open] summary, .tr-chog { display: block; }
  body.tr-print-table .tr-wrap > .tr-head, body.tr-print-table #panel-now, body.tr-print-table #panel-upcoming, body.tr-print-table #panel-gochar { display: none !important; }
  body.tr-print-table #panel-table { display: block !important; }
  .tr-etable { font-size: 8.5pt; }
  .tr-etable tbody th { background: #fff !important; }
  * { color: #000 !important; }
  .tr-cs-pl, .tr-cs-sign, .tr-cs-num, .tr-cs-mid, .tr-cs-mid2 { fill: #000 !important; }
}
