:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#203c44;background:#e7eee9;font-synthesis:none;font-size:14px;--ink:#173e47;--border:#d7dfd9;--paper:#fffef9}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,select,summary{cursor:pointer}button{color:var(--ink);background:var(--paper);border:1px solid var(--border);border-radius:7px;padding:9px 11px}button:hover{background:#ecf1eb}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,a:focus-visible{outline:3px solid #c6862a;outline-offset:3px}a{color:#276e7c;text-underline-offset:3px}#map{position:absolute;inset:0}.panel{position:absolute;top:20px;left:20px;width:310px;background:var(--paper);border:1px solid #ffffffb3;border-radius:14px;box-shadow:0 6px 30px #28414a22;max-height:calc(100dvh - 70px);overflow:auto}.panel header{display:flex;align-items:center;gap:10px;padding:19px 18px 16px}.brand-mark{background:var(--ink);color:#f5ce82;border-radius:8px;width:35px;height:40px;font-size:30px;text-align:center;line-height:36px;font-weight:700}.panel h1{font-size:18px;letter-spacing:-.5px;margin:0}.panel header p{margin:3px 0 0;font-size:12px;color:#74857f}#collapse{margin-left:auto;border:0;font-size:22px;padding:0 7px}#controls{padding:0 18px 17px}.section-heading{display:block;font-size:10px;letter-spacing:1.6px;font-weight:750;color:#7b8980;margin:21px 0 9px}.search-row{display:flex;border:1px solid var(--border);background:#f2f4ed;border-radius:8px;overflow:hidden}.search-row input{width:100%;min-width:0;border:0;background:transparent;padding:11px;color:var(--ink)}.search-row button{border:0;background:transparent;font-size:23px;padding:3px 13px}.mode-picker{display:flex;border:1px solid var(--border);padding:3px;border-radius:9px;gap:2px}.mode-picker button{border:0;border-radius:6px;padding:9px 5px;font-size:12px;flex:1;white-space:nowrap}.mode-picker button[aria-pressed=true]{background:var(--ink);color:white;box-shadow:0 2px 5px #173e4720}.background-picker{display:flex;gap:4px;margin-top:8px}.background-picker button{flex:1;font-size:11px;padding:6px 4px;border-radius:6px}.background-picker button[aria-pressed=true]{background:#e3ebe6;border-color:var(--ink);font-weight:650}#legend h2{font-size:12px;margin:17px 0 12px}#legend .legend-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 13px}.legend-item{display:flex;align-items:center;gap:8px;font-size:11px}.swatch{width:25px;flex-shrink:0;height:4px;border-radius:2px;background:var(--swatch)}.swatch.dashed{height:0;background:transparent;border-top:3px dashed var(--swatch);border-radius:0}.station-swatch{width:10px;height:10px;background:#fffef7;border:2px solid #123e52;border-radius:50%;margin:0 7px}.legend-note,.hint{font-size:11px;line-height:1.55;color:#697970}.legend-note{margin-bottom:0}.display-options{font-size:12px;border-top:1px solid var(--border);border-bottom:1px solid var(--border);padding:13px 0;margin-top:17px}.display-options summary{font-weight:600}.display-options>div{display:grid;gap:9px;padding-top:12px}.display-options label{display:flex;align-items:flex-start;gap:7px;line-height:1.4}.display-options input{accent-color:var(--ink);margin:2px 0 0}select{width:100%;padding:10px;border:1px solid var(--border);border-radius:7px;color:var(--ink);background:var(--paper)}.hint{margin:12px 0}.toolbar{display:flex;gap:6px}.toolbar button{flex:1;font-size:11px;padding:9px 4px}.map-status{position:absolute;bottom:28px;left:50%;transform:translateX(-50%);background:#fffef9ed;padding:7px 12px;border-radius:20px;font-size:11px;box-shadow:0 2px 12px #203c4415;max-width:calc(100% - 35px);text-align:center}.map-status.error,.map-status:has(.error){color:#923b2c;background:#fff2e9}.small{font-size:11px;line-height:1.5;color:#697970}#search-results{padding:0;margin:7px 0 0;list-style:none;max-height:220px;overflow:auto;border:1px solid var(--border);border-radius:7px}#search-results li+li{border-top:1px solid var(--border)}#search-results button{display:block;width:100%;border:0;border-radius:0;text-align:left;padding:11px}#search-results small{display:block;font-size:10px;margin-top:3px;color:#6c7c73}.detail-panel{position:absolute;right:60px;top:20px;width:310px;max-height:calc(100dvh - 80px);overflow:auto;background:var(--paper);padding:23px;border-radius:12px;box-shadow:0 6px 30px #28414a22}.detail-panel h2{font-size:21px;line-height:1.25;margin:8px 15px 7px 0}.detail-panel .eyebrow{font-size:10px;letter-spacing:1.3px;text-transform:uppercase;color:#7c887f}.detail-panel dl{display:grid;grid-template-columns:105px 1fr;gap:11px 12px;font-size:12px;line-height:1.5}.detail-panel dt{color:#79877d}.detail-panel dd{margin:0;overflow-wrap:anywhere}.close{position:absolute;right:9px;top:7px;border:0;font-size:22px;padding:1px 7px}.detail-panel .speed-value{font-size:18px;color:var(--ink);font-weight:650}dialog{background:var(--paper);color:var(--ink);border:0;border-radius:15px;max-width:580px;width:calc(100% - 28px);max-height:calc(100dvh - 40px);padding:28px;box-shadow:0 12px 65px #1e3d4340}dialog::backdrop{background:#173e4759}dialog h2{font-size:23px;letter-spacing:-.5px;margin-top:0}dialog h3{font-size:14px;margin:23px 0 8px}dialog p{line-height:1.65;font-size:13px}.no-script{position:absolute;top:50%;left:20px;background:white;padding:20px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}[hidden]{display:none!important}.maplibregl-ctrl-top-right{top:10px;right:10px}.maplibregl-ctrl-attrib{font-size:10px}.maplibregl-ctrl-scale{background:#fffef9d9!important;border-color:#586a67!important;color:#52605b!important;}.panel header{position:sticky;top:0;z-index:2;background:var(--paper);border-radius:14px 14px 0 0}.brand-mark{display:block;flex-shrink:0;width:40px;height:40px;padding:0;background:none}.brand-mark svg{display:block;width:40px;height:40px}.toolbar .icon-button{flex:0 0 40px;display:flex;align-items:center;justify-content:center;padding:8px}.icon-button svg{width:18px;height:18px}#settings-view .display-options{display:grid;gap:12px;border:0;margin:0;padding:6px 0 0}.settings-head{display:flex;align-items:center;gap:6px;margin:2px 0 8px}.settings-head h2{font-size:15px;margin:0}#settings-close{border:0;font-size:24px;line-height:1;padding:2px 9px}.toolbar .help-button{font-size:17px;font-weight:700;line-height:1}.help-contents{font-size:12px;line-height:1.7;margin:-6px 0 6px}.help-list{font-size:13px;line-height:1.6;padding-left:18px}.help-list li+li{margin-top:5px}.terms p{font-size:12px;line-height:1.6}#search-results .search-heading{padding:8px 11px 4px;font-size:10px;letter-spacing:1.3px;font-weight:750;color:#7b8980;text-transform:uppercase;background:#f6f7f2}
@media(max-width:650px){.panel{top:10px;left:10px;width:calc(100% - 65px);max-width:310px;max-height:calc(100dvh - 65px)}.panel header{padding:13px 14px}.panel h1{font-size:16px}#controls{padding:0 14px 14px}.section-heading{margin-top:15px}.map-status{bottom:45px;font-size:10px;width:max-content;max-width:calc(100% - 35px)}.detail-panel{left:10px;right:10px;top:auto;bottom:42px;width:auto;max-height:45dvh;z-index:3;padding:18px}.detail-panel dl{grid-template-columns:100px 1fr}.detail-panel h2{font-size:18px}.toolbar button{padding:10px 3px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

.map-status button{font-size:11px;padding:5px 8px;margin-left:8px}

.language-picker {display:grid;grid-template-columns:85px 1fr;gap:8px;align-items:center;margin-top:10px;}
.language-picker select {min-width:0;padding:9px 10px;}
.station-swatch {background:#ffa323;border-color:#123e52;}

.swatch.bridge{height:8px;border-top:2px solid #263b48;border-bottom:2px solid #263b48;border-radius:0;box-shadow:inset 0 1px #fffef8,inset 0 -1px #fffef8}
.swatch.tunnel{height:5px;position:relative}.swatch.tunnel:after{content:"";position:absolute;inset:2px 0;background:repeating-linear-gradient(90deg,#fffef8 0 4px,transparent 4px 7px)}
.legend-zoom{display:block;font-size:10px;color:#7b8980;margin-top:1px}
.units-picker{display:grid;grid-template-columns:85px 1fr;gap:8px;align-items:center}
.units-picker select{min-width:0;padding:7px 8px;font-size:12px}
/* The frame clips the double-size detail map, so the page never overflows:
   otherwise mobile browsers take a pinch as a page zoom. */
#map-frame{position:absolute;inset:0;overflow:hidden;touch-action:none}
html,body{height:100%;overflow:hidden;overscroll-behavior:none}
#map.detail{width:200%;height:200%;inset:auto;top:0;left:0;transform:scale(.5);transform-origin:0 0}
#map.detail .maplibregl-control-container{position:absolute;top:0;left:0;width:50%;height:50%;transform:scale(2);transform-origin:0 0;pointer-events:none}
#map.detail.detail-2{width:400%;height:400%;transform:scale(.25)}
#map.detail.detail-2 .maplibregl-control-container{width:25%;height:25%;transform:scale(4)}
.maplibregl-ctrl-group button.atlas-ctrl{font-size:17px;line-height:29px;color:#203c44}
.maplibregl-ctrl-group button.atlas-ctrl[aria-pressed=true]{background:#173e47;color:#fff}
/* Match the other MapLibre glyph controls and preserve contrast when active. */
.maplibregl-ctrl-group button.atlas-terrain-toggle{position:relative;display:flex;align-items:center;justify-content:center}
.maplibregl-ctrl-group button.atlas-terrain-toggle .terrain-scale-indicator{position:absolute;right:1px;bottom:1px;padding:0 2px;font-size:10px;font-weight:750;line-height:12px;border-radius:3px;pointer-events:none;color:#203c44;background:#fffef9f0}
.maplibregl-ctrl-group button.atlas-terrain-toggle[aria-pressed=true] .terrain-scale-indicator{background:#173e47;color:#fff}
.maplibregl-ctrl-group button.atlas-terrain-toggle svg{display:block;width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
/* Rendered vertical scale is explicit: the source DEM and contours remain exact. */
.terrain-exaggeration-picker{display:grid;gap:5px;margin:7px 0 2px 22px}
.terrain-exaggeration-picker>label{font-weight:600}
.terrain-exaggeration-picker select{width:100%;min-width:0;padding:7px 8px;font-size:12px}
.terrain-exaggeration-picker .hint{margin:0;font-size:11px}


.draw-toolbar{position:absolute;top:12px;left:50%;transform:translateX(-50%);display:flex;flex-wrap:wrap;align-items:center;gap:6px;max-width:min(560px,calc(100% - 420px));background:var(--paper);border-radius:12px;box-shadow:0 6px 30px #28414a22;padding:8px 38px 8px 8px}
.draw-group{display:flex;gap:2px;border:1px solid var(--border);border-radius:8px;padding:2px}
.draw-group button{border:0;font-size:12px;padding:6px 9px}
.draw-group button[aria-pressed=true]{background:var(--ink);color:#fff}
.draw-close{position:absolute;right:6px;top:6px;border:0;font-size:20px;padding:0 7px}
.draw-status{flex-basis:100%;margin:0 2px;font-size:11px;color:#697970;min-height:1em}
@media(max-width:1000px){.draw-toolbar{top:auto;bottom:78px;max-width:calc(100% - 20px)}}
.draw-style{align-items:center;gap:4px;padding:2px 4px}
.swatches{display:flex;gap:3px}
.swatch-button{width:20px;height:20px;border-radius:50%;padding:0;border:2px solid #fffef8;box-shadow:0 0 0 1px var(--border);background:var(--c)}
.swatch-button[aria-pressed=true]{box-shadow:0 0 0 2px var(--ink)}
#draw-color{width:26px;height:24px;padding:0;border:1px solid var(--border);border-radius:5px;background:none}
.draw-style select{width:auto;padding:4px 6px;font-size:12px}
/* Only the details content scrolls, so the close button stays in view. */
.detail-panel{display:flex;flex-direction:column;overflow:hidden}
#detail-content{overflow:auto;min-height:0;padding-right:4px}
.mode-picker{flex-wrap:wrap}.mode-picker button{flex:1 1 30%}
.swatch.inactive-construction,.swatch.inactive-proposed,.swatch.inactive-former{height:3px;border-radius:0}
.swatch.inactive-construction{background:repeating-linear-gradient(90deg,var(--swatch) 0 10px,transparent 10px 13px)}
.swatch.inactive-proposed{height:4px;background:radial-gradient(circle,var(--swatch) 1.6px,transparent 2px) 0 50%/6px 4px repeat-x}
.swatch.inactive-former{opacity:.8;background:repeating-linear-gradient(90deg,var(--swatch) 0 4px,transparent 4px 10px)}
.swatch.dual{background:linear-gradient(180deg,var(--swatch) 0 50%,#d62728 50% 100%)}
.draw-group button:disabled{opacity:.45;cursor:default}
.swatch.family{height:8px;border-radius:2px}
.gauge-scale{position:relative;height:10px;border-radius:3px;background:var(--scale);margin:18px 6px 20px}
.gauge-scale span{position:absolute;top:13px;transform:translateX(-50%);font-size:9px;color:#5f6d66}
.gauge-scale span.above{top:-14px}
.swatch.empty{visibility:hidden}
.track-badge-swatch{display:inline-block;min-width:10px;padding:0 4px;border:1px solid #173e47;border-radius:4px;background:#fffef8;color:#173e47;font-weight:700;font-size:11px;line-height:14px;text-align:center}
.track-badge-swatch.tunnel{border-color:#7d949c;background:#e3eaec;color:#4b626a}
.track-badge-swatch.station{border-color:#c47d12;background:#fff3da;color:#7a4a08}
.mode-picker{display:grid;grid-template-columns:repeat(3,1fr)}.mode-picker button{white-space:normal;line-height:1.2}

.polar-place{font:12px/1.2 'Noto Sans',system-ui,sans-serif;color:#74807d;text-shadow:0 0 2px #fff,0 0 2px #fff,0 0 3px #fff;white-space:nowrap;pointer-events:none}


.context-key { margin-top: 12px; padding: 12px 0; border-bottom: 1px solid var(--line, #d5dfdb); }
.context-key summary { cursor: pointer; font-size: 13px; }
.context-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 11px; }
.context-legend span::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 6px; border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 30%, white); vertical-align: middle; }
.nearby-list { list-style: none; padding: 0; }
.nearby-list li { margin: 10px 0; }
.nearby-list button { padding: 0; border: 0; background: none; color: #007b83; text-align: left; text-decoration: underline; }
.nearby-list span { display: block; margin-top: 3px; }


.swatch.pattern-swatch {width:62px;height:12px;background:none;border:0;flex-shrink:0;overflow:visible}
.pattern-swatch svg {display:block;width:62px;height:12px}
/* Long lifecycle patterns need a full row beside an unbroken label. */
.legend-item:has(.pattern-swatch) {grid-column:1 / -1}
.swatch.street-running {height:9px;background:#b68f55;border-top:3px solid #d1ba94;border-bottom:3px solid #d1ba94}
.swatch.level-crossing {background:none;height:18px;text-align:center}
.swatch.level-crossing::after {content:'×';color:#63332c;font-size:22px;line-height:18px;font-weight:bold}
.legend-help{margin-top:10px;font-size:11px;color:#697970}.legend-help summary{font-weight:600}.legend-help .legend-note{margin:6px 0 0}
.display-options fieldset{border:0;margin:0;padding:0;display:grid;gap:8px}.display-options legend{padding:0;margin-bottom:2px;font-size:10px;letter-spacing:1.3px;font-weight:750;color:#7b8980;text-transform:uppercase}
.map-readout{background:#fffef9d9;color:#52605b;font:11px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;padding:1px 5px;border-radius:3px;white-space:normal;overflow-wrap:anywhere}
.profile-chart{width:100%;height:auto;margin:6px 0 10px;font-size:9px;fill:#697970;touch-action:none}.profile-area{fill:#c2185b22;stroke:none}.profile-line{fill:none;stroke:#c2185b;stroke-width:1.5}.profile-axis{stroke:#9aa7a0;stroke-width:.8}.profile-cursor{stroke:#16414d;stroke-width:.8;stroke-dasharray:2 2}.profile-readout{fill:#16414d;font-weight:600}.profile-marker{width:12px;height:12px;border-radius:50%;background:#fffef8;border:3px solid #c2185b;box-shadow:0 1px 4px #0004}

.departures h3 { font-size: 13px; margin: 18px 0 6px; }
.departure-list { list-style: none; padding: 0; margin: 6px 0; font-size: 12px; }
.departure-list > li { border-top: 1px solid var(--border); }
.departure-summary { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 7px; padding:7px 0; list-style:none; }
.departure-summary::-webkit-details-marker { display:none; }
.departure-summary:hover { background:#ecf1eb; }
.departure-expand { margin-left:auto; }
.departure-trip[open] .departure-expand { transform:rotate(180deg); }
/* Explicitly restore native selection in the details panel, including the
   clickable departure summary and Safari's prefixed selection property. */
#detail-content, #detail-content * { -webkit-user-select:text; user-select:text; }
.trip-schedule h4 { margin:10px 0 4px; }
.trip-stops { width:100%; border-collapse:collapse; table-layout:fixed; font-size:11px; }
.trip-stops caption { text-align:left; font-weight:650; margin:8px 0; overflow-wrap:anywhere; }
.trip-stops th, .trip-stops td { text-align:left; vertical-align:top; border-top:1px solid var(--border); padding:6px 3px; overflow-wrap:anywhere; }
.trip-stops th:first-child { width:44%; }
.trip-stops td { font-variant-numeric:tabular-nums; }
.trip-date { display:block; font-weight:400; color:#697970; font-size:10px; }
.trip-current-stop { background:#fff0d3; }
.trip-stops .cancelled { text-decoration:line-through; }
.departure-time { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 38px; }
.departure-time.cancelled { text-decoration: line-through; color: #8a948e; }
.departure-line { background: #e3ebe6; border-radius: 4px; padding: 0 5px; font-weight: 650; font-size: 11px; }
.departure-headsign { flex: 1; min-width: 90px; }
.departure-track { color: #697970; font-size: 11px; }
.departure-status { color: #247046; font-size: 11px; font-weight: 600; }
.departure-status.late { color: #a02b22; }
.departure-links a { margin-right: 10px; font-size: 12px; }

/* The brand button is the compact menu; the same artwork is used everywhere. */
button.brand-mark{padding:0;border:0;background:transparent;flex-shrink:0}
button.brand-mark:focus-visible{outline:3px solid #d58d13;outline-offset:3px}
@media(max-width:650px),(max-height:500px){
  .panel{top:max(10px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left))}
  .panel.collapsed{width:48px;max-height:48px;background:transparent;border:0;box-shadow:none;overflow:visible}
  .panel.collapsed header{padding:0;background:transparent;border:0;box-shadow:none}
  .panel.collapsed header>div,.panel.collapsed #collapse{display:none}
  .panel.collapsed .brand-mark{width:48px;height:48px;min-width:48px;min-height:48px;margin:0;border-radius:11px;box-shadow:0 3px 12px #173e4759}
  .panel.collapsed .brand-mark svg{display:block;width:48px;height:48px}
}

.maplibregl-ctrl-attrib .atlas-build { display: block; }

.system-label{min-width:0}.system-label summary{list-style:none;text-decoration:underline dotted;text-underline-offset:3px}.system-label summary::-webkit-details-marker{display:none}.system-label summary:hover{color:#276e7c}.system-description{font-size:11px;line-height:1.5;color:#52665d;margin:5px 0 0}.system-list{display:flex;flex-wrap:wrap;gap:4px 10px}.system-list .system-label[open]{flex-basis:100%}.legend-item:has(.system-label[open]){grid-column:1/-1;align-items:flex-start}.legend-item:has(.system-label[open]) .swatch{margin-top:6px}

#service-frequency-options { display:grid; gap:5px; margin:10px 0; }
#service-frequency-options[hidden],#frequency-profile-options[hidden],#peak-phase-options[hidden],#frequency-hour-options[hidden] { display:none; }
#service-frequency-options select { width:100%; margin-bottom:6px; }

.frequency-key { display:flex; flex-wrap:wrap; gap:7px 12px; margin-top:10px; }
.frequency-key p { flex-basis:100%; margin:3px 0; }
.frequency-sample { display:inline-flex; align-items:center; gap:5px; font-size:11px; }
.frequency-sample i { display:block; width:24px; background:var(--ink); }
/* A measured control stack, not competing fixed offsets on its children. */
:root{--map-safe-left:env(safe-area-inset-left,0px);--map-safe-right:env(safe-area-inset-right,0px);--map-safe-top:env(safe-area-inset-top,0px);--map-safe-bottom:env(safe-area-inset-bottom,0px)}
.map-control-insets{position:fixed;visibility:hidden;pointer-events:none;width:0;height:0;padding:var(--map-safe-top) var(--map-safe-right) var(--map-safe-bottom) var(--map-safe-left)}
.maplibregl-ctrl-bottom-left{left:var(--map-control-left,10px);bottom:var(--map-control-bottom,85px);max-width:var(--map-control-width,calc(100% - 62px));width:max-content;display:flex;flex-direction:column;align-items:flex-start;gap:3px}
.maplibregl-ctrl-bottom-left>.maplibregl-ctrl{float:none;margin:0!important;max-width:100%;flex-shrink:0}
.maplibregl-ctrl-scale{display:block}
.map-readout{max-width:100%}
.panel{max-height:min(calc(100dvh - 70px),var(--map-panel-height,100dvh))}
.map-status{bottom:calc(28px + var(--map-safe-bottom))}
@media(max-width:650px){.panel{max-height:min(calc(100dvh - 65px),var(--map-panel-height,100dvh))}.map-status{bottom:calc(45px + var(--map-safe-bottom))}}
.maplibregl-ctrl-bottom-right{right:var(--map-info-right,10px);bottom:var(--map-info-bottom,10px)}
.maplibregl-ctrl-bottom-right>.maplibregl-ctrl{margin:0}
/* The info button remains a button even when its credit popover is open. */
.maplibregl-ctrl-attrib.maplibregl-compact{width:32px;height:32px;min-height:32px;padding:0;border-radius:50%}
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button{width:32px;height:32px;right:0;top:0;background-repeat:no-repeat;background-position:center;background-size:24px 24px}
.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{position:absolute;bottom:40px;right:0;width:330px;max-width:var(--map-info-width,calc(100vw - 20px));max-height:var(--map-info-height,calc(100dvh - 70px));overflow:auto;overflow-wrap:anywhere;white-space:normal;padding:12px;background:var(--paper);border-radius:9px;box-shadow:0 3px 15px #173e4740;text-align:left}

/* Explicit watch mode: the entire idle viewport belongs to the map. */
body[data-ui="watch"] .panel,body[data-ui="watch"] .maplibregl-control-container,body[data-ui="watch"] .detail-panel,body[data-ui="watch"] .map-status,body[data-ui="watch"] #draw-toolbar,body[data-ui="watch"] #measure-toolbar,body[data-ui="watch"] #about {display:none!important}
body[data-ui="watch"] #map-frame {inset:0;border-radius:0}
#watch-menu {position:fixed;inset:0;z-index:30;display:grid;place-items:center;background:var(--paper)}
#watch-content {width:min(360px,70vmin);height:min(360px,70vmin);overflow:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:0;font-size:14px}
#watch-content>button,#watch-content>select {min-height:44px;flex-shrink:0;width:100%;padding:7px 5px;border-radius:4px}
#watch-content .watch-scroll {overflow:auto;flex:1;min-height:0;overflow-wrap:anywhere;font-size:12px}
#watch-content .watch-scroll button {display:block;min-height:44px;width:100%;padding:7px 5px}
#watch-content .watch-scroll button[aria-pressed="true"] {background:#e3ebe6}
#watch-content .watch-scroll p {margin:6px 0}

/* Installation stays inside the existing controls, with no automatic banner. */
.toolbar{flex-wrap:wrap}
#pwa-install{max-width:470px;overscroll-behavior:contain}
/* Unsupported dialog elements have no browser-supplied hiding or top layer. */
dialog:not([open]){display:none}
#pwa-install-backdrop{position:fixed;inset:0;z-index:1000;background:#173e4759;touch-action:none;overscroll-behavior:none}
#pwa-install.pwa-install-fallback[open]{display:block;position:fixed;z-index:1001;left:50%;top:50%;right:auto;bottom:auto;margin:0;transform:translate(-50%,-50%);width:calc(100vw - 28px);max-height:calc(100vh - 28px);max-height:calc(100dvh - 28px);overflow:auto}
#pwa-install h2{padding-right:20px}
#pwa-install .help-list{padding-left:22px}
#pwa-install .help-list li+li{margin-top:10px}
#pwa-install-native{background:var(--ink);color:var(--paper);min-height:44px;padding:10px 18px}
#pwa-install-native:disabled{opacity:.7;cursor:wait}
#pwa-install-status{font-weight:600}
body[data-ui="watch"] #pwa-install{display:none!important}
@media(max-width:360px){#pwa-install{padding:24px 18px}#pwa-install h2{font-size:21px}}

/* Power facilities are circular lettered points, separate from track swatches. */
.point-swatch{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:25px;height:16px;gap:4px}.point-swatch.paired{width:36px}.point-swatch svg{display:block;flex-shrink:0;width:16px;height:16px}

.dot-swatch { width: 8px; height: 8px; flex-shrink: 0; margin: 0 7px; border-radius: 50%; background: var(--swatch); border: 1.5px solid var(--swatch-stroke); box-sizing: content-box; }

/* Help: data dates */
.data-ages { border-collapse: collapse; margin: 0.25em 0 0.75em; }
.data-ages th, .data-ages td { text-align: left; padding: 0.15em 0.75em 0.15em 0; vertical-align: top; }
.data-ages-notice, .data-age-stale { color: #8a4b00; }
