/* One location for the three teaching sequences; diagrams keep their native form. */
#pod, #deploy, #scale { padding-top: 19px; }
#pod > .room-heading,
#deploy > .room-heading,
#scale > .room-heading {
  min-block-size: 104px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.stage-rail {
  position: sticky;
  top: 0;
  z-index: 15;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 40px 48px minmax(0, 1fr) minmax(190px, 250px);
  gap: 8px;
  align-items: center;
  padding: 10px;
  margin: 0 0 16px;
  border: 1px solid #bccbb7;
  border-radius: 4px;
  background: #f3f5eb;
  color: var(--ink);
  box-shadow: 0 3px 10px #183c3509;
}

.stage-rail .stage-navigation { display: contents !important; }
.stage-rail .stage-navigation > :nth-child(1) { grid-column: 1; grid-row: 1; }
.stage-rail .stage-navigation > :nth-child(2) { grid-column: 2; grid-row: 1; }
.stage-rail .stage-navigation > :nth-child(3) { grid-column: 4; grid-row: 1; }
.stage-rail .stage-navigation button {
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 6px 9px;
  font: 600 12px/1.4 var(--sans);
  border: 1px solid #a8bda0;
  border-radius: 3px;
  background: #fafbf5;
  color: var(--teal);
  white-space: normal;
}
.stage-rail .stage-navigation > :last-child {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}
#scale > .stage-rail { margin: 0 0 16px; padding: 10px; }
.stage-rail #batch-next,
.stage-rail #supply-guide-next,
#scale .stage-rail #experiment-next {
  background: var(--teal);
  color: var(--white);
  border: 1px solid var(--teal);
  box-shadow: none;
  padding: 6px 9px;
  font: 600 12px/1.4 var(--sans);
  width: 100%;
  max-width: none;
  justify-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
#scale .stage-rail #experiment-back { width: auto; }
.stage-rail .stage-navigation > span { font: 10px/1.4 var(--mono); text-align: center; }
.stage-rail .stage-choices {
  display: grid;
  grid-column: 3;
  grid-row: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  width: auto;
  padding: 0;
  margin: 0;
  border: 0;
}
.stage-rail .capacity-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stage-rail .stage-choices button {
  min-width: 0;
  height: 44px;
  padding: 4px;
  border: 1px solid #bbcbb1;
  border-radius: 3px;
  background: #fafbf5;
  color: #45634b;
  font: 11px/1.35 var(--sans);
}
.stage-rail .stage-choices button[aria-pressed=true] {
  background: #dce9cf;
  border-color: var(--teal);
  box-shadow: inset 0 -2px var(--teal);
  color: var(--ink);
  font-weight: 700;
}
.stage-helper { margin: -8px 0 14px; font: 10px/1.6 var(--sans); color: var(--muted); }
#pod:not(.touring) > .stage-rail { display: none; }
.stage-rail #experiment-dots { display: none; }
.scale-room:not(.guided) .stage-prompt,
.scale-room:not(.guided) .guided-replay { display: none; }
.guided-replay { margin: 10px 0; }
.stage-prompt { margin-top: 12px; font: 13px/1.65 var(--sans); color: #d5e4cc; }

/* Keep the shell consistent; the capacity diagram still uses its dark data field. */
#scale { background: var(--paper); color: var(--ink); }
#scale h2 em { color: var(--teal); }
#scale .capacity-lede { color: var(--muted); }
#scale .room-heading .note-button { color: var(--muted); border-color: #9cac9d; }
#scale .lesson-path button { color: var(--muted); }
#scale .lesson-path button[aria-current] { color: var(--teal); border-color: var(--teal); }
#scale .lesson-path > span { color: #9aa99b; }
.supply-clear .supply-title h3 { min-block-size: 2.4em; line-height: 1.2; }
.scale-room .scale-readout h3 { min-block-size: 2.4em; line-height: 1.2; }

@media (max-width: 760px) {
  #pod, #deploy, #scale { padding-top: 13px; }
  #pod > .room-heading,
  #deploy > .room-heading,
  #scale > .room-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-block-size: 132px;
    gap: 6px;
  }
  #pod > .room-heading .note-button,
  #deploy > .room-heading .note-button,
  #scale > .room-heading .note-button {
    justify-self: end;
    min-height: 32px;
    padding: 3px 0;
    max-width: none;
  }
  .stage-rail { grid-template-columns: minmax(0, 1fr); padding: 8px; gap: 7px; }
  #scale > .stage-rail { padding: 8px; }
  .stage-rail .stage-navigation {
    display: grid !important;
    grid-template-columns: 36px 42px minmax(0, 1fr);
    grid-column: 1;
    grid-row: 1;
    gap: 6px;
    margin: 0;
  }
  .stage-rail .stage-navigation > :nth-child(n) { grid-column: auto; grid-row: auto; }
  .stage-rail .stage-navigation button { font-size: 11px; }
  .stage-rail .stage-choices { grid-column: 1; grid-row: 2; }
  .stage-rail .stage-choices button { font-size: 10px; height: 40px; }
  .supply-clear .supply-title h3 { min-block-size: 4.8em; }
  #pod .pod-view { height: 230px; min-height: 230px; flex: 0 0 auto; }
  #pod .pod-stage { flex: 0 0 auto; }
}

@media print { .stage-rail { display: none !important; } }
