/* ============================================================
   ROOMMATE.CSS — Roommate Matching v3
   Card-stack UI, photo profiles, gender preference,
   swipe gestures, rooms available tab.
   ============================================================ */
/* -- Page transition -- */
body {
  opacity: 0;
}
body.page-loaded {
  opacity: 1;
  transition: opacity 0.3s ease;
}
body.page-exiting {
  opacity: 0;
  transition: opacity 0.2s ease;
}



/* -- Page container -- */
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* -- Page header -- */
.page-header { margin-bottom: 36px; }
.page-title {
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 10px;
}
.page-title em { font-style: italic; color: var(--clay); }
.page-sub { font-size: 15px; color: var(--warm-grey); line-height: 1.65; max-width: 520px; }

/* -- Form cards -- */
.form-card {
  background: white;
  border: 1px solid var(--sand);
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 16px;
}
.form-card-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--sand);
  letter-spacing: -0.02em;
}
.form-hint-inline {
  font-size: 12px;
  color: var(--warm-grey);
  font-weight: 400;
  font-family: var(--sans);
}
.bio-counter {
  font-size: 11px;
  color: var(--warm-grey);
  text-align: right;
  margin-top: 4px;
}

/* -- Photo upload -- */
.photo-upload-row {
  display: flex;
  align-items: center;
}
.photo-upload-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
}
.photo-upload-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px dashed var(--sand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: border-color var(--duration-normal) var(--ease-out);
}
.photo-upload-wrap:hover .photo-upload-circle {
  border-color: var(--clay);
}
.photo-upload-initials {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--warm-grey-light);
}
.photo-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--duration-fast) ease;
  border-radius: 50%;
}
.photo-upload-wrap:hover .photo-upload-overlay {
  opacity: 1;
}
.photo-upload-info {}
.photo-upload-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}
.photo-upload-sub {
  font-size: 12px;
  color: var(--warm-grey);
}

/* -- Pill group -- */
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 8px 16px;
  border: 1.5px solid var(--sand);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--warm-grey);
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  user-select: none;
  background: white;
  font-family: var(--sans);
}
.pill:hover { border-color: var(--clay-light); color: var(--ink); }

/* "Looking for" pills with helper text */
.pill-group--looking .pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border-radius: 14px;
  padding: 10px 16px;
}
.pill-hint {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--warm-grey);
  opacity: 0.7;
  line-height: 1.3;
}
.pill.selected .pill-hint {
  color: var(--clay);
  opacity: 0.8;
}

/* Linked listing preview card in profile overlay */
.po-listing-card {
  display: flex;
  gap: 14px;
  background: linear-gradient(135deg, #EBF5FF, #DBEAFE);
  border: 1px solid #BFDBFE;
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 20px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease;
}
.po-listing-card:hover {
  box-shadow: 0 4px 16px rgba(30,64,175,0.1);
}
.po-listing-thumb {
  width: 100px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--sand);
}
.po-listing-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.po-listing-info {
  flex: 1;
  min-width: 0;
}
.po-listing-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.po-listing-meta {
  font-size: 12px;
  color: #1E40AF;
  line-height: 1.5;
}
.po-listing-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--clay);
  margin-top: 6px;
  display: inline-block;
}
.pill.selected {
  border-color: var(--clay);
  background: rgba(196,98,45,0.07);
  color: var(--clay);
  font-weight: 600;
}

/* -- Range slider -- */
.range-row { display: flex; align-items: center; gap: 14px; }

.range-input {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 100px;
  background: linear-gradient(to right, var(--clay) 50%, var(--sand) 50%);
  outline: none;
  cursor: pointer;
  transition: background 0.1s ease;
}

/* Webkit thumb */
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  border: 2.5px solid var(--clay);
  box-shadow: 0 2px 8px rgba(196,98,45,0.25);
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring), box-shadow 0.15s ease;
}
.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 14px rgba(196,98,45,0.35);
}
.range-input::-webkit-slider-thumb:active {
  transform: scale(1.1);
}

/* Firefox thumb */
.range-input::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  border: 2.5px solid var(--clay);
  box-shadow: 0 2px 8px rgba(196,98,45,0.25);
  cursor: pointer;
  transition: transform 0.15s var(--ease-spring);
}
.range-input::-moz-range-thumb:hover { transform: scale(1.2); }

/* Firefox track */
.range-input::-moz-range-track {
  height: 6px;
  border-radius: 100px;
  background: var(--sand);
}
.range-input::-moz-range-progress {
  height: 6px;
  border-radius: 100px;
  background: var(--clay);
}

/* -- Privacy notice -- */
.privacy-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(196,98,45,0.04);
  border: 1px solid rgba(196,98,45,0.12);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
  font-size: 13px;
}

/* -- Submit button -- */
.form-submit {
  width: 100%;
  padding: 16px;
  background: var(--clay);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.form-submit:hover:not(:disabled) {
  background: var(--clay-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(196,98,45,0.3);
}
.form-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* -- Save (secondary) button -- */
.form-submit-secondary:hover:not(:disabled) {
  background: var(--clay) !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(196,98,45,0.2);
}
.form-submit-secondary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }


/* ====================================================
   STATUS RING — WhatsApp-style live indicator
==================================================== */
.status-ring {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2.5px solid #BDB4AC;
  padding: 2px;
  flex-shrink: 0;
  transition: border-color 0.3s ease;
}
.status-ring-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: white;
  background: var(--clay);
  overflow: hidden;
}
.status-ring-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #BDB4AC;
  border: 2px solid white;
  transition: background 0.3s ease;
}
.status-ring-label {
  display: inline-block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: #8C8278;
  margin-top: 2px;
}

/* Small variant for the edit form */
.status-ring--small {
  width: 36px;
  height: 36px;
  border-width: 2px;
}
.status-ring-avatar--small {
  font-size: 14px;
}
.status-ring-dot--small {
  width: 10px;
  height: 10px;
}


/* ====================================================
   MATCHES VIEW
==================================================== */

.matches-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.matches-title {
  font-family: var(--serif);
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 700;
  line-height: 1.15;
}
.matches-title em { font-style: italic; color: var(--clay); }
.matches-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.pause-btn {
  font-size: 12px;
  color: var(--warm-grey);
  background: white;
  border: 1px solid var(--sand);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 500;
  transition: all var(--duration-fast) ease;
}
.pause-btn:hover { border-color: var(--warm-grey-light); color: var(--ink); }

.edit-profile-btn {
  font-size: 13px;
  color: var(--clay);
  background: none;
  border: 1px solid var(--sand);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 500;
  transition: all var(--duration-fast) ease;
}
.edit-profile-btn:hover { border-color: var(--clay); }

/* ====================================================
   TAB BAR — Find Roommates / Rooms Available
==================================================== */
.rm-tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--sand);
}
.rm-tab {
  flex: 1;
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--warm-grey);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.rm-tab:hover {
  color: var(--ink);
}
.rm-tab.active {
  color: var(--clay);
  border-bottom-color: var(--clay);
}
.rm-tab-icon {
  font-size: 16px;
}

/* Tab content panels */
.rm-tab-panel {
  display: none;
}
.rm-tab-panel.active {
  display: block;
}

/* -- Filter bar -- */
.stack-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.stack-filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--warm-grey);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
}
.stack-filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--sand);
  font-size: 12px;
  font-weight: 600;
  color: var(--warm-grey);
  background: white;
  cursor: pointer;
  font-family: var(--sans);
  transition: all var(--duration-fast) ease;
}
.stack-filter-pill:hover { border-color: var(--warm-grey-light); color: var(--ink); }
.stack-filter-pill.active { background: var(--ink); color: white; border-color: var(--ink); }
.stack-progress {
  margin-left: auto;
  font-size: 12px;
  color: var(--warm-grey);
  font-weight: 500;
}

/* -- Card stack wrap -- */
.card-stack-wrap {
  position: relative;
  margin-bottom: 24px;
}

/* -- Card stack container -- */
.card-stack {
  position: relative;
  height: 520px;
  margin-bottom: 16px;
  user-select: none;
}

/* -- Individual match card -- */
.match-card-stack {
  position: absolute;
  inset: 0;
  background: white;
  border: 1px solid var(--sand);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(26,22,18,0.08);
  cursor: grab;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.35s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}
.match-card-stack:active { cursor: grabbing; }

/* Stack peek effect */
.card-behind-1 {
  transform: translateY(12px) scale(0.97);
  z-index: 1;
  pointer-events: none;
  box-shadow: 0 2px 16px rgba(26,22,18,0.05);
}
.card-behind-2 {
  transform: translateY(22px) scale(0.94);
  z-index: 0;
  pointer-events: none;
  box-shadow: none;
}
/* Top card is z-index 2 by default */
.match-card-stack:not(.card-behind-1):not(.card-behind-2) {
  z-index: 2;
}

/* Swipe direction hints (overlay text) */
.card-swipe-hint {
  position: absolute;
  top: 28px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  padding: 6px 14px;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  border: 3px solid;
  transition: opacity 0.1s ease;
}
.pass-hint {
  left: 24px;
  color: #C0392B;
  border-color: #C0392B;
  transform: rotate(-10deg);
}
.connect-hint {
  right: 24px;
  color: #2D7A3A;
  border-color: #2D7A3A;
  transform: rotate(10deg);
}

/* -- Card avatar -- */
.card-avatar-wrap {
  width: 100%;
  height: 180px;
  background: var(--cream);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.card-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 700;
  color: white;
}

/* -- Card body -- */
.card-body {
  padding: 18px 22px 16px;
  flex: 1;
}

.card-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.card-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
}
.card-verified {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: #DCFCE7;
  color: #166534;
}
.card-gender-badge {
  font-size: 14px;
  color: var(--warm-grey);
}
.card-meta {
  font-size: 13px;
  color: var(--warm-grey);
  margin-bottom: 10px;
}
.card-bio {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 14px;
  font-style: italic;
  opacity: 0.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ====================================================
   COMPATIBILITY SCORE — v3 redesign
==================================================== */
.card-compat {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 14px;
  background: var(--cream);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.card-compat:hover {
  background: var(--sand);
}

/* Match meter ring */
.compat-meter {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  position: relative;
}
.compat-meter svg {
  width: 52px;
  height: 52px;
  transform: rotate(-90deg);
}
.compat-meter-bg {
  fill: none;
  stroke: var(--sand);
  stroke-width: 4;
}
.compat-meter-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}
.compat-meter-fill.level-strong { stroke: #2D7A3A; }
.compat-meter-fill.level-good { stroke: var(--clay); }
.compat-meter-fill.level-low { stroke: #706760; }

.compat-meter-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

/* Match label + expand hint */
.card-compat-info {
  flex: 1;
  min-width: 0;
}
.card-compat-level {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}
.card-compat-level.level-strong { color: #2D7A3A; }
.card-compat-level.level-good { color: var(--clay); }
.card-compat-level.level-low { color: #706760; }

.card-compat-expand {
  font-size: 11px;
  color: var(--warm-grey);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-compat-expand svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}
.card-compat-expand.open svg {
  transform: rotate(180deg);
}

/* -- Compat breakdown (v3 — human-readable) -- */
.compat-breakdown {
  margin: 0 0 10px;
  padding: 12px 14px;
  background: var(--cream);
  border-radius: 0 0 14px 14px;
  margin-top: -6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: breakdownIn 0.2s ease;
}
@keyframes breakdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.compat-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
}
.compat-row.match { color: #166534; }
.compat-row.partial { color: #92400E; }
.compat-row.miss { color: #991B1B; }
.compat-icon {
  font-size: 13px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  line-height: 1.5;
}
.compat-text { flex: 1; }

/* Full lifestyle grid (inside expanded breakdown) */
.lifestyle-grid {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--sand);
}
.lifestyle-grid-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--warm-grey);
  margin-bottom: 10px;
}
.lifestyle-grid-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.lifestyle-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.lifestyle-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--warm-grey);
}
.lifestyle-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

@media (max-width: 480px) {
  .lifestyle-grid-items {
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
  }
  .lifestyle-value { font-size: 12px; }
}

/* ── Profile Overlay (full-screen, scrollable, premium) ─────── */
.profile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: white;
  display: none; /* hidden by default, shown via .open class */
  flex-direction: column;
}
.profile-overlay.open {
  display: flex;
}
.profile-overlay-scroll {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.profile-overlay-back {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  border-bottom: 1px solid rgba(232,221,208,0.6);
  width: 100%;
  padding: 16px 24px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--clay);
  cursor: pointer;
  font-family: var(--sans);
  letter-spacing: -0.01em;
}
.profile-overlay-back:hover { color: var(--ink); }
.profile-overlay-avatar {
  width: 100%;
  height: 260px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--clay-light) 0%, var(--clay) 100%);
  position: relative;
}
.profile-overlay-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-overlay-avatar .card-avatar-initials {
  width: 100%;
  height: 100%;
  font-size: 90px;
}
/* Fade overlay at bottom of avatar */
.profile-overlay-avatar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, white);
}
.profile-overlay-body {
  padding: 28px 28px 100px; /* extra bottom padding so content isn't hidden behind sticky bar */
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Stagger-reveal children */
.profile-overlay-body .po-section {
  opacity: 0;
  transform: translateY(16px);
  animation: poReveal 0.4s ease forwards;
}
.profile-overlay-body .po-section:nth-child(1) { animation-delay: 0.05s; }
.profile-overlay-body .po-section:nth-child(2) { animation-delay: 0.1s; }
.profile-overlay-body .po-section:nth-child(3) { animation-delay: 0.15s; }
.profile-overlay-body .po-section:nth-child(4) { animation-delay: 0.2s; }
.profile-overlay-body .po-section:nth-child(5) { animation-delay: 0.25s; }
.profile-overlay-body .po-section:nth-child(6) { animation-delay: 0.3s; }
.profile-overlay-body .po-section:nth-child(7) { animation-delay: 0.35s; }
@keyframes poReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* Name section */
.po-name {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.po-meta {
  font-size: 14px;
  color: var(--warm-grey);
  margin-top: 4px;
  margin-bottom: 20px;
}

/* Bio card */
.po-bio {
  background: var(--cream);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 20px;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.65;
  font-style: italic;
  position: relative;
}
.po-bio::before {
  content: '\201C';
  font-family: var(--serif);
  font-size: 48px;
  color: var(--clay-light);
  position: absolute;
  top: 8px;
  left: 14px;
  line-height: 1;
  opacity: 0.5;
}

/* Compat section */
.po-compat-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.po-score-ring {
  width: 64px;
  height: 64px;
  position: relative;
  flex-shrink: 0;
}
.po-score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.po-score-ring .ring-bg {
  fill: none;
  stroke: var(--sand);
  stroke-width: 4;
}
.po-score-ring .ring-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.34,1.56,0.64,1);
}
.po-score-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  font-family: var(--sans);
}

/* Breakdown card */
.po-breakdown-card {
  background: var(--cream);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 20px;
}
.po-breakdown-card .compat-row {
  padding: 6px 0;
  border-bottom: 1px solid rgba(232,221,208,0.5);
}
.po-breakdown-card .compat-row:last-of-type {
  border-bottom: none;
}

/* Place card */
.po-place-card {
  background: linear-gradient(135deg, #EBF5FF, #DBEAFE);
  border: 1px solid #BFDBFE;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #1E40AF;
}

/* Tags */
.po-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

/* Bottom bar — stays at bottom of flex column */
.profile-overlay-bar {
  flex-shrink: 0;
  display: flex;
  gap: 12px;
  padding: 16px 28px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--sand);
  background: white;
}
.profile-overlay-bar .card-action-btn {
  flex: 1;
  justify-content: center;
  padding: 14px;
  font-size: 15px;
  border-radius: 14px;
}

@media (max-width: 600px) {
  .profile-overlay-avatar { height: 200px; }
  .profile-overlay-body { padding: 20px 18px 28px; }
  .profile-overlay-bar { padding: 12px 18px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .po-name { font-size: 24px; }
}

/* Mutual match badge */
.card-mutual {
  display: inline-flex; align-items: center; gap: 3px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white;
  font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 100px;
  animation: mutualPulse 2s ease infinite;
}
@keyframes mutualPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(251,191,36,0.4); } 50% { box-shadow: 0 0 0 6px rgba(251,191,36,0); } }

/* -- Card tags -- */
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.match-tag {
  font-size: 11px;
  background: var(--cream);
  border: 1px solid var(--sand);
  border-radius: var(--radius-sm);
  padding: 4px 9px;
  color: var(--ink);
  font-weight: 500;
}

/* ====================================================
   CARD ACTIONS — inside card
==================================================== */
.card-actions {
  display: flex;
  gap: 10px;
  padding: 0 22px 18px;
  flex-shrink: 0;
}
.card-action-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
}
.card-action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.card-action-pass {
  background: white;
  border: 1.5px solid var(--sand);
  color: var(--warm-grey);
}
.card-action-pass:hover {
  border-color: #C0392B;
  color: #C0392B;
  background: #FFF5F5;
}
.card-action-connect {
  background: var(--clay);
  color: white;
}
.card-action-connect:hover {
  background: var(--clay-dark, #A84D1F);
  box-shadow: 0 4px 16px rgba(196,98,45,0.3);
  transform: translateY(-1px);
}

/* -- Swipe hint overlay -- */
.swipe-hint {
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--warm-grey);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.4s ease;
  margin-bottom: 8px;
  pointer-events: none;
}

/* -- OLD Pass / Connect buttons (kept hidden for backward compat, overridden by in-card) -- */
.stack-actions {
  display: none !important;
}

/* -- Empty state -- */
.stack-empty {
  text-align: center;
  padding: 64px 32px;
  background: white;
  border: 1px solid var(--sand);
  border-radius: 24px;
}
.stack-empty-icon { font-size: 52px; margin-bottom: 16px; }
.stack-empty-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}
.stack-empty-sub {
  font-size: 14px;
  color: var(--warm-grey);
  line-height: 1.65;
  margin-bottom: 24px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

/* Empty state — branded illustration */
.empty-illustration {
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(196,98,45,0.08), rgba(232,136,90,0.15));
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-illustration svg {
  width: 48px;
  height: 48px;
  color: var(--clay);
}

/* -- Loading -- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--sand);
  border-top-color: var(--clay);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}


/* ====================================================
   ROOMS AVAILABLE TAB
==================================================== */
.rooms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.rooms-count {
  font-size: 13px;
  color: var(--warm-grey);
  font-weight: 500;
}

/* Post a Room button */
.post-room-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--clay);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: all 0.2s ease;
}
.post-room-btn:hover {
  background: var(--clay-dark, #A84D1F);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(196,98,45,0.3);
}
.post-room-btn svg {
  width: 16px;
  height: 16px;
}

/* Room post cards */
.rooms-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.room-post-card {
  background: white;
  border: 1px solid var(--sand);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.room-post-card:hover {
  box-shadow: 0 6px 24px rgba(26,22,18,0.08);
  transform: translateY(-2px);
}

.room-post-photo {
  width: 140px;
  flex-shrink: 0;
  background: var(--cream);
  overflow: hidden;
}
.room-post-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.room-post-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warm-grey);
  font-size: 32px;
}

.room-post-body {
  flex: 1;
  padding: 16px 18px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.room-post-address {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-post-price {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--clay);
}
.room-post-host {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--warm-grey);
}
.room-post-host-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
}
.room-post-desc {
  font-size: 13px;
  color: var(--ink);
  opacity: 0.7;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.room-post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--warm-grey);
  flex-wrap: wrap;
}
.room-post-meta-item {
  display: flex;
  align-items: center;
  gap: 3px;
}
.room-post-compat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
}
.room-post-compat.level-strong { background: #DCFCE7; color: #166534; }
.room-post-compat.level-good { background: rgba(196,98,45,0.1); color: var(--clay); }
.room-post-compat.level-low { background: var(--cream); color: var(--warm-grey); }

.room-post-actions {
  margin-top: auto;
  padding-top: 6px;
}
.room-interest-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--clay);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: all 0.2s ease;
}
.room-interest-btn:hover {
  background: var(--clay-dark, #A84D1F);
}
.room-interest-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Room Post Form (modal-style inline) */
.room-post-form {
  background: white;
  border: 1px solid var(--sand);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 20px;
  display: none;
}
.room-post-form.open { display: block; }
.room-post-form-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sand);
}
.room-post-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.room-post-form .form-group.full {
  grid-column: 1 / -1;
}
.room-post-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}


/* ====================================================
   CONNECT MODAL
==================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,22,18,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: white;
  border-radius: 24px;
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 460px;
  position: relative;
  animation: modalIn 0.3s var(--ease-spring) both;
}
.modal-close-x {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--cream);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warm-grey);
  transition: all var(--duration-fast) ease;
}
.modal-close-x:hover { background: var(--sand); color: var(--ink); }

.modal-match-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.modal-preview-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--sand);
}
.modal-preview-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  color: white;
}

.modal-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}
.modal-sub {
  font-size: 13px;
  color: var(--warm-grey);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 18px;
}
.modal-textarea {
  width: 100%;
  padding: 13px 15px;
  font-size: 14px;
  font-family: var(--sans);
  border: 1.5px solid var(--sand);
  border-radius: var(--radius-md);
  background: var(--cream);
  color: var(--ink);
  outline: none;
  resize: vertical;
  min-height: 100px;
  transition: border-color var(--duration-fast) ease;
  margin-bottom: 16px;
}
.modal-textarea:focus { border-color: var(--clay); background: white; }
.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-cancel {
  flex: 1;
  padding: 12px;
  background: none;
  border: 1.5px solid var(--sand);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--warm-grey);
  cursor: pointer;
  font-family: var(--sans);
  transition: all var(--duration-fast) ease;
}
.modal-cancel:hover { border-color: var(--warm-grey-light); color: var(--ink); }
.modal-send {
  flex: 2;
  padding: 12px;
  background: var(--clay);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sans);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--duration-fast) ease;
}
.modal-send:hover:not(:disabled) { background: var(--clay-dark); }
.modal-send:disabled { opacity: 0.6; cursor: not-allowed; }


/* ====================================================
   RESPONSIVE
==================================================== */
@media (max-width: 768px) {
  .page { padding: 28px 16px 80px; }
  .page-title { font-size: 28px; }
  .form-card { padding: 22px 16px; }
  .matches-header { flex-direction: column; gap: 12px; }
  .matches-header-actions { align-self: flex-end; }
  .card-stack { height: 480px; }
  .card-avatar-wrap { height: 140px; }
  .card-body { padding: 14px 16px 12px; }
  .card-name { font-size: 18px; }
  .card-actions { padding: 0 16px 14px; }
  .modal { padding: 28px 18px 22px; }
  .room-post-card { flex-direction: column; }
  .room-post-photo { width: 100%; height: 140px; }
  .room-post-form .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .card-stack { height: 440px; }
  .card-avatar-wrap { height: 120px; }
  .card-action-btn { padding: 10px 12px; font-size: 12px; }
  .matches-title { font-size: 26px; }
  .stack-filters { gap: 6px; }
  .stack-filter-pill { padding: 5px 10px; font-size: 11px; }
  .stack-progress { display: none; }
  .rm-tab { font-size: 13px; padding: 12px 10px; }
}


/* ====================================================
   LOGGED-OUT GATE
==================================================== */

/* Break gate sections out of .page container for full-width */
#gate-view {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
}

/* -- Dark Hero -- */
.rm-hero {
  background: var(--ink);
  position: relative;
  overflow: hidden;
  padding: clamp(100px, 14vw, 160px) 52px clamp(80px, 10vw, 120px);
  text-align: center;
}
.rm-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}
.rm-hero::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 60%;
  height: 80%;
  background: radial-gradient(circle, rgba(196,98,45,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.rm-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}
.rm-hero .eyebrow { color: var(--clay-light); }
.rm-hero .page-title { color: white; font-size: clamp(36px, 6vw, 56px); margin-bottom: 16px; }
.rm-hero .page-title em { color: var(--clay-light); }
.rm-hero .page-sub { color: rgba(255,255,255,0.45); max-width: 480px; margin: 0 auto; }
.rm-hero-actions { margin-top: 40px; }
.rm-hero .gate-btn { background: var(--clay); border-color: var(--clay); }
.rm-hero .gate-btn:hover { background: var(--clay-light); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(196,98,45,0.35); }
.rm-hero .gate-signin { color: rgba(255,255,255,0.35); }
.rm-hero .gate-signin a { color: var(--clay-light); }

/* -- Steps Section -- */
.rm-steps {
  background: var(--cream);
  padding: clamp(64px, 8vw, 100px) 52px;
}
.rm-steps-inner {
  max-width: 960px;
  margin: 0 auto;
}
.rm-section-title {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}
.rm-section-title em { font-style: italic; color: var(--clay); }

.rm-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.rm-step {
  padding: 0;
}
.rm-step-num {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 700;
  color: var(--clay);
  opacity: 0.3;
  margin-bottom: 16px;
  line-height: 1;
}
.rm-step h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.rm-step p {
  font-size: 14px;
  color: var(--warm-grey);
  line-height: 1.65;
}

/* -- Feature Cards -- */
.rm-features {
  background: white;
  padding: clamp(64px, 8vw, 100px) 52px;
}
.rm-features-inner {
  max-width: 960px;
  margin: 0 auto;
}

.gate-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.gate-card {
  background: var(--cream);
  border: 1px solid var(--sand);
  border-radius: 20px;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.2s;
}
.gate-card:hover {
  box-shadow: 0 12px 36px rgba(26,22,18,0.08);
  border-color: transparent;
}
.gate-card-icon { font-size: 28px; margin-bottom: 14px; }
.gate-card h3 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.gate-card p {
  font-size: 13px;
  color: var(--warm-grey);
  line-height: 1.65;
}

/* -- Bottom CTA -- */
.rm-bottom-cta {
  background: var(--ink);
  text-align: center;
  padding: clamp(64px, 8vw, 100px) 52px;
}
.rm-bottom-cta .rm-section-title { color: white; margin-bottom: 32px; }
.rm-bottom-cta .rm-section-title em { color: var(--clay-light); }

.gate-cta { text-align: center; padding-bottom: 0; }
.gate-btn {
  display: inline-flex;
  max-width: 340px;
  margin: 0 auto 14px;
  text-decoration: none;
}
.gate-signin { font-size: 13px; color: var(--warm-grey); margin: 0; }
.gate-signin a { color: var(--clay); font-weight: 600; text-decoration: none; }
.gate-signin a:hover { text-decoration: underline; }
.rm-bottom-cta .gate-signin { color: rgba(255,255,255,0.35); }
.rm-bottom-cta .gate-signin a { color: var(--clay-light); }

/* -- Gate Responsive -- */
@media (max-width: 768px) {
  .rm-hero, .rm-steps, .rm-features, .rm-bottom-cta { padding-left: 24px; padding-right: 24px; }
  .rm-steps-grid { grid-template-columns: 1fr; gap: 28px; }
  .gate-cards { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .rm-hero { padding-top: 80px; padding-bottom: 60px; }
  .rm-hero .page-title { font-size: 30px; }
}

/* ====================================================
   PHASE 5 — Discovery Filters + Top Matches
==================================================== */

/* Top matches mini-cards */
.top-matches { margin-bottom: 20px; }
.top-matches-label {
  font-size: 11px; font-weight: 700; color: var(--clay);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px;
}
.top-matches-row { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.top-matches-row::-webkit-scrollbar { display: none; }
.top-match-card {
  flex-shrink: 0; width: 100px; text-align: center; padding: 14px 10px;
  background: white; border: 1px solid var(--sand); border-radius: 14px;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.top-match-card:hover { border-color: var(--clay-light); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(196,98,45,0.1); }
.top-match-img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; margin: 0 auto 8px; display: block; }
.top-match-initials {
  width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 18px; font-weight: 700; color: white;
}
.top-match-name { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-match-score { font-size: 11px; color: var(--clay); font-weight: 600; }
.top-match-mutual { font-size: 10px; color: #f59e0b; font-weight: 700; margin-top: 2px; }

/* Extended filter bar */
.stack-filters-extra {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center;
}
.stack-filter-select {
  font-family: var(--sans); font-size: 12px; padding: 7px 12px;
  border: 1.5px solid var(--sand); border-radius: 8px; background: white;
  color: var(--ink); cursor: pointer; outline: none;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238C8278' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; padding-right: 24px;
}
.stack-filter-select:focus { border-color: var(--clay); }
.stack-filter-budget { display: flex; align-items: center; gap: 4px; }
.stack-filter-input {
  font-family: var(--sans); font-size: 12px; padding: 7px 10px;
  border: 1.5px solid var(--sand); border-radius: 8px; background: white;
  color: var(--ink); outline: none; width: 80px;
}
.stack-filter-input:focus { border-color: var(--clay); }
.stack-filter-dash { color: var(--warm-grey); font-size: 12px; }

/* Phase 5 responsive for filters + top matches */
@media (max-width: 768px) {
  .stack-filters-extra { gap: 6px; }
  .stack-filter-select, .stack-filter-input { font-size: 11px; padding: 6px 8px; }
  .stack-filter-input { width: 65px; }
  .top-match-card { width: 85px; padding: 10px 8px; }
  .top-match-img, .top-match-initials { width: 40px; height: 40px; }
}
@media (max-width: 480px) {
  .stack-filters-extra { flex-direction: column; align-items: stretch; }
  .stack-filter-budget { width: 100%; }
  .stack-filter-input { flex: 1; width: auto; }
}
@media (max-width: 375px) {
  .page { padding: 20px 12px 60px; }
  .form-card { padding: 22px 12px; }
  .modal { padding: 22px 12px; max-width: 100%; }

  /* Card stack: fit within 375px viewport */
  .card-stack { height: 400px; }
  .card-avatar-wrap { height: 100px; }
  .card-body { padding: 10px 12px 8px; }
  .card-name { font-size: 16px; }
  .card-actions { padding: 0 12px 12px; gap: 8px; }
  .card-action-btn { padding: 10px 10px; font-size: 12px; gap: 4px; min-height: 44px; }

  /* Tab bar: compact at 375px */
  .rm-tab { font-size: 12px; padding: 10px 8px; gap: 4px; }
  .rm-tab-icon { font-size: 14px; }

  /* Filters: tighter spacing */
  .stack-filters { gap: 4px; }
  .stack-filter-pill { padding: 5px 8px; font-size: 10px; }
  .stack-filter-label { font-size: 10px; margin-right: 2px; }

  /* Top matches mini cards */
  .top-match-card { width: 75px; padding: 8px 6px; }
  .top-match-img, .top-match-initials { width: 36px; height: 36px; }
  .top-match-name { font-size: 11px; }
  .top-match-score { font-size: 10px; }

  /* Extended filters */
  .stack-filters-extra { gap: 4px; }
  .stack-filter-select { font-size: 10px; padding: 6px 6px; padding-right: 20px; }
  .stack-filter-input { font-size: 10px; padding: 6px 6px; width: auto; flex: 1; }
}
