:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --text: #15181d;
  --muted: #5d6573;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #e3f3f1;
  --critical: #b4232c;
  --critical-bg: #fbe9ea;
  --high: #c2410c;
  --high-bg: #fdeee5;
  --medium: #a16207;
  --medium-bg: #fcf4dc;
  --low: #2563eb;
  --low-bg: #e8effd;
  --info: #5d6573;
  --info-bg: #eef0f3;
  --good: #15803d;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --radius: 12px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1014;
    --surface: #151a20;
    --surface-2: #1c222a;
    --border: #2a313b;
    --text: #e8ebef;
    --muted: #98a2b0;
    --accent: #2dd4bf;
    --accent-ink: #062320;
    --accent-soft: #10302d;
    --critical: #f8717a;
    --critical-bg: #3a1619;
    --high: #fb923c;
    --high-bg: #3a2113;
    --medium: #facc15;
    --medium-bg: #352c0c;
    --low: #7aa7ff;
    --low-bg: #16243f;
    --info: #98a2b0;
    --info-bg: #222831;
    --good: #4ade80;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
.brand .shield { fill: var(--accent); }
.brand .tick { fill: none; stroke: var(--accent-ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tabs { display: flex; gap: 4px; }
.tab { background: none; border: 0; padding: 8px 12px; border-radius: 8px; font: inherit; color: var(--muted); cursor: pointer; font-weight: 500; }
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.active { background: var(--accent-soft); color: var(--accent); }
.feed-pill { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.feed-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.feed-pill.ok .dot { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }
.feed-pill.busy .dot { background: var(--medium); animation: pulse 1s infinite alternate; }
.feed-pill.err .dot { background: var(--critical); }
@keyframes pulse { to { opacity: .3; } }

/* hero */
.hero { padding: 24px 0 12px; max-width: 760px; }
#tab-scan .hero { max-width: 960px; } /* wider on the scan page so the form, safety note and footer fit one screen */
.hero h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 700; letter-spacing: -.01em; }
.lead { color: var(--muted); margin: 8px 0 0; font-size: 16px; }
.scan-form { margin-top: 16px; }
.input-row { display: flex; gap: 8px; }
.input-row input {
  flex: 1; min-width: 0; height: 50px; padding: 0 16px; font: inherit; font-size: 16px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text);
}
.input-row input:focus, .cve-filters input:focus, .cve-filters select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.btn-primary {
  height: 50px; padding: 0 22px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-ghost:disabled { opacity: .6; cursor: default; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 14px; color: var(--muted); cursor: pointer; }
.scan-warn { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--text); background: var(--medium-bg); border: 1px solid color-mix(in srgb, var(--medium) 40%, transparent); }
.scan-warn svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--medium); }
.consent input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.form-error { color: var(--critical); background: var(--critical-bg); padding: 10px 14px; border-radius: 8px; margin: 12px 0 0; font-size: 14px; }
.checks { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.checks li { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.progress { padding: 18px 20px; margin-bottom: 24px; }
.progress-head { display: flex; align-items: center; gap: 10px; }
.progress-head .muted { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 13px; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-log { margin: 12px 0 0; padding-left: 22px; color: var(--muted); font-size: 14px; }
.progress-log li.done { color: var(--text); }
.progress-log li.done::marker { content: '✓  '; color: var(--good); }

/* summary */
.summary { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; padding: 24px; align-items: center; }
.score-box { position: relative; width: 132px; height: 132px; }
.ring { width: 132px; height: 132px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .9s ease; }
.score-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.grade { font-size: 44px; font-weight: 700; }
.summary-url { font-size: 14px; word-break: break-all; }
.verdict { font-size: 18px; font-weight: 600; margin: 4px 0 12px; }
.counts { display: flex; flex-wrap: wrap; gap: 8px; }
.count { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.count b { font-size: 16px; font-variant-numeric: tabular-nums; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.meta div { display: flex; gap: 6px; }
.meta dt { margin: 0; }
.meta dd { margin: 0; color: var(--text); }
.summary-actions { display: flex; flex-direction: column; gap: 8px; align-self: start; }

.sev-critical { color: var(--critical); background: var(--critical-bg); }
.sev-high { color: var(--high); background: var(--high-bg); }
.sev-medium { color: var(--medium); background: var(--medium-bg); }
.sev-low { color: var(--low); background: var(--low-bg); }
.sev-info, .sev-none, .sev-unscored { color: var(--info); background: var(--info-bg); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 32px 0 12px; }
.section-head h2 { font-size: 20px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* findings */
.findings { display: flex; flex-direction: column; gap: 8px; }
.finding { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.finding summary { display: grid; grid-template-columns: 82px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; cursor: pointer; list-style: none; }
.finding summary::-webkit-details-marker { display: none; }
.finding summary:hover { background: var(--surface-2); }
.badge { display: inline-block; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.f-title { font-weight: 600; }
.f-cat { font-size: 12px; color: var(--muted); }
.f-right { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.f-right .chev { transition: transform .2s; }
.finding[open] .chev { transform: rotate(90deg); }
.f-body { padding: 4px 16px 16px 110px; display: grid; gap: 12px; }
.f-body h4 { margin: 0 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.f-body p { margin: 0; }
.evidence { margin: 0; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; font-family: var(--mono); font-size: 12.5px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.fix { border-left: 3px solid var(--accent); padding-left: 12px; }
.cves { display: flex; flex-direction: column; gap: 6px; }
.cve-row { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: baseline; font-size: 13.5px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.cve-id { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.cve-desc { color: var(--muted); }
.kev-badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--critical); color: #fff; margin-left: 6px; vertical-align: 1px; letter-spacing: .03em; }
.fixed-in { color: var(--good); font-size: 12px; }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: 10px; }

/* techs */
.techs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.tech { padding: 14px 16px; }
.tech-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tech-name { font-weight: 600; }
.tech-ver { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.tech-src { font-size: 12px; color: var(--muted); }
.tech-status { margin-top: 8px; font-size: 13px; }
.tech-status.ok { color: var(--good); }
.tech details { margin-top: 8px; font-size: 13px; }
.tech details summary { cursor: pointer; color: var(--accent); }
.tech .cves { margin-top: 8px; }
.tech .cve-row { grid-template-columns: auto 1fr; }
.tech .cve-row .cve-desc { grid-column: 1 / -1; }

.disclaimer { margin: 28px 0 0; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 16px; }

/* CVE tab */
.cve-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 40px 0 20px; flex-wrap: wrap; }
.cve-head h1 { font-size: 30px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.stat { padding: 14px 16px; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); }
.cve-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; margin-top: 20px; align-items: start; }
.cve-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.cve-filters input[type=search] { flex: 1; min-width: 200px; height: 40px; padding: 0 12px; font: inherit; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.cve-filters select { height: 40px; padding: 0 10px; font: inherit; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.chk { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); cursor: pointer; }
.chk input { accent-color: var(--accent); }
.cve-list { display: flex; flex-direction: column; gap: 6px; }
.cve-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.cve-item .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cve-item .score { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; }
.cve-item .date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cve-item .desc { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); }
.cve-item .prods { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.cve-item .prod { font-family: var(--mono); font-size: 11.5px; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; color: var(--muted); }
.more { margin: 12px auto 0; display: block; }
.kev-side { padding: 16px; position: sticky; top: 76px; }
.kev-side h3 { font-size: 16px; }
.kev-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.kev-list li { font-size: 13px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.kev-list li:last-child { border: 0; }
.kev-list .cve-id { font-size: 12.5px; }
.kev-list .vp { color: var(--text); font-weight: 500; }

/* short tabs (Dependencies, Threat check…): keep the footer at the bottom of the window instead of floating mid-page */
body:has(> #app) { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body:has(> #app) > #app { width: 100%; flex: 1 0 auto; }
body:has(> #app) > .footer { flex: none; }
.footer { margin-top: 12px; border-top: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--muted); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .8fr); gap: 24px; padding-top: 14px; padding-bottom: 10px; }
.foot-logo { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text); text-decoration: none; }
.foot-logo:hover { text-decoration: none; }
.foot-logo .muted { font-weight: 500; font-size: 13px; }
.foot-brand p { margin: 4px 0 0; max-width: 380px; line-height: 1.55; }
.foot-privacy svg { width: 14px; height: 14px; flex: none; }
.foot-col h2 { margin: 2px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text); }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 3px 14px; }
.foot-col a, .foot-inline a { color: var(--muted); text-decoration: none; }
.foot-col a:hover, .foot-inline a:hover { color: var(--accent); text-decoration: underline; }
.foot-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 24px; padding-top: 9px; padding-bottom: 12px; border-top: 1px solid var(--border); font-size: 12px; }
.foot-bottom p { margin: 0; }
.foot-privacy { display: inline-flex; align-items: center; gap: 6px; }
.foot-inline { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-doc { margin-top: 32px; }
.footer-doc .foot-bottom { border-top: 0; padding-top: 12px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 14px 20px; } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .foot-grid { grid-template-columns: 1fr; } }
@media print { .footer-doc { display: none; } }

@media (max-width: 860px) {
  .cve-layout { grid-template-columns: 1fr; }
  .kev-side { position: static; }
  .summary { grid-template-columns: auto 1fr; }
  .summary-actions { grid-column: 1 / -1; flex-direction: row; }
}
@media (max-width: 600px) {
  .topbar-inner { gap: 10px; }
  .brand span { display: none; }
  .feed-pill #feedPillText { display: none; }
  .hero { padding-top: 28px; }
  .input-row { flex-direction: column; }
  .summary { grid-template-columns: 1fr; justify-items: start; }
  .finding summary { grid-template-columns: 1fr auto; }
  .finding summary .badge { grid-column: 1 / -1; justify-self: start; }
  .f-body { padding-left: 16px; }
  .cve-row { grid-template-columns: auto 1fr; }
  .cve-row .cve-desc { grid-column: 1 / -1; }
  .techs { grid-template-columns: 1fr; }
}

@media print {
  .topbar, .hero, .summary-actions, .filters, .footer, #progress { display: none !important; }
  body { background: #fff; color: #000; }
  .finding { break-inside: avoid; }
  .finding .f-body { display: grid !important; }
}

/* ===================== v2: AI prompts, dependencies, monitoring ===================== */
.sr-only, .offscreen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.btn-sm { height: auto; padding: 6px 12px; font-size: 13px; }
.btn-primary.btn-sm { height: 36px; padding: 0 14px; }
.btn-link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 6px 4px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--critical); }
.flashed { border-color: var(--good) !important; color: var(--good) !important; }
.btn-primary.flashed { background: var(--good); color: var(--accent-ink) !important; }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; }

.ai-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 18px; margin-top: 12px; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.ai-bar-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 280px; }
.ai-bar-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-bar select, .mon-actions select, .field select { height: 36px; padding: 0 10px; font: inherit; font-size: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.f-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prompt-preview { margin: 0; padding: 12px; max-height: 320px; overflow: auto; background: var(--surface-2); border-radius: 8px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; }

.page-head { padding: 40px 0 20px; max-width: 780px; }
.page-head h1 { font-size: clamp(24px, 3.4vw, 30px); }

/* dependencies */
.deps-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.deps-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.deps-card h3 { font-size: 16px; }
.deps-card p { margin: 0; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 22px 16px; border: 2px dashed var(--border); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over, .drop:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.drop input { display: none; }
.drop-icon { font-size: 22px; color: var(--accent); }
.gh-form { display: flex; gap: 8px; }
.gh-form input, .field input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; font: inherit; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.gh-form input:focus, .field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.gh-form .btn-primary { height: 42px; }
#depsError { margin-top: 12px; }
#depsProgress { margin-top: 16px; }
.dep-result { margin-top: 24px; }
.dep-summary { grid-template-columns: auto 1fr auto; }
.mini-grade { --g: var(--muted); width: 88px; height: 88px; border-radius: 50%; border: 8px solid var(--g); display: grid; place-content: center; text-align: center; line-height: 1.05; color: var(--g); }
.mini-grade span { font-size: 30px; font-weight: 700; }
.mini-grade small { font-size: 11px; color: var(--muted); }
.dep-result .findings { margin-top: 12px; }
.dep .f-title { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.note { margin-top: 12px; padding: 10px 14px; border-radius: 8px; background: var(--medium-bg); color: var(--text); font-size: 13.5px; }
.note p { margin: 0; }
.note p + p { margin-top: 4px; }

/* monitoring */
.monitor-layout { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
.mon-form { padding: 18px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; }
.mon-form h3 { font-size: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 6px; }
.field select { height: 42px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; text-align: center; padding: 8px 4px; font-size: 13px; color: var(--muted); }
.seg label + label span { border-left: 1px solid var(--border); }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
#chanFields { display: flex; flex-direction: column; gap: 12px; }
.help { margin: 0; }
.mon-form .consent { margin: 0; }
.mon-form .form-error { margin: 0; }
.import summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.import .gh-form { margin-top: 8px; }
.section-head.tight { margin-top: 0; }
.mon-list { display: flex; flex-direction: column; gap: 10px; }
.mon-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.mon-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.mon-grade { width: 56px; height: 56px; border-radius: 12px; display: grid; place-content: center; text-align: center; font-size: 24px; font-weight: 700; line-height: 1; background: var(--surface-2); color: var(--muted); }
.mon-grade small { font-size: 11px; font-weight: 500; margin-top: 3px; }
.mon-grade.g-good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.mon-grade.g-mid { background: var(--medium-bg); color: var(--medium); }
.mon-grade.g-bad { background: var(--critical-bg); color: var(--critical); }
.mon-main { min-width: 0; }
.mon-url { font-weight: 600; word-break: break-all; }
.mon-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 13px; margin-top: 2px; }
.pill { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.pill.busy { background: var(--medium-bg); color: var(--medium); }
.pill.err { background: var(--critical-bg); color: var(--critical); }
.mon-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.spark { width: 120px; height: 32px; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.counts.mini { gap: 4px; }
.counts.mini .count { padding: 1px 7px; }
.counts.mini .count b { font-size: 13px; }
.mon-stack { display: flex; flex-wrap: wrap; gap: 4px; }
.mon-stack .prod { font-family: var(--mono); font-size: 11.5px; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; color: var(--muted); }
.mon-alerts summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.mon-alerts ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.mon-alerts li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; }
.ok-dot, .err-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); display: inline-block; }
.err-dot { background: var(--critical); }
.mon-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px solid var(--border); padding-top: 12px; }
.mon-actions select { height: 32px; font-size: 13px; }
.mon-msg { margin: 0; color: var(--good); }
.mon-msg.bad { color: var(--critical); }
.code-note { margin: 0; background: var(--accent-soft); }
.code-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.code-row code { word-break: break-all; font-size: 12px; }

@media (max-width: 860px) {
  .deps-inputs, .monitor-layout { grid-template-columns: minmax(0, 1fr); }
  .mon-form { position: static; }
  .dep-summary { grid-template-columns: auto 1fr; }
}
@media (max-width: 600px) {
  .gh-form { flex-direction: column; }
  .mon-head { grid-template-columns: auto 1fr; }
  .mon-side { grid-column: 1 / -1; align-items: flex-start; }
  .mon-alerts li { grid-template-columns: auto 1fr; }
  .mon-alerts li > .muted { grid-column: 2; }
  .dep-summary { grid-template-columns: 1fr; }
}
@media print { .ai-bar, .f-actions, .prompt-preview { display: none !important; } }
@media (max-width: 920px) {
  .feed-pill #feedPillText { display: none; }
  .topbar-inner { gap: 12px; }
}

/* ===================== v3: EPSS, history, shared reports ===================== */
.cve-tags { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cve-tags .kev-badge { margin-left: 0; }
.epss { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; cursor: help; border: 1px solid transparent; }
.epss.e-hi { color: #fff; background: var(--critical); }
.epss.e-mid { color: var(--high); background: var(--high-bg); }
.epss.e-lo { color: var(--muted); background: var(--surface-2); }
.f-right { gap: 6px; }
.f-right .kev-badge { margin-left: 0; }
.legend { font-size: 12.5px; font-weight: 400; color: var(--muted); margin-left: 6px; cursor: help; }
.dep .f-title .epss { margin-left: 2px; }

/* shared report viewer */
.shared-mode .tabs, .shared-mode .hero, .shared-mode #progress, .shared-mode .owner-only { display: none !important; }
.shared-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin: 24px 0 16px; background: var(--accent-soft); }
.btn-a { display: inline-flex; align-items: center; text-decoration: none !important; }
#sharedError { margin-top: 32px; }

/* compare with previous scan */
.compare { margin-top: 12px; padding: 14px 18px; border-left: 4px solid var(--muted); }
.compare.up { border-left-color: var(--good); }
.compare.down { border-left-color: var(--critical); }
.compare-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.compare-score { font-variant-numeric: tabular-nums; }
.compare-body { display: flex; gap: 8px 24px; flex-wrap: wrap; margin-top: 8px; font-size: 14px; }
.compare-body details { flex: 1 1 260px; }
.compare-body summary { cursor: pointer; }
.compare-body details.dim summary { color: var(--muted); cursor: default; }
.diff-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.diff-list .badge { min-width: 70px; margin-right: 6px; }
.delta { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.delta.up, .compare.up .delta { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.delta.down, .compare.down .delta { background: var(--critical-bg); color: var(--critical); }

/* share box */
.share-box { margin-top: 12px; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.share-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.share-row input { flex: 1; min-width: 200px; height: 36px; padding: 0 10px; font-family: var(--mono); font-size: 13px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); }

/* history */
.page-head.with-action { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; max-width: none; flex-wrap: wrap; }
.page-head.with-action > div { max-width: 780px; }
.hist-list { display: flex; flex-direction: column; gap: 12px; }
.hist-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.hist-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.hist-main { min-width: 0; }
.hist-main .mon-url { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hist-side { display: flex; align-items: center; gap: 12px; }
.spark circle { fill: var(--accent); }
.hist-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.hist-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.hist-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.hist-table tr:last-child td { border-bottom: 0; }
.hist-table .num { font-variant-numeric: tabular-nums; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn-link { padding: 2px 6px; }
.g-good-text { color: var(--good); }
.g-mid-text { color: var(--medium); }
.g-bad-text { color: var(--critical); }
@media (max-width: 640px) {
  .hist-head { grid-template-columns: auto 1fr; }
  .hist-side { grid-column: 1 / -1; justify-content: space-between; }
  .hist-table thead { display: none; }
  .hist-table tr { display: grid; grid-template-columns: 1fr auto; padding: 6px 0; border-bottom: 1px solid var(--border); }
  .hist-table td { border: 0; padding: 2px 4px; }
  .row-actions { grid-column: 1 / -1; text-align: left; white-space: normal; }
}
@media print { .share-box, .shared-banner { display: none !important; } }
.diff-list li { display: flex; gap: 8px; align-items: baseline; }
.diff-list .badge { flex: none; margin-right: 0; }
/* CVE rows: id + tags on the first line, description full width below */
.cve-row { grid-template-columns: auto 1fr; gap: 4px 10px; }
.cve-row .cve-desc { grid-column: 1 / -1; }

/* ===================== v4: language toggle, DNS panel ===================== */
.lang-btn { flex: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 8px; cursor: pointer; }
.lang-btn:hover { background: var(--surface-2); }
.feed-pill + .lang-btn { margin-left: 4px; }
.dns-card { padding: 6px 18px; }
.dns-row { display: grid; grid-template-columns: 22px 150px 1fr; gap: 4px 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.dns-row:last-child { border-bottom: 0; }
.dns-ico { width: 20px; height: 20px; border-radius: 50%; display: grid; place-content: center; font-size: 12px; font-weight: 700; align-self: center; }
.dns-ico.ok { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.dns-ico.bad { background: var(--critical-bg); color: var(--critical); }
.dns-ico.na { background: var(--surface-2); color: var(--muted); }
.dns-label { font-weight: 600; }
.dns-val { min-width: 0; word-break: break-word; }
.dns-detail { grid-column: 3; font-size: 11.5px; color: var(--muted); word-break: break-all; background: none; padding: 0; }
.dns-note { margin: 10px 0 4px; }
@media (max-width: 600px) {
  .dns-row { grid-template-columns: 22px 1fr; }
  .dns-val, .dns-detail { grid-column: 2; }
}

/* ===================== v5: sign-in, user menu, admin ===================== */
.signed-out #app, .signed-out .tabs, .signed-out .feed-pill { display: none !important; }
.signin { min-height: calc(100vh - 200px); display: grid; place-items: center; padding: 40px 16px; }
.signin-card { max-width: 440px; width: 100%; padding: 32px 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.signin-card h1 { font-size: 24px; }
.signin-card p { margin: 0; }
.signin-logo { width: 48px; height: 48px; }
.signin-logo .shield { fill: var(--accent); }
.signin-logo .tick { fill: none; stroke: var(--accent-ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.btn-ms { display: inline-flex; align-items: center; gap: 12px; margin-top: 8px; padding: 0 20px; height: 44px; border: 1px solid #8c8c8c; border-radius: 4px; background: #fff; color: #5e5e5e; font-weight: 600; font-size: 15px; text-decoration: none !important; }
.btn-ms:hover { background: #f3f3f3; }
.btn-ms svg { width: 20px; height: 20px; }
@media (prefers-color-scheme: dark) { .btn-ms { background: #2f2f2f; color: #fff; border-color: #2f2f2f; } .btn-ms:hover { background: #3a3a3a; } }

.user-menu { position: relative; flex: none; }
.user-menu summary { list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-content: center; font-size: 13px; font-weight: 700; cursor: pointer; user-select: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 6px; z-index: 20; display: flex; flex-direction: column; }
.menu-user { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; word-break: break-all; }
.menu-user .pill { align-self: flex-start; margin-top: 4px; }
.menu-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-decoration: none !important; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--critical); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: 14px; z-index: 50; max-width: calc(100vw - 32px); box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.admin-card { padding: 4px 12px; overflow-x: auto; }
.audit-table code { font-size: 12px; }
.audit-target { max-width: 360px; word-break: break-all; }
@media (max-width: 1100px) {
  .feed-pill { display: none; }
  .tab { padding: 8px 9px; }
  .topbar-inner { gap: 10px; }
}

/* ===================== user guide (help.html) ===================== */
.help-back { margin-left: auto; }
.help-lang { margin-left: auto; text-decoration: none !important; }
.help-lang + .help-back { margin-left: 0; }
.doc-layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; padding-top: 32px; padding-bottom: 48px; }
.doc-toc { position: sticky; top: 80px; font-size: 14px; max-height: calc(100vh - 100px); overflow: auto; }
.doc-toc ol { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.doc-toc a { color: var(--muted); }
.doc-toc a:hover { color: var(--accent); }
.doc { max-width: 780px; min-width: 0; }
.doc h1 { font-size: clamp(26px, 4vw, 34px); }
.doc section { padding-top: 12px; scroll-margin-top: 72px; }
.doc h2 { font-size: 22px; margin: 28px 0 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.doc h3 { font-size: 16px; margin: 20px 0 6px; }
.doc p, .doc li { line-height: 1.75; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li + li { margin-top: 4px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0; display: block; overflow-x: auto; }
.doc-table th, .doc-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-table th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.callout { margin: 14px 0; padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); border-left: 4px solid var(--accent); }
.callout.warn { background: var(--medium-bg); border-left-color: var(--medium); }
.callout p { margin: 0 0 6px; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.sev-legend { list-style: none; padding-left: 0 !important; }
.sev-legend li { display: flex; gap: 10px; align-items: baseline; }
.sev-legend .badge, .sev-legend .kev-badge, .sev-legend > li > .epss:first-child { flex: none; min-width: 78px; text-align: center; margin-left: 0; }
.inline-ico { display: inline-grid; vertical-align: -4px; margin: 0 2px; }
.faq { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 8px 0; background: var(--surface); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; }
@media (max-width: 860px) {
  .doc-layout { grid-template-columns: 1fr; gap: 16px; }
  .doc-toc { position: static; max-height: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; }
}
@media print { .doc-toc, .help-back { display: none !important; } .doc-layout { display: block; } }

/* brand: "ZyGen AI" as a smaller prefix so the full name fits beside the tabs */
.brand-name { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.brand-org { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
@media (max-width: 980px) { .topbar:has(.tabs) .brand-org { display: none; } }

/* scan schedule editor */
.sched { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.sched select, .sched input[type=time] { height: 40px; padding: 0 10px; font: inherit; font-size: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.sched .sched-kind { flex: 1 1 180px; }
.sched label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.sched label[hidden], .sched span[hidden] { display: none !important; }
.sched-tz { flex-basis: 100%; }
.scan-now { margin-top: 10px; font-size: 13px; }
.mon-sched { font-size: 13px; color: var(--text); }
.sched-edit { border-top: 1px dashed var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.sched-edit-actions { display: flex; gap: 8px; align-items: center; }
.field .scan-now input[type=checkbox] { flex: none; width: 16px; height: 16px; padding: 0; margin-top: 4px; border: 0; }

/* uptime / downtime monitoring */
.up-block { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.up-block.up-off { background: none; border-style: dashed; }
.up-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.up-meta { margin-left: auto; }
.up-pill { font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--surface); color: var(--muted); }
.up-pill.up { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.up-pill.down { color: #fff; background: var(--critical); }
.up-stats { display: flex; gap: 18px; flex-wrap: wrap; }
.up-stats span { display: flex; flex-direction: column; line-height: 1.2; }
.up-stats small { font-size: 11px; color: var(--muted); }
.up-stats b { font-size: 16px; font-variant-numeric: tabular-nums; }
.up-chart { width: 100%; height: 36px; display: block; }
.up-chart .ok { fill: color-mix(in srgb, var(--good) 70%, transparent); }
.up-chart .fail { fill: var(--critical); }
.up-chart .nd { fill: var(--border); }
.up-inc { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.up-inc li { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: baseline; }
.up-select { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.up-select select { height: 32px; font: inherit; font-size: 13px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }

/* ===================== company logo ===================== */
.brand-logo { width: 28px; height: 28px; object-fit: contain; flex: none; }
.signin-logo-img { width: 94px; height: auto; margin-bottom: 4px; }
.shared-banner { justify-content: flex-start; }
.shared-banner .shared-text { flex: 1 1 240px; }
.shared-logo { width: 36px; height: 36px; flex: none; }
.print-head { display: none; }
/* navy logo → white on dark backgrounds (transparent PNG, so a filter recolours it cleanly) */
@media (prefers-color-scheme: dark) {
  .brand-logo, .signin-logo-img, .shared-logo, .foot-logo img { filter: brightness(0) invert(1); }
}
@media print {
  .print-head { display: flex !important; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 2px solid #021d44; }
  .print-head img { width: 47px; height: auto; filter: none !important; }
  .print-head div { display: flex; flex-direction: column; line-height: 1.3; }
  .print-head strong { font-size: 18px; color: #021d44; }
  .print-head span { font-size: 12px; color: #555; }
}
.signin-card h1 { text-wrap: balance; }

/* ===================== monitoring dashboard ===================== */
.view-seg { max-width: 520px; grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
.mon-dash { display: flex; flex-direction: column; gap: 14px; }
.dash-controls { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.dash-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.dash-actions select { height: 32px; font: inherit; font-size: 13px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.dash-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.dash-kpis .value small { font-size: 14px; color: var(--muted); font-weight: 600; }
.stat.kpi-bad { border-color: var(--critical); box-shadow: inset 0 3px 0 var(--critical); }
.stat.kpi-warn { border-color: var(--medium); box-shadow: inset 0 3px 0 var(--medium); }
.sev-high-text { color: var(--high); }
.dash-card { padding: 14px 16px; }
.dash-card-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-bottom: 8px; }
.dash-card-head h3 { font-size: 16px; }
.table-scroll { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.dash-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.dash-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: 0; }
.dash-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-align: left; }
.link-btn:hover { color: var(--accent); text-decoration: underline; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex: none; }
.live-dot.up { background: var(--good); }
.live-dot.down { background: var(--critical); box-shadow: 0 0 0 3px color-mix(in srgb, var(--critical) 25%, transparent); }
.day-strip { display: flex; gap: 2px; margin-top: 6px; }
.ds { display: inline-block; width: 7px; height: 16px; border-radius: 2px; background: var(--border); flex: none; }
.ds-up { background: color-mix(in srgb, var(--good) 75%, transparent); }
.ds-minor { background: var(--medium); }
.ds-down { background: var(--critical); }
.ds-nodata, .ds-future { background: var(--surface-2); border: 1px solid var(--border); }
.budget-cell { min-width: 160px; }
.budget { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-bottom: 3px; }
.budget-fill { display: block; height: 100%; background: var(--good); }
.budget-fill.risk { background: var(--medium); }
.budget-fill.breach { background: var(--critical); }
.sla-badge { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.sla-badge.ok { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.sla-badge.risk { color: var(--medium); background: var(--medium-bg); }
.sla-badge.breach { color: #fff; background: var(--critical); }
.dash-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.dash-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dash-legend .ds { height: 10px; }
.mini-badge { display: inline-block; min-width: 24px; text-align: center; font-weight: 700; border-radius: 6px; padding: 1px 6px; }
.mini-badge.g-good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.mini-badge.g-mid { background: var(--medium-bg); color: var(--medium); }
.mini-badge.g-bad { background: var(--critical-bg); color: var(--critical); }
.sev-counts { white-space: nowrap; }
.sev-counts .count { padding: 1px 7px; margin-right: 2px; }
.sev-counts .count b { font-size: 13px; }
.spark.sm { width: 90px; height: 26px; }
.top-issue { max-width: 280px; }
.top-issue .badge { margin-right: 4px; }
.mon-card.highlight { outline: 3px solid var(--accent); outline-offset: 2px; transition: outline-color .3s; }
@media print {
  .view-seg, .dash-controls .filters, .dash-actions { display: none !important; }
}

/* maintenance windows */
:root { --maint: #2563eb; --maint-bg: #e8effd; }
@media (prefers-color-scheme: dark) { :root { --maint: #7aa7ff; --maint-bg: #16243f; } }
.up-pill.maint { color: var(--maint); background: var(--maint-bg); }
.live-dot.maint { background: var(--maint); }
.ds-maint { background: var(--maint); }
.maint-note { color: var(--maint); margin-top: 2px; }
.maint summary { color: var(--maint); }
.mt-list { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.mt-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }
.mt-list li.past { opacity: .6; }
.mt-kind { font-size: 11px; font-weight: 700; color: var(--maint); background: var(--maint-bg); padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
.mt-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding-top: 8px; border-top: 1px dashed var(--border); margin-top: 6px; }
.mt-form select, .mt-form input[type=time], .mt-form input[type=datetime-local], .mt-form input[type=text] { height: 34px; font: inherit; font-size: 13px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
.mt-form input[type=text] { flex: 1 1 220px; }
.mt-form label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.mt-weekly, .mt-once { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.mt-weekly[hidden], .mt-once[hidden] { display: none; }
.mt-days { display: flex; gap: 4px; }
.mt-days label { position: relative; }
.mt-days input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.mt-days span { display: inline-block; min-width: 34px; text-align: center; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; color: var(--muted); }
.mt-days input:checked + span { background: var(--maint); border-color: var(--maint); color: #fff; font-weight: 600; }
.mt-days input:focus-visible + span { outline: 2px solid var(--maint); outline-offset: 1px; }

/* ---- alert channels (multi-select) ---- */
.seg.seg-multi { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 560px) { .seg.seg-multi { grid-template-columns: repeat(3, 1fr); } .seg.seg-multi label:nth-child(4) span { border-left: 0; } .seg.seg-multi label:nth-child(n+4) span { border-top: 1px solid var(--border); } }
.chan-group { border: 1px solid var(--border); border-radius: 8px; padding: 4px 12px 8px; margin: 0 0 10px; }
.chan-group legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.chan-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chan-chip { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); white-space: nowrap; }
.chans summary { color: var(--accent); }
.ch-kind { color: var(--accent); background: var(--surface-2); }
.ch-form { flex-direction: column; align-items: stretch; }
.ch-form .ch-type { align-self: flex-start; }
.ch-form .ch-fields { display: flex; flex-direction: column; gap: 8px; }
.ch-form .ch-fields:empty { display: none; }
.ch-form .field { display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin: 0; }
.ch-form .field input[type=text] { flex: none; width: 100%; }
.ch-form .help { margin: 0; }
.ch-form .ch-add { align-self: flex-start; }

/* ---- in-app notifications (bell) ---- */
.notif { position: relative; flex: none; }
.notif summary { list-style: none; }
.notif summary::-webkit-details-marker { display: none; }
.notif-btn { position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-content: center; color: var(--text); cursor: pointer; border: 1px solid var(--border); background: var(--surface); }
.notif-btn:hover { background: var(--surface-2); }
.notif-badge { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--critical); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.notif-panel { width: min(380px, calc(100vw - 32px)); padding: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.notif-list { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 440px); overflow-y: auto; }
.notif-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.notif-list li[data-mid] { cursor: pointer; }
.notif-list li[data-mid]:hover, .notif-list li[data-mid]:focus-visible { background: var(--surface-2); outline: none; }
.notif-list li.unread { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.notif-list li.unread strong::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; }
.nf-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nf-body { color: var(--muted); white-space: pre-line; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.nf-at { white-space: nowrap; }
.nf-empty { display: block !important; text-align: center; padding: 24px 12px !important; }
.notif-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 12px; }
@media (max-width: 560px) { .notif-panel { position: fixed; left: 16px; right: 16px; top: 60px; width: auto; } }

/* ---- scan page: safety assurance ---- */
.safe-scan { margin-top: 12px; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--good) 35%, var(--border)); background: color-mix(in srgb, var(--good) 6%, var(--surface)); border-radius: 12px; }
.safe-head { display: flex; gap: 10px; align-items: flex-start; color: var(--good); }
.safe-head svg { flex: none; margin-top: 1px; }
.safe-head div { display: flex; flex-direction: column; gap: 2px; }
.safe-head strong { color: var(--text); font-size: 15px; }
.safe-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; font-size: 13px; color: var(--muted); }
.safe-list li { display: flex; gap: 8px; align-items: flex-start; }
.safe-list b { color: var(--text); font-weight: 600; }
@media (max-width: 640px) { .safe-list { grid-template-columns: 1fr; } }

/* footer: user guide link under the authorization note (signed-in only; the guide requires sign-in) */
.signed-out .foot-guide { display: none; }

/* sign-in card: TH/EN switch (the header button is hidden while signed out to avoid two controls) */
.seg.seg-lang { grid-template-columns: repeat(2, minmax(84px, 1fr)); margin-top: 6px; }
.signed-out #langBtn { display: none; }

/* ---- code audit tab ---- */
.ca-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.ca-cmd { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.ca-cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 6px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; }
.drop.busy { opacity: .6; pointer-events: none; }
.ca-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ca-list li { display: grid; grid-template-columns: minmax(120px, auto) auto 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.ca-list li.active { border-color: var(--accent); }
.ca-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.badge.ca-nv { color: var(--maint); background: var(--maint-bg); }
.ca-result { display: flex; flex-direction: column; gap: 12px; }
.ca-result:empty { display: none; }
.ca-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 18px; }
.ca-head h2 { margin: 0; }
.ca-compare { padding: 12px 16px; display: flex; gap: 8px 18px; flex-wrap: wrap; align-items: baseline; }
.ca-compare details { flex-basis: 100%; }
.ca-ai { padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ca-ai p { margin: 2px 0 0; }
.ca-ai select { height: 32px; font: inherit; font-size: 13px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); padding: 0 8px; }
.ca-sec { font-size: 16px; margin: 8px 0 0; display: inline; }
.ca-rejected > summary { cursor: pointer; }
.ca-ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.ca-ul code, .ca-finding .f-cat code { font-size: 12px; overflow-wrap: anywhere; }
.ca-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-radius: 4px; padding: 0 5px; }
.ca-pre { margin: 4px 0 0; padding: 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-family: var(--mono); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
@media (max-width: 640px) { .ca-list li { grid-template-columns: 1fr auto; } .ca-list li .ca-chips { grid-column: 1 / -1; } }
.deps-inputs > * { min-width: 0; }
.ca-steps li { min-width: 0; }

/* ===================== sign-in (split layout, security theme) ===================== */
.signed-out .topbar, .signed-out .footer { display: none !important; }
.signin { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); padding: 0; place-items: stretch; }
.signin-hero { position: relative; overflow: hidden; color: #eaf3ff; background: radial-gradient(120% 90% at 20% 10%, #1d4f8f 0%, #0f2f5c 45%, #081a33 100%); padding: 32px 48px 44px; display: flex; flex-direction: column; justify-content: space-between; isolation: isolate; }
.hero-grid { position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(140, 200, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(140, 200, 255, .07) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 55% 40%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse at 55% 40%, #000 30%, transparent 75%); }
.hero-stage { position: relative; z-index: 0; flex: 1 1 auto; min-height: 300px; margin: 8px 0; }
.hero-radar { position: absolute; z-index: -1; width: min(100%, 520px); max-height: 130%; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: .95; }
.radar-rings { opacity: .22; stroke-width: 1; }
.hero-chips { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; z-index: 0; pointer-events: none; } /* positioned inside .hero-stage, never over the copy */
.hero-chips li { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #c9dcf5; background: rgba(10, 30, 60, .62); border: 1px solid rgba(140, 200, 255, .22); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 4px 18px rgba(0, 0, 0, .25); white-space: nowrap; transition: color 1.8s ease, background-color 1.8s ease, border-color 1.8s ease, box-shadow 1.8s ease; }
.hero-chips li.lit { transition-duration: .12s; color: #fff; background: rgba(28, 92, 72, .78); border-color: #7ee2a8; box-shadow: 0 0 0 1px rgba(126, 226, 168, .35), 0 0 22px rgba(126, 226, 168, .45); }
.hero-chips li.lit:has(i.hot) { background: rgba(110, 36, 40, .78); border-color: #ff8a8a; box-shadow: 0 0 0 1px rgba(255, 138, 138, .35), 0 0 22px rgba(255, 138, 138, .45); }
.hero-chips li.lit i { box-shadow: 0 0 0 4px rgba(126, 226, 168, .35), 0 0 10px #7ee2a8; }
.hero-chips li.lit i.hot { box-shadow: 0 0 0 4px rgba(255, 138, 138, .35), 0 0 10px #ff8a8a; }
.hero-chips:not(.ready) { visibility: hidden; } /* until the ring is laid out */
.hero-chips.compact li.minor { display: none; } /* small hero: eight main tags only (set by signin-radar.js) */
.hero-chips i { width: 7px; height: 7px; border-radius: 50%; background: #7ee2a8; box-shadow: 0 0 0 3px rgba(126, 226, 168, .2); }
.hero-chips i.hot { background: #ff8a8a; box-shadow: 0 0 0 3px rgba(255, 138, 138, .2); }
.hero-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.hero-brand img { filter: brightness(0) invert(1); }
.hero-copy { position: relative; z-index: 1; max-width: 560px; }
.hero-eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: #8cc8ff; letter-spacing: .02em; }
.hero-title { margin: 0 0 14px; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.18; font-weight: 700; color: #fff; text-wrap: balance; }
.hero-lead { margin: 0; font-size: 15px; line-height: 1.65; color: #c4d8f2; }
.hero-standards { margin-top: 22px; }
.hero-standards p { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8cc8ff; }
.hero-standards ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.hero-standards li { padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; color: #dbe9fb; background: rgba(140, 200, 255, .08); border: 1px solid rgba(140, 200, 255, .22); white-space: nowrap; }
.signin-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.signin-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.signin-form h1 { font-size: 28px; margin: 0; }
.signin-form > p { margin: 0; }
.signin-form .btn-ms { width: 100%; justify-content: center; margin-top: 8px; }
.signin-secure { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--muted); }
.signin-secure svg { width: 22px; height: 22px; flex: none; color: var(--good); margin-top: 1px; }
.signin-secure { flex-direction: column; gap: 12px; padding: 14px 16px; border-color: color-mix(in srgb, var(--good) 35%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--good) 7%, var(--surface)), var(--surface)); }
.signin-secure-head { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
.signin-secure > svg { display: none; }
.signin-secure-head::before { content: ''; grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--good) 16%, transparent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 4 5v6c0 5 3.4 9.3 8 11 4.6-1.7 8-6 8-11V5l-8-3Z' fill='none' stroke='%2322a06b' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='m8.5 12 2.4 2.4 4.6-4.8' fill='none' stroke='%2322a06b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 22px no-repeat; }
.signin-secure strong { display: block; color: var(--text); font-size: 14px; }
.signin-secure-head span { font-size: 12px; }
.signin-secure-list { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 9px; }
.signin-secure-list li { position: relative; padding-left: 24px; font-size: 12px; line-height: 1.45; }
.signin-secure-list li::before { content: ''; position: absolute; left: 0; top: 1px; width: 16px; height: 16px; border-radius: 50%; background: var(--good); }
.signin-secure-list li::after { content: ''; position: absolute; left: 5px; top: 4px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.signin-secure-list b { display: block; color: var(--text); font-size: 13px; }
.signin-help { text-align: center; margin: 4px 0 0; }
@media (prefers-reduced-motion: reduce) { .hero-chips li { transition: none; } }
@media (max-width: 900px) {
  .signin { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .signin-hero { min-height: 0; padding: 20px 20px 24px; gap: 28px; }
  .hero-stage { position: absolute; inset: 0; margin: 0; min-height: 0; }
  .hero-radar { width: 420px; max-height: none; top: -60px; left: auto; right: -140px; transform: none; opacity: .6; }
  .hero-chips, .hero-lead, .hero-standards { display: none; }
  .hero-title { font-size: 26px; }
  .signin-panel { place-items: start center; padding: 28px 16px 40px; }
}
@media (max-height: 760px) and (min-width: 901px) { .hero-chips li.minor { display: none; } .hero-title { font-size: clamp(28px, 3vw, 38px); } .hero-stage { min-height: 220px; } }
@media (max-height: 640px) and (min-width: 901px) { .hero-chips { display: none; } .hero-lead { display: none; } .hero-stage { min-height: 120px; } .hero-standards { margin-top: 14px; } }

/* top bar: compact CVE status badge (full text in tooltip/screen reader) so every tab fits */
.feed-pill { flex: none; border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.feed-pill:hover { background: var(--surface-2); color: var(--text); }
.tabs { min-width: 0; }

/* ---- CVE tab: auto-update progress ---- */
.cve-sync { position: relative; overflow: hidden; display: flex; gap: 14px; align-items: center; padding: 14px 16px; margin: 0 0 14px; border-color: color-mix(in srgb, var(--low) 35%, var(--border)); background: color-mix(in srgb, var(--low) 6%, var(--surface)); }
.cve-sync .sync-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cve-sync strong { font-size: 14px; }
.sync-icon { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--low) 25%, transparent); border-top-color: var(--low); animation: sync-spin .8s linear infinite; }
.cve-sync.done { border-color: color-mix(in srgb, var(--good) 40%, var(--border)); background: color-mix(in srgb, var(--good) 7%, var(--surface)); }
.cve-sync.done .sync-icon { animation: none; border: 0; background: var(--good); mask: none; }
.cve-sync.done .sync-icon::after { content: '✓'; display: grid; place-items: center; height: 100%; color: #fff; font-size: 13px; font-weight: 700; }
.cve-sync.error { border-color: color-mix(in srgb, var(--high) 40%, var(--border)); background: color-mix(in srgb, var(--high) 7%, var(--surface)); }
.cve-sync.error .sync-icon { animation: none; border: 0; background: var(--high); }
.cve-sync.error .sync-icon::after { content: '!'; display: grid; place-items: center; height: 100%; color: #fff; font-size: 13px; font-weight: 700; }
.sync-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sync-steps span { font-size: 11px; font-weight: 700; color: var(--low); background: var(--low-bg); padding: 2px 8px; border-radius: 999px; animation: sync-pulse 1.6s ease-in-out infinite; }
.sync-steps span:nth-child(2) { animation-delay: .3s; }
.sync-steps span:nth-child(3) { animation-delay: .6s; }
.sync-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--low) 15%, transparent); }
.sync-bar i { position: absolute; top: 0; bottom: 0; width: 35%; background: var(--low); border-radius: 3px; animation: sync-slide 1.4s ease-in-out infinite; }
.cve-sync:not(.running) .sync-bar { display: none; }
.cve-list.is-syncing { opacity: .55; transition: opacity .2s; }
.cve-item.skel { height: 92px; border-radius: 10px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; border: 1px solid var(--border); }
@keyframes sync-spin { to { transform: rotate(360deg); } }
@keyframes sync-slide { 0% { left: -35%; } 100% { left: 100%; } }
@keyframes sync-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .sync-icon, .sync-steps span, .sync-bar i, .cve-item.skel { animation: none !important; } }

/* ---- CVE enrichment: chips, meta line, detail dialog ---- */
.xchip { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none !important; white-space: nowrap; margin-left: 4px; font-family: var(--mono); }
.xchip.cwe { color: var(--medium); }
.xchip.attack { color: #b4232c; border-color: color-mix(in srgb, #b4232c 30%, var(--border)); }
@media (prefers-color-scheme: dark) { .xchip.attack { color: #ff9b9b; } }
.cve-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 6px; font-size: 12px; }
.vec-head { color: var(--muted); }
.kev-due { color: var(--critical); font-weight: 600; }
.cvd-open { padding: 0; font-size: 12px; }
.cve-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.cve-dialog::backdrop { background: rgba(8, 15, 30, .55); }
.cvd-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--border); }
.cvd-head h2 { margin: 0; font-size: 18px; font-family: var(--mono); }
.cvd-close { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.cvd-body { padding: 16px 18px 22px; display: flex; flex-direction: column; gap: 10px; }
.cvd-body p { margin: 0; }
.cvd-loading { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 24px 0; }
.cvd-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cvd-badges .xchip { margin-left: 0; }
.cvd-title { font-weight: 700; }
.cvd-desc { line-height: 1.6; }
.cvd-links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; font-weight: 600; }
.cvd-sec { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.cvd-sec h3 { font-size: 14px; margin: 0 0 8px; }
.ssvc-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.ssvc { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.ssvc b { font-size: 14px; color: var(--text); }
.ssvc.bad { border-color: color-mix(in srgb, var(--critical) 45%, var(--border)); background: var(--critical-bg); }
.ssvc.bad b { color: var(--critical); }
.ssvc.mid { border-color: color-mix(in srgb, var(--medium) 45%, var(--border)); background: var(--medium-bg); }
.ssvc.ok { background: var(--surface-2); }
.kev-box { border: 1px solid color-mix(in srgb, var(--critical) 35%, var(--border)); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 8px; }
.kev-box dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 0; }
.kev-box dt { color: var(--muted); }
.kev-box dd { margin: 0; }
.kev-box dd.bad { color: var(--critical); font-weight: 700; }
.cvss-block { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.cvss-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cvss-vec { display: block; margin: 6px 0; font-size: 12px; overflow-wrap: anywhere; color: var(--muted); }
.cvss-metrics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 13px; }
.cvss-metrics li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--border); padding: 3px 0; }
.cvss-metrics li span { color: var(--muted); }
.cvss-metrics li.bad b { color: var(--critical); }
.cvss-metrics li.mid b { color: var(--medium); }
.cvss-metrics li.ok b { color: var(--good); }
.cvd-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.cvd-refs { margin: 0; padding-left: 18px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.cvd-src { border-top: 1px solid var(--border); padding-top: 10px; }
@media (max-width: 640px) { .ssvc-row, .cvss-metrics { grid-template-columns: 1fr; } }
.cve-dialog { overflow: auto; overscroll-behavior: contain; }

/* ---- monitor card: tracked CVEs ---- */
.act-cves { padding: 0; font-size: 12px; }
.mon-cves summary { color: var(--accent); }
.mon-cves-body { margin-top: 8px; max-height: 520px; overflow: auto; padding-right: 4px; }
.mon-cves-h { font-size: 13px; margin: 12px 0 4px; }

/* ---- tracked CVEs: pending / fixed ---- */
.seg.cve-tabs { grid-template-columns: repeat(3, 1fr); margin-bottom: 8px; }
.cve-item-wrap { border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px 8px; margin-bottom: 8px; background: var(--surface); }
.cve-item-wrap.fixed { opacity: .85; background: color-mix(in srgb, var(--good) 5%, var(--surface)); }
.cve-item-wrap .cves { margin: 0; }
.cve-item-wrap .cve-row { border: 0; padding: 4px 0; }
.cve-state { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; font-size: 12px; border-top: 1px dashed var(--border); padding-top: 6px; }
.cve-state.fixed span { color: var(--good); font-weight: 600; }
.cve-state .pill { margin-right: auto; }

/* ---- audit log filters ---- */
.audit-filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; padding: 12px 14px; margin-bottom: 10px; }
.audit-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; min-width: 140px; }
.audit-filters label.grow { flex: 1 1 200px; }
.audit-filters input, .audit-filters select { height: 34px; font: inherit; font-size: 13px; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; }
.audit-actions { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.audit-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; }
.audit-pager { display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) { .audit-filters label { min-width: 0; flex: 1 1 45%; } .audit-actions { margin-left: 0; width: 100%; } }

/* ---- per-site scan history ---- */
.hist-dialog { width: min(880px, calc(100vw - 32px)); }
.hist-chart { width: 100%; height: auto; margin: 4px 0 6px; }
.hist-chart polyline { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.hist-chart circle { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.hist-chart text { font-size: 10px; fill: var(--muted); }
.hist-chart .b-good { fill: color-mix(in srgb, var(--good) 8%, transparent); }
.hist-chart .b-mid { fill: color-mix(in srgb, var(--medium) 8%, transparent); }
.hist-chart .b-bad { fill: color-mix(in srgb, var(--critical) 7%, transparent); }
.hist-chgs { min-width: 170px; }
.hist-chg summary { cursor: pointer; font-size: 12px; font-weight: 600; }
.hist-chg.fix summary { color: var(--good); }
.hist-chg.add summary { color: var(--critical); }
.hist-chg ul { margin: 4px 0 0; padding-left: 16px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.hist-open { padding: 0; font-size: 12px; }

/* ---- per-channel alert preferences ---- */
.ch-list li.ch-row { grid-template-columns: auto 1fr auto; }
.ch-prefsum { display: block; font-size: 11px; margin-top: 2px; }
.ch-btns { display: flex; gap: 10px; align-items: center; }
.ch-prefs { grid-column: 1 / -1; border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 4px; display: flex; flex-direction: column; gap: 10px; }
.ap-events { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.ap-events legend { font-size: 12px; font-weight: 700; margin-bottom: 6px; color: var(--muted); }
.ap-events label { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text); }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 14px; }
.ap-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ap-grid select { height: 34px; font: inherit; font-size: 13px; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; }
.ap-actions { display: flex; gap: 10px; align-items: center; }
.ch-prefs .muted.small { margin: 0; }

/* ---- certificate / domain expiry ---- */
.mon-exp { flex-wrap: wrap; gap: 4px 12px; }
.exp { font-size: 12px; font-weight: 600; }
.exp.ok { color: var(--good); }
.exp.warn { color: var(--medium); }
.exp.bad { color: var(--critical); }
.act-expiry { padding: 0; font-size: 12px; }
.exp-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

/* keep long channel URLs from widening the monitor page */
.monitor-layout > * { min-width: 0; }
.monitor-layout { grid-template-columns: 360px minmax(0, 1fr); }
@media (max-width: 860px) { .monitor-layout { grid-template-columns: minmax(0, 1fr); } }
.ch-btns { white-space: nowrap; }
.ch-list li.ch-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.ch-list li.ch-row > .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* CVE links inside in-app notifications */
.nf-cve { font-weight: 600; text-decoration: underline; }

/* add-channel: button first, form after */
.ch-open { align-self: flex-start; margin-top: 6px; }
.ch-form-btns { display: flex; gap: 12px; align-items: center; }

/* create form: channel list + add flow */
#chanList { margin: 4px 0 0; }
#monForm .ch-form { margin-top: 6px; }
#monForm .ch-row > .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- team: roles, members, access requests ---- */
.role-chip { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.role-chip.role-owner { color: var(--accent, #1f6f5c); border-color: currentColor; }
.role-chip.role-editor { color: var(--medium); border-color: currentColor; }
.team-list, .team-sub .mt-list { margin: 6px 0; }
.team-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.team-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.team-who strong { overflow-wrap: anywhere; }
.team-act { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.team-sub { margin-top: 8px; }
.team-subhead { font-size: 12px; font-weight: 700; color: var(--muted); }
.team-reqs { border-left: 3px solid var(--medium); padding-left: 10px; }
.team-form { flex-direction: column; align-items: stretch; }
.team-form .field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.team-form .help { margin: 0; }
.team-open { margin-top: 6px; }
.mon-filter { margin-left: auto; font-size: 13px; }
.section-head.tight { display: flex; align-items: center; gap: 12px; }
.mon-exists { display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--medium); border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.mon-exists .field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.mon-exists .btn-primary { align-self: flex-start; }
.pill.warn { color: var(--medium); border-color: currentColor; }
/* viewers see but cannot change; editors cannot delete the site */
.mon-card.role-viewer :is(.act-run, .act-test, .act-edit-sched, .act-pause, .act-delete, .up-select, .act-expiry, .ch-open, .ch-form, .ch-del, .ch-cfg, .ch-test-exp, .mt-form, .mt-del, .cve-set, .maint .mt-open) { display: none !important; }
.mon-card.role-editor .act-delete { display: none !important; }
.team-form .field { align-items: stretch; text-align: left; }
.team-form .field > span { font-size: 13px; font-weight: 600; }
.team-form input[type=email] { width: 100%; box-sizing: border-box; }
.team-form select, .team-form .ch-form-btns { align-self: flex-start; }
.team-row .team-who { flex: 1 1 220px; }
.mon-ex-owners { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ===================== executive report ===================== */
/* .xr-intro uses the shared .page-head spacing and heading size */
.xr-controls { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-bottom: 16px; }
.xr-controls .field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.xr-controls .field > span { font-size: 12px; font-weight: 700; color: var(--muted); }
.xr-range { display: flex; gap: 6px; align-items: center; }
.xr-sites-pick { flex-basis: 100%; }
.xr-sites-pick summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.xr-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 12px; margin: 8px 0 4px; }
.xr-site { display: flex; gap: 8px; align-items: center; font-size: 13px; min-width: 0; }
.xr-site span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xr-btns { display: flex; gap: 8px; flex-wrap: wrap; flex-basis: 100%; }
.xr-report { display: flex; flex-direction: column; gap: 18px; }
.xr-kicker { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.xr-head h2 { margin: 2px 0 4px; font-size: 26px; }
.xr-note { margin: 6px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--medium-bg); color: var(--medium); font-size: 13px; }
.xr-sec h3 { margin: 0 0 8px; font-size: 16px; }
.xr-sum { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.xr-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.xr-kpi { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; break-inside: avoid; }
.xr-kl { font-size: 12px; color: var(--muted); font-weight: 600; }
.xr-kv { font-size: 24px; font-weight: 800; }
.xr-kv small { font-size: 13px; font-weight: 600; color: var(--muted); }
.xr-kn { font-size: 11px; color: var(--muted); }
.xr-d { font-size: 12px; font-weight: 700; }
.xr-d.good { color: var(--good); }
.xr-d.bad { color: var(--critical); }
.xr-d.flat { color: var(--muted); font-weight: 500; }
.sev-c { color: var(--critical); font-weight: 700; }
.sev-h { color: var(--high); font-weight: 700; }
.xr-sub { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.xr-gbar { width: 100%; height: 22px; border-radius: 6px; overflow: hidden; display: block; }
.xr-g.g-A { fill: #15803d; } .xr-g.g-B { fill: #65a30d; } .xr-g.g-C { fill: #ca8a04; } .xr-g.g-D { fill: #ea580c; } .xr-g.g-F { fill: #b4232c; }
.xr-gt { fill: #fff; font-size: 5px; font-weight: 700; }
.xr-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.xr-chart { margin: 0; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; break-inside: avoid; }
.xr-chart figcaption { font-size: 12px; font-weight: 700; color: var(--muted); }
.xr-chart svg { width: 100%; height: auto; display: block; }
.xr-grid { stroke: var(--border); stroke-width: 1; }
.xr-ax { fill: var(--muted); font-size: 10px; }
.xr-line { fill: none; stroke-width: 2.5; }
.xr-line.score, .xr-dot.score { stroke: var(--accent); }
.xr-line.uptime, .xr-dot.uptime { stroke: #2563eb; }
.xr-dot { fill: var(--surface); stroke-width: 2; }
.xr-bar.cve { fill: var(--high); opacity: .85; }
.xr-risks { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.xr-tablewrap { overflow-x: auto; }
.xr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.xr-table th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 700; border-bottom: 2px solid var(--border); padding: 6px 8px; white-space: nowrap; }
.xr-table td { border-bottom: 1px solid var(--border); padding: 8px; vertical-align: top; }
.xr-table td.num { white-space: nowrap; }
.xr-table tr { break-inside: avoid; }
.xr-grade { display: inline-block; min-width: 26px; text-align: center; font-weight: 800; border-radius: 6px; padding: 1px 6px; color: #fff; background: var(--muted); }
.xr-grade.g-A { background: #15803d; } .xr-grade.g-B { background: #65a30d; } .xr-grade.g-C { background: #ca8a04; } .xr-grade.g-D { background: #ea580c; } .xr-grade.g-F { background: #b4232c; }
.xr-list { margin: 0; padding-left: 20px; }
.xr-method { font-size: 12px; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 10px; }
.xr-method ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.xr-standalone { background: #fff; color: #15181d; }
@media print {
  .xr-intro, .xr-controls, .tabs, .topbar, .footer { display: none !important; }
  body.xr-printing main > :not(#tab-report) { display: none !important; }
  .xr-report { border: 0; box-shadow: none; padding: 0; }
  .xr-report .print-head { display: flex !important; }
  .xr-kpi, .xr-chart { background: #fff; }
  .xr-sec { break-inside: avoid-page; }
  @page { size: A4; margin: 14mm; }
}
.xr-glegend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; }
.xr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .xr-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media print { .xr-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* executive report: standards mapping */
.xr-std { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; flex-basis: 100%; }
.xr-std legend { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.xr-std label { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.xr-fw { margin-top: 14px; break-inside: auto; }
.xr-fw h4 { margin: 0 0 2px; font-size: 15px; }
.xr-ctable td:first-child { width: 56px; }
.xr-st { font-size: 12px; font-weight: 700; white-space: nowrap; }
.xr-st.st-issue { color: var(--critical); }
.xr-st.st-minor { color: var(--medium); }
.xr-st.st-ok { color: var(--good); }
.xr-st.st-out { color: var(--muted); font-weight: 500; }
.xr-ctable tr.st-out td { color: var(--muted); }
.xr-ev { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.xr-procs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.xr-proc { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
@media print { .xr-std { display: none !important; } .xr-proc { border: 1px solid currentColor; background: #fff; } }

/* executive report: schedules + shared link view */
.xr-sched { margin-bottom: 16px; display: block; }
.xr-sched > summary { cursor: pointer; }
.xr-sched[open] { display: flex; flex-direction: column; gap: 10px; }
.xs-form { display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed var(--border); padding-top: 10px; }
.xs-form .field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.xs-form .field > span { font-size: 12px; font-weight: 700; color: var(--muted); }
.xs-row { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.xs-list { display: flex; flex-direction: column; gap: 8px; }
.xs-item { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.xs-item.off { opacity: .7; }
.xs-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 320px; }
.xs-act { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.xs-links summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.xr-shared-note { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
body.xr-shared .tabs, body.xr-shared #feedPill { display: none !important; }
@media print { .xr-sched, .xr-shared-note { display: none !important; } }

/* ---- top navigation: keep every tab visible ---- */
/* mid widths: tighter tabs; narrow widths: tabs move to their own full-width row under the logo */
@media (max-width: 1180px) {
  .tabs { gap: 2px; }
  .tab { padding: 7px 8px; font-size: 14px; }
  .topbar-inner { gap: 10px; }
}
/* the top bar may use more width than page content */
.topbar .wrap { max-width: 1320px; }
/* set by app.js when the tabs do not fit on one line (depends on language, screen width and the Admin tab) */
.topbar.nav-2row .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 6px; row-gap: 4px; }
.topbar.nav-2row .tabs { order: 10; flex: 1 1 100%; }
.topbar.nav-2row .brand { margin-right: auto; }
.topbar.nav-2row .tab { padding: 6px 10px; }

/* admin: trash */
.trash-card { margin-bottom: 16px; display: block; }
.trash-card > summary { cursor: pointer; }
.trash-card[open] { display: flex; flex-direction: column; gap: 10px; }
.trash-list { display: flex; flex-direction: column; gap: 8px; }
.trash-item { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.trash-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 320px; overflow-wrap: anywhere; }
.trash-act { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.trash-main > .xr-grade { align-self: flex-start; }

/* ===================== threat check ===================== */
.tc-card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.tc-form { display: flex; gap: 8px; flex-wrap: wrap; }
.tc-form input { flex: 1 1 280px; min-width: 0; font-family: var(--mono); font-size: 14px; }
.tc-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px; border: 2px dashed var(--border); border-radius: 12px; cursor: pointer; text-align: center; }
.tc-drop:hover, .tc-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.tc-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.tc-fresh { display: flex; gap: 6px; align-items: center; }
.tc-sources-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.tc-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); }
.tc-chip.on { color: var(--good); border-color: currentColor; }
.tc-chip.off { color: var(--muted); }
.tc-result { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.tc-verdict { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.tc-verdict.bad { background: var(--critical-bg); color: var(--critical); }
.tc-verdict.warn { background: var(--medium-bg); color: var(--medium); }
.tc-verdict.ok { background: var(--accent-soft); color: var(--good); }
.tc-vicon { font-size: 28px; line-height: 1; }
.tc-vtitle { font-weight: 800; font-size: 17px; }
.tc-ind { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tc-ind code { overflow-wrap: anywhere; font-size: 13px; }
.tc-file { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.tc-flags { margin: 4px 0 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.tc-flags .bad { color: var(--critical); font-weight: 600; }
.tc-flags .warn { color: var(--medium); }
.ok-text { color: var(--good); margin: 4px 0 0; }
.tc-sources { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tc-src { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--border); }
.tc-src:last-child { border-bottom: 0; }
.tc-st { font-size: 12px; font-weight: 700; white-space: nowrap; }
.tc-src.st-malicious .tc-st { color: var(--critical); }
.tc-src.st-suspicious .tc-st { color: var(--medium); }
.tc-src.st-clean .tc-st { color: var(--good); }
.tc-src.st-skipped, .tc-src.st-error { opacity: .75; }
.tc-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.tc-hist-card > summary { cursor: pointer; }
.tc-hist li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tc-hist .link-btn { text-align: left; overflow-wrap: anywhere; }
@media (max-width: 600px) { .tc-src { grid-template-columns: 1fr; gap: 2px; } }
.mon-bl, .mon-la { flex-wrap: wrap; gap: 4px 12px; }
.act-blacklist { padding: 0; font-size: 12px; }
.mon-card.role-viewer .act-blacklist { display: none !important; }

/* admin: API keys */
.sec-list { display: flex; flex-direction: column; gap: 8px; }
.sec-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.sec-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 360px; overflow-wrap: anywhere; }
.sec-meta { color: var(--muted); }
.sec-st { font-weight: 700; }
.sec-st.on { color: var(--good); }
.sec-st.env { color: var(--accent); }
.sec-st.off { color: var(--muted); }
.sec-st.bad { color: var(--critical); }
.sec-act { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.sec-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.sec-form .sec-input { flex: 1 1 280px; min-width: 0; font-family: var(--mono); }
.sec-help { flex-basis: 100%; margin: 0; }
.sec-flag { display: flex; gap: 10px; align-items: flex-start; margin-top: 8px; }
.sec-flag > span { display: flex; flex-direction: column; gap: 2px; }
/* rows inside .mt-list: beat the generic ".mt-list li" grid */
.mt-list.sec-list > li.sec-row, .mt-list.trash-list > li.trash-item { display: flex; justify-content: space-between; align-items: flex-start; }

/* ===================== admin: sub-navigation + overview ===================== */
.adm-nav { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 4px 0 16px; }
.adm-nav button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; margin-bottom: -1px; }
.adm-nav button:hover { color: var(--text); }
.adm-nav button.active { color: var(--accent); border-bottom-color: var(--accent); }
.adm-nav button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.adm-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); }
.adm-badge.bad { background: var(--critical); color: #fff; }
.adm-panel { display: flex; flex-direction: column; gap: 16px; }
.adm-panel[hidden] { display: none !important; }
.adm-panel > .card.trash-card { display: flex; flex-direction: column; gap: 10px; margin-bottom: 0; }
.adm-h2 { margin: 0; font-size: 17px; display: flex; gap: 8px; align-items: baseline; }
.adm-panel-lead { margin: 0; }
.adm-kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important; }
.adm-kpi.bad { border-color: var(--critical); background: var(--critical-bg); }
.adm-kpi.warn { border-color: var(--medium); background: var(--medium-bg); }
.adm-kpi .xr-kn { font-size: 12px; }
.adm-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .adm-cols { grid-template-columns: minmax(0, 1fr); } }
.adm-box h2 { margin: 0 0 8px; font-size: 16px; }
.adm-todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.adm-todo li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; border-left: 4px solid var(--border); background: var(--surface-2); }
.adm-todo li.lvl-bad { border-left-color: var(--critical); background: var(--critical-bg); }
.adm-todo li.lvl-warn { border-left-color: var(--medium); background: var(--medium-bg); }
.adm-todo li.lvl-info { border-left-color: var(--low); }
.adm-tt { display: flex; flex-direction: column; gap: 2px; font-size: 14px; overflow-wrap: anywhere; }
.adm-ok { margin: 0; padding: 12px; border-radius: 10px; background: var(--accent-soft); color: var(--good); font-weight: 600; }
.adm-recent { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; }
.adm-recent li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 2px 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.adm-recent li:last-child { border-bottom: 0; }
.adm-target { grid-column: 2; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .adm-recent li { grid-template-columns: minmax(0, 1fr); }
  .adm-target { grid-column: 1; }
  .adm-todo li { grid-template-columns: auto minmax(0, 1fr); }
  .adm-todo li button { grid-column: 2; justify-self: start; }
  .adm-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .adm-nav button { white-space: nowrap; }
}
@media (max-width: 600px) { .adm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } .adm-kpi .xr-kv { font-size: 20px; } }

/* admin: users / sessions / all sites / health */
.ops-card { display: flex; flex-direction: column; gap: 10px; }
details.ops-card > summary { cursor: pointer; }
.ops-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ops-q { margin-left: auto; min-width: 200px; }
.mt-list.ops-list { display: flex; flex-direction: column; gap: 8px; }
.mt-list.ops-list > li.ops-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; padding: 10px 12px; }
.ops-row.off { opacity: .7; }
.ops-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 360px; overflow-wrap: anywhere; }
.ops-act { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.ops-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 10px; border: 1px dashed var(--border); border-radius: 8px; }
.ops-form .field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.ops-form .ch-form-btns { align-self: flex-start; }
.danger-bg { background: var(--critical) !important; border-color: var(--critical) !important; }
.danger-text { color: var(--critical); align-self: flex-start; }
.ops-kv { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ops-kv li { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ops-kv li:last-child { border-bottom: 0; }
.ops-kv li > :nth-child(3) { grid-column: 2; }
.ops-kv li.lvl-bad { background: var(--critical-bg); border-radius: 8px; padding: 8px; }
.ops-kv li.lvl-warn { background: var(--medium-bg); border-radius: 8px; padding: 8px; }
@media (max-width: 600px) { .ops-kv li { grid-template-columns: minmax(0, 1fr); } .ops-kv li > :nth-child(3) { grid-column: 1; } .ops-q { margin-left: 0; width: 100%; } }
.adm-box { padding: 14px 16px; }

/* ===================== announcements banner ===================== */
.ann-bar { position: relative; z-index: 5; }
.ann { border-bottom: 1px solid var(--border); }
.ann-in { display: flex; gap: 10px; align-items: center; padding-top: 8px; padding-bottom: 8px; font-size: 14px; }
.ann-msg { flex: 1; overflow-wrap: anywhere; font-weight: 600; }
.ann-until { color: inherit; opacity: .8; white-space: nowrap; }
.ann-info { background: var(--low-bg); color: var(--low); }
.ann-warn { background: var(--medium-bg); color: var(--medium); }
.ann-critical { background: var(--critical); color: #fff; }
.ann-x { background: none; border: 0; color: inherit; font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.ann-x:hover { background: rgba(0,0,0,.08); }
.ann-pill.ann-info { color: var(--low); border-color: currentColor; background: var(--low-bg); }
.ann-pill.ann-warn { color: var(--medium); border-color: currentColor; background: var(--medium-bg); }
.ann-pill.ann-critical { color: #fff; background: var(--critical); border-color: var(--critical); }
@media print { .ann-bar { display: none !important; } }
/* admin: usage / review / notify / requests */
.us-vals { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.us-vals li { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }
.us-vals strong { font-size: 24px; color: var(--accent); }
.us-vals span { font-size: 12px; color: var(--muted); }
.us-bar.scan { fill: var(--accent); }
.us-bar.threat { fill: var(--high); }
.us-leg { font-weight: 600; font-size: 11px; margin-left: 8px; }
.us-leg.scan { color: var(--accent); }
.us-leg.threat { color: var(--high); }
.us-sites { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.us-sites li span:first-child { overflow-wrap: anywhere; margin-right: 8px; }
.rv-flag td { background: var(--medium-bg); }
.rv-sign { display: flex; flex-direction: column; gap: 8px; border-top: 1px dashed var(--border); padding-top: 10px; }
.rv-sign .field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.rv-sign textarea, .an-form textarea { width: 100%; box-sizing: border-box; font: inherit; }
.rv-sign .btn-primary { align-self: flex-start; }
.an-form { display: flex; flex-direction: column; gap: 10px; }
.an-form .field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.an-form .field > span, .rv-sign .field > span { font-size: 12px; font-weight: 700; color: var(--muted); }
.an-form .btn-primary { align-self: flex-start; }
li.ops-row.rq-old { border-left: 4px solid var(--critical); }
#scCats { margin-top: 4px; }
.sec-add { flex-direction: column; align-items: stretch; border: 1px dashed var(--border); border-radius: 10px; padding: 12px; margin-top: 8px; }
.sec-add .field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.sec-add .field > span { font-size: 12px; font-weight: 700; color: var(--muted); }
.sec-add .ch-form-btns { align-self: flex-start; }
.sec-addbtn { margin-top: 8px; }
.sec-add .sec-input { flex: none; width: 100%; box-sizing: border-box; }

/* 9 main tabs: keep them on one line on common laptop widths (1100–1440px) */
@media (max-width: 1440px) {
  .tabs { gap: 2px; }
  .tab { padding: 7px 9px; font-size: 14px; }
  .topbar-inner { gap: 12px; }
}
/* when the tabs have their own row, wrap them instead of hiding some behind a sideways scroll (phones keep the scroll) */
@media (min-width: 601px) {
  .topbar.nav-2row .tabs { flex-wrap: wrap; overflow: visible; row-gap: 2px; }
}
@media (min-width: 601px) and (max-width: 900px) { .topbar.nav-2row .tab { padding: 6px 6px; } }

/* CVE page is opened from the CVE badge (no tab) — keep the badge visible at every width */
body:not(.signed-out):not(.xr-shared) .topbar .feed-pill { display: flex; }
.feed-pill.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* organisation IOC list + look-alike domains */
.ioc-form { display: grid; gap: 8px; margin: 10px 0; }
.ioc-form textarea { width: 100%; font-family: var(--mono, ui-monospace, monospace); font-size: 13px; resize: vertical; }
.ioc-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ioc-row input { flex: 1 1 200px; min-width: 0; }
.ioc-filter { width: 100%; margin: 6px 0 8px; }
.mt-list.ioc-list li { display: flex; gap: 10px; align-items: center; }
.ioc-list .ioc-val { display: flex; flex-direction: column; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pill.bad { background: var(--critical-bg); color: var(--critical); }
.tc-ioc-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; padding-top: 10px; border-top: 1px solid var(--border); }
.tc-verdict.ok .tc-vicon { filter: none; }
details.mon-la summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
details.mon-la summary::-webkit-details-marker { display: none; }
details.mon-la { display: block; }
.la-list { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 4px; }
.la-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; overflow-wrap: anywhere; }

/* Threat Check: WHOIS + DNS panels */
.lk-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin: 14px 0; }
.lk-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.lk-box summary { cursor: pointer; margin-bottom: 6px; }
.lk-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.lk-kv dt { color: var(--muted); }
.lk-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.lk-kv code { font-size: 12.5px; }
@media (max-width: 600px) { .lk-kv { grid-template-columns: 1fr; } .lk-kv dd { margin-bottom: 6px; } }
.bad-text { color: var(--critical); }
.ioc-syntax { margin: 4px 0 0; color: var(--muted); }

/* Admin → sources: on/off switches */
.src-row { align-items: center; }
.src-row.is-off .sec-main > strong { color: var(--muted); }
.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-ui { width: 40px; height: 22px; border-radius: 11px; background: var(--border); position: relative; transition: background .15s; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--good); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .switch-ui { opacity: .5; }
#srcCard { margin-bottom: 16px; }
.mt-list.sec-list > li.src-row { align-items: center; flex-wrap: nowrap; }
.mt-list.sec-list > li.src-row .sec-main { flex: 1; min-width: 0; }
