/* ============================================================
   chat.css — OpenTalk random chat
   - Light/dark via CSS vars (theme switch is instant)
   - Top bar carries brand (left) + online count + theme toggle (right)
   - Bottom bar is slim (mode pill) only on the chat page
   - Video tiles have a FIXED aspect ratio + max size — they DO NOT
     stretch to the user's webcam resolution
   - Mobile-first responsive
   ============================================================ */

:root {
  --bg:        #f4f5f8;
  --panel:     #ffffff;
  --panel-2:   #f7f8fb;
  --text:      #0e1116;
  --text-2:    #4b5563;
  --muted:     #6b7280;
  --border:    #e5e7eb;
  --primary:   #228891;
  --primary-2: #006c74;
  --primary-fg:#ffffff;
  --accent:    #ff5470;
  --danger:    #c0392b;
  --success:   #4CAF50;
  --tile-bg:   #d9dde3;
  --shadow:    0 6px 22px rgba(15,23,42,.08);
  --radius:    14px;
  --topbar-h:  60px;
}
:root[data-theme="dark"] {
  --bg:        #0e1116;
  --panel:     #161b22;
  --panel-2:   #1d242d;
  --text:      #e6e9ef;
  --text-2:    #c9d1d9;
  --muted:     #8b95a3;
  --border:    #232a33;
  --primary:   #4ab3bd;
  --primary-2: #228891;
  --primary-fg:#0e1116;
  --tile-bg:   #1d242d;
  --shadow:    0 6px 22px rgba(0,0,0,.45);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100dvh;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ==================== TOP BAR ==================== */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: 12px;
  padding: 8px 18px; min-height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky; top: 0; z-index: 50;
}
.topbar-center {
  display: flex; justify-content: center;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 22px; color: var(--text);
  letter-spacing: -0.01em;
}
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.topbar-right {
  display: flex; align-items: center; gap: 14px;
  justify-self: end;
}
.online {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; color: var(--primary);
  font-size: 14px; white-space: nowrap;
}
.online .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(76,175,80,.18);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(76,175,80,.45); }
  70%  { box-shadow: 0 0 0 8px rgba(76,175,80,0);   }
  100% { box-shadow: 0 0 0 0   rgba(76,175,80,0);   }
}

/* Theme toggle (iOS-style switch) */
.theme-toggle {
  position: relative; width: 46px; height: 26px;
  background: var(--panel-2); border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer; display: inline-block; flex: 0 0 auto;
}
.theme-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary);
  transition: transform .18s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
:root[data-theme="dark"] .theme-toggle::after { transform: translateX(20px); }

/* ==================== LANDING (index.html) ==================== */
.hero {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 56px 18px 40px;
  background:
    radial-gradient(ellipse at top, rgba(34,136,145,.18), transparent 60%),
    var(--bg);
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 56px);
  margin: 0 0 14px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--text); max-width: 800px;
}
.hero h1 .accent { color: var(--primary); }
.hero p.lead {
  font-size: clamp(15px, 2vw, 18px); color: var(--text-2);
  max-width: 620px; margin: 0 0 26px; line-height: 1.55;
}
.hero .cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: var(--primary-fg);
  border: none; cursor: pointer;
  font-size: 18px; font-weight: 800;
  padding: 16px 36px; border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(34,136,145,.45);
  transition: transform .1s, box-shadow .15s;
}
.hero .cta:hover { transform: translateY(-2px); text-decoration: none; }
.hero .cta small { font-size: 12px; opacity: .85; font-weight: 600; }
.hero .cta .ico-svg { display: inline-block; vertical-align: middle; }
.hero .cta-alt {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(15,23,42,.10);
}
.hero .cta-row {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
}
.hero .age-line {
  margin-top: 18px; color: var(--muted); font-size: 13px;
  display: inline-flex; align-items: center; gap: 8px;
}
.hero .age-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #c0392b; color: #fff; font-size: 11px; font-weight: 800;
}

.hero-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; max-width: 720px; width: 100%; margin: 36px auto 0;
}
.hero-grid .card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: left;
  box-shadow: var(--shadow);
}
.hero-grid .card .ico { font-size: 22px; margin-bottom: 6px; }
.hero-grid .card h3 { margin: 0 0 4px; font-size: 14px; color: var(--text); }
.hero-grid .card p  { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.4; }
@media (max-width: 640px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ==================== APP STAGE (random/index.html) ==================== */
/* Two-column stage that occupies the full visible viewport:
   - Big partner video on the LEFT (fills available width + height)
   - Self preview as a small PiP overlay inside the partner tile
   - Chat panel on the RIGHT, fixed width on desktop, full width on mobile.
   Reserved chrome: topbar + modebar (~52px) + app padding/gap (~30px). */
.app {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
  max-width: 1480px; width: 100%; margin: 0 auto;
  --stage-h: calc(100dvh - var(--topbar-h) - 30px);
  min-height: var(--stage-h);
}
@media (min-width: 980px) {
  /* umingle-style: narrow video column on the LEFT, wide chat on the RIGHT. */
  .app { grid-template-columns: 320px minmax(0, 1fr); align-items: stretch; }
}
@media (min-width: 1280px) {
  .app { grid-template-columns: 360px minmax(0, 1fr); }
}

/* ---- Video column ----
   Default (desktop ≥ 980px): Omegle-style VERTICAL stack — stranger
   on top, you on the bottom — chat column sits to the right.
   This is the layout users know from Omegle / OmeTV / Monkey.
   Optional: data-vlayout="split" → 50/50 side-by-side,
             data-vlayout="pip"   → big stranger + small self overlay.
   Mobile (<980px) always uses PiP overlay. */
.video-col {
  position: relative;
  height: var(--stage-h);
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr;        /* one row by default (PiP fallback) */
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 980px) {
  /* umingle-style: stranger on top, you below — both inside the narrow left column. */
  .video-col:not([data-vlayout="pip"]):not([data-vlayout="split"]) {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
    height: auto;
    align-content: start;
    gap: 10px;
  }
  .video-col:not([data-vlayout="pip"]):not([data-vlayout="split"]) .tile {
    aspect-ratio: 4 / 3;
    height: auto;
  }
  /* Equal-visibility side-by-side (good for streamers) */
  .video-col[data-vlayout="split"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
  }
}
.tile {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--tile-bg);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  min-height: 0; min-width: 0;
}
/* PiP fallback (narrow desktops, or explicit data-vlayout="pip") */
@media (max-width: 979px) {
  .video-col { display: block; }
  .tile.self {
    position: absolute;
    right: 14px; bottom: 14px;
    width: clamp(120px, 22%, 220px);
    height: auto;
    aspect-ratio: 4 / 3;
    z-index: 4;
    border: 2px solid var(--panel);
    box-shadow: 0 6px 18px rgba(0,0,0,.45);
    border-radius: 12px;
  }
}
.video-col[data-vlayout="pip"] { display: block; }
.video-col[data-vlayout="pip"] .tile.self {
  position: absolute;
  right: 14px; bottom: 14px;
  width: clamp(120px, 22%, 220px);
  height: auto;
  aspect-ratio: 4 / 3;
  z-index: 4;
  border: 2px solid var(--panel);
  box-shadow: 0 6px 18px rgba(0,0,0,.45);
  border-radius: 12px;
}
.tile video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;            /* cover the fixed box, crop excess */
  background: #000;
}
.tile.self video { transform: scaleX(-1); }
.tile.self.no-mirror video { transform: none; }
.tile .tile-tag {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(0,0,0,.55); color: #fff;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  pointer-events: none; z-index: 2;
}
/* Omegle-style watermark on the partner tile: "OpenTalk" big + ".club" small,
   bottom-left, white text with a black stroke outline (like the screenshot). */
.tile .tile-brand {
  position: absolute; left: 18px; bottom: 16px;
  color: #fff;
  font-size: 0; /* hide the literal text node, glyphs come via ::before / ::after */
  pointer-events: none; z-index: 2;
  line-height: 1;
}
.tile .tile-brand::before {
  content: "OpenTalk";
  font-size: 18px; font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.55), 0 0 1px rgba(0,0,0,.5);
  font-family: inherit;
}
.tile .tile-brand::after {
  content: ".club";
  font-size: 18px; font-weight: 500;
  margin-left: 1px;
  color: rgba(255,255,255,.85);
  text-shadow: 0 1px 3px rgba(0,0,0,.55);
}
@media (max-width: 640px) {
  .tile .tile-brand { left: 12px; bottom: 12px; }
  .tile .tile-brand::before,
  .tile .tile-brand::after { font-size: 14px; }
}
/* Report flag: bottom-right, big plain grey flag, no pill background */
.tile .tile-flag {
  position: absolute; right: 14px; bottom: 12px;
  width: 52px; height: 52px;
  background: transparent; border: none; cursor: pointer; z-index: 3;
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(220,220,220,.85);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.6));
  transition: color .15s, transform .1s;
  padding: 0;
}
.tile .tile-flag:hover { color: #fff; transform: scale(1.08); }
.tile .tile-flag svg { display: block; width: 30px; height: 30px; }
@media (max-width: 640px) {
  .tile .tile-flag { width: 44px; height: 44px; right: 10px; bottom: 10px; }
  .tile .tile-flag svg { width: 26px; height: 26px; }
}
/* Volume slider on the partner tile (top centre, on hover) */
.tile .tile-volume {
  position: absolute; left: 50%; top: 12px;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.55); color: #fff;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12px; z-index: 3;
  opacity: 0; transition: opacity .18s;
  pointer-events: none;
}
.tile:hover .tile-volume,
.tile:focus-within .tile-volume,
.tile .tile-volume:hover { opacity: 1; pointer-events: auto; }
@media (hover: none) {
  .tile .tile-volume { opacity: 1; pointer-events: auto; }
}
.tile .tile-volume input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 110px; height: 4px; background: rgba(255,255,255,.35);
  border-radius: 999px; outline: none; cursor: pointer; margin: 0;
}
.tile .tile-volume input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff;
}
.tile .tile-volume input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--primary); border: 2px solid #fff;
}
.tile.placeholder { color: var(--muted); font-size: 14px; }
/* Brand stays visible on placeholder; only flag + volume slider hide. */
.tile.placeholder .tile-flag,
.tile.placeholder .tile-volume { display: none; }
/* Force [hidden] to win over inline-flex on input-row buttons. */
.input-row [hidden] { display: none !important; }
/* Hide the placeholder message once a real partner video is attached */
.tile:not(.placeholder) .tile-placeholder-text { display: none; }
.tile .tile-placeholder-text { z-index: 1; }

/* ---- Chat column ---- */
.chat-col {
  display: flex; flex-direction: column;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  height: var(--stage-h);
  min-height: 0;
}
.chat-msgs {
  flex: 1; overflow-y: auto;
  padding: 18px 18px 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.welcome { padding: 4px 2px 12px; }
.welcome h2 {
  font-size: 22px; margin: 0 0 14px; font-weight: 800; color: var(--text);
  letter-spacing: -0.01em;
}
.welcome .age-line {
  color: var(--primary); font-weight: 800; margin: 6px 0 8px;
  display: flex; align-items: center; gap: 8px; font-size: 16px;
}
.welcome .age-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: #c0392b; color: #fff; font-size: 11px; font-weight: 800;
}
.welcome ul { margin: 0; padding-left: 0; list-style: none; color: var(--text-2); }
.welcome ul li { padding: 3px 0; font-size: 15px; }

.msg {
  max-width: 78%; padding: 8px 12px; border-radius: 14px;
  font-size: 14px; line-height: 1.4; word-wrap: break-word;
}
.msg.me   { align-self: flex-end;  background: var(--primary); color: var(--primary-fg); border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; background: var(--panel-2); color: var(--text); border-bottom-left-radius: 4px; }
.msg.sys  { align-self: center; background: transparent; color: var(--muted); font-size: 12px; font-style: italic; }

/* ---- Input row + Start ---- */
.input-row {
  display: flex; gap: 10px; padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.start-btn {
  flex: 0 0 auto;
  background: var(--primary); color: var(--primary-fg);
  border: none; border-radius: 14px;
  padding: 14px 26px;
  font-size: 16px; font-weight: 800;
  cursor: pointer;
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(34,136,145,.35);
  transition: transform .08s, box-shadow .12s, opacity .12s;
}
.start-btn small { font-size: 11px; opacity: .8; font-weight: 600; }
.start-btn:hover { transform: translateY(-1px); }
.start-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.start-btn.stop  { background: var(--danger); box-shadow: 0 6px 14px rgba(192,57,43,.35); }
.start-btn.next  { background: var(--success); box-shadow: 0 6px 14px rgba(76,175,80,.35); }

.text-input {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 15px; outline: none;
  min-width: 0;
}
.text-input:focus { border-color: var(--primary); }
.send-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); padding: 0 6px; font-size: 22px;
}
.send-btn:hover { color: var(--primary); }

/* ==================== BOTTOM MODE PILL (chat page) ==================== */
.modebar {
  display: flex; justify-content: center;
  padding: 8px 12px;
  background: transparent;
}
.mode-pill {
  display: inline-flex; background: var(--panel);
  border-radius: 999px; padding: 4px; gap: 2px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.mode-pill button {
  border: none; background: transparent; color: var(--muted);
  padding: 8px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.mode-pill button.active { background: var(--primary); color: var(--primary-fg); }

/* ==================== INTEREST INPUT ==================== */
.interest-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  background: var(--panel-2);
}
.interest-bar .label { font-size: 12px; color: var(--muted); margin-right: 4px; }
.interest-bar input {
  flex: 1; min-width: 120px; background: transparent; border: none;
  color: var(--text); padding: 4px 6px; font-size: 13px; outline: none;
}
.chip {
  background: var(--primary); color: var(--primary-fg);
  font-size: 12px; padding: 3px 8px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 4px;
}
.chip button { background: none; border: none; color: var(--primary-fg); cursor: pointer; padding: 0; font-size: 14px; line-height: 1; }

/* ==================== 18+ inline gate ==================== */
.gate-inline {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px; margin-top: 12px;
}
.gate-inline h3 { margin: 0 0 8px; color: var(--text); font-size: 16px; }
.gate-inline p { margin: 0 0 12px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.gate-inline .row { display: flex; gap: 8px; flex-wrap: wrap; }
.gate-inline button {
  border: none; padding: 10px 16px; border-radius: 10px;
  font-weight: 700; cursor: pointer; font-size: 14px;
}
.gate-inline .agree { background: var(--primary); color: var(--primary-fg); }
.gate-inline .leave { background: var(--panel); color: var(--muted); border: 1px solid var(--border); }

/* ==================== REPORT MODAL ==================== */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none;
  align-items: center; justify-content: center; z-index: 900; padding: 20px;
}
.modal.active { display: flex; }
.modal-card {
  background: var(--panel); color: var(--text);
  border-radius: 14px; padding: 22px; max-width: 400px; width: 100%;
  box-shadow: var(--shadow);
}
.modal-card h3 { margin: 0 0 14px; }
.modal-card label { display: flex; align-items: center; gap: 8px; padding: 6px 0; color: var(--text-2); font-size: 14px; }
.modal-card .actions { margin-top: 16px; display: flex; gap: 8px; justify-content: flex-end; }
.modal-card .actions button {
  border: none; padding: 10px 16px; border-radius: 10px; font-weight: 700; cursor: pointer;
}
.modal-card .send { background: var(--danger); color: #fff; }
.modal-card .cancel { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }

/* ==================== TOAST ==================== */
.toast {
  position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px;
  font-size: 14px; z-index: 1100; display: none;
  box-shadow: var(--shadow);
}
.toast.active { display: block; }

/* ==================== SEO SECTIONS ==================== */
.seo {
  background: var(--panel-2);
  padding: 40px 18px;
  border-top: 1px solid var(--border);
}
.seo .wrap { max-width: 980px; margin: 0 auto; }
.seo h2 { font-size: clamp(22px, 3.5vw, 28px); color: var(--text); margin: 0 0 16px; }
.seo p, .seo li { color: var(--text-2); line-height: 1.55; font-size: 15px; }
.faq details { background: var(--panel); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--border); }
.faq summary { cursor: pointer; font-weight: 700; color: var(--text); }
.faq p { margin: 8px 0 0; }
.compare-tbl { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 12px; overflow: hidden; font-size: 14px; }
.compare-tbl th, .compare-tbl td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.compare-tbl th { background: var(--panel-2); color: var(--text); }
.compare-tbl td.yes { color: var(--success); font-weight: 700; }
.compare-tbl td.no  { color: var(--danger);  font-weight: 700; }

/* ==================== SITE FOOTER ==================== */
footer.site-foot {
  text-align: center; padding: 22px 16px; color: var(--muted); font-size: 13px;
  border-top: 1px solid var(--border); background: var(--panel);
}
footer.site-foot .links {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 18px; margin-bottom: 10px;
}
footer.site-foot a { color: var(--muted); }

/* ==================== MOBILE TWEAKS ==================== */
@media (max-width: 640px) {
  .topbar { padding: 8px 12px; min-height: 52px; }
  :root { --topbar-h: 52px; }
  .brand { font-size: 17px; }
  .brand img { width: 30px; height: 30px; }
  .topbar-right { gap: 10px; }
  .online { font-size: 13px; }

  .hero { padding: 36px 16px 28px; }
  .hero .cta { padding: 14px 28px; font-size: 16px; }

  .app {
    padding: 8px; gap: 8px;
    /* On mobile we let the page scroll naturally so the chat input is
       always reachable above the on-screen keyboard. */
    --stage-h: auto;
    min-height: 0;
  }
  .video-col {
    height: auto;
    grid-template-rows: auto;
    display: block;
    position: relative;
  }
  .tile { height: auto; width: 100%; max-width: 100%; aspect-ratio: 4 / 3; }
  .tile.self {
    position: absolute; right: 8px; bottom: 8px;
    width: 38%; max-width: 160px; height: auto;
    z-index: 3; border: 2px solid var(--panel);
    box-shadow: 0 4px 12px rgba(0,0,0,.35);
  }
  .chat-col { height: auto; min-height: 320px; max-height: none; }
  .chat-msgs { padding: 14px; }
  .welcome h2 { font-size: 18px; }
  .input-row { padding: 10px; gap: 8px; }
  .start-btn { padding: 12px 18px; font-size: 15px; }
  .text-input { padding: 11px 12px; font-size: 14px; }
}

/* ============================================================
   Additions: typing indicator, hover tile controls, device menu,
   theme-toggle sun/moon icons
   ============================================================ */

/* Typing indicator (bouncing dots in a "them" bubble) */
.msg.typing {
  display: inline-flex; gap: 4px;
  padding: 10px 12px; align-items: center;
}
.msg.typing .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.msg.typing .dot:nth-child(2) { animation-delay: .15s; }
.msg.typing .dot:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0);   opacity: .4; }
  40%           { transform: translateY(-4px); opacity: 1; }
}

/* Hover controls on the self tile (camera/mic selectors) */
.tile-controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; gap: 6px; justify-content: center;
  padding: 6px;
  background: linear-gradient(to top, rgba(0,0,0,.6), transparent);
  opacity: 0; transition: opacity .18s;
  pointer-events: none;
  z-index: 5;
}
.tile.self:hover .tile-controls,
.tile.self:focus-within .tile-controls,
.tile-controls:hover { opacity: 1; pointer-events: auto; }
/* Always show on touch devices (no hover). */
@media (hover: none) {
  .tile-controls { opacity: 1; pointer-events: auto; background: rgba(0,0,0,.4); }
}
.tile-ctrl {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255,255,255,.95); color: #111;
  font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  transition: transform .1s;
}
.tile-ctrl:hover { transform: scale(1.08); }

/* Popup menu listing devices */
.device-menu {
  position: absolute; bottom: 44px; left: 50%; transform: translateX(-50%);
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 4px; min-width: 180px; max-width: 240px;
  z-index: 10;
}
.device-menu .menu-item {
  display: block; width: 100%; text-align: left;
  border: none; background: transparent; color: var(--text);
  padding: 8px 10px; font-size: 13px; border-radius: 6px;
  cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.device-menu .menu-item:hover { background: var(--panel-2); }
.device-menu .menu-item.active { background: var(--primary); color: var(--primary-fg); }
.device-menu .menu-empty { padding: 8px 10px; font-size: 13px; color: var(--muted); }

/* Theme toggle: sun/moon glyphs, knob slides between */
.theme-toggle { font-size: 0; }
.theme-toggle::before {
  content: "☀";
  position: absolute; left: 5px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: #f1c40f; pointer-events: none;
  z-index: 1; line-height: 1;
}
.theme-toggle::after {
  font-size: 11px; color: var(--primary-fg);
  display: inline-flex; align-items: center; justify-content: center;
  content: "🌙";
}
:root[data-theme="dark"] .theme-toggle::after { content: "☀"; }
:root[data-theme="dark"] .theme-toggle::before { content: "🌙"; left: auto; right: 5px; color: #c9d1d9; }

/* Landing brand sizing — much bigger and bolder on landing pages */
.brand.brand-lg { font-size: 38px; font-weight: 900; gap: 16px; }
.brand.brand-lg img { width: 60px; height: 60px; border-radius: 14px; }
.brand .brand-text { letter-spacing: -0.025em; }
.topbar-landing { background: transparent; border-bottom: none; box-shadow: none; }
.topbar-landing .online { font-size: 16px; font-weight: 800; }
.topbar-landing .online .dot { width: 11px; height: 11px; }
@media (max-width: 640px) {
  .brand.brand-lg { font-size: 28px; gap: 12px; }
  .brand.brand-lg img { width: 46px; height: 46px; }
  .topbar-landing .online { font-size: 14px; }
}

/* Welcome screen: small lead line under the greeting */
.welcome .welcome-lead {
  margin: 6px 0 14px; font-size: 15px; color: var(--text-2);
}
.welcome h2 { font-size: 24px; margin: 0 0 6px; }

/* Modern SVG icons inside hero CTAs */
.hero .cta { gap: 10px; }
.hero .cta .ico-svg { width: 22px; height: 22px; }
.hero-grid .card .ico svg { display: block; color: var(--primary); }

/* ============ "Less is more" landing tweaks ============ */
/* Tighter hero copy */
.hero h1 { font-size: clamp(30px, 4.4vw, 46px); margin-bottom: 8px; }
.hero p.lead { font-size: 15px; margin-bottom: 22px; max-width: 480px; }

/* Minimal feature cards: icon top-centre, single title, no subtitle */
.hero-grid.hero-grid-min .card {
  text-align: center;
  padding: 18px 14px;
}
.hero-grid.hero-grid-min .card .ico {
  display: flex; justify-content: center;
  margin: 0 0 8px;
}
.hero-grid.hero-grid-min .card .ico svg {
  color: var(--primary);
}
.hero-grid.hero-grid-min .card h3 {
  margin: 0; font-size: 15px; font-weight: 700;
}
.hero-grid.hero-grid-min .card p { display: none; }

/* Tighter SEO + FAQ blocks */
.seo { padding: 28px 18px; }
.seo h2 { font-size: clamp(20px, 3vw, 24px); margin-bottom: 12px; }
.faq details { padding: 10px 14px; }
.faq summary { font-size: 14px; }
.faq p { font-size: 14px; }
.compare-tbl { font-size: 13px; }
.compare-tbl th, .compare-tbl td { padding: 8px 10px; }

/* ============ Landing umingle-style card ============ */
.hero-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(15,23,42,.08);
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 36px 36px;
  text-align: center;
}
.hero-card h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero-card .accent { color: var(--primary); }
.hero-card .lead {
  font-size: 15px; color: var(--text-2);
  max-width: 520px; margin: 0 auto 28px;
  line-height: 1.55;
}
.start-block { margin-top: 8px; }
.start-block .start-label {
  font-weight: 800; color: var(--text); margin-bottom: 14px; font-size: 18px;
}
.cta-row {
  display: flex; align-items: center; justify-content: center; gap: 14px;
}
.cta.cta-pill {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--primary-fg);
  border: none; cursor: pointer;
  font-size: 22px; font-weight: 800;
  padding: 16px 48px; border-radius: 14px;
  text-decoration: none; min-width: 150px;
  box-shadow: 0 10px 24px rgba(34,136,145,.30);
  transition: transform .12s, box-shadow .15s;
}
.cta.cta-pill:hover { transform: translateY(-2px); text-decoration: none; }
.cta-or {
  font-size: 14px; color: var(--text-2); font-weight: 600;
}
.interest-block { margin-top: 32px; }
.interest-block .interest-label {
  display: block; font-weight: 700; color: var(--text);
  margin-bottom: 10px; font-size: 15px;
}
.interest-block .interest-input {
  width: 100%; max-width: 440px;
  padding: 14px 18px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg); color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.interest-block .interest-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,136,145,.18);
}
.mod-pill {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 24px; padding: 10px 18px;
  background: rgba(34,136,145,.10);
  color: var(--primary); border-radius: 999px;
  font-weight: 700; font-size: 14px;
}
.mod-pill svg { color: var(--primary); }

@media (max-width: 640px) {
  .hero-card { padding: 32px 20px 28px; border-radius: 18px; }
  .cta.cta-pill { font-size: 18px; padding: 14px 32px; min-width: 110px; }
}

/* Stop button: white card style, sits next to Skip */
.start-btn.stop-btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800;
}
.start-btn.stop-btn .sb-ico {
  display: inline-flex; width: 14px; height: 14px;
  background: var(--text);
  border-radius: 2px;
}
.start-btn.stop-btn:hover { background: var(--panel-2); }
