* { box-sizing: border-box; }

:root {
  --primary: #6c3fc5;
  --primary-dark: #43237e;
  --accent: #ff6f91;
  --accent-warm: #ffb86b;
  --success: #2bb673;
  --danger: #ef5d6f;
  --bg: #fbf7fb;
  --text: #3a2f4d;
  --text-soft: #847e95;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: radial-gradient(circle at 20% 0%, #ffb86b 0%, transparent 55%),
              linear-gradient(160deg, #43237e, #6c3fc5 55%, #ff6f91 120%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  color: var(--text);
}

h1, h2, h3, .logo, .g-title, .quiz-question, .quiz-result h3 {
  font-family: "Poppins", "Inter", sans-serif;
}

.app {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  position: relative;
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 16px 0;
  background: linear-gradient(135deg, #fff 0%, #fdf2f6 100%);
  border-bottom: 1px solid #f1e6f4;
  position: sticky;
  top: 0;
  z-index: 5;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.brand-logo-img { height: 64px; width: auto; max-width: 100%; display: block; }
.brand-logo-img-topbar { height: 48px; }

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(108,63,197,.35);
}

.tagline {
  font-size: 12px;
  color: var(--text-soft);
  margin: 0 0 10px;
  font-weight: 500;
}

.tabs { display: flex; width: 100%; }
.tab {
  flex: 1;
  border: none;
  background: none;
  padding: 10px 0 12px;
  font-size: 11px;
  color: var(--text-soft);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-weight: 500;
  transition: color .2s ease;
}
.tab-icon { font-size: 16px; }
.tab.active { color: var(--primary); border-bottom-color: var(--accent); font-weight: 700; }
.tab:hover { color: var(--primary); }

main { flex: 1; position: relative; overflow: hidden; }

.screen { display: none; height: 100%; padding: 20px 20px 86px; overflow-y: auto; }
.screen.active { display: flex; flex-direction: column; animation: fadeIn .35s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

#discover { align-items: center; justify-content: flex-start; }
#discover .deck { margin-top: auto; }
#discover .mini-tip-link { margin-bottom: auto; }

.deck {
  position: relative;
  width: 100%;
  max-width: 340px;
  height: 470px;
  flex-shrink: 0;
  margin: 14px auto 0;
}

.card {
  position: absolute;
  inset: 0;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(108,63,197,.22);
  padding: 24px;
  display: flex;
  flex-direction: column;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform .25s ease, opacity .25s ease;
  border: 1px solid #f3eaf7;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,184,107,.25), transparent 70%);
}
.card:active { cursor: grabbing; }

.card .emoji {
  font-size: 50px;
  text-align: center;
  margin-bottom: 10px;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.08));
}
.card-avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 10px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
}
.card-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card h3 { margin: 0 0 2px; font-size: 23px; color: var(--primary-dark); font-weight: 700; }
.card .status {
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 14px;
  font-size: 13px;
  display: inline-block;
  background: #fff0f4;
  padding: 3px 10px;
  border-radius: 20px;
  align-self: flex-start;
}
.card .bio { font-size: 14.5px; color: #4a4159; line-height: 1.55; flex: 1; }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.tag {
  background: #f3ecfa;
  color: var(--primary);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 14px;
  font-weight: 600;
}

.test-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #fff7e6;
  color: #b9762f;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 10px;
  border: 1px solid #f5dba4;
  z-index: 2;
}

.mood-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  box-shadow: 0 4px 10px rgba(0,0,0,.1);
  border: 2px solid #f0e6f5;
  z-index: 2;
}
.mood-badge.helper {
  border-color: var(--success);
  box-shadow: 0 4px 14px rgba(43,182,115,.35);
}
.helper-hint {
  font-size: 12.5px;
  color: var(--success);
  font-weight: 600;
  text-align: left;
  margin: 8px 0 0;
}
.helper-note {
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
  background: #eafaf1;
  padding: 6px 10px;
  border-radius: 10px;
  margin: 0 0 10px;
  align-self: flex-start;
}

.stamp {
  position: absolute;
  top: 24px;
  font-size: 24px;
  font-weight: 800;
  border: 3px solid;
  border-radius: 10px;
  padding: 4px 12px;
  opacity: 0;
  text-transform: uppercase;
  pointer-events: none;
  letter-spacing: .5px;
}
.stamp.like { right: 20px; color: var(--success); border-color: var(--success); transform: rotate(12deg); }
.stamp.pass { left: 20px; color: var(--danger); border-color: var(--danger); transform: rotate(-12deg); }

.actions { display: flex; gap: 30px; margin-top: 20px; }
.btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  font-size: 23px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(108,63,197,.2);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn.pass { color: var(--danger); }
.btn.connect { color: var(--success); }
.btn:hover { transform: scale(1.1) translateY(-2px); }
.btn:active { transform: scale(.96); }

.hint { font-size: 12px; color: var(--text-soft); text-align: center; margin-top: 16px; line-height: 1.5; }

.mini-tip-link {
  display: inline-block;
  margin: 14px auto 0;
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  padding: 6px 14px;
  border: 1.5px solid #ffb86b;
  border-radius: 20px;
  background: #fff8f0;
}
.mini-tip-link:hover { background: linear-gradient(135deg, #ffb86b, #ff6f91); color: #fff; border-color: transparent; }

#matches h2, #profile h2, #groups h2, #checkin h2 {
  color: var(--primary-dark);
  margin-bottom: 4px;
  font-size: 21px;
  font-weight: 700;
}
.section-sub { color: var(--text-soft); font-size: 13px; margin: 0 0 18px; line-height: 1.5; }
.privacy-note {
  background: #f8f3fb;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  margin: -8px 0 16px;
  line-height: 1.4;
}

.advice-intro {
  background: linear-gradient(135deg, #f3ecfa, #fff0f4);
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  padding: 16px 18px;
  border-radius: 14px;
  margin: 0 0 18px;
}

.advice-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(108,63,197,.1);
  border: 1px solid #f3eaf7;
}
.advice-icon {
  font-size: 26px;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff0e6, #f3ecfa);
}
.advice-card h3 { font-size: 15px; color: var(--primary-dark); margin: 0 0 6px; }
.advice-card p { font-size: 13.5px; color: #4a4159; line-height: 1.55; margin: 0; }

.advice-footer {
  font-size: 12.5px;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.5;
  margin-top: 10px;
  padding: 0 8px;
}

.group-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.group-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(108,63,197,.1);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid #f3eaf7;
  transition: transform .15s ease;
}
.group-card:hover { transform: translateY(-2px); }
.group-card .g-emoji {
  font-size: 28px;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff0e6, #f3ecfa);
}
.custom-group-badge {
  display: inline-block;
  background: #fff7e6;
  color: #b9762f;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
  margin-bottom: 5px;
}
.group-card .g-title { font-weight: 700; color: var(--primary-dark); margin: 0 0 2px; font-size: 15.5px; }
.group-card .g-meta { font-size: 12px; color: var(--accent); font-weight: 600; margin: 0 0 7px; }
.group-card .g-desc { font-size: 13px; color: #4a4159; line-height: 1.5; margin: 0 0 12px; }
.group-card .g-footer { display: flex; align-items: center; justify-content: space-between; }
.group-card .g-spots { font-size: 12px; color: var(--text-soft); font-weight: 500; }
.join-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(108,63,197,.3);
  transition: transform .15s ease;
}
.join-btn:hover { transform: scale(1.05); }
.join-btn.joined { background: var(--success); box-shadow: none; }
.join-btn:disabled { cursor: default; }

.quiz-card {
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 8px 22px rgba(108,63,197,.12);
  border: 1px solid #f3eaf7;
}
.quiz-progress { font-size: 12px; color: var(--text-soft); margin-bottom: 10px; font-weight: 600; }
.quiz-question { font-size: 16.5px; font-weight: 700; color: var(--primary-dark); margin: 0 0 18px; line-height: 1.4; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  text-align: left;
  background: #f8f3fb;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: all .15s ease;
  font-weight: 500;
}
.quiz-option:hover { border-color: var(--primary); background: #f3ecfa; transform: translateX(2px); }
.quiz-result h3 { color: var(--primary-dark); margin-top: 0; font-size: 19px; }
.quiz-result p { font-size: 14px; color: #4a4159; line-height: 1.6; }
.quiz-result .suggestion {
  background: linear-gradient(135deg, #f3ecfa, #fff0f4);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--primary-dark);
  font-weight: 600;
  margin-top: 14px;
  line-height: 1.5;
}
.quiz-restart {
  margin-top: 18px;
  background: none;
  border: 2px solid var(--primary);
  color: var(--primary);
  border-radius: 20px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
}
.quiz-restart:hover { background: var(--primary); color: #fff; }

.match-list { list-style: none; padding: 0; margin: 0; }
.match-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(108,63,197,.1);
  border: 1px solid #f3eaf7;
}
.match-list .emoji {
  font-size: 26px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff0e6, #f3ecfa);
  overflow: hidden;
}
.match-list .emoji img { width: 100%; height: 100%; object-fit: cover; display: block; }
.match-list .name { font-weight: 700; color: var(--primary-dark); }
.guide-row { border-color: var(--accent-warm); background: linear-gradient(135deg, #fff9f0, #fff); }
.guide-badge {
  display: inline-block;
  margin-left: 6px;
  background: linear-gradient(135deg, var(--accent-warm), var(--accent));
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 8px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.match-list .sub { font-size: 12px; color: var(--text-soft); }

.empty-hint { color: var(--text-soft); font-size: 14px; }

.profile-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 8px 22px rgba(108,63,197,.12);
  border: 1px solid #f3eaf7;
}
.profile-card .avatar {
  font-size: 50px;
  width: 84px;
  height: 84px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe9d6, #f3ecfa);
}
.profile-card h3 { font-size: 19px; margin: 4px 0; color: var(--primary-dark); }
.profile-card .status { color: var(--accent); font-weight: 600; font-size: 13px; }
.profile-department { color: var(--text-soft); font-size: 12.5px; margin: 2px 0 0; }
.profile-card .bio { font-size: 14px; color: #4a4159; line-height: 1.6; text-align: left; margin-top: 14px; }
.profile-card .tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 16px; }

.match-list li { cursor: pointer; transition: transform .15s ease; }
.match-list li:hover { transform: translateY(-2px); }
.match-list .chevron { margin-left: auto; color: var(--text-soft); font-size: 18px; }

.chat-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: none;
  flex-direction: column;
  z-index: 20;
  animation: slideUp .25s ease;
}
.chat-overlay.open { display: flex; }

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #fff 0%, #fdf2f6 100%);
  border-bottom: 1px solid #f1e6f4;
}
.photo-consent-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 16px;
  background: #f8f3fb;
  border-bottom: 1px solid #f1e6f4;
  font-size: 12px;
  color: var(--text-soft);
}
.photo-consent-bar button {
  border: none;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  background: #f3ecfa;
  color: var(--primary);
}
.photo-consent-bar button.active { background: var(--success); color: #fff; }
.photo-consent-bar.unlocked { background: #eafaf1; color: var(--success); }

.chat-back {
  border: none;
  background: #f3ecfa;
  color: var(--primary);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}
.chat-report, .chat-block {
  border: none;
  background: #f8f3fb;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 4px;
}
.chat-report:hover { background: #fff0e6; }
.chat-block:hover { background: #fff0f2; }
.chat-avatar {
  font-size: 22px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe9d6, #f3ecfa);
  overflow: hidden;
  flex-shrink: 0;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-name { font-weight: 700; color: var(--primary-dark); font-size: 15px; }
.chat-status { font-size: 12px; color: var(--text-soft); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  position: relative;
}
.msg.them {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #f3eaf7;
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.msg.me {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-system {
  text-align: center;
  font-size: 11.5px;
  color: var(--success);
  font-weight: 600;
  margin: 6px 0;
}
.msg-sender {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 3px;
}
.msg-time {
  display: block;
  font-size: 10px;
  opacity: .65;
  margin-top: 3px;
}

.typing-indicator {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #f3eaf7;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  padding: 12px 16px;
  display: flex;
  gap: 4px;
}
.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-soft);
  animation: blink 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: .2s; }
.typing-indicator span:nth-child(3) { animation-delay: .4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: .3; }
  40% { opacity: 1; }
}

.chat-input-bar {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid #f1e6f4;
}
.chat-input-bar input {
  flex: 1;
  border: 1px solid #ecdff2;
  background: #f8f3fb;
  border-radius: 22px;
  padding: 11px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
}
.chat-input-bar input:focus { outline: 2px solid var(--primary); }
.chat-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-photo-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: #f3ecfa;
  color: var(--primary);
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
}
.chat-photo-btn:hover { background: #e9dcf6; }

.msg-photo {
  display: block;
  max-width: 200px;
  width: 100%;
  border-radius: 12px;
  margin-bottom: 4px;
}
.chat-send:hover { transform: scale(1.06); }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 13px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  box-shadow: 0 10px 26px rgba(0,0,0,.25);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
  z-index: 10;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.bnav-icon-wrap { position: relative; display: inline-flex; }
.nav-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  display: none;
}
.nav-badge.show { display: block; }

.unread-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  display: inline-block;
  margin-right: 6px;
  flex-shrink: 0;
}

#editProfileForm input {
  width: 100%;
  border: 1px solid #ecdff2;
  background: #f8f3fb;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
}
#editProfileForm input:focus { outline: 2px solid var(--primary); }

.je-delete {
  border: none;
  background: none;
  color: var(--text-soft);
  font-size: 14px;
  cursor: pointer;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 6px;
}
.je-delete:hover { background: #fff0f2; color: var(--danger); }

/* --- Bottom navigation --- */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: #fff;
  border-top: 1px solid #f1e6f4;
  box-shadow: 0 -6px 20px rgba(108,63,197,.08);
  z-index: 15;
  padding: 6px 4px;
}
.bnav-item {
  flex: 1;
  border: none;
  background: none;
  font-size: 21px;
  padding: 8px 0;
  cursor: pointer;
  border-radius: 14px;
  color: var(--text-soft);
  transition: transform .15s ease, background .15s ease;
}
.bnav-item.active { background: #f3ecfa; transform: translateY(-2px); }
.bnav-item:hover { background: #f8f3fb; }
.bnav-label { display: none; }

/* --- Onboarding --- */
.onboarding {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: linear-gradient(160deg, #43237e, #6c3fc5 60%, #ff6f91 130%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 24px;
  overflow-y: auto;
}
.onboarding.hidden { display: none; }
.onboarding-card {
  background: #fff;
  border-radius: 22px;
  padding: 28px 24px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.onboarding-logo {
  font-family: "Poppins", sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.lang-picker { display: flex; gap: 8px; margin-bottom: 16px; }
.lang-btn {
  flex: 1;
  background: #f8f3fb;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 9px 0;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
}
.lang-btn.selected { border-color: var(--primary); background: #f3ecfa; color: var(--primary-dark); }
#settingsLangPicker { margin-bottom: 0; }
.onboarding-card h2 {
  font-size: 19px;
  color: var(--primary-dark);
  margin: 0 0 8px;
  line-height: 1.3;
}
.onboarding-sub { font-size: 13px; color: var(--text-soft); line-height: 1.5; margin: 0 0 18px; }
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin: 14px 0 6px; }
#onboardingForm input[type="text"],
#onboardingForm input[type="date"],
#onboardingForm select,
#editProfileForm select {
  width: 100%;
  border: 1px solid #ecdff2;
  background: #f8f3fb;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
}
#onboardingForm input:focus,
#onboardingForm select:focus,
#editProfileForm select:focus { outline: 2px solid var(--primary); }

.text-input {
  width: 100%;
  border: 1px solid #ecdff2;
  background: #f8f3fb;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  resize: vertical;
}
.text-input:focus { outline: 2px solid var(--primary); }
#cgGenderRow { display: flex; gap: 8px; }
#cgGenderRow .builder-style-opt {
  width: auto;
  height: auto;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
}

.mood-picker { display: flex; justify-content: space-between; gap: 6px; }
.mood-opt {
  flex: 1;
  font-size: 24px;
  background: #f8f3fb;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 8px 0;
  cursor: pointer;
  transition: all .15s ease;
}
.mood-opt.selected { border-color: var(--primary); background: #f3ecfa; transform: scale(1.08); }

.avatar-hint { font-size: 11.5px; color: var(--text-soft); line-height: 1.4; margin: 0 0 8px; }
.avatar-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.avatar-opt {
  width: 42px;
  height: 42px;
  padding: 0;
  background: none;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: all .15s ease;
  overflow: hidden;
}
.avatar-opt svg, .avatar-opt img { width: 100%; height: 100%; display: block; object-fit: cover; }
.avatar-opt.selected { border-color: var(--primary); transform: scale(1.1); }

.pic-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.pic-tab {
  flex: 1;
  background: #f8f3fb;
  border: 2px solid transparent;
  color: var(--text-soft);
  border-radius: 14px;
  padding: 9px 0;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.pic-tab.selected { background: #f3ecfa; border-color: var(--primary); color: var(--primary); }
.pic-panel { margin-bottom: 6px; }

.avatar-create-btn {
  width: 100%;
  background: #f3ecfa;
  border: none;
  color: var(--primary);
  border-radius: 14px;
  padding: 10px 0;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
}
.avatar-create-btn:hover { background: #e9dcf6; }

.avatar-builder-preview-wrap {
  display: flex;
  justify-content: center;
  margin: 0 -22px 16px;
  padding: 30px 22px 14px;
  position: sticky;
  top: -26px;
  background: #fff;
  z-index: 3;
}
.avatar-builder-preview { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; box-shadow: 0 6px 18px rgba(108,63,197,.2); }
.avatar-builder-preview svg,
.avatar-builder-preview img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }

.builder-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.builder-row-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.builder-row-scroll .builder-style-opt { flex-shrink: 0; }
.builder-style-opt {
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
}
.builder-style-opt svg, .builder-style-opt img { width: 100%; height: 100%; object-fit: cover; }
.builder-style-opt.selected { border-color: var(--primary); transform: scale(1.1); }
.builder-color-opt {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.builder-color-opt.selected { border-color: var(--primary-dark); transform: scale(1.15); }

.photo-upload-btn {
  width: 100%;
  background: none;
  border: 2px dashed #d9c8ec;
  color: var(--primary);
  border-radius: 14px;
  padding: 10px 0;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
}
.photo-upload-btn:hover { background: #f8f3fb; }

.photo-preview-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.photo-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}
.photo-remove {
  border: none;
  background: #fff0f2;
  color: var(--danger);
  border-radius: 14px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.profile-pics-row { display: flex; justify-content: center; align-items: flex-start; gap: 22px; margin-bottom: 6px; }
.pic-row-hint { font-size: 11.5px; color: var(--text-soft); text-align: center; margin: 0 0 14px; line-height: 1.4; }
.pic-tag {
  display: block;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-soft);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.avatar-wrap { position: relative; width: 84px; margin: 0 auto 10px; }
.photo-wrap { position: relative; width: 84px; margin: 0 auto 10px; }
.profile-photo-circle {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #f3ecfa;
  border: 2px dashed #d9c8ec;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
}
.profile-photo-circle.has-photo { border-style: solid; border-color: var(--primary); }
.profile-photo-circle img { width: 100%; height: 100%; object-fit: cover; }

.match-profile-pic {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  margin: 0 auto 14px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
}
.match-profile-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-mood-badge {
  position: absolute;
  top: 58px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.avatar.has-photo { padding: 0; overflow: hidden; }
.avatar-photo-fab {
  position: absolute;
  top: 58px;
  left: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.avatar-photo-fab-remove {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar svg { width: 100%; height: 100%; border-radius: 50%; }

.onboarding-submit {
  width: 100%;
  margin-top: 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 13px 0;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(108,63,197,.3);
}
.onboarding-submit:hover { transform: translateY(-1px); }
.onboarding-disclaimer { font-size: 11px; color: var(--text-soft); line-height: 1.5; margin: 16px 0 0; text-align: center; }

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.5;
}
.consent-row input { margin-top: 2px; flex-shrink: 0; }
.consent-row a { color: var(--primary); font-weight: 600; }

.legal-text { max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.legal-text h3 { font-size: 13.5px; color: var(--primary-dark); margin: 14px 0 4px; }
.legal-text h3:first-child { margin-top: 0; }
.legal-text p { font-size: 12.5px; color: var(--text); line-height: 1.5; margin: 0; }

/* --- Tour visuel --- */
.tour {
  position: absolute;
  inset: 0;
  z-index: 51;
  background: linear-gradient(160deg, #43237e, #6c3fc5 60%, #ff6f91 130%);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.tour.open { display: flex; }
.tour-card {
  background: #fff;
  border-radius: 24px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 340px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
  text-align: center;
}
.tour-slide { display: none; }
.tour-slide.active { display: block; animation: fadeIn .3s ease; }
.tour-icon {
  font-size: 64px;
  width: 110px;
  height: 110px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 28px;
  background: linear-gradient(135deg, #ffe9d6, #f3ecfa);
}
.tour-title { font-family: "Poppins", sans-serif; font-size: 18px; font-weight: 700; color: var(--primary-dark); margin: 0 0 12px; }
.tour-scenario {
  background: #f8f3fb;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
  font-style: italic;
}
.tour-dots { display: flex; justify-content: center; gap: 7px; margin: 20px 0 16px; }
.tour-dot { width: 8px; height: 8px; border-radius: 50%; background: #e6d9f0; transition: all .2s ease; }
.tour-dot.active { background: var(--primary); width: 20px; border-radius: 4px; }
.tour-next {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 13px 0;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(108,63,197,.3);
}
.tour-skip {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-soft);
  font-size: 12.5px;
  margin-top: 10px;
  cursor: pointer;
  text-decoration: underline;
}

/* --- Journal --- */
.journal-form {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(108,63,197,.1);
  border: 1px solid #f3eaf7;
  margin-bottom: 18px;
}
.journal-form .mood-picker { margin-bottom: 12px; }
.journal-form textarea,
.wall-form textarea,
.journal-form select {
  width: 100%;
  border: 1px solid #ecdff2;
  background: #f8f3fb;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  resize: none;
}
.journal-form textarea:focus,
.wall-form textarea:focus,
.journal-form select:focus { outline: 2px solid var(--primary); }
.journal-submit, .wall-submit {
  margin-top: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

.journal-list { display: flex; flex-direction: column; gap: 12px; }
.journal-entry {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(108,63,197,.08);
  border: 1px solid #f3eaf7;
}
.journal-entry .je-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.journal-entry .je-mood { font-size: 20px; }
.journal-entry .je-date { font-size: 12px; color: var(--text-soft); font-weight: 600; }
.journal-entry .je-text { font-size: 14px; color: var(--text); line-height: 1.5; }
.journal-empty { color: var(--text-soft); font-size: 13px; text-align: center; padding: 20px 0; }

/* --- Wall --- */
.wall-form {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(108,63,197,.1);
  border: 1px solid #f3eaf7;
  margin-bottom: 18px;
}
.wall-list { display: flex; flex-direction: column; gap: 12px; }
.wall-post {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(108,63,197,.08);
  border: 1px solid #f3eaf7;
}
.wall-post .wp-text { font-size: 14px; color: var(--text); line-height: 1.55; margin-bottom: 8px; }
.wall-post .wp-footer { display: flex; align-items: center; justify-content: space-between; }
.wall-post .wp-author { font-size: 12px; color: var(--text-soft); font-weight: 600; }
.wall-like {
  border: none;
  background: #f3ecfa;
  color: var(--primary);
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.wall-like.liked { background: #fff0f4; color: var(--accent); }

/* --- Profile extras --- */
.profile-stats {
  display: flex;
  gap: 10px;
  margin: 14px 0;
}
.profile-stats .stat {
  flex: 1;
  background: #f8f3fb;
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
}
.profile-stats .stat-value { font-size: 18px; font-weight: 800; color: var(--primary); display: block; }
.profile-stats .stat-label { font-size: 10.5px; color: var(--text-soft); }
.profile-action {
  width: 100%;
  margin-top: 18px;
  background: none;
  border: 2px solid var(--primary);
  color: var(--primary);
  border-radius: 20px;
  padding: 11px 0;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.profile-action:hover { background: var(--primary); color: #fff; }
.profile-action + .profile-action { margin-top: 10px; }

.support-card { background: linear-gradient(135deg, #fffaf0, #fff); border-color: var(--accent-warm); }
.support-link {
  display: block;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  background: linear-gradient(135deg, var(--accent-warm), var(--accent));
  color: #fff;
  border: none;
}
.support-link:hover { background: linear-gradient(135deg, var(--accent), var(--primary)); color: #fff; }

.profile-support-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffb86b, #ff6f91);
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(255,111,145,.35);
  transition: transform .15s ease;
}
.profile-support-card:hover { transform: translateY(-2px); }
.profile-support-icon { font-size: 34px; flex-shrink: 0; }
.profile-support-text { display: flex; flex-direction: column; gap: 2px; }
.profile-support-text strong { color: #fff; font-size: 16px; font-family: "Poppins", sans-serif; }
.profile-support-text span { color: #fff; opacity: .9; font-size: 12.5px; line-height: 1.4; }

.settings-card {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 8px 22px rgba(108,63,197,.12);
  border: 1px solid #f3eaf7;
}
.settings-card h3 { color: var(--primary-dark); margin: 0 0 8px; font-size: 16px; }
.settings-desc { font-size: 13.5px; color: var(--text); margin: 0 0 18px; }
.settings-danger {
  width: 100%;
  background: #fff0f2;
  border: 2px solid var(--danger);
  color: var(--danger);
  border-radius: 20px;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.settings-danger:hover { background: var(--danger); color: #fff; }
.settings-note { font-size: 12px; color: var(--text-soft); line-height: 1.5; margin: 12px 0 0; }

/* --- SOS --- */
.sos-btn {
  position: absolute;
  right: 16px;
  bottom: 78px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ffb86b, #ff6f91);
  color: #fff;
  font-size: 21px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255,111,145,.4);
  z-index: 16;
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 8px 20px rgba(255,111,145,.4); }
  50% { box-shadow: 0 8px 26px rgba(255,111,145,.7); }
}

.sos-overlay {
  position: absolute;
  inset: 0;
  background: rgba(67,35,126,.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
}
.sos-overlay.open { display: flex; }
.sos-card {
  background: #fff;
  border-radius: 22px;
  padding: 26px 22px;
  max-width: 340px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
  max-height: 85vh;
  overflow-y: auto;
}
.sos-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: #f3ecfa;
  color: var(--primary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
}
.sos-icon { font-size: 38px; text-align: center; margin-bottom: 6px; }
.sos-card h2 { font-size: 19px; color: var(--primary-dark); text-align: center; margin: 0 0 10px; }
.sos-card p { font-size: 13.5px; color: var(--text); line-height: 1.55; text-align: center; }
.sos-line {
  background: #f8f3fb;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
}
.sos-line strong { display: block; font-size: 13.5px; color: var(--primary-dark); margin-bottom: 2px; }
.sos-line span { font-size: 12.5px; color: var(--text-soft); }
.sos-breathing {
  margin-top: 14px;
  background: linear-gradient(135deg, #fff0e6, #f3ecfa);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 600;
  color: var(--primary-dark);
}

/* --- Espace professionnels --- */
.pro-list { display: flex; flex-direction: column; gap: 14px; }
.pro-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(108,63,197,.1);
  border: 1px solid #f3eaf7;
  display: flex;
  gap: 14px;
}
.pro-avatar {
  font-size: 28px;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff0e6, #f3ecfa);
}
.pro-card h3 { font-size: 15px; color: var(--primary-dark); margin: 0 0 2px; }
.pro-title { font-size: 12px; color: var(--accent); font-weight: 600; margin: 0 0 8px; }
.pro-bio { font-size: 13px; color: #4a4159; line-height: 1.5; margin: 0 0 10px; }
.pro-price { font-size: 13px; font-weight: 700; color: var(--primary); margin: 0 0 10px; }
.pro-book-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.pro-detail-header { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }

.pro-cal-scroll { overflow-x: auto; padding-bottom: 4px; }
.pro-cal-grid {
  display: grid;
  gap: 4px;
  min-width: 480px;
}
.pro-cal-corner { background: transparent; }
.pro-cal-head {
  text-align: center;
  font-size: 10.5px;
  color: var(--text-soft);
  font-weight: 600;
  text-transform: capitalize;
  padding: 4px 2px 6px;
  border-bottom: 2px solid #f3eaf7;
}
.pro-cal-head strong { font-size: 12px; color: var(--primary-dark); }
.pro-cal-head.closed { color: #ccc; }
.pro-cal-time {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary-dark);
  background: #f8f3fb;
  border-radius: 8px;
}
.pro-cal-cell {
  border: none;
  border-radius: 8px;
  height: 38px;
  font-size: 14px;
  font-weight: 800;
  cursor: default;
}
.pro-cal-cell.available {
  background: #eafaf1;
  color: var(--success);
  cursor: pointer;
  border: 1.5px solid transparent;
}
.pro-cal-cell.available:hover { border-color: var(--success); background: #d8f5e6; }
.pro-cal-cell.mine {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  cursor: pointer;
}
.pro-cal-cell.taken { background: #f3f1f5; color: #d4cdda; }
.pro-cal-cell.closed { background: transparent; color: #e8e2ee; }

.pro-cal-legend {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-soft);
  flex-wrap: wrap;
}
.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}
.legend-dot.available { background: var(--success); }
.legend-dot.mine { background: linear-gradient(135deg, var(--primary), var(--accent)); }
.legend-dot.taken { background: #d4cdda; }

.appointment-list { display: flex; flex-direction: column; gap: 12px; }
.appointment-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(108,63,197,.08);
  border: 1px solid #f3eaf7;
  display: flex;
  align-items: center;
  gap: 12px;
}
.appointment-card .ap-emoji { font-size: 22px; }
.appointment-card .ap-info { flex: 1; min-width: 0; }
.appointment-card .ap-name { font-weight: 700; color: var(--primary-dark); font-size: 13.5px; }
.appointment-card .ap-time { font-size: 12px; color: var(--text-soft); }
.appointment-cancel {
  border: none;
  background: #fff0f2;
  color: var(--danger);
  border-radius: 14px;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

/* ====================================================== */
/* --- Vue ordinateur (écrans larges) --- */
/* ====================================================== */
@media (min-width: 900px) {
  body { padding: 32px; align-items: center; overflow: hidden; height: 100vh; }

  .app {
    max-width: 1080px;
    height: 88vh;
    min-height: unset;
    min-height: 600px;
    border-radius: 24px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto 1fr;
    position: relative;
  }

  .topbar {
    grid-column: 1;
    grid-row: 1;
    position: static;
    align-items: flex-start;
    padding: 28px 22px;
    border-bottom: none;
    border-right: 1px solid #f1e6f4;
  }
  .tagline { text-align: left; margin-bottom: 0; }

  .bottom-nav {
    grid-column: 1;
    grid-row: 2;
    position: static;
    flex-direction: column;
    height: auto;
    border-top: none;
    border-right: 1px solid #f1e6f4;
    box-shadow: none;
    padding: 12px;
    gap: 4px;
  }
  .bnav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 11px 14px;
    font-size: 18px;
    border-radius: 12px;
  }
  .bnav-item.active { transform: none; }
  .bnav-label { display: inline; font-size: 14px; font-weight: 600; font-family: "Inter", sans-serif; }

  main {
    grid-column: 2;
    grid-row: 1 / span 2;
    overflow: hidden;
  }
  .screen { padding: 36px 44px; height: 100%; }

  .sos-btn { right: 28px; bottom: 28px; }

  .deck { max-width: 380px; height: 480px; }

  .group-list, .wall-list, .match-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .journal-list, .journal-form, .wall-form { max-width: 640px; }

  .profile-card { max-width: 460px; margin-left: auto; margin-right: auto; }

  .onboarding-card { max-width: 420px; }
}

/* --- Bouton de bascule mobile/desktop --- */
.device-toggle-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(108,63,197,.25);
  z-index: 100;
}
.device-toggle-btn:hover { transform: scale(1.06); }

/* Force l'affichage mobile même sur grand écran, quel que soit le media query desktop ci-dessus */
body.preview-mobile {
  display: flex;
  justify-content: center;
  align-items: center;
}
body.preview-mobile .app {
  max-width: 400px !important;
  width: 100%;
  height: 92vh !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 28px !important;
  border: 8px solid #1a1126;
  box-shadow: 0 20px 60px rgba(0,0,0,.5) !important;
}
body.preview-mobile .topbar {
  flex-direction: column !important;
  align-items: center !important;
  padding: 22px 16px 0 !important;
  border-right: none !important;
  border-bottom: 1px solid #f1e6f4 !important;
}
body.preview-mobile .tagline { text-align: center !important; margin-bottom: 10px !important; }
body.preview-mobile .bottom-nav {
  flex-direction: row !important;
  border-right: none !important;
  border-top: 1px solid #f1e6f4 !important;
  box-shadow: 0 -6px 20px rgba(108,63,197,.08) !important;
  padding: 6px 4px !important;
  gap: 0 !important;
}
body.preview-mobile .bnav-item {
  flex-direction: column !important;
  justify-content: center !important;
  padding: 8px 0 !important;
  font-size: 21px !important;
}
body.preview-mobile .bnav-label { display: none !important; }
body.preview-mobile main { overflow: hidden; }
body.preview-mobile .screen { padding: 20px 20px 86px !important; height: 100% !important; }
body.preview-mobile .sos-btn { right: 16px !important; bottom: 78px !important; }
body.preview-mobile #discover { justify-content: flex-start !important; }
body.preview-mobile .deck { max-width: 340px !important; height: 470px !important; }
body.preview-mobile .group-list,
body.preview-mobile .wall-list,
body.preview-mobile .match-list,
body.preview-mobile .pro-list {
  display: flex !important;
  flex-direction: column !important;
}
body.preview-mobile .journal-list,
body.preview-mobile .journal-form,
body.preview-mobile .wall-form,
body.preview-mobile .profile-card,
body.preview-mobile .onboarding-card {
  max-width: none !important;
}
