/* ==========================================================================
   Fluency Mono Report — the house B&W report format.

   Monochrome ink hierarchy, IBM Plex Sans body / IBM Plex Mono labels,
   print-first at Letter and A4 with a 0.7in page margin.

   White-label: a client or partner MSSP ships this same format under their
   own identity by overriding --report-accent, the .brand-mark SVG, the org
   name in the running header, and the footer confidentiality line. Fluency
   is the default preset.
   ========================================================================== */

@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/ibm-plex-mono-400-latin.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/ibm-plex-mono-500-latin.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/ibm-plex-mono-600-latin.woff2') format('woff2'); }

:root {
  /* Ink */
  --ink-head:   #000;
  --ink-body:   #242424;
  --ink-table:  #444;
  --ink-second: #555;
  --ink-deck:   #4a4a4a;
  --ink-micro:  #777;
  --ink-micro2: #8a8a8a;
  /* Surfaces */
  --sheet:      #fff;
  --callout:    #f4f4f2;
  --emphasis:   #fafaf9;
  --badge-grey: #e8e8e6;
  --invert:     #111;
  /* Rules */
  --rule:       #111;
  --hairline:   #d8d8d8;
  --row-rule:   #e2e2e2;
  /* White-label slot. Monochrome is the default; the accent is opt-in and
     used sparingly (most useful on the M-SOC / CISO monthly report). */
  --report-accent: #b3242e;

  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}

@page { size: Letter; margin: 0.7in; }

* { box-sizing: border-box; }

html { background: #ececeb; }

body {
  margin: 0;
  background: #ececeb;
  color: var(--ink-body);
  font-family: var(--sans);
  font-size: 9.5pt;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* --- Sheet ---------------------------------------------------------------
   8.5in wide with a 0.7in margin gives the 7.1in Letter text column on
   screen. In print the @page rule owns the geometry, so the padding is
   dropped and the column reflows to whatever the sheet is (Letter or A4). */
.sheet {
  max-width: min(8.5in, 100%);
  margin: 0 auto;
  padding: 0.7in;
  background: var(--sheet);
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 28px rgba(0,0,0,.07);
}

/* --- Running header / footer --------------------------------------------- */
.running-header,
.running-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 7.5pt;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.running-header {
  padding-bottom: 7px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-head);
}
.running-header .org { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.running-header .brand-mark { width: 11px; height: 11px; }
.running-header .doc-title { color: var(--ink-micro); font-weight: 400; text-align: right; }
.running-footer {
  margin-top: 34px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
  color: var(--ink-micro2);
}

/* --- Cover block ---------------------------------------------------------- */
.cover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding-top: 26px;
}
h1.cover-title {
  margin: 0;
  max-width: 4.8in;
  font-size: 29pt;
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--ink-head);
}
.cover-row .brand-mark { flex: none; width: 80px; height: 80px; color: var(--ink-head); }
.cover-deck {
  margin: 14px 0 0;
  max-width: 5.4in;
  font-size: 12pt;
  line-height: 1.38;
  color: var(--ink-deck);
}
.cover-rule {
  height: 2px;
  margin: 22px 0 26px;
  background: var(--rule);
}
.cover-meta {
  margin: -14px 0 26px;
  font-family: var(--mono);
  font-size: 7.5pt;
  letter-spacing: .04em;
  color: var(--ink-micro);
  overflow-wrap: anywhere;
}

/* --- Headings ------------------------------------------------------------- */
h2.section {
  margin: 30px 0 12px;
  font-size: 16pt;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.012em;
  color: var(--ink-head);
  break-after: avoid;
}
h3.subsection {
  margin: 22px 0 8px;
  font-size: 14pt;
  font-weight: 600;
  line-height: 1.22;
  color: var(--ink-head);
  break-after: avoid;
}
h4.card-title {
  margin: 0 0 5px;
  font-size: 11pt;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink-head);
  break-after: avoid;
}
p { margin: 0 0 9px; }
p:last-child { margin-bottom: 0; }
a { color: inherit; }

.mono-label {
  display: block;
  font-family: var(--mono);
  font-size: 7.5pt;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-micro);
}
/* A § or ordinal mark that introduces the next section heading. */
.section-mark { margin-top: 30px; break-after: avoid; }
.section-mark + h2.section { margin-top: 4px; }
.micro { font-size: 7.5pt; line-height: 1.45; color: var(--ink-micro); }
.mono { font-family: var(--mono); font-size: 8.5pt; overflow-wrap: anywhere; }
.secondary { color: var(--ink-second); }

/* --- Step strip ----------------------------------------------------------- */
.step-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--hairline);
  margin: 24px 0;
  break-inside: avoid;
}
.step-strip .step { padding: 12px 18px 16px; border-left: 1px solid var(--row-rule); }
.step-strip .step:first-child { padding-left: 0; border-left: 0; }
.step-strip .step .mono-label { margin-bottom: 7px; }
.step-strip .step p { font-size: 8.5pt; color: var(--ink-table); }

/* --- Callout -------------------------------------------------------------- */
.callout {
  background: var(--callout);
  border-left: 3px solid var(--rule);
  padding: 15px 20px;
  margin: 18px 0;
  break-inside: avoid;
}
.callout > :first-child { margin-top: 0; }
.callout h4.card-title { font-size: 12pt; margin-bottom: 7px; }

/* --- Summary panel (inverted) --------------------------------------------- */
.summary-panel {
  background: var(--invert);
  color: var(--row-rule);
  padding: 18px 22px;
  margin: 20px 0;
  break-inside: avoid;
}
.summary-panel h4.card-title,
.summary-panel h3.subsection { color: #fff; }
.summary-panel .mono-label { color: var(--ink-micro2); }
.summary-panel a { color: #fff; }

/* --- Emphasis card -------------------------------------------------------- */
.card {
  background: var(--emphasis);
  border: 1px solid var(--hairline);
  padding: 14px 16px;
  break-inside: avoid;
}
.card p { font-size: 8.5pt; color: var(--ink-table); }
.card-grid { display: grid; gap: 12px; margin: 16px 0; }
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* --- Stat tiles ----------------------------------------------------------- */
.stat-tiles {
  display: grid;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--hairline);
  margin: 20px 0;
  break-inside: avoid;
}
.stat-tiles.n-4 { grid-template-columns: repeat(4, 1fr); }
.stat-tiles.n-5 { grid-template-columns: repeat(5, 1fr); }
.stat-tiles .tile { padding: 12px 16px 14px; border-left: 1px solid var(--row-rule); }
.stat-tiles .tile:first-child { padding-left: 0; border-left: 0; }
.stat-tiles .figure {
  font-family: var(--mono);
  font-size: 17pt;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink-head);
}
.stat-tiles .figure small { font-size: 9pt; font-weight: 400; color: var(--ink-second); }
.stat-tiles .figure.critical { color: var(--report-accent); }
.stat-tiles .tile .mono-label { margin-top: 6px; letter-spacing: .12em; }

/* --- Tables --------------------------------------------------------------- */
/* Wide tables scroll inside their own container so the page never does. */
.table-scroll { max-width: 100%; overflow-x: auto; }

table.matrix, table.data {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 6px;
  font-size: 8.5pt;
  color: var(--ink-table);
}
table.matrix { table-layout: fixed; }
table.matrix col.key { width: 31%; }
table.matrix col.val { width: 69%; }
thead th {
  font-family: var(--mono);
  font-size: 7.5pt;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-micro);
  text-align: left;
  padding: 0 10px 6px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: bottom;
}
tbody td {
  overflow-wrap: anywhere;
  padding: 7px 10px 7px 0;
  border-bottom: 1px solid var(--row-rule);
  vertical-align: top;
}
tbody th {
  overflow-wrap: anywhere;
  padding: 7px 10px 7px 0;
  border-bottom: 1px solid var(--row-rule);
  vertical-align: top;
  text-align: left;
  font-weight: 600;
  color: var(--ink-head);
}
thead th:last-child, tbody td:last-child, tbody th:last-child { padding-right: 0; }
tbody tr { break-inside: avoid; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table + .micro { margin-top: 8px; }

/* --- Status badges -------------------------------------------------------- */
/* Three variants only. Always block-level, on their own line under the label
   they qualify — never inline beside it. */
.badge {
  display: block;
  width: fit-content;
  margin-top: 4px;
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 7pt;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  break-inside: avoid;
  break-after: avoid;
}
.badge--filled   { background: var(--invert); color: #fff; border: 1px solid var(--invert); }
.badge--outlined { background: transparent; color: var(--ink-head); border: 1px solid var(--ink-head); }
.badge--grey     { background: var(--badge-grey); color: var(--ink-second); border: 1px solid var(--badge-grey); }
/* The one crimson accent the format allows, reserved for critical severity. */
.badge--critical { background: var(--report-accent); color: #fff; border: 1px solid var(--report-accent); }
td > .badge:first-child, .summary-panel .badge { margin-top: 0; }
.summary-panel .badge--filled { background: #fff; color: var(--invert); border-color: #fff; }
.summary-panel .badge--outlined { color: #fff; border-color: #fff; }

/* --- Mono chart ----------------------------------------------------------- */
/* Ink tints only — no colour encoding. */
.mono-chart { margin: 14px 0 6px; break-inside: avoid; }
.mono-chart .bar-row {
  display: grid;
  grid-template-columns: 1.9in 1fr 0.62in;
  align-items: center;
  gap: 12px;
  padding: 3.5px 0;
}
.mono-chart .bar-label { font-size: 8.5pt; color: var(--ink-table); }
.mono-chart .bar-label .mono-label { display: inline; font-size: 7pt; letter-spacing: .1em; }
.mono-chart .track { height: 9px; background: var(--row-rule); }
.mono-chart .fill { height: 100%; width: var(--w, 0%); background: var(--invert); }
.mono-chart .fill.tint-2 { background: var(--ink-second); }
.mono-chart .fill.tint-3 { background: var(--ink-micro2); }
.mono-chart .fill.tint-4 { background: var(--hairline); }
.mono-chart.with-share .bar-row { grid-template-columns: 1.7in 1fr 0.95in; }
.mono-chart .bar-value {
  font-family: var(--mono);
  font-size: 8pt;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ink-head);
}

/* --- Kill-chain band ------------------------------------------------------ */
.chain {
  display: grid;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--hairline);
  margin: 16px 0;
  break-inside: avoid;
}
.chain.n-6 { grid-template-columns: repeat(6, 1fr); }
.chain.n-7 { grid-template-columns: repeat(7, 1fr); }
.chain .link { padding: 9px 10px 11px; border-left: 1px solid var(--row-rule); }
.chain.n-6 .link:nth-child(6n+1) { border-left: 0; padding-left: 0; }
.chain.n-7 .link:nth-child(7n+1) { border-left: 0; padding-left: 0; }
.chain.n-6 .link:nth-child(n+7) { border-top: 1px solid var(--row-rule); }
.chain.n-7 .link:nth-child(n+8) { border-top: 1px solid var(--row-rule); }
.chain .link .id {
  font-family: var(--mono);
  font-size: 7pt;
  letter-spacing: .1em;
  color: var(--ink-micro2);
}
.chain .link .name { font-size: 8pt; font-weight: 600; color: var(--ink-head); margin-top: 2px; }
.chain .link .count {
  font-family: var(--mono);
  font-size: 8pt;
  color: var(--ink-second);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.chain .link.quiet .name, .chain .link.quiet .count { color: var(--ink-micro2); font-weight: 400; }

/* --- Lists ---------------------------------------------------------------- */
ul.findings { list-style: none; margin: 12px 0; padding: 0; }
ul.findings > li {
  padding: 9px 0 9px 0;
  border-top: 1px solid var(--row-rule);
  break-inside: avoid;
}
ul.findings > li:last-child { border-bottom: 1px solid var(--row-rule); }
ul.findings > li > .mono-label { margin-bottom: 3px; }
ul.plain { margin: 8px 0; padding-left: 1.1em; }
ul.plain li { margin-bottom: 4px; }

/* --- Split verdict -------------------------------------------------------- */
.verdict-bar {
  display: flex;
  height: 11px;
  margin: 12px 0 6px;
  border: 1px solid var(--rule);
  break-inside: avoid;
}
.verdict-bar .lhs { background: var(--invert); }
.verdict-bar .rhs { background: var(--badge-grey); }
.verdict-legend {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 7.5pt;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-second);
}

/* --- Methodology block ---------------------------------------------------- */
.methodology {
  margin-top: 30px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font-size: 7.5pt;
  line-height: 1.5;
  color: var(--ink-micro);
  break-inside: avoid;
}
.methodology h3.subsection { font-size: 10pt; margin: 0 0 7px; }
.methodology p { margin-bottom: 7px; }
.methodology strong { color: var(--ink-second); }

/* --- Print ---------------------------------------------------------------- */
@media print {
  html, body { background: #fff; }
  .sheet { max-width: none; margin: 0; padding: 0; box-shadow: none; }
  /* No position:fixed — the format forbids it, and Chrome's fixed-in-print
     repeat overlaps content. The header and footer print once, as document
     header and footer, which is what static HTML can honestly deliver. */
  .running-footer { margin-top: 24px; }
  h2.section { break-before: auto; }
}

/* --- Narrow screens ------------------------------------------------------- */
@media screen and (max-width: 8.5in) {
  .sheet { padding: 0.45in 0.4in; box-shadow: none; }
  .cover-row { gap: 20px; }
  .cover-row .brand-mark { width: 54px; height: 54px; }
  h1.cover-title { font-size: 23pt; }
  .step-strip, .card-grid.cols-2, .card-grid.cols-3, .stat-tiles.n-4, .stat-tiles.n-5 {
    grid-template-columns: 1fr;
  }
  .step-strip .step, .stat-tiles .tile {
    padding-left: 0; border-left: 0; border-top: 1px solid var(--row-rule);
  }
  .step-strip .step:first-child, .stat-tiles .tile:first-child { border-top: 0; }
  .chain.n-6, .chain.n-7 { grid-template-columns: repeat(2, 1fr); }
  .chain .link { border-left: 1px solid var(--row-rule); padding-left: 10px; border-top: 0; }
  .chain.n-6 .link:nth-child(odd), .chain.n-7 .link:nth-child(odd) { border-left: 0; padding-left: 0; }
  .chain.n-6 .link:nth-child(n+3), .chain.n-7 .link:nth-child(n+3) { border-top: 1px solid var(--row-rule); }
  .mono-chart .bar-row { grid-template-columns: 1.35in 1fr 0.55in; gap: 8px; }
  .mono-chart.with-share .bar-row { grid-template-columns: 1.15in 1fr 0.85in; gap: 8px; }
}
