/* Pulse Analytics — dashboard styles. Humans = amber, bots = violet, everywhere. */
:root {
  --bg: #121826;
  --panel: #182133;
  --panel-2: #1f2a40;
  --line: #2a3549;
  --line-2: #344158;
  --text: #e6ebf2;
  --text-2: #b9c3d3;
  --muted: #8a97ad;
  --human: #f0a43a;
  --human-soft: rgba(240, 164, 58, .15);
  --human-faint: rgba(240, 164, 58, .09);
  --human-bar: rgba(240, 164, 58, .4);
  --bot-bar: rgba(140, 140, 255, .4);
  --bot: #8c8cff;
  --bot-soft: rgba(140, 140, 255, .16);
  --good: #45c08a;
  --bad: #ef6b6b;
  --idle: #7d8aa1;
  --focus: #9fb4ff;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --r-sm: 6px;
  --r-md: 10px;
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef1f6;
  --panel: #ffffff;
  --panel-2: #f4f6fa;
  --line: #dde3ec;
  --line-2: #cbd3df;
  --text: #172033;
  --text-2: #3b465c;
  --muted: #5e6b82;
  --human: #b46a08;
  --human-soft: rgba(196, 122, 18, .14);
  --human-faint: rgba(196, 122, 18, .07);
  --human-bar: rgba(196, 122, 18, .32);
  --bot-bar: rgba(90, 85, 224, .28);
  --bot: #5a55e0;
  --bot-soft: rgba(90, 85, 224, .12);
  --good: #17895a;
  --bad: #cf3d3d;
  --idle: #8693a8;
  --focus: #3f5bd8;
  --shadow: 0 10px 30px rgba(23, 32, 51, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--human); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 12px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 18px; }
.brand-mark { width: 26px; height: 26px; }
.brand-name { font-weight: 800; font-stretch: 125%; font-size: 19px; letter-spacing: .01em; }
.nav-a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500;
}
.nav-a:hover { background: var(--panel-2); color: var(--text); }
.nav-a.on { background: var(--panel-2); color: var(--text); box-shadow: inset 2px 0 0 var(--human); }
.nav-a svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.side-h { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 10px 6px; color: var(--muted); font-size: 12px; }
.side-h a { color: var(--muted); }
.side-h a:hover { color: var(--human); }
.site-list { display: flex; flex-direction: column; gap: 1px; }
.site-a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--r-sm); }
.site-a:hover { background: var(--panel-2); color: var(--text); }
.site-a.on { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--human); }
.site-a .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.site-a .lv { font-weight: 800; font-stretch: 112%; color: var(--human); min-width: 2ch; text-align: right; }
.site-a .lv.zero { color: var(--muted); font-weight: 500; }
.site-a.off .nm { color: var(--muted); text-decoration: line-through; }
.side-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 1px; border-top: 1px solid var(--line); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }

/* ---------- page header ---------- */
.ph { padding: 22px 28px 0; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.ph-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ph h1 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 700; }
.ph .dom { color: var(--muted); font-size: 13px; }
.ph .dom a:hover { color: var(--human); }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 2px; }
.tabs { display: flex; gap: 22px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 8px 0 11px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--human); }
.content { padding: 24px 28px 48px; display: flex; flex-direction: column; gap: 22px; }

/* ---------- controls ---------- */
.sel, .inp, .btn {
  height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--panel); padding: 0 11px;
}
.sel { padding-right: 28px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 13px top 15px, right 8px top 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.inp { min-width: 0; }
textarea.inp { height: auto; padding: 8px 11px; resize: vertical; }
.btn { cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.pri { background: var(--human); border-color: var(--human); color: #1b1305; }
.btn.pri:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel-2); }
.btn:disabled { opacity: .5; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; height: 34px; }
.seg button { border: 0; background: var(--panel); padding: 0 12px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on[data-v="humans"], .seg button.on[data-v="live"] { background: var(--human-soft); color: var(--human); }
.seg button.on[data-v="bots"] { background: var(--bot-soft); color: var(--bot); }
.seg button.on { background: var(--panel-2); color: var(--text); }
label.f { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
label.f .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.chk { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.chk input { margin-top: 3px; accent-color: var(--human); }

/* ---------- panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 14px 18px 10px; flex-wrap: wrap; }
.panel-h h2 { margin: 0; font-size: 15px; font-weight: 650; flex: none; }
.panel-h .sub { color: var(--muted); font-size: 12.5px; }
.panel-b { padding: 4px 18px 16px; }
.panel-b.flush { padding: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; align-items: start; }
/* Small side boxes (live pages, countries, sources, devices): long titles are cut with "…" and never spill into the next box */
.grid4 > .panel, .grid3 > .panel, .panel.boxed { overflow: hidden; min-width: 0; }
.tbl.fixed { table-layout: fixed; }
.tbl.fixed td, .tbl.fixed th { overflow: hidden; }
.tbl.fixed .c { overflow: hidden; }
.tbl.fixed .n { width: 64px; }
.tbl.fixed .n.w2 { width: 128px; }
.tbl.fixed .trunc, .tbl.fixed .pg-t, .tbl.fixed .pg-u { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share > .bar { max-width: 100%; }
.kpi-foot { padding: 8px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* ---------- live hero ---------- */
.live-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; padding: 22px 24px; align-items: center; }
.live-now { display: flex; flex-direction: column; gap: 6px; padding-right: 28px; border-right: 1px solid var(--line); }
.live-lab { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--human); flex: none; }
.dot.bot { background: var(--bot); }
.dot.idle { background: var(--idle); }
.dot.left { background: transparent; border: 1.5px solid var(--idle); }
.dot.blip { animation: blip 1.2s ease-out 1; }
@keyframes blip { 0% { box-shadow: 0 0 0 0 var(--human); } 100% { box-shadow: 0 0 0 10px transparent; } }
.big { font-size: 76px; line-height: .92; font-weight: 800; font-stretch: 125%; letter-spacing: -.01em; color: var(--human); }
.big.bot { color: var(--bot); }
.big-sub { color: var(--muted); font-size: 13px; }
.big-sub b { color: var(--text-2); font-weight: 600; }
.live-side { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.mstat .v { font-size: 30px; font-weight: 750; font-stretch: 118%; line-height: 1.1; }
.mstat .v.h { color: var(--human); }
.mstat .v.b { color: var(--bot); }
.mstat .l { color: var(--muted); font-size: 12.5px; }
.minutes { padding: 0 24px 18px; }
.minutes-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11.5px; margin-top: 6px; }

/* ---------- KPI strip ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.kpi { padding: 16px 18px; border-right: 1px solid var(--line); min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi .l { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.kpi .v { font-size: 26px; font-weight: 750; font-stretch: 115%; line-height: 1.25; white-space: nowrap; }
.kpi .d { font-size: 12px; font-weight: 600; }
.kpi .d.up { color: var(--good); }
.kpi .d.down { color: var(--bad); }
.kpi .d.flat { color: var(--muted); }
.kpi.lead .v { color: var(--human); }
.kpi.botk .v { color: var(--bot); }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 6px 18px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 7px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .n { text-align: right; white-space: nowrap; }
.tbl th.n { text-align: right; }
.tbl tbody tr:hover td { background: var(--human-faint); }
.tbl.bots tbody tr:hover td { background: var(--bot-soft); }
.share { position: relative; }
.share > .bar { position: absolute; left: 0; top: 4px; bottom: 4px; background: var(--human-faint); border-radius: 3px; z-index: 0; }
.bots .share > .bar { background: var(--bot-soft); }
.share > .c { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pg-t { font-weight: 550; }
.pg-u { color: var(--muted); font-size: 12px; word-break: break-all; }
.pg-u:hover { color: var(--human); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.more { display: block; padding: 10px 18px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); cursor: pointer; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; }
.more:hover { color: var(--human); }
.empty { padding: 26px 18px; color: var(--muted); text-align: center; }
.flag { display: inline-flex; width: 22px; justify-content: center; font-size: 15px; line-height: 1; flex: none; }
.flag.code { font-size: 10px; font-weight: 700; border: 1px solid var(--line-2); border-radius: 3px; padding: 2px 0; width: 24px; color: var(--text-2); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--panel-2); color: var(--text-2); white-space: nowrap; }
.tag.new { background: var(--human-soft); color: var(--human); }
.tag.k { color: #fff; }
.tag.ok { background: rgba(69, 192, 138, .15); color: var(--good); }
.tag.bad { background: rgba(239, 107, 107, .15); color: var(--bad); }
.st { font-weight: 700; font-size: 12px; }
.st.s2 { color: var(--good); } .st.s3 { color: var(--muted); } .st.s4 { color: #e6a23c; } .st.s5 { color: var(--bad); }
.ic { width: 15px; height: 15px; vertical-align: -3px; color: var(--muted); flex: none; }

/* live visitor table */
.vt td { padding-top: 9px; padding-bottom: 9px; }
.vt tr { cursor: pointer; }
.vt .who { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.vt .pg { max-width: min(520px, 30vw); min-width: 200px; }
.vt .tm { font-weight: 650; }
.vt tr.left td { opacity: .55; }

/* ---------- overview board ---------- */
.board { width: 100%; border-collapse: collapse; }
.board th { text-align: right; font-weight: 500; font-size: 12px; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.board th:first-child { text-align: left; }
.board td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.board td:first-child { text-align: left; max-width: 280px; }
.board .sname, .board .sdom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1500px) { .board th, .board td { padding-left: 11px; padding-right: 11px; } .board .spk svg { width: 120px; } }
.board tbody tr { cursor: pointer; }
.board tbody tr:hover td { background: var(--panel-2); }
.board .sname { font-weight: 650; font-size: 15px; }
.board .sdom { color: var(--muted); font-size: 12px; }
.board .live { font-size: 30px; font-weight: 800; font-stretch: 125%; color: var(--human); line-height: 1; }
.board .live.zero { color: var(--muted); font-weight: 500; }
.board .bv { color: var(--bot); font-weight: 650; }
.board .spk { width: 150px; }
.board tfoot td { font-weight: 700; color: var(--text-2); border-bottom: 0; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.tip {
  position: absolute; pointer-events: none; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 8px 10px; font-size: 12.5px; box-shadow: var(--shadow); white-space: nowrap; z-index: 10; transform: translate(-50%, -100%);
}
.tip b { font-weight: 700; }
.tip .r { display: flex; align-items: center; gap: 6px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* ---------- drawer & dialog ---------- */
.scrim { position: fixed; inset: 0; background: rgba(5, 9, 18, .55); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--panel); border-left: 1px solid var(--line);
  z-index: 41; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: slide .18s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-h { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.drawer-h h3 { margin: 0 0 4px; font-size: 17px; }
.drawer-b { padding: 16px 20px; overflow-y: auto; }
.path { list-style: none; margin: 0; padding: 0; position: relative; }
.path li { position: relative; padding: 0 0 16px 22px; }
.path li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.path li.now::before { background: var(--human); }
.path li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.path li:last-child::after { display: none; }
.path .t { font-weight: 600; }
.path .m { color: var(--muted); font-size: 12px; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 12px; font-size: 13px; margin-bottom: 18px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
dialog { border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--panel); color: var(--text); padding: 0; width: min(460px, 92vw); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(5, 9, 18, .55); }
.dlg-b { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.dlg-b h3 { margin: 0; font-size: 17px; }
.dlg-b p { margin: 0; color: var(--text-2); }
.dlg-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); }

/* ---------- setup / forms ---------- */
.code { position: relative; }
.code pre {
  margin: 0; padding: 12px 14px; padding-right: 86px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  overflow-x: auto; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text-2); white-space: pre-wrap; word-break: break-all;
}
.code .btn { position: absolute; top: 7px; right: 7px; height: 28px; padding: 0 10px; font-size: 12.5px; }
.form { display: flex; flex-direction: column; gap: 16px; max-width: 620px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.opt { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); cursor: pointer; }
.opt:has(input:checked) { border-color: var(--human); background: var(--human-faint); }
.opt input { accent-color: var(--human); margin-top: 3px; }
.opt b { display: block; }
.opt span { color: var(--muted); font-size: 12.5px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; }
.steps li::marker { color: var(--human); font-weight: 700; }
.resets { display: flex; flex-wrap: wrap; gap: 8px; }
.note { padding: 10px 14px; border-radius: var(--r-sm); background: var(--panel-2); color: var(--text-2); font-size: 13px; }
.note.warn { background: rgba(239, 107, 107, .1); color: var(--text); }
.err { color: var(--bad); font-size: 13px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600; z-index: 60; box-shadow: var(--shadow); }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
.health { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; }
.health > div { padding: 14px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.health .l { color: var(--muted); font-size: 12.5px; }
.health .v { font-weight: 650; }

/* ---------- info boxes ---------- */
.info {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line-2);
  background: transparent; color: var(--muted); font: italic 700 10.5px/1 Georgia, serif; cursor: pointer; padding: 0; vertical-align: 1px; margin-left: 2px;
}
.info:hover, .info:focus-visible { color: var(--human); border-color: var(--human); }
.pop {
  position: absolute; z-index: 70; max-width: 320px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--panel-2);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); color: var(--text); font-size: 13px; line-height: 1.5; font-weight: 400;
  font-style: normal; text-align: left; white-space: normal;
}
th .info { margin-left: 4px; }

/* ---------- one-code card ---------- */
.cc { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.cc h2 { margin: 0; font-size: 18px; font-weight: 700; }
.cc p { margin: 0; color: var(--text-2); max-width: 72ch; }
.code.big pre { font-size: 15px; padding: 16px 18px; padding-right: 130px; color: var(--text); border-color: var(--line-2); }
.code.big .btn { top: 50%; transform: translateY(-50%); height: 34px; padding: 0 14px; font-size: 13.5px; }
.cc-wp { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-sm); background: var(--panel-2); color: var(--text-2); font-size: 13.5px; }
.cc-wp > svg { margin-top: 2px; color: var(--human); }
.cc-wp a { color: inherit; }
.wait { display: flex; gap: 14px; align-items: center; padding: 18px 22px; }
.blip-loop { animation: blip 1.6s ease-out infinite; }

/* ---------- status rows ---------- */
.status { display: flex; flex-direction: column; }
.st-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 18px; border-top: 1px solid var(--line); }
.st-row:first-child { border-top: 0; }
.st-row a { color: var(--human); }
.st-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--idle); }
.st-dot.st-ok { background: var(--good); box-shadow: 0 0 0 4px rgba(69, 192, 138, .15); }
.st-dot.st-part { background: #e6a23c; }
.st-dot.st-wait { background: var(--idle); animation: blip 1.6s ease-out infinite; }
.st-dot.st-off { background: transparent; border: 1.5px solid var(--idle); }

/* ---------- switch, expanders ---------- */
.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw { flex: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; margin-top: 1px; transition: background .15s; }
.switch .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .sw { background: var(--human); }
.switch input:checked + .sw::after { transform: translateX(16px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--focus); outline-offset: 2px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
details.xp > summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 650; display: flex; align-items: center; gap: 10px; }
details.xp > summary::-webkit-details-marker { display: none; }
details.xp > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
details.xp[open] > summary::before { transform: rotate(45deg); }
details.xp > summary:hover { color: var(--human); }
details.xp[open] > summary { border-bottom: 1px solid var(--line); }
details.xp > .panel-b { padding-top: 16px; }
details.xp > .panel-b.flush { padding-top: 0; }

/* ---------- auth / install pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.auth-card.wide { width: min(640px, 100%); }
.auth-card h1 { margin: 0; font-size: 20px; }
.auth-card .brand { padding: 0 0 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
  .topbar .brand { padding: 0; }
  .ph { padding: 16px 16px 0; position: static; }
  .content { padding: 16px 16px 40px; gap: 16px; }
  .grid2, .grid3, .grid4 { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .panel-h .sub { display: none; }
  .live-hero { grid-template-columns: minmax(0, 1fr); padding: 18px; gap: 18px; }
  .live-now { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
  .big { font-size: 60px; }
  .kpi { border-bottom: 1px solid var(--line); }
  .board .spk, .board .hide-m { display: none; }
  .board th, .board td { padding-left: 8px; padding-right: 8px; }
  .board td:first-child { white-space: normal; word-break: break-word; }
  .board .live { font-size: 24px; }
  .tbl th, .tbl td { padding-left: 12px; padding-right: 12px; }
  .vt .hide-m, .tbl .hide-m, .hide-m { display: none !important; }
  .tbl td:first-child { word-break: break-word; }
  .form-row { grid-template-columns: minmax(0, 1fr) !important; }
  .code.big pre { padding-right: 18px; padding-bottom: 58px; font-size: 13px; }
  .code.big .btn { top: auto; bottom: 10px; transform: none; right: 10px; }
  .cc { padding: 18px; }
  .minutes { padding: 0 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
