:root {
  color-scheme: light;
  --background: #f4f6f8;
  --panel: #ffffff;
  --panel-muted: #edf1f4;
  --text: #172126;
  --muted: #617078;
  --border: #d5dde1;
  --accent: #176b67;
  --accent-soft: #dff1ef;
  --shadow: 0 12px 30px rgb(24 42 49 / 9%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--background);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.55rem 2rem;
  color: #f8ffff;
  background:
    radial-gradient(circle at 84% -60%, rgb(107 204 255 / 42%), transparent 48%),
    linear-gradient(128deg, #133845, #176b67 62%, #2d596f);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: #b8e5dd;
  font-size: 0.75rem;
  font-weight: 780;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  letter-spacing: -0.04em;
}

.report-identity {
  max-width: 62rem;
  margin-bottom: 0;
  color: #d0e9e6;
  font-size: 0.86rem;
}

.report-links {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.65rem;
}

.report-links a {
  color: #f8ffff;
  font-size: 0.78rem;
  font-weight: 680;
  text-underline-offset: 0.18em;
}

.global-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(7.5rem, 1fr));
  gap: 0.5rem;
  min-width: min(100%, 31rem);
}

.header-stat {
  padding: 0.62rem 0.78rem;
  border: 1px solid rgb(220 250 247 / 24%);
  border-radius: 0.62rem;
  background: rgb(4 37 43 / 25%);
  backdrop-filter: blur(8px);
}

.header-stat strong,
.header-stat span {
  display: block;
}

.header-stat strong {
  font-size: 1.03rem;
}

.header-stat span {
  margin-top: 0.12rem;
  color: #cde4e2;
  font-size: 0.67rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.page-main {
  max-width: 1800px;
  margin: 0 auto;
  padding: 1.15rem;
}

.explorer-panel,
.method-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #fafcfc;
}

.toolbar > div {
  flex: 0 1 auto;
}

.control-label,
.search-control > span {
  display: block;
  margin-bottom: 0.32rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.segmented {
  display: inline-flex;
  padding: 0.18rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: var(--panel-muted);
}

.segmented button {
  min-height: 2.25rem;
  padding: 0.4rem 0.72rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  cursor: pointer;
}

.segmented button.selected {
  color: #f8ffff;
  background: var(--accent);
  box-shadow: 0 2px 8px rgb(23 107 103 / 24%);
}

.search-control {
  width: min(100%, 28rem);
}

.depth-control {
  width: 10.5rem;
}

.depth-control .control-label {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.depth-control output {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.depth-control input {
  width: 100%;
  accent-color: var(--accent);
}

.depth-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
}

.search-control input {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.45rem 0.7rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--panel);
}

.search-control input:disabled {
  color: var(--muted);
  background: var(--panel-muted);
}

.runtime-coverage {
  display: grid;
  grid-template-columns: minmax(15rem, 1.25fr) minmax(10rem, 0.8fr) minmax(20rem, 1.5fr);
  align-items: center;
  gap: 1rem;
  min-height: 3.7rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #f8fbfa;
}

.runtime-coverage[hidden] {
  display: none;
}

.runtime-coverage-heading {
  min-width: 0;
}

.runtime-coverage-heading strong,
.runtime-coverage-heading span {
  display: block;
}

.runtime-coverage-heading strong {
  font-size: 0.86rem;
}

.runtime-coverage-heading span {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.runtime-coverage-meter {
  display: grid;
  grid-template-columns: 3.4rem minmax(4rem, 1fr);
  align-items: center;
  gap: 0.55rem;
}

.runtime-coverage-meter output {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.runtime-coverage-track {
  height: 0.5rem;
  overflow: hidden;
  border: 1px solid rgb(23 107 103 / 18%);
  border-radius: 999px;
  background: #dce4e5;
}

.runtime-coverage-track span {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, #36a985, #78cfad);
  transition: width 90ms ease-out;
}

.runtime-coverage-facts {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  min-width: 0;
}

.runtime-coverage-facts div {
  min-width: 0;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
}

.runtime-coverage-facts strong,
.runtime-coverage-facts span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-coverage-facts strong {
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.runtime-coverage-facts span {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.66rem;
}

button:focus-visible,
input:focus {
  outline: 3px solid rgb(23 107 103 / 25%);
  outline-offset: 1px;
}

.context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
}

.breadcrumbs {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  overflow: auto;
  white-space: nowrap;
}

.breadcrumbs button {
  padding: 0.2rem 0.38rem;
  border: 0;
  border-radius: 0.3rem;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
}

.breadcrumbs button:disabled {
  color: var(--text);
  font-weight: 720;
  cursor: default;
}

.breadcrumbs > span {
  color: #a1adb2;
}

.view-explanation {
  position: relative;
  flex: 0 0 auto;
}

.view-explanation summary {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 680;
  cursor: pointer;
  user-select: none;
}

.view-note {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(34rem, calc(100vw - 4rem));
  margin: 0;
  padding: 0.75rem 0.85rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.color-legend {
  display: grid;
  grid-template-columns: auto auto minmax(12rem, 28rem) auto;
  align-items: center;
  justify-content: end;
  gap: 0.55rem;
  min-height: 2.2rem;
  padding: 0.35rem 1rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: #fafcfc;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.color-legend[hidden] {
  display: none;
}

.color-legend strong {
  color: var(--text);
  font-size: 0.7rem;
}

.color-legend-gradient {
  height: 0.55rem;
  border: 1px solid rgb(65 81 89 / 20%);
  border-radius: 999px;
}

.color-legend.boundary .color-legend-gradient {
  background: linear-gradient(90deg, #d7dde0, #78cfad);
}

.color-legend.frontier .color-legend-gradient {
  background: linear-gradient(90deg, #dfe4e6, hsl(14 76% 51%));
}

.color-legend.combined .color-legend-gradient {
  background: linear-gradient(
    90deg,
    #d7dde0 0 24%,
    #78cfad 24% 49%,
    #df4c2f 49% 74%,
    #8f60bf 74% 100%
  );
}

.color-legend-value {
  white-space: nowrap;
}

.explorer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 23rem);
  min-height: 68vh;
}

.treemap {
  position: relative;
  min-height: 68vh;
  overflow: hidden;
  background: #e8edef;
  view-transition-name: vir-map-scope;
}

::view-transition-group(vir-map-scope) {
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-old(vir-map-scope) {
  animation: vir-map-scope-out 260ms ease-in both;
}

::view-transition-new(vir-map-scope) {
  animation: vir-map-scope-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

::view-transition-group(*) {
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

@keyframes vir-map-scope-out {
  to {
    opacity: 0;
    transform: scale(0.985);
  }
}

@keyframes vir-map-scope-in {
  from {
    opacity: 0;
    transform: scale(1.015);
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation-duration: 1ms;
  }
}

.map-block {
  position: absolute;
  overflow: hidden;
  padding: 0.18rem;
  color: hsl(var(--block-hue) 35% 16%);
  border: 2px solid #f7fafb;
  background: hsl(var(--block-hue) 53% 78%);
  cursor: pointer;
  transition: filter 100ms ease, box-shadow 100ms ease;
}

.map-block.depth-1 {
  border-width: 1px;
  background: hsl(var(--block-hue) 56% 86%);
}

.map-block.depth-2 {
  border-width: 1px;
  background: hsl(var(--block-hue) 48% 91%);
}

.map-block.depth-3 {
  border-width: 1px;
  background: hsl(var(--block-hue) 42% 94%);
}

.map-block.depth-4,
.map-block.depth-5,
.map-block.depth-6 {
  border-width: 1px;
  background: hsl(var(--block-hue) 36% 96%);
}

.map-block:hover,
.map-block:focus-visible {
  z-index: 4;
  filter: saturate(1.22) brightness(1.02);
  box-shadow: inset 0 0 0 2px hsl(var(--block-hue) 58% 35%);
  outline: none;
}

.map-block.highlighted {
  z-index: 5;
  box-shadow: inset 0 0 0 4px #df4c2f, 0 0 0 2px #ffffff;
}

.map-block.in-boundary,
.map-block.outside-boundary,
.map-block.mixed-boundary {
  color: #173b35;
  background: color-mix(
    in srgb,
    #78cfad var(--boundary-percent),
    #d7dde0
  );
}

.map-block.frontier-pressure {
  color: #421d16;
  background: hsl(
    14
    calc(var(--frontier-saturation) * 1%)
    calc(var(--frontier-lightness) * 1%)
  );
}

.map-block.no-frontier-pressure {
  color: #354248;
  background: #dfe4e6;
}

.map-block.combined-context {
  color: #2e2731;
  background: var(--combined-color);
}

.block-label {
  position: relative;
  z-index: 3;
  display: block;
  max-width: 100%;
  padding: 0.18rem 0.28rem;
  pointer-events: none;
}

.block-label strong,
.block-label > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block-label strong {
  font-size: 0.78rem;
  line-height: 1.12;
}

.block-label > span {
  margin-top: 0.08rem;
  font-size: 0.68rem;
  opacity: 0.72;
}

.block-label.compact > span {
  display: none;
}

.nested-map {
  position: absolute;
  inset: 2.35rem 0.18rem 0.18rem;
  overflow: hidden;
}

.map-block.depth-1 > .nested-map,
.map-block.depth-2 > .nested-map,
.map-block.depth-3 > .nested-map,
.map-block.depth-4 > .nested-map,
.map-block.depth-5 > .nested-map {
  inset: 1.8rem 0.12rem 0.12rem;
}

.details-panel {
  max-height: 68vh;
  overflow: auto;
  border-left: 1px solid var(--border);
  background: #fbfcfd;
}

.details-panel > section {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.selection-details h2 {
  overflow-wrap: anywhere;
  margin-bottom: 0.18rem;
  font-size: 1.05rem;
}

.selection-kind {
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.detail-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.38rem 0.8rem;
  margin: 0;
  font-size: 0.8rem;
}

.detail-stats dt {
  color: var(--muted);
}

.detail-stats dd {
  max-width: 13rem;
  overflow-wrap: anywhere;
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
  text-align: right;
}

.source-path,
.detail-note {
  overflow-wrap: anywhere;
  margin: 0.85rem 0 0;
  padding: 0.65rem;
  border-radius: 0.42rem;
  color: #415159;
  background: var(--panel-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.35;
}

.detail-actions {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
}

.detail-actions > strong {
  display: block;
  margin-bottom: 0.35rem;
}

.detail-actions button {
  width: 100%;
  margin-bottom: 0.65rem;
  padding: 0.5rem 0.65rem;
  color: #f8ffff;
  border: 0;
  border-radius: 0.42rem;
  background: var(--accent);
  cursor: pointer;
}

.detail-actions ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
}

.detail-actions li + li {
  margin-top: 0.25rem;
}

.detail-actions-remainder {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.detail-actions a {
  color: var(--accent);
  font-weight: 680;
}

.detail-highlights {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.detail-highlights h3 {
  margin: 0 0 0.3rem;
  font-size: 0.74rem;
}

.detail-highlights ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-highlights li + li {
  border-top: 1px solid #e7ecee;
}

.detail-highlights button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  width: 100%;
  padding: 0.32rem 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.detail-highlights button:hover {
  color: var(--accent);
}

.detail-highlights button span:first-child {
  overflow: hidden;
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-highlights button span:last-child {
  color: var(--muted);
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 0.87rem;
}

.section-heading > span {
  color: var(--muted);
  font-size: 0.7rem;
}

.top-children,
.search-results {
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-children li + li,
.search-results li + li {
  border-top: 1px solid #e7ecee;
}

.top-children button,
.search-results button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  width: 100%;
  padding: 0.46rem 0.15rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.top-children button:hover,
.search-results button:hover {
  color: var(--accent);
}

.top-children button span:first-child,
.search-results button span:first-child {
  overflow: hidden;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-children button span:last-child,
.search-results button span:last-child {
  color: var(--muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.empty-message {
  padding: 2rem;
  color: var(--muted);
}

.method-panel {
  margin-top: 1rem;
  padding: 1rem 1.2rem;
}

.method-panel h2 {
  margin-bottom: 0.65rem;
  font-size: 1rem;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.2rem;
}

.method-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.method-grid strong {
  color: var(--text);
}

.frontier-cost-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.frontier-cost-heading h2,
.frontier-cost-heading .eyebrow {
  margin: 0;
}

.frontier-cost-baseline,
.frontier-cost-note {
  color: var(--muted);
  font-size: 0.78rem;
}

.frontier-cost-baseline {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.frontier-cost-note {
  margin: 0.55rem 0 0.8rem;
}

.frontier-cost-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
}

.frontier-cost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.frontier-cost-table th,
.frontier-cost-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.frontier-cost-table th {
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.frontier-cost-table tbody tr:last-child td {
  border-bottom: 0;
}

.frontier-cost-table .numeric {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.frontier-cost-names {
  min-width: 18rem;
  max-width: 44rem;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
}

.frontier-cost-names a {
  color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .page-header {
    display: block;
  }

  .global-summary {
    margin-top: 1rem;
  }

  .explorer-layout {
    grid-template-columns: 1fr;
  }

  .details-panel {
    max-height: none;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .method-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .runtime-coverage {
    grid-template-columns: minmax(15rem, 1fr) minmax(10rem, 0.8fr);
  }

  .runtime-coverage-facts {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .page-header,
  .page-main {
    padding: 1rem;
  }

  .global-summary {
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }

  .toolbar,
  .context-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    display: flex;
  }

  .segmented button {
    flex: 1;
  }

  .search-control {
    width: 100%;
  }

  .runtime-coverage {
    grid-template-columns: 1fr;
  }

  .runtime-coverage-facts {
    grid-column: auto;
    flex-direction: column;
    gap: 0.4rem;
  }

  .runtime-coverage-facts div {
    padding-left: 0;
    border-left: 0;
  }

  .view-note {
    right: auto;
    left: 0;
    width: min(34rem, calc(100vw - 3rem));
  }

  .color-legend {
    grid-template-columns: auto 1fr auto;
    justify-content: stretch;
  }

  .color-legend strong {
    grid-column: 1 / -1;
  }

  .treemap {
    min-height: 60vh;
  }
}
