/* Breakdown Lab — member modeling controls. Display only.
 * Independent sliders. Total badge is BMW blue at 100/100, red otherwise.
 * Track/knob match Lab factor health bars: thin bar, wide rectangular thumb.
 * Radius 0, no shadows (production brand contract).
 */
.lab-weights {
  border: 1px solid var(--pro-line, var(--hairline, #e5e5e5));
  background: #fff;
  padding: 14px 16px 12px;
  margin: 0 0 14px;
  color: var(--pro-fg, #262626);
}
/* Live-region announcer: readable by screen readers, never painted. The global
 * .sr-only rule is scoped to .pro-command, so the Lab carries its own. */
.lab-weights .sr-only,
.lab-weights [data-lab-announce] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.lab-preview--dark .lab-weights {
  background: #10141b;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f7f9fc;
}
.lab-weights__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.lab-weights__kicker {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pro-gold, #c8a74a);
}
.lab-weights__title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--pro-fg, #262626);
}
.lab-preview--dark .lab-weights__title { color: #f7f9fc; }
.lab-weights__total {
  font-variant-numeric: tabular-nums;
  font-family: var(--pro-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border: 1px solid currentColor;
  color: #1c69d4;
}
.lab-weights__total.is-complete,
.lab-weights.is-complete .lab-weights__total { color: #1c69d4; }
.lab-weights__total.is-incomplete,
.lab-weights.is-incomplete .lab-weights__total { color: #b91c1c; }
.lab-preview--dark .lab-weights__total.is-complete { color: #6ea8f0; }
.lab-preview--dark .lab-weights__total.is-incomplete { color: #f87171; }

.lab-weights__copy {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--pro-muted, #757575);
  max-width: 62ch;
}
.lab-preview--dark .lab-weights__copy { color: #98a2b3; }
.lab-weights__copy-warn {
  display: none;
  margin: -6px 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: #b91c1c;
}
.lab-weights.is-incomplete .lab-weights__copy-warn { display: block; }
.lab-preview--dark .lab-weights__copy-warn { color: #f87171; }

/* Inline text buttons (Fit to 100 inside the warning, clear tosses). */
.lab-weights__inline {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0 0 0 4px;
  font: inherit;
  font-weight: 800;
  color: #1c69d4;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.lab-weights__inline:hover,
.lab-weights__inline:focus-visible { color: #0653b6; outline: 2px solid #0653b6; outline-offset: 2px; }

/* System vs your view */
.lab-weights__compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.lab-weights__cmp {
  padding: 8px 10px;
  border: 1px solid var(--pro-line, #e5e5e5);
  background: #fafafa;
  min-width: 0;
}
.lab-preview--dark .lab-weights__cmp { background: #07090d; border-color: rgba(255, 255, 255, 0.14); }
.lab-weights__cmp span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pro-muted, #757575);
  margin-bottom: 3px;
}
.lab-weights__cmp strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lab-weights__cmp em {
  font-style: normal;
  font-family: var(--pro-mono, ui-monospace, Menlo, Consolas, monospace);
  font-weight: 700;
  color: #1c69d4;
}
.lab-weights__cmp.is-agree strong { color: var(--pro-ink, #0f3d2c); }
.lab-weights__cmp.is-split strong { color: #b45309; }
.lab-weights__cmp--aligned strong { color: var(--pro-ink, #0f3d2c); }
.lab-weights__cmp--tilted strong { color: #b45309; }
.lab-weights__cmp--contrarian strong { color: #b91c1c; }

/* Presets + toolbar */
.lab-weights__presets,
.lab-weights__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.lab-weights__preset,
.lab-weights__tool,
.lab-weights__mode {
  appearance: none;
  border: 1px solid var(--pro-line, #e5e5e5);
  background: #fff;
  color: var(--pro-fg, #262626);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 0;
}
.lab-preview--dark .lab-weights__preset,
.lab-preview--dark .lab-weights__tool,
.lab-preview--dark .lab-weights__mode {
  background: #07090d;
  border-color: rgba(255, 255, 255, 0.16);
  color: #f7f9fc;
}
.lab-weights__preset:hover,
.lab-weights__preset:focus-visible,
.lab-weights__tool:hover,
.lab-weights__tool:focus-visible,
.lab-weights__mode:hover,
.lab-weights__mode:focus-visible {
  border-color: var(--pro-gold, #c8a74a);
  color: var(--pro-ink, #0f3d2c);
  outline: 2px solid var(--pro-gold, #c8a74a);
  outline-offset: 2px;
}
.lab-weights__preset[aria-pressed="true"],
.lab-weights__mode[aria-checked="true"],
.lab-weights__tool[aria-pressed="true"] {
  background: var(--pro-ink, #0f3d2c);
  border-color: var(--pro-ink, #0f3d2c);
  color: #fff;
}
.lab-weights__tool:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.lab-weights__tool--quiet {
  border-color: transparent;
  color: var(--pro-muted, #757575);
}

/* Share box */
.lab-weights__share {
  border: 1px solid var(--pro-line, #e5e5e5);
  background: #fafafa;
  padding: 10px;
  margin: 0 0 12px;
}
.lab-weights__share-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pro-muted, #757575);
  margin-bottom: 6px;
}
.lab-weights__share-row { display: flex; gap: 8px; }
.lab-weights__share-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--pro-line, #e5e5e5);
  padding: 6px 8px;
  font-family: var(--pro-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 11px;
  color: var(--pro-fg, #262626);
  background: #fff;
  border-radius: 0;
}
.lab-weights__share-status {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--pro-muted, #757575);
}

/* Sections */
.lab-weights__section {
  border-top: 1px solid var(--pro-line, #e5e5e5);
  padding-top: 10px;
  margin-top: 10px;
}
.lab-preview--dark .lab-weights__section { border-color: rgba(255, 255, 255, 0.12); }
.lab-weights__section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 8px;
}
.lab-weights__label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pro-fg, #262626);
}
.lab-weights__hint {
  font-size: 11px;
  line-height: 1.4;
  color: var(--pro-muted, #757575);
}
.lab-weights__modes {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
}
.lab-weights__modes .lab-weights__mode + .lab-weights__mode { margin-left: -1px; }

.lab-weights__toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.lab-weights__toggle input {
  margin: 2px 0 0;
  accent-color: #1c69d4;
  flex: 0 0 auto;
}
.lab-weights__toggle small {
  display: block;
  font-weight: 400;
  color: var(--pro-muted, #757575);
}

/* Slider rows */
.lab-weights__rows { display: grid; gap: 10px; }
.lab-weights__row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 64px;
  gap: 10px;
  align-items: center;
}
.lab-weights__row.is-locked .lab-weights__slider { opacity: 0.55; }
.lab-weights__name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
}
.lab-weights__lock {
  appearance: none;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 1px solid var(--pro-muted, #757575);
  background: transparent;
  cursor: pointer;
  position: relative;
  border-radius: 0;
}
.lab-weights__lock::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: transparent;
}
.lab-weights__lock[aria-pressed="true"] {
  border-color: var(--pro-ink, #0f3d2c);
}
.lab-weights__lock[aria-pressed="true"]::after { background: var(--pro-ink, #0f3d2c); }
.lab-weights__lock:hover,
.lab-weights__lock:focus-visible {
  border-color: var(--pro-gold, #c8a74a);
  outline: 2px solid var(--pro-gold, #c8a74a);
  outline-offset: 2px;
}
.lab-weights__value {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  line-height: 1.1;
}
.lab-weights__value b { display: block; font-weight: 800; }
.lab-weights__value small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--pro-muted, #757575);
}
.lab-weights__value small.is-up { color: var(--pro-ink, #0f3d2c); }
.lab-weights__value small.is-down { color: #b91c1c; }
.lab-weights__track-wrap {
  position: relative;
  display: block;
  min-width: 0;
  padding: 6px 0;
}
.lab-weights__official-tick {
  position: absolute;
  top: 2px;
  width: 2px;
  height: 12px;
  margin-left: -1px;
  background: var(--pro-gold, #c8a74a);
  pointer-events: none;
}
.lab-weights__slider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 4px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(
    to right,
    #1c69d4 0 var(--lab-fill, 50%),
    #e5e5e5 var(--lab-fill, 50%) 100%
  );
}
.lab-weights.is-incomplete .lab-weights__slider {
  background: linear-gradient(
    to right,
    #b91c1c 0 var(--lab-fill, 50%),
    #e5e5e5 var(--lab-fill, 50%) 100%
  );
}
.lab-weights .lab-weights__slider--temp {
  background: linear-gradient(
    to right,
    var(--pro-ink, #0f3d2c) 0 var(--lab-fill, 50%),
    #e5e5e5 var(--lab-fill, 50%) 100%
  );
}
.lab-preview--dark .lab-weights__slider {
  background: linear-gradient(
    to right,
    #1c69d4 0 var(--lab-fill, 50%),
    rgba(255, 255, 255, 0.16) var(--lab-fill, 50%) 100%
  );
}
.lab-preview--dark .lab-weights.is-incomplete .lab-weights__slider {
  background: linear-gradient(
    to right,
    #b91c1c 0 var(--lab-fill, 50%),
    rgba(255, 255, 255, 0.16) var(--lab-fill, 50%) 100%
  );
}
.lab-weights__slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 0;
  background: transparent;
}
.lab-weights__slider::-moz-range-track {
  height: 4px;
  border-radius: 0;
  background: transparent;
}
.lab-weights__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 8px;
  margin-top: -2px;
  background: #1c69d4;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}
.lab-weights.is-incomplete .lab-weights__slider::-webkit-slider-thumb { background: #b91c1c; }
.lab-weights .lab-weights__slider--temp::-webkit-slider-thumb { background: var(--pro-ink, #0f3d2c); }
.lab-weights__slider::-moz-range-thumb {
  width: 22px;
  height: 8px;
  background: #1c69d4;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}
.lab-weights.is-incomplete .lab-weights__slider::-moz-range-thumb { background: #b91c1c; }
.lab-weights .lab-weights__slider--temp::-moz-range-thumb { background: var(--pro-ink, #0f3d2c); }
.lab-preview--dark .lab-weights.is-incomplete .lab-weights__slider::-webkit-slider-thumb,
.lab-preview--dark .lab-weights.is-incomplete .lab-weights__slider::-moz-range-thumb { background: #f87171; }
.lab-weights__slider:focus-visible {
  outline: 2px solid #0653b6;
  outline-offset: 3px;
}

.lab-weights__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--pro-line, #e5e5e5);
  font-size: 11px;
  color: var(--pro-muted, #757575);
}
.lab-weights__foot-note { flex: 1 0 100%; }

/* Per-horse chrome injected into .lab-horse cards */
.lab-weights__delta {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 6px;
  font-family: var(--pro-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pro-muted, #757575);
  border: 1px solid var(--pro-line, #e5e5e5);
  background: #fff;
  flex: 1 0 100%;
  width: fit-content;
}
.lab-weights__delta.is-up { color: var(--pro-ink, #0f3d2c); border-color: rgba(15, 61, 44, 0.45); }
.lab-weights__delta.is-down { color: #b91c1c; border-color: rgba(185, 28, 28, 0.4); }
.lab-weights__delta.is-tossed { color: #757575; text-decoration: line-through; }
.lab-preview--dark .lab-weights__delta.is-up { color: var(--pro-gold, #c8a74a); }

.lab-score--yours strong { color: #1c69d4; }
.lab-weights__edge {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-family: var(--pro-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 10px;
  font-weight: 700;
  color: var(--pro-muted, #757575);
  white-space: nowrap;
}
.lab-weights__edge.is-plus { color: var(--pro-ink, #0f3d2c); }
.lab-weights__edge.is-minus { color: #b91c1c; }

.lab-weights__horse-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--pro-line, #e5e5e5);
}
.lab-weights__drivers {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 11px;
  min-width: 0;
}
.lab-weights__driver { font-weight: 700; }
.lab-weights__driver.is-up { color: var(--pro-ink, #0f3d2c); }
.lab-weights__driver.is-down { color: #b91c1c; }
.lab-weights__driver-adj {
  font-family: var(--pro-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 10px;
  font-weight: 700;
  color: var(--pro-muted, #757575);
  border: 1px solid var(--pro-line, #e5e5e5);
  padding: 1px 6px;
}
.lab-weights__horse-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.lab-weights__toss {
  appearance: none;
  border: 1px solid var(--pro-line, #e5e5e5);
  background: #fff;
  color: var(--pro-fg, #262626);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 9px;
  cursor: pointer;
  border-radius: 0;
}
.lab-weights__toss[aria-pressed="true"] {
  background: #262626;
  border-color: #262626;
  color: #fff;
}
.lab-weights__toss:hover,
.lab-weights__toss:focus-visible {
  border-color: var(--pro-gold, #c8a74a);
  outline: 2px solid var(--pro-gold, #c8a74a);
  outline-offset: 2px;
}
.lab-weights__nudge {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--pro-line, #e5e5e5);
}
.lab-weights__nudge button {
  appearance: none;
  width: 26px;
  border: 0;
  background: #fff;
  color: var(--pro-fg, #262626);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border-radius: 0;
}
.lab-weights__nudge button:disabled { color: #bbbbbb; cursor: not-allowed; }
.lab-weights__nudge button:hover:not(:disabled),
.lab-weights__nudge button:focus-visible { background: rgba(200, 167, 74, 0.16); outline: 2px solid var(--pro-gold, #c8a74a); outline-offset: -2px; }
.lab-weights__nudge b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 0 4px;
  border-left: 1px solid var(--pro-line, #e5e5e5);
  border-right: 1px solid var(--pro-line, #e5e5e5);
  font-family: var(--pro-mono, ui-monospace, Menlo, Consolas, monospace);
  font-size: 11px;
  font-weight: 800;
  background: #fafafa;
}
.lab-weights__nudge b.is-up { color: var(--pro-ink, #0f3d2c); }
.lab-weights__nudge b.is-down { color: #b91c1c; }

/* Card states driven by the member view */
.lab-horse.is-your-top { border-color: #1c69d4; }
.lab-horse.is-your-top > .lab-horse-head { border-left: 3px solid #1c69d4; }
.lab-horse.is-tossed { opacity: 0.6; }
.lab-horse.is-tossed .lab-horse-name { text-decoration: line-through; }
.lab-horse { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .lab-horse { transition: none !important; }
}
@media (max-width: 640px) {
  .lab-weights__row {
    grid-template-columns: 84px minmax(0, 1fr) 52px;
    gap: 8px;
  }
  .lab-weights__horse-tools { flex-direction: column; align-items: flex-start; }
}
