/* ─────────────────────────────────────────────────────────────────────────
   AsterisMC Wiki
   Encyclopedia layout for /wiki and /wiki/<slug>.
   Colour tokens come from theme.css; the extras below are wiki-only.
   ───────────────────────────────────────────────────────────────────────── */
:root {
  --link:       #f0a08c;
  --link-hover: #f8c4b6;
  --redlink:    #ff5d5d;
  --text:       #ece0e4;
  --text-mid:   rgba(236,224,228,.70);
  --text-dim:   rgba(236,224,228,.45);
  --rule:       rgba(255,255,255,.09);
  --rule-navy:  rgba(168,64,90,.30);
  --sans: Roboto,"Helvetica Neue",-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  --mono: ui-monospace,"SF Mono",SFMono-Regular,Menlo,"Cascadia Mono",Consolas,monospace;
}

/* ── page frame ───────────────────────────────────────────────────────── */
.wiki_body { background: var(--bg-void); color: var(--text); font-size: 15px; line-height: 1.72; }
.wiki_body a { color: var(--link); text-decoration: none; }
.wiki_body a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 2px; }
.wiki_body :focus-visible { outline: 2px solid var(--cmc-gold); outline-offset: 3px; border-radius: 2px; }

.wiki_content { padding: 34px 0 90px; }
.wiki_container { max-width: 1220px; margin: 0 auto; padding: 0 26px; }
.wiki_layout { display: grid; grid-template-columns: 1fr; gap: 34px; }
@media (min-width: 992px) { .wiki_layout { grid-template-columns: 196px minmax(0,1fr); } }
.wiki_layout > main { min-width: 0; }

/* ── portlet sidebar ──────────────────────────────────────────────────── */
.wiki_side { font-size: 13px; }
@media (min-width: 992px) {
  .wiki_side { position: sticky; top: 96px; align-self: start;
               max-height: calc(100vh - 120px); overflow-y: auto; padding-right: 4px; }
}
.wiki_side .portlet { margin-bottom: 20px; }
.wiki_side h4 { font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
                color: var(--cmc-gold); margin: 0 0 8px; padding-bottom: 6px;
                border-bottom: 1px solid var(--rule); }
.wiki_side a { display: block; padding: 3px 0 3px 10px; border-left: 2px solid transparent;
               color: var(--text-mid); line-height: 1.45; }
.wiki_side a:hover { color: var(--link-hover); text-decoration: none; border-left-color: var(--rule-navy); }
.wiki_side a.on { color: var(--cmc-gold); border-left-color: var(--cmc-gold); }

/* ── article tabs + inline search ─────────────────────────────────────── */
.tabs { display: flex; align-items: flex-end; gap: 2px; flex-wrap: wrap;
        border-bottom: 1px solid var(--rule-navy); margin-bottom: 0; }
.tabs a { font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
          padding: 8px 16px; color: var(--text-dim); background: rgba(255,255,255,.02);
          border: 1px solid var(--rule); border-bottom: none; border-radius: 3px 3px 0 0; }
.tabs a:hover { color: var(--text); text-decoration: none; background: rgba(168,64,90,.14); }
.tabs a.sel { color: #fff; background: var(--bg-card); border-color: var(--rule-navy);
              border-top: 2px solid var(--cmc-gold); padding-top: 7px; }
.tabs a.off { color: rgba(236,224,228,.3); cursor: default; }
.tabs a.off:hover { background: rgba(255,255,255,.02); color: rgba(236,224,228,.3); }

.searchbox { position: relative; margin-left: auto; width: min(330px,60vw); padding-bottom: 5px; }
.searchbox input { width: 100%; background: rgba(255,255,255,.05); border: 1px solid var(--rule-navy);
                   border-radius: 3px; padding: 6px 40px 6px 12px; color: #fff;
                   font-family: var(--sans); font-size: 13.5px; }
.searchbox input::placeholder { color: var(--text-dim); }
.searchbox input:focus { outline: none; border-color: var(--cmc-gold); background: rgba(255,255,255,.08); }
.searchbox .slash { position: absolute; right: 10px; top: calc(50% - 3px); transform: translateY(-50%);
                    font-family: var(--mono); font-size: 10px; color: var(--text-dim);
                    border: 1px solid var(--rule); border-radius: 3px; padding: 0 5px; pointer-events: none; }
.results { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 2px);
           background: var(--bg-card); border: 1px solid var(--rule-navy); border-radius: 3px;
           z-index: 40; box-shadow: 0 18px 44px rgba(0,0,0,.6); max-height: 360px; overflow-y: auto; }
.results.open { display: block; }
.results a { display: block; padding: 8px 13px; border-bottom: 1px solid var(--rule); color: var(--text); }
.results a:last-child { border-bottom: none; }
.results a:hover, .results a.hi { background: rgba(168,64,90,.16); text-decoration: none; }
.results .rt { font-weight: 500; font-size: 13px; }
.results .rc { font-size: 10.5px; color: var(--text-dim); font-family: var(--mono); letter-spacing: .04em; }
.results .none { padding: 10px 13px; color: var(--text-dim); font-size: 13px; }

/* ── article head ─────────────────────────────────────────────────────── */
h1.title { font-size: clamp(27px,3.8vw,36px); font-weight: 300; color: #fff; margin: 22px 0 4px;
           padding-bottom: 10px; border-bottom: 1px solid var(--rule-navy); text-wrap: balance; }
.from { font-size: 13px; color: var(--text-dim); font-style: italic; margin: 0 0 16px; }

/* ── article body ─────────────────────────────────────────────────────── */
.art h2 { font-size: 21px; font-weight: 300; color: #fff; margin: 32px 0 12px; padding-bottom: 7px;
          border-bottom: 1px solid var(--rule); scroll-margin-top: 96px; }
.art h3 { font-size: 13px; font-weight: 600; color: var(--cmc-gold-light); letter-spacing: .14em;
          text-transform: uppercase; margin: 24px 0 9px; scroll-margin-top: 96px; }
.art p { margin: 0 0 14px; max-width: 76ch; }
.art ul, .art ol { margin: 0 0 16px; padding-left: 24px; max-width: 76ch; }
.art li { margin-bottom: 7px; }
.art strong { color: #fff; font-weight: 500; }
.art em { color: var(--text-mid); }
.art img { max-width: 100%; height: auto; }
.wiki_body code { font-family: var(--mono); font-size: .87em; background: rgba(0,0,0,.4);
                  border: 1px solid var(--rule); border-radius: 3px; padding: 1px 6px;
                  color: var(--cmc-gold-light); white-space: nowrap; }

.hatnote { font-size: 13.5px; font-style: italic; color: var(--text-mid); margin: 0 0 14px; padding-left: 30px; }
.hatnote a { font-style: italic; }

.infobox { float: right; width: 290px; margin: 6px 0 20px 28px; background: var(--bg-card);
           border: 1px solid var(--rule-navy); border-top: 3px solid var(--cmc-gold);
           border-radius: 3px; overflow: hidden; font-size: 13px; }
/* 991, not 767: .art becomes a grid at 991 and a grid item ignores float,
   so the floated 290px box would strand itself against the left margin. */
@media (max-width: 991px) { .infobox { float: none; width: 100%; margin: 0 0 22px; } }
.infobox .ib-h { background: linear-gradient(180deg,rgba(120,36,60,.6),rgba(120,36,60,.22));
                 padding: 10px 14px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
                 font-size: 11.5px; color: #fff; text-align: center; border-bottom: 1px solid var(--rule-navy); }
.infobox dl { display: grid; grid-template-columns: auto 1fr; margin: 0; }
.infobox dt { padding: 7px 14px; color: var(--text-mid); font-size: 12px;
              border-bottom: 1px solid var(--rule); background: rgba(255,255,255,.015); }
.infobox dd { margin: 0; padding: 7px 14px; text-align: right; font-family: var(--mono); font-size: 12px;
              color: #fff; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.infobox .ib-f { padding: 9px 14px; font-size: 11px; color: var(--text-dim); text-align: center; }

.tblwrap { overflow-x: auto; margin: 0 0 20px; }
table.wt { border-collapse: collapse; width: 100%; font-size: 13.5px;
           background: var(--bg-card); border: 1px solid var(--rule-navy); }
table.wt caption { caption-side: top; text-align: left; font-size: 12px; color: var(--text-dim);
                   padding: 0 0 7px; font-style: italic; }
table.wt th { background: rgba(120,36,60,.34); color: #fff; text-align: left; font-weight: 600;
              font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 9px 13px;
              border-bottom: 1px solid var(--rule-navy); white-space: nowrap; }
table.wt td { padding: 9px 13px; border-bottom: 1px solid var(--rule); color: var(--text-mid); vertical-align: top; }
table.wt tr:last-child td { border-bottom: none; }
table.wt tbody tr:hover td { background: rgba(168,64,90,.09); }
table.wt td.n { font-family: var(--mono); color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.wt td.cfg { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }
table.wt td.name { color: #fff; font-weight: 500; white-space: nowrap; }

.formula { font-family: var(--mono); font-size: 13.5px; color: var(--cmc-gold-light);
           background: rgba(0,0,0,.36); border-left: 3px solid var(--cmc-gold); border-radius: 0 3px 3px 0;
           padding: 14px 18px; margin: 0 0 18px; line-height: 1.9; overflow-x: auto; }
.callout { background: rgba(120,36,60,.17); border: 1px solid var(--rule-navy);
           border-left: 3px solid var(--cmc-gold); border-radius: 0 3px 3px 0;
           padding: 13px 18px; margin: 0 0 20px; max-width: 78ch; }
.callout .lbl { display: block; font-size: 10px; font-weight: 600; letter-spacing: .2em;
                text-transform: uppercase; color: var(--cmc-gold); margin-bottom: 6px; }
.callout p { margin: 0 0 9px; font-size: 14px; }
.callout p:last-child { margin-bottom: 0; }

.chip { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
        text-transform: uppercase; padding: 2px 7px; border-radius: 2px; white-space: nowrap;
        vertical-align: middle; }
.chip.ok   { color: #7fd2a4; background: rgba(26,92,58,.42);  border: 1px solid rgba(79,174,122,.4); }
.chip.warn { color: #e6b063; background: rgba(214,154,66,.16); border: 1px solid rgba(214,154,66,.35); }
.chip.idle { color: #dcb4bd; background: rgba(168,64,90,.18);  border: 1px solid var(--rule-navy); }
.chip[title] { cursor: help; }

.rail { margin: 6px 0 22px; overflow-x: auto; }
.rail svg { min-width: 620px; }

/* ── contents box ─────────────────────────────────────────────────────── */
.toc { float: left; clear: left; min-width: 210px; max-width: 300px; margin: 4px 26px 18px 0;
       background: var(--bg-card); border: 1px solid var(--rule-navy); border-radius: 3px; padding: 12px 16px 14px; }
@media (max-width: 991px) { .toc { float: none; max-width: none; margin: 0 0 20px; } }
.toc > label { display: block; }
.toc h4 { font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
          color: var(--cmc-gold); margin: 0 0 8px; }
.toc ol { list-style: none; counter-reset: t; margin: 0; padding: 0; font-size: 13px; }
.toc li { counter-increment: t; margin: 0 0 4px; line-height: 1.45; }
.toc li::before { content: counter(t) ". "; color: var(--text-dim); font-family: var(--mono); font-size: 11px; }
.toc li.sub { padding-left: 16px; }
.toc li.sub::before { content: "· "; }

/* ── article foot ─────────────────────────────────────────────────────── */
.catbar { margin-top: 36px; border: 1px solid var(--rule-navy); border-radius: 3px;
          background: rgba(120,36,60,.10); padding: 10px 16px; font-size: 13px; color: var(--text-mid); }
.catbar b { color: var(--text); font-weight: 500; margin-right: 6px; }
.catbar a { margin-right: 4px; }
/* Category cards were removed from the main page (2026-11-20), so the bar has nowhere to link. */
.catbar { display: none; }
.catbar .sep { color: var(--text-dim); margin: 0 6px; }
.lastedit { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule);
            font-size: 12.5px; color: var(--text-dim); }
.lastedit b { color: var(--text-mid); font-weight: 500; }
.lastedit code { font-size: 11.5px; }

.pagenav { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
           margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--rule); font-size: 13px; }
.pagenav span { color: var(--text-dim); font-size: 11px; letter-spacing: .14em;
                text-transform: uppercase; display: block; margin-bottom: 2px; }
.pagenav .next { text-align: right; margin-left: auto; }

/* ── main page ────────────────────────────────────────────────────────── */
.section_title { text-align: center; margin: 38px 0 30px; }
.section_title h2 { display: inline-block; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
                    color: #fff; line-height: 1.35; font-size: clamp(18px,2.6vw,24px); margin: 0; }
.section_title h2 em { font-style: normal; color: var(--cmc-gold); }
.section_title p { color: var(--text-mid); font-size: 14px; margin: 10px 0 0; }
.portal_lead { background: var(--bg-card); border: 1px solid var(--rule-navy); border-radius: 3px;
               padding: 22px 26px; margin-bottom: 24px; }
.portal_lead p { margin: 0 0 12px; max-width: 78ch; }
.portal_lead p:last-child { margin: 0; }
.statebar { display: flex; flex-wrap: wrap; border: 1px solid var(--rule-navy); border-radius: 3px;
            overflow: hidden; margin-bottom: 8px; background: var(--bg-card); }
.statebar div { flex: 1 1 150px; padding: 12px 18px; border-right: 1px solid var(--rule); }
.statebar div:last-child { border-right: none; }
.statebar .l { display: block; font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
               color: var(--text-dim); margin-bottom: 3px; font-family: var(--mono); }
.statebar .v { font-family: var(--mono); font-size: 15px; color: var(--cmc-gold-light);
               font-variant-numeric: tabular-nums; }
.statebar .v small { font-size: 11px; color: var(--text-dim); letter-spacing: .03em; }
.cats { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) { .cats { grid-template-columns: 1fr 1fr; } }
.zeta_card { position: relative; background: linear-gradient(180deg,var(--bg-card-alt),var(--bg-card));
             border: 1px solid var(--rule); border-radius: 3px; padding: 20px 22px; overflow: hidden;
             transition: border-color 220ms ease, transform 220ms ease; }
.zeta_card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
                     background: linear-gradient(90deg,var(--cmc-blue),var(--cmc-blue-mid)); }
.zeta_card.outside::before { background: rgba(255,255,255,.14); }
.zeta_card:hover { border-color: var(--rule-navy); transform: translateY(-2px); }
.zeta_card h3 { margin: 0 0 3px; font-size: 13px; font-weight: 600; color: #fff;
                letter-spacing: .2em; text-transform: uppercase; }
.zeta_card .d { font-size: 12.5px; color: var(--text-dim); margin: 0 0 12px; }
.zeta_card ul { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.zeta_card li { margin-bottom: 5px; line-height: 1.5; }
.zeta_card li .fig { color: var(--text-dim); font-family: var(--mono); font-size: 11px; margin-left: 6px; }
.btn_row { text-align: center; margin-top: 34px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; font-size: 12.5px;
          color: var(--text-dim); border-top: 1px solid var(--rule); margin-top: 32px; padding-top: 16px; }
.clearfix::after { content: ""; display: block; clear: both; }

@media (prefers-reduced-motion: reduce) {
  .zeta_card { transition: none; }
  .zeta_card:hover { transform: none; }
}
.zeta_card { scroll-margin-top: 96px; }

/* The hero heading is a div, not an h1. The site chrome puts a big word at the
   top of every page, but on the wiki that word is the section name ("Wiki") and
   it would repeat on all 64 pages, leaving each article with two h1 elements and
   the wrong one first. The article title is the page's only h1; this rule copies
   .home_content h1 (elements_styles.css:817 plus the base h1 size at :121) so
   nothing moves visually. */
.home_content .home_h {
  font-size: 48px;
  font-weight: 300;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 2px;
}
/* Mirror the responsive h1 steps from elements_responsive.css (40 / 36 / 24px)
   plus the margin reset it applies to .home_content h1 at 767px. Without these
   the demoted heading would stay 48px on phones. */
@media only screen and (max-width: 991px) { .home_content .home_h { font-size: 40px; } }
@media only screen and (max-width: 767px) { .home_content .home_h { font-size: 36px; margin-bottom: 0; } }
@media only screen and (max-width: 479px) { .home_content .home_h { font-size: 24px; } }

/* Breadcrumb. Sits above the tab strip and mirrors the BreadcrumbList JSON-LD,
   so what a reader sees and what a crawler is told are the same trail. */
.wiki_crumb { font-size: 12px; color: var(--text-dim); margin: 0 0 14px;
              display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wiki_crumb a { color: var(--text-mid); }
.wiki_crumb a:hover { color: var(--link-hover); }
.wiki_crumb .sep { color: rgba(236,224,228,.28); }
.wiki_crumb .here { color: var(--text); }


/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE
   Breakpoints match elements_responsive.css (991 / 767 / 575 / 479) so the
   wiki reflows at the same widths as the header, hero and footer around it.

   The layout inverts below 992px. On desktop the sidebar is a column beside
   the article; below that it was stacking ABOVE the article, so a phone
   scrolled through 67 links and roughly five screens before the first word.
   Here it becomes a closed drawer instead.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Desktop: the drawer element behaves as a plain column. `details` is used so
   the whole thing works with JavaScript off; forcing it open here means the
   toggle never exists above 992px. */
/* The toggles are real checkboxes so the disclosure works with no JavaScript.
   They are moved out of sight rather than `display:none`, which would take
   them out of the tab order and break the label. */
.wd_toggle, .toc_toggle {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
@media (min-width: 992px) {
  /* Desktop ignores the checkbox entirely: the column is simply always open. */
  .wiki_side > .wiki_drawer_btn { display: none; }
  .wiki_side > .wiki_drawer_panel { display: block; }
}
.wd_toggle:focus-visible + .wiki_drawer_btn,
.toc_toggle:focus-visible + label { outline: 2px solid var(--cmc-gold); outline-offset: 2px; }

@media (max-width: 991px) {
  /* ── The drawer ─────────────────────────────────────────────────────── */
  .wiki_side {
    position: static;
    max-height: none;
    overflow: visible;
    margin: 0 0 18px;
  }
  .wiki_drawer_btn {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;               /* comfortable thumb target */
    padding: 0 14px;
    cursor: pointer;
    border: 1px solid var(--rule-navy);
    border-radius: 3px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
  }
  .wiki_drawer_btn:hover { background: var(--bg-card-alt); }
  /* Three bars that become an X when the drawer is open. */
  .wd_icon {
    position: relative;
    width: 16px;
    height: 2px;
    background: var(--cmc-gold);
    flex: none;
    transition: background 160ms ease;
  }
  .wd_icon::before, .wd_icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 16px;
    height: 2px;
    background: var(--cmc-gold);
    transition: transform 160ms ease, top 160ms ease;
  }
  .wd_icon::before { top: -5px; }
  .wd_icon::after  { top: 5px; }
  .wd_toggle:checked + .wiki_drawer_btn .wd_icon { background: transparent; }
  .wd_toggle:checked + .wiki_drawer_btn .wd_icon::before { top: 0; transform: rotate(45deg); }
  .wd_toggle:checked + .wiki_drawer_btn .wd_icon::after  { top: 0; transform: rotate(-45deg); }
  .wd_label { flex: 1 1 auto; }
  .wd_count {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: .06em;
    text-transform: none;
    color: var(--text-dim);
    font-family: var(--mono);
  }

  /* The panel slides over the article rather than pushing it down, so opening
     the index never costs you your place in what you were reading. */
  .wd_toggle:checked ~ .wiki_drawer_panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(330px, 86vw);
    z-index: 300;
    padding: 74px 18px 40px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: var(--bg-base);
    border-left: 1px solid var(--rule-navy);
    box-shadow: -18px 0 44px rgba(0,0,0,.55);
    animation: wd_in 200ms ease;
  }
  @keyframes wd_in { from { transform: translateX(100%); } to { transform: none; } }
  .wiki_drawer_panel { display: none; }
  .wd_toggle:checked ~ .wiki_drawer_panel { display: block; }

  /* Dim the page behind the open panel.
     This lives on the panel, not on the button. The button is fixed with
     z-index 301, which makes it a stacking context, so a backdrop drawn there
     painted above the panel and swallowed every click meant for the index. As
     the panel's own ::before at z-index -1 it sits behind the panel's contents
     and above the article, which is what a backdrop is supposed to do. */
  .wd_toggle:checked ~ .wiki_drawer_panel::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(7,4,6,.66);
    animation: wd_fade 200ms ease;
  }
  @keyframes wd_fade { from { opacity: 0; } to { opacity: 1; } }

  /* Keep the toggle reachable above the open panel so it doubles as the
     close button. */
  .wd_toggle:checked + .wiki_drawer_btn {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 301;
    width: min(330px, 86vw);
    border-color: var(--cmc-gold);
  }

  .wiki_side .portlet { margin-bottom: 18px; }
  .wiki_side a {
    padding: 9px 0 9px 12px;        /* 40px rows, not 22px */
    line-height: 1.35;
  }

  /* ── Tabs and search ────────────────────────────────────────────────── */
  /* Discussion and View history do nothing yet, and on a phone they only
     crowd out the one control that matters. */
  .tabs a.off { display: none; }
  .tabs { gap: 0; }
  .searchbox {
    margin: 10px 0 0;
    width: 100%;
    padding-bottom: 0;
    flex: 1 0 100%;
  }
  .searchbox input { padding: 11px 14px; font-size: 16px; }  /* 16px stops iOS zooming on focus */
  .searchbox .slash { display: none; }                        /* no keyboard, no shortcut */
  .results { max-height: 60vh; }
  .results a { padding: 12px 14px; }

  /* ── Reading measure ────────────────────────────────────────────────── */
  .wiki_container { padding: 0 16px; }
  .wiki_content { padding: 20px 0 60px; }
  h1.title { margin-top: 16px; }

  /* ── Infobox after the opening paragraph ───────────────────────────────
     Grid ordering rather than moving it in the DOM, so the desktop float is
     untouched. You get the sentence that says what the thing is before the
     table of numbers about it. */
  .art { display: grid; grid-template-columns: minmax(0,1fr); }
  .art > * { order: 4; min-width: 0; }
  .art > .hatnote { order: 0; }
  .art > .toc     { order: 1; }
  .art > p.wiki_lead   { order: 2; margin-bottom: 18px; }
  .art > .infobox { order: 3; }
  /* The clearfix float-guard is meaningless once this is a grid, and as a
     grid item it would occupy a row of its own. */
  .art.clearfix::after { display: none; }

  .infobox { margin-top: 0; }
  .infobox dt, .infobox dd { padding: 9px 14px; }

  /* ── Contents, collapsed ────────────────────────────────────────────── */
  .toc { padding: 0; }
  .toc > label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
  }
    .toc > label h4 { margin: 0; }
  .toc > label::after {
    content: "";
    margin-left: auto;
    width: 7px; height: 7px;
    border-right: 2px solid var(--cmc-gold);
    border-bottom: 2px solid var(--cmc-gold);
    transform: rotate(45deg) translate(-2px,-2px);
    transition: transform 160ms ease;
  }
  .toc_toggle:checked ~ label::after { transform: rotate(-135deg) translate(-2px,-2px); }
  .toc > ol { display: none; padding: 0 16px 14px; }
  .toc_toggle:checked ~ ol { display: block; }
  .toc li { margin-bottom: 10px; }
  .toc li a { display: inline-block; padding: 2px 0; }

  /* ── Long strings that would otherwise force the page sideways ──────── */
  .wiki_body code { white-space: normal; overflow-wrap: anywhere; }
  .art p, .art li { overflow-wrap: break-word; }
  .rail { margin-inline: -16px; padding-inline: 16px; }

  /* ── Touch targets ──────────────────────────────────────────────────────
     Measured at 360px: the breadcrumb links were 21px tall and the Read tab
     37px. Both are navigation, both need a thumb-sized hit area. Padding
     rather than height, so the text keeps its position and only the tappable
     box grows. */
  .wiki_crumb { gap: 2px 4px; margin-bottom: 10px; }
  .wiki_crumb a, .wiki_crumb .here {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 6px;
  }
  .wiki_crumb a:first-child { padding-left: 0; }
  .tabs a { min-height: 44px; display: inline-flex; align-items: center; }
  .tabs a.sel { padding-top: 0; }

  /* ── Page furniture ─────────────────────────────────────────────────── */
  .pagenav { gap: 12px; }
  .pagenav a { flex: 1 1 45%; min-height: 44px; }
  .catbar { line-height: 2.1; }
  .catbar a { display: inline-block; padding: 2px 0; }
}

/* ── Tables become labelled rows ──────────────────────────────────────────
   A three-column config table needs roughly 560px: the config keys run to 37
   characters and must not wrap mid-token. Below that, each row becomes its own
   small block and every cell prints the column header it belongs to, taken
   from the `data-label` the server writes. Nothing is hidden and nothing
   scrolls sideways.
   ─────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .tblwrap { overflow-x: visible; }
  table.wt { display: block; border: none; background: none; }
  table.wt caption { display: block; margin-bottom: 10px; }
  table.wt thead { position: absolute; width: 1px; height: 1px;
                   overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.wt tbody { display: block; }
  table.wt tr {
    display: block;
    margin-bottom: 10px;
    padding: 4px 0;
    background: var(--bg-card);
    border: 1px solid var(--rule-navy);
    border-radius: 3px;
  }
  table.wt tbody tr:hover td { background: none; }
  table.wt td {
    display: flex;
    gap: 14px;
    align-items: baseline;
    padding: 7px 14px;
    border-bottom: 1px solid var(--rule);
    white-space: normal;
    overflow-wrap: anywhere;
  }
  table.wt tr td:last-child { border-bottom: none; }
  table.wt td::before {
    content: attr(data-label);
    flex: 0 0 38%;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim);
  }
  /* The first cell is the row's subject, so it reads as a heading. */
  table.wt td.name {
    display: block;
    padding: 9px 14px 8px;
    font-size: 14px;
    background: rgba(120,36,60,.18);
    border-bottom: 1px solid var(--rule-navy);
  }
  table.wt td.name::before { display: none; }
  table.wt td.n, table.wt td.cfg { white-space: normal; }
  /* A cell with no label of its own should not leave a gap where one would be. */
  table.wt td:not([data-label])::before { display: none; }
}

/* ── Article hero: a band, not a screenful ────────────────────────────────
   The main page keeps the full hero, as a landing page should. An article is
   read, not landed on, so on phones it gets a slim band and the title is
   visible without scrolling.
   ─────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .home.home_article { height: 132px; }
  .home.home_article .home_content { margin-top: 44px; }
  .home.home_article .home_content .home_h { font-size: 26px; }
  .home.home_article .home_content span { font-size: 9px; letter-spacing: .3em; }
}
@media (max-width: 479px) {
  .home.home_article { height: 116px; }
  .home.home_article .home_content { margin-top: 36px; }
  .home.home_article .home_content .home_h { font-size: 22px; }
}

/* ── Narrow phones ────────────────────────────────────────────────────── */
@media (max-width: 575px) {
  .statebar div { flex: 1 1 50%; }
  .zeta_card { padding: 16px 16px; }
  .art h2 { font-size: 19px; }
  .formula { padding: 12px 14px; font-size: 12.5px; }
  .callout { padding: 12px 14px; }
}
@media (max-width: 479px) {
  .wiki_container { padding: 0 13px; }
  .rail { margin-inline: -13px; padding-inline: 13px; }
  .statebar div { flex: 1 1 100%; border-right: none;
                  border-bottom: 1px solid var(--rule); }
  .statebar div:last-child { border-bottom: none; }
  table.wt td::before { flex-basis: 44%; }
  .infobox dt, .infobox dd { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .wd_toggle:checked ~ .wiki_drawer_panel,
  .wd_toggle:checked ~ .wiki_drawer_panel::before { animation: none; }
  .wd_icon, .wd_icon::before, .wd_icon::after,
  .toc > label::after { transition: none; }
}
