:root {
  color-scheme: dark;
  --bg: #0a0d0e;
  --panel: #101517;
  --panel2: #151b1d;
  --line: #2a3335;
  --soft: #bdc8c3;
  --muted: #7f8b87;
  --text: #f1f5f2;
  --accent: #a4cfb9;
  --green: #8fc6a6;
  --yellow: #d7b86d;
  --red: #dc928b;
  --display: Bahnschrift, "Arial Narrow", "Segoe UI Variable", sans-serif;
  --body: "Segoe UI Variable", Aptos, "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Code", Consolas, monospace;
}

html { background: var(--bg); scroll-behavior: smooth; }
body {
  min-height: 100dvh;
  background:
    linear-gradient(rgba(164, 207, 185, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 100% 52px;
  font-family: var(--body);
  -webkit-tap-highlight-color: rgba(164,207,185,.15);
}
button, a, input, select, textarea { touch-action: manipulation; }

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 40; padding: 10px 14px;
  border-radius: 4px; color: #07100c; background: #c4e1d2; font-weight: 800;
  transform: translateY(-160%); transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  min-height: 62px;
  padding: 10px 18px;
  background: rgba(10,13,14,.94);
  border-bottom-color: rgba(211,229,219,.12);
  box-shadow: 0 14px 44px rgba(0,0,0,.22);
}
.mark {
  width: 36px; height: 36px; flex-basis: 36px; border-radius: 4px;
  border: 1px solid #36413d; background-size: 230% auto;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 8px 24px rgba(0,0,0,.32);
}
.brand strong { font-family: var(--display); font-size: 19px; }
.brand .small { margin-top: 3px; }

.btn {
  min-height: 38px; padding: 8px 11px; border-radius: 4px; border-color: #303a3d;
  background: #141a1c; font-weight: 720;
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease;
}
.btn:hover { transform: translateY(-1px); border-color: #53615d; background: #1a2224; }
.btn:active { transform: translateY(1px); }
.btn.primary { color: #07100c; border-color: var(--accent); background: var(--accent); }
.btn.primary:hover { border-color: #c4e1d2; background: #c4e1d2; }

main { width: min(1540px,100%); padding: 28px 28px 56px; gap: 18px; }
.heading { align-items: flex-start; padding: 18px 0 8px; }
h1 {
  margin-bottom: 10px; font-family: var(--display); font-size: 52px; line-height: 1;
  font-weight: 760; text-wrap: balance;
}
.heading p { max-width: 760px; }
.heading-actions { align-items: flex-end; }
.toggle { min-height: 38px; padding: 8px 10px; border: 1px solid #303a3d; background: #101517; }

.pipeline {
  grid-template-columns: 1.15fr 1.15fr .8fr;
  border-radius: 6px; border-color: #2d383a; background: #0f1416;
}
.pipeline-step { min-height: 94px; padding: 17px 18px; border-right-color: #2d383a; }
.pipeline-step strong { font-family: var(--display); font-size: 14px; }
.step-number {
  width: 29px; height: 29px; border-radius: 3px; border-color: #496157;
  background: #15201b; font-family: var(--mono); font-size: 11px;
}

.metrics {
  border-radius: 0; border-inline: 0; border-color: #2a3335;
}
.metric { min-height: 105px; padding: 18px 20px; background: rgba(13,17,18,.68); border-right-color: #2a3335; }
.metric b, .coverage-item b { font-family: var(--display); font-variant-numeric: tabular-nums; }
.metric b { margin-top: 8px; font-size: 34px; }

.coverage { gap: 0; border-block: 1px solid #263033; }
.coverage-item {
  min-height: 84px; padding: 14px 16px; border: 0; border-right: 1px solid #263033;
  border-radius: 0; background: #0c1112;
}
.coverage-item:last-child { border-right: 0; }
.coverage-item b { font-size: 23px; }

.panel { border-radius: 6px; border-color: #2a3335; background: #101517; }
.panel-head { padding: 16px 18px; border-bottom-color: #2a3335; }
.panel-head h2 { font-family: var(--display); font-size: 18px; }
.form, .bulk-form { padding: 18px; }

.field {
  min-height: 42px; border-radius: 4px; border-color: #303a3c; background: #090d0e;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}
.field:hover { border-color: #46524f; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(164,207,185,.11); }
select.field { color-scheme: dark; }

.file-drop, .import-preview, .import-report {
  border-radius: 4px; border-color: #35413e; background: #0b1011;
}
.file-drop { min-height: 112px; }
.file-drop.dragging { border-color: var(--accent); background: #121d18; }
.pill { border-radius: 3px; font-family: var(--mono); font-size: 10px; }
.status-guide { padding: 12px 18px; border-bottom-color: #2a3335; background: #0c1112; }
.toolbar { padding: 12px 18px; border-bottom-color: #2a3335; }
.table-wrap { scrollbar-color: #41504b #0a0e0f; }
table { font-variant-numeric: tabular-nums; }
th {
  position: sticky; top: 0; z-index: 2; color: #7f8b87; background: #0b1011;
  font-family: var(--mono); font-size: 9px;
}
td { border-bottom-color: #222b2d; }
tbody tr { transition: background-color 130ms ease; }
tbody tr:hover { background: #131b1b; }
.notice, .toast { border-radius: 4px; }
.toast { background: #141a1c; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.empty { min-height: 180px; display: grid; place-items: center; background: #0d1213; }

:focus-visible { outline: 2px solid #c4e1d2; outline-offset: 3px; }

@media (max-width: 900px) {
  main { padding: 20px 16px 44px; }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline-step { border-right: 0; border-bottom: 1px solid #2d383a; }
  .coverage { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .coverage-item { border-bottom: 1px solid #263033; }
}

@media (max-width: 640px) {
  .topbar { position: relative; display: grid; grid-template-columns: 1fr; padding: 12px; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .actions .btn { width: 100%; }
  main { padding: 16px 10px 36px; gap: 12px; }
  .heading { padding-top: 8px; }
  h1 { font-size: 38px; }
  .heading-actions { width: 100%; grid-template-columns: 1fr; }
  .toggle { justify-content: center; }
  .pipeline-step { min-height: 82px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 88px; padding: 13px; }
  .metric b { font-size: 28px; }
  .coverage { grid-template-columns: 1fr 1fr; }
  .coverage-item { padding: 12px; }
  .form, .bulk-form { padding: 14px; }
  .panel-head { align-items: flex-start; }
  .toolbar { grid-template-columns: 1fr; }
  .import-report { grid-template-columns: 1fr 1fr; }
}

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