/* londo — the other london, in person.
   Dusk palette on an instrument panel: keys that press, toggles that click,
   a compass that points. Bricolage Grotesque speaks, Plex Mono measures. */

:root {
  --dusk-0: #14101f;
  --dusk-1: #1d1630;
  --dusk-2: #2a1f42;
  --mauve: #8e7aa8;
  --peach: #e8a98c;
  --gold: #e3c08d;
  --ink: #efeaf4;
  --ink-dim: #a99fc0;
  --card: rgba(255, 252, 250, 0.055);
  --card-edge: rgba(232, 169, 140, 0.14);
  --key-face: #2e2344;
  --key-side: #181028;
  --key-lit: #3c2d56;
  --radius: 18px;
  --display: "Bricolage Grotesque", Georgia, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 16px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: linear-gradient(175deg, var(--dusk-0) 0%, var(--dusk-1) 38%, var(--dusk-2) 72%, #3d2a45 100%);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ---------- sky: drifting light behind everything ---------- */

.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; }

.blob-a {
  width: 55vw; height: 55vw; left: -12vw; top: -18vw;
  background: radial-gradient(circle, rgba(142, 122, 168, 0.55), transparent 65%);
  animation: drift-a 75s ease-in-out infinite alternate;
}

.blob-b {
  width: 48vw; height: 48vw; right: -14vw; bottom: -16vw;
  background: radial-gradient(circle, rgba(232, 169, 140, 0.4), transparent 65%);
  animation: drift-b 95s ease-in-out infinite alternate;
}

@keyframes drift-a { to { transform: translate(9vw, 7vh) scale(1.12); } }
@keyframes drift-b { to { transform: translate(-8vw, -9vh) scale(1.08); } }

.grain {
  position: absolute; inset: 0; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */

.topbar {
  padding: 2.6rem 1.5rem 0.4rem;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 640;
  font-size: clamp(2.5rem, 6vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.01em;
  background: linear-gradient(100deg, var(--ink) 30%, var(--peach) 75%, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0.35rem 0 0 0.1rem;
  color: var(--ink-dim);
  font-size: 0.95rem;
  font-weight: 400;
}

/* ---------- the mechanical kit ---------- */

.legend {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.legend b { color: var(--gold); font-weight: 600; }

.unit { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 0.4rem; min-width: 0; }
.unit-inline { flex-direction: row; align-items: center; gap: 0.5rem; }
.unit-grow { flex: 1 1 240px; min-width: 0; }

/* a wrapped column flex sizes its line to content — that made the topic
   tape push the whole page wide. Keep combined rows single-column and
   cap children at the row's width. */
.controls-row.unit { flex-wrap: nowrap; }
.controls-row.unit > * { max-width: 100%; }

/* --- keycaps --- */

.key {
  font-family: var(--display);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  background: linear-gradient(180deg, var(--key-lit), var(--key-face));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.48rem 1rem;
  cursor: pointer;
  position: relative;
  top: 0;
  box-shadow:
    0 4px 0 var(--key-side),
    0 6px 14px -6px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.06s ease, box-shadow 0.06s ease, color 0.15s ease;
}

.key:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--key-side), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.key.lit {
  color: var(--gold);
  box-shadow:
    0 4px 0 var(--key-side),
    0 0 16px -2px rgba(227, 192, 141, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.key.lit:active {
  box-shadow: 0 1px 0 var(--key-side), 0 0 16px -2px rgba(227, 192, 141, 0.5);
}

/* category keys glow in their own colour when lit */
.key-move.lit    { color: #f0a18e; box-shadow: 0 4px 0 var(--key-side), 0 0 16px -2px rgba(232, 131, 111, 0.55), inset 0 1px 0 rgba(255,255,255,0.12); }
.key-connect.lit { color: var(--gold); }
.key-expand.lit  { color: #b9a0e8; box-shadow: 0 4px 0 var(--key-side), 0 0 16px -2px rgba(157, 127, 209, 0.6), inset 0 1px 0 rgba(255,255,255,0.12); }
.key-think.lit   { color: #8ad2bf; box-shadow: 0 4px 0 var(--key-side), 0 0 16px -2px rgba(95, 181, 162, 0.55), inset 0 1px 0 rgba(255,255,255,0.12); }
.key-make.lit    { color: #ec9bbf; box-shadow: 0 4px 0 var(--key-side), 0 0 16px -2px rgba(217, 106, 158, 0.55), inset 0 1px 0 rgba(255,255,255,0.12); }

.reset-key {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 0.52rem 0.85rem;
}

.reset-key:hover { color: var(--peach); }

/* --- header / bottom view keys --- */

.views { display: inline-flex; gap: 0.45rem; padding-bottom: 0.3rem; }

.view-key { font-size: 0.95rem; }

.bottom-tabs { display: none; }

/* ---------- controls ---------- */

.controls {
  position: sticky;
  top: env(safe-area-inset-top, 0);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1rem 1.5rem 1rem;
  max-width: 1100px;
  margin: 0 auto;
  border-radius: 20px;
  background: linear-gradient(to bottom, rgba(20, 16, 31, 0.94) 82%, rgba(20, 16, 31, 0));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.controls-row.keys { gap: 0.5rem; }

.bench {
  align-items: center;
  gap: 1.4rem;
}

#search {
  flex: 1 1 220px;
  height: 2.5rem;
  padding: 0 1.05rem;
  border-radius: 10px;
  border: 1px solid var(--card-edge);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
  color: var(--ink);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.25s ease;
}

#search::placeholder { color: var(--ink-dim); }

#search:focus { outline: none; border-color: var(--peach); }

/* --- free-only slide switch --- */

.switch { position: relative; width: 3.3rem; height: 1.7rem; flex: none; }
.switch input { display: none; }

.slider {
  position: absolute; inset: 0; border-radius: 999px; cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--card-edge);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
  transition: background 0.2s;
}

.slider::before {
  content: ""; position: absolute; left: 3px; top: 2px;
  width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background: linear-gradient(180deg, #564273, var(--key-lit));
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
  transition: transform 0.18s cubic-bezier(0.3, 1.4, 0.5, 1), background 0.2s;
}

.switch input:checked + .slider { background: rgba(227, 192, 141, 0.22); }
.switch input:checked + .slider::before {
  transform: translateX(1.55rem);
  background: linear-gradient(180deg, var(--gold), #b8945e);
}

/* --- lens toggle: three stacked stops --- */

.lens-toggle {
  display: flex;
  flex-direction: column;
  width: 9.6rem;
  border-radius: 10px;
  border: 1px solid var(--card-edge);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.lens-stop {
  height: 1.55rem;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-dim);
  opacity: 0.6;
  transition: color 0.15s, opacity 0.15s, background 0.15s;
}

.lens-stop + .lens-stop { border-top: 1px solid rgba(255, 255, 255, 0.06); }

/* the end stops follow the housing's curve so a lit ring isn't squared off */
.lens-stop:first-child { border-radius: 9px 9px 0 0; }
.lens-stop:last-child { border-radius: 0 0 9px 9px; }

.lens-stop.lit {
  color: var(--gold);
  opacity: 1;
  font-weight: 600;
  background: rgba(227, 192, 141, 0.09);
  box-shadow: inset 0 0 0 1px rgba(227, 192, 141, 0.3);
}

@media (hover: hover) {
  .lens-stop:not(.lit):hover { color: var(--ink); opacity: 0.9; }
}

/* --- the area dial: five zones + a synced label column --- */

.areas {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.compass {
  width: 6.2rem;
  flex: none;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.4));
}

.compass svg { display: block; width: 100%; height: auto; }

/* the dial sits in a dark well, like the other instruments */
.dial-face {
  fill: rgba(0, 0, 0, 0.35);
  stroke: var(--card-edge);
  stroke-width: 1;
}

.zone {
  fill: rgba(255, 255, 255, 0.04);
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill 0.15s ease, stroke 0.15s ease;
}

.zone.lit {
  fill: rgba(227, 192, 141, 0.28);
  stroke: rgba(227, 192, 141, 0.7);
}

.dial-pts text {
  font-family: var(--mono);
  font-size: 8px;
  fill: var(--ink-dim);
  opacity: 0.75;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.area-labels {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-start;
}

.area-readout {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gold);
  line-height: 1.2;
  cursor: pointer;
}

/* hover highlights only where hover exists — on touch they stick */
@media (hover: hover) {
  .zone:hover { fill: rgba(232, 169, 140, 0.14); }
}

/* --- day ticker tape (scrolling dates + pinned 7/30) --- */

.ticker-shell {
  display: flex;
  min-width: 0;
  overflow: hidden; /* clip lit ticks to the rounded corners */
  border: 1px solid var(--card-edge);
  border-radius: 10px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.045) 0 1px, transparent 1px 9px),
    rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.ticker {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 22px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 22px), transparent);
}

.ticker::-webkit-scrollbar { display: none; }

.ticker-fixed {
  display: flex;
  flex: none;
  border-left: 1px solid rgba(232, 169, 140, 0.3);
}

.tick {
  flex: none;
  scroll-snap-align: start;
  padding: 0.45rem 0.7rem 0.4rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-dim);
  border: none;
  background: none;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  transition: color 0.15s, background 0.15s;
}

.tick small { display: block; font-size: 0.58rem; opacity: 0.6; }

@media (hover: hover) {
  .tick:hover { color: var(--ink); }
}

.tick.cursor {
  color: var(--gold);
  background: rgba(227, 192, 141, 0.12);
  box-shadow: inset 0 -2px 0 var(--gold);
}

/* --- topic token tape (multi-select) --- */

/* "anything" sits still on the left; the rest of the tokens scroll past it */
.tape-shell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
}

.tape-fixed { flex: none; padding: 2px 0 2px 4px; }

.tape {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  padding: 2px 4px;
  mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 34px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 34px), transparent);
}

.tape::-webkit-scrollbar { display: none; }

.token {
  flex: none;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 7px;
  padding: 0.34rem 0.55rem;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

@media (hover: hover) {
  .token:hover { color: var(--ink); }
}

.token.lit {
  color: var(--gold);
  border-color: rgba(227, 192, 141, 0.55);
  background: rgba(227, 192, 141, 0.1);
}

/* ---------- events ---------- */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem 4rem;
}

.status {
  color: var(--ink-dim);
  padding: 3.5rem 0;
  text-align: center;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.1rem;
  animation: breathe 2.2s ease-in-out infinite;
  transition: opacity 0.4s ease;
}

@keyframes breathe {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.95; }
}

.day-heading {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin: 2.6rem 0 1.1rem;
  font-family: var(--display);
  font-weight: 560;
  font-size: 1.4rem;
  letter-spacing: 0.005em;
}

.day-heading .when { color: var(--gold); font-weight: 480; }
.day-heading .count {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
}

.day-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--card-edge), transparent);
  align-self: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 1.1rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  animation: settle 0.55s ease forwards;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

@keyframes settle {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(232, 169, 140, 0.45);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.55);
}

.banner {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--dusk-2);
}

.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover .banner img { transform: scale(1.045); }

.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 16, 31, 0.35), transparent 45%);
  pointer-events: none;
}

.placeholder-initial {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 600;
  color: rgba(255, 250, 245, 0.9);
  text-align: center;
  padding: 0.75rem 1rem;
  line-height: 1.3;
  word-break: break-word;
  max-width: 100%;
}

.badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 1;
  padding: 0.24rem 0.55rem;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: lowercase;
  color: #fff7f0;
  background: rgba(20, 16, 31, 0.6);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 252, 250, 0.16);
}

.badge-cat-move    { background: rgba(232, 131, 111, 0.8); }
.badge-cat-connect { background: rgba(196, 152, 84, 0.85); }
.badge-cat-expand  { background: rgba(157, 127, 209, 0.8); }
.badge-cat-think   { background: rgba(63, 148, 130, 0.85); }
.badge-cat-make    { background: rgba(217, 106, 158, 0.8); }

.pick-mark {
  position: absolute;
  bottom: 0.55rem;
  right: 0.65rem;
  z-index: 1;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold);
  text-shadow: 0 1px 6px rgba(20, 16, 31, 0.9);
}

.card-body { padding: 0.9rem 1.05rem 1.05rem; }

.time {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.time .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.dot-morning { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.dot-afternoon { background: var(--peach); box-shadow: 0 0 8px var(--peach); }
.dot-evening { background: var(--mauve); box-shadow: 0 0 8px var(--mauve); }

.card-body h3 {
  margin: 0.35rem 0 0.3rem;
  font-family: var(--display);
  font-weight: 580;
  font-size: 1.06rem;
  line-height: 1.3;
}

.hook {
  margin: 0.1rem 0 0.35rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: 0.88rem;
  line-height: 1.42;
  color: var(--gold);
  opacity: 0.92;
}

.venue, .meta {
  margin: 0.18rem 0 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-dim);
}

.blurb { display: none; }

.free-tag { color: var(--peach); font-weight: 600; }

/* ---------- tonight ---------- */

.tonight-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin: 1.6rem 0 1.2rem;
}

.tonight-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 620;
  font-size: 2.1rem;
  background: linear-gradient(100deg, var(--ink) 35%, var(--peach) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tonight-sub {
  margin: 0;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 0.78rem;
  flex: 1;
}

.surprise { color: var(--gold); }

.surprise-note { padding: 0.6rem 0 0.8rem; animation: none; }

.grid-solo {
  grid-template-columns: minmax(265px, 460px);
  justify-content: center;
}

.show-all { display: block; margin: 1.6rem auto 0; }

/* ---------- map ---------- */

#map-view {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem 3rem;
}

#map {
  height: min(72vh, 640px);
  border-radius: var(--radius);
  border: 1px solid var(--card-edge);
  background: var(--dusk-2);
  /* contain Leaflet's internal pane z-indexes (400–700) so they don't
     paint over the fixed bottom nav */
  isolation: isolate;
}

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--dusk-1);
  color: var(--ink);
}

.leaflet-popup-content a { color: var(--peach); }

/* ---------- submit box ---------- */

.submit {
  max-width: 560px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
  text-align: center;
}

.submit-prompt {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-weight: 460;
  color: var(--ink-dim);
}

#submit-form {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

#submit-url {
  flex: 1 1 260px;
  height: 2.5rem;
  padding: 0 1.05rem;
  border-radius: 10px;
  border: 1px solid var(--card-edge);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.45);
  color: var(--ink);
  font-size: 0.9rem;
  font-family: inherit;
}

#submit-url::placeholder { color: var(--ink-dim); }

#submit-url:focus { outline: none; border-color: var(--peach); }

.submit-note {
  margin: 0.55rem 0 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--mauve);
}

/* ---------- footer ---------- */

footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2.5rem;
  color: var(--ink-dim);
  font-size: 0.85rem;
  text-align: center;
}

footer a {
  color: var(--peach);
  text-decoration: none;
  border-bottom: 1px dotted rgba(232, 169, 140, 0.5);
}

footer a:hover { color: var(--gold); }

#last-updated {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--mauve);
  margin-bottom: 0.2rem;
}

/* ---------- time-of-day theming ----------
   The site at 8am is not the site at 11pm. Same bones, shifted light. */

body.theme-dawn {
  background: linear-gradient(175deg, #1a1828 0%, #2b2342 40%, #4a3358 75%, #6e4257 100%);
}

body.theme-dawn .blob-a { background: radial-gradient(circle, rgba(232, 169, 140, 0.5), transparent 65%); }
body.theme-dawn .blob-b { background: radial-gradient(circle, rgba(227, 192, 141, 0.42), transparent 65%); }

body.theme-day {
  background: linear-gradient(175deg, #181426 0%, #251d3c 45%, #34254b 78%, #45304d 100%);
}

body.theme-night {
  background: linear-gradient(175deg, #0d0a16 0%, #131022 45%, #1c1531 80%, #261b36 100%);
}

body.theme-night .blob { opacity: 0.35; }

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  /* view keys move to a thumb-reach bottom bar */
  .topbar .views { display: none; }

  /* compact header */
  .topbar { padding: 1.2rem 1.2rem 0; }
  .topbar h1 { font-size: 2rem; }
  .tagline { font-size: 0.8rem; margin-top: 0.1rem; }

  .bottom-tabs {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 20;
    padding: 0.65rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(20, 16, 31, 0.96) 70%, rgba(20, 16, 31, 0));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .bottom-tabs .key { flex: 1; max-width: 8.5rem; text-align: center; }

  main, #map-view { padding-bottom: 5.5rem; }
  .submit { margin-bottom: 1rem; }
  footer { padding-bottom: 6rem; }

  /* controls scroll away with the page instead of eating viewport height,
     and compress so the first events show without scrolling */
  .controls {
    position: static;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0.7rem 1.2rem 0.4rem;
    gap: 0.55rem;
  }

  /* search + free switch + reset stay on one line */
  .controls > .controls-row:first-child { flex-wrap: nowrap; }

  #search {
    flex: 1 1 120px;
    min-width: 0;
    font-size: 1rem; /* >=16px stops iOS zooming on focus */
    height: 2.25rem;
    padding: 0 0.8rem;
  }

  .unit { gap: 0.3rem; }
  .bench { gap: 0.6rem 0.8rem; align-items: center; }
  .unit-grow { flex-basis: 100%; }

  .key {
    font-size: 0.78rem;
    padding: 0.34rem 0.6rem;
    box-shadow: 0 3px 0 var(--key-side), 0 5px 10px -5px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  .key:active { transform: translateY(2px); }
  .controls-row.keys { gap: 0.3rem; }
  .cat-key { padding: 0.34rem 0.55rem; }
  .reset-key { padding: 0.4rem 0.6rem; font-size: 0.64rem; }

  .lens-toggle { width: 7.3rem; }
  .lens-stop { font-size: 0.68rem; }
  .compass { width: 5.4rem; }
  .areas { gap: 0.6rem; }
  /* wrap "anywhere in london" so the dial and label share a line
     with the lens toggle instead of pushing onto their own row */
  .area-readout { max-width: 5.8rem; font-size: 0.85rem; }
  .tick { padding: 0.36rem 0.55rem 0.32rem; font-size: 0.66rem; }
  .token { font-size: 0.64rem; padding: 0.28rem 0.45rem; }
  .switch { width: 2.9rem; height: 1.5rem; }
  .switch .slider::before { width: 1.05rem; height: 1.05rem; }
  .switch input:checked + .slider::before { transform: translateX(1.35rem); }

  main { padding-top: 0.2rem; }

  .tonight-title { font-size: 1.8rem; }
  #map { height: 65vh; }

  /* day headings float at the top while scrolling that day's events */
  .day-group { margin-top: 1.4rem; }

  .day-heading {
    position: sticky;
    top: env(safe-area-inset-top, 0);
    z-index: 5;
    margin: 0 -1.5rem 0.9rem;
    padding: 0.65rem 1.5rem 0.55rem;
    background: rgba(20, 16, 31, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

/* ---------- quiet for those who prefer it ---------- */

@media (prefers-reduced-motion: reduce) {
  .blob-a, .blob-b { animation: none; }
  .card { animation-duration: 0.01s; }
  .card:hover { transform: none; }
  .card:hover .banner img { transform: none; }
  .status { animation: none; }
  .lens-stop, .slider::before { transition: none; }
}
