/* Manuscript v2 (knob-study revision) figures and tables.
   Scoped to main.ms2 so nothing here reaches model-boundary.html, which
   shares manuscript.css and styles/read.css. Figures are plain HTML/CSS:
   the route's CSP blocks inline styles, so every width and height is a
   preset utility class at the end of this file. */

.ms2 {
  --ms-ink: var(--paper-ink, #171717);
  --ms-muted: var(--paper-muted, #55514a);
  --ms-rule: var(--paper-rule, #c9c5bd);
  --ms-a: #1f4f8b;
  --ms-b: #8f9aa6;
  --ms-c: #596a7b;
  --ms-well: #f1efeb;
}

/* ---------- prose details ---------- */

.ms2 .note-ref {
  font-size: 0.72em;
  line-height: 0;
  vertical-align: super;
}

.ms2 .note-ref a {
  padding: 0 0.12em;
  text-decoration: none;
}

.ms2 .ms-notes {
  padding-left: 1.4em;
  font-size: 0.875rem;
  line-height: 1.5;
}

.ms2 .ms-notes li {
  margin: 0 0 0.55em;
}

.ms2 .ms-notes__back {
  text-decoration: none;
}

.ms2 h3 + p,
.ms2 h3 + .table-wrap {
  margin-top: 0.4rem;
}

/* Tables: let long cells wrap inside the fixed layout. */
.ms2 table td,
.ms2 table th {
  overflow-wrap: anywhere;
}

.ms2 .dial-table th:nth-child(1),
.ms2 .dial-table td:nth-child(1) {
  width: 22%;
}

.ms2 .dial-table th:nth-child(5),
.ms2 .dial-table td:nth-child(5) {
  width: 13%;
}

.ms2 .importance-table th:nth-child(1),
.ms2 .importance-table td:nth-child(1) {
  width: 34%;
}

.ms2 .importance-table th:nth-child(4),
.ms2 .importance-table td:nth-child(4) {
  width: 34%;
}

.ms2 .split-table th:nth-child(1),
.ms2 .split-table td:nth-child(1) {
  width: 28%;
}

.ms2 .auc-table th:nth-child(1),
.ms2 .auc-table td:nth-child(1) {
  width: 40%;
}

.ms2 .fleet-table th:nth-child(1),
.ms2 .fleet-table td:nth-child(1) {
  width: 12%;
}

/* ---------- figure shell ---------- */

.ms2 .ms-fig {
  padding: 14px 14px 12px;
  border-top: 1px solid var(--ms-ink);
  border-bottom: 1px solid var(--ms-ink);
}

.ms2 .ms-fig .chart-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ms2 .ms-fig .chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
}

.ms2 .ms-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
}

.ms2 .ms-key::before {
  display: inline-block;
  width: 14px;
  height: 10px;
  content: "";
}

.ms2 .ms-key--a::before {
  background: var(--ms-a);
}

.ms2 .ms-key--b::before {
  background: var(--ms-b);
}

/* ---------- horizontal bars (F1, F4, F5) ---------- */

.ms2 .ms-bars {
  display: grid;
  gap: 10px;
}

.ms2 .ms-bars__row {
  display: grid;
  gap: 3px;
}

.ms2 .ms-bars p {
  margin: 0;
}

.ms2 .ms-bars__label {
  color: var(--ms-ink);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
}

.ms2 .ms-bars__line {
  display: grid;
  grid-template-columns: 6.6rem minmax(0, 1fr) 8.2rem;
  gap: 8px;
  align-items: center;
  font-size: 0.75rem;
  line-height: 1.3;
}

.ms2 .ms-bars--single .ms-bars__line {
  grid-template-columns: minmax(0, 1fr) 4rem;
}

.ms2 .ms-bars__scr {
  color: var(--ms-muted);
}

.ms2 .ms-bars__track {
  position: relative;
  display: block;
  height: 12px;
  background: var(--ms-well);
}

.ms2 .ms-bars--auc .ms-bars__track--mark::after {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 82%;
  border-left: 1px dashed var(--ms-ink);
  content: "";
}

.ms2 .ms-bars__fill {
  display: block;
  height: 100%;
  min-width: 1px;
}

.ms2 .ms-bars__fill--a {
  background: var(--ms-a);
}

.ms2 .ms-bars__fill--b {
  background: var(--ms-b);
}

.ms2 .ms-bars__fill--c {
  background: var(--ms-c);
}

.ms2 .ms-bars__val {
  color: var(--ms-ink);
  font-variant-numeric: lining-nums tabular-nums;
}

.ms2 .ms-axis {
  display: flex;
  justify-content: space-between;
  margin: 2px 0 0 calc(6.6rem + 8px);
  margin-right: calc(8.2rem + 8px);
  color: var(--ms-muted);
  font-size: 0.6875rem;
}

.ms2 .ms-bars--single .ms-axis {
  margin-left: 0;
  margin-right: calc(4rem + 8px);
}

.ms2 .ms-bars__aside {
  color: var(--ms-muted);
  font-size: 0.75rem;
}

/* ---------- columns (F2) ---------- */

.ms2 .ms-cols {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.ms2 .ms-cols__col {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.ms2 .ms-cols__well {
  position: relative;
  display: block;
  width: 100%;
  height: 150px;
  background: var(--ms-well);
}

.ms2 .ms-cols__bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  background: var(--ms-a);
}

.ms2 .ms-cols__val,
.ms2 .ms-cols__lab {
  font-size: 0.75rem;
  font-variant-numeric: lining-nums tabular-nums;
}

.ms2 .ms-cols__val {
  color: var(--ms-ink);
  font-weight: 700;
}

.ms2 .ms-cols__lab {
  color: var(--ms-muted);
}

.ms2 .ms-cols__axis {
  margin: 6px 0 0;
  color: var(--ms-muted);
  font-size: 0.75rem;
  text-align: center;
}

/* ---------- 3 x 3 map (F3) ---------- */

.ms2 .ms-map {
  display: grid;
  gap: 4px;
}

.ms2 .ms-map__row {
  display: grid;
  grid-template-columns: 5.2rem repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.ms2 .ms-map__corner,
.ms2 .ms-map__head,
.ms2 .ms-map__rowhead {
  align-self: center;
  color: var(--ms-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.ms2 .ms-map__head {
  text-align: center;
}

.ms2 .ms-map__cell {
  display: grid;
  min-height: 52px;
  place-content: center;
  color: var(--ms-ink);
  font-size: 0.9375rem;
  font-variant-numeric: lining-nums tabular-nums;
  font-weight: 700;
  text-align: center;
}

.ms2 .ms-map__cell--1 {
  background: #e7edf4;
}

.ms2 .ms-map__cell--2 {
  background: #b9cadc;
}

.ms2 .ms-map__cell--3 {
  background: #7f9bbb;
}

.ms2 .ms-map__cell--default {
  outline: 2px solid var(--ms-ink);
  outline-offset: -2px;
}

.ms2 .ms-map__tag {
  font-size: 0.6875rem;
  font-weight: 400;
}

@media (max-width: 640px) {
  .ms2 .ms-fig {
    padding: 12px 0 10px;
  }

  .ms2 .ms-bars__line {
    grid-template-columns: 4.6rem minmax(0, 1fr) 4.9rem;
    gap: 6px;
  }

  .ms2 .ms-axis {
    margin-left: calc(4.6rem + 6px);
    margin-right: calc(4.9rem + 6px);
  }

  .ms2 .ms-bars--single .ms-axis {
    margin-left: 0;
    margin-right: calc(4rem + 8px);
  }

  .ms2 .ms-cols {
    gap: 4px;
  }

  .ms2 .ms-cols__well {
    height: 120px;
  }

  .ms2 .ms-map__row {
    grid-template-columns: 3rem repeat(3, minmax(0, 1fr));
  }
}

/* ---------- preset widths and heights (generated) ---------- */

.ms2 .ms-h-0 { height: 0%; }
.ms2 .ms-h-3 { height: 3%; }
.ms2 .ms-h-45 { height: 45%; }
.ms2 .ms-h-70 { height: 70%; }
.ms2 .ms-h-88 { height: 88%; }
.ms2 .ms-h-98 { height: 98%; }
.ms2 .ms-w-0 { width: 0%; }
.ms2 .ms-w-2 { width: 2%; }
.ms2 .ms-w-3 { width: 3%; }
.ms2 .ms-w-7 { width: 7%; }
.ms2 .ms-w-9 { width: 9%; }
.ms2 .ms-w-10 { width: 10%; }
.ms2 .ms-w-16 { width: 16%; }
.ms2 .ms-w-44 { width: 44%; }
.ms2 .ms-w-45 { width: 45%; }
.ms2 .ms-w-57 { width: 57%; }
.ms2 .ms-w-63 { width: 63%; }
.ms2 .ms-w-67 { width: 67%; }
.ms2 .ms-w-79 { width: 79%; }
.ms2 .ms-w-81 { width: 81%; }
.ms2 .ms-w-86 { width: 86%; }
.ms2 .ms-w-98 { width: 98%; }
