/*
 * components.css -- Branson '26 Component Library
 * All shared components and base styles.
 * Only references semantic tokens from tokens.css and themes/trail.css.
 */

/* ===== Base Styles ===== */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  font-size: 17px; line-height: 1.5;
  color: var(--color-ink);
  background:
    radial-gradient(1000px 520px at -10% -10%, #E7EEDE 0%, transparent 55%),
    radial-gradient(900px 520px at 110% 10%, #F1DDB9 0%, transparent 55%),
    var(--color-bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(1000px 520px at -10% -10%, #1F2E1E 0%, transparent 55%),
      radial-gradient(900px 520px at 110% 10%, #2B2418 0%, transparent 55%),
      var(--color-bg);
  }
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); letter-spacing: -0.01em; }
h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; line-height: 1.1; }
h2 { font-size: clamp(20px, 3vw, 26px); font-weight: 700; }
h3 { font-size: 19px; font-weight: 700; }

/* ===== Site Navigation ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-line);
}
.site-header__inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 var(--sp-4);
  height: 56px;
  display: flex; align-items: center; gap: var(--sp-4);
}
.site-logo {
  font-family: var(--font-display); font-weight: 800; font-size: 18px;
  color: var(--status-yes); text-decoration: none; letter-spacing: -0.01em;
  flex-shrink: 0;
}
.site-nav { display: flex; gap: var(--sp-2); margin-left: auto; }
.site-nav .nav-link {
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  padding: 6px 12px; border-radius: var(--radius-btn);
  color: var(--color-ink-dim); text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center;
  transition: background 150ms, color 150ms;
}
.site-nav .nav-link:hover { background: var(--color-bg); color: var(--color-ink); }
.site-nav .nav-link[aria-current="page"] {
  background: color-mix(in srgb, var(--status-yes) 12%, transparent);
  color: var(--status-yes);
}
.theme-toggle {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--color-line);
  background: var(--color-surface);
  cursor: pointer; font-size: 16px;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background 150ms;
  padding: 0; margin: 0;
}
.theme-toggle:hover { background: var(--color-bg); }

/* Profile button in header (👤). Stays visible on mobile since there is no profile bottom-tab. */
.header-profile-btn {
  position: relative;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--color-line);
  background: var(--color-surface);
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 18px;
  color: var(--color-ink);
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms;
  padding: 0; margin: 0;
}
.header-profile-btn:hover { background: var(--color-bg); }
.header-profile-btn .profile-nudge-dot {
  position: absolute; top: 3px; right: 3px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--warn);
  border: 2px solid var(--color-surface);
  display: none;
}
.header-profile-btn[data-unset="true"] .profile-nudge-dot { display: block; }

/* Mobile bottom tab bar */
.bottom-tabs {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: color-mix(in srgb, var(--color-surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-line);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  justify-content: space-around;
  margin: 0; list-style: none;
}
@media (max-width: 719px) { .site-nav { display: none; } .bottom-tabs { display: flex; } }
@media (max-width: 719px) { .site-logo { margin-right: auto; } }
.bottom-tabs .tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 22px; text-decoration: none;
  min-width: 44px; min-height: 44px; justify-content: center;
  border-radius: 10px;
  transition: background 150ms;
  color: inherit;
}
.bottom-tabs .tab[aria-current="page"] {
  background: color-mix(in srgb, var(--status-yes) 14%, transparent);
}

/* ===== Page Layout ===== */
.page-main { max-width: 1100px; margin: 0 auto; padding: var(--sp-5) var(--sp-4) 120px; }
.page-hero { margin-bottom: var(--sp-5); }
.page-hero h1 { font-size: var(--text-xl); font-family: var(--font-display); font-weight: 800; margin: 0 0 var(--sp-2); }
.page-hero .eyebrow {
  font-family: var(--font-display); font-weight: 800; font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--status-yes);
  margin: 0 0 var(--sp-2);
}
.page-hero .hero-sub { color: var(--color-ink-dim); margin: 0; }

/* Test data banner */
.test-banner {
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--warn) 40%, var(--color-line));
  border-radius: var(--radius-btn);
  padding: 10px 16px; margin-bottom: var(--sp-4);
  font-size: var(--text-sm); color: var(--color-ink);
}

/* Live count display */
.live-count { font-size: var(--text-sm); color: var(--color-ink-dim); margin-bottom: var(--sp-3); }

/* ===== Sparse Catalog Cards (.card--light) ===== */
.catalog-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(2, 1fr);
}
.catalog-grid[hidden] { display: none; }
@media (min-width: 720px) { .catalog-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 1024px) { .catalog-grid { grid-template-columns: repeat(4, 1fr); } }

.card--light {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--color-surface);
  border: 1.5px solid var(--color-line);
  box-shadow: var(--shadow-1);
  transition: transform 180ms ease, box-shadow 180ms ease;
  display: flex; flex-direction: column;
  cursor: pointer;
}
.card--light:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.card--light__thumb {
  aspect-ratio: 16/10; width: 100%; display: block;
  background: var(--color-bg);
}
.card--light__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card--light__thumb svg { width: 100%; height: 100%; display: block; }
.card--light__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card--light h3 { font-size: 16px; line-height: 1.25; }
.card--light__hook {
  font-size: 17px; color: var(--color-ink-dim); line-height: 1.4;
  margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card--light__row {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  margin-top: auto;
}

/* ===== Mini Chips ===== */
.minichip {
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: var(--radius-pill);
  background: var(--color-bg); border: 1px solid var(--color-line);
  color: var(--color-ink-dim);
}
.minichip.price { color: var(--status-yes); border-color: color-mix(in srgb, var(--status-yes) 35%, var(--color-line)); }
.minichip.rating { color: var(--accent-sand); border-color: color-mix(in srgb, var(--accent-sand) 45%, var(--color-line)); }

/* ===== Heart Overlay ===== */
.heart-overlay {
  position: absolute; top: 8px; right: 8px;
  width: 36px; height: 36px; border-radius: 50%;
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  border: 1.5px solid var(--color-line);
  cursor: pointer; user-select: none;
  color: var(--color-ink-dim); font-size: 16px;
  transition: transform 120ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
  padding: 0; margin: 0;
  min-width: 44px; min-height: 44px;
}
.heart-overlay:active { transform: scale(0.92); }
.heart-overlay[aria-pressed="true"] {
  background: var(--status-wishlist); border-color: var(--status-wishlist); color: white;
}

/* ===== Dense Wishlist Cards (.card--dense) ===== */
.dense-stack { display: grid; gap: 16px; }
.card--dense {
  position: relative;
  border-radius: var(--radius-card);
  background: var(--color-surface);
  border: 1.5px solid var(--color-line);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: border-color 200ms ease, background 200ms ease, opacity 220ms ease, transform 220ms ease, max-height 240ms ease, margin 240ms ease;
}
.card--dense[data-state="wishlist"] {
  border-color: color-mix(in srgb, var(--status-wishlist) 45%, var(--color-line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--status-wishlist) 6%, transparent), transparent 40%), var(--color-surface);
}
.card--dense[data-state="committing"] {
  border-color: color-mix(in srgb, var(--status-yes) 50%, var(--color-line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--status-yes) 8%, transparent), transparent 45%), var(--color-surface);
}
.card--dense[data-state="not-going"] {
  border-color: color-mix(in srgb, var(--status-no) 40%, var(--color-line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-clay) 6%, transparent), transparent 45%), var(--color-surface);
  opacity: 0.9;
}
.card--dense.removing {
  opacity: 0; transform: scale(0.96);
  max-height: 0 !important; margin: 0 !important; padding: 0; border: 0;
  pointer-events: none;
}

.card--dense__top {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .card--dense__top { grid-template-columns: 280px 1fr; }
}
.card--dense__thumb {
  aspect-ratio: 4/3;
  background: var(--color-bg);
  position: relative;
}
.card--dense__thumb svg { width: 100%; height: 100%; display: block; }
.card--dense__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Dense card remove button */
.card--dense .remove-x {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--color-surface) 90%, transparent);
  backdrop-filter: blur(6px);
  border: 1.5px solid var(--color-line); cursor: pointer;
  font-size: 18px; color: var(--color-ink-dim);
  transition: background 150ms, color 150ms, transform 100ms;
  padding: 0; margin: 0;
  min-width: 44px; min-height: 44px;
}
.card--dense .remove-x:hover { background: var(--accent-clay); color: white; border-color: var(--accent-clay); }
.card--dense .remove-x:active { transform: scale(0.92); }

.card--dense__body {
  padding: 16px 18px 18px;
  display: grid; gap: 12px;
}

/* Segmented buttons (two-button variant) */
.seg.two-btn { grid-template-columns: 1fr 1fr; }
.seg.two-btn button { font-weight: 700; }

/* ===== Segmented Control ===== */
.seg {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px; padding: 4px;
  border-radius: 12px;
  background: var(--color-bg);
  border: 1.5px solid var(--color-line);
}
.seg button {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 8px; border-radius: 9px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  border: none; background: transparent; color: var(--color-ink-dim);
  cursor: pointer; min-height: 44px;
  transition: background 150ms, color 150ms;
}
.seg button .ico { font-size: 14px; }
.seg button[aria-checked="true"] {
  border: 2px solid var(--status-yes);
  color: var(--color-ink);
}
.seg button[aria-pressed="true"][data-v="committing"] { background: var(--status-yes); color: white; }
.seg button[aria-pressed="true"][data-v="not-going"]  { background: var(--accent-clay); color: white; }
.seg button[aria-pressed="true"][data-v="neutral"]    { background: var(--status-neutral); color: white; }

/* ===== Tags and Chips ===== */
.tag {
  font-family: var(--font-display); font-weight: 700; font-size: 12px;
  padding: 3px 9px; border-radius: 6px;
  background: var(--color-bg); color: var(--color-ink-dim);
  border: 1px solid var(--color-line);
}

.tags-row { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  padding: 10px 14px; border-radius: var(--radius-pill);
  background: var(--color-surface); border: 1.5px solid var(--color-line);
  color: var(--color-ink-dim);
  cursor: pointer;
  min-height: 44px;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.chip:hover { background: var(--color-bg); }
.chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--status-yes) 12%, transparent);
  border-color: var(--status-yes);
  color: var(--status-yes);
}

.filter-strip {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

/* ===== Filter Popover ===== */
.filter-popover-wrap {
  position: relative;
  margin-bottom: var(--sp-4);
}

/* The toggle button reuses .chip base look */
.filter-toggle-btn {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--color-surface); border: 1.5px solid var(--color-line);
  color: var(--color-ink-dim);
  cursor: pointer; min-height: 44px;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.filter-toggle-btn:hover { background: var(--color-bg); }

/* Active-filter state: filled white so it pops against any background */
.filter-toggle-btn.is-filtered {
  background: #ffffff;
  border-color: #ffffff;
  color: #111111;
}

/* Popover panel */
.filter-popover {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 200;
  background: #18181b;          /* zinc-900 */
  border: 1.5px solid #3f3f46;  /* zinc-700 */
  border-radius: 14px;
  padding: 14px;
  max-height: 60vh;
  overflow-y: auto;
  min-width: 280px;
  max-width: min(400px, calc(100vw - 32px));
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
}
.filter-popover.open { display: block; }

/* Near full-width on very narrow screens */
@media (max-width: 480px) {
  .filter-popover {
    right: 0;
    max-width: calc(100vw - 32px);
  }
}

/* Strip doesn't need its own bottom margin when nested inside the popover */
.filter-popover .filter-strip {
  margin-bottom: 0;
}

/* ===== Avatars ===== */
.avatars { display: flex; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800;
  font-size: 11px; color: white;
  border: 2px solid var(--color-surface);
  margin-left: -6px;
  position: relative;
}
.avatar:first-child { margin-left: 0; }
.avatar[data-s="committing"] { box-shadow: 0 0 0 2px var(--status-yes); }
.avatar[data-s="wishlist"]   { box-shadow: 0 0 0 2px var(--status-wishlist); }
.avatar[data-s="not-going"]  { box-shadow: 0 0 0 2px var(--accent-clay); opacity: 0.7; }

/* ===== Key-Value Rows ===== */
.kv-row {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  font-size: 14px; color: var(--color-ink-dim);
}
.kv { display: inline-flex; align-items: center; gap: 6px; }
.kv b { color: var(--color-ink); font-weight: 700; }

/* ===== Reservation Block ===== */
.reservation-block {
  padding: 10px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--warn) 35%, var(--color-line));
  display: flex; flex-direction: column; gap: 4px;
}
.reservation-block .pill {
  align-self: flex-start;
  font-family: var(--font-display); font-size: 12px; font-weight: 800;
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--warn); color: white; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.reservation-block .note {
  font-size: 17px; color: var(--color-ink);
}

/* ===== Who Row ===== */
.who-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-top: 12px; border-top: 1px dashed var(--color-line);
}
.who-text { font-size: 13px; color: var(--color-ink-dim); font-weight: 600; }
.who-text.empty { color: var(--color-ink-dim); font-style: italic; }

/* ===== Actions Row ===== */
.actions-row {
  display: flex; flex-direction: column; gap: 10px;
  padding-top: 12px; border-top: 1px dashed var(--color-line);
}
.actions-row .wish-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--color-bg); border: 1.5px solid var(--color-line);
}
.actions-row .wish-row .label { font-weight: 700; font-family: var(--font-display); font-size: 14px; }

.heart-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-surface); border: 1.5px solid var(--color-line);
  font-size: 18px; color: var(--color-ink-dim);
  cursor: pointer;
  transition: background 150ms, border-color 150ms, color 150ms, transform 100ms;
  padding: 0; margin: 0;
  min-width: 44px; min-height: 44px;
}
.heart-toggle:active { transform: scale(0.92); }
.heart-toggle[aria-pressed="true"] { background: var(--status-wishlist); border-color: var(--status-wishlist); color: white; }

/* ===== Links and Buttons ===== */
.link-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; font-size: 14px;
}
.link-row a {
  color: var(--status-wishlist); font-weight: 700; text-decoration: none;
}
.link-row a:hover { text-decoration: underline; }

.btn-suggest {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  background: transparent; border: 1.5px solid var(--color-line);
  color: var(--color-ink); cursor: pointer;
  min-width: 44px; min-height: 44px;
}
.btn-suggest:hover { border-color: var(--status-yes); color: var(--status-yes); }

.map-link {
  color: var(--status-wishlist); font-weight: 700; text-decoration: none;
  white-space: nowrap;
}
.map-link:hover { text-decoration: underline; }

/* ===== Toast ===== */
.toast-wrap {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 500; display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px 12px 16px; border-radius: 14px;
  background: var(--color-ink); color: var(--color-bg);
  box-shadow: 0 8px 30px rgba(0,0,0,0.22);
  font-size: 14px;
  pointer-events: auto;
  max-width: min(92vw, 460px);
  animation: toastin 200ms ease;
}
.toast.leaving { animation: toastout 200ms ease forwards; }
@keyframes toastin  { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastout { from { transform: translateY(0);   opacity: 1; } to { transform: translateY(16px); opacity: 0; } }
.toast button {
  background: transparent; border: 1.5px solid color-mix(in srgb, var(--color-bg) 45%, transparent);
  color: var(--color-bg); font-family: var(--font-display); font-weight: 700;
  padding: 6px 12px; border-radius: 8px; cursor: pointer;
  min-width: 44px; min-height: 44px;
}
.toast button:hover { background: color-mix(in srgb, var(--color-bg) 15%, transparent); }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 26, 18, 0.55);
  backdrop-filter: blur(4px);
  display: none; align-items: flex-end; justify-content: center;
  z-index: 400; padding: 0;
}
.modal-backdrop.open { display: flex; }
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 24px; } }
.modal {
  width: 100%; max-width: 460px;
  background: var(--color-surface);
  border-radius: 22px 22px 0 0;
  border: 1px solid var(--color-line);
  padding: 22px 20px 26px;
  box-shadow: var(--shadow-2);
  animation: slideup 200ms ease;
}
@media (min-width: 640px) { .modal { border-radius: 22px; } }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal h3 { margin-bottom: 6px; font-size: 20px; }
.modal p { margin: 0 0 14px; color: var(--color-ink-dim); font-size: 17px; }
.modal label {
  display: block; font-family: var(--font-display); font-size: 12px; font-weight: 800;
  color: var(--color-ink-dim); text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px; margin-top: 10px;
}
.modal select, .modal textarea {
  width: 100%; font-family: var(--font-body); font-size: 15px;
  padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--color-line);
  background: var(--color-bg); color: var(--color-ink);
}
.modal textarea { min-height: 72px; resize: vertical; }
.modal-btns { display: flex; gap: 8px; margin-top: 16px; }
.modal-btns button {
  flex: 1; padding: 11px 12px; border-radius: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  cursor: pointer; border: 1.5px solid transparent;
  min-height: 44px;
}
.modal-btns .cancel { background: transparent; border-color: var(--color-line); color: var(--color-ink); }
.modal-btns .send { background: var(--status-yes); color: white; border-color: var(--status-yes); }

/* ===== Detail Modal (card tap → full-screen sheet, rich dense layout) ===== */
.detail-modal {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 220ms ease;
}
.detail-modal.is-open { opacity: 1; pointer-events: auto; }
@media (min-width: 600px) {
  .detail-modal { align-items: center; padding: 24px; }
}
.detail-modal__sheet {
  width: 100%; max-width: 620px;
  max-height: 92dvh; overflow-y: auto;
  background: var(--color-surface);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -4px 40px rgba(0,0,0,0.32);
  position: relative;
  transform: translateY(28px);
  transition: transform 220ms ease;
  display: flex; flex-direction: column;
  overscroll-behavior: contain;
}
@media (min-width: 600px) {
  .detail-modal__sheet { border-radius: 22px; max-height: 88vh; transform: translateY(12px); }
}
.detail-modal.is-open .detail-modal__sheet { transform: translateY(0); }

/* Hero image (slot #dm-hero) */
.detail-modal__img {
  width: 100%; aspect-ratio: 16/9;
  object-fit: cover; display: block;
  border-radius: 22px 22px 0 0;
  flex-shrink: 0;
}

/* Modal heart: positioned top-right of sheet, same style as browse-card .heart-overlay */
.detail-modal__heart {
  position: absolute; top: 10px; right: 10px;
  z-index: 2;
}

/* Body area */
.detail-modal__body {
  padding: 20px 20px 36px;
  display: grid; gap: 12px;
  flex: 1;
}

/* 2. Header row: title left, rating right */
.detail-modal__header-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.detail-modal__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(20px, 3vw, 26px);
  color: var(--color-ink); margin: 0; line-height: 1.2;
  flex: 1;
}
.detail-modal__rating {
  font-family: var(--font-display); font-weight: 800;
  color: var(--accent-sand); font-size: 17px; white-space: nowrap;
  flex-shrink: 0;
}

/* 3. Metadata row */
.detail-modal__meta-row {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  font-size: 14px; color: var(--color-ink-dim);
}
.detail-modal__kv {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--color-ink-dim);
}

/* 4. Full description */
.detail-modal__desc {
  font-size: 17px; color: var(--color-ink);
  line-height: 1.6; margin: 0;
}

/* 5. Notes (muted tips/warnings) */
.detail-modal__notes {
  font-size: 17px; color: var(--color-ink-dim);
  line-height: 1.5; margin: 0;
  padding: 10px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 8%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--warn) 28%, var(--color-line));
}

/* 6. Tags row */
.detail-modal__tags-row {
  display: flex; gap: 6px; flex-wrap: wrap;
}

/* 7. Avatar section (inherits .card--light__avatars chip styles via existing JS) */
.detail-modal__avatars {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  min-height: 0; /* collapses when empty, avatar JS fills it */
}

/* 8. RSVP row -- inherits .seg.two-btn from components */
.detail-modal__rsvp { }  /* no extra style needed; .seg.two-btn handles layout */

/* 9. Footer: official site link */
.detail-modal__site-link {
  display: inline-flex; align-items: center;
  color: var(--status-wishlist); font-weight: 700; font-size: 15px;
  text-decoration: none;
  padding: 12px 0; min-height: 44px;
  transition: color 150ms;
}
.detail-modal__site-link:hover { text-decoration: underline; }

/* Footer row: wraps site-link + suggest button side by side */
.detail-modal__footer-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}

/* Suggest button: outlined secondary, smaller than RSVP buttons */
.detail-modal__suggest-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  background: transparent;
  border: 1.5px solid var(--color-line);
  color: var(--color-ink-dim);
  cursor: pointer;
  min-height: 44px;
  transition: border-color 150ms, color 150ms;
}
.detail-modal__suggest-btn:hover {
  border-color: var(--status-yes); color: var(--status-yes);
}

/* Close button: full-width, tall tap target, at the very bottom of the sheet.
   Primary dismiss affordance on mobile where the backdrop may not be reachable. */
.detail-modal__close-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 52px;
  padding: 12px 20px;
  margin: 4px 0 0;           /* small gap above the button */
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  background: transparent;
  border: none;
  border-top: 1.5px solid var(--color-line);
  color: var(--color-ink-dim);
  cursor: pointer;
  border-radius: 0 0 22px 22px;  /* matches sheet bottom corners */
  transition: background 150ms, color 150ms;
  flex-shrink: 0;  /* never squished inside flex column sheet */
}
.detail-modal__close-btn:hover {
  background: color-mix(in srgb, var(--color-bg) 60%, transparent);
  color: var(--color-ink);
}
.detail-modal__close-btn:active {
  background: var(--color-bg);
}

/* ===== Feedback Form ===== */
.feedback {
  margin-top: 48px;
  padding: 22px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-line);
  border-radius: 18px;
  box-shadow: var(--shadow-1);
}
.feedback h2 { margin-bottom: 6px; }
.feedback p { color: var(--color-ink-dim); margin: 0 0 14px; }
.feedback input, .feedback textarea {
  width: 100%; font-family: var(--font-body); font-size: 15px;
  padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--color-line);
  background: var(--color-bg); color: var(--color-ink);
}
.feedback textarea { margin-top: 10px; min-height: 100px; resize: vertical; }
.feedback label {
  display: block; font-family: var(--font-display); font-size: 12px; font-weight: 800;
  color: var(--color-ink-dim); text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px; margin-top: 12px;
}
.feedback label:first-of-type { margin-top: 0; }
.feedback button {
  margin-top: 14px;
  padding: 12px 18px; border-radius: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  background: var(--status-yes); color: white; border: none; cursor: pointer;
  min-width: 44px; min-height: 44px;
}
.feedback button:hover { background: var(--status-yes); filter: brightness(0.9); }

/* ===== Form States ===== */
.error {
  margin-top: 10px; padding: 10px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent-clay) 14%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--accent-clay) 50%, var(--color-line));
  color: var(--accent-clay);
  font-size: 17px; display: none;
}
.error.show { display: block; }
.ok {
  margin-top: 10px; padding: 10px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--status-yes) 14%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--status-yes) 50%, var(--color-line));
  color: var(--status-yes);
  font-size: 17px; display: none;
}
.ok.show { display: block; }

/* ===== Accessibility ===== */
:focus-visible { outline: 2px solid var(--status-yes); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ===== Quick Pick Deck (swipe stack on attractions.html) ===== */
.filter-row {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}
.qp-nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: transparent; color: var(--status-yes);
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  border: 1px solid var(--status-yes); cursor: pointer; text-decoration: none;
  min-height: 44px; white-space: nowrap;
}
.qp-nav-btn:hover { opacity: 0.9; }

.deck-wrap { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.deck-wrap[hidden] { display: none; }
.deck-count {
  font-size: var(--text-sm); color: var(--color-ink-dim);
  margin: 0 0 var(--sp-2);
  font-family: var(--font-display); font-weight: 700;
}

.deck-stage {
  position: relative; width: 100%;
  max-width: 640px; margin: 0 auto;
  height: 560px;
  touch-action: pan-y;
}
@media (max-width: 639px) { .deck-stage { height: 480px; } }

.deck-card {
  position: absolute; inset: 0;
  background: var(--color-surface);
  border-radius: var(--radius-card);
  border: 1.5px solid var(--color-line);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  cursor: grab;
  user-select: none; -webkit-user-select: none;
  transform-origin: center center;
  will-change: transform;
  display: flex; flex-direction: column;
}
.deck-card.dragging { cursor: grabbing; transition: none; }
.deck-card.returning { transition: transform 240ms cubic-bezier(0.2, 0.9, 0.35, 1); }
.deck-card.flying {
  transition: transform 360ms cubic-bezier(0.4, 0, 0.6, 1), opacity 360ms ease;
  pointer-events: none;
}
.deck-card.stack-2 { transform: translateY(12px) scale(0.96); opacity: 0.72; filter: saturate(0.85); pointer-events: none; }
.deck-card.stack-3 { transform: translateY(22px) scale(0.92); opacity: 0.45; filter: saturate(0.7); pointer-events: none; }

.deck-card__thumb {
  position: relative; width: 100%; aspect-ratio: 16/10;
  background: var(--color-bg);
  overflow: hidden;
  flex-shrink: 0;
}
.deck-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.deck-card__thumb svg { width: 100%; height: 100%; display: block; }
.deck-card__badge {
  position: absolute; top: 12px; left: 12px;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; color: var(--color-ink);
  text-transform: uppercase; letter-spacing: 0.08em;
  backdrop-filter: blur(6px);
}
.deck-card__duration {
  position: absolute; top: 12px; right: 12px;
  background: rgba(32,40,30,0.75); color: white;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700;
  backdrop-filter: blur(6px);
}

.deck-card__body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.deck-card__body h3 { font-size: 22px; line-height: 1.2; }
.deck-card__meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--color-ink-dim); }
.deck-card__meta .rating { color: var(--accent-sand); font-weight: 700; }
.deck-card__desc {
  font-size: 17px; color: var(--color-ink); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden; margin: 0;
}
.deck-card__hint {
  font-family: var(--font-display); font-size: 11px;
  color: var(--color-ink-dim); font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; margin-top: auto;
}

.deck-overlay {
  position: absolute; top: 24px;
  font-family: var(--font-display); font-weight: 800; font-size: 32px;
  padding: 10px 18px; border-radius: 12px;
  border: 3px solid currentColor;
  opacity: 0;
  pointer-events: none;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  backdrop-filter: blur(2px);
  letter-spacing: 0.06em;
}
.deck-overlay--wishlist { left: 24px; color: var(--status-yes); transform: rotate(-12deg); }
.deck-overlay--skip     { right: 24px; color: var(--accent-clay); transform: rotate(12deg); }
@media (prefers-reduced-motion: reduce) { .deck-overlay { transform: none !important; } }

.deck-actions { display: flex; justify-content: center; align-items: flex-start; gap: 16px; margin-top: var(--sp-4); }
.deck-act-col { display: flex; flex-direction: column; align-items: center; }
.deck-act-btn {
  width: 68px; height: 68px; border-radius: 50%;
  border: 2.5px solid var(--color-line);
  background: var(--color-surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; line-height: 1;
  box-shadow: var(--shadow-1);
  transition: transform 120ms, box-shadow 120ms, border-color 120ms;
  color: var(--color-ink);
  font-family: var(--font-body);
  padding: 0;
}
.deck-act-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.deck-act-btn:active:not(:disabled) { transform: translateY(0) scale(0.96); }
.deck-act-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.deck-act-btn--skip { color: var(--accent-clay); border-color: color-mix(in srgb, var(--accent-clay) 40%, var(--color-line)); }
.deck-act-btn--skip:hover:not(:disabled) { border-color: var(--accent-clay); background: color-mix(in srgb, var(--accent-clay) 8%, var(--color-surface)); }
.deck-act-btn--wishlist {
  color: var(--status-yes);
  border-color: color-mix(in srgb, var(--status-yes) 40%, var(--color-line));
  width: 80px; height: 80px; font-size: 34px;
}
.deck-act-btn--wishlist:hover:not(:disabled) { border-color: var(--status-yes); background: color-mix(in srgb, var(--status-yes) 8%, var(--color-surface)); }
.deck-act-btn--undo { width: 56px; height: 56px; font-size: 22px; color: var(--color-ink-dim); }

.deck-act-label {
  font-family: var(--font-display); font-weight: 700; font-size: 11px;
  color: var(--color-ink-dim); letter-spacing: 0.08em; text-transform: uppercase;
  margin-top: 6px;
}

.deck-end, .deck-empty {
  text-align: center;
  padding: 40px 24px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-1);
}
.deck-end__emoji { font-size: 48px; margin-bottom: 8px; }
.deck-end h2, .deck-empty h2 { margin-bottom: 10px; }
.deck-end p, .deck-empty p { color: var(--color-ink-dim); margin: 0 0 18px; }
.deck-end__btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.deck-end__btns button, .deck-end__btns a {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  padding: 12px 18px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--color-line);
  background: var(--color-bg); color: var(--color-ink);
  text-decoration: none; min-height: 44px;
}
.deck-end__btns .deck-end__primary {
  background: var(--status-yes); border-color: var(--status-yes); color: white;
}

.deck-kbd-hint {
  text-align: center; font-size: 12px; color: var(--color-ink-dim);
  margin-top: var(--sp-3);
}
.deck-kbd-hint .kbd {
  display: inline-block;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  padding: 2px 6px; border-radius: 4px;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  color: var(--color-ink);
  margin: 0 2px;
}

/* ===== Deck Bottom Sheet ===== */
.deck-sheet-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 400;
}
.deck-sheet-backdrop.open { display: block; }
.deck-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-height: 82vh; overflow-y: auto;
  background: var(--color-surface);
  border-radius: 20px 20px 0 0;
  z-index: 401;
  transform: translateY(100%);
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
  padding-bottom: env(safe-area-inset-bottom, 0);
  outline: none;
}
.deck-sheet.open { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .deck-sheet { transition: none; }
}
.deck-sheet__handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--color-line);
  margin: 10px auto 0;
}
.deck-sheet__thumb {
  width: 100%; height: 200px; overflow: hidden;
}
.deck-sheet__thumb img,
.deck-sheet__thumb svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.deck-sheet__body { padding: 16px 20px; }
.deck-sheet__body h3 { font-size: 22px; font-weight: 800; margin: 0 0 10px; }
.deck-sheet__meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 13px; color: var(--color-ink-dim);
  margin-bottom: 12px;
}
.deck-sheet__meta .rating { color: var(--accent-sand); font-weight: 700; }
.deck-sheet__desc { font-size: 17px; line-height: 1.55; color: var(--color-ink); margin: 0 0 16px; }
.deck-sheet__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.deck-sheet__notes {
  font-size: 17px; color: var(--color-ink-dim);
  background: color-mix(in srgb, var(--accent-sand) 12%, var(--color-bg));
  border-radius: 8px; padding: 10px 12px; margin-bottom: 20px;
}
.deck-sheet__footer {
  display: flex; gap: 10px; padding: 0 20px 24px;
}
.deck-sheet__footer button {
  flex: 1; padding: 14px; border-radius: 14px; font-size: 16px;
  font-weight: 700; font-family: var(--font-display);
  border: 2px solid transparent; cursor: pointer;
  min-height: 52px;
}
.deck-sheet__skip {
  background: var(--color-bg);
  border-color: color-mix(in srgb, var(--accent-clay) 40%, var(--color-line)) !important;
  color: var(--accent-clay);
}
.deck-sheet__wishlist {
  background: var(--status-yes);
  color: white;
}

/* ===== Profile Page ===== */
.profile-page { max-width: 640px; margin: 0 auto; padding: var(--sp-5) var(--sp-4) 120px; }
.profile-page h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 800; margin: 0 0 var(--sp-2); }
.profile-page .eyebrow {
  font-family: var(--font-display); font-weight: 800; font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--status-yes);
  margin: 0 0 var(--sp-2);
}
.profile-page .hero-sub { color: var(--color-ink-dim); margin: 0 0 var(--sp-5); }
.profile-section {
  background: var(--color-surface);
  border: 1.5px solid var(--color-line);
  border-radius: var(--radius-card);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-1);
}
.profile-section h2 { font-size: 18px; margin: 0 0 var(--sp-2); }
.profile-section .help { font-size: 17px; color: var(--color-ink-dim); margin: 0 0 var(--sp-3); }
.profile-section label {
  display: block; font-family: var(--font-display); font-size: 12px; font-weight: 800;
  color: var(--color-ink-dim); text-transform: uppercase; letter-spacing: 0.06em;
  margin: var(--sp-3) 0 var(--sp-2);
}
.profile-section label:first-of-type { margin-top: 0; }
.profile-section select,
.profile-section input[type="date"],
.profile-section input[type="text"] {
  width: 100%; font-family: var(--font-body); font-size: 15px;
  padding: 11px 12px; border-radius: 10px;
  border: 1.5px solid var(--color-line);
  background: var(--color-bg); color: var(--color-ink);
  min-height: 44px;
}

.profile-greeting {
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  color: var(--status-yes); margin-top: var(--sp-3);
}

.profile-radio-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.profile-radio-row {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: 12px 14px; border-radius: 10px;
  background: var(--color-bg);
  border: 1.5px solid var(--color-line);
  cursor: pointer;
  min-height: 44px;
  transition: border-color 150ms;
}
.profile-radio-row:has(input:checked) { border-color: var(--status-yes); }
.profile-radio-row input[type="radio"] { width: 20px; height: 20px; accent-color: var(--status-yes); margin-top: 2px; flex-shrink: 0; }
.profile-radio-row .text { display: flex; flex-direction: column; gap: 2px; }
.profile-radio-row .text .row-label { font-family: var(--font-body); font-size: 15px; color: var(--color-ink); font-weight: 600; }
.profile-radio-row .text .row-sub { font-size: 13px; color: var(--color-ink-dim); }

.profile-date-row { display: grid; grid-template-columns: 1fr; gap: var(--sp-3); }

.profile-interests { display: flex; flex-wrap: wrap; gap: 8px; }

.profile-notice {
  font-size: 17px; color: var(--color-ink);
  padding: 10px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--warn) 35%, var(--color-line));
  margin-top: var(--sp-3);
}

/* ── Theme Picker Grid ─────────────────────────────────────────── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px;
  background: none;
  border: 2px solid var(--color-line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 150ms, transform 100ms;
  min-height: 44px;
}
.theme-swatch:hover { border-color: var(--status-wishlist); transform: scale(1.04); }
.theme-swatch--active,
.theme-swatch[aria-checked="true"] { border-color: var(--status-yes); background: color-mix(in srgb, var(--status-yes) 8%, transparent); }
.theme-swatch__preview {
  width: 44px; height: 30px;
  border-radius: 8px;
  border: 2px solid;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.theme-swatch__dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
}
.theme-swatch__emoji { font-size: 16px; line-height: 1; }
.theme-swatch__label { font-size: 11px; color: var(--color-ink-dim); text-align: center; line-height: 1.2; font-weight: 500; }

@media (max-width: 719px) {
  .profile-section .help,
  .profile-notice,
  .card--light__hook,
  .reservation-block .note,
  .modal p,
  .detail-modal__desc,
  .detail-modal__notes,
  .error,
  .ok,
  .deck-card__desc,
  .deck-sheet__desc,
  .deck-sheet__notes {
    font-size: 18px;
  }
}
