/* =====================================================================
   Chat app design: violet theme, icon rail, card lists, avatar messages.
   Applies to the chat app only (the login page keeps the Appearance theme).
   Loaded after app.css and overrides it.
   ===================================================================== */
.app, .pw-dlg, .toast, .lightbox {
  --primary: #5b3df5;
  --primary-2: #3b1fc1;
  --bg: #f7f7fb;
  --card: #ffffff;
  --panel: #ffffff;
  --text: #0f1222;
  --muted: #6b7280;
  --line: #ececf3;
  --field: #f3f3f8;
  --ink: #1f2937;
  --soft: #efeafe;
  --bubble-them: #ffffff;
  --bubble-me: #3b1fc1;
  --pink: var(--primary);
  --pink-2: var(--primary-2);
  --primary-soft: var(--soft);
  --online: #22c55e;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px -18px rgba(16, 24, 40, .22);
  --side-w: 360px;
}
.app[data-theme=dark], html[data-chat-theme=dark] .pw-dlg, html[data-chat-theme=dark] .toast {
  --bg: #0c0c14;
  --card: #161622;
  --panel: #13131d;
  --text: #f3f4f8;
  --muted: #9aa0ae;
  --line: #262636;
  --field: #1d1d2b;
  --ink: #e5e7eb;
  --soft: #251e4a;
  --bubble-them: #1b1b28;
  --bubble-me: #4b2fe0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -18px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
:root { --row-h: 72px; }

/* ---------- login page: glass card over a pastel Dubai skyline ---------- */
.login { --lg-ink: #121a3d; --lg-muted: #6b7290; --lg-line: #e4e7f2; --lg-tile: #eef0fb; --lg-blue: #2f6bff; --lg-violet: #7c3aed;
  background: #e9ecfb; padding: 28px 16px 10px; color: var(--lg-ink); }
.login.pattern::before { display: none; }
/* background art: sky + water stretch, skyline pieces stick to the edges, ribbons to the corners */
.lg-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.lg-bg svg { position: absolute; display: block; }
.lg-sky { inset: 0; width: 100%; height: 100%; }
.lg-left { left: -10px; bottom: 28%; height: min(30vh, 290px); width: auto; aspect-ratio: 320 / 262; -webkit-box-reflect: below 0 linear-gradient(transparent 40%, rgba(255,255,255,.28)); }
.lg-burj { right: max(1vw, 4px); bottom: 28%; height: min(68vh, 680px); width: auto; aspect-ratio: 230 / 632; -webkit-box-reflect: below 0 linear-gradient(transparent 60%, rgba(255,255,255,.25)); }
.lg-rb { width: 230px; height: 230px; filter: drop-shadow(0 10px 24px rgba(47, 107, 255, .25)); }
.lg-rb1 { left: -70px; top: -80px; transform: rotate(-20deg); }
.lg-rb2 { left: -120px; bottom: 16%; transform: rotate(150deg) scale(.95); }
.lg-rb3 { right: -90px; bottom: -110px; transform: rotate(40deg); }
/* default background: Dubai at night (public/login-bg.jpg), fitted to fill the screen; an Appearance upload replaces it */
.login { background: #1c1712 url('/login-bg.jpg') center / cover no-repeat; }
.login .lg-bg { display: none; }
.login::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(180deg, rgba(10, 8, 20, .15), rgba(10, 8, 20, .35)); }
.login.photo { background: #1c1712 var(--login-photo) center / cover no-repeat; }
/* outer card: glowing frosted white glass over the photo; the white form panel inside stays solid */
.login form.card { background: linear-gradient(145deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .16) 55%, rgba(255, 255, 255, .26));
  border: 1px solid rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(20px) saturate(1.4) brightness(1.08); backdrop-filter: blur(20px) saturate(1.4) brightness(1.08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 0 45px rgba(255, 255, 255, .22), 0 0 90px rgba(140, 160, 255, .18),
    0 30px 70px -30px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 0 30px rgba(255, 255, 255, .16); }
.login form.card .brand-name { color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .25); }
.login form.card .brand-name .accent { background: linear-gradient(135deg, #8ab8ff 0%, #b49bff 55%, #f09bff 100%); -webkit-background-clip: text; background-clip: text; text-shadow: none; }
.login form.card .tagline { color: rgba(255, 255, 255, .85); }
.login form.card .lg-title { color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .25); }
.login form.card .lg-title .grad { background: linear-gradient(90deg, #8ab8ff, #b4a6ff); -webkit-background-clip: text; background-clip: text; text-shadow: none; }
.login form.card > .fine { color: rgba(255, 255, 255, .88); text-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
.login form.card .lg-panel { background: rgba(255, 255, 255, .96); box-shadow: 0 0 30px rgba(255, 255, 255, .25), 0 10px 30px -18px rgba(0, 0, 0, .35); }
.login form.card .live-pill { color: #fff; background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .45); box-shadow: 0 0 14px rgba(255, 255, 255, .2); }
.login form.card .live-pill svg { stroke: #fff; }
/* every form field gets a crisp 1px drop shadow */
.login form.card .ctl:not(.float), .login form.card .ctl.float input, .login form.card .seg input:not(:checked) + span { box-shadow: 0 1px 1px rgba(16, 24, 40, .16); }
.login form.card .ctl:not(.float):focus-within, .login form.card .ctl.float input:focus { box-shadow: 0 1px 1px rgba(16, 24, 40, .16), 0 0 0 3px rgba(47, 107, 255, .12); }
/* drop shadow on the logo mark and the ChateX wordmark */
.login form.card .logo { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)) drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
.login form.card .brand-name { filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .4)) drop-shadow(0 1px 2px rgba(0, 0, 0, .3)); text-shadow: none; }
.login .credit { color: rgba(255, 255, 255, .55); }
.login .seo-about { background: rgba(255, 255, 255, .88); }

/* the card */
.login .card { max-width: 500px; padding: 26px 26px 18px; gap: 0; border-radius: 34px; overflow: visible;
  background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: blur(22px) saturate(1.3); backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: 0 30px 70px -30px rgba(60, 80, 160, .35), inset 0 1px 0 rgba(255, 255, 255, .9); }
.login .card > * { position: relative; }
.login .card > .hero, .login .card > .hero-edge, .login .card > .card-swoosh { display: none; }
/* the whole card and everything in it at 80% (phones keep full size so inputs stay readable and iOS doesn't zoom) */
@media (min-width: 521px) { .login .card { zoom: .8; } }
.lg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.login .brand-block { gap: 12px; max-width: none; align-items: center; }
.login .logo { width: 48px; height: 48px; filter: drop-shadow(0 8px 14px rgba(91, 61, 245, .35)); }
.login .brand-name { font-size: 36px; font-weight: 700; letter-spacing: -.035em; color: var(--lg-ink); line-height: 1; }
.login .brand-name .accent { background: linear-gradient(135deg, #2f6bff 0%, #6d4bff 55%, #a855f7 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login .tagline { margin-top: 7px; font-size: 10.5px; font-weight: 600; letter-spacing: .34em; color: #50577a; }
.live-pill { flex: none; display: inline-flex; align-items: center; gap: 7px; margin-top: 2px; padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  color: #3b4263; background: rgba(255, 255, 255, .7); border: 1px solid rgba(255, 255, 255, .95); box-shadow: 0 4px 14px -6px rgba(60, 80, 160, .25); white-space: nowrap; }
.live-pill svg { width: 15px; height: 15px; fill: none; stroke: #3b4263; stroke-width: 1.9; stroke-linecap: round; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.lg-title { text-align: center; margin: 22px 0 0; font-size: 29px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; color: var(--lg-ink); }
.lg-title .grad { background: linear-gradient(90deg, #2f6bff, #5b4bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login .tag { margin: 10px 0 0; max-width: 100%; font-size: 14.5px; line-height: 1.5; font-weight: 400; color: var(--lg-muted); }
.login .notice { margin-top: 12px; }

/* the form panel */
.lg-panel { display: grid; gap: 14px; margin-top: 22px; padding: 20px 18px 16px; border-radius: 24px; background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(255, 255, 255, .95); box-shadow: 0 10px 30px -18px rgba(60, 80, 160, .3); }
.login .field { gap: 7px; }
.login .lbl { font-size: 12.5px; font-weight: 500; color: var(--lg-muted); }
.login .frow { gap: 12px; align-items: flex-end; }
.login .ibadge { display: grid; width: 44px; height: 44px; border-radius: 13px; background: var(--lg-tile); color: #3b5bdb; box-shadow: none; }
.login .ibadge svg { width: 21px; height: 21px; stroke-width: 1.7; }
.login .ctl { min-height: 44px; border-radius: 14px; background: #fff; border: 1px solid var(--lg-line); box-shadow: 0 1px 2px rgba(16, 24, 40, .03); }
.login .ctl:focus-within { background: #fff; border-color: #8b9cff; box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }
.login .ctl input, .login .ctl select { padding: 11px 14px; font-size: 15px; font-weight: 500; color: var(--lg-ink); }
.login .ctl.select::after { right: 16px; width: 8px; height: 8px; border-color: var(--lg-ink); border-width: 0 2px 2px 0; opacity: 1; }
/* label above the box (Username / Password) */
.login .ctl.float { display: grid; gap: 7px; padding: 0; min-height: 0; background: none; border: 0; box-shadow: none; }
.login .ctl.float:focus-within { box-shadow: none; }
.login .ctl.float > span { padding: 0 2px; font-size: 12.5px; font-weight: 500; color: var(--lg-muted); }
.login .ctl.float input { height: 44px; padding: 0 44px 0 14px; border-radius: 14px; background: #fff; border: 1px solid var(--lg-line); box-shadow: 0 1px 2px rgba(16, 24, 40, .03); }
.login .ctl.float input:focus { border-color: #8b9cff; box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }
.login .ok-ic { position: absolute; right: 13px; bottom: 12px; width: 21px; height: 21px; display: none; }
.login .ok-ic circle { fill: #16a34a; }
.login .ok-ic path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.login #fName:valid ~ .ok-ic { display: block; }
.login .ctl.country .flag { left: 14px; width: 30px; height: 21px; border-radius: 4px; }
.login .ctl.country select { padding-left: 56px; }

/* gender | age */
.login .duo { grid-template-columns: minmax(0, 1fr) minmax(0, .82fr); gap: 0; align-items: end; }
.login .gender-field { padding-right: 16px; }
.login .age-field { padding-left: 16px; border-left: 1px solid var(--lg-line); }
.login .seg { gap: 10px; }
.login .seg span { min-height: 44px; gap: 8px; padding: 8px 10px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--lg-ink);
  background: #fff; border: 1px solid var(--lg-line); box-shadow: 0 1px 2px rgba(16, 24, 40, .03); }
.login .seg span svg { width: 20px; height: 20px; stroke-width: 1.9; }
.login .seg input[value=f] + span svg { color: #ec4899; }
.login .seg input[value=m] + span svg { color: #2f6bff; }
.login .seg input:checked + span { color: #fff; border-color: transparent; }
.login .seg input:checked + span svg { color: #fff; }
.login .seg input[value=m]:checked + span { background: linear-gradient(135deg, #3b82f6, #2f5bff); box-shadow: 0 10px 20px -8px rgba(47, 91, 255, .6); }
.login .seg input[value=f]:checked + span { background: linear-gradient(135deg, #f472b6, #ec4899); box-shadow: 0 10px 20px -8px rgba(236, 72, 153, .55); }

/* detected location + bot check */
.geo-box { position: relative; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; column-gap: 14px; row-gap: 2px;
  padding: 14px 16px; border-radius: 16px; background: linear-gradient(120deg, #eafaf3, #e7f6fb); border: 1px solid #c4ecdc; }
.geo-box:has(#geoHint[hidden]):has(#capStatus[hidden]) { display: none; }
.card[data-mode=login] .geo-box:has(#capStatus[hidden]), .card[data-mode=register] .geo-box:has(#capStatus[hidden]) { display: none; }
.login .geo-hint { display: contents; }
.login .geo-hint[hidden], .card[data-mode=login] .geo-hint { display: none !important; }
.login .geo-hint img { grid-column: 1; grid-row: 1 / span 2; width: 52px; height: 38px; object-fit: cover; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.login .geo-hint .gh-shield { grid-column: 2; grid-row: 1 / span 2; width: 26px; height: 26px; color: #16a34a; }
.login .gh-txt { grid-column: 3; grid-row: 1; display: grid; gap: 2px; min-width: 0; }
.login .gh-l { font-size: 12.5px; color: var(--lg-muted); }
.login .gh-txt b { font-size: 14px; font-weight: 600; color: #15803d; }
.login .gh-txt .muted { font-size: 11.5px; color: var(--lg-muted); }
.login .cap-status { grid-column: 3; grid-row: 2; margin: 0; font-size: 12.5px; font-weight: 500; color: var(--lg-muted); }
.login .cap-status[data-state=ok] { color: #15803d; }
.login .geo-box:has(#geoHint[hidden]) .cap-status, .card[data-mode=login] .cap-status, .card[data-mode=register] .cap-status { grid-column: 1 / 4; grid-row: 1; }
.geo-globe { grid-column: 4; grid-row: 1 / span 2; width: 50px; height: 50px; filter: drop-shadow(0 6px 10px rgba(47, 125, 224, .3)); }
.login .err { font-size: 13px; }
.login .btn { margin-top: 2px; min-height: 52px; padding: 13px 18px; border-radius: 999px; font-size: 17px; font-weight: 600;
  background: linear-gradient(90deg, #2f80ff 0%, #4a5cff 50%, #7c3aed 100%); box-shadow: 0 16px 30px -14px rgba(60, 80, 255, .7); }
.login .btn .bi { width: 21px; height: 21px; }
.login .mode-links { margin: 0; text-align: center; font-size: 13.5px; color: var(--lg-muted); }
.login .mode-links a { color: #2f5bff; font-weight: 600; text-decoration: none; }
.login .fine { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 16px 0 0; font-size: 12.5px; color: var(--lg-muted); }
.login .fine svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.login .credit { color: rgba(80, 90, 130, .55); }
.login .seo-about { margin-top: 22px; padding: 16px 18px; border-radius: 20px; background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--lg-muted); font-size: 12.5px; }
.login .seo-about h1 { font-size: 15px; color: var(--lg-ink); }

@media (max-width: 520px) {
  .login { padding: 12px 10px 8px; }
  .login .card { padding: 20px 16px 14px; border-radius: 28px; }
  .login .logo { width: 40px; height: 40px; }
  .login .brand-name { font-size: 30px; }
  .login .tagline { font-size: 9px; letter-spacing: .26em; }
  .live-pill { padding: 6px 9px; font-size: 11px; }
  .lg-title { margin-top: 18px; font-size: 25px; }
  .login .tag { font-size: 13.5px; }
  .lg-panel { margin-top: 16px; padding: 16px 12px 14px; gap: 12px; border-radius: 22px; }
  .login .ibadge { width: 40px; height: 40px; }
  .login .frow { gap: 9px; }
  .login .ctl input, .login .ctl select, .login .ctl.float input { font-size: 16px; } /* 16px stops iPhones zooming in on tap */
  .login .duo { grid-template-columns: minmax(0, 1fr) 104px; }
  .login .gender-field { padding-right: 10px; }
  .login .age-field { padding-left: 10px; }
  .login .age-field .ibadge { display: none; }
  .login .seg { gap: 6px; }
  .login .seg span { padding: 8px 6px; font-size: 14px; gap: 5px; }
  .geo-box { column-gap: 10px; padding: 12px; }
  .login .geo-hint img { width: 42px; height: 30px; }
  .geo-globe { width: 40px; height: 40px; }
  .lg-burj { height: 54vh; opacity: .9; }
  .lg-left { height: 20vh; }
  .lg-rb { width: 160px; height: 160px; }
}
html[data-chat-theme=dark] body { background: #0c0c14; }

.app { grid-template-columns: 72px var(--side-w) minmax(0, 1fr); background: var(--bg); color: var(--text); }
.app .nm { color: var(--text); }
.app .av { border: 0; }
.app .icon-btn { color: var(--ink); }
.app .icon-btn:hover { background: var(--field); }
.app .icon-btn svg, .rail svg, .new-chat svg, .send svg, .search-pill svg {
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.app .icon-btn svg { width: 19px; height: 19px; }

/* ---------- icon rail ---------- */
.rail { position: relative; z-index: 8; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 0 16px;
  background: var(--panel); border-right: 1px solid var(--line); min-height: 0; }
.rail-logo svg { width: 38px; height: 38px; display: block; stroke: none; }
.rail-nav { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 20px; }
.rail-nav button { position: relative; width: 44px; height: 44px; border: 0; border-radius: 13px; background: transparent; color: var(--ink);
  display: grid; place-items: center; padding: 0; transition: background .15s, color .15s, box-shadow .15s; }
.rail-nav button:hover:not(.on) { background: var(--field); }
.rail-nav button.on { background: var(--primary); color: #fff; box-shadow: 0 10px 22px -10px var(--primary); }
.rail-nav .ic { display: grid; place-items: center; }
.rail-nav .ic svg { width: 20px; height: 20px; }
/* the section name shows as a tooltip on hover */
.rail-nav button > span:not(.ic) { position: absolute; left: calc(100% + 12px); top: 50%; transform: translate(-4px, -50%); white-space: nowrap;
  background: #111827; color: #fff; font-size: 12.5px; font-weight: 500; padding: 5px 10px; border-radius: 8px; opacity: 0; pointer-events: none;
  transition: opacity .12s, transform .12s; z-index: 20; }
.rail-nav button:hover > span:not(.ic), .rail-nav button:focus-visible > span:not(.ic) { opacity: 1; transform: translate(0, -50%); }
.rail-nav .nb { position: absolute; top: -3px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #ef4444; color: #fff;
  font-size: 9.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--panel); }
.rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rail-btn { width: 38px; height: 38px; border: 0; border-radius: 11px; background: transparent; color: var(--ink); display: grid; place-items: center; padding: 0; }
.rail-btn:hover { background: var(--field); }
.rail-btn svg { width: 19px; height: 19px; }
.rail-btn.off { color: var(--muted); }
#logoutBtn:hover { color: #e11d48; }
.rail .me { margin-top: 8px; padding: 0; border-radius: 50%; }
.rail .me:hover { background: none; }
.rail .me .info { display: none; }
.rail .me .av { width: 38px; height: 38px; box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--soft); }
.rail .st-menu { left: calc(100% + 8px); top: auto; bottom: 14px; width: 280px; max-width: none; border-radius: 16px; padding: 8px; background: var(--card); }
.st-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.st-head .av { width: 44px; height: 44px; }
.st-head .nm { font-size: 15px; }
.st-head .sub { font-size: 12.5px; font-weight: 400; margin-top: 1px; }
.st-prof svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; }
.st-sep { padding: 10px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.st-menu button { color: var(--text); }
.st-extra { display: none; }

/* ---------- sidebar ---------- */
.app .side { background: var(--panel); border-right: 1px solid var(--line); }
.app .side-head { padding: 24px 22px 12px; border-bottom: 0; gap: 10px; }
.side-title { margin: 0; flex: 1; font-size: 27px; font-weight: 700; letter-spacing: -.025em; color: var(--text); }
.new-chat { width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 18px -8px var(--primary); }
.new-chat svg { width: 17px; height: 17px; stroke-width: 2.4; }
.new-chat:hover { background: var(--primary-2); }
.app .side-tools { padding: 6px 22px 14px; border-bottom: 0; gap: 16px; }
.search-pill { position: relative; display: block; }
.app .search-pill input { width: 100%; padding: 15px 50px 15px 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel);
  box-shadow: var(--shadow); font-size: 15.5px; font-weight: 400; color: var(--text); outline: none; }
.app .search-pill input:focus { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.app .search-pill input::placeholder { color: color-mix(in srgb, var(--text) 62%, transparent); }
.search-pill svg { position: absolute; right: 18px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--ink); pointer-events: none; }
/* each pill is as wide as its label + count, so 3–4 digit counts are never cut off */
.app .tabs { display: flex; flex-wrap: nowrap; gap: 6px; }
.app .tabs button { flex: 1 1 auto; }
.app .tabs button b { flex: none; }
.app .tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; white-space: nowrap; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); border-radius: 999px; padding: 6px 8px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow); }
.app .tabs button b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; margin: 0;
  background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 600; }
.app .tabs button.on { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 8px 18px -10px var(--primary); }
.app .tabs button.on b { background: #fff; color: var(--primary); }
/* female = solid pink, male = solid blue, both with white text; the selected one gets a ring */
.app .tabs .gsym { font-style: normal; font-weight: 700; }
.app .tabs [data-f=f], .app .tabs [data-f=f].on { background: #ec4899; border-color: #ec4899; color: #fff; }
.app .tabs [data-f=m], .app .tabs [data-f=m].on { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.app .tabs [data-f=f] .gsym, .app .tabs [data-f=m] .gsym { color: #fff; }
.app .tabs [data-f=f] b, .app .tabs [data-f=f].on b { background: #fff; color: #db2777; }
.app .tabs [data-f=m] b, .app .tabs [data-f=m].on b { background: #fff; color: #2563eb; }
.app .tabs [data-f=f]:not(.on), .app .tabs [data-f=m]:not(.on) { opacity: .88; box-shadow: none; }
.app .tabs [data-f=f].on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px #ec4899, 0 8px 18px -10px #ec4899; }
.app .tabs [data-f=m].on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px #3b82f6, 0 8px 18px -10px #3b82f6; }
.app .tabs [data-f=all]:not(.on) b { background: var(--primary); color: #fff; }
.sec-h { flex: none; padding: 10px 22px 10px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.recent { flex: none; }
.recent .sec-h { padding-top: 4px; padding-bottom: 6px; font-size: 15px; font-weight: 700; letter-spacing: -.015em; text-transform: none; color: var(--text); }
.recent-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 22px 10px; scrollbar-width: none; }
.recent-strip::-webkit-scrollbar { display: none; }
.rc { position: relative; flex: none; width: 38px; display: grid; justify-items: center; gap: 3px; border: 0; background: none; padding: 0; color: var(--text); }
.rc .av { width: 26px; height: 26px; }
.rc .av-wrap .idle-badge { display: none; }
.rc .st-dot { top: auto; bottom: -1px; right: -1px; width: 8px; height: 8px; box-shadow: 0 0 0 1.5px var(--panel); }
.rc span { max-width: 40px; font-size: 10.5px; color: color-mix(in srgb, var(--text) 75%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc.on::after { content: ''; position: absolute; left: 25px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 1.5px var(--panel); }
.rc.sel .av { box-shadow: 0 0 0 1.5px var(--panel), 0 0 0 3px var(--primary); }
.rc-n { position: absolute; top: -5px; right: -2px; z-index: 2; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: #ef4444; color: #fff;
  font-size: 9px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 1.5px var(--panel); }
.list-h { padding-top: 4px; }

/* people list: each person is a card */
.app .list { padding-bottom: 12px; }
.app .row { left: 18px; right: 18px; height: calc(var(--row-h) - 10px); padding: 0 14px; gap: 12px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--panel) !important; box-shadow: var(--shadow); transition: border-color .12s; }
.app .row:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); box-shadow: var(--shadow); }
.app .row.sel, .app .row.m.sel, .app .row.m:hover.sel { border: 2px solid var(--primary); box-shadow: var(--shadow); }
.app .row .av { width: 42px; height: 42px; }
.app .row .st-dot, .app .crow .st-dot { width: 11px; height: 11px; right: -1px; top: -1px; }
.app .row .nm { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.app .row .sub { font-size: 13px; font-weight: 400; color: var(--muted); }
.app .flag { width: 26px; height: 19px; border-radius: 3px; }
.app .badge { min-width: 24px; height: 24px; border-radius: 12px; background: #ef4444; font-size: 12px; }
.app .heart { color: #ec4899; }
.app .qf { color: var(--primary); }

/* other lists (Inbox, History, Search results, Friends, Rooms) as cards too */
.app .clist { padding: 2px 18px 18px; }
.app .crow { margin-bottom: 12px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.app .crow:hover { background: var(--panel); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.app .crow.sel { border: 2px solid var(--primary); background: var(--panel); }
.app .crow .av { width: 42px; height: 42px; }
.app .crow .nm { font-size: 15.5px; font-weight: 600; }
.app .crow .pv { font-size: 13px; }
.app .clist .fsec { padding: 12px 4px 8px; font-size: 12.5px; font-weight: 600; }
.app .fr-add { padding: 4px 0 14px; border-bottom: 0; }
.app .fr-add input { border-radius: 14px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); padding: 12px 14px; }
.app .fr-add button { border-radius: 14px; background: var(--primary); }
.app .pane-note { border-bottom: 0; padding: 0 22px 12px; font-size: 13.5px; }
.app .room-list .room-row { margin: 0 18px 10px; height: 62px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.app .room-list .room-row:hover { background: var(--panel); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.app .room-list .room-row.sel { background: var(--panel); border: 2px solid var(--primary); box-shadow: var(--shadow); }
.app .av.room { background: linear-gradient(150deg, #7c5cff, var(--primary-2)); border: 0; }
.app .search-form { padding: 6px 22px 16px; border-bottom: 0; }
.app .search-form input, .app .search-form select { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.app .search-btn { border-radius: 14px; background: var(--primary); box-shadow: 0 10px 22px -12px var(--primary); }
.app .s-head { padding: 4px 22px 10px; border-bottom: 0; }
.app .sg .o-all { --c: var(--primary); }
.app .empty-pane, .app .empty { font-weight: 500; }

/* ---------- chat panel ---------- */
.app .chat { background-color: var(--bg);
  background-image: radial-gradient(color-mix(in srgb, var(--text) 9%, transparent) 1px, transparent 1.3px); background-size: 18px 18px; }
.app .chat-head { min-height: 92px; padding: 14px 28px; gap: 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.app .peer { gap: 16px; }
.peer-av { position: relative; flex: none; }
.app .peer .av { width: 62px; height: 62px; }
.peer-av.online::after { content: ''; position: absolute; right: 1px; bottom: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--online); box-shadow: 0 0 0 3px var(--panel); }
.app .peer .nm { font-size: 21px; font-weight: 600; letter-spacing: -.015em; }
.app .peer .sub { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 16px; font-weight: 400; color: var(--muted); }
.app .st-label.st-online { color: color-mix(in srgb, var(--text) 75%, transparent); font-weight: 500; }
.chip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--soft); color: var(--primary); border-radius: 999px;
  padding: 3px 11px; font-size: 13px; font-weight: 500; }
.app[data-theme=dark] .chip { color: #b8a8ff; }
.app .peer .flag { width: 34px; height: 25px; }
.app .head-actions { display: flex; align-items: center; gap: 8px; }
.app .head-actions .icon-btn { width: 38px; height: 38px; border-radius: 10px; }
.app .head-actions .icon-btn svg { width: 19px; height: 19px; }
#blockBtn:hover, #closeBtn:hover { color: #e11d48; }
.app .friend-btn, .app #leaveRoomBtn { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); }
.app .friend-btn:not(.done) { border-color: var(--soft); background: var(--soft); color: var(--primary); }
.app .friend-btn.go { background: var(--primary); color: #fff; border-color: var(--primary); }
.app[data-theme=dark] .friend-btn:not(.done):not(.go) { color: #b8a8ff; }
.app .back svg { width: 22px; height: 22px; stroke-width: 2.2; }

/* room members */
.app .chat { position: relative; }
.members-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
.members-btn:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.members-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--primary); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.members { position: absolute; top: 92px; right: 0; bottom: 0; z-index: 7; width: min(340px, 100%); display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: -18px 0 40px -24px rgba(16, 24, 40, .35); animation: memIn .18s ease; }
@keyframes memIn { from { transform: translateX(24px); opacity: 0; } }
.members-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 12px 10px 18px; border-bottom: 1px solid var(--line); }
.members-head b { font-size: 15px; font-weight: 600; }
.members-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; cursor: pointer; }
.mrow:hover { background: var(--field); }
.mrow.me { cursor: default; }
.mrow .av { width: 38px; height: 38px; }
.mrow .nm { font-size: 14.5px; font-weight: 600; }
.mrow .sub { font-size: 12.5px; font-weight: 400; margin-top: 1px; }
.mrow .flag { width: 24px; height: 17px; }
.mrow .st-dot { width: 10px; height: 10px; }
.app .peer { cursor: default; }
.app .chat-head .peer:has(.av.room) { cursor: pointer; }
@media (max-width: 1100px) { .members { top: 80px; } }
@media (max-width: 720px) { .members { top: 68px; width: 100%; border-left: 0; } .members-btn { height: 34px; padding: 0 10px; font-size: 13px; } }

/* messages: avatar beside the bubble, "Name · time" above it */
.app .msgs { padding: 26px 30px 14px; gap: 22px; }
.app .msg { flex-direction: row; align-items: flex-end; gap: 14px; max-width: min(74%, 640px); }
.app .msg.me { flex-direction: row-reverse; }
.m-av { flex: none; }
.m-av .av { width: 42px; height: 42px; }
.m-av .idle-badge, .m-av .st-dot { display: none; }
.m-av.who { cursor: pointer; }
.m-col { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; min-width: 0; }
.msg.me .m-col { align-items: flex-end; }
.m-head { display: flex; align-items: center; gap: 9px; padding: 0 2px; font-size: 15px; white-space: nowrap; }
.msg.me .m-head { flex-direction: row-reverse; }
.m-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.m-name.who { cursor: pointer; }
.m-name.who:hover { color: var(--primary); }
.m-head > i { width: 5px; height: 5px; flex: none; border-radius: 50%; background: color-mix(in srgb, var(--text) 18%, transparent); }
.app .meta { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 400; color: var(--muted); }
.app .bubble { background: var(--bubble-them); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 15px 22px; font-size: 16px; line-height: 1.5;
  box-shadow: var(--shadow); }
.app .msg.me .bubble { background: var(--bubble-me); color: #fff; border-color: transparent; border-radius: 18px; box-shadow: 0 16px 30px -16px rgba(59, 31, 193, .65); }
.app .bubble.pic { padding: 6px; background: var(--panel) !important; border-color: var(--line); }
.app .bubble.big-emoji { background: transparent !important; border-color: transparent; box-shadow: none; padding: 0; }
.app .msg.me .bubble.big-emoji { box-shadow: none; }
.app .msg.draft .bubble { background: transparent; border: 1.5px dashed color-mix(in srgb, var(--text) 22%, transparent); color: var(--muted); box-shadow: none; }
.app .msg.draft .m-head { font-style: italic; }
.app .msg.fail .meta { color: #dc2626; }
.app .ticks.read { color: var(--primary); }
.app .sys { background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-weight: 500; box-shadow: var(--shadow); }
.app .prof-card { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.app .typing { bottom: 104px; left: 30px; background: var(--panel); border: 1px solid var(--line); }
.app .live-note { background: var(--panel); border-top: 1px solid var(--line); color: var(--muted); padding: 8px 28px; }
.app .live-note button { color: var(--primary); }

/* composer: one rounded bar with the icons inside */
.app .composer { position: relative; gap: 4px; padding: 16px 28px; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); }
.app .composer::before { content: ''; position: absolute; inset: 16px 28px; inset-block-end: max(16px, env(safe-area-inset-bottom)); border-radius: 16px; background: var(--field);
  transition: box-shadow .15s; pointer-events: none; }
.app .composer:focus-within::before { box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent); }
.app .composer > * { position: relative; }
.app .composer #text { order: 1; flex: 1; border: 0; background: transparent; padding: 17px 10px 17px 22px; font-size: 16.5px; color: var(--text); }
.app .composer #text::placeholder { color: color-mix(in srgb, var(--text) 60%, transparent); }
.app .composer #text:focus { background: transparent; border: 0; }
.app .composer #emojiBtn { order: 2; }
.app .composer #picBtn { order: 3; }
.app .composer .icon-btn { width: 38px; height: 38px; color: color-mix(in srgb, var(--text) 70%, transparent); }
.app .composer .icon-btn:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.app .composer .emoji-btn svg { width: 20px; height: 20px; stroke-width: 1.7; }
.app .send { order: 4; width: 42px; height: 42px; margin: 0 8px 0 4px; border-radius: 11px; background: var(--primary); display: grid; place-items: center;
  box-shadow: 0 10px 22px -10px var(--primary); }
.app .send:hover { background: var(--primary-2); }
.app .send svg { width: 18px; height: 18px; stroke-width: 2; margin-left: -2px; }
.app .emoji-panel { order: 5; position: absolute; left: 28px; right: 28px; bottom: calc(100% - 8px); border: 1px solid var(--line); border-radius: 18px;
  background: var(--card); box-shadow: 0 20px 50px -20px rgba(16, 24, 40, .35); overflow: hidden; }
.app .ep-h { background: var(--card); }

/* dark mode details from app.css that used fixed colors */
.app[data-theme=dark] .leave-btn { background: var(--panel); }
.app[data-theme=dark] .flag { box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.app[data-theme=dark] .test-badge { background: #475569; }
html[data-chat-theme=dark] .pw-dlg { background: var(--card); color: var(--text); }
html[data-chat-theme=dark] .pw-dlg input, html[data-chat-theme=dark] .pf input, html[data-chat-theme=dark] .pf select { background: var(--field); color: var(--text); border-color: var(--line); }

/* ---------- Settings ---------- */
.set-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.s-card { display: block; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 8px 10px; box-shadow: var(--shadow); text-align: start; color: var(--text); font: inherit; }
.s-sec { padding: 10px 8px 4px; font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.s-sub { padding: 10px 8px 3px; font-size: 9.5px; font-weight: 600; color: var(--muted); }
.s-prof { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.s-prof:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.s-prof-av .av { width: 42px; height: 42px; box-shadow: 0 0 0 3px var(--soft); }
.s-prof .stx b { font-size: 12.5px; }
.srow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 14px; background: transparent; color: var(--text); text-align: start; font: inherit; cursor: pointer; }
.srow:hover { background: var(--field); }
.sic { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--field); color: var(--ink); }
.sic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.stx b { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.stx small { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sval { flex: none; max-width: 40%; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { flex: none; width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir=rtl] .chev { transform: scaleX(-1); }
.srow.danger .sic { color: #e11d48; background: color-mix(in srgb, #e11d48 8%, var(--panel)); border-color: color-mix(in srgb, #e11d48 20%, var(--line)); }
.srow.danger b { color: #e11d48; }
.s-top { display: flex; align-items: center; gap: 8px; padding: 2px 0 2px; }
.s-top h2 { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: -.015em; }
.s-back { width: 26px; height: 26px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); display: grid; place-items: center; }
.s-back:hover { background: var(--field); }
.s-back svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir=rtl] .s-back svg { transform: scaleX(-1); }
.s-opt { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 14px; cursor: pointer; }
.s-opt:hover { background: var(--field); }
.s-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.rd { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--text) 25%, transparent); }
.s-opt input:checked + .rd { border-color: var(--primary); background: radial-gradient(circle, var(--primary) 0 3px, transparent 3.5px); }
.s-opt input:focus-visible + .rd, .s-opt input:focus-visible + .sw { outline: 2px solid var(--primary); outline-offset: 2px; }
.sw { order: 2; flex: none; position: relative; width: 28px; height: 16px; border-radius: 8px; background: color-mix(in srgb, var(--text) 18%, transparent); transition: background .15s; }
.sw::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.s-opt input:checked ~ .sw { background: var(--primary); }
.s-opt input:checked ~ .sw::after { transform: translateX(12px); }
[dir=rtl] .s-opt input:checked ~ .sw::after { transform: translateX(-12px); }
.s-note { margin: 3px 8px 8px; font-size: 9.5px; line-height: 1.5; color: var(--muted); }
.s-note.center { text-align: center; }
.s-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 10px 10px; }
.s-actions.col { flex-direction: column; }
.s-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 9px; padding: 7px 12px; font: inherit; font-size: 10px; font-weight: 600; cursor: pointer; }
.s-btn:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.s-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.s-btn.primary:hover { background: var(--primary-2); }
.s-btn.danger { color: #e11d48; }
.s-btn.wide { width: 100%; margin: 6px 0; }
.s-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.s-form { display: grid; gap: 8px; padding: 10px; }
.s-form input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--field); color: var(--text); font: inherit; font-size: 11px; outline: none; letter-spacing: .2em; }
.s-form input::placeholder { letter-spacing: 0; }
.s-form input:focus { border-color: var(--primary); }
.qr-box { display: grid; place-items: center; padding: 18px 10px 6px; }
.qr-box img { width: 150px; height: 150px; border-radius: 16px; border: 1px solid var(--line); padding: 10px; background: #fff; }
.qr-link { margin: 0 8px 4px; padding: 7px 10px; border-radius: 8px; background: var(--field); font-size: 9px; color: var(--muted); word-break: break-all; text-align: center; }
.scan-dlg video { width: 100%; max-height: 50vh; border-radius: 14px; background: #000; object-fit: cover; }
/* screen lock */
.lock-scr { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.lock-card { width: min(340px, 100%); display: grid; justify-items: center; gap: 10px; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 28px 24px; box-shadow: var(--shadow); }
.lock-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--soft); color: var(--primary); }
.lock-ic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lock-card h2 { margin: 4px 0 0; font-size: 20px; }
.lock-card p { margin: 0; color: var(--muted); font-size: 14px; }
.lock-card input { width: 100%; text-align: center; font-size: 22px; letter-spacing: .4em; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--field); color: var(--text); outline: none; }
.lock-card input:focus { border-color: var(--primary); }
.lock-card .s-btn { width: 100%; padding: 12px; }
.s-link { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.s-link:hover { color: #e11d48; }
/* text size (Settings → Appearance) */
.app[data-fs=s] .bubble { font-size: 14.5px; }
.app[data-fs=l] .bubble { font-size: 18px; }
.app[data-fs=l] .m-head { font-size: 16px; }
/* right-to-left (Arabic) */
.app[dir=rtl] .rail-nav button > span:not(.ic) { left: auto; right: calc(100% + 12px); }
.app[dir=rtl] .rail .st-menu { left: auto; right: calc(100% + 8px); }

/* short screens: a tighter rail so everything fits (it can't scroll: menus and tooltips stick out of it) */
@media (min-width: 721px) and (max-height: 700px) {
  .rail { gap: 6px; padding: 12px 0 10px; }
  .rail-logo svg { width: 34px; height: 34px; }
  .rail-nav { gap: 5px; margin-top: 10px; }
  .rail-nav button { width: 40px; height: 40px; border-radius: 12px; }
  .rail-btn { width: 34px; height: 34px; }
  .rail .me .av { width: 34px; height: 34px; }
}

/* ---------- tablets ---------- */
@media (max-width: 1100px) {
  .app { --side-w: 320px; }
  .app .msgs { padding: 22px 20px 12px; }
  .app .chat-head { padding: 12px 18px; min-height: 80px; }
  .app .peer .av { width: 52px; height: 52px; }
  .app .composer { padding-left: 18px; padding-right: 18px; }
  .app .composer::before { inset-inline: 18px; }
  .app .emoji-panel { left: 18px; right: 18px; }
}
@media (max-width: 900px) {
  .app { --side-w: 300px; grid-template-columns: 64px var(--side-w) minmax(0, 1fr); }
  .rail-nav button { width: 40px; height: 40px; }
  .app .msg { max-width: 84%; }
}

/* ---------- phones: rail becomes a bottom tab bar, the chat slides over everything ---------- */
@media (max-width: 720px) {
  :root { --row-h: 70px; }
  .app { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .app .side { grid-area: 1 / 1; }
  .rail { grid-area: 2 / 1; flex-direction: row; gap: 4px; padding: 6px 8px; padding-bottom: max(6px, env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); }
  .rail-logo { display: none; }
  .rail-nav { flex-direction: row; justify-content: space-around; gap: 2px; margin: 0; }
  .rail-nav button { width: 40px; height: 40px; border-radius: 12px; }
  .rail-nav .ic svg { width: 20px; height: 20px; }
  .rail-nav button > span:not(.ic) { display: none; }
  .rail-nav .nb { top: 1px; right: 0; }
  .rail-bottom { flex-direction: row; }
  .rail-btn { display: none; }
  .rail .me { margin: 0 2px 0 4px; }
  .rail .me .av { width: 34px; height: 34px; }
  .rail .st-menu { position: fixed; left: 10px; right: 10px; bottom: 74px; width: auto; }
  .st-extra { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px 2px 2px; border-top: 1px solid var(--line); margin-top: 6px; }
  .st-extra button { justify-content: center; flex-direction: column; gap: 4px; font-size: 12.5px; padding: 8px 4px; }
  .st-extra svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .app .chat { grid-area: 1 / 1 / 3 / 2; z-index: 9; }
  .app .side-head { padding: 18px 16px 10px; }
  .side-title { font-size: 25px; }
  .app .side-tools { padding: 4px 16px 12px; gap: 12px; }
  .app .tabs button { padding: 6px 7px; font-size: 13px; }
  .sec-h { padding-left: 16px; padding-right: 16px; }
  .recent-strip { padding-left: 16px; padding-right: 16px; gap: 10px; }
  .app .row { left: 12px; right: 12px; }
  .app .clist { padding: 2px 12px 16px; }
  .app .room-list .room-row { margin: 0 12px 10px; }
  .app .chat-head { min-height: 68px; padding: 8px 10px; gap: 6px; }
  .app .peer { gap: 10px; }
  .app .peer .av { width: 44px; height: 44px; }
  .peer-av.online::after { width: 12px; height: 12px; box-shadow: 0 0 0 2px var(--panel); }
  .app .peer .nm { font-size: 17px; }
  .app .peer .sub { font-size: 13.5px; gap: 6px; margin-top: 2px; }
  .app .peer .chip, .app .peer .flag { display: none; }
  .app .head-actions { gap: 2px; }
  .app .head-actions .icon-btn { width: 34px; height: 34px; }
  .app .friend-btn, .app #leaveRoomBtn { padding: 7px 11px; font-size: 13px; }
  .app .msgs { padding: 16px 12px 10px; gap: 16px; }
  .app .msg { max-width: 90%; gap: 9px; }
  .m-av .av { width: 32px; height: 32px; }
  .m-head { font-size: 13.5px; gap: 7px; }
  .app .meta { font-size: 12.5px; }
  .app .bubble { padding: 11px 15px; font-size: 15.5px; border-radius: 16px; }
  .app .composer { padding: 10px 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .app .composer::before { inset: 10px; inset-block-end: max(10px, env(safe-area-inset-bottom)); border-radius: 14px; }
  .app .composer #text { padding: 14px 6px 14px 16px; font-size: 16px; }
  .app .composer .icon-btn { width: 34px; height: 34px; }
  .app .send { width: 38px; height: 38px; margin: 0 6px 0 2px; border-radius: 10px; }
  .app .emoji-panel { left: 8px; right: 8px; }
  .app .typing { bottom: 84px; left: 12px; }
}

/* shown while the connection is being restored */
.reconn { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 60; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-radius: 999px; background: #111827; color: #fff; font-size: 13px; font-weight: 500; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); }
.reconn i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* login page notice while demo users auto-reply */
.login .demo-note { margin: 8px 0 0; text-align: center; font-size: 11.5px; color: rgba(255, 255, 255, .8); text-shadow: 0 1px 4px rgba(0, 0, 0, .35); }

/* "Get notified?" card */
.notif-ask { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 40; width: min(460px, calc(100% - 24px));
  display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-radius: 18px; background: var(--card); color: var(--text);
  border: 1px solid var(--line); box-shadow: 0 18px 50px -18px rgba(16, 24, 40, .45); animation: naIn .25s ease; }
@keyframes naIn { from { transform: translate(-50%, -12px); opacity: 0; } }
.na-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--primary); }
.na-ic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.na-tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.na-tx b { font-size: 14px; font-weight: 600; }
.na-tx small { font-size: 12px; color: var(--muted); }
.na-btns { flex: none; display: flex; gap: 6px; }
.notif-ask .s-btn { font-size: 13px; padding: 8px 12px; }
@media (max-width: 520px) { .notif-ask { flex-wrap: wrap; } .na-btns { width: 100%; justify-content: flex-end; } }

/* links to the country / city landing pages (home page, under the card) */
.login .seo-links { margin: 10px 0 0; line-height: 2; }
.login .seo-links a { color: #4a5cff; text-decoration: none; white-space: nowrap; }
