:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1c212a;
  --line: #2b3140;
  --text: #edf2ff;
  --muted: #a0abc2;
  --accent: #86b7ff;
  --danger: #ff7d7d;
  --ok: #9bffb0;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: linear-gradient(180deg, #0c0f14 0%, #131823 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  padding: 24px;
}

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

button,
select,
input {
  font: inherit;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

p { margin: 0; }

.shell {
  max-width: 1360px;
  margin: 0 auto;
}

.shell-center {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
}

.panel {
  background: rgba(23, 26, 33, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel-hero {
  width: min(760px, 100%);
  padding: 34px;
  display: grid;
  gap: 28px;
}

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

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.grid-call {
  padding: 18px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
}

.sidebar,
.content {
  min-width: 0;
}

.stack {
  display: flex;
  flex-direction: column;
}

.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.muted,
.label,
.status,
.micro-note {
  color: var(--muted);
}

.label {
  font-size: 13px;
}

.micro-note {
  font-size: 12px;
  line-height: 1.5;
}

.input,
.button,
.link-box {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  min-height: 48px;
  padding: 0 14px;
  font-size: 15px;
}

.button {
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}

.button:hover,
.mini-button:hover {
  transform: translateY(-1px);
  border-color: #3b4f79;
}

.button-primary {
  background: linear-gradient(180deg, #4c8bff 0%, #3174ef 100%);
  border-color: transparent;
}

.button-ghost {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button-danger {
  border-color: rgba(255, 125, 125, 0.4);
  color: #ffd8d8;
}

.status-error {
  color: #ffb1b1;
}

.or-line {
  position: relative;
  text-align: center;
  color: var(--muted);
}

.or-line::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--line);
}

.or-line span {
  position: relative;
  display: inline-block;
  padding: 0 10px;
  background: rgba(23, 26, 33, 0.9);
}

.link-box {
  display: flex;
  align-items: center;
  word-break: break-all;
}

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

.participant {
  min-height: 58px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  gap: 12px;
}

.participant-left {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.participant-title {
  font-size: 15px;
  font-weight: 600;
}

.participant-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.participant-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.badge,
.media-chip,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.badge {
  min-width: 56px;
}

.badge-on {
  background: rgba(155, 255, 176, 0.12);
  color: var(--ok);
}

.badge-off {
  background: rgba(255, 125, 125, 0.12);
  color: #ffb0b0;
}

.signal-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
}

.signal-bar {
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.signal-bar:nth-child(2) { height: 11px; }
.signal-bar:nth-child(3) { height: 14px; }
.signal-bar:nth-child(4) { height: 17px; }
.signal-bar:nth-child(5) { height: 20px; }
.signal-bar.is-on { background: var(--accent); }

.media-grid {
  min-height: 250px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  align-content: start;
}

.screens {
  min-height: 420px;
}

.empty-state {
  display: grid;
  place-items: center;
}

.screen-placeholder {
  color: var(--muted);
  text-align: center;
}

.media-card,
.screen-card,
.camera-card {
  overflow: hidden;
  border-radius: 18px;
  background: #0b0d12;
  border: 1px solid var(--line);
  min-width: 0;
}

.media-card.is-self {
  border-color: rgba(134, 183, 255, 0.5);
}

.screen-meta {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.media-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.media-chip {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.mini-button {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  transition: transform 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
}

.media-card video {
  width: 100%;
  display: block;
  background: #000;
}

.screen-video {
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.camera-video {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.media-card:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.media-card:fullscreen video {
  width: 100%;
  height: 100%;
}

.media-card:fullscreen .screen-video,
.media-card:fullscreen .camera-video {
  object-fit: contain;
}

@media (max-width: 1080px) {
  .grid-call {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  body {
    padding: 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .participant {
    flex-direction: column;
    align-items: flex-start;
  }

  .participant-badges {
    justify-content: flex-start;
  }
}
