/* ══════════════════════════════════════════════
   WHISPER CHAT — V3 GUARANTEED WORKING
   Mobile screenshot debugged
══════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0b0b10;
  --bg2: #111118;
  --bg3: #18181f;
  --bg4: #20202a;
  --accent: #6c63ff;
  --accent2: #8b83ff;
  --accent-glow: #6c63ff40;
  --accent-dim: #6c63ff18;
  --teal: #00c9a7;
  --teal-dim: #00c9a715;
  --pink: #ff6b9d;
  --pink-dim: #ff6b9d15;
  --amber: #ffc146;
  --text: #eeeef5;
  --text2: #8888a8;
  --text3: #4a4a68;
  --border: #ffffff0d;
  --border2: #ffffff18;
  --border3: #ffffff28;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-full: 9999px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --topbar-h: 56px;
  --sidebar-w: 260px;
}

body.light {
  --bg:#f5f5fa; --bg2:#ffffff; --bg3:#f0f0f8; --bg4:#e8e8f5;
  --text:#111120; --text2:#555575; --text3:#9090aa;
  --border:#00000010; --border2:#00000018; --border3:#00000028;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.skip-link { position: absolute; top: -100px; left: 16px; z-index: 9999; background: var(--accent); color: #fff; padding: 8px 16px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 8px; }

/* ══ BASE — page can scroll normally on mobile ══ */
html, body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ══ TOPBAR — sticky at top, ALWAYS visible ══ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none; }
.logo-icon { font-size: 22px; }
.logo-name { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--text); }
.logo-tag { font-size: 9px; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border-radius: var(--radius-full); background: var(--accent-dim); color: var(--accent2); }
.topbar-center { display: none; }
.topbar-right { display: flex; gap: 6px; }
.tb-btn { width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border2); background: transparent; cursor: pointer; font-size: 16px; color: var(--text2); display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.tb-btn:hover { background: var(--bg3); color: var(--text); }
.status-pill { display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-full); border: 1px solid var(--border2); background: var(--bg3); font-size: 12px; color: var(--text2); }
.status-pill.connected { border-color: var(--teal-dim); background: var(--teal-dim); color: var(--teal); }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); animation: pulse-anim 2.5s infinite; }
@keyframes pulse-anim { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.8)} }

/* ══ LAYOUT ══ */
.layout {
  display: flex;
  position: relative;
  min-height: calc(100vh - var(--topbar-h));
}

/* ══ SIDEBAR — drawer on mobile, fixed on desktop ══ */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 200;
  transform: translateX(-110%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.sidebar.open { transform: translateX(0); box-shadow: 4px 0 32px rgba(0,0,0,0.5); }
.sidebar-tabs { display: flex; flex-shrink: 0; border-bottom: 1px solid var(--border); }
.stab { flex:1; padding:12px 6px; background:transparent; border:none; cursor:pointer; font-size:12px; font-weight:600; color:var(--text3); font-family:var(--font-body); border-bottom:2px solid transparent; transition:all .15s; display:flex; align-items:center; justify-content:center; gap:4px; }
.stab.active { color:var(--accent2); border-bottom-color:var(--accent); }
.friend-notif-dot { width:7px; height:7px; border-radius:50%; background:var(--pink); animation:pulse-anim 1.5s infinite; }
.sidebar-panel { flex:1; overflow-y:auto; display:none; flex-direction:column; }
.sidebar-panel.active { display:flex; }
.panel-label { padding:12px 14px 6px; font-size:10px; font-weight:700; letter-spacing:1px; text-transform:uppercase; color:var(--text3); }
.empty-state { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; padding:24px 16px; text-align:center; color:var(--text3); }
.empty-icon { font-size:32px; }
.empty-state strong { font-size:13px; color:var(--text2); }
.empty-state span { font-size:12px; line-height:1.5; }
.recent-item, .friend-item { display:flex; align-items:center; gap:10px; padding:10px 12px; cursor:pointer; transition:background .12s; border-left:2px solid transparent; }
.recent-item:hover,.friend-item:hover { background:var(--bg3); }
.recent-item.is-active { background:var(--accent-dim); border-left-color:var(--accent); }
.item-av { width:38px; height:38px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:15px; font-weight:700; position:relative; }
.item-av-dot { position:absolute; bottom:1px; right:1px; width:10px; height:10px; border-radius:50%; border:2px solid var(--bg2); }
.item-info { flex:1; min-width:0; }
.item-name { font-size:13px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.item-prev { font-size:11px; color:var(--text3); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.item-meta { display:flex; flex-direction:column; align-items:flex-end; gap:4px; flex-shrink:0; }
.item-time { font-size:10px; color:var(--text3); }
.item-badge { font-size:9px; font-weight:700; padding:2px 7px; border-radius:var(--radius-full); background:var(--teal-dim); color:var(--teal); }
.friend-chat-btn { width:30px; height:30px; border-radius:var(--radius-sm); background:var(--accent-dim); border:none; cursor:pointer; color:var(--accent2); font-size:14px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.sidebar-footer { padding:12px; border-top:1px solid var(--border); flex-shrink:0; }
.btn-start-sidebar { width:100%; padding:13px; border-radius:var(--radius); background:var(--accent); color:#fff; border:none; font-size:14px; font-weight:700; cursor:pointer; font-family:var(--font-body); display:flex; align-items:center; justify-content:center; gap:8px; }

/* ══ MAIN AREA — full width on mobile, scrollable ══ */
.main-area {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* ══ SCREENS — display block, full width, content shows fully ══ */
.screen {
  display: none;
  width: 100%;
  padding: 24px 16px 40px;
}
.screen.active { display: block; }

/* HOME CONTENT */
.home-bg-dots { display: none; }

.home-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.home-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--accent-dim);
  color: var(--accent2);
  border: 1px solid var(--accent-glow);
}

.home-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--text);
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent2) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-sub {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.7;
}

/* GENDER + NAME PICKER */
.gender-filter, .name-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.gender-btns {
  display: flex;
  gap: 8px;
  width: 100%;
}
.gender-btn {
  flex: 1;
  padding: 12px 4px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
}
.gender-btn:hover { border-color: var(--accent); color: var(--accent2); background: var(--accent-dim); }
.gender-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.name-row {
  display: flex;
  gap: 8px;
  width: 100%;
}
.name-input {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
}
.name-input:focus { border-color: var(--accent); }
.name-input::placeholder { color: var(--text3); }
.shuffle-btn {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--bg3);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.shuffle-btn:hover { background: var(--accent-dim); border-color: var(--accent); transform: rotate(180deg); }

/* ACTION BUTTONS */
.home-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.btn-primary {
  width: 100%;
  padding: 15px 20px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-primary:hover { background: #5a52ee; transform: translateY(-1px); }
.btn-glow { box-shadow: 0 0 20px var(--accent-glow); }
.btn-secondary {
  width: 100%;
  padding: 15px 20px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
  font-size: 15px;
  cursor: pointer;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
}
.btn-secondary:hover { background: var(--bg3); color: var(--text); }
.btn-sm { padding: 10px 20px; font-size: 13px; width: auto; }

/* FEATURE PILLS */
.feature-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 5px 11px; border-radius: var(--radius-full); border: 1px solid var(--border2); background: var(--bg3); font-size: 11px; color: var(--text2); }

/* INTERESTS */
.card-box { background:var(--bg2); border:1px solid var(--border2); border-radius:22px; padding:24px 18px; width:100%; max-width:500px; margin:0 auto; display:flex; flex-direction:column; gap:16px; }
.card-title { font-family:var(--font-display); font-size:22px; font-weight:700; color:var(--text); }
.card-sub { font-size:13px; color:var(--text2); }
.chip-grid { display:flex; flex-wrap:wrap; gap:8px; }
.chip { padding:8px 16px; border-radius:var(--radius-full); border:1px solid var(--border2); background:var(--bg3); color:var(--text2); font-size:13px; font-weight:500; cursor:pointer; font-family:var(--font-body); }
.chip:hover,.chip.sel { background:var(--accent-dim); border-color:var(--accent); color:var(--accent2); font-weight:600; }
.card-actions { display:flex; gap:10px; }
.card-actions .btn-primary,.card-actions .btn-secondary { flex:1; }

/* SEARCHING */
.search-box { display:flex; flex-direction:column; align-items:center; gap:18px; text-align:center; padding:40px 20px; width:100%; max-width:400px; margin:0 auto; }
.search-animation { position:relative; width:80px; height:80px; display:flex; align-items:center; justify-content:center; }
.search-ring { position:absolute; border-radius:50%; border:2px solid var(--accent); animation:ring-expand 2s linear infinite; }
.ring1{width:40px;height:40px} .ring2{width:60px;height:60px;animation-delay:.6s} .ring3{width:80px;height:80px;animation-delay:1.2s}
@keyframes ring-expand{0%{opacity:1;transform:scale(.5)} 100%{opacity:0;transform:scale(1.2)}}
.search-core { font-size:28px; z-index:1; animation:float-anim 3s infinite; }
@keyframes float-anim{0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)}}
.search-title { font-family:var(--font-display); font-size:22px; font-weight:700; color:var(--text); }
.search-sub { font-size:14px; color:var(--text2); }

/* ══ CHAT SCREEN — FIXED full screen, NOT inside scrollable area ══ */
.chat-screen {
  display: none;
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  flex-direction: column;
  background: var(--bg);
  z-index: 80;
}
.chat-screen.active { display: flex; }

.chat-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  gap: 8px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  min-height: 60px;
}
.chat-header-left { display:flex; align-items:center; gap:10px; flex:1; min-width:0; }
.chat-av { width:40px; height:40px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:15px; font-weight:700; position:relative; }
.chat-av-dot { position:absolute; bottom:2px; right:2px; width:10px; height:10px; border-radius:50%; border:2px solid var(--bg2); }
.chat-info { min-width:0; }
.chat-name { font-size:14px; font-weight:600; color:var(--text); display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chat-status { font-size:10px; color:var(--text2); }

.chat-header-right { display: flex; gap: 6px; flex-shrink: 0; }
.hdr-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  background: var(--bg3);
  cursor: pointer;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  padding: 0;
}
.btn-label { display: none; }
.btn-friend { border-color: #00c9a730; background: var(--teal-dim); }
.btn-friend.added { opacity: .6; cursor: default; }
.btn-skip { border-color: var(--border2); }
.btn-end { border-color: #ff6b9d30; background: var(--pink-dim); }

.mood-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.mood-bar::-webkit-scrollbar { display: none; }
.mood-label { font-size: 10px; font-weight: 700; color: var(--text3); white-space: nowrap; text-transform: uppercase; letter-spacing: .5px; flex-shrink: 0; display: none; }
.mood-chips { display: flex; gap: 6px; }
.mood-chip { padding: 5px 13px; border-radius: var(--radius-full); border: 1px solid var(--border); background: transparent; font-size: 11px; font-weight: 600; cursor: pointer; color: var(--text2); font-family: var(--font-body); white-space: nowrap; transition: all .15s; }
.mood-chip.active,.mood-chip:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent2); }

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
}
.sys-msg { align-self:center; font-size:11px; color:var(--text3); padding:5px 14px; border-radius:var(--radius-full); background:var(--bg3); border:1px solid var(--border); margin:6px 0; text-align:center; }
.msg-row { display:flex; align-items:flex-end; gap:8px; max-width:88%; animation:msg-slide .22s cubic-bezier(.34,1.56,.64,1); }
.msg-row.me { align-self:flex-end; flex-direction:row-reverse; }
.msg-row.them { align-self:flex-start; }
@keyframes msg-slide{from{opacity:0;transform:translateY(8px) scale(.96)} to{opacity:1;transform:translateY(0) scale(1)}}
.msg-av { width:28px; height:28px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; }
.msg-body { display:flex; flex-direction:column; gap:3px; }
.msg-row.me .msg-body { align-items:flex-end; }
.msg-row.them .msg-body { align-items:flex-start; }
.bubble { padding:10px 14px; border-radius:18px; font-size:14px; line-height:1.5; word-break:break-word; }
.bubble.me { background:var(--accent); color:#fff; border-bottom-right-radius:4px; }
.bubble.them { background:var(--bg3); color:var(--text); border:1px solid var(--border2); border-bottom-left-radius:4px; }
.msg-time { font-size:10px; color:var(--text3); padding:0 4px; }

.typing-row { display:flex; align-items:flex-end; gap:8px; align-self:flex-start; }
.typing-bubble { padding:12px 16px; border-radius:18px; border-bottom-left-radius:4px; background:var(--bg3); border:1px solid var(--border2); display:flex; gap:5px; align-items:center; }
.td { width:7px; height:7px; border-radius:50%; background:var(--accent2); animation:typing-bop 1.2s infinite; }
.td:nth-child(2){animation-delay:.2s} .td:nth-child(3){animation-delay:.4s}
@keyframes typing-bop{0%,60%,100%{transform:translateY(0);opacity:.4} 30%{transform:translateY(-6px);opacity:1}}

.disc-bar { flex-shrink:0; padding:10px 14px; display:flex; align-items:center; justify-content:space-between; background:var(--pink-dim); border-top:1px solid #ff6b9d25; }
.disc-text { font-size:12px; color:var(--pink); font-weight:600; }
.disc-new-btn { padding:8px 16px; border-radius:var(--radius-full); background:var(--pink-dim); border:1px solid #ff6b9d30; color:var(--pink); font-size:12px; font-weight:700; cursor:pointer; font-family:var(--font-body); }

.input-area {
  flex-shrink: 0;
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.input-wrap { flex:1; border:1.5px solid var(--border2); border-radius:22px; background:var(--bg3); padding:10px 14px; display:flex; gap:8px; align-items:flex-end; transition:border-color .15s; }
.input-wrap:focus-within { border-color:var(--accent); }
.msg-input { flex:1; background:transparent; border:none; outline:none; font-size:15px; font-family:var(--font-body); color:var(--text); resize:none; max-height:100px; line-height:1.5; }
.msg-input::placeholder { color:var(--text3); }
.msg-input:disabled { opacity:.4; }
.char-count { font-size:10px; color:var(--text3); flex-shrink:0; align-self:flex-end; margin-bottom:2px; display:none; }
.send-btn { width:46px; height:46px; border-radius:14px; flex-shrink:0; background:var(--accent); border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; color:#fff; transition:all .15s; }
.send-btn:hover { background:#5a52ee; transform:scale(1.05); }
.send-btn:disabled { opacity:.35; cursor:not-allowed; }

/* ══ TOAST — HIDDEN by default, only shows when .show class added ══ */
.toast {
  display: none; /* CRITICAL: hidden by default */
  position: fixed;
  bottom: 80px;
  left: 12px;
  right: 12px;
  z-index: 500;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.toast.show { display: block; animation: toast-in 0.35s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes toast-in { from { transform: translateY(120%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.toast-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.toast-av { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.toast-info { flex: 1; }
.toast-info strong { font-size: 13px; color: var(--text); display: block; }
.toast-info span { font-size: 11px; color: var(--text2); }
.toast-close { background: transparent; border: none; cursor: pointer; color: var(--text3); font-size: 18px; padding: 2px; flex-shrink: 0; }
.toast-actions { display: flex; gap: 8px; }
.toast-btn { flex: 1; padding: 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; cursor: pointer; font-family: var(--font-body); border: none; }
.toast-btn.accept { background: var(--teal); color: #000; }
.toast-btn.decline { background: var(--bg4); color: var(--text2); border: 1px solid var(--border); }

/* FOOTER */
.site-footer { background:var(--bg2); border-top:1px solid var(--border); padding:14px 16px; }
.footer-inner { max-width:900px; margin:0 auto; display:flex; flex-direction:column; gap:10px; }
.footer-logo { display:flex; align-items:center; gap:6px; font-size:14px; font-weight:700; color:var(--text2); }
.footer-links { display:flex; gap:14px; flex-wrap:wrap; }
.footer-links a { font-size:12px; color:var(--text3); text-decoration:none; }
.footer-copy { font-size:11px; color:var(--text3); }

.sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 149; background: rgba(0,0,0,.6); }
.sidebar-overlay.show { display: block; }

/* ══════════════════════════════
   DESKTOP (769px+)
══════════════════════════════ */
@media (min-width: 769px) {
  :root { --topbar-h: 58px; }

  html, body { height: 100%; overflow: hidden; min-height: auto; }

  .topbar-center { display: flex; }

  .layout {
    height: calc(100vh - var(--topbar-h));
    overflow: hidden;
  }

  /* Sidebar visible always on desktop */
  .sidebar {
    position: relative;
    top: auto;
    left: auto;
    bottom: auto;
    transform: none !important;
    width: var(--sidebar-w);
    height: 100%;
    z-index: 1;
    box-shadow: none;
    flex-shrink: 0;
  }
  .sidebar.collapsed { width: 0; overflow: hidden; }

  .main-area { height: 100%; overflow: hidden; }

  .screen { display: none; height: 100%; overflow-y: auto; padding: 40px 24px; align-items: center; }
  .screen.active { display: flex; flex-direction: column; justify-content: center; align-items: center; }

  .home-content { text-align: center; align-items: center; }
  .home-badge { align-self: center; }
  .gender-filter, .name-picker { align-items: center; }
  .home-actions { flex-direction: row; width: auto; }
  .btn-primary, .btn-secondary { width: auto; padding: 13px 28px; }

  .chat-screen { position: relative; top: auto; left: auto; right: auto; bottom: auto; height: 100%; }

  .hdr-btn { width: auto; height: 38px; border-radius: var(--radius-sm); padding: 0 14px; font-size: 13px; gap: 6px; }
  .btn-label { display: inline; }

  .toast { position: absolute; top: 68px; bottom: auto; left: auto; right: 12px; width: 300px; }

  .char-count { display: block; }
  .mood-label { display: block; }
  .home-title { font-size: clamp(30px, 4vw, 46px); }

  

  .footer-inner { flex-direction: row; justify-content: space-between; align-items: center; }
}

@media (min-width: 1200px) {
  :root { --sidebar-w: 300px; }
  .msg-row { max-width: 65%; }
}

@media (max-width: 360px) {
  .gender-btn { font-size: 11px; padding: 11px 3px; }
  .home-title { font-size: 26px; }
  .hdr-btn { width: 36px; height: 36px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}


/* ── New gender selector buttons ── */
.my-gender-btn, .pref-btn {
  flex: 1;
  padding: 12px 4px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
}
.my-gender-btn:hover, .pref-btn:hover {
  border-color: var(--accent);
  color: var(--accent2);
  background: var(--accent-dim);
}
.my-gender-btn.active, .pref-btn.active,
.my-gender-btn[aria-pressed="true"], .pref-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
