/* === AuPair Rematch — design system ====================== */
:root {
  --brand:        #5b7cf6;
  --brand-dark:   #3a56d4;
  --brand-light:  #eef1ff;
  --green:        #27ae60;
  --green-light:  #e8f8ef;
  --amber:        #d97706;
  --amber-light:  #fef3c7;
  --danger:       #e84040;
  --danger-light: #fff0f0;
  --ink:          #1a1f2e;
  --muted:        #6b7280;
  --line:         #e5e7eb;
  --surface:      #ffffff;
  --bg:           #f7f8fc;
  --radius:       16px;
  --radius-sm:    10px;
  --shadow:       0 4px 20px rgba(0,0,0,.07);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.12);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  position: relative;
  min-height: 100vh;
}

/* ── VIEWS ─────────────────────────────────────────────────── */
.view {
  display: none;
  min-height: 100vh;
}
.view.active { display: block; }

/* ── LANDING ────────────────────────────────────────────────── */
.landing-inner {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 60px;
  background: linear-gradient(145deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  text-align: center;
}

.brand-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.3));
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand p {
  margin: 8px 0 0;
  font-size: 1rem;
  opacity: .85;
}

.landing-who {
  margin: 40px 0 16px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: .7;
}

.role-cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 440px;
}

.role-card {
  flex: 1;
  min-width: 160px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 20px;
  padding: 28px 16px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform .15s, background .15s;
}

.role-card:hover {
  transform: translateY(-4px);
  background: rgba(255,255,255,.25);
}

.role-icon { font-size: 2.4rem; }
.role-card strong { font-size: 1rem; font-weight: 700; }
.role-card span   { font-size: .78rem; opacity: .8; }

.landing-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 40px;
}

.landing-badges span {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
}

.landing-legal-links {
  margin-top: 18px;
  font-size: 12px;
  opacity: .9;
}

.landing-legal-links a {
  color: #fff;
  font-weight: 600;
}

.landing-legal-links span {
  margin: 0 8px;
}

/* ── AUTH ────────────────────────────────────────────────────── */
#view-auth {
  background: var(--bg);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#view-auth.active { display: flex; }

.auth-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  animation: fadeUp .25s ease;
}

.back-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  margin-bottom: 20px;
  display: inline-block;
}
.back-btn:hover { color: var(--ink); }

.auth-role-badge {
  display: inline-block;
  background: var(--brand-light);
  color: var(--brand);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}

.auth-panel h2 { margin: 0 0 6px; font-size: 1.5rem; }

.auth-sub {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 14px;
}

.auth-legal-checklist {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.auth-legal-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  line-height: 1.4;
  margin-bottom: 8px;
}

.auth-legal-item:last-child {
  margin-bottom: 0;
}

.auth-legal-item input {
  margin-top: 2px;
}

.auth-legal-error {
  margin: 4px 0 0;
  min-height: 16px;
  font-size: 12px;
  color: var(--danger);
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: box-shadow .15s;
}
.btn-google:hover { box-shadow: 0 2px 10px rgba(0,0,0,.12); }

.btn-demo {
  width: 100%;
  margin-top: 10px;
  padding: 11px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.btn-demo:hover { background: #eff0f3; }

.auth-privacy {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 14px 0 0;
  line-height: 1.4;
}

/* ── ONBOARDING ──────────────────────────────────────────────── */
#view-onboarding {
  background: var(--bg);
  padding: 24px;
}

.onboard-panel {
  max-width: 520px;
  margin: 0 auto;
  padding-bottom: 60px;
}

.onboard-header {
  text-align: center;
  margin: 8px 0 28px;
}

.onboard-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.onboard-header h2 { margin: 0 0 6px; font-size: 1.35rem; }
.onboard-header p  { color: var(--muted); font-size: 14px; margin: 0; }

.profile-form {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.field-group { margin-bottom: 18px; }

.field-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.field-hint {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

.field-group input,
.field-group textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  transition: border-color .15s;
  outline: none;
}

.field-group input:focus,
.field-group textarea:focus { border-color: var(--brand); }

.field-group textarea { min-height: 90px; resize: vertical; }

.char-count {
  display: block;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── SHARED BUTTONS ─────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background .15s;
}
.btn-primary:hover    { background: var(--brand-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: var(--surface);
  color: var(--brand);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-secondary:hover { background: var(--brand-light); }

.btn-danger {
  width: 100%;
  padding: 12px;
  background: var(--danger-light);
  color: var(--danger);
  border: 1.5px solid #f5aaaa;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger:hover { background: #ffe0e0; }

.status-msg {
  text-align: center;
  font-size: 13px;
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--green);
  font-weight: 500;
}
.status-msg.error { color: var(--danger); }

/* ── MAIN APP ────────────────────────────────────────────────── */
#view-app {
  display: none;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
#view-app.active { display: flex; }

.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  z-index: 10;
}

.app-bar-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-logo {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.app-title-text {
  font-weight: 800;
  font-size: 1.05rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  font-size: 12px;
  color: var(--muted);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-signout {
  padding: 5px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-signout:hover { background: #eff0f3; color: var(--ink); }

/* ── TAB PANES ──────────────────────────────────────────────── */
.tab-panes {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 80px;
}

.tab-pane { display: none; padding: 20px; }
.tab-pane.active { display: block; animation: fadeUp .2s ease; }

.section-head { margin-bottom: 20px; }
.section-head h3 { margin: 0 0 4px; font-size: 1.15rem; }
.section-sub { margin: 0; color: var(--muted); font-size: 14px; }

.quota-note {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
  background: #eaf1ff;
  border: 1px solid #c9dafc;
  border-radius: 999px;
  display: inline-block;
  padding: 4px 10px;
}

/* ── CANDIDATE CARDS ────────────────────────────────────────── */
.candidate-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.candidate-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  animation: fadeUp .2s ease;
}

.candidate-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.candidate-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.candidate-meta strong { display: block; font-size: 15px; }
.candidate-meta .role-tag { font-size: 11px; color: var(--muted); margin-top: 2px; }

.candidate-match-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  vertical-align: middle;
}

.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.interest-tag {
  background: var(--brand-light);
  color: var(--brand);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
}

.region-line { color: var(--muted); font-size: 13px; margin-bottom: 10px; }

.candidate-about {
  margin: 8px 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #263244;
  background: #f8fbff;
  border: 1px solid #dbe6f3;
  border-radius: 10px;
  padding: 8px 10px;
}

.candidate-about strong {
  color: #0f2a4a;
}

.candidate-actions { display: flex; gap: 10px; margin-top: 12px; }

.btn-like {
  flex: 1;
  padding: 10px;
  background: var(--green-light);
  color: var(--green);
  border: 1.5px solid #b2e4c7;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-like:hover    { background: #cff0dc; }
.btn-like:disabled { opacity: .6; cursor: default; }

.btn-pass {
  flex: 1;
  padding: 10px;
  background: #f9f9f9;
  color: var(--muted);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-pass:hover { background: #f0f0f0; }

.match-burst {
  text-align: center;
  padding: 24px 16px;
  animation: fadeUp .3s ease;
}
.match-burst .match-emoji { font-size: 2.5rem; }
.match-burst p { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

/* ── MATCHES LIST ────────────────────────────────────────────── */
.matches-list { display: flex; flex-direction: column; gap: 12px; }

.match-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: box-shadow .15s;
  animation: fadeUp .2s ease;
}
.match-item:hover { box-shadow: var(--shadow); }

.match-item.closed {
  border-style: dashed;
  border-color: #d1d5db;
  background: #f9fafb;
  cursor: default;
}
.match-item.closed .match-avatar {
  background: #d1d5db;
  color: #6b7280;
}
.match-item.closed .match-info strong {
  color: var(--muted);
}

.match-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #27ae60, #1a7a44);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.match-item .match-info { flex: 1; }
.match-info strong { display: block; font-size: 14px; }
.match-info small  { color: var(--muted); font-size: 12px; }
.match-about {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #334155;
}
.match-chevron     { color: var(--muted); font-size: 18px; }

/* ── CHAT ────────────────────────────────────────────────────── */
.chat-panel {
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
}
.chat-panel.hidden { display: none; }

.chat-back-btn {
  margin-bottom: 12px;
  width: auto;
  align-self: flex-start;
  text-align: left;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  padding: 7px 12px;
  color: #334155;
  transition: border-color .15s, background .15s, color .15s;
}
.chat-back-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
}

.chat-match-header {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--ink);
}

.chat-match-sub {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  line-height: 1.35;
}

.chat-messages {
  flex: 1;
  min-height: 180px;
  max-height: none;
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
}

.chat-msg {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 14px;
  max-width: 80%;
  line-height: 1.4;
}
.chat-msg.mine {
  background: var(--brand);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-msg.theirs {
  background: var(--surface);
  border: 1px solid var(--line);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 12px;
}

.chat-input-row textarea {
  flex: 1;
  padding: 10px 2px;
  border: none;
  border-radius: 0;
  font-size: 14px;
  line-height: 1.35;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: none;
  background: transparent;
  min-height: 24px;
  max-height: 96px;
  overflow-y: auto;
}
.chat-input-row textarea:focus { border-color: transparent; }

.btn-send {
  width: 44px;
  height: 44px;
  padding: 0;
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  white-space: normal;
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
}
.btn-send:hover { background: #16a34a; }

.chat-actions {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.chat-status {
  margin: 8px 2px 0;
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
}

.chat-status.success { color: var(--green); }
.chat-status.info { color: var(--muted); }
.chat-status.error { color: var(--danger); }

.btn-reveal {
  width: 100%;
  padding: 11px;
  background: var(--amber-light);
  color: var(--amber);
  border: 1.5px solid #fcd34d;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-reveal:hover { background: #fde68a; }

.btn-unmatch {
  width: 100%;
  padding: 11px;
  background: #fef2f2;
  color: #991b1b;
  border: 1.5px solid #fca5a5;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-unmatch:hover {
  background: #fee2e2;
}

.btn-unmatch:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* close-row: two buttons side by side */
.chat-close-row {
  display: flex;
  gap: 8px;
}

.btn-close-match {
  flex: 1;
  padding: 11px;
  background: #f3f4f6;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-close-match:hover  { background: #e5e7eb; }
.btn-close-match:disabled { opacity: .55; cursor: not-allowed; }

.btn-report {
  flex: 1;
  padding: 11px;
  background: #fff7ed;
  color: #92400e;
  border: 1.5px solid #fcd34d;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-report:hover  { background: #fef3c7; }
.btn-report:disabled { opacity: .55; cursor: not-allowed; }

/* report reason modal */
.report-modal-card {
  max-width: 420px;
}

.feedback-modal-card {
  max-width: 460px;
}

#feedbackText {
  min-height: 130px;
  resize: vertical;
}

.report-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 20px;
}
.report-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--bg);
  transition: border-color .15s, background .15s;
}
.report-option:has(input:checked) {
  border-color: var(--amber);
  background: #fffbeb;
}
.report-option input[type="radio"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--amber);
}

/* ── CLOSED MATCH BANNER ─────────────────────────────────────── */
.chat-closed-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
  animation: fadeUp .2s ease;
}
.chat-closed-banner.hidden { display: none !important; }

.chat-closed-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1;
}

.chat-closed-banner strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 3px;
}

.chat-closed-banner p {
  margin: 0;
  font-size: 12px;
  color: #b45309;
  line-height: 1.4;
}

.chat-header-closed {
  font-size: 12px;
  font-weight: 500;
  color: #b45309;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── PROFILE TAB ─────────────────────────────────────────────── */
.profile-preview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.profile-av {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.profile-preview h4 { margin: 0 0 6px; font-size: 1.15rem; }

.role-badge {
  display: inline-block;
  background: var(--brand-light);
  color: var(--brand);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 12px;
}

.profile-preview .meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0;
}

.profile-preview .about-text {
  color: var(--ink);
  font-size: 14px;
  margin: 10px 0 0;
  line-height: 1.5;
}

/* inline SVG icons used in meta lines and candidate cards */
.meta-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  opacity: .75;
  vertical-align: middle;
  display: inline-block;
}

/* landing badge SVG icons */
.badge-icon {
  width: 13px;
  height: 13px;
  vertical-align: middle;
  margin-right: 3px;
  opacity: .85;
}

.divider { border: none; border-top: 1px solid var(--line); margin: 24px 0; }

.danger-zone h4 { margin: 0 0 12px; color: var(--danger); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }

/* ── BOTTOM NAV ─────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: none;
  grid-template-columns: 1fr 1fr 1fr;
  z-index: 20;
}

#view-app.active .bottom-nav { display: grid; }
#view-app.chat-open .bottom-nav { display: none; }
#view-app.chat-open .tab-panes { padding-bottom: 16px; overflow-y: auto; }
#view-app.chat-open .chat-panel { min-height: calc(100vh - 130px); }
#view-app.chat-open .chat-panel {
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

#view-app.chat-open .chat-input-row {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, calc(100% - 20px));
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 35;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
}

.nav-btn {
  background: none;
  border: none;
  padding: 10px 0 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  transition: color .15s;
}
.nav-btn.active { color: var(--brand); }
.nav-icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  flex-shrink: 0;
}

/* ── LOADING OVERLAY ────────────────────────────────────────── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.92);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.loading-overlay.active { display: flex; }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 40px 16px;
}

/* ── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (min-width: 600px) {
  .role-cards          { flex-wrap: nowrap; }
  .tab-panes           { max-width: 600px; margin: 0 auto; }
  .app-bar             { max-width: 600px; margin: 0 auto; }
  .bottom-nav          { max-width: 600px; left: 50%; transform: translateX(-50%); }
}

@media (max-width: 640px) {
  .chat-panel {
    overflow-y: auto;
  }

  .chat-input-row {
    flex-direction: row;
    align-items: center;
    padding: 6px 6px 6px 12px;
  }

  .chat-input-row textarea {
    font-size: 16px;
  }

  .btn-send {
    width: 44px;
  }

  .chat-messages {
    min-height: 140px;
    max-height: 45vh;
  }

  #view-app.chat-open .chat-panel {
    min-height: calc(100svh - 130px);
  }
}

/* ── TOAST ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: auto;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
  pointer-events: auto;
  animation: toastIn .2s ease;
  width: 100%;
}

.toast.info    { background: #1a1f2e; color: #fff; }
.toast.success { background: #166534; color: #dcfce7; }
.toast.error   { background: #7f1d1d; color: #fee2e2; }
.toast.warning { background: #78350f; color: #fef3c7; }

.toast-icon  { font-size: 1.1rem; flex-shrink: 0; }
.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: .6;
  cursor: pointer;
  padding: 0 0 0 8px;
  font-size: 16px;
  line-height: 1;
}
.toast-close:hover { opacity: 1; }

/* ── ADMIN DASHBOARD ──────────────────────────────────────── */
#view-admin.active { display: flex; }

.admin-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ink);
  color: #fff;
  padding: 0 20px;
  height: 56px;
  flex-shrink: 0;
  gap: 12px;
}

.admin-bar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
}

.admin-logo {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.admin-badge {
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 999px;
}

.admin-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-main {
  flex: 1;
  padding: 24px 20px 48px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.admin-page-head h2 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 800;
}

.admin-page-head-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-last-refresh {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.admin-status-msg {
  color: var(--danger);
  font-size: 13px;
  margin: 0 0 12px;
  min-height: 1.2em;
}

/* Stats grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  padding: 18px 16px 14px;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 6px;
}

.stat-value.stat-green  { color: var(--green); }
.stat-value.stat-amber  { color: var(--amber); }
.stat-value.stat-muted  { color: var(--muted); }
.stat-value.stat-danger { color: var(--danger); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}

/* Section card */
.admin-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 20px;
}

.admin-section {
  margin-top: 28px;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.admin-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.admin-section-desc {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.feedback-flow-counts {
  margin-top: -6px;
}

/* Deletion queue items */
.admin-deletion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.admin-deletion-item:last-child { border-bottom: none; }

.admin-deletion-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-uid {
  font-size: 11px;
  font-family: "SF Mono", "Fira Code", monospace;
  background: var(--bg);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--ink);
  word-break: break-all;
}

.admin-del-date {
  font-size: 11px;
  color: var(--muted);
}

.abuse-reason-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.feedback-status {
  display: inline-block;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
}

.feedback-status.todo {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.feedback-status.doing {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.feedback-status.done {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.feedback-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* ── CONFIRM MODAL ──────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop[hidden] { display: none !important; }
.modal-backdrop.active { display: flex; }

.modal-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp .2s ease;
}

.modal-msg {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-cancel {
  padding: 10px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.modal-cancel:hover { background: #eff0f3; }

.modal-confirm {
  padding: 10px 18px;
  background: var(--danger);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}
.modal-confirm:hover { background: #c53030; }
.modal-confirm.safe { background: var(--brand); }
.modal-confirm.safe:hover { background: var(--brand-dark); }

/* ── CHAT HOUSE-RULES CARD ───────────────────────────────────── */
.chat-rules-card {
  max-width: 460px;
}

.chat-rules-card h2 {
  margin: 0 0 8px;
  font-size: 1.22rem;
}

.rules-intro {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 18px;
  line-height: 1.55;
}

.rules-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.rules-list li {
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand-light);
}

/* ── ONBOARDING ROLE CHIP ────────────────────────────────────── */
.onboard-role-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-light);
  color: var(--brand);
  border: 1.5px solid #c7d2fe;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  width: auto;
}
.onboard-role-chip:hover { background: #dbe4ff; border-color: #a5b4fc; }

.role-chip-switch {
  font-size: 11px;
  font-weight: 500;
  opacity: .65;
  padding-left: 4px;
  border-left: 1px solid #a5b4fc;
}

/* ── AU PAIR ONLY FIELDS ─────────────────────────────────────── */
.aupair-field { display: none; }
.aupair-field.visible { display: block; }


