:root {
  color-scheme: light;
  --background: #f7f9fc;
  --surface: #ffffff;
  --surface-subtle: #f1f4f8;
  --foreground: #202124;
  --muted-foreground: #626b78;
  --border: #d5d9df;
  --input-border: #b8bec8;
  --focus: #356fa8;
  --wheel: #356fa8;
  --wheel-soft: #dceaf6;
  --construction: #8a8f98;
  --terrain: #dce5ee;
  --terrain-line: #6b7280;
  --outgoing: #d55e00;
  --incoming: #0072b2;
  --motion: #009e73;
  --edge: #9c6500;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --success: #067647;
  --success-soft: #dcfae6;
  --neutral-soft: #eef1f4;
  --map-pass: #bfe8d3;
  --map-fail: #f4bbb5;
  --map-none: #e2e6eb;
  --shadow: 0 12px 36px rgba(31, 42, 55, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: #111418;
    --surface: #191e24;
    --surface-subtle: #222932;
    --foreground: #edf1f5;
    --muted-foreground: #aeb7c2;
    --border: #39424d;
    --input-border: #566170;
    --focus: #75b7f0;
    --wheel: #75b7f0;
    --wheel-soft: #23394c;
    --construction: #8994a1;
    --terrain: #293641;
    --terrain-line: #a5afba;
    --outgoing: #f29a63;
    --incoming: #65bce8;
    --motion: #57c9a5;
    --edge: #e0ad4f;
    --danger: #f97066;
    --danger-soft: #4a2020;
    --success: #47cd89;
    --success-soft: #163d2d;
    --neutral-soft: #2a313a;
    --map-pass: #285942;
    --map-fail: #64302d;
    --map-none: #343b44;
    --shadow: 0 12px 36px rgba(0, 0, 0, 0.26);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 400;
}

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

button,
select,
input[type="number"] {
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--surface);
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 32%, transparent);
  outline-offset: 2px;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

button[aria-pressed="true"] {
  border-color: var(--focus);
  background: var(--wheel-soft);
  color: var(--foreground);
}

[hidden] {
  display: none !important;
}

var {
  font-style: italic;
}

.explorer-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
}

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--wheel);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 6px;
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 500;
  letter-spacing: -0.025em;
}

h2 {
  margin-bottom: 4px;
  font-size: 17px;
  font-weight: 500;
}

h3 {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.015em;
}

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

.scope-line {
  max-width: 740px;
  margin-bottom: 0;
  color: var(--muted-foreground);
  line-height: 1.55;
}

.scope-badge,
.direction-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.scope-badge {
  padding: 5px 10px;
  background: var(--neutral-soft);
  color: var(--muted-foreground);
}

.selection-bar {
  display: grid;
  grid-template-columns:
    minmax(180px, 0.88fr)
    minmax(165px, 0.72fr)
    minmax(190px, 0.82fr)
    minmax(160px, 0.68fr)
    minmax(230px, 1.2fr);
  gap: 16px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.formulation-note {
  margin: 9px 3px 0;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
}

select {
  width: 100%;
  min-height: 40px;
  padding: 7px 34px 7px 10px;
}

select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.preset-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.preset-fieldset legend {
  margin-bottom: 7px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
}

.preset-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  gap: 8px;
}

.preset-buttons button {
  min-height: 40px;
  padding: 7px 8px;
  font-weight: 500;
}

.reference-case-detail {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-subtle);
}

.reference-case-detail strong {
  display: block;
  color: var(--foreground);
  font-size: 11px;
  letter-spacing: 0.035em;
}

.reference-case-detail p {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.5;
}

.advanced-reference {
  margin-top: 10px;
  color: var(--muted-foreground);
  font-size: 11px;
}

.advanced-reference summary {
  cursor: pointer;
}

.advanced-reference button {
  width: 100%;
  min-height: 36px;
  margin-top: 9px;
  padding: 7px 10px;
  text-align: left;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.control-panel,
.result-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-panel {
  padding: 18px;
}

.result-panel {
  min-width: 0;
  overflow: hidden;
}

.panel-heading,
.section-heading,
.figure-heading,
.range-heading,
.metric-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2,
.section-heading h3,
.figure-heading h2 {
  margin-bottom: 0;
}

.muted-text {
  color: var(--muted-foreground);
  font-size: 12px;
}

.control-section {
  padding: 17px 0;
  border-top: 1px solid var(--border);
}

.section-field {
  margin-top: 14px;
}

.control-subsection {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: color-mix(
    in srgb,
    var(--surface-subtle) 58%,
    var(--surface)
  );
}

.subsection-heading,
.path-settings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.subsection-heading .muted-text {
  text-align: right;
}

.compatibility-note {
  display: grid;
  gap: 5px;
  margin-top: 13px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--wheel);
  border-radius: 8px;
  background: var(--surface-subtle);
  font-size: 11px;
  line-height: 1.45;
}

.compatibility-note strong {
  color: var(--wheel);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.compatibility-note[data-status="compatible"] {
  border-left-color: var(--success);
  background: color-mix(in srgb, var(--success-soft) 48%, var(--surface));
}

.compatibility-note[data-status="compatible"] strong {
  color: var(--success);
}

.compatibility-note[data-status="reduced-only"],
.compatibility-note[data-status="incompatible"] {
  border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger-soft) 48%, var(--surface));
}

.compatibility-note[data-status="reduced-only"] strong,
.compatibility-note[data-status="incompatible"] strong {
  color: var(--danger);
}

.range-control + .range-control {
  margin-top: 20px;
}

.range-heading {
  margin-bottom: 9px;
}

.range-heading label {
  font-weight: 500;
}

.number-with-unit {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-foreground);
  font-size: 12px;
}

input[type="number"] {
  width: 86px;
  min-height: 34px;
  padding: 5px 8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--wheel);
}

.control-note,
.claim-note {
  margin-bottom: 0;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.5;
}

.control-note {
  margin-top: 14px;
}

.range-note {
  margin: 7px 0 0;
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.45;
}

.signed-height-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.transition-indicator {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
  font-weight: 500;
}

.transition-indicator[data-transition="LEVEL"] {
  background: var(--neutral-soft);
  color: var(--muted-foreground);
}

.transition-indicator[data-transition="DESCENT"] {
  background: var(--wheel-soft);
  color: var(--wheel);
}

.signed-height-note {
  margin-top: 8px;
}

.mirror-field {
  margin-top: 12px;
}

.feature-field,
.feature-range {
  margin-top: 14px;
}

.range-control.is-locked {
  padding: 10px;
  border-radius: 9px;
  background: var(--surface-subtle);
}

.input-error {
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.metric {
  min-width: 0;
  padding: 14px 16px;
}

.metric + .metric {
  border-left: 1px solid var(--border);
}

.metric-label,
.metric-context {
  display: block;
}

.metric-label {
  margin-bottom: 7px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  overflow: hidden;
  font-size: 16px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.explorer-shell[data-contact-formulation="feature-resolved"] .metric-strip {
  grid-template-columns:
    minmax(0, 1.3fr)
    minmax(0, 0.95fr)
    minmax(0, 0.75fr)
    minmax(0, 1.15fr)
    minmax(0, 0.85fr);
}

.metric-context {
  min-height: 17px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.direction-badge,
.status-badge {
  min-width: 42px;
  padding: 3px 8px;
  background: var(--neutral-soft);
  color: var(--muted-foreground);
}

.metric[data-status="pass"] .status-badge {
  background: var(--success-soft);
  color: var(--success);
}

.metric[data-status="fail"] .status-badge {
  background: var(--danger-soft);
  color: var(--danger);
}

.metric[data-window="outside"] .metric-context {
  color: var(--danger);
}

.figure-heading {
  padding: 16px 18px 4px;
}

.figure-heading p {
  margin-bottom: 0;
}

.kernel-status {
  color: var(--success);
  font-size: 12px;
  font-weight: 500;
}

.kernel-status[data-status="error"] {
  color: var(--danger);
}

.figure-stage {
  width: 100%;
  padding: 0 12px;
}

#wheel-figure {
  display: block;
  width: 100%;
  height: auto;
  min-height: 360px;
}

#wheel-figure text {
  fill: var(--foreground);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
}

#wheel-figure .secondary-label {
  fill: var(--muted-foreground);
  font-size: 12px;
}

#wheel-figure .dimension-label,
#wheel-figure .angle-label {
  paint-order: stroke fill;
  stroke: var(--surface);
  stroke-linejoin: round;
  stroke-width: 4px;
}

#wheel-figure .dimension-label {
  fill: var(--muted-foreground);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

#wheel-figure .angle-label {
  fill: var(--motion);
  font-size: 12px;
  font-weight: 500;
}

#wheel-figure .callout-label {
  fill: var(--foreground);
  font-size: 13px;
  font-weight: 500;
  paint-order: stroke fill;
  stroke: var(--surface);
  stroke-linejoin: round;
  stroke-width: 4px;
}

#wheel-figure .callout-label.outgoing {
  fill: var(--outgoing);
}

#wheel-figure .callout-label.incoming {
  fill: var(--incoming);
}

#wheel-figure .callout-label.edge {
  fill: var(--edge);
}

#wheel-figure .callout-label.hub-label {
  fill: var(--foreground);
}

#wheel-figure .callout-leader {
  fill: none;
  stroke: var(--construction);
  stroke-linecap: round;
  stroke-width: 1.15;
}

#wheel-figure .callout-leader.outgoing {
  stroke: var(--outgoing);
}

#wheel-figure .callout-leader.incoming {
  stroke: var(--incoming);
}

#wheel-figure .callout-leader.edge {
  stroke: var(--edge);
}

#wheel-figure .terrain-fill {
  fill: var(--terrain);
  stroke: none;
}

#wheel-figure .terrain-boundary {
  fill: none;
  stroke: var(--terrain-line);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

#wheel-figure .construction {
  fill: none;
  stroke: var(--construction);
  stroke-dasharray: 6 5;
  stroke-width: 1.2;
  opacity: 0.72;
}

#wheel-figure .projection {
  fill: none;
  stroke: var(--construction);
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

#wheel-figure .spoke {
  fill: none;
  stroke: var(--construction);
  stroke-width: 1;
  opacity: 0.76;
}

#wheel-figure .wheel-foot {
  fill: none;
  stroke: var(--wheel);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

#wheel-figure .contact-arm {
  fill: none;
  stroke: var(--motion);
  stroke-linecap: round;
  stroke-width: 2;
}

#wheel-figure .angle-arc {
  fill: none;
  stroke: var(--motion);
  stroke-linecap: round;
  stroke-width: 2.2;
}

#wheel-figure .hub {
  fill: var(--surface);
  stroke: var(--foreground);
  stroke-width: 2;
}

#wheel-figure .foot-center {
  fill: var(--surface);
  stroke: var(--construction);
  stroke-width: 1.4;
}

#wheel-figure .outgoing-contact {
  fill: var(--outgoing);
  stroke: var(--surface);
  stroke-width: 2;
}

#wheel-figure .incoming-contact {
  fill: var(--incoming);
  stroke: var(--surface);
  stroke-width: 2;
}

#wheel-figure .physical-edge {
  fill: var(--surface);
  stroke: var(--edge);
  stroke-width: 2.5;
}

#wheel-figure .feature-tangent {
  fill: none;
  stroke: var(--motion);
  stroke-dasharray: 7 4;
  stroke-linecap: round;
  stroke-width: 2.2;
}

#wheel-figure .feature-dimension {
  fill: none;
  stroke: var(--construction);
  stroke-linecap: square;
  stroke-width: 1.15;
}

#wheel-figure .penetration {
  fill: none;
  stroke: var(--danger);
  stroke-linecap: round;
  stroke-width: 6;
}

#wheel-figure .worst-point {
  fill: var(--danger);
  stroke: var(--surface);
  stroke-width: 2;
}

#wheel-figure .dimension {
  fill: none;
  stroke: var(--construction);
  stroke-width: 1.25;
}

#wheel-figure .error-message {
  fill: var(--danger);
  font-size: 15px;
  font-weight: 500;
}

.figure-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 18px 16px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  flex: 0 0 auto;
  gap: 8px 15px;
  color: var(--muted-foreground);
  font-size: 11px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-line {
  display: inline-block;
  width: 20px;
  border-top: 3px solid;
}

.wheel-line {
  border-color: var(--wheel);
}

.penetration-line {
  border-color: var(--danger);
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.outgoing-dot {
  background: var(--outgoing);
}

.incoming-dot {
  background: var(--incoming);
}

.active-contact-dot {
  background: var(--motion);
}

.legend-edge {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 2px solid var(--edge);
  background: var(--surface);
}

.claim-note {
  max-width: 560px;
  text-align: right;
}

.validation-panel {
  padding: 18px;
  border-top: 1px solid var(--border);
  background: color-mix(
    in srgb,
    var(--surface-subtle) 44%,
    var(--surface)
  );
}

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

.validation-heading h2,
.validation-heading p {
  margin-bottom: 0;
}

.validation-kicker {
  color: var(--wheel);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
}

.reference-regression {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--neutral-soft);
  color: var(--muted-foreground);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.035em;
}

.reference-regression[data-status="pass"] {
  background: var(--success-soft);
  color: var(--success);
}

.reference-regression[data-status="fail"] {
  background: var(--danger-soft);
  color: var(--danger);
}

.validation-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.validation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.validation-row > span {
  min-width: 0;
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.35;
}

.validation-row > strong {
  color: var(--muted-foreground);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-align: right;
}

.validation-row > small {
  grid-column: 1 / -1;
  min-width: 0;
  color: var(--muted-foreground);
  font-size: 9px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.validation-row[data-status="pass"] > strong,
.validation-row[data-status="on-surface"] > strong {
  color: var(--success);
}

.validation-row[data-status="fail"] > strong,
.validation-row[data-status="off-surface"] > strong {
  color: var(--danger);
}

.validation-row[data-status="not-evaluated"] > strong,
.validation-row[data-status="not-applicable"] > strong,
.validation-row[data-status="unavailable"] > strong {
  color: var(--muted-foreground);
}

.validation-claim-note {
  margin: 11px 0 0;
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 1.5;
}

.animation-panel {
  padding: 20px 18px 18px;
  border-top: 1px solid var(--border);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--wheel-soft) 22%, var(--surface)) 0,
      var(--surface) 92px
    );
}

.animation-heading,
.animation-controls,
.animation-export-row,
.animation-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.animation-heading {
  align-items: flex-start;
  margin-bottom: 8px;
}

.path-settings {
  margin: 13px 0 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: color-mix(
    in srgb,
    var(--surface-subtle) 62%,
    var(--surface)
  );
}

.path-settings-heading {
  margin-bottom: 9px;
}

.path-settings-heading h3,
.path-settings-heading p {
  margin-bottom: 0;
}

.path-settings-heading p {
  margin-top: 3px;
  line-height: 1.45;
}

.path-setting-controls {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1.2fr);
  gap: 12px;
}

.path-number-field > span small {
  margin-left: 4px;
  color: var(--muted-foreground);
  font-weight: 400;
}

.path-number-field .number-with-unit {
  width: 100%;
}

.path-number-field input {
  min-width: 0;
  width: 100%;
}

.recovery-extent-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 11px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.recovery-extent-summary > div {
  min-width: 0;
  padding: 8px 10px;
}

.recovery-extent-summary > div + div {
  border-left: 1px solid var(--border);
}

.recovery-extent-summary span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-foreground);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.045em;
}

.recovery-extent-summary strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recovery-extent-summary[data-status="pass"] > div:last-child strong {
  color: var(--success);
}

.recovery-extent-summary[data-status="fail"] > div:last-child strong {
  color: var(--danger);
}

#recovery-extent-status[data-status="fail"] {
  color: var(--danger);
}

.animation-heading h2,
.animation-heading p {
  margin-bottom: 0;
}

.animation-kicker {
  color: var(--wheel);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
}

.animation-claim {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 27px;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--motion) 38%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--success-soft) 58%, var(--surface));
  color: var(--success);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

.animation-stage {
  position: relative;
  width: 100%;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

#animation-figure {
  display: block;
  width: 100%;
  height: auto;
  min-height: 330px;
}

#animation-figure text {
  fill: var(--foreground);
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
}

#animation-figure .animation-background {
  fill: var(--surface);
}

#animation-figure .terrain-fill {
  fill: var(--terrain);
  stroke: none;
}

#animation-figure .terrain-boundary {
  fill: none;
  stroke: var(--terrain-line);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

#animation-figure .terrain-extent-limit {
  fill: none;
  stroke: var(--edge);
  stroke-dasharray: 4 4;
  stroke-width: 1.4;
}

#animation-figure .terrain-extent-label {
  fill: var(--edge);
  font-size: 10px;
}

#animation-figure .material-track {
  fill: none;
  stroke-linecap: round;
  stroke-width: 1.45;
  opacity: 0.3;
}

#animation-figure .material-track.outgoing {
  stroke: var(--outgoing);
  stroke-dasharray: 7 5;
}

#animation-figure .material-track.incoming {
  stroke: var(--incoming);
  stroke-dasharray: 3 5;
}

#animation-figure .hub-center-trajectory {
  fill: none;
  stroke: var(--wheel);
  stroke-dasharray: 2 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
  opacity: 0.68;
}

#animation-figure .reference-target {
  fill: var(--surface);
  stroke: var(--construction);
  stroke-width: 1.5;
  opacity: 0.75;
}

#animation-figure .support-marker {
  fill: var(--surface);
  stroke: var(--motion);
  stroke-width: 1.8;
}

#animation-figure .physical-edge {
  fill: var(--surface);
  stroke: var(--edge);
  stroke-width: 2.4;
}

#animation-figure .spoke {
  fill: none;
  stroke: var(--construction);
  stroke-width: 1.1;
  opacity: 0.74;
}

#animation-figure .wheel-foot {
  fill: none;
  stroke: var(--wheel);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4.2;
}

#animation-figure .wheel-foot.active {
  stroke: color-mix(in srgb, var(--wheel) 55%, var(--motion));
  stroke-width: 5.8;
}

#animation-figure .hub {
  fill: var(--surface);
  stroke: var(--foreground);
  stroke-width: 2;
}

#animation-figure .material-marker {
  stroke: var(--surface);
  stroke-width: 2;
}

#animation-figure .material-marker.outgoing {
  fill: var(--outgoing);
}

#animation-figure .material-marker.incoming {
  fill: var(--incoming);
}

#animation-figure .body-reference {
  fill: var(--surface);
  stroke: var(--edge);
  stroke-width: 2;
}

#animation-figure .body-reference-label {
  fill: var(--edge);
  font-size: 9px;
  font-weight: 600;
}

#animation-figure .active-contact {
  fill: color-mix(in srgb, var(--motion) 24%, var(--surface));
  stroke: var(--motion);
  stroke-width: 2.8;
}

#animation-figure .active-contact.double {
  fill: color-mix(in srgb, var(--motion) 38%, var(--surface));
}

#animation-figure .active-contact-label {
  fill: var(--success);
  font-size: 9px;
  font-weight: 600;
}

#animation-figure .callout-label {
  fill: var(--foreground);
  font-size: 11px;
  font-weight: 500;
  paint-order: stroke fill;
  stroke: var(--surface);
  stroke-linejoin: round;
  stroke-width: 4px;
}

#animation-figure .callout-label.outgoing {
  fill: var(--outgoing);
}

#animation-figure .callout-label.incoming {
  fill: var(--incoming);
}

#animation-figure .callout-label.edge {
  fill: var(--edge);
}

#animation-figure .callout-label.endpoint {
  fill: var(--muted-foreground);
  font-size: 10px;
  font-weight: 400;
}

#animation-figure .callout-leader {
  fill: none;
  stroke: var(--construction);
  stroke-linecap: round;
  stroke-width: 1.05;
  opacity: 0.88;
}

#animation-figure .callout-leader.outgoing {
  stroke: var(--outgoing);
}

#animation-figure .callout-leader.incoming {
  stroke: var(--incoming);
}

#animation-figure .callout-leader.edge {
  stroke: var(--edge);
}

#animation-figure .callout-leader.endpoint {
  opacity: 0.62;
}

#animation-figure .penetration {
  fill: none;
  stroke: var(--danger);
  stroke-linecap: round;
  stroke-width: 6;
}

#animation-figure .worst-point {
  fill: var(--danger);
  stroke: var(--surface);
  stroke-width: 2;
}

#animation-figure .landmark-label,
#animation-figure .frame-label {
  fill: var(--muted-foreground);
  font-size: 11px;
}

#animation-figure .frame-label {
  font-variant-numeric: tabular-nums;
  paint-order: stroke fill;
  stroke: var(--surface);
  stroke-linejoin: round;
  stroke-width: 4px;
}

#animation-figure .frame-phase {
  fill: var(--foreground);
  font-weight: 500;
}

#animation-figure .frame-meta {
  fill: var(--muted-foreground);
}

#animation-figure .claim-label {
  fill: var(--success);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.035em;
}

#animation-figure .unavailable-label {
  fill: var(--muted-foreground);
  font-size: 14px;
  font-weight: 500;
}

.animation-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-subtle);
}

.animation-readout > div {
  min-width: 0;
  padding: 10px 12px;
}

.animation-readout > div + div {
  border-left: 1px solid var(--border);
}

.animation-readout > div:nth-child(n + 4) {
  border-top: 1px solid var(--border);
}

.animation-readout > div:nth-child(3n + 1) {
  border-left: 0;
}

.readout-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-foreground);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.animation-readout strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.animation-readout [data-status="pass"] strong {
  color: var(--success);
}

.animation-readout [data-status="fail"] strong {
  color: var(--danger);
}

.animation-controls {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) 86px auto;
  margin-top: 12px;
}

.transport-controls,
.export-controls,
.animation-legend {
  display: flex;
  align-items: center;
  gap: 7px;
}

.transport-controls button,
.export-controls button {
  min-height: 34px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
}

#animation-play {
  min-width: 64px;
  border-color: var(--wheel);
  background: var(--wheel);
  color: #ffffff;
}

#animation-play:disabled {
  border-color: var(--input-border);
  background: var(--neutral-soft);
  color: var(--muted-foreground);
}

.timeline-control {
  min-width: 0;
}

.timeline-keyframes {
  position: relative;
  height: 12px;
  margin-top: 3px;
  color: var(--muted-foreground);
  font-size: 9px;
}

.timeline-keyframes span,
.timeline-keyframes button {
  position: absolute;
  top: 0;
  white-space: nowrap;
}

.timeline-keyframes .timeline-start {
  left: 0;
}

.timeline-keyframes .timeline-transition {
  left: 50%;
  min-height: 0;
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: var(--wheel);
  font: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  transform: translateX(-50%);
}

.timeline-keyframes .timeline-transition:disabled {
  color: var(--muted-foreground);
  cursor: default;
  opacity: 0.6;
}

.timeline-keyframes .timeline-end {
  right: 0;
}

.compact-field {
  display: grid;
  gap: 4px;
  color: var(--muted-foreground);
  font-size: 10px;
}

.compact-field select {
  min-height: 34px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.track-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-foreground);
  font-size: 11px;
  white-space: nowrap;
}

.track-toggle input {
  accent-color: var(--wheel);
}

.track-toggle-group {
  display: grid;
  gap: 5px;
}

.animation-export-row {
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.animation-legend {
  flex-wrap: wrap;
  color: var(--muted-foreground);
  font-size: 10px;
}

.animation-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-ring {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--construction);
  border-radius: 50%;
  background: var(--surface);
}

.animation-legend .legend-line {
  display: inline-block;
  width: 15px;
  height: 0;
  border-top: 2px dashed var(--wheel);
}

.export-label {
  margin-right: 2px;
  color: var(--muted-foreground);
  font-size: 10px;
}

.animation-footer {
  align-items: flex-start;
  margin-top: 10px;
}

.animation-warning,
.export-status {
  margin-bottom: 0;
  font-size: 10px;
  line-height: 1.45;
}

.animation-warning {
  max-width: 52%;
  color: var(--danger);
}

.export-status {
  color: var(--muted-foreground);
  text-align: right;
}

.export-status[data-status="error"] {
  color: var(--danger);
}

.export-status[data-status="success"] {
  color: var(--success);
}

.animation-panel[data-available="false"] .animation-stage {
  background: var(--surface-subtle);
}

.map-panel {
  padding: 18px;
  border-top: 1px solid var(--border);
}

.control-panel > .map-panel {
  margin-top: 18px;
  padding: 18px 0 0;
}

.feature-map-note {
  margin-top: 18px;
  padding: 17px 0 0;
  border-top: 1px solid var(--border);
}

.feature-map-note h2 {
  font-size: 15px;
}

.feature-map-note p {
  margin-bottom: 0;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.55;
}

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

.map-heading p {
  margin-bottom: 0;
  line-height: 1.45;
}

.map-resolution {
  flex: 0 0 auto;
  color: var(--muted-foreground);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.map-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: center;
}

.map-stage {
  min-width: 0;
}

#obstacle-map {
  display: block;
  width: 100%;
  height: auto;
  touch-action: pan-y;
}

#obstacle-map[data-interactive="true"] {
  cursor: crosshair;
}

#obstacle-map text {
  fill: var(--foreground);
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
}

#obstacle-map .map-axis-label,
#obstacle-map .map-tick-label {
  fill: var(--muted-foreground);
}

#obstacle-map .map-axis-label {
  font-size: 12px;
}

#obstacle-map .map-tick-label {
  font-size: 10px;
}

#obstacle-map .map-grid-line {
  stroke: var(--border);
  stroke-width: 1;
}

#obstacle-map .map-zero-line {
  stroke: var(--foreground);
  stroke-dasharray: 5 4;
  stroke-width: 1.75;
}

#obstacle-map .map-zero-label {
  fill: var(--foreground);
  font-size: 10px;
  font-weight: 600;
}

#obstacle-map .map-plot-frame {
  fill: none;
  stroke: var(--foreground);
  stroke-width: 1.25;
}

#obstacle-map .map-cell {
  stroke: none;
  shape-rendering: crispEdges;
}

#obstacle-map .map-cell-arc-pass {
  fill: var(--map-pass);
}

#obstacle-map .map-cell-arc-fail {
  fill: var(--map-fail);
}

#obstacle-map .map-cell-no-canonical-solution {
  fill: var(--map-none);
}

#obstacle-map .map-reference-marker {
  fill: var(--surface);
  stroke: var(--muted-foreground);
  stroke-width: 1.5;
}

#obstacle-map .map-reference-label {
  fill: var(--muted-foreground);
  font-size: 9px;
  font-weight: 500;
}

#obstacle-map .map-reference-marker.is-descent {
  fill: var(--neutral-soft);
}

#obstacle-map .map-current-halo {
  fill: var(--surface);
  stroke: var(--surface);
  stroke-width: 5;
}

#obstacle-map .map-current-marker {
  fill: none;
  stroke: var(--foreground);
  stroke-width: 2.5;
}

#obstacle-map .map-current-cross {
  stroke: var(--foreground);
  stroke-linecap: round;
  stroke-width: 1.5;
}

.map-context {
  min-width: 0;
}

.map-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 14px;
  color: var(--muted-foreground);
  font-size: 11px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.map-swatch {
  display: inline-block;
  flex: 0 0 auto;
  width: 15px;
  height: 11px;
}

.map-pass {
  background: var(--map-pass);
}

.map-fail {
  background: var(--map-fail);
}

.map-none {
  background: var(--map-none);
}

.map-current-symbol {
  display: inline-block;
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border: 2px solid var(--foreground);
  border-radius: 50%;
  background: var(--surface);
}

.map-summary,
.map-current,
.map-claim {
  margin-bottom: 0;
  font-size: 12px;
  line-height: 1.5;
}

.map-summary {
  margin-top: 16px;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.map-current {
  margin-top: 7px;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}

.map-current[data-window="outside"] {
  color: var(--danger);
}

.map-claim {
  margin-top: 11px;
  color: var(--muted-foreground);
}

@media (max-width: 1040px) {
  .selection-bar {
    grid-template-columns: 1fr 1fr;
  }

  .preset-fieldset {
    grid-column: 1 / -1;
  }

  .workspace {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .explorer-shell[data-contact-formulation="feature-resolved"] .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .validation-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .metric:nth-child(2n + 1) {
    border-left: 0;
  }

  .animation-controls {
    grid-template-columns: auto minmax(180px, 1fr) 82px;
  }

  .track-toggle-group {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .explorer-shell {
    padding: 18px;
  }

  .page-heading,
  .figure-footer,
  .animation-heading,
  .animation-export-row,
  .animation-footer,
  .map-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .selection-bar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .claim-note {
    max-width: none;
    text-align: left;
  }

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

  #wheel-figure {
    min-height: 310px;
  }

  #animation-figure {
    min-height: 280px;
  }

  .animation-readout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .animation-readout > div:nth-child(3) {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .animation-readout > div:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

  .animation-readout > div:nth-child(2n + 1) {
    border-left: 0;
  }

  .animation-readout > div:nth-child(4) {
    border-left: 1px solid var(--border);
  }

  .animation-controls {
    grid-template-columns: auto 80px;
  }

  .timeline-control {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .transport-controls {
    grid-column: 1;
    grid-row: 2;
  }

  .compact-field {
    grid-column: 2;
    grid-row: 2;
  }

  .track-toggle-group {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .animation-warning {
    max-width: none;
  }

  .export-status {
    text-align: left;
  }
}

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

  .selection-bar,
  .control-panel {
    padding: 14px;
  }

  .preset-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .explorer-shell[data-contact-formulation="feature-resolved"] .metric-strip {
    grid-template-columns: 1fr;
  }

  .metric + .metric {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .section-heading,
  .figure-heading,
  .validation-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .validation-list {
    grid-template-columns: 1fr;
  }

  #wheel-figure {
    min-height: 260px;
  }

  #wheel-figure .callout-label {
    font-size: 20px;
    stroke-width: 6px;
  }

  #wheel-figure .dimension-label {
    font-size: 16px;
    stroke-width: 5px;
  }

  #wheel-figure .angle-label {
    font-size: 18px;
    stroke-width: 5px;
  }

  #wheel-figure .callout-leader {
    stroke-width: 1.5;
  }

  .animation-panel {
    padding: 17px 12px 15px;
  }

  .animation-claim {
    white-space: normal;
  }

  #animation-figure {
    min-height: 235px;
  }

  #animation-figure .callout-label {
    font-size: 18px;
    stroke-width: 6px;
  }

  #animation-figure .callout-label.endpoint {
    font-size: 15px;
  }

  #animation-figure .frame-label {
    font-size: 15px;
    stroke-width: 6px;
  }

  #animation-figure .callout-leader {
    stroke-width: 1.45;
  }

  .animation-readout {
    grid-template-columns: 1fr;
  }

  .animation-readout > div + div,
  .animation-readout > div:nth-child(3),
  .animation-readout > div:nth-child(4),
  .animation-readout > div:nth-child(n + 5) {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .animation-controls {
    grid-template-columns: 1fr;
  }

  .timeline-control,
  .transport-controls,
  .compact-field,
  .track-toggle-group {
    grid-column: 1;
    grid-row: auto;
  }

  .path-setting-controls,
  .recovery-extent-summary {
    grid-template-columns: 1fr;
  }

  .recovery-extent-summary > div + div {
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .compact-field select {
    width: 100%;
  }

  .transport-controls button {
    flex: 1 1 0;
  }

  .export-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .export-controls button {
    width: 100%;
  }

  .export-label {
    grid-column: 1 / -1;
  }

  .control-panel > .map-panel {
    padding: 16px 0 0;
  }

  .map-legend {
    grid-template-columns: 1fr;
  }
}
