:root {
  color-scheme: dark;
  --canvas: #0b0c0e;
  --canvas: oklch(0.125 0.008 25);
  --surface-1: #101114;
  --surface-1: oklch(0.155 0.009 25);
  --surface-2: #17181c;
  --surface-2: oklch(0.19 0.01 25);
  --surface-3: #1d1f24;
  --surface-3: oklch(0.225 0.012 25);
  --text: #ece8e7;
  --text: oklch(0.92 0.012 25);
  --text-soft: #c4bdbc;
  --text-soft: oklch(0.78 0.014 25);
  --muted: #938c8f;
  --muted: oklch(0.64 0.015 25);
  --dim: #9a9295;
  --dim: oklch(0.67 0.014 25);
  --accent: #e24343;
  --accent: oklch(0.625 0.205 27);
  --accent-hot: #ff6464;
  --accent-hot: oklch(0.72 0.19 27);
  --accent-soft: rgba(226, 67, 67, 0.14);
  --accent-soft: oklch(0.625 0.205 27 / 0.14);
  --line-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --focus: oklch(0.78 0.15 27);
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --font-display:
    "Bahnschrift Condensed", "Arial Narrow", "Microsoft YaHei UI", sans-serif;
  --font-body:
    "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--canvas);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--text);
}

button,
input,
a {
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
.idol-node:focus-visible .node-focus {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  background: var(--accent);
  color: var(--text);
  text-decoration: none;
  transition-property: transform;
  transition-duration: 140ms;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100dvh;
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px), var(--canvas);
  background-size: 96px 96px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(420px, 720px);
  gap: 30px;
  align-items: center;
  min-height: 116px;
  padding: 18px clamp(18px, 2.4vw, 38px);
  background: var(--surface-1);
  box-shadow:
    0 1px 0 var(--line),
    0 14px 40px rgba(0, 0, 0, 0.2);
}

.identity-block {
  min-width: 0;
}

.archive-code,
.section-kicker {
  margin: 0 0 6px;
  color: var(--accent-hot);
  font-family: var(--font-display);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.signal-mark {
  width: 20px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 1px;
  background: var(--accent);
  box-shadow: 8px 0 0 color-mix(in oklch, var(--accent) 45%, transparent);
}

.title-row h1,
.map-heading-row h2,
.detail-title-block h2 {
  text-wrap: balance;
}

.title-row h1 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(23px, 2vw, 32px);
  font-stretch: condensed;
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subtitle {
  margin: 7px 0 0 30px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.freshness-line {
  margin: 7px 0 0;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.55;
  letter-spacing: 0.025em;
  text-wrap: pretty;
}

.topbar-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(190px, 0.72fr) auto;
  gap: 12px;
  align-items: center;
}

.search-control {
  position: relative;
  min-width: 0;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 46px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  box-shadow:
    inset 0 0 0 1px var(--line),
    0 6px 18px rgba(0, 0, 0, 0.16);
}

.search-box:focus-within {
  box-shadow:
    inset 0 0 0 1px var(--accent),
    0 0 0 3px var(--accent-soft);
}

.search-icon {
  width: 19px;
  height: 19px;
  margin-left: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.7;
}

#idol-search {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 44px 0 11px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  outline: 0;
}

#idol-search::placeholder {
  color: var(--dim);
}

#idol-search::-webkit-search-cancel-button {
  appearance: none;
}

.icon-button,
.tool-button,
.scope-switch button {
  border: 0;
  cursor: pointer;
  transition-property: transform, background-color, color, opacity;
  transition-duration: 140ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.icon-button:active,
.tool-button:active,
.scope-switch button:active,
.search-result:active,
.region-filter-toggle:active,
.region-expand-button:active,
.region-chip:active,
#clear-region-filter:active {
  transform: scale(0.96);
}

.clear-button {
  position: absolute;
  right: 4px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--muted);
  font-size: 22px;
}

.search-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 7px);
  left: 0;
  width: 100%;
  max-height: min(440px, 58vh);
  margin: 0;
  padding: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius-md);
  background: var(--surface-3);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.46),
    inset 0 0 0 1px var(--line);
  list-style: none;
}

.search-result {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 7px 9px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition-property: transform, background-color;
  transition-duration: 120ms;
}

.search-result[aria-selected="true"] {
  background: var(--accent-soft);
}

.result-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
}

.result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-copy {
  min-width: 0;
}

.result-copy strong,
.result-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-copy strong {
  font-size: 13px;
  font-weight: 500;
}

.result-copy span,
.result-meta {
  color: var(--muted);
  font-size: 11px;
}

.result-meta {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.empty-result {
  padding: 18px 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.scope-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 206px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line);
}

.scope-switch button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.scope-switch button[aria-pressed="true"] {
  background: var(--text);
  color: var(--canvas);
}

.region-filter {
  position: relative;
  min-width: 0;
}

.region-filter-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-soft);
  cursor: pointer;
  text-align: left;
  transition-property: transform, background-color, color;
  transition-duration: 140ms;
}

#region-filter-summary {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-filter-caret {
  color: var(--accent-hot);
  font-size: 15px;
}

.region-filter-popover {
  position: absolute;
  z-index: 45;
  top: calc(100% + 7px);
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 32px));
  max-height: min(570px, calc(100dvh - 144px));
  padding: 12px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface-3);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.46),
    inset 0 0 0 1px var(--line);
}

.region-filter-heading {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
}

.region-filter-heading strong {
  font-size: 13px;
  font-weight: 500;
}

.region-filter-heading-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

#clear-region-popover {
  min-width: 40px;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--accent-soft);
  color: var(--accent-hot);
  cursor: pointer;
  font-size: 11px;
}

#clear-region-popover:disabled {
  opacity: 0.42;
  cursor: default;
}

#region-match-count,
.region-filter-help {
  color: var(--muted);
  font-size: 10px;
}

.region-filter-help {
  margin: 6px 0 10px;
  line-height: 1.5;
  text-wrap: pretty;
}

.region-scope-control {
  min-width: 0;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
}

.region-scope-control legend {
  margin-bottom: 5px;
  color: var(--dim);
  font-size: 10px;
}

.region-scope-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.region-scope-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.region-scope-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.region-scope-option span {
  display: grid;
  min-height: 40px;
  padding: 0 6px;
  place-items: center;
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
  transition-property: background-color, color;
  transition-duration: 140ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.region-scope-option input:checked + span {
  background: var(--text);
  color: var(--canvas);
  font-weight: 600;
}

.region-scope-option input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.region-scope-option input:focus-visible {
  outline: 0;
}

.region-filter-tree {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(430px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: inset 0 1px 0 var(--line-soft);
}

.region-tree-empty {
  margin: 0;
  padding: 22px 8px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.region-province {
  box-shadow: inset 0 -1px 0 var(--line-soft);
}

.region-province-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.region-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 4px 7px;
  color: var(--text-soft);
  font-size: 12px;
  cursor: pointer;
}

.region-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.region-option small {
  color: var(--dim);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.region-expand-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--accent-hot);
  cursor: pointer;
  font-size: 18px;
}

.region-city-list {
  padding: 0 0 5px 26px;
  background: color-mix(in oklch, var(--surface-3) 90%, var(--accent) 10%);
}

.region-city-option {
  min-height: 40px;
}

.region-chips-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: -2px 0 9px;
  padding: 8px 0;
  box-shadow: inset 0 -1px 0 var(--line-soft);
}

.region-chips-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

.region-chips {
  display: flex;
  flex: 1 1 auto;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.region-chip,
#clear-region-filter {
  min-height: 40px;
  border: 0;
  cursor: pointer;
}

.region-chip {
  flex: 0 0 auto;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--text-soft);
  font-size: 11px;
}

.evidence-filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 7px 0;
  box-shadow:
    inset 0 1px 0 var(--line-soft),
    inset 0 -1px 0 var(--line-soft);
}

.evidence-filter-label {
  flex: 0 0 auto;
  color: var(--dim);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.evidence-filter-options {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.evidence-filter-options button,
#clear-evidence-filter {
  min-height: 32px;
  border: 0;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 10px;
  transition:
    background-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.evidence-filter-options button {
  padding: 0 9px;
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.evidence-filter-options button span {
  margin-left: 4px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.evidence-filter-options button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px
    color-mix(in oklch, var(--accent) 52%, transparent);
}

.evidence-filter-options button[aria-pressed="true"]::before {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent-hot);
  content: "";
  vertical-align: 1px;
}

#clear-evidence-filter {
  flex: 0 0 auto;
  padding: 0 8px;
  background: transparent;
  color: var(--accent-hot);
}

.api-coverage-line {
  margin: 7px 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

#clear-region-filter {
  flex: 0 0 auto;
  padding: 0 9px;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--accent-hot);
  font-size: 11px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  min-height: calc(100dvh - 116px);
}

.map-workspace {
  min-width: 0;
  padding: 24px clamp(16px, 2.2vw, 34px) 18px;
  background: color-mix(in oklch, var(--canvas) 94%, var(--accent) 6%);
}

.map-heading-row {
  display: flex;
  gap: 24px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 13px;
}

.map-heading-row h2 {
  margin: 0;
  scroll-margin-top: 180px;
  font-family: var(--font-display);
  font-size: clamp(26px, 2.2vw, 36px);
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1;
}

.map-heading-row h2:focus {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.coverage-line {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.chart-tools {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 45px;
  padding: 6px 0;
  box-shadow: 0 1px 0 var(--line-soft);
}

.chart-tools p {
  margin: 0;
  color: var(--dim);
  font-size: 11px;
}

.zoom-controls {
  display: flex;
  gap: 5px;
}

.tool-button {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--text-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

.fit-button {
  min-width: 78px;
  font-size: 11px;
}

.chart-frame {
  position: relative;
  height: clamp(600px, calc(100dvh - 285px), 920px);
  min-height: 600px;
  overflow: hidden;
  background: var(--surface-1);
  box-shadow:
    inset 0 1px 0 var(--line),
    inset 0 -1px 0 var(--line);
}

#idol-map {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

#idol-map.is-dragging {
  cursor: grabbing;
}

.chart-canvas {
  fill: var(--surface-1);
}

.chart-grid {
  opacity: 0.48;
  pointer-events: none;
}

.micro-grid-line {
  fill: none;
  stroke: var(--line-soft);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.unknown-hatch-line {
  stroke: var(--line);
  stroke-width: 7;
}

.band-fill {
  fill: rgba(255, 255, 255, 0.012);
}

.band-fill.band-alternate {
  fill: rgba(255, 255, 255, 0.025);
}

.unknown-style-fill,
.unknown-followers-fill {
  fill: url(#unknown-hatch);
  opacity: 0.52;
}

.axis-out-style-fill {
  fill: color-mix(in oklch, var(--accent) 11%, var(--surface-1));
  opacity: 0.78;
}

.unresolved-style-fill {
  fill: url(#unknown-hatch);
  opacity: 0.62;
}

.band-rule,
.axis-line,
.axis-tick,
.unknown-divider {
  stroke: var(--line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.unknown-divider {
  stroke: var(--line-strong);
  stroke-dasharray: 12 10;
}

.band-rule.is-categorical {
  stroke: var(--line-strong);
  stroke-dasharray: 7 7;
}

.axis-label,
.band-label,
.band-sublabel,
.axis-title,
.unknown-label {
  fill: var(--muted);
  font-family: var(--font-body);
}

.band-label {
  fill: var(--text-soft);
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.band-sublabel,
.axis-label,
.unknown-label {
  font-size: 15px;
}

.axis-title {
  fill: var(--text-soft);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.tether {
  stroke: var(--line);
  stroke-width: 1;
  opacity: 0.42;
  vector-effect: non-scaling-stroke;
}

.tether.is-filtered {
  display: none;
}

.idol-node {
  cursor: pointer;
  transition-property: opacity;
  transition-duration: 150ms;
}

.idol-node.is-filtered {
  display: none;
}

.node-visual {
  transform-box: fill-box;
  transform-origin: center;
  transition-property: transform, opacity;
  transition-duration: 160ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.node-disc {
  fill: var(--surface-3);
  stroke: var(--line-strong);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.node-focus {
  fill: transparent;
  stroke: transparent;
  stroke-width: 4;
}

.avatar-image {
  pointer-events: none;
}

.avatar-image.is-broken {
  display: none;
}

.node-initials {
  fill: var(--text-soft);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  pointer-events: none;
  text-anchor: middle;
}

.node-name {
  fill: var(--muted);
  font-family: var(--font-body);
  font-size: 15px;
  pointer-events: none;
  text-anchor: middle;
}

.idol-node.is-non-active {
  opacity: 0.54;
}

.idol-node.is-non-active .node-disc {
  stroke-dasharray: 5 4;
}

.idol-node.is-medium-identity:not(.is-non-active) .node-disc {
  stroke-dasharray: 2 3;
}

.idol-node.is-selected {
  opacity: 1;
}

.idol-node.is-selected .node-visual {
  transform: scale(1.12);
}

.idol-node.is-selected .node-disc {
  fill: var(--accent-soft);
  stroke: var(--accent-hot);
  stroke-width: 3;
}

.idol-node.is-selected .node-name {
  fill: var(--text);
  font-weight: 500;
}

.idol-node:focus-visible .node-focus {
  fill: transparent;
  stroke: var(--focus);
}

.selection-ring {
  opacity: 0;
  pointer-events: none;
  transform-box: view-box;
  transform-origin: 0 0;
  transition-property: transform, opacity;
  transition-duration: 420ms, 140ms;
  transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1), ease-out;
}

.selection-ring.is-visible {
  opacity: 1;
}

.selection-orbit,
.selection-core,
.selection-cross {
  fill: none;
  stroke: var(--accent-hot);
  vector-effect: non-scaling-stroke;
}

.selection-orbit {
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
}

.selection-core {
  stroke-width: 2.5;
}

.selection-cross {
  stroke-width: 1.5;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  min-height: 48px;
  padding: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.legend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.legend-dot,
.legend-ring,
.legend-swatch {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
}

.legend-dot.known {
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--text-soft);
}

.legend-dot.initial {
  background: var(--surface-3);
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 10px;
}

.legend-ring.non-active {
  box-shadow: inset 0 0 0 1px var(--muted);
  border: 1px dashed var(--muted);
}

.legend-ring.medium-identity {
  border: 2px dotted var(--text-soft);
  box-shadow: inset 0 0 0 3px var(--surface-2);
}

.legend-swatch {
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.legend-swatch.comparable {
  background: rgba(255, 255, 255, 0.04);
}

.legend-swatch.axis-out {
  background: color-mix(in oklch, var(--accent) 20%, var(--surface-1));
}

.legend-swatch.unresolved {
  background: repeating-linear-gradient(
    135deg,
    var(--surface-3) 0 3px,
    var(--line-strong) 3px 4px
  );
}

.legend-note {
  margin-left: auto;
}

.detail-panel {
  position: sticky;
  top: 116px;
  align-self: start;
  min-height: calc(100dvh - 116px);
  max-height: calc(100dvh - 116px);
  padding: 24px 24px calc(26px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface-2);
  box-shadow:
    -1px 0 0 var(--line),
    -20px 0 50px rgba(0, 0, 0, 0.2);
}

.detail-heading {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 15px;
}

.detail-index {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
}

.status-stamp {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  border-radius: var(--radius-xs);
  background: var(--surface-3);
  color: var(--muted);
  font-size: 11px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.status-stamp.is-active {
  background: var(--accent-soft);
  color: var(--accent-hot);
  box-shadow: inset 0 0 0 1px
    color-mix(in oklch, var(--accent) 44%, transparent);
}

.poster-stage {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 10;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px),
    var(--surface-1);
  background-size: 28px 28px;
  box-shadow: inset 0 0 0 1px var(--line);
}

#detail-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
}

.poster-stage.is-poster-art #detail-poster {
  object-fit: contain;
  background: var(--surface-1);
}

.poster-stage.is-cover-visual #detail-poster {
  object-fit: cover;
}

.poster-fallback {
  display: grid;
  gap: 8px;
  place-items: center;
  color: var(--dim);
}

.poster-fallback span {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 28px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.poster-fallback p {
  margin: 0;
  font-size: 11px;
}

.poster-label {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-height: 25px;
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  background: rgba(11, 12, 14, 0.84);
  color: var(--text-soft);
  font-size: 10px;
}

.detail-title-block {
  padding: 19px 0 16px;
  box-shadow: 0 1px 0 var(--line);
}

.detail-title-block h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.02;
}

.detail-title-block p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.detail-facts {
  margin: 0;
  padding: 11px 0;
  box-shadow: 0 1px 0 var(--line);
}

.detail-facts div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  min-height: 34px;
  padding: 7px 0;
}

.detail-facts dt,
.detail-label {
  color: var(--dim);
  font-size: 11px;
}

.detail-facts dd {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}

.tags-block {
  padding: 14px 0 6px;
}

.detail-label {
  margin: 0 0 9px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-tags span {
  min-height: 27px;
  padding: 5px 8px;
  border-radius: var(--radius-xs);
  background: var(--surface-3);
  color: var(--text-soft);
  font-size: 10px;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.detail-note {
  min-height: 42px;
  margin: 9px 0 15px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
  text-wrap: pretty;
}

.candidate-evidence {
  margin: 0 0 15px;
  background: color-mix(in oklch, var(--surface-2) 84%, var(--accent) 16%);
  box-shadow:
    inset 0 1px 0 var(--line),
    inset 0 -1px 0 var(--line);
}

.candidate-evidence summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 45px;
  padding: 0 10px;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 11px;
  list-style: none;
}

.candidate-evidence summary::-webkit-details-marker {
  display: none;
}

.candidate-evidence summary > span:first-child::before {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border: 1px solid var(--accent-hot);
  content: "";
  transform: rotate(45deg);
}

.candidate-evidence summary > span:first-child {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.035em;
}

.candidate-evidence summary > span:last-child {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.candidate-evidence[open] summary {
  box-shadow: inset 0 -1px 0 var(--line-soft);
}

.candidate-evidence[open] summary > span:first-child::before {
  background: var(--accent-hot);
}

.candidate-evidence-boundary,
.candidate-copy {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.candidate-evidence-boundary {
  padding: 10px;
  background: rgba(0, 0, 0, 0.16);
}

.candidate-section {
  padding: 11px 10px 13px;
  box-shadow: inset 0 -1px 0 var(--line-soft);
}

.candidate-section:last-child {
  box-shadow: none;
}

.candidate-section-heading {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.candidate-section-heading strong {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}

.candidate-section-heading span {
  color: var(--dim);
  font-size: 10px;
  text-align: right;
}

.candidate-profile-media {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 64px;
  margin-bottom: 9px;
}

.candidate-avatar-frame {
  display: grid;
  width: 64px;
  height: 64px;
  overflow: hidden;
  place-items: center;
  border-radius: var(--radius-pill);
  background: color-mix(in oklch, var(--surface-3) 86%, var(--accent) 14%);
  box-shadow: inset 0 0 0 1px var(--line);
}

.candidate-avatar-frame img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
}

.candidate-avatar-frame span {
  color: var(--dim);
  font-family: var(--font-display);
  font-size: 20px;
}

.candidate-avatar-copy {
  display: grid;
  gap: 4px;
}

.candidate-avatar-copy strong {
  color: var(--accent-hot);
  font-size: 11px;
  font-weight: 600;
}

.candidate-avatar-copy span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-wrap: pretty;
}

.candidate-facts {
  margin: 0 0 8px;
}

.candidate-facts div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  padding: 4px 0;
}

.candidate-facts dt {
  color: var(--dim);
  font-size: 10px;
}

.candidate-facts dd {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
  text-align: right;
  overflow-wrap: anywhere;
}

.candidate-link,
.candidate-list a {
  display: inline-flex;
  margin-top: 8px;
  color: var(--accent-hot);
  font-size: 11px;
  text-decoration: none;
}

.candidate-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.candidate-list li {
  padding: 8px;
  background: rgba(0, 0, 0, 0.18);
  box-shadow: inset 2px 0 0 var(--line-strong);
}

.candidate-list p {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.candidate-list .candidate-item-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.candidate-list .candidate-list-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.primary-link,
.secondary-link {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  text-decoration: none;
  transition-property: transform, background-color, color;
  transition-duration: 140ms;
}

.primary-link {
  background: var(--accent);
  color: var(--canvas);
  font-weight: 600;
}

.secondary-link {
  background: var(--surface-3);
  color: var(--text-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}

.primary-link:active,
.secondary-link:active {
  transform: scale(0.98);
}

.secondary-link.is-disabled {
  pointer-events: none;
  opacity: 0.4;
}

.observed-line {
  margin: 12px 0 0;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.5;
}

.method-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 17px clamp(18px, 2.4vw, 38px)
    calc(18px + env(safe-area-inset-bottom));
  background: var(--surface-1);
  box-shadow: inset 0 1px 0 var(--line);
}

.method-strip p {
  margin: 0;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.6;
}

.method-strip strong {
  color: var(--text-soft);
  font-weight: 500;
}

@media (hover: hover) {
  .search-result:hover,
  .tool-button:hover,
  .clear-button:hover,
  .region-expand-button:hover,
  .region-chip:hover,
  #clear-region-filter:hover {
    background: var(--accent-soft);
    color: var(--text);
  }

  .region-filter-toggle:hover {
    background: var(--surface-2);
    color: var(--text);
  }

  .region-scope-option input:not(:checked) + span:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
  }

  .scope-switch button:not([aria-pressed="true"]):hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
  }

  .idol-node:hover .node-visual {
    transform: scale(1.08);
  }

  .primary-link:hover {
    background: var(--accent-hot);
  }

  .secondary-link:hover {
    background: var(--surface-1);
    color: var(--text);
  }
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 13px;
    min-height: auto;
  }

  .subtitle {
    display: none;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  .detail-panel {
    top: 137px;
    min-height: calc(100dvh - 137px);
    max-height: calc(100dvh - 137px);
  }
}

@media (max-width: 860px) {
  .topbar {
    position: relative;
    padding: 16px;
  }

  .title-row h1 {
    white-space: normal;
  }

  .topbar-controls {
    grid-template-columns: 1fr;
  }

  .scope-switch {
    width: 100%;
  }

  .region-filter-popover {
    right: auto;
    left: 0;
    width: 100%;
    max-height: min(570px, calc(100dvh - 200px));
  }

  .workspace {
    display: block;
  }

  .map-workspace {
    padding: 18px 14px 12px;
  }

  .map-heading-row {
    display: block;
  }

  .map-heading-row h2 {
    scroll-margin-top: 18px;
  }

  .coverage-line {
    margin-top: 8px;
    text-align: left;
  }

  .evidence-filter-bar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .evidence-filter-options {
    order: 3;
    flex-basis: 100%;
  }

  .api-coverage-line {
    margin-bottom: 7px;
  }

  .chart-tools {
    align-items: end;
  }

  .chart-tools p {
    max-width: 190px;
  }

  .chart-frame {
    height: 62svh;
    min-height: 510px;
  }

  .legend-note {
    width: 100%;
    margin-left: 0;
  }

  .detail-panel {
    position: relative;
    top: auto;
    min-height: 0;
    max-height: none;
    padding: 22px 18px calc(24px + env(safe-area-inset-bottom));
    overflow: visible;
    box-shadow: inset 0 1px 0 var(--line);
  }

  .poster-stage {
    max-height: 520px;
  }

  .method-strip {
    grid-template-columns: 1fr;
    gap: 9px;
  }
}

@media (max-width: 430px) {
  .archive-code {
    font-size: 10px;
  }

  .title-row h1 {
    font-size: 24px;
  }

  .map-heading-row h2 {
    font-size: 28px;
  }

  .chart-tools {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .evidence-filter-options button {
    flex: 1 1 calc(50% - 3px);
  }

  .candidate-facts div {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .fit-button {
    min-width: 68px;
    padding: 0 7px;
  }

  .chart-frame {
    min-height: 480px;
  }

  .detail-facts div {
    grid-template-columns: 88px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
