/* MS / simulation articles: additions on top of article.css, built from its tokens only. */

/* Data figures are matplotlib PNGs on white; give them a hairline so the white edge reads as a frame. */
figure img {
  width: 100%; height: auto;
  border: 1px solid var(--line-soft); border-radius: 3px; background: #fff;
}

/* ---------- Index of articles (multiple-sclerosis hub) ---------- */
.index-entry h2 a { border-bottom: none; }
.index-entry h2 a:hover { color: var(--accent); }
.index-entry .more { font-family: var(--sans); font-size: 0.85rem; }

/* ---------- Cellular census (rim/index.html) ----------
   The seven cell-type colours are categorical data, kept from the original chart so they stay distinguishable. */
:root {
  --c-oligo: #4f6bd6; --c-opc: #9333ea; --c-astro: #0d9488; --c-neuron: #c98a10;
  --c-myeloid: #dd6a2a; --c-lympho: #d6438f; --c-vascular: #cf3b40;
  --z-nawm: #ece9e1; --z-rim: #d3e7e3; --z-core: #dbd7cd; --z-vein: #a29e94;
  --field: #f1efe9; --card: #fbfaf7; --hair: rgba(28, 27, 25, 0.12);
}
.census-fig { margin: 36px 0; }
@media (min-width: 960px) {
  .census-fig { width: 880px; margin-left: calc(50% - 440px); }
}
.census-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 24px; align-items: start; }
@media (max-width: 760px) { .census-grid { grid-template-columns: 1fr; } }
svg#map { display: block; width: 100%; height: auto; background: var(--field); border-radius: 3px; }
.zlabel { fill: var(--text); font-family: var(--sans); font-size: 11px; font-weight: 500; }
.census { font-family: var(--sans); }
.census h3 { font-family: var(--sans); font-size: 0.82rem; font-weight: 500; color: var(--muted); margin: 0 0 6px; }
.cell { border-top: 1px solid var(--line-soft); cursor: pointer; transition: opacity 0.2s; }
.cell:last-child { border-bottom: 1px solid var(--line-soft); }
.cell.dim { opacity: 0.4; }
.chead { display: flex; align-items: baseline; gap: 10px; padding: 9px 2px 6px; }
.chead .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; align-self: center; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18); }
.chead .nm { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.chead .role { font-size: 0.8rem; color: var(--muted); }
.chead .pct { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 0.9rem; color: var(--text); }
.cell:hover .nm { color: var(--accent); }
.abar { height: 2px; background: var(--line-soft); margin: 0 2px 8px; }
.abar span { display: block; height: 100%; }
.cbody { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; font-size: 0.82rem; line-height: 1.5; color: var(--body); padding: 0 2px; }
.cell.open .cbody { max-height: 320px; padding-bottom: 10px; }
.zkeys { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.zk { display: flex; align-items: center; gap: 6px; }
.zk .s { width: 14px; height: 9px; border-radius: 2px; }

/* ---------- Code tutorials (simulation) ---------- */
code { font-family: var(--mono); font-size: 0.84em; background: rgba(28, 27, 25, 0.05); border-radius: 3px; padding: 1px 4px; }
.codewrap { position: relative; margin: 0 0 10px; }
pre.code, pre.out { margin: 0; font-size: 0.8rem; line-height: 1.6; color: var(--text); }
pre.code { padding-right: 4.2rem; }
pre.code .c { color: var(--muted); }
pre.code .s { color: var(--accent); }
pre.out { background: none; color: var(--body); margin-bottom: 20px; }
.copy {
  position: absolute; top: 8px; right: 8px;
  font-family: var(--sans); font-size: 0.72rem; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); border-radius: 3px;
  padding: 2px 8px; cursor: pointer;
}
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
dl.walk { margin: 6px 0 24px; }
dl.walk dt { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); margin: 18px 0 4px; }
dl.walk dd { margin: 0; color: var(--body); }
.tablewrap { overflow-x: auto; margin: 0 0 22px; }
table.traits { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.86rem; line-height: 1.5; }
table.traits th, table.traits td { text-align: left; vertical-align: top; padding: 9px 10px 9px 0; border-bottom: 1px solid var(--line-soft); color: var(--body); }
table.traits th { font-weight: 500; color: var(--muted); border-bottom-color: var(--line); }
table.traits td:first-child { white-space: nowrap; color: var(--text); }
@media (max-width: 620px) {
  /* on a phone the code scrolls sideways, so keep the button above it rather than over it */
  .codewrap { padding-top: 30px; }
  .copy { top: 0; right: 0; }
  pre.code { padding-right: 16px; }
}
