/* Carbonara Emulsion Lab — additions for the output-amount control and the
   per-constituent silky-window indicators. Loaded after the original sheet. */

/* ---------- control rows: four columns (label / slider / output / window) ---------- */

.control-row,
.stepper-row {
  grid-template-columns: minmax(108px, .7fr) minmax(142px, 1.15fr) minmax(54px, auto) 78px;
  min-height: 58px;
}

.control-row > output { grid-column: 3; }

.control-row > .tune {
  grid-column: 4;
  justify-self: end;
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 0;
  border: 0;
  background: 0 0;
  color: inherit;
  cursor: pointer;
  font-family: var(--condensed);
  font-variant-numeric: tabular-nums;
}

.control-row > .tune:disabled { cursor: default; }

.tune-text {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: .66rem;
  letter-spacing: .02em;
  white-space: nowrap;
  color: var(--cyan);
}

.tune-text b { font-weight: 600; }
.tune-text i { font-style: normal; color: #3c4a4d; font-size: .62rem; }
.tune-text b.tight { color: var(--amber); }
.tune-text .dir { font-size: .74rem; line-height: 1; }

.tune[data-state="out"] .tune-text { color: var(--amber); }
.tune[data-state="out"] .tune-text .dir { color: var(--orange); }
.tune[data-state="out"] .tune-text b { color: var(--amber); }
.tune[data-state="none"] .tune-text { color: var(--muted); }
.tune[data-state="none"] .tune-text b { color: var(--muted); }
.tune[data-state="none"] .tune-text .dir { color: var(--muted); }

.tune:not(:disabled):hover .tune-text { color: var(--cream); }
.tune:not(:disabled):hover .tune-text b.tight { color: var(--gold); }
.tune:not(:disabled):active { transform: translateY(1px); }

.tune-static { color: var(--muted) !important; }
.tune-static .tune-text { color: var(--muted); font-size: .58rem; letter-spacing: .08em; text-transform: uppercase; }

.tune-bar {
  position: relative;
  display: block;
  width: 64px;
  height: 3px;
  background: #171c1e;
  box-shadow: inset 0 0 0 1px #2b3234;
  overflow: hidden;
}

.tune-bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  background: #7ad7f040;
  border-left: 1px solid #7ad7f0a0;
  border-right: 1px solid #7ad7f0a0;
}

.tune-bar b {
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 1px;
  background: var(--cyan);
  box-shadow: 0 0 5px var(--cyan);
}

.tune[data-state="out"] .tune-bar b { background: var(--orange); box-shadow: 0 0 5px var(--orange); }
.tune[data-state="none"] .tune-bar b { background: var(--muted); box-shadow: none; }

/* ---------- silky window strip above each slider ---------- */

.window {
  position: relative;
  height: 4px;
  margin: 0 0 3px;
  background: #1a2022;
  box-shadow: inset 0 0 0 1px #313a3c;
  border-radius: 2px;
  overflow: hidden;
}

.window-band {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--lo, 0) * 100%);
  width: calc((var(--hi, 0) - var(--lo, 0)) * 100%);
  background: linear-gradient(90deg, #48a9e6a8, #7ad7f0d6);
  box-shadow: 0 0 7px #7ad7f033;
}

.window[data-state="out"] .window-band { display: none; }

/* ---------- batch row ---------- */

.batch-row { --accent: var(--cyan) !important; }
.batch-row > output { color: var(--cyan); text-shadow: 0 0 14px #7ad7f047; }
.batch-row label { color: var(--cream); }
.batch-row { border-bottom: 1px solid #3f4749; }

/* ---------- silky window summary ---------- */

.tune-summary {
  border-top: 1px solid var(--line);
  background: #0c1011e6;
  padding: 10px 18px 12px;
}

.tune-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: var(--condensed);
  font-size: .55rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #737a7c;
}

.tune-summary-head strong {
  font-size: .6rem;
  letter-spacing: .07em;
  color: var(--cyan);
}

.tune-summary-head strong[data-state="out"] { color: var(--amber); }
.tune-summary-head strong[data-state="none"] { color: var(--orange); }

.tune-summary-body {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-top: 5px;
}

.tune-summary-body p {
  margin: 0;
  font-family: var(--condensed);
  font-size: .73rem;
  line-height: 1.45;
  color: var(--muted);
}

.tune-summary-body p strong { color: var(--cream); font-weight: 600; }

.tune-summary-body .move {
  display: inline-block;
  margin-right: 10px;
  white-space: nowrap;
  color: var(--amber);
}

.snap-button {
  flex: none;
  padding: 4px 9px;
  border: 1px solid #4a5355;
  background: #171c1e;
  color: var(--cyan);
  font-family: var(--condensed);
  font-size: .58rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 3px;
}

.snap-button:hover { border-color: var(--cyan); color: var(--cream); }
.snap-button[hidden] { display: none; }

/* ---------- run button label ---------- */

.run-button { display: flex; align-items: center; justify-content: center; }
.run-button .play-mark { margin-right: 18px; }

/* ---------- status headline: wrap inside the readout column ---------- */

.status h2 {
  font-size: clamp(1.1rem, 1.32vw, 1.35rem);
  line-height: 1.05;
  overflow-wrap: normal;
  hyphens: none;
  max-width: 100%;
}

/* ---------- narrower layouts ---------- */

@media (width <= 1220px) {
  .control-row,
  .stepper-row { grid-template-columns: minmax(100px, .68fr) minmax(120px, 1.1fr) minmax(50px, auto) 72px; }
  .control-row > .tune { width: 72px; }
  .tune-bar { width: 60px; }
}

@media (width <= 760px) {
  .control-row,
  .stepper-row { grid-template-columns: minmax(92px, .6fr) minmax(112px, 1.2fr) minmax(48px, auto) 68px; gap: 12px; }
  .control-row > .tune { width: 68px; }
  .tune-bar { width: 56px; }
  .tune-text { font-size: .58rem; gap: 4px; }
}

@media (width <= 540px) {
  .control-row { grid-template-columns: 1fr auto auto; row-gap: 7px; min-height: 74px; }
  .control-row label { grid-area: 1 / 1; }
  .control-row > output { grid-area: 1 / 2; }
  .control-row > .tune { grid-area: 1 / 3; width: 62px; }
  .slider-wrap { grid-area: 2 / 1 / auto / 4; }
  .stepper-row { grid-template-columns: 1fr auto auto; }
  .stepper-row .stepper { grid-area: 1 / 2; width: 128px; }
  .tune-bar { width: 52px; }
  .tune-static { margin-left: 8px; }
  .tune-summary-body { display: block; }
  .snap-button { margin-top: 8px; }
}

.batch-row .window { display: none; }

/* ---------- legend under the panel heading ---------- */

.panel-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 7px 18px 6px;
  font-family: var(--condensed);
  font-size: .5rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #6b7375;
  border-bottom: 1px solid #232a2c;
}

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

.panel-legend i {
  display: block;
  width: 16px;
  height: 4px;
  border-radius: 1px;
  background: linear-gradient(90deg, #48a9e6a8, #7ad7f0d6);
}

/* ---------- readout: keep the superscript off the label ---------- */

.primary-readings strong { line-height: 1; }
.primary-readings sup { top: -.1em; }
