:root {
  --background: #f7f8f6;
  --foreground: #18201c;
  --card: #ffffff;
  --card-foreground: #18201c;
  --primary: #176b52;
  --primary-foreground: #ffffff;
  --secondary: #edf1ee;
  --secondary-foreground: #26332d;
  --muted-ui: #edf1ee;
  --muted-foreground: #657069;
  --accent-ui: #e5f1ec;
  --accent-foreground: #145943;
  --destructive: #a43e36;
  --border-ui: #dce3df;
  --ring: #27866a;
  --radius: 0.625rem;
  --radius-sm: calc(var(--radius) * 0.75);
  --radius-md: calc(var(--radius) * 0.875);
  --radius-xl: calc(var(--radius) * 1.5);
  --shadow-card: 0 1px 2px rgb(24 32 28 / 0.04), 0 8px 24px rgb(24 32 28 / 0.04);
  --theme-toggle-bg: var(--card);
  --theme-toggle-border: var(--border-ui);
  --theme-toggle-text: var(--muted-foreground);
  --theme-toggle-active: var(--foreground);
  --theme-toggle-focus: var(--ring);
}

:root[data-theme="dark"] {
  --background: #0d110f;
  --foreground: #eef3f0;
  --card: #151a17;
  --card-foreground: #eef3f0;
  --primary: #78d6b2;
  --primary-foreground: #09251b;
  --secondary: #202722;
  --secondary-foreground: #e4ebe7;
  --muted-ui: #202722;
  --muted-foreground: #a6b1aa;
  --accent-ui: #1b3028;
  --accent-foreground: #9be3c7;
  --destructive: #f19a91;
  --border-ui: #2c3530;
  --ring: #68c5a2;
  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.24), 0 12px 32px rgb(0 0 0 / 0.16);
}

:root[data-page="home"] {
  --bg: var(--background);
  --surface: var(--card);
  --ink: var(--foreground);
  --muted: var(--muted-foreground);
  --border: var(--border-ui);
  --line: var(--border-ui);
  --blue: var(--primary);
  --text: var(--secondary-foreground);
  --lede: var(--foreground);
  --inline-code: var(--muted-ui);
  --hover-border: var(--ring);
  color-scheme: light;
}

:root[data-page="home"][data-theme="dark"] {
  --faint: #8d9992;
  --panel: #090c0a;
  --panel-ink: #f1f5f2;
  --panel-muted: #87928b;
  --panel-border: #37423c;
  --panel-hover: #1c231f;
  --cta-hover: #9be3c7;
  color-scheme: dark;
}

:root[data-page="leaderboard"] {
  --ink: var(--foreground);
  --muted: var(--muted-foreground);
  --line: var(--border-ui);
  --accent: var(--primary);
  --error: var(--destructive);
  --bg: var(--background);
  color-scheme: light;
}

:root[data-page="leaderboard"][data-theme="dark"] {
  color-scheme: dark;
}

:root[data-page="report"] {
  --steel: var(--background);
  --surface: var(--card);
  --surface-2: var(--secondary);
  --line: var(--border-ui);
  --text: var(--foreground);
  --muted: var(--muted-foreground);
  --teal: var(--primary);
  --warn: #805f16;
  --danger: var(--destructive);
  color-scheme: light;
}

:root[data-page="report"][data-theme="dark"] {
  --warn: #e7bf72;
  color-scheme: dark;
}

:root[data-page="design-partners"] {
  color-scheme: light;
}

:root[data-page="design-partners"][data-theme="dark"] {
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: Geist, "Geist Fallback", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}

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

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-ui);
}

.site-nav__brand,
.site-nav__links {
  display: flex;
  align-items: center;
}

.site-nav__brand {
  gap: 9px;
  color: var(--foreground);
  font-weight: 650;
  text-decoration: none;
}

.site-nav__mark {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.site-nav__links {
  gap: 4px;
  margin-left: auto;
}

.site-nav__link {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted-foreground);
  font-size: 13px;
  text-decoration: none;
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  background: var(--accent-ui);
  color: var(--accent-foreground);
  text-decoration: none;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 32px;
  background: var(--theme-toggle-bg);
  color: var(--theme-toggle-text);
  border: 1px solid var(--theme-toggle-border);
  border-radius: 999px;
  padding: 6px 9px;
  font: 12px/1 Geist, "Geist Fallback", ui-sans-serif, sans-serif;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(24 32 28 / 0.04);
}

.theme-toggle:hover {
  border-color: var(--ring);
}

.theme-toggle .light-label {
  color: var(--theme-toggle-active);
  font-weight: 600;
}

.theme-toggle[aria-pressed="true"] .light-label {
  color: var(--theme-toggle-text);
  font-weight: 400;
}

.theme-toggle[aria-pressed="true"] .dark-label {
  color: var(--theme-toggle-active);
  font-weight: 600;
}

.theme-track {
  position: relative;
  width: 28px;
  height: 16px;
  background: var(--secondary);
  border: 1px solid var(--border-ui);
  border-radius: 999px;
}

.theme-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  background: var(--foreground);
  border-radius: 50%;
  transition: transform 0.18s ease;
}

.theme-toggle[aria-pressed="true"] .theme-knob {
  transform: translateX(12px);
}

/* Design partners: shared site shell, cards, badges, and button language. */
.partners-page {
  width: min(920px, calc(100% - 36px));
  margin: 0 auto;
  padding: 72px 0 80px;
}

.partners-hero {
  max-width: 780px;
  margin-bottom: 42px;
}

.partners-hero h1 {
  margin: 8px 0 18px;
  color: var(--foreground);
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.partners-lede {
  margin: 0;
  color: var(--secondary-foreground);
  font-size: 18px;
  line-height: 1.7;
}

.partners-lede strong {
  color: var(--foreground);
}

.pack-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.pack-card,
.partners-cta-card {
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.pack-card {
  padding: 24px;
}

.pack-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.pack-card h2,
.partners-cta-card h2 {
  margin: 0;
  color: var(--card-foreground);
  line-height: 1.3;
}

.pack-card h2 {
  font-size: 20px;
}

.pack-card p,
.partners-cta-card p {
  color: var(--secondary-foreground);
  line-height: 1.65;
}

.pack-card__note {
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border-ui);
  color: var(--muted-foreground) !important;
  font-size: 13px;
}

.partners-cta-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  margin-top: 16px;
  padding: 28px;
}

.partners-cta-card h2 {
  margin-bottom: 10px;
  font-size: 24px;
}

.partners-cta-card p {
  max-width: 680px;
  margin: 0;
}

:root[data-page="design-partners"] .cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgb(24 32 28 / 0.08);
}

:root[data-page="design-partners"] .cta:hover {
  background: var(--accent-foreground);
  color: var(--primary-foreground);
}

.partners-footer {
  width: min(920px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 48px;
  border-top: 1px solid var(--border-ui);
  color: var(--muted-foreground);
  font-size: 13px;
}

@media (max-width: 720px) {
  .site-nav {
    flex-wrap: wrap;
  }

  .site-nav__links {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
  }

  .pack-grid,
  .partners-cta-card {
    grid-template-columns: 1fr;
  }

  .partners-page {
    padding-top: 48px;
  }

  .partners-cta-card .cta {
    justify-self: start;
  }
}

/* Homepage: shadcn card, badge, button, and separator language. */
:root[data-page="home"] .pill,
:root[data-page="home"] .channel-card,
:root[data-page="home"] .download-card,
:root[data-page="home"] .offline,
:root[data-page="home"] .abstain,
:root[data-page="home"] .stats,
:root[data-page="home"] .memo-card,
:root[data-page="home"] .graph-card {
  border-color: var(--border-ui);
  border-radius: var(--radius);
}

:root[data-page="home"] .channel-card,
:root[data-page="home"] .download-card,
:root[data-page="home"] .offline,
:root[data-page="home"] .abstain,
:root[data-page="home"] .stats,
:root[data-page="home"] .memo-card,
:root[data-page="home"] .graph-card {
  background: var(--card);
  box-shadow: var(--shadow-card);
}

:root[data-page="home"] .pill {
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-weight: 550;
}

:root[data-page="home"] .channel-card:hover,
:root[data-page="home"] .download-card:hover {
  border-color: var(--ring);
  background: var(--accent-ui);
}

:root[data-page="home"] .cta {
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgb(24 32 28 / 0.08);
}

:root[data-page="home"] .cta:hover {
  background: var(--accent-foreground);
  color: var(--primary-foreground);
}

/* Homepage memo and evidence graphs. */
.memo-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-xl);
  background: var(--card);
}

.memo-card h2 {
  margin: 4px 0 7px;
}

.memo-card p {
  max-width: 560px;
  margin: 0;
}

.memo-card .cta {
  white-space: nowrap;
}

.eyebrow {
  display: block;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.graph-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.graph-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-xl);
  background: var(--card);
}

.graph-card--wide {
  grid-column: 1 / -1;
}

.graph-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.graph-card h3 {
  margin: 4px 0 18px;
  color: var(--card-foreground);
  font-size: 16px;
  line-height: 1.35;
}

.graph-total {
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid var(--border-ui);
  border-radius: 999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  font: 650 11px/1.4 Geist Mono, ui-monospace, monospace;
}

.outcome-chart {
  display: grid;
  gap: 13px;
}

.outcome-row {
  display: grid;
  grid-template-columns: 160px minmax(120px, 1fr) 48px;
  gap: 12px;
  align-items: center;
}

.outcome-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--secondary-foreground);
  font-size: 12px;
}

.outcome-label b,
.outcome-pct {
  font-family: Geist Mono, ui-monospace, monospace;
}

.outcome-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--muted-ui);
}

.outcome-bar {
  display: block;
  min-width: 5px;
  height: 100%;
  border-radius: inherit;
}

.outcome-bar--ranked {
  background: var(--primary);
}

.outcome-bar--unranked {
  border: 1px dashed var(--primary);
  background: color-mix(in srgb, var(--primary) 18%, transparent);
}

.outcome-bar--refused {
  background: var(--destructive);
}

.outcome-pct {
  color: var(--muted-foreground);
  font-size: 11px;
  text-align: right;
}

.graph-note {
  margin: 17px 0 0;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.55;
}

.coverage-chart {
  margin: 22px 0 0;
}

.coverage-scale {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted-foreground);
  font: 10px/1.4 Geist Mono, ui-monospace, monospace;
}

.coverage-track {
  position: relative;
  height: 16px;
  border: 1px solid var(--border-ui);
  border-radius: 999px;
  background: var(--muted-ui);
}

.coverage-fill {
  position: absolute;
  inset: -1px auto -1px -1px;
  min-width: 7px;
  border-radius: 999px;
  background: var(--destructive);
}

.coverage-threshold {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 2px;
  background: var(--foreground);
}

.coverage-threshold span {
  position: absolute;
  top: 27px;
  left: 50%;
  width: max-content;
  transform: translateX(-50%);
  color: var(--muted-foreground);
  font-size: 10px;
}

.coverage-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 30px;
}

.coverage-value b {
  color: var(--destructive);
  font: 700 26px/1 Geist Mono, ui-monospace, monospace;
}

.coverage-value span {
  color: var(--muted-foreground);
  font-size: 12px;
}

.calibration-flow {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.calibration-flow li {
  position: relative;
  min-height: 56px;
  padding: 0 0 16px 32px;
}

.calibration-flow li::before {
  position: absolute;
  top: 3px;
  left: 0;
  width: 13px;
  height: 13px;
  border: 2px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  content: "";
}

.calibration-flow li::after {
  position: absolute;
  top: 18px;
  bottom: 0;
  left: 7px;
  width: 1px;
  background: var(--border-ui);
  content: "";
}

.calibration-flow li:last-child::after {
  display: none;
}

.calibration-flow li.calibration-flow__future::before {
  border-style: dashed;
  background: var(--card);
}

.calibration-flow b,
.calibration-flow span {
  display: block;
}

.calibration-flow b {
  color: var(--card-foreground);
  font-size: 13px;
}

.calibration-flow span {
  margin-top: 2px;
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 680px) {
  .memo-card,
  .graph-grid {
    grid-template-columns: 1fr;
  }

  .memo-card {
    align-items: start;
  }

  .memo-card .cta {
    justify-self: start;
  }

  .outcome-row {
    grid-template-columns: 1fr 44px;
  }

  .outcome-label {
    grid-column: 1 / -1;
  }
}

/* Leaderboard: shadcn table, badges, cards, and evidence map. */
:root[data-page="leaderboard"] body {
  max-width: 1120px;
}

:root[data-page="leaderboard"] h1 {
  color: var(--foreground);
  letter-spacing: -0.025em;
}

:root[data-page="leaderboard"] h2 {
  color: var(--foreground);
  letter-spacing: -0.012em;
}

.table-shell {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-ui);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.table-shell table {
  min-width: 980px;
  margin: 0;
}

.table-shell th,
.table-shell td {
  border-color: var(--border-ui);
}

.table-shell th {
  background: var(--muted-ui);
  color: var(--muted-foreground);
}

.table-shell tbody tr:hover {
  background: var(--accent-ui);
}

:root[data-page="leaderboard"] .evidence-pill,
:root[data-page="leaderboard"] .low-confidence {
  border-radius: 999px;
  font-weight: 600;
}

:root[data-page="leaderboard"] .evidence-pill {
  border-color: var(--border-ui);
  background: var(--secondary);
  color: var(--secondary-foreground);
}

:root[data-page="leaderboard"] .evidence-pill:hover {
  border-color: var(--ring);
  background: var(--accent-ui);
  color: var(--accent-foreground);
}

:root[data-page="leaderboard"] .low-confidence {
  border-color: #b28a30;
  color: #785b14;
  background: #fff8df;
}

:root[data-page="leaderboard"][data-theme="dark"] .low-confidence {
  border-color: #a98534;
  color: #f0cf7f;
  background: #292315;
}

:root[data-page="leaderboard"] .incomplete-banner {
  border-radius: var(--radius);
}

:root[data-page="leaderboard"][data-theme="dark"] .incomplete-banner {
  color: #ffc2bd;
  background: #321b1b;
  border-color: #74403d;
}

:root[data-page="leaderboard"][data-theme="dark"] tr.error-row {
  background: #251818;
}

:root[data-page="leaderboard"] code {
  background: var(--muted-ui);
  color: var(--secondary-foreground);
}

.evidence-map-card {
  margin: 32px 0 40px;
  padding: 22px;
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow-card);
}

.evidence-map-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.evidence-map-card__header h2 {
  margin: 0 0 5px;
}

.evidence-map-card__header p,
.evidence-map-note {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

.shadcn-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid var(--border-ui);
  border-radius: 999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.evidence-map-scroll {
  overflow-x: auto;
  padding: 2px 2px 8px;
}

.evidence-map {
  position: relative;
  min-width: 720px;
  height: 390px;
}

.evidence-map__plot {
  position: absolute;
  inset: 18px 24px 48px 54px;
  border-left: 1px solid var(--border-ui);
  border-bottom: 1px solid var(--border-ui);
  background-image:
    linear-gradient(to right, var(--border-ui) 1px, transparent 1px),
    linear-gradient(to top, var(--border-ui) 1px, transparent 1px);
  background-size: 20% 100%, 100% 25%;
}

.evidence-map__axis-label,
.evidence-map__tick {
  position: absolute;
  color: var(--muted-foreground);
  font-size: 11px;
}

.evidence-map__axis-label--x {
  right: 24px;
  bottom: 0;
}

.evidence-map__axis-label--y {
  top: 0;
  left: 0;
}

.evidence-map__tick--y {
  left: -34px;
  bottom: var(--tick);
  transform: translateY(50%);
}

.evidence-map__tick--x {
  left: var(--tick);
  bottom: -28px;
  transform: translateX(-50%);
}

.evidence-point {
  position: absolute;
  left: var(--x);
  bottom: var(--y);
  z-index: 2;
  width: 13px;
  height: 13px;
  transform: translate(-50%, 50%);
  border: 2px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--card) 80%, transparent);
}

.evidence-point--unranked {
  background: var(--card);
  border-style: dashed;
}

.evidence-point__label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  display: none;
  width: max-content;
  max-width: 180px;
  transform: translateX(-50%);
  padding: 5px 8px;
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--card-foreground);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
  box-shadow: var(--shadow-card);
}

.evidence-point:hover,
.evidence-point:focus-visible {
  z-index: 4;
}

.evidence-point:hover .evidence-point__label,
.evidence-point:focus-visible .evidence-point__label {
  display: block;
}

.evidence-map-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 12px 0 8px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.evidence-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--primary);
  border-radius: 999px;
  background: var(--primary);
}

.legend-dot--hollow {
  background: var(--card);
  border-style: dashed;
}

/* Paired-dot comparison: canonical Code and Process sub-scores. */
.trust-comparison-card {
  margin: 32px 0 40px;
  padding: 22px;
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow-card);
}

.trust-comparison-scroll {
  overflow-x: auto;
  padding: 2px 2px 8px;
}

.trust-comparison {
  min-width: 720px;
}

.trust-row {
  display: grid;
  grid-template-columns: 150px minmax(360px, 1fr) 104px;
  gap: 14px;
  align-items: center;
}

.trust-scale {
  display: flex;
  justify-content: space-between;
  margin-right: 118px;
  margin-left: 164px;
  margin-bottom: 7px;
  color: var(--muted-foreground);
  font-size: 10px;
}

.trust-rows {
  border: 1px solid var(--border-ui);
  border-radius: var(--radius);
  overflow: hidden;
}

.trust-row {
  min-height: 38px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-ui);
}

.trust-row:last-child {
  border-bottom: 0;
}

.trust-row:hover {
  background: var(--accent-ui);
}

.trust-row--unranked {
  background: color-mix(in srgb, var(--muted-ui) 48%, transparent);
}

.trust-row__name {
  min-width: 0;
}

.trust-row__name a {
  display: block;
  overflow: hidden;
  color: var(--foreground);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  text-decoration: none;
  white-space: nowrap;
}

.trust-row__coverage {
  display: block;
  color: var(--muted-foreground);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trust-row__plot {
  position: relative;
  height: 20px;
  background-image: linear-gradient(to right, var(--border-ui) 1px, transparent 1px);
  background-size: 25% 100%;
  border-right: 1px solid var(--border-ui);
}

.trust-row__line {
  position: absolute;
  top: 9px;
  left: var(--start);
  width: var(--width);
  height: 2px;
  background: var(--muted-foreground);
  opacity: 0.55;
}

.trust-dot {
  position: absolute;
  top: 5px;
  left: var(--value);
  width: 10px;
  height: 10px;
  transform: translateX(-50%);
  border: 2px solid var(--card);
  border-radius: 999px;
  box-shadow: 0 0 0 1px currentColor;
}

.trust-dot--code,
.legend-dot--code {
  color: var(--primary);
  background: var(--primary);
  border-color: var(--primary);
}

.trust-dot--process,
.legend-dot--process {
  color: #5576c3;
  background: #5576c3;
  border-color: #5576c3;
}

:root[data-theme="dark"] .trust-dot--process,
:root[data-theme="dark"] .legend-dot--process {
  color: #8da9ed;
  background: #8da9ed;
  border-color: #8da9ed;
}

.trust-row__values {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted-foreground);
  font: 600 10px/1 Geist Mono, ui-monospace, monospace;
}

.legend-line {
  width: 18px;
  height: 2px;
  background: var(--muted-foreground);
}

/* Certificates: shadcn detail-page cards and status badges. */
:root[data-page="report"] .certificate {
  padding-top: 28px;
}

:root[data-page="report"] .hero,
:root[data-page="report"] .criterion,
:root[data-page="report"] .evidence-grid article {
  border-color: var(--border-ui);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

:root[data-page="report"] .meta div {
  border-color: var(--border-ui);
  border-radius: var(--radius-sm);
  background: var(--secondary);
}

:root[data-page="report"] .status {
  border-color: var(--border-ui);
  border-radius: 999px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  font-size: 11px;
  font-weight: 650;
}

:root[data-page="report"] code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--muted-ui);
}

.criterion-profile-card {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--border-ui);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow-card);
}

.criterion-profile-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.criterion-profile-card__header h2 {
  margin: 0 0 5px;
}

.criterion-profile-card__header p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

.criterion-profile-card__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.criterion-profile__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.criterion-profile__group {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border-ui);
  border-radius: var(--radius);
  background: var(--background);
}

.criterion-profile__group h3 {
  margin: 0 0 12px;
  font-size: 13px;
}

.criterion-profile__rows {
  display: grid;
  gap: 10px;
}

.criterion-profile__row {
  display: grid;
  grid-template-columns: minmax(150px, 1.35fr) minmax(120px, 1fr) 58px;
  gap: 10px;
  align-items: center;
}

.criterion-profile__label {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: baseline;
}

.criterion-profile__label strong {
  color: var(--primary);
  font: 700 11px/1 Geist Mono, ui-monospace, monospace;
}

.criterion-profile__label span {
  overflow: hidden;
  color: var(--foreground);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.criterion-profile__track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--muted-ui);
  box-shadow: inset 0 0 0 1px var(--border-ui);
}

.criterion-profile__track > span {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.criterion-profile__row--warning .criterion-profile__track > span {
  background: #b58123;
}

.criterion-profile__row--not_applicable .criterion-profile__track {
  background: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 4px,
    var(--border-ui) 4px,
    var(--border-ui) 6px
  );
}

.criterion-profile__row--insufficient_data .criterion-profile__track {
  border: 1px dashed var(--muted-foreground);
  background: transparent;
  box-shadow: none;
}

.criterion-profile__state {
  color: var(--muted-foreground);
  font: 650 10px/1 Geist Mono, ui-monospace, monospace;
  text-align: right;
}

.criterion-profile__row--verified .criterion-profile__state {
  color: var(--primary);
}

.criterion-profile__row--warning .criterion-profile__state {
  color: #8a6119;
}

:root[data-theme="dark"] .criterion-profile__row--warning .criterion-profile__state {
  color: #e6bb68;
}

@media (max-width: 720px) {
  .site-nav {
    width: min(100% - 28px, 1120px);
    gap: 10px;
  }

  .site-nav__brand span:last-child,
  .site-nav__links .site-nav__link:first-child {
    display: none;
  }

  .evidence-map-card {
    margin-inline: -8px;
    padding: 16px;
  }

  .trust-comparison-card,
  .criterion-profile-card {
    padding: 16px;
  }

  .evidence-map-card__header {
    display: block;
  }

  .evidence-map-card__header .shadcn-badge {
    margin-top: 10px;
  }

  .criterion-profile-card__header {
    display: block;
  }

  .criterion-profile-card__badges {
    justify-content: flex-start;
    margin-top: 10px;
  }

  .criterion-profile__grid {
    grid-template-columns: 1fr;
  }

  .criterion-profile__row {
    grid-template-columns: minmax(130px, 1fr) minmax(100px, 1fr) 54px;
  }
}

/* Both charts below position their data marks with percentage left/bottom offsets
   (--x/--y/--value/--start/--width) against a hardcoded 720px-wide container, scrolled via
   overflow-x:auto. On a ~390pt phone that puts most marks off the initial viewport with no
   affordance that there is more to scroll to — they read as missing, not merely unscrolled.
   Below this width the containers go fully fluid (min-width:0; width:100%) instead: the
   percentage-based marks reposition themselves against the narrower box for free, so the whole
   chart fits without requiring horizontal scroll on the phone widths this targets. */
@media (max-width: 560px) {
  .evidence-map-scroll,
  .trust-comparison-scroll {
    overflow-x: visible;
    padding: 2px 0 8px;
  }

  .evidence-map {
    min-width: 0;
    width: 100%;
    height: 340px;
  }

  .evidence-map__plot {
    inset: 16px 10px 40px 32px;
  }

  .evidence-map__tick--y {
    left: -24px;
    font-size: 10px;
  }

  .evidence-map__axis-label--y {
    font-size: 10px;
  }

  .evidence-point__label {
    max-width: 130px;
  }

  .trust-comparison {
    min-width: 0;
    width: 100%;
  }

  .trust-row {
    grid-template-columns: 72px minmax(0, 1fr) 46px;
    gap: 8px;
  }

  .trust-scale {
    margin-left: 80px;
    margin-right: 54px;
  }

  .trust-row__name a {
    font-size: 11px;
  }

  .trust-row__values {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    font-size: 9px;
  }
}

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

  .theme-knob {
    transition: none;
  }
}


/* One shared nav is mounted on every page (theme.js). On the homepage the brand mark
   would duplicate the hero logo, so only the links and the theme toggle are shown. */
[data-page="home"] .site-nav__brand { display: none; }
[data-page="home"] .site-nav { border-bottom: 0; }
