/* =====================================================================
   SesliChat — Design system
   Facebook-style: light UI, flat white cards, hairline borders,
   blue accent, Inter typography.
   CSS custom properties are overridden at runtime from platform settings.
   ===================================================================== */

:root {
  /* Brand (overridden inline by the layout from admin settings)
     Palette: Facebook blue on a light grey canvas. */
  --brand: #166fe5;
  --brand-2: #1259b8;
  --brand-3: #1b74e4;
  --accent: #1877f2;
  --success: #31a24c;
  --warning: #f7b928;
  --danger: #e41e3f;

  /* Surfaces — light grey canvas, white cards */
  --bg-0: #f0f2f5;
  --bg-1: #ffffff;
  --bg-2: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e4e6eb;
  --line: #ced0d4;
  --line-strong: #bcc0c4;

  /* Text */
  --txt: #050505;
  --txt-2: #5a5d61;
  --txt-3: #6a6d71;
  --txt-inv: #ffffff;

  /* Geometry — Facebook uses tighter radii than the old glass theme */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;

  /* Elevation — flat; cards rely on hairline borders, not drop shadows */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-3: 0 6px 20px rgba(0, 0, 0, 0.16);
  --glow: 0 2px 8px rgba(24, 119, 242, 0.24);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-1: 140ms;
  --dur-2: 260ms;
  --dur-3: 460ms;

  /* Layout */
  --nav-h: 60px;
  --max-w: 1240px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* Dark theme (opt-in via data-theme="dark") */
[data-theme="dark"] {
  --brand: #2d88ff;
  --brand-2: #1877f2;
  --brand-3: #4599ff;
  --accent: #2d88ff;
  --bg-0: #18191a;
  --bg-1: #242526;
  --bg-2: #3a3b3c;
  --surface: #242526;
  --surface-2: #3a3b3c;
  --surface-3: #4e4f50;
  --line: #3e4042;
  --line-strong: #4f5154;
  --txt: #e4e6eb;
  --txt-2: #b0b3b8;
  --txt-3: #8a8d91;
  --txt-inv: #18191a;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 6px 20px rgba(0, 0, 0, 0.6);
  --glow: 0 2px 8px rgba(45, 136, 255, 0.3);
}

/* ---------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-0);
  color: var(--txt);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-2); text-decoration: none; transition: color var(--dur-1) var(--ease); }
a:hover { color: #c4b5fd; }

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.2; letter-spacing: -0.022em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1em; }

::selection { background: rgba(20, 97, 201, 0.36); color: #fff; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); background-clip: content-box; }

/* ------------------------------------------------------------- utilities */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 22px; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { display: grid; place-items: center; }
.text-center { text-align: center; }
.muted { color: var(--txt-3); }
.dim { color: var(--txt-2); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 26px; }
.mt-4 { margin-top: 40px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 26px; }
.gap-sm { gap: 8px; }
.gap-lg { gap: 22px; }
.full { width: 100%; }

.gradient-text {
  background: linear-gradient(100deg, var(--brand) 0%, var(--brand-2) 45%, var(--brand-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--brand-2);
  padding: 6px 13px; border-radius: var(--r-pill);
  background: rgba(20, 97, 201, 0.12);
  border: 1px solid rgba(20, 97, 201, 0.28);
}

/* Inside the dark hero the blue pill is invisible — use a translucent white one. */
.slide__bg ~ * .eyebrow,
.hero .eyebrow {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.34);
}

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-bg: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: #fff;
  font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease),
              background var(--dur-2) var(--ease), border-color var(--dur-1) var(--ease),
              opacity var(--dur-1) var(--ease);
  box-shadow: 0 8px 22px rgba(24, 119, 242, 0.30);
  text-decoration: none;
  position: relative;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1.5px); box-shadow: 0 14px 32px rgba(24, 119, 242, 0.42); color: #fff; }
.btn:active { transform: translateY(0) scale(0.985); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(247, 185, 40, 0.45), 0 10px 26px rgba(24, 119, 242, 0.35); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn--ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--txt);
  box-shadow: none;
}
.btn--ghost:hover { background: var(--surface-2); border-color: rgba(20, 97, 201, 0.5); color: var(--txt); box-shadow: var(--shadow-1); }

.btn--soft {
  background: rgba(24, 119, 242, 0.12);
  border-color: rgba(24, 119, 242, 0.32);
  color: var(--brand-2);
  box-shadow: none;
}
.btn--soft:hover { background: rgba(24, 119, 242, 0.2); color: var(--brand); }

/* Gold action button — dark text is required: white on #1877f2 is unreadable. */
.btn--accent {
  --btn-bg: linear-gradient(135deg, #1877f2, #e8b400);
  color: #2a123f;
  box-shadow: 0 8px 22px rgba(247, 185, 40, 0.28);
}
.btn--accent:hover { color: #2a123f; box-shadow: 0 14px 32px rgba(247, 185, 40, 0.4); }

.btn--danger { background: linear-gradient(135deg, #f43f5e, #e11d48); box-shadow: 0 8px 22px rgba(244, 63, 94, 0.3); }
.btn--danger:hover { box-shadow: 0 14px 32px rgba(244, 63, 94, 0.42); }

.btn--success { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 8px 22px rgba(16, 185, 129, 0.28); }

.btn--sm { padding: 8px 14px; font-size: 13px; border-radius: var(--r-xs); gap: 6px; }
.btn--lg { padding: 15px 30px; font-size: 16px; border-radius: var(--r-md); }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: 40px; height: 40px; border-radius: var(--r-sm); }
.btn--icon.btn--sm { width: 32px; height: 32px; }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-2);
  position: relative;
  overflow: hidden;
}
.card--flush { padding: 0; }
.card--tight { padding: 16px; }
.card--hover { transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.card--hover:hover { transform: translateY(-3px); border-color: rgba(20, 97, 201, 0.32); box-shadow: var(--shadow-3); }

.glass {
  background: rgba(13, 18, 34, 0.62);
  border: 1px solid var(--line);
}

.section { padding: 68px 0; }
.section--tight { padding: 40px 0; }
.section-head { max-width: 720px; margin: 0 auto 38px; text-align: center; }
.section-head p { color: var(--txt-3); font-size: 15.5px; margin-top: 10px; }

/* ------------------------------------------------------------- formfields */
.field { margin-bottom: 16px; }
.field > label, .label {
  display: block; margin-bottom: 7px;
  font-size: 13px; font-weight: 600; color: var(--txt-2); letter-spacing: -0.005em;
}
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }

.input, .select, .textarea {
  width: 100%;
  padding: 12px 15px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--txt);
  font-size: 14.5px;
  outline: none;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--txt-3); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  background: var(--bg-1);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.18);
}
.input:disabled, .select:disabled { opacity: 0.6; cursor: not-allowed; }
.textarea { resize: vertical; min-height: 100px; line-height: 1.55; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237d8aa7' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.input--error, .textarea--error { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.14); }
.field-error { margin-top: 6px; font-size: 12.5px; color: #fb7185; }

.hint { margin-top: 6px; font-size: 12.5px; color: var(--txt-3); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

/* checkbox / switch */
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; color: var(--txt-2); }
.check input[type="checkbox"] { flex: none; margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  width: 44px; height: 25px; border-radius: var(--r-pill);
  background: var(--surface-3); border: 1px solid var(--line-strong);
  position: relative; transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
  flex: none;
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--txt-2);
  transition: transform var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.switch input:checked + .switch__track { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; }
.switch input:checked + .switch__track::after { transform: translateX(19px); background: #fff; }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.28); }

/* file drop */
.file-drop {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
  background: var(--surface-2);
}
.file-drop:hover, .file-drop.is-drag { border-color: var(--brand); background: rgba(24, 119, 242, 0.07); }
.file-drop input { display: none; }
.file-drop__icon { font-size: 26px; margin-bottom: 6px; opacity: 0.75; }

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.015em;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--txt-2); white-space: nowrap;
}
.badge--live { background: rgba(16, 185, 129, 0.14); border-color: rgba(16, 185, 129, 0.34); color: #34d399; }
.badge--closed { background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.28); color: #94a3b8; }
.badge--private { background: rgba(245, 158, 11, 0.13); border-color: rgba(245, 158, 11, 0.30); color: #fbbf24; }
.badge--brand { background: rgba(24, 119, 242, 0.15); border-color: rgba(24, 119, 242, 0.34); color: #a5b4fc; }
.badge--danger { background: rgba(244, 63, 94, 0.14); border-color: rgba(244, 63, 94, 0.32); color: #fb7185; }
.badge--guest { background: rgba(247, 185, 40, 0.13); border-color: rgba(247, 185, 40, 0.30); color: #67e8f9; }
.badge--admin { background: linear-gradient(135deg, rgba(247, 185, 40, 0.2), rgba(20, 97, 201, 0.2)); border-color: rgba(247, 185, 40, 0.4); color: #f9a8d4; }
.badge--dm { background: rgba(251, 191, 36, 0.14); border-color: rgba(251, 191, 36, 0.34); color: #fcd34d; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--txt-3); flex: none; }
.dot--live { background: var(--success); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); animation: pulse-dot 2.4s infinite; }
.dot--warn { background: var(--warning); }
.dot--danger { background: var(--danger); }
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* --------------------------------------------------------------- avatars */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; flex: none;
  border: 1.5px solid var(--line-strong);
  background: var(--surface-2);
}
.avatar--xs { width: 26px; height: 26px; }
.avatar--sm { width: 32px; height: 32px; }
.avatar--lg { width: 58px; height: 58px; }
.avatar--xl { width: 88px; height: 88px; }
.avatar--xxl { width: 116px; height: 116px; }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { margin-left: -10px; border: 2px solid var(--bg-1); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ----------------------------------------------------------------- flash */
.flash-stack { position: fixed; top: calc(var(--nav-h) + 14px); right: 20px; z-index: 120; display: grid; gap: 10px; max-width: 400px; }
.flash {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 15px; border-radius: var(--r-md);
  background: rgba(13, 19, 36, 0.94);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
  font-size: 14px;
  animation: flash-in var(--dur-2) var(--ease);
}
@keyframes flash-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.flash__icon {
  width: 21px; height: 21px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: var(--surface-3); color: var(--txt);
}
.flash__text { flex: 1; }
.flash__close { background: none; border: 0; color: var(--txt-3); cursor: pointer; font-size: 19px; line-height: 1; padding: 0 2px; }
.flash__close:hover { color: var(--txt); }
.flash--success { border-color: rgba(16, 185, 129, 0.42); }
.flash--success .flash__icon { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.flash--error { border-color: rgba(244, 63, 94, 0.42); }
.flash--error .flash__icon { background: rgba(244, 63, 94, 0.2); color: #fb7185; }
.flash--warning { border-color: rgba(245, 158, 11, 0.42); }
.flash--warning .flash__icon { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.flash--info { border-color: rgba(24, 119, 242, 0.42); }
.flash--info .flash__icon { background: rgba(24, 119, 242, 0.2); color: #a5b4fc; }

/* ------------------------------------------------------------------ nav */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  transition: background var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.nav.is-scrolled { background: var(--bg-1); box-shadow: var(--shadow-2); }
.nav__inner {
  width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 17.5px; letter-spacing: -0.03em; color: var(--txt); }
.brand:hover { color: var(--txt); }
.brand__mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2) 60%, var(--brand-3));
  display: grid; place-items: center; color: #fff; font-size: 16px;
  box-shadow: 0 6px 18px rgba(24, 119, 242, 0.42);
  flex: none;
}
.brand__logo { height: 32px; width: auto; border-radius: 8px; }

.nav__links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav__link {
  padding: 8px 13px; border-radius: var(--r-xs);
  font-size: 14px; font-weight: 550; color: var(--txt-2);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.nav__link:hover { background: var(--surface); color: var(--txt); }
.nav__link.is-active { color: var(--txt); background: var(--surface-2); }

.nav__actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }

/* language switcher: one bordered pill holding a flag plus a compact select */
.langswitch {
  display: inline-flex; align-items: center; margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding-left: 8px;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.langswitch:hover { border-color: var(--line-strong); }
.langswitch:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.langswitch__flag {
  display: block; width: 18px; height: 13px; flex: 0 0 auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.22);
  pointer-events: none;
}
.langswitch select {
  appearance: none; -webkit-appearance: none;
  padding: 7px 26px 7px 7px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 9px center;
  color: var(--txt-2);
  font-size: 12.5px; font-weight: 560; font-family: inherit;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease);
}
.langswitch select:hover { color: var(--txt); }
.langswitch select:focus-visible { outline: none; }
@media (max-width: 640px) {
  .langswitch { padding-left: 6px; }
  .langswitch__flag { width: 16px; height: 12px; }
  .langswitch select { padding: 6px 22px 6px 6px; font-size: 12px; }
}

.nav__toggle {
  display: none; width: 42px; height: 42px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; padding: 0;
  place-items: center;
}
.nav__toggle span { display: block; width: 18px; height: 2px; background: var(--txt); border-radius: 2px; position: relative; transition: transform var(--dur-2) var(--ease), background var(--dur-1); }
.nav__toggle span::before, .nav__toggle span::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: var(--txt); border-radius: 2px;
  transition: transform var(--dur-2) var(--ease), top var(--dur-2) var(--ease);
}
.nav__toggle span::before { top: -6px; }
.nav__toggle span::after { top: 6px; }
.nav__toggle[aria-expanded="true"] span { background: transparent; }
.nav__toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

/* user menu */
.usermenu { position: relative; }
.usermenu__btn {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 10px 5px 5px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.usermenu__btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.usermenu__name { font-size: 13.5px; font-weight: 600; max-width: 120px; }
.usermenu__panel {
  position: absolute; top: calc(100% + 9px); right: 0; min-width: 224px;
  background: rgba(13, 19, 36, 0.97);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 7px;
  box-shadow: var(--shadow-3);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), visibility var(--dur-2);
  z-index: 60;
}
.usermenu.is-open .usermenu__panel { opacity: 1; visibility: visible; transform: none; }
.usermenu__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: var(--r-xs);
  font-size: 13.5px; color: var(--txt-2); font-weight: 500;
}
.usermenu__item:hover { background: var(--surface-2); color: var(--txt); }
.usermenu__item--danger { color: #fb7185; }
.usermenu__item--danger:hover { background: rgba(244, 63, 94, 0.12); color: #fda4af; }
.usermenu__sep { height: 1px; background: var(--line); margin: 6px 4px; }
.usermenu__head { padding: 9px 11px 7px; font-size: 12px; color: var(--txt-3); }

/* Admin row action menu (<details class="menu">). The items are real <button>
   elements, so the native UA button background/colour must be reset or the
   near-white theme text lands on a light-grey native button and is unreadable. */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::marker { content: ''; }
.menu > summary:hover { color: var(--txt); }

.menu__panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 254px;
  padding: 8px;
  background: var(--panel, rgba(13, 19, 36, 0.97));
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
}

.menu__form { margin: 0; display: grid; gap: 6px; }

/* One rule per item keeps every action in this menu visually identical. */
.menu__item {
  appearance: none; -webkit-appearance: none;
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  margin: 0;
  padding: 9px 11px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--txt-2);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.menu__item:hover { background: var(--surface-2); color: var(--txt); }
.menu__item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  color: var(--txt);
}

.menu__item--danger { color: #fb7185; }
.menu__item--danger:hover {
  background: rgba(244, 63, 94, 0.14);
  color: #fda4af;
}

[data-theme="light"] .menu__item--danger { color: #be123c; }
[data-theme="light"] .menu__item--danger:hover { background: rgba(190, 18, 60, 0.09); color: #9f1239; }
[data-theme="light"] .menu__panel { background: #ffffff; }

/* mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(4, 7, 14, 0.62);
  opacity: 0; visibility: hidden; transition: opacity var(--dur-2) var(--ease), visibility var(--dur-2);
}
.drawer.is-open { opacity: 1; visibility: visible; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 86vw);
  background: var(--bg-1);
  border-left: 1px solid var(--line);
  padding: 20px;
  display: flex; flex-direction: column; gap: 6px;
  transform: translateX(100%);
  transition: transform var(--dur-3) var(--ease);
  overflow-y: auto;
}
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.drawer__link {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-radius: var(--r-sm);
  font-size: 15px; font-weight: 550; color: var(--txt-2);
}
.drawer__link:hover, .drawer__link.is-active { background: var(--surface-2); color: var(--txt); }
.drawer__sep { height: 1px; background: var(--line); margin: 10px 0; }
.drawer__foot { margin-top: auto; padding-top: 18px; display: grid; gap: 9px; }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; overflow: hidden; }
.slider { position: relative; width: 100%; min-height: clamp(420px, 66vh, 680px); }
.slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 900ms var(--ease);
  display: grid; place-items: center;
  padding: 60px 22px;
  pointer-events: none;
}
.slide.is-active { opacity: 1; pointer-events: auto; position: relative; }
.slide__bg { position: absolute; inset: 0; z-index: 0; }
.slide__bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7, 10, 18, 0.42), rgba(7, 10, 18, 0.86));
}
.slide__img { width: 100%; height: 100%; object-fit: cover; }
.slide__content { position: relative; z-index: 1; max-width: 860px; text-align: center; }
.slide__title { font-size: clamp(2rem, 5vw, 3.9rem); margin: 14px 0 14px; letter-spacing: -0.035em; color: #ffffff; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); }
.slide__sub { font-size: clamp(15px, 1.9vw, 19px); color: rgba(255, 255, 255, 0.92); max-width: 620px; margin: 0 auto 26px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3); }
.slide__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.slider__dots { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.slider__dot {
  width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.32); transition: all var(--dur-2) var(--ease);
}
.slider__dot.is-active { width: 26px; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.slider__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(9, 13, 24, 0.6); border: 1px solid var(--line-strong);
  color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 17px;
  transition: background var(--dur-2) var(--ease);
}
.slider__arrow:hover { background: rgba(24, 119, 242, 0.4); }
.slider__arrow--prev { left: 18px; }
.slider__arrow--next { right: 18px; }

/* hero fallback (no slides configured) */
.hero-plain {
  position: relative; padding: 96px 22px 84px; text-align: center; overflow: hidden;
}

/* The plain hero sits on the light canvas, so the text must use theme colours
   rather than the white used over the old gradient slides. */
.hero-plain .eyebrow {
  color: var(--brand-2);
  background: rgba(24, 119, 242, 0.12);
  border-color: rgba(24, 119, 242, 0.28);
}
.hero-plain h1 {
  color: var(--txt);
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.03em;
}
.hero-plain .slide__sub {
  color: var(--txt-2);
  text-shadow: none;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.hero-plain::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 620px;
  background: radial-gradient(650px 320px at 50% 0%, rgba(20, 97, 201, 0.28), transparent 70%);
  pointer-events: none;
}

/* ------------------------------------------------------------- room cards */
.grid { display: grid; gap: 18px; }
.grid--rooms { grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.room-card {
  display: flex; flex-direction: column; gap: 13px;
  padding: 17px;
  border-radius: var(--r-lg);
  background: var(--bg-1);
  border: 1px solid var(--line);
  text-decoration: none; color: inherit;
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
  position: relative; overflow: hidden;
}
.room-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2), var(--brand-3));
  opacity: 0; transition: opacity var(--dur-2) var(--ease);
}
.room-card:hover { transform: translateY(-3px); border-color: rgba(20, 97, 201, 0.35); box-shadow: var(--shadow-3); color: inherit; }
.room-card:hover::before { opacity: 1; }
.room-card__top { display: flex; align-items: flex-start; gap: 12px; }
.room-card__icon {
  width: 50px; height: 50px; border-radius: var(--r-md); flex: none;
  background: linear-gradient(140deg, rgba(24, 119, 242, 0.34), rgba(20, 97, 201, 0.2));
  border: 1px solid rgba(20, 97, 201, 0.3);
  display: grid; place-items: center; font-size: 22px; overflow: hidden;
}
.room-card__icon img { width: 100%; height: 100%; object-fit: cover; }
.room-card__title { font-size: 15.5px; font-weight: 680; letter-spacing: -0.015em; line-height: 1.32; }
.room-card__owner { font-size: 12.5px; color: var(--txt-3); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.room-card__desc { font-size: 13px; color: var(--txt-3); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.room-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; }
.room-card__meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--txt-3); }
.room-card__meta span { display: inline-flex; align-items: center; gap: 5px; }

/* --------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat {
  padding: 22px 18px; border-radius: var(--r-md);
  background: var(--bg-1);
  border: 1px solid var(--line);
  text-align: center;
  position: relative; overflow: hidden;
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
}
.stat:hover { transform: translateY(-2px); border-color: rgba(20, 97, 201, 0.3); }
.stat__icon { font-size: 20px; margin-bottom: 8px; opacity: 0.9; }
.stat__num { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 760; letter-spacing: -0.04em; line-height: 1; }
.stat__label { font-size: 12px; color: var(--txt-3); margin-top: 7px; font-weight: 550; letter-spacing: 0.02em; text-transform: uppercase; }

/* --------------------------------------------------------- feature cards */
.feature {
  padding: 24px; border-radius: var(--r-lg);
  background: var(--bg-1);
  border: 1px solid var(--line);
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.feature:hover { transform: translateY(-3px); border-color: rgba(24, 119, 242, 0.3); box-shadow: var(--shadow-2); }
.feature__icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  font-size: 21px; margin-bottom: 15px;
  background: linear-gradient(140deg, rgba(24, 119, 242, 0.26), rgba(20, 97, 201, 0.14));
  border: 1px solid rgba(20, 97, 201, 0.26);
}
.feature h3 { font-size: 16px; margin-bottom: 7px; }
.feature p { font-size: 13.5px; color: var(--txt-3); margin: 0; line-height: 1.6; }

/* steps */
.steps-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; counter-reset: step; }
.step-item { position: relative; padding: 24px 20px 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.step-item::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -14px; left: 20px;
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 750; font-size: 14px;
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(24, 119, 242, 0.4);
}
.step-item h3 { font-size: 15.5px; margin: 10px 0 6px; }
.step-item p { font-size: 13.5px; color: var(--txt-3); margin: 0; }

/* ----------------------------------------------------------------- auth */
.auth-wrap { min-height: calc(100vh - var(--nav-h)); display: grid; place-items: center; padding: 40px 20px 70px; }
.auth-card { width: 100%; max-width: 460px; padding: 34px; }
.auth-card h1 { font-size: 1.7rem; margin-bottom: 6px; }
.auth-card .sub { color: var(--txt-3); font-size: 14px; margin-bottom: 24px; }
.auth-alt { margin-top: 18px; text-align: center; font-size: 13.5px; color: var(--txt-3); }
.auth-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; max-width: 1000px; width: 100%; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); }
.auth-split__aside {
  padding: 44px 38px; position: relative; overflow: hidden;
  background: linear-gradient(150deg, rgba(24, 119, 242, 0.24), rgba(20, 97, 201, 0.14) 50%, rgba(247, 185, 40, 0.12));
  display: flex; flex-direction: column; justify-content: center;
}
.auth-split__aside h2 { font-size: 1.85rem; }
.auth-split__aside p { color: rgba(255, 255, 255, 0.72); font-size: 14.5px; }
.auth-split__form { padding: 44px 38px; background: rgba(10, 15, 26, 0.75); }
@media (max-width: 860px) { .auth-split { grid-template-columns: 1fr; } .auth-split__aside { display: none; } }

/* ------------------------------------------------------------ dashboard */
.dash { display: grid; grid-template-columns: 258px 1fr; gap: 26px; padding: 30px 0 70px; align-items: start; }
.dash__side {
  position: sticky; top: calc(var(--nav-h) + 20px);
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--bg-1);
  border: 1px solid var(--line);
}
.dash__profile { display: flex; align-items: center; gap: 12px; padding: 8px 8px 16px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.dash__link {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 550; color: var(--txt-2);
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.dash__link:hover { background: var(--surface-2); color: var(--txt); }
.dash__link.is-active {
  background: linear-gradient(90deg, rgba(24, 119, 242, 0.24), rgba(20, 97, 201, 0.10));
  color: #fff; font-weight: 620;
  box-shadow: inset 2px 0 0 var(--brand);
}
.dash__icon { width: 18px; text-align: center; opacity: 0.85; font-size: 15px; }

/* Admin console shell: sidebar + content, mirroring the .dash__* member layout.
   These classes previously had no rules at all, so the "Sign out" <button>
   inherited the native UA grey background with faint theme text. */
.admin {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  gap: 26px;
  padding: 30px 0 70px;
  align-items: start;
}

.admin__side {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--bg-1);
  border: 1px solid var(--line);
}

.admin__brand {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 8px 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

/* Shared by <a> links and the sign-out <button>: reset the native button so
   both render as identical, readable rows. */
.admin__link {
  appearance: none; -webkit-appearance: none;
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  margin: 0;
  padding: 11px 13px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--txt-2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.admin__link:hover { background: var(--surface-2); color: var(--txt); }
.admin__link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.admin__link.is-active {
  background: linear-gradient(90deg, rgba(24, 119, 242, 0.24), rgba(20, 97, 201, 0.10));
  color: #fff;
  font-weight: 620;
  box-shadow: inset 2px 0 0 var(--brand);
}
.admin__link--btn { justify-content: flex-start; }

.admin__foot {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--line);
}
.admin__foot form { margin: 0; }

.admin__main { min-width: 0; }

.admin__topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 11px 15px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .admin__side { position: static; flex-direction: row; flex-wrap: wrap; overflow-x: auto; gap: 6px; padding: 10px; }
  .admin__brand { padding: 4px 6px; margin: 0; border: 0; }
  .admin__link { width: auto; white-space: nowrap; }
  .admin__foot { flex-direction: row; align-items: center; margin: 0; padding: 0; border: 0; gap: 6px; }
}
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .dash__side { position: static; flex-direction: row; overflow-x: auto; gap: 6px; padding: 10px; }
  .dash__profile { display: none; }
  .dash__link { white-space: nowrap; font-size: 13px; padding: 9px 12px; }
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.75rem; margin: 0; }
.page-head p { margin: 5px 0 0; color: var(--txt-3); font-size: 14px; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
/* Inside narrow two-column dashboard panels the 620px floor forces a horizontal
   scrollbar that hides the last column. The grid already stacks below 900px, so
   allow these in-panel tables to shrink and wrap their cells instead. */
.admin__main .grid > .card .table-wrap table.data,
.dash .grid > .card .table-wrap table.data { min-width: 0; }
.admin__main .grid > .card .table-wrap table.data th,
.admin__main .grid > .card .table-wrap table.data td,
.dash .grid > .card .table-wrap table.data th,
.dash .grid > .card .table-wrap table.data td { white-space: normal; padding-left: 10px; padding-right: 10px; }
table.data th {
  text-align: left; padding: 12px 14px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--txt-3);
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
table.data tbody tr { transition: background var(--dur-1) var(--ease); }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.032); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

.empty {
  padding: 52px 24px; text-align: center; color: var(--txt-3);
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
}
.empty__icon { font-size: 34px; margin-bottom: 10px; opacity: 0.55; }
.empty h3 { font-size: 16px; color: var(--txt-2); margin-bottom: 6px; }
.empty p { font-size: 13.5px; margin: 0 0 16px; }

/* --------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab {
  padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--txt-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer;
  transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.tab:hover { color: var(--txt-2); }
.tab.is-active { color: var(--txt); border-bottom-color: var(--brand); }

/* --------------------------------------------------------------- modal */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }

/* The `hidden` attribute must beat any display set by a later class rule.
   Without this, elements that set display:flex/inline-flex stay visible
   even though JS marks them hidden. */
[hidden] { display: none !important; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(4, 7, 14, 0.72); backdrop-filter: blur(6px); }
.modal__panel {
  position: relative; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow-3);
  animation: modal-in var(--dur-2) var(--ease);
}
.modal__panel--wide { max-width: 760px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.modal__head h2 { font-size: 1.2rem; margin: 0; }
.modal__close {
  background: var(--surface); border: 1px solid var(--line); color: var(--txt-2);
  width: 32px; height: 32px; border-radius: var(--r-xs); cursor: pointer;
  display: grid; place-items: center; font-size: 18px; line-height: 1; flex: none;
}
.modal__close:hover { background: var(--surface-3); color: var(--txt); }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ------------------------------------------------------------- footer */
.footer {
  margin-top: 60px;
  border-top: 1px solid var(--line);
  /* Kept deliberately dark on the light theme: the footer is a solid band.
     All text inside it is white, so it must not use the theme text colours. */
  background: #1c1e21;
  padding: 54px 0 26px;
  color: #ffffff;
}
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 34px; }
.footer h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.09em; color: #ffffff; margin-bottom: 14px; }
.footer__links { display: grid; gap: 9px; }
.footer__links a { font-size: 13.5px; color: #ffffff; }
.footer__links a:hover { color: #ffffff; text-decoration: underline; }
.footer__about { font-size: 13.5px; color: #ffffff; line-height: 1.65; max-width: 340px; }
.footer__bottom {
  margin-top: 38px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.22);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 13px; font-weight: 500; color: #ffffff;
}

/* Catch-all: every element inside the dark footer is white, including the
   brand link and any inline-styled helper text. */
.footer,
.footer a,
.footer .brand,
.footer .brand:hover,
.footer .small,
.footer span,
.footer p,
.footer h4 { color: #ffffff; }
.footer a:hover { color: #ffffff; text-decoration: underline; }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; gap: 26px; } }
@media (max-width: 560px) { .footer__grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- banners */
.banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-size: 14px;
}
.banner--warning { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.32); color: #fcd34d; }
.banner--danger { background: rgba(244, 63, 94, 0.1); border-color: rgba(244, 63, 94, 0.32); color: #fda4af; }
.banner--info { background: rgba(24, 119, 242, 0.1); border-color: rgba(24, 119, 242, 0.3); color: #c7d2fe; }

/* -------------------------------------------------------- notifications */
.toast-host { position: fixed; bottom: 22px; right: 22px; z-index: 150; display: grid; gap: 9px; max-width: 340px; }
.toast {
  padding: 12px 16px; border-radius: var(--r-md);
  background: rgba(13, 19, 36, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
  font-size: 13.5px;
  animation: flash-in var(--dur-2) var(--ease);
}

/* ---------------------------------------------------------- animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 620ms var(--ease), transform 620ms var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* --------------------------------------------------------------- misc */
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.kv { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--txt-3); }
.kv dd { margin: 0; color: var(--txt-2); word-break: break-word; }
.pill-list { display: flex; flex-wrap: wrap; gap: 7px; }

.notice {
  padding: 15px 18px; border-radius: var(--r-md);
  background: rgba(24, 119, 242, 0.08);
  border-left: 3px solid var(--brand);
  font-size: 13.5px; color: var(--txt-2);
}

/* ------------------------------------------------------ responsive nav */
@media (max-width: 980px) {
  .nav__links { display: none; }
  .nav__toggle { display: grid; }
  .nav__inner { gap: 12px; }
  .usermenu__name { display: none; }
  .nav__actions .btn--lg, .nav__actions .btn:not(.btn--sm):not(.btn--icon) { padding: 9px 15px; font-size: 13.5px; }
}
@media (max-width: 560px) {
  .section { padding: 46px 0; }
  .container { padding: 0 16px; }
  .card { padding: 18px; border-radius: var(--r-md); }
  .slide { padding: 44px 18px; }
  .slider__arrow { display: none; }
  /* Below 560px the sign-in buttons move into the drawer (they are already
     rendered there), so the bar keeps only the brand, the language switcher
     and the menu toggle. Without this the row overflows the viewport. */
  .nav__actions > .btn { display: none; }
  .nav__actions { gap: 6px; }
  .langswitch { padding-left: 5px; }
  .langswitch select { max-width: 88px; }
  .flash-stack { left: 12px; right: 12px; max-width: none; }
  .toast-host { left: 12px; right: 12px; max-width: none; }
  .auth-card { padding: 24px 20px; }
}

/* =====================================================================
   LIVE ROOM
   ===================================================================== */
/* Layout: people list on the left, voice stage on top-right with the live
   chat docked beneath it. The stage and chat share a single grid column so the
   chat sits directly under the voice box rather than beside it. */
.room {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  grid-template-areas:
    "people stage"
    "people chat"
    "music music";
  /* The stage takes the leftover space and the chat keeps a fixed, comfortable
     height, so the message box is always on screen without page scrolling.
     The music row only takes space when the player panel is shown. */
  grid-template-rows: minmax(0, 1fr) clamp(240px, 34vh, 340px) auto;
  gap: 16px;
  padding: 18px clamp(14px, 3vw, 34px) 26px;
  align-items: stretch;
  height: calc(100vh - 68px);
  max-height: calc(100vh - 68px);
  min-height: 0;
  overflow: hidden;
}

/* Watching the video needs room. Instead of letting the page grow (which left
   the panel below the fold and made the browser scroll everything upward), the
   stage and chat give up height so the music row fits inside the same viewport.
   The page itself never grows, so nothing jumps when the panel opens. */
.room.is-video-open {
  grid-template-rows: minmax(120px, 1fr) clamp(150px, 22vh, 240px) auto;
}

@media (max-height: 780px) {
  .room.is-video-open { grid-template-rows: minmax(90px, 1fr) clamp(120px, 18vh, 190px) auto; }
}

.room__people { grid-area: people; min-height: 0; overflow: hidden; }
.room__chat   { grid-area: chat; }

.room__stage {
  grid-area: stage;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 20px;
  padding: 20px;
  background: var(--bg-1);
  border: 1px solid var(--line);
}

.room__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.room__head-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.room__title { font-size: 1.32rem; font-weight: 720; letter-spacing: -0.02em; margin: 0; }
.room__sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.room__head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.room__desc { font-size: 13.5px; color: var(--txt-2); margin: 0; line-height: 1.6; }
.room-card__icon--sm { width: 46px; height: 46px; font-size: 19px; border-radius: 13px; }

.room__bar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--txt-3);
  padding: 9px 13px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--line);
}
.room__bar strong { color: var(--txt-1); font-weight: 620; }
.room__bar-sep { opacity: 0.4; }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  animation: pulse-live 2s infinite;
}
@keyframes pulse-live {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70%  { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---- stage grid ---- */
.stage {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  align-content: start;
  /* Scrolls internally so a crowded room never pushes the chat off screen. */
  min-height: 0;
  overflow-y: auto;
  padding: 6px 0;
}

.stage__empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 9px; text-align: center; padding: 46px 20px;
  color: var(--txt-3);
}
.stage__empty-icon { font-size: 40px; opacity: 0.75; }
.stage__empty h3 { margin: 0; font-size: 1.02rem; color: var(--txt-2); font-weight: 640; }
.stage__empty p { margin: 0 0 6px; font-size: 13px; max-width: 340px; }

.tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  aspect-ratio: 1 / 0.86;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .18s, transform .18s, box-shadow .18s;
  overflow: hidden;
  padding: 30px 8px 10px;
}

/* The participant name is pinned to the top of the tile as its own bar so it is
   always legible and never pushed off the bottom when the avatar is large or
   the tile is short. */
.tile__name {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 7px 10px;
  font-size: 12.5px; font-weight: 650; color: var(--txt-2);
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(180deg, rgba(8, 11, 22, 0.72), rgba(8, 11, 22, 0));
  z-index: 2;
  pointer-events: none;
}
[data-theme="light"] .tile__name {
  color: #1f2937;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
}
.tile.is-talking .tile__name { color: #ecfdf5; }
.tile.is-talking {
  border-color: rgba(52, 211, 153, 0.62);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14);
  transform: translateY(-2px);
}
.tile.is-muted { opacity: 0.72; }
.tile__pulse {
  position: absolute; inset: auto 0 0 0; height: 3px;
  background: linear-gradient(90deg, #34d399, #1877f2);
  opacity: 0; transition: opacity .18s;
}
.tile.is-talking .tile__pulse { opacity: 1; }
.tile__badge { position: absolute; top: 30px; right: 9px; font-size: 12px; z-index: 3; }

/* ---- controls ---- */
.room__controls {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-top: 15px; border-top: 1px solid var(--line);
}
.ctl {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 17px; border-radius: 12px;
  background: var(--surface-2); color: var(--txt-1);
  border: 1px solid var(--line);
  font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: background .16s, border-color .16s, transform .12s;
}
.ctl:hover { background: var(--surface-3); }
.ctl:active { transform: scale(0.975); }
.ctl__icon { font-size: 15px; line-height: 1; }

.ctl--primary {
  background: linear-gradient(135deg, #1877f2, #1461c9);
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 22px -10px rgba(24, 119, 242, 0.75);
}
.ctl--primary:hover { filter: brightness(1.08); }

.ctl[data-state="muted"] { border-color: rgba(239, 68, 68, 0.6); color: #fca5a5; }
.ctl[data-state="on"] { border-color: rgba(52, 211, 153, 0.6); color: #6ee7b7; }

.ctl--danger { border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
.ctl--danger:hover { background: rgba(239, 68, 68, 0.14); }

.ctl--meter { cursor: default; min-width: 138px; }
.ctl--meter:hover { background: var(--surface-2); }
.ctl-group { display: flex; align-items: center; gap: 9px; margin-left: auto; flex-wrap: wrap; }
.ctl--mini { padding: 9px 13px; }

.meter {
  width: 74px; height: 5px; border-radius: 99px;
  background: var(--surface-3); overflow: hidden;
}
.meter__fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #34d399, #1877f2, #1877f2);
  border-radius: 99px; transition: width .07s linear;
}

.vol {
  -webkit-appearance: none; appearance: none;
  width: 84px; height: 4px; border-radius: 99px;
  background: var(--surface-3); outline: none; cursor: pointer;
}
.vol::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: #818cf8; border: 2px solid #0b1020; cursor: pointer;
}
.vol::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: #818cf8; border: 2px solid #0b1020; cursor: pointer;
}

/* ---- chat panel ---- */
.room__chat, .room__people {
  display: flex; flex-direction: column;
  border-radius: 20px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  overflow: hidden;
  max-height: calc(100vh - 130px);
}
/* Chat is docked under the voice stage, so it gets a predictable height that
   keeps the message log and the input box both visible without page scrolling. */
.room__chat { min-height: 0; height: auto; max-height: none; }
.room__people { max-height: calc(100vh - 130px); }
.chat__head {
  display: flex; align-items: center; gap: 9px;
  padding: 15px 17px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.chat__head h2 { margin: 0; font-size: 14px; font-weight: 680; letter-spacing: -0.01em; }
.chat__close { display: none; margin-left: auto; }

.chat__log {
  flex: 1; overflow-y: auto; padding: 15px 17px;
  display: flex; flex-direction: column; gap: 13px;
  scroll-behavior: smooth;
}
.chat__intro {
  text-align: center; color: var(--txt-3);
  font-size: 12.5px; padding: 26px 12px; line-height: 1.65;
}
.chat__intro p { margin: 7px 0 0; }

/* ------------------------------------------------------------ music panel */
.room__music {
  grid-area: music;
  display: flex; flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--bg-1);
  border: 1px solid var(--line);
  overflow: hidden;
  flex: none;
}
.music__head {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px;
  min-height: 52px;
}
.music__icon { font-size: 17px; flex: none; }
.music__now {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0; flex: 1;
}
.music__now strong {
  font-size: 13.5px; font-weight: 650; color: var(--txt);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.music__now .tiny { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music__toggle { flex: none; }

/* A locked player gets a quiet accent so owners can see the state at a glance. */
.room__music.is-dj-locked { border-color: var(--brand); }
#music-lock[aria-pressed="true"] { color: var(--brand); }

/* Chevron that reveals the video; rotates when the player is open. */
.music__chev {
  display: block; font-size: 11px; line-height: 1;
  color: var(--txt-2);
  transition: transform .22s ease;
}
#music-video-toggle[aria-expanded="true"] .music__chev { transform: rotate(180deg); }

/* The player opens at the top of the panel and pushes the page down by about
   half a viewport. The iframe always keeps a real size (onReady needs one),
   while max-height on the wrapper drives the slide open and shut. */
.music__player {
  overflow: hidden;
  max-height: 0;
  flex: none;
  background: #000;
  transition: max-height .3s ease;
}

/* Keeps the whole panel clear of the fixed top navigation when scrolled to. */
.room__music { scroll-margin-top: 72px; }
.music__player.is-open {
  max-height: min(56vh, 520px);
  position: relative;
}

/* Shown when the browser refused to start audio on its own. */
.music__unblock {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  border: 0; cursor: pointer;
  background: rgba(0, 0, 0, .68);
  color: #fff; font: inherit; font-size: 14px; font-weight: 600;
  letter-spacing: .01em;
}
.music__unblock span:first-child { font-size: 18px; }
.music__unblock:hover { background: rgba(0, 0, 0, .78); }
.music__player #yt-player,
.music__player iframe {
  display: block; width: 100%; height: min(56vh, 520px); border: 0;
}

.music__search { border-top: 1px solid var(--line); padding: 12px 14px; }
.music__form { display: flex; gap: 8px; }
.music__form .input { flex: 1; min-width: 0; padding: 9px 12px; font-size: 13.5px; }
.music__results {
  display: flex; flex-direction: column; gap: 3px;
  margin-top: 10px; max-height: 232px; overflow-y: auto;
}
.music__results:empty { display: none; }
.music__result {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 9px; border-radius: var(--r-sm);
  border: 0; background: none; width: 100%; text-align: left;
  cursor: pointer; color: var(--txt); font: inherit;
}
.music__result:hover, .music__result:focus-visible { background: var(--surface-2); }
.music__result img { width: 48px; height: 34px; border-radius: 5px; object-fit: cover; flex: none; background: var(--surface-3); }
.music__result-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.music__result-text strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music__result-text span { font-size: 11.5px; color: var(--txt-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music__result-text .music__stats {
  font-size: 11px; color: var(--txt-3);
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
}
.music__add { flex: none; font-size: 15px; opacity: .6; }

/* "Add to queue" sits next to the play row so clicking a track plays it. */
.music__queue {
  flex: none; width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--bg-1); color: var(--txt-2);
  font-size: 15px; line-height: 1; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.music__queue:hover {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.music__empty { font-size: 12.5px; color: var(--txt-3); padding: 10px 2px; }

/* "More like this" block under the player. */
.music__similar { border-top: 1px solid var(--line); padding: 12px 14px 14px; }
.music__similar-head {
  margin: 0 0 9px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--txt-3);
}
/* Keep the related list scrollable so opening the video adds about half a
   screen, not a full extra page. */
.music__similar .music__results {
  margin-top: 0;
  max-height: min(46vh, 360px);
  overflow-y: auto;
}

.music__bar {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; border-top: 1px solid var(--line);
}
.music__time { font-size: 11.5px; color: var(--txt-3); font-variant-numeric: tabular-nums; flex: none; }
.music__seek { flex: 1; min-width: 0; }

@media (max-width: 900px) {
  .music__results { max-height: 200px; }
  .music__bar { gap: 7px; padding: 8px 11px; }
}

.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg--new { animation: msg-in .24s ease-out; }
@keyframes msg-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}
.msg__body { min-width: 0; flex: 1; }
.msg__meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 2px; }
.msg__name { font-size: 12.5px; font-weight: 680; color: var(--txt-1); }
.msg__time { font-size: 11.5px; color: var(--txt-3); }
.msg__text {
  font-size: 13.5px; line-height: 1.55; color: var(--txt-2);
  word-wrap: break-word; overflow-wrap: anywhere;
}
.msg__text a { color: #a5b4fc; text-decoration: underline; text-underline-offset: 2px; }
.msg__text a:hover { color: #c7d2fe; }

.chat__form {
  display: flex; gap: 9px; padding: 12px 15px 4px;
  border-top: 1px solid var(--line); flex-shrink: 0;
}
.chat__input {
  flex: 1; padding: 11px 14px; border-radius: 11px;
  background: var(--surface); color: var(--txt-1);
  border: 1px solid var(--line); font: inherit; font-size: 13.5px;
  outline: none; transition: border-color .16s, box-shadow .16s;
}
.chat__input:focus {
  border-color: rgba(24, 119, 242, 0.6);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.13);
}
.btn--icon {
  width: 42px; height: 42px; padding: 0; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1877f2, #1461c9);
  color: #fff; border: none; cursor: pointer; font-size: 15px;
}
.btn--icon:hover { filter: brightness(1.1); }
.chat__hint { padding: 3px 17px 12px; }

/* ---- people ---- */
.people { flex: 1; overflow-y: auto; padding: 11px; display: flex; flex-direction: column; gap: 5px; }
.people__foot { padding: 11px 15px; border-top: 1px solid var(--line); }

.person {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 11px; border-radius: 10px;
  background: transparent; border: 1px solid transparent;
  color: var(--txt-2); font: inherit; font-size: 13px;
  cursor: pointer; text-align: left; transition: background .15s, border-color .15s;
}
.person:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line); }
.person:disabled { cursor: default; opacity: 0.85; }

/* Direct-message affordances in the people list. */
.person.is-dm-active {
  background: rgba(251, 191, 36, 0.10);
  border-color: rgba(251, 191, 36, 0.36);
  color: var(--txt);
}
.person__unread {
  color: #fbbf24; font-size: 10px; line-height: 1;
  margin-left: auto; animation: dm-pulse 1.6s ease-in-out infinite;
}
@keyframes dm-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.person__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Back-to-room control shown only while a direct thread is open. */
.chat__back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none;
  border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--txt-2);
  font-size: 14px; cursor: pointer;
  transition: background .15s, color .15s;
}
.chat__back:hover { background: var(--surface-2); color: var(--txt); }
.chat__peer { flex: none; }
.person.is-talking { border-color: rgba(52, 211, 153, 0.55); background: rgba(52, 211, 153, 0.07); }
.person__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person__mic { font-size: 12px; opacity: 0.8; }

/* ---- per-person volume popover ---- */
.pop {
  position: fixed; z-index: 90; width: 216px;
  padding: 15px; border-radius: 15px;
  background: var(--glass-solid, #12172a);
  border: 1px solid var(--line);
  box-shadow: 0 18px 46px -16px rgba(0, 0, 0, 0.72);
  right: 22px; bottom: 110px;
}
.pop__name { font-size: 13px; font-weight: 660; margin-bottom: 11px; }
.pop__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 11px; font-size: 12.5px; color: var(--txt-3); margin-bottom: 13px;
}
.pop__row .vol { flex: 1; }

/* ---- connection state ---- */
#conn-state[data-kind="ok"]    { color: #34d399; }
#conn-state[data-kind="warn"]  { color: #fbbf24; }
#conn-state[data-kind="error"] { color: #f87171; }

/* ---- error page ---- */
.err-page {
  max-width: 620px; margin: 0 auto;
  padding: clamp(50px, 12vh, 130px) 22px 80px;
  text-align: center;
}
.err-page h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); margin: 0 0 10px; letter-spacing: -0.025em; }
.err-code {
  font-size: clamp(3.6rem, 9vw, 6rem); font-weight: 800; line-height: 1;
  letter-spacing: -0.05em; margin-bottom: 12px;
  background: linear-gradient(135deg, #1877f2, #a855f7, #ec4899);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---- responsive ---- */
@media (max-width: 1080px) {
  .room { grid-template-columns: 232px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  /* Mobile: stage first, then chat, then the people list as a horizontal
     strip. Nothing is hidden behind a toggle any more — the chat stays alive
     under the voice box exactly like on desktop. */
  .room {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "stage"
      "chat"
      "people";
    grid-template-rows: auto auto auto;
    padding: 12px 12px 90px;
    /* Mobile grows with its content; the fixed-viewport rule is desktop-only. */
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .room__chat { height: auto; min-height: 320px; max-height: 60vh; }
  /* People become a horizontal strip; the panel must size to its content
     instead of being squashed by the grid row, and the rows must not shrink. */
  .room__people {
    max-height: none;
    order: 3;
    overflow: visible;
  }
  .people {
    flex-direction: row !important;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
    gap: 8px;
    flex: 0 0 auto;
  }
  .people .person {
    flex: 0 0 auto;
    width: 172px;
    padding: 8px 10px;
    min-height: 44px;
  }
  .people__foot { padding: 0 12px 10px; flex: 0 0 auto; }
  .room__controls {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 11px 14px calc(11px + env(safe-area-inset-bottom, 0px));
    background: var(--glass-solid, #0c1120);
    border-top: 1px solid var(--line);
    justify-content: space-between;
  }
  .ctl__label { font-size: 12px; }
  .ctl--meter { display: none; }
  .hide-sm { display: none; }
  .stage { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
}
@media (max-width: 420px) {
  .ctl { padding: 10px 13px; }
  .ctl--danger .ctl__label { display: none; }
}
