/* Airfoil Lift Curve & Stall Explorer — #456 (scoped styles) */
.case-header {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 20px 6px;
}
.case-header h1 {
  font-size: 1.45rem;
  margin: 0 0 4px;
}
.case-header p {
  margin: 0;
  opacity: 0.75;
  font-size: 0.92rem;
}

.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 20px 32px;
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: rgba(127, 127, 127, 0.07);
  border: 1px solid rgba(127, 127, 127, 0.22);
  border-radius: 10px;
  padding: 12px;
}

.controls h2 {
  margin: 2px 0 10px;
  font-size: 1.05rem;
}
.controls h3 {
  margin: 2px 0 8px;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}
.grp {
  margin-bottom: 14px;
}
.grp:last-child {
  margin-bottom: 2px;
}

.ctl {
  margin: 8px 0;
}
.ctl label {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
  margin-bottom: 2px;
}
.ctl output {
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}
.ctl input[type="range"] {
  width: 100%;
  margin: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips button {
  border: 1px solid rgba(127, 127, 127, 0.4);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}
.chips button.active {
  background: rgba(96, 165, 250, 0.25);
  border-color: rgba(96, 165, 250, 0.7);
}

.preset-note,
.hint {
  font-size: 0.75rem;
  opacity: 0.7;
  margin: 6px 0 0;
  line-height: 1.45;
}

.btnrow {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.btnrow button {
  flex: 1;
  border: 1px solid rgba(127, 127, 127, 0.4);
  background: rgba(127, 127, 127, 0.12);
  color: inherit;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}
.btnrow button.primary {
  background: rgba(96, 165, 250, 0.25);
  border-color: rgba(96, 165, 250, 0.7);
}

/* ---------- stage ---------- */
.stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.statusbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 12px;
}
.badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(127, 127, 127, 0.5);
  background: rgba(127, 127, 127, 0.15);
}
.badge.attached {
  background: rgba(22, 101, 52, 0.35);
  border-color: rgba(74, 222, 128, 0.6);
}
.badge.partial {
  background: rgba(180, 83, 9, 0.35);
  border-color: rgba(251, 191, 36, 0.7);
}
.badge.stalled {
  background: rgba(127, 29, 29, 0.45);
  border-color: rgba(248, 113, 113, 0.8);
}
.elapsed {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}
.legend {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  opacity: 0.85;
  flex-wrap: wrap;
}
.legend .sw {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  margin: 0 2px 0 8px;
}
.legend .sw.lift {
  background: #f87171;
}
.legend .sw.drag {
  background: #fb923c;
}
.legend .sw.res {
  background: #94a3b8;
}
.legend .sw.sep {
  background: rgba(239, 68, 68, 0.4);
}

.canvas-wrap {
  padding: 6px;
}
#mainCanvas {
  display: block;
  width: 100%;
  height: 480px;
}

.readout {
  padding: 0 4px;
  row-gap: 4px;
}
.readout .chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.78rem;
  border: 1px solid rgba(127, 127, 127, 0.3);
  border-radius: 8px;
  padding: 4px 9px;
  background: rgba(127, 127, 127, 0.08);
}
.readout .chip .v {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.charts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 1180px) {
  .charts {
    grid-template-columns: 1fr;
  }
}
.chart-wrap h3 {
  margin: 2px 4px 6px;
  font-size: 0.8rem;
  opacity: 0.75;
  font-weight: 600;
}
.chart-wrap canvas {
  display: block;
  width: 100%;
  height: 190px;
}

.notes summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}
.notes #notesBody {
  margin-top: 8px;
  font-size: 0.8rem;
  line-height: 1.6;
  opacity: 0.85;
}
.notes #notesBody p {
  margin: 6px 0;
}
.notes #notesBody .refs {
  opacity: 0.7;
  font-size: 0.74rem;
}
