/* ============================================================
   Rail Threat Brief — design system
   Concept: "operational briefing" — calm, trustworthy,
   printed-brief aesthetic. Dark control desk, warm paper cards,
   one signal-orange accent.
   Fonts: Fraunces (editorial serif display), IBM Plex Sans
   (body), IBM Plex Mono (technical values). Self-hosted woff2.
   ============================================================ */

/* ---------- 1. Self-hosted fonts (no runtime CDN) ---------- */

@font-face {
  font-family: "Fraunces";
  src: url("/static/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/static/fonts/ibm-plex-sans-latin.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/static/fonts/ibm-plex-mono-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/static/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- 2. Tokens — dark (default) ---------- */

:root {
  /* surfaces */
  --page-bg: #17181c;
  --page-text: #d8d4c9;
  --page-muted: #93978f;
  --glow: rgba(255, 106, 26, 0.08);
  --rule: #3a3d45;

  /* paper cards */
  --card-bg: #f1ede3;
  --card-text: #202329;
  --card-muted: #585d66;
  --card-border: #d9d3c4;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 28px rgba(0, 0, 0, 0.45);

  /* controls */
  --control-bg: #1e2026;
  --control-border: #6e7583;
  --control-text: #e8e4da;

  /* text on dark surfaces */
  --text-muted: var(--page-muted);
  --text-strong: var(--page-text);

  /* the one accent — signal orange (rail safety) */
  --accent: #ff6a1a;        /* on dark surfaces: 6.6:1 */
  --accent-deep: #b83900;   /* on paper cards:   4.6:1 */
  --accent-ink: #1a0f07;    /* text sitting on the accent fill */
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --focus: #d25500;          /* on paper cards: 3.56:1 (>= 3:1 AA) */
  --error: #ff8f80;         /* on dark surfaces: 8.3:1 */

  /* severity ramp (fills always sit on paper; ink passes 4.5:1) */
  --sev-critical: #d13425;
  --sev-critical-ink: #fff7f4;
  --sev-high: #c2410a;
  --sev-high-ink: #fff3ea;
  --sev-medium: #8f6d00;
  --sev-medium-ink: #fff9ec;
  --sev-low: #5f6c7d;
  --sev-low-ink: #f4f7fa;

  /* type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* scale (rem on 16px root) */
  --text-xs: 0.75rem;    /* 12 */
  --text-sm: 0.8125rem;  /* 13 */
  --text-md: 1rem;       /* 16 */
  --text-lg: 1.125rem;   /* 18 */
  --text-xl: 1.375rem;   /* 22 */
  --text-2xl: 1.75rem;   /* 28 */
  --text-3xl: 2.5rem;    /* 40 */

  /* spacing — 4px base */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* radii — small, printed */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --content-max: 78rem;
  --measure: 68ch;

  /* motion */
  --ease-brief: cubic-bezier(0.22, 0.7, 0.22, 1);
  --reveal-duration: 520ms;
}

/* ---------- 3. Tokens — light theme (paper desk) ---------- */

@media (prefers-color-scheme: light) {
  :root {
    --page-bg: #eae7de;
    --page-text: #23262d;
    --page-muted: #555a4e;
    --glow: rgba(214, 140, 60, 0.14);
    --rule: #c9c4b4;

    --card-bg: #f9f7f1;
    --card-text: #20232a;
    --card-muted: #565b64;
    --card-border: #cfc9b9;
    --card-shadow: 0 1px 2px rgba(60, 50, 30, 0.12), 0 10px 24px rgba(60, 50, 30, 0.14);

    --control-bg: #fffdf6;
    --control-border: #7a7464;
    --control-text: #23262d;

    --accent: #b03200;
    --accent-deep: #b03200;
    --accent-ink: #fff3ea;
    --focus: #c2410a;
    --error: #a02015;
  }
}

/* ---------- 4. Reset & base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  html {
    color-scheme: light;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--page-text);
  background-color: var(--page-bg);
  background-image:
    radial-gradient(1100px 420px at 50% -140px, var(--glow), transparent 70%);
  background-attachment: fixed;
  font-optical-sizing: auto;
  -webkit-text-size-adjust: 100%;
}

/* fine paper grain, fixed above everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.035;
  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='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: light) {
  body::after {
    opacity: 0.05;
  }
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

/* ---------- 5. Typography ---------- */

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  line-height: 1.5;
  color: var(--page-text);
  margin: 0 0 var(--space-4);
}

h1 {
  font-size: clamp(var(--text-3xl), 4.5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.015em;
}

h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 var(--space-4);
  max-width: var(--measure);
}

strong {
  font-weight: 600;
}

small {
  font-size: var(--text-sm);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--control-border) 16%, transparent);
  color: var(--page-text);
  overflow-wrap: anywhere;
}

@media (prefers-color-scheme: light) {
  code {
    background: color-mix(in srgb, var(--control-border) 18%, transparent);
  }
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  border-radius: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* ---------- 6. Focus & skip link ---------- */

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 1000;
  padding: var(--space-3) var(--space-5);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: top 150ms ease;
}

.skip-link:focus {
  top: var(--space-4);
}

/* ---------- 7. Masthead / navigation ---------- */

.masthead {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6) clamp(1rem, 4vw, 2rem) var(--space-5);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.masthead::after {
  content: "";
  position: absolute;
  left: clamp(1rem, 4vw, 2rem);
  right: clamp(1rem, 4vw, 2rem);
  bottom: -3px;
  border-bottom: 3px double var(--rule);
}

.site-name {
  margin: 0;
}

.site-name a {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--page-text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 0.55em;
}

/* the signal lamp — the one sharp accent, reserved */
.site-name a::before {
  content: "";
  width: 0.72em;
  height: 0.72em;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
  flex: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--page-muted);
  border-radius: var(--radius-sm);
}

.site-nav a:hover {
  color: var(--page-text);
}

/* ---------- 8. Layout shell ---------- */

main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6) clamp(1rem, 4vw, 2rem) var(--space-7);
}

.colophon {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-4) clamp(1rem, 4vw, 2rem) var(--space-6);
  border-top: 1px solid var(--rule);
  font-size: var(--text-sm);
  color: var(--page-muted);
  font-family: var(--font-mono);
}

.colophon p {
  margin: 0;
}

.page-title {
  margin-bottom: var(--space-2);
}

.lede {
  color: var(--page-muted);
  margin-bottom: var(--space-6);
}

/* ---------- 9. Severity count strip ---------- */

.window-selector {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-6);
}

.window-option {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
}

.window-option:hover {
  border-color: var(--accent);
  color: var(--text-strong);
}

.window-option.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft, transparent);
}

.sector-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-6);
}

.sector-tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
}

.sector-tab:hover { border-color: var(--accent); color: var(--text-strong); }

.sector-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft, transparent);
}

.sector-badge { margin-left: var(--space-2); }

.counts {
  list-style: none;
  margin: 0 0 var(--space-7);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.count {
  background: var(--page-bg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.count-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--page-muted);
}

.count-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.1;
  color: var(--page-text);
}

/* only the count glyph takes the severity hue — the label is always text */
.count.sev-critical .count-value { color: var(--sev-critical); }
.count.sev-high .count-value { color: var(--accent); }
.count.sev-medium .count-value { color: color-mix(in srgb, var(--sev-medium) 75%, var(--page-text)); }
.count.sev-low .count-value { color: var(--page-muted); }

/* ---------- 10. Bento digest grid ---------- */

.digest {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-5);
}

/* severity-ordered: first item (top severity) spans full width,
   then an 8/4 pairing and 6/6 pairs — every row always fills */
.report {
  grid-column: span 6;
  min-width: 0;
  background: var(--card-bg);
  color: var(--card-text);
  border: 1px solid var(--card-border);
  border-left: 5px solid var(--sev-low);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  padding: var(--space-5) var(--space-6) var(--space-4);
  animation: brief-in var(--reveal-duration) var(--ease-brief) both;
}

.report:nth-child(2) { grid-column: span 8; }
.report:nth-child(3) { grid-column: span 4; }

.report:first-child {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--space-6);
  padding: var(--space-6) var(--space-7);
}

.report h2 {
  color: var(--card-text);
}

.report:first-child h2 {
  grid-column: 1 / -1;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 650;
  margin-bottom: var(--space-3);
}

.report p {
  max-width: none;
}

.report .meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  row-gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.report:first-child .summary {
  grid-column: 1 / 8;
  font-size: var(--text-lg);
}

.report:first-child .impact,
.report:first-child .source {
  grid-column: 8 / 13;
  margin-left: var(--space-2);
}

.report:first-child .read-more {
  grid-column: 8 / 13;
  margin-left: var(--space-2);
  margin-top: var(--space-2);
}

/* severity accents — border + labelled badge, never color alone */
.report.sev-critical { border-left-color: var(--sev-critical); }
.report.sev-high { border-left-color: var(--sev-high); }
.report.sev-medium { border-left-color: var(--sev-medium); }
.report.sev-low { border-left-color: var(--sev-low); }

.meta time {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--card-muted);
  letter-spacing: 0.02em;
}

.summary {
  color: var(--card-text);
}

.impact {
  color: var(--card-text);
}

.impact::before {
  content: "Impact: ";
  font-weight: 600;
}

.source {
  font-size: var(--text-sm);
  color: var(--card-muted);
}

.source a {
  color: var(--accent-deep);
}

.read-more {
  margin-top: var(--space-4);
  margin-bottom: 0;
}

.read-more a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
  color: var(--accent-deep);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.read-more a::after {
  content: " \2192";
  transition: transform 150ms ease;
  display: inline-block;
}

.read-more a:hover::after {
  transform: translateX(3px);
}

/* ---------- 11. Badges (severity, labelled — never color-only) ---------- */

.badge {
  display: inline-block;
  padding: 0.3em 0.7em;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.badge.sev-critical { background: var(--sev-critical); color: var(--sev-critical-ink); }
.badge.sev-high { background: var(--sev-high); color: var(--sev-high-ink); }
.badge.sev-medium { background: var(--sev-medium); color: var(--sev-medium-ink); }
.badge.sev-low { background: var(--sev-low); color: var(--sev-low-ink); }

/* ---------- 12. Forms ---------- */

.search-form {
  display: flex;
  align-items: flex-end;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1 1 22rem;
}

label {
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--page-muted);
}

input[type="password"],
input[type="search"] {
  min-height: 48px;
  width: 100%;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--control-text);
  background: var(--control-bg);
  border: 1.5px solid var(--control-border);
  border-radius: var(--radius-md);
  appearance: none;
}

input::placeholder {
  color: var(--page-muted);
}

button {
  min-height: 48px;
  padding: var(--space-2) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  cursor: pointer;
  flex: none;
}

button:hover {
  filter: brightness(1.06);
}

button:active {
  transform: translateY(1px);
}

/* ---------- 13. Login ---------- */

.login-panel {
  max-width: 30rem;
  margin: var(--space-8) auto;
  background: var(--card-bg);
  color: var(--card-text);
  border: 1px solid var(--card-border);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  padding: var(--space-7) var(--space-6);
  animation: brief-in var(--reveal-duration) var(--ease-brief) both;
}

.login-panel h1 {
  color: var(--card-text);
  font-size: var(--text-2xl);
}

.login-panel .field {
  margin-bottom: var(--space-5);
}

.login-panel button {
  width: 100%;
}

.error {
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  background: color-mix(in srgb, var(--error) 12%, transparent);
  color: var(--error);
  border: 1px solid var(--error);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* ---------- 14. Search results ---------- */

.result-summary {
  padding: var(--space-4) var(--space-5);
  background: var(--page-bg);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  font-weight: 500;
}

.result-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.panel {
  background: var(--card-bg);
  color: var(--card-text);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  padding: var(--space-5) var(--space-6);
  min-width: 0;
  animation: brief-in var(--reveal-duration) var(--ease-brief) both;
}

.panel h2 {
  color: var(--card-text);
  font-size: var(--text-xl);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--card-border);
}

.record-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.record-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--card-border) 55%, transparent);
}

.record-list li:last-child {
  border-bottom: 0;
}

.record-list strong {
  color: var(--card-text);
}

.record-list code {
  color: var(--card-text);
  background: color-mix(in srgb, var(--card-border) 40%, transparent);
  font-size: var(--text-sm);
  font-weight: 500;
  max-width: 100%;
}

.kind {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--card-muted);
}

.empty-state {
  padding: var(--space-6) var(--space-5);
  border: 1px dashed var(--rule);
  border-radius: var(--radius-md);
  color: var(--page-muted);
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  animation: brief-in var(--reveal-duration) var(--ease-brief) both;
}

/* ---------- 15. Motion: staggered page-load reveal ---------- */

@keyframes brief-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.report:nth-child(1) { animation-delay: 0ms; }
.report:nth-child(2) { animation-delay: 70ms; }
.report:nth-child(3) { animation-delay: 140ms; }
.report:nth-child(4) { animation-delay: 210ms; }
.report:nth-child(5) { animation-delay: 280ms; }
.report:nth-child(6) { animation-delay: 350ms; }
.report:nth-child(7) { animation-delay: 420ms; }
.report:nth-child(8) { animation-delay: 490ms; }
.report:nth-child(n + 9) { animation-delay: 560ms; }

.panel:nth-child(1) { animation-delay: 80ms; }
.panel:nth-child(2) { animation-delay: 160ms; }

/* hover lift — only on fine pointers */
@media (hover: hover) {
  .report,
  .panel,
  .login-panel,
  .counts {
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
  }

  .report:hover,
  .panel:hover {
    transform: translateY(-3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.5);
  }

  .login-panel:hover {
    transform: translateY(-2px);
  }
}

@media (prefers-color-scheme: light) and (hover: hover) {
  .report:hover,
  .panel:hover {
    box-shadow: 0 2px 4px rgba(60, 50, 30, 0.14), 0 16px 32px rgba(60, 50, 30, 0.18);
  }
}

/* ---------- 16. Reduced motion: all motion off ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .skip-link {
    transition: none;
  }
}

/* ---------- 17. Responsive ---------- */

@media (max-width: 900px) {
  .report:first-child .summary { grid-column: 1 / -1; }
  .report:first-child .impact,
  .report:first-child .source,
  .report:first-child .read-more { grid-column: 1 / -1; margin-left: 0; }

  .result-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  main,
  .masthead,
  .colophon {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .masthead {
    padding-top: var(--space-5);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .counts {
    grid-template-columns: repeat(2, 1fr);
  }

  .digest {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .report,
  .report:nth-child(2),
  .report:nth-child(3),
  .report:first-child {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    padding: var(--space-4) var(--space-4) var(--space-3);
  }

  .report:first-child .summary,
  .report:first-child .impact,
  .report:first-child .source,
  .report:first-child .read-more {
    grid-column: 1 / -1;
  }

  .search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form .field {
    flex-basis: auto;
  }

  .login-panel {
    margin-top: var(--space-6);
  }
}

/* ---------- 18. Print: the brief, on paper ---------- */

@media print {
  body {
    background: #ffffff;
    color: #000000;
    font-size: 11pt;
  }

  body::after,
  .site-nav,
  .skip-link {
    display: none;
  }

  .masthead {
    border-bottom: 1px solid #000;
  }

  .masthead::after {
    display: none;
  }

  .report,
  .panel,
  .login-panel,
  .count,
  .result-summary {
    background: #ffffff;
    color: #000000;
    border-color: #000000;
    box-shadow: none;
    animation: none;
  }

  .report,
  .panel {
    break-inside: avoid;
  }

  a {
    color: #000000;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
  }
}
