/* Malé Bus — map-first layout: full-screen map, floating search, draggable bottom sheet.
   Ink on white, hairlines, pill controls, sage reserved for "now" and live states. */
:root {
  --ink: #1a1b1c;
  --paper: #ffffff;
  --mist: #f4f5f5;
  --line: #e4e6e7;
  --text-2: #6b7075;
  --text-3: #9a9fa4;
  --sage: #c8e4ad;
  --pine: #12331d;
  --warn: #b42318;
  /* type: Google Sans for display and numbers, DM Sans for reading text */
  --display: "Google Sans", "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --pill: 999px;
  --lift: 0 1px 2px rgba(26, 27, 28, .06), 0 8px 24px rgba(26, 27, 28, .08);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --peek: 240px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--mist); color: var(--ink); font: 400 15px/1.45 var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
/* icon defaults; the map's own drawing layer (route lines, stops) is left alone */
:where(svg:not(.leaflet-overlay-pane svg)) { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill { fill: currentColor; stroke: none; }
.cap { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* map */
#map { position: fixed; inset: 0; background: #eef0f0; font-family: var(--font); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.7) !important; }
.leaflet-control-zoom { display: none; }
.bus { position: relative; display: flex; align-items: center; gap: 5px; white-space: nowrap; transform: translate(-11px, -11px); }
.bus i { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); display: grid; place-items: center; }
.bus i svg { width: 11px; height: 11px; stroke: #fff; stroke-width: 2.4; }
.bus b { flex: none; font: 600 11px var(--font); color: var(--ink); background: #fff; border-radius: var(--pill); padding: 2px 7px; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.bus.dim { opacity: .45; }

/* top bar */
.top { position: fixed; z-index: 500; top: calc(var(--safe-t) + 12px); left: 12px; right: 12px; display: flex; gap: 8px; max-width: 520px; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: var(--paper); border: 0; border-radius: var(--pill); padding: 8px 16px 8px 18px; box-shadow: var(--lift); text-align: left; }
.search .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 3px var(--ink); flex: none; }
.search-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.search-text .cap { font-size: 10px; }
#stopName { font-family: var(--display); font-weight: 500; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--paper); box-shadow: var(--lift); display: grid; place-items: center; flex: none; }
.round.flat { box-shadow: none; background: var(--mist); width: 44px; height: 44px; }
.status { flex: none; display: flex; align-items: center; gap: 6px; background: var(--paper); border-radius: var(--pill); padding: 4px 10px 4px 8px; font-size: 12px; font-weight: 600; box-shadow: var(--lift); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.status.live i { background: #3fa34d; animation: pulse 2s infinite; }
.status.err i { background: var(--warn); }
@keyframes pulse { 50% { opacity: .35; } }
.locate { position: fixed; z-index: 400; right: 12px; bottom: calc(var(--peek) + 12px); transition: bottom .3s ease; }

/* bottom sheet */
.sheet { --h: calc(100dvh - var(--safe-t) - 84px); position: fixed; z-index: 600; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; height: var(--h); background: var(--paper); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 -2px 24px rgba(26,27,28,.12); display: flex; flex-direction: column; transform: translateY(calc(var(--h) - var(--peek))); transition: transform .32s cubic-bezier(.2,.8,.2,1); touch-action: none; }
.sheet.dragging { transition: none; }
.grab { padding: 10px 0 4px; display: grid; place-items: center; cursor: grab; }
.grab span { width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
.hero { padding: 6px 20px 14px; display: flex; flex-direction: column; gap: 10px; }
.hero-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hero .bno { font-family: var(--display); font-size: 36px; font-weight: 500; letter-spacing: -.025em; line-height: 1; }
.hero .mins { font-family: var(--display); font-size: 36px; font-weight: 500; letter-spacing: -.025em; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hero .mins small { font-family: var(--font); font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--text-2); margin-left: 3px; }
.hero .mins.now { background: var(--sage); color: var(--pine); border-radius: var(--pill); padding: 6px 14px; font-size: 20px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; color: var(--text-2); }
.badge { display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 8px; border-radius: 7px; color: #fff; font-family: var(--display); font-size: 13px; font-weight: 500; }
.type { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--line); border-radius: var(--pill); padding: 2px 8px; color: var(--ink); }
.empty { color: var(--text-2); font-size: 14px; font-weight: 400; padding: 4px 0; }
.tabs { display: flex; gap: 4px; padding: 0 14px 10px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs button { flex: none; border: 0; background: none; border-radius: var(--pill); padding: 8px 13px; font-weight: 600; font-size: 14px; color: var(--text-2); }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; }
.sheet:not(.full) .panes { overflow: hidden; }
.panes { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px calc(var(--safe-b) + 24px); touch-action: pan-y; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.grow { flex: 1; min-width: 0; }
.t1 { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t2 { font-size: 13px; font-weight: 400; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eta { font-family: var(--display); font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.eta.now { background: var(--sage); color: var(--pine); border-radius: var(--pill); padding: 2px 10px; font-size: 14px; font-weight: 500; }
.sec { margin: 18px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); border-radius: var(--pill); padding: 4px 10px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.uprow { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.rlist button { width: 100%; display: flex; gap: 12px; align-items: center; border: 0; background: none; text-align: left; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rlist .rno { width: 44px; height: 44px; border-radius: 12px; color: #fff; display: grid; place-items: center; font-family: var(--display); font-size: 16px; font-weight: 500; flex: none; }
.rlist button[aria-pressed="true"] .t1 { text-decoration: underline; text-underline-offset: 3px; }
.fare { font-family: var(--display); font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mini { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); border: 1px solid var(--line); border-radius: var(--pill); padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.tt li { cursor: pointer; padding: 10px 0; }
.tt .rail { width: 12px; display: grid; place-items: center; align-self: stretch; position: relative; }
.tt .rail::before { content: ""; position: absolute; top: -10px; bottom: -10px; width: 3px; background: var(--rc); }
.tt li:first-child .rail::before { top: 50%; }
.tt li:last-child .rail::before { bottom: 50%; }
.tt .rail i { position: relative; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2.5px solid var(--rc); }
.tt li.me .rail i { width: 15px; height: 15px; background: var(--sage); border-color: var(--ink); }
.tt li.me .t1 { text-decoration: underline; text-underline-offset: 3px; }
.picker-route { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 4px; }
.picker-route button { border: 1px solid var(--line); background: #fff; border-radius: var(--pill); padding: 5px 11px; font-size: 13px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.picker-route button i { width: 9px; height: 9px; border-radius: 50%; }
.picker-route button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 900; background: var(--paper); display: flex; flex-direction: column; padding-top: var(--safe-t); }
.ov-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ov-head h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.ov-head input { flex: 1; min-width: 0; border: 0; background: var(--mist); border-radius: var(--pill); padding: 12px 16px; font: 400 16px var(--font); color: var(--ink); }
.ov-body { flex: 1; overflow-y: auto; padding: 8px 20px calc(var(--safe-b) + 24px); max-width: 560px; width: 100%; margin: 0 auto; }
.stoprow { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: none; text-align: left; padding: 12px 0; border-bottom: 1px solid var(--line); }
.stoprow .swatches { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; max-width: 45%; }
.stoprow .swatches span { font-family: var(--display); font-size: 10.5px; font-weight: 500; color: #fff; border-radius: 5px; padding: 1px 5px; }
.star { border: 0; background: none; padding: 6px; color: var(--text-3); }
.star[aria-pressed="true"] { color: var(--ink); }
.star[aria-pressed="true"] svg { fill: var(--ink); }
.group { padding: 16px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.group:last-child { border-bottom: 0; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.row small { display: block; color: var(--text-2); font-size: 13px; font-weight: 400; }
.row b { font-weight: 600; }
.label { font-size: 13px; color: var(--text-2); }
.note { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { border: 1px solid var(--line); background: #fff; border-radius: var(--pill); padding: 8px 13px; font-size: 13px; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.switch input { appearance: none; width: 48px; height: 30px; border-radius: 30px; background: var(--line); position: relative; margin: 0; flex: none; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(18px); }
.fleet { list-style: none; margin: 0; padding: 0; }
.fleet li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* alert toast */
.toast { position: fixed; z-index: 1000; left: 12px; right: 12px; top: calc(var(--safe-t) + 12px); max-width: 520px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: var(--r-md); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; box-shadow: var(--lift); }
.toast > div { flex: 1; }
.toast b { display: block; font-family: var(--display); font-weight: 500; font-size: 16px; }
.toast span { font-size: 13px; font-weight: 400; color: #c9cccf; }
.toast button { border: 0; background: none; color: #c9cccf; font-weight: 600; font-size: 13px; padding: 0; }

@media (min-width: 900px) {
  .sheet .panes { overflow-y: auto !important; }
  .sheet { left: 16px; right: auto; bottom: 16px; width: 400px; height: calc(100dvh - 120px - var(--safe-t)); border-radius: var(--r-lg); transform: none !important; }
  .grab { display: none; }
  .locate { bottom: 24px !important; }
  .top { left: 16px; width: 400px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.arr { width: 13px; height: 13px; stroke-width: 2; vertical-align: -2px; margin: 0 3px; }
.areas { margin: 12px 0 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.areas button { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.areas button span { font-size: 11px; color: var(--text-3); font-weight: 600; }
.areas button[aria-pressed="true"] span { color: #c9cccf; }
.livecount { color: #2e7d3a; font-weight: 600; }
.speed { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.bus.sel b { background: var(--ink); color: #fff; }
.bus.sel i { box-shadow: 0 0 0 3px var(--ink), 0 1px 4px rgba(0,0,0,.25); }
.bus i svg { width: 12px; height: 12px; }
/* hero */
.hero-top { flex-wrap: wrap; }
.eta-label { font-family: var(--display); font-size: 17px; font-weight: 500; background: var(--sage); color: var(--pine); border-radius: var(--pill); padding: 6px 12px; line-height: 1.2; max-width: 100%; }
.type { display: inline-flex; align-items: center; gap: 5px; }
.type svg { width: 13px; height: 13px; stroke-width: 2; }
.ink { color: var(--ink); font-weight: 600; }
.eta.muted { color: var(--text-3); }
/* saved + lists with a star at the end */
.fav, .rrow, .pickrow, .list li:has(.fav-main) { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.list li:has(.fav-main) { padding: 0; }
.fav:last-of-type, .rrow:last-child { border-bottom: 0; }
.fav-main, .rrow > button { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; text-align: left; padding: 12px 0; }
.rlist .rrow > button { border-bottom: 0; }
.rno.sm { width: 40px; height: 40px; border-radius: 11px; color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 500; font-size: 15px; flex: none; }
.rno.stop { background: var(--mist); color: var(--ink); }
.pickrow .stoprow { border-bottom: 0; }
.star { flex: none; border: 0; background: none; padding: 10px 4px 10px 8px; color: var(--text-3); }
.star svg { width: 22px; height: 22px; }
.star[aria-pressed="true"] { color: #e0a100; }
.star[aria-pressed="true"] svg { fill: #f5c542; stroke: #e0a100; }
.empty-state { padding: 18px 0 8px; }
.empty-state b { font-family: var(--display); font-weight: 500; font-size: 17px; }
.nudge { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px; background: var(--mist); border-radius: var(--r-md); font-size: 14px; }
/* account */
.stack { display: flex; flex-direction: column; gap: 10px; }
.field { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: var(--pill); padding: 12px 16px; font: 400 16px var(--font); color: var(--ink); }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--pill); padding: 13px 16px; background: var(--ink); color: #fff; font: 600 15px var(--font); }
.btn.ghost { background: var(--mist); color: var(--ink); }

/* alert rules */
.rules li { padding: 0; }
.t2.wrap { white-space: normal; }
.on-now { flex: none; font-size: 11px; font-weight: 600; color: var(--pine); background: var(--sage); border-radius: var(--pill); padding: 2px 8px; }
.mini-sw { flex: none; padding-left: 8px; }
.mini-sw input { width: 42px; height: 26px; }
.mini-sw input::after { width: 20px; height: 20px; }
.mini-sw input:checked::after { transform: translateX(16px); }
.bell svg { width: 20px; height: 20px; }
.chip svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font: 500 24px var(--display); }
.stepper span { flex: 1; text-align: center; font-family: var(--display); font-size: 17px; color: var(--text-2); }
.stepper input { width: 64px; border: 0; border-bottom: 2px solid var(--ink); text-align: center; font: 500 34px var(--display); color: var(--ink); background: none; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.times { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.times label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); min-width: 0; }
.days button { min-width: 46px; }
select.field { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1b1c' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 18px; padding-right: 40px; }
.btn.danger { color: var(--warn); }

/* heading arrow around a moving bus */
.bus .dir { position: absolute; left: 0; top: 0; width: 22px; height: 22px; pointer-events: none; transition: transform .6s ease; }
.bus .dir::before { content: ""; position: absolute; left: 50%; top: -9px; transform: translateX(-50%); border: 6px solid transparent; border-bottom: 8px solid currentColor; border-top: 0; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff); }
.bus .dir[hidden] { display: none; }
/* bus popup */
.buspop .leaflet-popup-content-wrapper { border-radius: var(--r-md); box-shadow: var(--lift); padding: 0; }
.buspop .leaflet-popup-content { margin: 14px 16px; font: 400 14px/1.4 var(--font); color: var(--ink); width: auto !important; }
.buspop .leaflet-popup-close-button { top: 8px !important; right: 8px !important; font-size: 20px !important; color: var(--text-2) !important; }
.bp { display: flex; flex-direction: column; gap: 10px; }
.bp-head { display: flex; align-items: center; gap: 8px; padding-right: 18px; }
.bp-no { font-family: var(--display); font-weight: 500; font-size: 22px; letter-spacing: -.01em; }
.bp-head .type { margin-left: auto; }
.bp-dir { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.bp-dir b { color: var(--ink); font-weight: 600; }
.bp-dir svg { width: 16px; height: 16px; flex: none; }
.bp-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.bp-grid > div { background: var(--mist); border-radius: var(--r-sm); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bp-grid b { font-family: var(--display); font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-grid small { color: var(--text-2); font-size: 12px; }
.bp-grid .cap { font-size: 10px; }
.bp-mine { background: var(--sage); color: var(--pine); border-radius: var(--r-sm); padding: 8px 10px; font-size: 14px; }
.bp-mine b { font-weight: 600; }
.bp-stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bp-stops li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.bp-stops li:last-child { border-bottom: 0; }
.bp-stops li span { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-stops li b { font-family: var(--display); font-weight: 500; white-space: nowrap; }
.bp-actions { display: flex; gap: 8px; }
.bp-actions button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: var(--pill); padding: 10px 12px; background: var(--ink); color: #fff; font: 600 13px var(--font); }
.bp-actions button:first-child:not(:last-child) { background: var(--mist); color: var(--ink); }
.bp-actions svg { width: 15px; height: 15px; }
.bp-foot { font-size: 11.5px; color: var(--text-3); }

/* quick routes bar */
.quick { position: fixed; z-index: 500; top: calc(var(--safe-t) + 74px); left: 12px; right: 12px; max-width: 520px; display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; }
.quick::-webkit-scrollbar { display: none; }
.quick-chips { display: flex; gap: 6px; }
.qchip { flex: none; display: flex; align-items: center; gap: 6px; border: 0; background: var(--paper); border-radius: var(--pill); padding: 6px 12px 6px 10px; font: 500 14px var(--display); box-shadow: var(--lift); color: var(--ink); }
.qchip i { width: 10px; height: 10px; border-radius: 50%; background: var(--rc); }
.qchip.on { background: var(--rc); color: #fff; }
.qchip.on i { background: #fff; }
.qchip .x { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.25); margin-right: -4px; }
.qchip .x svg { width: 11px; height: 11px; stroke-width: 2.4; }
.qchip.add { color: var(--text-2); padding: 6px 12px; }
.routepick button { display: flex; align-items: center; gap: 6px; }
.routepick button i { width: 9px; height: 9px; border-radius: 50%; background: var(--rc); }
.routepick button[aria-pressed="true"] { background: var(--rc); border-color: var(--rc); }
.routepick button[aria-pressed="true"] i { background: #fff; }
@media (min-width: 900px) { .quick { left: 432px; right: 16px; top: calc(var(--safe-t) + 18px); max-width: none; } }
/* star sits at the right end of route rows (the generic .rlist button rule made it full width) */
.rlist .rrow > .star { width: auto; flex: none; margin-left: auto; padding: 10px 2px 10px 10px; border-bottom: 0; }
/* show full route and stop names in lists instead of cutting them off */
.rrow .t1, .rrow .t2, .fav .t1, .fav-main .t1, .stoprow .t1, .bp-grid b { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }

/* calmer bus popup */
.bp { gap: 8px; }
.bp-head { gap: 8px; }
.bp-no { font-size: 20px; }
.bp-type { margin-left: 2px; color: var(--text-2); display: grid; }
.bp-type svg { width: 16px; height: 16px; }
.bp-dir { display: block; font-size: 14px; color: var(--ink); }
.bp-dir b { font-weight: 600; }
.bp-dir span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-2); }
.bp-mine { font-size: 14px; padding: 9px 12px; }
.bp-next { font-size: 13px; color: var(--text-2); }
.bp-more summary { cursor: pointer; font-size: 13px; color: var(--text-2); list-style: none; }
.bp-more summary::-webkit-details-marker { display: none; }
.bp-more summary::after { content: " ›"; }
.bp-more[open] summary::after { content: " ⌄"; }
.bp-more .bp-stops { margin-top: 4px; }
.bp-actions { margin-top: 2px; }
.bp-actions button { padding: 9px 12px; }
/* popup spacing */
.buspop .leaflet-popup-content { margin: 16px 18px 18px !important; }
.buspop .leaflet-popup-close-button { width: 32px !important; height: 32px !important; top: 8px !important; right: 8px !important; display: grid; place-items: center; border-radius: 50%; line-height: 1 !important; }
.buspop .leaflet-popup-close-button:hover { background: var(--mist); }
.bp { gap: 10px; }
.bp-head { padding-right: 34px; min-height: 28px; }
.bp-mine { margin: 2px 0; }
.bp-more { padding-top: 2px; }
.bp-actions { margin-top: 4px; gap: 8px; }

/* mobile: time fields fit their column (Chrome gives them a wide built-in minimum) */
input[type="time"].field { min-width: 0; max-width: 100%; width: 100%; height: 48px; padding: 0 12px; font-size: 16px; display: block; -webkit-appearance: none; appearance: none; text-align: left; }
input[type="time"].field::-webkit-date-and-time-value { text-align: left; }
input[type="time"].field::-webkit-calendar-picker-indicator { margin-left: 2px; }
@media (max-width: 360px) { .times { grid-template-columns: 1fr; } }
/* account card */
.acct { display: flex; align-items: center; gap: 12px; }
.acct small { display: block; color: var(--text-2); font-size: 13px; }
.acct b { font-weight: 600; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font: 500 17px var(--display); flex: none; }
#signOut { width: 100%; }
/* popup: fixed comfortable width so lines and buttons don't wrap */
.buspop .leaflet-popup-content { width: min(280px, calc(100vw - 72px)) !important; }
.bp-actions button { white-space: nowrap; }
.bp-next, .bp-mine { text-wrap: pretty; }
.buspop .leaflet-popup-content-wrapper { padding: 0 !important; }
.buspop .leaflet-popup-content { margin: 0 !important; padding: 18px 18px 18px; box-sizing: border-box; }
.bp-head { min-height: 32px; }
/* quick bar: every pill the same height; phones get slightly bigger pills */
:root { --chip-h: 44px; --chip-font: 15px; }
@media (min-width: 900px) { :root { --chip-h: 40px; --chip-font: 14px; } }
.quick { padding: 4px 12px 16px; margin: -4px -12px 0; gap: 8px; }
.quick-chips { gap: 8px; }
.status, .qchip { height: var(--chip-h); box-sizing: border-box; box-shadow: 0 1px 2px rgba(26,27,28,.08), 0 3px 10px rgba(26,27,28,.08); }
.status { padding: 0 14px 0 12px; font-size: calc(var(--chip-font) - 1px); gap: 8px; }
.status i { width: 9px; height: 9px; }
.qchip { padding: 0 16px 0 14px; font-size: var(--chip-font); gap: 8px; }
.qchip i { width: 11px; height: 11px; }
.qchip.on { padding-right: 8px; }
.qchip .x { width: 26px; height: 26px; margin-right: 0; }
.qchip .x svg { width: 13px; height: 13px; }
.qchip.add { width: var(--chip-h); padding: 0; justify-content: center; font-size: 22px; font-weight: 400; line-height: 1; }
.qchip.add.wide { width: auto; padding: 0 16px; font-size: var(--chip-font); }

/* web: quick pills share the top row with the 52px search bar and settings button, so match them */
@media (min-width: 900px) {
  :root { --chip-h: 52px; --chip-font: 15px; }
  .quick { top: calc(var(--safe-t) + 12px); padding: 4px 12px 16px; margin: -4px -12px 0; }
  .status, .qchip { box-shadow: var(--lift); }
  .qchip.on { padding-right: 12px; }
  .qchip .x { width: 30px; height: 30px; }
}
.qchip.add svg { width: 20px; height: 20px; stroke-width: 2; display: block; }
.qchip.add.wide { gap: 6px; }
.qchip.add.wide svg { width: 17px; height: 17px; }

.qchip .count { font: 500 calc(var(--chip-font) - 2px) var(--font); opacity: .85; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.35); }
@media (min-width: 900px) { .hero { padding-top: 22px; } }

/* trip planner */
.trip-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 6px 8px; margin-top: 12px; }
.trip-field { grid-column: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 1px solid var(--line); background: #fff; border-radius: var(--r-md); padding: 10px 14px; text-align: left; min-width: 0; }
.trip-field .t1 { max-width: 100%; }
.trip-field .muted { color: var(--text-3); font-weight: 500; }
.trip-swap { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; }
.plans { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.plan { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: var(--r-md); padding: 14px; text-align: left; width: 100%; }
.plan:first-child { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.plan-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-routes { display: flex; align-items: center; gap: 4px; }
.plan-routes .arr { width: 14px; height: 14px; color: var(--text-3); }
.plan-arrive { font-family: var(--display); font-weight: 500; font-size: 17px; }
.plan-steps { display: flex; flex-direction: column; gap: 3px; font-size: 14px; line-height: 1.45; }
.plan-steps .sub { color: var(--text-2); font-size: 13px; margin-bottom: 4px; }
.plan-steps b { font-weight: 600; }
.plan-foot { font-size: 12.5px; color: var(--text-2); }

.delay { font-weight: 600; }
.delay.ontime { color: #2e7d3a; }
.delay.late { color: var(--warn); }
.delay.early { color: #a15c00; }
