/* figure layouts specific to the Cobweb explainer; tokens and shared figure parts come from /education/sim.css */

ol.ops { margin: 0 auto 1rem; padding-left: 1.6rem; }
ol.ops li { margin-bottom: 0.3rem; }

/* operator scenarios */
.split-fig--ms, .split-fig--sm { grid-template-columns: minmax(0, 1fr) 300px; }
.ops-stage { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.incoming {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px dashed var(--ink); padding: 8px 10px; margin-bottom: 12px; background: var(--linen);
}
.incoming .what { font: 500 0.78rem/1.35 var(--mono); }
.incoming .tag { font: 700 0.66rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: 3px; }
.scores { margin-bottom: 10px; }
.score-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) 46px; gap: 8px; align-items: center; margin: 4px 0; font: 500 0.78rem/1 var(--mono); }
.score-row .op { padding: 4px 6px; text-align: center; border: 1px solid var(--ink); }
.score-row .track { height: 14px; border: 1px solid var(--rule); background: var(--linen); }
.score-row .bar { height: 100%; transition: width 0.45s ease; }
.score-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.score-row.is-na { color: var(--ink-3); }
.score-row.is-na .op { border-style: dashed; }
.score-row.is-win .num { font-weight: 700; }
.score-row.is-win .op { box-shadow: 2px 2px 0 var(--ink); }
.scores .score-head { font: 600 0.7rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }

/* Hayes-Roth bars */
.hr-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; align-items: center; margin: 3px 0; }
.hr-label { font-size: 0.86rem; display: flex; align-items: center; gap: 6px; justify-content: flex-end; text-align: right; }
.hr-badge { font: 600 0.64rem/1.5 var(--mono); padding: 0 5px; border: 1px solid var(--ink); white-space: nowrap; }
.hr-badge--0 { background: var(--butter); }
.hr-badge--10 { background: var(--mint); }
.hr-track { position: relative; height: 18px; }
.hr-track .zero { position: absolute; top: -3px; bottom: -3px; width: 1.5px; background: var(--ink); }
.hr-track .bar { position: absolute; top: 2px; bottom: 2px; transition: left 0.4s ease, width 0.4s ease; }
.hr-track .val { position: absolute; top: 0; font: 500 0.72rem/18px var(--mono); white-space: nowrap; transition: left 0.4s ease; }
.hr-axis { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; margin-top: 6px; }
.hr-axis .ends { display: flex; justify-content: space-between; font: 500 0.7rem/1 var(--mono); color: var(--ink-3); }

/* Medin & Schaffer grid */
.ms-wrap { display: grid; grid-template-columns: auto repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 520px; margin: 0 auto; }
.ms-head { font: 600 0.7rem/1.2 var(--mono); color: var(--ink-3); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 2px; }
.ms-head--row { align-items: center; justify-content: flex-end; padding: 0 4px 0 0; }
.ms-cell {
  appearance: none; cursor: pointer; position: relative; aspect-ratio: 1 / 0.9; min-height: 64px;
  border: 2px solid var(--ink-3); background: var(--linen); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font: 500 0.74rem/1.15 var(--mono); padding: 4px;
}
.ms-cell .id { font-weight: 700; font-size: 0.86rem; }
.ms-cell .p { color: var(--ink-2); }
.ms-cell--A { border-color: var(--coral); }
.ms-cell--B { border-color: var(--cobalt); }
.ms-cell--A.ms-cell--train { background: #ffd8cf; }
.ms-cell--B.ms-cell--train { background: #d5e0ff; }
.ms-cell--transfer { border-style: dashed; }
.ms-cell--empty { cursor: default; border: 1px dotted var(--rule); color: var(--ink-3); }
.ms-cell.is-neighbor { box-shadow: inset 0 0 0 4px var(--butter); }
.ms-cell.is-selected { outline: 3px solid var(--ink); outline-offset: 2px; }
.ms-cell:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.ms-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin-top: 10px; font: 500 0.72rem/1.3 var(--mono); color: var(--ink-2); }
.ms-legend i { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-right: 4px; border: 2px solid var(--ink-3); }

/* Smith & Minda chart */
.sm-chart > svg { width: 100%; height: auto; display: block; }
.sm-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; font: 500 0.72rem/1.3 var(--mono); color: var(--ink-2); margin-top: 6px; }
.sm-legend svg { vertical-align: -3px; margin-right: 4px; }
.sm-seg-label { margin-left: 8px; }
.controls .label--math { text-transform: none; font-size: 0.95rem; }

@media (max-width: 760px) {
  .split-fig--ms, .split-fig--sm, .ops-stage { grid-template-columns: minmax(0, 1fr); }
  .hr-row, .hr-axis { grid-template-columns: 132px minmax(0, 1fr); gap: 8px; }
  .hr-label { font-size: 0.76rem; }
  .ms-cell { min-height: 54px; font-size: 0.66rem; }
}
