:root {
  --current: #2a9c90;
  --current-dark: #237e75;
  --current-soft: #e7f4f2;
  --ink: #1d2524;
  --ink-soft: #536865;
  --signal: #de5139;
  --signal-soft: #fbe9e5;
  --paper: #f5f8f7;
  --white: #ffffff;
  --line: #dfe7e5;
  --muted: #78908c;
  --font-heading: "Schibsted Grotesk";
  --font-body: "Hanken Grotesk";
  --font-mono: "JetBrains Mono";
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body), "Hanken Grotesk", sans-serif; }
body.drawer-open { overflow: hidden; }
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(42, 156, 144, .25); outline-offset: 2px; }
.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; }

.dashboard { width: 100%; min-height: 100vh; padding: 28px clamp(20px, 3.5vw, 56px) 0; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 34px; }
.title-lockup { display: flex; align-items: center; }
.title-lockup h1 { margin: 0; font: 720 clamp(24px, 2.3vw, 36px)/1.08 var(--font-heading), sans-serif; letter-spacing: -.045em; }
.header-actions { display: flex; align-items: center; gap: 14px; }
.release-picker { min-height: 52px; padding: 6px 10px 6px 14px; display: grid; grid-template-columns: auto auto; align-items: center; gap: 10px; background: var(--white); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 2px 6px rgba(26, 49, 44, .06); }
.release-picker > span { color: var(--muted); text-transform: uppercase; font: 700 9px/1 var(--font-mono), monospace; letter-spacing: .07em; }
.release-picker select { min-height: 36px; padding: 0 30px 0 10px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; font-weight: 700; cursor: pointer; }
.release-picker select:disabled { cursor: wait; opacity: .7; }
.export-top, .tracked-badge { min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; font-weight: 700; }
.export-top { color: var(--ink); background: var(--white); border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(26, 49, 44, .06); cursor: pointer; }
.export-top:hover { border-color: var(--current); color: var(--current-dark); }
.tracked-badge { background: var(--current); color: #fff; box-shadow: 0 5px 12px rgba(42, 156, 144, .2); }

.summary-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 28px; }
.summary-card { min-width: 0; min-height: 190px; padding: 24px 26px 22px; text-align: left; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 5px rgba(31, 54, 49, .04); color: var(--ink); cursor: pointer; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.summary-card:hover { transform: translateY(-2px); box-shadow: 0 7px 18px rgba(31, 54, 49, .07); }
.summary-card.selected { border-color: var(--current); box-shadow: 0 0 0 2px rgba(42, 156, 144, .12); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-icon { min-width: 42px; height: 42px; padding: 0 10px; display: grid; place-items: center; background: var(--current-soft); color: var(--current); border-radius: 10px; font: 750 18px/1 var(--font-mono), monospace; }
.card-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.people-plus { width: 24px; height: 24px; position: relative; display: block; }
.people-plus::before { content: ""; width: 7px; height: 7px; position: absolute; left: 3px; top: 3px; border: 2px solid currentColor; border-radius: 50%; }
.people-plus::after { content: ""; width: 12px; height: 7px; position: absolute; left: 0; bottom: 2px; border: 2px solid currentColor; border-bottom: 0; border-radius: 10px 10px 0 0; }
.people-plus b { position: absolute; right: 0; top: 5px; font: 700 15px/1 var(--font-mono), monospace; }
.people-plus i { display: none; }
.card-label { padding: 6px 10px; color: var(--current-dark); background: var(--current-soft); border-radius: 5px; text-transform: uppercase; font: 700 11px/1 var(--font-mono), monospace; letter-spacing: .04em; }
.summary-card > strong { display: block; margin-top: 22px; font: 720 38px/.9 var(--font-heading), sans-serif; letter-spacing: -.045em; }
.summary-card > p { margin: 12px 0 20px; color: #607791; font-size: 15px; }
.summary-card > i { display: block; width: 100%; height: 6px; overflow: hidden; background: #edf2f1; border-radius: 6px; }
.summary-card > i b { display: block; height: 100%; border-radius: inherit; background: var(--current); }
.tone-green .card-icon, .tone-green .card-label { background: #e6f7f1; color: #168e68; }
.tone-green > i b { background: #168e68; }
.tone-ink .card-icon, .tone-ink .card-label { background: #edf1f0; color: var(--ink); }
.tone-ink > i b { background: var(--ink-soft); }
.tone-gray .card-icon, .tone-gray .card-label { background: #eef2f5; color: #66798f; }
.tone-gray > i b { background: #91a3b6; }

.analysis-grid { display: grid; grid-template-columns: minmax(300px, .65fr) minmax(0, 1.35fr); gap: 22px; margin-bottom: 28px; }
.panel, .registry { background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 5px rgba(31, 54, 49, .035); }
.panel { min-width: 0; min-height: 360px; padding: 27px 30px; }
.panel h2, .registry-toolbar h2 { margin: 0; display: flex; align-items: center; gap: 10px; font: 690 20px/1.2 var(--font-heading), sans-serif; letter-spacing: -.025em; }
.panel h2 > span, .registry-toolbar h2 > span { color: var(--current); font-family: var(--font-mono), monospace; }
.severity-panel { display: flex; flex-direction: column; }
.severity-row { margin-top: 26px; padding: 0; border: 0; background: transparent; cursor: pointer; text-align: left; }
.severity-row > span { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #40536a; }
.severity-row > span b { font-weight: 600; }
.severity-row > span strong { color: var(--ink); }
.severity-row > i { display: block; height: 9px; margin-top: 9px; background: #f0f3f3; border-radius: 8px; overflow: hidden; }
.severity-row > i b { display: block; height: 100%; border-radius: inherit; background: var(--current); }
.severity-row > i .bar-critical { background: var(--signal); }
.severity-row > i .bar-moderate { background: #8ba09c; min-width: 3px; }
.severity-row[aria-pressed="true"] > span b { color: var(--current-dark); }
.severity-row[aria-pressed="true"] > i { box-shadow: 0 0 0 2px rgba(42, 156, 144, .12); }
.severity-row[aria-pressed="true"] > i .bar-critical { box-shadow: 0 0 0 2px rgba(222, 81, 57, .12); }
.breakdown-content { min-width: 0; min-height: 290px; display: grid; grid-template-columns: minmax(150px, .72fr) minmax(0, 1.28fr); align-items: center; gap: clamp(20px, 2.5vw, 44px); padding: 18px 0 0; }
.donut { width: min(195px, 100%); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; position: relative; }
.donut::before { content: ""; position: absolute; width: 67%; height: 67%; border-radius: 50%; background: var(--white); }
.donut > div { position: relative; display: flex; flex-direction: column; align-items: center; }
.donut strong { font: 720 33px/1 var(--font-heading), sans-serif; letter-spacing: -.04em; }
.donut span { margin-top: 8px; color: #8ba0b8; text-transform: uppercase; font: 700 10px/1 var(--font-mono), monospace; letter-spacing: .08em; }
.breakdown-content ul { min-width: 0; list-style: none; padding: 0; margin: 0; }
.breakdown-content li { min-width: 0; min-height: 34px; display: grid; grid-template-columns: 11px minmax(0, 1fr) auto; align-items: center; gap: 11px; color: #415469; font-size: 13px; }
.breakdown-content li i { width: 10px; height: 10px; border-radius: 50%; }
.breakdown-content li span { min-width: 0; overflow-wrap: anywhere; }
.breakdown-content li strong { color: var(--ink); font: 650 12px/1 var(--font-mono), monospace; }

.registry { margin-bottom: 28px; overflow: hidden; }
.registry-toolbar { min-height: 84px; padding: 18px 28px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.registry-toolbar h2 { margin-right: 8px; white-space: nowrap; }
.registry-toolbar h2::after { content: ""; width: 1px; height: 34px; margin-left: 8px; background: var(--line); }
.registry-toolbar label:not(.registry-search) { width: 190px; min-height: 42px; display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfc; }
.registry-toolbar label:nth-of-type(2) { width: 240px; }
select { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); cursor: pointer; }
.registry-search { margin-left: auto; width: min(320px, 30vw); min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 13px; background: #f8faf9; border: 1px solid var(--line); border-radius: 8px; color: #8ba0b8; }
.registry-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.registry-search input::placeholder { color: #96a5b4; }
.registry-count { min-height: 42px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); color: var(--muted); font: 550 11px/1 var(--font-mono), monospace; }
.registry-count strong { color: var(--ink); }
.registry-count button { border: 0; background: transparent; color: var(--current-dark); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.registry-table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 980px; border-collapse: collapse; table-layout: fixed; }
th { padding: 15px 28px; text-align: left; color: #6f829a; background: #fbfcfc; border-bottom: 1px solid var(--line); text-transform: uppercase; font: 700 10px/1 var(--font-mono), monospace; letter-spacing: .075em; }
th:nth-child(1) { width: 16%; } th:nth-child(2) { width: 10%; } th:nth-child(3) { width: 17%; } th:nth-child(4) { width: 23%; } th:nth-child(5) { width: 27%; } th:nth-child(6) { width: 7%; }
td { height: 74px; padding: 14px 28px; border-bottom: 1px solid #edf1f0; color: #3d536b; font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdfc; }
td:first-child a { color: var(--ink); text-decoration: none; font: 700 12px/1 var(--font-mono), monospace; }
td:first-child a:hover { color: var(--current-dark); text-decoration: underline; text-underline-offset: 3px; }
.severity-badge { display: inline-flex; min-height: 25px; align-items: center; padding: 0 9px; background: var(--current-soft); border: 1px solid #badbd6; border-radius: 99px; color: var(--current-dark); font-size: 11px; font-weight: 700; }
.severity-critical { color: var(--signal); background: var(--signal-soft); border-color: #efb4a9; }
.severity-moderate { color: #5f7470; background: #edf2f1; border-color: #d4dfdd; }
.product-summary { min-width: 0; display: flex; align-items: center; gap: 7px; }
.product-summary > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-summary small { flex: 0 0 auto; padding: 3px 6px; color: var(--current-dark); background: var(--current-soft); border-radius: 4px; font: 700 9px/1 var(--font-mono), monospace; }
.credit-list { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.credit-list-compact { flex-flow: row wrap; gap: 6px 10px; }
.credit-entry { min-width: 0; display: inline-flex; align-items: center; gap: 5px; color: #3d536b; }
.credit-list-compact .credit-entry { max-width: 100%; }
.credit-name { min-width: 0; overflow-wrap: anywhere; }
.credit-list-compact .credit-name { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.credit-info { width: 17px; height: 17px; flex: 0 0 17px; padding: 0; display: inline-grid; place-items: center; position: relative; color: var(--current-dark); background: var(--current-soft); border: 1px solid #b6d9d4; border-radius: 50%; cursor: help; font: 750 10px/1 var(--font-mono), monospace; }
.credit-info:hover, .credit-info:focus-visible { color: #fff; background: var(--current); border-color: var(--current); outline: none; }
.credit-tooltip { width: max-content; max-width: 190px; min-height: 34px; padding: 8px 10px; position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(3px); display: flex; align-items: center; gap: 5px; color: #fff; background: var(--ink); border-radius: 6px; box-shadow: 0 7px 18px rgba(20, 40, 36, .18); opacity: 0; visibility: hidden; pointer-events: none; white-space: nowrap; font: 500 11px/1.2 var(--font-body), sans-serif; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
.credit-tooltip::after { content: ""; width: 7px; height: 7px; position: absolute; left: 50%; bottom: -3px; transform: translateX(-50%) rotate(45deg); background: var(--ink); }
.credit-tooltip strong { color: #7ed0c7; font: 750 11px/1 var(--font-mono), monospace; }
.credit-info:hover .credit-tooltip, .credit-info:focus .credit-tooltip { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.no-credit { color: var(--muted); font-style: italic; }
.registry-table-wrap th:last-child, .registry-table-wrap td:last-child { padding-inline: 14px; text-align: center; }
.view-button { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #7f9bb8; cursor: pointer; font-size: 17px; }
.view-button:hover { color: var(--current-dark); background: var(--current-soft); border-color: #c8e0dc; }
.pagination { min-height: 66px; padding: 0 28px; display: flex; align-items: center; justify-content: center; gap: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.pagination button { border: 0; background: transparent; color: var(--current-dark); font-weight: 700; cursor: pointer; }
.pagination button:disabled { color: #b8c4c1; cursor: default; }
.pagination strong { color: var(--ink); }
.table-message { min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }
.table-message strong { color: var(--ink); font-size: 18px; }

footer { min-height: 78px; padding: 0 2px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 12px; }
footer a { color: var(--current-dark); }

.drawer-backdrop { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; background: rgba(20, 34, 31, .55); }
.detail-drawer { width: min(520px, 94vw); height: 100%; overflow-y: auto; padding: 50px 44px; background: var(--white); box-shadow: -15px 0 40px rgba(15, 34, 30, .16); position: relative; }
.drawer-close { position: absolute; top: 20px; right: 20px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); cursor: pointer; font-size: 24px; }
.eyebrow { margin: 0 0 16px; color: var(--current-dark); text-transform: uppercase; font: 700 10px/1 var(--font-mono), monospace; letter-spacing: .08em; }
.detail-drawer h2 { margin: 0; font: 720 44px/1 var(--font-heading), sans-serif; letter-spacing: -.055em; }
.drawer-impact { margin: 14px 0 22px; color: var(--ink-soft); font-size: 17px; }
.drawer-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.drawer-tags > span:not(.severity-badge) { padding: 6px 9px; color: var(--current-dark); background: var(--current-soft); border-radius: 5px; font-size: 12px; }
.detail-drawer dl { margin: 0 0 30px; }
.detail-drawer dl > div { padding: 22px 0; border-bottom: 1px solid var(--line); }
.detail-drawer dt { margin-bottom: 8px; color: var(--muted); text-transform: uppercase; font: 700 10px/1 var(--font-mono), monospace; letter-spacing: .07em; }
.detail-drawer dd { margin: 0; color: var(--ink); line-height: 1.55; overflow-wrap: anywhere; }
.product-list { margin: 0; padding-left: 18px; }
.product-list li + li { margin-top: 6px; }
.drawer-link { min-height: 48px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; background: var(--current); color: #fff; border-radius: 7px; text-decoration: none; font-weight: 700; }

@media (max-width: 1120px) {
  .summary-cards { grid-template-columns: 1fr 1fr; }
  .analysis-grid { grid-template-columns: 1fr; }
  .breakdown-panel { min-height: auto; }
  .registry-toolbar { flex-wrap: wrap; }
  .registry-search { width: 100%; max-width: none; margin-left: 0; }
}

@media (max-width: 720px) {
  .dashboard { padding-inline: 14px; }
  .dashboard-header { align-items: flex-start; flex-direction: column; }
  .header-actions { width: 100%; flex-wrap: wrap; }
  .release-picker { width: 100%; grid-template-columns: auto minmax(0, 1fr); }
  .release-picker select { width: 100%; }
  .export-top, .tracked-badge { flex: 1; }
  .summary-cards { grid-template-columns: 1fr; }
  .summary-card { min-height: 175px; }
  .panel { padding: 24px 20px; }
  .breakdown-content { grid-template-columns: 1fr; gap: 28px; }
  .registry-toolbar { align-items: stretch; padding: 18px; }
  .registry-toolbar h2 { width: 100%; }
  .registry-toolbar h2::after { display: none; }
  .registry-toolbar label:not(.registry-search), .registry-toolbar label:nth-of-type(2) { width: 100%; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; }
  .detail-drawer { padding-inline: 26px; }
}

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