:root {
  color-scheme: dark;
  --void: #080c14;
  --deep: #0f1420;
  --nebula: #151d2e;
  --panel: rgba(15, 20, 32, 0.96);
  --panel-raised: rgba(21, 29, 46, 0.96);
  --ink: #f0f4ff;
  --muted: #b6c2d7;
  --soft: #d7e2f5;
  --line: rgba(148, 163, 184, 0.32);
  --line-strong: rgba(34, 211, 238, 0.48);
  --violet: #7c3aed;
  --pulse: #a78bfa;
  --cyan: #22d3ee;
  --green: #6ee7b7;
  --amber: #fcd34d;
  --red: #fb7185;
  --blue: #60a5fa;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(34, 211, 238, 0.026) 1px, transparent 1px),
    linear-gradient(0deg, rgba(167, 139, 250, 0.026) 1px, transparent 1px),
    linear-gradient(180deg, var(--void) 0%, #101725 58%, #071019 100%);
  background-size: 36px 36px, 36px 36px, auto;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
button, input, select { font: inherit; }

.app-shell {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.site-header,
.decision-band,
.control-band,
.workbench,
.comparison-band,
.source-band,
.coverage-band {
  margin-top: 16px;
}

.site-header,
.decision-band,
.control-band,
.workbench,
.viz-panel,
.detail-panel,
.comparison-band,
.source-band,
.coverage-band,
.heatmap-wrap,
.svg-stage {
  min-width: 0;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  border: 1px solid rgba(240, 244, 255, 0.12);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #051018;
  font-weight: 950;
  box-shadow: 6px 6px 0 rgba(34, 211, 238, 0.16);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.2rem;
  line-height: 1.05;
  color: var(--ink);
}

.brand small,
.muted,
.kicker,
label span,
.source-note,
.meter-row small,
.row-sub,
.axis-label {
  color: var(--muted);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.78rem;
  font-weight: 900;
}

.site-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(21, 29, 46, 0.72);
  padding: 7px 10px;
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  border-color: var(--line-strong);
  outline: none;
}

.header-stats,
.hero-metrics,
.coverage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.stat,
.chip,
.confidence-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(21, 29, 46, 0.94);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.stat strong { color: var(--green); }

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 20px;
  align-items: end;
  padding: 26px 0 8px;
}

.kicker {
  margin: 0 0 6px;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 980px;
  margin-bottom: 12px;
  font-size: 3.2rem;
  line-height: 0.98;
}

.hero-copy {
  max-width: 760px;
  margin: 0;
  color: var(--soft);
  font-size: 1.05rem;
  line-height: 1.5;
}

h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
  line-height: 1.08;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.decision-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(21, 29, 46, 0.86), rgba(8, 12, 20, 0.82)),
    var(--panel);
  box-shadow: var(--shadow);
}

.decision-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.decision-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(8, 12, 20, 0.64);
  color: var(--ink);
  text-align: left;
}

.decision-card:hover,
.decision-card.selected {
  border-color: var(--line-strong);
  background:
    linear-gradient(180deg, rgba(34, 211, 238, 0.1), rgba(8, 12, 20, 0.7)),
    rgba(8, 12, 20, 0.74);
}

.decision-kicker,
.decision-source {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1.2;
  text-transform: uppercase;
}

.decision-name {
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 950;
  line-height: 1.08;
}

.decision-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.decision-stats span {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--soft);
  font-size: 0.76rem;
  font-weight: 900;
}

.decision-copy {
  color: var(--soft);
  font-size: 0.86rem;
  line-height: 1.36;
}

.control-band {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(180px, 260px) minmax(160px, 220px) minmax(170px, 240px);
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button,
select,
input {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(8, 12, 20, 0.96);
  color: var(--ink);
  min-height: 42px;
}

button {
  padding: 8px 11px;
  font-weight: 850;
  cursor: pointer;
}

button[aria-pressed="true"],
.usecase-button.active {
  border-color: var(--cyan);
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.42), rgba(34, 211, 238, 0.2)),
    #101827;
  color: var(--ink);
  box-shadow: inset 0 -2px 0 rgba(34, 211, 238, 0.72), 0 0 0 1px rgba(34, 211, 238, 0.12);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

label {
  display: grid;
  gap: 5px;
}

input,
select {
  width: 100%;
  padding: 8px 10px;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 410px);
  gap: 16px;
  align-items: start;
}

.viz-panel,
.detail-panel,
.comparison-band,
.source-band,
.coverage-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.viz-panel,
.detail-panel,
.comparison-band,
.coverage-band,
.source-band {
  padding: 15px;
}

.detail-panel {
  position: sticky;
  top: 12px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.dot {
  width: 10px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--cyan);
}

.heatmap-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 20, 0.68);
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #192235;
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 900;
}

td:first-child,
th:first-child {
  min-width: 230px;
}

.material-button {
  width: 100%;
  min-height: 40px;
  padding: 7px;
  text-align: left;
  background: transparent;
  border-color: transparent;
  color: var(--ink);
}

.material-button:hover,
.material-button.selected {
  border-color: var(--line-strong);
  background: rgba(34, 211, 238, 0.08);
}

.row-title {
  display: block;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.18;
}

.row-sub {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
  line-height: 1.28;
}

.heat-cell {
  min-width: 104px;
  border-left: 1px solid rgba(240, 244, 255, 0.08);
  color: #f8fbff;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.14;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.48);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.heat-cell.empty {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.11);
  text-shadow: none;
}

.comparison-filter {
  min-width: 220px;
}

.comparison-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 12px;
}

.comparison-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 20, 0.72);
}

.comparison-table {
  min-width: 1380px;
}

.comparison-table th,
.comparison-table td {
  padding: 11px;
}

.comparison-table td {
  font-size: 0.9rem;
  line-height: 1.28;
}

.comparison-table td:nth-child(4),
.comparison-table td:nth-child(5),
.comparison-table td:nth-child(6),
.comparison-table td:nth-child(7) {
  color: var(--green);
  font-weight: 900;
}

.tag {
  display: inline-flex;
  margin-top: 7px;
  border: 1px solid rgba(34, 211, 238, 0.38);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 900;
}

.missing {
  color: var(--muted);
  font-weight: 800;
}

.compact-source {
  max-width: 260px;
}

.compact-source a {
  display: inline-flex;
  margin: 0 6px 5px 0;
  color: var(--cyan);
  font-weight: 900;
}

.source-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.source-inline a {
  border-bottom: 1px solid rgba(34, 211, 238, 0.42);
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
  text-decoration: none;
}

.svg-stage {
  width: 100%;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 20, 0.78);
  overflow: hidden;
}

svg {
  display: block;
  width: 100%;
  height: auto;
  fill: var(--soft);
  color: var(--soft);
}

svg text {
  fill: var(--soft);
  color: var(--soft);
}

.parallel-line {
  fill: none;
  stroke-width: 2.2;
  stroke-opacity: 0.46;
}

.parallel-line.selected {
  stroke-width: 4;
  stroke-opacity: 1;
}

.axis-line {
  stroke: rgba(240, 244, 255, 0.38);
  stroke-width: 1;
}

.axis-label {
  font-size: 13px;
  font-weight: 900;
  fill: var(--soft);
  color: var(--soft);
  paint-order: stroke fill;
  stroke: rgba(8, 12, 20, 0.92);
  stroke-linejoin: round;
  stroke-width: 3px;
}

.radar-label {
  font-size: 12px;
  stroke-width: 2.6px;
}

.radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.radar-card,
.sweet-card,
.ranking-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 12, 20, 0.72);
}

.radar-card {
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(21, 29, 46, 0.88), rgba(8, 12, 20, 0.82)),
    #0b111d;
}

.radar-card h3 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--soft);
}

.radar-card svg {
  border-radius: 8px;
  background: rgba(8, 12, 20, 0.46);
  box-shadow: inset 0 0 0 1px rgba(240, 244, 255, 0.06);
}

.bubble-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 12px;
}

.sweet-list {
  display: grid;
  gap: 8px;
}

.sweet-card {
  padding: 9px;
}

.ranking-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.ranking-list {
  display: grid;
  gap: 8px;
}

.ranking-row {
  display: grid;
  grid-template-columns: minmax(190px, 260px) minmax(0, 1fr) 54px;
  gap: 10px;
  align-items: center;
  padding: 9px;
}

.stack {
  display: flex;
  overflow: hidden;
  min-height: 24px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.18);
  box-shadow: inset 0 0 0 1px rgba(240, 244, 255, 0.08);
}

.segment {
  min-width: 2px;
}

.score {
  text-align: right;
  font-weight: 950;
  color: var(--green);
}

.detail-head {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.detail-head h2 {
  font-size: 1.7rem;
}

.meter-list {
  display: grid;
  gap: 9px;
  margin: 12px 0;
}

.meter-row {
  display: grid;
  gap: 5px;
}

.meter-row header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 850;
}

.meter {
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 0 0 1px rgba(240, 244, 255, 0.08);
}

.meter span {
  display: block;
  height: 100%;
  width: var(--width);
  background: linear-gradient(90deg, var(--red), var(--amber), var(--green), var(--cyan));
}

.meter-row.is-missing .meter {
  background: repeating-linear-gradient(
    135deg,
    rgba(148, 163, 184, 0.15),
    rgba(148, 163, 184, 0.15) 6px,
    rgba(148, 163, 184, 0.08) 6px,
    rgba(148, 163, 184, 0.08) 12px
  );
}

.temp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.temp-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(8, 12, 20, 0.72);
}

.temp-card strong,
.temp-card span {
  display: block;
}

.temp-card span {
  margin-top: 3px;
  color: var(--green);
  font-weight: 900;
}

.guidance {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.guidance div {
  border-left: 3px solid var(--cyan);
  padding-left: 10px;
}

.guidance .avoid {
  border-left-color: var(--red);
}

.source-links {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.source-links a,
.source-row a {
  color: var(--cyan);
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.24;
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.coverage-chip {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(8, 12, 20, 0.72);
}

.coverage-chip strong {
  font-size: 0.94rem;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
  min-width: 0;
}

.source-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(8, 12, 20, 0.74);
}

.source-row strong {
  display: block;
}

.source-note {
  margin: 5px 0 0;
  font-size: 0.88rem;
  line-height: 1.42;
}

.no-results {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: minmax(240px, 1fr) auto;
  }

  .site-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  h1 {
    font-size: 2.5rem;
  }

  .decision-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .control-band,
  .workbench,
  .hero-band,
  .bubble-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .site-header {
    grid-template-columns: 1fr;
  }

  .site-nav {
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    flex-wrap: nowrap;
  }

  .site-nav a {
    min-height: 34px;
    padding: 6px 9px;
    white-space: nowrap;
  }

  .header-stats,
  .hero-metrics,
  .coverage-summary {
    justify-content: flex-start;
  }

  h1 {
    font-size: 2.05rem;
    line-height: 1.02;
  }

  h2 {
    font-size: 1.25rem;
  }

  .decision-grid {
    grid-template-columns: 1fr;
  }

  .decision-card {
    min-height: 0;
  }

  .panel-heading,
  .ranking-row {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    display: grid;
  }

  .ranking-row {
    display: grid;
  }

  .temp-grid {
    grid-template-columns: 1fr;
  }

  td:first-child,
  th:first-child {
    min-width: 220px;
  }

  table {
    min-width: 860px;
  }

  .heat-cell {
    min-width: 92px;
  }
}

@media print {
  body {
    background: white;
    color: #111827;
  }

  .control-band,
  .detail-panel {
    display: none;
  }

  .app-shell {
    width: 100%;
  }

  .workbench {
    display: block;
  }

  .viz-panel,
  .source-band,
  .coverage-band {
    box-shadow: none;
    break-inside: avoid;
  }
}
