/* Deliberately plain — serious, minimal, scientific, matching the visionOS
   app's interface direction. Nothing decorative competes with the coast. */

:root {
  --bg: #0b1622;
  --card: rgba(11, 22, 34, 0.88);
  --line: rgba(255, 255, 255, 0.10);
  --text: #e2f9ff;
  --muted: #8fb4c6;
  --dim: #5e7c8c;
  --cyan: #35c7ff;
  --amber: #ffb020;
  --green: #4ade80;
  --danger: #ff5b6e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#map { position: absolute; inset: 0; }

.panel {
  position: absolute;
  top: 14px;
  width: 320px;
  max-height: calc(100% - 28px);
  overflow-y: auto;
  padding: 18px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#panel { left: 14px; }
.queue { right: 14px; width: 340px; }
.routes { right: 14px; width: 340px; }

#routeSearch {
  width: 100%; margin: 4px 0 12px; padding: 11px 13px;
  border-radius: 11px; font: inherit; font-size: 15px;
  color: var(--text); background: rgba(255,255,255,0.06);
  border: 1px solid var(--line); -webkit-appearance: none;
}
#routeSearch:focus { outline: none; border-color: rgba(53,199,255,0.55); }

.route {
  display: block; width: 100%; text-align: left;
  padding: 11px 12px; margin-bottom: 8px;
  border-radius: 11px; cursor: pointer;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--text); font: inherit;
}
.route:hover, .route:active { background: rgba(53,199,255,0.12); border-color: rgba(53,199,255,0.35); }
.route.current { border-color: rgba(53,199,255,0.7); background: rgba(53,199,255,0.10); }
.route .rname { display: block; font-weight: 700; font-size: 14px; }
.route .rmeta { display: block; font-size: 11.5px; color: var(--dim); margin-top: 3px; }
.route .rconf { font-weight: 700; }

header { margin-bottom: 14px; }
h1 {
  font-size: 19px; margin: 2px 0 2px; font-weight: 700;
  /* Corridor names run long — "Long Beach (Belmont) → Newport Beach (Newport
     Pier)" overflowed the sheet and clipped off the right edge. */
  overflow-wrap: anywhere; line-height: 1.25;
}

.eyebrow {
  margin: 0; font-size: 10.5px; font-weight: 800;
  letter-spacing: 1.2px; color: var(--dim);
}
.sub  { margin: 0; font-size: 12px; color: var(--muted); }
.label {
  margin: 0 0 8px; font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.9px; color: var(--dim);
}

section {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.row {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 0; font-size: 13.5px; cursor: pointer;
}
.row input { accent-color: var(--cyan); width: 15px; height: 15px; }
.row em { font-style: normal; color: var(--amber); font-weight: 700; font-size: 11.5px; }

.strong { margin: 2px 0; font-size: 14px; font-weight: 700; }
.dim    { margin: 2px 0; font-size: 11.5px; color: var(--dim); }
.mono   { margin: 6px 0 2px; font-size: 11.5px; color: var(--muted);
          font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.note   { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); }
.warn   { margin: 6px 0 0; font-size: 11.5px; color: var(--amber); }

.tag {
  display: inline-block; padding: 1px 6px; margin-right: 5px;
  border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: 0.5px;
}
.tag-warn { background: rgba(255, 176, 32, 0.16); color: var(--amber); }
.tag-ok   { background: rgba(53, 199, 255, 0.16); color: var(--cyan); }
.tag-live { background: rgba(74, 222, 128, 0.16); color: var(--green); }

input[type="range"] { width: 100%; accent-color: var(--cyan); margin: 4px 0 2px; }

footer { padding-top: 12px; border-top: 1px solid var(--line); }

/* Places list — the reliable way to reach a pin. Full-width rows, thumb-sized. */
.place {
  display: block; width: 100%; text-align: left;
  padding: 11px 12px; margin-bottom: 8px;
  border-radius: 11px; cursor: pointer;
  background: rgba(53,199,255,0.06);
  border: 1px solid rgba(53,199,255,0.22);
  color: var(--text); font: inherit;
}
.place:hover, .place:active { background: rgba(53,199,255,0.13); }
.place .pname { display: block; font-weight: 700; font-size: 14px; }
.place .pmeta { display: block; font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.place .pwind { display: block; font-size: 11.5px; color: var(--cyan); margin-top: 3px; }

/* Report queue */
.report {
  padding: 11px; margin-bottom: 9px;
  border-radius: 11px;
  border: 1px dashed rgba(255, 176, 32, 0.55);
  background: rgba(255, 176, 32, 0.05);
  cursor: pointer;
}
.report:hover { background: rgba(255, 176, 32, 0.10); }
.report .t { font-weight: 700; font-size: 13px; }
.report .m { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.empty { font-size: 12.5px; color: var(--muted); }

/* A rider pin is drawn hollow and dashed on purpose. Everywhere else a solid
   marker means a claim backed by a graded source; an unreviewed report has not
   earned that, and borrowing the styling would launder it into evidence. */
.report-pin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px dashed var(--amber);
  background: rgba(11, 22, 34, 0.75);
  color: var(--amber);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; cursor: pointer;
}

.detail {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  width: min(560px, calc(100% - 40px));
  max-height: 46%; overflow-y: auto;
  padding: 18px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.detail h2 { margin: 6px 0 10px; font-size: 17px; }
.detail dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 0; }
.detail dt { font-size: 10.5px; font-weight: 800; letter-spacing: 0.6px; color: var(--dim); align-self: center; }
.detail dd { margin: 0; font-size: 13px; }
.detail a { color: var(--cyan); }
.resume {
  display: block; width: 100%; margin-top: 14px;
  padding: 13px 18px; border-radius: 12px; border: 0; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 800;
  color: #04121c; background: var(--cyan);
}
.resume:active { filter: brightness(0.92); }

.close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: 0; color: var(--muted);
  font-size: 20px; cursor: pointer; line-height: 1;
}

/* Mobile chrome — hidden on desktop, where the panels are columns. */
#topbar, .fly { display: none; }

.grabber { display: none; }

.seg {
  display: flex; gap: 6px; margin: 8px 0 2px;
}
.seg button {
  flex: 1; padding: 7px 6px; border-radius: 9px; cursor: pointer;
  font-size: 11.5px; font-weight: 700;
  color: var(--muted); background: var(--card);
  border: 1px solid var(--line);
}
.seg button.on { color: var(--cyan); border-color: rgba(53,199,255,0.5); background: rgba(53,199,255,0.10); }

.fly {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 22px; z-index: 20;
  padding: 12px 20px; border-radius: 999px; cursor: pointer;
  font-size: 14px; font-weight: 800; letter-spacing: 0.2px;
  color: #04121c; background: var(--cyan); border: 0;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
}
.fly.flying { background: var(--amber); }

@media (min-width: 901px) {
  .fly { display: block; }
}

/* ── Phone ─────────────────────────────────────────────────────────────────
   Selectors here are ID-qualified on purpose. The desktop rules use #panel
   and #queue, so a bare `.panel` inside this query loses on specificity and
   the sheets kept their desktop offsets — which is why they read as stuck at
   the edge of the screen instead of sliding up. */
@media (max-width: 900px) {
  #map { position: fixed; inset: 0; height: 100%; }
  html, body { overflow: hidden; overscroll-behavior: none; }

  #topbar {
    display: flex; gap: 8px; z-index: 60;
    position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 12px;
  }
  .chip {
    padding: 10px 16px; border-radius: 999px; cursor: pointer;
    font-size: 13.5px; font-weight: 700;
    color: var(--text); background: var(--card);
    border: 1px solid var(--line);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .chip[aria-expanded="true"] { color: var(--cyan); border-color: rgba(53,199,255,0.55); }

  .fly {
    display: block; position: fixed; z-index: 55;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  }

  /* Both sheets, ID-qualified so these win over the desktop column rules. */
  #panel.panel, #queue.panel, #routes.panel {
    position: fixed; left: 0; right: auto; top: auto; bottom: 0;
    width: 100%; max-height: 68vh; overflow-y: auto;
    border-radius: 20px 20px 0 0;
    padding: 6px 18px calc(env(safe-area-inset-bottom, 0px) + 22px);
    transform: translateY(103%);
    transition: transform 0.28s ease;
    z-index: 70;
  }
  #panel.panel.open, #queue.panel.open, #routes.panel.open { transform: translateY(0); }

  .grabber {
    display: block; width: 40px; height: 4px; margin: 6px auto 12px;
    border-radius: 999px; background: rgba(255,255,255,0.25);
  }

  /* Tapping a pin opened this at the bottom edge, half off-screen and under
     the fly button. It is a sheet like the others now, and sits above them. */
  #detail.detail {
    position: fixed; left: 0; right: auto; top: auto; bottom: 0;
    transform: none; width: 100%;
    max-height: 74vh; overflow-y: auto;
    border-radius: 20px 20px 0 0;
    padding: 18px 18px calc(env(safe-area-inset-bottom, 0px) + 24px);
    z-index: 80;
  }
  #detail.detail dl { grid-template-columns: 1fr; gap: 2px 0; }
  #detail.detail dt { margin-top: 10px; }
  .resume {
  display: block; width: 100%; margin-top: 14px;
  padding: 13px 18px; border-radius: 12px; border: 0; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 800;
  color: #04121c; background: var(--cyan);
}
.resume:active { filter: brightness(0.92); }

.close { font-size: 26px; top: 14px; right: 16px; padding: 4px 8px; }

  /* Touch targets sized for a thumb, not a cursor. */
  h1 { font-size: 17px; }
  .place { padding: 14px 13px; }
  .place .pname { font-size: 15.5px; }
  .row { padding: 10px 0; font-size: 15px; }
  .row input { width: 21px; height: 21px; }
  input[type="range"] { height: 30px; }
  .seg button { padding: 10px 8px; font-size: 12.5px; }
}
