/* ScienceSoft AI Endpoint Firewall brand: Brand Blue #005EB8, Title Navy #2F5597, Body #404040,
   Orange #FF9A08 (highlight and the primary action only), Panel #E8F4FF. Dark scheme: headings
   #8FBBEA, links #479BEB. Every colour below is a token; the dark scheme redefines the tokens. */

/* Open Sans (300/400/600/700) and Roboto Mono (400/700), latin and cyrillic, served from assets/fonts
   (SIL OFL 1.1, licences beside the files). */
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 300; font-display: swap;
  src: url("assets/fonts/open-sans-latin-300-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/open-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("assets/fonts/open-sans-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("assets/fonts/open-sans-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 300; font-display: swap;
  src: url("assets/fonts/open-sans-cyrillic-300-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/open-sans-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("assets/fonts/open-sans-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("assets/fonts/open-sans-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Roboto Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/roboto-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Roboto Mono"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("assets/fonts/roboto-mono-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Roboto Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("assets/fonts/roboto-mono-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Roboto Mono"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("assets/fonts/roboto-mono-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  /* brand */
  --brand-blue: #005EB8;
  --brand-navy: #2F5597;
  --brand-orange: #FF9A08;
  --brand-orange-hover: #ffab33;
  --on-orange: #2a1a00;
  --bar-bg: #005EB8;
  --bar-text: #ffffff;
  --hero-bg: radial-gradient(1200px 500px at 85% -10%, #3b8fe0 0%, transparent 60%),
             linear-gradient(135deg, #003f80 0%, #005EB8 55%, #2a7fd4 100%);
  --hero-text: #ffffff;
  --hero-lead: #e6f0fb;
  --hero-note: #bcd6f2;
  --hero-eyebrow: #ffd08a;
  --hero-panel: rgba(255, 255, 255, 0.09);
  --hero-code: rgba(255, 255, 255, 0.16);

  /* page */
  --bg: #f4f8fd;
  --surface: #ffffff;
  --field: #fbfdff;
  --text: #404040;
  --heading: #2F5597;
  --muted: #55657d;
  --border: #e3e8ef;
  --border-strong: #c9d8ec;
  --link: #005EB8;
  --accent: #005EB8;
  --accent-text: #ffffff;
  --focus: #005EB8;
  --panel: #E8F4FF;
  --panel-border: #bcd5f2;
  --note-bg: rgba(0, 94, 184, 0.04);
  --th-bg: #f4f8fd;
  --track: #eef2f7;
  --shadow: 0 2px 10px rgba(30, 50, 90, 0.05);
  --overlay: rgba(0, 94, 184, 0.16);

  --error-bg: #fdecec;
  --error-text: #8a1c1c;
  --heat: #005EB8;
  --heat-text: #1d2a3d;
  --hit: #FF9A08;
  --model-bg: #E8F4FF;
  --model-text: #0b4a8f;
  --rules-bg: #eef2f7;
  --rules-text: #38465c;

  /* entity highlights: five distinct hues; the tag beside each value also names the type */
  --ent-person: #ffd6e7;
  --ent-org: #cfe3ff;
  --ent-location: #d4f2c4;
  --ent-address: #ffe1b0;
  --ent-date: #e8dcff;
  --ent-text: #1d2a3d;

  --radius: 14px;
  --radius-sm: 8px;
  --sans: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-blue: #479BEB;
    --brand-navy: #8FBBEA;
    --bar-bg: #005EB8;
    --hero-bg: radial-gradient(1200px 500px at 85% -10%, #1f5f9f 0%, transparent 60%),
               linear-gradient(135deg, #062a52 0%, #0a4a8c 55%, #1d65ad 100%);
    --hero-lead: #dbe8f7;

    --bg: #141c28;
    --surface: #1a2433;
    --field: #131b27;
    --text: #d6e0ee;
    --heading: #8FBBEA;
    --muted: #a9b8cd;
    --border: #2b3a50;
    --border-strong: #3a4d68;
    --link: #479BEB;
    --accent: #8FBBEA;
    --accent-text: #0b1a2e;
    --focus: #8FBBEA;
    --panel: #1d3552;
    --panel-border: #2e5480;
    --note-bg: rgba(71, 155, 235, 0.07);
    --th-bg: #1d2b3f;
    --track: #243246;
    --shadow: none;
    --overlay: rgba(71, 155, 235, 0.18);

    --error-bg: #3a1717;
    --error-text: #ffb4b4;
    --heat: #479BEB;
    --heat-text: #f3f6fa;
    --hit: #FF9A08;
    --model-bg: #1d3552;
    --model-text: #cfe4fb;
    --rules-bg: #243246;
    --rules-text: #c5d0de;

    --ent-person: #6a2a48;
    --ent-org: #1f4a80;
    --ent-location: #2f5320;
    --ent-address: #6b4510;
    --ent-date: #4d2c66;
    --ent-text: #f3f6fa;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 300 15px/1.6 var(--sans);
}
strong, b { font-weight: 600; }

/* ------------------------------------------------------------------ header bar and hero */

.site-bar { background: var(--bar-bg); color: var(--bar-text); box-shadow: 0 1px 4px rgba(0, 20, 60, 0.18); }
.site-bar__in {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 8px 22px;
}
.site-bar__logo { display: block; height: 26px; width: auto; flex: none; }
.site-bar__product { display: flex; align-items: center; gap: 10px; min-width: 0; }
.site-bar__mark { display: block; height: 28px; width: auto; flex: none; }
.site-bar__name { font-weight: 600; font-size: 1.12rem; line-height: 1.25; letter-spacing: 0.005em; }

main { margin: 0; padding: 0 0 48px; }
.page { max-width: 980px; margin: 0 auto; padding: 24px 16px 0; }

.hero {
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-text);
}
.hero__in { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; padding: 30px 16px 30px; }
.hero::after {
  content: "";
  position: absolute;
  right: max(16px, calc(50% - 490px + 16px));
  top: 50%;
  width: 170px;
  height: 187px;
  transform: translateY(-50%);
  background: url("assets/ai-firewall-mark.svg") center / contain no-repeat;
  opacity: 0.22;
  pointer-events: none;
}
.hero__in > * { max-width: 46rem; }
.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--hero-eyebrow);
}
.hero h1 { color: var(--hero-text); font-size: 2.15rem; line-height: 1.12; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 12px; }
.hero .lede { font-size: 1.04rem; line-height: 1.65; color: var(--hero-lead); margin: 0 0 14px; }
.hero strong { color: #ffffff; }
.hero .privacy {
  margin: 0 0 12px;
  padding: 10px 14px;
  background: var(--hero-panel);
  border: 0;
  border-left: 3px solid var(--brand-orange);
  border-radius: 6px;
  color: var(--hero-lead);
  font-size: 0.92rem;
}
.hero code { background: var(--hero-code); color: #ffffff; border-radius: 4px; padding: 0 4px; }
.hero .hero__note { color: var(--hero-note); margin: 0; font-size: 0.82rem; }
.hero .hero__note strong { color: #ffffff; }

/* ------------------------------------------------------------------ type */

h1, h2, h3 { color: var(--heading); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; margin: 0 0 8px; line-height: 1.2; }
h2 { font-size: 1.3rem; margin: 0 0 10px; line-height: 1.3; }
h3 { font-size: 1.04rem; margin: 24px 0 4px; }
#doc-h { margin-top: 32px; }

/* A card's title carries the short orange accent the site puts under a page title. */
.card > h2:first-child { position: relative; padding-bottom: 0.45em; margin-bottom: 14px; }
.card > h2:first-child::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  background: var(--brand-orange);
  border-radius: 2px;
}

a { color: var(--link); text-underline-offset: 2px; }
code { font-family: var(--mono); font-size: 0.86em; font-weight: 400; }

.lede { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; font-weight: 400; }

.privacy {
  margin: 0 0 16px;
  padding: 10px 14px;
  background: var(--panel);
  border-left: 3px solid var(--brand-orange);
  border-radius: 6px;
}

/* ------------------------------------------------------------------ cards and controls */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin: 0 0 18px;
}

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* Secondary: outlined. Primary (.primary): orange, dark text. Link (.link): text only. */
button {
  font: 600 0.92rem/1.2 var(--sans);
  border-radius: 999px;
  border: 1px solid var(--brand-blue);
  background: transparent;
  color: var(--brand-blue);
  padding: 9px 18px;
  cursor: pointer;
  min-height: 40px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
button:hover:not(:disabled) { background: var(--panel); }
button.primary { background: var(--brand-orange); color: var(--on-orange); border-color: var(--brand-orange); }
button.primary:hover:not(:disabled) { background: var(--brand-orange-hover); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 20, 60, 0.18); }
button.link {
  border: none;
  background: none;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 8px 4px;
  font-weight: 400;
  border-radius: 4px;
}
button.link:hover:not(:disabled) { background: none; text-decoration-thickness: 2px; }
button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 12px; }
.examples button {
  padding: 4px 13px;
  min-height: 32px;
  font-size: 0.84rem;
  border-color: var(--border-strong);
  color: var(--heading);
  background: var(--surface);
}
.examples button:hover:not(:disabled) { border-color: var(--brand-blue); background: var(--panel); }

textarea {
  width: 100%;
  font: 400 0.9rem/1.5 var(--mono);
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  resize: vertical;
}
textarea:focus { border-color: var(--brand-blue); }
textarea::placeholder { color: var(--muted); }

.dropzone {
  border: 2px dashed var(--panel-border);
  border-radius: 10px;
  background: var(--note-bg);
  padding: 12px 16px;
  margin: 0 0 12px;
}
.dropzone p { margin: 0; }
.dropzone p + p { margin-top: 6px; }
.dropzone button.link { padding: 0 2px; min-height: 0; font-weight: 600; }
/* "choose one" opens the file picker: a primary action, so it is the orange pill even inside the sentence. */
.dropzone #attach.link {
  display: inline-block;
  padding: 3px 13px;
  margin: 0 0 0 2px;
  border-radius: 999px;
  background: var(--brand-orange);
  color: var(--on-orange);
  text-decoration: none;
  font-weight: 600;
  vertical-align: baseline;
}
.dropzone #attach.link:hover:not(:disabled) { background: var(--brand-orange-hover); }
body.dragging-file .dropzone { border-color: var(--brand-blue); background: var(--panel); }
#attach-error { margin: 0 0 8px; }
.notes {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-left: 3px solid var(--brand-orange);
  border-radius: 6px;
  background: var(--note-bg);
  color: var(--muted);
}
.notes p { margin: 0; }
.notes ul { margin: 4px 0 0; padding-left: 1.2em; }
.notes code { overflow-wrap: anywhere; }
.direct-link { font-weight: 600; }
#window-note { margin: 8px 0 0; }

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--overlay);
  border: 4px dashed var(--brand-blue);
  pointer-events: none;
}
.drop-overlay[hidden] { display: none; }
.drop-overlay p {
  margin: 0;
  padding: 16px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--heading);
  border-bottom: 3px solid var(--brand-orange);
  box-shadow: 0 12px 28px rgba(0, 20, 60, 0.2);
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
}
#run-status { overflow-wrap: anywhere; }

.threshold { margin: 12px 0 14px; }
.threshold label { font-weight: 600; color: var(--heading); }
.threshold output {
  font: 700 0.86rem/1.4 var(--mono);
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--panel);
  color: var(--heading);
}
.threshold input[type="range"] { width: 100%; max-width: 420px; display: block; margin: 8px 0 4px; accent-color: var(--brand-blue); }
.threshold p { margin: 0; }

progress { width: 100%; height: 12px; accent-color: var(--brand-blue); }
#progress-box { margin-top: 14px; }
#progress-box p { margin: 4px 0; }

.stages { margin: 6px 0 0; padding-left: 1.4em; font-size: 0.9rem; }
.stages li { color: var(--muted); }
.stages li.active { color: var(--text); font-weight: 600; }
.stages li.done { color: var(--text); }
.stages li.done::after { content: " — done"; color: var(--muted); font-weight: 400; }
.stages li.failed { color: var(--error-text); font-weight: 600; }

.error {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--error-bg);
  color: var(--error-text);
  border-radius: var(--radius-sm);
  padding: 10px;
  font: 400 0.84rem/1.45 var(--mono);
  margin: 12px 0 0;
}

/* ------------------------------------------------------------------ highlighted text */

.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; margin: 8px 0 10px; font-size: 0.86rem; font-weight: 400; }
.legend li { display: flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border-strong); display: inline-block; flex: none; }

.highlighted {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 400 0.9rem/1.95 var(--mono);
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  max-height: 480px;
  overflow-y: auto;
}

mark.ent { color: var(--ent-text); border-radius: 4px; padding: 1px 2px; }
.ent-person { background: var(--ent-person); }
.ent-organization { background: var(--ent-org); }
.ent-location { background: var(--ent-location); }
.ent-address { background: var(--ent-address); }
.ent-date_time { background: var(--ent-date); }
mark.ent .tag {
  font: 700 0.62rem/1 var(--sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: 4px;
  vertical-align: 1px;
  opacity: 0.85;
}

/* ------------------------------------------------------------------ tables */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
}
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; font-weight: 400; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child > * { border-bottom: 0; }
th { font-weight: 600; color: var(--heading); }
thead th {
  background: var(--th-bg);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
td.num, th.num { text-align: right; font-family: var(--mono); white-space: nowrap; }
thead th.num { font-family: var(--sans); }
td code { white-space: nowrap; }
tr.info-only td { color: var(--muted); }
tr.decided-model td { font-weight: 600; }

.entities { margin-top: 12px; }
.entities td.conf { font-family: var(--mono); text-align: right; white-space: nowrap; }
.dropped { margin: 12px 0 0; padding-left: 1.2em; font-size: 0.88rem; font-weight: 400; color: var(--muted); }
.dropped s { color: var(--muted); }

.type-chip {
  display: inline-block;
  border-radius: 4px;
  padding: 0 6px;
  font: 600 0.75rem/1.6 var(--sans);
  color: var(--ent-text);
  white-space: nowrap;
}

.owner { display: inline-block; border-radius: 999px; padding: 0 9px; font: 600 0.78rem/1.7 var(--sans); }
.owner-model { background: var(--model-bg); color: var(--model-text); }
.owner-rules { background: var(--rules-bg); color: var(--rules-text); }

.owners { margin: 8px 0 12px; font-size: 0.9rem; }
.owners div { display: flex; gap: 10px; align-items: baseline; margin: 4px 0; }
.owners dt { flex: 0 0 64px; }
.owners dd { margin: 0; }

.summary { font-size: 1.05rem; margin: 4px 0; }

table.heat { width: auto; min-width: 100%; }
table.heat th, table.heat td { white-space: nowrap; }
table.heat td.num { text-align: center; color: var(--heat-text); }
table.heat td.num.muted { color: var(--muted); }
table.heat td.hit { outline: 2px solid var(--hit); outline-offset: -2px; font-weight: 700; }
table.heat th[scope="row"] { position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.heat thead th { position: static; }
table.heat .range { display: block; font-family: var(--mono); font-weight: 400; font-size: 0.72rem; color: var(--muted); text-transform: none; letter-spacing: 0; }
table.heat th.title-col { white-space: normal; max-width: 9em; text-align: center; }

footer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
footer p { margin: 4px 0; }
.footer-brand { margin: 0 0 8px; }
.footer-brand img { display: block; height: 18px; width: auto; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* The watermark shield sits beside the text only where there is room for both. */
@media (max-width: 1000px) {
  .hero::after { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .site-bar__in { gap: 6px 14px; padding: 8px 16px; }
  .site-bar__logo { height: 18px; }
  .site-bar__mark { height: 20px; }
  .site-bar__product { gap: 7px; }
  .site-bar__name { font-size: 0.86rem; }
  .hero__in { padding: 20px 16px 22px; }
  .eyebrow { font-size: 0.72rem; margin-bottom: 6px; }
  .hero h1 { font-size: 1.55rem; margin-bottom: 8px; }
  .hero .lede { font-size: 0.95rem; line-height: 1.55; margin-bottom: 10px; }
  .hero .privacy { font-size: 0.85rem; line-height: 1.5; padding: 8px 12px; }
  .hero .hero__note { font-size: 0.78rem; line-height: 1.5; }
  h1 { font-size: 1.45rem; }
  .card { padding: 16px 14px; border-radius: 12px; }
  .owners div { flex-direction: column; gap: 2px; }
  .owners dt { flex: none; }
}

/* ------------------------------------------------------------------ results (results.js)
   The Results card: summary, personal data grouped by value, document types with their
   reasons, and the collapsed score of every window. */

#results h2 + .result-summary { margin-top: 4px; }
.result-summary {
  border-left: 4px solid var(--brand-blue);
  background: var(--panel);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  margin: 0 0 24px;
}
.result-summary p { margin: 6px 0; overflow-wrap: anywhere; }
.result-summary p:not(.small) { font-size: 1.02rem; color: var(--text); }
#pii-h, #doc-h { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); }
#results > p[role="note"], #model-part > p[role="note"] {
  padding: 8px 12px;
  border-left: 3px solid var(--brand-orange);
  border-radius: 6px;
  background: var(--note-bg);
}

.pii-group { margin: 16px 0 0; }
.pii-group h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; font-size: 1rem; }
.pii-group .group-count { font-weight: 400; font-size: 0.84rem; color: var(--muted); }
.pii-group .group-meaning { margin: 2px 0 6px; }
table.pii-values { width: 100%; }
table.pii-values td.value { overflow-wrap: anywhere; }
table.pii-values th.num, table.pii-values td.num { width: 1%; }
table.pii-values tr.below td { color: var(--muted); }

details.more { margin: 16px 0 0; border-top: 1px solid var(--border); padding-top: 10px; }
details.more > summary { cursor: pointer; font-weight: 600; padding: 4px 0; color: var(--heading); }
details.more > summary::marker { color: var(--brand-blue); }
details.more[open] > summary { margin-bottom: 6px; }
#window-details > summary { font-size: 1.05rem; }

#text-h { margin-top: 22px; }
#highlighted { max-height: none; overflow-y: visible; }
#highlighted.expanded { max-height: 70vh; overflow-y: auto; }

.exact-rule { font-size: 0.8rem; }
.type-list { list-style: none; margin: 8px 0 0; padding: 0; }
.type-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 10px;
  min-width: 0;
}
.type-item.assigned { border-color: var(--brand-blue); border-width: 2px; background: var(--note-bg); }
.type-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.type-name { font-weight: 600; color: var(--heading); }
.type-code { font-size: 0.75rem; color: var(--muted); }
.type-meaning { margin: 2px 0 6px; }
.verdict { border-radius: 999px; padding: 0 10px; font: 600 0.76rem/1.75 var(--sans); white-space: nowrap; }
.verdict-assigned { background: var(--accent); color: var(--accent-text); }
.verdict-not-assigned { border: 1px solid var(--border-strong); color: var(--text); }
.verdict-info { background: var(--rules-bg); color: var(--rules-text); }

.score-bar {
  position: relative;
  height: 10px;
  max-width: 420px;
  background: var(--track);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin: 6px 0 2px;
}
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: color-mix(in srgb, var(--muted) 45%, transparent); }
.bar-fill.on { background: var(--brand-blue); }
.bar-tick { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--heading); }
.bar-label { margin: 0 0 4px; font-family: var(--mono); font-size: 0.76rem; }
.reason { margin: 4px 0 0; }
.strongest { margin: 8px 0 0; }
.strongest p { margin: 0 0 2px; }
.excerpt {
  font: 400 0.8rem/1.5 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  margin: 0;
  max-height: 14em;
  overflow-y: auto;
}

table.heat th[scope="row"] { white-space: normal; min-width: 9.5em; }
table.heat .row-code { display: block; font-size: 0.7rem; font-weight: 400; color: var(--muted); white-space: nowrap; }
.win-btn {
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: none;
  color: var(--link);
  font: 700 0.84rem/1.3 var(--mono);
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: pointer;
}
.win-btn:hover:not(:disabled) { background: none; }
.window-text { margin: 8px 0; }
.window-text p { margin: 0 0 4px; }
#types-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
#types-rules .type-item { margin: 0; }
#types-rules .reason { font-size: 0.9rem; }

/* ------------------------------------------------------------------ on a device (results.js renderDevice)
   The device's verdict comes first in the Results card, in an orange-edged panel; the model's
   preview follows under its own heading. */

.device-verdict {
  border-left: 4px solid var(--brand-orange);
  background: var(--note-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px 12px;
  margin: 0 0 8px;
}
.device-verdict > h3 { margin: 0 0 2px; }
.device-intro { margin: 0 0 8px; }
.device-headline { font-size: 1.05rem; margin: 6px 0 10px; color: var(--text); overflow-wrap: anywhere; }
.device-facts { margin: 0; }
.device-facts > div { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 2px 12px; padding: 6px 0; border-top: 1px solid var(--border); }
.device-facts dt { font-weight: 600; color: var(--heading); }
.device-facts dd { margin: 0; overflow-wrap: anywhere; }
.device-types { list-style: none; margin: 0; padding: 0; }
.device-types li { margin: 0 0 2px; }
.device-why { margin: 12px 0 4px; font-size: 0.95rem; color: var(--heading); }
.signals { margin: 0; padding-left: 1.2em; font-size: 0.9rem; }
.signals li { margin: 2px 0; overflow-wrap: anywhere; }
.signal { font-size: 0.76rem; color: var(--muted); }
.device-note { margin: 10px 0 0; }
.device-json { margin-top: 10px; }
.device-json pre { max-height: 22em; }
.model-alone-h { margin-top: 26px; padding-top: 18px; border-top: 2px solid var(--border-strong); }
@media (max-width: 560px) {
  .device-facts > div { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ the V1 decision (results.js renderV1)
   First in the Results card, in a blue-edged panel: the final line, then per type its action, which
   sources found it and the four steps of how the decision was made. */

.v1-decision {
  border: 2px solid var(--brand-blue);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 0 0 14px;
}
.v1-decision > h3 { margin: 0 0 2px; }
.v1-intro { margin: 0 0 8px; }
.v1-final { font-size: 1.15rem; margin: 8px 0 10px; color: var(--text); overflow-wrap: anywhere; }
.v1-absent {
  margin: 0 0 10px;
  padding: 6px 10px;
  border-left: 3px solid var(--brand-orange);
  border-radius: 6px;
  background: var(--note-bg);
}
.v1-how { margin: 12px 0 6px; font-size: 0.95rem; color: var(--heading); }
.v1-types { list-style: none; margin: 0; padding: 0; }
.v1-type {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 0 0 10px;
  min-width: 0;
}
.v1-facts { margin: 6px 0 4px; }
.v1-facts > div { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 2px 12px; padding: 2px 0; }
.v1-facts dt { font-weight: 600; color: var(--heading); }
.v1-facts dd { margin: 0; overflow-wrap: anywhere; }
.v1-steps { margin: 6px 0 0; padding-left: 1.4em; font-size: 0.92rem; }
.v1-steps li { margin: 3px 0; overflow-wrap: anywhere; }
.v1-badge-full { background: var(--accent); color: var(--accent-text); }
.v1-badge-record { background: var(--brand-orange); color: var(--on-orange); }
.v1-badge-none { border: 1px solid var(--border-strong); color: var(--text); }
.v1-honest { margin: 10px 0 0; }
@media (max-width: 560px) {
  .v1-facts > div { grid-template-columns: 1fr; }
}
