/* Shared planning interface for the public demonstration and private workspace. */
.lab-shell {
  --lab-ink: #183447;
  --lab-muted: #5a6e7d;
  --lab-line: #dbe4e8;
  --lab-surface: #fff;
  --lab-soft: #f3f7f8;
  --lab-accent: #087f87;
  --lab-positive: #087b60;
  --lab-negative: #b13e4d;
  color: var(--lab-ink);
}
[data-theme="dark"] .lab-shell {
  --lab-ink: #eff5f7;
  --lab-muted: #9caeb9;
  --lab-line: #2a3c4b;
  --lab-surface: #102331;
  --lab-soft: #152c3b;
  --lab-accent: #57c9d0;
  --lab-positive: #74d9b6;
  --lab-negative: #ff9caa;
}
.lab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 6px 0 18px;
}
.lab-header h1 {
  margin: 3px 0 5px;
  font:
    700 clamp(26px, 3vw, 36px)/1.15 "Manrope",
    system-ui,
    sans-serif;
  letter-spacing: -0.035em;
  color: var(--lab-ink);
}
.lab-header p {
  margin: 0;
  font-size: 13px;
  color: var(--lab-muted);
}
.lab-eyebrow {
  display: block;
  color: var(--lab-accent);
  font-size: 10px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.lab-evidence {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--lab-muted);
}
.lab-evidence::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #bc914d;
  flex-shrink: 0;
}
.lab-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.45fr);
  align-items: start;
  gap: 22px;
}
.lab-inputs {
  min-width: 0;
  border: 1px solid var(--lab-line);
  background: var(--lab-surface);
  border-radius: 12px;
  overflow: clip;
}
.lab-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  background: var(--lab-soft);
  border-bottom: 1px solid var(--lab-line);
}
.lab-presets button {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--lab-muted);
  font-size: 11px;
  font-weight: 600;
  transition:
    background 0.18s,
    color 0.18s,
    box-shadow 0.18s;
}
.lab-presets button.active {
  color: var(--lab-ink);
  background: var(--lab-surface);
  box-shadow: 0 1px 5px #0001;
}
.lab-input-group {
  margin: 0;
  padding: 20px;
  border: 0;
  border-bottom: 1px solid var(--lab-line);
  min-width: 0;
}
.lab-input-group h2,
.lab-input-group legend,
.lab-input-group summary {
  margin: 0 0 16px;
  color: var(--lab-ink);
  font-size: 13px;
  font-weight: 700;
}
.lab-group-heading {
  display: flex;
  gap: 10px;
  align-items: center;
}
.lab-group-heading svg {
  height: 17px;
  width: 17px;
  color: var(--lab-accent);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
.lab-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 12px;
}
.lab-select-grid .lab-control {
  margin: 0;
}
.lab-select-grid .lab-control > small,
.lab-select-grid .lab-control > input[type="range"] {
  display: none;
}
.lab-field {
  display: grid;
  gap: 6px;
  color: var(--lab-ink);
  font-size: 12px;
  min-width: 0;
}
.lab-field > span {
  font-weight: 600;
}
.lab-field input,
.lab-field select,
.lab-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--lab-line);
  border-radius: 6px;
  color: var(--lab-ink);
  background: var(--lab-soft);
  padding: 9px 10px;
  font: inherit;
  min-height: 38px;
}
.lab-field textarea {
  min-height: 72px;
  resize: vertical;
}
.lab-field small,
.lab-control small {
  color: var(--lab-muted);
  font-size: 11px;
  line-height: 1.55;
  font-weight: 400;
}
.lab-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 12px;
  margin: 0 0 18px;
}
.lab-control:last-child {
  margin-bottom: 0;
}
.lab-control > label {
  font-size: 12px;
  font-weight: 600;
  color: var(--lab-ink);
  line-height: 1.45;
}
.lab-value-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}
.lab-value-wrap > span {
  color: var(--lab-muted);
  font-size: 11px;
}
.lab-value-wrap input {
  width: 82px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--lab-line);
  border-radius: 6px;
  color: var(--lab-ink);
  background: var(--lab-soft);
  text-align: right;
  font:
    600 13px/1.3 "DM Sans",
    system-ui,
    sans-serif;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
}
.lab-value-wrap input::-webkit-inner-spin-button {
  appearance: none;
}
.lab-control input[type="range"],
.lab-inspection input {
  grid-column: 1/-1;
  width: 100%;
  height: 18px;
  margin: 0;
  padding: 0;
  cursor: ew-resize;
  accent-color: var(--lab-accent);
}
.lab-shell input[type="range"] {
  appearance: none;
  height: 5px;
  margin: 7px 0;
  border: 0;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    var(--lab-accent) var(--range-fill, 0%),
    var(--lab-line) var(--range-fill, 0%)
  );
}
.lab-shell input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 2px solid var(--lab-surface);
  border-radius: 50%;
  background: var(--lab-accent);
  box-shadow: 0 0 0 1px var(--lab-accent);
}
.lab-shell input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 2px solid var(--lab-surface);
  border-radius: 50%;
  background: var(--lab-accent);
}
.lab-shell input[type="range"]:disabled {
  opacity: 0.35;
  cursor: default;
}
.lab-control > small {
  grid-column: 1/-1;
}
.lab-control output {
  font: inherit;
}
.lab-number-error {
  grid-column: 1/-1;
  color: var(--lab-negative);
  font-size: 11px;
}
.lab-inputs details {
  border-bottom: 1px solid var(--lab-line);
}
.lab-inputs details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 18px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  color: var(--lab-ink);
}
.lab-inputs details > summary::-webkit-details-marker {
  display: none;
}
.lab-inputs details > summary::after {
  content: "+";
  color: var(--lab-accent);
  font-size: 19px;
  font-weight: 400;
}
.lab-inputs details[open] > summary::after {
  content: "−";
}
.lab-inputs details > .lab-input-group {
  padding-top: 2px;
}
.lab-inputs details[open] > .lab-input-group {
  animation: lab-reveal 0.18s ease-out;
}
.lab-input-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 20px;
}
.lab-results {
  position: sticky;
  top: 86px;
  min-width: 0;
  align-self: start;
}
.lab-outcome {
  padding: 20px 22px 14px;
  background: var(--lab-surface);
  border: 1px solid var(--lab-line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}
.lab-outcome-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 7px;
}
.lab-outcome h2 {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--lab-muted);
}
.lab-outcome-line strong {
  display: block;
  font:
    700 clamp(30px, 3vw, 42px)/1.15 "Manrope",
    system-ui,
    sans-serif;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.lab-outcome p {
  margin: 8px 0 0;
  color: var(--lab-muted);
  font-size: 10px;
  line-height: 1.5;
}
.is-surplus {
  color: var(--lab-positive);
}
.is-shortfall {
  color: var(--lab-negative);
}
.lab-delta {
  padding: 7px 10px;
  border: 1px solid var(--lab-line);
  border-radius: 7px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.lab-delta small {
  display: block;
  font-size: 9px;
  color: var(--lab-muted);
  font-weight: 400;
  margin-top: 2px;
}
.lab-chart-host {
  border: 1px solid var(--lab-line);
  background: var(--lab-surface);
  padding: 14px 20px 16px;
}
.lab-chart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.lab-chart-heading h3 {
  font-size: 13px;
  line-height: 1.4;
  margin: 3px 0 0;
  color: var(--lab-ink);
}
.lab-live {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--lab-accent);
}
.lab-live i {
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
}
.lab-chart-legend {
  display: flex;
  gap: 20px;
  margin: 12px 0 4px;
  color: var(--lab-muted);
  font-size: 10px;
}
.lab-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.lab-chart-legend i {
  width: 16px;
  border-top: 2px solid var(--lab-accent);
}
.lab-chart-legend .chart-baseline {
  border-color: var(--lab-muted);
  border-top-style: dashed;
}
.lab-chart {
  display: block;
  width: 100%;
  height: auto;
  max-height: 255px;
  overflow: visible;
  touch-action: pan-y;
}
.lab-chart .plot-surplus {
  fill: var(--lab-positive);
  opacity: 0.045;
}
.lab-chart .plot-shortfall {
  fill: var(--lab-negative);
  opacity: 0.055;
}
.plot-grid {
  stroke: var(--lab-line);
  stroke-width: 0.8;
}
.plot-zero {
  stroke: var(--lab-muted);
  stroke-width: 1;
}
.plot-label {
  fill: var(--lab-muted);
  font-size: 11px;
  font-family: "DM Sans", system-ui, sans-serif;
}
.plot-axis {
  fill: var(--lab-muted);
  font-size: 10px;
}
.plot-current {
  stroke: var(--lab-accent);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: d 0.2s ease-out;
}
.plot-reference {
  stroke: var(--lab-muted);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
  opacity: 0.6;
  transition: d 0.2s ease-out;
}
.plot-threshold {
  stroke: var(--lab-positive);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0.7;
}
.plot-threshold-label {
  fill: var(--lab-positive);
  font-size: 10px;
  font-weight: 600;
}
.plot-marker-halo {
  fill: var(--lab-accent);
  opacity: 0.12;
  transition:
    cx 0.18s,
    cy 0.18s;
}
.plot-marker {
  fill: var(--lab-accent);
  stroke: var(--lab-surface);
  stroke-width: 2.5;
  transition:
    cx 0.18s,
    cy 0.18s;
}
.plot-inspect {
  stroke: var(--lab-muted);
  stroke-width: 1;
  opacity: 0.4;
  stroke-dasharray: 2 4;
}
.plot-inspect-marker {
  fill: var(--lab-surface);
  stroke: var(--lab-accent);
  stroke-width: 1.5;
}
.lab-chart-insight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  font-size: 10px;
  color: var(--lab-muted);
  font-variant-numeric: tabular-nums;
}
.lab-chart-insight span:first-child {
  color: var(--lab-ink);
  font-weight: 600;
}
.lab-inspection {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  border-top: 1px solid var(--lab-line);
  padding-top: 10px;
  color: var(--lab-muted);
  font-size: 10px;
}
.lab-inspection > span {
  display: flex;
  justify-content: space-between;
}
.lab-inspection small {
  font-size: 9px;
}
.lab-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--lab-line);
  border-top: 0;
  background: var(--lab-surface);
  border-radius: 0 0 12px 12px;
}
.lab-stat {
  padding: 13px 16px;
  border-right: 1px solid var(--lab-line);
  min-width: 0;
}
.lab-stat:last-child {
  border-right: 0;
}
.lab-stat small {
  display: block;
  font-size: 10px;
  color: var(--lab-muted);
  margin-bottom: 5px;
}
.lab-stat b {
  display: block;
  font:
    700 20px/1.2 "Manrope",
    system-ui,
    sans-serif;
  color: var(--lab-ink);
  font-variant-numeric: tabular-nums;
}
.lab-stat span {
  display: block;
  margin-top: 4px;
  color: var(--lab-muted);
  font-size: 9px;
  line-height: 1.4;
}
.lab-verdict {
  display: flex;
  align-items: start;
  gap: 9px;
  color: var(--lab-ink);
  font-size: 12px;
  line-height: 1.6;
  margin: 12px 1px 0;
}
.lab-verdict::before {
  content: "↗";
  color: var(--lab-accent);
  font-size: 18px;
  line-height: 1.2;
}
.lab-method {
  margin-top: 12px;
  border: 1px solid var(--lab-line);
  border-radius: 8px;
  background: var(--lab-surface);
}
.lab-method summary {
  cursor: pointer;
  padding: 12px 15px;
  color: var(--lab-muted);
  font-size: 11px;
}
.lab-method-body {
  padding: 0 15px 15px;
  font-size: 11px;
  color: var(--lab-muted);
}
.lab-method .data-table th,
.lab-method .data-table td {
  font-size: 11px;
}
.lab-mobile-expand {
  display: none;
}
.lab-validation {
  font-size: 12px;
  color: var(--lab-negative);
  line-height: 1.6;
  padding: 10px 0;
}
.lab-chart-empty {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 30px;
  text-align: center;
  color: var(--lab-muted);
  border: 1px dashed var(--lab-line);
  border-radius: 12px;
  background: var(--lab-surface);
}
@keyframes lab-reveal {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (min-width: 1440px) {
  .lab-layout {
    grid-template-columns: minmax(320px, 0.75fr) minmax(0, 1.4fr);
    gap: 28px;
  }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .lab-layout {
    grid-template-columns: minmax(250px, 0.85fr) minmax(0, 1fr);
    gap: 16px;
  }
  .lab-chart-host {
    padding: 14px 12px;
  }
  .lab-chart-insight {
    display: block;
  }
  .lab-chart-insight span {
    display: block;
  }
  .lab-outcome {
    padding: 16px;
  }
  .lab-delta {
    font-size: 11px;
  }
  .lab-stat {
    padding: 12px 9px;
  }
  .lab-stat b {
    font-size: 17px;
  }
}
@media (max-width: 760px) {
  .lab-header {
    display: block;
    margin: 0 0 12px;
  }
  .lab-header h1 {
    font-size: 28px;
  }
  .lab-header p {
    font-size: 12px;
  }
  .lab-header .lab-evidence {
    margin-top: 8px;
    font-size: 10px;
  }
  .lab-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .lab-inputs {
    width: 100%;
  }
  .lab-results {
    order: -1;
    position: sticky;
    top: 0;
    z-index: 12;
    width: 100%;
    background: var(--lab-surface);
    border-radius: 10px;
    box-shadow: 0 6px 18px #001b2b16;
  }
  .lab-outcome {
    padding: 10px 13px 7px;
  }
  .lab-outcome > .lab-eyebrow {
    font-size: 8px;
  }
  .lab-outcome-line {
    margin: 2px 0 0;
  }
  .lab-outcome-line h2 {
    font-size: 10px;
    margin-bottom: 2px;
  }
  .lab-outcome-line strong {
    font-size: 27px;
  }
  .lab-outcome p {
    font-size: 8px;
    margin: 4px 0 0;
  }
  .lab-delta {
    font-size: 10px;
    padding: 4px 7px;
  }
  .lab-delta small {
    font-size: 8px;
  }
  .lab-chart-host {
    padding: 4px 10px 6px;
  }
  .lab-chart-heading {
    display: none;
  }
  .lab-chart-legend {
    margin: 3px 0;
    font-size: 8px;
  }
  .lab-chart {
    max-height: 145px;
  }
  .lab-chart-insight {
    padding-top: 1px;
    font-size: 9px;
  }
  .lab-chart-insight span:last-child {
    display: none;
  }
  .lab-inspection {
    display: none;
  }
  .lab-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lab-stat {
    padding: 7px 9px;
  }
  .lab-stat small {
    font-size: 8px;
    margin-bottom: 2px;
  }
  .lab-stat b {
    font-size: 15px;
  }
  .lab-stat span {
    display: none;
  }
  .lab-verdict {
    font-size: 10px;
    margin: 0;
    padding: 7px 10px;
    background: var(--lab-soft);
    border: 1px solid var(--lab-line);
    border-top: 0;
    border-radius: 0 0 8px 8px;
  }
  .lab-verdict::before {
    font-size: 13px;
  }
  .lab-results > .lab-method {
    display: none;
  }
  .lab-mobile-expand {
    display: block;
    position: absolute;
    right: 10px;
    top: 8px;
    background: var(--lab-soft);
    border: 1px solid var(--lab-line);
    border-radius: 5px;
    padding: 4px 7px;
    font-size: 9px;
    color: var(--lab-muted);
  }
  .lab-results:has(.lab-mobile-expand) .lab-outcome > .lab-eyebrow {
    padding-right: 100px;
  }
  .lab-results.expanded {
    position: relative;
  }
  .lab-results.expanded .lab-chart {
    max-height: none;
  }
  .lab-results.expanded .lab-inspection {
    display: grid;
  }
  .lab-results.expanded > .lab-method {
    display: block;
  }
  .lab-input-group {
    padding: 18px;
  }
  .lab-control > label {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lab-shell *,
  .lab-shell *::before,
  .lab-shell *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  .lab-results {
    position: static;
    box-shadow: none;
  }
  .lab-layout {
    display: block;
  }
  .lab-inspection,
  .lab-mobile-expand,
  .lab-input-footer {
    display: none;
  }
  .lab-chart {
    max-height: none;
  }
  .lab-shell {
    --lab-ink: #111;
    --lab-muted: #444;
    --lab-surface: #fff;
    --lab-line: #bbb;
  }
}
