/* ARTICLE lane, 30 Nov 2026 night. Linked ONLY when a PR_ART_* flag is on (tools/static-render-v2.js buildCss); brand/v2.css and v2-motion.css are untouched.
   Every block is scoped by a class the renderer puts on main#main for that flag (artf-rail, artf-fig, artf-first, artf-cite, artf-print; the artf- prefix keeps them apart from the .art-* elements). */

/* ── PR_ART_RAIL: chapter index in the left gutter. >= 1400 px: the full list. 1280-1399 px (laptops): a slim strip of the chapter numbers that opens to the full list on hover or keyboard focus.
   Anchor positioning only (under the hero, no measured constant); without support, or below 1280 px, the list is not shown and nothing moves (the header chapter links and the phone "On this page" bar remain). ── */
.art-index { display: none; }
@supports (anchor-name: --a) and (position-anchor: --a) {
  @media (min-width: 1280px) {
    main#main.artf-rail { position: relative; }
    main#main.artf-rail > .v2-hero { anchor-name: --art-hero; }
    main#main.artf-rail > .v2-band--rail { position: relative; z-index: 4; }   /* the full-bleed photo rail passes OVER the index (opaque band) instead of the index covering its first photo */
    main#main.artf-rail > nav.art-index { display: block; position: absolute; position-anchor: --art-hero; top: anchor(bottom); bottom: 0; left: 10px; width: 56px; z-index: 3; pointer-events: none; }
    .art-index ol { position: sticky; top: 96px; width: 48px; margin: 0; padding: 8px 3px; list-style: none; pointer-events: auto; max-height: calc(100vh - 120px); overflow: hidden;
      background: rgba(255, 255, 255, .88); border: 1px solid var(--v2-line); border-radius: var(--v2-r-m); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-sizing: border-box; }
    body.v2 .art-index a { display: flex; gap: 8px; align-items: baseline; padding: 5px 0; border-left: 2px solid transparent; font-size: var(--fs-14); line-height: 1.3; color: var(--v2-ink-2); text-decoration: none; border-radius: 4px; overflow-wrap: anywhere; justify-content: center; }
    .art-index__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* slim strip: the title stays in the accessibility tree */
    .art-index__n { flex: none; min-width: 2.4em; white-space: nowrap; text-align: center; font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: .04em; color: var(--v2-teal-ink); }
    .art-index__n:empty::before { content: "\00b7"; }
    body.v2 .art-index a:hover { color: var(--v2-ink); }
    body.v2 .art-index a[aria-current="true"] { color: var(--v2-ink); border-left-color: var(--v2-line); font-weight: 500; background: linear-gradient(var(--v2-teal), var(--v2-teal)) 0 0 / 2px calc(var(--art-p, 1) * 100%) no-repeat border-box; }   /* the edge fills with the reading progress through the chapter (set by article.js; full when it is absent) */
    body.v2 .art-index a:focus-visible { outline: 2px solid var(--v2-teal-ink); outline-offset: -2px; }
    body.v2 .art-index__safe a { position: relative; }
    body.v2 .art-index__safe a::after { content: ""; position: absolute; right: 4px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--grade-low); }   /* the safety chapter: a quiet amber dot, never the CTA orange */
  }
  @media (min-width: 1280px) and (max-width: 1399px) {   /* the slim strip opens over the page text */
    .art-index ol:hover, .art-index ol:focus-within { width: 236px; overflow-y: auto; padding: 10px 6px; box-shadow: 0 10px 32px rgba(27, 36, 48, .14); }
    body.v2 .art-index ol:hover a, body.v2 .art-index ol:focus-within a { justify-content: flex-start; padding: 5px 8px; }
    .art-index ol:hover .art-index__t, .art-index ol:focus-within .art-index__t { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
    .art-index ol:hover .art-index__n, .art-index ol:focus-within .art-index__n { text-align: start; }
    body.v2 .art-index ol:hover .art-index__safe a, body.v2 .art-index ol:focus-within .art-index__safe a { padding-right: 18px; }
  }
  @media (min-width: 1400px) {   /* the full list */
    main#main.artf-rail > nav.art-index { --art-w: clamp(150px, calc((100% - 980px) / 2 - 52px), 240px); left: max(20px, calc((100% - 980px) / 2 - var(--art-w) - 20px)); width: var(--art-w); }
    .art-index ol { width: auto; padding: 10px 6px; overflow-y: auto; }
    body.v2 .art-index a { justify-content: flex-start; padding: 5px 8px; }
    .art-index__t { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
    body.v2 .art-index__safe a { padding-right: 18px; }
    .art-index__n { text-align: start; }
  }
}
@media print { .art-index { display: none !important; } }

/* ── any art flag: round 2's right-gutter diagram (brand/v2-motion.css) starts at a measured 960 px, the hero height of the base build. FIG and FIRST make the hero taller (elbow: 943 -> 1029 px), so
   the pinned image would start inside the hero. Anchor it to the hero's bottom edge instead (same support gate as the chapter index; without it the 960 px rule stays). ── */
@supports (anchor-name: --a) and (position-anchor: --a) {
  @media (min-width: 1400px) {
    body.v2 main#main[class*="artf-"] > .v2-hero { anchor-name: --art-hero; }
    body.v2 main#main[class*="artf-"] > aside.v2-sidefig { position-anchor: --art-hero; top: anchor(bottom); }
  }
}

/* ── PR_ART_FIG: the hero diagram as a numbered figure ── */
body.v2 main#main.artf-fig .v2-hero--stage .v2-figure--diagram { display: block; }
body.v2 .art-figcap { max-width: 340px; margin: 12px auto 0; font-size: var(--fs-12); line-height: 1.5; color: var(--v2-on-dark-2); text-wrap: pretty; }
body.v2 .art-figcap__n { display: block; margin-bottom: 2px; font-family: var(--font-mono); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--v2-teal-lite); }

/* ── PR_ART_FIRST: the page's own safety chapter, reachable from the first screen ── */
body.v2 .art-safety-link { flex-basis: 100%; }

/* ── PR_ART_CITE ── */
body.v2 .art-citeband { background: var(--v2-alt); padding: 0 0 var(--sp-7); }
body.v2 .art-cite { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; max-width: var(--v2-col); border-top: 1px solid var(--v2-line); padding-top: var(--sp-5); }
body.v2 .art-cite__k { flex-basis: 100%; font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: .08em; text-transform: uppercase; color: var(--v2-ink-3); }
body.v2 .art-cite__text { flex: 1 1 20ch; margin: 0; font-size: var(--fs-14); line-height: 1.5; color: var(--v2-ink-2); overflow-wrap: anywhere; }
body.v2 .art-cite__u { user-select: all; }
body.v2 .art-cite__btn { flex: none; min-height: 44px; padding: 0 var(--sp-4); border: 1px solid var(--v2-line); border-radius: var(--v2-pill); background: var(--v2-white); color: var(--v2-teal-ink); font: 500 var(--fs-14) var(--font-body); cursor: pointer; }
body.v2 .art-cite__btn:hover { border-color: var(--v2-teal-ink); }
body.v2 .art-cite__btn:focus-visible { outline: 2px solid var(--v2-teal-ink); outline-offset: 2px; }

/* ── PR_ART_PRINT: an article on paper. v2 ships no print sheet (only the sticky diagram and the local bar hide themselves): the dark hero, the sticky bar, the
   cards and the CTA band all printed as on screen. Ink on white, no chrome, external links followed by their address, blocks kept whole. ── */
@media print {
  body.v2:has(main#main.artf-print) .v2-bar, body.v2:has(main#main.artf-print) .pr-skip, body.v2:has(main#main.artf-print) .v2-localnav, body.v2:has(main#main.artf-print) .v2-scrollbar,
  body.v2:has(main#main.artf-print) main .v2-actions, body.v2:has(main#main.artf-print) .art-cite__btn, body.v2:has(main#main.artf-print) .v2-tone-brand,
  body.v2:has(main#main.artf-print) footer form, body.v2:has(main#main.artf-print) .v2-toc { display: none !important; }
  main#main.artf-print, main#main.artf-print :is(.v2-hero, .v2-band, .art-citeband, .v2-redflags, .v2-tone-dark, .v2-stage) { background: #fff !important; box-shadow: none !important; }
  main#main.artf-print :is(.v2-hero, .v2-tone-dark, .v2-stage) :is(h1, h2, h3, p, li, span, a, dt, dd, time) { color: #111 !important; -webkit-text-fill-color: #111 !important; background: none !important; text-shadow: none !important; }
  main#main.artf-print :is(.v2-hero, .v2-stage)::before, main#main.artf-print :is(.v2-hero, .v2-stage)::after { display: none !important; }
  main#main.artf-print .art-figcap, main#main.artf-print .art-figcap__n { color: #333 !important; }
  main#main.artf-print :is(.v2-figure, .v2-figure img) { filter: none !important; box-shadow: none !important; }
  main#main.artf-print .v2-band { padding-block: 16pt !important; }
  main#main.artf-print :is(h2, h3, figure, .v2-redflags, .pr-doctor, tr, li) { break-inside: avoid; }
  main#main.artf-print :is(h2, h3) { break-after: avoid; }
  main#main.artf-print a[href^="http"]:not([href*="padelrevive.com"])::after { content: " (" attr(href) ")"; font-size: .85em; word-break: break-all; }
  main#main.artf-print img, main#main.artf-print svg { max-width: 100% !important; }
}

/* ═══ ROUND 2 (phones and mid widths, < 1280 px). Every block is scoped by the flag's class on main#main and by the elements the renderer adds. ═══ */

/* ── PR_ART_M_SHEET: the chapter sheet. A bottom bar ("4 / 10" + the chapter in view) that opens a native popover with every chapter; the safety chapter is pinned first.
   Works without JavaScript (popovertarget); article.js adds the position, the current mark and closes the sheet after a jump. Browsers without the Popover API: nothing is shown. ── */
.art-sheet { display: none; }
@supports selector(:popover-open) {
  @media (max-width: 1279px) {
    body.v2 main#main.artf-m-sheet > .art-sheet { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 56; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--v2-line); }
    @supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
      body.v2 main#main.artf-m-sheet > .art-sheet { -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px); background: rgba(255, 255, 255, .9); }
    }
    body.v2 .art-sheet.is-js:not(.is-on) { visibility: hidden; transform: translateY(100%); }
    body.v2 .art-sheet::before { content: ""; position: absolute; left: 0; top: -2px; height: 2px; width: calc(var(--art-pp, 0) * 100%); background: var(--v2-teal); }   /* the whole page's reading progress: a thin line on the bar's top edge (set by article.js) */
    body.v2 .art-sheet__btn { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 560px; min-height: 52px; margin: 0 auto; padding: 6px var(--v2-gut) calc(6px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box;
      font: inherit; color: var(--v2-ink); background: transparent; border: 0; text-align: left; cursor: pointer; }
    body.v2 .art-sheet__pos { flex: none; min-width: 3.6em; font-family: var(--font-mono); font-size: var(--fs-12); font-weight: 500; letter-spacing: .04em; color: var(--v2-teal-ink); white-space: nowrap; }
    body.v2 .art-sheet__pos:empty { display: none; }
    body.v2 .art-sheet__k { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: .08em; text-transform: uppercase; color: var(--v2-ink-3); }
    body.v2 .art-sheet.has-cur .art-sheet__k { display: none; }
    body.v2 .art-sheet__cur { flex: 1; min-width: 0; font-size: var(--fs-14); line-height: 1.2; font-weight: 500; color: var(--v2-ink); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: break-word; }
    body.v2 .art-sheet__cur:empty { display: none; }
    body.v2 .art-sheet__chev { flex: none; margin-left: auto; color: var(--v2-ink-2); }
    body.v2 .art-sheet__btn:focus-visible { outline: 2px solid var(--v2-teal-ink); outline-offset: -4px; border-radius: 8px; }
    body.v2:has(.art-sheet) footer { padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px)); }   /* the bar never covers the last lines of the page */
    body.v2:has(.art-sheet) .v2-localnav { display: none !important; }   /* the sheet replaces the top "On this page" bar: two chapter controls would compete */
    body.v2:has(.art-sheet) [id], body.v2.has-localnav:has(.art-sheet) [id] { scroll-margin-top: 84px; }   /* only the 64 px header is left to clear */

    .art-sheet__pop { position: fixed; inset: auto 0 0 0; margin: 0 auto; width: min(100%, 560px); max-height: min(80dvh, 680px); max-height: min(80vh, 680px); max-height: min(80dvh, 680px); overflow-y: auto; overscroll-behavior: contain;
      padding: 0 var(--v2-gut) calc(20px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; border: 0; border-radius: 20px 20px 0 0; background: var(--v2-white); color: var(--v2-ink); box-shadow: 0 -14px 44px rgba(27, 36, 48, .22); }
    .art-sheet__pop::backdrop { background: rgba(27, 36, 48, .42); }
    body.v2 .art-sheet__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 calc(var(--v2-gut) * -1); padding: 14px var(--v2-gut) 10px; background: var(--v2-white); border-bottom: 1px solid var(--v2-line); }
    body.v2 .art-sheet__h { font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: .08em; text-transform: uppercase; color: var(--v2-ink-3); }
    body.v2 .art-sheet__x { min-height: 44px; min-width: 44px; padding: 0 var(--sp-4); border: 1px solid var(--v2-line); border-radius: var(--v2-pill); background: var(--v2-white); color: var(--v2-teal-ink); font: 500 var(--fs-14) var(--font-body); cursor: pointer; }
    body.v2 .art-sheet__x:focus-visible, body.v2 .art-sheet__pop a:focus-visible { outline: 2px solid var(--v2-teal-ink); outline-offset: 2px; }
    body.v2 .art-sheet__pin { display: flex; align-items: center; gap: 12px; min-height: 52px; margin: 14px 0 6px; padding: 8px 14px; border: 1px solid var(--v2-line); border-radius: var(--v2-r-m); background: var(--v2-alt); color: var(--v2-ink); font-size: var(--fs-17); font-weight: 500; line-height: 1.3; text-decoration: none; }
    body.v2 .art-sheet__dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--grade-low); }   /* the safety chapter: a quiet amber dot, never the CTA orange */
    body.v2 .art-sheet__pop ol { margin: 0; padding: 4px 0 0; list-style: none; }
    body.v2 .art-sheet__pop li a { display: flex; align-items: baseline; gap: 12px; min-height: 48px; padding: 10px 0 10px 10px; border-left: 2px solid transparent; font-size: var(--fs-17); line-height: 1.3; color: var(--v2-ink-2); text-decoration: none; }
    body.v2 .art-sheet__pop li + li a { border-top: 1px solid var(--v2-line); }
    body.v2 .art-sheet__n { flex: none; min-width: 2em; font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: .04em; color: var(--v2-teal-ink); }
    body.v2 .art-sheet__pop li a[aria-current="true"] { color: var(--v2-ink); font-weight: 500; border-left-color: var(--v2-teal-ink); }
    body.v2 .art-sheet__safe a::after { content: ""; flex: none; align-self: center; margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--grade-low); }
  }
  @media (min-width: 768px) and (max-width: 1279px) {
    body.v2 main#main.artf-m-sheet > .art-sheet { left: 50%; right: auto; width: 560px; transform: translateX(-50%); border: 1px solid var(--v2-line); border-bottom: 0; border-radius: 16px 16px 0 0; }
    body.v2 .art-sheet.is-js:not(.is-on) { transform: translate(-50%, 100%); }
  }
  @media (max-width: 1279px) and (prefers-reduced-motion: no-preference) {
    body.v2 .art-sheet { transition: transform .28s var(--v2-ease), visibility 0s; }
    body.v2 .art-sheet.is-js:not(.is-on) { transition: transform .28s var(--v2-ease), visibility 0s .28s; }
    .art-sheet__pop { opacity: 0; transform: translateY(28px); transition: opacity .22s var(--v2-ease), transform .3s var(--v2-ease), overlay .3s allow-discrete, display .3s allow-discrete; }
    .art-sheet__pop:popover-open { opacity: 1; transform: none; }
    @starting-style { .art-sheet__pop:popover-open { opacity: 0; transform: translateY(28px); } }
    .art-sheet__pop::backdrop { background-color: transparent; transition: background-color .3s var(--v2-ease), overlay .3s allow-discrete, display .3s allow-discrete; }
    .art-sheet__pop:popover-open::backdrop { background-color: rgba(27, 36, 48, .42); }
    @starting-style { .art-sheet__pop:popover-open::backdrop { background-color: transparent; } }
  }
}
@media print { .art-sheet, .art-next { display: none !important; } }

/* ── PR_ART_M_NEXT: at the end of each chapter, a plain link to the next one (and a button that opens the sheet). Added by the renderer, never on a frozen page. ── */
.art-next { display: none; }
@media (max-width: 1279px) {
  body.v2 main#main.artf-m-next .art-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; max-width: var(--v2-col); margin: 20px 0 0; padding-top: 8px; border-top: 1px solid var(--v2-line); }
  body.v2 .art-next__go { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 44px; color: inherit; text-decoration: none; }
  body.v2 .art-next__k { font-family: var(--font-mono); font-size: var(--fs-12); letter-spacing: .08em; text-transform: uppercase; color: var(--v2-ink-3); }
  body.v2 .art-next__t { font-size: var(--fs-17); font-weight: 500; line-height: 1.3; color: var(--v2-teal-ink); text-wrap: balance; }
  body.v2 .art-next__t::after { content: " \203A"; }
  body.v2 .art-next__all { flex: none; min-height: 44px; padding: 0 var(--sp-4); border: 1px solid var(--v2-line); border-radius: var(--v2-pill); background: var(--v2-white); color: var(--v2-teal-ink); font: 500 var(--fs-14) var(--font-body); cursor: pointer; }
  body.v2 .art-next__go:focus-visible, body.v2 .art-next__all:focus-visible { outline: 2px solid var(--v2-teal-ink); outline-offset: 2px; border-radius: 6px; }
  body.v2 .v2-tone-dark .art-next { border-top-color: rgba(255, 255, 255, .22); }
  body.v2 .v2-tone-dark .art-next__k { color: var(--v2-on-dark-2); }
  body.v2 .v2-tone-dark .art-next__t { color: var(--v2-teal-stage); }
}
@supports not selector(:popover-open) { .art-next__all { display: none !important; } }

/* ── PR_ART_M_RHYTHM (CSS only): on phones and tablets each chapter opens like a page. The page's own "NN / Title" label (aria-hidden, a 12 px mono line today) becomes a large numeral
   over a short rule, the heading follows; the continuation bands of a chapter keep their seam and look as before. The title stays in the h2 (only the numeral of the label is shown). ── */
@media (max-width: 1279px) {
  body.v2 main#main.artf-m-rhythm > .v2-band:has(.v2-chapter):not(.v2-band--cont) { padding-top: calc(var(--v2-pad) + var(--sp-3)); }
  body.v2 main#main.artf-m-rhythm .prose .v2-chapter { display: block; height: auto; transform: none; width: 2.05ch; max-width: 2.05ch; height: 1em; overflow: visible; white-space: normal; clip-path: inset(0);   /* wraps after the numeral; clip-path (not overflow) shows only the first line, so no text is clipped by a scroll box */
    margin: 0 0 var(--sp-3); padding-top: var(--sp-3); border-top: 3px solid currentColor; font-size: var(--fs-40); line-height: 1; font-weight: 400; letter-spacing: 0; text-transform: none; font-feature-settings: "zero" 0; }
  body.v2 main#main.artf-m-rhythm .pr-system-step .v2-chapter { display: none; }
  body.v2 main#main.artf-m-rhythm .v2-chapter + h2[id] { scroll-margin-top: 136px; }   /* a jump to a chapter shows its numeral and rule above the heading, below the 64 px header */
}

/* ── PR_ART_M_TABLES (CSS only): a table with a header row scrolls inside its own box on a phone. A shadow on the edge that still has hidden columns shows that it scrolls
   (it disappears at the end), the cells are tighter so more fits, the first column stays pinned (v2.css). Key/value tables already stack. No content is hidden or changed. ── */
@media (max-width: 734px) {
  body.v2 main#main.artf-m-tables .pr-table-scroll {
    background:
      linear-gradient(to right, var(--v2-white) 40%, rgba(255, 255, 255, 0)) left center / 32px 100% no-repeat local,
      linear-gradient(to left, var(--v2-white) 40%, rgba(255, 255, 255, 0)) right center / 32px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(27, 36, 48, .26), rgba(27, 36, 48, 0)) left center / 14px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(27, 36, 48, .26), rgba(27, 36, 48, 0)) right center / 14px 100% no-repeat scroll,
      var(--v2-white);
    overscroll-behavior-x: contain; }
  body.v2 main#main.artf-m-tables table:has(thead) { min-width: 480px; }
  body.v2 main#main.artf-m-tables table:has(thead) :is(th, td) { padding: 14px 12px; }
}
