/* ============================================================================
   USA Trip Companion v2 — Premium 2026 travel app
   Apple cleanliness + Airbnb warmth + Polarsteps travel emotion
   Neutral warm base · photos carry color · 1 brand + 1 accent
   ============================================================================ */

:root {
  /* TYPE — Inter primary, Fraunces for editorial moments (but sparingly) */
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --display: 'Fraunces', 'Instrument Serif', Georgia, serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* COLORS — warm neutrals, single brand + single accent */
  --bg: oklch(99% 0.003 80);           /* warm off-white */
  --bg-elev: oklch(100% 0 0);          /* pure white cards */
  --bg-elev-2: oklch(97% 0.004 80);    /* subtle stratum */
  --bg-warm: oklch(96% 0.008 60);      /* warm canvas for sections */

  --ink: oklch(18% 0.008 260);         /* graphite text */
  --ink-2: oklch(38% 0.008 260);
  --ink-3: oklch(58% 0.008 260);
  --ink-4: oklch(78% 0.008 260);

  --line: oklch(92% 0.005 260);
  --line-strong: oklch(85% 0.005 260);

  --brand: oklch(34% 0.08 230);        /* deep atlantic blue — the brand */
  --brand-soft: oklch(34% 0.08 230 / 0.08);
  --accent: oklch(62% 0.14 40);        /* terracotta CTA */
  --accent-soft: oklch(62% 0.14 40 / 0.1);

  /* Connector status tokens — unified across status pills, dots, warnings */
  --status-ok:    oklch(62% 0.13 155);  /* green   · fresh */
  --status-load:  oklch(68% 0.13 245);  /* blue    · in-flight */
  --status-stale: oklch(72% 0.13 85);   /* amber   · stale but usable */
  --status-off:   oklch(60% 0.02 260);  /* grey    · offline / cached */
  --status-err:   oklch(60% 0.20 25);   /* red     · error */

  --ok: oklch(55% 0.13 155);
  --warn: oklch(68% 0.15 70);

  /* SHADOWS — soft and subtle only */
  --sh-xs: 0 1px 2px oklch(0% 0 0 / 0.04);
  --sh-sm: 0 2px 6px oklch(0% 0 0 / 0.06), 0 1px 2px oklch(0% 0 0 / 0.04);
  --sh-md: 0 10px 30px -10px oklch(0% 0 0 / 0.12), 0 4px 8px oklch(0% 0 0 / 0.04);
  --sh-lg: 0 24px 60px -15px oklch(0% 0 0 / 0.18), 0 8px 20px oklch(0% 0 0 / 0.06);

  /* RADII */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  /* TIMING */
  --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-med: 260ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: oklch(14% 0.006 260);
  --bg-elev: oklch(17% 0.008 260);
  --bg-elev-2: oklch(21% 0.01 260);
  --bg-warm: oklch(16% 0.008 260);
  --ink: oklch(96% 0.005 80);
  --ink-2: oklch(74% 0.008 80);
  --ink-3: oklch(54% 0.01 80);
  --ink-4: oklch(36% 0.008 80);
  --line: oklch(28% 0.008 260);
  --line-strong: oklch(38% 0.008 260);
  --brand: oklch(72% 0.11 225);
  --brand-soft: oklch(72% 0.11 225 / 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}
button { font: inherit; border: none; background: none; color: inherit; cursor: pointer; text-align: inherit; }
input, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* Display text */
.display {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.025em;
  font-optical-sizing: auto;
  font-variation-settings: 'SOFT' 50, 'WONK' 0;
}
.mono {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500;
}

/* ============================================================================
   STAGE / PHONE FRAME
============================================================================ */
#phone {
  background: var(--bg);
  overflow: hidden;
}

/* Status bar */
.status-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 48px;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px 0;
  font-size: 14px; font-weight: 600;
  z-index: 100; pointer-events: none;
  color: var(--ink);
}
.status-bar .right { display: flex; gap: 6px; align-items: center; font-size: 13px; }

/* ============================================================================
   SCREEN CHROME — top nav, bottom nav, tab bar
============================================================================ */
.screen {
  flex: 1; min-height: 0;
  position: relative;
  overflow-y: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.screen::-webkit-scrollbar { display: none; }
.screen-inner { padding-bottom: 160px; }
.screen-inner.with-top { padding-top: 56px; }

/* Top bar — translucent glass over content */
.top-bar {
  position: sticky; top: 0; z-index: 50;
  padding: 48px 12px 10px;
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 8px;
  background: oklch(99% 0.003 80 / 0.85);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 0.5px solid transparent;
  transition: border-color var(--t-fast), background var(--t-fast);
}
[data-theme="dark"] .top-bar { background: oklch(14% 0.006 260 / 0.85); }
.top-bar.scrolled { border-bottom-color: var(--line); }

.top-bar.floating {
  position: absolute; top: 0; left: 0; right: 0;
  background: transparent; backdrop-filter: none;
}
.top-bar.floating .tb-title { opacity: 0; }

.tb-title {
  font-size: 15px; font-weight: 600; text-align: center;
  color: var(--ink);
  transition: opacity var(--t-fast);
}

/* Round icon button */
.rbtn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink);
  box-shadow: var(--sh-xs);
  transition: transform var(--t-fast), background var(--t-fast);
}
.rbtn:hover { background: var(--bg-elev-2); }
.rbtn:active { transform: scale(0.94); }
.rbtn.glass {
  background: oklch(0% 0 0 / 0.35);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-color: oklch(100% 0 0 / 0.15);
  color: white;
}
.rbtn svg { width: 17px; height: 17px; stroke-width: 2; }

.tb-actions { display: flex; gap: 6px; }

/* Now / Next bar — lives directly above the tab bar, always visible on main screens */
.now-next {
  position: absolute; left: 10px; right: 10px; bottom: 74px;
  background: oklch(100% 0 0 / 0.88);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  border: 0.5px solid var(--line);
  border-radius: 14px;
  padding: 8px 12px;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center;
  z-index: 89;
  box-shadow: var(--sh-md);
  text-align: left;
  transition: transform 200ms, opacity 200ms;
}
[data-theme="dark"] .now-next { background: oklch(20% 0.008 260 / 0.88); }
.now-next:active { transform: scale(0.995); }
.nn-left { display: grid; grid-template-columns: 14px 1fr; gap: 9px; align-items: center; min-width: 0; }
.nn-dot { position: relative; width: 14px; height: 14px; display: grid; place-items: center; }
.nn-dot-core {
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand);
  position: relative; z-index: 2;
}
.nn-dot-pulse {
  position: absolute; inset: 0;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--brand); opacity: 0.3;
  animation: nn-pulse 1.8s ease-out infinite;
}
@keyframes nn-pulse {
  0%   { transform: scale(0.5); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}
.nn-now, .nn-right { min-width: 0; }
.nn-eyebrow {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 1px;
}
.nn-mins { color: var(--brand); }
.nn-title {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.25;
}
.nn-arrow {
  color: var(--ink-4); font-size: 14px; font-weight: 400;
  padding: 0 2px;
}
.nn-right { text-align: right; }
.nn-right .nn-title { justify-self: end; }

/* Variants — tint eyebrow + title depending on trip phase */
.nn-v-pre-trip .nn-dot-core   { background: var(--status-stale); }
.nn-v-travel-day .nn-dot-core { background: var(--status-load); }
.nn-v-travel-day .nn-dot-pulse { display: none; }
.nn-v-in-trip .nn-dot-core    { background: var(--brand); }
.nn-v-post-trip .nn-dot-core  { background: var(--status-off); }
.nn-v-post-trip .nn-dot-pulse { display: none; }
.nn-v-empty .nn-dot-core      { background: var(--ink-4); }
.nn-v-empty .nn-dot-pulse     { display: none; }

/* Partial data — subtle dashed border left edge */
.now-next.nn-partial {
  border-left: 2px solid var(--status-stale);
  padding-left: 10px;
}

/* Offline pill — floats inside bar, right of content */
.nn-offline-pill {
  position: absolute; top: 6px; right: 10px;
  font-family: var(--mono); font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--status-off);
  background: color-mix(in oklch, var(--status-off) 14%, transparent);
  padding: 2px 6px; border-radius: 4px;
  pointer-events: none;
}
.now-next.nn-offline { padding-right: 68px; }

/* Loading skeleton — lines shimmer */
.now-next.nn-skeleton { pointer-events: none; }
.nn-sk-line {
  display: inline-block; width: 80%; height: 11px;
  background: linear-gradient(90deg, var(--bg-elev-2) 0%, var(--line) 50%, var(--bg-elev-2) 100%);
  background-size: 200% 100%;
  animation: nn-shimmer 1.2s linear infinite;
  border-radius: 3px;
  vertical-align: middle;
}
@keyframes nn-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Tab bar (bottom) */
.tab-bar {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  background: oklch(100% 0 0 / 0.88);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  border: 0.5px solid var(--line);
  border-radius: 28px;
  padding: 7px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
  z-index: 90;
  box-shadow: var(--sh-md);
}
[data-theme="dark"] .tab-bar { background: oklch(20% 0.008 260 / 0.88); }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px 6px; border-radius: 21px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--ink-3);
  transition: color var(--t-fast), background var(--t-fast);
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); }
.tab svg { width: 22px; height: 22px; stroke-width: 1.8; }

/* ============================================================================
   HOME — Airbnb × Apple Weather
============================================================================ */
.home-head {
  padding: 54px 22px 18px;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.home-greeting {
  font-size: 13px; color: var(--ink-3); margin-bottom: 2px;
  font-weight: 500;
}
.home-date {
  font-family: var(--display); font-size: 32px; line-height: 1.05;
  color: var(--ink);
}
.home-ava {
  width: 42px; height: 42px; border-radius: 50%;
  background-size: cover; background-position: center;
  border: 2px solid var(--bg-elev);
  box-shadow: var(--sh-sm);
}

/* Hero card — large cover */
.hero-card {
  margin: 0 16px;
  height: 440px;
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
  box-shadow: var(--sh-md);
  cursor: pointer;
}
.hero-card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 2s ease;
}
.hero-card:hover img { transform: scale(1.03); }
.hero-card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, oklch(0% 0 0 / 0.7) 100%);
  pointer-events: none;
}
.hero-card-content {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 24px;
  color: white;
  z-index: 1;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 20px;
  background: oklch(100% 0 0 / 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 14px;
}
.hero-kicker .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: oklch(90% 0.14 90);
  box-shadow: 0 0 10px oklch(90% 0.14 90);
}
.hero-title {
  font-family: var(--display);
  font-size: 48px; line-height: 0.98; font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  text-wrap: balance;
}
.hero-sub {
  font-size: 14px; line-height: 1.5;
  color: oklch(100% 0 0 / 0.82);
  max-width: 340px;
}

/* Day strip — 3 stats under hero */
.day-strip {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 16px 0;
}
.day-strip .cell {
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
  border-radius: var(--r-md);
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color var(--t-fast), transform var(--t-fast);
  box-shadow: var(--sh-xs);
}
.day-strip .cell:hover { border-color: var(--line-strong); }
.day-strip .cell:active { transform: scale(0.98); }
.day-strip .cell .mono { font-size: 10px; }
.day-strip .cell .v {
  font-family: var(--display); font-size: 22px; line-height: 1;
  color: var(--ink);
}

/* Sections */
.section {
  padding: 28px 22px 0;
}
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
}
.section-head h3 {
  font-family: var(--display);
  font-size: 26px; font-weight: 400; letter-spacing: -0.02em;
  color: var(--ink);
}
.section-head .action {
  font-size: 13px; color: var(--brand); font-weight: 600;
  display: inline-flex; align-items: center; gap: 2px;
}

/* Today events card */
.day-guide-text {
  font-size: 14px; line-height: 1.65; color: var(--ink-2);
  background: var(--bg-elev); border: 0.5px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 18px;
  box-shadow: var(--sh-xs);
}
.events-card {
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-xs);
}
.event-row {
  display: grid; grid-template-columns: 56px 1fr 22px;
  gap: 14px; align-items: center;
  padding: 14px 18px;
  transition: background var(--t-fast);
  width: 100%;
}
.event-row:hover { background: var(--bg-elev-2); }
.event-row + .event-row { border-top: 0.5px solid var(--line); }
.event-row .time {
  font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.event-row .title { font-size: 14.5px; font-weight: 500; color: var(--ink); }
.event-row .chev {
  color: var(--ink-4); opacity: 0;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.event-row:hover .chev { opacity: 1; transform: translateX(2px); }
.kind-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  display: inline-block; margin-right: 8px; vertical-align: middle;
}

/* Weather card — Apple-Weather-like */
.wx-card {
  margin: 0 22px;
  padding: 22px 24px;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, oklch(42% 0.09 230), oklch(58% 0.1 215) 60%, oklch(72% 0.11 200));
  color: white;
  position: relative; overflow: hidden;
  min-height: 180px;
  box-shadow: var(--sh-md);
}
.wx-card.sunny { background: linear-gradient(160deg, oklch(55% 0.14 45), oklch(68% 0.15 60) 60%, oklch(80% 0.14 80)); }
.wx-card.fog { background: linear-gradient(160deg, oklch(45% 0.02 260), oklch(60% 0.015 260) 60%, oklch(75% 0.01 260)); }
.wx-card.partly { background: linear-gradient(160deg, oklch(40% 0.07 230), oklch(58% 0.09 220) 60%, oklch(75% 0.08 210)); }
.wx-card::before {
  content: ''; position: absolute; top: -40%; right: -20%;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, oklch(100% 0 0 / 0.22), transparent 65%);
}
.wx-card .wc-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  position: relative; z-index: 1;
}
.wx-card .wc-loc {
  font-size: 14.5px; font-weight: 600;
  margin-bottom: 2px;
}
.wx-card .wc-date { font-size: 11.5px; opacity: 0.78; font-weight: 500; }
.wx-card .wc-glyph {
  font-size: 40px; line-height: 1; opacity: 0.95;
}
.wx-card .wc-temp {
  font-family: var(--display); font-size: 84px; line-height: 0.9; font-weight: 400;
  letter-spacing: -0.035em;
  margin-top: 16px; position: relative; z-index: 1;
}
.wx-card .wc-range {
  font-size: 12.5px; opacity: 0.85; margin-top: 6px; font-weight: 500;
  position: relative; z-index: 1;
}
.wx-card .wc-hint {
  margin-top: 16px; padding-top: 14px;
  border-top: 0.5px solid oklch(100% 0 0 / 0.18);
  display: flex; gap: 18px;
  position: relative; z-index: 1;
}
.wx-card .wc-hint .h { font-size: 12.5px; }
.wx-card .wc-hint .h-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0.7; margin-bottom: 3px;
}

/* Quick grid */
.quick-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.quick {
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-size: 10.5px; font-weight: 600;
  transition: background var(--t-fast), transform var(--t-fast), border-color var(--t-fast);
  padding: 8px;
  text-align: center;
  box-shadow: var(--sh-xs);
}
.quick:hover { background: var(--bg-elev-2); color: var(--ink); border-color: var(--line-strong); }
.quick:active { transform: scale(0.96); }
.quick svg { width: 20px; height: 20px; stroke-width: 1.7; color: var(--brand); }

/* Days scroller — Airbnb listing style */
.days-scroll {
  display: flex; gap: 12px;
  overflow-x: auto; scrollbar-width: none;
  padding: 0 22px 4px;
  scroll-snap-type: x mandatory;
}
.days-scroll::-webkit-scrollbar { display: none; }
.day-tile {
  flex-shrink: 0;
  width: 156px;
  scroll-snap-align: start;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  box-shadow: var(--sh-xs);
}
.day-tile:hover { transform: translateY(-2px); box-shadow: var(--sh-sm); }
.day-tile.is-today { border-color: var(--accent); }
.day-tile .img {
  height: 110px; background-size: cover; background-position: center;
  position: relative;
}
.day-tile .img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, oklch(0% 0 0 / 0.35) 100%);
}
.day-tile .badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 8px; border-radius: 20px;
  background: oklch(100% 0 0 / 0.95);
  font-family: var(--mono); font-size: 9px; font-weight: 700; color: var(--ink);
  text-transform: uppercase; letter-spacing: 0.06em;
  z-index: 1;
}
.day-tile.is-today .badge { background: var(--accent); color: white; }
.day-tile .body { padding: 12px 14px 14px; }
.day-tile .place { font-size: 14px; font-weight: 600; line-height: 1.15; margin-bottom: 3px; color: var(--ink); }
.day-tile .date { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }

/* ============================================================================
   MAP — Apple Maps cleanliness
============================================================================ */
.map-screen {
  position: relative; width: 100%; height: 100%;
  overflow: hidden;
  background: oklch(93% 0.006 200); /* cool gray-blue map base */
}
[data-theme="dark"] .map-screen { background: oklch(13% 0.008 230); }
.map-canvas { position: absolute; inset: 0; }
.map-svg { width: 100%; height: 100%; }

/* Day chips — top scroll */
.day-chips {
  position: absolute; top: 56px; left: 0; right: 0;
  padding: 0 14px;
  display: flex; gap: 6px; overflow-x: auto;
  scrollbar-width: none;
  z-index: 20;
}
.day-chips::-webkit-scrollbar { display: none; }
.day-chip {
  flex-shrink: 0;
  padding: 8px 13px; border-radius: 100px;
  background: oklch(100% 0 0 / 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid var(--line);
  font-size: 12px; font-weight: 600;
  color: var(--ink-2); white-space: nowrap;
  box-shadow: var(--sh-sm);
  transition: all var(--t-fast);
}
[data-theme="dark"] .day-chip { background: oklch(20% 0.008 260 / 0.95); }
.day-chip:hover { color: var(--ink); }
.day-chip.active { background: var(--brand); color: white; border-color: var(--brand); }
.day-chip .dn {
  font-family: var(--mono); font-size: 9px;
  color: var(--ink-3); margin-right: 6px; font-weight: 700;
}
.day-chip.active .dn { color: oklch(100% 0 0 / 0.85); }

/* Map pin — Apple Maps style teardrop */
.pin-v2 {
  position: absolute; transform: translate(-50%, -100%);
  z-index: 10; pointer-events: auto;
  transition: transform var(--t-med);
}
.pin-v2 .p-shape {
  width: 26px; height: 33px;
  position: relative;
  filter: drop-shadow(0 3px 6px oklch(0% 0 0 / 0.3));
}
.pin-v2 .p-shape svg { width: 100%; height: 100%; }
.pin-v2 .p-inner-num {
  position: absolute; top: 8px; left: 0; right: 0; text-align: center;
  font-family: var(--mono); font-size: 10px; font-weight: 700; color: white;
}
.pin-v2:hover { transform: translate(-50%, -100%) scale(1.08); }
.pin-v2.active { z-index: 15; transform: translate(-50%, -100%) scale(1.15); }

.pin-label-v2 {
  position: absolute; transform: translate(-50%, 0);
  padding: 4px 10px; border-radius: 8px;
  background: oklch(100% 0 0 / 0.95);
  backdrop-filter: blur(16px);
  border: 0.5px solid var(--line);
  font-size: 11px; font-weight: 600; color: var(--ink);
  white-space: nowrap; pointer-events: none;
  box-shadow: var(--sh-xs);
  z-index: 9;
}
[data-theme="dark"] .pin-label-v2 { background: oklch(22% 0.008 260 / 0.95); }
.pin-label-v2.active { background: var(--brand); color: white; border-color: var(--brand); }

/* Bottom sheet */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 84px;
  background: var(--bg-elev);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-top: 0.5px solid var(--line);
  box-shadow: 0 -24px 60px -20px oklch(0% 0 0 / 0.25);
  z-index: 30;
  max-height: 60%;
  overflow-y: auto;
  scrollbar-width: none;
  animation: slide-up var(--t-med);
}
.sheet::-webkit-scrollbar { display: none; }
@keyframes slide-up {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet-handle {
  width: 38px; height: 4px; border-radius: 2px;
  background: var(--line-strong);
  margin: 9px auto 10px;
}
.sheet-hero {
  height: 190px; margin: 0 14px 16px;
  border-radius: var(--r-md); overflow: hidden;
  position: relative; cursor: zoom-in;
}
.sheet-hero img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-med); }
.sheet-hero:hover img { transform: scale(1.05); }
.sheet-body { padding: 0 22px 24px; }
.sheet-title {
  font-family: var(--display); font-size: 30px; font-weight: 400;
  line-height: 1; letter-spacing: -0.02em;
  margin-bottom: 5px;
}
.sheet-meta {
  font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; font-weight: 500;
}
.sheet-weather {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--bg-warm);
  border-radius: var(--r-md);
  font-size: 13px;
}
.sheet-weather .gly { font-size: 22px; }
.sheet-weather .temps { font-weight: 600; color: var(--ink); }
.sheet-weather .summ { color: var(--ink-3); }
.sheet-actions {
  display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 6px;
  margin-bottom: 16px;
}
.sa-btn {
  padding: 11px; border-radius: var(--r-md);
  background: var(--bg-elev-2); border: 0.5px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--t-fast);
}
.sa-btn:hover { background: var(--line); }
.sa-btn.primary { background: var(--brand); border-color: var(--brand); color: white; }
.sa-btn.primary:hover { background: oklch(from var(--brand) calc(l - 0.05) c h); }
.sa-btn.icon-only { width: 44px; padding: 11px 0; }
.sa-btn svg { width: 14px; height: 14px; stroke-width: 2; }
.highlights {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}
.highlight-chip {
  padding: 6px 10px;
  background: var(--bg-warm);
  border-radius: 8px;
  font-size: 12px; font-weight: 500;
  color: var(--ink-2);
}

/* ============================================================================
   PLACE DETAIL
============================================================================ */
.place-hero {
  height: 380px; position: relative; overflow: hidden;
  margin-bottom: 0;
}
.place-hero img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.place-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, oklch(0% 0 0 / 0.5) 0%, transparent 40%, transparent 60%, oklch(0% 0 0 / 0.75) 100%);
}
.place-hero-content {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 24px; color: white; z-index: 1;
}
.place-hero-content .mono { color: oklch(100% 0 0 / 0.85); margin-bottom: 10px; }
.place-hero-content .title {
  font-family: var(--display);
  font-size: 54px; line-height: 0.95; font-weight: 400;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  text-wrap: balance;
}
.place-hero-content .region {
  font-size: 13px; color: oklch(100% 0 0 / 0.8); font-weight: 500;
}

/* Tab nav within place */
.place-tabs {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 0.5px solid var(--line);
  display: flex; gap: 0;
  padding: 0 16px;
  overflow-x: auto; scrollbar-width: none;
}
.place-tab {
  padding: 14px 14px 12px;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.place-tab:hover { color: var(--ink-2); }
.place-tab.active { color: var(--ink); border-bottom-color: var(--accent); }

/* Gallery */
.gallery {
  padding: 22px 16px 6px;
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  grid-auto-rows: 128px;
  gap: 4px;
  border-radius: var(--r-md);
}
.gallery .g-item {
  overflow: hidden; cursor: zoom-in;
  background: var(--bg-elev-2);
  transition: transform var(--t-fast);
}
.gallery .g-item:hover { transform: scale(0.99); }
.gallery .g-item:first-child {
  grid-row: span 2;
  border-radius: var(--r-md) 0 0 var(--r-md);
}
.gallery .g-item:nth-child(2) { border-radius: 0 var(--r-md) 0 0; }
.gallery .g-item:nth-child(3) { border-radius: 0; }
.gallery .g-item:nth-child(4) { border-radius: 0; }
.gallery .g-item:nth-child(5) { border-radius: 0 0 var(--r-md) 0; }
.gallery img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--t-med);
}
.gallery .g-item:hover img { transform: scale(1.08); }
.gallery .g-more {
  position: relative;
}
.gallery .g-more::after {
  content: 'See all';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: oklch(0% 0 0 / 0.45);
  backdrop-filter: blur(4px);
  color: white; font-size: 13px; font-weight: 600;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: oklch(3% 0 0 / 0.97);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  animation: fadein var(--t-med);
}
@keyframes fadein { from { opacity: 0 } to { opacity: 1 } }
.lightbox img {
  max-width: 94%; max-height: 72%;
  border-radius: 8px;
  box-shadow: 0 40px 100px oklch(0% 0 0 / 0.7);
  animation: zoomin var(--t-med);
}
@keyframes zoomin { from { transform: scale(0.95); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.lightbox .lb-caption {
  position: absolute; bottom: 44px; left: 0; right: 0;
  text-align: center; color: oklch(98% 0 0 / 0.9);
  font-family: var(--display); font-size: 18px; padding: 0 40px;
}
.lightbox .lb-close {
  position: absolute; top: 20px; right: 20px;
  width: 40px; height: 40px; border-radius: 50%;
  background: oklch(100% 0 0 / 0.14);
  color: white;
  display: flex; align-items: center; justify-content: center;
  border: 0.5px solid oklch(100% 0 0 / 0.2);
}
.lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: oklch(100% 0 0 / 0.14);
  color: white;
  display: flex; align-items: center; justify-content: center;
  border: 0.5px solid oklch(100% 0 0 / 0.2);
}
.lightbox .lb-nav.prev { left: 20px; }
.lightbox .lb-nav.next { right: 20px; }

/* Tip cards / must-eat / slang */
.tip-card {
  margin: 8px 0;
  padding: 16px 18px;
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
  border-radius: var(--r-md);
  font-size: 13.5px; line-height: 1.55; color: var(--ink-2);
  box-shadow: var(--sh-xs);
}
.tip-card .tk-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em;
  color: var(--brand); margin-bottom: 6px; font-weight: 700;
}

.eat-card {
  padding: 16px 18px;
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
  margin-bottom: 10px;
}
.eat-card-nav { cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.eat-card-nav:hover, .eat-card-nav:active { border-color: var(--brand); background: color-mix(in oklch, var(--brand) 5%, var(--bg-elev)); }
.nearby-nav-arrow { color: var(--brand); flex-shrink: 0; opacity: 0.8; }
.eat-card .nm {
  font-size: 15px; font-weight: 600; color: var(--ink);
  margin-bottom: 4px;
}
.eat-card .why { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin-bottom: 8px; }
.eat-card .meta { display: flex; gap: 10px; align-items: center; }
.eat-card .price {
  font-family: var(--mono); font-size: 10px; color: var(--accent);
  font-weight: 700; letter-spacing: 0.04em;
}
.eat-card .badge {
  font-family: var(--mono); font-size: 9px; padding: 2px 6px; border-radius: 4px;
  background: var(--brand-soft); color: var(--brand);
  font-weight: 700;
}

/* Slang */
.slang-item {
  padding: 14px 22px;
  border-bottom: 0.5px solid var(--line);
}
.slang-item .term {
  font-family: var(--mono); font-size: 13px; color: var(--brand);
  font-weight: 700; margin-bottom: 4px;
}
.slang-item .means {
  font-size: 14px; color: var(--ink); margin-bottom: 5px; font-weight: 500;
}
.slang-item .ex {
  font-family: var(--display); font-style: italic;
  font-size: 14px; color: var(--ink-3); line-height: 1.4;
}

/* Weather list */
.wx-row {
  display: grid; grid-template-columns: 50px 1fr 80px 44px;
  gap: 12px; align-items: center;
  padding: 14px 22px;
  border-bottom: 0.5px solid var(--line);
  transition: background var(--t-fast);
}
.wx-row:hover { background: var(--bg-warm); cursor: pointer; }
.wx-row .daynum {
  font-family: var(--display); font-size: 26px;
  color: var(--ink-2); font-weight: 400; line-height: 1;
}
.wx-row .place { font-size: 14.5px; font-weight: 600; line-height: 1.2; margin-bottom: 3px; }
.wx-row .cond { font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.wx-row .range {
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-2);
  font-weight: 600; text-align: right;
}
.wx-row .glyph { font-size: 22px; text-align: center; }
.wx-row.empty .place { color: var(--ink-3); font-style: italic; font-weight: 500; }

/* Team / leaderboard */
.team-grid {
  padding: 0 16px;
  display: grid; gap: 10px;
}
.team-card {
  display: grid; grid-template-columns: 28px 60px 1fr auto;
  gap: 14px; align-items: center;
  background: var(--bg-elev); border: 0.5px solid var(--line);
  border-radius: var(--r-md); padding: 14px 18px;
  box-shadow: var(--sh-xs);
  transition: transform var(--t-fast);
}
.team-card:hover { transform: translateX(2px); }
.team-card .rank {
  font-family: var(--display); font-size: 28px;
  color: var(--ink-3); line-height: 1; font-weight: 400;
}
.team-card.p1 .rank { color: var(--accent); }
.team-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background-size: cover; background-position: center;
  box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 3.5px var(--_c, var(--brand));
}
.team-card .body { min-width: 0; }
.team-card .nm {
  font-size: 15px; font-weight: 600; color: var(--ink);
  margin-bottom: 2px;
}
.team-card .ro { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.team-card .photos { text-align: right; }
.team-card .photos .big {
  font-family: var(--display); font-size: 28px;
  color: var(--ink); line-height: 1; font-weight: 400;
}
.team-card .photos .lbl {
  font-family: var(--mono); font-size: 9px; color: var(--ink-3);
  text-transform: uppercase; margin-top: 3px; font-weight: 700;
}

/* Challenge */
.challenge {
  margin: 0 16px 10px;
  padding: 18px 20px;
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
}
.challenge .ch-kind {
  font-family: var(--mono); font-size: 9px;
  color: var(--accent); letter-spacing: 0.08em;
  margin-bottom: 10px; font-weight: 700;
}
.challenge .ch-title {
  font-family: var(--display); font-size: 22px; font-weight: 400;
  line-height: 1.1; margin-bottom: 4px; letter-spacing: -0.015em;
}
.challenge .ch-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 12px; font-weight: 500; }
.challenge .ch-rule {
  font-size: 13px; color: var(--ink-2); line-height: 1.55;
  padding-top: 12px; border-top: 0.5px solid var(--line);
}

/* Bingo */
.bingo {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  margin-top: 12px;
}
.bingo .sq {
  aspect-ratio: 1; padding: 6px;
  background: var(--bg-elev-2); border-radius: 8px;
  font-size: 9px; color: var(--ink-2); font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  text-align: center; line-height: 1.2;
  cursor: pointer;
  transition: all var(--t-fast);
}
.bingo .sq:hover { background: var(--line); }
.bingo .sq.checked {
  background: var(--accent); color: white;
  text-decoration: line-through;
  text-decoration-color: oklch(100% 0 0 / 0.55);
}

/* Checklist */
.check-cat {
  padding: 24px 22px 8px;
  font-family: var(--display); font-size: 22px; font-weight: 400;
  letter-spacing: -0.015em;
}
.check-items {
  margin: 0 16px;
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-xs);
}
.check-item {
  display: flex; gap: 14px; align-items: center;
  padding: 13px 16px;
  cursor: pointer;
  transition: background var(--t-fast);
}
.check-item + .check-item { border-top: 0.5px solid var(--line); }
.check-item:hover { background: var(--bg-elev-2); }
.check-box {
  width: 22px; height: 22px; border-radius: 7px;
  border: 1.5px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.check-box.on { background: var(--brand); border-color: var(--brand); }
.check-box.on::after {
  content: ''; width: 5px; height: 10px;
  border: solid white; border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
.check-item .lbl { font-size: 14px; color: var(--ink); flex: 1; font-weight: 500; }
.check-item.on .lbl { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }

/* Empty state */
.empty {
  padding: 60px 40px;
  text-align: center;
  color: var(--ink-3);
}
.empty h4 {
  font-family: var(--display); font-size: 22px; font-weight: 400;
  color: var(--ink-2); margin-bottom: 8px;
}
.empty p { font-size: 13.5px; line-height: 1.5; }

/* Tweaks */
.tweaks {
  position: fixed; bottom: 20px; right: 20px;
  width: 300px; background: var(--bg-elev);
  border: 0.5px solid var(--line); border-radius: var(--r-lg);
  padding: 18px;
  z-index: 150;
  box-shadow: var(--sh-lg);
  display: none;
}
.tweaks.open { display: block; }
.tweaks h4 { font-family: var(--display); font-size: 18px; margin-bottom: 14px; font-weight: 400; }
.tw-row { margin-bottom: 14px; }
.tw-row .mono { display: block; margin-bottom: 6px; }
.tw-pill-grp { display: flex; gap: 4px; flex-wrap: wrap; }
.tw-pill {
  padding: 7px 11px; border-radius: 8px;
  background: var(--bg-elev-2); border: 0.5px solid var(--line);
  font-size: 11px; color: var(--ink-2); font-weight: 600;
}
.tw-pill.on { background: var(--brand); color: white; border-color: var(--brand); }
.tweaks-toggle {
  position: fixed; bottom: 20px; right: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-elev); border: 0.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  z-index: 140;
  box-shadow: var(--sh-md);
}
.tweaks-toggle svg { width: 18px; height: 18px; color: var(--ink-2); }

/* ============================================================================
   ACCESS GATE — pre-app authorization layer
============================================================================ */
.ag-root {
  position: absolute; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 24px;
  overflow-y: auto;
  border-radius: inherit;
}

/* Member picker layout */
.ag-picker-root {
  position: relative; z-index: 1;
  width: 100%; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.ag-members {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; width: 100%; max-width: 320px;
  margin-bottom: 24px;
}
.ag-member {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px 14px;
  background: var(--bg-elev); border: 1.5px solid transparent;
  border-radius: 18px; box-shadow: var(--sh-xs);
  transition: all 200ms; cursor: pointer;
}
.ag-member:hover:not(:disabled) {
  border-color: var(--brand);
  background: color-mix(in oklch, var(--brand) 6%, var(--bg-elev));
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}
.ag-member:active:not(:disabled) { transform: scale(0.97); }
.ag-member.ag-member-selecting {
  border-color: var(--brand);
  background: color-mix(in oklch, var(--brand) 8%, var(--bg-elev));
}
.ag-member:disabled { opacity: 0.5; }

.ag-avatar-wrap {
  position: relative; width: 72px; height: 72px;
}
.ag-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; display: block;
  border: 2.5px solid var(--line);
}
.ag-avatar-fallback {
  display: none;
  width: 72px; height: 72px; border-radius: 50%;
  align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: white;
}
.ag-avatar-spinner {
  position: absolute; inset: -4px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: oklch(0% 0 0 / 0.35);
}
.ag-spinner {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: white;
  animation: spin 0.7s linear infinite;
}
.ag-member-name {
  font-size: 15px; font-weight: 700; color: var(--ink);
}
.ag-member-role {
  font-size: 10px; color: var(--ink-3); font-weight: 500;
  letter-spacing: 0.02em; line-height: 1.3;
}
.ag-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: 0.9;
}
.ag-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 360px;
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
  border-radius: 22px;
  padding: 28px 24px 22px;
  box-shadow: var(--sh-lg);
  text-align: center;
}
.ag-brand { margin-bottom: 22px; }
.ag-brand-mark {
  font-family: var(--display); font-size: 28px; font-weight: 400;
  color: var(--brand); letter-spacing: -0.01em;
}
.ag-brand-sub {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.09em;
  color: var(--ink-3); margin-top: 2px; text-transform: uppercase;
}
.ag-title {
  font-family: var(--display); font-size: 22px; font-weight: 400;
  color: var(--ink); margin-bottom: 6px; letter-spacing: -0.01em;
}
.ag-sub {
  font-size: 13px; color: var(--ink-2); line-height: 1.5;
  margin-bottom: 22px;
}
.ag-pin { display: flex; gap: 10px; justify-content: center; margin-bottom: 16px; }
.ag-pin-cell {
  width: 52px; height: 58px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--bg);
  font-size: 24px; font-weight: 600; text-align: center;
  color: var(--ink); font-family: var(--mono);
  transition: all 160ms;
}
.ag-pin-cell:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.ag-pin-cell.filled { background: var(--bg-elev-2); }
.ag-pin-cell:disabled { opacity: 0.5; }

.ag-msg {
  font-size: 12px; font-weight: 600; margin-bottom: 12px;
  padding: 8px 12px; border-radius: 8px; display: inline-block;
}
.ag-msg-info   { color: var(--status-load); background: color-mix(in oklch, var(--status-load) 10%, transparent); }
.ag-msg-err    { color: var(--status-err);  background: color-mix(in oklch, var(--status-err) 10%, transparent); }
.ag-msg-locked { color: var(--status-stale);background: color-mix(in oklch, var(--status-stale) 12%, transparent); }

.ag-submit {
  width: 100%; padding: 13px;
  background: var(--brand); color: white;
  border-radius: 12px; font-weight: 600; font-size: 14px;
  transition: all 160ms;
  margin-top: 4px;
}
.ag-submit:disabled { opacity: 0.4; }
.ag-submit:not(:disabled):hover { background: oklch(from var(--brand) calc(l - 0.05) c h); }
.ag-submit:not(:disabled):active { transform: scale(0.985); }

.ag-footer { margin-top: 20px; padding-top: 16px; border-top: 0.5px solid var(--line); }
.ag-foot-row {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--ink-3);
}
.ag-dot { width: 6px; height: 6px; border-radius: 50%; }

@keyframes ag-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ============================================================
   PHOTO QUEST — cq-* (challenges screen), qs-* (slot cards),
   qc-* (capture sheet + confetti overlay)
   ============================================================ */

/* Sync pill */
.cq-sync { display: flex; align-items: center; }
.cq-sync-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 20px;
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 0.06em;
  background: color-mix(in oklch, var(--status-ok) 12%, transparent);
  color: var(--status-ok);
}
.cq-sync-pill.offline { background: color-mix(in oklch, var(--status-err) 12%, transparent); color: var(--status-err); }
.dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* Day chip strip */
.cq-day-strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 16px 12px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.cq-day-strip::-webkit-scrollbar { display: none; }

.cq-day-chip {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 10px 6px; border-radius: 14px;
  background: var(--bg-elev); border: 1.5px solid transparent;
  transition: all var(--t-fast);
}
.cq-day-chip.active { border-color: var(--brand); background: color-mix(in oklch, var(--brand) 8%, var(--bg-elev)); }
.cq-day-n { font-family: var(--mono); font-size: 9px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.08em; }
.cq-day-ring { position: relative; width: 36px; height: 36px; }
.cq-day-pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--ink-1);
}
.cq-day-badge {
  font-size: 9px; color: var(--status-ok); font-weight: 800;
  background: color-mix(in oklch, var(--status-ok) 14%, transparent);
  border-radius: 8px; padding: 1px 4px;
}

/* Day header */
.cq-day-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 20px 12px; gap: 12px;
}
.cq-day-head-left { flex: 1; min-width: 0; }
.cq-day-head-eyebrow {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  color: var(--ink-3); letter-spacing: 0.08em; margin-bottom: 3px;
}
.cq-day-head-title {
  font-family: var(--display); font-size: 20px; font-weight: 400;
  letter-spacing: -0.015em; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cq-day-head-right { display: flex; flex-direction: column; align-items: center; gap: 3px; flex-shrink: 0; }
.cq-day-head-count { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.cq-day-head-count strong { font-size: 18px; color: var(--ink-1); }

/* Split counters */
.cq-split {
  display: flex; align-items: center;
  margin: 0 16px 16px; padding: 12px 0;
  background: var(--bg-elev); border: 0.5px solid var(--line);
  border-radius: var(--r-md); overflow: hidden;
}
.cq-split-cell { flex: 1; text-align: center; padding: 4px 0; }
.cq-split-divider { width: 0.5px; height: 36px; background: var(--line); }
.cq-split-n { font-size: 20px; font-weight: 700; color: var(--ink-1); line-height: 1; }
.cq-split-label { font-size: 10px; color: var(--ink-3); font-weight: 600; margin-top: 3px; letter-spacing: 0.04em; text-transform: uppercase; }

/* Leaderboard */
.cq-leader {
  margin: 0 16px 8px; padding: 14px 16px;
  background: var(--bg-elev); border: 0.5px solid var(--line);
  border-radius: var(--r-md);
}
.cq-leader-head { font-size: 11px; font-weight: 600; color: var(--ink-3); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.cq-leader-row { display: flex; gap: 4px; }
.cq-leader-cell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.cq-leader-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
}
.cq-leader-n { font-size: 16px; font-weight: 700; line-height: 1; }
.cq-leader-name { font-size: 10px; color: var(--ink-3); font-weight: 500; }
.cq-leader-crown { position: absolute; top: -8px; right: calc(50% - 22px); font-size: 12px; }

/* Section count badge */
.cq-section-count {
  font-size: 12px; font-weight: 700; color: var(--brand);
  background: color-mix(in oklch, var(--brand) 12%, transparent);
  padding: 3px 8px; border-radius: 8px;
}

/* Slots container */
.cq-slots { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }

/* Slot card */
.qs-slot {
  padding: 14px 16px;
  background: var(--bg-elev); border: 0.5px solid var(--line);
  border-radius: var(--r-md); transition: border-color var(--t-fast);
}
.qs-slot.qs-filled { border-color: color-mix(in oklch, var(--brand) 35%, var(--line)); }
.qs-slot.qs-mine { border-color: color-mix(in oklch, var(--brand) 50%, var(--line)); background: color-mix(in oklch, var(--brand) 4%, var(--bg-elev)); }
.qs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.qs-title { font-size: 14px; font-weight: 600; line-height: 1.35; flex: 1; }
.qs-check { font-size: 12px; color: var(--status-ok); font-weight: 800; flex-shrink: 0; }
.qs-assignee { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: white; flex-shrink: 0; }
.qs-mytask-label { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--brand); text-transform: uppercase; margin-bottom: 6px; }
.qs-hint { font-size: 12px; color: var(--ink-3); margin-bottom: 10px; line-height: 1.45; }
.qs-thumbs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.qs-thumb {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--bg-elev-2) center/cover no-repeat;
  border: 1.5px solid var(--line); position: relative; overflow: hidden;
  flex-shrink: 0;
}
.qs-thumb.qs-status-uploaded { border-color: color-mix(in oklch, var(--status-ok) 50%, var(--line)); }
.qs-thumb.qs-status-offline-queued { opacity: 0.7; }
.qs-thumb-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: var(--ink-4); font-family: var(--mono);
}
.qs-thumb-overlay {
  position: absolute; inset: 0; background: oklch(0% 0 0 / 0.45);
  display: flex; align-items: center; justify-content: center;
}
.qs-thumb-who {
  position: absolute; bottom: 2px; right: 2px;
  width: 10px; height: 10px; border-radius: 50%; border: 1px solid white;
}
.qs-add {
  width: 44px; height: 44px; border-radius: 10px;
  border: 1.5px dashed var(--line-strong);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--ink-3); transition: all var(--t-fast);
  flex-shrink: 0;
}
.qs-add span { font-size: 8px; font-weight: 600; letter-spacing: 0.04em; }
.qs-add:hover, .qs-add.mine { border-color: var(--brand); color: var(--brand); background: color-mix(in oklch, var(--brand) 7%, transparent); }
.qs-add.qs-add-primary { border-style: solid; border-color: var(--brand); background: var(--brand); color: white; width: auto; padding: 0 14px; }
.qs-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: white;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Capture sheet */
.qc-sheet-backdrop {
  position: absolute; inset: 0; background: oklch(0% 0 0 / 0.55);
  display: flex; align-items: flex-end; z-index: 300;
}
.qc-sheet {
  width: 100%; background: var(--bg); border-radius: 20px 20px 0 0;
  padding: 16px 20px 32px; max-height: 88%;
  overflow-y: auto;
}
.qc-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.qc-sheet-kind {
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: 6px; color: var(--brand);
}
.qc-close { font-size: 15px; color: var(--ink-3); padding: 4px 8px; }
.qc-title { font-size: 17px; font-weight: 600; line-height: 1.3; margin-bottom: 6px; }
.qc-hint { font-size: 13px; color: var(--ink-3); margin-bottom: 16px; line-height: 1.5; }
.qc-preview { width: 100%; border-radius: 12px; object-fit: cover; max-height: 260px; margin-bottom: 14px; }
.qc-actions { display: flex; gap: 10px; }
.qc-btn-primary {
  flex: 1; padding: 13px; border-radius: 12px;
  background: var(--brand); color: white; font-weight: 600; font-size: 14px;
  transition: all 160ms;
}
.qc-btn-primary:hover { background: oklch(from var(--brand) calc(l - 0.05) c h); }
.qc-btn-primary:active { transform: scale(0.985); }
.qc-btn-secondary {
  flex: 0 0 auto; padding: 13px 18px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); color: var(--ink-1); font-weight: 600; font-size: 14px;
  transition: all 160ms;
}
.qc-empty { text-align: center; color: var(--ink-3); font-size: 14px; padding: 32px 0; }

/* Confetti + badge overlay */
.qc-confetti-root {
  position: absolute; inset: 0; z-index: 400;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: oklch(0% 0 0 / 0.72);
}
.qc-confetti-field { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.qc-confetti-piece {
  position: absolute; top: -10px;
  width: 8px; height: 8px; border-radius: 2px;
  animation: confetti-fall 1.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  opacity: 0;
}
@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(480deg); opacity: 0; }
}
.qc-confetti-card {
  background: var(--bg); border-radius: 24px; padding: 32px 28px;
  width: 76%; text-align: center; position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: 0 24px 64px oklch(0% 0 0 / 0.4);
}
.qc-badge { margin-bottom: 4px; }
.qc-confetti-eyebrow {
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--brand);
}
.qc-confetti-title { font-family: var(--display); font-size: 42px; font-weight: 400; letter-spacing: -0.03em; line-height: 1; }
.qc-confetti-sub { font-size: 14px; color: var(--ink-3); margin-bottom: 8px; }

/* Photo Quest tile on Home */
.pq-home-tile {
  margin: 0 16px 16px;
  padding: 14px 16px;
  background: var(--bg-elev); border: 0.5px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--sh-xs);
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: background var(--t-fast);
}
.pq-home-tile:hover { background: var(--bg-elev-2); }
.pq-home-tile-ring { flex-shrink: 0; position: relative; width: 48px; height: 48px; }
.pq-home-tile-count {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--ink-1);
}
.pq-home-tile-body { flex: 1; min-width: 0; }
.pq-home-tile-label { font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 2px; }
.pq-home-tile-title { font-size: 15px; font-weight: 600; line-height: 1.25; }
.pq-home-tile-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.pq-home-tile-chev { color: var(--ink-4); flex-shrink: 0; }

/* Quest badge on tab bar */
.tab-badge {
  position: absolute; top: 2px; right: calc(50% - 20px);
  background: var(--brand); color: white;
  font-family: var(--mono); font-size: 8px; font-weight: 800;
  padding: 1px 4px; border-radius: 6px; line-height: 1.4;
  min-width: 14px; text-align: center;
}

/* Member colors — must match TEAM[].id in data-v2.js */
:root {
  --mcolor-robert: oklch(65% 0.15  45);
  --mcolor-ola:    oklch(65% 0.15 140);
  --mcolor-ala:    oklch(65% 0.15 340);
  --mcolor-pola:   oklch(60% 0.15 280);
}
.ag-shake .ag-card { animation: ag-shake 380ms; }
