:root {
  color-scheme: light;
  --ink: #352238;
  --muted: #705773;
  --line: #dec0de;
  --accent: #d00dad;
  --accent-ink: #85056f;
  --accent-soft: #dec0de;
  --surface-soft: #f7eef7;
  --blue: #2865bc;
  --coral: #ca5848;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow: 0 4px 20px #35223820, 0 1px 4px #35223810;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; }
body { font: 16px/1.5 var(--sans); color: var(--ink); background: var(--accent-soft); overflow: hidden; }
button, input, select { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: wait; }
a { color: inherit; text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; }
[hidden] { display: none !important; }
.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; }
.app-shell { height: 100dvh; width: 100%; }
.workspace { position: absolute; inset: 0; }
.topbar { position: absolute; z-index: 20; inset: 16px 16px auto; display: flex; align-items: center; gap: 10px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.menu-toggle, .icon-button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); font-size: 23px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); font-size: 18px; font-weight: 750; letter-spacing: -.7px; text-decoration: none; }
.brand > span > span { color: var(--accent); }
.brand-mark { width: 27px; height: 27px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; }
.map-switcher { position: relative; display: flex; align-items: center; flex: 0 0 auto; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.map-switcher::after { position: absolute; right: 11px; color: var(--accent-ink); font-size: 12px; pointer-events: none; content: "▼"; }
.map-switcher select { height: 100%; min-width: 124px; appearance: none; border: 0; padding: 0 31px 0 12px; border-radius: inherit; background: transparent; color: var(--ink); font-size: 14px; font-weight: 650; cursor: pointer; }
.explore-search { display: flex; height: 44px; width: min(330px, 30vw); border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); overflow: hidden; }
.explore-search input { width: 100%; min-width: 0; border: 0; padding: 0 14px; background: transparent; outline: none; color: var(--ink); }
.explore-search:focus-within { outline: 3px solid var(--accent-ink); }
.explore-search button { width: 44px; border: 0; background: none; font-size: 28px; color: var(--accent); }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.view-switch { display: flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.view-button { border: 0; border-radius: 8px; padding: 7px 13px; min-height: 34px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 650; }
.view-button.is-active { color: #fff; background: var(--accent); }
.topbar-meta { display: none; }
.control-panel { position: absolute; z-index: 12; top: 76px; bottom: 38px; left: 16px; width: 320px; padding: 20px; overflow-y: auto; scrollbar-width: thin; border: 1px solid var(--line); border-radius: 16px; background: #fffafff5; box-shadow: var(--shadow); backdrop-filter: blur(12px); transition: transform 280ms ease, opacity 280ms ease, visibility 280ms; }
.sidebar-hidden .control-panel { transform: translateX(calc(-100% - 24px)); opacity: 0; visibility: hidden; }
.intro-block { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 22px; }
.intro-block h1 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.5px; }
.intro-block .icon-button { height: 28px; width: 28px; flex-basis: 28px; box-shadow: none; border: 0; font-size: 24px; color: var(--muted); }
.control-group { margin: 0 0 22px; }
.section-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.section-label, .field-label { color: var(--muted); font-size: 14px; font-weight: 600; }
.provider-badge { color: var(--muted); font-size: 12px; }
.live-profile-switch { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 10px; }
.live-profile-switch button { display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 62px; padding: 7px 1px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 600; }
.live-profile-switch button span { display: grid; place-items: center; height: 22px; font-size: 22px; }
.live-profile-switch button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.live-profile-switch button.is-active { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.mode-note, .clock-note, .panel-note, .data-notes { color: var(--muted); font-size: 13px; line-height: 1.5; }
.mode-note { margin: 10px 0 0; }
.fold-control select { width: 100%; min-height: 42px; margin-top: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font-size: 14px; }
.fold-warning { position: absolute; z-index: 4; left: 354px; right: 82px; bottom: 140px; max-width: 410px; margin: 0; padding: 8px 11px; border: 1px solid #d6b576; border-radius: 8px; background: #fff8eaf2; color: #72521b; font-size: 12px; pointer-events: none; }
.sidebar-hidden .fold-warning { left: 16px; }
.departure-clock { border-top: 1px solid var(--line); padding-top: 18px; }
.clock-layout { display: flex; align-items: center; gap: 20px; margin-top: 12px; }
.analog-clock { width: 102px; height: 102px; flex-shrink: 0; }
.clock-ring { fill: none; stroke: var(--accent-soft); stroke-width: 1.5; }
.clock-day, .clock-night { transition: opacity 500ms ease; }
.clock-night { opacity: 0; }
.departure-clock[data-period="night"] .clock-day { opacity: 0; }
.departure-clock[data-period="night"] .clock-night { opacity: 1; }
.clock-sun { fill: #ffe183; stroke: #995c0b; stroke-width: 1.3; stroke-linecap: round; }
.clock-moon { fill: #fff1c6; }
.clock-stars { fill: none; stroke: #cbdfff; stroke-width: 1; stroke-linecap: round; }
.is-playing .clock-ring { stroke: var(--accent); }
.clock-ticks { fill: none; stroke: #254365; stroke-width: 1.7; stroke-linecap: round; transition: stroke 500ms ease; }
.departure-clock[data-period="night"] .clock-ticks { stroke: #d7e7ff; }
.departure-clock[data-period="night"] .clock-hand--hour { stroke: #fff; }
.departure-clock[data-period="night"] .clock-hand--minute { stroke: #f4b1e7; }
.clock-hand { transform-origin: 50px 50px; transition: transform 820ms ease, stroke 500ms ease; stroke-linecap: round; }
.clock-hand--hour { stroke: var(--ink); stroke-width: 4; }
.clock-hand--minute { stroke: var(--accent-ink); stroke-width: 2.5; }
.clock-pin { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
.clock-setting { flex: 1; min-width: 0; display: grid; gap: 6px; }
.clock-setting .field-label { display: none; }
.time-input { width: 100%; min-width: 0; min-height: 40px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font-size: 16px; }
.clock-play { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; font-weight: 650; }
.clock-play[aria-pressed="true"] { color: white; background: var(--accent); border-color: var(--accent); }
.clock-note { margin: 12px 0 0; }
.clock-timeline { margin-top: 14px; }
.clock-slider { display: block; width: 100%; height: 28px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.clock-timeline-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.clock-sky-note { margin: 7px 0 0; font-size: 12px; color: var(--muted); }
.live-routing { padding: 18px 0 0; border-top: 1px solid var(--line); }
summary { cursor: pointer; font-size: 14px; font-weight: 650; }
.live-routing summary span { float: right; color: var(--muted); font-weight: 400; font-size: 12px; }
.live-place-grid { display: grid; grid-template-columns: minmax(0,1fr) 26px; gap: 8px; align-items: center; margin: 16px 0 12px; }
.live-place { position: relative; grid-column: 1; }
.live-place:nth-of-type(2) { grid-row: 2; }
.point-badge { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--blue); color: white; font-size: 12px; font-weight: 700; }
.point-badge--b { background: var(--coral); }
.text-input { width: 100%; min-height: 44px; padding: 9px 8px 9px 38px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font-size: 14px; }
.swap-button { grid-column: 2; grid-row: 1 / span 2; border: 0; background: none; font-size: 22px; color: var(--muted); }
.comparison-actions { display: grid; gap: 8px; }
.live-route-submit, .clear-comparison { min-height: 42px; border: 0; border-radius: 8px; background: var(--accent); color: white; font-size: 14px; font-weight: 650; }
.clear-comparison { background: var(--surface-soft); color: var(--ink); }
.live-route-status { margin: 0 0 18px; padding: 11px 12px; border-radius: 9px; background: var(--surface-soft); color: var(--muted); font-size: 13px; }
.live-route-status.is-error { color: #9b4236; background: #fff1ec; }
.panel-note { display: flex; gap: 8px; }
.panel-note svg { width: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.panel-note p { margin: 0; }
.data-notes { margin-top: 18px; }
.data-notes summary { font-size: 13px; }
.about-notes { margin-top: 18px; font-size: 14px; }
.about-notes h2 { margin: 0; font-size: 14px; font-weight: 650; }
.about-notes p { margin: 8px 0 0; color: var(--muted); }
.social-links { display: flex; flex-shrink: 0; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.social-badge { display: grid; place-items: center; width: 32px; height: 34px; border-radius: 7px; color: var(--accent-ink); text-decoration: none; transition: background-color 160ms ease, color 160ms ease; }
.social-badge svg { width: 16px; height: 16px; fill: currentColor; }
.social-badge:hover { background: var(--accent-soft); color: var(--ink); }
.map-panel { position: absolute; inset: 0; overflow: hidden; background: var(--accent-soft); isolation: isolate; }
/* Overscan supplies pixels pulled in by the warp. The visible map never
   changes size when the menu opens or closes. */
.maplibre-map { position: absolute; inset: -50%; z-index: 0; }
.chronomap { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.map-footer { position: absolute; z-index: 4; left: 354px; right: 16px; bottom: 34px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; pointer-events: none; transition: left 280ms ease; }
.sidebar-hidden .map-footer { left: 16px; }
.map-key { display: grid; flex: 0 0 188px; grid-template-columns: 1fr auto; gap: 3px 8px; color: var(--ink); background: #fffafff2; padding: 9px 10px; border-radius: 8px; box-shadow: var(--shadow); font-size: 12px; pointer-events: auto; }
.map-key strong { font-size: 14px; font-weight: 650; white-space: nowrap; }
.scale-detail { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.scale-rule { grid-column: 1 / -1; position: relative; display: block; width: 128px; margin: 5px 0; border-top: 2px solid var(--accent-ink); }
.map-key[data-kind="time"] .scale-rule { border-top-style: dashed; }
.scale-rule::before, .scale-rule::after { position: absolute; top: -5px; width: 2px; height: 7px; background: var(--accent-ink); content: ""; }
.scale-rule::after { right: 0; }
.map-navigation { position: absolute; z-index: 8; top: 82px; right: 16px; display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: white; box-shadow: var(--shadow); }
.map-navigation button { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-bottom: 1px solid var(--line); background: white; color: var(--ink); font-size: 24px; }
.map-navigation button:last-child { border: 0; }
.map-navigation button:hover, .icon-button:hover, .menu-toggle:hover { background: var(--accent-soft); }
.map-status { max-width: 500px; min-width: 0; padding: 7px 11px; border-radius: 8px; background: #fffaffe8; box-shadow: var(--shadow); color: var(--muted); font-size: 12px; }
.map-attribution { position: absolute; z-index: 5; bottom: 0; right: 0; max-width: 100%; padding: 3px 8px; background: #fffaffe3; color: var(--muted); font-size: 11px; }
.map-attribution a { text-decoration: none; }
.map-label, .node-label { fill: #324651; font-family: var(--sans); font-size: 12px; font-weight: 550; paint-order: stroke; stroke: #ffffffed; stroke-width: 3px; stroke-linejoin: round; }
.map-label--place { fill: #263d49; font-size: 14px; font-weight: 650; }
.map-label--transit { fill: #236f73; font-size: 11px; }
.map-label--landscape { fill: #4d7169; font-style: italic; }
.map-label--road { fill: #5c625d; font-size: 10px; }
.node-halo { fill: #fff; stroke: #6b8189; stroke-width: 1; }
.node-dot { fill: var(--accent-ink); }
.node-label { font-size: 12px; font-weight: 650; }
.node-tag { fill: #526878; font: 9px var(--sans); paint-order: stroke; stroke: white; stroke-width: 3px; }
.node-marker.is-anchor { opacity: .85; }
.is-point-a .node-dot { fill: var(--blue); }
.is-point-b .node-dot { fill: var(--coral); }
.is-point-a .node-halo { stroke: var(--blue); stroke-width: 2; }
.is-point-b .node-halo { stroke: var(--coral); stroke-width: 2; }
.journey-card { position: absolute; z-index: 6; top: 76px; left: 354px; width: min(400px, calc(100% - 438px)); padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fffffff2; box-shadow: var(--shadow); transition: left 280ms ease; }
.sidebar-hidden .journey-card { left: 16px; width: min(400px, calc(100% - 90px)); }
.journey-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.journey-card h3 { margin: 0; font-size: 14px; font-weight: 650; }
.journey-card header { padding-right: 15px; }
.journey-clear { position: absolute; right: 5px; top: 5px; width: 25px; height: 25px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; }
.journey-warning { margin: 10px 0 0; color: #855829; font-size: 12px; }
.journey-time { flex: 0 0 auto; color: var(--accent); font-size: 18px; font-weight: 700; }
.journey-path { display: flex; margin-top: 10px; color: var(--ink); font-size: 13px; }
.journey-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.map-error { position: absolute; inset: 0; z-index: 8; display: grid; place-content: center; padding: 2rem; background: var(--surface-soft); text-align: center; }
.map-error span { display: block; margin-top: 8px; color: var(--muted); }
@media (max-width: 1050px) {
  .topbar-actions { position: absolute; right: 0; top: 54px; }
  .explore-search { flex: 1; width: auto; }
  .map-navigation { top: 128px; }
  .journey-card, .sidebar-hidden .journey-card { top: 128px; }
}
@media (max-width: 760px) {
  .topbar { inset: 10px 10px auto; gap: 7px; flex-wrap: wrap; }
  .brand { padding: 0 10px; }
  .brand-mark { display: none; }
  .map-switcher select { min-width: 108px; padding-inline: 10px 27px; }
  .explore-search { flex: 0 0 100%; width: 100%; }
  .topbar-actions { top: 108px; gap: 6px; max-width: 100%; }
  .social-links { padding: 4px 2px; }
  .social-badge { width: 28px; }
  .view-button { padding-inline: 7px; }
  .control-panel { left: 10px; top: 172px; bottom: 28px; width: min(320px, calc(100vw - 70px)); padding: 16px; }
  .map-navigation { top: 172px; right: 10px; }
  .map-footer, .sidebar-hidden .map-footer { left: 10px; right: 10px; bottom: 38px; gap: 8px; }
  .map-key { flex-basis: 178px; padding: 8px; }
  .app-shell:not(.sidebar-hidden) .map-footer { visibility: hidden; }
  .map-attribution { font-size: 10px; }
  .journey-card, .sidebar-hidden .journey-card { top: auto; bottom: 150px; left: 10px; width: calc(100% - 72px); }
  .app-shell:not(.sidebar-hidden) .journey-card { visibility: hidden; }
  .fold-warning, .sidebar-hidden .fold-warning { left: 10px; right: 72px; bottom: 300px; }
  .app-shell:not(.sidebar-hidden) .fold-warning { visibility: hidden; }
}
@media (max-width: 400px) {
  .view-button { padding-inline: 5px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
