:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0a0d12;
  color: #eef2f7;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #18202c 0, #0a0d12 45%); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0; }
.brand { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 28px; }
.brand h1 { margin: 5px 0 10px; font-size: clamp(2.1rem, 5vw, 4rem); letter-spacing: -.04em; }
.brand p { margin: 0; color: #a9b3c2; max-width: 700px; line-height: 1.6; }
.eyebrow, .label { color: #7f8da2; text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; }
.card { border: 1px solid #273142; background: rgba(16, 21, 29, .9); border-radius: 16px; box-shadow: 0 18px 60px rgba(0,0,0,.22); }
.start-card { max-width: 560px; padding: 28px; }
button { border: 1px solid #344157; color: #eef2f7; background: #1b2431; border-radius: 10px; padding: 11px 16px; }
button:hover { background: #243044; }
.primary { background: #4f7cff; border-color: #4f7cff; font-weight: 700; }
.primary:hover { background: #638aff; }
.danger { color: #ff9a9a; border-color: #573238; }
.ghost { background: transparent; }
.small { padding: 7px 10px; font-size: .85rem; }
input { width: 100%; border: 1px solid #344157; border-radius: 10px; background: #0b1017; color: #fff; padding: 12px 14px; text-transform: uppercase; letter-spacing: .12em; outline: none; }
input:focus { border-color: #668dff; box-shadow: 0 0 0 3px rgba(79,124,255,.16); }
label { display: block; margin-bottom: 8px; color: #b8c2d0; }
.inline { display: flex; gap: 10px; }
.divider { display: flex; align-items: center; gap: 12px; color: #707d90; margin: 20px 0; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: #273142; }
.badge { display: inline-flex; align-items: center; white-space: nowrap; border: 1px solid #334158; background: #151c26; color: #c9d2df; border-radius: 999px; padding: 7px 11px; font-size: .82rem; }
.badge.online { border-color: #245c44; color: #8ce2b9; background: #10271d; }
.badge.muted { color: #8390a3; }
.room { display: grid; gap: 16px; }
.toolbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 18px 20px; }
.room-code-row { display: flex; gap: 10px; align-items: center; margin-top: 5px; }
.room-code-row strong { font-size: 1.45rem; letter-spacing: .12em; }
.toolbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.viewer { position: relative; min-height: min(70vh, 720px); overflow: hidden; display: grid; place-items: center; background: #05070a; }
.viewer video { width: 100%; height: 100%; max-height: 76vh; object-fit: contain; background: #000; }
.empty-state { text-align: center; color: #8491a4; padding: 40px; }
.empty-state h2 { color: #dbe2ec; margin-bottom: 8px; }
.empty-state p { margin: 0; }
.screen-icon { font-size: 3rem; color: #53647d; }
.sharing-tag { position: absolute; top: 14px; left: 14px; background: rgba(9,12,17,.82); border: 1px solid #39475c; padding: 8px 11px; border-radius: 9px; font-size: .82rem; backdrop-filter: blur(8px); }
.error { color: #ffb2b2; border: 1px solid #5f3238; background: #2a1518; padding: 11px 13px; border-radius: 10px; margin: 0; }
.hint { color: #728096; font-size: .84rem; line-height: 1.5; margin: 0 4px; }
.play-remote { position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.media-status { margin-top: 10px; }

.diagnostics { margin-top: 6px; padding: 20px; display: grid; gap: 18px; background: rgba(10, 14, 20, .96); }
.diagnostics-header { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.diagnostics-header h2 { margin: 4px 0 4px; font-size: 1.35rem; }
.diagnostics-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.diagnostic-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.diag-overview-item { border: 1px solid #273142; border-radius: 11px; padding: 12px 14px; background: #0b1017; }
.diag-overview-item span { display: block; color: #738197; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 5px; }
.diag-overview-item strong { font-size: .95rem; overflow-wrap: anywhere; }
.diagnostic-section-title { color: #8e9bb0; text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 700; margin-bottom: 9px; }
.diagnostic-peers { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.diag-peer-card, .diag-peer-empty { border: 1px solid #273142; background: #0b1017; border-radius: 11px; padding: 13px; min-width: 0; }
.diag-peer-empty { color: #738197; }
.diag-peer-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.mini-state { font-size: .72rem; border: 1px solid #334158; border-radius: 999px; padding: 4px 7px; color: #aeb8c7; }
.diag-kv { margin: 0; display: grid; grid-template-columns: minmax(110px, .75fr) minmax(0, 1.7fr); gap: 6px 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .74rem; }
.diag-kv dt { color: #6f7d91; }
.diag-kv dd { margin: 0; color: #c8d1de; overflow-wrap: anywhere; }
.diagnostic-log-wrap { border-top: 1px solid #273142; padding-top: 14px; }
.diagnostic-log-wrap summary { cursor: pointer; color: #c3ccd8; font-size: .86rem; user-select: none; }
.diagnostic-log { min-height: 220px; max-height: 430px; overflow: auto; margin: 12px 0 0; padding: 14px; border: 1px solid #273142; border-radius: 11px; background: #05070a; color: #b9c5d5; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .72rem; line-height: 1.55; }

[hidden] { display: none !important; }
@media (max-width: 720px) {
  .shell { padding: 28px 0; }
  .brand, .toolbar, .diagnostics-header { flex-direction: column; }
  .brand .badge { align-self: flex-start; }
  .toolbar-actions, .diagnostics-actions { justify-content: flex-start; width: 100%; }
  .inline { flex-direction: column; }
  .viewer { min-height: 50vh; }
  .diagnostic-overview { grid-template-columns: 1fr; }
  .diagnostic-peers { grid-template-columns: 1fr; }
  .diag-kv { grid-template-columns: 1fr; }
  .diag-kv dt { margin-top: 5px; }
}
