:root {
  --bg: #101418; --panel: rgba(16, 20, 24, .94); --fg: #f2f4f5; --muted: #9aa4ad; --line: rgba(255,255,255,.09);
  --accent: #ffcc33; --live: #3ddc84;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); overflow: hidden; }
#map { position: fixed; inset: 0; }

#brand {
  position: fixed; top: calc(env(safe-area-inset-top) + 10px); left: 12px; z-index: 5;
  background: var(--panel); padding: 6px 12px; border-radius: 20px; font-weight: 700; letter-spacing: .3px;
  font-size: 15px; box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
#brand b { color: var(--accent); }
.fab {
  position: fixed; right: 12px; z-index: 5; width: 44px; height: 44px; border-radius: 22px; border: 0;
  background: var(--panel); color: var(--fg); font-size: 22px; box-shadow: 0 2px 10px rgba(0,0,0,.35); cursor: pointer;
}
#locate { top: calc(env(safe-area-inset-top) + 10px); }
#pick { top: calc(env(safe-area-inset-top) + 62px); }
#pick.on { background: var(--accent); color: #111; }
#toast {
  position: fixed; top: calc(env(safe-area-inset-top) + 58px); left: 12px; right: 68px; z-index: 6;
  background: var(--panel); padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.35;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}

#sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; max-height: 46vh; display: flex; flex-direction: column;
  background: var(--panel); border-radius: 18px 18px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,.4);
  padding-bottom: env(safe-area-inset-bottom); transition: max-height .25s;
}
#sheet.small { max-height: 132px; }
@media (min-width: 900px) {
  #sheet { left: 16px; right: auto; bottom: 16px; top: 70px; width: 380px; max-height: none; border-radius: 18px; }
  #sheet.small { max-height: none; }
  .grip { display: none; }
}
.grip { width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); margin: 8px auto 2px; cursor: pointer; }
#sheet header { display: flex; align-items: flex-start; justify-content: space-between; padding: 6px 16px 4px; gap: 10px; }
#sheet h1 { font-size: 19px; margin: 0; line-height: 1.2; }
#stopMeta { color: var(--muted); font-size: 13px; margin-top: 2px; }
#clock { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; padding-top: 3px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 6px 16px 8px; scrollbar-width: none; flex-shrink: 0; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--fg);
  border-radius: 16px; padding: 5px 10px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.chip.on { border-color: var(--accent); background: rgba(255,204,51,.12); }
.chip small { color: var(--muted); margin-left: 4px; }

#deps { list-style: none; margin: 0; padding: 0 8px 10px; overflow-y: auto; }
#deps li {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: 9px 8px; border-top: 1px solid var(--line); cursor: default;
}
#deps li.veh { cursor: pointer; }
#deps li.sel { background: rgba(255,204,51,.08); border-radius: 10px; }
#deps li.cancel .dest, #deps li.cancel .eta { text-decoration: line-through; opacity: .55; }
#deps .dest { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#deps .sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
#deps .eta { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 17px; white-space: nowrap; }
#deps .eta small { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 2px; }
#deps .eta.now { color: var(--accent); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-right: 5px; vertical-align: 1px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
#deps .empty { display: block; color: var(--muted); text-align: center; padding: 18px; border: 0; font-size: 14px; }

.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 26px; padding: 0 7px;
  border-radius: 6px; font-weight: 800; font-size: 14px; letter-spacing: -.2px;
}
.badge.Tram, .badge.Métro { border-radius: 13px; }

/* Véhicules sur la carte */
.veh-mk { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.veh-mk .badge { height: 24px; min-width: 30px; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.5); border: 2px solid #fff; }
.veh-mk .arrow { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 9px solid #fff; margin-bottom: 1px; transition: transform .3s; }
.veh-mk.ghost .badge { opacity: .75; border-style: dashed; }
.veh-mk.sel .badge { transform: scale(1.25); }
.me { width: 18px; height: 18px; border-radius: 50%; background: #2d8cff; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(45,140,255,.25); }
.stop-mk { width: 16px; height: 16px; border-radius: 4px; background: var(--accent); border: 3px solid #111; box-shadow: 0 0 0 3px rgba(255,204,51,.35); }
.maplibregl-popup-content { background: var(--panel); color: var(--fg); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.maplibregl-popup-tip { border-top-color: var(--panel) !important; border-bottom-color: var(--panel) !important; }
.maplibregl-ctrl-attrib { font-size: 10px; }
