:root {
  --bg: #0c0c0f;
  --surface: #161619;
  --card: #1a1a1f;
  --border: #2a2a30;
  --text: #e8e6e3;
  --muted: #7a7875;
  --accent: #c9a87c;
  --red: #e85d5d;
  --blue: #5b8def;
  --green: #5dcc7e;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --card-w: min(400px, calc(100vw - 32px));
  --card-h: min(620px, calc(100dvh - 180px));
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Picker ───────────────────────────────────────────── */

#picker {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100dvh; position: relative; overflow: hidden;
}

/* ── Marquee Background ───────────────────────────────── */

.picker-grain {
  position: absolute; inset: 0; z-index: 1; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.picker-inner {
  text-align: center; z-index: 2; width: 100%; max-width: 420px;
}

.picker-brand {
  font-family: var(--serif); font-size: 52px; letter-spacing: -0.02em;
  color: var(--text);
}
.picker-brand em { color: var(--accent); font-style: italic; }
.picker-brand.compact {
  position: fixed; top: 20px; left: 0; right: 0;
  font-size: 52px; z-index: 10;
}

.picker-sub {
  font-size: 15px; color: var(--muted); margin-top: 4px; letter-spacing: 0.02em;
  font-weight: 300;
}

.picker-divider {
  width: 40px; height: 1px; background: var(--border);
  margin: 32px auto;
}

.picker-prompt {
  font-size: 13px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.12em; margin-bottom: 20px;
}

.picker-buttons { display: flex; gap: 20px; justify-content: center; }

.picker-btn {
  width: 180px; height: 180px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--serif); font-size: 32px; font-weight: 400;
  background: transparent; color: var(--text); border: 1px solid var(--border);
  border-radius: 16px; cursor: pointer; transition: all 0.25s ease;
  letter-spacing: 0.01em;
}
.pin-boxes { display: flex; gap: 12px; justify-content: center; }
.pin-box {
  width: 52px; height: 64px; font-family: var(--sans); font-size: 24px;
  background: var(--surface); color: var(--text); border: 1.5px solid var(--border);
  border-radius: 10px; text-align: center; outline: none;
  caret-color: transparent; transition: border-color 0.2s;
}
.pin-box:focus { border-color: var(--accent); }
.pin-box.filled { border-color: #444; }
.pin-boxes.shake {
  animation: pin-shake 0.4s ease;
}
.pin-boxes.shake .pin-box { border-color: var(--red); }
@keyframes pin-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

#pin-step, #user-step {
  position: absolute; width: 100%; text-align: center;
}
#pin-step { transition: opacity 0.4s ease, transform 0.4s ease; }
#pin-step.fade-out { opacity: 0; transform: translateY(-20px); pointer-events: none; }
#user-step.fade-in { animation: fade-up 0.5s ease both; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.picker-steps { position: relative; min-height: 240px; width: 100%; display: flex; justify-content: center; }

.picker-emoji { font-size: 48px; line-height: 1; }

.picker-john:hover, .picker-pen:hover {
  background: rgba(255,255,255,0.06); border-color: #555; color: #fff;
}

/* ── Interview ────────────────────────────────────────── */

#interview {
  z-index: 1; text-align: center; width: 100%; max-width: 400px;
  display: flex; flex-direction: column; align-items: center;
  gap: 20px; padding: 0 24px;
}

#interview-hero {
  font-family: var(--serif); font-size: 42px; font-weight: 400;
  color: rgba(232,230,227,0.22); line-height: 1.2;
  letter-spacing: -0.01em;
  animation: fade-up 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: 0.3s;
}

#waveform {
  width: 150%; height: 240px; margin-left: -25%; margin-right: -25%;
  animation: wave-in 1s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes wave-in {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

#interview-chips {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  width: 100%; min-height: 0;
}

.interview-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; font-family: var(--sans); font-size: 14px;
  font-weight: 300; letter-spacing: 0.02em;
  border-radius: 20px; border: 1px solid var(--border);
  color: var(--text); background: var(--surface);
  opacity: 0; transform: translateY(12px);
  animation: chip-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.interview-chip .material-symbols-rounded { font-size: 16px; opacity: 0.7; }

/* criteria (budget, beds, neighborhoods) -- white/neutral, these are facts */
.chip-criteria { border-color: rgba(255,255,255,0.15); }
.chip-criteria .material-symbols-rounded { color: var(--text); }

/* dealbreaker -- bold accent, "we absolutely need this" */
.chip-dealbreaker { border-color: rgba(201,168,124,0.5); color: var(--accent); }
.chip-dealbreaker .material-symbols-rounded { color: var(--accent); opacity: 1; }

/* very important -- lighter accent */
.chip-very_important { border-color: rgba(201,168,124,0.25); }
.chip-very_important .material-symbols-rounded { color: var(--accent); }

/* nice to have -- subtle */
.chip-nice_to_have { border-color: var(--border); color: var(--muted); }
.chip-nice_to_have .material-symbols-rounded { color: var(--muted); }

/* slight preference -- most subtle */
.chip-slight_preference { border-color: var(--border); color: #555; }
.chip-slight_preference .material-symbols-rounded { color: #555; }

/* "+N more" chip */
.chip-more {
  border-color: var(--border); color: var(--muted);
  cursor: pointer; transition: border-color 0.2s, color 0.2s;
}
.chip-more:hover { border-color: var(--accent); color: var(--accent); }
@keyframes chip-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

#interview-bottom {
  position: absolute; bottom: 28px; left: 24px; right: 24px;
  display: flex; gap: 10px; z-index: 1;
  animation: slide-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

#refine-btn, #vibe-btn, #swipe-btn {
  flex: 1; padding: 16px; font-family: var(--sans); font-size: 15px;
  font-weight: 400; letter-spacing: 0.04em;
  background: transparent; border: 1px solid var(--border);
  border-radius: 12px; cursor: pointer; transition: all 0.25s ease;
  color: var(--muted);
}
#refine-btn:hover, #vibe-btn:hover { border-color: var(--text); color: var(--text); }
#refine-btn.pulse {
  animation: btn-pulse 2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btn-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
#swipe-btn {
  color: var(--accent); border-color: rgba(201,168,124,0.3);
}
#swipe-btn:hover {
  background: rgba(201,168,124,0.08); border-color: var(--accent);
}

.picker-city {
  position: absolute; bottom: 28px;
  font-size: 12px; color: var(--muted); letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ── Header ───────────────────────────────────────────── */

#app { display: none; height: 100dvh; flex-direction: column; }

#progress-bar {
  display: flex; gap: 3px; padding: 8px 16px 0;
}
.prog-seg {
  flex: 1; height: 4px; border-radius: 2px;
  background: var(--border); transition: background 0.3s ease;
}
.prog-seg.done-like { background: var(--green); }
.prog-seg.done-super { background: var(--blue); }
.prog-seg.done-pass { background: var(--red); opacity: 0.5; }
.prog-seg.current {
  background: var(--accent);
  animation: pulse-seg 1.5s ease-in-out infinite;
}
@keyframes pulse-seg {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

#app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; position: relative;
}

.hdr-stats { display: flex; flex-direction: column; min-width: 0; }
.hdr-stats-right { text-align: right; }
.stats-name { font-size: 13px; font-weight: 500; color: var(--text); }
.stats-detail { font-size: 11px; color: var(--muted); font-weight: 300; white-space: nowrap; }

.hdr-brand {
  font-family: var(--serif); font-size: 18px; letter-spacing: -0.02em;
  color: var(--text); position: absolute; left: 50%; transform: translateX(-50%);
  cursor: pointer; transition: color 0.2s;
}
.hdr-brand:hover { color: var(--accent); }
.hdr-brand em { color: var(--accent); font-style: italic; }

/* ── Bottom Sheet ─────────────────────────────────────── */

#sheet {
  position: absolute; bottom: 80px; left: 12px; right: 12px; z-index: 15;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 8px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease;
}
#sheet.sheet-closed {
  transform: translateY(20px);
  opacity: 0; pointer-events: none;
}

.sheet-chips {
  display: flex; gap: 6px; overflow-x: auto; flex: 1;
  scrollbar-width: none; -ms-overflow-style: none;
}
.sheet-chips::-webkit-scrollbar { display: none; }
.sheet-chips .interview-chip {
  font-size: 11px; padding: 4px 10px; white-space: nowrap;
  animation: none; opacity: 1; transform: none; flex-shrink: 0;
}

#sheet-mic {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
#sheet-mic:hover { border-color: var(--accent); color: var(--accent); }
#sheet-mic.active {
  border-color: var(--accent); color: var(--accent);
  animation: btn-pulse 2s ease-in-out infinite;
}

/* ── Card Area ────────────────────────────────────────── */

#card-area {
  flex: 1; display: flex; align-items: center; justify-content: center;
  position: relative; padding: 0 16px;
}

.card {
  position: absolute;
  width: var(--card-w);
  display: flex; flex-direction: column;
  touch-action: none; user-select: none;
  cursor: grab;
  will-change: transform, opacity;
}
.card-body {
  height: var(--card-h);
  background: var(--card); border-radius: 20px;
  overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  position: relative; width: 100%;
}
.card-behind {
  z-index: 1; transform: scale(0.6); opacity: 0.6;
  transition: transform 0.4s ease, opacity 0.4s ease;
  pointer-events: none;
}
.card-front {
  z-index: 2;
}
.card-behind.promote {
  transform: scale(1); opacity: 1;
}

/* ── Bento Image Grid ─────────────────────────────────── */

.bento {
  flex: 1; display: grid; gap: 2px; padding: 2px;
  grid-template-columns: 1.2fr 1fr;
  grid-template-rows: 1fr 1fr 0.7fr;
  min-height: 0;
}

.bento-cell {
  position: relative; overflow: hidden; background: #111;
  border-radius: 2px;
}
.bento-cell.loading {
  background: linear-gradient(110deg, #111 30%, #1a1a1f 50%, #111 70%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.bento-cell:nth-child(1) { grid-row: 1 / 3; border-radius: 18px 2px 2px 2px; }
.bento-cell:nth-child(2) { border-radius: 2px 18px 2px 2px; }
.bento-cell:nth-child(4) { border-radius: 2px 2px 2px 18px; }
.bento-cell:nth-child(5) { border-radius: 2px 2px 18px 2px; }

.bento-cell.map-cell { position: relative; z-index: 1; transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.bento-cell.map-cell .maplibregl-map { width: 100%; height: 100%; }
.map-toggle {
  position: absolute; top: 6px; right: 6px; z-index: 10;
  width: 28px; height: 28px; border-radius: 6px;
  background: none; border: none;
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0.7; transition: opacity 0.2s;
}
.map-toggle:hover { opacity: 1; }

.map-chips {
  position: absolute; bottom: 4px; left: 4px; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 3px; max-width: calc(100% - 8px);
}
.map-chip {
  display: inline-flex; align-items: center; gap: 2px;
  font-family: var(--sans); font-size: 9px; font-weight: 400;
  padding: 2px 5px; border-radius: 3px;
  background: rgba(0,0,0,0.6); color: rgba(255,255,255,0.8);
  white-space: nowrap;
}
.map-chip .material-symbols-rounded { font-size: 10px; color: var(--accent); }

.map-info-overlay {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 7;
  padding: 32px 16px 14px; background: linear-gradient(transparent, rgba(0,0,0,0.8));
  border-radius: 0 0 18px 18px; pointer-events: none;
}
.map-info-name { font-family: var(--serif); font-size: 24px; color: var(--text); margin-bottom: 4px; }
.map-info-addr { font-size: 13px; color: var(--muted); }

.bento-cell .bento-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; pointer-events: none;
  opacity: 0;
}
.bento-cell.ready .bento-img { transition: opacity 1.2s ease-in-out; }
.bento-cell .bento-img.active { opacity: 1; }

/* ── Card Info ────────────────────────────────────────── */

.card-info {
  padding: 14px 16px 12px; position: relative;
  background: linear-gradient(to bottom, var(--card), #121215);
}

.card-price-row {
  display: flex; justify-content: space-between; align-items: baseline;
}
.card-unit {
  font-family: var(--serif); font-size: 32px;
  color: var(--text); line-height: 1;
}
.card-detail {
  font-family: var(--serif); font-size: 32px; color: var(--muted); line-height: 1;
}
.card-suffix { font-family: var(--serif); font-size: 20px; }
.card-slash { opacity: 0.25; }

.card-location {
  font-size: 13px; color: var(--muted); margin-top: 6px;
  font-weight: 300; letter-spacing: 0.01em;
}
.card-name {
  font-size: 11px; color: #444; margin-top: 2px;
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 400;
  display: flex; gap: 6px; align-items: baseline;
}
.card-link {
  position: absolute; bottom: 12px; right: 12px;
  color: var(--muted); opacity: 0.35; transition: opacity 0.2s;
}
.card-link:hover { opacity: 1; }

.card-chips-below {
  display: flex; flex-wrap: wrap; gap: 5px; justify-content: center;
  padding: 8px 14px 10px; background: transparent;
}
.card-chips {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px;
}
.card-chip {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--sans); font-size: 13px; font-weight: 400;
  padding: 6px 11px; border-radius: 8px;
  background: rgba(255,255,255,0.07);
  color: #999;
}
.card-chip .material-symbols-rounded {
  font-size: 16px; color: inherit; opacity: 0.8;
}
.chip-avail { background: rgba(93,204,126,0.1); color: var(--green); }
.chip-avail .material-symbols-rounded { opacity: 1; }
.chip-partner { background: rgba(91,141,239,0.12); color: var(--blue); }
.chip-partner .material-symbols-rounded { opacity: 1; }

.debug-predict {
  position: absolute; top: 10px; left: 10px; z-index: 15;
  font-family: var(--mono); font-size: 11px;
  background: rgba(0,0,0,0.7); padding: 3px 8px; border-radius: 4px;
  pointer-events: none;
}
.affinity-bar { padding: 0 16px; pointer-events: none; }
.affinity-track {
  position: relative; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.06);
}
.affinity-mid {
  position: absolute; left: 50%; top: -1px; width: 1px; height: 5px;
  background: rgba(255,255,255,0.15);
}
.affinity-fill {
  position: absolute; top: 0; height: 100%; border-radius: 2px;
  transition: left 0.4s ease, width 0.4s ease;
}
[data-bias="self"] .affinity-fill { background: var(--green); opacity: 0.5; }
[data-bias="partner"] .affinity-fill { background: var(--blue); opacity: 0.5; }
[data-bias="neutral"] .affinity-fill { background: var(--gold); opacity: 0.3; }

/* ── Swipe Hints ──────────────────────────────────────── */

.swipe-overlay {
  position: absolute; inset: 0; pointer-events: none; z-index: 10;
  transition: background 0.15s;
}

.hint {
  position: absolute; padding: 16px 48px; border-radius: 12px; font-size: 44px;
  font-family: var(--sans); font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; opacity: 0; transition: opacity 0.15s;
}
.hint-like {
  top: 50px; right: 28px; color: #fff;
  border: 4px solid var(--green); background: rgba(93,204,126,0.6);
  transform: rotate(12deg); text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.hint-pass {
  top: 50px; left: 28px; color: #fff;
  border: 4px solid var(--red); background: rgba(232,93,93,0.6);
  transform: rotate(-12deg); text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.hint-super {
  bottom: 80px; left: 50%; transform: translateX(-50%); color: #fff;
  border: 4px solid var(--blue); background: rgba(91,141,239,0.6);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* ── Filter Popover ───────────────────────────────────── */

.filter-backdrop {
  position: fixed; inset: 0; z-index: 49;
  background: rgba(0,0,0,0.3); opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.filter-backdrop.open { opacity: 1; pointer-events: auto; }

#filter-popover {
  position: fixed; bottom: 80px; left: 50%; z-index: 50;
  transform: translateX(-50%) translateY(12px) scale(0.97);
  width: var(--card-w);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px;
  opacity: 0; pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s ease;
}
#filter-popover.open {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1; pointer-events: auto;
}

.fp-chips {
  display: flex; flex-wrap: wrap; gap: 5px;
  max-height: 280px; overflow-y: auto;
  scrollbar-width: none;
}
.fp-chips::-webkit-scrollbar { display: none; }
.fp-chip {
  padding: 5px 10px; border-radius: 6px; font-size: 12px;
  font-family: var(--sans); white-space: nowrap;
  background: rgba(255,255,255,0.04); color: var(--muted);
  border: 1px solid rgba(255,255,255,0.08);
}
.fp-chip[data-imp="dealbreaker"] { color: #fff; border-color: rgba(255,255,255,0.2); }
.fp-chip[data-imp="very_important"] { color: var(--green); border-color: rgba(93,204,126,0.2); }
.fp-chip[data-imp="nice_to_have"] { color: var(--accent); border-color: rgba(201,168,124,0.2); }
.fp-chip[data-imp="criteria"] { color: #aaa; border-color: rgba(255,255,255,0.1); }

.fp-empty { font-size: 12px; color: #444; text-align: center; padding: 8px 0; }

.fp-mic-row {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--border);
  position: relative;
}
.fp-mic {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: none; border: 1px solid var(--border);
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.fp-mic:hover { border-color: var(--accent); color: var(--accent); }
.fp-mic.active {
  border-color: var(--accent); color: var(--accent);
  animation: btn-pulse 2s ease-in-out infinite;
}
.fp-hint { font-size: 12px; color: #444; flex: 1; line-height: 40px; position: absolute; left: 64px; transition: opacity 0.3s ease; }
.fp-hint.listening { color: var(--accent); }
.fp-wave {
  flex: 1; min-width: 0; height: 40px;
  opacity: 0; transition: opacity 0.3s ease;
}
.fp-wave.visible { opacity: 1; }

/* ── Actions ──────────────────────────────────────────── */

#actions {
  display: flex; gap: 8px; padding: 10px 0 20px;
  width: var(--card-w); margin: 0 auto;
}
.action-bar-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-family: var(--sans); font-size: 14px; font-weight: 400;
  cursor: pointer; transition: all 0.2s;
}
.action-bar-btn:active { transform: scale(0.97); }
.action-bar-btn:hover { border-color: var(--accent); color: var(--text); }
.action-bar-btn .material-symbols-rounded { font-size: 18px; }

.match-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red);
  color: #fff; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  animation: badge-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes badge-pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.match-celebration {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(12px);
  opacity: 0; transition: opacity 0.4s ease;
}
.match-celebration.visible { opacity: 1; }
.match-content { text-align: center; }
.match-heart {
  font-size: 72px; color: var(--red);
  animation: heart-beat 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both;
}
@keyframes heart-beat {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.match-text {
  font-family: var(--serif); font-size: 36px; color: var(--text);
  margin-top: 16px;
}
.match-sub {
  font-size: 15px; color: var(--muted); margin-top: 8px; font-weight: 300;
}
.match-img {
  width: 220px; height: 140px; object-fit: cover; border-radius: 12px;
  margin-top: 20px; box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.match-price {
  font-family: var(--serif); font-size: 28px; color: var(--text); margin-top: 14px;
}
.match-detail {
  font-family: var(--serif); font-size: 18px; color: var(--muted); margin-top: 2px;
}
.match-addr {
  font-size: 13px; color: var(--muted); margin-top: 6px; font-weight: 300;
}
.match-building {
  font-size: 11px; color: #555; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px;
}

/* ── Matches Feed ─────────────────────────────────────── */

#matches-feed { height: 100dvh; flex-direction: column; background: var(--bg); }
#matches-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; position: relative;
}
#matches-header h2 { font-family: var(--serif); font-size: 22px; font-weight: 400; }
.matches-counter { font-size: 12px; color: var(--muted); }

#matches-scroll {
  flex: 1; overflow-y: auto; scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

.match-card-wrap {
  scroll-snap-align: start;
  min-height: calc(100dvh - 60px);
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 16px 20px;
}
.match-card-wrap .card {
  position: relative; width: var(--card-w);
}
.match-card-wrap .bento { flex: 1; }

.match-actions {
  display: flex; gap: 8px; width: var(--card-w); margin-top: 10px;
}
.match-action {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 10px; border-radius: 10px; font-family: var(--sans); font-size: 13px;
  cursor: pointer; transition: all 0.2s; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted);
}
.match-action:hover { border-color: var(--accent); color: var(--text); }
.match-action .material-symbols-rounded { font-size: 16px; }
.match-action-unmatch { color: var(--red); }
.match-action-unmatch:hover { border-color: var(--red); }

/* ── Favorites ────────────────────────────────────────── */

#favorites { display: none; height: 100dvh; flex-direction: column; background: var(--bg); }

#fav-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
}

.hdr-back {
  background: none; border: none; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; padding: 4px;
  transition: color 0.2s;
}
.hdr-back:hover { color: var(--text); }

#fav-title {
  font-family: var(--serif); font-size: 22px; font-weight: 400;
}

.fav-tabs {
  display: flex; gap: 0; padding: 0 20px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.fav-tab {
  padding: 10px 20px; font-family: var(--sans); font-size: 14px;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); cursor: pointer; transition: all 0.2s;
}
.fav-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.fav-tab:hover { color: var(--text); }

#fav-list {
  flex: 1; overflow-y: auto; padding: 0 20px 20px;
  -webkit-overflow-scrolling: touch;
}

.fav-card {
  display: flex; gap: 14px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; margin-bottom: 10px;
  transition: border-color 0.2s; cursor: default;
}
.fav-card:hover { border-color: #3a3a40; }

.fav-card img {
  width: 96px; height: 72px; object-fit: cover; border-radius: 8px;
  flex-shrink: 0; background: #111;
}

.fav-info { flex: 1; min-width: 0; }
.fav-info .fav-price {
  font-family: var(--serif); font-size: 18px; line-height: 1.2;
}
.fav-info .fav-loc { font-size: 13px; color: var(--muted); margin-top: 2px; font-weight: 300; }
.fav-info .fav-name { font-size: 11px; color: #555; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

.badge {
  display: inline-block; font-size: 10px; padding: 3px 8px;
  border-radius: 4px; margin-top: 6px; letter-spacing: 0.04em;
  text-transform: uppercase; font-weight: 500;
}
.badge-superlike { background: rgba(91,141,239,0.15); color: var(--blue); }
.badge-like { background: rgba(93,204,126,0.12); color: var(--green); }
.badge-match { background: rgba(201,168,124,0.15); color: var(--accent); }
.badge-new {
  background: var(--blue); color: #fff; font-weight: 600; font-size: 11px;
  padding: 4px 10px; border-radius: 6px; letter-spacing: 0.06em;
  animation: badge-pop 0.3s ease;
}

.empty-state {
  text-align: center; color: var(--muted); padding: 60px 20px;
}
.empty-title { font-size: 17px; font-weight: 400; color: var(--fg); margin-bottom: 16px; }
.empty-reasons {
  display: inline-flex; flex-direction: column; gap: 6px;
  text-align: left; margin-bottom: 16px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px;
}
.empty-row { display: flex; justify-content: space-between; gap: 24px; font-size: 13px; }
.empty-label { color: var(--muted); }
.empty-val { font-family: var(--mono); font-size: 12px; color: var(--fg); }
.empty-hint { font-size: 13px; font-weight: 300; color: #555; }
.relax-options { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.relax-btn {
  font-family: var(--sans); font-size: 13px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: var(--fg); border-radius: 8px; padding: 10px 16px;
  cursor: pointer; transition: border-color 0.2s;
}
.relax-btn:hover { border-color: var(--gold); }
.relax-btn .relax-label { color: var(--muted); margin-left: 4px; }

/* ── Vibe Picker ─────────────────────────────────────── */

#vibe-screen {
  flex-direction: column; height: 100dvh;
  background: var(--bg); overflow: hidden;
  position: relative;
}
.vibe-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  height: 180px;
  padding: 32px 16px 0; text-align: center;
  pointer-events: none;
}
.vibe-header .vibe-title { position: relative; z-index: 2; }
.vibe-title {
  font-family: var(--serif); font-size: 28px; font-weight: 400;
  letter-spacing: -0.02em; color: var(--text);
}
.vibe-title em {
  color: var(--accent); font-style: italic;
}

/* progressive blur: 8 layers with increasing blur + gradient mask */
.progressive-blur {
  position: absolute; inset: 0; z-index: 1;
}
.vibe-grid {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 66vw;
  gap: 2px; padding: 0 2px 80px;
}
.vibe-cell {
  position: relative; overflow: hidden; cursor: pointer;
}
.vibe-cell img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transition: opacity 0.4s ease, transform 0.35s ease;
}
.vibe-cell:active img { transform: scale(0.96); }
.vibe-tap-overlay {
  position: absolute; inset: 0; z-index: 2;
  background: rgba(220,120,140,0);
  transition: background 0.3s ease;
  pointer-events: none;
}
.vibe-tap-overlay.visible { background: rgba(220,120,140,0.3); }
.vibe-tap-badge {
  position: absolute;
  font-family: var(--sans); font-weight: 500; font-size: 44px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #fff; padding: 16px 48px; border-radius: 12px;
  border: 4px solid rgb(220,120,140);
  background: rgba(220,120,140,0.6);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease;
}
.vibe-cell.fading {
  transition: opacity 0.35s ease, transform 0.35s ease;
  opacity: 0; transform: scale(0.92);
}
.vibe-footer {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
  height: 140px;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 20px 16px; pointer-events: none;
}
.vibe-footer > * { position: relative; z-index: 2; pointer-events: auto; }
.vibe-footer .progressive-blur-bottom { position: absolute; inset: 0; z-index: 1; }
.vibe-count {
  font-family: var(--serif); font-style: italic; color: var(--accent);
}
.vibe-count .vibe-count-n { font-size: 28px; letter-spacing: -0.02em; }
.vibe-count .vibe-count-label { font-size: 15px; margin-left: 2px; }
.vibe-actions { display: flex; gap: 10px; }
.vibe-btn {
  font-family: var(--sans); font-size: 14px; font-weight: 400;
  letter-spacing: 0.04em;
  padding: 10px 24px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); transition: all 0.2s;
}
.vibe-refresh { background: rgba(12,12,15,0.6); color: var(--muted); }
.vibe-refresh:hover { border-color: var(--text); color: var(--text); background: rgba(12,12,15,0.8); }
.vibe-done {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
  font-weight: 500;
}
.vibe-done:hover { opacity: 0.9; }

@media (min-width: 600px) {
  .vibe-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 30vw; }
}

/* ── Utilities ────────────────────────────────────────── */

.img-cell { cursor: pointer; }

.carousel-fullscreen {
  position: absolute; inset: 0; z-index: 10; border-radius: 18px;
  overflow: hidden; background: #111;
  animation: carousel-in 0.25s ease both;
}
@keyframes carousel-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.carousel-fullscreen.closing {
  animation: carousel-out 0.2s ease both;
}
@keyframes carousel-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); }
}

/* carousel track: horizontal strip of slides */
.carousel-track {
  position: absolute; inset: 0; display: flex;
  will-change: transform; touch-action: pan-y;
}
.carousel-slide {
  flex: 0 0 100%; width: 100%; height: 100%;
}
.carousel-slide img {
  width: 100%; height: 100%; object-fit: cover; pointer-events: none;
}

.carousel-minimize {
  position: absolute; top: 8px; right: 8px; z-index: 8;
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.3s;
}
.carousel-fullscreen .carousel-minimize { opacity: 1; }

.img-info-overlay {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 7;
  padding: 32px 16px 14px; background: linear-gradient(transparent, rgba(0,0,0,0.8));
  border-radius: 0 0 18px 18px;
  font-size: 13px; opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.carousel-fullscreen .img-info-overlay { opacity: 1; }
.img-info-space {
  font-family: var(--serif); font-size: 24px; color: var(--text); display: block; margin-bottom: 4px;
  text-transform: capitalize;
  text-transform: capitalize;
}
.img-info-desc { font-size: 13px; color: var(--muted); }

.img-counter {
  position: absolute; top: 10px; left: 12px; z-index: 8;
  font-size: 12px; color: rgba(255,255,255,0.6); font-family: var(--sans);
  background: rgba(0,0,0,0.4); padding: 3px 8px; border-radius: 4px;
  opacity: 0; transition: opacity 0.3s;
}
.carousel-fullscreen .img-counter { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
