/* ========================================================
   Ten Days — NYT-editorial style
   Serif display (Fraunces), sans body (Inter), off-white,
   restrained newsprint palette, single ink accent.
======================================================== */

/* ---------- TOKENS ---------- */
:root, [data-theme="light"] {
  --paper: #f5f1e8;
  --paper-2: #ede7d9;
  --paper-3: #e4dcc9;
  --ink: #14110c;
  --ink-2: #3a352a;
  --ink-mute: #6a6558;
  --ink-faint: #a49f92;
  --rule: #d2ccbc;
  --rule-soft: #e0d9c7;
  --accent: #ff5c2b;         /* zipouts tangerine */
  --accent-2: #e04916;
  --accent-soft: #ffe6dc;
  --highlight: #f0e4c6;
  --shadow-sm: 0 1px 2px rgba(20,17,12,0.06);
  --shadow-md: 0 4px 14px rgba(20,17,12,0.09);
  --shadow-lg: 0 18px 40px rgba(20,17,12,0.14);

  --text-xs: clamp(0.72rem, 0.68rem + 0.15vw, 0.8rem);
  --text-sm: clamp(0.84rem, 0.8rem + 0.2vw, 0.94rem);
  --text-base: clamp(0.98rem, 0.94rem + 0.2vw, 1.06rem);
  --text-lg: clamp(1.1rem, 1rem + 0.6vw, 1.4rem);
  --text-xl: clamp(1.4rem, 1.15rem + 1.1vw, 2.05rem);
  --text-2xl: clamp(1.9rem, 1.3rem + 2.4vw, 3rem);
  --text-hero: clamp(2.2rem, 1.4rem + 3.4vw, 4rem);

  --font-display: 'Fraunces', 'Times New Roman', Georgia, serif;
  --font-body: 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;

  --content: 1240px;
  --gutter: clamp(1.25rem, 3.5vw, 3rem);
}

[data-theme="dark"] {
  --paper: #14110c;
  --paper-2: #1c1912;
  --paper-3: #26221a;
  --ink: #f2ecdd;
  --ink-2: #d5cfbe;
  --ink-mute: #928c7e;
  --ink-faint: #635e53;
  --rule: #2f2b22;
  --rule-soft: #26221a;
  --accent: #ff7a4d;         /* zipouts tangerine, dark */
  --accent-2: #ff9d78;
  --accent-soft: #3a221c;
  --highlight: #3a2f18;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.5);
  --shadow-lg: 0 18px 40px rgba(0,0,0,0.6);
}

/* ---------- RESET / BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(1200px 600px at 15% -10%, rgba(255,255,255,0.35), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(139,26,26,0.05), transparent 55%);
  background-attachment: fixed;
  transition: background 400ms ease, color 400ms ease;
}
[data-theme="dark"] body {
  background-image:
    radial-gradient(1200px 600px at 15% -10%, rgba(255,255,255,0.03), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(226,98,74,0.08), transparent 55%);
}
img, svg, canvas { display: block; max-width: 100%; }
/* Leaflet manages its own canvas sizing/positioning — don't constrain */
.leaflet-container canvas, .leaflet-container img { max-width: none; }
button { cursor: pointer; background: none; border: none; color: inherit; font: inherit; }
input, select { font: inherit; color: inherit; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
::selection { background: var(--accent); color: var(--paper); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.015em; line-height: 1.1; }

.kicker {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- MASTHEAD ---------- */
.masthead { padding: clamp(1rem, 3vw, 1.5rem) var(--gutter) 0; }

/* Single-row header: logo (far left) | date | city switcher | tag | theme toggle (far right) */
.mast-row {
  max-width: var(--content); margin: 0 auto 1rem;
  display: flex; align-items: center; gap: 1.25rem;
}
.mast-banner {
  display: inline-flex; align-items: center;
  flex: 0 0 auto;
  margin: 0;
}
.mast-banner img {
  display: block;
  width: clamp(56px, 6.5vw, 88px);
  height: auto; aspect-ratio: 1 / 1;
}
.mast-date {
  flex: 0 1 auto;
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-mute); font-weight: 500;
  white-space: nowrap;
}
.mast-tag {
  flex: 0 1 auto;
  font-style: italic; letter-spacing: 0.02em;
  font-family: var(--font-display); font-size: var(--text-sm);
  color: var(--ink-mute); font-weight: 500;
  white-space: nowrap;
  margin-left: auto; /* push tag + toggle to the far right */
}

.city-switcher {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.28rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
}
.city-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 3.25rem; padding: 0.32rem 0.9rem;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}
.city-chip:hover { color: var(--ink); }
.city-chip.is-active {
  color: var(--paper);
  background: var(--ink);
}

/* Tablet — keep row but allow tag to hide before layout breaks */
@media (max-width: 820px) {
  .mast-row { gap: 0.9rem; }
  .mast-tag { display: none; }
}

/* Phone — keep logo far left, wrap the rest below if needed */
@media (max-width: 560px) {
  .mast-row { flex-wrap: wrap; gap: 0.6rem 0.9rem; margin-bottom: 0.75rem; }
  .mast-banner { order: 0; }
  .mast-banner img { width: clamp(48px, 14vw, 64px); }
  .mast-date { order: 2; flex: 1 1 100%; text-align: left; }
  .city-switcher { order: 1; margin-left: auto; }
  .city-chip { min-width: 2.75rem; padding: 0.28rem 0.75rem; }
  .theme-toggle { order: 1; }
}
.mast-logo {
  justify-self: center; color: var(--ink);
  display: inline-flex; align-items: center; gap: 0.55rem;
  text-decoration: none; line-height: 1;
}
.mast-logo:hover { color: var(--ink); }
.zipouts-mark { flex: none; display: block; }
.zipouts-wordmark {
  font-family: 'Satoshi', 'Inter', -apple-system, 'Helvetica Neue', sans-serif;
  font-weight: 900;
  font-size: 2.1rem;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1;
}
.zipouts-wordmark .accent-o { color: var(--accent, #ff5c2b); }
.theme-toggle {
  position: absolute; top: 1.4rem; right: var(--gutter); color: var(--ink-mute);
  padding: 0.5rem; border-radius: 999px; border: 1px solid var(--rule);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.mast-rule {
  max-width: var(--content); margin: 1rem auto 0;
  border-top: 3px double var(--ink);
  position: relative;
}
.mast-rule::after {
  content: ""; display: block; border-top: 1px solid var(--ink); margin-top: 3px;
}

/* ---------- SECTIONS ---------- */
main { max-width: var(--content); margin: 0 auto; padding: 0 var(--gutter) 5rem; }
.section-head {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
  border-bottom: 1px solid var(--rule); padding-bottom: 1rem;
  margin: 3rem 0 1.5rem; align-items: end;
}
.section-head h2 { font-size: var(--text-xl); }
.section-blurb { font-family: var(--font-display); font-style: italic; font-size: var(--text-base); color: var(--ink-2); max-width: 42ch; justify-self: end; }

/* ---------- HERO ---------- */
.hero { padding: 2rem 0 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.hero h1 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2rem, 1.2rem + 3.2vw, 3.6rem);
  line-height: 1.02; letter-spacing: -0.02em;
  margin: 0.75rem 0 1.25rem; max-width: 22ch;
}
.hero h1 em { font-style: italic; font-weight: 400; }
.lede { font-size: var(--text-lg); line-height: 1.5; color: var(--ink-2); max-width: 52ch; }
.lede em { font-style: italic; font-family: var(--font-display); }
.hero-stats { display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); margin-top: 2rem; border-top: 1px solid var(--rule); padding-top: 1.25rem; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: var(--font-display); font-weight: 700; font-size: var(--text-2xl); line-height: 1; letter-spacing: -0.02em; }
.stat-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-mute); margin-top: 0.35rem; }

.hero-side { display: flex; flex-direction: column; gap: 1.5rem; padding-top: 0.5rem; }
.side-block { border: 1px solid var(--rule); background: var(--paper-2); padding: 1.25rem; border-radius: 2px; }
.side-kicker { font-family: var(--font-display); font-style: italic; font-size: var(--text-sm); color: var(--ink-mute); margin-bottom: 0.75rem; letter-spacing: 0.01em; }
.side-body { font-size: var(--text-sm); }
.side-fine { font-size: var(--text-xs); color: var(--ink-mute); margin-top: 0.5rem; line-height: 1.5; }
.home-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 0.75rem; }
.home-picker label { display: flex; align-items: center; gap: 0.4rem; font-size: var(--text-sm); cursor: pointer; }
.home-picker input { accent-color: var(--accent); }
.link-btn { color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.2em; padding: 0; }
.link-btn:hover { color: var(--accent-2); }

.hero-rule { border-top: 1px solid var(--rule); margin-top: 3rem; }

/* ---------- HAPPENING NOW ---------- */
.now-section {
  margin: 2.5rem 0 3rem;
  padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.25rem, 2.5vw, 2rem);
  border: 1px solid var(--ink);
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--accent-soft), transparent 60%) 0%, var(--paper-2) 45%);
  border-radius: 3px;
  position: relative;
  box-shadow: var(--shadow-md);
}
.now-section::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 12px, transparent 12px 22px);
}

.now-head {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem); align-items: start; margin-bottom: 1.5rem;
}
.now-head-left h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem);
  line-height: 1.05; letter-spacing: -0.02em;
  margin: 0.4rem 0 0.75rem;
  max-width: 20ch;
}
.now-kicker { display: inline-flex; align-items: center; gap: 0.5rem; }
.now-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent), transparent 30%);
  animation: nowPulse 1.9s ease-out infinite;
}
@keyframes nowPulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent), transparent 30%); }
  70%  { box-shadow: 0 0 0 10px color-mix(in oklab, var(--accent), transparent 100%); }
  100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent), transparent 100%); }
}
.now-lede { font-size: var(--text-base); color: var(--ink-2); max-width: 52ch; line-height: 1.55; }

.now-nbhd-block {
  border: 1px solid var(--rule); background: var(--paper);
  padding: 1rem 1.1rem; border-radius: 2px;
}
.home-picker-now { grid-template-columns: 1fr 1fr; gap: 0.4rem 0.75rem; }
.now-shortlist {
  margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px solid var(--rule);
  font-size: var(--text-sm); color: var(--ink-2);
}

.now-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border: 1px solid var(--rule); background: var(--paper);
  margin-bottom: 1.25rem; overflow: hidden;
}
.now-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
  padding: 0.75rem 0.9rem; border-right: 1px solid var(--rule);
  text-align: left; transition: background 180ms ease, color 180ms ease;
  color: var(--ink-2);
}
.now-tab:last-child { border-right: none; }
.now-tab:hover { background: var(--paper-2); }
.now-tab.active { background: var(--ink); color: var(--paper); }
.now-tab-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.11em; font-weight: 600; }
.now-tab.active .now-tab-label { color: var(--paper); }
.now-tab-count { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: -0.02em; line-height: 1; }
.now-tab.active .now-tab-count { color: var(--paper); }
.now-tab-count::after { content: " events"; font-family: var(--font-body); font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); font-weight: 500; margin-left: 0.3rem; }
.now-tab.active .now-tab-count::after { color: color-mix(in oklab, var(--paper), transparent 30%); }

.now-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.now-card {
  display: flex; flex-direction: column; gap: 0.55rem;
  padding: 1rem 1.1rem 0.95rem;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 2px;
  position: relative; transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  min-height: 220px;
}
.now-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--ink-mute); }
.now-card.imminent { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow-sm); }
.now-card.imminent::before {
  content: ""; position: absolute; top: -1px; left: -1px; width: 6px; bottom: -1px;
  background: var(--accent);
}

/* Big time chip — the visual hook of the card */
.now-card-time-block {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.55rem 0.8rem;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink);
  align-self: flex-start;
  min-width: 0;
  max-width: 100%;
}
.now-card.imminent .now-card-time-block {
  background: color-mix(in oklab, var(--accent), transparent 92%);
  border-color: color-mix(in oklab, var(--accent), transparent 60%);
  border-left-color: var(--accent);
}
.now-card-status {
  font-family: var(--font-body); font-size: 0.62rem;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-mute); font-weight: 600; line-height: 1;
}
.now-card.imminent .now-card-status { color: var(--accent); }
.now-card-time-big {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.5rem; line-height: 1.05; letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.now-card.imminent .now-card-time-big { color: var(--accent); }

.now-card-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.15rem; line-height: 1.2; letter-spacing: -0.01em;
  color: var(--ink);
}
.now-card-title a { text-decoration: none; color: inherit; }
.now-card-title a:hover { color: var(--accent); }
.now-card-venue { font-size: var(--text-sm); color: var(--ink-2); line-height: 1.35; }
.now-card-venue .dot { color: var(--ink-faint); margin: 0 0.35rem; }
.now-card-blurb {
  font-family: var(--font-display); font-style: italic; font-size: 0.9rem;
  color: var(--ink-2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.now-card-foot {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  margin-top: auto; padding-top: 0.6rem; border-top: 1px dashed var(--rule);
}
.now-card-cost { font-family: var(--font-display); font-weight: 500; font-size: 0.95rem; }
.now-card-cost.free { color: var(--accent); font-style: italic; }
.now-card-dist { font-size: var(--text-xs); color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.08em; }
.now-card-actions { margin-left: auto; display: flex; gap: 0.3rem; align-items: center; }
.now-card .pick-star { width: 24px; height: 24px; }
.now-card .play-btn { width: 26px; height: 26px; }
.now-empty { padding: 2.5rem 1rem; text-align: center; font-family: var(--font-display); font-style: italic; color: var(--ink-mute); }
.now-empty a { color: var(--accent); }

/* Get Tickets / Book Tour CTA — shown only on ticketing sources */
.now-card-cta {
  display: inline-flex; align-items: center;
  align-self: flex-start;
  margin-top: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: var(--accent); color: white;
  font-family: var(--font-display); font-weight: 500; font-size: 0.85rem;
  text-decoration: none; border-radius: 4px;
  transition: background 0.15s;
}
.now-card-cta:hover { background: var(--accent-dark, #c85a3e); text-decoration: none; }
.now-card-cta svg { flex-shrink: 0; }

/* ---------- BROWSE (two-column layout) ---------- */
.browse-section { margin-top: 2rem; }
.browse-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2rem);
  align-items: start;
}
.browse-sidebar {
  display: flex; flex-direction: column; gap: 1.25rem;
  position: sticky; top: 1rem; align-self: start;
  max-height: calc(100vh - 2rem); overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-width: thin; scrollbar-color: var(--rule) transparent;
}
.browse-sidebar::-webkit-scrollbar { width: 6px; }
.browse-sidebar::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

.sidebar-block {
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 2px;
  padding: 0.9rem 0.9rem 1rem;
}
.sidebar-kicker {
  font-family: var(--font-body); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-mute); font-weight: 600; margin-bottom: 0.6rem;
}

.browse-main { min-width: 0; }
.results-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 0 0.75rem;
  margin-bottom: 0.75rem; border-bottom: 1px solid var(--rule);
  gap: 1rem; flex-wrap: wrap;
}
.results-count {
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
  letter-spacing: -0.01em; color: var(--ink);
}
.results-caption {
  font-family: var(--font-display); font-style: italic; font-size: var(--text-sm); color: var(--ink-mute);
}

/* ---------- MAP ---------- */
/* Day strip — in sidebar, so display as a vertical-friendly compact grid */
.day-strip {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0; border: 1px solid var(--rule); background: var(--paper);
  overflow: hidden;
}
.day-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-size: 0.68rem;
  color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: 0.09em;
  transition: background 180ms ease, color 180ms ease;
  min-width: 0;
  text-align: left;
}
.day-btn:nth-child(2n) { border-right: none; }
.day-btn:hover { background: var(--paper-3); color: var(--ink); }
.day-btn.active { background: var(--ink); color: var(--paper); }
.day-btn.active .day-count { color: var(--paper); }
.day-btn .day-num { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--ink); text-transform: none; line-height: 1; }
.day-btn.active .day-num { color: var(--paper); }
.day-btn .day-count { font-size: 0.62rem; color: var(--ink-faint); letter-spacing: 0.06em; }

.map-frame { position: relative; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; background: var(--paper); }
#map { width: 100%; height: 240px; }
.map-legend {
  position: absolute; bottom: 0.75rem; left: 0.75rem; z-index: 500;
  background: rgba(245,241,232,0.94); backdrop-filter: blur(8px);
  padding: 0.5rem 0.75rem; border: 1px solid var(--rule); border-radius: 2px;
  display: flex; flex-direction: column; gap: 0.3rem; font-size: var(--text-xs);
}
[data-theme="dark"] .map-legend { background: rgba(20,17,12,0.9); }
.legend-title { font-family: var(--font-display); font-style: italic; color: var(--ink-mute); }
.legend-scale { display: flex; height: 8px; width: 140px; border: 1px solid var(--rule); }
.legend-scale span { flex: 1; }
.l1 { background: #cbe4c9; } .l2 { background: #f2d16a; } .l3 { background: #ea8a3b; } .l4 { background: var(--accent); }
.legend-ends { display: flex; justify-content: space-between; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.65rem; }
.map-caption {
  position: absolute; top: 0.75rem; right: 0.75rem; z-index: 500;
  background: rgba(245,241,232,0.94); backdrop-filter: blur(8px);
  padding: 0.4rem 0.75rem; border: 1px solid var(--rule); border-radius: 2px;
  font-family: var(--font-display); font-style: italic; font-size: var(--text-sm);
}
[data-theme="dark"] .map-caption { background: rgba(20,17,12,0.9); }

/* Custom marker (legacy — kept for fallback) */
.event-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--paper);
  box-shadow: 0 0 0 1px var(--ink);
}

/* ---------- CLUSTER BUBBLES ---------- */
.cluster-marker {
  background: transparent !important;
  border: none !important;
}
.cluster-bubble {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 2px solid var(--paper);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.08);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  color: var(--paper);
  text-align: center;
  user-select: none;
}
.cluster-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(0,0,0,0.28), 0 0 0 1px rgba(0,0,0,0.12);
}
.cluster-count {
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.cluster-bubble.tier-hot {
  background: var(--accent);
  color: #fff;
}
.cluster-bubble.tier-warm {
  background: #c47a1a;
  color: #fff;
}
.cluster-bubble.tier-mid {
  background: #9a8b62;
  color: #fff;
}
.cluster-bubble.tier-low {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
[data-theme="dark"] .cluster-bubble.tier-low {
  background: var(--paper-2);
  color: var(--ink);
  border: 2px solid var(--paper);
}

/* Cluster popup content */
.cluster-popup .leaflet-popup-content-wrapper {
  padding: 0;
  max-width: 320px;
}
.cluster-popup .leaflet-popup-content {
  margin: 0.85rem 1rem 0.9rem;
}
.cpop-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
  color: var(--ink);
}
.cpop-sub {
  font-size: var(--text-xs);
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.cpop-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 0.5rem;
  max-height: 260px;
  overflow-y: auto;
}
.cpop-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: baseline;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--rule);
}
.cpop-list li:last-child { border-bottom: none; padding-bottom: 0; }
.cpop-date {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.cpop-body { min-width: 0; }
.cpop-etitle {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.25;
  color: var(--ink);
  display: block;
  margin-bottom: 0.1rem;
}
.cpop-meta {
  font-size: 0.7rem;
  color: var(--ink-mute);
  line-height: 1.35;
}
.cpop-more {
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--rule);
  font-size: var(--text-xs);
  color: var(--ink-mute);
  font-style: italic;
  text-align: center;
}
.cpop-hint {
  margin-top: 0.5rem;
  padding: 0.4rem 0.5rem;
  background: var(--paper-2);
  border: 1px dashed var(--rule);
  font-size: 0.68rem;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

.leaflet-popup-content-wrapper { border-radius: 2px; border: 1px solid var(--rule); box-shadow: var(--shadow-md); background: var(--paper); color: var(--ink); }
.leaflet-popup-content { font-family: var(--font-body); margin: 0.75rem 1rem; font-size: var(--text-sm); }
.leaflet-popup-tip { background: var(--paper); border: 1px solid var(--rule); }
.pop-title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin-bottom: 0.25rem; }
.pop-meta { font-size: var(--text-xs); color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.08em; }
.pop-blurb { margin-top: 0.4rem; }

/* ---------- FILTERS ---------- */
.filter-bar {
  display: grid; grid-template-columns: 1.6fr repeat(5, minmax(0, 1fr)) auto; gap: 0.75rem;
  padding: 0.75rem; background: var(--paper-2); border: 1px solid var(--rule);
  margin-bottom: 1rem; align-items: end;
}
.filter-group { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.filter-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-mute); font-weight: 500; }
.filter-bar input, .filter-bar select {
  border: 1px solid var(--rule); background: var(--paper); padding: 0.55rem 0.65rem;
  border-radius: 2px; font-size: var(--text-sm); color: var(--ink); width: 100%;
}
.filter-bar input:focus, .filter-bar select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.reset-btn {
  padding: 0.55rem 1rem; border: 1px solid var(--ink); background: var(--paper);
  font-size: var(--text-sm); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; height: fit-content;
}
.reset-btn:hover { background: var(--ink); color: var(--paper); }

/* ---------- TABLE ---------- */
.table-wrap { border: 1px solid var(--rule); background: var(--paper-2); overflow-x: auto; }
.listings { width: 100%; border-collapse: collapse; font-size: var(--text-sm); table-layout: fixed; }
/* Fixed column widths (desktop) — prevents any one cell from monopolizing the row.
   The event column is left auto so it absorbs remaining space. */
.listings col.col-star     { width: 44px; }
.listings col.col-date     { width: 10rem; }
.listings col.col-event    { width: auto; min-width: 18rem; }
.listings col.col-nbhd     { width: 10rem; }
.listings col.col-address  { width: 12rem; }
.listings col.col-type     { width: 6.5rem; }
.listings col.col-run      { width: 5.5rem; }
.listings col.col-cost     { width: 5rem; }
.listings col.col-source   { width: 6rem; }
.listings col.col-play     { width: 44px; }
/* Force wrap inside every cell so long unbroken strings can't push columns wider */
.listings td, .listings th { overflow-wrap: anywhere; word-break: break-word; }
.listings th {
  text-align: left; padding: 0.85rem 1rem; font-family: var(--font-body); font-weight: 600;
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-mute); background: var(--paper-3); cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--rule); white-space: nowrap;
  transition: color 180ms;
}
.listings th:hover { color: var(--accent); }
.listings th.sort-asc::after { content: " ↑"; color: var(--accent); }
.listings th.sort-desc::after { content: " ↓"; color: var(--accent); }
.listings th.col-pick, .listings th.col-action { width: 44px; }
.listings td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.listings tbody tr { transition: background 140ms ease; }
.listings tbody tr:hover { background: var(--paper-3); }
.listings tbody tr.picked { background: color-mix(in oklab, var(--accent-soft), transparent 30%); }
.listings tbody tr.picked td:first-child { border-left: 3px solid var(--accent); }

.td-date { white-space: nowrap; font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; }
/* Constrain date/time column width so long time strings wrap instead of overflowing */
.listings td:nth-child(2) { max-width: 12rem; }
.td-date-day { display: block; font-size: var(--text-xs); color: var(--ink-mute); font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.15rem; font-weight: 500; }
.td-time { font-size: var(--text-xs); color: var(--ink-mute); margin-top: 0.15rem; display: block; }
.td-time-big {
  display: inline-block; margin-top: 0.4rem;
  padding: 0.2rem 0.45rem;
  background: var(--paper-2); border: 1px solid var(--rule);
  border-left: 2px solid var(--ink);
  font-family: var(--font-display); font-weight: 700;
  font-size: 0.9rem; letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
  box-sizing: border-box;
  line-height: 1.25;
}
.td-time-big.td-time-open {
  color: var(--ink-mute); font-weight: 500;
  border-left-color: var(--ink-faint);
  font-family: var(--font-body); font-style: italic;
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem;
}

.td-title { font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; line-height: 1.25; }
.td-title a { text-decoration: none; }
.td-title a:hover { color: var(--accent); }
.td-venue { display: block; font-size: var(--text-xs); color: var(--ink-mute); margin-top: 0.15rem; font-family: var(--font-body); }
.td-blurb { display: block; font-size: var(--text-xs); color: var(--ink-2); margin-top: 0.35rem; font-family: var(--font-display); font-style: italic; max-width: 42ch; }

.td-nbhd { white-space: nowrap; }
.borough-pill { display: block; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-faint); margin-top: 0.15rem; }

.type-pill {
  display: inline-block; padding: 0.15rem 0.55rem; border: 1px solid currentColor;
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500;
  border-radius: 999px;
  /* Allow wrapping within the fixed-width Type column so long labels like
     "MUSIC/SPORTS" or "FESTIVALS/SPORTS/ART/FOOD" don't overflow into the
     adjacent Run column. `word-break: normal` + `overflow-wrap: break-word`
     keeps single words intact but lets the browser break at whitespace and
     slashes (helped by U+200B ZWSP injected in app.js). */
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  max-width: 100%;
  line-height: 1.15;
}
.type-Theater { color: #7a1e5e; }
.type-Music { color: #8b1a1a; }
.type-Art { color: #4a5e2c; }
.type-Film { color: #3a5a8c; }
.type-Food { color: #a05a1a; }
.type-Comedy { color: #a06a1a; }
.type-Nightlife { color: #5b2b7a; }
.type-Outdoor { color: #2c6a4a; }
.type-Talk { color: #2c5a70; }
.type-Market { color: #8a5a1a; }
.type-Other { color: var(--ink-mute); }

/* Run-type indicators — bold editorial badges */
.run-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.11em; font-weight: 700;
  white-space: nowrap; font-family: var(--font-body);
  padding: 0.28rem 0.55rem 0.24rem;
  border-radius: 3px;
  border: 1px solid transparent;
  line-height: 1;
}
.run-pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
}

/* Ongoing — quiet, negative-space treatment. Reads as "still there whenever." */
.run-Ongoing {
  color: var(--ink-mute);
  background: transparent;
  border-color: color-mix(in oklab, var(--ink-mute), transparent 75%);
  font-weight: 500;
}
.run-Ongoing::before { background: var(--ink-faint); }

/* Limited — solid gold badge. Reads as "time-boxed, act soon." */
.run-Limited {
  color: #4a2f0a;
  background: #f2d16a;
  border-color: #d19900;
}
.run-Limited::before { background: #7a4d0a; }

/* Unique — filled accent badge with star. Reads as "one-off, unrepeatable." */
.run-Unique {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 1px 3px color-mix(in oklab, var(--accent), transparent 60%);
}
.run-Unique::before {
  content: "★"; width: auto; height: auto; background: transparent;
  font-size: 0.75rem; line-height: 1; color: #ffe8a3;
}

[data-theme="dark"] .run-Limited {
  color: #f4e4b8; background: #6e4d0f; border-color: #b78a1f;
}
[data-theme="dark"] .run-Limited::before { background: #f2d16a; }
[data-theme="dark"] .run-Unique { box-shadow: 0 1px 6px color-mix(in oklab, var(--accent), transparent 40%); }

/* Row accent — a subtle left rail so Unique/Limited events pop when scanning */
.listings tr.row-Unique td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.listings tr.row-Limited td:first-child { box-shadow: inset 3px 0 0 #d19900; }
[data-theme="dark"] .listings tr.row-Limited td:first-child { box-shadow: inset 3px 0 0 #e8b45c; }

/* Sort indicator on Run column reads a bit larger since it's a key axis */
.listings th[data-sort="run_type"] { color: var(--ink); font-weight: 700; }
[data-theme="dark"] .type-Theater { color: #d68bb0; }
[data-theme="dark"] .type-Music { color: #e2624a; }
[data-theme="dark"] .type-Art { color: #a3b880; }
[data-theme="dark"] .type-Film { color: #7ba0d0; }
[data-theme="dark"] .type-Food { color: #d69a5e; }
[data-theme="dark"] .type-Comedy { color: #d6a970; }
[data-theme="dark"] .type-Nightlife { color: #9a7bc0; }
[data-theme="dark"] .type-Outdoor { color: #6da88c; }
[data-theme="dark"] .type-Talk { color: #7ba0b8; }
[data-theme="dark"] .type-Market { color: #c8a870; }

.td-cost { font-family: var(--font-display); font-size: 1rem; font-weight: 500; white-space: normal; overflow-wrap: break-word; line-height: 1.2; }
.td-cost.free { color: var(--accent); font-style: italic; }
.td-source { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-mute); white-space: nowrap; }
.td-address { font-size: var(--text-xs); color: var(--ink-mute); font-variant-numeric: tabular-nums; max-width: 180px; line-height: 1.35; }
.td-address-muted { color: var(--ink-faint); }

.pick-star {
  width: 26px; height: 26px; border-radius: 50%;
  color: var(--ink-faint); display: inline-flex; align-items: center; justify-content: center;
  transition: color 180ms;
}
.pick-star:hover { color: var(--accent); }
.pick-star.on { color: var(--accent); }
.pick-star svg { width: 16px; height: 16px; }

.route-mini {
  color: var(--ink-mute); padding: 0.25rem 0.5rem; font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: 0.08em; border: 1px solid transparent;
}
.route-mini:hover { color: var(--accent); border-color: var(--accent); }

.empty-state { padding: 3rem 1rem; text-align: center; font-family: var(--font-display); font-style: italic; color: var(--ink-mute); }

/* ---------- COMMUTE ---------- */
.commute-panel { border: 1px solid var(--rule); background: var(--paper-2); padding: 1.25rem; }
.commute-controls { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 0.75rem; align-items: end; }
.commute-field { display: flex; flex-direction: column; gap: 0.3rem; }
.commute-field label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-mute); font-weight: 500; }
.commute-field select { padding: 0.6rem 0.7rem; border: 1px solid var(--rule); background: var(--paper); border-radius: 2px; font-size: var(--text-sm); }
.commute-arrow { padding-bottom: 0.65rem; color: var(--accent); font-size: 1.25rem; font-family: var(--font-display); }
.route-btn { padding: 0.65rem 1.5rem; background: var(--ink); color: var(--paper); border: 1px solid var(--ink); font-size: var(--text-sm); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; height: fit-content; }
.route-btn:hover { background: var(--accent); border-color: var(--accent); }

.commute-result { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.commute-empty { font-family: var(--font-display); font-style: italic; color: var(--ink-mute); }
.route-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.route-stat { display: flex; flex-direction: column; }
.route-stat-num { font-family: var(--font-display); font-weight: 700; font-size: var(--text-xl); line-height: 1; }
.route-stat-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-mute); margin-top: 0.25rem; }
.route-steps { display: flex; flex-direction: column; gap: 0.5rem; }
.route-step { display: grid; grid-template-columns: 32px 1fr; gap: 0.75rem; align-items: start; padding: 0.6rem 0; border-bottom: 1px dashed var(--rule); }
.route-step:last-child { border-bottom: none; }
.route-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--paper-3); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.route-step-label { font-size: var(--text-sm); }
.route-step-sub { font-size: var(--text-xs); color: var(--ink-mute); margin-top: 0.15rem; }
.subway-bullet {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; font-weight: 700;
  font-family: var(--font-body); font-size: 0.8rem; color: white; margin-right: 0.15rem;
}
.sub-1 { background: #ee352e; }
.sub-2 { background: #ee352e; }
.sub-3 { background: #ee352e; }
.sub-4 { background: #00933c; }
.sub-5 { background: #00933c; }
.sub-6 { background: #00933c; }
.sub-7 { background: #b933ad; }
.sub-A { background: #2850ad; }
.sub-C { background: #2850ad; }
.sub-E { background: #2850ad; }
.sub-B { background: #ff6319; }
.sub-D { background: #ff6319; }
.sub-F { background: #ff6319; }
.sub-M { background: #ff6319; }
.sub-G { background: #6cbe45; }
.sub-J { background: #996633; }
.sub-Z { background: #996633; }
.sub-L { background: #a7a9ac; }
.sub-N { background: #fccc0a; color: #111; }
.sub-Q { background: #fccc0a; color: #111; }
.sub-R { background: #fccc0a; color: #111; }
.sub-W { background: #fccc0a; color: #111; }

/* ---------- FOOTER ---------- */
.colophon {
  max-width: var(--content); margin: 4rem auto 3rem; padding: 2rem var(--gutter) 0;
  border-top: 3px double var(--ink);
}
.colophon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 1.5rem; }
.colophon-grid p { font-size: var(--text-sm); color: var(--ink-2); }
.colophon-grid .kicker { margin-bottom: 0.4rem; }
.footer-fine { text-align: center; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: var(--text-xs); color: var(--ink-mute); font-family: var(--font-display); font-style: italic; }
.footer-brand { text-align: center; margin-top: 0.75rem; font-size: var(--text-xs); color: var(--ink-mute); font-family: var(--font-display); font-weight: 700; letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 0.4rem; justify-content: center; width: 100%; }
.footer-brand-mark { display: inline-flex; color: var(--ink); }
.footer-brand a { color: var(--ink-mute); text-decoration: none; }
.footer-brand a:hover { color: var(--accent); }

/* ---------- RESPONSIVE ---------- */

/* Tablet / narrow desktop — collapse two-col browse to single-col */
@media (max-width: 900px) {
  .zipouts-wordmark { font-size: 1.6rem; }
  .zipouts-mark { width: 32px; height: 32px; }
  .hero-grid { grid-template-columns: 1fr; }
  .section-head { grid-template-columns: 1fr; }
  .section-blurb { justify-self: start; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar .filter-group:first-child { grid-column: 1 / -1; }
  .commute-controls { grid-template-columns: 1fr; }
  .commute-arrow { display: none; }
  .route-summary { grid-template-columns: repeat(2, 1fr); }
  .colophon-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .home-picker { grid-template-columns: 1fr 1fr; }

  /* Browse layout — stack sidebar on top of results */
  .browse-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .browse-sidebar {
    position: static; max-height: none; overflow: visible;
    padding-right: 0; gap: 1rem;
  }
  #map { height: 300px; }
  .td-blurb { display: none; }

  /* Now section — stack head vertically */
  .now-head { grid-template-columns: 1fr; gap: 1rem; margin-bottom: 1rem; }
  .now-nbhd-block { padding: 0.85rem 1rem; }
  .now-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.85rem; }
}

/* Phone — tighten aggressively */
@media (max-width: 640px) {
  main { padding: 0 1rem 3rem; }

  /* Hero — downsize */
  .hero { padding: 1.5rem 0 1.75rem; }
  .hero-eyebrow { font-size: 0.68rem; }
  .hero h1 {
    font-size: clamp(1.75rem, 5.5vw, 2.4rem);
    line-height: 1.1; letter-spacing: -0.015em;
  }
  .lede { font-size: 0.98rem; line-height: 1.5; }
  .hero-stats { flex-wrap: wrap; gap: 1rem 1.5rem; padding-top: 1rem; }
  .stat-num { font-size: 1.75rem; }
  .stat-label { font-size: 0.65rem; margin-top: 0.2rem; }

  /* Section heads */
  .section-head h2 { font-size: 1.5rem; }
  .section-blurb { font-size: 0.9rem; max-width: 100%; }

  /* Now section */
  .now-section { padding: 1.1rem 1rem 1.15rem; margin: 1.5rem 0; }
  .now-head-left h2 {
    font-size: clamp(1.4rem, 5vw, 1.85rem);
    line-height: 1.1; margin: 0.35rem 0 0.55rem;
  }
  .now-lede { font-size: 0.9rem; line-height: 1.5; }
  .now-nbhd-block { padding: 0.75rem 0.85rem; }
  .home-picker-now { grid-template-columns: 1fr 1fr; gap: 0.35rem 0.6rem; }
  .home-picker-now label { font-size: 0.85rem; }
  .now-shortlist { font-size: 0.85rem; }

  /* Now tabs — 2x2 grid on phone so labels don't crush */
  .now-tabs { grid-template-columns: repeat(2, 1fr); }
  .now-tab { padding: 0.7rem 0.75rem; border-right: 1px solid var(--rule); }
  .now-tab:nth-child(2n) { border-right: none; }
  .now-tab:nth-child(1), .now-tab:nth-child(2) { border-bottom: 1px solid var(--rule); }
  .now-tab-label { font-size: 0.62rem; letter-spacing: 0.08em; }
  .now-tab-count { font-size: 1.15rem; }
  .now-tab-count::after { font-size: 0.58rem; }

  /* Now cards — single column, more compact */
  .now-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .now-card { min-height: 0; padding: 0.9rem 1rem 0.95rem; gap: 0.5rem; }
  .now-card-time-big { font-size: 1.35rem; }
  .now-card-status { font-size: 0.6rem; }
  .now-card-title { font-size: 1.05rem; }
  .now-card-venue { font-size: 0.85rem; }
  .now-card-blurb { font-size: 0.85rem; -webkit-line-clamp: 2; }
  .now-card-foot { gap: 0.4rem; padding-top: 0.5rem; }
  .now-card-cost { font-size: 0.88rem; }
  .now-card-dist { font-size: 0.65rem; }

  /* Browse — kill horizontal overflow */
  .browse-section { margin-top: 1.5rem; }
  .results-head { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .results-count { font-size: 1.05rem; }
  .results-caption { font-size: 0.85rem; }
  .sidebar-block { padding: 0.75rem 0.85rem 0.85rem; }
  .sidebar-kicker { font-size: 0.65rem; margin-bottom: 0.5rem; }

  /* Day strip — phone: 4 columns instead of 2 to fit vertically better */
  .day-strip { grid-template-columns: repeat(4, 1fr); gap: 0.2rem; }
  .day-cell { padding: 0.5rem 0.35rem; }
  .day-cell .day-num { font-size: 1rem; }
  .day-cell .day-dow { font-size: 0.58rem; }
  .day-cell .day-count { font-size: 0.58rem; }

  #map { height: 240px; }
  .map-legend, .map-caption { font-size: 0.65rem; padding: 0.3rem 0.5rem; }

  /* Cluster bubbles — slightly smaller on phone */
  .cluster-count { font-size: 0.85rem; }

  /* Table — horizontally scrollable OR stacked. Choose stacked for readability. */
  .listings-wrap { overflow-x: visible; }
  .listings { display: block; font-size: 0.85rem; }
  .listings thead { display: none; }
  .listings tbody { display: block; }
  .listings tr {
    display: grid;
    /* Fixed 3-column grid — date rail (~8rem), main content flex, play button.
     Fixed widths on cols 1 and 3 prevent long time strings (e.g. "10:00 AM - 5:00 PM (EVERY 30 MINS)")
     from starving the main content column. */
    grid-template-columns: minmax(6.5rem, 8rem) 1fr auto;
    gap: 0.4rem 0.75rem;
    padding: 0.85rem 0.85rem 0.9rem;
    border: 1px solid var(--rule);
    border-radius: 2px;
    margin-bottom: 0.6rem;
    background: var(--paper);
    align-items: start;
  }
  .listings tr:hover { background: var(--paper); }
  .listings td {
    display: block; padding: 0; border: none;
    min-width: 0;
  }
  /* Star: top-left */
  .listings td:nth-child(1) { grid-column: 1; grid-row: 1; }
  /* Date+time: below star (left column), spans through the run/cost rows */
  .listings td:nth-child(2) { grid-column: 1; grid-row: 2 / span 4; align-self: start; }
  /* Title+venue+blurb: right column, spans multiple rows */
  .listings td:nth-child(3) { grid-column: 2 / span 2; grid-row: 1; }
  /* Neighborhood */
  .listings td:nth-child(4) { grid-column: 2 / span 2; grid-row: 2; }
  .listings td:nth-child(4) .borough-pill { margin-left: 0.4rem; }
  /* Address — hide on phone */
  .listings td:nth-child(5) { display: none; }
  /* Type chip: its own full-width row so long category labels never collide
     with the run badge. Then run badge + cost share the row below. */
  .listings td:nth-child(6) {
    grid-column: 2 / span 2; grid-row: 3;
    display: block; min-width: 0;
  }
  .listings td:nth-child(6) .type-pill {
    display: inline-block;
    max-width: 100%;
    font-size: 0.62rem;
    padding: 0.15rem 0.5rem;
    letter-spacing: 0.06em;
    line-height: 1.25;
    white-space: normal;
    word-spacing: -0.02em;
    /* Break at slashes and spaces — not mid-word — so long labels
       ("MUSIC/DJ/NIGHTLIFE/SPORTS") wrap cleanly. */
    word-break: normal;
    overflow-wrap: break-word;
  }
  /* Run badge on row 4, cost on its own row 5. This avoids any collision
     when both would compete for the same narrow horizontal band. */
  .listings td:nth-child(7) {
    grid-column: 2 / span 2; grid-row: 4;
    justify-self: start; align-self: center;
  }
  .listings td:nth-child(7) .run-pill { flex-shrink: 0; }
  .listings td:nth-child(8) {
    grid-column: 2 / span 2; grid-row: 5;
    justify-self: start; align-self: center;
    padding-top: 0.15rem;
  }
  /* Source — hide on phone */
  .listings td:nth-child(9) { display: none; }
  /* Play button: top-right */
  .listings td:nth-child(10) { grid-column: 3; grid-row: 1; justify-self: end; padding-right: 0; width: auto; }

  .td-date { font-size: 0.95rem; }
  .td-time-big {
    font-size: 0.78rem;
    padding: 0.15rem 0.4rem;
    margin-top: 0.3rem;
    /* Long time strings must wrap inside the date rail instead of expanding it */
    white-space: normal;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .td-title { font-size: 1rem; line-height: 1.25; }
  .td-venue { font-size: 0.78rem; margin-top: 0.2rem; }
  .td-nbhd { font-size: 0.82rem; }
  .td-cost { font-size: 0.95rem; text-align: left; }

  /* Filter bar — stack on phone */
  .filter-bar { grid-template-columns: 1fr; padding: 0.6rem; gap: 0.55rem; }
  .filter-bar .filter-group:first-child { grid-column: 1; }
  .clear-btn { width: 100%; }

  /* Commute section */
  .commute-section { padding: 1.1rem 1rem; }
  .route-summary { grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; }
  .route-stat-num { font-size: 1.4rem; }
}

@media (max-width: 400px) {
  .day-strip { grid-template-columns: repeat(3, 1fr); }
  .now-tabs { grid-template-columns: repeat(2, 1fr); }
  .now-card-time-big { font-size: 1.25rem; }
}

@media print {
  .theme-toggle, .filter-bar, .commute-section, .colophon, .day-strip { display: none !important; }
  body { background: white; color: black; }
}

/* ---------- PLAY BUTTON ---------- */
.td-play { width: 44px; text-align: center; padding-left: 0.35rem !important; padding-right: 0.35rem !important; }
.play-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink-mute);
  background: transparent;
  transition: all 160ms ease;
}
.play-btn svg { margin-left: 2px; } /* optical centering of triangle */
.play-btn:hover {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.08);
}
.play-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- VIDEO MODAL ---------- */
.video-modal[hidden] { display: none; }
.video-modal {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  animation: modalFade 200ms ease;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.video-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 18, 14, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}
.video-panel {
  position: relative;
  width: min(960px, 100%);
  max-height: calc(100vh - 4rem);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: modalRise 240ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes modalRise { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.video-close {
  position: absolute; top: 0.6rem; right: 0.6rem; z-index: 2;
  width: 34px; height: 34px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(20, 18, 14, 0.7);
  color: white;
  border: none;
}
.video-close:hover { background: var(--accent); }
.video-frame-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
}
.video-frame-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.video-meta {
  padding: 1rem 1.4rem 1.15rem;
  border-top: 1px solid var(--rule);
  background: var(--paper);
}
.video-meta .kicker { margin-bottom: 0.35rem; }
.video-meta h3 {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.25rem;
}
.video-sub {
  font-size: var(--text-sm);
  color: var(--ink-mute);
  margin: 0;
  font-style: italic;
}

@media (max-width: 720px) {
  .video-modal { padding: 0; }
  .video-panel { border-radius: 0; max-height: 100vh; height: 100vh; }
  .video-meta { padding: 0.85rem 1rem 1rem; }
}
