/* Free Park Vancouver — styled to feel like a native iPhone app (iOS system colours, SF font,
   translucent materials, bottom sheet). Dark mode follows the phone's appearance setting. */

:root {
  --bg: #ffffff;
  --sheet: rgba(255, 255, 255, 0.86);
  --sheet-solid: #ffffff;
  --grouped: #f2f2f7;
  --fill: rgba(118, 118, 128, 0.12);
  --fill-strong: rgba(118, 118, 128, 0.2);
  --text: #000000;
  --muted: rgba(60, 60, 67, 0.6);
  --faint: rgba(60, 60, 67, 0.3);
  --sep: rgba(60, 60, 67, 0.18);
  --blue: #007aff;
  --green: #34c759;
  --brand: #1e9e5a;
  --orange: #ff9500;
  --amber: #e8a317;
  --red: #ff3b30;
  --gray: #8e8e93;
  --paid: #1a73e8;
  --warn-bg: rgba(255, 149, 0, 0.12);
  --hot-bg: rgba(255, 59, 48, 0.1);
  --good: #248a3d;
  --warn: #c93400;
  --bad: #d70015;
  --shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 8px 30px rgba(0, 0, 0, 0.16);
  --btn-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 2px 10px rgba(0, 0, 0, 0.16);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  --sab: env(safe-area-inset-bottom);
  --sat: env(safe-area-inset-top);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --sheet: rgba(28, 28, 30, 0.86);
    --sheet-solid: #1c1c1e;
    --grouped: #000000;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-strong: rgba(118, 118, 128, 0.36);
    --text: #ffffff;
    --muted: rgba(235, 235, 245, 0.6);
    --faint: rgba(235, 235, 245, 0.3);
    --sep: rgba(84, 84, 88, 0.6);
    --blue: #0a84ff;
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --good: #30d158;
    --warn: #ff9f0a;
    --bad: #ff6961;
    --warn-bg: rgba(255, 159, 10, 0.16);
    --hot-bg: rgba(255, 69, 58, 0.16);
    --shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.08), 0 8px 30px rgba(0, 0, 0, 0.6);
    --btn-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 2px 10px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --sheet: rgba(28, 28, 30, 0.86); --sheet-solid: #1c1c1e; --grouped: #000000;
  --fill: rgba(118, 118, 128, 0.24); --fill-strong: rgba(118, 118, 128, 0.36); --text: #ffffff;
  --muted: rgba(235, 235, 245, 0.6); --faint: rgba(235, 235, 245, 0.3); --sep: rgba(84, 84, 88, 0.6);
  --blue: #0a84ff; --green: #30d158; --orange: #ff9f0a; --red: #ff453a; --good: #30d158; --warn: #ff9f0a; --bad: #ff6961;
  --warn-bg: rgba(255, 159, 10, 0.16); --hot-bg: rgba(255, 69, 58, 0.16);
  --shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.08), 0 8px 30px rgba(0, 0, 0, 0.6);
  --btn-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 2px 10px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* ---------- App shell: no page scrolling, bouncing, zooming or text selection ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  position: fixed;
  inset: 0;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.35 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
button, a, input, label, select, textarea { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { text-decoration: none; }
[hidden] { display: none !important; }
h2, h3, p { margin: 0; }

#map { position: absolute; inset: 0; }
.maplibregl-ctrl-top-left { top: var(--sat); }
.maplibregl-ctrl-attrib.maplibregl-compact { margin: 6px 0 0 8px; }

/* ---------- Floating map buttons ---------- */
.map-buttons {
  position: absolute;
  top: calc(var(--sat) + 10px);
  right: 10px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: var(--sheet);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--btn-shadow);
  overflow: hidden;
}
.map-buttons { transition: opacity 0.2s; }
body.sheet-full .map-buttons { opacity: 0; pointer-events: none; }
.map-buttons button { width: 46px; height: 46px; display: grid; place-items: center; color: var(--blue); }
.map-buttons button:active { background: var(--fill); }
.map-buttons .sep { height: 0.5px; background: var(--sep); margin: 0 8px; }
#locateBtn .i-on { display: none; }
#locateBtn[data-state="follow"] .i-on { display: block; }
#locateBtn[data-state="follow"] .i-off { display: none; }
#locateBtn[data-state="searching"] { animation: pulse-opacity 1s ease-in-out infinite; }
@keyframes pulse-opacity { 50% { opacity: 0.35; } }

/* Compass (appears when the map is rotated or tilted) */
.compass {
  position: absolute;
  top: calc(var(--sat) + 116px);
  right: 13px;
  z-index: 4;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--sheet);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--btn-shadow);
  color: var(--text);
  display: grid; place-items: center;
  animation: pop-in 0.2s ease-out;
}
.compass svg { transition: transform 0.05s linear; }
body.sheet-full .compass { opacity: 0; pointer-events: none; }
@keyframes pop-in { from { transform: scale(0.6); opacity: 0; } }

/* ---------- Your location: blue dot ---------- */
.me { width: 22px; height: 22px; position: relative; pointer-events: none; }
.me-dot {
  position: absolute; inset: 0; border-radius: 50%;
  background: #0a84ff; border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.me-pulse {
  position: absolute; inset: -12px; border-radius: 50%;
  background: rgba(10, 132, 255, 0.28);
  animation: me-pulse 2s ease-out infinite;
}
@keyframes me-pulse { 0% { transform: scale(0.4); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.me-heading {
  position: absolute; left: 50%; top: 50%;
  width: 70px; height: 70px; margin: -35px 0 0 -35px;
  background: conic-gradient(from -30deg, rgba(10, 132, 255, 0.45), rgba(10, 132, 255, 0) 60deg, transparent 0);
  -webkit-mask: radial-gradient(circle, #000 0 34px, transparent 35px);
  mask: radial-gradient(circle, #000 0 34px, transparent 35px);
  border-radius: 50%;
  display: none;
}
.me.has-heading .me-heading { display: block; }

/* Destination pin */
.dest-pin {
  width: 26px; height: 26px;
  border-radius: 50% 50% 50% 0;
  background: var(--red);
  transform: rotate(-45deg) translate(5px, -5px);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* ---------- Placing a new spot ---------- */
.crosshair {
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -100%);
  pointer-events: none;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.15s;
}
.crosshair svg { display: block; }
.crosshair-dot {
  position: absolute; left: 50%; bottom: -3px; width: 6px; height: 6px; margin-left: -3px;
  border-radius: 50%; background: rgba(0, 0, 0, 0.45);
}
body.placing .map-buttons #layersBtn, body.placing .map-buttons .sep { display: none; }

/* ---------- Bottom sheet ---------- */
.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  /* Solid (not blurred): blurring the moving map behind a big panel is the most expensive
     thing an iPhone browser can do, and made panning stutter */
  background: var(--sheet-solid);
  border-radius: 14px 14px 0 0;
  box-shadow: var(--shadow);
  will-change: transform;
  touch-action: none;
}
.sheet.animating { transition: transform 0.38s cubic-bezier(0.2, 0.9, 0.25, 1); }
.sheet-grabber { flex: none; height: 20px; display: grid; place-items: center; cursor: grab; }
.sheet-grabber span { width: 36px; height: 5px; border-radius: 3px; background: var(--faint); }
.sheet-header { flex: none; padding: 0 16px 10px; }
.sheet-body {
  flex: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 2px 16px calc(16px + var(--sab));
}
.sheet-footer {
  flex: none;
  padding: 10px 16px calc(10px + var(--sab));
  border-top: 0.5px solid var(--sep);
  display: grid;
  gap: 6px;
}

/* Wide screens (iPad landscape, desktop): floating side panel */
@media (min-width: 720px) {
  .sheet {
    top: 12px; left: 12px; bottom: auto; right: auto;
    width: 380px;
    max-height: calc(100% - 24px);
    border-radius: 14px;
    transform: none !important;
  }
  .sheet-grabber { display: none; }
  .sheet-header { padding-top: 14px; }
  .sheet-body { flex: 1 1 auto; height: auto !important; max-height: none; }
  .maplibregl-ctrl-top-left { left: 400px; }
}

/* ---------- Headers ---------- */
.home-head { display: flex; gap: 10px; align-items: center; }
.search-pill {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px;
  border-radius: 11px;
  background: var(--fill);
  color: var(--muted);
  text-align: left;
}
.search-pill svg { flex: none; }
.round-btn {
  flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--fill); color: var(--muted);
  font-size: 22px; line-height: 1; font-weight: 500;
}
.round-btn.green { width: 40px; height: 40px; background: var(--brand); color: #fff; }
.round-btn:active { filter: brightness(0.9); }
.back-btn { font-size: 26px; padding-bottom: 3px; }

.title-head { display: flex; gap: 10px; align-items: flex-start; }
.title-text { flex: 1; min-width: 0; }
.title-head h2 { font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; margin-top: 2px; }
.title-head .subtitle { color: var(--muted); font-size: 15px; margin-top: 2px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }

.nav-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 34px; }
.nav-head > :first-child { justify-self: start; }
.nav-head > :last-child { justify-self: end; }
.nav-title { font-size: 17px; font-weight: 600; text-align: center; }
.text-btn { color: var(--blue); font-size: 17px; padding: 6px 0; white-space: nowrap; }
.text-btn.strong { font-weight: 600; }
.text-btn.danger { color: var(--red); }
.text-btn.back { justify-self: start; }

.search-head { display: flex; align-items: center; gap: 12px; }
.search-field {
  flex: 1; position: relative;
  display: flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 8px 0 10px;
  border-radius: 11px; background: var(--fill); color: var(--muted);
}
.search-field input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; background: none; outline: none;
  font-size: 17px; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
.search-field input::placeholder { color: var(--muted); }
.search-field input::-webkit-search-cancel-button { display: none; }
.clear-btn {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--faint); color: var(--sheet-solid);
  font-size: 15px; line-height: 20px; font-weight: 700; text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border-radius: 12px;
  font-weight: 600; font-size: 17px;
  background: var(--fill); color: var(--blue);
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.big { width: 100%; min-height: 50px; border-radius: 14px; }
.btn:active { filter: brightness(0.92); }
.btn:disabled { opacity: 0.5; }
.btn-sub { font-weight: 400; opacity: 0.85; }
.footer-alt { text-align: center; font-size: 15px; color: var(--blue); padding: 4px 0 0; }
.link-btn { color: var(--blue); font-size: 15px; padding: 8px 0 0; }

/* ---------- Home ---------- */
.near-me-btn {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 10px; margin-bottom: 10px;
  border-radius: 14px;
  background: var(--brand); color: #fff;
  text-align: left;
  box-shadow: 0 2px 8px rgba(30, 158, 90, 0.35);
}
.near-me-btn:active { filter: brightness(0.92); }
.nm-icon {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  background: #fff; color: var(--brand);
  display: grid; place-items: center; font-weight: 800; font-size: 22px;
}
.nm-text { flex: 1; display: grid; line-height: 1.25; }
.nm-text strong { font-size: 17px; }
.nm-text span { font-size: 13px; opacity: 0.9; }
.nm-chev { font-size: 26px; opacity: 0.8; }
.near-me-btn.busy .nm-icon { animation: pulse-opacity 0.9s ease-in-out infinite; }
.near-me-btn.busy .nm-text span::after { content: ' · finding you…'; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 2px 0 14px; }
.quick.two { grid-template-columns: 1fr 1fr; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px; border-radius: 14px;
  background: var(--fill);
  font-size: 13px; font-weight: 600;
}
.quick-btn:active { background: var(--fill-strong); }
.q-icon, .row-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-size: 17px; flex: none;
}
.blue { background: var(--blue); } .green { background: var(--brand); } .gray { background: var(--gray); }
.red { background: var(--red); } .orange { background: var(--orange); }

.card {
  position: relative;
  background: var(--fill);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 12px;
  display: grid; gap: 4px;
  font-size: 15px;
}
.card-title { font-weight: 700; font-size: 15px; }
.card.install { background: rgba(0, 122, 255, 0.12); }
.card-x { position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; font-size: 20px; color: var(--muted); }
.good { color: var(--good); }

.section-title {
  font-size: 13px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.02em;
  margin: 16px 4px 6px;
}
.legend { list-style: none; margin: 0; padding: 0 4px; display: grid; gap: 8px; font-size: 15px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 10px; vertical-align: -1px; }
.legend i.key-line { border-radius: 0; height: 0; border-top: 3px dashed var(--brand); background: none; width: 14px; vertical-align: 3px; }
.fine { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.4; }
.muted { color: var(--muted); }
.pad { padding: 14px 4px; }

/* ---------- Lists (iOS grouped style) ---------- */
.list { list-style: none; margin: 0; padding: 0; background: var(--fill); border-radius: 14px; overflow: hidden; }
.list > li + li { border-top: 0.5px solid var(--sep); }
.list.group { margin-bottom: 14px; }
.list-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; text-align: left; min-height: 52px;
}
.list-row:active { background: var(--fill-strong); }
.list-row .row-icon { width: 30px; height: 30px; font-size: 15px; }
.row-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.row-title { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { font-size: 14px; color: var(--muted); }
.row-meta strong { color: var(--text); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 600; }
.empty { text-align: center; padding: 24px 8px; display: grid; gap: 8px; justify-items: center; }

.switch-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 52px; }
.swatch { width: 14px; height: 14px; border-radius: 50%; flex: none; }

/* ---------- Search results with numbers ---------- */
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.result { display: flex; align-items: stretch; background: var(--fill); border-radius: 14px; overflow: hidden; }
.result-main { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: flex-start; padding: 12px; text-align: left; }
.result-main:active { background: var(--fill-strong); }
.num {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  color: #fff; font-size: 14px; font-weight: 700;
  display: grid; place-items: center; margin-top: 1px;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.result .row-title { font-weight: 600; }
.go-btn {
  flex: none; width: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--blue); color: #fff; font-size: 13px; font-weight: 700;
}
.go-btn:active { filter: brightness(0.9); }

/* ---------- Detail cards ---------- */
.tag {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; color: #fff;
}
.tag.free { background: var(--brand); } .tag.paid { background: var(--paid); } .tag.suspected { background: #7a88a6; }
.tag.notfree { background: var(--gray); }
.tag.street { background: #6e93b8; } .tag.parkade { background: #26385e; }
.tag.permit { background: #8a7fc0; } .tag.hot { background: #e5484d; } .tag.ev { background: #0f9d9a; }
.tag.accessible { background: #5b5bd6; } .tag.moto { background: #8e4ec6; } .tag.station { background: #1f2a44; }
.now { padding: 10px 12px; border-radius: 12px; background: var(--fill); font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.now.good { color: var(--good); } .now.warn { color: var(--warn); } .now.bad { color: var(--bad); }
.sheet-body > p { font-size: 15px; margin-bottom: 10px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 4px 0 12px; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.sign-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; margin-bottom: 12px; }

.warning { border-radius: 12px; background: var(--warn-bg); margin: 0 0 12px; font-size: 15px; }
.warning.high { background: var(--hot-bg); }
.warning summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 12px; font-weight: 700;
}
.warning summary::-webkit-details-marker { display: none; }
.warning summary::after { content: '›'; font-size: 22px; line-height: 1; color: var(--muted); transition: transform 0.2s; }
.warning[open] summary::after { transform: rotate(90deg); }
.warn-count { margin-left: auto; font-weight: 500; font-size: 13px; color: var(--muted); }
.warning > p, .warning > ul { padding: 0 12px; }
.warning ul { margin: 6px 0 12px; padding-left: 30px; display: grid; gap: 8px; }
.warn-sub { font-weight: 700; margin-top: 4px; }

.vote { border-top: 0.5px solid var(--sep); padding-top: 12px; margin-top: 4px; }
.vote-q { font-weight: 600; margin-bottom: 8px; }
.vote-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vote-btn { min-height: 44px; border-radius: 12px; background: var(--fill); font-weight: 600; font-size: 15px; }
.vote-btn:active { background: var(--fill-strong); }

/* ---------- Add a spot ---------- */
.step-hint { font-size: 15px; margin-bottom: 8px; }
.addr-line { font-size: 17px; margin-bottom: 10px; }
.inline-warn { font-size: 14px; color: var(--warn); margin-bottom: 10px; }
.row-btn {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; background: var(--fill);
  color: var(--blue); font-weight: 600;
}
.row-btn .row-icon { width: 30px; height: 30px; }

.form { display: grid; gap: 22px; padding-bottom: 8px; }
.form-where { font-size: 15px; color: var(--muted); margin-bottom: -8px; }
.field h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.field .opt { font-weight: 400; color: var(--muted); font-size: 13px; }
.field .hint { font-size: 13px; color: var(--muted); margin: -4px 0 10px; }
.field.invalid h3 { color: var(--bad); }
.field.invalid .stepper, .field.invalid .day-row, .field.invalid .time-row { box-shadow: 0 0 0 2px var(--bad); border-radius: 12px; }

.seg { display: flex; background: var(--fill); border-radius: 10px; padding: 2px; }
.seg button { flex: 1; min-height: 36px; border-radius: 8px; font-size: 15px; font-weight: 500; }
.seg button[aria-checked="true"] { background: var(--sheet-solid); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); font-weight: 600; }
.seg.wide { margin-bottom: 14px; }

.stepper { display: flex; align-items: center; justify-content: space-between; background: var(--fill); border-radius: 12px; padding: 4px; margin-bottom: 10px; }
.stepper button { width: 64px; height: 44px; border-radius: 9px; font-size: 26px; color: var(--blue); }
.stepper button:active { background: var(--fill-strong); }
.stepper output { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  min-height: 36px; padding: 0 14px; border-radius: 18px;
  background: var(--fill); font-size: 15px; font-weight: 500;
}
.pill[aria-pressed="true"] { background: var(--blue); color: #fff; }
.day-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 10px; }
.day { aspect-ratio: 1; border-radius: 50%; background: var(--fill); font-size: 15px; font-weight: 600; max-height: 46px; }
.day[aria-pressed="true"] { background: var(--brand); color: #fff; }
.time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.time-row label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.time-row input, textarea {
  font-size: 17px; padding: 10px 12px; border-radius: 10px; border: 0;
  background: var(--fill); color: var(--text); width: 100%; -webkit-appearance: none;
}
textarea { resize: none; font-family: var(--font); }

.switch-field { display: flex; align-items: center; gap: 12px; }
.switch-field > div { flex: 1; }
.switch-field .hint { margin: 0; }
.switch { position: relative; flex: none; width: 51px; height: 31px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; z-index: 1; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--fill-strong); transition: background 0.2s; }
.switch span::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s;
}
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }

.photo-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 52px; border-radius: 12px; border: 1.5px dashed var(--faint);
  color: var(--blue); font-weight: 600;
}
.photo-btn input { position: absolute; inset: 0; opacity: 0; width: 100%; }
.photo-preview { display: grid; gap: 6px; justify-items: start; }
.photo-preview img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; }
.form-error { color: var(--bad); font-weight: 600; font-size: 15px; }

/* ---------- Search tips ---------- */
.tips { list-style: none; margin: 0; padding: 0 4px; display: grid; gap: 10px; font-size: 15px; color: var(--muted); }
.tips li { display: flex; gap: 10px; align-items: baseline; }
.tips span { width: 20px; text-align: center; flex: none; }

/* ---------- Pay by phone ---------- */
.pay-card { background: var(--fill); border-radius: 14px; padding: 12px; margin-bottom: 12px; display: grid; gap: 10px; }
.pay-title { font-weight: 700; font-size: 15px; }
.pay-code { display: flex; align-items: center; gap: 12px; background: var(--sheet-solid); border-radius: 12px; padding: 10px; }
.pay-app-icon {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  background: #00a0df; color: #fff; font-weight: 800; font-size: 22px;
  display: grid; place-items: center;
}
.pay-code-text { flex: 1; display: grid; font-size: 13px; }
.pay-code-text strong { font-size: 24px; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 15px; border-radius: 17px; }
.pay-open { min-height: 44px; }
.pay-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }

/* ---------- Photos ---------- */
.hero-photo, .sign-figure { margin: 0 0 12px; position: relative; }
.hero-photo img { width: 100%; height: 200px; object-fit: cover; border-radius: 14px; display: block; }
.sign-figure img { width: 100%; max-height: 260px; object-fit: contain; background: var(--fill); border-radius: 12px; display: block; }
figcaption {
  position: absolute; left: 8px; bottom: 8px;
  padding: 3px 8px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 12px; font-weight: 600;
}
.thumb { flex: none; width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
.photo-field { display: grid; gap: 6px; margin-bottom: 14px; }
.photo-title { font-size: 15px; font-weight: 500; }
.photo-preview { position: relative; }

/* ---------- Placing a spot ---------- */
.seg[data-seg="mode"] { margin-bottom: 12px; }
.btn-row { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.btn-row .btn { min-height: 50px; border-radius: 14px; }
.place-actions { margin-top: 12px; }

/* ---------- Your own spot: edit / delete ---------- */
.owner { border-top: 0.5px solid var(--sep); padding-top: 12px; margin-top: 4px; display: grid; gap: 8px; }
.owner-title { font-weight: 600; }
.owner-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); color: #fff; }
.confirm-delete { background: var(--hot-bg); border-radius: 12px; padding: 12px; display: grid; gap: 10px; font-size: 15px; }

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  left: 50%; top: calc(var(--sat) + 12px);
  transform: translate(-50%, -20px);
  max-width: calc(100% - 100px);
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--sheet);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow);
  font-size: 15px; font-weight: 500; text-align: center;
  z-index: 20; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Unconfirmed lines, live reports, trips, parkades ---------- */
.now.soon, strong.soon { color: var(--orange, #f08c00); }
.tap-hint { font-size: 14px; color: var(--muted); margin: -2px 4px 12px; }
.legend i.key-glow { border-radius: 2px; height: 3px; width: 16px; vertical-align: 3px; background: #fff; box-shadow: 0 0 0 1px rgba(77, 93, 125, 0.35), 0 0 6px 2px rgba(77, 93, 125, 0.45); margin-right: 6px; margin-left: -2px; }
.legend i.key-glow.dashed { background: repeating-linear-gradient(90deg, #fff 0 5px, transparent 5px 8px); height: 4px; }
.legend i.key-dots { border-radius: 0; height: 0; width: 14px; background: none; border-top: 3px dotted; vertical-align: 3px; }
.legend i.key-square { border-radius: 4px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .legend i.key-glow { box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.45); }
}

.report { border-top: 0.5px solid var(--sep); padding-top: 12px; margin: 4px 0 12px; }
.report-latest { font-size: 15px; margin-bottom: 8px; }
.report-latest.good strong { color: var(--good); } .report-latest.bad strong { color: var(--bad); }
.report-btns { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr 1fr 1fr; gap: 6px; }
.report-btns button { min-height: 40px; border-radius: 10px; background: var(--fill); font-weight: 600; font-size: 14px; }
.report-btns button.full { color: var(--bad); }
.report-btns button:active { background: var(--fill-strong); }
.row-live { display: block; font-size: 13px; margin-top: 2px; font-weight: 600; }
.row-live.good { color: var(--good); } .row-live.bad { color: var(--bad); }

.trip-card { background: var(--fill); border-radius: 14px; padding: 12px; margin-bottom: 12px; display: grid; gap: 8px; }
.trip-title { font-weight: 700; font-size: 16px; }
.trip-card .muted { font-size: 14px; }
.trip-go { display: flex; align-items: center; justify-content: center; gap: 8px; }
.trip-card .fine { margin: 0; }
.trip-card .seg { background: var(--fill-strong); }

.rate-now { font-size: 20px; margin: 2px 0; }
.rate-form { display: flex; gap: 8px; margin: 10px 0; }
.rate-form input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 8px 12px; border-radius: 10px; border: 0.5px solid var(--sep); background: var(--sheet-solid, #fff); color: var(--text); }
.dismiss { border-top: 0.5px solid var(--sep); margin-top: 12px; padding-top: 4px; }
.link-btn.subtle { color: var(--muted); }

.street-q { background: var(--fill); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.street-q .vote-q { font-size: 17px; }
.street-q .vote-btn { background: var(--sheet-solid, #fff); }
.vote-btn.wide { width: 100%; margin-top: 8px; }

/* Fold the side panel down to the main buttons (wide screens only; phones use the bottom sheet's heights) */
.collapse-btn { display: none; }
@media (min-width: 720px) {
  .collapse-btn { display: inline-flex; align-items: center; justify-content: center; background: var(--fill); color: var(--muted); }
  .collapse-btn svg { transition: transform 0.2s ease; }
  .panel-collapsed .collapse-btn svg { transform: rotate(180deg); }
  .panel-collapsed .sheet[data-view="home"] .sheet-body > :not(.quick) { display: none; }
  .panel-collapsed .sheet[data-view="home"] .sheet-body .quick { margin-bottom: 4px; }
}

/* Spots in their "No parking" hours */
.tag.closed { background: #e5b000; color: #2b2100; }
.now.closed { color: #a87a00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .now.closed { color: #ffd23f; } }

/* Draggable ends of a stretch while adding a spot */
.drag-handle {
  width: 26px; height: 26px; border-radius: 50%;
  background: #1e9e5a; border: 4px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  cursor: grab; touch-action: none;
}
.drag-handle::after { content: ''; position: absolute; inset: -12px; border-radius: 50%; }   /* bigger finger target */
.side-seg { margin: 4px 0 10px; }
.side-seg button { font-size: 14px; }

/* Official UBC rates */
.rate-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 4px 0 6px; }
.rate-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 10px 4px 0; vertical-align: top; white-space: nowrap; }
.rate-table td { padding: 4px 0; }

/* Map key */
.key { background: var(--fill); border-radius: 14px; padding: 4px 14px 8px; margin-bottom: 12px; }
.key-group { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 10px 0 2px; }
.key-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.key-row + .key-row { border-top: 0.5px solid var(--sep); }
.key-text { display: flex; flex-direction: column; line-height: 1.25; }
.key-text strong { font-size: 15px; font-weight: 600; }
.key-text span { font-size: 13px; color: var(--muted); }
.key-swatch { flex: none; width: 28px; height: 14px; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.key-swatch.line::before { content: ''; width: 26px; height: 5px; border-radius: 3px; background: var(--c); }
.key-swatch.fat::before { content: ''; width: 26px; height: 9px; border-radius: 5px; background: var(--c); opacity: 0.55; }
.key-swatch.dot::before { content: ''; width: 13px; height: 13px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #fff; }
.key-swatch.square::before { content: 'P'; width: 15px; height: 15px; border-radius: 4px; background: var(--c); color: #fff; font: 700 11px/15px -apple-system, system-ui, sans-serif; text-align: center; }
.key-swatch.dots::before { content: ''; width: 26px; border-top: 3px dotted var(--c); }
.key-swatch.edge::before { content: ''; width: 26px; border-top: 3px dashed var(--brand); }
/* Unchecked lines: soft blue on the light map, glowing white on the dark map (same as the map) */
.key-swatch.glow::before { content: ''; width: 26px; height: 3px; border-radius: 2px; background: #4f6fae; box-shadow: 0 0 5px 2px rgba(125, 159, 224, 0.6); }
.key-swatch.glow.dashed::before { background: repeating-linear-gradient(90deg, #4f6fae 0 6px, transparent 6px 9px); height: 4px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .key-swatch.glow::before { background: #fff; box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.45); }
  :root:not([data-theme="light"]) .key-swatch.glow.dashed::before { background: repeating-linear-gradient(90deg, #fff 0 6px, transparent 6px 9px); }
  :root:not([data-theme="light"]) .key-swatch.dot::before { box-shadow: 0 0 0 2px #1c1c1e; }
}

/* "You need to be nearby" note on cards */
.near-note { background: var(--fill); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--muted); margin: 4px 0 8px; }
.near-note .link-btn { display: block; padding-top: 6px; }

/* Evo notes on cards */
.evo-note { border-radius: 12px; padding: 9px 12px; font-size: 14px; margin: 4px 0 10px; }
.evo-note.ok { background: rgba(12, 124, 186, 0.1); color: #0b6aa0; }
.evo-note.no { background: var(--fill); color: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .evo-note.ok { background: rgba(80, 170, 230, 0.16); color: #8fd0ff; } }

/* "Likely available" in near-me */
.likely { border: 1.5px solid var(--good); border-radius: 14px; padding: 8px 12px; margin-bottom: 12px; }
.likely-title { font-weight: 700; margin: 2px 0 4px; }
.likely-row { width: 100%; display: flex; align-items: center; justify-content: space-between; text-align: left; padding: 8px 0; gap: 8px; }
.likely-row + .likely-row { border-top: 0.5px solid var(--sep); }
.likely-row > span:first-child { display: flex; flex-direction: column; }
.likely-row .muted { font-size: 13px; }
.likely-row .chev { color: var(--muted); font-size: 20px; }

/* What kind of parking each near-me result is */
.type-chip { display: inline-block; align-self: flex-start; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-bottom: 3px; color: #fff; background: #8a9099; }
.type-chip.free { background: #1e9e5a; } .type-chip.street { background: #6e93b8; } .type-chip.maybe { background: #7a88a6; }
.type-chip.paid { background: #1a73e8; } .type-chip.closed { background: #e5b000; color: #2b2100; } .type-chip.permit { background: #8a7fc0; }
.type-chip.access { background: #5b5bd6; }

/* Near-me filter: tucked away under a small link */
.near-filter { margin: 0 0 10px; font-size: 14px; }
.near-filter summary { list-style: none; cursor: pointer; color: var(--accent, #1a73e8); font-weight: 600; padding: 4px 0; display: inline-block; }
.near-filter summary::-webkit-details-marker { display: none; }
.near-filter[open] { background: var(--fill); border-radius: 14px; padding: 8px 12px 10px; }
.near-filter .nf-label { margin: 8px 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b6b73); }
.near-filter .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.near-filter .chip { border: 1px solid var(--line, #d9d9de); background: var(--bg, #fff); color: inherit; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; }
.near-filter .chip.on { background: #1e9e5a; border-color: #1e9e5a; color: #fff; font-weight: 600; }
.near-filter .link-btn { margin-top: 10px; background: none; border: 0; padding: 0; color: var(--accent, #1a73e8); font: inherit; font-weight: 600; }
.near-filter .fine { margin: 8px 0 0; }

/* Filter on: a pill at the top of the map (tap to clear) */
.filter-pill { position: fixed; z-index: 4; top: calc(env(safe-area-inset-top, 0px) + 14px); left: 50%; transform: translateX(-50%); border: 0; border-radius: 999px; padding: 8px 14px; background: #1e9e5a; color: #fff; font: 600 14px/1.2 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: calc(100vw - 140px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter-pill[hidden] { display: none; }
#sheet .near-filter { margin-bottom: 12px; }

/* Paid parking: a smaller button under "Find free parking", and the Closest / Cheapest tabs */
.paid-near-btn { display: flex; align-items: center; gap: 10px; width: 100%; margin: -2px 0 10px; padding: 9px 14px; border-radius: 12px; background: var(--fill); color: var(--text); font-size: 15px; font-weight: 600; text-align: left; }
.paid-near-btn > span:nth-child(2) { flex: 1; }
.paid-near-btn .pn-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--paid); color: #fff; font-weight: 700; font-size: 15px; }
.paid-near-btn .nm-chev { font-size: 22px; opacity: 0.5; }
.paid-near-btn:active { filter: brightness(0.92); }
.paid-near-btn.busy .pn-icon { animation: pulse-opacity 0.9s ease-in-out infinite; }
.paid-tabs { margin-top: 10px; }
.row-meta .price { color: var(--paid); }
.row-meta .price.unknown { color: var(--muted); font-weight: 500; }
.switch-free, .switch-paid { display: block; margin: 4px 0 6px; }

/* Route stops: a row of numbers you swipe sideways (1–10) */
.stop-scroller { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 2px; margin: 0 -2px; }
.stop-scroller::-webkit-scrollbar { display: none; }
.stop-chip { flex: 0 0 auto; min-width: 46px; min-height: 40px; padding: 0 10px; border-radius: 10px; background: var(--fill-strong); font-size: 16px; font-weight: 600; scroll-snap-align: center; position: relative; }
.stop-chip.rec { box-shadow: inset 0 0 0 1.5px var(--brand); }
.stop-chip small { position: absolute; top: 1px; right: 4px; font-size: 9px; color: var(--brand); }
.stop-chip[aria-checked="true"] { background: var(--brand); color: #fff; box-shadow: none; }
.stop-chip[aria-checked="true"] small { color: #fff; }
.trip-card .stop-legend { margin-top: -2px; }

/* Looking for free parking: green accents. Looking for paid parking: blue accents.
   So it's obvious at a glance which one you picked. */
body.mode-free { --blue: var(--brand); --accent: var(--brand); --look: var(--brand); }
body.mode-paid { --blue: var(--paid); --brand: var(--paid); --accent: var(--paid); --look: var(--paid); }
body.mode-free #sheet, body.mode-paid #sheet { box-shadow: var(--shadow), inset 0 4px 0 var(--look); }
body.mode-free .title-head .eyebrow, body.mode-paid .title-head .eyebrow { color: var(--look); }
body.mode-paid .seg button[aria-checked="true"] { background: var(--paid); color: #fff; }
body.mode-free .type-chip.paid { background: var(--paid); }
