/* Private Live — mobile-first UI */
:root {
  color-scheme: dark;
  --bg: #07110f;
  --bg-deep: #040b09;
  --surface: #0d1b18;
  --surface-2: #12241f;
  --surface-3: #183029;
  --text: #f3f7f5;
  --text-soft: #d9e2de;
  --muted: #93a69f;
  --subtle: #60736c;
  --border: rgba(213, 235, 226, 0.13);
  --border-strong: rgba(213, 235, 226, 0.22);
  --accent: #68e0ae;
  --accent-bright: #8bf0c6;
  --accent-ink: #06281f;
  --accent-soft: rgba(104, 224, 174, 0.13);
  --danger: #ff746d;
  --danger-soft: rgba(255, 116, 109, 0.13);
  --warning: #f6c76b;
  --warning-soft: rgba(246, 199, 107, 0.13);
  --blue: #74b9ff;
  --purple: #b99cff;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  --container: 1180px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

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

svg {
  display: block;
  fill: currentColor;
}

img,
video {
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong {
  letter-spacing: -0.025em;
}

[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;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 9px 14px;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(104, 224, 174, 0.72);
  outline-offset: 3px;
}

.container {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 24px rgba(104, 224, 174, 0.18);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-compact {
  font-size: 15px;
}

.brand-compact .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.brand-compact .brand-mark svg {
  width: 20px;
  height: 20px;
}

.text-link {
  color: var(--text-soft);
  transition: color 160ms ease;
}

.text-link:hover {
  color: var(--accent);
}

.eyebrow,
.kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 7px 11px;
  border: 1px solid rgba(104, 224, 174, 0.2);
  border-radius: 999px;
  background: rgba(104, 224, 174, 0.07);
}

.kicker {
  margin-bottom: 4px;
}

.pulse-dot {
  position: relative;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(104, 224, 174, 0.1);
}

.pulse-dot::after {
  position: absolute;
  inset: -5px;
  border: 1px solid var(--accent);
  border-radius: inherit;
  content: "";
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.8; transform: scale(0.55); }
  70%, 100% { opacity: 0; transform: scale(1.35); }
}

.glass-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(20, 43, 36, 0.92), rgba(10, 23, 20, 0.9));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

/* Buttons and forms */
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-weight: 720;
  line-height: 1.2;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.button svg {
  width: 19px;
  height: 19px;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 28px rgba(104, 224, 174, 0.14);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-bright);
}

.button-secondary {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled) {
  border-color: rgba(104, 224, 174, 0.4);
  background: var(--accent-soft);
}

.button-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--text-soft);
}

.button-danger {
  background: var(--danger);
  color: #2c0908;
}

.button-large {
  width: 100%;
  min-height: 52px;
  padding-inline: 20px;
  font-size: 16px;
}

.button-compact {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.stack-form {
  display: grid;
  gap: 18px;
}

.field-group {
  position: relative;
  display: grid;
  gap: 7px;
}

.field-group label,
.copy-field label {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 680;
}

.field-group > input,
.field-group > select,
.field-group > textarea,
.input-shell,
.select-control,
.search-box {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field-group > input,
.field-group > select,
.select-control {
  min-height: 46px;
  padding: 0 13px;
}

.field-group > textarea {
  min-height: 90px;
  padding: 11px 13px;
  resize: vertical;
}

.input-shell {
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
}

.input-shell:focus-within,
.field-group > input:focus,
.field-group > select:focus,
.field-group > textarea:focus,
.select-control:focus,
.search-box:focus-within {
  border-color: rgba(104, 224, 174, 0.62);
  background: rgba(104, 224, 174, 0.035);
  box-shadow: 0 0 0 3px rgba(104, 224, 174, 0.09);
  outline: 0;
}

.input-shell > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--muted);
}

.input-shell input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: var(--subtle);
  opacity: 1;
}

.input-with-action {
  padding-right: 5px;
}

.input-action {
  min-width: 44px;
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.field-help,
.field-error {
  margin: 0;
  font-size: 12px;
}

.field-help {
  color: var(--muted);
}

.field-error {
  color: #ffaaa6;
}

.form-error {
  margin-top: -5px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 116, 109, 0.24);
  border-radius: 9px;
  background: var(--danger-soft);
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.privacy-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--accent);
}

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 2px solid rgba(104, 224, 174, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.toast {
  position: fixed;
  z-index: 1000;
  right: 16px;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 16px;
  padding: 12px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #172d27;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}

/* Landing */
.landing-page {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 84% 12%, rgba(44, 132, 102, 0.18), transparent 30%),
    radial-gradient(circle at 5% 75%, rgba(74, 105, 173, 0.09), transparent 28%),
    var(--bg);
}

.landing-page::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.site-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
}

.header-link {
  padding: 8px 0;
  font-size: 13px;
  font-weight: 650;
}

.hero {
  display: grid;
  min-height: calc(100vh - 175px);
  align-items: center;
  gap: 42px;
  padding-block: 48px 58px;
}

.hero-copy h1 {
  max-width: 720px;
  margin-bottom: 22px;
  font-size: clamp(38px, 10vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.hero-copy h1 span {
  color: var(--accent);
}

.hero-lead {
  max-width: 580px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 16px;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 0;
  margin: 0;
  color: var(--text-soft);
  list-style: none;
  font-size: 13px;
  font-weight: 650;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 7px;
}

.feature-list svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.entry-card,
.access-card {
  padding: 24px;
}

.entry-card-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
}

.entry-card-head h2 {
  margin: 0;
  font-size: 22px;
}

.secure-icon {
  display: grid;
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
}

.secure-icon svg {
  width: 23px;
  height: 23px;
}

.trust-strip {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  padding-block: 24px 34px;
  border-top: 1px solid var(--border);
}

.trust-strip div {
  display: grid;
  gap: 2px;
  padding-inline: 24px;
  border-right: 1px solid var(--border);
}

.trust-strip div:first-child { padding-left: 0; }
.trust-strip div:last-child { border: 0; }
.trust-strip strong { font-size: 14px; }
.trust-strip span { color: var(--muted); font-size: 12px; }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 20px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  color: var(--subtle);
  font-size: 11px;
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Watch page */
.watch-page {
  background: #08110f;
}

.watch-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 17, 15, 0.88);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.private-badge,
.status-badge {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 720;
  line-height: 1;
}

.private-badge svg {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.watch-main {
  padding-block: 24px 50px;
}

.center-state {
  display: grid;
  min-height: 60vh;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
}

.empty-state {
  max-width: 500px;
  padding: 42px 24px;
  margin: 12vh auto 0;
  text-align: center;
}

.empty-state h1 {
  margin-bottom: 10px;
  font-size: 26px;
}

.empty-state > p:not(.kicker) {
  margin-bottom: 24px;
  color: var(--muted);
}

.empty-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}

.empty-icon svg { width: 28px; height: 28px; }

.access-layout {
  display: grid;
  gap: 20px;
}

.room-cover {
  position: relative;
  min-height: 290px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 70% 30%, rgba(104, 224, 174, 0.22), transparent 25%),
    linear-gradient(135deg, #18352d 0%, #08110f 68%);
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(3, 10, 8, 0.92), transparent 75%);
}

.room-cover > .status-badge {
  position: absolute;
  top: 16px;
  left: 16px;
}

.cover-copy {
  position: absolute;
  right: 22px;
  bottom: 20px;
  left: 22px;
}

.cover-copy h1 {
  margin-bottom: 7px;
  font-size: 28px;
  line-height: 1.16;
}

.cover-copy > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.access-intro {
  margin: -9px 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.code-input-shell input {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.viewer-layout {
  display: grid;
  gap: 20px;
}

.player-card {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: #020504;
  box-shadow: 0 24px 65px rgba(0, 0, 0, 0.34);
}

.video-shell,
.admin-preview-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #020504;
}

.video-shell video,
.admin-preview-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(27, 75, 61, 0.36), transparent 42%),
    linear-gradient(135deg, #0e201b, #030706);
  background-position: center;
  background-size: cover;
}

.player-state {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 38px 20px 20px;
  text-align: center;
}

.player-state-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  color: var(--accent);
}

.player-state-icon svg { width: 22px; height: 22px; }
.player-state .kicker { margin-bottom: 2px; }
.player-state h2 { margin-bottom: 4px; font-size: clamp(19px, 5vw, 30px); }
.player-state > p:not(.kicker) { margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.player-state .button { min-height: 40px; }

.player-topbar {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.status-live {
  border-color: rgba(255, 116, 109, 0.35);
  background: rgba(190, 45, 40, 0.84);
  color: #fff;
}

.status-live::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.status-preview {
  border-color: rgba(116,185,255,.35);
  background: rgba(45, 104, 165, .22);
  color: #a9d3ff;
}

.status-scheduled,
.status-offline {
  color: var(--text-soft);
}

.status-warning {
  border-color: rgba(246,199,107,.35);
  background: rgba(117, 83, 23, .45);
  color: #ffe0a2;
}

.status-ended {
  color: var(--muted);
}

.viewer-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,.85);
  font-size: 11px;
  font-weight: 700;
}

.viewer-count svg { width: 13px; height: 13px; }

.room-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 2px 4px;
}

.room-summary h1 {
  margin-bottom: 4px;
  font-size: 22px;
  line-height: 1.25;
}

.room-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
}

.meta-status {
  color: var(--accent);
  font-weight: 750;
}

.room-host {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.room-summary .button-quiet {
  min-width: 44px;
  padding-inline: 11px;
  border-color: var(--border);
  font-size: 0;
}

.viewer-sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
}

.info-card {
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.info-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
}

.card-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.card-heading h2 {
  margin: 0;
  font-size: 15px;
}

.heading-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}

.heading-icon-warm {
  background: var(--warning-soft);
  color: var(--warning);
}

.heading-icon svg { width: 16px; height: 16px; }

.watch-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 3px 2px 0;
  color: var(--subtle);
  font-size: 11px;
}

.watch-tip svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; }

/* Admin login */
.admin-page {
  background: #f3f5f2;
  color: #12211c;
}

.login-view {
  display: grid;
  min-height: 100vh;
}

.login-aside {
  display: none;
}

.login-panel {
  display: grid;
  align-content: center;
  padding: 24px 20px calc(32px + env(safe-area-inset-bottom));
}

.login-mobile-brand {
  position: absolute;
  top: 22px;
  left: 20px;
}

.login-mobile-brand .brand { color: #12211c; }

.login-card {
  width: min(100%, 410px);
  margin: 60px auto 0;
}

.login-card .kicker { color: #248262; }
.login-card h1 { margin-bottom: 8px; font-size: 34px; }
.login-intro { margin-bottom: 28px; color: #687a73; }
.login-card .field-group label { color: #344740; }
.login-card .input-shell {
  border-color: #d5ded9;
  background: #fff;
  color: #12211c;
}
.login-card .input-shell:focus-within { border-color: #45aa84; background: #fff; }
.login-card .input-shell input { color: #12211c; }
.login-card .input-shell > svg { color: #7b8e87; }
.login-card .button-primary { background: #173d32; color: #effbf6; box-shadow: 0 12px 30px rgba(23,61,50,.16); }
.login-card .button-primary:hover:not(:disabled) { background: #205444; }
.login-card .field-error { color: #b83f3b; }
.login-card .form-error { border-color: #f1c0bd; background: #fff0ef; }
.login-help { margin: 20px 0 0; color: #84928d; font-size: 12px; text-align: center; }

/* Admin shell */
.admin-shell {
  min-height: 100vh;
  background: #f3f5f2;
  color: #12211c;
}

.admin-mobile-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid #dce3df;
  background: rgba(248, 250, 248, 0.94);
  backdrop-filter: blur(12px);
}

.admin-mobile-header .brand { color: #12211c; }
.admin-mobile-header .icon-button { border-color: #dce3df; }
.admin-mobile-header .status-badge { border-color: #d5ded9; color: #52645d; }

.nav-scrim {
  position: fixed;
  z-index: 44;
  inset: 0;
  background: rgba(0, 0, 0, 0.44);
}

.admin-sidebar {
  position: fixed;
  z-index: 45;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: min(82vw, 280px);
  flex-direction: column;
  padding: 22px 16px max(18px, env(safe-area-inset-bottom));
  transform: translateX(-105%);
  background: #091511;
  color: #eff7f3;
  box-shadow: 14px 0 50px rgba(0,0,0,.25);
  transition: transform 180ms ease;
}

.admin-shell.nav-open .admin-sidebar { transform: translateX(0); }
.admin-brand { padding: 0 8px 22px; }

.admin-nav {
  display: grid;
  gap: 5px;
  margin-top: 18px;
}

.nav-label {
  margin: 0 11px 6px;
  color: #6f827a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  min-height: 45px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #9eb0a9;
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
  text-align: left;
}

.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.is-active { background: rgba(104,224,174,.12); color: #82e8be; }
.nav-item svg { width: 19px; height: 19px; }

.nav-count {
  min-width: 21px;
  padding: 1px 6px;
  margin-left: auto;
  border-radius: 999px;
  background: rgba(104,224,174,.15);
  font-size: 10px;
  text-align: center;
}

.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.08);
}

.admin-identity {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 9px;
}

.admin-identity > span {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 800;
}

.admin-identity div { display: grid; min-width: 0; }
.admin-identity strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.admin-identity small { color: #71837c; font-size: 10px; }
.sidebar-bottom .icon-button { width: 38px; height: 38px; border-color: rgba(255,255,255,.1); color: #81948c; }

.admin-main {
  padding: 24px 16px 70px;
}

.admin-panel {
  max-width: 1340px;
  margin: 0 auto;
}

.panel-header {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
}

.panel-header .kicker,
.admin-card .kicker { color: #278465; }
.panel-header h1 { margin-bottom: 4px; font-size: clamp(27px, 6vw, 38px); line-height: 1.2; }
.panel-header > div > p:last-child { margin: 0; color: #71817b; font-size: 13px; }

.panel-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.select-label { color: #6e7c77; font-size: 11px; font-weight: 700; }
.admin-shell .select-control {
  width: auto;
  min-width: 145px;
  min-height: 38px;
  border-color: #d9e1dd;
  background: #fff;
  color: #183029;
}
.admin-shell .button-secondary { border-color: #d7dfdb; background: #fff; color: #263b34; }
.admin-shell .button-quiet { color: #546760; }
.admin-shell .button-primary { background: #173f33; color: #effbf6; box-shadow: none; }
.admin-shell .button-primary:hover:not(:disabled) { background: #215445; }
.admin-shell .button-danger { color: #fff; }

.inline-loading {
  display: flex;
  min-height: 160px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #74847e;
  font-size: 13px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card,
.admin-card {
  border: 1px solid #dde4e0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(20, 45, 36, 0.035);
}

.stat-card {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
}

.stat-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon-green { background: #e5f6ef; color: #218563; }
.stat-icon-blue { background: #e9f3ff; color: #397fbf; }
.stat-icon-warm { background: #fff3df; color: #b77817; }
.stat-icon-purple { background: #f2edff; color: #7655c2; }

.stat-card > div { display: grid; min-width: 0; }
.stat-card span:not(.stat-icon) { color: #708079; font-size: 10px; }
.stat-card strong { overflow: hidden; margin: 2px 0; font-size: clamp(18px, 5vw, 25px); line-height: 1.15; text-overflow: ellipsis; }
.stat-card small { color: #a0aca7; font-size: 9px; }

.control-grid,
.setup-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.admin-card {
  padding: 17px;
}

.admin-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.admin-card-header h2 { margin: 0; font-size: 17px; }
.admin-card .private-badge { border-color: #d9e1dd; background: #f7f9f8; color: #60726b; }
.admin-card .private-badge svg { color: #368b6c; }

.admin-preview-shell {
  border-radius: 11px;
  background: #07110f;
}

.admin-preview-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 18px;
  color: #e8f1ed;
  text-align: center;
}

.admin-preview-state strong { margin: 10px 0 2px; font-size: 14px; }
.admin-preview-state > span:last-child { color: #82968e; font-size: 11px; }
.admin-preview-shell > .status-badge { position: absolute; z-index: 3; top: 10px; left: 10px; }

.signal-rings {
  position: relative;
  display: block;
  width: 48px;
  height: 35px;
}
.signal-rings i { position: absolute; right: 50%; bottom: 0; width: 6px; border-radius: 3px; background: #31544a; transform: translateX(50%); }
.signal-rings i:nth-child(1) { height: 10px; margin-right: 15px; }
.signal-rings i:nth-child(2) { height: 20px; }
.signal-rings i:nth-child(3) { height: 32px; margin-right: -15px; }

.health-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7a8984;
  font-size: 10px;
  font-weight: 700;
}
.health-dot i,
.mini-dot { width: 7px; height: 7px; border-radius: 50%; background: #aeb9b5; }
.health-dot.health-online { color: #278465; }
.health-dot.health-online i,
.health-list .is-online .mini-dot { background: #34a87c; box-shadow: 0 0 0 4px #e3f4ed; }
.health-dot.health-warning { color: #a56c19; }
.health-dot.health-warning i { background: #d89936; }

.broadcast-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
  border-radius: 11px;
  background: #f5f8f6;
}

.broadcast-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: #e7edea;
  color: #71827b;
}
.broadcast-icon svg { width: 20px; height: 20px; }
.broadcast-state strong { display: block; margin-bottom: 1px; font-size: 13px; }
.broadcast-state p { margin: 0; color: #7d8d87; font-size: 11px; }
.live-control-card .button-large { min-height: 48px; font-size: 14px; }
.control-hint { margin: 10px 0 0; color: #8c9994; font-size: 10px; text-align: center; }

.copy-field { display: grid; gap: 5px; margin-bottom: 12px; }
.copy-field label { color: #556861; font-size: 11px; }
.copy-field > div { display: flex; overflow: hidden; border: 1px solid #d9e1dd; border-radius: 10px; background: #f7f9f8; }
.copy-field input { min-width: 0; min-height: 43px; flex: 1; padding: 0 11px; border: 0; outline: 0; background: transparent; color: #263d35; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.copy-field button { min-width: 48px; border: 0; border-left: 1px solid #d9e1dd; background: #fff; color: #357d64; cursor: pointer; font-size: 11px; font-weight: 750; }
.copy-field button:hover { background: #edf7f3; }

.obs-steps { display: grid; gap: 8px; padding: 0; margin: 17px 0 13px; list-style: none; color: #65766f; font-size: 11px; }
.obs-steps li { display: flex; align-items: center; gap: 8px; }
.obs-steps span { display: grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; border-radius: 6px; background: #e8f4ef; color: #267b5d; font-size: 9px; font-weight: 800; }
.setting-tip { margin: 0; padding: 10px 12px; border-radius: 9px; background: #fff6e6; color: #876228; font-size: 10px; }

.health-list { margin: 0; }
.health-list > div { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf0ee; }
.health-list > div:last-child { border: 0; }
.health-list dt { color: #71817b; font-size: 11px; }
.health-list dd { display: flex; align-items: center; gap: 7px; margin: 0; color: #263a33; font-size: 11px; font-weight: 680; text-align: right; }

/* Invites and settings */
.invite-list-card { padding: 0; overflow: hidden; }
.list-toolbar { display: grid; gap: 9px; padding: 14px; border-bottom: 1px solid #e4e9e6; }
.search-box { display: flex; min-height: 42px; align-items: center; gap: 8px; padding: 0 11px; border-color: #dce3df; background: #f7f9f8; color: #1f342c; }
.search-box svg { width: 18px; height: 18px; color: #87958f; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #1f342c; }
.list-toolbar .select-control { width: 100%; }
.invite-list { min-height: 170px; }

.invite-row {
  display: grid;
  gap: 10px;
  padding: 15px;
  border-bottom: 1px solid #e8ecea;
}
.invite-row:last-child { border: 0; }
.invite-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.invite-note { color: #677871; font-size: 11px; }
.invite-details { display: flex; flex-wrap: wrap; gap: 10px 15px; color: #7b8b85; font-size: 10px; }
.invite-row-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.invite-status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: #edf3f0; color: #60726b; font-size: 9px; font-weight: 750; }
.invite-status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.invite-status.active { background: #e7f6ef; color: #25805f; }
.invite-status.expired, .invite-status.exhausted { background: #fff4e1; color: #a36c1e; }
.invite-status.disabled { background: #f1f2f1; color: #8c9793; }
.invite-row .button { min-height: 32px; padding: 6px 9px; font-size: 10px; }
.list-empty { padding: 45px 20px; color: #7c8b85; text-align: center; }
.list-empty strong { display: block; margin-bottom: 3px; color: #33473f; }

.settings-form { max-width: 880px; }
.settings-grid { display: grid; gap: 16px; }
.admin-shell .field-group label,
.modal-dialog .field-group label { color: #43564f; }
.admin-shell .field-group > input,
.admin-shell .field-group > select,
.admin-shell .field-group > textarea,
.modal-dialog .field-group > input,
.modal-dialog .field-group > select {
  border-color: #d7e0db;
  background: #fff;
  color: #1b3028;
}
.admin-shell .field-group > input:focus,
.admin-shell .field-group > select:focus,
.admin-shell .field-group > textarea:focus,
.modal-dialog .field-group > input:focus,
.modal-dialog .field-group > select:focus { border-color: #50a987; background: #fff; }
.character-count { position: absolute; right: 10px; bottom: 7px; color: #96a29d; font-size: 9px; pointer-events: none; }
.field-group:has(textarea) .character-count { bottom: 8px; }

.toggle-row {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #e8ecea;
  cursor: pointer;
}
.toggle-row > span { display: grid; }
.toggle-row strong { font-size: 12px; }
.toggle-row small { color: #81908a; font-size: 10px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { position: relative; width: 42px; height: 24px; flex: 0 0 auto; border-radius: 999px; background: #ccd5d1; transition: background 150ms; }
.toggle-row i::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.15); content: ""; transition: transform 150ms; }
.toggle-row input:checked + i { background: #368d6e; }
.toggle-row input:checked + i::after { transform: translateX(18px); }
.toggle-row input:focus-visible + i { outline: 3px solid rgba(54,141,110,.25); outline-offset: 2px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 20px; margin-top: 20px; border-top: 1px solid #e8ecea; }
.form-actions .field-error { margin-right: auto; color: #b83f3b; }

/* Dialogs */
.modal-dialog {
  width: min(calc(100% - 28px), 520px);
  max-height: min(88vh, 720px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: #172b24;
  box-shadow: 0 24px 80px rgba(0,0,0,.32);
}
.modal-dialog::backdrop { background: rgba(3, 11, 8, .62); backdrop-filter: blur(3px); }
.dialog-card { padding: 22px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.dialog-header h2, .confirm-card h2, .generated-card h2 { margin: 0; font-size: 22px; }
.dialog-header .icon-button { width: 38px; height: 38px; border-color: #dce3df; color: #62736c; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.modal-dialog .button-secondary { border-color: #d7dfdb; background: #fff; color: #263b34; }
.modal-dialog .button-primary { background: #173f33; color: #fff; }
.modal-dialog .field-error { color: #b83f3b; }
.confirm-card, .generated-card { text-align: center; }
.confirm-card p, .generated-card > p { color: #6e7d77; }
.confirm-card .dialog-actions, .generated-card .dialog-actions { justify-content: center; }
.confirm-icon, .success-icon { display: grid; width: 52px; height: 52px; margin: 0 auto 14px; place-items: center; border-radius: 15px; background: #fff0e8; color: #c66732; }
.confirm-icon svg, .success-icon svg { width: 27px; height: 27px; }
.success-icon { background: #e7f6ef; color: #23805e; }
.generated-codes { max-height: 260px; padding: 14px; overflow: auto; border-radius: 10px; background: #f3f6f4; color: #19362c; font-size: 13px; text-align: left; white-space: pre-wrap; }

.admin-page .toast { background: #173f33; color: #fff; }

/* Breakpoints */
@media (min-width: 640px) {
  .container { width: min(100% - 48px, var(--container)); }
  .entry-card, .access-card { padding: 30px; }
  .hero { padding-block: 70px; }
  .trust-strip { display: grid; }
  .toast { right: 24px; bottom: 24px; left: auto; width: max-content; max-width: min(430px, calc(100vw - 48px)); text-align: left; }
  .watch-main { padding-block: 35px 60px; }
  .access-layout { grid-template-columns: minmax(0, 1.3fr) minmax(330px, .7fr); align-items: stretch; }
  .room-cover { min-height: 430px; }
  .access-card { display: flex; flex-direction: column; justify-content: center; }
  .room-summary .button-quiet { font-size: 12px; }
  .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-card { padding: 16px; }
  .admin-main { padding: 34px 26px 80px; }
  .panel-header { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .panel-header-actions { justify-content: flex-end; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-span-2 { grid-column: 1 / -1; }
  .list-toolbar { grid-template-columns: minmax(240px, 1fr) auto; }
  .list-toolbar .select-control { width: auto; }
  .invite-row { grid-template-columns: minmax(180px, 1.1fr) 1.5fr auto; align-items: center; }
  .invite-row-actions { min-width: 150px; justify-content: flex-end; }
}

@media (min-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1.2fr) minmax(360px, .72fr); gap: 60px; }
  .hero-copy h1 { font-size: clamp(54px, 6.2vw, 75px); }
  .viewer-layout { grid-template-columns: minmax(0, 1fr) 290px; align-items: start; }
  .player-card { border-radius: 18px; }
  .info-card { padding: 20px; }
  .control-grid { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); }
  .setup-grid { grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); }
  .admin-card { padding: 20px; }
}

@media (min-width: 960px) {
  .login-view { grid-template-columns: minmax(0, 1.05fr) minmax(430px, .75fr); }
  .login-aside {
    position: relative;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    padding: 38px 48px;
    background:
      radial-gradient(circle at 70% 20%, rgba(104,224,174,.22), transparent 31%),
      linear-gradient(145deg, #0c211b, #06100d 70%);
    color: #f3f7f5;
  }
  .login-aside::after { position: absolute; right: -12%; bottom: -22%; width: 65%; aspect-ratio: 1; border: 1px solid rgba(104,224,174,.12); border-radius: 50%; content: ""; box-shadow: 0 0 0 50px rgba(104,224,174,.025), 0 0 0 100px rgba(104,224,174,.018); }
  .login-aside-copy { position: relative; z-index: 2; }
  .login-aside-copy h1 { max-width: 600px; margin-bottom: 20px; font-size: clamp(43px, 5vw, 70px); line-height: 1.08; }
  .login-aside-copy > p:last-child { max-width: 440px; color: #8ea39b; font-size: 16px; }
  .signal-visual { display: flex; height: 70px; align-items: flex-end; gap: 8px; }
  .signal-visual span { width: 5px; border-radius: 4px; background: rgba(104,224,174,.4); animation: equalize 1.8s ease-in-out infinite alternate; }
  .signal-visual span:nth-child(1) { height: 20%; }
  .signal-visual span:nth-child(2) { height: 55%; animation-delay: -.3s; }
  .signal-visual span:nth-child(3) { height: 90%; animation-delay: -.8s; }
  .signal-visual span:nth-child(4) { height: 45%; animation-delay: -.5s; }
  .signal-visual span:nth-child(5) { height: 70%; animation-delay: -1.1s; }
  @keyframes equalize { to { height: 18%; opacity: .45; } }
  .login-panel { padding-inline: clamp(50px, 7vw, 100px); }
  .login-mobile-brand { display: none; }
  .login-card { margin-top: 0; }

  .admin-mobile-header { display: none; }
  .admin-sidebar { width: 238px; transform: none; box-shadow: none; }
  .admin-main { min-height: 100vh; padding: 42px 38px 80px 276px; }
  .admin-brand { padding-bottom: 26px; }
  .nav-scrim { display: none !important; }
}

@media (min-width: 1200px) {
  .viewer-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; }
  .admin-sidebar { width: 252px; }
  .admin-main { padding-left: 294px; padding-right: 42px; }
  .stat-card { gap: 13px; padding: 18px; }
  .stat-icon { width: 40px; height: 40px; }
}

@media (max-width: 430px) {
  .private-badge { font-size: 0; }
  .private-badge svg { width: 16px; height: 16px; }
  .admin-card .private-badge { font-size: 9px; }
  .room-cover { min-height: 260px; }
  .cover-copy h1 { font-size: 24px; }
  .stat-card { display: grid; }
}

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