/* clyr â€” where you belong | Primary: #40dbf1 */
/* ZT Nature: add font files to fonts/ and uncomment @font-face in fonts/README.md */
/* Until then we use Syne (loaded in HTML) as the main font. */

:root {
  --primary-color: #40dbf1;
  --secondary-color: #2ab8cc;
  --accent-color: #7aebfa;
  --background-color: #06090c;
  --teal: #40dbf1;
  --teal-dim: #2ab8cc;
  --teal-bright: #7aebfa;
  --teal-glow: rgba(64, 219, 241, 0.4);
  --teal-subtle: rgba(64, 219, 241, 0.08);
  --bg: #06090c;
  --bg-mid: #0c1116;
  --bg-card: #0f1419;
  --bg-card-hover: #141b22;
  --text: #f0f4f8;
  --text-soft: #9aabbb;
  --text-muted: #5c6f82;
  --border: rgba(64, 219, 241, 0.12);
  --font: 'Syne', system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  opacity: 1;
  transform: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

/* Chat page: lock viewport so only chat area scrolls */
body.chat-page {
  height: 100vh;
  overflow: hidden;
}

body.page-ready {
  opacity: 1;
  transform: none;
}

body.page-leave {
  opacity: 0;
  transform: translateY(-4px);
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--teal-bright); }

/* ---- Page grain (optional depth) ---- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 9999;
}

body.home-page::after,
body.clyr-theme::after {
  opacity: 0.02;
  mix-blend-mode: overlay;
}

/* ---- Header / Navbar ---- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 1.5rem;
  background: rgba(6, 9, 12, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(64, 219, 241, 0.08);
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  transition: color 0.2s ease;
}
.logo:hover { color: var(--teal); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-soft);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--teal); }

.nav-links .nav-cta {
  margin-left: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: var(--teal-subtle);
  color: var(--teal);
  border-radius: 8px;
}
.nav-links .nav-cta:hover {
  background: rgba(64, 219, 241, 0.15);
  color: var(--teal-bright);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 1px;
}

/* Full-screen dim layer behind mobile nav drawer (toggled via script.js) */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(2, 4, 12, 0.52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.nav-backdrop.nav-backdrop--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.nav-drawer-open {
  overflow: hidden;
  touch-action: pan-y;
}

body.nav-drawer-open .header {
  z-index: 200;
}

@media (prefers-reduced-motion: reduce) {
  .nav-backdrop,
  .nav-links,
  .nav-toggle span {
    transition: none !important;
  }
}

/* ---- Cookie consent bar (home) ---- */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 1.25rem;
  padding-bottom: max(1rem, var(--safe-bottom));
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.cookie-consent.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.cookie-consent-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.25rem;
}

.cookie-consent-text {
  margin: 0;
  flex: 1;
  min-width: min(100%, 280px);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-soft);
}

.cookie-consent-text a {
  color: var(--teal);
  font-weight: 500;
}

.cookie-consent-text a:hover {
  color: var(--teal-bright);
}

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cookie-consent-btn {
  padding: 0.65rem 1.15rem;
  font-size: 0.875rem;
  min-height: 44px;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7rem 1.5rem 5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 80% at 50% -20%, var(--teal-glow) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(64, 219, 241, 0.06) 0%, transparent 50%);
}

.hero-orb {
  position: absolute;
  width: min(90vw, 720px);
  height: min(90vw, 720px);
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(64, 219, 241, 0.15) 0%, rgba(64, 219, 241, 0.04) 40%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  margin-bottom: 1.5rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--teal-subtle);
}

.hero h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(3.5rem, 12vw, 7rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero h1 .line { display: block; }

.hero h1 .accent {
  color: var(--teal);
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.you-emphasis {
  color: var(--teal);
  font-weight: 600;
  position: relative;
  display: inline-block;
}

.hero-tagline {
  margin: 0 0 2.25rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-soft);
  font-weight: 400;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* clyr hero - minimal, name-forward */
.hero-clyr .hero-logo {
  margin: 0 0 1rem;
  font-size: clamp(4rem, 18vw, 9rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  color: var(--text);
  line-height: 0.9;
  background: linear-gradient(135deg, var(--text) 0%, var(--teal) 50%, var(--teal-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-clyr .hero-tagline {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  max-width: 420px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--teal);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--teal-bright);
  box-shadow: 0 12px 40px var(--teal-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid rgba(64, 219, 241, 0.5);
}
.btn-secondary:hover {
  background: var(--teal-subtle);
  border-color: var(--teal);
}

.btn-large {
  padding: 1.125rem 2.5rem;
  font-size: 1.0625rem;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  color: var(--teal);
  cursor: pointer;
  text-decoration: underline;
}
.btn-link:hover {
  color: var(--teal-bright);
}

/* ---- Features ---- */
.features {
  padding: 6rem 1.5rem;
}

.section-title {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 0.75rem;
  text-align: center;
  line-height: 1.1;
}
.section-title .accent {
  color: var(--teal);
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  text-align: center;
  color: var(--text-soft);
  font-size: 1.125rem;
  max-width: 520px;
  margin: 0 auto 3.5rem;
  line-height: 1.5;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.25rem;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(64, 219, 241, 0.25);
  transform: translateY(-4px);
}

.feature-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 1.5rem;
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon svg { width: 100%; height: 100%; }

.feature-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.feature-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* clyr features - split layout, zones-forward */
.features-clyr {
  padding: 5rem 1.5rem;
}

.features-split {
  max-width: 880px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.features-intro h2 {
  margin: 0 0 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.features-intro p {
  margin: 0 0 1.5rem;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.6;
}

.link-arrow {
  color: var(--teal);
  font-weight: 600;
  font-size: 0.95rem;
}

.link-arrow:hover {
  color: var(--teal-bright);
}

.features-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.feature-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.feature-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 0.5rem;
  background: var(--teal);
  border-radius: 50%;
}

/* ---- Shared: glass header (home + site pages) ---- */
.header-home,
.header-glass {
  background: rgba(6, 9, 12, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: rgba(64, 219, 241, 0.06);
}

/* ---- Home: marketing atmosphere (one continuous theme) ---- */
.home-page,
.clyr-theme {
  --home-blurple: #5865f2;
  --home-blurple-hover: #4752c4;
  --home-blurple-glow: rgba(88, 101, 242, 0.42);
  --home-surface: rgba(12, 14, 32, 0.55);
  --home-surface-strong: rgba(18, 22, 48, 0.75);
  --home-divider: rgba(255, 255, 255, 0.07);
  --home-text-muted: rgba(255, 255, 255, 0.62);
  background:
    radial-gradient(ellipse 120% 50% at 50% -5%, rgba(88, 101, 242, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 90% 45% at 100% 35%, rgba(235, 69, 158, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 70% 40% at 0% 55%, rgba(64, 219, 241, 0.1) 0%, transparent 48%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(88, 101, 242, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, #161a4a 0%, #12152b 22%, #0c0f24 48%, #080a18 78%, #05060f 100%);
  color: #f0f4f8;
}

.home-page .header-home,
.clyr-theme .header-home,
.clyr-theme .header-glass {
  background: rgba(26, 28, 77, 0.38);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.home-page.home-scrolled .header-home,
.clyr-theme.home-scrolled .header-home,
.clyr-theme.home-scrolled .header-glass {
  background: rgba(20, 24, 62, 0.94);
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

.home-page .logo,
.clyr-theme .logo {
  color: #fff;
}

.home-page .logo:hover,
.clyr-theme .logo:hover {
  color: #fff;
  opacity: 0.88;
}

.home-page .nav-links a:not(.nav-cta),
.clyr-theme .nav-links a:not(.nav-cta) {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

.home-page .nav-links a:not(.nav-cta):hover,
.clyr-theme .nav-links a:not(.nav-cta):hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.home-page .nav-links .nav-cta,
.clyr-theme .nav-links .nav-cta {
  margin-left: 0.5rem;
  padding: 0.5rem 1.15rem;
  background: #fff;
  color: #23272a;
  border-radius: 999px;
  font-weight: 600;
}

.home-page .nav-links .nav-cta:hover,
.clyr-theme .nav-links .nav-cta:hover {
  background: #f6f6f8;
  color: #111;
}

.home-page .nav-toggle,
.clyr-theme .nav-toggle {
  border-color: rgba(255, 255, 255, 0.28);
}

.home-page .nav-toggle span,
.clyr-theme .nav-toggle span {
  background: #fff;
}

/* ---- clyr-theme: inner marketing + legal (same palette as home) ---- */
.clyr-theme .page-hero-bg {
  background:
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(88, 101, 242, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 25%, rgba(235, 69, 158, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 55% 38% at 0% 70%, rgba(64, 219, 241, 0.1) 0%, transparent 50%);
}

.clyr-theme .page-hero h1 {
  color: #f6f7fb;
}

.clyr-theme .page-hero-sub {
  color: var(--home-text-muted);
}

.clyr-theme .page-section-title,
.clyr-theme .page-section h2 {
  color: #f6f7fb;
}

.clyr-theme .page-section p,
.clyr-theme .page-section ul,
.clyr-theme .page-section li {
  color: rgba(240, 244, 248, 0.78);
}

.clyr-theme .page-cta-box {
  background: var(--home-surface-strong);
  border-color: var(--home-divider);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
}

.clyr-theme .page-cta-box h2 {
  color: #f6f7fb;
}

.clyr-theme .page-cta-box p {
  color: var(--home-text-muted);
}

.clyr-theme .why-card-new {
  background: var(--home-surface);
  border-color: var(--home-divider);
}

.clyr-theme .why-card-new:hover {
  border-color: rgba(154, 233, 245, 0.35);
}

.clyr-theme .why-card-new h3 {
  color: #f6f7fb;
}

.clyr-theme .why-card-new p {
  color: var(--home-text-muted);
}

.clyr-theme .legal-content h1,
.clyr-theme .legal-content h2,
.clyr-theme .legal-content strong {
  color: #f6f7fb;
}

.clyr-theme .legal-content p,
.clyr-theme .legal-content ul,
.clyr-theme .legal-content ol,
.clyr-theme .legal-content li {
  color: rgba(240, 244, 248, 0.78);
}

.clyr-theme .legal-content a {
  color: #9ae9f5;
}

.clyr-theme .legal-content a:hover {
  color: #c5f6ff;
}

.clyr-theme .legal-updated {
  color: var(--home-text-muted);
}

.clyr-theme .careers-hero-bg {
  background:
    radial-gradient(ellipse 85% 55% at 50% 0%, rgba(88, 101, 242, 0.2) 0%, transparent 58%),
    radial-gradient(ellipse 55% 40% at 85% 100%, rgba(64, 219, 241, 0.1) 0%, transparent 50%);
}

.clyr-theme .careers-hero-sub {
  color: var(--home-text-muted);
}

.clyr-theme .careers-intro p,
.clyr-theme .careers-postings-empty,
.clyr-theme .careers-admin-empty,
.clyr-theme .careers-admin-denied p {
  color: rgba(240, 244, 248, 0.75);
}

.clyr-theme .careers-posting {
  background: var(--home-surface);
  border-color: var(--home-divider);
}

.clyr-theme .careers-posting:hover {
  border-color: rgba(154, 233, 245, 0.28);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

.clyr-theme .careers-admin-form-wrap {
  background: var(--home-surface-strong);
  border-color: var(--home-divider);
}

.clyr-theme .review-card {
  background: var(--home-surface);
  border-color: var(--home-divider);
}

.clyr-theme .status-card {
  background: var(--home-surface);
  border-color: var(--home-divider);
}

.clyr-theme .status-card .value {
  color: #f6f7fb;
}

.clyr-theme .status-card .message {
  background: rgba(8, 10, 24, 0.65);
  border: 1px solid var(--home-divider);
}

.clyr-theme.auth-page .auth-panel {
  background: linear-gradient(165deg, rgba(26, 28, 77, 0.88) 0%, rgba(10, 12, 28, 0.96) 100%);
}

.clyr-theme.auth-page .auth-panel-bg {
  background:
    radial-gradient(ellipse 80% 60% at 28% 42%, rgba(88, 101, 242, 0.28) 0%, transparent 58%),
    radial-gradient(ellipse 55% 50% at 85% 75%, rgba(64, 219, 241, 0.14) 0%, transparent 55%);
}

.clyr-theme.auth-page .auth-card {
  background: var(--home-surface-strong);
  border-color: var(--home-divider);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.35);
}

@media (max-width: 480px) {
  .clyr-theme .page-hero-inner > div:has(> .btn) {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
  }

  .clyr-theme .page-hero-inner > div:has(> .btn) .btn {
    width: min(100%, 20rem);
    margin-left: 0 !important;
    justify-content: center;
  }
}

/* ---- Site pages (why, product, legal, etc.) ---- */
.page-hero {
  padding: 8rem 1.5rem 4rem;
  text-align: center;
  position: relative;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(64, 219, 241, 0.08) 0%, transparent 50%);
}

.page-hero-inner {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}

.page-hero-sub {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

.page-section {
  margin-bottom: 2.5rem;
}

.page-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.page-section p {
  margin: 0 0 1rem;
  color: var(--text-soft);
  line-height: 1.7;
}

.page-section ul {
  margin: 0.75rem 0 1rem;
  padding-left: 1.5rem;
  color: var(--text-soft);
  line-height: 1.7;
}

.page-section li {
  margin-bottom: 0.5rem;
}

.page-section a {
  color: var(--teal);
}

.page-section a:hover {
  color: var(--teal-bright);
}

.page-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.page-cta-box {
  text-align: center;
  padding: 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.page-cta-box h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.page-cta-box p {
  margin: 0 0 1.25rem;
  color: var(--text-soft);
}

.why-grid-new {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  max-width: 900px;
  margin: 0 auto;
}

.why-card-new {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  transition: border-color 0.25s, transform 0.25s;
}

.why-card-new:hover {
  border-color: rgba(64, 219, 241, 0.25);
  transform: translateY(-2px);
}

.why-card-new h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.why-card-new p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-soft);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .why-grid-new { grid-template-columns: 1fr; }
}

/* ---- Home page (Discord-inspired showcase) ---- */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

[data-stagger-item] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s;
}

[data-stagger].revealed [data-stagger-item] {
  opacity: 1;
  transform: translateY(0);
}

.home-main {
  min-height: 100vh;
}

.home-page .home-main {
  position: relative;
}

/* Hero (Discord marketing reference: blurple sky, caps headline, tilted UI) */
.home-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7rem 1.5rem 5rem;
  overflow: hidden;
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, transparent 45%, rgba(8, 10, 28, 0.55) 88%, rgba(8, 10, 22, 0.97) 100%),
    radial-gradient(ellipse 130% 85% at 75% 0%, rgba(235, 69, 158, 0.22) 0%, transparent 48%),
    radial-gradient(ellipse 90% 70% at 0% 100%, rgba(88, 101, 242, 0.55) 0%, transparent 52%),
    radial-gradient(ellipse 70% 55% at 100% 65%, rgba(64, 219, 241, 0.14) 0%, transparent 46%),
    linear-gradient(168deg, #1a1c4d 0%, #252a8c 38%, #404eed 72%, #1e1638 100%);
}

.home-hero-stars {
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background-image:
    radial-gradient(1px 1px at 8% 12%, rgba(255, 255, 255, 0.95), transparent),
    radial-gradient(1px 1px at 18% 35%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.2px 1.2px at 32% 8%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1px 1px at 44% 22%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 58% 14%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1px 1px at 72% 28%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.2px 1.2px at 88% 10%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 92% 38%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 12% 62%, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1px 1px at 28% 78%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.2px 1.2px at 52% 88%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 68% 72%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 84% 58%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 96% 82%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 38% 48%, rgba(255, 255, 255, 0.3), transparent);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.home-hero-blobs {
  position: absolute;
  inset: -15% -10%;
  background:
    radial-gradient(ellipse min(55vw, 520px) min(48vh, 440px) at 92% 18%, rgba(235, 69, 158, 0.38), transparent 68%),
    radial-gradient(ellipse min(60vw, 560px) min(50vh, 460px) at 5% 88%, rgba(167, 139, 250, 0.28), transparent 65%);
  filter: blur(48px);
  opacity: 0.85;
}

.home-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 1.08fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.home-hero-text {
  max-width: 520px;
}

.home-hero-title {
  margin: 0 0 1.35rem;
  font-family: 'Archivo Black', var(--font);
  font-size: clamp(2.1rem, 4.9vw, 3.55rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #fff;
}

.home-hero-title-muted {
  color: rgba(255, 255, 255, 0.88);
}

.home-hero-accent {
  background: linear-gradient(120deg, #fff 0%, #c7d2ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-hero-desc {
  margin: 0 0 1.85rem;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
  max-width: 30rem;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.btn-hero-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.65rem;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, filter 0.2s ease;
}

.btn-hero-discord:hover {
  transform: translateY(-2px);
}

.btn-hero-discord-light {
  background: #fff;
  color: #111827;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

.btn-hero-discord-light:hover {
  background: #f6f6f8;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
}

.btn-hero-discord-blurple {
  background: var(--home-blurple);
  color: #fff;
  box-shadow: 0 14px 42px var(--home-blurple-glow);
}

.btn-hero-discord-blurple:hover {
  background: var(--home-blurple-hover);
  box-shadow: 0 20px 52px rgba(88, 101, 242, 0.55);
}

.btn-hero-ic {
  flex-shrink: 0;
}

.home-hero-stats {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
}

.home-hero-stats strong {
  display: block;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 700;
}

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border: none;
}

.btn-ghost:hover {
  color: var(--teal);
  background: rgba(64, 219, 241, 0.06);
}

/* UI mock + stage (tilted “monitor”, phone, member list) */
.home-hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-hero-stage {
  position: relative;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  min-height: min(460px, 56vh);
}

.home-mock-glow {
  position: absolute;
  inset: -12%;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(88, 101, 242, 0.45) 0%, rgba(64, 219, 241, 0.12) 45%, transparent 72%);
  filter: blur(44px);
  pointer-events: none;
  z-index: 0;
}

.home-hero-deco {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

.home-hero-deco-a {
  width: min(120px, 22vw);
  height: min(120px, 22vw);
  left: -4%;
  top: 18%;
  background: linear-gradient(145deg, rgba(235, 69, 158, 0.5), rgba(88, 101, 242, 0.25));
  filter: blur(2px);
}

.home-hero-deco-b {
  width: min(90px, 18vw);
  height: min(90px, 18vw);
  right: 4%;
  bottom: 12%;
  background: linear-gradient(145deg, rgba(64, 219, 241, 0.35), rgba(88, 101, 242, 0.3));
  filter: blur(1px);
}

.home-mock-frame {
  position: relative;
  z-index: 1;
  transform: perspective(1100px) rotateY(-8deg) rotateX(4deg);
  transform-style: preserve-3d;
  filter: drop-shadow(0 36px 70px rgba(0, 0, 0, 0.55));
  animation: homeFrameFloat 7s ease-in-out infinite;
}

@keyframes homeFrameFloat {
  0%, 100% {
    transform: perspective(1100px) rotateY(-8deg) rotateX(4deg) translateY(0);
  }
  50% {
    transform: perspective(1100px) rotateY(-8deg) rotateX(4deg) translateY(-10px);
  }
}

/* Home: embedded real clyr chat chrome (same classes as chat.html, scaled) */
.home-chat-preview {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 28px 90px rgba(0, 0, 0, 0.5),
    0 0 100px rgba(88, 101, 242, 0.15);
  pointer-events: none;
  user-select: none;
}

.home-chat-preview .chat-layout {
  display: grid;
  height: min(400px, 50vh);
  grid-template-columns: 58px minmax(0, 158px) minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-height: 0;
}

.home-chat-preview .chat-main {
  min-height: 0;
}

.home-chat-preview .chat-sidebar-zones {
  padding: 0.55rem 0.35rem;
  gap: 0.55rem;
}

.home-chat-preview .chat-sidebar-header .logo-mini {
  width: 30px;
  height: 30px;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.home-chat-preview .dm-pill {
  width: 36px;
  height: 36px;
}

.home-chat-preview .zones-list {
  gap: 0.4rem;
}

.home-chat-preview .zone-pill {
  width: 36px;
  height: 36px;
}

.home-chat-preview .zone-pill-initial {
  font-size: 0.8rem;
}

.home-chat-preview .zone-pill-add {
  font-size: 1.15rem;
}

.home-chat-preview .chat-zone-header {
  height: 46px;
  padding: 0.5rem 0.65rem;
}

.home-chat-preview .chat-zone-name {
  font-size: 0.8rem;
  gap: 0.35rem;
}

.home-chat-preview .channel-list {
  padding: 0.5rem 0.35rem 0.35rem;
}

.home-chat-preview .channel-section-label {
  font-size: 0.6rem;
  padding: 0.25rem 0.35rem;
}

.home-chat-preview .channel-item {
  font-size: 0.75rem;
  padding: 0.28rem 0.4rem;
}

.home-chat-preview .chat-user-footer {
  padding: 0.5rem 0.45rem;
}

.home-chat-preview .avatar-mini {
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
}

.home-chat-preview .chat-user-name {
  font-size: 0.78rem;
}

.home-chat-preview .chat-user-tag {
  font-size: 0.65rem;
}

.home-chat-preview .chat-main-header {
  padding: 0.55rem 0.75rem;
}

.home-chat-preview .chat-main-title h1 {
  font-size: 0.95rem;
}

.home-chat-preview .chat-main-subtitle {
  font-size: 0.72rem;
  margin-top: 0.2rem;
}

.home-chat-preview .chat-messages {
  padding: 0.5rem 0.65rem 0.35rem;
}

.home-chat-preview .message {
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.home-chat-preview .message-avatar {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 0.75rem;
}

.home-chat-preview .message-compact .message-avatar-hidden {
  width: 28px;
  min-width: 28px;
}

.home-chat-preview .message-author {
  font-size: 0.78rem;
}

.home-chat-preview .message-meta {
  font-size: 0.65rem;
}

.home-chat-preview .message-text {
  font-size: 0.78rem;
}

.home-chat-preview .chat-input-bar {
  padding: 0.4rem 0.65rem 0.55rem;
}

.home-chat-preview .chat-input {
  font-size: 0.78rem;
  padding: 0.45rem 0.75rem;
}

.home-chat-preview .chat-send-btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
}

.home-chat-preview .chat-input-hint {
  font-size: 0.65rem;
  margin-top: 0.25rem;
}

.home-preview-notice {
  font-size: 0.72rem;
  padding: 0.4rem 0.5rem;
  margin: 0 0 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.35;
}

.home-preview-typing {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.15rem 0 0;
}

.home-preview-typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
  animation: homeTyping 1.2s ease-in-out infinite;
}

.home-preview-typing span:nth-child(2) { animation-delay: 0.15s; }
.home-preview-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes homeTyping {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.home-chat-preview-wide {
  max-width: none;
}

.home-chat-preview-wide .chat-layout {
  display: grid;
  height: 360px;
  grid-template-columns: 62px minmax(0, 180px) minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-height: 0;
}

.home-mock-phone {
  display: none;
  position: absolute;
  right: -1%;
  bottom: 6%;
  width: 118px;
  z-index: 2;
  border-radius: 22px;
  background: linear-gradient(180deg, #1e1f22 0%, #111214 100%);
  border: 3px solid #313338;
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  padding: 0.45rem 0.45rem 0.5rem;
  transform: rotate(10deg);
}

.home-mock-phone-notch {
  height: 14px;
  border-radius: 10px;
  background: #0b0c0e;
  margin: 0 auto 0.35rem;
  width: 42%;
}

.home-mock-phone-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 0.15rem;
}

.home-mock-phone-grid span {
  aspect-ratio: 1;
  border-radius: 8px;
  background: linear-gradient(145deg, #3c45a5, #5865f2);
}

.home-mock-phone-grid span:nth-child(2) {
  background: linear-gradient(145deg, #eb459e, #9b59b6);
}

.home-mock-phone-grid span:nth-child(3) {
  background: linear-gradient(145deg, var(--teal), var(--teal-dim));
}

.home-mock-phone-grid span:nth-child(4) {
  background: linear-gradient(145deg, #fee75c, #faa61a);
}

.home-mock-phone-bar {
  margin-top: 0.4rem;
  padding: 0.25rem 0.2rem 0;
  font-size: 0.58rem;
  font-weight: 600;
  text-align: center;
  color: #949ba4;
  letter-spacing: 0.02em;
}

.home-hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.home-hero-scroll-line {
  display: block;
  width: 2px;
  height: 48px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.85), transparent);
  border-radius: 2px;
  opacity: 0.65;
  animation: homeScrollHint 2s ease-in-out infinite;
}

@keyframes homeScrollHint {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(0.7); }
}

/* Showcase section — same atmosphere as hero (no hard band) */
.home-showcase {
  position: relative;
  padding: 6rem 1.5rem 7rem;
  background: transparent;
  border-top: 1px solid var(--home-divider, rgba(255, 255, 255, 0.07));
}

.home-showcase-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 3rem;
  align-items: center;
}

.home-showcase-title {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #fff;
}

.home-showcase-accent {
  color: #c7d2fe;
  font-weight: 800;
}

.home-showcase-desc {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--home-text-muted, rgba(255, 255, 255, 0.62));
}

.home-showcase-board {
  position: relative;
}

.home-showcase-glow {
  position: absolute;
  inset: -5%;
  background:
    radial-gradient(ellipse 75% 65% at 50% 50%, rgba(88, 101, 242, 0.22) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 30% 70%, rgba(64, 219, 241, 0.12) 0%, transparent 60%);
  filter: blur(36px);
  pointer-events: none;
}

@media (min-width: 901px) {
  .home-mock-phone {
    display: block;
  }
}

/* Features */
.home-features {
  position: relative;
  padding: 7rem 1.5rem;
  background: transparent;
  border-top: 1px solid var(--home-divider, rgba(255, 255, 255, 0.07));
}

.home-features-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.home-features-header {
  margin-bottom: 3rem;
}

.home-features-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}

.home-features-sub {
  margin: 0;
  font-size: 1rem;
  color: var(--home-text-muted, rgba(255, 255, 255, 0.55));
}

.home-bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.home-bento-item {
  background: var(--home-surface, rgba(12, 14, 32, 0.55));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.home-bento-item:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-4px);
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.45),
    0 0 48px rgba(88, 101, 242, 0.12),
    0 0 28px rgba(64, 219, 241, 0.1);
}

.home-bento-inner {
  padding: 2rem;
  height: 100%;
}

.home-bento-icon {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ae9f5;
  margin-bottom: 0.75rem;
}

.home-bento-item h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.home-bento-item p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--home-text-muted, rgba(255, 255, 255, 0.62));
}

.home-strip {
  padding: 3.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid var(--home-divider, rgba(255, 255, 255, 0.07));
}

.home-strip-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.home-strip-text {
  margin: 0;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--home-text-muted, rgba(255, 255, 255, 0.68));
  line-height: 1.5;
}

.home-strip-accent {
  color: #b8f4ff;
  font-weight: 700;
}

.home-cta {
  position: relative;
  padding: 6rem 1.5rem;
  text-align: center;
  background: transparent;
  border-top: 1px solid var(--home-divider, rgba(255, 255, 255, 0.07));
}

.home-cta-inner {
  max-width: 520px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  background: var(--home-surface-strong, rgba(18, 22, 48, 0.75));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.home-cta-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}

.home-cta-desc {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  color: var(--home-text-muted, rgba(255, 255, 255, 0.62));
}

.home-page .home-cta .btn-primary {
  box-shadow:
    0 12px 40px rgba(64, 219, 241, 0.28),
    0 0 32px rgba(88, 101, 242, 0.15);
}

.home-page .home-cta .btn-primary:hover {
  box-shadow:
    0 16px 48px rgba(64, 219, 241, 0.38),
    0 0 40px rgba(88, 101, 242, 0.2);
}

@media (max-width: 1024px) {
  .home-showcase-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .home-showcase-board {
    order: -1;
  }
}

@media (max-width: 900px) {
  .home-hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .home-hero-text {
    max-width: none;
  }
  .home-hero-desc {
    margin-left: auto;
    margin-right: auto;
  }
  .home-hero-actions {
    justify-content: center;
  }
  .home-hero-stats {
    justify-content: center;
  }
  .home-hero-visual {
    order: -1;
  }
  .home-mock-frame {
    animation: none;
    transform: none;
    filter: drop-shadow(0 24px 50px rgba(0, 0, 0, 0.45));
  }
  .home-chat-preview .chat-layout,
  .home-chat-preview-wide .chat-layout {
    display: grid;
    max-width: min(100%, 26rem);
    width: 100%;
    height: min(392px, 50svh);
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .home-bento {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1299px) {
  .home-hero { padding: 7rem 1rem 5rem; }
  .home-hero-title { font-size: clamp(1.45rem, 6vw, 2.1rem); }
  .home-hero-desc { font-size: 1rem; }
  .home-hero-actions { flex-direction: column; }
  .home-hero-actions .btn,
  .home-hero-actions .btn-hero-discord {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }
}

/* clyr CTA - minimal close */
.cta-clyr {
  padding: 4rem 1.5rem;
  text-align: center;
}

.cta-clyr-text {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .feature-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---- Why ---- */
.why {
  background: var(--bg-mid);
  padding: 6rem 1.5rem;
  border-top: 1px solid var(--border);
}

.why-content { text-align: center; }

.why-list {
  list-style: none;
  margin: 2.5rem auto 0;
  padding: 0;
  max-width: 480px;
  text-align: left;
}

.why-list li {
  position: relative;
  padding: 1rem 0 1rem 2.25rem;
  color: var(--text-soft);
  font-size: 1.0625rem;
  border-bottom: 1px solid var(--border);
}
.why-list li:last-child { border-bottom: none; }

.why-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.35rem;
  width: 10px;
  height: 10px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--teal-glow);
}

/* ---- CTA ---- */
.cta-section { padding: 6rem 1.5rem; }

.cta-box {
  max-width: 560px;
  margin: 0 auto;
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-mid) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3.5rem 2.5rem;
  text-align: center;
}

.cta-box h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.cta-box > p {
  margin: 0 0 1.75rem;
  color: var(--text-soft);
  font-size: 1rem;
}

.cta-buttons { margin-bottom: 1rem; }

.cta-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 !important;
}

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  background: var(--bg-mid);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer .logo {
  display: inline-block;
  margin-bottom: 0.25rem;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0 0 1.5rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem;
  margin-bottom: 1.5rem;
}

.footer-nav a {
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.footer-nav a:hover { color: var(--teal); }

.footer-copy {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Home: footer matches marketing page */
.home-page .footer,
.clyr-theme .footer {
  background: rgba(5, 7, 20, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.home-page .footer .logo,
.clyr-theme .footer .logo {
  color: #fff;
}

.home-page .footer .logo:hover,
.clyr-theme .footer .logo:hover {
  color: #fff;
  opacity: 0.88;
}

.home-page .footer-tagline,
.home-page .footer-copy,
.clyr-theme .footer-tagline,
.clyr-theme .footer-copy {
  color: rgba(255, 255, 255, 0.48);
}

.home-page .footer-nav a,
.clyr-theme .footer-nav a {
  color: rgba(255, 255, 255, 0.65);
}

.home-page .footer-nav a:hover,
.clyr-theme .footer-nav a:hover {
  color: #fff;
}

.home-page .cookie-consent,
.clyr-theme .cookie-consent {
  background: rgba(12, 14, 32, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
}

.home-page .cookie-consent-text,
.clyr-theme .cookie-consent-text {
  color: rgba(255, 255, 255, 0.75);
}

.home-page .cookie-consent-text a,
.clyr-theme .cookie-consent-text a {
  color: #9ae9f5;
}

.home-page .cookie-consent-text a:hover,
.clyr-theme .cookie-consent-text a:hover {
  color: #c5f6ff;
}

/* ---- Mobile / Touch ---- */
@media (hover: none) and (pointer: coarse) {
  .btn, .nav-links a, a.nav-cta {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  a:not(.nav-cta):not(.btn) { -webkit-tap-highlight-color: rgba(64, 219, 241, 0.2); }
}

/* ---- Mobile (<= 768px) ---- */
@media (max-width: 768px) {
  .header {
    padding: 0.75rem 1rem;
    padding-top: max(0.75rem, var(--safe-top));
  }
  .nav { max-width: 100%; }
  .page-hero { padding: 6rem 1rem 3rem; }
  .page-hero h1 { font-size: 1.75rem; }
  .page-hero-sub { font-size: 1rem; }
  .page-content { padding: 0 1rem 3rem; }
  .legal-content h2 { font-size: 1.15rem; }
  .clyr-theme .page-cta-box {
    padding: 1.75rem 1.25rem;
    margin-left: 0;
    margin-right: 0;
  }
  .footer { padding: 2rem 1rem; padding-bottom: max(2rem, var(--safe-bottom)); }
  .footer-nav { gap: 1rem; }
  .modal-content { max-width: calc(100vw - 2rem); margin: 1rem; }

  /* —— Mobile navigation: hamburger + right drawer —— */
  .nav {
    position: relative;
    z-index: 1;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    min-height: 46px;
    position: relative;
    z-index: 2;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.22);
    gap: 0;
  }

  .home-page .nav-toggle,
  .clyr-theme .nav-toggle {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
  }

  .nav-toggle span {
    position: absolute;
    left: 50%;
    width: 20px;
    height: 2px;
    margin: 0;
    margin-left: -10px;
    border-radius: 2px;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
  }

  .nav-toggle span:nth-child(1) {
    top: calc(50% - 7px);
  }

  .nav-toggle span:nth-child(2) {
    top: 50%;
    margin-top: -1px;
  }

  .nav-toggle span:nth-child(3) {
    bottom: calc(50% - 7px);
  }

  .nav.open .nav-toggle span:nth-child(1) {
    top: 50%;
    margin-top: -1px;
    transform: rotate(45deg);
  }

  .nav.open .nav-toggle span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  .nav.open .nav-toggle span:nth-child(3) {
    bottom: 50%;
    margin-bottom: -1px;
    transform: rotate(-45deg);
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(20.5rem, 90vw);
    margin: 0;
    padding: max(4.85rem, calc(2.85rem + var(--safe-top))) 1rem max(1.25rem, var(--safe-bottom));
    list-style: none;
    z-index: 160;
    background: linear-gradient(200deg, #1a1d42 0%, #12152b 45%, #0a0c18 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -20px 0 56px rgba(0, 0, 0, 0.5);
    transform: translate3d(100%, 0, 0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.22s ease,
      visibility 0.32s step-end;
  }

  .nav.open .nav-links {
    transform: translate3d(0, 0, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
      transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.2s ease,
      visibility 0s step-start;
  }

  .nav.open .nav-links li {
    padding: 0;
    border: none;
  }

  .nav.open .nav-links a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    color: rgba(248, 250, 252, 0.92);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
  }

  .nav.open .nav-links a:hover,
  .nav.open .nav-links a:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(154, 233, 245, 0.25);
    outline: none;
  }

  .nav.open .nav-links a.active {
    color: #b8f4ff;
    border-color: rgba(64, 219, 241, 0.35);
    background: rgba(64, 219, 241, 0.1);
  }

  .nav.open .nav-links .nav-cta {
    margin-left: 0;
    margin-top: 0.35rem;
    justify-content: center;
    min-height: 50px;
    font-weight: 600;
    font-size: 1rem;
    color: #111827;
    background: #fff;
    border: none;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  }

  .nav.open .nav-links .nav-cta:hover,
  .nav.open .nav-links .nav-cta:focus-visible {
    color: #111827;
    background: #f4f4f8;
  }

  body:not(.home-page):not(.clyr-theme) .nav-links {
    background: var(--bg-mid);
    border-left-color: var(--border);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
  }

  body:not(.home-page):not(.clyr-theme) .nav.open .nav-links a {
    color: var(--text);
    background: var(--bg-card);
    border-color: var(--border);
  }
}

/* ---- Mobile (<= 640px) ---- */
@media (max-width: 640px) {
  .cookie-consent-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-consent-actions {
    justify-content: stretch;
  }

  .cookie-consent-actions .cookie-consent-btn {
    flex: 1;
    justify-content: center;
  }
  .hero { padding: 6rem 1rem 4rem; }
  .hero h1 { font-size: clamp(2.75rem, 14vw, 4rem); }
  .features-split { grid-template-columns: 1fr; gap: 2.5rem; }
  .features-intro { text-align: center; }

  .home-chat-preview .chat-layout,
  .home-chat-preview-wide .chat-layout {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    height: min(400px, 62svh);
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
  }

  .home-chat-preview .chat-sidebar-main,
  .home-chat-preview-wide .chat-sidebar-main {
    display: none;
  }

  .home-chat-preview .chat-main,
  .home-chat-preview-wide .chat-main {
    min-width: 0;
  }

  .home-chat-preview .chat-main-title h1,
  .home-chat-preview-wide .chat-main-title h1 {
    font-size: 0.88rem;
  }

  .home-chat-preview .message-text,
  .home-chat-preview-wide .message-text {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .home-chat-preview .chat-input,
  .home-chat-preview-wide .chat-input {
    font-size: 0.72rem;
    padding: 0.4rem 0.55rem;
  }

  .home-chat-preview .chat-send-btn,
  .home-chat-preview-wide .chat-send-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.72rem;
  }

  .home-showcase-board {
    width: 100%;
    max-width: min(100vw - 1.5rem, 28rem);
    margin-left: auto;
    margin-right: auto;
  }

  .home-hero-stage {
    min-height: min(340px, 48svh);
    max-width: 100%;
  }

  .home-showcase { padding: 4rem 1rem; }
  .home-features { padding: 4rem 1rem; }
  .home-features-title { font-size: 1.5rem; }
  .home-bento { gap: 1rem; }
  .home-bento-inner { padding: 1.5rem; }
  .home-strip { padding: 2rem 1rem; }
  .home-cta-inner {
    padding: 1.75rem 1.15rem;
    border-radius: 16px;
  }

  .home-page .home-main {
    overflow-x: clip;
  }

  .btn, .btn-primary, .btn-secondary {
    padding: 0.875rem 1.25rem;
    min-height: 48px;
  }
  .auth-card { padding: 1.75rem 1.25rem; }
  .auth-step h1 { font-size: 1.5rem; }
  .twofa-setup { flex-direction: column; }
  .twofa-qr-wrap { margin: 0 auto; }

  .auth-form input,
  .auth-form textarea {
    font-size: 16px;
  }

  .auth-input-totp {
    font-size: 17px !important;
    letter-spacing: 0.14em;
  }

  .twofa-qr {
    width: min(200px, 72vw);
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
    margin-left: auto;
    margin-right: auto;
  }

  .twofa-setup-new {
    padding: 1rem 0.75rem;
  }
}

/* ---- Small phones (<= 480px) ---- */
@media (max-width: 480px) {
  .home-hero-title { font-size: 1.75rem; }
  .home-features-title { font-size: 1.3rem; }
  .page-hero h1 { font-size: 1.5rem; }
}

/* ---- Auth (register / login) ---- */
.auth-page .auth-main {
  min-height: 100vh;
  padding: 6rem 0 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  min-height: calc(100vh - 6rem);
}

.auth-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: var(--bg-mid);
}

.auth-panel-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 30% 50%, rgba(64, 219, 241, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

.auth-panel-inner {
  position: relative;
  max-width: 360px;
}

.auth-panel-logo {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2rem;
  text-decoration: none;
}

.auth-panel-logo:hover {
  color: var(--teal);
}

.auth-panel-title {
  margin: 0 0 0.75rem;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}

.auth-panel-desc {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-soft);
}

.auth-panel-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.auth-panel-list li {
  position: relative;
  padding: 0.4rem 0 0.4rem 1.25rem;
  color: var(--text-soft);
  font-size: 0.9375rem;
}

.auth-panel-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.75rem;
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 50%;
}

.auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
}

.auth-card-new {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}

.auth-step h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  margin: 0 0 1.75rem;
  color: var(--text-soft);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.btn-auth {
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
}

.auth-input-totp {
  font-size: 1.25rem !important;
  letter-spacing: 0.25em;
  text-align: center;
}

@media (max-width: 900px) {
  .auth-split {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-form-wrap {
    order: -1;
    padding: 1.75rem max(0.75rem, var(--safe-left)) 1rem max(0.75rem, var(--safe-right));
    width: 100%;
    max-width: 100%;
    align-items: stretch;
    justify-content: flex-start;
  }

  .auth-panel {
    order: 1;
    padding: 1.5rem max(1rem, var(--safe-left)) 2rem max(1rem, var(--safe-right));
  }

  .auth-panel-logo {
    margin-bottom: 1rem;
  }

  .auth-panel-title {
    font-size: 1.45rem;
  }

  .auth-page .auth-main {
    padding: 5.25rem 0 max(2rem, var(--safe-bottom));
    padding-top: max(5rem, calc(3.75rem + var(--safe-top)));
    align-items: stretch;
    justify-content: flex-start;
  }

  .auth-card {
    max-width: 100%;
    width: min(100%, 26rem);
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .auth-page .auth-panel {
    padding: 1.15rem max(0.75rem, var(--safe-left)) 1.5rem max(0.75rem, var(--safe-right));
  }

  .auth-page .auth-form-wrap {
    padding-top: 1.35rem;
    padding-bottom: 0.65rem;
  }

  .auth-page .auth-card {
    padding: 1.35rem 1rem;
    border-radius: 14px;
  }

  .auth-page .auth-panel-title {
    font-size: 1.35rem;
  }

  .auth-page .auth-panel-list li {
    font-size: 0.875rem;
  }
}

.modal-form.auth-form {
  margin-bottom: 0;
}

.auth-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-soft);
}

.auth-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease;
}

.auth-form input::placeholder {
  color: var(--text-muted);
}

.auth-form input:focus {
  border-color: var(--teal);
}

.auth-form select {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s ease;
}

.auth-form select:focus {
  border-color: var(--teal);
}

.auth-form .btn-block {
  width: 100%;
  margin-top: 0.5rem;
}

.auth-error {
  margin: 0 0 1rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: #f87171;
}

.auth-error[hidden] { display: none; }

.auth-card .auth-step[hidden] {
  display: none !important;
}

/* 2FA setup */
.twofa-setup {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  padding: 1.25rem;
  background: var(--bg-mid);
  border-radius: 14px;
  border: 1px solid var(--border);
}

.twofa-setup-new {
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.twofa-qr-wrap {
  flex-shrink: 0;
  text-align: center;
}

.twofa-qr-label,
.twofa-manual-label {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

.twofa-qr {
  display: block;
  width: 200px;
  height: 200px;
  border-radius: 10px;
  background: #fff;
}

.twofa-manual {
  flex: 1;
  min-width: 0;
}

.twofa-secret {
  display: block;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  word-break: break-all;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-soft);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Success step */
.auth-step-success {
  text-align: center;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  background: var(--teal);
  border-radius: 50%;
  position: relative;
}

.success-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 22px;
  margin-left: -6px;
  margin-top: -14px;
  border: solid #06090c;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.auth-step-success .btn-block {
  margin-top: 1rem;
}

.auth-footer-link {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.auth-footer-link a {
  color: var(--teal);
  font-weight: 500;
}

.auth-field-hint {
  margin: -0.75rem 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.auth-success {
  margin: 0 0 1rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--teal);
}

.auth-success[hidden] { display: none; }

.settings-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.settings-section h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.settings-audio-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
}

.settings-toggle input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--teal);
  cursor: pointer;
}

.settings-toggle span {
  user-select: none;
}

.settings-gain-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.settings-gain-row input[type="range"] {
  flex: 1;
  height: 8px;
  accent-color: var(--teal);
}

.settings-select {
  display: block;
  width: 100%;
  max-width: 420px;
  margin-bottom: 1rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-mid);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
}

.settings-gain-value {
  font-size: 0.9rem;
  color: var(--text-muted);
  min-width: 3.5rem;
}

.settings-friends-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.settings-friends-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.settings-friends-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(64, 219, 241, 0.08);
}

.settings-friends-results {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.nav-close-btn {
  background: none;
  border: none;
  color: var(--teal);
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
}

/* Settings page in embed (overlay iframe) — no site chrome */
html.embed-mode,
html.embed-mode body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body.embed-mode.auth-page {
  min-height: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.embed-mode #settings-header {
  display: none !important;
}

body.embed-mode .cookie-consent {
  display: none !important;
}

body.embed-mode .auth-main {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  display: block;
  align-items: stretch;
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

body.embed-mode .auth-card {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 1.25rem 1.35rem 1.5rem;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  box-sizing: border-box;
}

body.embed-mode .auth-card h1 {
  font-size: 1.35rem;
  margin-top: 0;
}

body.embed-mode .settings-section {
  margin-bottom: 1.5rem;
}

body.embed-mode .settings-embed-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

body.embed-mode .settings-friends-columns {
  grid-template-columns: 1fr;
}

body.embed-mode #appearance-header {
  display: none !important;
}

body.embed-mode .appearance-card {
  max-width: none;
}

.auth-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.auth-form textarea::placeholder {
  color: var(--text-muted);
}

.auth-form textarea:focus {
  border-color: var(--teal);
}

/* Profile preview (settings page) */
.profile-preview {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 1.5rem 0 1rem;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--bg-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-soft);
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.profile-preview-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.profile-preview-username {
  font-size: 0.9rem;
  font-weight: 600;
}

.profile-preview-display {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.avatar-edit {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.avatar-preview {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-mid);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-soft);
  background-size: cover;
  background-position: center;
}

.nav-links a.active {
  color: var(--teal);
}

/* ---- Legal / content pages ---- */
.legal-main,
.page-main {
  min-height: calc(100vh - 200px);
}

.legal-content {
  color: var(--text);
}

.legal-content h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.legal-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2.25rem 0 0.75rem;
  color: var(--text);
}

.legal-content h2:first-of-type {
  margin-top: 1.5rem;
}

.legal-updated {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0 0 2rem;
}

.legal-content p {
  margin: 0 0 1rem;
  line-height: 1.7;
  color: var(--text-soft);
}

.legal-content ul,
.legal-content ol {
  margin: 0.75rem 0 1rem;
  padding-left: 1.5rem;
  color: var(--text-soft);
  line-height: 1.7;
}

.legal-content li {
  margin-bottom: 0.5rem;
}

.legal-content strong {
  color: var(--text);
  font-weight: 600;
}

.legal-content a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-content a:hover {
  color: var(--teal-bright);
}

.legal-content section {
  margin-bottom: 2rem;
}

.legal-content section:last-child {
  margin-bottom: 0;
}

/* ---- Careers page ---- */
.careers-main {
  min-height: 100vh;
}
.careers-hero {
  position: relative;
  padding: 7rem 1.5rem 5rem;
  text-align: center;
  overflow: hidden;
}
.careers-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(64, 219, 241, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(64, 219, 241, 0.06) 0%, transparent 50%);
}
.careers-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}
.careers-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
}
.careers-hero-sub {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-soft);
}
.careers-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}
.careers-intro {
  margin-bottom: 2.5rem;
}
.careers-intro h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  color: var(--text);
}
.careers-intro p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-soft);
  line-height: 1.7;
}
.careers-postings {
  margin-bottom: 2.5rem;
}
.careers-postings-empty {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 1rem 0 0;
}
.careers-postings-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  color: var(--text);
}
.careers-postings-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.careers-posting {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  text-align: left;
}
.careers-posting:hover {
  border-color: rgba(64, 219, 241, 0.2);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.careers-posting-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}
.careers-posting-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.careers-posting-dept {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.careers-posting-desc {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.6;
}
.careers-posting-apply {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--teal);
  background: transparent;
  border: 1px solid var(--teal);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  display: inline-block;
  text-decoration: none;
}
.careers-posting-link-label {
  margin: 0;
}
.careers-posting-link-missing {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}
.careers-posting-apply:hover {
  background: var(--teal-subtle);
  color: var(--teal-bright);
}
.careers-posting-general .careers-posting-apply {
  color: var(--text-soft);
  border-color: var(--border);
}
.careers-posting-general .careers-posting-apply:hover {
  background: var(--bg-mid);
  color: var(--text);
  border-color: var(--text-muted);
}
.careers-posting-apply--disabled,
.careers-posting-apply:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.careers-wizard-open .careers-hero {
  padding-bottom: 1.5rem;
}
.careers-wizard {
  max-width: 720px;
  margin: 0 auto 3rem;
}
.careers-wizard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}
.careers-wizard-exit {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  background: none;
  border: none;
  padding: 0;
  margin: 0 0 1.25rem;
  cursor: pointer;
  transition: color 0.2s ease;
}
.careers-wizard-exit:hover {
  color: var(--teal);
}
.careers-wizard-head {
  margin-bottom: 1.5rem;
}
.careers-wizard-dept {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal);
  margin-bottom: 0.35rem;
}
.careers-wizard-title {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
}
.careers-wizard-progress {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.careers-wizard-step-indicator {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-mid);
  opacity: 0.65;
  transition: border-color 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}
.careers-wizard-step-indicator.active {
  opacity: 1;
  border-color: rgba(64, 219, 241, 0.45);
  background: var(--teal-subtle);
}
.careers-wizard-step-indicator.done {
  opacity: 0.85;
  border-color: rgba(64, 219, 241, 0.2);
}
.careers-wizard-step-num {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text-soft);
}
.careers-wizard-step-indicator.active .careers-wizard-step-num {
  background: var(--teal);
  color: var(--bg-deep, #0a0f14);
}
.careers-wizard-step-indicator.done .careers-wizard-step-num {
  background: var(--teal-subtle);
  color: var(--teal);
}
.careers-wizard-step-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
  line-height: 1.2;
}
@media (max-width: 520px) {
  .careers-wizard-step-label { display: none; }
  .careers-wizard-step-indicator { justify-content: center; flex: 0 0 auto; }
}
.careers-wizard-panel-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.careers-wizard-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-soft);
}
.careers-wizard-body p {
  margin: 0 0 0.85rem;
}
.careers-wizard-body p:last-child {
  margin-bottom: 0;
}
.careers-wizard-list {
  margin: 0;
  padding-left: 1.25rem;
}
.careers-wizard-list li {
  margin-bottom: 0.5rem;
}
.careers-wizard-list li:last-child {
  margin-bottom: 0;
}
.careers-wizard-muted {
  color: var(--text-muted);
  font-style: italic;
}
.careers-wizard-apply-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(64, 219, 241, 0.25);
  background: var(--teal-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}
.careers-wizard-apply-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.5;
}
.careers-wizard-apply-btn {
  width: 100%;
  text-align: center;
  text-decoration: none;
}
.careers-wizard-copy {
  width: 100%;
}
.careers-wizard-copy-feedback {
  margin: 0;
  font-size: 0.85rem;
  color: var(--teal);
}
.careers-wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.careers-wizard-nav .btn {
  min-width: 7rem;
}
.careers-wizard-nav .btn-primary:only-child,
.careers-wizard-nav #wizard-next:not([hidden]) {
  margin-left: auto;
}
.careers-form-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.careers-form-wrap:hover {
  border-color: rgba(64, 219, 241, 0.25);
  box-shadow: 0 0 0 1px rgba(64, 219, 241, 0.08);
}
.careers-form {
  display: block;
}
.careers-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 520px) {
  .careers-form-grid { grid-template-columns: 1fr; }
}
.careers-form .form-row {
  margin-bottom: 1.25rem;
}
.careers-form .form-row:last-of-type {
  margin-bottom: 1.5rem;
}
.careers-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-soft);
}
.careers-form input,
.careers-form textarea {
  width: 100%;
  padding: 0.9rem 1.125rem;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}
.careers-form input::placeholder,
.careers-form textarea::placeholder {
  color: var(--text-muted);
}
.careers-form input:focus,
.careers-form textarea:focus {
  border-color: var(--teal);
  background: var(--bg-card-hover);
}
.careers-form textarea {
  resize: vertical;
  min-height: 140px;
}
.careers-char-count {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: right;
}
.careers-file-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.careers-submit {
  width: 100%;
  padding: 1rem 1.5rem;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--teal);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.careers-submit:hover:not(:disabled) {
  background: var(--teal-bright);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(64, 219, 241, 0.3);
}
.careers-submit:active:not(:disabled) {
  transform: translateY(0);
}
.careers-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.careers-note {
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}
.careers-feedback {
  margin: 0 0 1rem;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  border-radius: 12px;
}
.careers-feedback-pending {
  color: var(--text-soft);
  background: var(--teal-subtle);
}
.careers-feedback-success {
  color: var(--teal-bright);
  background: var(--teal-subtle);
}
.careers-feedback-error {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}
.careers-why {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.careers-why h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.careers-why ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.careers-why li {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-soft);
  line-height: 1.5;
}
.careers-why li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 6px;
  height: 6px;
  background: var(--teal);
  border-radius: 50%;
}
.careers-why li:last-child {
  margin-bottom: 0;
}

/* ---- Careers admin ---- */
.careers-admin-content {
  padding-top: 2rem;
}
.careers-admin-loading,
.careers-admin-denied {
  text-align: center;
  padding: 3rem 1.5rem;
}
.careers-admin-denied h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: var(--text);
}
.careers-admin-denied p {
  margin: 0 0 1.5rem;
  color: var(--text-soft);
}
.careers-admin-form-wrap {
  margin-bottom: 2.5rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.careers-admin-form-wrap h2 {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  color: var(--text);
}
.careers-admin-form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
}
.careers-admin-cancel {
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text-soft);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0;
}
.careers-admin-cancel:hover {
  color: var(--text);
}
.careers-admin-posting-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.careers-admin-delete {
  font-family: var(--font);
  font-size: 0.85rem;
  color: #f87171;
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.careers-admin-delete:hover {
  background: rgba(248, 113, 113, 0.12);
}
.careers-admin-empty {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 1rem 0 0;
}

.roadmap-admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.roadmap-admin-track-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.roadmap-admin-track-select-wrap label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.roadmap-admin-track-select-wrap select {
  min-width: 220px;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-mid);
  color: var(--text);
  font-family: var(--font);
}

.roadmap-admin-toolbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.roadmap-admin-stats {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.roadmap-admin-stats span {
  font-size: 0.78rem;
  color: var(--text-soft);
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
}

.roadmap-admin-layout {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 1rem;
  align-items: start;
}

.roadmap-admin-canvas-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: auto;
}

.roadmap-admin-canvas {
  position: relative;
  width: 1400px;
  min-height: 760px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    radial-gradient(ellipse at 20% 10%, rgba(64, 219, 241, 0.08), transparent 45%),
    radial-gradient(ellipse at 80% 90%, rgba(88, 101, 242, 0.08), transparent 45%),
    var(--bg-mid);
  background-size: 24px 24px, 24px 24px, auto, auto, auto;
}

.roadmap-admin-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.roadmap-edge {
  fill: none;
  stroke: rgba(64, 219, 241, 0.42);
  stroke-width: 2;
}

.roadmap-admin-nodes {
  position: absolute;
  inset: 0;
}

.roadmap-node {
  position: absolute;
  width: 240px;
  padding: 0.55rem 0.7rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
}

.roadmap-node--planned { border-color: rgba(100, 140, 255, 0.4); }
.roadmap-node--in_progress { border-color: rgba(64, 219, 241, 0.7); }
.roadmap-node--completed { border-color: rgba(80, 220, 140, 0.7); }
.roadmap-node--blocked { border-color: rgba(248, 113, 113, 0.7); }

.roadmap-node-drag {
  position: absolute;
  top: 0.3rem;
  right: 0.4rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: grab;
  font-size: 0.8rem;
}

.roadmap-node-head {
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
}

.roadmap-node-type,
.roadmap-node-status {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.roadmap-node h4 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  color: var(--text);
}

.roadmap-node p {
  margin: 0 0 0.35rem;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.4;
}

.roadmap-node-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.roadmap-node-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.roadmap-admin-side {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  min-height: 240px;
}

.roadmap-admin-side h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.roadmap-updates-list {
  display: grid;
  gap: 0.5rem;
  max-height: 700px;
  overflow: auto;
}

.roadmap-update-item {
  border: 1px solid var(--border);
  background: var(--bg-mid);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}

.roadmap-update-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.roadmap-update-item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.roadmap-modal {
  max-width: 520px;
}

.roadmap-public-main .roadmap-admin-canvas {
  min-height: 680px;
}

.roadmap-public-layout {
  grid-template-columns: 1.65fr 0.85fr;
}

.roadmap-node--readonly {
  pointer-events: none;
}

.roadmap-public-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.roadmap-public-pill {
  font-size: 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  color: var(--text-soft);
}

.roadmap-public-pill--planned { border-color: rgba(100, 140, 255, 0.4); }
.roadmap-public-pill--in-progress { border-color: rgba(64, 219, 241, 0.7); }
.roadmap-public-pill--completed { border-color: rgba(80, 220, 140, 0.7); }
.roadmap-public-pill--blocked { border-color: rgba(248, 113, 113, 0.7); }

.roadmap-public-updates-title {
  margin-top: 1rem;
}

.roadmap-public-content {
  max-width: 960px;
  padding-top: 5.75rem;
}

.roadmap-public-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.9rem;
}

.roadmap-public-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  padding: 0.9rem 1rem;
}

.roadmap-public-item--planned { border-color: rgba(100, 140, 255, 0.4); }
.roadmap-public-item--in_progress { border-color: rgba(64, 219, 241, 0.7); }
.roadmap-public-item--completed { border-color: rgba(80, 220, 140, 0.7); }
.roadmap-public-item--blocked { border-color: rgba(248, 113, 113, 0.7); }

.roadmap-public-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.roadmap-public-type,
.roadmap-public-status {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.roadmap-public-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.roadmap-public-item p {
  margin: 0 0 0.55rem;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.roadmap-public-meta {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.roadmap-public-updates-section {
  margin-top: 1rem;
}

@media (max-width: 1100px) {
  .roadmap-admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .roadmap-public-list {
    grid-template-columns: 1fr;
  }
}

/* ---- Why / Features page ---- */
.why-page .why-hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7rem 1.5rem 4rem;
  overflow: hidden;
}

.why-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 920px;
  text-align: center;
}

.why-title {
  margin: 0 0 1.25rem;
  font-size: clamp(2.75rem, 7.5vw, 4.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.why-lede {
  margin: 0 auto 2.25rem;
  max-width: 640px;
  color: var(--text-soft);
  font-size: 1.125rem;
  line-height: 1.6;
}

.why-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5.5rem 1.5rem;
}

.why-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.why-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.why-card:hover {
  transform: translateY(-4px);
  border-color: rgba(64, 219, 241, 0.25);
  background: var(--bg-card-hover);
}

.why-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.why-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
  font-size: 0.95rem;
}

.why-split {
  background: var(--bg-mid);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.why-split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}

.why-split-col {
  padding: 0;
}

.why-metrics {
  display: grid;
  gap: 1rem;
}

.metric {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.metric-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--teal);
}

.metric-label {
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

@media (max-width: 980px) {
  .why-grid { grid-template-columns: 1fr; max-width: 520px; }
  .why-split { grid-template-columns: 1fr; }
}

/* ---- Chat layout ---- */
body.chat-page {
  background: var(--bg-mid);
}

body.chat-page.chat-theme-light .chat-input-bar {
  border-top-color: var(--chat-border);
}

body.chat-page.chat-theme-light .message-self .message-body {
  color: #fff;
}

body.chat-page.chat-theme-light .zone-pill-active {
  color: #fff;
}

/* Exclusive soft light themes (user 29 / user 3) */
body.chat-page.chat-theme-light .chat-input-bar,
body.chat-page[data-chat-theme="pink_cream"] .chat-input-bar,
body.chat-page[data-chat-theme="meadow_cream"] .chat-input-bar {
  border-top-color: var(--chat-border);
}

body.chat-page[data-chat-theme="pink_cream"] .message-self .message-body,
body.chat-page[data-chat-theme="meadow_cream"] .message-self .message-body {
  color: #fff;
}

body.chat-page[data-chat-theme="pink_cream"] .zone-pill-active,
body.chat-page[data-chat-theme="meadow_cream"] .zone-pill-active {
  color: #fff;
}

.chat-page {
  background: var(--bg-mid);
}

.chat-layout {
  display: grid;
  grid-template-columns: 72px 200px minmax(0, 1fr);
  height: 100vh;
}

.chat-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.chat-sidebar-zones {
  align-items: center;
  padding: 0.75rem 0.5rem;
  gap: 0.75rem;
}

.chat-sidebar-header .logo-mini {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.06em;
  margin-bottom: 0.5rem;
}

.zones-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.zone-pill {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  background: var(--bg-mid);
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-radius 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.zones-list-reorderable .zone-pill[draggable="true"] {
  cursor: grab;
}

.zones-list-reorderable .zone-pill[draggable="true"]:active {
  cursor: grabbing;
}

.zone-pill-dragging {
  opacity: 0.4;
}

.zone-pill-drop-before::before,
.zone-pill-drop-after::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  height: 3px;
  border-radius: 999px;
  background: var(--teal);
  pointer-events: none;
}

.zone-pill-drop-before::before {
  top: -5px;
}

.zone-pill-drop-after::after {
  bottom: -5px;
}

.zone-pill-add-btn {
  cursor: pointer;
}

.zone-pill:hover {
  background: var(--teal-subtle);
  color: var(--teal);
  transform: translateY(-1px);
}

.zone-pill-active {
  background: var(--teal);
  color: #ffffff;
}

.zone-pill-in-voice {
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--teal);
}

.zone-pill-initial {
  font-weight: 700;
  font-size: 0.95rem;
}

.zone-pill-icon {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background-size: cover;
  background-position: center;
}

.zone-icon-edit {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.zone-icon-edit-fields {
  flex: 1;
  min-width: 0;
}

.zone-icon-url-input {
  margin-bottom: 0.35rem;
}

.file-upload-label {
  color: var(--teal);
  cursor: pointer;
  font-weight: 500;
}

.file-upload-label:hover {
  color: var(--teal-bright);
}

.file-upload-input {
  display: none;
}

.zone-icon-preview {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--bg-mid);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.btn-danger {
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.5);
}

.zone-pill-add {
  font-size: 1.4rem;
  font-weight: 600;
}

.chat-sidebar-main {
  background: var(--bg-mid);
}

.chat-zone-header {
  height: 52px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-zone-name-wrap {
  position: relative;
}

.chat-zone-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.chat-zone-name-wrap.has-dropdown .chat-zone-name {
  cursor: pointer;
}

.chat-zone-name-wrap.has-dropdown .chat-zone-name:hover {
  background: var(--teal-subtle);
  color: var(--teal);
}

.chat-zone-name-wrap:not(.has-dropdown) .zone-dropdown-chevron {
  display: none;
}

.zone-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--bg-mid);
  flex-shrink: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  display: none;
}

.zone-icon.has-icon {
  display: block;
}

.zone-dropdown-chevron {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: 0.15rem;
}

.chat-zone-name-wrap.open .zone-dropdown-chevron {
  transform: rotate(180deg);
}

.zone-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  padding: 0.25rem;
  z-index: 100;
  display: none;
}

.chat-zone-name-wrap.open .zone-dropdown {
  display: block;
}

.zone-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  background: none;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s ease, color 0.12s ease;
}

.zone-dropdown-item:hover {
  background: var(--teal-subtle);
  color: var(--teal);
}

.dot-online {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 12px var(--teal-glow);
}

.channel-list {
  flex: 1;
  padding: 0.75rem 0.5rem 0.5rem 0.4rem;
  overflow-y: auto;
}

.channel-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem;
}

.channel-item {
  width: 100%;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.channel-item .channel-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.channel-item-active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.channel-item-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.channel-item-with-preview {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding-top: 0.45rem;
  padding-bottom: 0.5rem;
}

.channel-voice-preview {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding-left: 1.9rem; /* align under the speaker icon */
}

.channel-voice-avatar {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-soft);
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}

.channel-voice-avatar-self {
  border-color: color-mix(in srgb, var(--teal) 55%, rgba(255, 255, 255, 0.12));
}

.channel-voice-overflow {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding-left: 0.15rem;
}

.channel-item-voice .channel-hash {
  display: none;
}

.channel-voice-icon {
  margin-right: 0.4rem;
  opacity: 0.9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Minimal SVG icons */
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: inherit;
}
.voice-status-btn .icon {
  width: 16px;
  height: 16px;
}
.dm-pill .icon {
  width: 20px;
  height: 20px;
}
.channel-voice-icon .icon {
  width: 14px;
  height: 14px;
}

/* Voice channel panel - fills available space */
.voice-panel {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  background: var(--bg);
}

.voice-panel[hidden] {
  display: none !important;
}

.voice-panel:not([hidden]) {
  display: flex;
}

.voice-audio-unlock {
  flex-shrink: 0;
  margin: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
}

.voice-audio-unlock[hidden] { display: none !important; }

.voice-audio-unlock-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text);
  font-size: 0.85rem;
}

.voice-audio-unlock-inner strong {
  font-size: 0.85rem;
}

.voice-audio-unlock-inner span {
  color: var(--text-muted);
  flex: 1;
}

.voice-participants {
  flex: 1 1 0;
  min-height: 200px;
  display: grid;
  gap: 0.65rem;
  padding: 0.65rem;
  align-content: center;
  overflow: hidden;
}

.voice-participants .chat-loading {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  color: var(--text-muted);
}

/* Auto-resizing grid (2+ people, no focus) */
.voice-participants:not(.voice-participants-theatre) {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  grid-auto-rows: minmax(min(150px, 26vh), 1fr);
}

.voice-participants-solo:not(.voice-participants-theatre) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-participants-solo:not(.voice-participants-theatre) .voice-tile {
  width: min(100%, 440px);
  height: auto;
  min-height: 200px;
  max-height: min(58vh, 500px);
  aspect-ratio: 16 / 10;
  flex: 0 1 auto;
}

.voice-tile-solo-hint {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

/* Voice tiles - fill their grid cell entirely */
.voice-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-participants-video:not(.voice-participants-theatre) .voice-tile[data-has-video="true"] {
  aspect-ratio: 16 / 9;
  height: auto;
}

.voice-tile-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* Local camera preview only — corrects mirrored selfie view (others still see normal feed) */
.voice-tile-video.voice-tile-video--flip {
  transform: scaleX(-1);
}

.voice-video-settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.65);
}

.voice-video-settings-backdrop[hidden] {
  display: none !important;
}

.voice-video-settings-modal {
  width: min(100%, 22rem);
  padding: 1.25rem 1.35rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.voice-video-settings-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.voice-video-settings-hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted, #8b9aab);
  line-height: 1.4;
}

.voice-video-settings-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.voice-video-settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.voice-video-settings-field--check {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 500;
  cursor: pointer;
}

.voice-video-settings-field--check input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.voice-video-settings-field--check small {
  display: block;
  font-weight: 400;
  color: var(--text-muted, #8b9aab);
  margin-top: 0.15rem;
}

.voice-video-settings-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.voice-video-settings-select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg, #0d1117);
  color: var(--text);
  font: inherit;
}

.voice-video-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.voice-tile-avatar {
  width: clamp(48px, 15vw, 96px);
  height: clamp(48px, 15vw, 96px);
  font-size: clamp(1.25rem, 5vw, 2.5rem);
  border-radius: 50%;
  background: var(--teal-subtle);
  color: var(--teal);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.voice-tile-clickable {
  cursor: pointer;
}

.voice-tile-clickable:hover {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* Theatre mode: large stage + filmstrip (click a tile to focus) */
.voice-participants.voice-participants-theatre {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 240px;
}

.voice-participants-theatre .voice-tile-stage {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #0a0c10;
}

.voice-participants-theatre .voice-tile-stage .voice-tile-video {
  object-fit: contain;
}

.voice-participants-theatre .voice-tile-stage .voice-tile-avatar {
  width: clamp(88px, 16vw, 152px);
  height: clamp(88px, 16vw, 152px);
  font-size: clamp(2rem, 6vw, 3rem);
  border-radius: 20px;
}

.voice-stage-filmstrip {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  flex-shrink: 0;
  overflow-x: auto;
  padding: 0.15rem 0 0.25rem;
  justify-content: center;
  scrollbar-width: thin;
}

.voice-stage-filmstrip .voice-tile-thumb {
  width: 148px;
  min-width: 120px;
  height: 84px;
  flex-shrink: 0;
  aspect-ratio: 16 / 9;
}

.voice-stage-filmstrip .voice-tile-thumb .voice-tile-avatar {
  width: 40px;
  height: 40px;
  font-size: 1rem;
  border-radius: 10px;
}

.voice-stage-filmstrip .voice-tile-thumb .voice-tile-name {
  font-size: 0.72rem;
  padding: 0.25rem 0.4rem;
}

.voice-tile-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
}

/* Audio-only tiles — card layout in grid, compact in filmstrip */
.voice-participants:not(.voice-participants-video):not(.voice-participants-theatre) .voice-tile {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.75rem;
  gap: 0.5rem;
  text-align: center;
}

.voice-participants:not(.voice-participants-video) .voice-tile .voice-tile-name {
  position: static;
  background: none;
  color: var(--text);
}

.voice-participants:not(.voice-participants-video) .voice-tile .voice-tile-video {
  display: none;
}

.voice-participants-theatre:not(.voice-participants-video) .voice-tile-stage {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.voice-participants-theatre:not(.voice-participants-video) .voice-tile-thumb {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 0.45rem 0.55rem;
  gap: 0.45rem;
}

.voice-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.voice-mic-select {
  padding: 0.5rem 0.75rem;
  font-family: var(--font);
  font-size: 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  max-width: 180px;
}

.voice-mic-select:focus {
  outline: none;
  border-color: var(--teal);
}

.voice-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.voice-btn:hover {
  background: var(--teal-subtle);
  border-color: var(--teal);
  color: var(--teal);
}

.voice-btn-mute.voice-muted .voice-btn-icon {
  opacity: 0.6;
}

.voice-btn-leave.btn-danger:hover {
  background: rgba(248, 113, 113, 0.15);
  border-color: rgba(248, 113, 113, 0.5);
  color: #f87171;
}

/* Settings overlay (in-chat modal) */
.settings-overlay {
  align-items: stretch;
  justify-content: center;
  padding: 1rem;
  z-index: 1200;
}

.settings-overlay:not(.is-open) {
  display: none !important;
}

.settings-overlay.is-open {
  display: flex !important;
}

body.settings-overlay-open {
  overflow: hidden;
}

.settings-overlay-inner {
  position: relative;
  width: 100%;
  max-width: min(720px, 96vw);
  height: min(88vh, 780px);
  max-height: calc(100dvh - 2rem);
  min-height: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.settings-overlay-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 10;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg-mid);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-overlay-close:hover {
  background: var(--teal-subtle);
  color: var(--teal);
}

.settings-overlay-close:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.settings-overlay-iframe {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  display: block;
  background: var(--bg-card);
}

@media (max-width: 640px) {
  .settings-overlay {
    padding: 0;
    align-items: stretch;
  }
  .settings-overlay-inner {
    max-width: none;
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    min-height: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .settings-overlay-close {
    top: 0.5rem;
    right: 0.5rem;
  }
}

.channel-hash {
  font-weight: 600;
  color: var(--text-muted);
}

.channel-icon {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.voice-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  margin: 0 0.4rem 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-shrink: 0;
}

.voice-status-bar[hidden] {
  display: none !important;
}

.voice-status-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.voice-status-bar:not([hidden]) .voice-status-info {
  cursor: pointer;
  border-radius: 6px;
  padding: 0.15rem 0.25rem;
  margin: -0.15rem -0.25rem;
  transition: background 0.12s ease;
}

.voice-status-bar:not([hidden]) .voice-status-info:hover {
  background: var(--teal-subtle);
}

.voice-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  animation: voice-pulse 1.5s ease-in-out infinite;
}

@keyframes voice-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.voice-status-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-status-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.voice-status-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-soft);
  transition: background 0.15s ease, color 0.15s ease;
}

.voice-status-btn:hover {
  background: var(--teal-subtle);
  color: var(--text);
}

.voice-status-btn.voice-status-leave:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.voice-status-btn.voice-status-active {
  color: var(--teal);
  background: var(--teal-subtle);
}

.chat-user-footer {
  border-top: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
}

.chat-user-footer-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.chat-user-footer-row .chat-user-info {
  flex: 1;
  min-width: 0;
}

.chat-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.chat-theme-quick {
  display: flex;
  gap: 0.2rem;
}

.chat-theme-quick-btn {
  border: 1px solid var(--chat-border, var(--border));
  background: var(--chat-bg-hover, var(--bg-card-hover));
  color: var(--chat-text-soft, var(--text-soft));
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.2;
}

.chat-theme-quick-btn:hover {
  color: var(--chat-text, var(--text));
  border-color: var(--chat-accent, var(--teal));
}

.chat-theme-quick-btn.is-active {
  background: var(--chat-accent, var(--teal));
  border-color: var(--chat-accent, var(--teal));
  color: var(--chat-bg-deep, #06090c);
}

.chat-footer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--chat-text-soft, var(--text-soft));
  cursor: pointer;
}

.chat-footer-btn:hover {
  background: var(--chat-bg-hover, var(--teal-subtle));
  color: var(--chat-text, var(--text));
}

.chat-footer-btn .icon {
  width: 18px;
  height: 18px;
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.25rem 0;
}
.chat-user-info:hover {
  background: var(--teal-subtle);
}

.avatar-mini {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.chat-user-meta {
  display: flex;
  flex-direction: column;
}

.chat-user-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.chat-user-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-main {
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.chat-main-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.chat-main-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-main-title h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.chat-main-subtitle {
  margin: 0.3rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.dm-call-btn {
  margin-left: auto;
  padding: 0.35rem 0.5rem;
  border: none;
  border-radius: 6px;
  background: var(--teal-subtle);
  color: var(--teal);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.dm-call-btn:hover {
  background: var(--teal-dim);
  color: var(--bg);
}
.dm-call-btn.dm-call-btn-active {
  background: #f15a68;
  color: #fff;
}
.dm-call-btn .icon {
  width: 18px;
  height: 18px;
}

.dm-incoming-call {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(6, 9, 12, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.dm-incoming-call[hidden] {
  display: none !important;
}
.dm-incoming-call-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  text-align: center;
  max-width: 320px;
  width: 100%;
}
.dm-incoming-call-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 0.75rem;
  background: var(--bg-card-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-soft);
  background-size: cover;
  background-position: center;
}
.dm-incoming-call-name {
  margin: 0 0 0.2rem;
  font-size: 1.1rem;
  font-weight: 600;
}
.dm-incoming-call-label {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.dm-incoming-call-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}
.dm-incoming-call-actions .btn { min-width: 100px; }

.chat-messages {
  flex: 1;
  padding: 1rem 1rem 0.5rem;
  overflow-y: auto;
  min-height: 0;
  max-height: 100%;
}

/* Chat message layout tokens */
body.chat-page .chat-messages {
  --msg-avatar-size: 36px;
  --msg-avatar-gap: 0.55rem;
}

/* Blob: shared avatar column + one text column for every line */
body.chat-page .chat-messages .message-group {
  display: grid;
  grid-template-columns: var(--msg-avatar-size) minmax(0, 1fr);
  column-gap: var(--msg-avatar-gap);
  row-gap: 0.0625rem;
  margin-bottom: 0.65rem;
}

body.chat-page .chat-messages .message-group:last-child {
  margin-bottom: 0;
}

body.chat-page .chat-messages .message-group > .message {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: start;
  margin: 0;
  padding: 0;
}

body.chat-page .chat-messages .message-group > .message:not(.message-compact) .message-avatar {
  grid-column: 1;
  grid-row: 1;
}

body.chat-page .chat-messages .message-group > .message:not(.message-compact) .message-body {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

body.chat-page .chat-messages .message-group > .message-compact {
  min-height: 0;
}

body.chat-page .chat-messages .message-group > .message-compact .message-body {
  grid-column: 2;
  min-width: 0;
  padding: 0;
  margin: 0;
}

body.chat-page .chat-messages .message-group > .message-compact .message-text {
  line-height: 1.28;
}

/* Fallback when subgrid is unavailable */
@supports not (grid-template-columns: subgrid) {
  body.chat-page .chat-messages .message-group {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
  }

  body.chat-page .chat-messages .message-group > .message {
    display: flex;
    gap: var(--msg-avatar-gap);
  }

  body.chat-page .chat-messages .message-group > .message-compact {
    display: block;
    padding-left: calc(var(--msg-avatar-size) + var(--msg-avatar-gap));
  }
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0;
  padding: 0.08rem 0;
}

.message-avatar {
  flex-shrink: 0;
  width: var(--msg-avatar-size, 36px);
  height: var(--msg-avatar-size, 36px);
  min-width: var(--msg-avatar-size, 36px);
  margin-top: 0;
  border-radius: 999px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-soft);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.message-avatar.bot {
  background: var(--teal-subtle);
  color: var(--teal);
}

.message-compact .message-avatar-hidden {
  display: none;
}

.message-body {
  flex: 1;
  min-width: 0;
  padding-top: 0;
}

.message-header {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  line-height: 1.15;
  margin: 0 0 0.125rem;
  min-height: 0;
  padding: 0;
}

body.chat-page .chat-messages .message-group > .message:not(.message-compact) .message-avatar {
  margin-top: 0.1rem;
}

body.chat-page .chat-messages .message-group > .message:not(.message-compact) .message-header {
  align-items: baseline;
  margin-bottom: 0.125rem;
}

body.chat-page .chat-messages .message-group > .message:not(.message-compact) .message-text {
  margin-top: 0;
}

.message-author {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.message-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.message-text {
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text-soft);
}

.chat-messages .message-text {
  margin-block: 0;
}

.msg-link {
  color: var(--teal);
  word-break: break-all;
}
.msg-link:hover {
  text-decoration: underline;
}

.message-group > .message-compact .msg-embeds {
  margin-top: 0.35rem;
}

.msg-embeds {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.msg-embed-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  max-width: 400px;
  border: 1px solid var(--border);
}
.msg-embed-img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}
.msg-embed-video-wrap {
  border-radius: 8px;
  overflow: hidden;
  max-width: 400px;
  border: 1px solid var(--border);
}
.msg-embed-video {
  display: block;
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
}
.msg-embed-iframe-wrap {
  border-radius: 8px;
  overflow: hidden;
  max-width: 400px;
  max-height: 280px;
  border: 1px solid var(--border);
}
.msg-embed-iframe {
  display: block;
  width: 100%;
  min-width: 280px;
  height: 200px;
  border: none;
}

/* Clickable message author/avatar for profile popover */
.message-avatar,
.message-author {
  cursor: pointer;
}
.message-avatar:hover,
.message-author:hover {
  color: var(--teal);
}

/* Profile card popover (Discord-style) */
body.profile-card-open { overflow: hidden; }

.profile-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
}

.profile-card-dismiss {
  position: fixed;
  inset: 0;
  pointer-events: auto;
  background: transparent;
}

.profile-card-backdrop {
  display: none;
}

.profile-card {
  position: fixed;
  z-index: 1;
  pointer-events: auto;
  width: min(300px, calc(100vw - 20px));
  max-height: min(420px, calc(100vh - 20px));
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: scale(0.96);
  transform-origin: top left;
  transition: opacity 0.15s ease, transform 0.18s ease;
}

.profile-card--popover {
  top: 0;
  left: 0;
}

.profile-card--ready {
  opacity: 1;
  transform: scale(1);
}

.profile-card-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 5;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-card-close:hover {
  background: rgba(0, 0, 0, 0.6);
}

.profile-card-banner {
  height: 60px;
  background: linear-gradient(135deg, var(--profile-accent, #40dbf1) 0%, rgba(64, 219, 241, 0.35) 55%, var(--bg-mid) 100%);
  border-radius: 14px 14px 0 0;
}

.profile-card-avatar-wrap {
  margin-top: -32px;
  padding: 0 1rem;
}

.profile-card-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  background: var(--bg-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-soft);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.profile-card-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-card-body {
  padding: 0.65rem 1rem 1rem;
}

.profile-card-status {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  color: var(--text-soft);
  font-style: italic;
}

.profile-card-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
}

.profile-card-username {
  margin: 0.1rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.profile-card-pronouns {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--teal);
}

.profile-card-section {
  margin-top: 0.65rem;
}

.profile-card-section h3 {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.profile-card-bio {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-soft);
  white-space: pre-wrap;
  max-height: 4.5em;
  overflow: hidden;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.profile-card-member {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.profile-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.profile-card-actions .btn {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  padding: 0.45rem 0.65rem;
}

.profile-card-error {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.profile-card-loading {
  padding: 2rem 1rem;
}

.message-avatar,
.message-author {
  cursor: pointer;
}

.message-avatar:hover,
.message-author:hover {
  opacity: 0.88;
}

.avatar-edit-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.avatar-edit-actions input[type="file"] {
  font-size: 0.85rem;
}

input[type="color"]#profile-accent {
  width: 100%;
  max-width: 120px;
  height: 42px;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-mid);
  cursor: pointer;
}

/* Legacy profile popover (unused) */
.profile-popover {
  position: fixed;
  z-index: 1000;
  min-width: 220px;
  max-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  padding: 1rem;
  animation: profile-popover-in 0.15s ease;
}
@keyframes profile-popover-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-popover-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-soft);
  margin: 0 auto 0.6rem;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.profile-popover-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin: 0 0 0.15rem;
}

.profile-popover-username {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 0.75rem;
}

.profile-popover-bio {
  font-size: 0.875rem;
  color: var(--text-soft);
  line-height: 1.45;
  margin: 0 0 0.75rem;
  max-height: 3.6em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}

.profile-popover-actions {
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
  margin-top: 0.25rem;
}

.profile-popover-actions a,
.profile-popover-actions button {
  display: block;
  width: 100%;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--teal);
  text-align: center;
  padding: 0.35rem 0;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font);
}
.profile-popover-actions a:hover,
.profile-popover-actions button:hover {
  background: var(--teal-subtle);
  color: var(--teal-bright);
}

.dm-pill {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  background: var(--bg-mid);
  color: var(--text-soft);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.dm-pill:hover {
  background: var(--teal-subtle);
  color: var(--teal);
  transform: translateY(-1px);
}

.dm-pill.dm-pill-active {
  background: var(--teal);
  color: #ffffff;
}

.dm-pill-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #eb459e;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--bg-dark);
}

.dm-sidebar-empty {
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  text-align: left;
}

/* DM list in sidebar */
.dm-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.dm-tab {
  flex: 1;
  padding: 0.5rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.dm-tab:hover {
  color: var(--text-soft);
}
.dm-tab.dm-tab-active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}
.dm-friends-add {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.dm-friends-input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  font-size: 0.875rem;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}
.dm-friends-input::placeholder {
  color: var(--text-muted);
}
.dm-friends-request {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.dm-friends-request:hover {
  background: var(--teal-subtle);
}
.dm-friends-request > div {
  display: flex;
  gap: 0.35rem;
}

.dm-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.5rem 0.2rem;
}

.dm-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.8rem;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  min-width: 0;
}

.dm-item span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-item:hover {
  background: var(--teal-subtle);
  color: var(--text);
}

.dm-item.dm-item-active {
  background: var(--teal-subtle);
  color: var(--teal);
}

.dm-item-avatar {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  background: var(--bg-mid);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-soft);
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

/* Zone settings modal tabs */
.modal-tabs {
  display: flex;
  gap: 0;
  margin: -0.5rem -2rem 1.25rem;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.modal-tab {
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.modal-tab:hover {
  color: var(--text);
}

.modal-tab.modal-tab-active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.zone-settings-list {
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-mid);
}

.btn-add {
  width: 100%;
  justify-content: center;
}

.role-color-picker {
  margin-bottom: 1rem;
}

.zone-settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
}

.zone-settings-item:last-child {
  border-bottom: none;
}

.zone-settings-item:hover {
  background: var(--teal-subtle);
}

.zone-settings-item-actions {
  display: flex;
  gap: 0.25rem;
}

.zone-settings-item-actions button {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-soft);
  transition: background 0.15s ease, color 0.15s ease;
}

.zone-settings-item-actions button:hover {
  background: var(--teal-subtle);
  color: var(--teal);
}

.zone-settings-item-actions button.danger {
  color: var(--text-muted);
}

.zone-settings-item-actions button.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.role-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}

.perm-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0.75rem 0;
}

.role-assign-grid {
  margin-bottom: 1rem;
}

.perm-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  cursor: pointer;
}

.perm-check input {
  margin: 0;
}

.zone-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.2rem;
  gap: 1rem;
}

.zone-member-row:hover {
  background: var(--teal-subtle);
}

.member-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-mid);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.member-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.member-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.owner-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--teal);
  margin-left: 0.25rem;
}

.member-actions {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.member-action {
  padding: 0.35rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-soft);
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s ease, color 0.15s ease;
}

.member-action:hover {
  background: var(--teal-subtle);
  color: var(--teal);
}

.member-action.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.zone-members-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-mid);
}

#zone-settings-content .modal-section-title {
  margin-bottom: 0.75rem;
}

.chat-input-bar {
  padding: 0.5rem 1rem 0.85rem;
  border-top: 1px solid var(--border);
}

.chat-input-wrap {
  position: relative;
}

.mention-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  min-width: 220px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  padding: 0.25rem;
  z-index: 50;
  display: none;
}

.mention-dropdown.open {
  display: block;
}

.mention-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  background: none;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s ease, color 0.12s ease;
}

.mention-item:hover,
.mention-item.mention-item-active {
  background: var(--teal-subtle);
  color: var(--teal);
}

.mention-username {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.message-text .mention {
  color: var(--teal);
  font-weight: 500;
  background: var(--teal-subtle);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

.chat-input-inner {
  display: flex;
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-mid);
  padding: 0.7rem 1rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-input:focus {
  border-color: var(--teal);
}

.chat-send-btn {
  padding-inline: 1.25rem;
}

.chat-input-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-loading {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Full-screen boot loader (one Lumi animation on first open) */
.clyr-boot-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  padding:
    max(1.5rem, env(safe-area-inset-top))
    max(1.25rem, env(safe-area-inset-right))
    max(2.5rem, env(safe-area-inset-bottom))
    max(1.25rem, env(safe-area-inset-left));
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, rgba(88, 101, 242, 0.22), transparent 58%),
    radial-gradient(ellipse 90% 60% at 85% 20%, rgba(235, 69, 158, 0.08), transparent 50%),
    radial-gradient(ellipse 80% 55% at 10% 30%, rgba(64, 219, 241, 0.14), transparent 48%),
    radial-gradient(ellipse 100% 40% at 50% 100%, rgba(64, 219, 241, 0.1), transparent 55%),
    linear-gradient(180deg, #0c1224 0%, #080b14 42%, #06090c 100%);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.clyr-boot-screen--hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.chat-page.clyr-boot-active .chat-layout {
  visibility: hidden;
  pointer-events: none;
}

.clyr-boot-sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.clyr-boot-lumi {
  position: relative;
  z-index: 2;
  width: min(94vw, 620px);
  max-height: min(62vh, 620px);
  height: auto;
  object-fit: contain;
  object-position: center bottom;
  margin-bottom: clamp(0.75rem, 3vh, 1.75rem);
  transform-origin: center bottom;
  animation: clyr-lumi-sway 2.8s ease-in-out infinite;
  filter: drop-shadow(0 16px 48px rgba(0, 0, 0, 0.45));
  user-select: none;
  -webkit-user-drag: none;
}

.clyr-boot-status {
  position: relative;
  z-index: 3;
  margin: 0;
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
  font-weight: 500;
  color: var(--text-soft);
  letter-spacing: 0.02em;
  text-align: center;
}

/* Stars + shooting stars span the whole viewport on boot */
.clyr-boot-screen .clyr-star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.5);
  opacity: 0.35;
  animation: clyr-star-twinkle 3s ease-in-out infinite;
}

.clyr-boot-screen .clyr-star--1 { top: 8%; left: 18%; animation-delay: 0s; }
.clyr-boot-screen .clyr-star--2 { top: 14%; left: 72%; width: 2px; height: 2px; animation-delay: 0.7s; }
.clyr-boot-screen .clyr-star--3 { top: 22%; left: 44%; width: 2px; height: 2px; animation-delay: 1.4s; }
.clyr-boot-screen .clyr-star--4 { top: 6%; left: 58%; animation-delay: 2s; opacity: 0.5; }
.clyr-boot-screen .clyr-star--5 { top: 18%; left: 88%; width: 2px; height: 2px; animation-delay: 0.3s; }
.clyr-boot-screen .clyr-star--6 { top: 32%; left: 12%; width: 2px; height: 2px; animation-delay: 1.8s; opacity: 0.28; }
.clyr-boot-screen .clyr-star--7 { top: 28%; left: 92%; animation-delay: 2.4s; opacity: 0.4; }

/* Shooting stars — Yusuke Nakaya / CodePen XyOaBj pattern */
.clyr-shooting-stars-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform: rotateZ(45deg);
  pointer-events: none;
  z-index: 1;
}

.clyr-shooting-star {
  --shoot-duration: 6s;
  position: absolute;
  left: 50%;
  top: 50%;
  height: 2px;
  width: 0;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(-45deg, rgba(140, 210, 255, 1), rgba(64, 219, 241, 0));
  filter: drop-shadow(0 0 6px rgba(100, 200, 255, 0.9));
  animation:
    clyr-star-tail var(--shoot-duration) ease-in-out infinite,
    clyr-star-shoot var(--shoot-duration) ease-in-out infinite;
}

.clyr-shooting-star::before,
.clyr-shooting-star::after {
  content: "";
  position: absolute;
  top: calc(50% - 1px);
  right: 0;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(-45deg, transparent, rgba(140, 210, 255, 1), transparent);
  animation: clyr-star-shine var(--shoot-duration) ease-in-out infinite;
}

.clyr-shooting-star::before {
  transform: translateX(50%) rotateZ(45deg);
}

.clyr-shooting-star::after {
  transform: translateX(50%) rotateZ(-45deg);
}

.clyr-boot-sky .clyr-shooting-stars-field .clyr-shooting-star:nth-child(1) {
  top: calc(50% - 160px);
  left: calc(50% - 120px);
  --shoot-duration: 6s;
  animation-delay: 1.2s;
}

.clyr-boot-sky .clyr-shooting-stars-field .clyr-shooting-star:nth-child(2) {
  top: calc(50% - 60px);
  left: calc(50% + 40px);
  --shoot-duration: 7s;
  animation-delay: 4.5s;
  background: linear-gradient(-45deg, rgba(200, 180, 255, 1), rgba(167, 139, 250, 0));
  filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.85));
}

.clyr-boot-sky .clyr-shooting-stars-field .clyr-shooting-star:nth-child(3) {
  top: calc(50% + 80px);
  left: calc(50% - 40px);
  --shoot-duration: 5.5s;
  animation-delay: 8s;
}

.clyr-boot-sky .clyr-shooting-stars-field .clyr-shooting-star:nth-child(4) {
  top: calc(50% - 20px);
  left: calc(50% - 180px);
  --shoot-duration: 6.5s;
  animation-delay: 11.5s;
  background: linear-gradient(-45deg, rgba(255, 220, 180, 1), rgba(255, 160, 80, 0));
  filter: drop-shadow(0 0 6px rgba(255, 180, 100, 0.75));
}

.clyr-boot-sky .clyr-shooting-stars-field .clyr-shooting-star:nth-child(1)::before,
.clyr-boot-sky .clyr-shooting-stars-field .clyr-shooting-star:nth-child(1)::after {
  animation-delay: 1.2s;
}

.clyr-boot-sky .clyr-shooting-stars-field .clyr-shooting-star:nth-child(2)::before,
.clyr-boot-sky .clyr-shooting-stars-field .clyr-shooting-star:nth-child(2)::after {
  animation-delay: 4.5s;
}

.clyr-boot-sky .clyr-shooting-stars-field .clyr-shooting-star:nth-child(3)::before,
.clyr-boot-sky .clyr-shooting-stars-field .clyr-shooting-star:nth-child(3)::after {
  animation-delay: 8s;
}

.clyr-boot-sky .clyr-shooting-stars-field .clyr-shooting-star:nth-child(4)::before,
.clyr-boot-sky .clyr-shooting-stars-field .clyr-shooting-star:nth-child(4)::after {
  animation-delay: 11.5s;
}

@keyframes clyr-star-tail {
  0%, 100% {
    width: 0;
    opacity: 0;
  }
  4% {
    opacity: 1;
  }
  22% {
    width: min(24vw, 180px);
    opacity: 1;
  }
  32% {
    width: 0;
    opacity: 0;
  }
}

@keyframes clyr-star-shoot {
  0%, 100% {
    transform: translateX(0);
    opacity: 0;
  }
  4% {
    opacity: 1;
  }
  32% {
    transform: translateX(min(48vw, 360px));
    opacity: 0;
  }
}

@keyframes clyr-star-shine {
  0%, 100% {
    width: 0;
  }
  50% {
    width: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .clyr-boot-lumi,
  .clyr-boot-screen .clyr-shooting-star,
  .clyr-boot-screen .clyr-star {
    animation: none !important;
  }
}

/* Lumi sky loader (inline — kept for helper reuse) */
.clyr-lumi-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  min-height: min(52vh, 420px);
  text-align: center;
}

.clyr-lumi-loader--compact {
  min-height: 220px;
  padding: 1.5rem 1rem;
}

.clyr-lumi-loader--mini {
  min-height: 0;
  padding: 1.25rem 0.5rem;
  gap: 0.5rem;
}

.clyr-lumi-loader-sky {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(64, 219, 241, 0.12), transparent 70%),
    radial-gradient(circle at 20% 15%, rgba(88, 101, 242, 0.18), transparent 45%),
    radial-gradient(circle at 80% 25%, rgba(235, 69, 158, 0.08), transparent 40%),
    linear-gradient(180deg, #0a1020 0%, #06090c 55%, #040608 100%);
  box-shadow: inset 0 0 0 1px rgba(64, 219, 241, 0.08);
}

.clyr-lumi-loader--compact .clyr-lumi-loader-sky {
  width: min(100%, 240px);
  border-radius: 16px;
}

.clyr-lumi-loader--mini .clyr-lumi-loader-sky {
  width: min(100%, 160px);
  aspect-ratio: 1 / 1;
  border-radius: 14px;
}

.clyr-lumi-loader-img {
  position: relative;
  z-index: 2;
  width: 78%;
  max-width: 240px;
  height: auto;
  object-fit: contain;
  object-position: center bottom;
  transform-origin: center bottom;
  animation: clyr-lumi-sway 2.8s ease-in-out infinite;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
  user-select: none;
  -webkit-user-drag: none;
}

.clyr-lumi-loader--compact .clyr-lumi-loader-img {
  max-width: 180px;
}

.clyr-lumi-loader--mini .clyr-lumi-loader-img {
  max-width: 120px;
  animation-duration: 3.2s;
}

.clyr-lumi-loader-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-soft);
  letter-spacing: 0.01em;
}

.clyr-lumi-loader--mini .clyr-lumi-loader-text {
  font-size: 0.8rem;
}

.clyr-star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.55);
  opacity: 0.35;
  animation: clyr-star-twinkle 3s ease-in-out infinite;
}

.clyr-star--1 { top: 18%; left: 22%; animation-delay: 0s; }
.clyr-star--2 { top: 28%; left: 68%; width: 2px; height: 2px; animation-delay: 0.8s; }
.clyr-star--3 { top: 12%; left: 48%; width: 2px; height: 2px; animation-delay: 1.6s; }
.clyr-star--4 { top: 36%; left: 38%; width: 2px; height: 2px; animation-delay: 2.1s; opacity: 0.25; }
.clyr-star--5 { top: 22%; left: 82%; animation-delay: 1.2s; opacity: 0.28; }

/* Inline loader shooting stars */
.clyr-shooting-stars-field--inline {
  inset: 0;
  transform: rotateZ(45deg) scale(0.92);
}

.clyr-shooting-stars-field--inline .clyr-shooting-star {
  --shoot-duration: 5.5s;
}

.clyr-shooting-stars-field--inline .clyr-shooting-star:nth-child(1) {
  top: calc(50% - 36px);
  left: calc(50% - 28px);
  animation-delay: 0.8s;
}

.clyr-shooting-stars-field--inline .clyr-shooting-star:nth-child(2) {
  top: calc(50% + 12px);
  left: calc(50% + 18px);
  animation-delay: 3.6s;
  background: linear-gradient(-45deg, rgba(200, 180, 255, 1), rgba(167, 139, 250, 0));
  filter: drop-shadow(0 0 5px rgba(167, 139, 250, 0.8));
}

.clyr-shooting-stars-field--inline .clyr-shooting-star:nth-child(3) {
  top: calc(50% - 8px);
  left: calc(50% - 52px);
  --shoot-duration: 5s;
  animation-delay: 6.2s;
}

.clyr-shooting-stars-field--inline .clyr-shooting-star:nth-child(1)::before,
.clyr-shooting-stars-field--inline .clyr-shooting-star:nth-child(1)::after {
  animation-delay: 0.8s;
}

.clyr-shooting-stars-field--inline .clyr-shooting-star:nth-child(2)::before,
.clyr-shooting-stars-field--inline .clyr-shooting-star:nth-child(2)::after {
  animation-delay: 3.6s;
}

.clyr-shooting-stars-field--inline .clyr-shooting-star:nth-child(3)::before,
.clyr-shooting-stars-field--inline .clyr-shooting-star:nth-child(3)::after {
  animation-delay: 6.2s;
}

.clyr-shooting-stars-field--inline .clyr-shooting-star:nth-child(n)::before,
.clyr-shooting-stars-field--inline .clyr-shooting-star:nth-child(n)::after {
  animation-name: clyr-star-shine-inline;
}

.clyr-shooting-stars-field--inline .clyr-shooting-star:nth-child(n) {
  animation-name: clyr-star-tail-inline, clyr-star-shoot-inline;
}

@keyframes clyr-star-tail-inline {
  0%, 100% { width: 0; opacity: 0; }
  4% { opacity: 1; }
  22% { width: 72px; opacity: 1; }
  32% { width: 0; opacity: 0; }
}

@keyframes clyr-star-shoot-inline {
  0%, 100% { transform: translateX(0); opacity: 0; }
  4% { opacity: 1; }
  32% { transform: translateX(140px); opacity: 0; }
}

@keyframes clyr-star-shine-inline {
  0%, 100% { width: 0; }
  50% { width: 18px; }
}

.clyr-lumi-loader--compact .clyr-shooting-stars-field--inline .clyr-shooting-star:nth-child(n) {
  animation-name: clyr-star-tail-inline-sm, clyr-star-shoot-inline-sm;
}

@keyframes clyr-star-tail-inline-sm {
  0%, 100% { width: 0; opacity: 0; }
  4% { opacity: 1; }
  22% { width: 56px; opacity: 1; }
  32% { width: 0; opacity: 0; }
}

@keyframes clyr-star-shoot-inline-sm {
  0%, 100% { transform: translateX(0); opacity: 0; }
  4% { opacity: 1; }
  32% { transform: translateX(110px); opacity: 0; }
}

.clyr-lumi-loader--mini .clyr-shooting-stars-field--inline .clyr-shooting-star:nth-child(3) {
  display: none;
}

@keyframes clyr-lumi-sway {
  0%, 100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  35% {
    transform: translateY(-5px) rotate(1.2deg) scale(1.01);
  }
  70% {
    transform: translateY(-2px) rotate(-0.8deg) scale(1);
  }
}

@keyframes clyr-star-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.85); }
  50% { opacity: 0.9; transform: scale(1.15); }
}

.chat-messages:has(> .clyr-lumi-loader),
.voice-participants:has(> .clyr-lumi-loader) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.zones-list:has(> .clyr-lumi-loader),
.channel-list:has(> .clyr-lumi-loader) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

@media (prefers-reduced-motion: reduce) {
  .clyr-lumi-loader-img,
  .clyr-lumi-loader-sky .clyr-shooting-star,
  .clyr-shooting-stars-field .clyr-shooting-star,
  .clyr-lumi-loader-sky .clyr-star {
    animation: none !important;
  }

  .clyr-lumi-loader-img {
    transform: none;
  }
}

.zone-invite-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.zone-invite-btn:hover {
  background: var(--bg-mid);
  color: var(--text);
}

.chat-zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: modal-overlay-in 0.2s ease;
}

@keyframes modal-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  animation: modal-content-in 0.2s ease;
}

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

.modal-content-wide {
  max-width: 560px;
}

.modal-content h2 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-content h3 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.modal-content .auth-subtitle {
  margin: 0 0 1.25rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.modal-actions .btn-primary:only-of-type {
  margin-left: auto;
}

.modal-section-divider {
  margin: 1.5rem 0;
  border: none;
  height: 1px;
  background: var(--border);
}

.modal-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  margin: 0 0 0.5rem;
}

.modal-content select {
  width: 100%;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239aabbb' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.modal-content select:focus {
  border-color: var(--teal);
}

.modal-content input[type="file"] {
  font-size: 0.85rem;
  color: var(--text-soft);
  padding: 0.35rem 0;
}

.modal-content input[type="file"]::file-selector-button {
  padding: 0.4rem 0.75rem;
  margin-right: 0.75rem;
  font-family: var(--font);
  font-size: 0.85rem;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.modal-content input[type="file"]::file-selector-button:hover {
  background: var(--teal-subtle);
  border-color: var(--teal);
}

.modal-content input[type="color"] {
  width: 48px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-mid);
  cursor: pointer;
}

.modal-content input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.modal-content input[type="color"]::-webkit-color-swatch {
  border-radius: 6px;
  border: none;
}

.invite-link-box {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.invite-url-input {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.875rem;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
}

.invite-url-input:focus {
  outline: none;
  border-color: var(--teal);
}

#invite-content .invite-link-box {
  margin: 0 0 0.5rem;
}

#invite-content .auth-field-hint {
  margin: 0;
}

@media (max-width: 900px) {
  body.chat-page .chat-layout {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  body.chat-page .chat-sidebar-main {
    display: none;
  }
}

/* Chat: mobile (<= 640px) */
@media (max-width: 640px) {
  body.chat-page .chat-sidebar-zones {
    flex: 0 0 56px;
  }
  body.chat-page .dm-pill {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
  body.chat-page .chat-zone-header,
  body.chat-page .chat-channel-header {
    padding: 0.75rem 1rem;
    padding-top: max(0.75rem, var(--safe-top));
  }
  body.chat-page .chat-input-bar {
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, var(--safe-bottom));
  }
  body.chat-page .chat-form input,
  body.chat-page .chat-form button {
    min-height: 44px;
  }
  body.chat-page .chat-messages {
    padding: 1rem;
  }
  body.chat-page .modal-overlay .modal-content {
    max-width: 100%;
    max-height: 85vh;
    margin: 1rem;
    margin-bottom: max(1rem, var(--safe-bottom));
  }
}


/* ============================
   CLYR CORE LAYOUT FIX
   ============================ */

html,
body {
  height: 100%;
}

body.chat-page {
  height: 100vh;
  overflow: hidden;
}

/* Root layout (real chat app only — home mocks keep grid from .home-chat-preview rules) */
body.chat-page .chat-layout {
  display: flex;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* Sidebars */
body.chat-page .chat-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

body.chat-page .chat-sidebar-zones {
  flex: 0 0 72px;
}

body.chat-page .chat-sidebar-main {
  flex: 0 0 200px;
}

/* Scrollable lists */
body.chat-page .zones-list,
body.chat-page .channel-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* User footer must NEVER scroll */
body.chat-page .chat-user-footer {
  flex-shrink: 0;
}

/* Main chat column */
body.chat-page .chat-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

/* Chat header stays fixed */
body.chat-page .chat-main-header {
  flex-shrink: 0;
}

/* Messages scroll â€” nothing else */
body.chat-page .chat-messages {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Input bar locked to bottom */
body.chat-page .chat-input-bar {
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: inherit;
}

/* Prevent flex overflow bugs (Chrome/Safari fix) */
body.chat-page .chat-sidebar *,
body.chat-page .chat-main * {
  min-height: 0;
}

/* ---- Trust & Safety panel ---- */
body.ts-page {
  min-height: 100vh;
}
.ts-page .ts-main {
  min-height: 100vh;
  padding: 5.75rem 1.5rem 3rem;
  box-sizing: border-box;
}
.ts-page .ts-loading,
.ts-page .ts-denied {
  max-width: 480px;
  margin: 2rem auto 4rem;
  text-align: center;
  color: var(--text-muted);
}
.ts-page .ts-denied h2 { margin-bottom: 0.5rem; }
.ts-page .ts-app {
  display: grid;
  grid-template-columns: minmax(220px, 260px) 1fr;
  gap: 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
  align-items: start;
}
.ts-page .ts-sidebar {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.25rem;
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 6.5rem);
  overflow-y: auto;
}
.ts-sidebar-head h1 {
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
}
.ts-role-badge {
  font-size: 0.8rem;
  color: var(--accent, #a78bfa);
  margin: 0 0 1rem;
}
.ts-nav { display: flex; flex-direction: column; gap: 0.35rem; }
.ts-nav-btn {
  font-family: var(--font);
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ts-nav-btn:hover, .ts-nav-btn.active {
  background: rgba(167, 139, 250, 0.15);
  color: var(--text);
}
.ts-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.5rem;
  min-height: 520px;
}
.ts-panel h2 { margin: 0 0 1rem; font-size: 1.35rem; }
.ts-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.ts-stat-card {
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.ts-stat-value { display: block; font-size: 1.75rem; font-weight: 700; }
.ts-stat-label { font-size: 0.8rem; color: var(--text-muted); }
.ts-stat-urgent .ts-stat-value { color: #f87171; }
.ts-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.ts-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.ts-filters select {
  font-family: var(--font);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}
.ts-report-list { display: flex; flex-direction: column; gap: 0.65rem; }
.ts-report-card {
  position: relative;
  padding: 0.85rem 1rem 0.85rem 2rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ts-report-merge-cb { position: absolute; left: 0.65rem; top: 1rem; }
.ts-report-card:hover {
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.06);
}
.ts-report-card h3 { margin: 0.35rem 0; font-size: 0.95rem; }
.ts-report-card-top { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ts-priority, .ts-status {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-weight: 600;
}
.ts-priority-urgent { background: rgba(248, 113, 113, 0.2); color: #fca5a5; }
.ts-priority-high { background: rgba(251, 191, 36, 0.2); color: #fcd34d; }
.ts-priority-normal { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.ts-status-open, .ts-status-triage { background: rgba(96, 165, 250, 0.2); color: #93c5fd; }
.ts-status-investigating { background: rgba(167, 139, 250, 0.2); color: #c4b5fd; }
.ts-status-escalated { background: rgba(251, 146, 60, 0.2); color: #fdba74; }
.ts-status-action_taken { background: rgba(74, 222, 128, 0.15); color: #86efac; }
.ts-status-dismissed { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.ts-report-meta { font-size: 0.8rem; color: var(--text-muted); margin: 0.2rem 0; }
.ts-empty, .ts-loading-inline { color: var(--text-muted); font-size: 0.9rem; }
.ts-back-btn {
  font-family: var(--font);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 1rem;
  padding: 0;
}
.ts-back-btn:hover { color: var(--text); }
.ts-detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.ts-detail-badges { display: flex; gap: 0.5rem; }
.ts-detail-section { margin-bottom: 1.5rem; }
.ts-detail-section h3 { font-size: 0.95rem; margin: 0 0 0.65rem; color: var(--text-muted); }
.ts-target-msg {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid rgba(167, 139, 250, 0.5);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.ts-evidence-dl {
  display: grid;
  grid-template-columns: minmax(7rem, auto) 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
  font-size: 0.88rem;
}
.ts-evidence-dl dt { color: var(--text-muted); margin: 0; }
.ts-evidence-dl dd { margin: 0; word-break: break-word; }
.ts-evidence-notes { white-space: pre-wrap; }
.ts-evidence-user-card {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.ts-evidence-card-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}
.ts-evidence-user-name { margin: 0 0 0.35rem; }
.ts-evidence-bio { margin: 0.5rem 0 0; font-size: 0.88rem; white-space: pre-wrap; }
.ts-evidence-warn {
  font-size: 0.82rem;
  color: #fbbf24;
  margin: 0 0 0.5rem;
}
.ts-evidence-msg { max-height: 20rem; overflow: auto; }
.ts-message-thread {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 24rem;
  overflow: auto;
}
.ts-thread-msg {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
}
.ts-thread-msg-target {
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.08);
}
.ts-thread-msg-head { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.ts-thread-msg-text { margin: 0; white-space: pre-wrap; word-break: break-word; }
.ts-evidence-raw summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  user-select: none;
}
.ts-evidence-pre {
  margin: 0.65rem 0 0;
  padding: 0.75rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 0.72rem;
  overflow: auto;
  max-height: 16rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.ts-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent, #40dbf1);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}
.ts-report-excerpt {
  margin: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--text);
  opacity: 0.92;
}
.ts-action-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.ts-action-danger { background: rgba(248, 113, 113, 0.25) !important; border-color: rgba(248, 113, 113, 0.4) !important; }
.ts-status-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.ts-notes { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 0.75rem; }
.ts-note {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.ts-note-head { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.ts-note-form textarea {
  width: 100%;
  font-family: var(--font);
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  margin-bottom: 0.5rem;
  resize: vertical;
}
.ts-search-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.ts-search-row input {
  flex: 1;
  font-family: var(--font);
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}
.ts-user-result {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.35rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
}
.ts-user-result span { color: var(--text-muted); font-size: 0.85rem; }
.ts-user-result:hover { border-color: rgba(167, 139, 250, 0.35); }
.ts-muted { color: var(--text-muted); font-weight: 400; }
.ts-sanction-list, .ts-history-list { font-size: 0.85rem; padding-left: 1.2rem; }
.ts-lift-btn {
  font-family: var(--font);
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.ts-audit-row {
  display: grid;
  grid-template-columns: 120px 1fr 140px 160px;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
}
.ts-audit-action { font-weight: 600; }
.ts-audit-time { color: var(--text-muted); text-align: right; }
.ts-staff-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.ts-staff-table th, .ts-staff-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}
.ts-hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.ts-hint a { color: var(--accent, #a78bfa); }

/* Admin hub tabs + staff management */
.admin-hub-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.admin-hub-tab {
  font-family: var(--font);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.admin-hub-tab.active {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.35);
  color: var(--text);
}
.staff-grant-form {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 1.5rem;
}
.staff-grant-form h3 { margin: 0 0 0.75rem; font-size: 1rem; }
.staff-grant-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; align-items: center; }
.staff-grant-row input, .staff-grant-row select {
  font-family: var(--font);
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}
.staff-roster-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.5rem;
}
.staff-roster-role {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
}

/* Chat report UI */
.message { position: relative; }
.message-report-btn {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  opacity: 0;
  font-family: var(--font);
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-muted);
  cursor: pointer;
  transition: opacity 0.15s;
}
.message:hover .message-report-btn { opacity: 1; }
.report-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.report-modal {
  width: 100%;
  max-width: 420px;
  background: #1a1a24;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.25rem;
}
.report-modal h3 { margin: 0 0 1rem; }
.report-modal-preview {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
}
.report-preview-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}
.report-preview-title { margin: 0; font-weight: 600; }
.report-preview-meta { margin: 0.2rem 0; color: var(--text-muted); font-size: 0.82rem; }
.report-preview-bio { margin: 0.35rem 0 0; font-size: 0.85rem; white-space: pre-wrap; }
.report-preview-msg {
  margin: 0.5rem 0 0;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid rgba(167, 139, 250, 0.4);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.report-preview-context { margin: 0.5rem 0 0; font-size: 0.78rem; color: var(--text-muted); }
.report-modal label { display: block; font-size: 0.85rem; margin-bottom: 0.35rem; color: var(--text-muted); }
.report-modal select, .report-modal textarea {
  width: 100%;
  font-family: var(--font);
  padding: 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  margin-bottom: 0.75rem;
}
.report-modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.profile-popover-report-btn {
  font-family: var(--font);
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.1);
  color: #fca5a5;
  cursor: pointer;
  width: 100%;
  margin-top: 0.35rem;
}

@media (max-width: 768px) {
  .ts-page .ts-main { padding: 5rem 1rem 2rem; }
  .ts-page .ts-app { grid-template-columns: 1fr; }
  .ts-page .ts-sidebar { position: static; max-height: none; }
  .ts-audit-row { grid-template-columns: 1fr 1fr; }
  .ts-audit-time { grid-column: 1 / -1; text-align: left; }
}

/* T&S user admin tools */
.ts-user-profile-card {
  margin-top: 1.25rem;
  padding: 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}
.ts-user-profile-card h4 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.ts-user-profile-card + .ts-user-profile-card { margin-top: 1rem; }
.ts-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.65rem;
}
.ts-admin-field label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.ts-admin-field input,
.ts-admin-field select {
  width: 100%;
  font-family: var(--font);
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  box-sizing: border-box;
}
.ts-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.ts-feature-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.ts-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.ts-admin-actions .btn { font-size: 0.82rem; padding: 0.45rem 0.75rem; }
.ts-temp-pw {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
  font-family: monospace;
  font-size: 0.9rem;
  word-break: break-all;
}
.ts-restriction-list { list-style: none; padding: 0; margin: 0; }
.ts-restriction-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}

/* Trust score (staff + settings) */
.ts-trust-score-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0.5rem 0;
}
.ts-trust-score {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}
.ts-trust-tier-trusted { color: #4ade80; }
.ts-trust-tier-good { color: #40dbf1; }
.ts-trust-tier-neutral { color: var(--text-muted); }
.ts-trust-tier-low { color: #fbbf24; }
.ts-trust-tier-restricted { color: #f87171; }
.ts-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 18rem;
  overflow: auto;
}
.ts-timeline li {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
}
.ts-timeline-type {
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.settings-reputation { margin-top: 0.5rem; }
.settings-trust-score {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}
.settings-trust-tier-trusted { color: #4ade80; }
.settings-trust-tier-good { color: #40dbf1; }
.settings-trust-tier-neutral { color: var(--text-muted); }
.settings-trust-tier-low { color: #fbbf24; }
.settings-trust-tier-restricted { color: #f87171; }
.settings-reputation-factors {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Platform announcements in chat */
.platform-announcements {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.platform-announcement {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
}
.platform-announcement strong { margin-right: 0.35rem; }
.platform-announcement-info {
  background: rgba(64, 219, 241, 0.12);
  border: 1px solid rgba(64, 219, 241, 0.25);
}
.platform-announcement-warning {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.platform-announcement-critical {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

/* Public status page */
.status-page .status-main {
  max-width: 52rem;
  margin: 0 auto;
  padding: 6rem 1.25rem 3rem;
}
.status-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}
.status-overall {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.status-overall h1 {
  margin: 0;
  font-size: 1.75rem;
}
.status-updated {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0.5rem 0 0;
}
.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot-operational { background: #4ade80; box-shadow: 0 0 8px rgba(74, 222, 128, 0.5); }
.status-dot-degraded { background: #fbbf24; }
.status-dot-partial_outage { background: #fb923c; }
.status-dot-major_outage { background: #f87171; }
.status-dot-maintenance { background: #60a5fa; }
.status-dot-loading { background: var(--text-muted); animation: status-pulse 1.2s ease infinite; }
@keyframes status-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}
.status-section { margin-bottom: 2rem; }
.status-section h2 {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-services {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.status-service {
  padding: 1rem 1.15rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}
.status-service-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.status-service-head h3 { margin: 0; font-size: 1rem; flex: 1; }
.status-service-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.status-service-desc,
.status-service-meta {
  margin: 0.35rem 0 0 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.status-incident,
.status-maintenance-item {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  margin-bottom: 0.75rem;
}
.status-incident h3,
.status-maintenance-item h3 { margin: 0 0 0.35rem; }
.status-incident-meta { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 0.75rem; }
.status-incident-update {
  padding: 0.65rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.88rem;
}
.status-incident-update-head {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.status-history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.status-history-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.88rem;
}
.status-muted { color: var(--text-muted); font-size: 0.9rem; }
.status-loading { color: var(--text-muted); }

/* Status services admin table */
.ts-services-table code.ts-svc-health {
  font-size: 0.75rem;
  word-break: break-all;
}
.ts-svc-order { white-space: nowrap; }
.ts-svc-move {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
  font-size: 0.85rem;
  margin-right: 0.2rem;
}
.ts-svc-move:disabled { opacity: 0.35; cursor: not-allowed; }
.ts-svc-actions { white-space: nowrap; }
.ts-svc-actions .btn { font-size: 0.78rem; padding: 0.35rem 0.55rem; }
.ts-service-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.35rem;
}
.ts-status-service-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Blog — public + staff */
.blog-list-wrap {
  max-width: 52rem;
  margin: 0 auto;
}
.blog-loading,
.blog-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
}
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.blog-card {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.blog-card:hover {
  border-color: rgba(64, 219, 241, 0.35);
  transform: translateY(-2px);
}
.blog-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.blog-card-cover {
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: var(--bg-mid);
}
.blog-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.blog-card-body {
  padding: 1.25rem 1.35rem 1.4rem;
}
.blog-card-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.blog-card-title {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.blog-card-excerpt {
  margin: 0 0 0.65rem;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}
.blog-card-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.blog-article-wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding-top: 5rem;
}
.blog-back {
  margin: 0 0 1.5rem;
  font-size: 0.88rem;
}
.blog-back a { color: var(--teal); text-decoration: none; }
.blog-back a:hover { text-decoration: underline; }
.blog-article-cover {
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  aspect-ratio: 21 / 9;
  background: var(--bg-mid);
}
.blog-article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.blog-article-header time {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.blog-article-header h1 {
  margin: 0.5rem 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.blog-article-deck {
  font-size: 1.05rem;
  color: var(--text-soft);
  line-height: 1.55;
  margin: 0 0 0.75rem;
}
.blog-article-byline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.blog-prose {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-soft);
}
.blog-prose h2,
.blog-prose h3 {
  color: var(--text);
  font-weight: 800;
  margin: 1.75rem 0 0.65rem;
  letter-spacing: -0.02em;
}
.blog-prose h2 { font-size: 1.35rem; }
.blog-prose h3 { font-size: 1.1rem; }
.blog-prose p { margin: 0 0 1rem; }
.blog-prose ul,
.blog-prose ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}
.blog-prose li { margin-bottom: 0.35rem; }
.blog-prose a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.blog-prose blockquote {
  margin: 1rem 0;
  padding: 0.65rem 1rem;
  border-left: 3px solid rgba(64, 219, 241, 0.45);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
}
.blog-prose code {
  font-family: ui-monospace, monospace;
  font-size: 0.88em;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.12em 0.35em;
  border-radius: 4px;
}
.blog-prose pre {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.4);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}
.blog-prose pre code {
  background: none;
  padding: 0;
}
.blog-prose hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 1.5rem 0;
}
.blog-prose strong { color: var(--text); font-weight: 700; }

/* Staff blog editor */
.ts-blog-editor-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.75rem;
}
@media (max-width: 900px) {
  .ts-blog-editor-split { grid-template-columns: 1fr; }
}
.ts-blog-editor-pane label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.ts-blog-editor-pane textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  resize: vertical;
  min-height: 280px;
}
.ts-blog-preview {
  min-height: 280px;
  max-height: 420px;
  overflow: auto;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}
.ts-blog-posts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.ts-blog-admin-card .ts-admin-actions { margin-top: 0.65rem; }

/* ---- Platform theme engine ---- */
body.clyr-themed {
  --teal: var(--primary-color);
  --teal-dim: var(--secondary-color);
  --teal-bright: var(--accent-color);
  --teal-glow: color-mix(in srgb, var(--primary-color) 40%, transparent);
  --teal-subtle: color-mix(in srgb, var(--primary-color) 8%, transparent);
  --bg: var(--background-color);
  --bg-mid: color-mix(in srgb, var(--background-color) 88%, #ffffff 12%);
  --bg-card: color-mix(in srgb, var(--background-color) 82%, #ffffff 18%);
  --border: color-mix(in srgb, var(--primary-color) 12%, transparent);
}

body.clyr-themed .header {
  border-bottom-color: color-mix(in srgb, var(--primary-color) 8%, transparent);
  background: color-mix(in srgb, var(--background-color) 75%, transparent);
}

body.clyr-themed .btn-primary,
body.clyr-themed .careers-submit {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-color: color-mix(in srgb, var(--primary-color) 50%, transparent);
}

body.clyr-themed .btn-primary:hover,
body.clyr-themed .careers-submit:hover {
  filter: brightness(1.08);
}

/* Platform themes must override static marketing gradients (.home-page / .clyr-theme) */
body.clyr-themed.home-page,
body.clyr-themed.clyr-theme {
  --home-blurple: var(--primary-color);
  --home-blurple-hover: var(--secondary-color);
  --home-blurple-glow: color-mix(in srgb, var(--primary-color) 42%, transparent);
  --home-surface: color-mix(in srgb, var(--background-color) 55%, transparent);
  --home-surface-strong: color-mix(in srgb, var(--background-color) 75%, #ffffff 8%);
  --home-divider: color-mix(in srgb, var(--primary-color) 10%, transparent);
  background:
    radial-gradient(ellipse 120% 50% at 50% -5%, color-mix(in srgb, var(--primary-color) 22%, transparent) 0%, transparent 55%),
    radial-gradient(ellipse 90% 45% at 100% 35%, color-mix(in srgb, var(--accent-color) 12%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse 70% 40% at 0% 55%, color-mix(in srgb, var(--secondary-color) 10%, transparent) 0%, transparent 48%),
    radial-gradient(ellipse 80% 50% at 50% 100%, color-mix(in srgb, var(--primary-color) 8%, transparent) 0%, transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--background-color) 92%, var(--primary-color) 8%) 0%, var(--background-color) 100%);
}

body.clyr-themed .home-bento-icon,
body.clyr-themed .home-strip-accent,
body.clyr-themed .legal-content a {
  color: var(--accent-color);
}

body.clyr-themed .legal-content a:hover {
  color: color-mix(in srgb, var(--accent-color) 80%, #ffffff 20%);
}

body.clyr-themed .why-card-new:hover,
body.clyr-themed .careers-posting:hover {
  border-color: color-mix(in srgb, var(--accent-color) 35%, transparent);
}

body.clyr-themed .page-hero-bg,
body.clyr-themed .careers-hero-bg {
  background:
    radial-gradient(ellipse 90% 55% at 50% 0%, color-mix(in srgb, var(--primary-color) 22%, transparent) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 25%, color-mix(in srgb, var(--accent-color) 10%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse 55% 38% at 0% 70%, color-mix(in srgb, var(--secondary-color) 10%, transparent) 0%, transparent 50%);
}

body.clyr-themed.auth-page .auth-panel-bg {
  background:
    radial-gradient(ellipse 80% 60% at 28% 42%, color-mix(in srgb, var(--primary-color) 28%, transparent) 0%, transparent 58%),
    radial-gradient(ellipse 55% 50% at 85% 75%, color-mix(in srgb, var(--secondary-color) 14%, transparent) 0%, transparent 55%);
}

body.clyr-themed.home-page .home-cta .btn-primary {
  box-shadow:
    0 12px 40px color-mix(in srgb, var(--primary-color) 28%, transparent),
    0 0 32px color-mix(in srgb, var(--secondary-color) 15%, transparent);
}

body.clyr-theme {
  --clyr-header-height: 4.5rem;
}

body.clyr-theme-banner-visible .header {
  top: 0;
}

body.clyr-theme-banner-visible > main,
body.clyr-theme-banner-visible .home-main,
body.clyr-theme-banner-visible .careers-main,
body.clyr-theme-banner-visible .roadmap-public-main,
body.clyr-theme-banner-visible .roadmap-public-content,
body.clyr-theme-banner-visible .auth-main,
body.clyr-theme-banner-visible .legal-main {
  padding-top: calc(5.5rem + var(--clyr-theme-banner-height, 2.75rem));
}

.clyr-theme-banner {
  position: fixed;
  top: var(--clyr-header-height, 4.5rem);
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--theme-banner-bg, rgba(64, 219, 241, 0.12));
  border-bottom: 1px solid var(--theme-banner-border, rgba(64, 219, 241, 0.3));
  --clyr-theme-banner-height: 2.75rem;
}

.clyr-theme-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-height: 2.75rem;
}

.clyr-theme-banner-text {
  color: var(--theme-banner-text, var(--teal-bright));
  font-size: 0.9rem;
  font-weight: 600;
}

.clyr-theme-banner-link {
  color: var(--primary-color);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
}

.clyr-theme-banner-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-soft);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.35rem;
}

.clyr-theme-logo {
  display: block;
  height: 28px;
  width: auto;
  object-fit: contain;
}

.careers-admin-content--wide {
  max-width: 1100px !important;
}

.themes-admin-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 768px) {
  .themes-admin-layout {
    grid-template-columns: 1fr;
  }
}

.themes-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.themes-list-item {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.themes-list-item.active {
  border-color: var(--teal);
  background: var(--teal-subtle);
}

.themes-list-item .themes-list-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.themes-editor {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.themes-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.themes-color-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.themes-color-grid input[type="color"] {
  width: 100%;
  height: 2.25rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}

.themes-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.themes-active-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--teal-subtle);
  color: var(--teal-bright);
  margin-left: 0.35rem;
}

/* ---- Chat appearance themes ---- */
.appearance-user-notice {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
}

.appearance-user-notice--locked {
  border-color: rgba(232, 164, 184, 0.35);
  background: rgba(232, 164, 184, 0.08);
}

.appearance-user-notice--exclusive {
  border-color: rgba(143, 188, 143, 0.35);
  background: rgba(143, 188, 143, 0.08);
}

.appearance-user-notice-title {
  display: block;
  font-size: 0.9rem;
  margin: 0 0 0.35rem;
}

.appearance-user-notice-body {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-soft);
  line-height: 1.45;
}

.appearance-theme-group {
  margin-top: 0.75rem;
}

.appearance-theme-group-title {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.appearance-section {
  margin-bottom: 1.75rem;
}

.appearance-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.chat-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.chat-theme-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.chat-theme-option:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.chat-theme-option--active {
  border-color: var(--teal);
  background: var(--teal-subtle);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--teal) 35%, transparent);
}

.chat-theme-option-swatches {
  display: flex;
  gap: 4px;
  width: 100%;
}

.chat-theme-swatch {
  flex: 1;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-theme-option-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
}

.chat-theme-option-label {
  font-size: 0.88rem;
  font-weight: 700;
}

.chat-theme-exclusive-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-soft);
}

.chat-theme-option-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.chat-theme-preview {
  display: grid;
  grid-template-columns: 48px 88px 1fr;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--chat-border, var(--border));
  margin-top: 0.65rem;
  background: var(--preview-main, var(--bg));
}

.chat-theme-preview-sidebar {
  background: var(--preview-zones, var(--bg-card));
  padding: 0.5rem 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
}

.chat-theme-preview-zone {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--preview-channels, var(--bg-mid));
  opacity: 0.7;
}

.chat-theme-preview-zone.active {
  background: var(--preview-accent, var(--teal));
  opacity: 1;
}

.chat-theme-preview-channels {
  background: var(--preview-channels, var(--bg-mid));
  padding: 0.5rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.65rem;
  color: var(--preview-muted, var(--text-muted));
}

.chat-theme-preview-channel {
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
}

.chat-theme-preview-channel.active {
  background: var(--preview-hover, rgba(255, 255, 255, 0.06));
  color: var(--preview-text, var(--text));
}

.chat-theme-preview-main {
  background: var(--preview-main, var(--bg));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.5rem;
}

.chat-theme-preview-msg {
  display: flex;
  gap: 0.35rem;
  align-items: flex-start;
}

.chat-theme-preview-avatar {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--preview-accent, var(--teal));
  flex-shrink: 0;
  opacity: 0.85;
}

.chat-theme-preview-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.chat-theme-preview-lines span {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--preview-hover, rgba(255, 255, 255, 0.08));
}

.chat-theme-preview-lines span:first-child {
  width: 75%;
}

.chat-theme-preview-lines span:last-child {
  width: 50%;
}

.chat-theme-preview-input {
  height: 22px;
  border-radius: 8px;
  background: var(--preview-input, var(--bg-card));
  margin-top: auto;
}

.appearance-sync-hint {
  margin-top: 0.5rem;
}

.appearance-overlay .settings-overlay-inner {
  max-width: min(640px, 96vw);
}

.profile-card-actions .profile-card-action {
  flex: 1 1 auto;
  min-width: 0;
}

