:root, [data-md-color-scheme] { --af-product: var(--af-fg); }
.af-figure svg { width: 100%; height: auto; display: block; }
/* Tool pages lead with the product: a named crop from scripts/captures.py, the full capture behind the link,
   and a caption that says what is shown (a sentence, so body type, not a tracked label). */
.md-typeset figure.af-figure--lead { margin: 1.2em 0 1.6em; }
/* display:block only on single images: a Night/Day pair (#only-dark / #only-light) keeps Material's theme switch,
   which a display rule here would outrank and show both */
.md-typeset figure.af-figure--lead > a > img:not([src*="#only-"]) { display: block; }
.md-typeset figure.af-figure--lead > a > img { width: 100%; height: auto; border-radius: var(--af-radius-card); box-shadow: 0 0 0 1px var(--af-line); }
.md-typeset figure.af-figure--lead figcaption { font-family: inherit; font-size: .72rem; letter-spacing: 0; text-transform: none; color: var(--af-fg-muted); text-align: left; margin-top: .7em; }
@media (forced-colors: active) { .md-typeset figure.af-figure--lead > a > img { box-shadow: none; outline: 1px solid CanvasText; } }
/* Deck page: the slides themselves, scaled into the column */
.af-deck-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--af-line); border-radius: var(--af-radius-card); background: var(--af-canvas); margin: 1em 0 1.5em; }
/* the slides follow this page's scheme; on phones a frame would squeeze a slide to 3 px type, so the page
   links to the slides (stacked there) and the PDF instead */
@media (max-width: 600px) { .af-deck-frame { display: none !important; } }
/* Home: the four planes have a wide drawing and a stacked one; phones get the stacked one, as How it fits does */
.af-planes--stacked { display: none !important; }
@media (max-width: 959px) {
  .af-planes--wide { display: none !important; }
  .af-planes--stacked { display: block !important; max-width: 26rem; }
}
/* Roadmap page (docs/roadmap.md; lists generated by scripts/roadmap.py) */
.af-rm-stamp, .af-rm-note, .af-rm-phase, .af-rm-count { color: var(--af-fg-muted); font-size: .72rem; }
.af-rm-phase, .af-rm-count { font-family: var(--af-font-sans); font-weight: 500; text-transform: none; letter-spacing: 0; margin-top: -.4rem; }
/* The progress table: phase names stay on one line, the Done-when sentence gets the width. */
.md-typeset .af-rm-progress td:first-child { white-space: nowrap; }
.md-typeset .af-rm-progress td:nth-child(2) { min-width: 26rem; }
.md-typeset .af-rm-progress table:not([class]) { font-size: .68rem; }
/* One row per theme: name, count, bar. The row opens the issue list, which is closed by default. */
.md-typeset .af-rm-phase + details.af-rm-theme, .md-typeset .af-rm-phase + p.af-rm-theme { margin-top: .6rem; }
.md-typeset h2 + .af-rm-phase { margin-top: -.6rem; }
.md-typeset p.af-rm-theme, .md-typeset details.af-rm-theme > summary, .md-typeset details.af-rm-issues > summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(6rem, 14rem); gap: .3rem 1rem; align-items: center;
  margin: 0; padding: .35rem 0 .35rem 1.4rem; border-bottom: 1px solid var(--af-line); background: transparent;
  font-family: var(--af-font-sans); font-size: .78rem; letter-spacing: 0; text-transform: none; color: var(--af-fg); }
.md-typeset details.af-rm-issues > summary { grid-template-columns: minmax(0, 1fr); }
.md-typeset details.af-rm-theme, .md-typeset details.af-rm-issues { border: 0; box-shadow: none; background: transparent; margin: 0; }
.md-typeset details.af-rm-theme > summary::before, .md-typeset details.af-rm-issues > summary::before { left: 0; top: .45rem; width: 1rem; height: 1rem; -webkit-mask-image: none; mask-image: none; background: none !important; content: "▸"; color: var(--af-fg-subtle); font-size: .7rem; line-height: 1rem; text-align: center; }
.md-typeset details.af-rm-theme[open] > summary::before, .md-typeset details.af-rm-issues[open] > summary::before { content: "▾"; }
.md-typeset p.af-rm-theme { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.md-typeset p.af-rm-theme .af-rm-count { white-space: normal; text-transform: none; font-size: .68rem; }
.md-typeset details.af-rm-theme > summary::after, .md-typeset details.af-rm-issues > summary::after { display: none; }
.md-typeset details.af-rm-theme > summary:hover, .md-typeset details.af-rm-issues > summary:hover { background: var(--af-selected); }
.md-typeset details.af-rm-theme > ul, .md-typeset details.af-rm-issues > ul { margin: .4rem 0 .8rem 1.4rem; font-size: .72rem; }
.af-rm-theme__name { color: var(--af-fg); font-weight: 500; min-width: 0; }
.md-typeset .af-rm-count { margin: 0; white-space: nowrap; font-size: .64rem; }
.af-rm-bar { display: block; height: 4px; background: var(--af-line); border-radius: 2px; overflow: hidden; }
.af-rm-bar::before { content: ""; display: block; height: 100%; width: var(--af-rm-pct, 0%); background: var(--af-fg-muted); }
@media (max-width: 599px) { .md-typeset p.af-rm-theme, .md-typeset details.af-rm-theme > summary { grid-template-columns: minmax(0, 1fr) auto; } .md-typeset details.af-rm-theme > summary .af-rm-bar, .md-typeset p.af-rm-theme .af-rm-bar { grid-column: 1 / -1; } }
.af-rm-state { display: inline-block; width: 1.3em; font-family: var(--af-font-mono); font-size: .72rem; text-align: center; color: var(--af-fg-subtle); }
.af-rm-dropped { color: var(--af-fg-dim); }
.af-rm-issues s { color: var(--af-fg-dim); }
@media (forced-colors: active) { .af-rm-bar { border: 1px solid CanvasText; } .af-rm-bar::before { background: CanvasText; } }
/* Airframe reference pages (docs/airframe/; tables generated by scripts/airframe.py pages) */
/* Components page: a card per component with its Night thumbnail; 3 across at 1440, 1 at 390 */
.af-comps { display: grid; grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr)); gap: var(--af-space-12); margin: .8em 0 1.6em; }
.md-typeset a.af-comp { display: flex; flex-direction: column; gap: var(--af-space-8); padding: var(--af-space-12); background: var(--af-raised); border-radius: var(--af-radius-card); color: var(--af-fg); text-decoration: none; }
.md-typeset a.af-comp:hover, .md-typeset a.af-comp:focus-visible { background: var(--af-selected); color: var(--af-fg); }
.md-typeset a.af-comp:focus-visible { outline: 2px solid var(--af-focus); outline-offset: 2px; }
.af-comp__pic { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--af-radius-control); background: var(--af-canvas); box-shadow: inset 0 0 0 1px var(--af-line-subtle); }
.af-comp__pic img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.af-comp__blank { display: flex; align-items: center; justify-content: center; height: 100%; font-family: var(--af-font-sans); font-weight: 500; font-size: .66rem; letter-spacing: 0; text-transform: none; color: var(--af-fg-subtle); }
.af-comp__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--af-space-8); }
.af-comp__head b { font-family: var(--af-font-display); font-stretch: var(--af-display-stretch); font-weight: 700; font-size: .82rem; }
.af-comp__group, .af-comp__go { font-family: var(--af-font-sans); font-weight: 500; font-size: .62rem; letter-spacing: 0; text-transform: none; color: var(--af-fg-subtle); }
.af-comp__sub { font-size: .7rem; line-height: 1.45; color: var(--af-fg-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.af-comp__go { display: flex; gap: var(--af-space-12); margin-top: auto; }
/* Component page: the live Night preview in a frame above the README */
.af-preview { display: block; width: 100%; border: 1px solid var(--af-line); border-radius: var(--af-radius-card); background: var(--af-canvas); margin: .6em 0 1em; }
.af-swatch { display: inline-block; width: 1.6rem; height: 1.6rem; border-radius: var(--af-radius-control); box-shadow: inset 0 0 0 1px var(--af-line); vertical-align: middle; }
.af-type-sample { color: var(--af-fg); line-height: 1.15; }
.af-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); gap: 2px; margin: 1.2em 0; }
.af-icon { margin: 0; padding: .9rem .4rem .6rem; background: var(--af-raised); display: flex; flex-direction: column; align-items: center; gap: .55rem; color: var(--af-fg); }
.af-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: var(--af-icon-stroke); stroke-linecap: square; stroke-linejoin: miter; }
.af-icon figcaption { font-family: var(--af-font-mono); font-size: .56rem; letter-spacing: .04em; color: var(--af-fg-subtle); text-align: center; overflow-wrap: anywhere; }
.af-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 2px; margin: 1.2em 0; }
.af-rule { background: var(--af-raised); padding: var(--af-space-16); display: flex; flex-direction: column; gap: .35rem; }
.af-rule b { font-family: var(--af-font-display); font-stretch: var(--af-display-stretch); font-weight: 700; font-size: .78rem; color: var(--af-fg); }
.af-rule span { color: var(--af-fg-muted); font-size: .7rem; line-height: 1.5; }
.md-typeset table:not([class]) td:nth-child(-n+2) code { white-space: nowrap; }
/* Tools page: the table becomes one card per tool on phones (KAN-154). The header row goes; each cell is labelled
   from its column, the name leads in the display face, and nothing is cut or squeezed to a word per line. */
@media (max-width: 599px) {
  .md-typeset .af-cards-table .md-typeset__table, .md-typeset .af-cards-table table:not([class]) { display: block; overflow: visible; }
  .md-typeset .af-cards-table thead { display: none; }
  .md-typeset .af-cards-table tbody { display: grid; gap: var(--af-space-8); }
  .md-typeset .af-cards-table table:not([class]) tr { display: block; border: 0; box-shadow: none; padding: var(--af-space-12) var(--af-space-16); background: var(--af-raised); border-radius: var(--af-radius-card); }
  .md-typeset .af-cards-table table:not([class]) tr:hover { background: var(--af-raised); }
  .md-typeset .af-cards-table table:not([class]) td { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: .8rem; padding: .2rem 0; border: 0; }
  .md-typeset .af-cards-table td::before { color: var(--af-fg-subtle); font-size: .66rem; font-weight: 500; padding-top: .1rem; }
  .md-typeset .af-cards-table table:not([class]) td:first-child { display: block; padding-bottom: .4rem; font-family: var(--af-font-display); font-stretch: var(--af-display-stretch); font-weight: 700; font-size: .9rem; }
  .md-typeset .af-cards-table td:first-child::before { content: none; }
  .md-typeset .af-cards-table td:nth-child(2)::before { content: "Plane"; }
  .md-typeset .af-cards-table td:nth-child(3)::before { content: "What"; }
  .md-typeset .af-cards-table td:nth-child(4)::before { content: "Status"; }
  .md-typeset .af-cards-table td:nth-child(5)::before { content: "Docs"; }
}
