/* Forecast: each spot reads like a weather forecast. Flat cool gray, white surfaces, soft corners, big numbers. */
:root {
  --ground: #F3F5F6;
  --paper: #FFFFFF;
  --card: #F6F7F8;
  --track: #EEF0F2;
  --ink: #16191D;
  --ink-2: #5B6470;
  --rule: #E3E6E9;
  --veo: #0B7A62;
  --bird: #3D3FB8;
  --spin: #C8431C;
  --alert: #FFC83D;
  --good-bg: #E4F3EC;
  --good-ink: #0B6B55;
  --fresh: #FFF3D1;
  --float: 0 2px 10px rgb(22 25 29 / .14);
  --lift: 0 -6px 24px rgb(22 25 29 / .08);
  --font: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 400 16px/1.4 var(--font);
  color: var(--ink);
  background: var(--ground);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}
/* Tabular figures only on numbers that update in place: this face also widens punctuation under tnum. */
.fc-num, .row .mins, .count, .badge, .toggles .count { font-variant-numeric: tabular-nums; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--bird); outline-offset: 2px; }
h2[tabindex="-1"]:focus { outline: none; }
::selection { background: var(--alert); color: var(--ink); }
.sheet, dialog { scrollbar-color: var(--rule) transparent; }
[hidden] { display: none !important; }
button svg, svg.inline { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.inline { width: 18px; height: 18px; vertical-align: -3px; }

/* ---------- Floating top controls ---------- */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 700;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 12px) 12px 0;
  pointer-events: none; /* the map stays draggable between the buttons */
}
.bar > * { pointer-events: auto; }
.wordmark {
  margin: 0 auto 0 0; padding: 9px 14px; border-radius: 14px;
  background: var(--paper); box-shadow: var(--float);
  font-size: 19px; font-weight: 800; letter-spacing: -.02em;
}
.float-btn, .locate {
  position: relative; display: grid; place-items: center;
  min-width: 46px; height: 46px; padding: 0 10px; border: 0; border-radius: 14px;
  background: var(--paper); color: var(--ink); box-shadow: var(--float);
}
.route-key { display: flex; gap: 3px; }
.route-key i {
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  font: 800 11px/1 var(--font); font-style: normal; color: #fff;
}
.route-key i.off { background: var(--track); color: #9AA1AA; }
.badge {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--alert); color: var(--ink); font: 800 12px/20px var(--font); text-align: center;
}
.locate { position: fixed; right: 12px; z-index: 600; bottom: calc(var(--sheet-h, 220px) + 12px); }

/* ---------- Map ---------- */
#map { position: fixed; inset: 0; background: var(--ground); }
.leaflet-container { font: inherit; background: var(--ground); }
.leaflet-control-attribution { font-size: 10px; background: rgb(255 255 255 / .8) !important; border-radius: 8px 0 0 0; }
.band { display: inline-block; border-radius: 4px; }
.band.veo, .route-key i.veo, .mk.veo { background: var(--veo); }
.band.bird, .route-key i.bird, .mk.bird { background: var(--bird); }
.band.spin, .route-key i.spin, .mk.spin { background: var(--spin); }
.park { /* legend swatch matching the map's parking circles */
  display: block; width: 20px; height: 20px; border-radius: 50%;
  background: rgb(47 128 237 / .16); border: 1.5px solid rgb(47 128 237 / .6);
}
.you { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 3px solid var(--paper); box-shadow: 0 0 0 2px var(--ink), var(--float); }
.spot svg { width: 30px; height: 40px; fill: var(--alert); stroke: var(--ink); stroke-width: 2; }
@media (max-width: 719px) {
  .leaflet-bottom { bottom: var(--sheet-h, 220px); } /* keep the map credit visible above the sheet */
  .locate { bottom: calc(var(--sheet-h, 220px) + 28px); }
}

/* ---------- Sheet ---------- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 650;
  max-height: 64vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 14px calc(env(safe-area-inset-bottom) + 14px);
  background: var(--paper); border-radius: 24px 24px 0 0; box-shadow: var(--lift);
}
.grab { display: block; width: 100%; height: 22px; margin: -8px 0 4px; padding: 0; border: 0; background: none; }
.grab span { display: block; width: 36px; height: 4px; margin: 0 auto; border-radius: 2px; background: #D5D9DD; }
.grab[aria-expanded="false"] + .tabs { margin-bottom: 0; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; margin-bottom: 12px; border-radius: 13px; background: var(--track); }
.tabs button {
  min-height: 40px; border: 0; border-radius: 10px; background: transparent;
  color: var(--ink-2); font-weight: 700; font-size: 15px;
}
.tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgb(22 25 29 / .1); }
.tabs .count { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 10px; background: var(--alert); color: var(--ink); font-size: 12px; line-height: 20px; }

/* Forecast cards (My spots) */
.fc-list, .rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fc {
  width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px;
  padding: 14px 16px; border: 0; border-radius: 18px; background: var(--card); text-align: left;
}
.fc-main { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.fc-main b { font-size: 18px; font-weight: 700; line-height: 1.2; }
.fc-sub { margin-top: 2px; font-size: 14px; color: var(--ink-2); }
.fc-num { font-size: 52px; font-weight: 800; line-height: .95; letter-spacing: -.04em; }
.fc-num small { margin-left: 3px; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.chip { display: inline-block; margin-top: 8px; padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 700; background: var(--paper); color: var(--ink); }
.chip.good { background: var(--good-bg); color: var(--good-ink); }
.chip.empty { background: var(--track); color: var(--ink-2); }
.chip.al { background: var(--alert); }
.chip.off { background: var(--track); color: var(--ink-2); }
.fc-strip { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.fc-strip .chip { margin-top: 6px; font-weight: 500; }
.fc-strip .chip.al { font-weight: 700; }

/* Nearby */
.sheet-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.expand {
  flex: 1; display: grid; grid-template-columns: 1fr auto 22px; align-items: center; gap: 10px;
  min-height: 44px; padding: 4px 4px 4px 4px; border: 0; background: none; text-align: left;
}
.expand h2 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.25; }
.expand .when { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.expand svg { color: var(--ink-2); transition: transform .2s; }
.expand[aria-expanded="true"] svg { transform: rotate(180deg); }
.clear { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--track); display: grid; place-items: center; }
.cols { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; padding: 0 14px 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.row {
  width: 100%; display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; border: 0; border-radius: 16px; background: var(--card); text-align: left;
}
.mk { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; }
.row .who { display: flex; flex-direction: column; min-width: 0; }
.row .who b { font-size: 17px; font-weight: 700; }
.row .who span { font-size: 14px; color: var(--ink-2); }
.row .mins { font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.row .mins small { margin-left: 3px; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.row[aria-current="true"] { background: var(--paper); box-shadow: inset 0 0 0 2px var(--ink); }
.row.fresh { background: var(--fresh); }
.empty-row { padding: 14px; border-radius: 16px; background: var(--card); color: var(--ink-2); }

.actions {
  position: sticky; bottom: calc(-1 * (env(safe-area-inset-bottom) + 14px)); z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 10px -14px 0; padding: 10px 14px calc(env(safe-area-inset-bottom) + 14px); background: var(--paper);
}
.actions > * {
  min-height: 54px; display: grid; place-items: center; padding: 8px 12px; border: 0; border-radius: 16px;
  font-weight: 700; font-size: 16px; text-align: center; text-decoration: none;
}
.actions.single { grid-template-columns: 1fr; }
.open { color: #fff; }
.open.veo { background: var(--veo); }
.open.bird { background: var(--bird); }
.open.spin { background: var(--spin); }
.notify { background: var(--alert); color: var(--ink); }
.add { background: var(--ink); color: #fff; }
.more { padding: 4px 4px 0; font-size: 14px; color: var(--ink-2); }
.more p { margin: 8px 0 0; }
.more a { color: var(--ink); font-weight: 700; text-underline-offset: 3px; }
.warn { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--fresh); font-size: 14px; }
.intro { padding: 4px 4px 2px; }
.intro h2 { margin: 0 0 6px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.intro p { margin: 0 0 14px; color: var(--ink-2); }

/* ---------- Buttons ---------- */
.btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%;
  min-height: 54px; padding: 10px 16px; border: 0; border-radius: 16px;
  font-weight: 700; font-size: 17px; text-align: center; text-decoration: none;
}
.btn small { font-weight: 400; font-size: 13px; }
.btn.alert { background: var(--alert); color: var(--ink); }
.btn.ink { background: var(--ink); color: #fff; }
.btn.plain { min-height: 50px; margin-top: 8px; background: var(--card); color: var(--ink); font-size: 16px; }
.x { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--track); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 12px; right: 12px; z-index: 1000;
  top: calc(env(safe-area-inset-top) + 68px);
  display: flex; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 500; box-shadow: var(--float);
  opacity: 0; pointer-events: none; transform: translateY(-6px); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; pointer-events: auto; transform: none; }
.toast button { margin-left: auto; padding: 7px 12px; border: 0; border-radius: 10px; background: var(--alert); color: var(--ink); font-weight: 700; }

/* ---------- Pop-ups (bottom sheets) ---------- */
dialog {
  width: 100%; max-width: 520px; max-height: 92dvh; margin: auto auto 0;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 18px);
  border: 0; border-radius: 24px 24px 0 0; background: var(--paper); color: var(--ink); overflow-y: auto;
}
dialog::backdrop { background: rgb(22 25 29 / .35); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
dialog h2 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.note { margin: 0 0 14px; color: var(--ink-2); font-size: 15px; }

.toggles { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.toggles label {
  display: grid; grid-template-columns: 22px 20px 1fr auto; gap: 12px; align-items: center;
  min-height: 54px; padding: 0 14px; border-radius: 14px; background: var(--card); font-weight: 700;
}
.toggles .band { width: 20px; height: 20px; border-radius: 6px; }
.toggles .count { color: var(--ink-2); font-weight: 400; font-size: 14px; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }

fieldset { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.field { display: grid; gap: 6px; font-weight: 700; margin-bottom: 16px; }
.opt { font-weight: 400; color: var(--ink-2); }
.field input, .choices input[type="time"] {
  min-height: 48px; padding: 8px 14px; border: 0; border-radius: 12px; background: var(--card); font-weight: 400;
}
.field input::placeholder { color: #6B737D; } /* 4.6:1 on the card fill */
.seg { display: grid; gap: 3px; padding: 3px; border-radius: 13px; background: var(--track); }
.seg.four { grid-template-columns: repeat(4, 1fr); }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.seg label, .days label { position: relative; }
.seg input, .days input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; }
.seg span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 50px; padding: 6px 8px; border-radius: 10px; font-weight: 700; font-size: 15px; text-align: center; color: var(--ink-2);
}
.seg span:has(.band) { flex-direction: row; gap: 8px; }
.seg .band { width: 12px; height: 12px; border-radius: 4px; }
.seg small { font-weight: 400; font-size: 12px; }
.seg input:checked + span, .days input:checked + span { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgb(22 25 29 / .12); }
.seg input:focus-visible + span, .days input:focus-visible + span { outline: 3px solid var(--bird); outline-offset: -3px; }
.choices { display: grid; gap: 6px; }
.choices label { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 14px; border-radius: 14px; background: var(--card); }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 6px 0 0; }
.mode-note { margin: 8px 0 0; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; padding: 3px; border-radius: 13px; background: var(--track); margin-bottom: 12px; }
.days span { display: grid; place-items: center; min-height: 42px; border-radius: 10px; font-weight: 700; color: var(--ink-2); }
fieldset .field { margin-bottom: 12px; }
.error { color: #A3301A; font-weight: 700; margin: 0 0 10px; }
.error:empty { display: none; }
.steps { padding-left: 22px; }
.steps li { margin-bottom: 8px; }

.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alert-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--card); }
.alert-list .name { padding: 0; border: 0; background: none; text-align: left; font-weight: 700; font-size: 17px; }
.alert-list .status { grid-column: 1; font-size: 14px; color: var(--ink-2); }
.alert-list .tools { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 16px; align-items: center; }
.switch { position: relative; width: 52px; height: 32px; padding: 0; border: 0; border-radius: 16px; background: #D5D9DD; font-size: 0; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .2); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--ink); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.delete { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--paper); color: #A3301A; }
.empty { color: var(--ink-2); padding: 12px 0; background: none !important; }

@media (min-width: 720px) {
  .sheet { left: 12px; right: auto; bottom: 12px; width: 400px; border-radius: 24px; box-shadow: var(--float); }
  .locate { bottom: 24px; }
  dialog { margin: auto; border-radius: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
