/* unde-ne-intalnim: two journeys drawn as two colours across the stop map; where the colours meet, the trips are equal */
:root {
  --bg: #eef2f6; --bg-2: #e3e9f0; --card: #f8fafc; --ink: #0f1726; --mut: #374255; --line: #c9d2de; --line-soft: #d8dfe8;
  --link: #173f9e;
  --pa: #c2185b; --pb: #1d55c9; --pa-t: #9a0f4b; --pb-t: #173f9e; --pm: #7a3d9a;
  --map-bg: #e7ecf2; --map-water: #b9cde0; --map-park: #d4e1d4; --map-road: #c5ced9; --map-road2: #d7dde5; --map-rail: #a7b1bf;
  --map-uat: #8d98a8; --map-label: #1b2433; --map-halo: #eef2f6; --star: #0f1726; --star-ring: #ffffff;
  --walk: #4a5568; --ride-ink: #ffffff;
  --topbar: 48px; --panel: 430px;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --shadow: 0 1px 0 rgba(15, 23, 38, .05), 0 10px 30px -14px rgba(15, 23, 38, .3);
  color-scheme: light;
}
:root.dark {
  --bg: #0b1220; --bg-2: #101a2c; --card: #121c2f; --ink: #e8edf5; --mut: #b9c3d3; --line: #27344b; --line-soft: #1e2a3e;
  --link: #a8c8ff;
  --pa: #ff5c9a; --pb: #5aa9ff; --pa-t: #ff8db8; --pb-t: #8cc3ff; --pm: #c99bff;
  --map-bg: #0a1020; --map-water: #152b4a; --map-park: #0f231f; --map-road: #253248; --map-road2: #182235; --map-rail: #34405a;
  --map-uat: #4f5d78; --map-label: #e8edf5; --map-halo: #0a1020; --star: #ffffff; --star-ring: #0a1020;
  --walk: #b9c3d3; --ride-ink: #0b1220;
  --shadow: 0 1px 0 rgba(0, 0, 0, .35), 0 14px 36px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
svg[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 12px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans); overflow-anchor: none; }
a { color: var(--link); text-underline-offset: 2px; }
.mut { color: var(--mut); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 99; background: var(--ink); color: var(--bg); padding: 8px 12px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.mono, time { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar); display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--bg); font: 500 14px/1 var(--sans); border-bottom: 1px solid var(--line-soft); }
.home { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; }
.motif { width: 22px; height: 22px; }
.topnav { display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { color: var(--mut); text-decoration: none; white-space: nowrap; padding: 6px 0; }
.topnav a:hover { color: var(--ink); }
.spacer { flex: 1; }
.lang { color: var(--mut); text-decoration: none; font: 600 13px/1 var(--sans); padding: 8px 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font: 600 18px/1 var(--sans); padding: 0; }
.icon-btn[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
@media (pointer: coarse) { .icon-btn { width: 44px; height: 44px; } }
@media (max-width: 760px) { .topnav { display: none; } .home span { font-size: 13px; } }
#theme .i-sun { display: none; } :root.dark #theme .i-sun { display: block; } :root.dark #theme .i-moon { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--bg); border-radius: 8px; padding: 9px 14px; font: 600 15px/1.2 var(--sans); cursor: pointer; text-decoration: none; }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.small { padding: 6px 10px; font-size: 13px; }
@media (pointer: coarse) { .btn { min-height: 44px; } }

/* the tool: map is the page; the panel reads beside it (desktop) or below it (phone) */
.tool { display: grid; grid-template-columns: var(--panel) minmax(0, 1fr); align-items: start; }
.panel { grid-column: 1; grid-row: 1; padding: 22px 22px 28px; border-right: 1px solid var(--line-soft); min-height: calc(100svh - var(--topbar)); background: var(--bg); }
.stage { grid-column: 2; grid-row: 1; position: sticky; top: var(--topbar); height: calc(100svh - var(--topbar)); margin: 0; background: var(--map-bg); overflow: hidden; touch-action: none; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
@media (max-width: 979px) {
  .tool { grid-template-columns: minmax(0, 1fr); }
  .stage { grid-column: 1; grid-row: 1; height: 42svh; min-height: 250px; z-index: 5; border-bottom: 1px solid var(--line); }
  .panel { grid-column: 1; grid-row: 2; border-right: 0; min-height: 0; padding: 16px 16px 24px; }
}
.busy, .nomap { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; font-size: 15px; color: var(--ink); max-width: 80%; text-align: center; }

.tapbar { position: absolute; top: 12px; left: 12px; right: 120px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--mut); pointer-events: none; }
.tapbar > span { background: color-mix(in srgb, var(--map-bg) 85%, transparent); padding: 4px 6px; border-radius: 6px; }
.tapbar button { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 5px 11px 5px 6px; font: 500 13px/1.2 var(--sans); cursor: pointer; }
.tapbar button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
@media (pointer: coarse) { .tapbar button { min-height: 40px; } }
@media (max-width: 979px) { .tapbar { top: 8px; left: 8px; right: 8px; flex-wrap: nowrap; } .tapbar > span { font-size: 12px; white-space: nowrap; }
  .tapbar button[data-mode-pick="a"] .tl-txt, .tapbar button[data-mode-pick="b"] .tl-txt { display: none; } .tapbar button[data-mode-pick="a"], .tapbar button[data-mode-pick="b"] { padding: 4px; } }
@media (max-width: 400px) { .tapbar > span { display: none; } }
.who { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 99px; font: 700 12px/1 var(--sans); color: #fff; flex: none; }
:root.dark .who { color: #0b1220; }
.who-a { background: var(--pa); } .who-b { background: var(--pb); }
.star { display: inline-grid; place-items: center; width: 22px; height: 22px; font-size: 15px; line-height: 1; color: var(--star); }
.map-tools { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.map-tools #whole { margin-top: 4px; white-space: nowrap; }
@media (max-width: 979px) { .map-tools { flex-direction: row-reverse; align-items: center; top: auto; bottom: 64px; right: 8px; } .map-tools .icon-btn[data-zoom] { display: none; } }
.legend { position: absolute; left: 12px; bottom: 10px; display: grid; grid-template-columns: auto auto auto; gap: 2px 10px; align-items: center;
  background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--line-soft); padding: 7px 10px 6px; border-radius: 8px; font-size: 12px; color: var(--mut); }
.legend .ramp { grid-column: 1 / 4; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--pa), var(--pm) 50%, var(--pb)); }
.legend .lg-m { text-align: center; } .legend .lg-b { text-align: right; }
.legend .lg-s { grid-column: 1 / 4; display: flex; align-items: center; gap: 4px; }
.legend .lg-h { grid-column: 1 / 4; color: var(--ink); font-weight: 600; }
.legend .metro-k { display: inline-block; width: 18px; height: 3px; margin: 0 4px 0 12px; border-radius: 2px; background: linear-gradient(90deg, #c8102e 0 25%, #f2c500 25% 50%, #2b7a3d 50% 75%, #f39200 75%); opacity: .8; }
@media (max-width: 979px) { .legend { left: 8px; right: 8px; bottom: 6px; font-size: 12px; padding: 4px 8px; grid-template-columns: 1fr auto 1fr; } .legend .lg-s { display: none; } .legend .lg-h { display: none; } }
.mapcard { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: calc(100% - 24px);
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px 6px 8px; box-shadow: var(--shadow); text-decoration: none; font-size: 14px; white-space: nowrap; }
.mapcard b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.mapcard .t { display: inline-flex; align-items: center; gap: 4px; color: var(--mut); font: 13px/1 var(--mono); }
.mapcard .t time { color: var(--ink); font-weight: 600; }
.mapcard .who { width: 18px; height: 18px; font-size: 10px; }
.mapcard b { flex: 0 1 auto; min-width: 4.5em; }
@media (max-width: 400px) { .mapcard .tm { display: none; } .mapcard .t { font-size: 12px; } }
@media (min-width: 980px) { .mapcard { left: 12px; transform: none; bottom: auto; top: 54px; } }
@media (min-width: 980px) and (max-width: 1279px) { .tapbar > span { display: none; } }
@media (max-width: 979px) { .mapcard { bottom: auto; top: 56px; left: 8px; transform: none; font-size: 13px; padding: 4px 10px 4px 6px; } }
.tip { position: absolute; z-index: 6; pointer-events: none; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; line-height: 1.35; box-shadow: var(--shadow); max-width: 240px; }
.tip b { font-weight: 600; } .tip .t { font-family: var(--mono); font-size: 12px; } .tip .h { color: var(--mut); font-size: 12px; }

/* panel */
@media (max-width: 979px) { body.typing .stage { position: relative; height: 30svh; min-height: 180px; } }
.reset-top { justify-self: start; }
.shared-line { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--ink); background: var(--card); font-size: 15px; }
.kicker { margin: 0 0 6px; font: 600 12px/1.4 var(--sans); letter-spacing: .02em; color: var(--mut); }
h1 { margin: 0 0 10px; font: 650 27px/1.18 var(--sans); letter-spacing: -.01em; text-wrap: balance; }
.deck { margin: 0 0 16px; color: var(--mut); font-size: 16px; line-height: 1.5; }
@media (max-width: 979px) { h1 { font-size: 23px; } .deck { font-size: 15.5px; } }
.controls { display: grid; gap: 12px; padding: 14px 0 6px; border-top: 1px solid var(--line-soft); }
.org label, .timerow label { display: flex; align-items: center; gap: 8px; font: 600 14px/1.3 var(--sans); margin-bottom: 5px; }
.qwrap { display: flex; gap: 6px; position: relative; }
.qwrap input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: var(--card); color: var(--ink); font: 500 16px/1 var(--sans); }
.org[data-who="a"] input { border-left: 4px solid var(--pa); } .org[data-who="b"] input { border-left: 4px solid var(--pb); }
@media (pointer: coarse) { .qwrap input { height: 44px; } }
.sugg { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: var(--shadow); max-height: 260px; overflow: auto; position: relative; z-index: 8; }
.sugg li { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.sugg li[aria-selected="true"], .sugg li:hover { background: var(--bg-2); }
.sugg .ln { color: var(--mut); font: 12px/1.6 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.timerow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.timerow label { margin: 0; }
.tsel { display: flex; align-items: center; gap: 6px; }
.tsel select { height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--card); color: var(--ink); font: 600 17px/1 var(--mono); }
.day { margin: -4px 0 0; font-size: 13px; color: var(--mut); }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: var(--card); color: var(--ink); padding: 9px 8px; font: 500 14px/1.25 var(--sans); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); font-weight: 600; }
@media (pointer: coarse) { .seg button { min-height: 44px; } }
.limrow { display: grid; gap: 4px; font-size: 14px; } .limrow input { width: 100%; accent-color: var(--ink); }
.goal-note { margin: 0; font-size: 13px; color: var(--mut); }

/* the result: a meeting ticket, two journeys on one time axis */
.result { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.meet-lab { margin: 0; font: 600 12px/1.3 var(--sans); color: var(--mut); letter-spacing: .02em; }
.meet-name { margin: 2px 0 2px; font: 650 30px/1.12 var(--sans); letter-spacing: -.01em; }
.meet-when { margin: 0 0 4px; font-size: 15px; }
.meet-when time { font-weight: 600; }
.meet-why { margin: 0 0 12px; font-size: 13px; color: var(--mut); }
.meet-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.meet-actions:not(:has(button:not([hidden]))) { display: none; }
.meet-why button { border: 0; background: none; padding: 0; color: var(--link); font: inherit; text-decoration: underline; cursor: pointer; }
.tl { position: relative; margin: 8px 0 4px; }
.tl-row { display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 8px; margin: 8px 0; }
.tl-track { position: relative; height: 24px; }
.tl-seg { position: absolute; top: 4px; height: 16px; border-radius: 3px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  font: 700 11px/1 var(--sans); color: var(--ride-ink); white-space: nowrap; }
.tl-seg.walk { top: 11px; height: 2px; border-radius: 0; background: repeating-linear-gradient(90deg, var(--walk) 0 3px, transparent 3px 6px); }
.tl-seg.wait { top: 9px; height: 6px; border: 1px solid var(--walk); background: transparent; border-radius: 3px; opacity: .8; }
.tl-seg.idle { top: 7px; height: 10px; border-radius: 3px; background: repeating-linear-gradient(135deg, var(--line) 0 3px, transparent 3px 6px); border: 1px dashed var(--mut); }
.tl-end { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); }
.tl-axis { position: relative; height: 18px; margin-left: 34px; border-top: 1px solid var(--line); font: 11px/1 var(--mono); color: var(--mut); }
.tl-axis span { position: absolute; top: 4px; transform: translateX(-50%); }
.tl-axis-lab { margin: 2px 0 10px 34px; font-size: 11px; color: var(--mut); }
.legs { display: grid; gap: 12px; margin: 10px 0 0; }
@media (min-width: 560px) and (max-width: 979px) { .legs { grid-template-columns: 1fr 1fr; } }
.leg { border-left: 3px solid var(--pa); padding: 2px 0 2px 12px; }
.leg.b { border-left-color: var(--pb); }
.leg h3 { margin: 0 0 4px; font: 600 15px/1.35 var(--sans); display: flex; gap: 8px; align-items: center; }
.leg h3 .tot { margin-left: auto; font: 600 14px/1 var(--mono); color: var(--mut); white-space: nowrap; }
.leg ol { list-style: none; margin: 0; padding: 0; font-size: 14.5px; line-height: 1.45; }
.leg li { display: grid; grid-template-columns: 46px 1fr; gap: 8px; padding: 3px 0; }
.leg li time { color: var(--mut); font-size: 13px; padding-top: 1px; }
.badge { display: inline-block; min-width: 26px; padding: 1px 6px; margin-right: 4px; border-radius: 4px; font: 700 12.5px/1.45 var(--sans); text-align: center; color: #fff; vertical-align: 1px; }
.leg .note { color: var(--mut); font-size: 13px; }
.leg .unreach { color: var(--ink); }
.empty { margin: 8px 0; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; font-size: 14.5px; }
.alts { margin-top: 16px; }
.alts h3 { margin: 0 0 6px; font: 600 13px/1.3 var(--sans); color: var(--mut); }
.alts-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.alts-list button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; text-align: left; border: 1px solid var(--line-soft); background: var(--card); color: var(--ink); border-radius: 8px; padding: 7px 10px; font: 500 14.5px/1.3 var(--sans); cursor: pointer; }
.alts-list button:hover { border-color: var(--ink); }
.alts-list .t { font: 12.5px/1 var(--mono); color: var(--mut); white-space: nowrap; }
@media (pointer: coarse) { .alts-list button { min-height: 44px; } }
.mine { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }

/* share row: compact and quiet */
.share-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.share-row .lbl { font-size: 14px; color: var(--mut); margin-right: 2px; }
.share-row a, .share-row button { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 99px; border: 1px solid var(--line-soft); background: transparent; color: var(--ink); cursor: pointer; padding: 0; }
.share-row svg { width: 18px; height: 18px; }
.share-row a:hover, .share-row button:hover, .share-row a:focus-visible, .share-row button:focus-visible { color: var(--link); border-color: var(--link); }
@media (pointer: coarse) { .share-row a, .share-row button { width: 44px; height: 44px; } }
.status { margin: 4px 0 0; font-size: 13px; color: var(--mut); min-height: 0; flex-basis: 100%; }
.status:empty { display: none; }
.page-share { padding-top: 26px; }

/* article below */
.wrap { max-width: 44rem; margin: 0 auto; padding: 0 20px; }
.block { padding: 34px 0 10px; }
.block h2 { font: 650 24px/1.25 var(--sans); margin: 0 0 12px; position: relative; text-wrap: balance; }
.block h3 { font: 600 18px/1.3 var(--sans); margin: 22px 0 6px; }
.anchor { position: absolute; left: -1.1em; color: var(--mut); text-decoration: none; opacity: 0; font-weight: 400; }
h2:hover .anchor, .anchor:focus { opacity: 1; }
.pairs { padding-left: 1.6em; margin: 10px 0 12px; font-size: 15.5px; }
.pairs li { margin: 4px 0; }
.plain { padding-left: 1.1em; } .sources li { margin: 6px 0; font-size: 15px; }
footer { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; padding: 40px 16px 60px; font-size: 14px; color: var(--mut); border-top: 1px solid var(--line-soft); margin-top: 40px; }
footer a { color: var(--mut); }
@media print { .stage, .topbar, .share-row, .controls { display: none !important; } .tool { display: block; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
