/* LayerDefend panel. Dark, quiet, lines instead of boxes where possible; colour only where it carries meaning. */
:root {
  --bg: #09090b;
  --bg-2: #0d0d10;
  --card: #0f0f12;
  --card-2: #141418;
  --hover: #17171c;
  --line: #1d1d22;
  --line-2: #27272e;
  --line-3: #34343c;
  --text: #ececf1;
  --muted: #a1a1ac;
  --dim: #6c6c78;
  --green: #2ed191;
  --blue: #4ea1ff;
  --amber: #f2a93b;
  --red: #f0545f;
  --violet: #a78bfa;
  --cyan: #2dd4d8;
  --radius: 10px;
  --radius-s: 8px;
  --side: 244px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;
  color-scheme: dark;
}
@font-face {
  font-family: "Twemoji Country Flags";
  src: url(flags.woff2) format("woff2");
  font-display: swap;
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Inter", "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: inherit; text-decoration: none; }
a.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
a.link:hover { text-decoration-color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(78, 161, 255, .3); }
:focus-visible { outline: 2px solid rgba(78, 161, 255, .55); outline-offset: 2px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.tight { gap: 4px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.s { gap: 6px; }
.stack.l { gap: 20px; }
.hidden { display: none !important; }
.ok { color: var(--green); }
.bad { color: var(--red); }
.warn { color: var(--amber); }
.flag { font-family: "Twemoji Country Flags", system-ui; display: inline-block; width: 1.4em; text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Icons ─────────────────────────────────────────────────────────── */
.ic { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic.s { width: 14px; height: 14px; }
.ic.l { width: 20px; height: 20px; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px; border-radius: var(--radius-s);
  border: 1px solid var(--line-2); background: var(--card-2); color: var(--text);
  font-weight: 500; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, opacity .12s;
}
.btn:hover { background: var(--hover); border-color: var(--line-3); }
.btn.primary { background: #f4f4f6; border-color: #f4f4f6; color: #0b0b0d; }
.btn.primary:hover { background: #fff; border-color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: #ff8a92; border-color: rgba(240, 84, 95, .35); background: rgba(240, 84, 95, .06); }
.btn.danger:hover { background: rgba(240, 84, 95, .12); border-color: rgba(240, 84, 95, .55); }
.btn.solid-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.s { height: 28px; padding: 0 9px; font-size: 12.5px; gap: 5px; }
.btn.icon { width: 34px; padding: 0; }
.btn.s.icon { width: 28px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn .spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Form fields ───────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 500; color: var(--text); }
.field .hint { font-size: 12px; color: var(--dim); }
.input, .select, textarea.input {
  width: 100%; height: 36px; padding: 0 11px; border-radius: var(--radius-s);
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 92px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
textarea.input.mono { font-size: 12.5px; }
.input::placeholder, textarea.input::placeholder { color: var(--dim); }
.input:hover, .select:hover { border-color: var(--line-3); }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: #4b4b55; box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
.input.s, .select.s { height: 30px; font-size: 13px; padding: 0 9px; }
.select {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1ac' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select option { background: #141418; }
.row > .select, .row > .input, .page-head > .select { width: auto; min-width: 130px; max-width: 100%; }
.page-head > .input { width: min(300px, 100%); }
.row > .input-wrap.grow .input { width: 100%; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input { padding-left: 34px; }
.input-wrap > .ic { position: absolute; left: 11px; color: var(--dim); pointer-events: none; }
.input-wrap .btn.ghost { position: absolute; right: 3px; height: 30px; width: 30px; padding: 0; }
.input-wrap.after .input { padding-left: 11px; padding-right: 38px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 13.5px; }
.check input { appearance: none; width: 16px; height: 16px; margin: 0; border: 1px solid var(--line-3); border-radius: 5px; background: var(--bg-2); display: grid; place-content: center; cursor: pointer; flex: none; }
.check input:checked { background: #f4f4f6; border-color: #f4f4f6; }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #0b0b0d; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 34px; height: 20px; margin: 0; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #d4d4da; transition: transform .15s, background .15s; }
.switch input:checked { background: var(--green); }
.switch input:checked::after { transform: translateX(14px); background: #fff; }
.switch input:disabled { opacity: .5; cursor: not-allowed; }
.field > .seg { align-self: flex-start; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg-2); }
.seg button { border: 0; background: transparent; color: var(--muted); height: 28px; padding: 0 11px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--card-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.err-line { color: #ff8a92; font-size: 13px; }

/* ── Badges, dots ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  background: var(--card-2); color: var(--muted); border: 1px solid var(--line-2);
}
.badge.light { background: #ececf1; color: #0b0b0d; border-color: #ececf1; }
.badge.green { color: var(--green); background: rgba(46, 209, 145, .08); border-color: rgba(46, 209, 145, .25); }
.badge.blue { color: var(--blue); background: rgba(78, 161, 255, .08); border-color: rgba(78, 161, 255, .25); }
.badge.amber { color: var(--amber); background: rgba(242, 169, 59, .08); border-color: rgba(242, 169, 59, .25); }
.badge.red { color: #ff7b85; background: rgba(240, 84, 95, .08); border-color: rgba(240, 84, 95, .28); }
.badge.violet { color: var(--violet); background: rgba(167, 139, 250, .08); border-color: rgba(167, 139, 250, .25); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; display: inline-block; }
.dot.green { background: var(--green); box-shadow: 0 0 0 3px rgba(46, 209, 145, .14); }
.dot.red { background: var(--red); box-shadow: 0 0 0 3px rgba(240, 84, 95, .16); }
.dot.amber { background: var(--amber); box-shadow: 0 0 0 3px rgba(242, 169, 59, .15); }
.dot.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.status-code { font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: var(--card-2); }
.status-code.s2 { color: var(--green); }
.status-code.s3 { color: var(--blue); }
.status-code.s4 { color: var(--amber); }
.status-code.s5 { color: #ff7b85; }

/* ── App shell ─────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  border-right: 1px solid var(--line); background: var(--bg); padding: 14px 10px 10px; gap: 6px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.brand svg { width: 22px; height: 22px; }
.brand .sub { font-weight: 500; color: var(--dim); font-size: 12px; margin-left: auto; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-group { font-size: 11.5px; font-weight: 500; color: var(--dim); padding: 14px 10px 5px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 33px; padding: 0 10px; border-radius: var(--radius-s);
  color: var(--muted); font-size: 13.5px; font-weight: 500;
}
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.on { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.nav a.on .ic { color: var(--text); }
.nav a .count { margin-left: auto; font-size: 11.5px; color: var(--dim); }
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.me-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-s); cursor: pointer; }
.me-card:hover { background: var(--card); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-weight: 600; font-size: 13px; color: #0b0b0d;
  background: linear-gradient(135deg, #8fd3ff 0%, #4ea1ff 45%, #2ed191 100%);
}
.avatar.xl { width: 58px; height: 58px; font-size: 21px; }
.me-card .who { min-width: 0; flex: 1; line-height: 1.3; }
.me-card .who b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-card .who span { font-size: 12px; color: var(--dim); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; height: 54px; display: flex; align-items: center; gap: 12px;
  padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(9, 9, 11, .86); backdrop-filter: blur(10px);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); min-width: 0; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--line-3); }
.crumbs .cur { color: var(--text); font-weight: 500; }
.top .tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
.content { padding: 26px 28px 60px; width: 100%; max-width: 1360px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .t { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.page-head .t p { color: var(--muted); font-size: 13.5px; }
.banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); margin-bottom: 18px;
  border: 1px solid rgba(242, 169, 59, .3); background: rgba(242, 169, 59, .06); color: #ffd28a; font-size: 13.5px;
}
.banner.red { border-color: rgba(240, 84, 95, .35); background: rgba(240, 84, 95, .07); color: #ffb3b9; }
.banner.blue { border-color: rgba(78, 161, 255, .3); background: rgba(78, 161, 255, .06); color: #b8d9ff; }
.banner .grow { color: inherit; }

/* ── Cards, sections ───────────────────────────────────────────────── */
.card { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); min-height: 48px; }
.card-head h3 { font-size: 13.5px; }
.card-head .meta { font-size: 12px; color: var(--dim); }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }
.section { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 28px; padding: 26px 0; border-top: 1px solid var(--line); }
.section:first-child { border-top: 0; padding-top: 4px; }
.section > .about h2 { font-size: 15px; margin-bottom: 6px; }
.section > .about p { color: var(--muted); font-size: 13px; }
.section > .body { display: flex; flex-direction: column; gap: 16px; min-width: 0; max-width: 640px; }
.section > .body.wide { max-width: none; }
.save-bar {
  position: sticky; bottom: 16px; z-index: 15; display: flex; align-items: center; gap: 12px; margin-top: 18px;
  padding: 10px 12px 10px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(20, 20, 24, .94);
  backdrop-filter: blur(8px); box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
.save-bar .grow { color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 9px 12px 10px; font-size: 13.5px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--text); }
.empty { padding: 42px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ic { width: 28px; height: 28px; color: var(--dim); stroke-width: 1.5; }
.empty b { color: var(--text); font-weight: 600; }

/* ── KPI tiles ─────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: 1.35fr repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.kpi { padding: 15px 16px 14px; border-left: 1px solid var(--line); min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.kpi:first-child { border-left: 0; }
.kpi .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .v { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi.big .v { font-size: 30px; }
.kpi .d { font-size: 12px; color: var(--dim); }

/* ── Tables ────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 500; font-size: 12px; color: var(--dim); padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg-2); }
table.t td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr:hover td { background: rgba(255, 255, 255, .018); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t .sub { display: block; color: var(--dim); font-size: 12px; margin-top: 1px; }
table.t.compact td { padding: 7px 14px; }
tr.new td { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: rgba(78, 161, 255, .1); } }

/* ── Ranked lists ──────────────────────────────────────────────────── */
.rank { list-style: none; margin: 0; padding: 4px 0; }
.rank li { position: relative; display: flex; align-items: center; gap: 9px; padding: 7px 16px; font-size: 13px; min-height: 34px; }
.rank li .bar { position: absolute; left: 8px; top: 3px; bottom: 3px; border-radius: 6px; background: rgba(255, 255, 255, .035); pointer-events: none; }
.rank li > * { position: relative; }
.rank .key { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .key small { color: var(--dim); margin-left: 6px; }
.rank .n { font-variant-numeric: tabular-nums; font-weight: 500; }
.rank .p { width: 52px; text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.rank li.action { cursor: pointer; }
.rank li.action:hover .bar { background: rgba(255, 255, 255, .06); }

/* ── Charts ────────────────────────────────────────────────────────── */
.chart { position: relative; width: 100%; user-select: none; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--dim); font-size: 11px; font-family: inherit; }
.chart .cursor { stroke: var(--line-3); stroke-width: 1; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 170px; padding: 9px 11px; border-radius: 9px;
  background: rgba(17, 17, 21, .97); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); font-size: 12.5px;
}
.chart-tip .tt { color: var(--muted); margin-bottom: 5px; font-size: 12px; }
.chart-tip .tr { display: flex; align-items: center; gap: 7px; line-height: 1.75; }
.chart-tip .tr b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; padding-left: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.legend button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 0; cursor: pointer; color: var(--muted); }
.legend button.off { opacity: .38; }
.legend button b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.swatch { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.donut-wrap { display: flex; align-items: center; gap: 22px; padding: 18px; }
.donut-wrap .legend-col { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 0; font-size: 13px; }
.donut-wrap .legend-col div { display: flex; align-items: center; gap: 8px; }
.donut-wrap .legend-col b { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 500; }
.donut-wrap .legend-col span.p { width: 50px; text-align: right; color: var(--dim); }
.meter { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: #e6e6ea; }
.meter.green > i { background: var(--green); }
.meter.amber > i { background: var(--amber); }
.meter.red > i { background: var(--red); }

/* ── Layout grids for dashboards ───────────────────────────────────── */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }

/* ── Overlays: modal, drawer, menu, toast ──────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .62); display: grid; place-items: center; padding: 20px; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); animation: rise .18s ease-out;
}
.modal.wide { width: min(780px, 100%); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.modal-head { padding: 18px 20px 0; display: flex; flex-direction: column; gap: 5px; }
.modal-head p { color: var(--muted); font-size: 13.5px; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--bg-2); border-radius: 0 0 14px 14px; }
.drawer-bg { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .4); animation: fade .15s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(480px, 100%); overflow-y: auto;
  background: var(--card); border-left: 1px solid var(--line-2); box-shadow: -20px 0 60px rgba(0, 0, 0, .5); animation: slide .18s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { position: sticky; top: 0; background: var(--card); display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 16px 18px 30px; display: flex; flex-direction: column; gap: 18px; }
dl.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 9px 14px; margin: 0; font-size: 13.5px; }
dl.kv dt { color: var(--dim); }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.menu {
  position: fixed; z-index: 60; min-width: 200px; max-height: 360px; overflow-y: auto; padding: 5px;
  background: #121216; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); animation: fade .1s;
}
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: 13.5px; color: var(--text); text-align: left; }
.menu button:hover, .menu button.on { background: var(--hover); }
.menu button.on::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.menu .menu-label { font-size: 11.5px; color: var(--dim); padding: 6px 9px 3px; }
.toasts { position: fixed; z-index: 80; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 11px 14px; border-radius: 10px; font-size: 13.5px;
  background: #16161a; border: 1px solid var(--line-2); box-shadow: 0 14px 40px rgba(0, 0, 0, .5); animation: rise .18s ease-out;
}
.toast.err { border-color: rgba(240, 84, 95, .45); }
.toast.err .ic { color: var(--red); }
.toast.ok .ic { color: var(--green); }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--bg-2); border: 1px dashed var(--line-3); }
.secret-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.copy-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.copy-line code { min-width: 0; overflow-wrap: anywhere; }

/* ── Login ─────────────────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(700px 380px at 50% -8%, rgba(78, 161, 255, .10), transparent 70%), var(--bg); }
.login { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 24px; }
.login .logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.login .logo svg { width: 28px; height: 28px; }
.login-card { width: 100%; padding: 28px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(15, 15, 18, .92); display: flex; flex-direction: column; gap: 18px; }
.login-card .head { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.login-card .head h1 { font-size: 21px; }
.login-card .head p { color: var(--muted); font-size: 13.5px; }
.login .foot { color: var(--dim); font-size: 13px; text-align: center; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ── Profile header (account page) ─────────────────────────────────── */
.profile { display: flex; align-items: center; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.profile .who { display: flex; flex-direction: column; gap: 3px; }
.profile .who .name { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 600; }
.profile .who > span { color: var(--muted); font-size: 13.5px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--card); }
.stat-box .k { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.stat-box .v { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-box .v small { color: var(--dim); font-weight: 500; font-size: 13px; }

/* ── Site list rows ────────────────────────────────────────────────── */
.site-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .9fr) 34px; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.site-row:last-child { border-bottom: 0; }
.site-row:hover { background: rgba(255, 255, 255, .018); }
.site-row .name { display: flex; align-items: center; gap: 11px; min-width: 0; }
.site-row .name b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-row .name small { color: var(--dim); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favicon { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line-2); font-weight: 600; font-size: 12.5px; color: var(--muted); text-transform: uppercase; }
.site-row .cell { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; min-width: 0; }
.site-row .cell b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── Wizard ────────────────────────────────────────────────────────── */
.wiz { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; }
.wiz-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.wiz-steps li { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--dim); font-size: 13.5px; font-weight: 500; }
.wiz-steps li i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-3); font-style: normal; font-size: 11.5px; flex: none; }
.wiz-steps li.cur { color: var(--text); background: var(--card); }
.wiz-steps li.cur i { border-color: var(--text); color: var(--text); }
.wiz-steps li.done { color: var(--muted); }
.wiz-steps li.done i { background: var(--green); border-color: var(--green); color: #06140d; }
.wiz-body { max-width: 620px; display: flex; flex-direction: column; gap: 18px; }
.wiz-body .lead h2 { font-size: 19px; margin-bottom: 6px; }
.wiz-body .lead p { color: var(--muted); }
.result { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-s); border: 1px solid var(--line-2); background: var(--bg-2); font-size: 13.5px; }
.result.good { border-color: rgba(46, 209, 145, .3); background: rgba(46, 209, 145, .05); }
.result.bad { border-color: rgba(240, 84, 95, .32); background: rgba(240, 84, 95, .05); }
.result .ic { margin-top: 2px; }
.result.good .ic { color: var(--green); }
.result.bad .ic { color: var(--red); }
details.more { border-top: 1px solid var(--line); padding-top: 12px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; display: flex; align-items: center; gap: 6px; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary { margin-bottom: 12px; }
.tagbox { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; min-height: 36px; border: 1px solid var(--line-2); border-radius: var(--radius-s); background: var(--bg-2); }
.tagbox:focus-within { border-color: #4b4b55; box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
.tagbox .tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 4px 0 9px; border-radius: 6px; background: var(--card-2); border: 1px solid var(--line-2); font-size: 12.5px; font-family: var(--mono); }
.tagbox .tag button { border: 0; background: none; color: var(--dim); cursor: pointer; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; padding: 0; }
.tagbox .tag button:hover { color: var(--text); background: var(--hover); }
.tagbox input { flex: 1; min-width: 140px; border: 0; background: none; outline: none; height: 24px; padding: 0 6px; font-size: 13px; }
.rule-cond { display: grid; grid-template-columns: 1.1fr 1fr 1.6fr auto; gap: 8px; align-items: start; }
.rule-list .rl { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rule-list .rl:last-child { border-bottom: 0; }
.rule-list .rl .grow b { font-weight: 500; }
.rule-list .rl .grow small { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skeleton { background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-left: 0; }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--line); }
  .span-8, .span-7, .span-5 { grid-column: span 12; }
  .span-4 { grid-column: span 6; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 45; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s ease-out; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
  .app.nav-open .side { transform: none; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 44; background: rgba(0, 0, 0, .5); }
  .menu-btn { display: inline-flex; }
  .top { padding: 0 14px; }
  .content { padding: 20px 16px 60px; }
  .section { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .wiz { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .wiz-steps { flex-direction: row; overflow-x: auto; }
  .wiz-steps li span { display: none; }
  .wiz-steps li.cur span { display: inline; }
  .site-row { grid-template-columns: minmax(0, 1fr) auto; }
  .site-row .cell.opt { display: none; }
  .plan-grid, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .rule-cond { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .crumbs .hide-s { display: none; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-left: 0; border-top: 1px solid var(--line); }
  .kpi:nth-child(-n+2) { border-top: 0; }
  .kpi:nth-child(even) { border-left: 1px solid var(--line); }
  .kpi.big { grid-column: span 2; }
  .kpi.big + .kpi { border-left: 0; border-top: 1px solid var(--line); }
  .kpi.big ~ .kpi:nth-child(odd) { border-left: 1px solid var(--line); }
  .kpi.big ~ .kpi:nth-child(even) { border-left: 0; }
  .span-4, .span-6 { grid-column: span 12; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .page-head { align-items: flex-start; }
  .top .tools .hide-s { display: none; }
  dl.kv { grid-template-columns: 96px minmax(0, 1fr); }
}
