/* Capabilities page: only what sits inside this page's own drawn visuals (the hero window, the sensor table,
   the capability sheets) and the quantities list. Tokens only; nothing restyles a kit class outside a visual. */

/* ---- shared bits of the three drawn windows ---- */
.capwin, .capsens, .capsheet, .capq { background: var(--bg); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; font-size: 13px; box-shadow: 0 1px 2px rgb(11 26 36 / .06), 0 24px 48px -28px rgb(11 26 36 / .28); }
.capwin__bar, .capsens__bar, .capsheet__head, .capq__bar { display: flex; align-items: center; gap: var(--s-3); height: 40px; padding-inline: var(--s-4); border-bottom: 1px solid var(--line); color: var(--muted); }
.capwin__dots, .capsens__dots, .capsheet__dots, .capq__dots { display: flex; gap: 6px; flex: none; }
.capwin__dots i, .capsens__dots i, .capsheet__dots i, .capq__dots i { width: 10px; height: 10px; border-radius: 50%; background: color-mix(in oklab, var(--ink) 13%, var(--bg)); }
.capwin__crumb, .capsens__crumb, .capq__crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.capwin__crumb i, .capsens__crumb i, .capq__crumb i { font-style: normal; padding-inline: 2px; }
.capwin__crumb b, .capsens__crumb b, .capq__crumb b { color: var(--ink); font-weight: 500; }

/* ---- hero: the mark in the headline, the window with three tabs ---- */
.hero--centred .hero__lead { color: var(--ink); }   /* the kit greys this line; people read it, so it takes the ink (7:1) */
.capmark { display: inline-block; width: .74em; height: .74em; vertical-align: -.04em; margin-inline: 0 .3em; color: var(--ink); }
.capmark svg { display: block; width: 100%; height: 100%; }
/* an empty twin of the mark closes the first line, so the words stay on the page axis */
.capmark--pad { visibility: hidden; margin-inline: .3em 0; }
.capwin__tabs { flex-wrap: nowrap; padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--line); }
.capwin__panel { display: grid; grid-template-columns: 252px minmax(0, 1fr); column-gap: var(--s-6); padding: var(--s-3) var(--s-5) var(--s-3); min-height: 196px; }   /* one fixed height for every tab */
.capwin__side { display: grid; gap: var(--s-2); align-content: start; min-width: 0; }
.capwin__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin: 0; }
.capwin__head b { font-weight: 500; font-size: var(--t-body); }
.capwin__chip { color: var(--alert); font-weight: 500; white-space: nowrap; }
.capwin__rows { list-style: none; margin: 0; padding: 0; }
.capwin__rows li { display: flex; justify-content: space-between; gap: var(--s-3); padding: 5px 0; border-top: 1px solid var(--line); color: var(--muted); }
.capwin__rows b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.capwin__note { margin: 0; color: var(--ink); }
.capwin__chart { min-width: 0; display: grid; grid-template-rows: auto 1fr; gap: var(--s-2); }
.capwin__axis { margin: 0; color: var(--muted); }
.capwin__plot { position: relative; min-height: 96px; }
.capwin__plot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.capwin__dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--alert); }

/* ---- activation: the sensor table ---- */
.capsens { margin-top: var(--s-7); }
.capsens__count { margin-left: auto; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); font-weight: 500; font-size: 12px; line-height: 1; }
.capsens__table { width: 100%; border-collapse: collapse; }
.capsens__table th, .capsens__table td { padding: var(--s-3) var(--s-4); text-align: left; vertical-align: middle; font-weight: 400; border-top: 1px solid var(--line); }
.capsens__table thead th { border-top: 0; color: var(--muted); font-weight: 500; font-size: 12px; padding-block: var(--s-3); }
.capsens__table tbody th b { display: block; font-weight: 500; font-size: var(--t-body); }
.capsens__table tbody th span { display: block; margin-top: 2px; color: var(--muted); }
.capsens__table tbody th { white-space: nowrap; }
.capsens__table td.capsens__fmt { color: var(--ink); }
.capsens__table thead th:first-child { width: 24%; }
.capsens__table thead th.capsens__fmt { width: 28%; }
.capsens__cap { text-align: center !important; }
.capsens__cap .m-switch { display: inline-block; vertical-align: middle; box-sizing: border-box; width: 48px; height: 44px; border: solid transparent; border-width: 10px 4px; background-clip: padding-box; }
.capsens__na { color: var(--muted); }

/* ---- the capability sheets (pinned chapters) ---- */
[data-moment="pinned-chapters"] .mo-pc__visual .capsheet { max-width: 560px; margin-inline: auto; }
.capsheet__head b { color: var(--ink); font-weight: 500; }
.capsheet__chip { margin-left: auto; color: var(--ink); font-weight: 500; }
.capsheet__rows { margin: 0; display: grid; }
.capsheet__rows > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); column-gap: var(--s-4); padding: var(--s-3) var(--s-4); border-top: 1px solid var(--line); }
.capsheet__rows > div:first-child { border-top: 0; }
.capsheet__rows dt { color: var(--muted); font-weight: 500; }
.capsheet__rows dd { margin: 0; font-size: 14px; line-height: 1.45; }

/* ---- quantities: one window, the three capabilities side by side ---- */
.capq { margin-top: var(--s-7); }
.capq__cols { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 3fr); column-gap: var(--s-7); padding: var(--s-5) var(--s-5) var(--s-6); }
.capq__cols h3 { font: 500 var(--t-card)/1.3 var(--font-text); margin-bottom: var(--s-3); }
.capq dl { margin: 0; display: grid; }
.capq__cols > div:first-child dl { display: block; column-count: 2; column-gap: var(--s-6); }
.capq__cols > div:first-child dl > div { break-inside: avoid; }
.capq dl > div { display: grid; gap: 2px; padding: var(--s-3) 0; border-top: 1px solid var(--line); }
.capq dl > div:last-child { border-bottom: 1px solid var(--line); }
.capq dt { font-size: var(--t-small); color: var(--muted); }
.capq dd { margin: 0; font-size: 15px; line-height: 1.5; }

/* the pinned stage starts at the section's top line like every other section (the kit centres it) */
@media (min-width: 1024px) {
  main [data-moment="pinned-chapters"][data-moment].is-live > .mo-pc__grid { align-content: start; padding-top: var(--padt); }
}

/* ---- smaller screens ---- */
@media (max-width: 1023px) {
  .capwin__panel { grid-template-columns: 200px minmax(0, 1fr); column-gap: var(--s-5); }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .capq__cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--s-6); }
  .capq__cols > div:first-child { grid-column: 1 / -1; }
  .capq__cols > div:first-child dl { display: block; column-count: 2; column-gap: var(--s-6); }
  .capq dl > div { padding-block: var(--s-2); }
  /* the sheet sets the height of its lit frame here (the kit's 4:3 would clip its rows) */
  main [data-moment="pinned-chapters"] .mo-pc__visual.mo-pc__visual--lit { aspect-ratio: auto; }
  /* each step stacks (words, then its sheet) so three steps fit the two screens */
  main [data-moment="pinned-chapters"]:not(.is-live) .mo-pc__step { grid-template-columns: minmax(0, 1fr); }
  main [data-moment="pinned-chapters"]:not(.is-live) .mo-pc__step .mo-pc__visual { grid-column: 1; grid-row: auto; margin-top: var(--s-4); }
  /* at rest the pinned section is as tall as its steps; two whole screens here */
  main > #chapters[data-moment]:not(.is-live) { min-height: calc(2 * 100svh); }
}
@media (max-width: 639px) {
  main > #chapters[data-moment]:not(.is-live) { min-height: calc(2 * 100lvh); }
  .capwin__tabs { padding-inline: var(--s-3); }
  .capwin__tabs .tab { padding-inline: var(--s-3); }
  .capwin__panel { grid-template-columns: minmax(0, 1fr); row-gap: var(--s-3); padding: var(--s-3) var(--s-4) 0; }
  .capwin__rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
  .capwin__rows li { display: grid; gap: 2px; border-top: 0; padding: 0; }
  .capwin__rows b { text-align: left; }
  .capwin__note { display: none; }
  .capwin__plot { min-height: 80px; }
  .capsens { margin-top: var(--s-4); }
  .capsens__fmt { display: none; }
  .capsens__table th, .capsens__table td { padding: var(--s-2) var(--s-3); }
  main [data-moment="pinned-chapters"] .mo-pc__visual.mo-pc__visual--lit { padding: 0; background: none; aspect-ratio: auto; display: block; }
  .capsheet__rows > div { grid-template-columns: 1fr; row-gap: 2px; padding-block: var(--s-2); }
  .capsheet__rows > div:nth-child(n+3) { display: none; }
  .capq { margin-top: var(--s-5); }
  .capq__cols { grid-template-columns: minmax(0, 1fr); padding: var(--s-4); row-gap: var(--s-6); }
  .capq__cols > div:first-child dl { display: grid; column-count: auto; }
  .capq dl > div { padding-block: var(--s-4); }
  .capq dd { font-size: 16px; }
}

/* the headline in two balanced lines (Josefin runs wider than the kit's default measure) */
.hero--centred h1 { max-width: 24ch; text-wrap: balance; }
