/* HazardLedger design system — light, cool-clean, soft (fleet house style: no
   dark backgrounds, nothing techy/robotic, soft rounded corners, clean sans,
   no monospace). Identity hue: a deep safety-orange, distinct from every
   sibling site, used restrained for the brand mark, primary actions, and the
   score/severity accents. Verdict bands stay green / amber / red. WCAG 2.1 AA. */

:root {
  --bg: #f4f5f7;          /* cool-neutral canvas */
  --surface: #ffffff;     /* cards */
  --surface-2: #f7f8fa;   /* inset fills */
  --band: #eef1f4;        /* footer / tinted band */
  --border: #e2e6eb;
  --border-2: #d5dae1;
  --text: #1c2530;        /* cool slate ink (not blue-black, not pure black) */
  --muted: #5a6673;       /* ~5.3:1 on --bg */
  --faint: #8a939e;

  --accent: #c2410c;      /* deep safety orange — 5.9:1 on white */
  --accent-soft: #fbeee6; /* orange tint for soft fills */
  --accent-ink: #ffffff;  /* text on --accent */

  --clear: #158043;       /* Clear Record */
  --clear-bg: #e7f4ec;
  --clear-ink: #10693a;
  --some: #9a6a00;        /* Some Concerns */
  --some-bg: #faf1d9;
  --some-ink: #855a00;
  --high: #c0362b;        /* High Risk */
  --high-bg: #fbeae8;
  --high-ink: #ad2a20;

  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(20, 30, 45, .04), 0 2px 8px rgba(20, 30, 45, .05);
  --shadow-sm: 0 1px 2px rgba(20, 30, 45, .06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --maxw: 960px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
}
/* No monospace anywhere — code/kbd render in the same soft sans. */
code, kbd, samp, pre { font-family: var(--font); font-size: .95em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5em; color: var(--text); }
h1 { font-size: 1.9rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Header / footer */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text); font-size: 1.15rem; letter-spacing: -0.03em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); display: inline-block; box-shadow: inset 0 0 0 3px rgba(255,255,255,.28); }
.nav a { color: var(--muted); margin-left: 18px; font-size: .93rem; }
.nav a:hover { color: var(--text); }
.site-footer { border-top: 1px solid var(--border); background: var(--band); margin-top: 56px; padding: 30px 0; color: var(--muted); font-size: .85rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.footer-links { margin-bottom: .8em; }
.footer-fineprint { color: var(--muted); max-width: 78ch; }
.footer-copyright { color: var(--faint); margin-top: .6em; }

/* Buttons + form */
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); font-weight: 600; padding: 11px 18px; border-radius: var(--radius); border: 0; cursor: pointer; font-size: .95rem; box-shadow: var(--shadow-sm); }
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-2); box-shadow: none; }
.btn.secondary:hover { background: var(--surface-2); filter: none; }
.search { display: flex; gap: 8px; flex-wrap: wrap; }
.search input[type=text], .search select, input.field, textarea.field, select.field {
  background: var(--surface); border: 1px solid var(--border-2); color: var(--text);
  border-radius: var(--radius); padding: 12px 14px; font-size: 1rem; font-family: var(--font);
}
.search input[type=text] { flex: 1 1 320px; min-width: 0; }
.search input:focus, .field:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
label { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 5px; }

/* Hero / search page */
.hero { padding: 52px 0 34px; }
.hero h1 { font-size: 2.4rem; max-width: 18ch; }
.hero .lede { color: var(--muted); font-size: 1.15rem; max-width: 60ch; }

/* Cards + panels */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin: 16px 0; box-shadow: var(--shadow-sm); }
.grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } }

/* ---- Verdict card: score + percentile + confidence, always together ---- */
.verdict { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.verdict .band-strip { height: 6px; }
.verdict.band-clear .band-strip { background: var(--clear); }
.verdict.band-some_concerns .band-strip { background: var(--some); }
.verdict.band-high_risk .band-strip { background: var(--high); }
.verdict.band-unrated .band-strip { background: var(--border-2); }
.verdict-body { display: flex; gap: 22px; padding: 22px; flex-wrap: wrap; align-items: center; }
.score-dial { flex: 0 0 auto; text-align: center; min-width: 120px; }
.score-num { font-size: 3.4rem; font-weight: 750; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.band-clear .score-num { color: var(--clear); }
.band-some_concerns .score-num { color: var(--some); }
.band-high_risk .score-num { color: var(--high); }
.band-unrated .score-num { color: var(--muted); font-size: 1.4rem; }
.score-outof { color: var(--faint); font-size: .8rem; }
.band-pill { display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 999px; font-size: .82rem; font-weight: 650; }
.band-clear .band-pill { background: var(--clear-bg); color: var(--clear-ink); }
.band-some_concerns .band-pill { background: var(--some-bg); color: var(--some-ink); }
.band-high_risk .band-pill { background: var(--high-bg); color: var(--high-ink); }
.band-unrated .band-pill { background: var(--surface-2); color: var(--muted); }
.verdict-main { flex: 1 1 300px; min-width: 0; }
.verdict-main h2 { font-size: 1.35rem; margin-bottom: 3px; }
.verdict-sub { color: var(--muted); font-size: .95rem; margin-bottom: 12px; }

/* percentile bar */
.pctile { margin: 10px 0; }
.pctile .track { height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.pctile .fill { height: 100%; background: var(--accent); }
.pctile .cap { font-size: .82rem; color: var(--muted); margin-top: 5px; }

/* confidence footer — visually distinct; limited/unverified must NOT read clean */
.confidence-footer { border-top: 1px solid var(--border); padding: 12px 22px; font-size: .85rem; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.conf-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; margin-top: 5px; }
.conf-strong .conf-dot { background: var(--clear); }
.conf-limited-data { background: repeating-linear-gradient(45deg, var(--some-bg), var(--some-bg) 10px, #fbf5e4 10px, #fbf5e4 20px); color: var(--text); }
.conf-limited-data .conf-dot { background: var(--some); }
.conf-unmatched { background: var(--high-bg); color: var(--text); }
.conf-unmatched .conf-dot { background: var(--high); }

/* Severity + citation table */
.sev { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.sev-willful, .sev-failure_to_abate { background: var(--high-bg); color: var(--high-ink); }
.sev-repeat { background: var(--accent-soft); color: var(--accent); }
.sev-serious { background: var(--some-bg); color: var(--some-ink); }
.sev-other, .sev-unclassified { background: var(--surface-2); color: var(--muted); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
.tabular { font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }

/* misc */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tag { display: inline-block; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px; font-size: .8rem; color: var(--muted); margin: 0 6px 6px 0; }
.callout { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; font-size: .92rem; color: var(--text); }
.dispute-link { color: var(--muted); font-size: .85rem; text-decoration: underline; }
.notice { background: var(--some-bg); border: 1px solid #ecd9a6; color: var(--some-ink); padding: 10px 14px; border-radius: var(--radius); font-size: .9rem; }
.result-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.result-row:last-child { border-bottom: 0; }
.result-row a { color: var(--text); font-weight: 600; }
.mini-band { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.mini-band.band-clear { background: var(--clear-bg); color: var(--clear-ink); }
.mini-band.band-some_concerns { background: var(--some-bg); color: var(--some-ink); }
.mini-band.band-high_risk { background: var(--high-bg); color: var(--high-ink); }
.mini-band.band-unrated { background: var(--surface-2); color: var(--muted); }

/* Directory browse grid */
.dir-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
@media (min-width: 560px) { .dir-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 820px) { .dir-grid { grid-template-columns: 1fr 1fr 1fr; } }
.dir-cell { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.dir-cell:hover { border-color: var(--border-2); text-decoration: none; }
.dir-cell .dir-name { color: var(--text); font-weight: 600; }

/* Embed code input + preformatted blocks */
.embed-input { width: 100%; min-width: 320px; font-size: .82rem; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); }
pre { display: block; padding: 12px 14px; margin: 0; white-space: pre; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); font-size: .82rem; line-height: 1.5; }

/* Compare table: first column is the metric label */
.compare-table th[scope="row"] { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.compare-table td { font-size: .92rem; }
