/* Shared styles for the customer dashboard (dashboard.html) and the admin panel (admin.html). */
:root {
  --bg: #08090b;
  --panel: #0e1014;
  --panel-2: #12151a;
  --hover: rgba(255,255,255,.035);
  --line: rgba(255,255,255,.07);
  --line-2: rgba(255,255,255,.12);
  --text: #ececee;
  --body: rgba(236,236,238,.82);
  --muted: rgba(236,236,238,.56);
  --faint: rgba(236,236,238,.38);
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --ban: #e5645e;
  --kick: #d4a24a;
  --block: #8a94b8;
  --flag: #84868d;
  --ok: #4fb07f;
  /* chart: greys, with bans the only colour */
  --ch-flag: #2e3138;
  --ch-block: #4a4e57;
  --ch-kick: #767a84;
  --ch-ban: #d9605a;
  --r: 4px;
  --side: 232px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font: 13px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
svg.i { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
::selection { background: rgba(139,159,255,.35); }

/* ---------- demo strip ---------- */
.demo-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px; height: 34px; padding: 0 16px;
  background: #e9e9ea; color: #111; font-size: 12.5px;
}
.demo-bar b { font-weight: 600; }
.demo-bar .sp { flex: 1; }
.demo-bar a { font-weight: 500; }
.demo-bar a:hover { text-decoration: underline; }
.demo-bar .get { padding: 3px 10px; border-radius: 3px; background: #111; color: #fff; }
.demo-bar .get:hover { text-decoration: none; background: #2a2a2a; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - 34px); }
.side {
  position: sticky; top: 34px; height: calc(100vh - 34px); overflow-y: auto;
  display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #0a0b0e;
}
.side-logo { display: block; padding: 18px 18px 14px; }
.side-logo img { display: block; height: 22px; width: auto; }
.server {
  display: flex; align-items: center; gap: 9px; margin: 0 10px 8px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 6px; text-align: left; transition: border-color .15s, background .15s;
}
.server:hover { border-color: var(--line-2); background: var(--hover); }
.server .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.server b { font-weight: 500; }
.server small { margin-left: auto; color: var(--faint); font-family: var(--mono); font-size: 11px; }
.server svg { color: var(--faint); }
.server-menu { margin: -4px 10px 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2); overflow: hidden; display: none; }
.server-menu.open { display: block; }
.server-menu button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; text-align: left; }
.server-menu button:hover { background: var(--hover); }
.server-menu button.on { color: #fff; }
.server-menu .dot { width: 7px; height: 7px; border-radius: 50%; }
.server-menu small { margin-left: auto; color: var(--faint); font-family: var(--mono); font-size: 11px; }
.nav { padding: 4px 10px 16px; flex: 1; }
.nav h6 { margin: 16px 8px 6px; font-size: 11px; font-weight: 500; color: var(--faint); }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 8px; border-radius: 5px;
  color: var(--muted); transition: background .12s, color .12s;
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.on { background: rgba(255,255,255,.055); color: #fff; }
.nav a .count { margin-left: auto; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.nav a .count.hot { color: var(--text); }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: #23262d; font-size: 11.5px; font-weight: 600; color: #fff; }
.me div { line-height: 1.3; min-width: 0; }
.me small { display: block; color: var(--faint); font-size: 11.5px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 34px; z-index: 20; display: flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(8,9,11,.92); backdrop-filter: blur(8px);
}
.menu-toggle { display: none; padding: 6px; margin-left: -6px; border-radius: 5px; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--faint); white-space: nowrap; overflow: hidden; }
.crumbs b { color: var(--text); font-weight: 500; }
.top .sp { flex: 1; }
.search-btn {
  display: flex; align-items: center; gap: 8px; width: 260px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--faint); transition: border-color .15s;
}
.search-btn:hover { border-color: var(--line-2); }
.search-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-btn kbd { margin-left: auto; white-space: nowrap; }
kbd { font-family: var(--mono); font-size: 10.5px; padding: 1px 5px; border: 1px solid var(--line-2); border-radius: 3px; color: var(--muted); }
.icon-btn { position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .pip { position: absolute; top: 7px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--ban); }
/* fills the screen beside the sidebar; very wide monitors get a cap so lines stay readable */
.view { padding: 24px 28px 60px; width: 100%; max-width: 2400px; }

/* ---------- page parts ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ph h1 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.ph p { margin-top: 3px; color: var(--muted); }
.ph .acts { display: flex; align-items: center; gap: 8px; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 30px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel-2); font-weight: 500; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #191c22; border-color: rgba(255,255,255,.2); }
.btn.pri { background: #ececee; border-color: #ececee; color: #0b0b0c; }
.btn.pri:hover { background: #fff; }
.btn.danger { color: var(--ban); }
.btn.danger:hover { border-color: rgba(239,111,105,.5); background: rgba(239,111,105,.08); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.panel { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 44px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.panel-h h3 { font-size: 13px; font-weight: 500; }
.panel-h a, .panel-h .lnk { font-size: 12px; color: var(--muted); }
.panel-h a:hover, .panel-h .lnk:hover { color: var(--text); }
.panel-b { padding: 16px; }

/* one strip split by hairlines, not four cards */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--line); overflow: hidden; }
.kpis .kpi { padding: 14px 18px 15px; border: 0; border-radius: 0; background: var(--panel); }
.kpi span { color: var(--muted); font-size: 12px; }
.kpi strong { display: block; margin-top: 4px; font-size: 22px; font-weight: 500; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi strong small { font-size: 13px; font-weight: 400; color: var(--faint); }
.kpi em { display: block; margin-top: 1px; font-style: normal; font-size: 12px; color: var(--faint); }
.kpi em.up { color: var(--ban); } .kpi em.down { color: var(--ok); }
.g2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; margin-bottom: 12px; }
.g2b { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }

.chart { position: relative; height: 210px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .ax { font-family: var(--mono); font-size: 10px; fill: var(--faint); }
.chart .gl { stroke: rgba(255,255,255,.05); stroke-dasharray: 2 3; }
.chart g.col:hover rect.bar { filter: brightness(1.25); }
.chart g.col rect.hit { fill: transparent; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 1px; }
.tip {
  position: fixed; z-index: 80; pointer-events: none; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 5px;
  background: #16191f; font-size: 12px; line-height: 1.6; white-space: nowrap; display: none;
}
.tip b { font-weight: 600; }

/* plain ranked list with a hairline bar under each row */
.hbars { display: grid; margin: -6px 0; }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; padding: 7px 0; }
.hbar:hover span { color: #fff; }
.hbar span { color: var(--body); }
.hbar u { grid-column: 1 / -1; order: 3; display: block; height: 2px; background: rgba(255,255,255,.05); text-decoration: none; }
.hbar u i { display: block; height: 100%; background: #6f737c; }
.hbar b { font-weight: 400; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; }
.kv dt { color: var(--muted); }
.kv dd { min-width: 0; overflow-wrap: anywhere; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 34px; padding: 0 12px; text-align: left; font-weight: 500; font-size: 12px; color: var(--faint); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { height: 40px; padding: 0 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--hover); }
tr.fresh { animation: fresh 2.4s ease-out; }
@keyframes fresh { from { background: rgba(255,255,255,.06); } to { background: transparent; } }
td.r, th.r { text-align: right; }
td .sub { display: block; font-size: 11.5px; color: var(--faint); line-height: 1.3; }
td.name { line-height: 1.3; }
.empty { padding: 40px 16px; text-align: center; color: var(--faint); }

/* status labels: a small coloured mark and plain text */
.pill { display: inline-flex; align-items: center; gap: 7px; color: var(--body); text-transform: capitalize; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 1px; background: var(--c, var(--flag)); }
.pill.ban { --c: var(--ban); color: var(--text); } .pill.kick { --c: var(--kick); } .pill.block { --c: var(--block); } .pill.flag { --c: var(--flag); color: var(--muted); }
.pill.ok { --c: var(--ok); } .pill.off { --c: rgba(255,255,255,.18); color: var(--faint); }
.tnum { font-variant-numeric: tabular-nums; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--ok)); }
.risk { display: inline-flex; gap: 2px; }
.risk i { width: 4px; height: 12px; border-radius: 1px; background: rgba(255,255,255,.12); }
.risk.r1 i:nth-child(-n+1) { background: var(--ok); }
.risk.r2 i:nth-child(-n+2) { background: var(--kick); }
.risk.r3 i:nth-child(-n+3) { background: var(--ban); }

/* toolbar */
.bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.field { position: relative; display: flex; align-items: center; }
.field svg { position: absolute; left: 9px; color: var(--faint); pointer-events: none; }
.inp, .sel {
  height: 30px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--bg); outline: none;
  transition: border-color .15s;
}
.field .inp { padding-left: 30px; width: 240px; }
.inp:focus, .sel:focus, textarea:focus { border-color: rgba(255,255,255,.35); }
.inp::placeholder, textarea::placeholder { color: var(--faint); }
.sel { appearance: none; padding-right: 28px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='none' stroke='%23888' stroke-width='1.5'%3E%3Cpath d='m2 3.5 3 3 3-3'/%3E%3C/svg%3E") no-repeat right 9px center; }
.sel option { background: #111317; }
textarea { width: 100%; min-height: 90px; padding: 9px 10px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--bg); outline: none; resize: vertical; line-height: 1.55; }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg); }
.seg button { height: 24px; padding: 0 10px; border-radius: 4px; color: var(--muted); font-size: 12px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: rgba(255,255,255,.1); color: #fff; }
.seg button small { margin-left: 5px; color: var(--faint); font-family: var(--mono); font-size: 10.5px; }
.bar .sp { flex: 1; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.pager div { display: flex; gap: 6px; }

.tgl { position: relative; width: 30px; height: 17px; flex: none; border-radius: 9px; background: rgba(255,255,255,.14); transition: background .15s; }
.tgl::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #cfd0d4; transition: transform .15s; }
.tgl.on { background: #ececee; }
.tgl.on::after { transform: translateX(13px); background: #0b0b0c; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { position: relative; height: 36px; padding: 0 12px; color: var(--muted); }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: #fff; }
.tabs button.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: #fff; }
.tabs small { margin-left: 6px; font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* detections config */
.cfg-group + .cfg-group { margin-top: 12px; }
.cfg-row { display: grid; grid-template-columns: 30px minmax(0, 1.4fr) 110px 96px 70px 56px 60px; gap: 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.cfg-row:last-child { border-bottom: 0; }
.cfg-row.dis .nm, .cfg-row.dis .sel, .cfg-row.dis .inp { opacity: .45; }
.cfg-row .nm b { font-weight: 500; }
.cfg-row .nm .mono { margin-left: 8px; color: var(--faint); font-size: 11px; }
.cfg-row .inp { width: 100%; }
.cfg-row.dirty, .set-row.dirty { background: rgba(139,159,255,.05); }
.cfg-row .nm small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--faint); }
.cfg-head { display: grid; grid-template-columns: 30px minmax(0, 1.4fr) 110px 96px 70px 56px 60px; gap: 14px; padding: 0 16px; height: 34px; align-items: center; font-size: 12px; color: var(--faint); border-bottom: 1px solid var(--line); }
.tgl.sm { width: 26px; height: 15px; }
.tgl.sm::after { width: 11px; height: 11px; }
.tgl.sm.on::after { transform: translateX(11px); }
.note-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 12px 16px; color: var(--body); }
.note-bar a, .ph p a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* settings pages built from field lists */
.set-row.stack { flex-direction: column; align-items: stretch; gap: 12px; }
.set-row.stack > div:first-child { max-width: 680px; }
.inp-u { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.set-row .inp-u .inp { width: 100px; }
.inp-u small { min-width: 56px; font-size: 12px; color: var(--faint); }
.chip { display: inline-flex; align-items: center; gap: 4px; }
.chip button { display: grid; place-items: center; color: var(--faint); }
.chip button:hover { color: var(--text); }
.chip button svg.i { width: 11px; height: 11px; }
.lst-add { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.lst-add .inp { width: 280px; max-width: 100%; }
.rows table { min-width: 520px; }
.rows td { padding-top: 6px; padding-bottom: 6px; }
.rows td .inp, .rows td .sel { width: 100%; min-width: 80px; }
.ladder { display: flex; height: 30px; margin: 16px; border-radius: 6px; overflow: hidden; font-size: 11.5px; }
.ladder i { display: flex; align-items: center; padding: 0 10px; white-space: nowrap; overflow: hidden; font-style: normal; background: rgba(255,255,255,.06); color: var(--muted); transition: width .2s; }
.ladder .f { background: var(--flag); color: #0b0b0c; }
.ladder .k { background: var(--kick); color: #0b0b0c; }
.ladder .b { background: var(--ban); color: #0b0b0c; }
.demo-bar.on { background: #d9eee2; }
.demo-bar .sel { height: 24px; padding-top: 0; padding-bottom: 0; background-color: #fff; color: #111; border-color: rgba(0,0,0,.2); font-size: 12px; }
.demo-bar .faint-dark { color: #555; }
.savebar {
  position: sticky; bottom: 16px; z-index: 15; display: none; align-items: center; gap: 12px; margin-top: 16px; padding: 10px 12px 10px 16px;
  border: 1px solid var(--line-2); border-radius: 8px; background: #15181d; box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.savebar.show { display: flex; }
.savebar span { flex: 1; }

/* appeals */
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: 560px; }
.split .list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 72vh; }
.ap { display: block; width: 100%; padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.ap:hover { background: var(--hover); }
.ap.on { background: rgba(255,255,255,.06); }
.ap .r1 { display: flex; justify-content: space-between; gap: 8px; }
.ap b { font-weight: 500; }
.ap p { margin-top: 4px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap small { display: block; margin-top: 4px; color: var(--faint); font-size: 11.5px; }
.detail { padding: 20px 24px; min-width: 0; }
.detail h2 { font-size: 16px; font-weight: 600; }
.msg { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); line-height: 1.65; color: var(--body); }
.msg.staff { border-color: rgba(139,159,255,.25); }
.msg header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12px; color: var(--faint); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-family: var(--mono); font-size: 11.5px; padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--body); background: var(--bg); }
.sec-t { margin: 22px 0 8px; font-size: 12px; font-weight: 500; color: var(--faint); }

/* drawer + modal */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); overflow-y: auto;
  background: var(--panel); border-left: 1px solid var(--line-2); transform: translateX(100%); transition: transform .25s cubic-bezier(.2,.7,.2,1);
}
.drawer.show { transform: none; }
.dr-h { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.dr-h h2 { font-size: 16px; font-weight: 600; }
.dr-h p { margin-top: 2px; color: var(--muted); }
.dr-b { padding: 18px 20px 30px; }
.dr-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.modal {
  position: fixed; z-index: 62; top: 50%; left: 50%; width: min(460px, calc(100vw - 32px)); max-height: 86vh; overflow-y: auto;
  transform: translate(-50%, -48%); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2); box-shadow: 0 16px 40px rgba(0,0,0,.5);
}
.modal.show { opacity: 1; transform: translate(-50%, -50%); pointer-events: auto; }
.modal.wide { width: min(640px, calc(100vw - 32px)); }
.md-h { padding: 18px 20px 0; }
.md-h h2 { font-size: 15px; font-weight: 600; }
.md-h p { margin-top: 4px; color: var(--muted); }
.md-b { padding: 16px 20px; display: grid; gap: 12px; }
.md-b label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.md-b .inp, .md-b .sel { width: 100%; color: var(--text); font-size: 13px; }
.md-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
pre.code { padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); font-family: var(--mono); font-size: 12px; line-height: 1.7; overflow-x: auto; color: var(--body); }
pre.code .c { color: var(--faint); } pre.code .s { color: #a8d8a0; } pre.code .n { color: #f2b880; } pre.code .b { color: #8fb8ff; }

/* palette */
.palette { position: fixed; z-index: 70; top: 14vh; left: 50%; width: min(560px, calc(100vw - 32px)); transform: translateX(-50%); display: none; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel-2); box-shadow: 0 16px 40px rgba(0,0,0,.5); overflow: hidden; }
.palette.show { display: block; }
.palette input { width: 100%; height: 48px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line); background: none; outline: none; font-size: 14px; }
.pal-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.pal-list h6 { padding: 8px 10px 4px; font-size: 11px; font-weight: 500; color: var(--faint); }
.pal-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: 5px; text-align: left; color: var(--body); }
.pal-item small { margin-left: auto; color: var(--faint); font-family: var(--mono); font-size: 11px; }
.pal-item.on { background: rgba(255,255,255,.08); color: #fff; }

/* notifications */
.notif { position: fixed; z-index: 65; top: 92px; right: 16px; width: 340px; display: none; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel-2); box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.notif.show { display: block; }
.notif h4 { display: flex; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 500; }
.notif h4 button { font-size: 12px; font-weight: 400; color: var(--muted); }
.notif a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.notif a:last-child { border-bottom: 0; }
.notif a:hover { background: var(--hover); }
.notif a small { display: block; color: var(--faint); font-size: 11.5px; }

/* toasts */
.toasts { position: fixed; z-index: 90; bottom: 16px; right: 16px; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 380px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 7px; background: #181b21; box-shadow: 0 10px 30px rgba(0,0,0,.45); animation: tin .25s ease-out; }
.toast svg { color: var(--ok); }
.toast.out { opacity: 0; transform: translateY(6px); transition: .25s; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* misc cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.hook-prev { margin-top: 12px; padding: 10px 12px; border-radius: 5px; background: #111318; border-left: 3px solid var(--c, var(--ban)); font-size: 12.5px; }
.hook-prev b { font-weight: 600; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.key { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--bg); }
.key span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.danger-zone { border-color: rgba(239,111,105,.3); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row b { font-weight: 500; }
.set-row p { color: var(--muted); }
.set-row .inp, .set-row .sel { width: 260px; }
.plan { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.plan strong { font-size: 22px; font-weight: 600; }
.meter { height: 6px; border-radius: 3px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: #c9cbd1; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.yes { color: var(--ok); } .no { color: var(--faint); }

/* ---------- small screens ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .g2, .g2b { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 55; top: 34px; left: 0; width: 260px; transform: translateX(-100%); transition: transform .25s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.5); }
  .menu-toggle { display: grid; place-items: center; }
  .search-btn { width: auto; }
  .search-btn span, .search-btn kbd { display: none; }
  .top { padding: 0 14px; }
  .view { padding: 18px 14px 50px; }
  .split { grid-template-columns: 1fr; }
  .split .list { max-height: 280px; border-right: 0; border-bottom: 1px solid var(--line); }
  .cfg-head { display: none; }
  .cfg-row { grid-template-columns: 30px 1fr; row-gap: 8px; }
  .cfg-row > :nth-child(n+3) { grid-column: 2; }
  .set-row { flex-direction: column; align-items: flex-start; }
  .set-row .inp, .set-row .sel { width: 100%; }
  .field .inp { width: 100%; }
  .bar .field { flex: 1 1 200px; }
  .notif { left: 16px; width: auto; }
}
@media (max-width: 560px) {
  .demo-bar .txt { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi strong { font-size: 20px; }
  .hbar { grid-template-columns: 100px 1fr 34px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
