:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --panel: #ffffff;
  --ink: #182026;
  --muted: #66717c;
  --line: #d8dee4;
  --teal: #147d74;
  --teal-soft: #dff3ef;
  --amber: #b26900;
  --amber-soft: #fff2d8;
  --rose: #b42345;
  --rose-soft: #ffe6eb;
  --blue: #2f6fbb;
  --violet: #6a56c9;
  --shadow: 0 18px 45px rgba(24, 32, 38, 0.09);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 1040px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1480px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.1;
}

h2 {
  font-size: 15px;
  line-height: 1.3;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-picker,
button,
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.file-picker,
button {
  min-height: 40px;
  padding: 9px 13px;
  font-weight: 700;
}

#matrixCatalog {
  min-height: 40px;
  max-width: 280px;
  padding: 8px 10px;
  font-weight: 700;
}

.file-picker input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.summary div,
.details,
.toolbar,
.lane {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary div {
  padding: 16px;
  box-shadow: var(--shadow);
}

.summary span {
  display: block;
  font-size: 24px;
  font-weight: 800;
}

.summary small,
.lane-heading span,
.details small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 220px 180px 180px;
  gap: 10px;
  padding: 12px;
  margin-bottom: 14px;
}

.coverage-panel {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.meter-copy strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.meter-copy span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.meter {
  height: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--rose-soft);
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width 180ms ease;
}

.toolbar input,
.toolbar select {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  background: #fbfcfd;
  color: var(--ink);
}

.view-tabs {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.tab {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 7px 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  background: var(--ink);
  color: #ffffff;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) 190px minmax(340px, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: 620px;
}

.lane {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.lane-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.node-list {
  height: 566px;
  overflow: auto;
  padding: 12px;
}

.group {
  margin-bottom: 14px;
}

.group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.node {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  text-align: left;
  cursor: pointer;
}

.node:hover,
.node.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.node.related {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.node.uncovered {
  border-color: rgba(180, 35, 69, 0.38);
  background: #fff8f9;
}

.node.uncovered .count {
  background: var(--rose-soft);
  color: var(--rose);
}

.node.no-links {
  border-color: rgba(178, 105, 0, 0.45);
  background: #fffaf0;
}

.node.no-links .count {
  background: var(--amber-soft);
  color: var(--amber);
}

.node.dimmed {
  opacity: 0.38;
}

.node strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node span {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.count {
  min-width: 32px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #e9eef4;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.graph-wrap {
  position: relative;
  min-height: 620px;
  overflow: hidden;
}

.edge-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.edge {
  fill: none;
  stroke: rgba(47, 111, 187, 0.22);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.edge.active {
  stroke: var(--rose);
  stroke-width: 3;
}

.edge.high {
  stroke: rgba(47, 111, 187, 0.34);
  stroke-width: 2;
}

.circle-panel {
  min-height: 720px;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.circle-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.circle-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.circle-graph {
  display: block;
  width: 100%;
  height: 666px;
  background: #fbfcfd;
}

.circle-link {
  fill: none;
  stroke: rgba(47, 111, 187, 0.1);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.circle-link.active {
  stroke: var(--rose);
  stroke-width: 2.6;
}

.circle-node {
  cursor: pointer;
}

.circle-node circle {
  stroke: #ffffff;
  stroke-width: 2;
}

.circle-node.file circle {
  fill: var(--teal);
}

.circle-node.file.uncovered circle {
  fill: var(--rose);
}

.circle-node.test circle {
  fill: var(--blue);
}

.circle-node.test.no-links circle {
  fill: var(--amber);
}

.circle-node.active circle {
  stroke: var(--ink);
  stroke-width: 4;
}

.circle-node.related circle {
  stroke: var(--amber);
  stroke-width: 4;
}

.circle-node.dimmed,
.circle-link.dimmed,
.circle-label.dimmed {
  opacity: 0.18;
}

.circle-label {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}

.circle-label.muted {
  fill: var(--muted);
}

.circle-empty {
  fill: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-anchor: middle;
}

.details {
  margin-top: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.details h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

.details p {
  color: var(--muted);
  line-height: 1.5;
}

.details-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: #fbfcfd;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.empty {
  padding: 26px 14px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  body {
    min-width: 0;
  }

  .shell {
    width: min(100% - 24px, 760px);
  }

  .topbar,
  .actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary,
  .coverage-panel,
  .toolbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .circle-panel {
    min-height: 560px;
  }

  .circle-graph {
    height: 520px;
  }

  .graph-wrap {
    display: none;
  }
}
