:root {
  --background: #e6fff7;
  --paper: #f5fff9;
  --ink: #050505;
  --muted: #858b88;
  --safe: #c9ffe0;
  --safe-border: #008e49;
  --threshold: #fff6b3;
  --threshold-border: #9c7600;
  --rule: 3px solid var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  background: var(--background);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  pointer-events: none;
}

p,
h1,
h2 {
  margin: 0;
}

.report-shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: var(--rule);
  background: color-mix(in srgb, var(--background) 95%, transparent);
  box-shadow: 0 12px 0 var(--ink);
}

.report-header {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.2fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 22px;
  color: #f5f5f5;
  background: var(--ink);
}

.report-header h1 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
}

.report-header h1 span {
  padding-inline: 0.18em;
  font-weight: 500;
  letter-spacing: 0.18em;
}

.report-tagline,
.report-code,
.label,
.stamp,
.sample-type,
.sample-meta,
table,
.interpretation,
.report-footer {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  text-transform: uppercase;
}

.report-tagline {
  font-size: 0.75rem;
  line-height: 1.45;
  letter-spacing: 0.17em;
  text-align: right;
}

.report-code {
  align-self: stretch;
  padding-left: 10px;
  border-left: 2px solid currentColor;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  writing-mode: vertical-rl;
}

.report-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.8fr) minmax(180px, 0.8fr);
  border-top: var(--rule);
  border-bottom: var(--rule);
}

.summary-cell {
  min-width: 0;
  padding: 16px 20px;
  border-right: var(--rule);
}

.summary-cell:last-child {
  border-right: 0;
}

.label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.23em;
}

.summary-statement {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
  text-transform: uppercase;
}

.stamp {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 8px;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
}

.summary-mark {
  display: grid;
  place-items: center;
}

.ripple-mark {
  position: relative;
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border: var(--rule);
  border-radius: 50%;
}

.ripple-mark::before,
.ripple-mark::after {
  position: absolute;
  inset: 10px;
  content: "";
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.ripple-mark::after {
  inset: 24px;
  border-style: dashed;
}

.ripple-mark span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow:
    0 -22px var(--ink),
    0 22px var(--ink),
    22px 0 var(--ink),
    -22px 0 var(--ink),
    15px 15px var(--ink),
    -15px 15px var(--ink),
    15px -15px var(--ink),
    -15px -15px var(--ink);
}

.sample-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: var(--rule);
  background: var(--paper);
}

.sample {
  min-width: 0;
  padding: 18px 20px 22px;
  border-right: var(--rule);
}

.sample:last-child {
  border-right: 0;
}

.sample-header {
  display: flex;
  gap: 16px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sample-header h2 {
  font-size: 1.05rem;
  text-transform: uppercase;
}

.sample-type {
  padding: 5px 7px;
  color: #f5f5f5;
  background: var(--ink);
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  white-space: nowrap;
}

.sample-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 10px;
  padding: 0;
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.02em;
  list-style: none;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 300px;
  border-collapse: collapse;
  font-size: 0.72rem;
}

caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

th,
td {
  padding: 5px 0;
  border-bottom: 1px solid var(--ink);
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
}

thead th {
  font-size: 0.67rem;
  font-weight: 600;
}

tbody th {
  width: 42%;
}

.result {
  padding-left: 12px;
  letter-spacing: 0.04em;
  text-align: right;
}

.flag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.flag abbr {
  text-decoration: none;
}

.safe {
  border-color: var(--safe-border);
  background: var(--safe);
}

.threshold {
  border-color: var(--threshold-border);
  border-style: dashed;
  background: var(--threshold);
}

.interpretation {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.48;
}

.interpretation strong {
  color: var(--ink);
  font-weight: 600;
}

.report-footer {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-top: var(--rule);
  font-size: 0.65rem;
}

.ticker {
  letter-spacing: 0.14em;
}

.ticker::before {
  margin-right: 5px;
  content: "///////";
  font-size: 0.52rem;
  letter-spacing: 0.16em;
}

@media (max-width: 880px) {
  .report-summary,
  .sample-grid {
    grid-template-columns: 1fr;
  }

  .summary-cell,
  .sample {
    border-right: 0;
    border-bottom: var(--rule);
  }

  .summary-cell:last-child,
  .sample:last-child {
    border-bottom: 0;
  }

  .summary-mark {
    min-height: 116px;
  }
}

@media (max-width: 640px) {
  body {
    padding: 12px;
  }

  .report-shell {
    box-shadow: 0 6px 0 var(--ink);
  }

  .report-header {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .report-header h1 {
    font-size: clamp(1rem, 5vw, 1.2rem);
    letter-spacing: 0;
    white-space: nowrap;
  }

  .report-tagline {
    font-size: 0.65rem;
    text-align: left;
  }

  .report-code {
    padding-top: 8px;
    padding-left: 0;
    border-top: 2px solid currentColor;
    border-left: 0;
    writing-mode: horizontal-tb;
  }

  .sample,
  .summary-cell {
    padding-inline: 16px;
  }

  .sample-meta {
    display: grid;
    gap: 4px;
  }

  table {
    font-size: 0.66rem;
  }

  .report-footer {
    display: grid;
    justify-content: start;
    gap: 7px;
  }
}

@media print {
  :root,
  html,
  body,
  .report-shell,
  .sample-grid {
    background: #fff;
  }

  body {
    padding: 0;
  }

  body::before {
    display: none;
  }

  .report-shell {
    max-width: none;
    box-shadow: none;
  }
}
