/* Geist foundations, implemented with native HTML controls for this independent lab.
   Source references and component contract: /docs/design-system.md. */
@font-face {
  font-family: 'Geist';
  src: url('/vendor/geist-sans.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/vendor/geist-mono.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --font-geist-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-geist-mono: 'Geist Mono', 'SFMono-Regular', Consolas, monospace;
  --ds-background-100: #0a0a0a;
  --ds-background-200: #111113;
  --ds-gray-100: #19191c;
  --ds-gray-200: #232327;
  --ds-gray-300: #29292f;
  --ds-gray-400: #333339;
  --ds-gray-500: #45454e;
  --ds-gray-600: #5f606b;
  --ds-gray-700: #797a86;
  --ds-gray-800: #9697a2;
  --ds-gray-900: #adadb7;
  --ds-gray-1000: #ededf1;
  --ds-blue-100: #0d2038;
  --ds-blue-200: #112b4d;
  --ds-blue-400: #234777;
  --ds-blue-700: #5da6ff;
  --ds-blue-800: #77b6ff;
  --ds-blue-900: #83bdff;
  --ds-blue-1000: #cfe5ff;
  --ds-teal-100: #102822;
  --ds-teal-200: #15362e;
  --ds-teal-400: #226254;
  --ds-teal-700: #58d4b8;
  --ds-teal-800: #68dfc4;
  --ds-teal-900: #75e4ca;
  --ds-teal-1000: #cbf5e9;
  --ds-amber-100: #2a2115;
  --ds-amber-400: #654721;
  --ds-amber-700: #efa84d;
  --ds-amber-900: #ffc477;
  --ds-red-100: #2b1519;
  --ds-red-400: #6f3039;
  --ds-red-700: #f66b77;
  --ds-red-900: #ff9da5;
  --ds-purple-700: #a781ef;
  --ds-purple-900: #c4a8f9;
  --background: var(--ds-background-100);
  --foreground: var(--ds-gray-1000);
  --muted: var(--ds-gray-900);
  --border: var(--ds-gray-400);
  --accent: var(--ds-blue-700);
  --chart-peer: #747d90;
  --chart-distance-low: #35445c;
  --chart-selected: #e9f2ff;
  --chart-sample: #78ade8;
  --radius: 6px;
  --radius-lg: 12px;
  --shadow-small: 0 1px 2px rgb(0 0 0 / 4%);
  --shadow-menu: 0 4px 12px rgb(0 0 0 / 38%), 0 16px 32px rgb(0 0 0 / 28%);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  font-family: var(--font-geist-sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--foreground); background: var(--background); font-size: 14px; line-height: 1.5; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(26px, 3vw, 40px); line-height: 1.12; letter-spacing: -.045em; }
h2 { font-size: 20px; line-height: 1.3; letter-spacing: -.025em; }
h3 { font-size: 15px; line-height: 1.4; letter-spacing: -.015em; }
small { font-size: 12px; }
a { color: var(--ds-blue-900); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--ds-gray-400);
  border-radius: var(--radius);
  background: var(--ds-background-100);
  color: var(--foreground);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms var(--ease-out);
}
button:hover, .button:hover { background: var(--ds-gray-100); border-color: var(--ds-gray-500); text-decoration: none; }
button:active, .button:active { transform: scale(.98); }
button:disabled, button[aria-disabled='true'], .button[aria-disabled='true'] { opacity: .5; cursor: not-allowed; transform: none; }
.button-primary, button.primary { color: var(--ds-background-100); background: var(--foreground); border-color: var(--foreground); }
.button-primary:hover, button.primary:hover { color: var(--ds-background-100); background: var(--ds-gray-900); border-color: var(--ds-gray-900); }
.button-secondary { background: var(--ds-background-100); }
.button-quiet { background: transparent; border-color: transparent; color: var(--muted); }
button svg, .button svg { width: 16px; height: 16px; flex: 0 0 auto; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--ds-blue-700); outline-offset: 3px; }
input:not([type='checkbox'], [type='radio'], [type='range']), select, textarea {
  min-height: 36px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ds-gray-400);
  border-radius: var(--radius);
  background: var(--ds-background-100);
  box-shadow: var(--shadow-small);
  font-size: 13px;
}
input::placeholder, textarea::placeholder { color: var(--ds-gray-900); opacity: 1; }
input:not([type='checkbox'], [type='radio'], [type='range']):hover, select:hover, textarea:hover { border-color: var(--ds-gray-500); }
input:disabled, select:disabled, textarea:disabled { background: var(--ds-background-200); color: var(--muted); cursor: not-allowed; }
input[type='checkbox'], input[type='radio'] { accent-color: var(--foreground); width: 15px; height: 15px; margin: 0; cursor: pointer; flex: 0 0 auto; }
input[type='range'] { accent-color: var(--foreground); width: 100%; min-height: 24px; margin: 0; cursor: pointer; }
label { cursor: pointer; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; margin-bottom: 10px; padding: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
summary { cursor: pointer; font-weight: 500; }
details > :not(summary) { margin-top: 12px; }
dialog { background: var(--ds-background-200); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; max-width: min(560px, calc(100vw - 32px)); color: var(--foreground); box-shadow: var(--shadow-menu); }
dialog::backdrop { background: rgb(0 0 0 / 30%); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-weight: 500; }
.app-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 max(28px, calc((100vw - 1440px) / 2));
  border-bottom: 1px solid var(--border);
  background: var(--ds-background-100);
}
.app-brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; color: var(--foreground); font-size: 14px; font-weight: 600; letter-spacing: -.025em; text-decoration: none; }
.app-brand:hover { text-decoration: none; }
.app-brand svg { width: 24px; height: 24px; }
.app-brand span { color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.app-nav { display: flex; align-self: stretch; align-items: stretch; gap: 22px; min-width: 0; }
.app-nav a { position: relative; display: flex; align-items: center; padding: 0 1px; color: var(--muted); font-size: 13px; white-space: nowrap; text-decoration: none; }
.app-nav a:hover { color: var(--foreground); }
.app-nav a[aria-current='page'] { color: var(--foreground); }
.app-nav a[aria-current='page']::after { content: ''; position: absolute; inset: auto 0 -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--foreground); }
.app-header > .badge { margin-left: auto; flex-shrink: 0; }
.app-shell { width: min(1440px, calc(100% - 56px)); margin: 0 auto; padding: 32px 0 40px; }
.page-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.page-intro p:not(.eyebrow) { max-width: 66ch; color: var(--muted); font-size: 14px; line-height: 1.6; margin-top: 12px; }
.eyebrow { margin-bottom: 10px; font-family: var(--font-geist-mono); font-size: 11px; font-weight: 400; line-height: 1.5; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.panel { min-width: 0; background: var(--ds-background-100); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.panel-heading h2, .panel-heading h3 { font-size: 14px; line-height: 1.4; }
.panel-heading p { margin-top: 4px; font-size: 12px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .field > span { font-size: 12px; font-weight: 500; }
.muted { color: var(--muted); }
.numeric, output { font-variant-numeric: tabular-nums; }
.numeric { font-family: var(--font-geist-mono); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--ds-background-200); color: var(--muted); font-size: 11px; line-height: 16px; white-space: nowrap; }
.segmented { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--ds-gray-100); border: 1px solid var(--ds-gray-200); border-radius: 8px; }
.segmented button { min-height: 28px; padding: 3px 10px; background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.segmented button:hover { color: var(--foreground); }
.segmented button[aria-pressed='true'], .segmented button[aria-selected='true'] { color: var(--foreground); background: var(--ds-background-100); border-color: var(--border); box-shadow: var(--shadow-small); }
.empty-state { padding: 36px 24px; color: var(--muted); font-size: 13px; text-align: center; }
.notice { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--ds-background-200); font-size: 13px; line-height: 1.6; }
.notice[role='alert'] { background: var(--ds-red-100); border-color: var(--ds-red-400); color: var(--ds-red-900); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-150%); padding: 8px 14px; color: var(--background); background: var(--foreground); border-radius: var(--radius); }
.skip-link:focus { transform: translateY(0); }
.page-footer { display: flex; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; line-height: 1.6; }
.page-footer a { color: inherit; }
.chart-axis { color: var(--ds-gray-600); font-family: var(--font-geist-mono); font-size: 10px; }
.chart-axis text { fill: var(--muted); }
.chart-axis .domain { stroke: var(--border); }
.chart-grid line { stroke: var(--ds-gray-200); stroke-opacity: .75; shape-rendering: crispEdges; }
.chart-grid .domain { display: none; }
.chart-tooltip { position: absolute; z-index: 10; max-width: 240px; padding: 9px 11px; background: var(--ds-background-100); border: 1px solid var(--border); border-radius: var(--radius); color: var(--foreground); box-shadow: var(--shadow-menu); font-size: 12px; line-height: 1.5; pointer-events: none; }
.chart-tooltip strong { display: block; font-weight: 600; }

/* Home-only composition. The two tools own the layout inside their workspaces. */
.home-shell { max-width: 1120px; padding-top: 68px; }
.home-intro { max-width: 800px; margin-bottom: 40px; }
.home-intro h1 { font-size: clamp(32px, 4.5vw, 50px); letter-spacing: -.052em; line-height: 1.08; }
.home-intro > p:last-child { max-width: 620px; margin-top: 18px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.home-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.home-tool { display: flex; flex-direction: column; min-width: 0; background: var(--ds-background-100); }
.home-tool + .home-tool { border-left: 1px solid var(--border); }
.home-tool-heading { padding: 26px 28px 0; }
.home-tool-heading > .eyebrow { margin-bottom: 16px; }
.home-tool-heading h2 { font-size: 24px; letter-spacing: -.035em; }
.home-tool-heading > p:last-child { min-height: 66px; margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.home-figure { margin: 16px 0 0; }
.home-figure svg { display: block; width: 100%; height: auto; overflow: visible; }
.home-figure figcaption { margin: 0 28px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.home-tool-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; padding: 24px 28px 28px; }
.home-tool-bottom > span { color: var(--muted); font-size: 11px; }
.home-evidence { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 25px 0; margin-top: 14px; border-bottom: 1px solid var(--border); }
.home-evidence > div { display: flex; flex-direction: column; gap: 4px; padding-right: 24px; }
.home-evidence > div + div { border-left: 1px solid var(--border); padding-left: 28px; }
.home-evidence dt { order: 1; font-size: 12px; color: var(--muted); }
.home-evidence dd { margin: 0; font-family: var(--font-geist-mono); font-size: 21px; line-height: 1.3; letter-spacing: -.04em; }
.home-method { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: start; padding-top: 24px; }
.home-method p { max-width: 730px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.home-method a { font-size: 12px; white-space: nowrap; }
@media (max-width: 1000px) {
  .app-header { gap: 24px; padding-inline: 24px; }
  .app-header > .badge { display: none; }
  .app-shell { width: calc(100% - 40px); }
  .app-nav { gap: 18px; }
}
@media (max-width: 700px) {
  .app-header { padding: 16px 20px 0; flex-wrap: wrap; gap: 10px 20px; }
  .app-brand { min-height: 24px; }
  .app-nav { flex-basis: 100%; gap: 22px; min-height: 44px; overflow-x: auto; scrollbar-width: none; }
  .app-nav::-webkit-scrollbar { display: none; }
  .app-nav a { flex-shrink: 0; font-size: 12px; }
  .app-shell { width: calc(100% - 32px); padding-top: 24px; }
  .page-intro { flex-direction: column; gap: 16px; margin-bottom: 22px; }
  .page-intro h1 { font-size: 28px; }
  .page-intro p:not(.eyebrow) { font-size: 13px; }
  .panel-heading { padding: 16px; }
  button, .button, input:not([type='checkbox'], [type='radio'], [type='range']), select { min-height: 40px; }
  .segmented button { min-height: 34px; }
  .home-shell { padding-top: 38px; }
  .home-intro { margin-bottom: 28px; }
  .home-intro h1 { font-size: clamp(30px, 7.4vw, 44px); }
  .home-intro > p:last-child { font-size: 14px; }
  .home-tools { grid-template-columns: minmax(0, 1fr); }
  .home-tool + .home-tool { border-left: 0; border-top: 1px solid var(--border); }
  .home-tool-heading { padding: 24px 22px 0; }
  .home-tool-heading h2 { font-size: 23px; }
  .home-tool-heading > p:last-child { min-height: auto; }
  .home-figure figcaption { margin-inline: 22px; }
  .home-tool-bottom { padding: 22px; flex-wrap: wrap; }
  .home-tool-bottom > span { max-width: 120px; }
  .home-evidence { gap: 16px; }
  .home-evidence > div { padding-right: 0; }
  .home-evidence > div + div { padding-left: 16px; }
  .home-evidence dd { font-size: 19px; }
  .home-evidence dt { font-size: 11px; }
  .home-method { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .page-footer { margin-top: 24px; }
}
@media (pointer: coarse) {
  button, .button, input:not([type='checkbox'], [type='radio'], [type='range']), select { min-height: 44px; }
  .segmented button { min-height: 38px; }
  input[type='range'] { min-height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  button:active, .button:active { transform: none; }
}

.sources-shell { max-width: 760px; }
.sources-shell p, .sources-shell ul { margin-block: 16px 24px; color: var(--muted); line-height: 1.65; }
.sources-shell li + li { margin-top: 8px; }
