:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #0b1020;
  color: #edf2ff;
}

* { box-sizing: border-box; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: #38bdf8; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.address-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin: 28px 0; }
#deviceId { font-size: clamp(24px, 4vw, 38px); font-weight: 700; letter-spacing: .05em; font-variant-numeric: tabular-nums; }
#notice { color: #bae6fd; min-height: 24px; }
.toggle { display: flex; align-items: center; gap: 10px; }
summary { cursor: pointer; }
@media (max-width: 760px) { .home-grid { grid-template-columns: 1fr; } }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top left, #172554 0, #0b1020 38rem); }
main { width: min(1050px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 64px; }
header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
h1 { margin: 5px 0 0; font-size: clamp(28px, 5vw, 46px); letter-spacing: -0.04em; }
h2 { margin: 0 0 18px; font-size: 20px; }
h3 { margin: 0 0 12px; font-size: 15px; color: #b8c6ea; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .14em; color: #7dd3fc; font-size: 12px; font-weight: 700; }
.card { margin-top: 16px; padding: 22px; border: 1px solid #263354; border-radius: 16px; background: rgba(15, 23, 42, .9); box-shadow: 0 18px 55px rgba(0,0,0,.2); }
.setup { margin-top: 0; }
.badge { padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.offline { background: #3f1d2b; color: #fda4af; }
.online { background: #12372a; color: #86efac; }
.session { background: #163056; color: #93c5fd; }
.role-picker, .permissions, .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.role-picker label, .permissions label { padding: 11px 13px; border: 1px solid #334365; border-radius: 10px; background: #111a30; }
.field { display: grid; gap: 7px; margin: 13px 0; color: #b8c6ea; font-size: 13px; }
input, textarea, button { font: inherit; }
input, textarea { width: 100%; border: 1px solid #344364; border-radius: 9px; padding: 11px 12px; background: #0a1225; color: #f8fafc; outline: none; }
input:focus, textarea:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,.12); }
button { border: 1px solid #3d4b69; border-radius: 9px; padding: 10px 14px; background: #1b2741; color: #edf2ff; cursor: pointer; font-weight: 700; }
button:hover:not(:disabled) { filter: brightness(1.15); }
button:disabled { opacity: .42; cursor: not-allowed; }
.primary { background: #0284c7; border-color: #0ea5e9; }
.danger { background: #7f1d1d; border-color: #b91c1c; }
.small { padding: 6px 9px; font-size: 12px; }
.identity { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-top: 18px; padding: 12px; border-radius: 10px; background: #08101f; }
.identity span { color: #7dd3fc; font-size: 12px; font-weight: 700; }
.identity code { overflow-wrap: anywhere; }
.request { margin-top: 18px; padding: 16px; border-left: 4px solid #f59e0b; background: #261d0d; border-radius: 8px; }
.request p { color: #fde68a; }
.session-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 22px; }
video { width: 100%; min-height: 240px; display: block; border-radius: 12px; background: #020617; object-fit: contain; }
.muted { color: #8492b5; font-size: 13px; }
.received { margin-top: 18px; padding: 12px; border-radius: 8px; background: #08101f; color: #a7f3d0; white-space: pre-wrap; }
.clipboard-field { margin-top: 22px; }
.log-title { display: flex; align-items: center; justify-content: space-between; }
.log-title h2 { margin: 0; }
pre { min-height: 110px; max-height: 260px; overflow: auto; margin: 14px 0 0; color: #9fb0d9; white-space: pre-wrap; font: 12px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; }
.hidden { display: none !important; }

@media (max-width: 760px) {
  .session-grid { grid-template-columns: 1fr; }
  header { align-items: stretch; flex-direction: column; }
  .badge { align-self: flex-start; }
  .identity { grid-template-columns: 1fr auto; }
  .identity span { grid-column: 1 / -1; }
}
