/*
 * The formula page's own pieces (plan 2026-10-11-site-formula-pages, FP-4) around what it borrows:
 * the frame is the landing's (landing.css), the calculator /calc/'s (page.css), the store door the
 * landing's `.try`. Every colour and size is a token variable (INV-205); no new colour (SITE7-6).
 * G-11 (D-SITE-10, layout A): from 960 px the calculator card is sticky on the right (canvas, the ONE result,
 * the quiet store line); the h1, the lead, the fields and the article run down a ~640 px column; below 960 px
 * the card dissolves (`display: contents`) so the same nodes take the phone's order: h1, lead, fields,
 * result, store line, canvas, article. Nothing is written twice and hidden: one result, one store line.
 * These rules stay HERE, not in /calc/'s page.css, which the calculator page shares.
 */

.fp-crumbs { font-size: 13px; color: var(--onSurfaceLow); }
.fp-crumbs ol { display: flex; flex-wrap: wrap; gap: var(--space4) var(--space8); margin: 0; padding: 0; list-style: none; }
.fp-crumbs li { display: inline-flex; align-items: center; gap: var(--space8); }
/* The separator is a hairline, not a typed symbol. */
.fp-crumbs li + li::before { content: ""; width: 1px; height: 0.9em; background: var(--ghostOutline); transform: skewX(-20deg); }
.fp-crumbs a { color: var(--ink); text-underline-offset: 3px; }

.fp-lead { margin: 0 0 var(--space24); max-width: 60ch; color: var(--onSurfaceLow); font-size: var(--type-bodyLg-size); line-height: var(--type-bodyLg-line); }

/* SITE7-4: the quiet line and the status badge under the result (not a button). */
.fp-store { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space8) var(--space12); margin: var(--space12) 0; font-size: 14px; }
.fp-store-line { color: var(--onSurfaceLow); font-size: 14px; }
.fp-store .try { width: auto; min-height: 32px; padding-inline: var(--space12); background: transparent; color: var(--onAccentContainer); border: var(--border-card) solid var(--accentContainer); font-size: 14px; font-weight: var(--weight-body); }

.fp-text { max-width: 1100px; margin: 0 auto; padding: 0 var(--screenMargin) var(--sectionGap); font-size: 16px; line-height: 1.55; }
.fp-text section { padding-block: var(--space24); border-top: 1px solid var(--ghostOutline); }
.fp-text h2 { margin: 0 0 var(--space8); font-size: var(--type-headMd-size); line-height: var(--type-headMd-line); letter-spacing: 0; }
.fp-text h3 { margin: var(--space16) 0 var(--space4); font-size: var(--type-bodyLg-size); line-height: var(--type-bodyLg-line); font-weight: var(--weight-emphasis); }
.fp-text p { max-width: 68ch; margin: 0 0 var(--space12); }
.fp-detail p { margin-bottom: var(--space8); }
/* SITE10-7: «Next» and «Similar» are ONE block of cards - the name and the target's first lead sentence. */
.fp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space12); margin: 0; padding: 0; list-style: none; }
.fp-cards a { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space4); height: 100%; padding: var(--space12) var(--space16); color: var(--ink); text-decoration: none; border: var(--border-card) solid var(--ghostOutline); border-radius: var(--panelRadius); background: var(--surfaceLow); }
.fp-cards a:hover { border-color: var(--outline); }
.fp-cards strong { font-weight: var(--weight-emphasis); }
.fp-cards span { color: var(--onSurfaceLow); font-size: 14px; line-height: 1.45; }
.fp-inverse a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-underline-offset: 3px; }
.fp-inverse p { margin: 0; }
/* G-3a / SITE10-7: the table of ready values - full column width, the figures right-aligned under right-aligned
   headings in tabular digits, the example's row tinted from the tokens. */
.fp-text .fp-quick { margin: var(--space16) 0 var(--space8); }
.fp-tablewrap { overflow-x: auto; margin-bottom: var(--space12); }
.fp-table { width: 100%; border-collapse: collapse; margin: 0; font-variant-numeric: tabular-nums; }
.fp-table th, .fp-table td { padding: var(--space6) var(--space12); border-bottom: 1px solid var(--ghostOutline); text-align: end; white-space: nowrap; }
.fp-table th { font-weight: var(--weight-emphasis); white-space: normal; vertical-align: bottom; }
.fp-table td:last-child { font-weight: var(--weight-emphasis); }
.fp-table tr.is-example td { background: var(--accentContainer); color: var(--onAccentContainer); font-weight: var(--weight-emphasis); }
.fp-table tr.is-example td:first-child { border-start-start-radius: var(--chipRadius); border-end-start-radius: var(--chipRadius); }
.fp-table tr.is-example td:last-child { border-start-end-radius: var(--chipRadius); border-end-end-radius: var(--chipRadius); }
.fp-checked { color: var(--onSurfaceLow); margin: 0 0 var(--space12); }
/* The text pages (the how page and the four legal ones) are a DOCUMENT, not the landing: one measure, the body's
   size, a heading of the document's size and a paragraph that ends with air - the embed documentation's numbers. */
.fp-how { max-width: 760px; margin: 0 auto; padding: var(--space24) var(--screenMargin) var(--sectionGap); font-size: 16px; line-height: 1.55; }
.fp-how h1 { max-width: none; margin: 0 0 var(--space16); font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.fp-how > p:not([class]) { max-width: 68ch; margin: 0 0 var(--space12); }
.fp-how > .fp-lead { max-width: 68ch; }
/* The heading belongs to the text under it. */
.fp-how h2 { margin: calc(var(--space24) + var(--space16)) 0 var(--space8); font-size: var(--type-headLg-size); line-height: var(--type-headLg-line); font-weight: var(--type-headMd-weight); letter-spacing: var(--type-headLg-tracking); scroll-margin-top: var(--space16); }

/* D-SITE-16 EC-6 (DEF-WEB-17, 01.11): the embed documentation page is a REFERENCE, not an article. From 960 px a sticky
   table of contents stands beside the body; below, the anchors are the hub's scrolling bar (fp-jump's measure). Every
   code block is a labelled figure with a copy button, every parameter and code a row of the ready-values table with its
   text wrapped and aligned to the start, and every example its code beside the frame it creates. */
.fp-doc { max-width: 1240px; margin: 0 auto; padding: var(--space16) var(--screenMargin) var(--sectionGap); font-size: 16px; line-height: 1.55; }
.fp-doc-head { display: grid; gap: var(--space16); max-width: 72ch; padding-bottom: var(--space24); }
.fp-doc h1 { max-width: none; margin: 0; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.fp-doc-head .fp-lead { margin: 0; }
.fp-doc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space16); }
.fp-doc-toc { position: sticky; top: 0; z-index: 5; display: flex; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--screenMargin)); padding: var(--space10) var(--screenMargin); background: var(--ground); border-bottom: var(--border-row) solid var(--ghostOutline); }
.fp-doc-toc-h { display: none; }
.fp-doc-toc ol { display: flex; gap: var(--space6); margin: 0; padding: 0; list-style: none; }
.fp-doc-toc a { flex: none; display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; padding-inline: var(--space12); font-size: 15px; text-decoration: none; color: var(--ink); background: var(--surfaceHigh); border: var(--border-pill) solid var(--outline); border-radius: var(--pillRadius); }
.fp-doc-toc a:hover { background: var(--surfaceLow); }
.fp-doc-body { min-width: 0; }
.fp-doc-body section { padding-block: var(--space24); border-top: 1px solid var(--ghostOutline); scroll-margin-top: 72px; }
.fp-doc-body section:first-child { border-top: 0; padding-top: var(--space8); }
.fp-doc h2 { margin: 0 0 var(--space12); font-size: var(--type-headLg-size); line-height: var(--type-headLg-line); font-weight: var(--type-headMd-weight); letter-spacing: var(--type-headLg-tracking); }
.fp-doc h3 { margin: var(--space24) 0 var(--space8); font-size: var(--type-headMd-size); line-height: var(--type-headMd-line); font-weight: var(--type-headMd-weight); letter-spacing: 0; scroll-margin-top: 72px; }
.fp-doc h3 code { font-size: 17px; }
.fp-doc p, .fp-doc-list { max-width: 68ch; margin: 0 0 var(--space12); }
.fp-doc-list { padding-inline-start: var(--space24); }
.fp-doc-list li { margin-bottom: var(--space8); }
.fp-doc code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; overflow-wrap: anywhere; }
.fp-doc :not(pre) > code { padding: 1px var(--space4); background: var(--surfaceLow); border-radius: var(--chipRadius); }
.fp-code { margin: 0 0 var(--space16); border: 1px solid var(--ghostOutline); border-radius: var(--panelRadius); background: var(--surfaceLow); overflow: hidden; }
.fp-code figcaption { display: flex; align-items: center; justify-content: space-between; gap: var(--space8); min-height: 36px; padding-inline: var(--space16) var(--space6); font-size: var(--type-labelSm-size); font-weight: var(--type-labelSm-weight); letter-spacing: var(--type-labelBold-tracking); text-transform: uppercase; color: var(--onSurfaceLow); border-bottom: 1px solid var(--ghostOutline); }
.fp-code pre { margin: 0; padding: var(--space12) var(--space16); overflow-x: auto; tab-size: 2; }
.fp-code pre code { display: block; padding: 0; white-space: pre; overflow-wrap: normal; line-height: 1.5; background: none; }
.fp-code-copy { min-height: 28px; padding-inline: var(--space10); font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--ink); background: var(--surfaceHigh); border: var(--border-pill) solid var(--outline); border-radius: var(--pillRadius); cursor: pointer; }
.fp-code-copy:hover { background: var(--ground); }
.fp-doc-table th, .fp-doc-table td { white-space: normal; text-align: start; vertical-align: top; font-size: 15px; }
.fp-doc-table td:last-child { font-weight: inherit; }
.fp-doc-table td:first-child { white-space: nowrap; }
.fp-doc-names { display: flex; flex-wrap: wrap; gap: var(--space8) var(--space16); margin: 0 0 var(--space12); padding: 0; list-style: none; }
.fp-doc-names small { color: var(--onSurfaceLow); }
.fp-doc-steps { display: grid; gap: var(--space12); margin: 0 0 var(--space12); padding: 0; list-style: none; counter-reset: step; }
.fp-doc-steps li { counter-increment: step; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--space12); }
.fp-doc-steps li::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; font-weight: var(--weight-emphasis); color: var(--onAccentContainer); background: var(--accentContainer); border-radius: 50%; }
.fp-doc-steps p { margin-bottom: var(--space8); }
.fp-doc-steps .fp-code { margin: 0; }
.fp-ex { display: grid; gap: var(--space16); margin-bottom: var(--space24); }
.fp-ex .fp-code { margin: 0; }
.fp-doc-cap { margin: 0 0 var(--space8); font-size: 14px; color: var(--onSurfaceLow); }
.fp-doc-live { border: 1px solid var(--ghostOutline); border-radius: var(--panelRadius); overflow: hidden; }
.fp-doc-live[hidden] { display: none; }
.fp-doc-live iframe { display: block; }
.fp-doc-pair { display: grid; gap: var(--space16); margin-bottom: var(--space16); }
.fp-doc-btns { display: flex; flex-wrap: wrap; gap: var(--space8); margin-bottom: var(--space12); }
.fp-doc-btn { min-height: 44px; padding-inline: var(--space16); font: inherit; font-size: 15px; color: var(--ink); background: var(--surfaceHigh); border: var(--border-pill) solid var(--outline); border-radius: var(--pillRadius); cursor: pointer; }
.fp-doc-btn:hover { background: var(--surfaceLow); }
.fp-doc-msg { margin: 0; padding: var(--space12) var(--space16); color: var(--error); border: 1px solid var(--error); border-radius: var(--panelRadius); }
.fp-doc-msg[hidden] { display: none; }
/* DEF-WEB-17: the hub's one line to the documentation page, under its lead. */
.fp-hub-embed { margin: 0; }
.fp-hub-embed a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-underline-offset: 3px; }
@media (min-width: 960px) {
  .fp-doc-grid { grid-template-columns: 220px minmax(0, 1fr); gap: calc(2 * var(--space24)); align-items: start; }
  .fp-doc-toc { position: sticky; top: var(--space24); display: block; margin: 0; padding: 0; overflow: visible; background: none; border: 0; }
  .fp-doc-toc-h { display: block; margin: 0 var(--space10) var(--space8); font-size: var(--type-labelBold-size); font-weight: var(--type-labelBold-weight); letter-spacing: var(--type-labelBold-tracking); text-transform: uppercase; color: var(--onSurfaceLow); }
  .fp-doc-toc ol { display: grid; gap: var(--space2); }
  .fp-doc-toc a { display: flex; min-height: 36px; padding-inline: var(--space10); font-size: 15px; color: var(--onSurfaceLow); background: none; border: 0; border-radius: var(--chipRadius); }
  .fp-doc-toc a:hover { background: var(--surfaceLow); color: var(--ink); }
  .fp-doc-body section:first-child { padding-top: 0; }
  .fp-ex { grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); align-items: start; }
  .fp-doc-pair { grid-template-columns: 1fr 1fr; }
}

/* site-legal: the four legal pages wear the how page's measure; the facts as label/value rows, the «By region»
   table as the ready-values table with its text wrapped and aligned to the start. */
.fp-legal { counter-reset: legal-section; }
.fp-legal h1 { margin-bottom: var(--space8); }
/* A section of the two agreements is cited by its number, the imprint's notices keep their official titles bare. */
.fp-legal:is([data-legal="terms"], [data-legal="privacy"]) > h2::before { counter-increment: legal-section; content: counter(legal-section) ". "; }
.fp-legal > ul { max-width: 68ch; margin: 0 0 var(--space12); }
.fp-legal > ul { padding-inline-start: var(--space24); }
.fp-legal > ul li + li { margin-top: var(--space4); }
.fp-legal .fp-lead { margin-bottom: var(--space12); color: inherit; font-size: inherit; line-height: inherit; }
.fp-legal-date { margin: 0 0 var(--space16); color: var(--onSurfaceLow); }
.fp-legal-langs ul { display: flex; flex-wrap: wrap; gap: var(--space4) var(--space16); margin: 0 0 var(--space24); padding: 0; list-style: none; }
.fp-legal-facts { display: grid; grid-template-columns: minmax(8em, max-content) 1fr; gap: var(--space8) var(--space16); margin: 0 0 var(--space24); }
.fp-legal-facts dt { color: var(--onSurfaceLow); }
.fp-legal-facts dd { margin: 0; }
.fp-legal-regions th, .fp-legal-regions td { white-space: normal; text-align: start; vertical-align: top; }
.fp-legal-regions td:last-child { font-weight: inherit; }

/* landing.css caps every h1 at 15ch for the hero; the calculator's title keeps page.css's measure. */
.nn-page .nn-title { max-width: none; }

/* FP-5 / HR-1 (plan 2026-10-25-site-hub-redesign): the hub - a lead, a search, a sticky bar of shelf anchors, and
   every formula a row of its name and its page's lead; two columns where they fit, one on a phone. */
.fp-hub { max-width: 1100px; margin: 0 auto; padding: var(--space16) var(--screenMargin) var(--sectionGap); }
.fp-hub-intro { display: grid; gap: var(--space12); max-width: 68ch; padding-bottom: var(--space8); }
.fp-hub h1 { max-width: none; margin: 0; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
.fp-hub-lead { color: var(--onSurfaceLow); }
.fp-find { display: flex; align-items: center; gap: var(--space8); min-height: 52px; padding-inline: var(--space14); background: var(--surfaceHigh); color: var(--onSurfaceLow); border: var(--border-card) solid var(--outline); border-radius: var(--pillRadius); }
.fp-find[hidden], .fp-find-none[hidden], .fp-jump a[hidden], .fp-shelf[hidden], .fp-shelf li[hidden] { display: none; }
.fp-find:focus-within { border-color: var(--ink); outline: 1px solid var(--ink); outline-offset: 0; }
.fp-find svg { flex: none; }
.fp-find input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 17px; color: var(--ink); outline: none; /* ring: .fp-find:focus-within */ }
.fp-find-none { color: var(--onSurfaceLow); }
/* the bar stays at the top while the shelves scroll under it: it is how a reader of 98 rows gets to the sixth shelf */
.fp-jump { position: sticky; top: 0; z-index: 5; display: flex; gap: var(--space6); overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--screenMargin)); padding: var(--space10) var(--screenMargin); background: var(--ground); border-bottom: var(--border-row) solid var(--ghostOutline); }
.fp-jump a { flex: none; display: inline-flex; align-items: center; gap: var(--space6); min-height: 44px; padding-inline: var(--space12); font-size: 15px; text-decoration: none; color: var(--ink); background: var(--surfaceHigh); border: var(--border-pill) solid var(--outline); border-radius: var(--pillRadius); }
.fp-jump a:hover { background: var(--surfaceLow); }
.fp-jump b, .fp-shelf h2 span { font-weight: 500; color: var(--onSurfaceLow); font-variant-numeric: tabular-nums; }
.fp-shelf { padding-block: var(--space24) var(--space8); scroll-margin-top: 72px; }
.fp-shelf h2 { margin: 0 0 var(--space8); font-size: var(--type-headMd-size); line-height: var(--type-headMd-line); letter-spacing: 0; }
.fp-shelf h2 span { margin-inline-start: var(--space6); font-size: 15px; }
.fp-shelf ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); column-gap: calc(var(--space24) + var(--space8)); margin: 0; padding: 0; list-style: none; }
.fp-shelf li { min-width: 0; border-top: var(--border-row) solid var(--ghostOutline); }
.fp-shelf a { display: grid; gap: var(--space2); min-height: 48px; padding-block: var(--space12); color: var(--ink); text-decoration: none; }
.fp-shelf a b { font-weight: 600; }
.fp-shelf a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.fp-shelf a span { font-size: var(--type-bodyMd-size); line-height: var(--type-bodyMd-line); color: var(--onSurfaceLow); }

/* G-6 / SITE10-7: the «embed on your site» disclosure is a small row by the footer's links; open, it takes its own line. */
.foot { align-items: center; }
.fp-embed { flex: 0 1 auto; }
.fp-embed[open] { flex-basis: 100%; order: 9; max-width: 68ch; }
.fp-embed summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; font-size: 14px; line-height: 1.4; color: var(--onSurfaceLow); }
.fp-embed p { margin: var(--space12) 0; }
/* D-SITE-26 OF-2: the ready code's two variants, a native radio pair that shows one <pre>. */
.fp-embed-code { display: flex; flex-wrap: wrap; gap: var(--space12); }
.fp-embed-code input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fp-embed-code label { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space16); border: 1px solid var(--ghostOutline); border-radius: var(--panelRadius); cursor: pointer; font-size: 14px; color: var(--onSurfaceLow); }
.fp-embed-code input:checked + label { border-color: currentColor; color: var(--ink); font-weight: 600; }
.fp-embed-code input:focus-visible + label { outline: 2px solid currentColor; outline-offset: 2px; }
.fp-embed-code pre { flex-basis: 100%; min-width: 0; }
#fp-embed-script:checked ~ .fp-embed-as-link, #fp-embed-link:checked ~ .fp-embed-as-script { display: none; }
.fp-embed pre { margin: 0; padding: var(--space12) var(--space16); overflow-x: auto; border: 1px solid var(--ghostOutline); border-radius: var(--panelRadius); user-select: all; }
.fp-embed code { font-family: ui-monospace, monospace; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- layout A, from 960 px: the sticky card right (SITE10-1), the article ~640 px left */
@media (min-width: 960px) {
  .nn-page { display: grid; grid-template-columns: minmax(0, 640px) 440px; grid-template-rows: none; column-gap: calc(2 * var(--space24)); justify-content: center; max-width: 1240px; padding: var(--space24) var(--screenMargin) calc(2 * var(--space24)); }
  .nn-page > :not(.nn-calc) { grid-column: 1; margin: 0; }
  .nn-page > .fp-lead { margin-bottom: var(--space16); }
  .nn-page > .nn-calc { grid-column: 2; grid-row: 1 / span 6; position: sticky; top: var(--space24); align-self: start; }
  .nn-page > .fp-text { padding: 0; max-width: none; }
  .nn-fields { max-width: 420px; }
  .nn-calc .nn-result-fields { display: flex; align-items: center; justify-content: flex-end; margin: 0; padding: 0 var(--space16); border-top: 1px solid var(--ghostOutline); min-height: calc(2 * var(--resultAir) + 2 * var(--resultBreath) + (var(--resultFont) + var(--resultNextFont)) * var(--resultLine)); }
  .nn-calc .nn-result .nn-lines { align-items: flex-end; }   /* the answer right; the canvas row keeps its centre line */
  .nn-calc .fp-store { margin: 0; padding: var(--space12) var(--space16); border-top: 1px solid var(--ghostOutline); background: var(--surfaceLow); }
}

/* ---- below 960 px: one column, the card dissolved so its three nodes take the phone's order (SITE10-2) */
@media (max-width: 959px) {
  .nn-page { display: flex; flex-direction: column; padding: var(--space12) 0 0; }
  .nn-page > :not(.nn-calc) { margin-inline: var(--screenMargin); }
  .nn-title { font-size: var(--type-headMd-size); line-height: var(--type-headMd-line); }
  .nn-fields { max-width: none; }
  :root { --canvasMin: 96px; }
  .nn-canvas { font-size: 24px; --mathSize: 24px; }
  .nn-page > .nn-title { order: 1; margin-bottom: var(--space8); }
  .nn-page > .fp-lead { order: 2; margin-bottom: var(--space16); }
  .nn-page > .nn-fields { order: 3; }
  .nn-page > .nn-calc { display: contents; }
  .nn-calc > .nn-result-fields { order: 4; margin: 0 var(--screenMargin) var(--space4); }
  .nn-calc > .fp-store { order: 5; margin: var(--space8) var(--screenMargin) var(--space16); }
  .nn-calc > .nn-canvas { order: 6; margin-bottom: var(--space16); border-top: var(--border-card) solid var(--ghostOutline); }
  .nn-page > .fp-text { order: 7; margin-inline: 0; }
  .fp-table th, .fp-table td { padding-inline: var(--space6); font-size: 15px; }
}
