:root {
  --bg: #0b1020;
  --bg2: #10162a;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --text: #e6edf6;
  --muted: #9aa7bd;
  --accent: #4f8cff;
  --accent-2: #59f1b6;
  --danger: #ff6b6b;
  --ring: rgba(79, 140, 255, 0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #1a2450 0%, transparent 60%),
              radial-gradient(1200px 600px at 90% 0%, #0c3a4a 0%, transparent 60%),
              linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
}

.page {
  max-width: 920px;
  margin: 28px auto 48px;
  padding: 0 18px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.welcome {
  margin-bottom: 18px;
}

.welcome-card {
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.15), rgba(89, 241, 182, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.welcome h1 {
  margin: 0 0 10px;
  font-size: 28px;
  color: #4f8cff;
}

.lead {
  margin: 0 0 16px;
  color: #cbd5f5;
  max-width: 560px;
}

.enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2d6bff, #4f8cff);
  color: white;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(79, 140, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.enter:hover {
  filter: brightness(1.08);
}

.enter.disabled {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(0.1);
}

.welcome-meta {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.brand {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(89, 241, 182, 0.5);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.status-pill.connected { background: rgba(34, 197, 94, 0.15); color: #a7f3d0; }
.status-pill.connecting { background: rgba(245, 158, 11, 0.15); color: #fde68a; }
.status-pill.error { background: rgba(239, 68, 68, 0.15); color: #fecaca; }

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.6);
}

.status-pill.connected .dot { background: #22c55e; box-shadow: 0 0 10px rgba(34, 197, 94, 0.6); }
.status-pill.connecting .dot { background: #f59e0b; box-shadow: 0 0 10px rgba(245, 158, 11, 0.6); }

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: 0.4px;
  color: #cbd5f5;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label {
  font-size: 12px;
  color: var(--muted);
}

input, select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 12, 24, 0.7);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

button {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, #2d6bff, #4f8cff);
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(79, 140, 255, 0.25);
}

button.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 500;
  box-shadow: none;
}

button.mic-allowed {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.45);
}

button.mic-blocked {
  background: rgba(239, 68, 68, 0.18);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.45);
}

button.mic-request {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.45);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.conn {
  display: grid;
  gap: 8px;
}

.conn.horizontal {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.conn-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.conn-row span {
  color: var(--muted);
}

.conn-row strong {
  font-weight: 600;
}

.conn-row.good {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

.conn-row.warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
}

.conn-row.bad {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.conn-meter {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.meter-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.meter-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meter-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff6b6b, #f59e0b, #22c55e);
  transition: width 0.4s ease;
}

.meter-meta {
  font-size: 12px;
  color: var(--muted);
}

.people {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-auto-rows: 180px;
  gap: 12px;
  align-content: start;
}

.video-banner {
  display: none;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
  font-size: 12px;
}

.video-banner.show {
  display: block;
}

.video-tile {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(7, 12, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 160px;
  cursor: pointer;
}

.video-tile.active {
  grid-column: 1 / -1;
  min-height: 360px;
  grid-row: span 2;
}

.video-tile.hidden {
  display: none;
}

.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #05080f;
}

.video-tile.local video.mirror {
  transform: scaleX(-1);
}

.video-label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #e5e7eb;
  font-size: 11px;
  letter-spacing: 0.3px;
}

.video-fullscreen {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.55);
  color: #e5e7eb;
  font-size: 11px;
  cursor: pointer;
}

.video-fullscreen:hover {
  filter: brightness(1.1);
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.person-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person-actions {
  display: flex;
  gap: 6px;
}

.person-actions .tiny {
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 10px;
}

.person .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

.person .meta {
  display: flex;
  flex-direction: column;
}

.person .name {
  font-weight: 600;
  font-size: 14px;
}

.person .state {
  font-size: 12px;
  color: var(--muted);
}

.log {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: #070b16;
  color: #cbd5f5;
  padding: 12px;
  border-radius: 12px;
  min-height: 120px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.log-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.log-actions .ghost {
  padding: 8px 12px;
  font-size: 12px;
}

.log .line { margin-bottom: 6px; }
.log .time { color: #7dd3fc; margin-right: 6px; }

.foot {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.status-card {
  background: rgba(7, 12, 24, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
}

.status-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.status-value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 6px;
}

.status-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.status-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.status-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .actions { flex-direction: column; }
  .grid { grid-template-columns: 1fr; }
  .conn.horizontal { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: 1fr; }
  .status-actions { flex-direction: column; align-items: stretch; }
}

