:root {
  --bg: #0b0b12;
  --bg-2: #12121c;
  --header: rgba(16, 16, 24, 0.86);
  --header-2: rgba(22, 22, 34, 0.92);
  --text: #f4f3f8;
  --muted: #9b98ab;
  --subtle: #6f6c80;
  --card: rgba(24, 24, 36, 0.92);
  --option: #1c1c2a;
  --option-on: #26263a;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --accent-soft: rgba(139, 92, 246, 0.22);
  --accent-glow: rgba(139, 92, 246, 0.45);
  --on-accent: #ffffff;
  --msn-blue: #8b5cf6;
  --msn-blue-deep: #6d28d9;
  --bubble: #232334;
  --bubble-mine: linear-gradient(135deg, #7c3aed 0%, #a855f7 55%, #c084fc 100%);
  --composer: rgba(20, 20, 30, 0.95);
  --pane: transparent;
  --danger: #ff6b8a;
  --ok: #34d399;
  --link: #c4b5fd;
  --hover: rgba(255, 255, 255, 0.06);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --media-bg: #101018;
  --scroll: #3a3850;
  --radius: 18px;
  --radius-sm: 12px;
  --inset: none;
  --glow-a: rgba(168, 85, 247, 0.28);
  --glow-b: rgba(225, 29, 72, 0.18);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #ece8f7;
  --bg-2: #f7f5fc;
  --header: rgba(255, 255, 255, 0.88);
  --header-2: rgba(255, 255, 255, 0.95);
  --text: #1c1830;
  --muted: #6b6580;
  --subtle: #908aa3;
  --card: rgba(255, 255, 255, 0.9);
  --option: #f3f0fb;
  --option-on: #ebe4ff;
  --line: rgba(60, 40, 100, 0.12);
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-soft: rgba(124, 58, 237, 0.16);
  --accent-glow: rgba(124, 58, 237, 0.28);
  --on-accent: #ffffff;
  --msn-blue: #7c3aed;
  --msn-blue-deep: #5b21b6;
  --bubble: #ffffff;
  --bubble-mine: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  --composer: rgba(255, 255, 255, 0.92);
  --pane: transparent;
  --danger: #e11d48;
  --ok: #059669;
  --link: #6d28d9;
  --hover: rgba(76, 29, 149, 0.06);
  --shadow: 0 18px 40px rgba(76, 29, 149, 0.12);
  --media-bg: #ebe7f7;
  --scroll: #c4b5fd;
  --radius: 18px;
  --radius-sm: 12px;
  --inset: none;
  --glow-a: rgba(124, 58, 237, 0.16);
  --glow-b: rgba(244, 63, 94, 0.1);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 70% 55% at 8% 18%, var(--glow-a), transparent 55%),
    radial-gradient(ellipse 55% 45% at 92% 82%, var(--glow-b), transparent 50%),
    radial-gradient(ellipse 40% 35% at 70% 20%, rgba(99, 102, 241, 0.12), transparent 45%),
    linear-gradient(160deg, var(--bg-2), var(--bg));
  background-attachment: fixed;
  color: var(--text);
  font-family: "Plus Jakarta Sans", "Segoe UI", Tahoma, sans-serif;
  overflow: hidden;
}

button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

#file-warning {
  background: linear-gradient(90deg, #7f1d1d, #9f1239);
  color: #fff4f5;
  text-align: center;
  padding: 10px 14px;
  font-size: 14px;
}

header {
  position: relative;
  z-index: 20;
  flex: none;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  color: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.brand svg {
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

nav { display: flex; align-items: center; gap: 8px; }
.nav-right { margin-left: auto; gap: 6px; }
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  transition: 0.18s ease;
}
nav a.active, nav a:hover {
  color: var(--text);
  background: var(--hover);
  text-decoration: none;
}
nav a.active {
  color: #fff;
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.25);
}
html[data-theme="light"] nav a.active {
  color: var(--accent);
}

#theme-btn, #menu-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--option);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.18s ease;
}
#theme-btn:hover, #menu-btn:hover {
  background: var(--option-on);
  box-shadow: 0 0 0 1px var(--accent-soft), 0 0 18px var(--accent-soft);
}
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: none; }
#menu-btn { display: none; }

#theme-btn svg, #menu-btn svg, .icon-btn svg, #btn-end svg, .hang svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#mobile-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 12px;
  min-width: 240px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(16px);
}
#mobile-panel a {
  color: var(--text);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
}
#mobile-panel a:hover, #mobile-panel a.active { background: var(--hover); }

main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view { flex: 1; min-height: 0; overflow: auto; }

.page h1, .center-copy h1 {
  font-size: clamp(28px, 4.8vw, 44px);
  letter-spacing: -0.04em;
  margin: 14px 0;
  font-weight: 800;
}

/* Home estilo Messenger (sem login), cores do Talkiechat */
#view-home {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px 28px;
  overflow: auto;
}
.msn-stage {
  width: min(1040px, 100%);
  margin: auto;
}
.msn-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.msn-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.16), transparent);
  font-size: 12px;
  color: var(--muted);
}
.msn-win-controls {
  display: flex;
  gap: 6px;
}
.msn-win-controls i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
  border: 1px solid var(--line);
  background: var(--option);
}
.msn-win-controls i:nth-child(1) { background: rgba(251, 191, 36, 0.45); }
.msn-win-controls i:nth-child(2) { background: rgba(52, 211, 153, 0.4); }
.msn-win-controls i:nth-child(3) { background: rgba(255, 107, 138, 0.45); }
.msn-panel-body {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(240px, 0.9fr);
  align-items: stretch;
  min-height: 420px;
  position: relative;
}
.msn-copy {
  padding: 34px 36px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}
.msn-kicker {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.msn-signin-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.msn-avatar {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  border: 2px solid rgba(167, 139, 250, 0.7);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.1), transparent 48%),
    var(--option);
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 10px 22px rgba(0,0,0,0.28);
}
.msn-intro { min-width: 0; }
.msn-intro h1 {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 42px);
  letter-spacing: -0.045em;
  font-weight: 800;
  line-height: 1.02;
}
.msn-subbrand {
  margin: 4px 0 8px;
  color: var(--accent-hover);
  font-size: 15px;
  font-weight: 600;
}
.msn-status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ok);
  font-size: 12px;
  font-weight: 600;
}
.msn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}
.msn-lead {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 40ch;
}
.msn-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 22px;
}
.msn-actions .primary {
  display: inline-flex;
  text-decoration: none;
  min-width: 148px;
  justify-content: center;
}
.msn-actions .muted {
  margin: 0;
  font-size: 13px;
}
.msn-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-width: 42ch;
}
.msn-points li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  padding-left: 14px;
  position: relative;
}
.msn-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.msn-points strong {
  color: var(--text);
  font-weight: 700;
}
.msn-art {
  position: relative;
  display: grid;
  place-items: center;
  padding: 28px 28px 28px 8px;
  overflow: hidden;
}
.msn-art::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.28), transparent 68%);
  pointer-events: none;
  animation: msnGlow 5.5s ease-in-out infinite;
}
.msn-icon-tile {
  position: relative;
  z-index: 1;
  animation: msnFloat 4.8s ease-in-out infinite;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.38));
}
.msn-icon-bubbles {
  display: block;
  width: min(220px, 52vw);
  height: auto;
  overflow: visible;
}
.msn-chat-b1,
.msn-chat-b2,
.msn-chat-dots {
  transform-box: fill-box;
  transform-origin: center;
}
.msn-chat-b1 {
  animation: msnBubbleIn 3.6s ease-in-out infinite;
}
.msn-chat-b2 {
  animation: msnBubbleIn 3.6s ease-in-out infinite 0.35s;
}
.msn-chat-dots {
  animation: msnDotsShow 3.6s ease-in-out infinite;
}
.msn-dot-1,
.msn-dot-2,
.msn-dot-3 {
  transform-box: fill-box;
  transform-origin: center;
}
.msn-dot-1 { animation: msnDotBounce 3.6s ease-in-out infinite 0.7s; }
.msn-dot-2 { animation: msnDotBounce 3.6s ease-in-out infinite 0.85s; }
.msn-dot-3 { animation: msnDotBounce 3.6s ease-in-out infinite 1s; }
.site-footer {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px 18px;
}
.site-footer[hidden] { display: none !important; }
.msn-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.msn-links a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.msn-links a:hover { color: var(--text); text-decoration: underline; }
.msn-links span {
  color: var(--subtle);
  font-size: 12px;
}
@keyframes msnFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes msnGlow {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 1; }
}
@keyframes msnBubbleIn {
  0%, 8% {
    opacity: 0;
    transform: translateY(10px) scale(0.72);
  }
  22%, 78% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  92%, 100% {
    opacity: 0;
    transform: translateY(-6px) scale(0.88);
  }
}
@keyframes msnDotsShow {
  0%, 18% { opacity: 0; }
  28%, 72% { opacity: 1; }
  84%, 100% { opacity: 0; }
}
@keyframes msnDotBounce {
  0%, 18%, 100% {
    opacity: 0.25;
    transform: translateY(0) scale(0.7);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px) scale(1);
  }
  42% {
    opacity: 0.55;
    transform: translateY(0) scale(0.85);
  }
  54% {
    opacity: 1;
    transform: translateY(-3px) scale(1);
  }
  68%, 84% {
    opacity: 0.35;
    transform: translateY(0) scale(0.75);
  }
}
.feature, .page {
  background: transparent;
}
.feature h2, .page h2 { font-size: 16px; margin: 0 0 8px; letter-spacing: -0.02em; }
.feature p, .page p { color: var(--muted); line-height: 1.55; font-size: 14px; }

.page { width: min(740px, calc(100% - 36px)); margin: 36px auto 64px; }
.page h1 { font-size: 36px; }
.page a { color: var(--link); }

#view-chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: transparent;
  border-top: 0;
}

.gate {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  overflow: auto;
  background:
    radial-gradient(ellipse 50% 40% at 50% 30%, var(--glow-a), transparent 60%),
    transparent;
}

.center-copy { width: min(560px, 100%); text-align: center; }
.center-copy p { line-height: 1.55; margin: 8px 0; }
.center-copy .primary { margin-top: 18px; min-width: 220px; }
.muted { color: var(--muted); }
.center-copy a, .card a { color: var(--link); }

.card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px 20px 18px;
  box-shadow: var(--shadow), 0 0 40px rgba(139, 92, 246, 0.08);
  text-align: center;
  backdrop-filter: blur(18px);
}
.card h2 { font-size: 18px; margin: 4px 0 12px; font-weight: 700; letter-spacing: -0.02em; }
.card-icon { color: var(--accent); margin-bottom: 6px; filter: drop-shadow(0 0 12px var(--accent-glow)); }
.search-card h2 { margin-top: 16px; margin-bottom: 8px; }
.queue-spin {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 8px auto 0;
  display: grid;
  place-items: center;
}
.queue-spin.drop #queue-status {
  animation: queueNumDrop 0.4s ease-out;
}
.queue-spinner {
  position: absolute;
  inset: 0;
  width: 108px !important;
  height: 108px !important;
  margin: 0 !important;
  border: 5px solid rgba(124, 58, 237, 0.22);
  border-top-color: #c4b5fd;
  border-right-color: #8b5cf6;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.12), 0 0 30px rgba(139, 92, 246, 0.28);
  animation: spin 0.85s linear infinite;
}
@keyframes queueNumDrop {
  0% { transform: scale(1.18); opacity: 0.7; }
  60% { transform: scale(0.92); }
  100% { transform: scale(1); opacity: 1; }
}

.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
#choices-age { grid-template-columns: 1fr; }
.chat-safety {
  flex: none;
  margin: 0 12px 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 107, 138, 0.35);
  border-radius: 12px;
  background: rgba(255, 107, 138, 0.08);
}
.chat-safety strong {
  display: block;
  color: #ff8fa8;
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.chat-safety p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.choice {
  min-height: 74px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--option);
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  padding: 8px;
  transition: 0.18s ease;
}
.choice:hover { background: var(--option-on); }
.choice[aria-pressed="true"] {
  border-color: transparent;
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent), 0 0 22px var(--accent-soft);
  color: var(--text);
}

.primary, .ghost {
  border-radius: 999px;
  min-height: 44px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.18s ease;
}
.primary {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: var(--on-accent);
  border: 0;
  box-shadow: 0 10px 28px var(--accent-glow);
}
.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
  filter: brightness(1.05);
}
.primary:disabled { opacity: 0.45; box-shadow: none; }
.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.ghost:hover { background: var(--hover); border-color: rgba(255, 255, 255, 0.16); }
.block { width: 100%; margin-top: 8px; }
.row-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

#dev-modal .muted,
#pass-modal .muted {
  margin: 0 0 4px;
}
.pass-promo {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(124, 58, 237, 0.08);
  text-align: left;
}
.pass-promo.compact {
  margin-top: 12px;
  margin-bottom: 4px;
}
.pass-promo .muted {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
}
.pass-promo .primary { margin-top: 0; }
.pass-box {
  margin: 14px 0;
  border: 1px solid var(--line);
  background: var(--option);
  border-radius: var(--radius);
  overflow: hidden;
}
.pass-qr-wrap {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 14px 0 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
#pass-qr {
  width: 220px;
  height: 220px;
  object-fit: contain;
  image-rendering: pixelated;
}
#pass-qr[hidden] { display: none !important; }
#pass-qr-hint {
  margin: 0;
  color: #4b4560;
  font-size: 12px;
  text-align: center;
}
.pass-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.pass-row:last-child { border-bottom: 0; }
.pass-row span { min-width: 120px; font-size: 12px; }
.pass-row strong { flex: 1; font-size: 14px; word-break: break-all; }
.pass-row .ghost {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
}
.pass-copy-row strong {
  font-size: 11px;
  line-height: 1.35;
  max-height: 3.9em;
  overflow: hidden;
}
.pass-steps { font-size: 13px; line-height: 1.5; margin: 10px 0 0; text-align: left; }
#pass-modal .modal {
  max-width: min(520px, calc(100vw - 24px));
  max-height: min(92vh, 900px);
  overflow: auto;
}
#pass-modal .modal-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
#pass-modal .modal-actions .primary,
#pass-modal .modal-actions .ghost,
#pass-modal .modal-actions a.primary {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#queue-status {
  position: relative;
  z-index: 1;
  margin: 0;
  min-width: 1.35em;
  color: var(--text);
  font-size: 40px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  text-align: center;
}
#online-search {
  margin: 0 0 4px;
  font-size: 13px;
}
#search-hint {
  display: none;
}
#btn-pass,
#btn-pass-prefs { margin-top: 0; }
.field-label {
  display: block;
  margin: 14px 0 6px;
  font-size: 14px;
  color: var(--muted);
  text-align: left;
}
#dev-user,
#dev-password {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--option);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
}
#dev-user:focus,
#dev-password:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-error {
  color: var(--danger);
  font-size: 14px;
  margin: 10px 0 0;
  text-align: left;
}

.spinner {
  width: 52px;
  height: 52px;
  margin: 4px auto 14px;
  border-radius: 50%;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 24px var(--accent-soft);
}
@keyframes spin { to { transform: rotate(360deg); } }

#thread {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(14, 14, 22, 0.55);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(16px);
}
html[data-theme="light"] #thread {
  background: rgba(255, 255, 255, 0.55);
}
.partner-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(20, 20, 30, 0.72);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  backdrop-filter: blur(12px);
}
html[data-theme="light"] .partner-bar {
  background: rgba(255, 255, 255, 0.7);
}
.avatar, .call-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #f472b6);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 18px var(--accent-glow);
}
.partner-meta { display: flex; flex-direction: column; min-width: 0; }
.partner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.partner-meta strong { font-size: 15px; color: var(--text); letter-spacing: -0.02em; }
.partner-meta span { font-size: 12px; }
.partner-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--option);
  font-family: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: default;
}
.partner-tag.normal {
  color: #7dffb2;
  border-color: rgba(125, 255, 178, 0.35);
}
.partner-tag.pass {
  color: #c4b5fd;
  border-color: rgba(196, 181, 253, 0.4);
}
.partner-tag.invisible {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(139, 92, 246, 0.16);
}
.partner-tag.clickable {
  cursor: pointer;
}
.partner-tag.clickable:hover {
  filter: brightness(1.12);
  box-shadow: 0 0 0 1px currentColor;
}
#partner-tag[hidden] { display: none !important; }
.partner-meta .online { color: var(--ok); }
.partner-meta .away { color: #fbbf24; }
.partner-meta .offline { color: var(--muted); }
.partner-meta .typing { color: var(--accent); }
.partner-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.mini {
  background: var(--option);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 36px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: 0.18s ease;
}
.mini:hover {
  background: var(--option-on);
  box-shadow: 0 0 16px var(--accent-soft);
}
.mini.danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(255, 107, 138, 0.35);
}
.mini.danger:hover {
  background: rgba(255, 107, 138, 0.12);
  box-shadow: none;
}

#messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(ellipse 55% 40% at 80% 20%, rgba(139, 92, 246, 0.12), transparent 55%),
    radial-gradient(ellipse 45% 35% at 15% 85%, rgba(225, 29, 72, 0.08), transparent 50%),
    transparent;
}
#messages.drop { outline: 2px dashed var(--accent); outline-offset: -10px; border-radius: 16px; }
#messages::-webkit-scrollbar { width: 8px; }
#messages::-webkit-scrollbar-thumb {
  background: var(--scroll);
  border-radius: 999px;
  border: 0;
}

.msg { display: flex; flex-direction: column; max-width: min(72%, 460px); animation: rise 0.22s ease; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; align-items: flex-start; }
.msg.system {
  align-self: center;
  max-width: 440px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.bubble {
  padding: 11px 14px;
  border-radius: 18px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  border: 0;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  font-size: 14px;
}
.mine .bubble {
  background: var(--bubble-mine);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 10px 28px var(--accent-glow);
}
.theirs .bubble {
  background: var(--bubble);
  color: var(--text);
  border-bottom-left-radius: 6px;
}
html[data-theme="light"] .mine .bubble {
  color: #fff;
}
html[data-theme="light"] .theirs .bubble {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(76, 29, 149, 0.08);
}
.system .bubble { background: transparent; padding: 4px 8px; border: 0; box-shadow: none; }
.bubble.media { background: transparent; padding: 0; border: 0; box-shadow: none; }
.bubble img, .bubble video {
  display: block;
  width: min(280px, 70vw);
  max-height: 320px;
  border-radius: 16px;
  background: var(--media-bg);
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}
.bubble video { object-fit: contain; }
.preview-meta {
  margin-top: 12px;
  text-align: left;
}
.preview-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.viewonce-actions {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}
.viewonce-actions .ghost {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  padding: 7px 12px;
  font-size: 12px;
}
.preview-meta select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--option);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  margin-bottom: 4px;
}
.meta-rating-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.meta-choice {
  min-height: 44px;
  border-radius: 12px;
}
.meta-choice[aria-pressed="true"][data-rating="plus18"] {
  border-color: transparent;
  background: rgba(255, 107, 138, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 107, 138, 0.55);
  color: #ff8aa3;
}
.viewonce-card {
  position: relative;
  width: min(260px, 72vw);
  border: 1px solid var(--line);
  background: var(--option);
  border-radius: 16px;
  overflow: hidden;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: 0.18s ease;
  padding: 0;
}
.viewonce-card.sealed {
  min-height: 168px;
  background: #12121a;
}
.viewonce-card.sealed:hover {
  box-shadow: 0 0 0 1px var(--accent-soft), 0 10px 24px rgba(0, 0, 0, 0.22);
}
.viewonce-blur {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(18px) saturate(1.05) brightness(0.7);
  transform: scale(1.2);
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
.viewonce-blur.placeholder {
  filter: none;
  transform: none;
  background:
    radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.42), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(255, 107, 138, 0.25), transparent 50%),
    #1a1a28;
}
.viewonce-blur.placeholder.audio {
  background:
    radial-gradient(circle at 50% 40%, rgba(139, 92, 246, 0.35), transparent 50%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.08) 0 4px,
      transparent 4px 10px
    ),
    #151522;
}
.viewonce-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 8, 14, 0.05), rgba(8, 8, 14, 0.78));
  pointer-events: none;
}
.viewonce-info {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: end;
  min-height: 168px;
  padding: 12px;
}
.viewonce-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.viewonce-details {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}
.viewonce-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  backdrop-filter: blur(6px);
}
.viewonce-tag.plus18 {
  background: rgba(255, 77, 109, 0.42);
  border-color: rgba(255, 107, 138, 0.55);
  color: #ffe4ea;
}
.viewonce-tag.normal {
  background: rgba(52, 211, 153, 0.28);
  border-color: rgba(52, 211, 153, 0.45);
  color: #e8fff4;
}
.viewonce-card.text-only {
  display: grid;
  gap: 6px;
  padding: 14px;
  min-height: 0;
  color: var(--text);
  background: var(--option);
}
.viewonce-card.text-only strong {
  font-size: 14px;
  letter-spacing: -0.02em;
}
.viewonce-card.text-only > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.viewonce-card.burned {
  cursor: default;
  opacity: 0.9;
  box-shadow: none;
}
.viewonce-card.burned:hover {
  box-shadow: none;
  background: var(--option);
}
.nosave,
.nosave * {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.msg time { color: var(--subtle); font-size: 10px; margin-top: 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

#composer {
  position: relative;
  z-index: 25;
  flex: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0 14px 14px;
  padding: 12px;
  background: var(--composer);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
#composer.is-off {
  opacity: 0.55;
  pointer-events: none;
}
.composer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
#msg-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  background: var(--option);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  font-size: 14px;
  padding: 13px 16px;
}
#msg-input:focus {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
#msg-input:disabled { opacity: 0.55; }
#msg-input::placeholder { color: var(--subtle); }
.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.tool-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
}
html[data-theme="light"] .tool-group {
  background: rgba(15, 10, 30, 0.04);
}
.tool-group-end {
  margin-left: auto;
}
#composer.recording-voice .composer-toolbar,
#composer.recording-voice .composer-row { display: none; }
#voice-bar {
  display: grid;
  grid-template-columns: auto auto minmax(100px, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px 4px;
}
#voice-bar[hidden] { display: none !important; }
.voice-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.voice-meta .meta-choice {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 12px;
}
#lightbox-audio {
  width: min(420px, 92vw);
}
.voice-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4d6d;
  box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.45);
  animation: camPulse 1.1s ease-in-out infinite;
}
#voice-timer {
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: #ff6b8a;
}
#voice-hint { font-size: 13px; }
#btn-voice.recording {
  color: #ff6b8a;
  background: rgba(255, 107, 138, 0.16);
  border-color: rgba(255, 107, 138, 0.35);
}
.bubble.media audio {
  display: block;
  width: min(260px, 70vw);
  max-width: 100%;
  margin: 0;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #c9c6d6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: 0.18s ease;
}
html[data-theme="light"] .icon-btn { color: #5b5670; }
.icon-btn:hover:not(:disabled) {
  color: var(--text);
  background: var(--hover);
  border-color: var(--line);
}
.icon-btn:disabled { opacity: 0.35; }
.icon-btn.danger {
  color: #ff8aa3;
}
.icon-btn.danger:hover:not(:disabled) {
  color: #ff6b8a;
  background: rgba(255, 107, 138, 0.14);
  border-color: rgba(255, 107, 138, 0.28);
}
#send-btn,
.icon-btn.send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(124, 58, 237, 0.28);
  color: #d8b4fe;
}
#send-btn:not(:disabled),
.icon-btn.send:not(:disabled) {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px var(--accent-glow);
}
#send-btn:not(:disabled):hover,
.icon-btn.send:not(:disabled):hover {
  filter: brightness(1.08);
}

#emoji-pop {
  position: absolute;
  right: 12px;
  bottom: calc(100% + 10px);
  width: 280px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 30;
  backdrop-filter: blur(16px);
}
#emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
#emoji-grid button {
  border: 0;
  background: transparent;
  border-radius: 10px;
  font-size: 22px;
  line-height: 1.3;
  padding: 4px 0;
}
#emoji-grid button:hover { background: var(--option); }

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(6, 6, 12, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  backdrop-filter: blur(8px);
}
.modal {
  width: min(460px, 100%);
  background: var(--card);
  color: var(--text);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow), 0 0 48px rgba(139, 92, 246, 0.12);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.modal h2 { margin: 0 0 12px; font-size: 18px; letter-spacing: -0.02em; }
#preview-visual img, #preview-visual video {
  width: 100%;
  max-height: 50vh;
  object-fit: contain;
  background: var(--media-bg);
  border-radius: var(--radius);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.modal-actions.center { justify-content: center; }
.dev-ready-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.dev-ready-actions .block { width: 100%; }
.danger-text { color: var(--danger) !important; }
#dev-dock {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 130;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  box-shadow: none;
  backdrop-filter: blur(10px);
  opacity: 0.72;
}
#dev-dock:hover { opacity: 1; }
#dev-dock[hidden] { display: none !important; }
.dev-dock-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-right: 2px;
  opacity: 0.55;
}
#dev-dock .primary,
#dev-dock .ghost {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
}
.media-pick-actions { display: grid; gap: 10px; margin-top: 16px; }

#camera-capture {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: #000;
}
.phone-cam {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
}
#camera-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  transform: scaleX(-1);
}
#camera-preview.rear { transform: none; }
.phone-cam-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 8px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent);
}
.phone-cam-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.phone-cam-meta strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#camera-timer {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: #ff6b8a;
  font-weight: 700;
}
.phone-cam-icon,
.phone-cam-side {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}
.phone-cam-icon svg,
.phone-cam-side svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.phone-cam-spacer { width: 44px; height: 44px; }
.phone-cam-hint {
  position: absolute;
  left: 50%;
  bottom: 168px;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}
.phone-cam-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  gap: 18px;
  padding: 18px 28px calc(28px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.62), transparent);
}
.phone-cam-bottom .phone-cam-side:first-child { justify-self: start; }
.phone-cam-bottom .phone-cam-side:last-child { justify-self: end; }
.phone-shutter {
  width: 78px;
  height: 78px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  position: relative;
  padding: 0;
}
.phone-shutter-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}
.phone-shutter-core {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #fff;
  transition: 0.15s ease;
}
.phone-shutter:active .phone-shutter-core {
  transform: scale(0.9);
  background: #f3e8ff;
}
.phone-shutter.recording .phone-shutter-ring {
  border-color: #ff4d6d;
  animation: camPulse 1.1s ease-in-out infinite;
}
.phone-shutter.recording .phone-shutter-core {
  inset: 22px;
  border-radius: 8px;
  background: #ff4d6d;
}
.phone-cam-modes {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 118px;
  z-index: 2;
  text-align: center;
  pointer-events: none;
}
#camera-mode-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #f5c542;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
#camera-capture.flash .phone-cam::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0.85;
  animation: camFlash 0.18s ease-out;
  pointer-events: none;
  z-index: 3;
}
@keyframes camFlash {
  from { opacity: 0.9; }
  to { opacity: 0; }
}
@keyframes camPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.45); }
  50% { box-shadow: 0 0 0 10px rgba(255, 77, 109, 0); }
}

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 16px 24px;
}
.viewonce-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent);
  color: #fff;
  z-index: 2;
}
#lightbox-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#lightbox-stage {
  width: min(960px, 100%);
  height: min(78vh, 100%);
  display: grid;
  place-items: center;
}
#lightbox img,
#lightbox video {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 12px;
  background: #000;
}
#lightbox-hint {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  margin: 0;
}
#lightbox-close {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

#call-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(6, 6, 12, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(10px);
}
#call-incoming { text-align: center; }
.call-avatar { margin: 0 auto 12px; }
.call-avatar.big { width: 92px; height: 92px; font-size: 36px; }
#call-stage {
  position: relative;
  width: min(980px, 100%);
  height: min(640px, 100%);
  background: #101018;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
#remote-video { width: 100%; height: 100%; object-fit: cover; background: #101018; }
#local-video {
  display: block;
  position: absolute;
  width: 180px;
  height: 124px;
  right: 16px;
  bottom: 96px;
  object-fit: cover;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  background: #1a1528;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}
#local-video.off { opacity: 0.35; }
#audio-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
}
.call-top {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  font-size: 14px;
  z-index: 3;
}
#call-status { margin-right: auto; }
#call-inhibit-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: none;
}
#call-inhibit-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  background: #050508;
  color: #fff;
  text-align: center;
}
#call-inhibit-shield[hidden] { display: none !important; }
#call-inhibit-shield strong {
  font-size: 18px;
  letter-spacing: 0.02em;
}
#call-inhibit-shield span {
  max-width: 340px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}
body.capture-lock #lightbox-stage,
body.capture-lock #remote-video,
body.capture-lock #local-video,
.secure-hidden {
  filter: brightness(0) !important;
  opacity: 0.02 !important;
}
body.capture-lock #messages .bubble.media,
body.capture-lock #messages .viewonce-card {
  filter: blur(22px) brightness(0.25);
  pointer-events: none;
}
body.capture-lock #lightbox {
  background: #000;
}
#call-stage.inhibiting #remote-video,
#call-stage.inhibiting #local-video {
  filter: brightness(0);
}
#call-inhibit[aria-pressed="true"] {
  background: rgba(124, 58, 237, 0.88);
}
#call-inhibit[aria-pressed="true"]::after { display: none; }
#demo-banner {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 92px;
  margin: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
}
.call-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  display: flex;
  justify-content: center;
  gap: 14px;
}
.call-ctrl, .hang {
  width: 54px;
  height: 54px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 50%;
}
.call-ctrl[aria-pressed="true"] { background: rgba(255, 107, 138, 0.9); }
.call-ctrl[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  background: #fff4f5;
  transform: rotate(-40deg);
}
.icon-btn { position: relative; }
.hang { background: var(--danger); }
.hang:hover { filter: brightness(1.05); }

#toast {
  position: fixed;
  top: auto;
  bottom: 108px;
  left: 50%;
  z-index: 80;
  transform: translateX(-50%) translateY(8px);
  max-width: min(520px, calc(100% - 24px));
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 18px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  box-shadow: var(--shadow);
  font-size: 13px;
  backdrop-filter: blur(14px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.capture-modal { text-align: center; border: 1px solid rgba(255, 107, 138, 0.45); }
.capture-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 107, 138, 0.18);
  color: var(--danger);
  font-size: 28px;
  font-weight: 800;
}
#capture-banner {
  position: fixed;
  top: 74px;
  left: 50%;
  z-index: 85;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 20px));
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: linear-gradient(90deg, #7f1d1d, #9f1239);
  color: #fff4f5;
  border: 1px solid rgba(255, 180, 188, 0.35);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
#capture-banner strong { font-size: 14px; }
#capture-banner span { flex: 1; min-width: 180px; font-size: 13px; line-height: 1.4; opacity: 0.95; }
#capture-banner .ghost {
  border-color: rgba(255, 244, 245, 0.35);
  color: #fff4f5;
  padding: 8px 12px;
  font-size: 13px;
}
#capture-banner.pulse {
  animation: capturePulse 1.1s ease-in-out 2;
}
@keyframes capturePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 122, 0.35); }
  50% { box-shadow: 0 0 0 10px rgba(255, 107, 122, 0); }
}

#mod-panel {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(5, 5, 10, 0.92);
  padding: 16px;
}
#mod-panel[hidden] { display: none !important; }
.mod-shell {
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
}
.mod-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.mod-top strong { display: block; }
.mod-mode-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.mod-top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mod-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
}
.mod-side {
  border-right: 1px solid var(--line);
  padding: 12px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.mod-section h3 {
  margin: 0 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mod-section h3 span {
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  background: var(--option);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}
.mod-room-btn,
.mod-window-btn {
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  background: var(--option);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
}
.mod-room-btn.active,
.mod-window-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.mod-room-btn small,
.mod-window-btn small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 11px;
}
.mod-phase {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 7px;
  margin-left: 6px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.mod-phase.chat { color: #7dffb2; border-color: rgba(125, 255, 178, 0.35); }
.mod-phase.queue { color: #ffd27d; border-color: rgba(255, 210, 125, 0.35); }
.mod-phase.idle { color: var(--muted); }
.mod-feed {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.mod-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.mod-feed-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#mod-events {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mod-event {
  border: 1px solid var(--line);
  background: var(--option);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}
.mod-event .meta {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}
.mod-event img,
.mod-event video,
.mod-event audio {
  max-width: min(360px, 100%);
  margin-top: 8px;
  border-radius: 10px;
  display: block;
}
@media (max-width: 860px) {
  .mod-body { grid-template-columns: 1fr; }
  .mod-side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 240px; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 860px) {
  .nav-right a { display: none; }
  #menu-btn { display: inline-flex; }
  header { padding: 0 12px; gap: 10px; }
  .msn-panel-body {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .msn-copy { padding: 24px 18px 10px; order: 1; }
  .msn-art {
    order: 0;
    min-height: 180px;
    padding: 20px 12px 4px;
  }
  .msn-icon-bubbles { width: 168px; }
  .msn-actions { margin-bottom: 16px; }
  .msn-points { margin-bottom: 8px; }
  .msg { max-width: 86%; }
  #local-video { width: 112px; height: 80px; bottom: 88px; right: 10px; }
  #call-layer { padding: 0; }
  #call-stage { width: 100%; height: 100%; border-radius: 0; }
}

@media (max-width: 700px) {
  #thread { margin: 8px; border-radius: 18px; }
  #composer {
    border-radius: 18px;
    padding: 10px;
    margin: 0 8px 8px;
  }
  .composer-toolbar {
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .composer-toolbar::-webkit-scrollbar { display: none; }
  .tool-group { flex: none; }
  .partner-actions { max-width: 58%; }
  .mini {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 11px;
  }
  .icon-btn {
    width: 38px;
    height: 38px;
  }
  #send-btn,
  .icon-btn.send {
    width: 42px;
    height: 42px;
  }
  #emoji-pop { right: 8px; left: 8px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
