/* ==========================================================================
   StreamTogether — "lamp-lit living room"
   A deep plum night palette with one warm accent: lamplight. Everything else stays
   quiet so the screen and the people on the couch carry the room.
   ========================================================================== */

:root {
  --bg: #17131f;
  --bg-2: #1c1726;
  --surface: #221c2e;
  --surface-2: #2b2439;
  --surface-3: #352d45;
  --line: #3a3249;
  --line-soft: #2e2740;
  --text: #f1ecf7;
  --muted: #aaa1ba;
  --faint: #7d7490;
  --lamp: #f2b65a;
  --lamp-strong: #ffc976;
  --lamp-ink: #2a1b05;
  --lamp-glow: rgb(242 182 90 / 0.35);
  --good: #6fd3b8;
  --warn: #f2b65a;
  --bad: #ff7f7f;
  --danger: #e5625e;
  --focus: #ffd38a;
  --stage: #07050b;
  --shadow: 0 1px 0 rgb(255 255 255 / 0.03) inset, 0 12px 32px -18px rgb(0 0 0 / 0.7);

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Type scale, ratio ~1.2 from 16px */
  --t-xs: 0.75rem;
  --t-sm: 0.8125rem;
  --t-base: 1rem;
  --t-md: 1.125rem;
  --t-lg: 1.375rem;
  --t-xl: 1.75rem;
  --t-2xl: 2.25rem;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;
  --gap: 16px;
  --rail-w: 232px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f7f4fb;
  --bg-2: #f1ecf7;
  --surface: #ffffff;
  --surface-2: #f1ecf6;
  --surface-3: #e7e0ef;
  --line: #ddd5e8;
  --line-soft: #ebe5f2;
  --text: #221c30;
  --muted: #625a72;
  --faint: #8a8199;
  --lamp: #b8731a;
  --lamp-strong: #9a5f12;
  --lamp-ink: #ffffff;
  --lamp-glow: rgb(184 115 26 / 0.25);
  --good: #1f8a6c;
  --warn: #a8670f;
  --bad: #c33d3d;
  --danger: #c33d3d;
  --focus: #8a4fd6;
  --shadow: 0 10px 30px -18px rgb(60 30 90 / 0.35);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #f7f4fb; --bg-2: #f1ecf7; --surface: #ffffff; --surface-2: #f1ecf6; --surface-3: #e7e0ef;
    --line: #ddd5e8; --line-soft: #ebe5f2; --text: #221c30; --muted: #625a72; --faint: #8a8199;
    --lamp: #b8731a; --lamp-strong: #9a5f12; --lamp-ink: #ffffff; --lamp-glow: rgb(184 115 26 / 0.25);
    --good: #1f8a6c; --warn: #a8670f; --bad: #c33d3d; --danger: #c33d3d; --focus: #8a4fd6;
    --shadow: 0 10px 30px -18px rgb(60 30 90 / 0.35);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--t-base)/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--t-xl); }
h2 { font-size: var(--t-lg); }
h3 { font-size: var(--t-md); }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1:focus { outline: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--lamp); color: var(--lamp-ink); padding: 8px 14px; border-radius: var(--r-sm); }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: var(--t-sm); }
.grow { flex: 1; min-width: 0; }
.clamp-1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row-end { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.icon { flex: none; }

/* ------------------------------------------------------------------ boot */
.boot { display: grid; place-items: center; min-height: 100dvh; }
.boot-lamp { width: 44px; height: 44px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 60px 20px var(--lamp-glow); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(0.85); opacity: 0.7; } }

/* ------------------------------------------------------------------ buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font-weight: 700; font-size: var(--t-sm); text-decoration: none; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--lamp); border-color: var(--lamp); color: var(--lamp-ink); }
.btn-primary:hover { background: var(--lamp-strong); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-small { min-height: 32px; padding: 0 12px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.link-quiet { color: var(--muted); font-size: var(--t-sm); text-decoration: none; }
.link-quiet:hover { color: var(--text); text-decoration: underline; }

input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lamp); box-shadow: 0 0 0 3px var(--lamp-glow); }
input[type=color] { width: 56px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2); }
input[type=checkbox], input[type=radio] { accent-color: var(--lamp); width: 18px; height: 18px; flex: none; margin: 3px 0 0; }
input[type=range] { accent-color: var(--lamp); width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: var(--t-sm); }
.hint { color: var(--muted); font-size: var(--t-sm); }
.form-error { color: var(--bad); font-size: var(--t-sm); min-height: 1em; }
.form-error:empty { display: none; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.check > span { display: flex; flex-direction: column; font-weight: 700; font-size: var(--t-sm); }
.check small { font-weight: 400; color: var(--muted); font-size: var(--t-sm); }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 700; font-size: var(--t-sm); margin-bottom: 8px; padding: 0; }
details summary { cursor: pointer; font-weight: 700; font-size: var(--t-sm); color: var(--muted); padding: 8px 0; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: var(--t-xs); font-weight: 700; white-space: nowrap; }
.tag-mature { background: transparent; border: 1px solid var(--bad); color: var(--bad); }
.tag-live, .tag-connected, .tag-built_in { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.tag-upcoming, .tag-not_connected { background: color-mix(in srgb, var(--lamp) 16%, transparent); color: var(--lamp); }
.tag-needs_server_setup, .tag-not_available { background: var(--surface-3); color: var(--muted); }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--lamp); color: var(--lamp-ink); font-size: 11px; font-weight: 700; }
.icon-btn .badge, .bell .badge { position: absolute; top: 0; right: 0; }

.avatar { position: relative; display: inline-grid; place-items: center; border-radius: 50%; color: #1a1422; font-weight: 700; flex: none; overflow: hidden; font-family: var(--font-display); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.ghost { width: 32px; height: 32px; background: var(--surface-3); }

.segmented { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; margin-bottom: 20px; }
.segmented button { display: inline-flex; gap: 8px; align-items: center; padding: 8px 16px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; font-size: var(--t-sm); }
.segmented button.on { background: var(--surface-3); color: var(--text); }

.choice-group { display: grid; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; background: var(--bg-2); }
.choice:has(input:checked) { border-color: var(--lamp); background: color-mix(in srgb, var(--lamp) 8%, var(--bg-2)); }
.choice input { margin: 0; }
.choice > span:last-child { display: flex; flex-direction: column; }
.choice small { color: var(--muted); font-size: var(--t-sm); }
.choice-icon { color: var(--lamp); display: grid; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: var(--t-sm); font-weight: 700; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--muted); flex: 1; min-width: 200px; }
.search:focus-within { border-color: var(--lamp); }
.search input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding-left: 0 !important; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 100dvh; }
.rail {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 4px;
  padding: 22px 14px; border-right: 1px solid var(--line-soft); background: var(--bg);
}
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: var(--t-lg); text-decoration: none; padding: 0 10px 18px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.brand-word::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 18px 4px var(--lamp-glow); flex: none; }
.rail ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rail ul a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); color: var(--muted); text-decoration: none; font-weight: 700; font-size: var(--t-sm); }
.rail ul a:hover { color: var(--text); background: var(--surface); }
.rail ul a.on { color: var(--text); background: var(--surface); }
.rail ul a.on .icon { color: var(--lamp); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.rail-bell, .rail-me { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-md); color: var(--muted); text-decoration: none; font-weight: 700; font-size: var(--t-sm); background: transparent; border: 0; cursor: pointer; text-align: left; }
.rail-bell:hover, .rail-me:hover { background: var(--surface); color: var(--text); }
.rail-bell .badge { margin-left: auto; }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.main { padding: 32px clamp(16px, 4vw, 48px) 64px; max-width: 1240px; width: 100%; outline: none; }
.conn-banner { background: color-mix(in srgb, var(--warn) 18%, var(--bg)); color: var(--warn); text-align: center; padding: 6px; font-size: var(--t-sm); font-weight: 700; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin-top: 6px; }
.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel > h2 { margin-bottom: 14px; font-size: var(--t-md); }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.panel-head h2 { font-size: var(--t-md); }
.empty { text-align: center; padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h3 { font-size: var(--t-md); }
.empty p { max-width: 42ch; }
.empty-line { padding: 10px 0; }

.skeleton-group { display: flex; flex-direction: column; gap: 12px; padding: 8px 0; }
.skeleton { height: 18px; border-radius: 6px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ------------------------------------------------------------------ lists & cards */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-md); text-decoration: none; color: var(--text); }
.list-row:hover { background: var(--surface-2); }
.list-row[aria-disabled] { opacity: 0.55; cursor: default; }
.row-title { font-weight: 700; font-size: var(--t-sm); text-decoration: none; }
a.row-title:hover { text-decoration: underline; }
.people-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.people-list li { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-md); }
.people-list li:hover { background: var(--surface-2); }
.presence-wrap { position: relative; display: inline-flex; }
.presence-wrap.is-online::after { content: ""; position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--good); border: 2px solid var(--surface); }

.art { border-radius: var(--r-md); position: relative; overflow: hidden; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art.fill { position: absolute; inset: 0; border-radius: 0; }
.art-sm { width: 44px; height: 44px; flex: none; border-radius: var(--r-sm); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 280px); gap: 16px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.card-row > * { scroll-snap-align: start; }
.party-card { display: flex; flex-direction: column; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; transition: border-color 0.15s, transform 0.15s var(--ease); }
.party-card:hover { border-color: var(--line); transform: translateY(-2px); }
.party-card-art { position: relative; aspect-ratio: 16 / 9; background: var(--stage); }
.party-card-art > img { width: 100%; height: 100%; object-fit: cover; }
.live-pill { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); background: rgb(10 7 15 / 0.75); color: #fff; font-size: var(--t-xs); font-weight: 700; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgb(111 211 184 / 0.25); }
.party-card-art .tag-mature { position: absolute; right: 10px; top: 10px; background: rgb(10 7 15 / 0.75); }
.party-card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.party-card-body h3 { font-size: var(--t-base); }
.party-card .now { display: flex; gap: 6px; align-items: center; color: var(--lamp); font-size: var(--t-sm); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.party-card-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 6px; }
.host { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--muted); }

/* ------------------------------------------------------------------ home */
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.quick { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-soft); text-decoration: none; color: var(--text); }
.quick:hover { border-color: var(--line); background: var(--surface-2); }
.quick > span { display: flex; flex-direction: column; }
.quick small { color: var(--muted); font-size: var(--t-sm); }
.quick .icon { color: var(--lamp); }
.quick-primary { background: linear-gradient(135deg, color-mix(in srgb, var(--lamp) 22%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, var(--lamp) 40%, var(--line-soft)); }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.home-grid .panel { margin: 0; }
.span-2 { grid-column: span 2; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }

/* ------------------------------------------------------------------ auth */
.public { min-height: 100dvh; }
.auth-page { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100dvh; }
.auth-hero { position: relative; overflow: hidden; background: radial-gradient(80% 60% at 30% 25%, #3a2648 0%, var(--bg) 70%); display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; }
:root[data-theme="light"] .auth-hero { background: radial-gradient(80% 60% at 30% 25%, #e9d9f3 0%, var(--bg) 70%); }
.auth-lamp { position: absolute; left: 22%; top: 18%; width: 120px; height: 120px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 160px 60px var(--lamp-glow); opacity: 0.9; }
.auth-couch { display: flex; gap: 14px; padding: 18px 26px; border-radius: 40px 40px 18px 18px; background: color-mix(in srgb, var(--text) 8%, transparent); align-self: flex-start; margin-bottom: 28px; }
.seat { display: block; }
.auth-couch .seat { width: 54px; height: 54px; border-radius: 50%; animation: talk 4.8s ease-in-out infinite; }
@keyframes talk { 0%, 80%, 100% { box-shadow: 0 0 0 0 transparent; } 88% { box-shadow: 0 0 0 4px var(--lamp), 0 0 24px 6px var(--lamp-glow); } }
.auth-tagline { font-family: var(--font-display); font-size: var(--t-2xl); line-height: 1.1; max-width: 16ch; font-weight: 700; letter-spacing: -0.02em; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 80px); }
.auth-form { max-width: 400px; width: 100%; display: flex; flex-direction: column; }
.auth-form h1 { margin-bottom: 6px; }
.auth-form > p.muted { margin-bottom: 24px; }
.auth-switch { margin-top: 18px; font-size: var(--t-sm); color: var(--muted); }

/* ------------------------------------------------------------------ create / forms */
.create-form { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; align-items: start; }
.create-form.single { grid-template-columns: minmax(0, 680px); }
.create-main { max-width: 640px; }
.create-side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.create-art { width: 100%; aspect-ratio: 16 / 10; border-radius: var(--r-lg); }
.advanced { border-top: 1px solid var(--line-soft); padding-top: 8px; margin-bottom: 16px; }
.add-item { display: grid; grid-template-columns: 2fr 1.4fr 90px auto; gap: 8px; margin-bottom: 10px; }
.programme { list-style: none; counter-reset: prog; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.programme li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg-2); border-radius: var(--r-sm); counter-increment: prog; }
.programme li:not(.empty-line):not(.total)::before { content: counter(prog); width: 22px; color: var(--faint); font-weight: 700; font-size: var(--t-sm); }
.programme li.total, .programme li.empty-line { background: transparent; }

/* ------------------------------------------------------------------ friends / profile / settings */
.add-friend { display: flex; gap: 10px; flex-wrap: wrap; }
.search-results { list-style: none; padding: 0; margin: 8px 0 0; }
.result { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; background: transparent; border-radius: var(--r-sm); cursor: pointer; text-align: left; }
.result:hover { background: var(--surface-2); }
.profile-head { display: flex; gap: 20px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.profile-head .bio { margin-top: 8px; max-width: 60ch; }
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 24px; }
.settings-nav a { padding: 9px 12px; border-radius: var(--r-sm); color: var(--muted); text-decoration: none; font-weight: 700; font-size: var(--t-sm); }
.settings-nav a:hover { color: var(--text); background: var(--surface); }
.settings-nav a.on { color: var(--text); background: var(--surface); box-shadow: inset 3px 0 0 var(--lamp); }
.settings-content { max-width: 680px; }
.settings-content > h2 { margin-bottom: 12px; }
.settings-content > p.muted { margin-bottom: 18px; }
.settings-content h3 { margin: 24px 0 8px; font-size: var(--t-base); }
.settings-form { display: flex; flex-direction: column; }
.avatar-preview { margin-bottom: 16px; }
.danger-zone { border-top: 1px solid var(--line-soft); margin-top: 28px; padding-top: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.meter { flex: 1; height: 8px; background: var(--bg-2); border-radius: var(--r-pill); overflow: hidden; border: 1px solid var(--line); }
.meter-fill { height: 100%; width: 0; background: var(--good); transition: width 0.06s linear; }
.source-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.source { padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.source-head { display: flex; align-items: center; gap: 10px; }
.source-head .btn { margin-left: auto; }

/* uploads */
.library { display: flex; flex-direction: column; gap: 10px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 1.5px dashed var(--line); border-radius: var(--r-lg); text-align: center; cursor: pointer; color: var(--muted); background: var(--bg-2); }
.dropzone strong { color: var(--text); }
.dropzone:hover, .dropzone.over { border-color: var(--lamp); color: var(--text); }
.upload-progress { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-progress .bar { height: 6px; flex: 1 1 100%; background: var(--lamp); border-radius: var(--r-pill); width: 0; transition: width 0.2s; }
.file-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--bg-2); }
.file-row.status-unsupported .small, .file-row.status-failed .small { color: var(--bad); }
.file-row.status-processing .icon { animation: breathe 1.6s ease-in-out infinite; }

/* join */
.join-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.join-card { width: min(520px, 100%); background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.join-art { aspect-ratio: 16 / 7; border-radius: var(--r-md); }
.join-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.art.pulse { width: 64px; height: 64px; border-radius: 50%; background: var(--lamp) !important; box-shadow: 0 0 60px 16px var(--lamp-glow); animation: breathe 2.4s ease-in-out infinite; align-self: center; }

/* ------------------------------------------------------------------ dialogs, toasts, popovers */
.dialog { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.6); }
.dialog-wide { width: min(760px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgb(8 5 12 / 0.6); backdrop-filter: blur(2px); }
.dialog[open] { animation: rise 0.18s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 22px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dialog-head h2 { font-size: var(--t-md); }
.dialog-body { padding: 4px 22px 22px; }
.dialog-body h3 { font-size: var(--t-base); margin: 16px 0 8px; }
.toasts { position: fixed; z-index: 1000; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(460px, calc(100vw - 24px)); }
.toast { pointer-events: auto; padding: 11px 16px; border-radius: var(--r-md); background: var(--surface-3); color: var(--text); font-size: var(--t-sm); font-weight: 700; box-shadow: 0 12px 30px -10px rgb(0 0 0 / 0.6); animation: rise 0.2s var(--ease); border-left: 3px solid var(--muted); }
.toast-success { border-left-color: var(--good); }
.toast-error { border-left-color: var(--bad); }
.toast.leaving { opacity: 0; transition: opacity 0.25s; }
.notif-pop { position: fixed; z-index: 500; left: calc(var(--rail-w) + 8px); bottom: 70px; width: 340px; max-height: 60dvh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.6); }
.notif-pop ul { list-style: none; margin: 0; padding: 0; }
.notif-pop li a { display: flex; flex-direction: column; padding: 10px; border-radius: var(--r-sm); text-decoration: none; font-size: var(--t-sm); }
.notif-pop li a:hover { background: var(--surface-2); }
.notif-pop li.unread a span { font-weight: 700; }
.notif-pop li.unread a { box-shadow: inset 3px 0 0 var(--lamp); }
.notice { padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--line-soft); margin-bottom: 14px; display: flex; flex-direction: column; gap: 4px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; font-size: var(--t-sm); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.on { color: var(--text); border-bottom-color: var(--lamp); }
.add-panel { min-height: 220px; }
.add-panel .row input { flex: 1; }
.result-grid { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.result-card { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; font-size: var(--t-sm); }
.result-card img { aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-sm); width: 100%; }
.result-card:hover span:first-of-type { color: var(--lamp); }
.track-list { list-style: none; padding: 0; margin: 12px 0 0; }
.track { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: 0; background: transparent; cursor: pointer; border-radius: var(--r-sm); text-align: left; }
.track:hover { background: var(--surface-2); }
.track img, .track-art { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; background: var(--surface-3); }
.track .grow { display: flex; flex-direction: column; }
.play-now { margin-top: 12px; border-top: 1px solid var(--line-soft); }
.member-menu { display: flex; flex-direction: column; gap: 12px; }
.mod-tools { border-top: 1px solid var(--line-soft); padding-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.mod-tools select { width: auto; flex: 1; }
.invite-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.invite-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--bg-2); border-radius: var(--r-sm); }

/* ==========================================================================
   Party room
   ========================================================================== */
.bare { min-height: 100dvh; }
.party-loading { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 16px; }
.party {
  --party-hue: 38;
  --side-w: 360px;
  height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(70% 50% at 35% 0%, hsl(var(--party-hue) 40% 16% / 0.55), transparent 70%), var(--bg);
}
:root[data-theme="light"] .party { background: radial-gradient(70% 50% at 35% 0%, hsl(var(--party-hue) 60% 88% / 0.7), transparent 70%), var(--bg); }
.party-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; min-height: 56px; }
.party-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.party-title h1 { font-size: var(--t-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.party-head-actions { display: flex; gap: 6px; align-items: center; }
.party-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: 12px; padding: 0 12px 12px; }
.party.side-closed .party-grid { grid-template-columns: minmax(0, 1fr) 0; gap: 0; }
.party.side-closed .party-side { display: none; }
.party-main { min-height: 0; display: flex; flex-direction: column; gap: 10px; }

/* stage: the screen in the room */
.stage-wrap {
  position: relative; flex: 1; min-height: 220px; border-radius: var(--r-lg); overflow: hidden; background: var(--stage);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.04), 0 30px 90px -40px hsl(var(--party-hue) 70% 50% / 0.55);
  display: flex; flex-direction: column;
}
.stage-box { position: relative; flex: 1; min-height: 0; display: flex; }
.stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
.stage > * { grid-area: 1 / 1; }
.media-el { width: 100%; height: 100%; object-fit: contain; background: var(--stage); }
.media-el.audio-only { height: 0; }
.stage:has(.media-el.audio-only)::before { content: ""; width: min(40%, 220px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, hsl(var(--party-hue) 70% 70%), hsl(var(--party-hue) 50% 22%)); box-shadow: 0 0 80px 10px hsl(var(--party-hue) 70% 50% / 0.35); animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.yt-host, .yt-host > div, .yt-host iframe { width: 100%; height: 100%; border: 0; }
.sp-host { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px; text-align: center; color: #fff; }
.sp-art { width: min(260px, 50vmin); aspect-ratio: 1; border-radius: var(--r-md); background: hsl(var(--party-hue) 30% 20%); overflow: hidden; box-shadow: 0 30px 60px -20px rgb(0 0 0 / 0.8); }
.sp-art img { width: 100%; height: 100%; object-fit: cover; }
.sp-meta { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.sp-meta strong { font-family: var(--font-display); font-size: var(--t-lg); }
.ext-host { width: 100%; height: 100%; display: grid; place-items: center; padding: 20px; color: #fff; }
.ext-card { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 460px; }
.ext-card h2 { font-size: var(--t-xl); }
.ext-provider { color: var(--lamp); font-weight: 700; }
.ext-clock-wrap { display: flex; flex-direction: column; align-items: center; margin-top: 6px; }
.ext-clock { font-family: var(--font-display); font-size: clamp(2.5rem, 7vw, 4.5rem); font-variant-numeric: tabular-nums; line-height: 1; }
.ext-host.counting .ext-clock { color: var(--lamp); }
.ext-status { font-size: var(--t-base); min-height: 1.5em; color: #e9e2f2; }
.ext-why { color: #cfc6dc; max-width: 40ch; }
.ext-why summary { color: #cfc6dc; }

.stage-overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; padding: 16px; }
.stage-overlay > * { pointer-events: auto; }
.stage-overlay.active { background: rgb(7 5 11 / 0.55); }
.overlay-card { background: rgb(30 24 40 / 0.92); color: #f1ecf7; border: 1px solid rgb(255 255 255 / 0.08); border-radius: var(--r-lg); padding: 22px 26px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; max-width: 420px; }
.overlay-card strong { font-family: var(--font-display); font-size: var(--t-md); }
.overlay-card .muted { color: #b9b0c8; }
.overlay-cta { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 30px; border-radius: var(--r-lg); border: 0; background: var(--lamp); color: var(--lamp-ink); cursor: pointer; font-weight: 700; box-shadow: 0 0 60px 10px var(--lamp-glow); }
.overlay-cta small { font-weight: 400; }
.overlay-chip { position: absolute; top: 14px; padding: 6px 14px; border-radius: var(--r-pill); background: rgb(30 24 40 / 0.85); color: #fff; font-size: var(--t-sm); font-weight: 700; }
.big-count { font-family: var(--font-display); font-size: 3rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--lamp); }

.transport { position: relative; z-index: 2; padding: 6px 14px 10px; background: linear-gradient(transparent, rgb(7 5 11 / 0.9) 40%); color: #f1ecf7; }
.seek-row { display: flex; align-items: center; gap: 10px; }
.time { font-variant-numeric: tabular-nums; font-size: var(--t-xs); min-width: 42px; }
.time.muted { color: #b9b0c8; text-align: right; }
.seek { flex: 1; height: 18px; }
.transport-row { display: flex; align-items: center; gap: 12px; }
.transport-left, .transport-right { display: flex; align-items: center; gap: 4px; }
.transport .icon-btn { color: #d9d1e6; }
.transport .icon-btn:hover { background: rgb(255 255 255 / 0.08); color: #fff; }
.play-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--lamp); color: var(--lamp-ink); display: grid; place-items: center; cursor: pointer; }
.play-btn:hover { background: var(--lamp-strong); }
.play-btn.locked, .icon-btn.locked { opacity: 0.55; }
.now-title { flex: 1; min-width: 0; font-size: var(--t-sm); }
.now-title .muted { color: #b9b0c8; }
.sync-indicator { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: var(--r-pill); border: 0; background: rgb(255 255 255 / 0.06); color: #e9e2f2; cursor: help; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.good { background: var(--good); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.stage-wrap:fullscreen { border-radius: 0; }
.stage-wrap:fullscreen .transport { position: absolute; left: 0; right: 0; bottom: 0; opacity: 0; transition: opacity 0.25s; }
.stage-wrap:fullscreen:hover .transport, .stage-wrap:fullscreen:focus-within .transport { opacity: 1; }

/* the couch: everyone in the room, seated under the screen */
.couch {
  display: flex; gap: 14px; align-items: flex-end; overflow-x: auto; padding: 10px 18px 12px; min-height: 94px;
  border-radius: 40px 40px var(--r-lg) var(--r-lg);
  background: linear-gradient(color-mix(in srgb, var(--text) 5%, transparent), color-mix(in srgb, var(--text) 2%, transparent));
  scrollbar-width: thin;
}
.couch .seat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; width: 70px; }
.couch .seat .avatar { box-shadow: 0 0 0 3px var(--bg); transition: box-shadow 0.12s ease-out; }
.couch .seat.speaking .avatar { box-shadow: 0 0 0 3px var(--lamp), 0 0 26px 8px var(--lamp-glow); }
.couch .seat.video { width: 168px; }
.couch .seat video { width: 168px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-md); background: #000; transition: box-shadow 0.12s; }
.couch .seat video.mirror { transform: scaleX(-1); }
.couch .seat.video.speaking video { box-shadow: 0 0 0 3px var(--lamp), 0 0 26px 6px var(--lamp-glow); }
.seat-name { display: flex; align-items: center; gap: 3px; font-size: var(--t-xs); color: var(--muted); max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.seat-crown { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); padding: 0 6px; border-radius: var(--r-pill); background: var(--lamp); color: var(--lamp-ink); font-size: 10px; font-weight: 700; }
.couch.has-video { min-height: 140px; }

.controlbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); flex-wrap: wrap; }
.cb-group { display: flex; align-items: center; gap: 6px; }
.cb-media { flex: 1; max-width: 420px; }
.ctl { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; font-weight: 700; font-size: var(--t-sm); }
.ctl:hover { background: var(--surface-3); }
.ctl.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.ctl:disabled { opacity: 0.45; cursor: not-allowed; }
.ctl-small { min-height: 32px; padding: 0 10px; font-size: var(--t-xs); white-space: nowrap; }
.ctl-small[aria-pressed="true"] { border-color: var(--lamp); color: var(--lamp); }
.ctl-leave { color: var(--bad); border-color: transparent; background: transparent; }
.ctl-leave:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.vol { max-width: 150px; }
.duck-chip { padding: 3px 10px; border-radius: var(--r-pill); color: var(--lamp); background: color-mix(in srgb, var(--lamp) 14%, transparent); opacity: 0; transition: opacity 0.3s; white-space: nowrap; }
.duck-chip.on { opacity: 1; }
.mesh-note { max-width: 220px; }

/* side panel */
.party-side { min-height: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; }
.side-tabs { display: flex; padding: 6px 6px 0; gap: 2px; border-bottom: 1px solid var(--line-soft); }
.side-tab { flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 6px; padding: 10px 6px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; font-size: var(--t-sm); border-bottom: 2px solid transparent; }
.side-tab.on { color: var(--text); border-bottom-color: var(--lamp); }
.side-panels { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.side-panels > section { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* chat */
.chat-scroll { position: relative; flex: 1; min-height: 0; display: flex; }
.chat-list { list-style: none; margin: 0; padding: 12px 8px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.msg { position: relative; display: flex; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); }
.msg:hover { background: var(--surface-2); }
.msg.grouped { padding-top: 1px; }
.msg-gutter { width: 32px; flex: none; }
.msg-main { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-head strong { font-size: var(--t-sm); }
.msg-head time { font-size: var(--t-xs); color: var(--faint); }
.msg-body { font-size: var(--t-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-quote { border-left: 2px solid var(--line); padding-left: 8px; color: var(--muted); margin: 2px 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.msg-actions { position: absolute; right: 6px; top: -14px; display: none; align-items: center; gap: 2px; padding: 2px; border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid var(--line); }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { display: flex; }
.msg-actions .icon-btn { width: 28px; height: 28px; }
.react-row { display: flex; }
.react-row button { border: 0; background: transparent; cursor: pointer; padding: 2px 4px; border-radius: 6px; font-size: 15px; }
.react-row button:hover { background: var(--surface-2); }
.reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.reaction { border: 1px solid var(--line); background: var(--bg-2); border-radius: var(--r-pill); padding: 0 8px; font-size: var(--t-xs); cursor: pointer; line-height: 22px; }
.reaction.mine { border-color: var(--lamp); background: color-mix(in srgb, var(--lamp) 14%, transparent); }
.msg-system { text-align: center; color: var(--faint); font-size: var(--t-xs); padding: 4px 8px; }
.msg-system:empty { display: none; }
.new-pill { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); border: 0; padding: 5px 12px; border-radius: var(--r-pill); background: var(--lamp); color: var(--lamp-ink); font-weight: 700; font-size: var(--t-xs); cursor: pointer; }
.chat-notice { padding: 8px 12px; color: var(--muted); border-top: 1px solid var(--line-soft); }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-top: 1px solid var(--line-soft); background: var(--bg-2); }
.chat-compose { position: relative; display: flex; align-items: flex-end; gap: 4px; padding: 10px; border-top: 1px solid var(--line-soft); }
.chat-compose textarea { min-height: 40px; max-height: 120px; resize: none; border-radius: 20px; padding: 9px 14px; }
.send-btn { color: var(--lamp); }
.emoji-pop { position: absolute; bottom: 58px; left: 8px; z-index: 5; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; border-radius: var(--r-md); background: var(--surface-3); border: 1px solid var(--line); box-shadow: 0 12px 30px -10px rgb(0 0 0 / 0.5); }
.emoji-pop button { border: 0; background: transparent; font-size: 20px; padding: 4px; border-radius: 6px; cursor: pointer; }
.emoji-pop button:hover { background: var(--surface-2); }

/* queue */
.queue-body, .people-body { overflow-y: auto; padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.q-section-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
.q-section-head h3, .people-body h3 { font-size: var(--t-sm); color: var(--muted); margin-top: 6px; }
.q-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.q-item { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r-sm); }
.q-item:hover { background: var(--surface-2); }
.q-item.current { background: color-mix(in srgb, var(--lamp) 10%, transparent); box-shadow: inset 3px 0 0 var(--lamp); }
.q-item[draggable="true"] { cursor: grab; }
.q-item.dragging { opacity: 0.4; }
.q-item.drop-target { box-shadow: inset 0 2px 0 var(--lamp); }
.q-thumb { width: 64px; height: 36px; border-radius: 4px; object-fit: cover; flex: none; background: var(--surface-3); }
.q-icon { display: grid; place-items: center; color: var(--muted); }
.q-actions { display: flex; opacity: 0.5; }
.q-item:hover .q-actions, .q-item:focus-within .q-actions { opacity: 1; }
.q-actions .icon-btn { width: 30px; height: 30px; }
.q-history { margin-top: 8px; }
.marathon-progress { padding: 12px; background: var(--bg-2); border-radius: var(--r-md); display: flex; flex-direction: column; gap: 8px; }
.mp-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.mp-bar { display: flex; gap: 3px; }
.mp-bar span { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); }
.mp-bar span.done { background: color-mix(in srgb, var(--lamp) 55%, var(--surface-3)); }
.mp-bar span.now { background: var(--lamp); box-shadow: 0 0 10px var(--lamp-glow); }

/* people */
.invite-box { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.waitlist { padding: 10px; border-radius: var(--r-md); background: color-mix(in srgb, var(--lamp) 8%, transparent); }
.member-list li.speaking .avatar { box-shadow: 0 0 0 2px var(--lamp); }
.member-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.role { color: var(--lamp); font-weight: 700; }
.sync-chip { font-variant-numeric: tabular-nums; }
.sync-chip.good { color: var(--good); }
.sync-chip.warn { color: var(--warn); }
.sync-chip.bad { color: var(--bad); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  :root { --rail-w: 76px; }
  .rail { padding: 18px 10px; align-items: center; }
  .rail .brand-word { font-size: 0; padding: 0 0 18px; }
  .rail .brand-word::before { width: 18px; height: 18px; }
  .rail ul a, .rail-bell, .rail-me { justify-content: center; padding: 10px; position: relative; }
  .rail ul a span, .rail-bell > span:not(.badge), .rail-me span { display: none; }
  .rail-bell .badge { position: absolute; top: 2px; right: 2px; }
  .party { --side-w: 320px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; z-index: 50; bottom: 0; left: 0; right: 0; top: auto; height: auto; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line-soft); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); }
  .rail .brand-word, .rail-foot { display: none; }
  .rail ul { flex-direction: row; justify-content: space-around; width: 100%; }
  .rail ul li:nth-child(6), .rail ul li:nth-child(7) { display: none; }
  .rail ul a { flex-direction: column; gap: 2px; padding: 6px 10px; font-size: 10px; }
  .rail ul a span { display: block; }
  .topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
  .small-brand { font-size: var(--t-md); padding: 0; }
  .main { padding: 20px 16px 96px; }
  .notif-pop { left: 12px; right: 12px; width: auto; top: 56px; bottom: auto; }
  .quick-actions, .home-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { min-height: 220px; padding: 24px; }
  .auth-tagline { font-size: var(--t-xl); }
  .auth-lamp { width: 70px; height: 70px; left: auto; right: 14%; top: 18%; }
  .auth-panel { padding: 24px 16px 40px; }
  .create-form { grid-template-columns: 1fr; }
  .create-side { position: static; order: -1; }
  .create-art { aspect-ratio: 16 / 5; }
  .settings { grid-template-columns: 1fr; gap: 12px; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .settings-nav a { white-space: nowrap; }
  .settings-nav a.on { box-shadow: inset 0 -2px 0 var(--lamp); }
  .grid-2, .add-item { grid-template-columns: 1fr; }

  /* party: player on top, panel below, controls docked */
  .party { height: auto; min-height: 100dvh; overflow: visible; }
  .party-head { position: sticky; top: 0; z-index: 10; background: var(--bg); }
  .party-head .tag { display: none; }
  .party-grid, .party.side-closed .party-grid { display: flex; flex-direction: column; padding: 0 0 76px; gap: 0; }
  .party-main { gap: 0; }
  .stage-wrap { flex: none; min-height: 0; border-radius: 0; position: sticky; top: 56px; z-index: 5; }
  .stage-box { flex: none; aspect-ratio: 16 / 9; }
  .stage-wrap:has(.ext-host), .stage-wrap:has(.sp-host) { position: relative; top: 0; }
  .stage-box:has(.ext-host), .stage-box:has(.sp-host) { aspect-ratio: auto; min-height: 340px; }
  .overlay-card { padding: 14px 16px; gap: 8px; }
  .overlay-card p { font-size: var(--t-sm); }
  .transport { padding: 4px 10px 6px; }
  .now-title { display: none; }
  .sync-text { display: none; }
  .couch { border-radius: 0; min-height: 80px; padding: 10px 12px; }
  .controlbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; border-radius: 0; border-width: 1px 0 0; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); flex-wrap: nowrap; }
  .ctl span { display: none; }
  .ctl { padding: 0 12px; }
  .cb-media .vol, .duck-chip, .mesh-note, .ctl-small { display: none; }
  .party-side, .party.side-closed .party-side { display: flex; border-radius: 0; border-width: 1px 0 0; min-height: 60dvh; }
  .chat-list { max-height: none; }
}
@media (max-width: 420px) {
  .party-head-actions .btn { display: none; }
  .couch .seat.video, .couch .seat video { width: 132px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media (forced-colors: active) {
  .couch .seat.speaking .avatar, .couch .seat.speaking video { outline: 3px solid CanvasText; }
}
