:root {
  color-scheme: light dark;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #5f6673;
  --border: #d8dee9;
  --blue: #2563eb;
  --green: #107c41;
  --amber: #b45309;
  --red: #b42318;
  --shadow: 0 18px 55px rgb(15 23 42 / 10%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f172a;
    --surface: #172033;
    --text: #f8fafc;
    --muted: #bcc7d8;
    --border: #314158;
    --shadow: 0 18px 55px rgb(0 0 0 / 30%);
  }
}

:root[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #172033;
  --text: #f8fafc;
  --muted: #bcc7d8;
  --border: #314158;
  --shadow: 0 18px 55px rgb(0 0 0 / 30%);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--blue); }
button, input, select { font: inherit; }
button { border: 0; border-radius: 999px; background: var(--blue); color: white; padding: .75rem 1rem; cursor: pointer; font-weight: 650; }
button:hover, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); outline-offset: 2px; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.danger { background: transparent; color: var(--red); border: 1px solid currentColor; }
input, select { width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: .8rem .9rem; background: var(--surface); color: var(--text); }
main { width: min(1180px, calc(100% - 2rem)); margin: -3rem auto 4rem; display: grid; gap: 1.25rem; }
.hero { background: radial-gradient(circle at top right, #60a5fa 0, #2563eb 35%, #13294b 100%); color: white; padding: 1rem 1rem 6rem; }
.topbar, .hero__content { width: min(1180px, 100%); margin: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.topbar a { color: white; }
.topbar__actions { display: flex; align-items: center; gap: .75rem; }
.hero__content { padding: 5rem 0 2rem; }
.hero h1 { max-width: 820px; font-size: clamp(2.4rem, 6vw, 5rem); line-height: .95; margin: .25rem 0 1rem; letter-spacing: -.04em; }
.hero p { max-width: 760px; font-size: 1.15rem; color: rgb(255 255 255 / 88%); }
.eyebrow { margin: 0 0 .35rem; color: var(--blue); text-transform: uppercase; letter-spacing: .11em; font-size: .78rem; font-weight: 750; }
.hero .eyebrow { color: #bfdbfe; }
.panel, .table-shell, .summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); padding: 1.25rem; }
.panel h2, .table-shell h2 { margin: 0 0 .35rem; }
.vendor-panel { display: grid; gap: 1rem; }
.vendor-form label { font-weight: 700; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: end; margin-top: .4rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; min-height: 2rem; }
.tag { background: color-mix(in srgb, var(--blue) 12%, var(--surface)); color: var(--text); border: 1px solid color-mix(in srgb, var(--blue) 45%, var(--border)); }
.note { color: var(--muted); margin: 0; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.summary-card strong { display: block; font-size: 2rem; }
.summary-card span, .summary-card small { display: block; color: var(--muted); }
.category-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.category-summary article { border: 1px solid var(--border); border-radius: 18px; padding: 1rem; }
.category-summary h3 { margin: 0 0 .65rem; }
.category-summary div { display: flex; gap: .5rem; flex-wrap: wrap; }
.category-summary span { background: var(--bg); border-radius: 999px; padding: .35rem .6rem; }
.control-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: .85rem; align-items: end; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.check input { width: auto; }
.plan-visibility { border: 1px solid var(--border); border-radius: 18px; padding: .85rem 1rem 1rem; margin: 1rem 0 0; }
.plan-visibility legend { font-weight: 700; padding: 0 .35rem; }
.view-toggle { display: inline-flex; align-items: center; gap: .55rem; border: 0; padding: 0; margin: 0; }
.view-toggle legend { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.view-toggle__description { display: inline-flex; align-items: center; min-height: 1.9rem; color: var(--muted); font-size: .9rem; font-weight: 750; line-height: 1; }
.check-list { display: flex; flex-wrap: wrap; gap: .85rem; }
.switch { display: inline-flex; align-items: center; min-height: 1.9rem; cursor: pointer; }
.switch input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.switch__track { position: relative; inline-size: 3.75rem; block-size: 1.9rem; flex: 0 0 auto; border: 0; border-radius: 999px; background: var(--muted); transition: background-color .15s ease; }
.switch__thumb { position: absolute; inset-block-start: .18rem; inset-inline-start: .18rem; inline-size: 1.54rem; block-size: 1.54rem; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgb(0 0 0 / 22%); transition: transform .15s ease; }
.switch:has(input:checked) .switch__track { background: #2f7d20; }
.switch:has(input:checked) .switch__thumb { transform: translateX(1.85rem); }
.switch:has(input:focus-visible) .switch__track { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); outline-offset: 2px; }
.tabs, .action-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.tabs button { background: transparent; color: var(--text); border: 1px solid var(--border); }
.tabs button[aria-selected="true"] { background: var(--blue); color: white; }
.table-headline { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: .85rem; flex-wrap: wrap; }
.table-actions .note { display: inline-flex; align-items: center; min-height: 1.9rem; margin: 0; line-height: 1; }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 980px; border-collapse: collapse; }
caption { text-align: left; color: var(--muted); padding: .5rem 0 1rem; }
th, td { border-top: 1px solid var(--border); padding: .8rem; text-align: left; vertical-align: top; }
thead th { background: color-mix(in srgb, var(--blue) 8%, var(--surface)); position: sticky; top: 0; z-index: 1; }
tbody th small { display: block; color: var(--amber); margin-top: .2rem; }
.matched-row { background: color-mix(in srgb, var(--amber) 12%, var(--surface)); }
tbody tr { border-left: 4px solid transparent; }
tbody tr.status-covered { border-left-color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--surface)); }
tbody tr.status-not-needed { border-left-color: var(--muted); opacity: .78; }
tbody tr.status-gap { border-left-color: var(--red); background: color-mix(in srgb, var(--red) 10%, var(--surface)); }
tbody tr.matched-row.status-unchecked { background: color-mix(in srgb, var(--amber) 12%, var(--surface)); }
.parent-row th { padding: .55rem .8rem; background: color-mix(in srgb, var(--blue) 9%, var(--surface)); border-top: 1px solid var(--border); }
.parent-row .collapse { width: 100%; display: flex; align-items: center; gap: .55rem; background: transparent; color: var(--text); border-radius: 8px; padding: .35rem .45rem; text-align: left; }
.parent-row .collapse span:nth-child(2) { font-weight: 750; }
.parent-row .collapse small { margin-left: auto; color: var(--muted); font-weight: 650; }
.grouped-row th:first-child { padding-left: 2.25rem; }
.coverage { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; border-radius: 999px; padding: .28rem .58rem; font-size: .88rem; line-height: 1.2; border: 1px solid currentColor; }
.coverage.included { color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); }
.coverage.partial { color: var(--amber); background: color-mix(in srgb, var(--amber) 10%, transparent); }
.coverage.not-included { min-width: 6.75rem; color: var(--red); background: transparent; }
.manual-vendor { min-width: 12rem; }
.skip-link { position: absolute; left: -999px; background: var(--surface); padding: .7rem; z-index: 3; }
.skip-link:focus { left: 1rem; top: 1rem; }
.load-error { margin: 1rem; padding: 1rem; border: 1px solid var(--red); color: var(--red); background: var(--surface); }
footer { width: min(1180px, calc(100% - 2rem)); margin: 0 auto 2rem; color: var(--muted); font-size: .95rem; }

@media (max-width: 900px) {
  .summary-grid, .control-grid { grid-template-columns: 1fr; }
  .input-row { grid-template-columns: 1fr; }
  .table-actions { justify-content: flex-start; }
  main { margin-top: -2rem; }
}
