:root {
  --background: #08080a;
  --foreground: #f4f4f5;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-strong: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-border-strong: rgba(255, 255, 255, 0.18);
  --muted: rgba(255, 255, 255, 0.55);
  --text-dim: rgba(255, 255, 255, 0.4);
  --danger: rgba(255, 255, 255, 0.7);
  --info-security-accent: rgba(190, 216, 232, 0.72);
  --info-security-accent-soft: rgba(190, 216, 232, 0.09);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  background: var(--background);
  color: var(--foreground);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

button, nav, .topbar, .bottom-bar, .tb-avatar, .gender-choice, .sidebar {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

a { color: inherit; text-decoration: none; }

body > * { position: relative; z-index: 1; }

/* === TOP BAR === */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(56px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(16px, env(safe-area-inset-left, 16px));
  padding-right: max(16px, env(safe-area-inset-right, 16px));
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border-bottom: 0;
  z-index: 50;
  box-sizing: border-box;
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.tb-icon {
  background: rgba(18, 18, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--foreground);
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.15s ease;
}
.tb-icon:hover { background: rgba(255, 255, 255, 0.15); }
.tb-icon .material-symbols-outlined { font-size: 24px; }

/* ONLINE USER COUNTS CAPSULE (TOP RIGHT) */
.tb-stats-pill {
  display: inline-flex !important;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  background: rgba(18, 18, 24, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.stat-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fff;
}
.stat-pill-item.male { color: #38bdf8; }
.stat-pill-item.female { color: #c084fc; }
.stat-ic { font-size: 16px; }

.tb-spacer { flex: 1; }

/* AVATAR (Border & glowing color based on gender) */
.tb-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  user-select: none;
  overflow: hidden;
  transition: all 0.15s ease;
}
.tb-avatar.gender-W, .am-avatar.gender-W {
  background: rgba(244, 114, 182, 0.15) !important;
  color: #f472b6 !important;
  border: 2px solid #f472b6 !important;
}
.tb-avatar.gender-M, .am-avatar.gender-M {
  background: rgba(96, 165, 250, 0.15) !important;
  color: #60a5fa !important;
  border: 2px solid #60a5fa !important;
}
.tb-avatar.gender-N, .am-avatar.gender-N {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  border: 2px solid rgba(255, 255, 255, 0.4) !important;
}
.tb-avatar:hover { transform: scale(1.05); }
.tb-avatar:active { transform: scale(0.95); }

/* === MAIN SHELL === */
.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  padding-top: calc(56px + env(safe-area-inset-top, 0px));
  height: 100vh;
  height: 100dvh;
  transition: grid-template-columns 0.3s ease;
  box-sizing: border-box;
}

.shell.nav-collapsed { grid-template-columns: 0 1fr; }
.shell.nav-collapsed .sidebar { opacity: 0; pointer-events: none; overflow: hidden; }

@media (max-width: 768px) {
  .shell { grid-template-columns: 1fr; }
  .shell.nav-collapsed .sidebar { display: none; }
}

/* SIDEBAR BACKDROP FOR MOBILE DRAWER */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1990 !important;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

@media (max-width: 768px) {
  .shell:not(.nav-collapsed) .sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
}

/* === Desktop reference layout v153 ===
   Calibrated against justrechat.png (1920x1080 CSS px, captured @2x). */
body::before {
  background: #070808 !important;
  background-image: none !important;
}

body::after {
  display: none !important;
}

.shell,
.shell.nav-collapsed {
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 0;
  width: 100%;
  height: 100dvh;
  padding: 0;
  background: #070808;
  transition: grid-template-columns 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.shell.nav-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.topbar {
  left: 310px !important;
  height: 80px !important;
  padding: 0 14px !important;
  transition: left 260ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body:has(.shell.nav-collapsed) .topbar {
  left: 0 !important;
}

.tb-icon {
  width: 50px !important;
  height: 50px !important;
  background: linear-gradient(180deg, #242525 0%, #1c1d1d 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
}

.tb-icon:hover {
  background: #292a2a !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

.tb-icon:active {
  transform: scale(0.96) !important;
}

.tb-icon .material-symbols-outlined {
  font-size: 29px !important;
  font-variation-settings: "FILL" 0, "wght" 350, "GRAD" 0, "opsz" 28;
}

.tb-stats-pill {
  min-height: 50px !important;
  gap: 15px !important;
  padding: 0 19px !important;
  background: linear-gradient(180deg, #242525 0%, #1d1e1e 100%) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
}

.stat-pill-item {
  gap: 7px;
  line-height: 1;
}

.stat-pill-item.male {
  color: #f02bd3;
}

.stat-pill-item.female {
  color: #238cf3;
}

.stat-ic {
  font-size: 20px !important;
}

.sidebar {
  position: relative !important;
  width: 310px !important;
  min-width: 310px !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 24px 10px 20px !important;
  overflow: hidden !important;
  background: #0e0f10 !important;
  border: 0 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.025) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.sidebar::before {
  display: none !important;
}

.shell.nav-collapsed .sidebar {
  opacity: 0 !important;
  pointer-events: none !important;
}

.sb-header {
  display: flex !important;
  height: 54px !important;
  margin: 0 35px 16px !important;
  padding: 0 !important;
  border: 0 !important;
  flex-shrink: 0;
}

.sb-brand {
  gap: 14px !important;
  white-space: nowrap;
}

.sb-logo {
  width: 40px !important;
  height: 40px !important;
  flex-shrink: 0;
}

.sb-title {
  font-family: "Manrope", "Segoe UI Variable", sans-serif !important;
  font-size: 28px !important;
  font-weight: 800 !important;
  letter-spacing: -0.04em !important;
}

.sb-close-btn {
  display: none !important;
}

.nav-list {
  gap: 24px !important;
}

.nav-pill {
  width: 100% !important;
  height: 56px !important;
  min-height: 56px !important;
  padding: 0 18px !important;
  gap: 12px !important;
  background: #181919 !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  color: #f4f4f5 !important;
  font-size: 20px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}

.nav-pill:hover {
  background: #202121 !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  transform: none !important;
}

.nav-pill:active {
  transform: scale(0.985) !important;
}

.nav-pill.active {
  background: #1a1b1b !important;
  border-color: rgba(255, 255, 255, 0.88) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

.nav-pill .material-symbols-outlined {
  font-size: 25px !important;
  font-variation-settings: "FILL" 0, "wght" 350, "GRAD" 0, "opsz" 24;
}

.sb-footer {
  margin-top: auto !important;
  padding: 0 !important;
  border: 0 !important;
}

.sb-profile-btn {
  height: 56px !important;
  padding: 0 11px !important;
  gap: 12px !important;
  background: linear-gradient(180deg, #292a2a 0%, #242525 100%) !important;
  border-color: rgba(255, 255, 255, 0.13) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

.sb-profile-avatar {
  position: relative;
  width: 42px !important;
  height: 42px !important;
  padding: 3px;
  overflow: hidden;
  isolation: isolate;
  font-size: 0 !important;
  color: #ffffff !important;
  background:
    radial-gradient(circle at 65% 30%, #ffffff 0 8%, transparent 9%),
    conic-gradient(from 25deg, #ff9f1a, #ffec62, #f8f8f8, #8f5cff, #f2389d, #ff9f1a) !important;
  border: 2px solid rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 0 0 2px #202121;
}

.sb-profile-avatar::after {
  content: "N";
  position: absolute;
  inset: 5px;
  z-index: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 10, 11, 0.82);
  color: #ffffff;
  font: 800 15px/1 "Manrope", sans-serif;
}

.sb-profile-name {
  font-size: 20px !important;
  font-weight: 650 !important;
  letter-spacing: -0.02em;
}

.stage {
  min-width: 0;
  width: 100%;
  height: 100dvh;
  background: #070808;
  border-radius: 0;
  overflow: hidden;
}

.chat-list-view {
  width: 100%;
  height: 100%;
  padding: 130px 10px 20px 18px !important;
}

.stage-chat-grid {
  width: 100%;
  gap: 14px;
}

.stage-chat-capsule {
  min-height: 80px !important;
  height: 80px !important;
  gap: 18px !important;
  padding: 0 29px !important;
  overflow: hidden;
  background: #171818 !important;
  border: 1px solid rgba(255, 255, 255, 0.17) !important;
  border-radius: 999px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.015) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  animation: none !important;
}

.stage-chat-capsule::before {
  display: none !important;
}

.stage-chat-capsule:hover {
  transform: none !important;
  background: #1d1e1e !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

.stage-chat-capsule:active {
  transform: scale(0.997) !important;
}

.stage-chat-capsule .s-capsule-avatar {
  width: 36px !important;
  height: 36px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.stage-chat-capsule .s-capsule-avatar .material-symbols-outlined {
  font-size: 36px !important;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 36;
}

.stage-chat-capsule .s-capsule-body {
  display: flex;
  justify-content: center;
}

.stage-chat-capsule .s-capsule-top {
  flex-wrap: nowrap;
}

.stage-chat-capsule .s-capsule-title {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 20px !important;
  font-weight: 600 !important;
  letter-spacing: -0.035em;
}

.stage-chat-capsule .s-capsule-desc,
.stage-chat-capsule .s-capsule-status,
.stage-chat-capsule .s-capsule-action {
  display: none !important;
}

.chat-active {
  padding: 80px 10px 10px 18px !important;
}

.nekto-container {
  padding: 92px 18px 20px !important;
}

@media (max-width: 768px) {
  .shell,
  .shell.nav-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar,
  body:has(.shell.nav-collapsed) .topbar {
    left: 0 !important;
    height: 64px !important;
    padding: 0 12px !important;
  }

  .tb-icon {
    width: 44px !important;
    height: 44px !important;
  }

  .sidebar {
    position: fixed !important;
    width: min(310px, 88vw) !important;
    min-width: 0 !important;
    padding: max(20px, env(safe-area-inset-top, 0px)) 10px max(20px, env(safe-area-inset-bottom, 0px)) !important;
    transform: translateX(0) !important;
  }

  .shell.nav-collapsed .sidebar {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: none !important;
    transform: translateX(-105%) !important;
  }

  .sb-header {
    margin-inline: 16px !important;
  }

  .sb-close-btn {
    display: flex !important;
  }

  .sb-title {
    font-size: 24px !important;
  }

  .chat-list-view {
    padding: 82px 12px 16px !important;
  }

  .stage-chat-capsule {
    min-height: 70px !important;
    height: 70px !important;
    padding: 0 20px !important;
  }

  .stage-chat-capsule .s-capsule-title {
    font-size: 17px !important;
  }

  .chat-active {
    padding: 68px 8px 8px !important;
  }

  .nekto-container {
    padding: 76px 12px 18px !important;
  }
}

/* === SIDEBAR (NAV RAIL & DRAWER) === */
.sidebar {
  display: flex;
  flex-direction: column;
  background: #08080a;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 14px;
  height: calc(100vh - 56px);
  height: calc(100dvh - 56px - env(safe-area-inset-top, 0px));
  box-sizing: border-box;
}

.sb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-logo {
  width: 28px;
  height: 28px;
}
.sb-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.sb-close-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sb-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

@media (min-width: 769px) {
  .sb-header { display: none; }
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.sb-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sb-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}
.sb-profile-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

.sb-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  flex-shrink: 0;
}
.sb-profile-avatar.gender-W {
  background: rgba(244, 114, 182, 0.15);
  color: #f472b6;
  border: 1.5px solid #f472b6;
}
.sb-profile-avatar.gender-M {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
  border: 1.5px solid #60a5fa;
}
.sb-profile-avatar.gender-N {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.sb-profile-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* nav-pill: see later glass block (~line 1114) */

/* CHAT SUBLIST (Nested under "Чаты") */
.chat-sublist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 12px;
  margin-top: 2px;
}

.chat-capsule {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chat-capsule:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}
.chat-capsule.active {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}
.capsule-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.capsule-avatar .material-symbols-outlined { font-size: 18px; }
.capsule-info { display: flex; flex-direction: column; min-width: 0; }
.capsule-name { font-size: 13px; font-weight: 600; color: #fff; }
.capsule-preview { font-size: 10.5px; color: var(--muted); margin-top: 1px; }

/* === MAIN CHAT STAGE === */
.stage {
  display: flex;
  flex-direction: column;
  background: #08080a;
  height: calc(100vh - 56px);
  overflow: hidden;
}

.stage-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

/* CHAT LIST VIEW (Stretched Capsule across Stage) */
.chat-list-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px;
  width: 100%;
  box-sizing: border-box;
  overflow-y: auto;
}

/* NEKTO.ME ROULETTE CARD */
.nekto-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
}

.nekto-card {
  position: relative;
  width: min(560px, 100%);
  border-radius: 22px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(20, 20, 26, 0.55);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.nekto-card::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 1px;
  border-radius: 32px 32px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  pointer-events: none;
}

.nekto-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.nekto-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.nekto-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.nekto-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nekto-label {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.nekto-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.nekto-btn-group {
  display: flex;
  gap: 6px;
}

.nekto-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.n-btn {
  flex: 1;
  padding: 9px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.n-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.n-btn.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  font-weight: 600;
}

/* Monochrome Start Chat Button */
.nekto-start-btn {
  width: 220px;
  height: 48px;
  margin: 8px auto 0 auto;
  background: transparent;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #f5f5f5;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

}

.nekto-start-btn:hover {
  background: #ffffff;
  color: #000000;

  transform: scale(1.02);
}

/* Online stats pill inside nekto card */
.nekto-stats-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin: 4px auto 0 auto;
}

.nekto-footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}
.nekto-footer b { color: #ffffff; }

.stage-chat-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

/* legacy stage-chat-capsule rules removed; see ~line 1164 */

.s-capsule-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
}

.s-capsule-avatar .material-symbols-outlined { font-size: 20px; }

.s-capsule-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.s-capsule-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.s-capsule-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
}

.s-capsule-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.28);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.s-capsule-desc {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s-capsule-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

/* legacy stage-chat-capsule:hover .s-capsule-action removed */

/* WIDE ROOM CAPSULE HEADER */
.chat-room-capsule {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 56px;
  padding: 0 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 16px;
  flex-shrink: 0;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 4px 20px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* === MESSAGES BUBBLES === */
.msg {
  display: flex;
  gap: 10px;
  max-width: 80%;
}
.msg.me {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg.peer { align-self: flex-start; }

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
}
.msg-avatar.gender-W { background: rgba(244, 114, 182, 0.2); color: #f472b6; border-color: rgba(244, 114, 182, 0.4); }
.msg-avatar.gender-M { background: rgba(96, 165, 250, 0.2); color: #60a5fa; border-color: rgba(96, 165, 250, 0.4); }

.msg-body { display: flex; flex-direction: column; gap: 4px; }
.msg-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.msg-author { font-weight: 600; }
.msg-time { color: var(--text-dim); }

.msg-bubble {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
}
.msg.me .msg-bubble {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.msg.time {
  align-self: center;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
}

/* composer & avatar-menu: see later glass block (~line 1397 / 1462) */

.avatar-menu.hidden { display: none !important; }

.avatar-menu > * + * {
  margin-top: 12px;
}

.avatar-menu .am-header {
  padding-bottom: 0;
  border-bottom: 0;
  margin-bottom: 0;
}

.avatar-menu .am-divider {
  margin-top: 16px;
  margin-bottom: 16px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.am-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}
.am-avatar {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.am-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.am-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
}
.am-status {
  font-size: 12px;
  color: var(--muted);
}

.am-pubkey-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  box-sizing: border-box;
  text-align: left;
  transition: all 0.15s ease;
}
.am-pubkey-card:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
}
.pubkey-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 14px;
  margin-bottom: 6px;
}
.pubkey-text {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.am-pubkey-copy-icon {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
  transition: color 0.15s ease;
}
.am-pubkey-card:hover .am-pubkey-copy-icon {
  color: #ffffff;
}

.access-key-label {
  margin-top: 2px;
}

.am-access-key-card {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  overflow: hidden;
  min-height: 42px;
  padding: 5px 7px 5px 14px;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.access-key-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-key-text.is-revealed {
  overflow-x: auto;
  text-overflow: clip;
  scrollbar-width: none;
  user-select: all;
}

.access-key-text.is-revealed::-webkit-scrollbar {
  display: none;
}

.am-key-action {
  display: inline-flex;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.am-key-action:hover,
.am-key-action:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.am-key-action .material-symbols-outlined {
  font-size: 18px;
}

.am-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gender-selector {
  display: flex;
  gap: 6px;
}
.g-btn {
  flex: 1;
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
}
.g-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--foreground); }
.g-btn.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--foreground);
}

.am-divider { height: 1px; background: var(--glass-border); }

.am-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.am-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.am-item.danger {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}
.am-item.danger:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
}
.am-item .material-symbols-outlined { font-size: 18px; }

/* === MODAL === */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}
.modal.hidden { display: none !important; }
.modal-card {
  width: min(440px, 100%);
  background: #121218;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 24px;
}
.modal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.brand-title { font-size: 18px; font-weight: 700; color: #fff; }
.brand-subtitle { font-size: 12px; color: var(--muted); display: block; }
.onb-section-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.onb-divider { height: 1px; background: var(--glass-border); margin: 16px 0; }
.muted-title { font-size: 14px; font-weight: 600; color: var(--foreground); margin-bottom: 10px; }
.muted { font-size: 12px; color: var(--muted); line-height: 1.45; }
.ts-wrapper { margin: 16px 0; min-height: 65px; }

.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

.modal-card > * + * {
  margin-top: 16px;
}

.modal-card .muted-title + .muted { margin-top: -4px; }
.btn-primary {
  width: 100%;
  height: 46px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-secondary {
  width: 100%;
  height: 46px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--foreground);
  font-size: 14px;
  cursor: pointer;
}
.seed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}
.seed-grid div {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 8px;
  font-size: 12px;
  font-family: monospace;
}
.access-key-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  backdrop-filter: blur(12px);
}
.access-key-box code {
  min-width: 0;
  flex: 1;
  color: var(--foreground);
  font: 600 13px/1.5 ui-monospace, "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
  user-select: all;
  padding: 2px 0;
}
.access-key-box .copy {
  flex-shrink: 0;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  color: var(--foreground);
  font: 600 12px/1 "Manrope", sans-serif;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.access-key-box .copy:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
}
.pubid-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 12px;
}
.pubid-box b { font-family: monospace; font-size: 11px; word-break: break-all; flex: 1; }
.pubid-box .copy { background: transparent; border: 0; color: var(--muted); cursor: pointer; }
.restore-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 14px 16px;
  color: #fff;
  font-family: monospace;
  font-size: 13px;
  outline: none;
  resize: vertical;
  backdrop-filter: blur(12px);
}
.hidden { display: none !important; }

/* === Apple Liquid Glass — dark === */
:root {
  --background: #050507;
  --foreground: #ffffff;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-raised: rgba(255, 255, 255, 0.06);
  --surface-soft: rgba(255, 255, 255, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-bg-strong: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-border-strong: rgba(255, 255, 255, 0.18);
  --glass-hi: rgba(255, 255, 255, 0.45);
  --glass-shadow: rgba(0, 0, 0, 0.55);
  --muted: rgba(255, 255, 255, 0.66);
  --text-dim: rgba(255, 255, 255, 0.42);
  --accent: #ffffff;
  --accent-strong: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.12);
  --accent-line: rgba(255, 255, 255, 0.42);
  --danger: #ff7c88;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 40px 120px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.07) inset;
  --blur-sm: blur(20px) saturate(180%);
  --blur-md: blur(36px) saturate(180%);
  --blur-lg: blur(50px) saturate(180%);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html,
body {
  min-width: 0;
  overflow: hidden;
  font-family: "Manrope", "Segoe UI Variable", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle white grid like before — no color glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    var(--background);
  background-size: 34px 34px;
}

/* Subtle noise grain for liquid glass texture */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

button,
input,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* === Apple Liquid Glass — surface mixin === */
/* Topbar — pill (heavily rounded) */
.topbar {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 60;
  height: 60px;
  padding: 0 18px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(20, 20, 26, 0.55);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  isolation: isolate;
}

/* Glass highlight on top edge of any glass surface */
.topbar::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 1px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  pointer-events: none;
  z-index: 1;
}

.tb-icon {
  border: 1px solid transparent;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.tb-icon:hover {
  background: var(--surface-soft);
  border-color: var(--glass-border);
}

.tb-icon:active { transform: scale(0.94); }

.tb-brand { gap: 11px; }
.tb-name,
.brand-title {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-weight: 600;
}

.tb-name {
  font-size: 15px;
  letter-spacing: -0.035em;
}

.tb-logo,
.modal-logo {
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.16));
}

.tb-stats-pill {
  gap: 12px;
  margin-left: 10px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(12px);
}

.tb-avatar {
  border-width: 1px !important;
  transition: transform 220ms var(--ease-spring), box-shadow 220ms ease;
}

.tb-avatar:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.shell {
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 12px;
  height: 100dvh;
  padding: 84px 12px 12px;
  transition: grid-template-columns 320ms var(--ease-out);
}

.sidebar {
  height: calc(100dvh - 96px);
  padding: 18px 12px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(20, 20, 26, 0.5);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 1px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  pointer-events: none;
}

.nav-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  transition: color 200ms ease, background-color 200ms ease, border-color 200ms ease, transform 220ms var(--ease-spring);
}

.nav-pill:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.nav-pill.active {
  color: var(--foreground);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 4px 14px rgba(0, 0, 0, 0.25);
}

/* no left white dot — whole pill is the indicator */

.stage {
  min-width: 0;
  height: calc(100dvh - 96px);
  border-radius: 22px;
  background: transparent;
  position: relative;
  overflow: hidden;
}

.chat-list-view { padding: 16px; }

.stage-chat-grid {
  width: 100%;
}

.stage-chat-capsule {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  position: relative;
  min-height: 64px;
  height: 64px;
  padding: 0 22px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    rgba(20, 20, 26, 0.45);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    0 16px 50px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: surface-in 480ms var(--ease-out) both;
  transition: transform 280ms var(--ease-spring), background-color 220ms ease, border-color 220ms ease, box-shadow 280ms ease;
  overflow: hidden;
}

.stage-chat-capsule::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 1px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  pointer-events: none;
}

.stage-chat-capsule:hover {
  transform: translateY(-3px) scale(1.005);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Horizontal layout for capsule in the chat list */
.stage-chat-capsule .s-capsule-body {
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.stage-chat-capsule .s-capsule-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: var(--foreground);
  backdrop-filter: blur(10px);
}

.stage-chat-capsule .s-capsule-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.s-capsule-top {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.s-capsule-tag {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-line);
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 8px;
}

.s-capsule-desc {
  color: var(--muted);
  font-size: 12px;
}
.s-capsule-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.s-capsule-status-dot,
.room-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a1a1aa;
  box-shadow: 0 0 0 3px rgba(161, 161, 170, 0.1);
}
.s-capsule-status[data-state="online"] { color: #d4ffe3; }
.s-capsule-status[data-state="online"] .s-capsule-status-dot,
.room-status[data-state="online"] .room-status-dot {
  background: #56e58c;
  box-shadow: 0 0 0 3px rgba(86, 229, 140, 0.12), 0 0 14px rgba(86, 229, 140, 0.34);
}
.s-capsule-status[data-state="connecting"] .s-capsule-status-dot,
.room-status[data-state="connecting"] .room-status-dot {
  background: #f5c96a;
  box-shadow: 0 0 0 3px rgba(245, 201, 106, 0.12);
  animation: secure-pulse 1.6s ease-in-out infinite;
}
.s-capsule-status[data-state="offline"] .s-capsule-status-dot,
.room-status[data-state="offline"] .room-status-dot {
  background: #ff7c88;
  box-shadow: 0 0 0 3px rgba(255, 124, 136, 0.12);
}
.s-capsule-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #ffffff;
  color: #09090b;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.16);
}
.s-capsule-action {
  padding: 9px 12px 9px 15px;
  border-radius: 999px;
  background: var(--surface-soft);
  border-color: var(--glass-border);
  color: var(--foreground);
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.s-capsule-action .material-symbols-outlined { font-size: 17px; }
/* legacy stage-chat-capsule:hover .s-capsule-action removed */

.chat-active {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
}

.chat-room-capsule {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  padding: 0 22px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    rgba(20, 20, 26, 0.5);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  flex-shrink: 0;
}

.chat-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--foreground);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.chat-back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateX(-1px);
}

.chat-back-btn .material-symbols-outlined { font-size: 20px; }

.chat-room-capsule::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 1px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  pointer-events: none;
}

.room-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--foreground);
  backdrop-filter: blur(10px);
  font-size: 20px;
  flex-shrink: 0;
}

.room-copy {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.room-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-subtitle {
  color: var(--muted);
  font-size: 11px;
}

.room-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 220px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.room-status[data-state="online"] { color: #d4ffe3; }
.room-status[data-state="offline"] { color: #ffc5ca; }

.room-security {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  font: 700 9px/1 "Unbounded", "Manrope", sans-serif;
}

.room-security .material-symbols-outlined { font-size: 14px; }

.messages {
  flex: 1;
  min-height: 0;
  gap: 8px;
  padding: 12px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.chat-empty-state {
  display: flex;
  flex: 1;
  width: min(360px, 88%);
  min-height: 220px;
  margin: auto;
  align-self: center;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.chat-empty-state .material-symbols-outlined {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--foreground);
  font-size: 23px;
}

.chat-empty-state strong {
  color: var(--foreground);
  font-size: 15px;
}

.chat-empty-state > span:last-child {
  max-width: 320px;
  font-size: 12px;
  line-height: 1.55;
}

.msg {
  animation: message-in 260ms var(--ease-out) both;
  transition: opacity 180ms ease, filter 180ms ease;
}

.msg-bubble {
  padding: 11px 15px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    rgba(20, 20, 26, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px 18px 18px 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.msg-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg.me .msg-bubble {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78)),
    rgba(255, 255, 255, 0.9);
  color: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 18px 18px 6px 18px;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.18);
}

.msg.is-pending { opacity: 0.58; }
.msg.is-failed { opacity: 0.72; filter: saturate(0.45); }
.msg.is-failed .msg-bubble { border-color: rgba(255, 124, 136, 0.48); }

.msg.time {
  border: 0;
  background: transparent;
  color: var(--text-dim);
}

.composer {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  min-height: 64px;
  height: auto;
  padding: 9px 10px 9px 16px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)),
    rgba(20, 20, 26, 0.55);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  flex-shrink: 0;
}

.composer::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 1px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  pointer-events: none;
}

.composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 120px;
  padding: 11px 14px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  line-height: 1.45;
  resize: none;
  overflow-y: auto;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.composer textarea::placeholder { color: var(--muted); }

.composer textarea:focus {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  outline: none;
}

.composer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--foreground);
  font-weight: 600;
  font-size: 13px;
  backdrop-filter: blur(14px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: background-color 200ms ease, border-color 200ms ease, transform 220ms var(--ease-spring);
}

.composer button:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}
.composer button:active { transform: translateY(0) scale(0.97); }
.composer button:disabled { cursor: default; opacity: 0.42; transform: none; }
.composer button[aria-busy="true"] { cursor: wait; }
.composer button .material-symbols-outlined { font-size: 18px; }

.composer-notice {
  min-height: 18px;
  margin: -7px 12px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.composer-notice[data-tone="warning"] { color: #f5d28a; }
.composer-notice[data-tone="error"] { color: #ffadb5; }

/* FULL PAGE PROFILE VIEW */
.avatar-menu {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  background: #08080a;
  padding: max(16px, calc(env(safe-area-inset-top, 0px) + 12px)) 16px max(16px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  overflow-y: auto;
  box-sizing: border-box;
  animation: surface-in 240ms var(--ease-out) both;
}

.avatar-menu.hidden {
  display: none !important;
}

.am-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.am-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.am-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.am-top-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.am-top-placeholder {
  width: 40px;
}

.am-content-wrap {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.avatar-menu::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 1px;
  border-radius: 22px 22px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  pointer-events: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: var(--blur-md) saturate(140%);
  -webkit-backdrop-filter: var(--blur-md) saturate(140%);
}

.modal-card {
  position: relative;
  width: min(440px, 100%);
  border-radius: 28px;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    rgba(22, 22, 28, 0.7);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  overflow: hidden;
  animation: modal-in 480ms var(--ease-spring) both;
}

.modal-card::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 1px;
  border-radius: 32px 32px 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  pointer-events: none;
}

.onb-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  color: var(--muted);
  font: 600 10px/1 "Unbounded", "Manrope", sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.onb-kicker span {
  width: 24px;
  height: 1px;
  background: var(--accent-line);
}

.brand-title { font-size: 16px; }
.brand-subtitle { margin-top: 3px; line-height: 1.35; }
.onb-section-title { letter-spacing: 0.08em; }
.onb-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.gender-selector { min-width: 0; }
.g-btn {
  min-width: 0;
  min-height: 42px;
  padding: 0 14px;
  white-space: normal;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  transition: color 200ms ease, background-color 200ms ease, border-color 200ms ease, transform 220ms var(--ease-spring);
}

.g-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
}

.g-btn.active {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.ts-wrapper:empty { min-height: 0; margin: 0; }

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 220ms var(--ease-spring), background-color 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 220ms ease;
}

.btn-primary {
  color: #0a0a0a;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.78));
  border: 0;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.18);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(255, 255, 255, 0.26);
}

.btn-secondary {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.btn-primary .material-symbols-outlined,
.btn-secondary .material-symbols-outlined { font-size: 18px; }

.access-key-box,
.pubid-box,
.restore-input {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  border-radius: 14px;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 22px 0;
}

.loading-orbit {
  width: 18px;
  height: 18px;
  border: 2px solid var(--glass-border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: orbit 800ms linear infinite;
}

@keyframes surface-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes secure-pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes orbit { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
  .topbar {
    height: 60px;
    gap: 8px;
    padding: 0 10px;
  }

  .tb-icon { width: 38px; height: 38px; }
  .tb-brand { gap: 8px; }
  .tb-logo { width: 24px; height: 24px; }
  .tb-name { font-size: 12px; }
  .tb-stats-pill { margin-left: 2px; gap: 8px; padding: 5px 8px; }
  .tb-avatar { width: 34px; height: 34px; }

  .shell,
  .shell.nav-collapsed {
    grid-template-columns: minmax(0, 1fr);
    height: 100dvh;
    padding-top: 60px;
  }

  .stage { height: calc(100dvh - 60px); }
  .sidebar {
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    z-index: 45;
    width: min(280px, 84vw);
    height: auto;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
    transition: transform 260ms var(--ease-out);
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(24px);
  }

  .shell.nav-collapsed .sidebar {
    display: flex;
    opacity: 1;
    pointer-events: none;
    transform: translateX(-105%);
  }

  .chat-list-view { padding: 14px 12px; }
  .stage-chat-capsule { min-height: 78px; padding: 13px 14px 13px 18px; }
  .s-capsule-avatar { width: 42px; height: 42px; }
  .s-capsule-action { display: none; }
  .s-capsule-desc { white-space: normal; line-height: 1.35; }

  .chat-active { padding: 10px 9px 8px; }
  .chat-room-capsule { margin-bottom: 8px; padding: 9px 11px; }
  .chat-back-btn { width: 36px; height: 36px; flex-basis: 36px; }
  .room-icon { display: none; }
  .room-subtitle { display: none; }
  .room-status { margin-left: auto; }
  .room-status #roomStatusText { display: none; }
  .room-security { display: none; }
  .messages { padding-inline: 2px; }
  .msg { max-width: 92%; }

  .composer { padding: 7px; border-radius: 22px; }
  .composer textarea { min-width: 0; padding-inline: 11px; }
  .composer button { width: 44px; flex: 0 0 44px; padding: 0; }
  .composer button span:first-child { display: none; }

  .avatar-menu {
    top: 68px;
    right: 10px;
    width: calc(100vw - 20px);
  }

  .modal {
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 2500;
  }

  .modal-card {
    width: min(440px, calc(100vw - 32px));
    max-height: min(88dvh, 720px);
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 28px;
    padding: 24px 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), 0 0 1px rgba(255, 255, 255, 0.25);
  }

  .gender-selector { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-btn { padding-inline: 5px; font-size: 10px; line-height: 1.2; }
  .brand-subtitle { max-width: 250px; }
  .access-key-box { align-items: flex-start; flex-direction: column; }
  .access-key-box .copy { width: 100%; }
}

@media (max-width: 520px) {
  .tb-stats-pill { display: none; }
  .tb-spacer { min-width: 2px; }
  .modal-brand { align-items: flex-start; }
  .nekto-row-2 { grid-template-columns: 1fr; }
  .nekto-card { padding: 20px 16px; }
}

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

/* Conversation flow: incoming messages on the left, your messages on the right. */
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.peer { align-self: flex-start; }
.msg.time { align-self: center; }

.msg.me .msg-bubble {
  border-radius: 16px 7px 16px 16px;
  border-color: var(--accent-line);
  box-shadow: inset -3px 0 0 rgba(255, 255, 255, 0.42);
}

.msg.time {
  margin-left: 0;
  text-align: center;
}

/* Live anonymous matchmaking */
.nekto-start-btn {
  border-color: var(--accent);
  color: var(--accent);
  transition: transform 160ms ease, color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.nekto-start-btn:hover {
  color: #050505;
  background: var(--accent);
  box-shadow: 0 12px 34px rgba(255, 255, 255, 0.16);
}

.nekto-search-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 24px;
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.match-live-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: match-live-pulse 1.8s ease-in-out infinite;
}

.match-state-wrap {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 420px;
  padding: 24px;
  place-items: center;
}

.match-state-card {
  display: flex;
  width: min(470px, 100%);
  padding: 34px 30px 30px;
  align-items: center;
  flex-direction: column;
  border: 1px solid var(--glass-border-strong);
  border-radius: 22px;
  background: rgba(15, 15, 15, 0.92);
  box-shadow: var(--shadow);
  text-align: center;
  animation: surface-in 320ms var(--ease-out) both;
}

.match-kicker {
  margin-top: 17px;
  color: var(--accent);
  font: 700 9px/1.2 "Unbounded", "Manrope", sans-serif;
  letter-spacing: 0.14em;
}

.match-state-card h2 {
  margin: 9px 0 8px;
  color: var(--text);
  font-size: clamp(20px, 3vw, 27px);
  letter-spacing: -0.035em;
}

.match-state-card p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.match-orbit {
  position: relative;
  display: grid;
  width: 68px;
  height: 68px;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--accent-soft);
  place-items: center;
}

.match-orbit::after {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.75);
  content: "";
  animation: match-orbit 1.45s linear infinite;
}

.match-orbit span {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.045);
}

.match-filter-summary {
  display: flex;
  margin: 22px 0;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}

.match-filter-summary span {
  padding: 7px 9px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface-soft);
  font-size: 10px;
}

.match-cancel-btn,
.match-ended-actions button,
.match-end-btn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--glass-border-strong);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface-soft);
  font: 700 11px/1 "Manrope", sans-serif;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}

.match-cancel-btn:hover,
.match-end-btn:hover {
  border-color: rgba(255, 124, 136, 0.42);
  color: #ff9ca6;
  background: rgba(255, 124, 136, 0.08);
  transform: translateY(-1px);
}

.match-cancel-btn.is-primary,
.match-ended-actions button {
  border-color: var(--accent-line);
  color: #050505;
  background: var(--accent);
}

.match-state-icon {
  display: grid;
  width: 58px;
  height: 58px;
  color: #ff9ca6;
  border: 1px solid rgba(255, 124, 136, 0.28);
  border-radius: 999px;
  background: rgba(255, 124, 136, 0.07);
  place-items: center;
}

.match-chat-active .chat-room-capsule { gap: 10px; }
.match-end-btn { flex: 0 0 auto; }

.match-ended-actions {
  display: flex;
  padding: 8px 0 2px;
  justify-content: flex-start;
}

@keyframes match-orbit {
  from { transform: rotate(0deg) translateX(31px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(31px) rotate(-360deg); }
}

@keyframes match-live-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1); }
}

@media (max-width: 640px) {
  .match-state-wrap { min-height: 360px; padding: 12px; }
  .match-state-card { padding: 28px 18px 24px; border-radius: 28px; }
  .match-chat-active .room-security { display: none; }
  .match-end-btn { min-height: 34px; padding-inline: 10px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .match-live-dot,
  .match-orbit::after { animation: none !important; }
}

@media (max-width: 768px) {
  .msg.time { margin-left: 38px; }
}

/* Shared icon-and-label gender controls: the profile and matcher use one visual language. */
.gender-selector,
.nekto-gender-selector {
  gap: 8px;
}

.g-btn.gender-choice,
.n-btn.gender-choice {
  display: inline-flex;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-color: var(--glass-border-strong);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface-soft);
  font-size: 11px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.gender-choice .gender-choice-icon {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1;
}

.gender-choice .gender-choice-label {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
}

.gender-choice[data-g="N"] .gender-choice-icon,
.gender-choice[data-val="N"] .gender-choice-icon { color: #e5e7eb; }

.gender-choice[data-g="W"] .gender-choice-icon,
.gender-choice[data-val="W"] .gender-choice-icon { color: #f472b6; }

.gender-choice[data-g="M"] .gender-choice-icon,
.gender-choice[data-val="M"] .gender-choice-icon { color: #38bdf8; }

.g-btn.gender-choice:hover,
.n-btn.gender-choice:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
}

.g-btn.gender-choice.active,
.n-btn.gender-choice.active {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

.gender-choice:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .g-btn.gender-choice,
  .n-btn.gender-choice {
    min-height: 40px;
    padding-inline: 6px;
    gap: 4px;
    font-size: 9px;
  }

  .gender-choice .gender-choice-icon { font-size: 16px; }
}

.tb-logo,
.modal-logo { filter: brightness(0) invert(1); }

/* TOPBAR TRANSPARENT FLOATING CONTROLS */
.topbar,
.topbar::before {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.topbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: calc(56px + env(safe-area-inset-top, 0px)) !important;
  padding-top: env(safe-area-inset-top, 0px) !important;
  padding-left: max(16px, env(safe-area-inset-left, 16px)) !important;
  padding-right: max(16px, env(safe-area-inset-right, 16px)) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  z-index: 50 !important;
  pointer-events: none !important;
}

.topbar > * {
  pointer-events: auto !important;
}

.tb-icon {
  background: transparent !important;
  border: 0 !important;
  color: var(--foreground) !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: background 0.15s ease !important;
}
.tb-icon:hover { background: rgba(255, 255, 255, 0.08) !important; }
.tb-icon .material-symbols-outlined { font-size: 26px !important; }

.tb-stats-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 8px 16px !important;
  background: rgba(18, 18, 24, 0.92) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 999px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

/* SIDEBAR DEFINITION */
.sidebar {
  display: flex !important;
  flex-direction: column !important;
  background: #08080a !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 16px 14px !important;
  box-sizing: border-box !important;
}

.sb-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-bottom: 16px !important;
  margin-bottom: 12px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.sb-brand {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.sb-logo {
  width: 28px !important;
  height: 28px !important;
}

.sb-title {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  letter-spacing: -0.01em !important;
}

.nav-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  flex: 1 !important;
}

.nav-pill {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  width: 100% !important;
  height: 48px !important;
  padding: 10px 16px !important;
  border-radius: 999px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.nav-pill:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #ffffff !important;
}

.nav-pill.active {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.nav-pill .material-symbols-outlined {
  font-size: 22px !important;
}

.sb-footer {
  margin-top: auto !important;
  padding-top: 16px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  width: 100% !important;
}

.sb-profile-btn {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  padding: 10px 14px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  text-align: left !important;
  box-sizing: border-box !important;
}

.sb-profile-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

.sb-profile-avatar {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  font-family: ui-monospace, "SF Mono", Menlo, monospace !important;
  flex-shrink: 0 !important;
}

.sb-profile-name {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  flex: 1 !important;
}

.bottom-bar,
#bottomBar {
  display: none !important;
}

/* MOBILE DRAWER ADJUSTMENTS */
@media (max-width: 768px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 2000 !important;
    width: min(290px, 84vw) !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    padding-top: max(16px, calc(env(safe-area-inset-top, 0px) + 12px)) !important;
    padding-bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 16px)) !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
    background: #08080a !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    border-left: 0 !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateX(0) !important;
    transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.95) !important;
  }

  .shell.nav-collapsed .sidebar {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: none !important;
    transform: translateX(-105%) !important;
  }

  .shell,
  .shell.nav-collapsed {
    padding-top: calc(56px + env(safe-area-inset-top, 0px)) !important;
    height: 100vh !important;
    height: 100dvh !important;
  }

  .stage, .chat-list-view, .nekto-container, .composer-wrap, .chat-active {
    padding-bottom: 16px !important;
  }
}

/* v153 cascade lock: this block intentionally stays last. */
body::before {
  background: #070808 !important;
  background-image: none !important;
}

body::after {
  display: none !important;
}

@media (min-width: 769px) {
  .shell,
  .shell.nav-collapsed {
    display: grid !important;
    grid-template-columns: 310px minmax(0, 1fr) !important;
    gap: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    padding: 0 !important;
    background: #070808 !important;
  }

  .shell.nav-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) !important;
  }

  .topbar {
    top: 0 !important;
    left: 310px !important;
    right: 0 !important;
    width: auto !important;
    height: 80px !important;
    padding: 0 10px 0 14px !important;
  }

  body:has(.shell.nav-collapsed) .topbar {
    left: 0 !important;
  }

  .topbar .tb-icon {
    width: 50px !important;
    height: 50px !important;
    background: linear-gradient(180deg, #242525 0%, #1c1d1d 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.13) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
  }

  .topbar .tb-icon .material-symbols-outlined {
    font-size: 29px !important;
  }

  .topbar .tb-stats-pill {
    min-width: 272px !important;
    min-height: 50px !important;
    gap: 15px !important;
    margin: 0 !important;
    padding: 0 19px !important;
    background: linear-gradient(180deg, #242525 0%, #1d1e1e 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    justify-content: center !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
  }

  .topbar .stat-ic {
    font-size: 20px !important;
  }

  .shell > .sidebar {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    width: 310px !important;
    min-width: 310px !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 18px 10px 35px !important;
    overflow: hidden !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    background: #0e0f10 !important;
    border: 0 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.025) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .shell.nav-collapsed > .sidebar {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .shell > .sidebar::before {
    display: none !important;
  }

  .sidebar > .sb-header {
    display: flex !important;
    height: 54px !important;
    margin: 0 38px 22px !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .sidebar .sb-close-btn {
    display: none !important;
  }

  .sidebar .sb-brand {
    gap: 12px !important;
  }

  .sidebar .sb-logo {
    width: 40px !important;
    height: 40px !important;
  }

  .sidebar .sb-title {
    font-family: "Manrope", "Segoe UI Variable", sans-serif !important;
    font-size: 30px !important;
    font-weight: 800 !important;
    letter-spacing: -0.04em !important;
  }

  .sidebar .sb-close-btn {
    display: none !important;
  }

  .sidebar > .nav-list {
    gap: 24px !important;
  }

  .sidebar .nav-pill {
    width: 100% !important;
    height: 55px !important;
    min-height: 55px !important;
    padding: 0 18px !important;
    gap: 12px !important;
    background: #181919 !important;
    border: 1px solid rgba(255, 255, 255, 0.13) !important;
    color: #f4f4f5 !important;
    font-size: 20px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
  }

  .sidebar .nav-pill.active {
    background: #1a1b1b !important;
    border-color: rgba(255, 255, 255, 0.88) !important;
  }

  .sidebar .nav-pill .material-symbols-outlined {
    font-size: 25px !important;
  }

  .sidebar > .sb-footer {
    margin-top: auto !important;
    padding: 0 !important;
    border: 0 !important;
  }

  .sidebar .sb-profile-btn {
    width: 100% !important;
    height: 55px !important;
    padding: 0 11px !important;
    gap: 12px !important;
    background: linear-gradient(180deg, #292a2a 0%, #242525 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.13) !important;
  }

  .sidebar .sb-profile-avatar {
    width: 42px !important;
    height: 42px !important;
  }

  .sidebar .sb-profile-name {
    font-size: 20px !important;
    font-weight: 650 !important;
  }

  .shell > .stage {
    width: 100% !important;
    min-width: 0 !important;
    height: 100dvh !important;
    margin: 0 !important;
    background: #080808 !important;
    border-radius: 0 !important;
  }

  .stage > .chat-list-view {
    width: 100% !important;
    height: 100% !important;
    padding: 130px 10px 20px 18px !important;
  }

  .stage .stage-chat-capsule {
    width: 100% !important;
    min-height: 80px !important;
    height: 80px !important;
    gap: 25px !important;
    padding: 0 29px !important;
    background: #181818 !important;
    border: 1px solid rgba(255, 255, 255, 0.17) !important;
    border-radius: 999px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.015) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .stage .stage-chat-capsule .s-capsule-avatar {
    width: 36px !important;
    height: 36px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .stage .stage-chat-capsule .s-capsule-avatar .material-symbols-outlined {
    font-size: 36px !important;
  }

  .stage .stage-chat-capsule .s-capsule-title {
    font-family: "Unbounded", "Manrope", sans-serif !important;
    font-size: 20px !important;
    font-weight: 600 !important;
  }

  .stage .stage-chat-capsule .s-capsule-desc,
  .stage .stage-chat-capsule .s-capsule-status,
  .stage .stage-chat-capsule .s-capsule-action {
    display: none !important;
  }

  .stage > .chat-active {
    padding: 80px 10px 10px 18px !important;
  }

  .stage > .nekto-container {
    padding: 92px 18px 20px !important;
  }
}

@media (max-width: 768px) {
  .topbar,
  body:has(.shell.nav-collapsed) .topbar {
    left: 0 !important;
  }

  body:has(.shell:not(.nav-collapsed)) .topbar {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .sidebar .sb-close-btn {
    display: flex !important;
    margin-left: auto !important;
    color: #ffffff !important;
  }

  .stage > .chat-list-view {
    padding: 82px 12px 16px !important;
  }

  .stage > .chat-active {
    padding: 68px 8px 8px !important;
  }
}

/* v154: keep the fallback profile avatar to one clean circle. */
.sidebar .sb-profile-avatar {
  position: relative !important;
  width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  isolation: auto !important;
  overflow: hidden !important;
  display: grid !important;
  place-items: center !important;
  flex: 0 0 42px !important;
  border: 1px solid rgba(255, 255, 255, 0.58) !important;
  border-radius: 50% !important;
  background: #17181a !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font: 800 15px/1 "Manrope", sans-serif !important;
}

.sidebar .sb-profile-avatar::after {
  content: none !important;
  display: none !important;
}

.sidebar .sb-profile-avatar > span {
  display: block !important;
  color: inherit !important;
  font: inherit !important;
}

.sidebar .sb-profile-avatar.gender-W {
  border-color: rgba(244, 114, 182, 0.72) !important;
  background: rgba(244, 114, 182, 0.12) !important;
  color: #f472b6 !important;
}

.sidebar .sb-profile-avatar.gender-M {
  border-color: rgba(96, 165, 250, 0.72) !important;
  background: rgba(96, 165, 250, 0.12) !important;
  color: #60a5fa !important;
}

/* v156: restore the spatial grid and strengthen selected outlines. */
:root {
  --stage-grid-line: rgba(255, 255, 255, 0.032);
  --stage-grid-size: 32px;
  --selected-outline-width: 2px;
}

.shell > .stage {
  background-color: #080808 !important;
  background-image:
    linear-gradient(var(--stage-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--stage-grid-line) 1px, transparent 1px) !important;
  background-size: var(--stage-grid-size) var(--stage-grid-size) !important;
}

.sidebar .sb-profile-avatar {
  border-width: var(--selected-outline-width) !important;
}

.sidebar .nav-pill.active {
  border-width: var(--selected-outline-width) !important;
}

/* v157: one top bar, three-piece composer, encrypted image messages. */
:root {
  --composer-control-size: 56px;
  --composer-surface: #1b1c1e;
  --composer-border: rgba(255, 255, 255, 0.16);
  --composer-border-hover: rgba(255, 255, 255, 0.28);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.topbar .tb-room-identity {
  display: none;
  min-width: 0;
  align-items: center;
  gap: 13px;
  color: #ffffff;
}

body.global-chat-open .topbar {
  justify-content: flex-start !important;
  gap: 18px !important;
}

body.global-chat-open .topbar .tb-room-identity {
  display: flex;
  flex: 1 1 auto;
}

body.global-chat-open .topbar .tb-spacer {
  display: none !important;
}

body.global-chat-open .topbar .tb-stats-pill {
  margin-left: auto !important;
}

.topbar .tb-room-icon {
  display: inline-flex;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 34;
}

.topbar .tb-room-title {
  overflow: hidden;
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer.composer-separated {
  position: relative;
  display: grid;
  grid-template-columns: var(--composer-control-size) minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  min-height: var(--composer-control-size);
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.composer.composer-separated::before {
  display: none;
}

.composer-separated .image-upload-btn,
.composer-separated .composer-send-btn {
  height: var(--composer-control-size) !important;
  min-height: var(--composer-control-size) !important;
  border: 1px solid var(--composer-border) !important;
  background: var(--composer-surface) !important;
  color: #f8f8f8 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.composer-separated .image-upload-btn {
  width: var(--composer-control-size) !important;
  min-width: var(--composer-control-size) !important;
  padding: 0 !important;
  border-radius: 50% !important;
}

.composer-separated .image-upload-btn .material-symbols-outlined {
  display: inline-flex !important;
  font-size: 24px !important;
}

.composer-separated .composer-send-btn {
  width: auto !important;
  min-width: 128px !important;
  padding: 0 25px !important;
  border-radius: 999px !important;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.composer-separated .composer-send-btn .send-label {
  display: inline !important;
}

.composer-separated .image-upload-btn:hover,
.composer-separated .composer-send-btn:hover:not(:disabled) {
  border-color: var(--composer-border-hover) !important;
  background: #222325 !important;
}

.composer-separated .image-upload-btn[aria-busy="true"] {
  cursor: wait;
  opacity: 0.56;
}

.composer-separated .composer-input-capsule {
  display: flex;
  min-width: 0;
  min-height: var(--composer-control-size);
  align-items: center;
  padding: 5px 16px;
  border: 1px solid var(--composer-border);
  border-radius: 999px;
  background: var(--composer-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.composer-separated .composer-input-capsule:focus-within {
  border-color: var(--composer-border-hover);
  background: #1f2022;
}

.composer-separated .composer-input-capsule textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.composer-separated .composer-input-capsule textarea:focus {
  background: transparent;
  box-shadow: none;
}

.composer-image-preview {
  position: absolute;
  left: calc(var(--composer-control-size) + 10px);
  bottom: calc(var(--composer-control-size) + 10px);
  z-index: 3;
  display: flex;
  max-width: min(420px, calc(100% - var(--composer-control-size) - 10px));
  min-height: 58px;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid var(--composer-border);
  border-radius: 18px;
  background: rgba(27, 28, 30, 0.96);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}

.composer-image-preview > img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 11px;
  object-fit: cover;
}

.composer-image-preview > span {
  min-width: 0;
  overflow: hidden;
  color: #f2f2f3;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-separated .composer-image-remove {
  width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  margin-left: auto;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.07) !important;
  box-shadow: none !important;
}

.composer-separated .composer-image-remove .material-symbols-outlined {
  display: inline-flex !important;
  font-size: 18px !important;
}

.msg-bubble.msg-bubble-media {
  max-width: min(520px, 68vw);
  padding: 5px;
  overflow: hidden;
  border-radius: 20px;
}

.msg-media {
  display: flex;
  margin: 0;
  flex-direction: column;
  gap: 7px;
}

.msg-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(58vh, 560px);
  border-radius: 15px;
  object-fit: contain;
}

.msg-image-caption {
  padding: 2px 8px 7px;
  color: inherit;
  font-size: 13px;
  line-height: 1.42;
  white-space: pre-wrap;
}

@media (max-width: 768px) {
  :root {
    --composer-control-size: 46px;
  }

  body.global-chat-open .topbar {
    gap: 10px !important;
  }

  .topbar .tb-room-identity {
    gap: 8px;
  }

  .topbar .tb-room-icon {
    flex-basis: 27px;
    width: 27px;
    height: 27px;
    font-size: 27px;
  }

  .topbar .tb-room-title {
    font-size: 14px;
  }

  .composer.composer-separated {
    grid-template-columns: var(--composer-control-size) minmax(0, 1fr) auto;
    gap: 6px;
    padding: 0 !important;
    border-radius: 0 !important;
  }

  .composer-separated .composer-input-capsule {
    min-height: var(--composer-control-size);
    padding: 1px 11px;
  }

  .composer-separated .composer-input-capsule textarea {
    min-height: 42px;
    padding: 10px 0;
  }

  .composer-separated .composer-send-btn {
    width: auto !important;
    min-width: 96px !important;
    padding: 0 15px !important;
    font-size: 12px;
  }

  .composer-separated button span:first-child,
  .composer-separated .composer-send-btn .send-label {
    display: inline-flex !important;
  }

  .composer-image-preview {
    left: 0;
    bottom: calc(var(--composer-control-size) + 8px);
    max-width: 100%;
  }

  .msg-bubble.msg-bubble-media {
    max-width: 76vw;
  }
}

@media (max-width: 520px) {
  body.global-chat-open .topbar .tb-room-title {
    font-size: 13px;
  }
}

/* ===== Smoked optical glass · v159 ===== */
:root {
  --capsule-glass-fill:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.105) 0%,
      rgba(255, 255, 255, 0.042) 34%,
      rgba(255, 255, 255, 0.012) 68%,
      rgba(255, 255, 255, 0.052) 100%
    ),
    rgba(12, 13, 15, 0.6);
  --capsule-glass-fill-hover:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.145) 0%,
      rgba(255, 255, 255, 0.06) 38%,
      rgba(255, 255, 255, 0.018) 72%,
      rgba(255, 255, 255, 0.075) 100%
    ),
    rgba(15, 16, 18, 0.64);
  --capsule-glass-border: rgba(255, 255, 255, 0.18);
  --capsule-glass-border-hover: rgba(255, 255, 255, 0.3);
  --capsule-glass-filter: blur(18px) saturate(138%);
  --capsule-glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.19),
    inset 0 -1px 0 rgba(255, 255, 255, 0.035),
    0 12px 34px rgba(0, 0, 0, 0.34);
  --capsule-glass-shadow-hover:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05),
    0 15px 38px rgba(0, 0, 0, 0.4);
}

.topbar .tb-icon,
.topbar .tb-stats-pill,
.sidebar .nav-pill,
.sidebar .sb-profile-btn,
.stage .stage-chat-capsule,
.composer-separated .image-upload-btn,
.composer-separated .composer-send-btn,
.composer-separated .composer-input-capsule,
.composer-image-preview {
  border-color: var(--capsule-glass-border) !important;
  background: var(--capsule-glass-fill) !important;
  box-shadow: var(--capsule-glass-shadow) !important;
  -webkit-backdrop-filter: var(--capsule-glass-filter) !important;
  backdrop-filter: var(--capsule-glass-filter) !important;
}

.topbar .tb-icon:hover,
.topbar .tb-stats-pill:hover,
.sidebar .nav-pill:hover,
.sidebar .sb-profile-btn:hover,
.stage .stage-chat-capsule:hover,
.composer-separated .image-upload-btn:hover,
.composer-separated .composer-send-btn:hover:not(:disabled) {
  border-color: var(--capsule-glass-border-hover) !important;
  background: var(--capsule-glass-fill-hover) !important;
  box-shadow: var(--capsule-glass-shadow-hover) !important;
}

.composer-separated .composer-input-capsule:focus-within {
  border-color: rgba(255, 255, 255, 0.4) !important;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.135) 0%,
      rgba(255, 255, 255, 0.052) 36%,
      rgba(255, 255, 255, 0.016) 70%,
      rgba(255, 255, 255, 0.065) 100%
    ),
    rgba(13, 14, 16, 0.62) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(255, 255, 255, 0.045),
    0 14px 38px rgba(0, 0, 0, 0.38) !important;
}

.sidebar .nav-pill.active {
  border-width: var(--selected-outline-width) !important;
  border-color: rgba(255, 255, 255, 0.88) !important;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.17) 0%,
      rgba(255, 255, 255, 0.067) 38%,
      rgba(255, 255, 255, 0.018) 72%,
      rgba(255, 255, 255, 0.082) 100%
    ),
    rgba(14, 15, 17, 0.66) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.29),
    inset 0 -1px 0 rgba(255, 255, 255, 0.055),
    0 14px 34px rgba(0, 0, 0, 0.38) !important;
}

.stage .stage-chat-capsule::before {
  display: block !important;
  opacity: 0.8 !important;
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .topbar .tb-icon,
  .topbar .tb-stats-pill,
  .sidebar .nav-pill,
  .sidebar .sb-profile-btn,
  .stage .stage-chat-capsule,
  .composer-separated .image-upload-btn,
  .composer-separated .composer-send-btn,
  .composer-separated .composer-input-capsule,
  .composer-image-preview {
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.025)),
      rgba(20, 21, 23, 0.92) !important;
  }
}

/* The room icon belongs directly to the capsule surface. A second backdrop
   filter here creates a visible square patch behind the transparent glyph. */
.stage .stage-chat-capsule .s-capsule-avatar {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* ===== Global timeline and semantic gender colors · v161 ===== */
.topbar .stat-pill-item.male {
  color: #60a5fa !important;
}

.topbar .stat-pill-item.female {
  color: #f472b6 !important;
}

body.global-chat-open .messages .msg.me {
  align-self: flex-start !important;
  flex-direction: row !important;
}

body.global-chat-open .messages .msg.me .msg-bubble {
  border-radius: 16px 16px 16px 7px;
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.42);
}

/* ===== Anonymous chat · open control field · v162 ===== */
.stage > .nekto-container {
  align-items: stretch;
  justify-content: stretch;
  overflow-x: hidden;
}

.stage > .nekto-container > .nekto-card {
  display: grid;
  width: 100%;
  max-width: none;
  min-height: 100%;
  padding: 20px 28px 24px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  column-gap: clamp(22px, 2.4vw, 44px);
  row-gap: clamp(24px, 3vh, 38px);
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  overflow: visible;
}

.stage > .nekto-container > .nekto-card::before {
  display: none !important;
  content: none !important;
}

.nekto-card .nekto-header {
  grid-column: 1 / -1;
  padding: 0;
  border: 0;
}

.nekto-card .nekto-title {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: clamp(20px, 1.55vw, 27px);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.nekto-card .nekto-topic-group {
  grid-column: 1 / span 5;
}

.nekto-card .nekto-gender-group {
  grid-column: 6 / -1;
}

.nekto-card .nekto-row-2 {
  display: grid;
  grid-column: 1 / -1;
  align-self: center;
  grid-template-columns: 1fr;
  gap: clamp(22px, 3.5vh, 40px);
}

.nekto-card .nekto-group {
  min-width: 0;
  gap: 11px;
}

.nekto-card .nekto-label {
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nekto-card .nekto-btn-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.nekto-card .nekto-gender-selector {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nekto-card .nekto-btn-stack {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.nekto-card .n-btn {
  min-width: 0;
  min-height: 46px;
  padding: 10px 14px;
  border-color: var(--capsule-glass-border);
  background: var(--capsule-glass-fill);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 10px 24px rgba(0, 0, 0, 0.22);
  -webkit-backdrop-filter: blur(16px) saturate(132%);
  backdrop-filter: blur(16px) saturate(132%);
}

.nekto-card .n-btn:hover {
  border-color: var(--capsule-glass-border-hover);
  background: var(--capsule-glass-fill-hover);
}

.nekto-card .n-btn.active {
  border-color: rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.045)),
    rgba(18, 19, 21, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 28px rgba(0, 0, 0, 0.28);
}

.nekto-card .nekto-start-btn {
  grid-column: 1 / -1;
  align-self: end;
  justify-self: center;
  width: min(320px, 100%);
  min-height: 54px;
  margin: 0;
}

@media (max-width: 1100px) {
  .stage > .nekto-container > .nekto-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    align-content: start;
    row-gap: 24px;
  }

  .nekto-card .nekto-header,
  .nekto-card .nekto-topic-group,
  .nekto-card .nekto-gender-group,
  .nekto-card .nekto-row-2,
  .nekto-card .nekto-start-btn {
    grid-column: 1;
  }

  .nekto-card .nekto-start-btn {
    margin-top: 8px;
  }
}

@media (max-width: 768px) {
  .stage > .nekto-container > .nekto-card {
    min-height: auto;
    padding: 10px 2px 20px;
    row-gap: 20px;
  }

  .nekto-card .nekto-title {
    font-size: 19px;
  }

  .nekto-card .nekto-btn-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nekto-card .nekto-btn-stack .n-btn:last-child {
    grid-column: 1 / -1;
  }

  .nekto-card .n-btn {
    min-height: 44px;
    padding-inline: 8px;
  }
}

@media (max-width: 430px) {
  .nekto-card .nekto-gender-selector {
    grid-template-columns: 1fr;
  }
}

/* ===== Chat flow and text containment · v163 ===== */
:root {
  --composer-textarea-height: 44px;
}

body.global-chat-open .messages > .msg:first-child {
  margin-top: auto;
}

body.global-chat-open .messages .msg,
body.global-chat-open .messages .msg-body,
body.global-chat-open .messages .msg-bubble,
body.global-chat-open .messages .msg-text {
  min-width: 0;
}

body.global-chat-open .messages .msg-body,
body.global-chat-open .messages .msg-bubble,
body.global-chat-open .messages .msg-text {
  max-width: 100%;
}

body.global-chat-open .messages .msg.peer .msg-bubble,
body.global-chat-open .messages .msg.me .msg-bubble {
  border-radius: 7px 16px 16px 16px !important;
  overflow: hidden;
}

body.global-chat-open .messages .msg-text {
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.global-chat-open .messages .msg-meta {
  min-width: 0;
  max-width: 100%;
}

body.global-chat-open .messages .msg-author {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-separated .composer-input-capsule {
  height: var(--composer-control-size) !important;
  min-height: var(--composer-control-size) !important;
  max-height: var(--composer-control-size) !important;
  overflow: hidden;
}

.composer-separated .composer-input-capsule textarea {
  height: var(--composer-textarea-height) !important;
  min-height: var(--composer-textarea-height) !important;
  max-height: var(--composer-textarea-height) !important;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  scrollbar-width: thin;
}

@media (max-width: 768px) {
  :root {
    --composer-textarea-height: 42px;
  }
}

/* ===== Anonymous chat · sequential rhythm · v164 ===== */
.stage > .nekto-container > .nekto-card {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
  align-content: start;
  row-gap: clamp(20px, 2.4vh, 28px);
}

.nekto-card .nekto-header,
.nekto-card .nekto-topic-group,
.nekto-card .nekto-gender-group,
.nekto-card .nekto-row-2,
.nekto-card .nekto-start-btn {
  grid-column: 1;
}

.nekto-card .nekto-topic-group,
.nekto-card .nekto-gender-group {
  width: 100%;
}

.nekto-card .nekto-row-2 {
  align-self: stretch;
  gap: clamp(18px, 2.2vh, 24px);
}

.nekto-card .nekto-start-btn {
  align-self: start;
  margin: 4px auto 0;
}

@media (max-width: 768px) {
  .stage > .nekto-container > .nekto-card {
    row-gap: 20px;
  }

  .nekto-card .nekto-row-2 {
    gap: 20px;
  }
}

/* ===== iOS PWA shell · v172 ===== */
:root {
  --pwa-safe-top: env(safe-area-inset-top, 0px);
  --pwa-safe-right: env(safe-area-inset-right, 0px);
  --pwa-safe-bottom: env(safe-area-inset-bottom, 0px);
  --pwa-safe-left: env(safe-area-inset-left, 0px);
}

html {
  background: #070808;
}

/* Product layout for the installed iOS app: a fixed top inset and no
   persistent bottom inset. Keyboard clearance is added only while typing. */
html.pwa-ios.pwa-standalone {
  --pwa-safe-top: 44px;
  --pwa-safe-bottom: 0px;
}

html.pwa-standalone,
html.pwa-standalone body {
  min-height: 100%;
  min-height: 100dvh;
  background: #070808;
}

html.pwa-ios input,
html.pwa-ios textarea,
html.pwa-ios select {
  font-size: max(16px, 1em);
}

@media (display-mode: standalone) {
  .topbar {
    height: calc(56px + var(--pwa-safe-top)) !important;
    padding-top: var(--pwa-safe-top) !important;
    padding-left: max(16px, var(--pwa-safe-left)) !important;
    padding-right: max(16px, var(--pwa-safe-right)) !important;
  }

  .shell,
  .shell.nav-collapsed {
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding-top: calc(56px + var(--pwa-safe-top)) !important;
    padding-bottom: 0 !important;
  }

  .bottom-bar {
    padding-bottom: 0 !important;
  }

  .avatar-menu {
    padding-top: max(16px, calc(var(--pwa-safe-top) + 12px)) !important;
    padding-right: max(16px, var(--pwa-safe-right)) !important;
    padding-bottom: 16px !important;
    padding-left: max(16px, var(--pwa-safe-left)) !important;
  }

  html.pwa-ios.pwa-standalone .avatar-menu {
    padding-bottom: 0 !important;
  }
}

@media (display-mode: standalone) and (min-width: 769px) {
  .shell,
  .shell.nav-collapsed {
    padding-top: 0 !important;
  }

  .topbar {
    height: calc(80px + var(--pwa-safe-top)) !important;
  }

  .shell > .sidebar {
    padding-top: max(18px, calc(var(--pwa-safe-top) + 12px)) !important;
    padding-bottom: max(35px, calc(var(--pwa-safe-bottom) + 20px)) !important;
  }

  html.pwa-ios.pwa-standalone .shell > .sidebar {
    padding-bottom: 0 !important;
  }
}

@media (display-mode: standalone) and (max-width: 768px) {
  .stage {
    padding-right: var(--pwa-safe-right);
    padding-left: var(--pwa-safe-left);
  }

  .stage > .chat-active,
  .stage > .nekto-container,
  .stage > .chat-list-view {
    padding-bottom: 16px !important;
  }

  html.pwa-ios.pwa-standalone .stage > .chat-active,
  html.pwa-ios.pwa-standalone .stage > .nekto-container,
  html.pwa-ios.pwa-standalone .stage > .chat-list-view {
    padding-bottom: 0 !important;
  }
}

@media (display-mode: standalone) and (orientation: landscape) {
  .topbar {
    padding-left: max(16px, calc(var(--pwa-safe-left) + 8px)) !important;
    padding-right: max(16px, calc(var(--pwa-safe-right) + 8px)) !important;
  }
}

/* ===== Anonymous conversation · unified chat language · v166 ===== */
.topbar .tb-room-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.topbar .tb-room-meta {
  max-width: min(48vw, 520px);
  overflow: hidden;
  color: rgba(255, 255, 255, 0.5);
  font: 600 10px/1.2 "Manrope", sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.match-chat-open .topbar {
  justify-content: flex-start !important;
  gap: 18px !important;
}

body.match-chat-open .topbar .tb-room-identity {
  display: flex;
  flex: 1 1 auto;
}

body.match-chat-open .topbar .tb-spacer {
  display: none !important;
}

body.match-chat-open .topbar .tb-stats-pill {
  margin-left: 0 !important;
}

.topbar .tb-match-end {
  display: inline-flex;
  min-width: 104px;
  min-height: 44px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--capsule-glass-border);
  border-radius: 999px;
  background: var(--capsule-glass-fill);
  box-shadow: var(--capsule-glass-shadow);
  color: rgba(255, 255, 255, 0.8);
  font: 700 12px/1 "Manrope", sans-serif;
  -webkit-backdrop-filter: var(--capsule-glass-filter);
  backdrop-filter: var(--capsule-glass-filter);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.topbar .tb-match-end:hover {
  border-color: rgba(255, 124, 136, 0.42);
  background: rgba(255, 124, 136, 0.08);
  color: #ff9ca6;
}

.match-chat-active .match-composer-separated {
  grid-template-columns: var(--composer-control-size) minmax(0, 1fr) auto;
}

body.match-chat-open .messages > .msg:first-child {
  margin-top: auto;
}

body.match-chat-open .messages .msg,
body.match-chat-open .messages .msg-body,
body.match-chat-open .messages .msg-bubble,
body.match-chat-open .messages .msg-text {
  min-width: 0;
}

body.match-chat-open .messages .msg-body,
body.match-chat-open .messages .msg-bubble,
body.match-chat-open .messages .msg-text {
  max-width: 100%;
}

body.match-chat-open .messages .msg.me {
  align-self: flex-start !important;
  flex-direction: row !important;
}

body.match-chat-open .messages .msg.peer .msg-bubble,
body.match-chat-open .messages .msg.me .msg-bubble {
  overflow: hidden;
  border-radius: 7px 16px 16px 16px !important;
}

body.match-chat-open .messages .msg.me .msg-bubble {
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.42);
}

body.match-chat-open .messages .msg-text {
  overflow-x: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.match-chat-open .messages .msg-meta {
  min-width: 0;
  max-width: 100%;
}

body.match-chat-open .messages .msg-author {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.match-chat-ended .match-composer-separated .composer-input-capsule {
  opacity: 0.56;
}

body.match-chat-ended .match-composer-separated .match-new-search-btn {
  min-width: 128px !important;
  border-color: rgba(255, 255, 255, 0.34) !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

@media (max-width: 768px) {
  body.match-chat-open .topbar {
    gap: 9px !important;
  }

  .topbar .tb-room-meta {
    max-width: 42vw;
    font-size: 9px;
  }

  .topbar .tb-match-end {
    min-width: 88px;
    min-height: 40px;
    padding-inline: 13px;
    font-size: 11px;
  }

  body.match-chat-ended .match-composer-separated .match-new-search-btn {
    min-width: 104px !important;
    padding-inline: 12px !important;
  }
}

@media (max-width: 430px) {
  .topbar .tb-room-meta {
    max-width: 34vw;
  }

  body.match-chat-open .topbar .tb-stats-pill {
    display: none !important;
  }
}

/* ===== iOS PWA keyboard & bounce fixes · v172 ===== */

:root {
  --ios-keyboard-h: 0px;
  --ios-bottom-overscan: 48px;
}

/* Keep the root in normal flow: fixed roots create a bottom gap in iOS PWAs. */
html.pwa-ios.pwa-standalone,
html.pwa-ios.pwa-standalone body {
  position: static !important;
  width: 100%;
  height: calc(100dvh + var(--ios-bottom-overscan));
  min-height: calc(100dvh + var(--ios-bottom-overscan));
  overflow: hidden;
}

/* iOS: smooth momentum scroll only on designated containers */
html.pwa-ios .messages,
html.pwa-ios .sidebar,
html.pwa-ios .am-content-wrap,
html.pwa-ios .modal-card,
html.pwa-ios .chat-list-view {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* iOS standalone: adjust composer area when keyboard is open */
@media (display-mode: standalone) {
  html.pwa-ios .composer-wrap {
    transition: padding-bottom 120ms ease;
    padding-bottom: var(--ios-keyboard-h) !important;
  }

  /* Ensure messages scroll area accounts for keyboard */
  html.pwa-ios .messages {
    scroll-padding-bottom: calc(var(--ios-keyboard-h) + 80px);
  }
}

/* iOS: enforce 16px on composer textarea to prevent auto-zoom */
html.pwa-ios .composer textarea {
  font-size: 16px;
}

/* iOS: prevent double-tap-to-zoom on interactive elements */
html.pwa-ios button,
html.pwa-ios a,
html.pwa-ios input,
html.pwa-ios textarea,
html.pwa-ios select {
  touch-action: manipulation;
}

/* iOS standalone landscape: sidebar safe area */
@media (display-mode: standalone) and (orientation: landscape) {
  html.pwa-ios .sidebar {
    padding-left: max(18px, calc(var(--pwa-safe-left) + 8px)) !important;
  }
}

/* Safari does not consistently match display-mode: standalone for installed
   web apps. The runtime class is therefore the source of truth for this shell. */
html.pwa-ios.pwa-standalone .topbar {
  height: 100px !important;
  padding-top: 44px !important;
}

html.pwa-ios.pwa-standalone .shell,
html.pwa-ios.pwa-standalone .shell.nav-collapsed {
  position: fixed !important;
  inset: 100px 0 0 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
}

html.pwa-ios.pwa-standalone .shell > .stage {
  height: 100% !important;
  min-height: 100% !important;
}

html.pwa-ios.pwa-standalone .sidebar,
html.pwa-ios.pwa-standalone .avatar-menu {
  padding-top: 44px !important;
  padding-bottom: 0 !important;
}

html.pwa-ios.pwa-standalone .sidebar {
  padding-bottom: 8px !important;
}

/* The mobile profile panel normally starts below the browser top bar. In an
   installed PWA that leaves the app header visible above the profile. */
html.pwa-ios.pwa-standalone .avatar-menu {
  inset: 0 0 calc(-1 * var(--ios-bottom-overscan)) 0 !important;
  width: auto !important;
  height: auto !important;
  padding: 44px 16px 8px !important;
  overflow-y: auto !important;
  background: #08080a !important;
  -webkit-overflow-scrolling: touch;
}

html.pwa-ios.pwa-standalone .sidebar > .sb-footer {
  padding-top: 0 !important;
  border-top: 0 !important;
}

/* Match the desktop's clean navigation/profile surfaces in the iOS PWA. */
html.pwa-ios.pwa-standalone .sidebar > .sb-header,
html.pwa-ios.pwa-standalone .avatar-menu .am-top-bar {
  border-bottom: 0 !important;
}

html.pwa-ios.pwa-standalone .sidebar > .sb-footer,
html.pwa-ios.pwa-standalone .sidebar > .sb-footer::before,
html.pwa-ios.pwa-standalone .sidebar > .sb-footer::after {
  border-top: 0 !important;
  box-shadow: none !important;
}

html.pwa-ios.pwa-standalone .stage > .chat-active,
html.pwa-ios.pwa-standalone .stage > .nekto-container,
html.pwa-ios.pwa-standalone .stage > .chat-list-view {
  padding-bottom: 0 !important;
}

html.pwa-ios.pwa-standalone .stage > .chat-active {
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}

@media (max-width: 768px) {
  html.pwa-ios.pwa-standalone .stage > .chat-list-view {
    padding-top: 24px !important;
  }
}

/* Extend the stage grid through iOS's bottom system area. */
html.pwa-ios.pwa-standalone {
  background-color: #080808 !important;
  background-image:
    linear-gradient(var(--stage-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--stage-grid-line) 1px, transparent 1px) !important;
  background-position: 0 4px, 0 4px !important;
  background-repeat: repeat, repeat !important;
  background-size: var(--stage-grid-size) var(--stage-grid-size), var(--stage-grid-size) var(--stage-grid-size) !important;
}

html.pwa-ios.pwa-standalone body {
  background: transparent !important;
}

html.pwa-ios.pwa-standalone body::before {
  display: none !important;
}

/* Match the dynamic PWA viewport without introducing a large-viewport gap. */
html.pwa-ios.pwa-standalone,
html.pwa-ios.pwa-standalone body {
  height: calc(100dvh + var(--ios-bottom-overscan)) !important;
  min-height: calc(100dvh + var(--ios-bottom-overscan)) !important;
}

/* Paint the grid beneath iOS system areas without shifting app content. */
html.pwa-ios.pwa-standalone .shell,
html.pwa-ios.pwa-standalone .shell.nav-collapsed {
  inset: 100px 0 calc(-1 * var(--ios-bottom-overscan)) !important;
  background: transparent !important;
  overflow: visible !important;
  isolation: isolate;
}

html.pwa-ios.pwa-standalone .shell::before {
  content: "";
  position: absolute;
  top: -100px;
  right: 0;
  left: 0;
  height: 100px;
  z-index: 0;
  pointer-events: none;
  background-color: #080808;
  background-image:
    linear-gradient(var(--stage-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--stage-grid-line) 1px, transparent 1px);
  background-position: 0 4px, 0 4px;
  background-size: var(--stage-grid-size) var(--stage-grid-size), var(--stage-grid-size) var(--stage-grid-size);
}

html.pwa-ios.pwa-standalone .shell > .stage,
html.pwa-ios.pwa-standalone .shell > .sidebar {
  position: relative;
  z-index: 1;
}

html.pwa-ios.pwa-standalone .composer.composer-separated {
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html.pwa-ios.pwa-standalone .stage > .chat-active {
  height: calc(100% - var(--ios-bottom-overscan)) !important;
  min-height: calc(100% - var(--ios-bottom-overscan)) !important;
  padding-bottom: 8px !important;
}

html.pwa-ios.pwa-standalone .stage > .nekto-container {
  height: calc(100% - var(--ios-bottom-overscan)) !important;
  min-height: 0 !important;
  padding-bottom: 8px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Visual-only continuation under the home indicator; chat content keeps its viewport. */
html.pwa-ios.pwa-standalone .shell > .stage {
  overflow: visible !important;
}

html.pwa-ios.pwa-standalone .shell > .stage::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  height: 64px;
  z-index: 0;
  pointer-events: none;
  background-color: #080808;
  background-image:
    linear-gradient(var(--stage-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--stage-grid-line) 1px, transparent 1px);
  background-position: 0 4px, 0 4px;
  background-size: var(--stage-grid-size) var(--stage-grid-size), var(--stage-grid-size) var(--stage-grid-size);
  background-attachment: fixed;
}

/* Keep the desktop navigation rail compact; mobile drawer sizing is unchanged. */
@media (min-width: 769px) {
  :root {
    --desktop-sidebar-width: 280px;
  }

  .shell {
    grid-template-columns: var(--desktop-sidebar-width) minmax(0, 1fr) !important;
  }

  .shell.nav-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) !important;
  }

  .topbar {
    left: var(--desktop-sidebar-width) !important;
  }

  .shell > .sidebar {
    width: var(--desktop-sidebar-width) !important;
    min-width: var(--desktop-sidebar-width) !important;
    padding-bottom: 10px !important;
  }

  /* The brand shares the same left and right edge as navigation and profile. */
  .sidebar > .sb-header {
    margin: 0 0 22px !important;
  }

  /* Align the composer attachment control with the sidebar's 10px inner edge. */
  .stage > .chat-active {
    padding-left: 10px !important;
  }
}

/* ===== Unified desktop / iOS PWA navigation language · v197 ===== */
:root {
  --unified-sidebar-width: 280px;
  --unified-sidebar-edge: 10px;
  --unified-sidebar-bg: #0e0f10;
  --unified-nav-height: 55px;
  --unified-nav-gap: 12px;
  --unified-content-top-gap: 16px;
  --unified-brand-logo: 40px;
  --unified-brand-title: 30px;
}

/* Keep one compact vertical rhythm between the top bar, room capsule,
   and peer navigation actions. */
@media (min-width: 769px) {
  .sidebar > .nav-list {
    gap: var(--unified-nav-gap) !important;
  }

  .stage > .chat-list-view {
    padding-top: calc(80px + var(--unified-content-top-gap)) !important;
  }
}

/* iOS keeps its drawer behavior and safe areas, while its visual metrics
   mirror the desktop sidebar. */
html.pwa-ios.pwa-standalone .sidebar {
  width: min(var(--unified-sidebar-width), 84vw) !important;
  padding: 44px var(--unified-sidebar-edge) max(8px, env(safe-area-inset-bottom, 0px)) !important;
  background: var(--unified-sidebar-bg) !important;
  border-right-color: rgba(255, 255, 255, 0.025) !important;
}

html.pwa-ios.pwa-standalone .sidebar > .sb-header {
  height: 54px !important;
  margin: 0 0 22px !important;
  padding: 0 !important;
  border: 0 !important;
  justify-content: flex-start !important;
}

html.pwa-ios.pwa-standalone .sidebar .sb-brand {
  gap: 12px !important;
}

html.pwa-ios.pwa-standalone .sidebar .sb-logo {
  width: var(--unified-brand-logo) !important;
  height: var(--unified-brand-logo) !important;
}

html.pwa-ios.pwa-standalone .sidebar .sb-title {
  font-size: var(--unified-brand-title) !important;
  font-weight: 800 !important;
  letter-spacing: -0.04em !important;
}

html.pwa-ios.pwa-standalone .sidebar > .nav-list {
  gap: var(--unified-nav-gap) !important;
}

html.pwa-ios.pwa-standalone .stage > .chat-list-view {
  padding-top: var(--unified-content-top-gap) !important;
}

html.pwa-ios.pwa-standalone .sidebar .nav-pill {
  height: var(--unified-nav-height) !important;
  min-height: var(--unified-nav-height) !important;
  padding: 0 18px !important;
  gap: 12px !important;
  font-size: 20px !important;
  font-weight: 500 !important;
}

html.pwa-ios.pwa-standalone .sidebar .nav-pill .material-symbols-outlined {
  font-size: 25px !important;
}

html.pwa-ios.pwa-standalone .sidebar .sb-profile-btn {
  height: var(--unified-nav-height) !important;
  padding: 0 11px !important;
  gap: 12px !important;
}

html.pwa-ios.pwa-standalone .sidebar .sb-profile-name {
  font-size: 20px !important;
  font-weight: 650 !important;
}

/* Keep the compact mobile topology, but use the same glass outline as desktop. */
html.pwa-ios.pwa-standalone .topbar .tb-icon {
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

/* Remove decorative shine that does not exist on the desktop navigation. */
html.pwa-ios.pwa-standalone .avatar-menu::before,
html.pwa-ios.pwa-standalone .sidebar > .sb-header::before,
html.pwa-ios.pwa-standalone .sidebar > .sb-header::after,
html.pwa-ios.pwa-standalone .sidebar > .sb-footer::before,
html.pwa-ios.pwa-standalone .sidebar > .sb-footer::after {
  display: none !important;
  content: none !important;
}

/* Desktop typography rhythm, slightly compressed to fit all three choices. */
html.pwa-ios.pwa-standalone .avatar-menu .g-btn {
  min-height: 42px;
  padding: 8px 6px;
  gap: 5px;
  font-size: 10px;
}

/* ===== Quiet navigation rail · v199 =====
   Only the current destination reads as a capsule. The profile is a compact
   account row rather than a third navigation pill. */
.sidebar .nav-pill {
  border-width: 1px !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  color: rgba(244, 244, 245, 0.64) !important;
}

.sidebar .nav-pill:hover {
  border-color: transparent !important;
  background: rgba(255, 255, 255, 0.045) !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

.sidebar .nav-pill.active,
.sidebar .nav-pill.active:hover {
  border-width: 1px !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.115) 0%,
      rgba(255, 255, 255, 0.045) 48%,
      rgba(255, 255, 255, 0.018) 100%
    ),
    rgba(18, 19, 20, 0.72) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    0 8px 22px rgba(0, 0, 0, 0.18) !important;
  -webkit-backdrop-filter: blur(14px) saturate(125%) !important;
  backdrop-filter: blur(14px) saturate(125%) !important;
  color: #fff !important;
}

.sidebar .nav-pill:focus-visible,
.sidebar .sb-profile-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.72) !important;
  outline-offset: 3px !important;
}

.sidebar > .sb-footer {
  padding: 0 !important;
  border: 0 !important;
}

.sidebar .sb-profile-btn,
html.pwa-ios.pwa-standalone .sidebar .sb-profile-btn {
  width: 100% !important;
  min-height: 66px !important;
  height: auto !important;
  padding: 8px 9px !important;
  gap: 11px !important;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.sidebar .sb-profile-btn:hover,
html.pwa-ios.pwa-standalone .sidebar .sb-profile-btn:hover {
  border-color: rgba(255, 255, 255, 0.07) !important;
  background: rgba(255, 255, 255, 0.045) !important;
  box-shadow: none !important;
}

.sidebar .sb-profile-avatar,
html.pwa-ios.pwa-standalone .sidebar .sb-profile-avatar {
  width: 42px !important;
  height: 42px !important;
  flex: 0 0 42px !important;
}

.sidebar .sb-profile-copy {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.sidebar .sb-profile-name,
html.pwa-ios.pwa-standalone .sidebar .sb-profile-name {
  display: block !important;
  width: 100% !important;
  flex: 0 1 auto !important;
  font-size: 15px !important;
  font-weight: 750 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.015em !important;
}

.sidebar .sb-profile-role {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: rgba(244, 244, 245, 0.5);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .sb-profile-settings {
  display: inline-flex !important;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  outline: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 22px !important;
  transition:
    color 150ms ease,
    background-color 150ms ease;
}

.sidebar .sb-profile-btn:hover .sb-profile-settings {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar .nav-pill,
  .sidebar .sb-profile-btn,
  .sidebar .sb-profile-settings {
    transition: none !important;
  }
}

/* ===== Justre manifesto · v201 ===== */
.stage > .info-view {
  display: flex;
  width: 100%;
  min-height: 100%;
  box-sizing: border-box;
  align-items: stretch;
  overflow-y: auto;
  padding: clamp(48px, 7vh, 88px) clamp(34px, 5vw, 96px) clamp(40px, 6vh, 72px);
}

.info-manifest {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 1280px;
  min-width: 0;
  margin: 0 auto;
  text-align: center;
}

.info-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.info-kicker .material-symbols-outlined {
  color: rgba(255, 255, 255, 0.84);
  font-size: 19px;
}

.info-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.2vh, 18px);
  margin: 0;
  color: #fff;
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: clamp(64px, 8.1vw, 148px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 0.9;
  text-align: center;
}

.info-title-line {
  display: block;
}

.info-title-secondary {
  color: rgba(255, 255, 255, 0.42);
}

.info-statement {
  max-width: 1040px;
  margin: clamp(34px, 5vh, 58px) 0 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(22px, 2.25vw, 36px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.38;
  text-align: center;
}

.info-statement strong {
  color: #fff;
  font-weight: 800;
}

.info-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px 34px;
  width: min(920px, 100%);
  max-width: 920px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.info-points li {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-size: clamp(15px, 1.2vw, 19px);
  font-weight: 450;
  line-height: 1.5;
}

.info-points li::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: 0.58em;
  flex: 0 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.045);
}

.info-points .info-point-secure {
  color: var(--info-security-accent);
}

.info-points .info-point-secure::before {
  border-color: var(--info-security-accent);
  box-shadow: 0 0 0 3px var(--info-security-accent-soft);
}

@media (max-width: 768px) {
  .stage > .info-view,
  html.pwa-ios.pwa-standalone .stage > .info-view {
    align-items: flex-start;
    padding: 34px 22px max(24px, env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }

  .info-manifest {
    display: block;
    flex: none;
    max-width: 620px;
    margin: 0 auto;
    padding-left: 0;
    text-align: center;
  }

  .info-kicker {
    justify-content: center;
    margin-bottom: 22px;
    font-size: 10px;
  }

  .info-title {
    gap: 8px;
    font-size: clamp(38px, 12vw, 52px);
  }

  .info-statement {
    margin-top: 28px;
    font-size: 19px;
  }

  .info-points {
    grid-template-columns: 1fr;
    gap: 9px;
    margin-top: 18px;
  }

  .info-points li {
    font-size: 14px;
  }
}
