/* src/styles.css */
:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #60706c;
  --faint: #dbe3df;
  --paper: #f7f3ea;
  --panel: #fffaf1;
  --teal: #197c7c;
  --teal-dark: #0e5658;
  --coral: #c95b46;
  --gold: #c58b2d;
  --plum: #744f82;
  --green: #547d4f;
  --shadow: 0 18px 50px rgba(38, 43, 39, 0.14);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body,
#app {
  width: 100%;
  min-height: 100%;
  margin: 0;
}
body {
  background:
    linear-gradient(
      135deg,
      rgba(25, 124, 124, 0.08),
      transparent 36%),
    linear-gradient(
      315deg,
      rgba(201, 91, 70, 0.09),
      transparent 32%),
    var(--paper);
  color: var(--ink);
}
button,
input,
select {
  font: inherit;
}
button {
  border: 1px solid rgba(23, 33, 31, 0.16);
  background: #ffffff;
  color: var(--ink);
  border-radius: 8px;
  min-height: 36px;
  padding: 0 12px;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}
button:hover {
  border-color: rgba(25, 124, 124, 0.46);
  transform: translateY(-1px);
}
button.is-active {
  background: var(--teal-dark);
  color: #ffffff;
  border-color: var(--teal-dark);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 16px 24px 12px;
}
.topbar h1,
.readout-panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: 0;
}
.kicker {
  margin: 0 0 4px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.toolbar,
.segmented,
.preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(480px, 1fr) minmax(300px, 360px);
  gap: 16px;
  height: calc(100vh - 76px);
  min-height: 650px;
  padding: 0 16px 16px;
}
.panel {
  min-width: 0;
  overflow: auto;
  border: 1px solid rgba(23, 33, 31, 0.12);
  background: rgba(255, 250, 241, 0.92);
  box-shadow: var(--shadow);
}
.control-panel,
.readout-panel {
  padding: 18px;
}
.panel-section {
  padding: 0 0 18px;
  margin: 0 0 18px;
  border-bottom: 1px solid rgba(23, 33, 31, 0.1);
}
.panel-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}
.section-heading strong {
  color: var(--ink);
  text-align: right;
  text-transform: none;
}
.field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.field select,
.field input[type=range] {
  grid-column: 1 / -1;
}
.field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(23, 33, 31, 0.16);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
}
.field output {
  min-width: 54px;
  color: var(--ink);
  text-align: right;
}
input[type=range] {
  width: 100%;
  accent-color: var(--teal);
}
.segmented {
  margin-top: 12px;
}
.segmented button {
  flex: 1 1 92px;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}
.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.model-lab {
  display: grid;
  grid-template-rows: minmax(340px, 1.15fr) minmax(290px, 0.85fr);
  gap: 16px;
  min-width: 0;
  min-height: 0;
}
.model-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 33, 31, 0.12);
  background: rgba(255, 250, 241, 0.86);
  box-shadow: var(--shadow);
}
.model-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 11px 14px 9px;
  border-bottom: 1px solid rgba(23, 33, 31, 0.1);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}
.model-heading strong {
  color: var(--ink);
  text-transform: none;
}
.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 50% 42%,
      rgba(255, 255, 255, 0.95),
      rgba(236, 229, 212, 0.72) 64%),
    #ece5d4;
}
.circle-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 50% 46%,
      rgba(255, 255, 255, 0.94),
      rgba(236, 229, 212, 0.7) 68%),
    #ece5d4;
}
#scene,
#circleScene {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}
#circleScene {
  cursor: crosshair;
}
.label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.value-label,
.axis-label {
  position: absolute;
  pointer-events: auto;
  max-width: 128px;
  padding: 5px 7px;
  border: 1px solid rgba(23, 33, 31, 0.14);
  background: rgba(255, 250, 241, 0.88);
  color: var(--ink);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  transform: translate(-50%, -50%);
  box-shadow: 0 6px 18px rgba(23, 33, 31, 0.1);
  white-space: normal;
}
.value-label.is-muted {
  opacity: 0.42;
}
.value-label.is-selected {
  border-color: rgba(201, 91, 70, 0.72);
  background: #ffffff;
  color: #7a2b1f;
}
.value-label.is-region:not(.is-selected) {
  border-color: rgba(25, 124, 124, 0.5);
  background: rgba(255, 255, 255, 0.94);
  color: var(--teal-dark);
}
.axis-label {
  max-width: 150px;
  color: var(--teal-dark);
}
.beacon-upload {
  margin-top: 8px;
}
.beacon-upload input[type=file] {
  font-size: 11px;
  width: 100%;
}
.beacon-status {
  font-size: 11px;
  color: #6b6152;
  margin: 4px 0 0;
}
.beacon-status.is-error {
  color: #b23b2e;
}
.beacon-label-layer {
  z-index: 3;
}
.beacon-label {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -150%);
  padding: 1px 6px;
  border: 1px solid rgba(120, 110, 95, 0.35);
  border-left: 3px solid var(--beacon-color, #888);
  background: rgba(255, 250, 241, 0.86);
  color: #2a2018;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.beacon-label.is-active {
  background: #fffaf1;
  color: #12100c;
  font-weight: 700;
  z-index: 6;
}
.archetype-status {
  color: #7a5a1e;
}
.archetype-label-layer {
  z-index: 4;
}
.archetype-label {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -160%);
  padding: 1px 7px;
  border: 1px solid color-mix(in srgb, var(--archetype-color, #8a6d2f) 55%, rgba(70, 55, 30, 0.4));
  background:
    linear-gradient(
      180deg,
      rgba(255, 251, 242, 0.94),
      rgba(248, 240, 224, 0.9));
  color: #33270f;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.25;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.archetype-label::before {
  content: "\25c7  ";
  color: var(--archetype-color, #8a6d2f);
  letter-spacing: 0;
}
.archetype-label.is-active {
  background: #fffdf6;
  color: #171208;
  border-color: var(--archetype-color, #8a6d2f);
  z-index: 6;
}
.beacon-info {
  position: absolute;
  top: 14px;
  right: 14px;
  width: min(320px, 74%);
  max-height: 84%;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  background: rgba(255, 250, 241, 0.97);
  border: 1px solid rgba(120, 110, 95, 0.4);
  border-radius: 12px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.18);
  z-index: 20;
  font-size: 12px;
  color: #241f18;
  pointer-events: auto;
}
.beacon-info[hidden] {
  display: none;
}
.beacon-info-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.beacon-info-swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.15);
}
.beacon-info-title strong {
  font-size: 15px;
  display: block;
}
.beacon-info-title span {
  font-size: 10.5px;
  color: #6b6152;
}
.beacon-info-close {
  margin-left: auto;
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #6b6152;
}
.beacon-info-coords {
  font-size: 10.5px;
  color: #6b6152;
  margin-bottom: 8px;
}
.beacon-info-scroll {
  overflow-y: auto;
}
.beacon-info-values {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.beacon-info-values th {
  text-align: left;
  color: #8a8072;
  font-weight: 600;
  border-bottom: 1px solid rgba(120, 110, 95, 0.25);
  padding: 2px 4px;
}
.beacon-info-values td {
  padding: 2px 4px;
  border-bottom: 1px solid rgba(120, 110, 95, 0.12);
}
.beacon-info-sliders {
  font-size: 10.5px;
  color: #4a4236;
  margin-top: 6px;
  word-break: break-word;
}
.beacon-info-sliders strong {
  color: #241f18;
}
.legend {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 8px 10px;
  border: 1px solid rgba(23, 33, 31, 0.12);
  background: rgba(255, 250, 241, 0.86);
  color: var(--muted);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
}
.circle-legend {
  bottom: 12px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.legend-swatch.openness {
  background: var(--teal);
}
.legend-swatch.transcendence {
  background: var(--coral);
}
.legend-swatch.selected {
  background: var(--gold);
}
.legend-swatch.aggregate {
  background: #17211f;
  box-shadow: inset 0 0 0 2px rgba(255, 250, 241, 0.92);
}
.mix-summary {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid rgba(23, 33, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}
.mix-summary strong,
.mix-summary span {
  display: block;
}
.mix-summary strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}
.mix-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
.expression-slider {
  position: relative;
}
.goal-ghost {
  position: absolute;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid rgba(64, 156, 255, 0.95);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
  pointer-events: none;
  z-index: 2;
}
.goal-rank-badge {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 650;
  color: #58a6ff;
  white-space: nowrap;
}
.goal-rank-badge.is-matched {
  color: #3fb96f;
}
.expression-row.is-locked input[type=range] {
  opacity: 0.55;
  cursor: not-allowed;
}
.expression-row.is-locked .drag-handle {
  opacity: 0.4;
  pointer-events: none;
}
.random-mix-btn {
  width: 100%;
  margin-top: 8px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 550;
  padding: 8px 10px;
  border: 1px solid rgba(23, 33, 31, 0.22);
  border-radius: 9px;
  background: rgba(23, 33, 31, 0.06);
  color: inherit;
  cursor: pointer;
}
.random-mix-btn:hover {
  background: rgba(23, 33, 31, 0.1);
}
.random-mix-btn:active {
  transform: scale(0.99);
}
.mix-color-swatch,
.value-color-swatch {
  display: inline-block;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(23, 33, 31, 0.16), 0 2px 8px rgba(23, 33, 31, 0.12);
}
.mix-color-swatch {
  width: 28px;
  height: 28px;
  background: rgba(23, 33, 31, 0.18);
  position: relative;
  overflow: hidden;
}
.mix-color-swatch.is-metallic::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.78) 0%,
      rgba(255, 255, 255, 0) 26%,
      rgba(0, 0, 0, 0.36) 54%,
      rgba(255, 255, 255, 0.58) 80%,
      rgba(255, 255, 255, 0) 100%);
  opacity: calc(0.4 + 0.55 * var(--metal, 0));
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.mix-color-swatch.is-metallic::after {
  content: "";
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: -60%;
  width: 55%;
  background:
    linear-gradient(
      100deg,
      transparent 0%,
      rgba(255, 255, 255, 0.2) 38%,
      rgba(255, 255, 255, 0.95) 50%,
      rgba(255, 255, 255, 0.2) 62%,
      transparent 100%);
  transform: skewX(-16deg);
  opacity: calc(0.55 + 0.45 * var(--metal, 0));
  mix-blend-mode: screen;
  pointer-events: none;
  animation: auraSheenSweep 2.6s linear infinite;
}
@keyframes auraSheenSweep {
  0% {
    left: -60%;
  }
  100% {
    left: 130%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mix-color-swatch.is-metallic::after {
    animation: none;
    left: 34%;
  }
}
.value-color-swatch {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
}
.selected-values-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}
.selected-value-row {
  display: grid;
  gap: 7px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(23, 33, 31, 0.08);
}
.selected-value-row.is-dragging,
.expression-row.is-dragging {
  opacity: 0.46;
}
.selected-value-row.is-drop-target,
.expression-row.is-drop-target {
  border-color: rgba(197, 139, 45, 0.78);
  box-shadow: inset 0 2px 0 rgba(197, 139, 45, 0.8);
}
.selected-value-row:last-child {
  border-bottom: 0;
}
.selected-value-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.selected-value-head strong {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.drag-handle {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(23, 33, 31, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
  cursor: grab;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  touch-action: none;
  user-select: none;
}
.drag-handle:active {
  cursor: grabbing;
}
.mix-remove {
  flex: 0 0 auto;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}
.mix-weight {
  display: grid;
  grid-template-columns: 44px 1fr 42px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.mix-weight output {
  color: var(--ink);
  font-weight: 850;
  text-align: right;
}
.mix-coupling {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}
.expression-summary {
  align-items: start;
}
.pool-summary {
  margin: -2px 0 12px;
  padding: 8px 10px;
  border: 1px solid rgba(23, 33, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}
.pool-summary strong {
  color: var(--ink);
}
.expression-controls {
  display: grid;
  gap: 13px;
}
.expression-family {
  display: grid;
  gap: 9px;
  min-width: 0;
}
.expression-family h3 {
  margin: 2px 0 0;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.expression-row {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(23, 33, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}
.expression-head {
  display: grid;
  gap: 3px;
}
.expression-head strong {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}
.expression-head strong span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}
.expression-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.3;
}
.expression-slider {
  display: grid;
  grid-template-columns: 58px 1fr 44px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}
.expression-slider input {
  min-width: 0;
}
.expression-slider output {
  color: var(--ink);
  font-weight: 850;
  text-align: right;
}
.pole-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
}
.pole-labels span:last-child {
  text-align: right;
}
.expression-ownership {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.3;
}
.score-block {
  display: grid;
  grid-template-columns: 86px 1fr;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(23, 33, 31, 0.1);
}
.score-block p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.score-ring {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 999px;
  background:
    conic-gradient(
      var(--teal) 0deg,
      var(--teal) var(--score-angle, 360deg),
      rgba(23, 33, 31, 0.12) var(--score-angle, 360deg)),
    #ffffff;
  box-shadow: inset 0 0 0 9px #ffffff;
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
}
.coordinate-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
}
.coordinate-list div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(23, 33, 31, 0.08);
}
.coordinate-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.coordinate-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}
.value-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.theory-list {
  display: grid;
  gap: 11px;
}
.theory-list h2 {
  margin: 5px 0 0;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}
.theory-list p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}
.theory-list a {
  color: var(--teal-dark);
  font-weight: 850;
  text-decoration-color: rgba(25, 124, 124, 0.35);
  text-underline-offset: 3px;
}
.theory-list a:hover {
  text-decoration-color: var(--teal-dark);
}
.theory-note {
  padding: 10px 11px;
  border: 1px solid rgba(25, 124, 124, 0.18);
  border-radius: 8px;
  background: rgba(25, 124, 124, 0.06);
}
.model-comparison {
  display: grid;
  gap: 12px;
}
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.comparison-grid div {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(23, 33, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}
.comparison-grid strong,
.comparison-grid span,
.comparison-grid em {
  display: block;
}
.comparison-grid strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}
.comparison-grid span {
  margin: 7px 0 5px;
  color: var(--teal-dark);
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
}
.comparison-grid em,
.comparison-note {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}
.comparison-method {
  display: grid;
  gap: 8px;
  margin: 0;
}
.comparison-method div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(23, 33, 31, 0.08);
}
.comparison-method dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.comparison-method dd {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
.comparison-note {
  margin: 0;
}
.claim-list {
  display: grid;
  gap: 9px;
}
.claim-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid rgba(23, 33, 31, 0.08);
}
.claim-row:last-child {
  border-bottom: 0;
}
.claim-row strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}
.claim-row span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.claim-badge {
  min-width: 78px;
  padding: 5px 7px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 850;
  text-align: center;
}
.claim-badge.strong {
  background: var(--green);
}
.claim-badge.medium {
  background: var(--teal);
}
.claim-badge.open {
  background: var(--gold);
}
.claim-badge.weak {
  background: var(--coral);
}
.source-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(23, 33, 31, 0.08);
}
.source-list > strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}
.source-list a {
  display: block;
  padding: 9px 10px;
  border: 1px solid rgba(23, 33, 31, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--teal-dark);
  text-decoration: none;
}
.source-list a:hover {
  border-color: rgba(25, 124, 124, 0.38);
  background: #ffffff;
}
.source-list span,
.source-list em {
  display: block;
}
.source-list span {
  font-size: 12px;
  font-weight: 850;
}
.source-list em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}
.risk-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.risk-list li {
  padding: 10px 11px;
  border-left: 4px solid var(--teal);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}
.risk-list li.warn {
  border-left-color: var(--gold);
}
.risk-list li.fail {
  border-left-color: var(--coral);
}
@media (max-width: 1180px) {
  .layout {
    grid-template-columns: minmax(260px, 300px) 1fr;
    grid-template-rows: minmax(460px, 1fr) auto;
    height: auto;
    min-height: calc(100vh - 76px);
  }
  .readout-panel {
    grid-column: 1 / -1;
  }
}
@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }
  .layout {
    display: flex;
    flex-direction: column;
    padding: 0 12px 12px;
  }
  .model-lab {
    order: 1;
    grid-template-rows: minmax(360px, 52vh) minmax(320px, 46vh);
    margin-bottom: 12px;
  }
  .control-panel {
    order: 2;
  }
  .readout-panel {
    order: 3;
  }
  .panel {
    margin-bottom: 12px;
  }
  .stage {
    height: auto;
    min-height: 0;
  }
  .toolbar button,
  .preset-grid button,
  .segmented button {
    min-width: 0;
    padding: 0 10px;
  }
}
