:root {
    --ink: #10131c;
    --panel: #1a2030;
    --line: #2c3548;
    --paper: #f3ecdf;
    --muted: #a7b0c2;
    --violet: #8d5cff;
    --lime: #b6ff3c;
    --danger: #ff6b7a;
    --ok: #7dffa1;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--paper);
    background:
        radial-gradient(900px 420px at 0% -10%, rgba(141, 92, 255, 0.35), transparent 60%),
        radial-gradient(700px 380px at 100% 0%, rgba(182, 255, 60, 0.12), transparent 55%),
        var(--ink);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { padding: 28px 18px; border-right: 1px solid var(--line); background: rgba(8, 10, 16, 0.55); display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; background: var(--lime); color: #111; font-weight: 800; transform: skewX(-8deg); }
.brand strong { display: block; letter-spacing: 0.04em; }
.brand small, .hint, .meta, small { color: var(--muted); }
nav { display: flex; flex-direction: column; gap: 4px; }
nav a { color: var(--paper); text-decoration: none; padding: 10px 12px; border-left: 3px solid transparent; }
nav a.active, nav a:hover { border-left-color: var(--lime); background: rgba(255,255,255,0.04); }
main { padding: 32px 36px 64px; }
h1 { font-size: 42px; line-height: 0.95; margin: 0; letter-spacing: -0.04em; }
h2 { margin: 0 0 12px; }
h3 { margin: 18px 0 8px; font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lime); }
.eyebrow { letter-spacing: 0.18em; text-transform: uppercase; color: var(--lime); font-size: 12px; margin: 0 0 8px; }
.page-head, .lede { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 22px; }
.stats { display: grid; grid-template-columns: 1.4fr repeat(5, 1fr); gap: 12px; }
.stat, .panel, .callout { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.stat span { display: block; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.stat strong { font-size: 28px; }
.stat em { font-style: normal; color: var(--muted); font-size: 16px; }
.bar { height: 10px; background: #0c0f16; border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--lime)); }
.callout { margin: 18px 0; border-left: 4px solid var(--violet); }
.split, .grid-2 { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 18px; }
.event-list { list-style: none; padding: 0; margin: 0; }
.event-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.event-list small, td small { display: block; }
label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
input, select, button, .button {
    font: inherit; color: var(--paper); background: #0e121b; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
button, .button { background: var(--lime); color: #142006; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block; }
button.ghost { background: transparent; color: var(--paper); width: 100%; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.flash { padding: 12px 14px; border-radius: 12px; }
.flash-ok { background: rgba(125, 255, 161, 0.12); }
.flash-error { background: rgba(255, 107, 122, 0.15); }
.check { flex-direction: row; align-items: center; }
.gate { display: grid; place-items: center; padding: 32px; }
.gate-card, .install { width: min(760px, 100%); background: var(--panel); padding: 28px; border-radius: 24px; border: 1px solid var(--line); }
.url { word-break: break-all; font-family: "Courier New", monospace; }
.preview { width: 100%; height: 240px; border: 0; background: repeating-conic-gradient(#222 0% 25%, #2a2a2a 0% 50%) 50% / 24px 24px; border-radius: 12px; }
.preview-brand { height: 320px; }
.preview-pill { height: 110px; }
.widget-style { margin: 0 0 18px; padding: 14px 16px 6px; border: 1px solid var(--line); border-radius: 14px; }
.widget-style legend { padding: 0 6px; color: var(--lime); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; }
.field-row { display: grid; grid-template-columns: 2fr 1fr 0.8fr; gap: 10px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0 10px; }
.swatches input[type="color"] { width: 100%; height: 38px; padding: 3px; }
.field-title { margin: 4px 0 6px; color: var(--muted); font-size: 13px; }
.alert-sound-preview { display: block; width: 100%; height: 40px; margin-bottom: 10px; }
.volume-row { display: flex; align-items: center; gap: 12px; }
.volume-row input[type="range"] { flex: 1; padding: 0; border: 0; background: transparent; accent-color: var(--lime); }
.volume-row output { min-width: 3.5em; color: var(--paper); text-align: right; }
.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.icon-option { margin: 0; cursor: pointer; }
.icon-option input { position: absolute; opacity: 0; pointer-events: none; }
.icon-option span { display: grid; place-items: center; width: 46px; height: 46px; border: 2px solid var(--line); border-radius: 12px; background: #f4f1ff; }
.icon-option input:checked + span { border-color: var(--lime); box-shadow: 0 0 0 2px rgba(182, 255, 60, 0.35); }
.icon-option input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 2px; }
.icon-option svg { width: 28px; height: 28px; overflow: visible; }
.icon-option path { fill: var(--icon-fill, #ffd23f); stroke: var(--icon-line, #000); stroke-width: 1.6; stroke-linejoin: round; paint-order: stroke; }
.icon-option img { width: 30px; height: 30px; object-fit: contain; }
.icon-option em { color: #333; font-size: 11px; font-style: normal; }
.form-section { margin-top: 4px; }
.preview-banner { height: 180px; }
.alert-lab { margin-bottom: 18px; }
.alert-lab-head { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; align-items: start; }
.alert-test { display: grid; grid-template-columns: 1fr 0.7fr; gap: 0 10px; }
.alert-test-buttons { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.alert-test-status { grid-column: 1 / -1; min-height: 1.2em; margin: 8px 0 0; }
.alert-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 14px 0 8px; overflow: hidden; border-radius: 12px; background: repeating-conic-gradient(#222 0% 25%, #2a2a2a 0% 50%) 50% / 24px 24px; }
.alert-stage iframe { position: absolute; top: 0; left: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; }
.placeholders { margin: 0 0 10px; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.checks { list-style: none; padding: 0; }
.checks li { padding: 8px 0; }
.checks .ok { color: var(--ok); }
.checks .bad { color: var(--danger); }
.steps { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.steps li { color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: 0.08em; }
.steps .active { color: var(--lime); }
.conn-card form, .danger-panel { margin-top: 8px; }
.danger-panel { margin: 18px 0; }
@media (max-width: 980px) {
    .shell, .stats, .split, .grid-2, .alert-lab-head { grid-template-columns: 1fr; }
    .side { border-right: 0; border-bottom: 1px solid var(--line); }
    h1 { font-size: 34px; }
}
