:root {
  color-scheme: light;
  --ink: #182034;
  --muted: #647089;
  --line: #dfe5ee;
  --surface: #ffffff;
  --canvas: #f3f6fa;
  --nav: #10182c;
  --mint: #2cbbaa;
  --violet: #596bff;
  --amber: #dd941c;
  --danger: #c94955;
  --shadow: 0 16px 40px rgba(26, 42, 72, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, a { font: inherit; }
button { color: inherit; }
a { color: #4355d6; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 10; padding: .75rem 1rem; color: white; background: #000; border-radius: .5rem; }
.skip-link:focus { top: 1rem; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 20px 24px; color: #c9d2e6; background: var(--nav); }
.brand { display: flex; align-items: center; gap: 12px; color: white; font-weight: 750; font-size: 1.1rem; text-decoration: none; letter-spacing: -.02em; }
.brand-button { width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.brand-mark { position: relative; width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(145deg, #17233c, #0b1122); box-shadow: inset 0 0 0 1px #2a3959; }
.brand-mark::before, .brand-mark span { position: absolute; content: ""; border: solid #4ed9ca; border-right-color: transparent; border-radius: 50%; }
.brand-mark::before { inset: 8px; transform: rotate(-14deg); }
.brand-mark span { inset: 13px; border-width: 2px; border-color: #e9f3ff transparent #e9f3ff #e9f3ff; transform: rotate(12deg); }
.brand-mark::after { position: absolute; content: ""; top: 18px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: #ffcc66; }
.environment { margin: 10px 0 28px 52px; color: #8491ad; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
nav { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; padding: 11px 13px; border: 0; border-radius: 10px; color: #acb8cf; background: transparent; text-decoration: none; text-align: left; font-size: .9rem; cursor: pointer; }
.nav-item span { width: 20px; color: #71809f; text-align: center; }
.nav-item:hover, .nav-item:focus-visible { color: white; background: #19243d; outline: none; }
.nav-item.active { color: white; background: linear-gradient(90deg, rgba(56, 214, 197, .18), rgba(89, 107, 255, .13)); box-shadow: inset 3px 0 var(--mint); }
.nav-item.active span { color: #55ded0; }
.sidebar-note { margin-top: auto; display: grid; gap: 6px; padding: 16px; border: 1px solid #263554; border-radius: 12px; background: #151f36; }
.sidebar-note strong { color: #edf4ff; font-size: .82rem; }
.sidebar-note span { color: #8e9bb5; font-size: .75rem; line-height: 1.5; }
main { min-width: 0; padding: 30px clamp(22px, 4vw, 58px) 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-weight: 700; font-size: .69rem; letter-spacing: .11em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.7rem, 3vw, 2.25rem); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 1.15rem; letter-spacing: -.025em; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.icon-button, .profile { border: 0; background: transparent; }
.icon-button { position: relative; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); }
.notification-dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border: 2px solid white; border-radius: 50%; background: var(--danger); }
.profile { display: flex; align-items: center; gap: 10px; color: var(--ink); text-align: left; }
.profile > span:first-child { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; color: white; background: #4657d7; font-size: .76rem; font-weight: 800; }
.profile-copy { display: grid; font-size: .82rem; font-weight: 700; }
.profile-copy small { color: var(--muted); font-size: .7rem; font-weight: 500; }
.mobile-menu { display: none; }
.notice { display: flex; gap: 12px; margin: 0 0 32px; padding: 13px 16px; border: 1px solid #cdd9fc; border-radius: 12px; background: #edf2ff; }
.notice-icon { display: grid; place-items: center; flex: 0 0 24px; height: 24px; border-radius: 50%; color: white; background: #5366de; font-weight: 800; }
.notice strong { font-size: .82rem; }
.notice p { margin: 2px 0 0; color: #53607b; font-size: .78rem; }
.section-heading, .panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.updated { color: var(--muted); font-size: .75rem; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.metric, .panel { border: 1px solid rgba(216, 224, 235, .9); background: var(--surface); box-shadow: var(--shadow); }
.metric { position: relative; min-height: 150px; padding: 22px; border-radius: 16px; overflow: hidden; }
.metric::after { content: ""; position: absolute; right: -30px; bottom: -50px; width: 110px; height: 110px; border-radius: 50%; background: linear-gradient(135deg, transparent, rgba(89,107,255,.05)); }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 16px; border-radius: 9px; font-weight: 800; }
.metric-icon.mint { color: #078577; background: #daf6f1; }
.metric-icon.violet { color: #4d59d3; background: #e8eaff; }
.metric-icon.amber { color: #a36805; background: #fff0d0; }
.metric-icon.blue { color: #2174b8; background: #dff1ff; }
.metric p { margin-bottom: 5px; color: var(--muted); font-size: .78rem; }
.metric strong { display: block; margin-bottom: 5px; font-size: 1.65rem; letter-spacing: -.04em; }
.metric small { color: var(--muted); font-size: .7rem; }
.good { color: #168274; font-weight: 700; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(280px, .8fr); gap: 18px; margin-top: 26px; }
.content-grid > *, .two-column > *, .panel { min-width: 0; }
.panel { padding: 22px; border-radius: 16px; }
.panel-heading { margin-bottom: 18px; }
.panel-heading a { font-size: .75rem; font-weight: 700; text-decoration: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th { padding: 10px 12px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: left; font-size: .67rem; text-transform: uppercase; letter-spacing: .08em; }
td { padding: 16px 12px; border-bottom: 1px solid #edf0f5; color: #4f5c73; }
tbody tr:last-child td { border-bottom: 0; }
.device-name { display: block; margin-bottom: 3px; color: var(--ink); font-weight: 750; }
td small { display: block; color: var(--muted); font-size: .67rem; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; font-weight: 700; font-size: .67rem; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.warning { color: #9a650e; background: #fff2d9; }
.status.danger { color: #b43946; background: #ffe7e9; }
.assurance { text-align: center; }
.assurance .panel-heading { text-align: left; }
.ring { width: 128px; height: 128px; display: grid; place-content: center; margin: 8px auto 20px; border-radius: 50%; background: radial-gradient(circle at center, white 56%, transparent 58%), conic-gradient(var(--mint) 0 100%, #e7edf2 0); }
.ring span { font-size: 1.35rem; font-weight: 800; letter-spacing: -.04em; }
.ring small { color: var(--muted); }
.check-list { display: grid; gap: 12px; padding: 0; text-align: left; list-style: none; }
.check-list li { display: flex; gap: 10px; align-items: start; }
.check-list li > span { display: grid; place-items: center; flex: 0 0 22px; height: 22px; border-radius: 50%; color: #087e72; background: #daf6f1; font-size: .7rem; font-weight: 900; }
.check-list strong, .check-list small { display: block; }
.check-list strong { font-size: .75rem; }
.check-list small { margin-top: 2px; color: var(--muted); font-size: .67rem; }
.primary { width: 100%; margin-top: 10px; padding: 11px 14px; border: 0; border-radius: 10px; color: white; background: #5666dc; font-weight: 750; }
.primary:disabled { color: #8d99ab; background: #e2e7ee; cursor: not-allowed; }
.fine-print { margin: 10px 2px 0; color: var(--muted); font-size: .65rem; line-height: 1.45; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 15%, rgba(44,187,170,.16), transparent 28%), radial-gradient(circle at 85% 80%, rgba(89,107,255,.15), transparent 30%), var(--canvas); }
.login-card { width: min(100%, 440px); padding: 36px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.login-brand { width: fit-content; margin-bottom: 30px; color: var(--ink); }
.login-copy, .supporting { color: var(--muted); font-size: .82rem; line-height: 1.55; }
.form-grid { display: grid; gap: 16px; margin-top: 24px; }
.form-grid.compact { gap: 13px; margin-top: 18px; }
label { display: grid; gap: 6px; color: var(--ink); font-size: .75rem; font-weight: 700; }
input, select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); font: inherit; }
input:focus, select:focus { border-color: #596bff; outline: 3px solid rgba(89,107,255,.16); }
.form-error { min-height: 1.25rem; margin: 12px 0 0; color: var(--danger); font-size: .76rem; }
.secondary, .danger-button { min-height: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-weight: 700; cursor: pointer; }
.danger-button { color: var(--danger); border-color: rgba(201,73,85,.35); }
.danger-button:disabled { opacity: .45; cursor: not-allowed; }
.small { min-height: 32px; padding: 5px 8px; font-size: .7rem; }
.connection-state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .73rem; }
.connection-state > span { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(44,187,170,.12); }
.link-button { border: 0; color: #4355d6; background: transparent; font-size: .75rem; font-weight: 700; cursor: pointer; }
.good-status { color: #087e72; background: #daf6f1; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .72fr); gap: 18px; align-items: start; }
.count-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: #4657d7; background: #e8eaff; font-size: .68rem; font-weight: 800; }
.empty-state { display: grid; justify-items: center; padding: 42px 20px; color: var(--muted); text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 12px; border-radius: 14px; color: #596bff; background: #e8eaff; font-size: 1.4rem; }
.empty-state h2 { color: var(--ink); }
.empty-state p { max-width: 430px; margin: 8px 0 0; font-size: .78rem; line-height: 1.5; }
.secret-result { display: grid; gap: 8px; margin-top: 18px; padding: 14px; border: 1px solid #edca7b; border-radius: 10px; background: #fff8e7; }
.secret-result code { overflow-wrap: anywhere; user-select: all; font-size: .72rem; }
.secret-result small { color: #75613b; font-size: .68rem; }
.row-actions { display: flex; gap: 7px; min-width: 150px; }
.inline-policy { display: flex; align-items: center; gap: 7px; min-width: 240px; }
.inline-policy select { min-width: 160px; }
.media-actions { min-width: 230px; }
.recording-tools { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px); gap: 12px; margin: 20px 0 14px; }
.recording-tools label { color: var(--muted); font-size: .7rem; font-weight: 700; }
.recording-tools input, .recording-tools select { margin-top: 6px; }
.policy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.policy-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.policy-card h3 { margin: 8px 0 18px; font-size: 1rem; }
.policy-card dl { display: grid; gap: 10px; margin: 0; }
.policy-card dl div { display: flex; justify-content: space-between; gap: 16px; font-size: .73rem; }
.policy-card dt { color: var(--muted); }
.policy-card dd { margin: 0; text-align: right; font-weight: 700; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkbox { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.checkbox input { width: 17px; min-height: 17px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 240px; color: var(--muted); font-size: .82rem; }
.loading span { width: 20px; height: 20px; border: 3px solid var(--line); border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; }
.error-panel { padding: 24px; border: 1px solid rgba(201,73,85,.35); border-radius: 14px; background: rgba(201,73,85,.08); }
.error-panel p { color: var(--muted); }
.hash { color: var(--muted); font-size: .68rem; }
dialog { width: min(92vw, 420px); padding: 0; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--surface); box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.media-dialog { width: min(92vw, 620px); }
.media-dialog audio { display: block; width: 100%; margin-top: 20px; }
.live-player { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; border-color: rgba(29, 166, 133, .42); background: linear-gradient(135deg, rgba(29, 166, 133, .10), var(--surface) 52%); }
.live-player[hidden] { display: none; }
.live-player h2 { margin: 4px 0 0; }
.live-health { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #1da685; box-shadow: 0 0 0 0 rgba(29, 166, 133, .55); animation: live-pulse 1.5s infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 9px rgba(29, 166, 133, 0); } 100% { box-shadow: 0 0 0 0 rgba(29, 166, 133, 0); } }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
dialog::backdrop { background: rgba(6,12,26,.64); backdrop-filter: blur(3px); }
.dialog-card { padding: 26px; }
.dialog-card > p:not(.eyebrow, .form-error) { color: var(--muted); font-size: .78rem; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.dialog-actions .primary { width: auto; margin-top: 0; }
.toast { position: fixed; z-index: 20; right: 22px; bottom: 22px; max-width: 380px; padding: 13px 16px; border-radius: 10px; color: white; background: #182034; box-shadow: 0 14px 40px rgba(0,0,0,.25); font-size: .78rem; }
@keyframes spin { to { transform: rotate(360deg); } }
button:focus-visible, a:focus-visible { outline: 3px solid #ffbd40; outline-offset: 3px; }
@media (max-width: 1050px) { .metric-grid { grid-template-columns: repeat(2, 1fr); } .content-grid, .two-column { grid-template-columns: 1fr; } }
@media (max-width: 740px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 5; width: 248px; transform: translateX(-102%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  main { padding: 22px 18px 50px; }
  .mobile-menu { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
  .topbar { align-items: start; }
  .profile-copy { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
  .policy-grid { grid-template-columns: 1fr; }
  .connection-state { display: none; }
  .login-card { padding: 26px; }
  .live-player, .live-health { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --ink: #edf2fc; --muted: #9eabc1; --line: #2c3951; --surface: #151f33; --canvas: #0c1424; --shadow: none; }
  .notice { color: #e8edff; border-color: #31436c; background: #192744; }
  .notice p { color: #aebbd5; }
  .notification-dot { border-color: var(--surface); }
  .metric::after { opacity: .5; }
  th, td { border-color: #28354a; }
  td { color: #bdc7d8; }
  .ring { background: radial-gradient(circle at center, var(--surface) 56%, transparent 58%), conic-gradient(var(--mint) 0 100%, #344158 0); }
  .secret-result { border-color: #6f5830; background: #332a19; }
  .secret-result small { color: #d3bd90; }
  .good-status { color: #67e0d2; background: #183b3a; }
  .count-badge { color: #bec5ff; background: #29305d; }
  .empty-state > span { color: #bfc6ff; background: #29305d; }
}
