:root { --bg:#FCFDFC; --fg:#14213d; --muted:#5d6b85; --line:#e3e8f2; --accent:#0D24B1; --accent2:#DE6471; --ok:#068532; --warn:#b7791f; --soft:#EEF2FB; --cream:#FBF6EA; --panel-w:380px; }
* { box-sizing: border-box; }
html, body { margin:0; height:100%; font: 14px/1.45 Nunito, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color:var(--fg); background:var(--bg); }
#app { display:flex; height:100%; }
#panel { width:var(--panel-w); flex:none; display:flex; flex-direction:column; border-right:1px solid var(--line); background:var(--bg); overflow:hidden; }
#map { flex:1; min-width:0; }
.hdr { padding:10px 12px 0; border-bottom:1px solid var(--line); }
.hdr h1 { margin:0 0 6px; font-size:19px; font-weight:800; letter-spacing:-0.2px; }
.hdr h1 img { width:30px; height:30px; vertical-align:-8px; margin-right:6px; }
.tabs { display:flex; gap:4px; }
.tabs button { flex:1; border:0; background:none; padding:8px 4px; cursor:pointer; border-bottom:2px solid transparent; font-weight:600; color:var(--muted); }
.tabs button.active { color:var(--accent); border-bottom-color:var(--accent); }
.tab { display:none; padding:10px 12px; overflow:auto; }
.tab.active { display:block; }
#panel > section { flex:1; min-height:0; }
.field { position:relative; margin-bottom:8px; }
.field label { display:block; font-size:12px; color:var(--muted); }
input, select { width:100%; padding:8px 10px; border:2px solid #cfd8ea; border-radius:10px; font:inherit; background:#fff; }
input:focus, select:focus { outline:none; border-color:var(--accent); }
.row { display:flex; gap:6px; align-items:center; margin:6px 0 10px; }
.row select { flex:1; }
.row input[type=time] { width:100px; }
button { font:inherit; padding:7px 10px; border:1px solid #ccc; background:#fafafa; border-radius:6px; cursor:pointer; }
button.primary { background:var(--accent2); color:#fff; border-color:var(--accent2); font-weight:800; border-radius:999px; }
.sugg { position:absolute; z-index:5; left:0; right:0; background:#fff; border:1px solid #ccc; border-top:0; border-radius:0 0 6px 6px; max-height:220px; overflow:auto; display:none; }
.sugg div { padding:6px 8px; cursor:pointer; }
.sugg div:hover { background:#f0f4fa; }
.sugg small { color:var(--muted); }
.journey { border:2px solid var(--line); border-radius:12px; padding:8px 10px; margin-bottom:8px; cursor:pointer; }
.journey:hover, .journey.sel { border-color:var(--accent); box-shadow:0 0 0 2px #0b6bcb22; }
.journey .sum { display:flex; justify-content:space-between; font-weight:600; }
.journey .sum small { font-weight:400; color:var(--muted); }
.leg { display:flex; gap:8px; padding:4px 0; border-top:1px dashed var(--line); font-size:13px; }
.leg .badge { flex:none; min-width:44px; text-align:center; border-radius:999px; padding:1px 8px; font-weight:800; color:#fff; background:var(--accent); }
.leg .badge.walk { background:#888; }
.leg .meta { color:var(--muted); }
.rl { padding:6px 4px; border-bottom:1px solid var(--line); cursor:pointer; display:flex; gap:8px; }
.rl:hover { background:#f6f8fb; }
.rl .num { flex:none; min-width:48px; text-align:center; font-weight:800; color:#fff; background:var(--accent); border-radius:999px; padding:3px 8px; height:fit-content; }
.rl .num.ac { background:var(--ok); }
.rl .t { font-size:13px; }
.rl .t small { color:var(--muted); display:block; }
.detail { border-top:1px solid var(--line); padding:10px 12px; overflow:auto; background:var(--cream); }
.detail h2 { margin:0 0 4px; font-size:16px; display:flex; justify-content:space-between; }
.detail h2 button { padding:2px 8px; }
.detail .svc { margin:6px 0; padding:8px 10px; border-radius:10px; background:var(--soft); font-size:13px; }
.detail .svc.after, .detail .svc.no { background:#fff1f0; }
.detail .svc.before { background:#fff8e6; }
.dirtabs { display:flex; gap:4px; margin:6px 0; }
.dirtabs button { flex:1; font-size:12px; padding:5px; }
.dirtabs button.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.stoplist { list-style:none; margin:0; padding:0; font-size:13px; }
.stoplist li { padding:3px 0 3px 14px; position:relative; cursor:pointer; }
.stoplist li::before { content:""; position:absolute; left:2px; top:9px; width:7px; height:7px; border-radius:50%; background:var(--accent); }
.stoplist li.osm::before { background:#9ab; width:5px; height:5px; left:3px; top:10px; }
.stoplist li:hover { background:#eef2f7; }
.stoplist .m { float:right; color:var(--muted); }
.foot { padding:6px 12px; font-size:11px; color:var(--muted); border-top:1px solid var(--line); }
.muted { color:var(--muted); }
.warn { color:var(--warn); }
.pill { display:inline-block; padding:0 6px; border-radius:10px; background:#eee; font-size:12px; margin-right:4px; }
.maplibregl-popup-content { font: 13px/1.4 system-ui, sans-serif; padding:8px 10px; }
.maplibregl-popup-content button { padding:3px 8px; margin:4px 4px 0 0; font-size:12px; }
.handle { display:none; }
@media (max-width: 720px) {
  #app { flex-direction:column; }
  #map { flex:1; min-height:0; }
  /* bottom sheet: peek (header only) / mid / full; height animates, the map takes the rest */
  #panel { width:100%; flex:none; height:55vh; border-right:0; border-top:1px solid var(--line); order:2; border-radius:18px 18px 0 0; box-shadow:0 -6px 18px rgba(13,36,177,.12); transition:height .25s ease; }
  #panel.peek { height:132px; }
  #panel.full { height:88vh; }
  #panel.peek .tab, #panel.peek .detail, #panel.peek .foot { display:none; }
  .handle { display:flex; justify-content:center; align-items:center; height:22px; cursor:pointer; touch-action:none; flex:none; }
  .handle span { width:44px; height:5px; border-radius:999px; background:#cfd8ea; }
  .hdr { padding-top:2px; }
}

a.report { color: var(--muted); text-decoration: underline dotted; font-size: 12px; }

.brand { display:flex; align-items:center; justify-content:space-between; }
.brand h1 { margin:0 0 6px; }
.brand .home { font-size:13px; font-weight:800; color:var(--accent); text-decoration:none; border:2px solid var(--line); border-radius:999px; padding:4px 10px; margin-bottom:6px; }
.brand .lang { font-size:12px; font-weight:800; border:2px solid var(--line); border-radius:999px; padding:3px 8px; margin-right:6px; background:#fff; color:var(--muted); }
.brand .lang:hover { border-color:var(--accent); color:var(--accent); }
.brand .home:hover { border-color:var(--accent); background:var(--soft); }

.hdr-actions { display:flex; align-items:center; gap:6px; margin-bottom:6px; }
.brand .home { margin-bottom:0; }
button.info { width:28px; height:28px; padding:0; border-radius:50%; border:2px solid var(--line); background:#fff; color:var(--accent); font: italic 800 15px Georgia, serif; line-height:1; }
button.info:hover { border-color:var(--accent); background:var(--soft); }
#info-dialog { border:3px solid var(--accent); border-radius:16px; padding:18px 20px; max-width:440px; font: 14px/1.5 Nunito, system-ui, sans-serif; color:var(--fg); }
#info-dialog::backdrop { background:rgba(13,36,177,.35); }
#info-dialog h2 { margin:0 0 10px; font-size:18px; color:var(--accent); }
#info-dialog p { margin:8px 0; }
#info-dialog .dot { display:inline-block; width:12px; height:12px; border-radius:50%; vertical-align:-1px; margin-right:3px; }
#info-dialog .dot.fill { background:#FFC93C; border:1.5px solid var(--accent); }
#info-dialog .dot.ring { background:#fff; border:2.5px solid #FFC93C; }
#info-dialog form { text-align:right; margin-top:10px; }

.stop-pop b { display:block; font-size:14px; color:var(--accent); margin-bottom:2px; }
.stop-pop .badges { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; max-height:180px; overflow:auto; }
.stop-pop .badge { display:inline-flex; align-items:center; gap:5px; padding:2px 8px 2px 2px; border:2px solid var(--line); border-radius:999px; background:#fff; cursor:pointer; font:inherit; font-size:12px; color:var(--fg); }
.stop-pop .badge:hover { border-color:var(--accent); background:var(--soft); }
.stop-pop .badge .n { background:var(--accent); color:#fff; font-weight:800; border-radius:999px; padding:1px 7px; }
.stop-pop .badge.ac .n { background:var(--ok); }
.stop-pop .badge small { color:var(--muted); }
.maplibregl-popup-content { border-radius:12px; border:2px solid var(--accent); box-shadow:0 6px 18px rgba(13,36,177,.15); }
.maplibregl-popup-close-button { font-size:18px; padding:0 6px; }
