/* Trip screens: Trip, Day, Map and Packet views (docs/architecture.md 12.1, 12.3–12.5, 12.8, 12.9). Owner: trip UI.
   Phone first; desktop at 900 px. Every class here starts with t- or tv- so shell styles and these never collide.
   Day colors: --dc is the stroke color, --dt the text/button color (colorInk on light, the lifted color on dark),
   --don the text on a --dt fill. Elements that carry a route set --dc/--dcd/--dci inline (common.js colorVars). */

.tv { --dt: var(--ink); --don: var(--bg); font-variant-ligatures: none }   /* Overpass Mono joins "ffl" */
.tsheet { font-variant-ligatures: none }
.t-mid { font-family: var(--font-mono); font-weight: 400 }   /* Overpass's middot sits against the next word */
[style*="--dci"] { --dt: var(--dci); --don: #fff }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) [style*="--dci"] { --dc: var(--dcd); --dt: var(--dcd); --don: #10161D } }
:root[data-theme="dark"] [style*="--dci"] { --dc: var(--dcd); --dt: var(--dcd); --don: #10161D }

.tv .sec[hidden] { display: none }
.tv [data-zone] > .sec:not([hidden]) ~ .sec:not([hidden]), .t-tripgrid > .sec:not([hidden]) ~ .sec:not([hidden]) { margin-top: 18px }
.tv h2 { font-size: clamp(24px, 6vw, 34px) }
.tv h3 { font-size: 19px; margin-bottom: 10px }
.t-block > h2 { margin: 4px 0 10px }
.t-lede { font-size: 17px; line-height: 1.5; color: var(--ink); max-width: 64ch }
.t-hint { font-size: 15px; color: var(--ink-3); margin-bottom: 10px }
.t-attrib { font-size: 12px; line-height: 1.35; color: var(--ink-3); margin-top: 6px }
.t-b56 { min-height: 56px }
.t-b48 { min-height: 48px }
:is(.tv, .tsheet) .btn .ic { width: 20px; height: 20px }   /* base .ic is 22; shell.css sizes only .shell buttons */
.tv .chip { white-space: normal }
.lvl { width: 22px; height: 22px; flex: none; display: inline-block; vertical-align: middle }
.chip .lvl { width: 14px; height: 14px }
.t-alt { font: 800 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase }
.t-dayswatch { width: 12px; height: 12px; border-radius: 50%; background: var(--dc); flex: none; display: inline-block }
.t-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px }
.t-when { display: flex; flex-wrap: wrap; gap: 6px }

/* images: aspect-ratio boxes; a missing file becomes a captioned --sunk block (11.3) */
.t-fig { margin: 0 }
.t-img, .t-imgbox { position: relative; background: var(--sunk); overflow: hidden }
.t-img { border-radius: 10px }
.t-img img { width: 100%; height: 100%; object-fit: cover }
.t-fig figcaption { display: grid; gap: 2px; margin-top: 7px; font-size: 14px; line-height: 1.35 }
.t-fig figcaption small { color: var(--ink-3); font-size: 12px }
.t-fig figcaption a, .t-covercred a, .t-herocap a { color: inherit }
.t-img.missing, .t-imgbox.missing { display: grid; place-items: center; min-height: 120px; border: 1.5px dashed var(--rule) }
.t-img.missing::after, .t-imgbox.missing::after { content: attr(data-cap); padding: 12px 16px; font-size: 14px; color: var(--ink-3); text-align: center; max-width: 36ch }
.t-imgbox.missing img, .t-img.missing img { display: none }

/* ---------------------------------------------------------------- Trip tab */
.t-tripgrid { display: grid; grid-template-columns: max(16px, var(--safe-l)) minmax(0, 1fr) max(16px, var(--safe-r)); padding-bottom: 8px }
.t-tripgrid > .sec { grid-column: 2 }
.t-tripgrid > .sec-cover { grid-column: 1 / -1; margin-top: 0 !important }
.t-tripgrid > .sec-banner:not([hidden]) { margin-bottom: 12px; margin-top: 12px }

.t-cover { position: relative; height: 200px; background: #1a1f26; color: #fff; overflow: hidden }
.t-coverimg { position: absolute; inset: 0; background: #1a1f26 }
.t-coverimg img { width: 100%; height: 100%; object-fit: cover; filter: none }
.t-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,12,18,.9) 0%, rgba(8,12,18,.45) 55%, rgba(8,12,18,.1) 100%); pointer-events: none }
.t-cover.noimg { background: var(--guide) }
.t-covertext { position: absolute; inset: auto 0 0 0; z-index: 1; padding-bottom: 14px }
.t-covereye { font: 700 12px/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: #E9E4D6 }
.t-cover h1 { font-size: clamp(30px, 8vw, 54px); margin: 6px 0 8px; color: #fff; max-width: 16ch }
.t-coverstats { display: flex; flex-wrap: wrap; gap: 4px 22px; font: 600 13px/1.25 var(--font-mono); color: #F1EEE6 }
.t-coverstats b { display: block; font: 800 20px/1.1 var(--font-display); color: #fff }
.t-covercred { position: absolute; top: 8px; right: max(10px, var(--safe-r)); z-index: 1; margin: 0; font-size: 11px; color: #F1EEE6; background: rgba(8,12,18,.55); padding: 3px 7px; border-radius: 6px; max-width: 70% }
.t-imgbox.missing.t-coverimg { border: 0 }

.t-now { background: var(--surface); border: 1px solid var(--rule); border-left: 6px solid var(--dc); border-radius: var(--radius); padding: 14px 16px 16px; display: grid; gap: 6px }
.t-noweye { font: 700 12px/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dt); display: flex; align-items: center; gap: 8px }
.t-livedot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--okbg) }
.t-now h2 { font-size: 24px }
.t-now ul { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 8px }
.t-now li { display: grid; gap: 1px; font-size: 16px; line-height: 1.4 }
.t-nowk { font: 700 12px/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 6px }
.t-now li.due span:last-child { color: var(--warnink); font-weight: 600 }
.t-nowgo { justify-self: start; background: var(--dt); border-color: var(--dt); color: var(--don) }

/* guide sign (green, white border, Overpass) as the day list */
.t-guide { background: var(--guide); color: #fff; border-radius: 12px; padding: 6px; box-shadow: 0 1px 0 rgba(0,0,0,.06); margin-top: 14px }
.t-guide > div { border: 3px solid #fff; border-radius: 8px; padding: 10px 12px 6px }
.t-gtop { font: 800 12px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; opacity: .92; margin-bottom: 4px }
.t-guide ul { list-style: none; margin: 0; padding: 0 }
.t-guide li { border-top: 2px solid rgba(255,255,255,.3) }
.t-guide li:first-child { border-top: 0 }
.t-guide li > a, .t-guide li { color: #fff; text-decoration: none }
.t-guide li > a, .tv-packet .t-guide li { display: grid; grid-template-columns: 2.6em minmax(0, 1fr) auto 26px; align-items: center; gap: 10px; min-height: 56px; padding: 6px 0 }
.t-guide small { font: 700 12px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; opacity: .9 }
.t-gname { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0 }
.t-gtxt { font: 800 clamp(18px, 4.6vw, 24px)/1.1 var(--font-display); overflow-wrap: anywhere }
.t-gtimes { flex-basis: 100%; font: 600 13px/1.2 var(--font-mono); opacity: .92 }
.t-gmi { font: 900 clamp(20px, 5vw, 26px)/1 var(--font-display); white-space: nowrap }
.t-gmi i { font-style: normal; font-size: .58em; font-weight: 700; margin-left: 3px }
.t-plaque { display: inline-block; background: #fff; color: #141D27; border: 2px solid #141D27; border-radius: 3px; font: 800 11px/1 var(--font-display); letter-spacing: .1em; text-transform: uppercase; padding: 4px 6px 3px; align-self: center }
.t-guide .lvl { width: 26px; height: 26px }
.tv-packet .t-guide li { grid-template-columns: 2.6em minmax(0, 1fr) auto }
.t-guide li > a:focus-visible { outline-color: #fff; box-shadow: 0 0 0 6px var(--signal) }

/* overview map: base image + client-drawn routes + top fragment; HTML legend and attribution */
.t-ovmap { position: relative; margin: 0 }
.t-ovmap > a { display: block; color: inherit }
.t-ovbox { position: relative; border-radius: 14px; border: 1px solid var(--rule) }
.t-ovbox img { width: 100%; height: 100%; filter: none }
.t-ovsvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none }
.ovcase { fill: none; stroke: #fff; stroke-width: 6.5; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: .95 }
.ovline { fill: none; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round }
.t-ovlegend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--ink-2) }
.t-ovlegend li { display: flex; align-items: center; gap: 8px }
.t-lgline { width: 26px; height: 6px; border-radius: 3px; box-shadow: 0 0 0 2px #fff; flex: none }
.t-lgflag { width: 14px; height: 16px; flex: none; background: linear-gradient(var(--ink), var(--ink)) 0 0 / 2px 100% no-repeat; position: relative }
.t-lgflag::after { content: ""; position: absolute; left: 2px; top: 0; width: 11px; height: 8px; background: repeating-conic-gradient(var(--ink) 0 25%, var(--surface) 0 50%) 0 0 / 5.5px 4px }
.t-ovlegend .t-alt { background: var(--signal); color: #141D27; padding: 2px 4px; border-radius: 3px }

.t-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin: 4px 0 0 }
.t-facts div { border-top: 2px solid var(--ink); padding-top: 8px }
.t-facts dt { font: 600 12px/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3) }
.t-facts dd { margin: 4px 0 0; font: 800 21px/1.1 var(--font-display) }
.t-facts dd small { display: block; font: 500 14px/1.35 var(--font-body); color: var(--ink-2); margin-top: 3px }
.sec-facts .t-fig { margin-top: 18px }

.t-alts { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px }
.t-alts li { background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; display: grid; gap: 6px; align-content: start }
.t-althead { display: flex; justify-content: space-between; gap: 10px; align-items: baseline }
.t-althead b { font: 800 18px/1.2 var(--font-display) }
.t-althead .num { font-size: 14px; color: var(--ink-3); white-space: nowrap }
.t-alts p { font-size: 15px; color: var(--ink-2); line-height: 1.45 }
.t-altacts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px }

.t-banner { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--rule); border-left: 5px solid var(--county); border-radius: 12px; padding: 8px 8px 8px 12px; font-size: 15px; line-height: 1.35 }
.t-banner p { flex: 1; min-width: 0 }
.t-banner .btn { min-height: 48px }

/* ---------------------------------------------------------------- Day tab */
.t-daywrap { padding-top: 12px }
.t-cols > [data-zone] { min-width: 0 }
.t-cols { margin-top: 18px }
.t-cols > [data-zone="r"]:not(:empty) { margin-top: 18px }
[data-zone="bot"]:not(:empty) { margin-top: 18px }

.t-zone-pv { position: sticky; top: calc(var(--topbar-h) + var(--safe-t)); z-index: 15 }
.t-previewbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: var(--signal); color: #141D27; padding: 8px max(16px, var(--safe-r)) 8px max(16px, var(--safe-l)); box-shadow: 0 2px 8px rgba(0,0,0,.15) }
.t-previewbar p { flex: 1 1 180px; font: 800 17px/1.2 var(--font-display) }
.t-previewbar p span { font: 700 12px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; display: block; margin-bottom: 3px }
.t-pvacts { display: flex; gap: 8px }
.t-previewbar .btn { min-height: 48px; color: #141D27; border-color: #141D27; background: transparent }
.t-previewbar .t-pvuse { background: #141D27; color: #fff }

.t-hero { position: relative; height: 160px; border-radius: 14px; overflow: hidden; background: #1a1f26; color: #fff }
.t-hero.tall { height: clamp(220px, 34vw, 380px) }
.t-heroimg { position: absolute; inset: 0; background: #1a1f26 }
.t-heroimg img { width: 100%; height: 100%; object-fit: cover; filter: none }
.t-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,12,18,.88), rgba(8,12,18,0) 75%); pointer-events: none }
.t-hero.noimg { height: auto; background: none; color: var(--ink) }
.t-hero.noimg::after { display: none }
.t-herotext { position: absolute; inset: auto 0 0 0; z-index: 1; padding: 0 14px 12px }
.t-hero.noimg .t-herotext { position: static; padding: 0 }
.t-herotext h2 { color: inherit; font-size: clamp(24px, 6.4vw, 40px) }
.t-dtag { display: inline-block; font: 700 12px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; background: var(--dt); color: var(--don); padding: 6px 8px 5px; border-radius: 6px; margin-bottom: 8px }
.t-herocap { position: absolute; top: 6px; right: 8px; z-index: 1; margin: 0; font-size: 11px; color: #F1EEE6; background: rgba(8,12,18,.55); padding: 3px 7px; border-radius: 6px; max-width: 70%; text-align: right; line-height: 1.3 }
.t-herocap small { display: block }
.t-heroimg.missing { border: 0 }

.t-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: 3px solid var(--dc); border-bottom: 1px solid var(--rule) }
.t-stats div { padding: 10px 10px 10px 0 }
.t-stats div:not(:nth-child(3n+1)) { padding-left: 10px; border-left: 1px solid var(--rule) }
.t-stats div:nth-child(n+4) { border-top: 1px solid var(--rule) }
.t-stats dt { font: 600 11.5px/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3) }
.t-stats dd { margin: 4px 0 0; font: 600 clamp(15.5px, 4.3vw, 19px)/1.15 var(--font-mono); letter-spacing: -0.03em; overflow-wrap: anywhere }

/* live / morning / done card */
.t-live { background: var(--surface); border: 1px solid var(--rule); border-top: 6px solid var(--dc); border-radius: var(--radius); padding: 14px 16px 16px; display: grid; gap: 8px; box-shadow: var(--shadow); font-size: 20px }
.t-liveeye { font: 700 14px/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dt) }
.t-livename { font: 900 28px/1.08 var(--font-display); letter-spacing: -0.01em; overflow-wrap: anywhere }
.tv .t-livename { font-size: 28px }   /* beats .tv h2's clamp(24px…) */
.t-liveeta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px }
.t-liveeta time { font: 700 38px/1 var(--font-mono); letter-spacing: -0.03em; color: var(--ink) }
.t-liveeta time small { font-size: .5em; letter-spacing: 0; margin-left: .2em }
.t-etal, .t-rel { font: 600 20px/1.2 var(--font-body); color: var(--ink-2) }
.t-delta { font: 700 20px/1 var(--font-mono); padding: 6px 10px 5px; border-radius: 999px; background: var(--sunk); color: var(--ink) }
.t-delta.late { background: var(--warnbg); color: var(--warnink) }
.t-delta.early { background: var(--okbg); color: var(--ok) }
.t-livesub { font-size: 20px; line-height: 1.3; color: var(--ink) }
.t-livelines { list-style: none; margin: 2px 0 4px; padding: 0; display: grid; gap: 6px }
.t-livelines li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 20px; line-height: 1.3 }
.t-livelines .ic { width: 22px; height: 22px; margin-top: 2px; color: var(--ink-2) }
.t-primary { min-height: 64px; width: 100%; font-size: 22px; background: var(--dt); border-color: var(--dt); color: var(--don); white-space: normal; text-align: center; line-height: 1.15; padding: 8px 16px }
.t-secrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px }
.t-secrow .btn { min-height: 56px; padding: 0 8px; font-size: 16px; white-space: normal; text-align: center; line-height: 1.1 }
.t-secrow .ic { width: 20px; height: 20px }
.t-linkbtn { justify-self: start; min-height: 48px; padding: 0 2px; border: 0; background: none; color: var(--county); font: 700 17px/1 var(--font-display); text-decoration: underline; text-underline-offset: 3px; cursor: pointer }
.t-viewnote { font-size: 16px }
.t-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 2px 12px; border-top: 1px solid var(--rule); margin-top: 4px; padding-top: 4px }
.t-switchrow { display: flex; align-items: center; gap: 10px; min-height: 52px; font: 700 16px/1.15 var(--font-display); cursor: pointer }
.t-switchrow small { display: block; font: 500 13px/1.2 var(--font-mono); color: var(--ink-3) }
.t-switchrow input { appearance: none; -webkit-appearance: none; width: 52px; height: 32px; border-radius: 999px; background: var(--rule); position: relative; flex: none; margin: 0; cursor: pointer; transition: background .2s }
.t-switchrow input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s }
.t-switchrow input:checked { background: var(--guide) }
.t-switchrow input:checked::after { transform: translateX(20px) }
.t-morning .t-liveeta time { font-size: 40px }
.t-wxlist { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px }
.t-wx { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding: 8px 10px; border-radius: 10px; background: var(--sunk); font-size: 16px; line-height: 1.3 }
.t-wx b { font-family: var(--font-display); overflow-wrap: anywhere }
.t-wx time { font: 600 15px/1.3 var(--font-mono) }
.t-wx span { grid-column: 1 / -1; font: 600 15px/1.35 var(--font-mono); color: var(--ink-2) }
.t-wx.warn { background: var(--warnbg) } .t-wx.warn span { color: var(--warnink) }
.t-wx.alert { background: var(--nobg) } .t-wx.alert span { color: var(--no) }
.t-wxnote { font-size: 16px; display: flex; gap: 8px; align-items: center }
.t-ready { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); font-size: 16px; line-height: 1.35 }
.t-ready > span:not(.spinner) { flex: 1 1 200px }
.t-ready.no { background: var(--warnbg); border-color: transparent; color: var(--warnink) }
.t-ready .spinner { width: 20px; height: 20px; border-width: 2px }
.tv .t-done .t-livename { font-size: 30px }

/* heads-up */
.t-heads { display: grid; gap: 8px }
.t-rec { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 6px 12px 12px; border-radius: 12px; border: 1px solid var(--rule); background: var(--surface) }
.t-rec .lvl { width: 28px; height: 28px; margin-top: 1px }
.t-rec.lvl-warn { background: var(--warnbg); border-color: transparent }
.t-rec.lvl-alert { background: var(--nobg); border-color: transparent }
.t-recbody b { font: 800 17px/1.25 var(--font-display); display: block }
.t-recbody p { font-size: 15px; line-height: 1.45; color: var(--ink); margin-top: 3px }
.t-recacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px }
.t-recacts .btn { background: var(--surface); white-space: normal; text-align: left; line-height: 1.15; padding: 6px 14px; border-radius: 24px }
.t-recbody .t-recbail { margin-top: 8px; font-size: 15px; color: var(--ink-2) }
.t-recbody .t-recbail b { display: inline; font: inherit; font-weight: 800; color: var(--ink) }
.t-recx { margin: -6px 0 0 }
.t-recfix { margin-top: 8px !important; padding-top: 8px; border-top: 1px solid rgba(0,0,0,.12) }
.t-rec.gone { opacity: .5 }
.t-headsmore { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink); font: 700 15px/1 var(--font-display); justify-self: start; cursor: pointer }
.t-headsheet .sheetbody { gap: 10px }

/* route switcher */
.t-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; width: 100%; min-height: 52px; padding: 8px 14px; border: 1.5px solid var(--rule); border-left: 6px solid var(--dc); border-radius: 12px; background: var(--surface); color: var(--ink); font: 400 16px/1.25 var(--font-body); text-align: left; cursor: pointer }
.t-swlead { font: 700 12px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3) }
.t-switch b { font: 800 17px/1.2 var(--font-display); flex: 1 1 auto; min-width: 0 }
.t-swmore { display: inline-flex; align-items: center; gap: 2px; font: 700 14px/1 var(--font-mono); color: var(--dt); margin-left: auto }
.t-swmore .ic { width: 18px; height: 18px }
.t-switchhint { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px 10px; align-items: start; margin-top: 8px; padding: 10px 12px; background: var(--warnbg); color: var(--warnink); border-radius: 12px; font-size: 15px }
.t-switchhint .btn { grid-column: 2; justify-self: start }
.t-swcard { display: grid; gap: 6px; width: 100%; padding: 12px 14px; border: 1.5px solid var(--rule); border-left: 6px solid var(--dc); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: left; font: 400 15px/1.35 var(--font-body); cursor: pointer }
.t-swcard.active { border-color: var(--dc) }
.t-swtop { display: flex; justify-content: space-between; align-items: baseline; gap: 10px }
.t-swtop b { font: 800 18px/1.2 var(--font-display) }
.t-inuse, .t-tag { font: 700 11px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; padding: 5px 7px 4px; border-radius: 5px; background: var(--sunk); color: var(--ink-2); white-space: nowrap }
.t-inuse { background: var(--dt); color: var(--don) }
.t-swnums { display: flex; flex-wrap: wrap; gap: 2px 14px; font: 500 14px/1.4 var(--font-mono); color: var(--ink-2) }
.t-swnums b { color: var(--ink); font-weight: 700 }
.t-swfuel { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2) }
.t-swfuel .lvl { width: 18px; height: 18px }
.t-swnote { color: var(--ink-2) }

/* timeline */
.t-tl { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule) }
.t-tlrow { border-bottom: 1px solid var(--rule); position: relative }
.t-tlrow.folded { display: none }
.t-tlsum { display: grid; grid-template-columns: 60px 30px minmax(0, 1fr) 22px; gap: 0 10px; align-items: start; width: 100%; min-height: 56px; padding: 10px 0; border: 0; background: none; color: inherit; text-align: left; font: inherit; cursor: pointer }
.t-tl.packet .t-tlsum { grid-template-columns: 60px 30px minmax(0, 1fr); cursor: default }
.t-tl.packet .t-tlrow::before { display: none }
.t-tltime { display: grid; justify-items: end; gap: 1px; padding-top: 1px }
.t-tltime time { font: 600 17px/1.2 var(--font-mono); color: var(--ink) }
.t-tltime .t-ge { font-size: 12px; margin-right: 1px }
.t-tltime s { font: 500 12px/1.2 var(--font-mono); color: var(--ink-3) }
.t-tld { font: 600 13px/1.2 var(--font-mono); color: var(--ink) }
.t-badge { width: 28px; height: 28px; border-radius: 50%; background: var(--dt); color: var(--don); font: 800 15px/29px var(--font-display); text-align: center; display: block; position: relative }
.t-badge.flag { background: var(--ink) }
.t-badge.flag::before { content: ""; position: absolute; left: 10px; top: 6px; width: 2px; height: 16px; background: var(--bg) }
.t-badge.flag::after { content: ""; position: absolute; left: 12px; top: 7px; width: 9px; height: 7px; background: var(--bg); clip-path: polygon(0 0, 100% 40%, 0 80%) }
.t-dot { width: 12px; height: 12px; margin: 6px 0 0 8px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ink-3); display: block }
.t-tlmain { min-width: 0 }
.t-tlmain b { font: 800 17px/1.25 var(--font-display) }
.t-tlmi { font: 500 12.5px/1 var(--font-mono); color: var(--ink-3); margin-left: 8px; white-space: nowrap }
.t-tlchev { width: 20px; height: 20px; margin-top: 4px; color: var(--ink-3); transition: transform .2s }
.t-tlsum[aria-expanded="true"] .t-tlchev { transform: rotate(180deg) }
.t-tlnote { padding: 0 0 12px 110px; margin-top: -8px; font-size: 15px; line-height: 1.45; color: var(--ink-2) }
.t-tlrow.pass .t-tlmain b { font-weight: 700; font-size: 16px }
.t-tlrow.s-done .t-tltime time, .t-tlrow.s-done .t-tlmain b { color: var(--ink-2) }
.t-tlrow.s-next::before, .t-tlrow.s-here::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 2px; background: var(--dc) }
.t-tlrow.s-due .t-tltime time { color: var(--warnink) }
.t-tlrow.skipped .t-tlmain b, .t-tlrow.skipped .t-tltime time { text-decoration: line-through; color: var(--ink-3) }
.t-tlx { padding: 2px 0 14px 0 }
.t-tltimes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; margin: 0 0 10px; padding: 10px 12px; background: var(--sunk); border-radius: 10px }
.t-tltimes dt { font: 600 11px/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3) }
.t-tltimes dd { margin: 2px 0 0; font: 600 15px/1.3 var(--font-mono) }
.t-tlacts { display: flex; flex-wrap: wrap; gap: 8px }
.t-tlacts .btn { flex: 1 1 140px; min-height: 56px }
.t-tlacts .btn.primary { background: var(--dt); border-color: var(--dt); color: var(--don) }
.t-bail { display: grid; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--rule) }
.t-bail p { display: flex; gap: 8px; font-size: 15px }
.t-bail .lvl { width: 16px; height: 16px; margin-top: 3px; color: var(--county) }
.t-tlfold { border-bottom: 1px solid var(--rule) }
.t-foldbtn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 56px; padding: 0 4px; border: 0; background: none; color: var(--ink-2); font: 700 16px/1 var(--font-display); cursor: pointer }
.t-foldbtn .ic:first-child { color: var(--ok) }

/* map windows */
.t-mapwin { margin: 0 }
.t-mwbox { display: block; position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--rule); background: var(--sunk); color: inherit; text-decoration: none }
.t-mwlayer { position: relative; width: 100% }
.t-mwlayer img { width: 100%; height: 100%; max-width: none; filter: none }
.t-mapwin.crop .t-mwbox { height: 220px }
.t-mapwin.crop .t-mwlayer { position: absolute }
.t-mwopen { position: absolute; right: 8px; bottom: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: var(--surface); color: var(--ink); font: 700 14px/1 var(--font-display); box-shadow: var(--shadow) }
.t-mwopen .ic { width: 18px; height: 18px }
.t-mk { position: absolute; width: 0; height: 0; z-index: 1; pointer-events: none }
.t-mk::before { content: ""; position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); border-radius: 50% }
.t-mk.gps::before { width: 18px; height: 18px; background: #1F6FEB; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(31,111,235,.25), 0 1px 4px rgba(0,0,0,.4) }
.t-mk.rider::before { width: 18px; height: 18px; background: var(--rc, var(--dt)); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45) }
.t-mk.rider .t-mklabel { border-left: 4px solid var(--rc, var(--dt)) }
.t-mk.next::before { width: 34px; height: 34px; border: 4px solid var(--dt); background: transparent; box-shadow: 0 0 0 2px #fff, inset 0 0 0 2px #fff }
.t-mkhead { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; transform-origin: 50% 50% }
.t-mkhead::before { content: ""; position: absolute; left: 3px; top: -17px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 14px solid #1F6FEB; filter: drop-shadow(0 0 1px #fff) }
.t-mklabel { position: absolute; left: 14px; top: -12px; white-space: nowrap; font: 700 12px/1 var(--font-mono); background: var(--surface); color: var(--ink); padding: 5px 7px 4px; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.25) }

/* profile */
.t-prof { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 10px 6px 8px }
.t-profbox { touch-action: pan-y; user-select: none; -webkit-user-select: none; min-height: 120px; border-radius: 8px; cursor: crosshair }
.t-profbox svg { display: block; width: 100%; height: auto; overflow: visible }
.t-profwait { padding: 40px 12px; text-align: center }
.t-profread { min-height: 2.8em; padding: 6px 8px 0; font: 400 15px/1.4 var(--font-body); color: var(--ink-2) }
.t-profsvg .pg { stroke: var(--rule); stroke-width: 1 }
.t-profsvg .pt { fill: var(--ink-3); font: 500 12px var(--font-mono) }
.t-profsvg .pa { fill: var(--dc); fill-opacity: .16 }
.t-profsvg .pln { fill: none; stroke: var(--dc); stroke-width: 2.5; stroke-linejoin: round }
.t-profsvg .pd { fill: var(--surface); stroke: var(--dc); stroke-width: 2.5 }
.t-profsvg .pl { fill: var(--ink); font: 700 12.5px var(--font-display); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round }
.t-profsvg .plead { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3 }
.t-profsvg .pgps { stroke: var(--dt); stroke-width: 2; stroke-dasharray: 4 4 }
.t-profsvg .pgpsd { fill: var(--dt); stroke: var(--surface); stroke-width: 2.5 }
.t-profsvg .pscrub { stroke: var(--ink); stroke-width: 1.5 }
.t-profsvg .pscrubd { fill: var(--ink); stroke: var(--surface); stroke-width: 2 }

/* road book cards, notes, legs, GPX, photos */
.t-rb { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px }
.t-rbc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface) }
.t-rbc.here { border-color: var(--dc); box-shadow: inset 4px 0 0 var(--dc) }
.t-rbmile { font: 600 12.5px/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3) }
.t-rblen { font: 600 14px/1.2 var(--font-mono); color: var(--ink-2); text-align: right; grid-row: 1 / 3; grid-column: 2; align-self: center }
.t-rbroad { display: flex; align-items: center; gap: 8px; min-width: 0 }
.t-rbroad b { font: 800 17px/1.2 var(--font-display) }
.t-rbroad .sh, .t-rbt .sh { width: 26px; height: 28px; flex: none }
.t-rbc p { grid-column: 1 / -1; font-size: 15px; line-height: 1.45; color: var(--ink-2) }
.t-rbc .t-chips { grid-column: 1 / -1; margin-top: 2px }
.t-notes { display: grid; gap: 14px }
.t-notes h4 { display: flex; align-items: center; gap: 8px; color: var(--ink) }
.t-notes h4 .ic { width: 18px; height: 18px }
.t-notes p, .t-notes li { font-size: 15px; line-height: 1.5; color: var(--ink-2) }
.t-notes ul { margin: 0; padding-left: 18px; display: grid; gap: 4px }
.t-watch h4::before { content: ""; width: 14px; height: 14px; background: var(--signal); transform: rotate(45deg); border-radius: 2px; box-shadow: inset 0 0 0 2px #141D27; margin: 0 2px }
.t-legs { display: flex; flex-wrap: wrap; gap: 10px }
.t-leg { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink); text-decoration: none; font: 700 15px/1.2 var(--font-display) }
.t-leg span { font: 600 12px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--don); background: var(--dt); padding: 5px 7px 4px; border-radius: 5px; white-space: nowrap }
.t-leg.next { border-color: var(--dc) }
.t-leg em { font: 700 11px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; font-style: normal; color: var(--dt) }
.t-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
.t-strip .t-img { aspect-ratio: 4 / 3 !important }
.t-profread.scrub { font-family: var(--font-mono); font-weight: 600 }

/* sheets opened by the trip screens (rendered into <body>) */
.tsheet .sheetacts .btn { min-height: 56px }
.tsheet .sheetacts { flex-direction: column-reverse }
@media (min-width: 900px) { .tsheet .sheetacts { flex-direction: row } }
.t-otsheet .sheetbody { justify-items: center; text-align: center }
.t-seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; border: 1.5px solid var(--rule); border-radius: 12px; overflow: hidden }
.t-segb { min-height: 52px; border: 0; background: var(--surface); font: 700 16px/1 var(--font-display); cursor: pointer }
.t-segb[aria-checked="true"] { background: var(--ink); color: var(--bg) }
.t-otread { display: block; font: 700 40px/1.1 var(--font-mono); letter-spacing: -0.02em; padding: 4px 0 }
.t-otsteps { display: grid; grid-template-columns: repeat(4, 64px); gap: 10px; justify-content: center }
.t-otstep { width: 64px; height: 64px; border-radius: 14px; border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink); font: 800 21px/1 var(--font-mono); cursor: pointer; touch-action: manipulation }
.t-otstep:active { background: var(--sunk) }
.t-otnow { min-height: 56px; min-width: 140px }
.t-ottype { width: 100%; text-align: left }
.t-swsheet .sheetbody { gap: 10px }
.t-daylist { display: grid; gap: 8px }
.t-daypick { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px; border: 1.5px solid var(--rule); border-radius: 12px; color: var(--ink); text-decoration: none; background: var(--surface) }
.t-daypick.cur { border-color: var(--dc) }
.t-daypick small { display: block; font: 600 11px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3) }
.t-daypick b { font: 800 17px/1.2 var(--font-display) }

/* ---------------------------------------------------------------- Map tab */
.tv-map { position: fixed; left: 0; right: 0; top: calc(var(--topbar-h) + var(--safe-t) + 1px); bottom: calc(var(--tabbar-h) + var(--safe-b)); z-index: 1; background: var(--sunk) }
.t-mv, .t-mvsurf { position: absolute; inset: 0 }
.t-mvsurf { overflow: hidden; touch-action: none; cursor: grab; outline-offset: -4px }
.t-mvsurf:active { cursor: grabbing }
.t-mvlayer { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform }
.t-mvlayer img { width: 100%; height: 100%; max-width: none; filter: none; user-select: none; -webkit-user-drag: none }
.t-mvlayer .t-ovsvg { width: 100%; height: 100% }
.t-mvlayer .ovcase { vector-effect: none; stroke-width: calc(6.5px / var(--k, 1)) }
.t-mvlayer .ovline { vector-effect: none; stroke-width: calc(3.6px / var(--k, 1)) }
.t-mvmarks { position: absolute; inset: 0; pointer-events: none }
.t-mvbtns { position: absolute; right: max(10px, var(--safe-r)); top: 50%; transform: translateY(-50%); display: grid; gap: 8px; z-index: 3 }
.t-mvbtn { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); cursor: pointer }
.t-mvbtn .ic { width: 26px; height: 26px }
.t-mvattrib { position: absolute; left: max(10px, var(--safe-l)); top: 66px; z-index: 2; margin: 0; max-width: calc(100% - 20px); pointer-events: none; font-size: 12px; line-height: 1.3; color: #48525E; background: rgba(255,255,255,.88); padding: 3px 7px; border-radius: 6px }
.t-mvtoggle { position: absolute; top: 10px; left: max(10px, var(--safe-l)); right: max(10px, var(--safe-r)); z-index: 3; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px }
.t-mvtoggle::-webkit-scrollbar { display: none }
.t-mvtoggle a { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 48px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--ink); border: 1px solid var(--rule); box-shadow: 0 1px 4px rgba(0,0,0,.15); text-decoration: none; font: 700 15px/1 var(--font-display) }
.t-mvtoggle a[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink) }
.t-stops { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: 0 -4px 18px rgba(0,0,0,.18); max-height: 72px; overflow: hidden; transition: max-height .25s ease; display: grid; grid-template-rows: 72px minmax(0, 1fr) }
.t-stops[data-open="true"] { max-height: min(62%, 520px) }
.t-stopspeek { display: flex; align-items: center; gap: 12px; height: 72px; width: 100%; padding: 8px max(16px, var(--safe-r)) 8px max(16px, var(--safe-l)); border: 0; background: none; color: var(--ink); text-align: left; font: 800 17px/1.2 var(--font-display); cursor: pointer; position: relative }
.t-stopspeek small { display: block; font: 600 11px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3) }
.t-grab { position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--rule) }
.t-stoplist { list-style: none; margin: 0; padding: 0 0 12px; overflow-y: auto; overscroll-behavior: contain }
.t-stoplist button { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; min-height: 56px; padding: 6px max(16px, var(--safe-r)) 6px max(16px, var(--safe-l)); border: 0; border-top: 1px solid var(--rule); background: none; color: var(--ink); text-align: left; cursor: pointer }
.t-stoplist b { font: 800 16px/1.2 var(--font-display); display: block }
.t-stoplist small { font-size: 13px; color: var(--ink-3) }
.t-stoplist time { font: 600 15px/1 var(--font-mono) }
.t-stoplist .s-done b, .t-stoplist .s-done time { color: var(--ink-3) }
.t-stoplist .skipped b { text-decoration: line-through }
.t-stoplist .s-next { background: var(--sunk) }
.t-mvlegend { position: absolute; left: max(8px, var(--safe-l)); bottom: 8px; z-index: 2; max-width: calc(100% - 90px); background: var(--surface); border-radius: 12px; padding: 8px 12px; box-shadow: var(--shadow) }
.t-mvlegend .t-ovlegend { margin: 0; display: grid; gap: 4px; font-size: 13px }

/* ---------------------------------------------------------------- Packet */
.tv-packet { padding-bottom: 32px }
.t-ptools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding-block: 12px }
.t-ptools .t-hint { margin: 0 }
.t-pcover { position: relative; min-height: clamp(320px, 48vw, 560px); background: #1a1f26; color: #fff; overflow: hidden; display: grid; align-items: end }
.t-pcover.noimg { background: var(--guide) }
.t-pcoverimg { position: absolute; inset: 0; background: #1a1f26 }
.t-pcoverimg img { width: 100%; height: 100%; object-fit: cover; filter: none }
.t-pcover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,12,18,.92), rgba(8,12,18,.4) 50%, rgba(8,12,18,0) 80%); pointer-events: none }
/* phones: the cover is only as tall as its text, so keep the scrim up to the top edge and leave a band for the photo
   credit (it sat on the eyebrow) */
@media (max-width: 700px) {
  .t-pcover { padding-top: 40px }
  .t-pcover::after { background: linear-gradient(to top, rgba(8,12,18,.92), rgba(8,12,18,.62) 50%, rgba(8,12,18,.55) 100%) }
}
.t-pcovertext { position: relative; z-index: 1; padding: 0 max(16px, var(--safe-l)) 28px; max-width: 1160px; width: 100%; margin: 0 auto }
.t-pcovertext .eyebrow { color: #E9E4D6; text-shadow: 0 1px 2px rgba(8,12,18,.85), 0 0 10px rgba(8,12,18,.6) }
.t-pcover h1 { color: #fff; margin: 10px 0; max-width: 14ch }
.t-psub { font-size: clamp(17px, 2vw, 20px); color: #F1EEE6; max-width: 48ch; margin-bottom: 18px }
.t-psec { padding-block: 44px 8px; display: grid; gap: 14px }
.t-psec > h2 { margin-bottom: 4px }
.t-povgrid, .t-ptwo, .t-pcols { display: grid; gap: 24px; align-items: start }
.t-povright { display: grid; gap: 18px; min-width: 0 }
.t-pday { padding-top: 44px; display: grid; gap: 18px }
.t-pbody { display: grid; gap: 20px }
/* one column that may shrink: an auto column grows to a wide table's min-content (the road book) and pushed the packet
   120 px past a 390 px screen; the two-column layouts from 900 px up override this */
.t-psec, .t-pday, .t-pbody, .t-povgrid, .t-ptwo, .t-pcols { grid-template-columns: minmax(0, 1fr) }
.t-pmap { margin: 0 }
.t-pmap .t-imgbox { border-radius: 14px; border: 1px solid var(--rule) }
.t-pmap img { width: 100%; height: 100%; filter: none }
.t-pmap figcaption, .t-pprof figcaption { font-size: 13px; color: var(--ink-3); margin-top: 6px }
.t-pprof { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 14px 12px 10px }
.t-pprof svg { width: 100%; height: auto; display: block }
.t-rbt td { font-size: 14.5px; line-height: 1.45 }
.t-rbt .t-rbroad { min-width: 180px }
.t-rbt .t-rbroad b { font-size: 15.5px }
.t-pday .t-notes { margin-top: 18px }
.t-bullets { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2) }
.t-bullets b { color: var(--ink) }
.t-ticket { display: grid; gap: 8px; margin: 18px 0 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px }
.t-ticket dt { font: 600 12px/1.3 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3) }
.t-ticket dd { margin: 2px 0 0; font-weight: 600 }
.t-ticket dd.big { font: 800 20px/1.15 var(--font-display) }
.t-addr { user-select: all; font-family: var(--font-mono) }
.t-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px }
.t-status li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: 15px; color: var(--ink-2) }
.t-credits { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2) }
.t-credits a { color: var(--ink) }
.t-pfoot { border-top: 1px solid var(--rule); margin-top: 40px; padding-top: 18px; font-size: 13px; color: var(--ink-3) }
.tv-packet .t-ovmap .t-ovlegend { margin-top: 8px }
.tv-packet td .t-dayswatch { margin-right: 8px }

/* ---------------------------------------------------------------- phones that are narrow */
@media (max-width: 380px) {
  .t-tlsum { grid-template-columns: 54px 28px minmax(0, 1fr) 20px; gap: 0 8px }
  .t-tlnote { padding-left: 98px }
  .t-liveeta time { font-size: 34px }
}

/* ---------------------------------------------------------------- tablet and desktop */
@media (min-width: 640px) {
  .t-strip { grid-template-columns: repeat(4, minmax(0, 1fr)) }
  .t-cover { height: 260px }
}
@media (min-width: 900px) {
  .tv-map { bottom: 0 }
  .t-tripgrid { grid-template-columns: minmax(16px, 1fr) minmax(0, 560px) minmax(0, 560px) minmax(16px, 1fr); column-gap: 36px;
    grid-template-areas: "cover cover cover cover" ". banner banner ." ". now now ." ". ovmap sign ." ". ovmap facts ." ". backups backups ."; align-items: start }
  .t-tripgrid > .sec { grid-column: auto }
  .t-tripgrid > .sec-banner { grid-area: banner } .t-tripgrid > .sec-cover { grid-area: cover } .t-tripgrid > .sec-now { grid-area: now }
  .t-tripgrid > .sec-sign { grid-area: sign; margin-top: 18px } .t-tripgrid > .sec-ovmap { grid-area: ovmap; margin-top: 18px }
  .t-tripgrid > .sec-facts { grid-area: facts } .t-tripgrid > .sec-backups { grid-area: backups; margin-top: 36px }
  .t-cover { height: 320px }
  .t-ovmap .t-ovlegend { position: absolute; margin: 0; z-index: 1; display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 8px 12px; font-size: 13px; max-width: 46% }
  .t-ovmap.lg-tr .t-ovlegend { top: 12px; right: 12px } .t-ovmap.lg-tl .t-ovlegend { top: 12px; left: 12px }
  .t-ovmap.lg-br .t-ovlegend { bottom: 40px; right: 12px } .t-ovmap.lg-bl .t-ovlegend { bottom: 40px; left: 12px }
  .t-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start }
  .t-cols > [data-zone="r"]:not(:empty) { margin-top: 0 }
  .mode-planning .t-cols, .mode-preview .t-cols { grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr) }
  .t-mapwin .t-mwbox { max-width: min(100%, calc(78vh * var(--ar))); margin-inline: auto }   /* a portrait map stays on screen */
  .t-mapwin.crop .t-mwbox { height: auto }
  .t-mapwin.crop .t-mwlayer { position: relative; left: auto !important; top: auto !important; width: 100% !important; height: auto !important; aspect-ratio: var(--ar) }
  .t-hero { height: 240px }
  .t-stats { grid-template-columns: repeat(6, minmax(0, 1fr)) }
  .t-stats div:nth-child(n) { padding-left: 12px; border-left: 1px solid var(--rule); border-top: 0 }
  .t-stats div:first-child { padding-left: 0; border-left: 0 }
  .t-notes { grid-template-columns: repeat(2, minmax(0, 1fr)) } .t-watch { grid-column: 1 / -1 }
  .t-rbc { grid-template-columns: 90px minmax(0, 1fr) auto; align-items: baseline }
  .t-rbc .t-rbmile { grid-row: 1 / 3 } .t-rbc .t-rblen { grid-row: 1; grid-column: 3 }
  .t-rbc p, .t-rbc .t-chips { grid-column: 2 / -1 }
  .t-stops { left: auto; right: 84px; width: 380px; bottom: 12px; border-radius: 18px }
  .t-povgrid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) }
  .t-pmap .t-imgbox { max-width: min(100%, calc(85vh * var(--ar))); margin-inline: auto }
  .t-ptwo { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) }
  .t-pcols { grid-template-columns: minmax(0, .85fr) minmax(0, 1.35fr); gap: 36px }
}

/* ---------------------------------------------------------------- print (packet) */
@media print {
  :root { --bg: #fff; --surface: #fff }
  body:has(.tv-packet) .topbar, body:has(.tv-packet) .tabbar, body:has(.tv-packet) #toasts, .t-ptools { display: none !important }
  body:has(.tv-packet) main#view { padding: 0 }
  .tv-packet { padding: 0 }
  .t-pcover { min-height: 300px; break-after: page }
  .t-pday { break-before: page }
  .t-psec { break-inside: auto }
  figure, .t-rbt tr, .t-tlrow, .t-alts li, .t-facts div, .t-guide { break-inside: avoid }
  .t-imgbox img, .t-img img { filter: none }
  .t-pmap .t-imgbox { max-width: 100% }
  .t-leg { border-color: #999 }
  a { color: inherit; text-decoration: none }
  .tablewrap { overflow: visible; border-color: #bbb }
}

/* packet: bikes on the trip */
.tv .t-bikes { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 6px }

/* ── Turn cues (8.5): the next turn as a guide sign (white on green, inset white border), and the turn-by-turn list ── */
.t-turn { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 12px; align-items: center; background: var(--guide); color: #fff;
  border-radius: 12px; padding: 10px 14px 12px; box-shadow: inset 0 0 0 3px var(--guide), inset 0 0 0 5px rgba(255,255,255,.9) }
.t-turnic { width: 60px; height: 60px }
.t-turnbody { min-width: 0; display: grid; gap: 2px }
.t-turnd { font: 700 32px/1 var(--font-mono); letter-spacing: -0.02em }
.t-turnt { font: 600 19px/1.2 var(--font-display); overflow-wrap: anywhere }
.t-turnt b { font-weight: 900 }
.t-turnthen { display: flex; gap: 6px; align-items: center; font: 600 15px/1.2 var(--font-display); color: #DCEFE3; margin-top: 2px }
.t-turn.now { animation: t-turnpulse 1.2s ease-in-out infinite alternate }
@keyframes t-turnpulse { to { background: #13894F } }
@media (prefers-reduced-motion: reduce) { .t-turn.now { animation: none } }
.t-arrow { display: block }
.t-arrow.sm { width: 22px; height: 22px; flex: none }
.t-turn.big { grid-template-columns: 104px minmax(0, 1fr); padding: 12px 16px 14px; gap: 16px }
.t-turn.big .t-turnic { width: 104px; height: 104px }
.t-turn.big .t-turnd { font-size: 58px }
.t-turn.big .t-turnt { font-size: 26px }
.t-turn.big .t-turnthen { font-size: 18px }
.t-turn.big .t-arrow.sm { width: 28px; height: 28px }

.t-cues summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-height: var(--tap); padding: 6px 0; cursor: pointer; list-style: none; position: relative; padding-right: 28px }
.t-cues summary::-webkit-details-marker { display: none }
.t-cues summary::after { content: ""; position: absolute; right: 6px; top: 18px; width: 9px; height: 9px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) }
.t-cues details[open] summary::after { transform: rotate(-135deg); top: 22px }
.t-cues summary h3 { margin: 0 }
.t-cues summary .muted { font-size: 14px }
.t-cuelist { list-style: none; margin: 6px 0 10px; padding: 0 }
.t-cuelist li { display: grid; grid-template-columns: 48px 24px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 48px; padding: 6px 4px; border-bottom: 1px solid var(--rule); font-size: 16px; line-height: 1.3 }
.t-cuelist li .t-arrow { color: var(--dt) }
.t-cuemi { font: 600 14px/1 var(--font-mono); color: var(--ink-2); text-align: right }
.t-cuelist li.done { color: var(--ink-3) }
.t-cuelist li.done .t-arrow { color: var(--ink-3) }
.t-cuelist li.next { box-shadow: inset 4px 0 0 var(--dc); background: var(--sunk); font-weight: 600 }

/* Rider tracks (9.4) on the day map: dashed, in the rider's color, over the planned route */
.t-trk { vector-effect: none; filter: drop-shadow(0 0 1px #fff); fill: none; stroke-width: calc(4px / var(--k, 1)); stroke-dasharray: calc(9px / var(--k, 1)) calc(6px / var(--k, 1)); stroke-linecap: round; stroke-linejoin: round; opacity: .95 }
.t-nowriders ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px }
.t-nowriders li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; align-items: baseline }
.t-rdot { width: 12px; height: 12px; border-radius: 50%; background: var(--rc); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--rule); transform: translateY(1px) }
.t-recapcard { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px 12px; align-items: center; background: var(--surface); border: 1px solid var(--rule); border-left: 6px solid var(--guide); border-radius: var(--radius); padding: 12px 14px }
.t-recapcard .btn { grid-column: 1 / -1 }
.t-recapic { width: 44px; height: 44px; border-radius: 50%; background: var(--guide); color: #fff; display: grid; place-items: center }
.t-recapic .ic { width: 24px; height: 24px }
@media (min-width: 600px) { .t-recapcard { grid-template-columns: 44px minmax(0, 1fr) auto } .t-recapcard .btn { grid-column: auto } }

/* ── Ride mode (12.10): the whole screen, no top bar or tabs. Portrait: sign, map, stop, action. Landscape phones
   (a handlebar mount): the map on the left, the rest on the right. ── */
body.riding #topbar, body.riding #tabbar { display: none !important }
body.riding { overflow: hidden }
.rv { position: fixed; inset: 0; z-index: 30; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; background: var(--bg);
  padding: calc(var(--safe-t) + 8px) calc(var(--safe-r) + 8px) calc(var(--safe-b) + 8px) calc(var(--safe-l) + 8px); gap: 8px }
.rv-turn .t-turn { border-radius: 14px }
.rv-nogps { display: grid; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--rule); font: 600 18px/1.3 var(--font-display) }
.rv-nogps .btn { justify-self: start }
.t-turn.off { background: var(--signal); color: #141D27; box-shadow: inset 0 0 0 3px var(--signal), inset 0 0 0 5px #141D27 }
.rv-map { position: relative; overflow: hidden; border-radius: 14px; background: var(--sunk); border: 1px solid var(--rule); min-height: 160px }
.rv-layer { position: absolute; left: 0; top: 0; transition: transform .9s linear; will-change: transform }
.rv-layer img { display: block; width: 100%; height: 100%; max-width: none }
.rv-marks { position: absolute; inset: 0 }
.rv-marks .t-mk.next::before { width: 44px; height: 44px }
.rv-marks .rv-up { transform: rotate(var(--unrot, 0deg)); transform-origin: -14px 12px }
.rv-me { position: absolute; width: 0; height: 0; z-index: 2; pointer-events: none; transition: transform .9s linear }
.rv-me::before { content: ""; position: absolute; left: -17px; top: -22px; width: 34px; height: 40px; background: #1F6FEB;
  clip-path: polygon(50% 0, 100% 100%, 50% 76%, 0 100%); filter: drop-shadow(0 0 2px #fff) drop-shadow(0 1px 3px rgba(0,0,0,.5)) }
.rv-me::after { content: ""; position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; background: rgba(31,111,235,.18) }
.rv-me.off::before { background: #67707A }
.rv-mapbtns { position: absolute; right: 8px; top: 8px; display: grid; gap: 8px; z-index: 3 }
.rv-mapbtns .t-mvbtn { width: 56px; height: 56px }
.rv-n { font: 900 18px/1 var(--font-display); color: #B3261E; display: inline-block; transition: transform .9s linear }
.rv-attrib { position: absolute; left: 6px; bottom: 6px; z-index: 3; font-size: 10.5px; line-height: 1.2; padding: 3px 6px; border-radius: 6px; background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--ink-2); max-width: 75% }
.rv-nomap { padding: 16px; color: var(--ink-3) }
.rv-stop { padding: 0 6px; min-width: 0 }
.rv-stopin { display: grid; gap: 2px }
.tv .rv-stopname, .rv-stopname { font: 900 30px/1.05 var(--font-display); overflow-wrap: anywhere; margin: 0 }
.rv-eta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 2px }
.rv-eta time { font: 700 44px/1 var(--font-mono); letter-spacing: -0.03em }
.rv-eta time small { font-size: .45em; margin-left: .15em }
.rv-togo { font: 700 22px/1 var(--font-mono); color: var(--ink-2) }
.rv-line { font-size: 17px; line-height: 1.3; color: var(--ink-2) }
.rv-acts { display: grid; gap: 8px }
.rv-primary { min-height: 80px; font-size: 26px }
.rv-secrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px }
.rv-secrow .btn { min-height: 56px; font-size: 17px }
@media (orientation: landscape) and (max-height: 600px) {
  .rv { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto }
  .rv-map { grid-column: 1; grid-row: 1 / -1 }
  .rv-turn { grid-column: 2; grid-row: 1 }
  .rv-stop { grid-column: 2; grid-row: 2; overflow-y: auto }
  .rv-acts { grid-column: 2; grid-row: 3 }
  .rv .t-turn.big { grid-template-columns: 68px minmax(0, 1fr); padding: 8px 12px 10px; gap: 10px }
  .rv .t-turn.big .t-turnic { width: 68px; height: 68px }
  .rv .t-turn.big .t-turnd { font-size: 40px }
  .rv .t-turn.big .t-turnt { font-size: 20px }
  .rv .t-turn.big .t-turnthen { font-size: 15px }
  .rv-stopname { font-size: 24px }
  .rv-eta time { font-size: 34px }
  .rv-primary { min-height: 64px; font-size: 22px }
}
.t-rpgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px }
.t-rpgrid figure { margin: 0; display: grid; gap: 4px }
.t-rp { display: block; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--sunk); cursor: zoom-in; min-height: 48px }
.t-rp img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block }
.t-rpgrid figcaption { font-size: 13px; line-height: 1.35; color: var(--ink-2) }
.t-rpgrid figcaption b { font-family: var(--font-mono); color: var(--ink) }
.t-rpgrid figcaption span { display: block; color: var(--ink-3); overflow-wrap: anywhere }
