/* ── OC Transpo Live — bus.jjjp.ca ──────────────────────────────────────── */

/* Light theme (default) */
:root {
  --bg:        #eceef1;
  --bg-2:      #ffffff;
  --bg-3:      #f4f5f7;
  --bg-4:      #e6e8ec;
  --line:      #d3d7df;
  --text:      #1b1c21;
  --text-dim:  #565b66;
  --text-mute: #8a8f9b;
  --accent:    #2563eb;
  --accent-2:  #1d4ed8;
  --red:       #d62518;
  --green:     #1a9c43;
  --amber:     #b9760a;
  --shadow:    0 1px 2px rgba(20,22,30,.06), 0 6px 18px rgba(20,22,30,.07);
  --pill-fresh-bg:#e6f7ec; --pill-fresh-fg:#15803d; --pill-fresh-bd:#a9e6bf;
  --pill-stale-bg:#fdf3e1; --pill-stale-fg:#b45309; --pill-stale-bd:#f2d6a3;
  --pill-dead-bg: #fdeceb; --pill-dead-fg: #b91c1c; --pill-dead-bd: #f1c1bd;
  --eta-soon-bg:#fdf3e1; --eta-soon-bd:#f2d6a3;
  --fav-bg: rgba(185,118,10,.10);
  --row-h: 56px;          /* timeline stop row height — app.js reads this */
  --radius: 11px;
  font-size: 15px;
}

/* Dark theme */
html[data-theme="dark"] {
  --bg:        #0d0d0f;
  --bg-2:      #16161a;
  --bg-3:      #1f1f25;
  --bg-4:      #2a2a32;
  --line:      #32323c;
  --text:      #e9e9ee;
  --text-dim:  #9a9aa6;
  --text-mute: #6b6b78;
  --accent:    #3b82f6;
  --accent-2:  #60a5fa;
  --red:       #ef4444;
  --green:     #22c55e;
  --amber:     #f59e0b;
  --shadow:    0 2px 10px rgba(0,0,0,.55);
  --pill-fresh-bg:#0e2a18; --pill-fresh-fg:#bbf7d0; --pill-fresh-bd:#14532d;
  --pill-stale-bg:#2a1d07; --pill-stale-fg:#fde68a; --pill-stale-bd:#78350f;
  --pill-dead-bg: #2a0f0f; --pill-dead-fg: #fecaca; --pill-dead-bd: #7f1d1d;
  --eta-soon-bg:#2a1d07; --eta-soon-bd:#78350f;
  --fav-bg: rgba(245,158,11,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em;
     color: var(--text-dim); margin-bottom: .5rem; }
a { color: var(--accent-2); }

/* ── Live ripple animation ───────────────────────────────────────────────── */
@keyframes ripple {
  0%   { box-shadow: 0 0 0 0   rgba(26,156,67,.55); }
  70%  { box-shadow: 0 0 0 9px rgba(26,156,67,0); }
  100% { box-shadow: 0 0 0 0   rgba(26,156,67,0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

.live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green); flex: 0 0 auto;
}
html.live .live-dot,
html.live .pill.fresh .pill-dot { animation: ripple 2.1s ease-out infinite; }
@media (prefers-reduced-motion: reduce) {
  html.live .live-dot, html.live .pill.fresh .pill-dot { animation: none; }
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */
#topbar {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .9rem;
  background: var(--bg-2); border-bottom: 1px solid var(--line);
  flex: 0 0 auto; position: sticky; top: 0; z-index: 70;
}
.brand { display: flex; align-items: center; gap: .5rem; margin-right: auto;
         min-width: 0; }
.brand-mark { font-size: 1.35rem; }
.brand-text { font-size: 1.02rem; white-space: nowrap; }
.brand-text strong { color: var(--accent); font-weight: 700; }

.icon-btn {
  background: var(--bg-3); color: var(--text); border: 1px solid var(--line);
  width: 38px; height: 38px; border-radius: 9px; cursor: pointer;
  font-size: 1.1rem; line-height: 1; flex: 0 0 auto;
  transition: background .15s;
}
.icon-btn:hover { background: var(--bg-4); }
#refresh-btn.spinning { animation: spin .6s linear infinite; }
#sidebar-toggle { display: none; }

/* ── Freshness pill ──────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .32rem .6rem; border-radius: 999px;
  font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--bg-3); border: 1px solid var(--line);
}
.pill-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-mute); }
.pill.fresh { background: var(--pill-fresh-bg); color: var(--pill-fresh-fg);
              border-color: var(--pill-fresh-bd); }
.pill.fresh .pill-dot { background: var(--green); }
.pill.stale { background: var(--pill-stale-bg); color: var(--pill-stale-fg);
              border-color: var(--pill-stale-bd); }
.pill.stale .pill-dot { background: var(--amber); }
.pill.dead  { background: var(--pill-dead-bg); color: var(--pill-dead-fg);
              border-color: var(--pill-dead-bd); }
.pill.dead  .pill-dot { background: var(--red); }
.pill-muted { color: var(--text-dim); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
#layout { display: flex; flex: 1 1 auto; min-height: 0; }

#sidebar {
  width: 312px; flex: 0 0 312px;
  background: var(--bg-2); border-right: 1px solid var(--line);
  overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: .9rem;
}
#sidebar.collapsed { display: none; }

#content {
  flex: 1 1 auto; overflow-y: auto; padding: 1.1rem;
  display: flex; flex-direction: column; gap: 1.1rem;
}
/* More breathing room between each chosen line's timeline card. */
#timelines { display: flex; flex-direction: column; gap: 1.5rem; }
#timelines > .timeline-card { scroll-margin-top: 1rem; }

.panel { background: var(--bg-3); border: 1px solid var(--line);
         border-radius: var(--radius); padding: .85rem; }
.panel-quiet { background: transparent; border-style: dashed; }
.hint { font-size: .75rem; color: var(--text-mute); margin-bottom: .6rem;
        line-height: 1.45; }

#backdrop { display: none; }

/* ── Line search — bigger, harder to miss ────────────────────────────────── */
.line-search-wrap {
  display: flex; align-items: center; gap: .55rem;
  background: var(--bg-2);
  border: 2px solid var(--accent);
  border-radius: 11px;
  padding: .6rem .8rem;
  margin-bottom: .7rem;
  transition: box-shadow .15s, border-color .15s;
}
.line-search-wrap:focus-within {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(37,99,235,.20);
}
.line-search-icon { font-size: 1.05rem; line-height: 1; opacity: .85; }
.line-search {
  flex: 1 1 auto; min-width: 0;
  background: transparent; color: var(--text);
  border: none; outline: none;
  font: inherit; font-size: 1rem;
  padding: 0;
}
.line-search::placeholder { color: var(--text-mute); }

/* ── Line picker ─────────────────────────────────────────────────────────── */
.line-picker { display: flex; flex-direction: column; gap: .4rem; }
.line-opt {
  display: flex; align-items: center; gap: .55rem;
  padding: .5rem .55rem; border-radius: 9px; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line);
  transition: border-color .15s;
}
.line-opt:hover { border-color: var(--accent); }
.line-opt input { accent-color: var(--accent); width: 17px; height: 17px; }
.line-opt .ln-name { font-weight: 600; font-size: .9rem; }

.route-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 22px; padding: 0 .35rem;
  border-radius: 5px; font-weight: 700; font-size: .82rem;
  background: var(--accent); color: #fff; flex: 0 0 auto;
}
.route-badge.big { min-width: 38px; height: 28px; font-size: .95rem; }

/* ── Stop groups (Work / Home / …) ───────────────────────────────────────── */
.stop-groups {
  display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .55rem;
}
.group-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .55rem; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: .78rem; cursor: pointer; color: var(--text);
  transition: border-color .15s, background .15s;
}
.group-chip:hover { border-color: var(--accent); }
.group-chip.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.group-chip .grp-count {
  font-size: .68rem; opacity: .8;
  font-variant-numeric: tabular-nums;
}
.group-chip .grp-edit {
  background: none; border: none; color: inherit; opacity: .55;
  cursor: pointer; padding: 0 0 0 .15rem; font-size: .82rem; line-height: 1;
}
.group-chip .grp-edit:hover { opacity: 1; }
.group-add {
  background: var(--bg-2); color: var(--text-mute);
  border: 1px dashed var(--line); border-radius: 999px;
  padding: .3rem .55rem; cursor: pointer; font-size: .78rem;
}
.group-add:hover { border-color: var(--accent); color: var(--accent); }

/* ── Favourite stops ─────────────────────────────────────────────────────── */
.fav-stops { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .6rem; }
.fav-stop-row {
  display: flex; align-items: center; gap: .5rem; font-size: .82rem;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px; padding: .4rem .5rem;
}
.fav-live {
  position: relative;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-mute); flex: 0 0 auto;
  transition: background .2s;
}
.fav-live.on { background: var(--green); }
html.live .fav-live.on { animation: ripple 2.1s ease-out infinite; }
.fav-stop-row .stop-code, .dep-head .stop-code, .nearby-item .stop-code {
  font-variant-numeric: tabular-nums; color: var(--text-mute);
  font-size: .72rem; border: 1px solid var(--line); border-radius: 4px;
  padding: 0 .25rem;
}
.fav-stop-row .nm { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis;
                    white-space: nowrap; }
.mini-x { background: none; border: none; color: var(--text-mute);
          cursor: pointer; font-size: 1.05rem; line-height: 1; padding: .2rem; }
.mini-x:hover { color: var(--red); }
.empty-mini { font-size: .76rem; color: var(--text-mute); font-style: italic; }

.wide-btn {
  width: 100%; padding: .55rem; cursor: pointer;
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; font-size: .82rem;
}
.wide-btn:hover { border-color: var(--accent); }

.nearby-list { display: flex; flex-direction: column; gap: .3rem; margin-top: .5rem; }
.nearby-item {
  display: flex; align-items: center; gap: .5rem; font-size: .8rem;
  padding: .4rem; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 8px;
}
.nearby-item .dist { color: var(--text-mute); font-size: .72rem; }
.nearby-item .add { margin-left: auto; cursor: pointer; background: none;
  border: 1px solid var(--line); border-radius: 6px; color: var(--accent-2);
  padding: .2rem .45rem; font-size: .72rem; }
.nearby-item .add:hover { background: var(--bg-4); }

/* ── Toggles / fields ────────────────────────────────────────────────────── */
.row-toggle { display: flex; align-items: center; gap: .5rem; cursor: pointer;
              font-size: .86rem; padding: .3rem 0; }
.row-toggle input { accent-color: var(--accent); width: 17px; height: 17px; }
.row-field { display: flex; align-items: center; justify-content: space-between;
             font-size: .86rem; padding: .35rem 0; }
.row-field select { background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 7px; padding: .3rem .45rem; }

#auth-area { font-size: .82rem; line-height: 1.5; }
.auth-user { display: flex; align-items: center; gap: .5rem; }
.auth-user img { width: 26px; height: 26px; border-radius: 50%; }
.link-btn { background: none; border: none; color: var(--accent-2);
            cursor: pointer; font-size: .8rem; padding: 0; text-decoration: underline; }

.credits { font-size: .68rem; color: var(--text-mute); line-height: 1.55;
           margin-top: auto; padding-top: .4rem; }

/* ── Departures board ────────────────────────────────────────────────────── */
#departures-board { display: flex; flex-wrap: wrap; gap: 1rem; }
#departures-board:empty { display: none; }
.dep-card {
  flex: 1 1 280px; background: var(--bg-2); box-shadow: var(--shadow);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .85rem 1rem; min-width: 250px;
}
.dep-card.urgent { border-color: var(--pill-dead-bd); }
.dep-head { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .55rem; }
.dep-head .stop-name { font-size: 1rem; font-weight: 650; }
.dep-rows { display: flex; flex-direction: column; gap: .45rem; }
.dep-row { display: flex; align-items: center; gap: .55rem; }
.dep-row .headsign { font-size: .82rem; color: var(--text-dim); flex: 1 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-eta { font-variant-numeric: tabular-nums; font-weight: 700;
  font-size: 1.1rem; white-space: nowrap; }
.dep-eta small { font-size: .68rem; font-weight: 400; color: var(--text-mute); }
.dep-eta.soon  { color: var(--amber); }
.dep-eta.now   { color: var(--red); }
.dep-eta.later { color: var(--green); }
.dep-none { font-size: .8rem; color: var(--text-mute); font-style: italic; }

/* ── Timeline card ───────────────────────────────────────────────────────── */
.timeline-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.timeline-head {
  display: flex; align-items: center; gap: .55rem;
  padding: .6rem .8rem; background: var(--bg-3);
  border-bottom: 1px solid var(--line); cursor: pointer;
  user-select: none;
}
.timeline-head .tl-title { font-weight: 650; }
.timeline-head .tl-sub { font-size: .76rem; color: var(--text-mute);
  margin-left: auto; white-space: nowrap; }
.tl-chevron { font-size: .85rem; color: var(--text-mute);
  transition: transform .2s; flex: 0 0 auto; }
.timeline-card.expanded .tl-chevron { transform: rotate(90deg); }

/* ── Reliability strip ───────────────────────────────────────────────────── */
.reliability {
  display: flex; align-items: center; gap: .45rem;
  padding: .4rem .8rem; font-size: .76rem; color: var(--text-dim);
  background: var(--bg-2); border-bottom: 1px solid var(--line);
  cursor: help;
}
.rel-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.rel-dot.good { background: var(--green); }
.rel-dot.ok   { background: var(--amber); }
.rel-dot.bad  { background: var(--red); }
.rel-text { flex: 1 1 auto; }
.rel-miss { color: var(--red); font-weight: 600; }
.rel-warn { color: var(--amber); margin-left: auto; }

/* ── Compact body — bus strips ───────────────────────────────────────────── */
.compact-body { display: flex; flex-direction: column; }
.bus-strip {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .8rem; border-bottom: 1px solid var(--line);
  font-size: .85rem;
}
.bus-strip:last-child { border-bottom: none; }
.strip-stops { display: flex; align-items: center; gap: .35rem;
  flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
.strip-stops .from { color: var(--text-mute); }
.strip-stops .to   { font-weight: 650; }
.strip-stops .term { color: var(--text-dim); }
.strip-arrow { color: var(--accent); font-weight: 700; }
.strip-more {
  letter-spacing: 1px; color: var(--text-mute);
  border-bottom: 2px dotted var(--text-mute); line-height: .6;
  padding: 0 .15rem;
}
.strip-eta {
  font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap;
  color: var(--text); margin-left: auto; padding-left: .4rem;
}
.strip-eta.soon { color: var(--amber); }
.strip-eta.now  { color: var(--red); }
.strip-veh { font-size: .72rem; color: var(--text-mute); }

/* ── Expanded body — rail + stops ────────────────────────────────────────── */
.timeline-body { position: relative; padding: 0; }
.rail { position: absolute; left: 26px; top: 0; bottom: 0; width: 3px;
        background: var(--bg-4); }
.stop-row {
  position: relative; height: var(--row-h);
  display: flex; align-items: center; gap: .6rem;
  padding-left: 48px; padding-right: .8rem;
}
.stop-node {
  position: absolute; left: 21px; width: 13px; height: 13px;
  border-radius: 50%; background: var(--bg-2);
  border: 3px solid var(--text-mute);
}
.stop-row.is-fav { background: var(--fav-bg); }
.stop-row.is-fav .stop-node { border-color: var(--amber);
  box-shadow: 0 0 0 4px rgba(245,158,11,.18); }
.stop-row.terminus .stop-node { border-color: var(--accent);
  width: 15px; height: 15px; left: 20px; }

.stop-main { flex: 1 1 auto; min-width: 0; }
.stop-name { font-size: .89rem; overflow: hidden; text-overflow: ellipsis;
             white-space: nowrap; }
.stop-meta { font-size: .72rem; color: var(--text-mute);
             display: flex; gap: .5rem; align-items: center; }
.stop-code-tag { border: 1px solid var(--line); border-radius: 4px;
                 padding: 0 .25rem; font-variant-numeric: tabular-nums; }

.stop-etas { display: flex; gap: .35rem; align-items: center;
             flex-wrap: wrap; justify-content: flex-end; }
.eta-chip { font-variant-numeric: tabular-nums; font-size: .78rem;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 6px; padding: .15rem .4rem; white-space: nowrap; }
.eta-chip.soon { color: var(--amber); background: var(--eta-soon-bg);
                 border-color: var(--eta-soon-bd); }
.eta-chip.now  { color: #fff; background: var(--red); border-color: var(--red); }

.fav-toggle { background: none; border: none; cursor: pointer;
  font-size: 1.05rem; color: var(--text-mute); flex: 0 0 auto; padding: .25rem; }
.fav-toggle.on { color: var(--amber); }

/* bus markers on the rail */
.bus-marker { position: absolute; left: 16px; z-index: 4;
  display: flex; align-items: center; gap: .35rem; transform: translateY(-50%); }
.bus-dot {
  position: relative; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; border: 2px solid var(--bg-2);
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
html.live .bus-dot::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  animation: ripple 2.1s ease-out infinite;
}
.bus-info {
  background: var(--bg-4); border: 1px solid var(--line);
  border-radius: 6px; padding: .12rem .4rem; font-size: .72rem;
  white-space: nowrap; box-shadow: var(--shadow);
}
.bus-info .veh { color: var(--text-mute); }
.bus-marker.faded { opacity: .42; }
.bus-marker.faded .bus-dot::after { animation: none; }
.occ-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%;
           margin-left: .25rem; }
.occ-1 { background: var(--green); }
.occ-2 { background: var(--amber); }
.occ-3 { background: var(--red); }

.tl-empty { padding: .9rem .8rem; color: var(--text-mute); font-size: .84rem; }

/* ── Map ─────────────────────────────────────────────────────────────────── */
#map-wrap { background: var(--bg-2); border: 1px solid var(--line);
            border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
#map { height: 360px; width: 100%; background: var(--bg-3); }
.bus-pin {
  background: var(--accent); color: #fff; font-weight: 700;
  border: 2px solid #fff; border-radius: 50%;
  width: 26px; height: 26px; display: flex;
  align-items: center; justify-content: center; font-size: .72rem;
  box-shadow: 0 1px 5px rgba(0,0,0,.55);
}
.leaflet-popup-content { font-size: .8rem; }

/* Nearby-stops mini map (sidebar) */
.nearby-controls { margin-top: .5rem; }
.nearby-map {
  margin-top: .5rem; height: 220px; width: 100%;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg-3); overflow: hidden;
}
.nearby-pin {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.55);
}
.nearby-pin.me {
  background: var(--red); width: 16px; height: 16px;
}

/* ── Per-saved-stop "mini" timeline strips (new compact view) ────────────── */
.mini-strip {
  display: flex; flex-direction: column; gap: .35rem;
  padding: .65rem .8rem;
  border-bottom: 1px solid var(--line);
}
.mini-strip:last-child { border-bottom: none; }
.mini-strip.is-fav { background: var(--fav-bg); }
.mini-head {
  display: flex; align-items: center; gap: .5rem;
  font-size: .85rem;
}
.mini-head .mini-name {
  font-weight: 650; flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mini-head .stop-code-tag {
  border: 1px solid var(--line); border-radius: 4px;
  padding: 0 .25rem; font-size: .7rem;
  font-variant-numeric: tabular-nums; color: var(--text-mute);
}
.mini-eta {
  font-variant-numeric: tabular-nums; font-weight: 700;
  font-size: 1rem; white-space: nowrap;
}
.mini-eta.soon  { color: var(--amber); }
.mini-eta.now   { color: var(--red); }
.mini-eta.later { color: var(--green); }
.mini-eta.none  { color: var(--text-mute); font-weight: 500; font-size: .82rem; }

/* The chain itself. A thin connector line runs at the dot's vertical centre
   so the dots read as nodes on a route, not just floating circles. */
.mini-chain {
  position: relative;
  display: flex; align-items: center;
  padding: 20px 6px 6px;            /* top room for bus icon over a dot */
}
.mini-chain::before {
  content: ""; position: absolute;
  left: 14px; right: 14px;
  top: 20px;                        /* matches padding-top above */
  transform: translateY(5px);       /* offset by half the dot height */
  height: 2px; background: var(--bg-4);
  z-index: 0;
}
.chain-dot {
  position: relative; z-index: 1;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--text-mute);
  margin: 0 9px; flex: 0 0 auto;
}
.chain-dot.bus-here {
  background: var(--accent); border-color: var(--accent);
}
.chain-dot.bus-here::after {
  content: "🚌"; position: absolute;
  left: 50%; bottom: calc(100% + 2px);
  transform: translateX(-50%);
  font-size: 13px; line-height: 1;
  white-space: nowrap;
}
html.live .chain-dot.bus-here::before {
  content: ""; position: absolute; inset: -3px;
  border-radius: 50%;
  animation: ripple 2.1s ease-out infinite;
}
.chain-dot.saved {
  background: var(--amber); border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(245,158,11,.22);
}
/* Skip cluster: three tiny dots packed close, implying hidden stops. */
.chain-skip {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 2px;
  margin: 0 6px;
  padding: 2px 0;
}
.chain-skip .skip-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--text-mute); opacity: .6;
}
.mini-empty { color: var(--text-mute); font-size: .78rem;
  font-style: italic; padding: 0 .5rem .35rem; }

/* ── Misc ────────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.empty-state { padding: 2rem; text-align: center; color: var(--text-mute);
               border: 1px dashed var(--line); border-radius: var(--radius); }
.toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
  background: var(--bg-4); border: 1px solid var(--line);
  padding: .6rem 1rem; border-radius: 9px; font-size: .85rem;
  box-shadow: var(--shadow); z-index: 1000; max-width: 90vw;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  :root { font-size: 14.5px; }
  #sidebar-toggle { display: block; }
  #topbar { padding: .5rem .7rem; }
  .brand-text { font-size: .95rem; }

  #sidebar {
    position: fixed; top: 51px; bottom: 0; left: 0;
    width: min(86vw, 330px); z-index: 80;
    transform: translateX(0); transition: transform .25s ease;
    box-shadow: 6px 0 26px rgba(0,0,0,.4);
  }
  #sidebar.collapsed { display: flex; transform: translateX(-105%); }

  #backdrop { display: block; position: fixed; inset: 51px 0 0 0;
              background: rgba(0,0,0,.5); z-index: 75; }
  #backdrop.hidden { display: none; }

  #content { padding: .7rem; gap: .8rem; }
  #departures-board { gap: .7rem; }
  .dep-card { flex-basis: 100%; min-width: 0; }
  #map { height: 300px; }
  .timeline-head { padding: .7rem .8rem; }     /* bigger touch target */
  .bus-strip { padding: .65rem .7rem; }
  .stop-row { padding-right: .5rem; }
  .fav-toggle, .mini-x { padding: .4rem; }     /* easier to tap */
}
