:root {
  --navy: #172554;
  --navy-2: #0f172a;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #dbe3ef;
  --panel: #ffffff;
  --canvas: #f4f7fb;
  --accent: #f5b400;
  --accent-2: #d97706;
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --info: #0369a1;
  --radius: 18px;
  --shadow: 0 16px 45px rgba(15, 23, 42, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(245, 180, 0, .12), transparent 28rem),
    var(--canvas);
  line-height: 1.55;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: white; padding: .7rem 1rem; z-index: 20;
}
.skip-link:focus { left: .8rem; top: .8rem; }

.hero {
  background: linear-gradient(135deg, var(--navy-2), var(--navy));
  color: white;
  padding: 2rem clamp(1rem, 4vw, 4rem);
  border-bottom: 5px solid var(--accent);
}
.hero__inner { max-width: 1240px; margin: 0 auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-size: .78rem; color: #fde68a; font-weight: 800; }
h1 { margin: .35rem 0 .6rem; font-size: clamp(2rem, 4vw, 3.7rem); line-height: 1.05; }
.hero p { max-width: 850px; color: #dbeafe; margin: 0; }

.lab-shell { max-width: 1240px; margin: 1.4rem auto 4rem; padding: 0 1rem; }
.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: minmax(260px, .78fr) minmax(0, 1.7fr); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid > * { min-width: 0; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-top: 0; color: var(--navy); }
.card h2 { font-size: 1.15rem; }
.card h3 { font-size: 1rem; }

.controls { display: grid; gap: 1rem; }
.control { display: grid; gap: .35rem; }
.control label, .control legend { font-weight: 750; color: #334155; }
.control small { color: var(--muted); }
.control__row { display: flex; justify-content: space-between; gap: .75rem; align-items: center; }
.value-pill { font-variant-numeric: tabular-nums; background: #eef2ff; color: var(--navy); padding: .15rem .55rem; border-radius: 999px; font-weight: 800; }
input[type="range"] { width: 100%; accent-color: var(--navy); }
select, input[type="number"], input[type="text"] {
  width: 100%; padding: .7rem .75rem; border: 1px solid #cbd5e1; border-radius: 11px; background: white;
}
.checkbox-row { display: flex; gap: .65rem; align-items: flex-start; margin: .4rem 0; }
.checkbox-row input { margin-top: .25rem; accent-color: var(--navy); }
input, select, textarea { max-width: 100%; }
.control__row { flex-wrap: wrap; }
button:disabled, select:disabled, input:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }

.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .4rem; }
.btn {
  border: 0; border-radius: 12px; padding: .72rem 1rem; font-weight: 800;
  background: var(--navy); color: white; box-shadow: 0 7px 18px rgba(23,37,84,.18);
}
.btn:hover { filter: brightness(1.08); }
.btn--accent { background: var(--accent); color: #2a2100; }
.btn--ghost { background: #eef2ff; color: var(--navy); box-shadow: none; }
.btn--danger { background: var(--bad); }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: .7rem; }
.metric { background: #f8fafc; border: 1px solid var(--line); border-radius: 14px; padding: .8rem; }
.metric__label { color: var(--muted); font-size: .78rem; font-weight: 700; }
.metric__value { display: block; color: var(--navy); font-size: 1.35rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.metric__hint { color: var(--muted); font-size: .76rem; }

.section-title { display: flex; align-items: center; gap: .65rem; margin: 1.1rem 0 .6rem; }
.section-title::before { content: ""; width: 11px; height: 28px; border-radius: 4px; background: var(--accent); }
.section-title h2 { margin: 0; font-size: 1.22rem; color: var(--navy); }

.explanation {
  border-left: 5px solid var(--accent); background: #fffbeb; padding: .9rem 1rem; border-radius: 0 12px 12px 0;
}
.explanation strong { color: #7c4a03; }
.status-good { color: var(--good); }
.status-warn { color: var(--warn); }
.status-bad { color: var(--bad); }
.status-info { color: var(--info); }

.bar-list { display: grid; gap: .7rem; }
.bar-item { display: grid; grid-template-columns: 150px 1fr 55px; gap: .65rem; align-items: center; }
.bar-track { height: 14px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--navy), var(--accent)); border-radius: inherit; transition: width .35s ease; }

.pipeline { display: flex; gap: .65rem; align-items: stretch; overflow-x: auto; padding-bottom: .35rem; }
.pipeline__node {
  min-width: 150px; flex: 1; padding: .85rem; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; text-align: center;
}
.pipeline__node strong { display: block; color: var(--navy); }
.pipeline__arrow { display: grid; place-items: center; color: var(--accent-2); font-size: 1.7rem; font-weight: 900; }

.log {
  min-height: 120px; max-height: 250px; overflow: auto; background: #07111f; color: #d1fae5;
  border-radius: 14px; padding: .8rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem; white-space: pre-wrap;
}

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
table { border-collapse: collapse; width: 100%; min-width: 620px; background: white; }
th, td { padding: .65rem .7rem; border-bottom: 1px solid var(--line); text-align: left; }
th { background: #eef2ff; color: var(--navy); position: sticky; top: 0; }
td { font-variant-numeric: tabular-nums; }

.tag { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .18rem .55rem; background: #eef2ff; color: var(--navy); font-size: .76rem; font-weight: 800; }
.tag--good { background: #dcfce7; color: #166534; }
.tag--warn { background: #fef3c7; color: #92400e; }
.tag--bad { background: #fee2e2; color: #991b1b; }

.footer-nav { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-top: 1.4rem; }
.footer-nav a { text-decoration: none; font-weight: 800; color: var(--navy); }

@media (max-width: 880px) {
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .bar-item { grid-template-columns: 105px 1fr 48px; }
  .pipeline { flex-direction: column; }
  .pipeline__arrow { transform: rotate(90deg); }
}

.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;
}

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

.day-bars{display:grid;grid-template-columns:repeat(24,minmax(24px,1fr));align-items:end;gap:3px;height:210px;padding:.7rem;border-left:1px solid var(--line);border-bottom:1px solid var(--line);overflow-x:auto}.day-bar{min-width:24px;background:linear-gradient(180deg,var(--accent),var(--navy));border-radius:5px 5px 0 0;position:relative}.day-bar span{position:absolute;bottom:-1.55rem;font-size:.62rem;left:50%;transform:translateX(-50%)}.provider-card{border:1px solid var(--line);border-radius:14px;padding:.8rem;background:#f8fafc}.provider-card--winner{outline:3px solid var(--accent);background:#fffbeb}
.provider-card--disqualified{opacity:.55;border-style:dashed}

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

textarea {
  width: 100%; padding: .7rem .75rem; border: 1px solid #cbd5e1; border-radius: 11px;
  background: white; font-family: inherit; resize: vertical;
}

.obj-list { margin: .4rem 0 0; padding-left: 1.2rem; display: grid; gap: .35rem; }
.obj-list li { color: var(--ink); }

.hypothesis-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.model-note { color: var(--muted); font-size: .84rem; margin: .3rem 0 .8rem; }

.evidence-box {
  width: 100%; min-height: 200px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .84rem; white-space: pre-wrap; background: #f8fafc;
}

.continuity { border-left: 5px solid var(--info); }
.continuity p { margin: .4rem 0; }

@media (max-width: 880px) {
  .hypothesis-grid { grid-template-columns: 1fr; }
}
