/* Cinderblock portal. Developed by Clicky Fyre Company.
   Design tokens first: every color comes from a variable, so dark and light themes stay in step.
   Theme: follows the device, or the viewer's choice (data-theme on <html>, saved in localStorage). */

@font-face { font-family: "Bricolage"; src: url(fonts/bricolage-grotesque-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url(fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); font-weight: 700 800; font-display: swap; }
@font-face { font-family: "Plex"; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "PlexArabic"; src: url(fonts/ibm-plex-sans-arabic-400.woff2) format("woff2"); font-weight: 400 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "PlexArabic"; src: url(fonts/ibm-plex-sans-arabic-600.woff2) format("woff2"); font-weight: 600 800; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "PlexMono"; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PlexMono"; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  --font: "Plex", "PlexArabic", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Bricolage", "Plex", -apple-system, "Segoe UI", sans-serif;
  --mono: "PlexMono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 14px; --r-sm: 9px;
  /* light */
  --bg: #f5f3ef; --side: #f5f3ef; --card: #ffffff; --card-2: #f3f0eb; --line: #e6e1d9; --line-2: #d9d3c9;
  --ink: #1d1b18; --muted: #6b655d; --faint: #9a938a;
  --accent: #c8521d; --accent-ink: #ffffff; --accent-soft: #fbe8de; --accent-line: #efc6b1;
  --valid: #2c79d6; --bad: #e5652d; --bad-ink: #b8461b; --bad-soft: #fbe5dc;
  --ok: #2d8a47; --ok-soft: #e1f3e5; --warn: #8a6608; --warn-bar: #8a6608; --warn-soft: #f7efd3;
  --info: #1f78b4; --info-soft: #e2eff7; --shadow: 0 1px 0 rgba(0,0,0,.02);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121110; --side: #121110; --card: #1c1b19; --card-2: #252321; --line: #2e2c29; --line-2: #3b3935;
  --ink: #f2eee8; --muted: #aaa39a; --faint: #756f67;
  --accent: #f26d2b; --accent-ink: #1b0f07; --accent-soft: #3a2116; --accent-line: #6b3a22;
  --valid: #3a86e3; --bad: #e8622a; --bad-ink: #f08a5a; --bad-soft: #3a2116;
  --ok: #43b96c; --ok-soft: #173222; --warn: #e8b73f; --warn-bar: #e8b73f; --warn-soft: #3a3016;
  --info: #4aa8e0; --info-soft: #16293a; --shadow: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #121110; --side: #121110; --card: #1c1b19; --card-2: #252321; --line: #2e2c29; --line-2: #3b3935;
    --ink: #f2eee8; --muted: #aaa39a; --faint: #756f67;
    --accent: #f26d2b; --accent-ink: #1b0f07; --accent-soft: #3a2116; --accent-line: #6b3a22;
    --valid: #3a86e3; --bad: #e8622a; --bad-ink: #f08a5a; --bad-soft: #3a2116;
    --ok: #43b96c; --ok-soft: #173222; --warn: #e8b73f; --warn-bar: #e8b73f; --warn-soft: #3a3016;
    --info: #4aa8e0; --info-soft: #16293a; --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; }
h1 { font-size: 34px; line-height: 1.1; margin: 0 0 6px; font-weight: 700; }
h2 { font-size: 21px; margin: 0 0 10px; font-weight: 700; }
h3 { font-size: 16px; margin: 14px 0 6px; font-weight: 600; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .strong { font-weight: 600; }
.mono { font-family: var(--mono); } .nowrap { white-space: nowrap; } .num { font-family: var(--mono); text-align: right; }
.inline { display: inline; margin: 0; }
code { font-family: var(--mono); background: var(--card-2); padding: 1px 6px; border-radius: 5px; font-size: .92em; }
svg { width: 18px; height: 18px; }

/* ---------- shell: sidebar + main ---------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 0 6px; }
.brand .mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); }
.brand .mark svg { width: 19px; height: 19px; }
.brand .word { font: 700 20px/1 var(--display); }
.ws { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.ws-pick { display: block; padding: 0; }
.ws-pick summary { display: flex; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; list-style: none; }
.ws-pick summary::-webkit-details-marker { display: none; }
.ws-badge { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--card-2); font: 600 12px var(--font); }
.ws-logo { flex: none; height: 30px; max-width: 64px; object-fit: contain; border-radius: 6px; background: #fff; padding: 2px; }
.ws-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ws-text b { font-size: 14px; font-weight: 600; } .ws-text small { font-size: 12px; color: var(--muted); }
.chev { margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-top: -4px; }
.ws-menu { border-top: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; max-height: 260px; overflow: auto; }
.ws-menu a { text-decoration: none; padding: 7px 8px; border-radius: 7px; font-size: 14px; }
.ws-menu a:hover { background: var(--card-2); } .ws-menu .more { color: var(--accent); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font: 600 11.5px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; text-decoration: none; font-size: 15px; color: var(--ink); }
.side nav a i { width: 6px; height: 6px; border-radius: 2px; background: var(--line-2); flex: none; }
.side nav a em { margin-left: auto; font: 500 12px var(--mono); font-style: normal; color: var(--muted); }
.side nav a em.hot { color: var(--accent); }
.side nav a:hover { background: var(--card); }
.side nav a.on { background: var(--card-2); font-weight: 600; }
.side nav a.on i { background: var(--accent); }
.prot { margin-top: auto; padding: 12px 14px; border-radius: 12px; background: var(--info-soft); display: flex; flex-direction: column; gap: 2px; }
.prot b { color: var(--info); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.prot b i { width: 8px; height: 8px; border-radius: 50%; background: var(--info); }
.prot span { font-size: 12.5px; color: var(--muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.main.solo { min-height: 100vh; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; padding: 18px 28px 6px; }
.filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 11px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--muted); font-size: 14px; }
.chip select { border: 0; background: transparent; color: var(--ink); font: 600 14px var(--font); padding: 6px 4px; max-width: 170px; cursor: pointer; }
.filterbar .chip select { max-width: 132px; }
.chip select:focus { outline: none; }
.switch { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .knob { position: relative; width: 38px; height: 22px; border-radius: 22px; background: var(--line-2); transition: .15s; flex: none; }
.switch .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); transition: .15s; }
.switch input:checked + .knob { background: var(--accent); }
.switch input:checked + .knob::after { left: 19px; background: var(--accent-ink); }
.search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); width: 210px; flex: none; margin: 0; color: var(--muted); }
.side-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; margin: 0; font-size: 13px; }
.side-foot a { color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell { background: linear-gradient(to right, var(--side) 256px, var(--line) 256px, var(--line) 257px, transparent 257px); }

.spike-card h2 { font-size: 19px; }
.search input { border: 0; background: transparent; padding: 0; width: 100%; color: var(--ink); font-size: 14px; }
.search input:focus { outline: none; }
.icon-btn { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; padding: 0; }
.icon-btn b { position: absolute; top: -7px; right: -7px; min-width: 19px; height: 19px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font: 600 11px/19px var(--font); text-align: center; padding: 0 5px; }
.menu-btn { display: none; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--card-2); font: 600 13px var(--font); text-decoration: none; }
.logout .linkbtn, .linkbtn { background: none; border: 0; color: var(--muted); font: 500 13px var(--font); cursor: pointer; padding: 6px; }
.linkbtn:hover { color: var(--ink); }

/* ---------- page ---------- */
.wrap { width: 100%; max-width: 1480px; padding: 18px 28px 40px; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead p { margin: 0; }
.pagehead .row { margin: 0; }
.sub { color: var(--muted); font-size: 16px; margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow); min-width: 0; }
.card > h2:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; } .card-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.grid > .card { margin-bottom: 0; }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.g-half { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid2 > .card { margin-bottom: 0; }

/* buttons, inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font: 600 14.5px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { background: var(--bad-soft); border-color: var(--accent-line); color: var(--bad-ink); }
.btn.ghost { background: transparent; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.big { height: 48px; padding: 0 22px; font-size: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.row.tight { margin: 0; gap: 6px; }
input, select, textarea { font: inherit; font-size: 14.5px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--card-2); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-line); outline-offset: 0; border-color: var(--accent); }
textarea { width: 100%; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type=file] { background: transparent; border: 0; padding: 0; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.form.narrow { max-width: 620px; }
.form > button, .form fieldset > button { align-self: flex-start; }
label.chk { flex-direction: row !important; align-items: center; gap: 10px; font-weight: 500 !important; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
fieldset.plain { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.filters input { width: 150px; }
.filters label.chk { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 10px; color: var(--ink); }
.filters label.chk input { width: auto; }
.row input, .row select { min-width: 0; }

/* alerts, pills, tags */
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.bad { background: var(--bad-soft); color: var(--bad-ink); border-color: var(--accent-line); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert a { color: inherit; font-weight: 600; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 2px 9px; border-radius: 7px; font: 600 13px var(--mono); }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad-ink); }
.tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 7px; background: var(--card-2); color: var(--ink); font-size: 12.5px; font-weight: 600; margin: 1px 0; white-space: nowrap; }
.tag.bad { background: var(--bad-soft); color: var(--bad-ink); } .tag.g { background: var(--info-soft); color: var(--info); } .tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.warn { background: var(--warn-soft); color: var(--warn); }
.cc { display: inline-block; font: 600 11px var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--card-2); color: var(--ink); border: 1px solid var(--line); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.bad { background: var(--bad); } .dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.info { background: var(--info); }

/* tables */
.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font: 600 12px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tr.blocked td { background: var(--bad-soft); }
.t td.url { max-width: 380px; word-break: break-all; }
.t td.num, .t th.num { text-align: right; }
.t tfoot td { font-weight: 700; border-top: 1px solid var(--line-2); border-bottom: 0; }
.tscroll { overflow-x: auto; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; margin: 6px 0; }
.kv dt { color: var(--muted); font-weight: 500; font-size: 14px; } .kv dd { margin: 0; }
.steps { padding-left: 22px; } .steps li { margin: 5px 0; }
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; width: min(520px, 94vw); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(10, 8, 6, .55); }
.danger-zone { margin-top: 26px; padding: 14px 16px; border: 1px solid var(--accent-line); border-radius: 12px; background: var(--bad-soft); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 8px 14px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14.5px; }
.tabs a:hover { color: var(--ink); background: var(--card); }
.tabs a.on { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { border: 0; background: none; color: var(--muted); font: 600 14px var(--font); padding: 7px 14px; border-radius: 9px; text-decoration: none; cursor: pointer; }
.seg a.on, .seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg.accent a.on, .seg.accent button.on { background: var(--accent); color: var(--accent-ink); }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .label { color: var(--muted); font-size: 14px; }
.kpi .value { font: 700 clamp(21px, 1.9vw, 32px)/1.15 var(--display); letter-spacing: -.01em; white-space: nowrap; }
.kpi .value.bad { color: var(--bad-ink); } .kpi .value.warn { color: var(--warn); }
.kpi .meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.delta { display: inline-block; padding: 2px 8px; border-radius: 7px; font: 600 13px var(--font); background: var(--card-2); color: var(--muted); }
.delta.up { background: var(--ok-soft); color: var(--ok); } .delta.down { background: var(--bad-soft); color: var(--bad-ink); } .delta.warn { background: var(--warn-soft); color: var(--warn); }
.meter { height: 6px; border-radius: 6px; background: var(--card-2); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; border-radius: 6px; background: var(--valid); }
.meter i.bad { background: var(--bad); } .meter i.ok { background: var(--ok); } .meter i.warn { background: var(--warn-bar); }

/* ---------- charts (pure HTML) ---------- */
.chart-legend { display: flex; gap: 16px; font-size: 14px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 11px; height: 11px; border-radius: 3px; background: var(--valid); }
.chart-legend i.bad { background: var(--bad); } .chart-legend i.soft { background: #a9cbdc; }
.stack { display: flex; align-items: flex-end; gap: 12px; height: 260px; padding: 26px 0 0; border-bottom: 1px solid var(--line-2); margin-top: 8px;
  background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 33.3%; background-position: 0 26px; }
.stack .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; position: relative; min-width: 0; }
.stack .col b { position: absolute; left: 0; right: 0; text-align: center; font: 500 12.5px var(--mono); color: var(--muted); transform: translateY(-20px); }
.stack .col .inv { background: var(--bad); border-radius: 5px 5px 0 0; }
.stack .col .val { background: var(--valid); }
.stack .col .inv + .val { border-radius: 0; }
.stack .col .val:first-child { border-radius: 5px 5px 0 0; }
.stack.soft .col .val { background: #a9cbdc; }
.stack.dense { gap: 5px; height: 220px; }
.xlabels { display: flex; gap: 12px; margin-top: 10px; }
.xlabels > div { flex: 1; text-align: center; font-size: 13.5px; color: var(--muted); min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.xlabels .chip-s { display: inline-block; padding: 2px 9px; border-radius: 8px; background: var(--card-2); font: 600 12px var(--font); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.xlabels .chip-s.hot { background: var(--bad-soft); color: var(--bad-ink); }
.xlabels.dense { justify-content: space-between; } .xlabels.dense > div { flex: none; }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { position: relative; width: 170px; height: 170px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut .center b { font: 700 28px/1 var(--display); } .donut .center span { font-size: 13px; color: var(--muted); margin-top: 4px; }
.donut.sm { width: 120px; height: 120px; } .donut.sm .center b { font-size: 22px; }
.legend-list { display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.legend-list span { display: flex; align-items: center; gap: 9px; }
.legend-list i { width: 11px; height: 11px; border-radius: 3px; background: var(--valid); } .legend-list i.bad { background: var(--bad); } .legend-list i.soft { background: #a9cbdc; }
.overline { font: 600 12px var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.hbars { display: flex; flex-direction: column; gap: 16px; }
.hbar .top { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; margin-bottom: 7px; }
.hbar .top b { font: 500 14px var(--mono); }
.hbar .track { height: 6px; border-radius: 6px; background: var(--card-2); overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--bad); border-radius: 6px; }
.hbar .track i.info { background: var(--info); }
.rate { display: flex; align-items: center; gap: 10px; }
.rate .track { width: 90px; height: 6px; border-radius: 6px; background: var(--card-2); overflow: hidden; flex: none; }
.rate .track i { display: block; height: 100%; background: var(--bad); }
.cell-sub { display: block; color: var(--muted); font-size: 13.5px; }

/* lists (new sources, feed) */
.list { display: flex; flex-direction: column; }
.list .item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.list .item:last-child { border-bottom: 0; }
.list .item .main-t { flex: 1; min-width: 0; }
.list .item .ip { font: 500 16px var(--mono); }
.list .item .why { color: var(--muted); font-size: 14px; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--info); white-space: nowrap; }
.status.warn { color: var(--warn); } .status .dot { background: currentColor; }
.scorebox { flex: none; display: grid; place-items: center; width: 50px; height: 42px; border-radius: 10px; font: 600 16px var(--mono); background: var(--bad-soft); color: var(--bad-ink); }
.scorebox.warn { background: var(--warn-soft); color: var(--warn); } .scorebox.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- click forensics ---------- */
.forensics { display: grid; grid-template-columns: minmax(280px, 400px) minmax(0, 1fr); gap: 18px; align-items: start; }
.clicklist { padding: 10px; max-height: calc(100vh - 170px); overflow-y: auto; position: sticky; top: 16px; }
.clicklist a { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 12px; text-decoration: none; border: 1px solid transparent; }
.clicklist a:hover { background: var(--card-2); }
.clicklist a.on { background: var(--card-2); border-color: var(--line-2); }
.clicklist .mid { flex: 1; min-width: 0; }
.clicklist .mid .ip { display: block; font: 500 15px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clicklist .mid .kw { display: block; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clicklist .right { text-align: right; font-size: 13px; color: var(--muted); }
.verdict { font: 600 14px var(--font); } .verdict.bad { color: var(--bad-ink); } .verdict.warn { color: var(--warn); } .verdict.ok { color: var(--ok); }
.hero { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .center b { font: 700 32px/1 var(--display); } .ring .center span { font-size: 12px; color: var(--muted); }
.hero .story { flex: 1; min-width: 240px; }
.hero .story .ipline { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.hero .story .ipline .ip { font: 500 24px var(--mono); }
.hero .story p { margin: 0; font-size: 17px; line-height: 1.6; }
.hero .actions { display: flex; flex-direction: column; gap: 10px; }
.facts { display: flex; flex-direction: column; }
.facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.facts > div:last-child { border-bottom: 0; }
.facts dt, .facts .k { color: var(--muted); flex: none; } .facts .v { display: flex; align-items: center; justify-content: flex-end; gap: 9px; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.detail-grid { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline div { display: flex; gap: 16px; align-items: center; font-size: 15px; }
.timeline .tm { font: 500 14px var(--mono); color: var(--muted); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- protection rules ---------- */
.rules { display: flex; flex-direction: column; gap: 12px; }
.rule { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.rule.off { opacity: .62; }
.rule .body { flex: 1; min-width: 0; }
.rule .body b { font-size: 16.5px; font-weight: 600; }
.rule .body p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.rule .hits { text-align: right; font-size: 13px; color: var(--muted); }
.rule .hits b { display: block; font: 600 18px var(--display); color: var(--ink); }
.toggle { position: relative; display: inline-block; width: 52px; height: 30px; flex: none; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 30px; background: var(--line-2); transition: .15s; }
.toggle span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); transition: .15s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { left: 26px; background: var(--accent-ink); }
.checkcard, .form label.checkcard { display: flex; flex-direction: row; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); font-weight: 400; cursor: pointer; }
.checkcard > span { display: flex; flex-direction: column; gap: 2px; }
.checkcard input { margin-top: 3px; width: 20px; height: 20px; }
.checkcard b { display: block; font-weight: 600; font-size: 15.5px; color: var(--ink); } .checkcard > span > span { color: var(--muted); font-size: 14px; }
.testbox { display: flex; align-items: center; gap: 20px; padding: 16px 20px; border-radius: 12px; background: var(--card-2); }
.testbox div { flex: 1; } .testbox b.big { font: 700 34px var(--display); }
.slots .meter { height: 8px; }

/* ---------- client report ---------- */
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.report-head .who { display: flex; gap: 18px; align-items: center; }
.logo-box { width: 72px; height: 72px; border-radius: 12px; border: 1.5px dashed var(--line-2); display: grid; place-items: center; font-size: 12px; color: var(--muted); text-align: center; overflow: hidden; background: var(--card); }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.report-head h1 { font-size: 30px; margin: 0; }
.report-head .by { text-align: right; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.saved-hero { background: #1b1916; color: #f5f1ea; border-radius: 16px; padding: 30px 36px; display: flex; flex-direction: column; justify-content: center; }
:root[data-theme="dark"] .saved-hero { background: #0b0a09; border: 1px solid var(--line); }
.saved-hero .label { font-size: 16px; opacity: .85; }
.saved-hero .amount { font: 800 64px/1.05 var(--display); letter-spacing: -.02em; margin: 8px 0; }
.saved-hero .how { font-size: 16px; opacity: .9; }
.cc-row { display: flex; align-items: center; gap: 14px; font-size: 15px; }
.cc-row .cc { min-width: 32px; text-align: center; padding: 3px 6px; }
.cc-row .name { width: 170px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-row .track { flex: 1; height: 7px; border-radius: 6px; background: var(--card-2); overflow: hidden; }
.cc-row .track i { display: block; height: 100%; background: var(--info); border-radius: 6px; }
.cc-row .pct { width: 44px; text-align: right; font-family: var(--mono); font-size: 14px; color: var(--muted); }
/* Arabic (right to left) client report: the layout mirrors; numbers, IPs and links stay left to right inside <bdi> */
.report[dir="rtl"] { font-family: "PlexArabic", var(--font); }
.report[dir="rtl"] h1, .report[dir="rtl"] h2 { font-family: "PlexArabic", var(--font); letter-spacing: 0; }
.report[dir="rtl"] .t th, .report[dir="rtl"] .t td { text-align: right; }
.report[dir="rtl"] .t td.num, .report[dir="rtl"] .t th.num { text-align: left; }
.report[dir="rtl"] .report-head .by { text-align: left; align-items: flex-start; }
.report[dir="rtl"] .t th, .report[dir="rtl"] .overline { letter-spacing: 0; text-transform: none; }
.report-foot { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.printfoot { display: none; }

/* ---------- auth pages ---------- */
body.plain { display: block; }
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.authbox { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 30px; width: min(430px, 100%); }
.authbox.wide { width: min(580px, 100%); }
.authbox .brand { padding: 0; margin-bottom: 18px; }
.authbox .brand .logo, .bare-brand .logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font: 700 12px var(--font); }
.authbox .brand, .bare-brand { font: 700 20px var(--display); display: flex; align-items: center; gap: 12px; }
.authbox h1 { font-size: 28px; }
.authbox .foot { padding: 16px 0 0; }
.foot { text-align: center; color: var(--faint); font-size: 13px; padding: 20px; margin-top: auto; }

/* ---------- older page parts (kept for the site, client and system pages) ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.stat b { display: block; font: 700 28px/1.15 var(--display); }
.stat span { color: var(--muted); font-size: 14px; }
.stat small { display: block; color: var(--muted); font-size: 12.5px; }
.stat.warn b { color: var(--bad-ink); } .stat.good b { color: var(--ok); }
.stats.big .stat b { font-size: 32px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 6px; justify-content: flex-start; }
.bar { position: relative; flex: 1; max-width: 60px; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar i { position: absolute; bottom: 20px; width: 72%; max-height: calc(100% - 20px); background: var(--line-2); border-radius: 5px 5px 0 0; }
.bar i.a { width: 44%; background: var(--valid); } .bar i.b { width: 24%; background: var(--bad); }
.bar span { position: absolute; bottom: 0; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--line-2); margin-right: 6px; vertical-align: -1px; }
.legend i.a { background: var(--valid); } .legend i.b { background: var(--bad); }
.viewas { background: var(--warn-soft); color: var(--warn); padding: 9px 20px; font-size: 14px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.grouphead, .cocell, .cohead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.grouphead h2 { margin: 0 6px 0 0; } .grouphead { margin-bottom: 10px; }
.clogo { height: 30px; width: auto; max-width: 96px; object-fit: contain; border-radius: 6px; background: #fff; padding: 2px; }
.clogo.big { height: 58px; max-width: 170px; }
.clogo.ph { display: inline-grid; place-items: center; width: 30px; background: var(--card-2); color: var(--ink); font-weight: 700; font-size: 13px; }
.t td.num { width: 80px; }
.qr { margin: 8px 0; }
.qr svg { display: block; width: 190px; height: 190px; background: #fff; border-radius: 10px; padding: 4px; }
.secret { font-family: var(--mono); }

.card.spike-card { border-color: var(--accent); background: var(--bad-soft); }

/* ---------- mobile ---------- */
.tabbar { display: none; }
@media (max-width: 1380px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .g-main, .g-half, .forensics, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .search { width: 200px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-105%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  body.menu-open .side { transform: none; }
  .menu-btn { display: grid; }
  .topbar { padding: 12px 14px 4px; flex-wrap: wrap; }
  .topbar .spacer { flex: 1; }
  .topbar .brand { padding: 0; }
  .filterbar { order: 5; flex-basis: 100%; flex: none; width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .filterbar .chip { flex: none; } .filterbar .chip select { max-width: 130px; }
  .switch { white-space: nowrap; flex: none; }
  .search { display: none; }
  .logout { display: none; }
  .wrap { padding: 12px 14px 96px; }
  h1 { font-size: 28px; }
  .kpis, .kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 14px 16px; } .kpi .value { font-size: 26px; }
  .kpi .meter { display: none; }
  .card { padding: 18px 16px; }
  .split, .grid2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; }
  .stack { gap: 6px; height: 200px; } .xlabels { gap: 6px; } .xlabels .chip-s { display: none; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--side); border-top: 1px solid var(--line); padding: 8px 6px calc(10px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
  .tabbar a i { width: 30px; height: 4px; border-radius: 3px; background: transparent; }
  .tabbar a.on { color: var(--ink); } .tabbar a.on i { background: var(--accent); }
  .foot { padding-bottom: 90px; }
  .saved-hero .amount { font-size: 44px; }
  .report-head .by { align-items: flex-start; text-align: left; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 901px) { .only-mobile { display: none !important; } }

/* ---------- print (client report PDF) ---------- */
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --card: #fff; --card-2: #f3f0eb; --line: #ddd6cc; --line-2: #cfc7bb; --ink: #1d1b18; --muted: #5d574f;
    --bad: #d85a25; --bad-ink: #b8461b; --bad-soft: #fbe5dc; --valid: #2c79d6; --info: #1f78b4; color-scheme: light; }
  .side, .topbar, .tabbar, .noprint, .foot, .viewas { display: none !important; }
  .shell { display: block; } .wrap { max-width: none; padding: 0; }
  body { background: #fff; font-size: 12px; }
  .card, .kpi, .saved-hero { break-inside: avoid; }
  .saved-hero { background: #1b1916 !important; color: #f5f1ea !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .stack .col .inv, .stack .col .val, .hbar .track i, .cc-row .track i, .donut svg { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .printfoot { display: block; text-align: center; color: #666; margin-top: 16px; }
  @page { margin: 12mm; }
}

/* Google safety checks (1.5) */
.checks { display: grid; gap: 10px; margin-top: 6px; }
.check { display: flex; gap: 12px; align-items: flex-start; }
.check .tag { min-width: 66px; justify-content: center; text-align: center; flex: none; }
.alert.small { font-size: 13px; padding: 8px 12px; margin-bottom: 10px; }
.advice { margin: 8px 0 14px; padding-left: 20px; display: grid; gap: 6px; }

/* White-label logo (Settings, Branding) */
.brand-logo { display: block; width: auto; height: 32px; max-width: 120px; object-fit: contain; border-radius: 6px; }
.brand-preview { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card-2); }
.brand-preview .swatch { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); }

/* Shared report (no login, no menu) */
.bare-main { max-width: 1180px; margin: 0 auto; padding: 22px 16px 30px; }
.bare-brand { margin-bottom: 18px; padding: 0; }

/* Setup checklist and Action center */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist li i { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font: 700 12px var(--font); font-style: normal; background: var(--card-2); color: var(--muted); }
.checklist li.ok i { background: var(--ok-soft); color: var(--ok); }
.checklist li.todo i { background: var(--warn-soft); color: var(--warn); }
.checklist li span { display: flex; flex-direction: column; gap: 2px; }
.checklist li small { color: var(--muted); font-size: 13px; }
.actions-list { list-style: none; margin: 0; padding: 0; }
.actions-list li { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line); }
.actions-list li:last-child { border-bottom: 0; }
.actions-list .what { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 320px; }
.actions-list .what small { color: var(--muted); font-size: 13px; }
.actions-list .go { display: flex; gap: 8px; align-items: center; }
