/* =====================================================================
   ONO App Styles
   Extends styles.css (base variables defined there)
   ===================================================================== */

/* --- Body / Layout -------------------------------------------------- */
.app-body {
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* --- Top Bar -------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,247,244,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 54px;
  gap: 16px;
}
.topbar-brand {
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--line); color: var(--ink); }

/* --- Main Content --------------------------------------------------- */
.app-main {
  flex: 1;
  padding: 16px 16px 100px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

/* --- Bottom Nav ----------------------------------------------------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px 8px;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 600;
  font-family: inherit;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg { transition: transform 0.15s; }
.nav-item.active {
  color: var(--brand);
}
.nav-item.active svg { transform: scale(1.1); }

/* --- Buttons (app variants) ----------------------------------------- */
.btn-coral-app {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: 0;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-coral-app:hover { background: var(--brand-dark); }
.btn-coral-app:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost-app {
  display: inline-block;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-ghost-app:hover { background: var(--bg); }

/* --- Cards ---------------------------------------------------------- */
.a-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 2px 12px rgba(31,36,48,0.06);
}
.a-card h2 { margin: 0 0 4px; font-size: 1.15rem; }

/* --- Auth / Gate ---------------------------------------------------- */
.auth-wrap {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 36px 30px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(31,36,48,0.1);
  text-align: center;
}
.auth-logo {
  font-weight: 900;
  font-size: 2.4rem;
  color: var(--brand);
  letter-spacing: -1px;
  margin-bottom: 4px;
}
.auth-tagline {
  font-size: .95rem;
  color: var(--muted);
  margin-bottom: 28px;
}
.auth-tagline b { color: var(--ink); }
.auth-card .form-field { text-align: left; margin-bottom: 14px; }
.auth-card label { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.auth-card input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: 12px; font-size: .95rem; font-family: inherit;
  background: #fff; transition: border-color 0.15s;
}
.auth-card input:focus { outline: none; border-color: var(--brand); }
.auth-submit {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
}
.auth-msg {
  font-size: .875rem;
  color: var(--muted);
  margin-top: 14px;
  min-height: 20px;
}
.auth-msg.error { color: var(--brand-dark); }
.auth-msg.success { color: #2f9e64; }

/* --- Form fields ---------------------------------------------------- */
.form-field {
  margin-bottom: 16px;
}
.form-field label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus { outline: none; border-color: var(--brand); }
.form-field textarea { resize: vertical; min-height: 80px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .field-row { grid-template-columns: 1fr; } }

/* --- Onboarding Wizard ---------------------------------------------- */
.wizard-wrap { padding-bottom: 8px; }
.wizard-header {
  margin-bottom: 24px;
}
.wizard-step-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}
.wizard-title { font-size: 1.4rem; font-weight: 900; margin: 0 0 4px; letter-spacing: -0.5px; }
.wizard-sub { font-size: .9rem; color: var(--muted); margin: 0; }

/* progress bar */
.wizard-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
}
.wizard-dot {
  height: 4px;
  flex: 1;
  border-radius: 4px;
  background: var(--line);
  transition: background 0.3s;
}
.wizard-dot.done { background: var(--brand); }
.wizard-dot.active { background: var(--brand); opacity: 0.5; }

/* completeness chip */
.completeness-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  background: #fff3f2;
  border: 1px solid #ffd6d3;
  border-radius: 12px;
  padding: 10px 14px;
}
.completeness-track {
  flex: 1;
  height: 6px;
  background: var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.completeness-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 6px;
  transition: width 0.4s;
}
.completeness-label { font-size: .78rem; font-weight: 700; color: var(--brand-dark); white-space: nowrap; }

/* wizard nav buttons */
.wizard-nav {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.wizard-nav .back-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.wizard-nav .next-btn {
  flex: 1;
  background: var(--brand);
  color: #fff;
  border: 0;
  padding: 14px;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.wizard-nav .next-btn:hover { background: var(--brand-dark); }
.wizard-nav .next-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Adults list */
.adult-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.adult-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
}
.adult-item .adult-name { flex: 1; font-weight: 600; font-size: .9rem; }
.adult-item .pill { flex-shrink: 0; }

/* Safety checklist */
.safety-check-list { display: flex; flex-direction: column; gap: 0; }
.safety-check-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.safety-check-item:last-child { border-bottom: 0; }
.safety-check-item label { margin: 0; font-size: .95rem; font-weight: 600; color: var(--ink); cursor: pointer; flex: 1; }
.safety-check-item input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--brand); cursor: pointer; flex-shrink: 0; }

/* Photo upload */
.photo-upload-area {
  border: 2px dashed var(--line);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.photo-upload-area:hover { border-color: var(--brand); background: #fff3f2; }
.photo-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.photo-upload-icon { color: var(--brand); margin-bottom: 8px; }
.photo-upload-label { font-weight: 700; font-size: .9rem; display: block; }
.photo-upload-sub { font-size: .78rem; color: var(--muted); }
.photo-previews { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.photo-preview-img {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--line);
}

/* --- Discovery / Swipe Deck ---------------------------------------- */
.discover-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.discover-header {
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
  padding-top: 8px;
}
.discover-header h2 { font-size: 1.1rem; font-weight: 800; margin: 0; letter-spacing: -0.3px; }
.discover-header p { font-size: .82rem; color: var(--muted); margin: 4px 0 0; }

/* card deck area */
.deck-area {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 540px;
  margin-bottom: 20px;
  touch-action: pan-y;
}
.swipe-card-outer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* the actual swipeable card */
.swipe-card-new {
  position: absolute;
  width: 100%;
  max-width: 400px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 16px 60px rgba(31,36,48,0.18);
  background: var(--card);
  cursor: grab;
  user-select: none;
  will-change: transform;
  transition: box-shadow 0.2s;
  top: 0;
}
.swipe-card-new.dragging { cursor: grabbing; box-shadow: 0 24px 80px rgba(31,36,48,0.28); }

/* behind cards (stack illusion) */
.swipe-card-behind {
  position: absolute;
  width: 94%;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  top: 8px;
  left: 3%;
  z-index: 1;
  height: 60px;
  transition: transform 0.3s;
}
.swipe-card-behind.second { width: 88%; left: 6%; top: 16px; z-index: 0; }

/* card photo */
.sc-photo {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, #ffd6d3 0%, #ffe0d0 100%);
}
.sc-photo-placeholder {
  width: 100%;
  height: 260px;
  background: linear-gradient(135deg, #ffd6d3 0%, #ffe0d0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: 3.5rem;
  font-weight: 900;
}

/* card body */
.sc-body { padding: 16px 18px 20px; }
.sc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.sc-name { font-size: 1.25rem; font-weight: 900; letter-spacing: -0.5px; }
.sc-dist { font-size: .82rem; color: var(--muted); font-weight: 600; padding-top: 4px; }
.sc-verified { display: flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; color: #2f9e64; }
.sc-verified svg { flex-shrink: 0; }
.sc-stars { font-size: .82rem; color: #f5a623; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.sc-stars-count { color: var(--muted); font-weight: 600; }
.sc-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.sc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.sc-chip {
  font-size: .72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
}
.sc-chip.circle { background: #e5f6ec; color: #2f9e64; border-color: #c4ead4; }
.sc-chip.interest { background: rgba(255,107,94,0.08); color: var(--brand-dark); border-color: rgba(255,107,94,0.2); }
.sc-bio {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* like / pass overlays */
.sc-like-indicator, .sc-pass-indicator {
  position: absolute;
  top: 32px;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 1.4rem;
  font-weight: 900;
  opacity: 0;
  letter-spacing: 1px;
  pointer-events: none;
  border: 3px solid;
  transform: rotate(-15deg);
  z-index: 10;
}
.sc-like-indicator {
  left: 20px;
  color: #2f9e64;
  border-color: #2f9e64;
  background: rgba(229,246,236,0.9);
  transform: rotate(-10deg);
}
.sc-pass-indicator {
  right: 20px;
  color: var(--brand-dark);
  border-color: var(--brand-dark);
  background: rgba(253,236,234,0.9);
  transform: rotate(10deg);
}

/* swipe action buttons */
.swipe-btn-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  width: 100%;
  max-width: 400px;
}
.swipe-btn {
  flex: 1;
  max-width: 180px;
  padding: 14px;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  border: 0;
  transition: transform 0.1s, box-shadow 0.1s;
}
.swipe-btn:active { transform: scale(0.95); }
.swipe-btn.pass {
  background: #fff;
  color: var(--muted);
  border: 1.5px solid var(--line);
  box-shadow: 0 2px 12px rgba(31,36,48,0.08);
}
.swipe-btn.pass:hover { border-color: var(--brand-dark); color: var(--brand-dark); }
.swipe-btn.like {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 18px rgba(255,107,94,0.35);
}
.swipe-btn.like:hover { background: var(--brand-dark); }

/* empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; font-weight: 800; margin: 0 0 8px; }
.empty-state p { font-size: .9rem; color: var(--muted); margin: 0 0 20px; }

/* skeleton */
.skeleton-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 14px;
}
.skeleton-photo {
  height: 200px;
  background: linear-gradient(90deg, #f0e2dd 25%, #faf0ee 50%, #f0e2dd 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skeleton-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0e2dd 25%, #faf0ee 50%, #f0e2dd 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Roster --------------------------------------------------------- */
.roster-card { cursor: default; }
.roster-card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 4px;
}
.roster-card-photo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, #ffd6d3, #ffe0d0);
}
.roster-card-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--brand);
}
.roster-card-info { flex: 1; min-width: 0; }
.roster-card-name { font-size: 1rem; font-weight: 900; margin-bottom: 4px; letter-spacing: -0.3px; }
.roster-card-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.roster-card-kids { font-size: .78rem; color: var(--muted); font-weight: 600; }
.roster-save-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.roster-save-btn:hover { border-color: var(--brand); color: var(--brand); }
.roster-save-btn.saved { color: var(--brand); border-color: var(--brand); background: rgba(255,107,94,0.07); }
.roster-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.roster-action-btn {
  border-radius: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.roster-action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.roster-filter-row.hidden { display: none !important; }

/* --- Matches -------------------------------------------------------- */
.match-list { display: flex; flex-direction: column; gap: 12px; }
.match-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(31,36,48,0.06);
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
.match-card:hover { box-shadow: 0 6px 24px rgba(31,36,48,0.12); transform: translateY(-1px); }
.match-card-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}
.match-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: linear-gradient(135deg, #ffd6d3, #ffe0d0);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--brand);
}
.match-info { flex: 1; min-width: 0; }
.match-name { font-weight: 800; font-size: .95rem; margin-bottom: 3px; }
.match-preview { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-time { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.match-propose-btn {
  margin: 0 16px 14px;
  width: calc(100% - 32px);
  padding: 11px;
  border-radius: 12px;
  border: 1px dashed var(--brand);
  background: rgba(255,107,94,0.05);
  color: var(--brand-dark);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.match-propose-btn:hover { background: rgba(255,107,94,0.12); }

/* --- Chat ----------------------------------------------------------- */
.chat-view { display: flex; flex-direction: column; height: calc(100dvh - 54px - 72px - 24px); }
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.chat-back-btn {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  display: flex;
  align-items: center;
}
.chat-back-btn:hover { color: var(--ink); }
.chat-header-name { font-weight: 800; font-size: 1rem; }
.chat-header-sub { font-size: .78rem; color: var(--muted); }
.chat-header-view-profile {
  margin-left: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 10px;
  font-family: inherit;
}
.chat-header-view-profile:hover { color: var(--ink); }
.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-msg {
  max-width: 76%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: .9rem;
  line-height: 1.45;
}
.chat-msg.me {
  background: var(--brand);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}
.chat-msg.them {
  background: #eef0f3;
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}
.chat-input-row {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  font-size: .9rem;
  font-family: inherit;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.15s;
}
.chat-input:focus { outline: none; border-color: var(--brand); }
.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand);
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.15s;
}
.chat-send-btn:hover { background: var(--brand-dark); }
.chat-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: .9rem;
}

/* --- Swaps ---------------------------------------------------------- */
.ledger-card {
  background: linear-gradient(135deg, var(--brand) 0%, #ff8c82 100%);
  border-radius: 20px;
  padding: 20px;
  color: #fff;
  margin-bottom: 20px;
}
.ledger-card h3 { margin: 0 0 12px; font-size: 1rem; opacity: 0.85; font-weight: 700; }
.ledger-row { display: flex; gap: 12px; }
.ledger-stat {
  flex: 1;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
}
.ledger-stat-val { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.5px; display: block; }
.ledger-stat-lbl { font-size: .72rem; opacity: 0.8; margin-top: 2px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.swap-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(31,36,48,0.06);
}
.swap-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.swap-card-title { font-weight: 800; font-size: .95rem; }
.swap-card-role { font-size: .75rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.swap-state-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.swap-state-pill.proposed { background: #fff8e0; color: #b07d00; }
.swap-state-pill.held,
.swap-state-pill.accepted { background: #e5f6ec; color: #2f9e64; }
.swap-state-pill.awaiting_reciprocity { background: rgba(255,107,94,0.1); color: var(--brand-dark); }
.swap-state-pill.completed,
.swap-state-pill.reciprocity_scheduled { background: #e8f0fe; color: #1a56d6; }
.swap-state-pill.cancelled,
.swap-state-pill.no_show,
.swap-state-pill.hold_failed { background: #fdecea; color: var(--brand-dark); }
.swap-card-meta { font-size: .85rem; color: var(--muted); margin-bottom: 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.swap-deposit-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink);
}
.swap-actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.swap-action-btn {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  font-family: inherit;
  transition: opacity 0.15s;
}
.swap-action-btn:hover { opacity: 0.8; }
.swap-action-btn.primary { background: var(--brand); color: #fff; }
.swap-action-btn.secondary { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.swap-action-btn.danger { background: #fdecea; color: var(--brand-dark); }

/* --- Profile View (own) -------------------------------------------- */
.profile-status-banner {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.profile-photo-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.profile-photo-thumb {
  width: 90px;
  height: 90px;
  border-radius: 14px;
  object-fit: cover;
  background: linear-gradient(135deg, #ffd6d3, #ffe0d0);
}
.profile-photo-add {
  width: 90px;
  height: 90px;
  border-radius: 14px;
  border: 2px dashed var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
}
.profile-photo-add:hover { border-color: var(--brand); color: var(--brand); }
.profile-photo-add input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin: 0 0 12px; }
.circle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.circle-name { font-weight: 700; font-size: .9rem; }
.circle-code { font-size: .75rem; color: var(--muted); }
.circle-code code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-family: monospace; }

/* --- Profile Modal (other family) ---------------------------------- */
.profile-modal-card {
  max-width: 480px;
  width: calc(100vw - 40px);
  max-height: 80vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  background: var(--bg);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  z-index: 1;
}
.modal-close:hover { background: var(--line); }
.pm-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffd6d3, #ffe0d0);
  display: block;
  margin-bottom: 16px;
}
.pm-photo-placeholder {
  width: 100%;
  height: 200px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffd6d3, #ffe0d0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 900;
  color: var(--brand);
  margin-bottom: 16px;
}
.pm-name { font-size: 1.4rem; font-weight: 900; margin: 0 0 6px; letter-spacing: -0.5px; }
.pm-meta-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.pm-bio { font-size: .9rem; color: var(--muted); margin-bottom: 14px; line-height: 1.55; }
.pm-stat-row { display: flex; gap: 10px; margin-bottom: 14px; }
.pm-stat {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
}
.pm-stat-val { font-size: 1.1rem; font-weight: 900; display: block; }
.pm-stat-lbl { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; }

/* --- Date Picker Modal --------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31,36,48,0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal-card {
  background: var(--card);
  border-radius: 24px 24px 0 0;
  padding: 28px 24px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
@media (min-width: 480px) {
  .modal-overlay { align-items: center; padding: 20px; }
  .modal-card { border-radius: 24px; }
}
.modal-card h2 { font-size: 1.2rem; font-weight: 900; margin: 0 0 6px; letter-spacing: -0.5px; }
.modal-sub { font-size: .875rem; color: var(--muted); margin: 0 0 20px; }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.modal-actions button { flex: 1; }
.deposit-row { display: flex; align-items: center; gap: 14px; }
.deposit-row input[type="range"] {
  flex: 1;
  accent-color: var(--brand);
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
}
.deposit-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  min-width: 52px;
  text-align: right;
}

/* --- Toast ---------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: calc(72px + 12px + env(safe-area-inset-bottom, 0));
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(31,36,48,0.25);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 300;
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Pills ---------------------------------------------------------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.pill.ok { background: #e5f6ec; color: #2f9e64; }
.pill.warn { background: #fff8e0; color: #b07d00; }
.pill.error { background: #fdecea; color: var(--brand-dark); }
.pill.muted { background: #eef0f3; color: var(--muted); }

/* --- Trust badges --------------------------------------------------- */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
}
.trust-badge.verified {
  background: #e5f6ec;
  color: #2f9e64;
  border: 1px solid #c4ead4;
}
.trust-badge.safety {
  background: rgba(255,107,94,0.09);
  color: var(--brand-dark);
  border: 1px solid rgba(255,107,94,0.25);
}
.trust-badge svg { flex-shrink: 0; }

/* --- Verification rows ---------------------------------------------- */
.verify-section { margin-bottom: 16px; }
.verify-section:last-child { margin-bottom: 0; }
.verify-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.verify-status-row .verify-label { font-size: .88rem; font-weight: 600; flex: 1; }
.verify-status-row .verified-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 700;
  color: #2f9e64;
}
.sandbox-hint {
  font-size: .75rem;
  color: var(--muted);
  background: #fff8e0;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
  cursor: pointer;
}
.sandbox-hint:hover { background: #fef3c7; }
.verify-confirm-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.verify-confirm-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: .88rem;
  font-family: inherit;
}
.verify-confirm-row input:focus { outline: none; border-color: var(--brand); }
.verify-phone-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.verify-phone-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: .88rem;
  font-family: inherit;
}
.verify-phone-row input:focus { outline: none; border-color: var(--brand); }

/* --- Star picker ----------------------------------------------------- */
.star-picker {
  display: flex;
  gap: 4px;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--line);
  margin-bottom: 8px;
}
.star-picker .star { transition: color 0.1s; cursor: pointer; }
.star-picker .star.on { color: #f5a623; }

/* --- Reviews --------------------------------------------------------- */
.review-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}
.review-card .review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.review-card .review-family { font-weight: 700; font-size: .9rem; }
.review-card .review-date { font-size: .78rem; color: var(--muted); }
.review-stars { font-size: .95rem; color: #f5a623; margin-bottom: 6px; }
.review-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.review-item .review-item-stars { color: #f5a623; font-size: .85rem; margin-bottom: 4px; }
.review-item .review-item-text { font-size: .875rem; color: var(--ink); line-height: 1.5; }
.review-item .review-item-date { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.pending-reviews-card {
  background: #fff8e0;
  border: 1px solid #fde68a;
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 14px;
}
.pending-reviews-card h3 {
  font-size: .95rem;
  font-weight: 800;
  margin: 0 0 12px;
  color: #b07d00;
}
.review-submit-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

/* --- Admin link in topbar ------------------------------------------- */
.admin-topbar-link {
  display: inline-flex;
  align-items: center;
  background: #e8f0fe;
  color: #1a56d6;
  border: 1px solid #b8d0fb;
  border-radius: 8px;
  font-size: .72rem;
  font-weight: 800;
  padding: 4px 10px;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: background 0.15s;
}
.admin-topbar-link:hover { background: #d0e2fe; }

/* --- SOS / report button -------------------------------------------- */
.sos-btn {
  padding: 6px 12px;
  border-radius: 10px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #fdd5d5;
  background: #fdecea;
  color: var(--brand-dark);
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
}
.sos-btn:hover { background: #fcd3d3; }
.report-concern-btn {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}
.report-concern-btn:hover { color: var(--brand-dark); border-color: var(--brand-dark); }

/* --- Deposit payment button (swap card) ----------------------------- */
.swap-pay-deposit-btn {
  display: block;
  width: 100%;
  margin: 10px 0 8px;
  padding: 12px 16px;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  text-align: center;
}
.swap-pay-deposit-btn:hover { background: var(--brand-dark); }
.swap-pay-deposit-btn:active { transform: scale(0.98); }

/* --- Money status receipt line (swap card) -------------------------- */
.swap-money-status {
  font-size: .8rem;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.swap-money-status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}

/* --- Sandbox deposit indicator -------------------------------------- */
.swap-sandbox-indicator {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  background: #fff8e0;
  color: #b07d00;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 4px 10px;
  margin: 4px 0 8px;
}

/* --- Stripe payment element wrapper --------------------------------- */
#stripePaymentEl {
  min-height: 120px;
}
#stripeError {
  background: #fdecea;
  border-radius: 8px;
  padding: 8px 12px;
}

/* --- Notification Bell ---------------------------------------------- */
.notif-bell-wrap { position: relative; }
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  padding: 0 4px;
  pointer-events: none;
  border: 2px solid rgba(255,247,244,0.95);
}

/* --- Notification Panel -------------------------------------------- */
.notif-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  /* transparent overlay — clicking outside closes panel */
}
.notif-panel {
  position: absolute;
  top: 54px;
  right: 12px;
  width: min(380px, calc(100vw - 24px));
  max-height: min(520px, calc(100dvh - 80px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 16px 60px rgba(31,36,48,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* on mobile (<480px) — full-width sheet anchored to top */
@media (max-width: 480px) {
  .notif-panel {
    right: 0;
    left: 0;
    width: 100%;
    border-radius: 0 0 20px 20px;
    max-height: calc(100dvh - 54px);
  }
}
.notif-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.notif-panel-title {
  font-size: .95rem;
  font-weight: 800;
  flex: 1;
  letter-spacing: -0.3px;
}
.notif-mark-all-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.notif-mark-all-btn:hover { color: var(--brand-dark); border-color: var(--brand-dark); }
.notif-panel-close {
  width: 28px;
  height: 28px;
  background: var(--bg);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}
.notif-panel-close:hover { background: var(--line); color: var(--ink); }

.notif-list {
  overflow-y: auto;
  flex: 1;
}
.notif-loading,
.notif-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(255,107,94,0.04); }
.notif-item.unread:hover { background: rgba(255,107,94,0.08); }
.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-dot.read { background: transparent; }
.notif-item-body {
  flex: 1;
  min-width: 0;
}
.notif-item-text {
  font-size: .875rem;
  line-height: 1.45;
  color: var(--ink);
}
.notif-item.unread .notif-item-text { font-weight: 600; }
.notif-item-time {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 3px;
}

/* --- Hidden --------------------------------------------------------- */
.hidden { display: none !important; }

/* --- Responsive ----------------------------------------------------- */
@media (max-width: 480px) {
  .app-main { padding: 12px 12px 96px; }
  .deck-area { height: 520px; }
  .sc-photo, .sc-photo-placeholder { height: 230px; }
}
