@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --ink: #171a18;
  --muted: #626762;
  --line: #d9ddd5;
  --paper: #fff;
  --soft: #f3f5f0;
  --lime: #e6fa91;
  --red: #c73b32;
  --amber: #a75b0b;
  --green: #20724d;
  --dark: #111513;
  color: var(--ink);
  font-family: 'DM Sans', Arial, sans-serif;
  font-synthesis: none;
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
}

a {
  color: inherit;
}

button {
  font: inherit;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: 'Space Grotesk', Arial, sans-serif;
  letter-spacing: 0;
}

p,
li,
td,
th {
  font-size: 15px;
  line-height: 1.72;
}

code,
pre,
.section-number,
.cover-kicker,
.report-actions > span,
.contents,
.risk-pill,
.score-box,
.decision-label {
  font-family: 'DM Mono', ui-monospace, monospace;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid #7b922f;
  outline-offset: 4px;
}

.skip {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--lime);
  color: var(--ink);
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.report-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 12px 4.5%;
  border-bottom: 1px solid #303531;
  background: var(--dark);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.brand small {
  display: block;
  margin-top: 2px;
  font-size: inherit;
  font-weight: 400;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding-bottom: 4px;
  background: #fff;
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 29px;
  font-weight: 700;
}

.brand-mark span {
  margin-left: -3px;
  color: #8aa32f;
}

.report-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.report-actions > span {
  color: #b6bcb6;
  font-size: 10px;
  letter-spacing: 0;
}

.back-link,
.print-button {
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid #555d57;
  border-radius: 3px;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.back-link:hover,
.print-button:hover {
  border-color: var(--lime);
  color: var(--lime);
}

main {
  width: min(1180px, 92%);
  margin: 40px auto 0;
  background: var(--paper);
  box-shadow: 0 18px 60px #20251f14;
}

.report-page {
  min-height: 720px;
}

.cover {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  padding: 58px 64px 38px;
  background:
    linear-gradient(90deg, transparent 0 76%, #2d332e 76% 76.2%, transparent 76.2%),
    var(--dark);
  color: #fff;
}

.cover-kicker,
.cover-foot {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  font-size: 11px;
}

.cover-kicker span:last-child {
  color: var(--lime);
}

.cover-title {
  align-self: center;
  max-width: 800px;
  padding: 70px 0;
}

.cover-title > p:first-child {
  margin-bottom: 18px;
  color: var(--lime);
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 13px;
  text-transform: uppercase;
}

.cover h1 {
  max-width: 700px;
  font-size: 68px;
  line-height: 1.02;
}

.cover-summary {
  max-width: 620px;
  margin-top: 26px;
  color: #cdd2cd;
  font-size: 17px;
}

.cover-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 48px;
  border-top: 1px solid #4a504b;
  border-bottom: 1px solid #4a504b;
}

.cover-meta div {
  padding: 18px 16px 18px 0;
  border-right: 1px solid #4a504b;
}

.cover-meta div:not(:first-child) {
  padding-left: 16px;
}

.cover-meta div:last-child {
  border-right: 0;
}

.cover-meta dt {
  margin-bottom: 7px;
  color: #989f99;
  font-size: 10px;
  text-transform: uppercase;
}

.cover-meta dd {
  font-size: 13px;
  line-height: 1.4;
}

.cover-foot {
  color: #8e958f;
}

.report-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
}

.contents {
  position: sticky;
  top: 78px;
  align-self: start;
  min-height: calc(100vh - 78px);
  padding: 48px 28px;
  border-right: 1px solid var(--line);
  background: #fafbf9;
}

.contents p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 10px;
}

.contents a {
  display: block;
  padding: 9px 0;
  color: #454a46;
  font-size: 11px;
  line-height: 1.5;
  text-decoration: none;
}

.contents a:hover {
  color: #556c13;
}

.report-body {
  min-width: 0;
  padding: 0 64px 70px;
}

.report-section,
.finding {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
}

.section-number {
  margin-bottom: 18px;
  color: #71832f;
  font-size: 11px;
  font-weight: 500;
}

.section-title-row,
.finding-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
}

.report-body h2 {
  max-width: 690px;
  margin-bottom: 24px;
  font-size: 38px;
  font-weight: 600;
  line-height: 1.12;
}

.report-body h3 {
  margin: 34px 0 12px;
  font-size: 21px;
  font-weight: 600;
}

.report-body > section > p,
.finding > p {
  max-width: 790px;
  margin-top: 14px;
  color: #3e433f;
}

.risk-pill {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 11px;
}

.risk-pill.high,
.risk-text.high {
  color: var(--red);
}

.risk-text.medium {
  color: var(--amber);
}

.risk-text.low {
  color: var(--green);
}

.executive-callout {
  margin: 10px 0 30px;
  padding: 24px 26px;
  border-left: 5px solid var(--red);
  background: #fff4f2;
}

.decision-label {
  margin-bottom: 8px;
  color: var(--red);
  font-size: 10px;
}

.decision {
  max-width: 760px;
  font-family: 'Space Grotesk', Arial, sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 36px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.metrics div {
  padding: 20px 12px;
  border-right: 1px solid var(--line);
}

.metrics div:first-child {
  padding-left: 0;
}

.metrics div:last-child {
  border-right: 0;
}

.metrics strong,
.metrics span {
  display: block;
}

.metrics strong {
  margin-bottom: 5px;
  font-family: 'Space Grotesk', Arial, sans-serif;
  font-size: 30px;
}

.metrics span {
  color: var(--muted);
  font-size: 11px;
}

.metrics .high strong {
  color: var(--red);
}

.metrics .medium strong {
  color: var(--amber);
}

.metrics .low strong {
  color: var(--green);
}

.table-wrap {
  margin: 22px 0 28px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--soft);
  font-size: 12px;
  font-weight: 600;
}

tbody th {
  width: 185px;
}

.findings-table td:first-child {
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
}

.risk-text {
  font-weight: 700;
  white-space: nowrap;
}

.severity-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 30px;
  border: 1px solid var(--line);
}

.severity-scale span {
  padding: 16px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.severity-scale span:last-child {
  border-right: 0;
}

.severity-scale b {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.finding-heading h2 {
  max-width: 650px;
}

.score-box {
  flex: 0 0 74px;
  padding: 12px 8px;
  background: var(--red);
  color: white;
  font-size: 26px;
  font-weight: 500;
  text-align: center;
}

.score-box small {
  display: block;
  margin-top: 3px;
  font-size: 9px;
}

.finding-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 8px 0 34px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.finding-meta div {
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.finding-meta dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.finding-meta dd {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.55;
}

code {
  padding: 1px 4px;
  background: #edf0e9;
  font-size: 0.92em;
}

.attack-path,
.fix-list {
  max-width: 800px;
  padding-left: 22px;
}

.attack-path li,
.fix-list li {
  margin: 8px 0;
  padding-left: 8px;
}

.attack-path li::marker {
  color: #71832f;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-weight: 500;
}

.evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 30px;
}

.evidence {
  min-width: 0;
  margin-top: 14px;
  border: 1px solid #303631;
  background: #171b18;
  color: #f4f7f2;
}

.evidence > p {
  padding: 10px 14px;
  border-bottom: 1px solid #303631;
  color: var(--lime);
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 9px;
}

pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-size: 11px;
  line-height: 1.65;
  white-space: pre;
}

pre code {
  padding: 0;
  background: none;
  color: inherit;
}

.retest-box {
  margin-top: 34px;
  padding: 25px 28px;
  border-top: 4px solid #748b2b;
  background: #f3f8dc;
}

.retest-box h3 {
  margin-top: 0;
}

.priority-list {
  margin-top: 30px;
  border-top: 1px solid var(--line);
}

.priority-list article {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.priority-list article > span {
  color: #71832f;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 12px;
}

.priority-list h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.priority-list p {
  color: #4d524e;
}

.sample-note {
  margin-top: 28px !important;
  padding: 20px 22px;
  border-left: 4px solid #71832f;
  background: var(--soft);
}

.references {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.references h3 {
  width: 100%;
  margin: 0 0 4px;
  font-size: 16px;
}

.references a {
  color: #53671f;
  font-size: 13px;
}

footer {
  display: flex;
  justify-content: space-between;
  width: min(1180px, 92%);
  margin: 0 auto 50px;
  padding: 24px 30px;
  background: var(--dark);
  color: #aab0aa;
  font-size: 11px;
}

@media (max-width: 900px) {
  .report-actions > span {
    display: none;
  }

  main,
  footer {
    width: 100%;
  }

  main {
    margin-top: 0;
    box-shadow: none;
  }

  .cover {
    padding: 46px 6%;
  }

  .cover h1 {
    font-size: 52px;
  }

  .cover-meta {
    grid-template-columns: 1fr 1fr;
  }

  .cover-meta div:nth-child(2) {
    border-right: 0;
  }

  .cover-meta div:nth-child(3),
  .cover-meta div:nth-child(4) {
    border-top: 1px solid #4a504b;
  }

  .report-layout {
    display: block;
  }

  .contents {
    display: none;
  }

  .report-body {
    padding: 0 6% 50px;
  }
}

@media (max-width: 620px) {
  .report-nav {
    min-height: 68px;
    padding-inline: 4%;
  }

  .brand {
    font-size: 14px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 25px;
  }

  .back-link {
    display: none;
  }

  .print-button {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 11px;
  }

  .report-page {
    min-height: 650px;
  }

  .cover {
    grid-template-rows: auto 1fr auto auto;
    padding: 32px 5% 26px;
    background: var(--dark);
  }

  .cover-title {
    padding: 55px 0;
  }

  .cover h1 {
    font-size: 42px;
  }

  .cover-summary {
    font-size: 15px;
  }

  .cover-meta {
    grid-template-columns: 1fr;
    margin-bottom: 28px;
  }

  .cover-meta div,
  .cover-meta div:not(:first-child) {
    padding: 11px 0;
    border-top: 1px solid #4a504b;
    border-right: 0;
  }

  .cover-foot,
  .cover-kicker {
    font-size: 9px;
  }

  .cover-foot span:last-child {
    text-align: right;
  }

  .report-body {
    padding-inline: 5%;
  }

  .report-section,
  .finding {
    padding: 46px 0;
  }

  .report-body h2 {
    font-size: 31px;
  }

  .section-title-row,
  .finding-heading {
    display: block;
  }

  .risk-pill,
  .score-box {
    display: inline-block;
    margin-bottom: 22px;
  }

  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .metrics div:nth-child(3) {
    border-right: 0;
  }

  .metrics div:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

  .finding-meta,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .severity-scale {
    grid-template-columns: 1fr 1fr;
  }

  .severity-scale span {
    border-bottom: 1px solid var(--line);
  }

  .severity-scale span:nth-child(2n) {
    border-right: 0;
  }

  .severity-scale span:last-child {
    border-bottom: 0;
  }

  footer {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0;
    padding-inline: 5%;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }
}

@media print {
  @page {
    size: A4;
    margin: 15mm;
  }

  body {
    background: #fff;
  }

  .report-nav,
  .contents,
  footer {
    display: none !important;
  }

  main {
    width: 100%;
    margin: 0;
    box-shadow: none;
  }

  .cover {
    min-height: 250mm;
    break-after: page;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .report-layout {
    display: block;
  }

  .report-body {
    padding: 0;
  }

  .report-section,
  .finding {
    padding: 12mm 0;
  }

  .finding {
    break-before: page;
  }

  h2,
  h3,
  .finding-heading,
  .retest-box,
  .evidence,
  tr,
  .priority-list article {
    break-inside: avoid;
  }

  .evidence,
  .score-box,
  .executive-callout,
  .risk-pill,
  .retest-box {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  a {
    text-decoration: none;
  }
}
