/* built by build.sh — edit design/ or site/assets/css/site.css, not this file */
/* ============================================================================
   BONITHENA — colour tokens
   Variables only: no components, no resets, no utilities.
   Two sampled anchors (#BDB9B6 paper, #313133 ink) + five liturgical accents.
   Every ratio in a comment below is measured (WCAG 2.1 + APCA 0.1.9);
   `verify.py` re-checks them, so a value edited by hand fails loudly.
   Ramp steps are OKLab-interpolated, i.e. even in perceived lightness.
   ============================================================================ */

/* ── 1. primitives ─────────────────────────────────────────────────────────
   Raw values. Nothing here is meant to be referenced by a component;
   components read the semantic layer (section 2). Override primitives only
   when re-skinning the whole system. */

:root {
  /* anchors, sampled pixel-exact from the reference graphic */
  --c-paper: #BDB9B6;  /* warm neutral · 62% of source px */
  --c-ink:   #313133;  /* cool ink     · 36% of source px */

  /* neutral ramp: paper → ink, even OKLab steps */
  --c-n0: #BDB9B6;  /* paper */
  --c-n1: #AEAAA8;
  --c-n2: #9C9997;
  --c-n3: #878584;
  --c-n4: #737171;
  --c-n5: #605E5F;
  --c-n6: #4D4C4D;
  --c-n7: #3D3D3F;
  --c-n8: #313133;  /* ink */

  /* text-tuned ink steps, sitting between n8 and n6 to land on 7:1 / 4.5:1 */
  --c-ink-deep: #2F2D2D;  /* 7.03:1 on #BDB9B6 */
  --c-ink-mute: #4C4A4B;  /* 4.51:1 on #BDB9B6 · floor */
  --c-card:     #E1DFDE;  /* 9.77:1 on #E1DFDE */

  /* liturgical accents — wash / line / seam / ink / on-ink */
  /* red — Gifts of the Holy Spirit */
  --c-red-wash:   #EA8F82;
  --c-red-line:   #9F4C42;   /* 3.01:1 on #BDB9B6 */
  --c-red-seam:   #AF594E;   /* 2.01:1 on #EA8F82 */
  --c-red-ink:    #71211A;   /* 4.52:1 on #EA8F82 */
  --c-red-on-ink: #FBB8AE;   /* 7.77:1 on #313133 */

  /* rose — Rejoicing */
  --c-rose-wash:   #DCAD9A;
  --c-rose-line:   #855B4A;   /* 3.00:1 on #BDB9B6 */
  --c-rose-seam:   #A17563;   /* 2.00:1 on #DCAD9A */
  --c-rose-ink:    #673F2F;   /* 4.50:1 on #DCAD9A */
  --c-rose-on-ink: #FECDB9;   /* 9.05:1 on #313133 */

  /* violet — Contrition */
  --c-violet-wash:   #BC8EAA;
  --c-violet-line:   #825873;   /* 3.00:1 on #BDB9B6 */
  --c-violet-seam:   #865B76;   /* 2.01:1 on #BC8EAA */
  --c-violet-ink:    #4D2740;   /* 4.52:1 on #BC8EAA */
  --c-violet-on-ink: #DDADCA;   /* 6.74:1 on #313133 */

  /* gold — Majesty and Purity */
  --c-gold-wash:   #DAB577;
  --c-gold-line:   #815F20;   /* 3.00:1 on #BDB9B6 */
  --c-gold-seam:   #9F7C3E;   /* 2.00:1 on #DAB577 */
  --c-gold-ink:    #644500;   /* 4.54:1 on #DAB577 */
  --c-gold-on-ink: #FBD596;   /* 9.31:1 on #313133 */

  /* green — Life in the Holy Spirit */
  --c-green-wash:   #B3B77D;
  --c-green-line:   #666831;   /* 3.00:1 on #BDB9B6 */
  --c-green-seam:   #7C7F47;   /* 2.00:1 on #B3B77D */
  --c-green-ink:    #47480D;   /* 4.54:1 on #B3B77D */
  --c-green-on-ink: #D3D79C;   /* 8.64:1 on #313133 */
}

/* ── 2. semantics ─────────────────────────────────────────────────────────
   The layer components use. Values alias primitives, so a whole theme can be
   re-pointed by redefining this block alone. */

:root {
  /* surfaces */
  --surface:        var(--c-n0);      /* page ground */
  --surface-card:   var(--c-card);     /* 9.77:1 on #E1DFDE · for long copy */
  --surface-invert: var(--c-n8);      /* header / dark panels */

  /* type */
  --text:        var(--c-n8);         /* 6.66:1 on #BDB9B6 */
  --text-head:   var(--c-ink-deep);   /* 7.03:1 on #BDB9B6 */
  --text-muted:  var(--c-ink-mute);   /* 4.51:1 on #BDB9B6 · floor */
  --text-invert: var(--c-n0);         /* 6.66:1 on #313133 */

  /* frames — decoration only, never a contrast carrier */
  --frame:        var(--c-n2);        /* 1.45:1 on #BDB9B6 */
  --frame-strong: var(--c-n4);        /* 2.49:1 on #BDB9B6 */

  /* accent, neutral by default; one of the five or a [data-season] sets it */
  --accent-wash:   var(--c-violet-wash);
  --accent-line:   var(--c-violet-line);
  --accent-seam:   var(--c-violet-seam);
  --accent-ink:    var(--c-violet-ink);
  --accent-on-ink: var(--c-violet-on-ink);
}

/* ── 3. season scoping ─────────────────────────────────────────────────────
   Set one attribute on any container; everything inside inherits the pair.
   Nested seasons override correctly, because these only assign variables. */

[data-season="advent"], [data-season="lent"] {
  --accent-wash:   var(--c-violet-wash);
  --accent-line:   var(--c-violet-line);
  --accent-seam:   var(--c-violet-seam);
  --accent-ink:    var(--c-violet-ink);
  --accent-on-ink: var(--c-violet-on-ink);
}

[data-season="gaudete"], [data-season="laetare"] {
  --accent-wash:   var(--c-rose-wash);
  --accent-line:   var(--c-rose-line);
  --accent-seam:   var(--c-rose-seam);
  --accent-ink:    var(--c-rose-ink);
  --accent-on-ink: var(--c-rose-on-ink);
}

[data-season="christmas"], [data-season="easter"], [data-season="epiphany-feast"] {
  --accent-wash:   var(--c-gold-wash);
  --accent-line:   var(--c-gold-line);
  --accent-seam:   var(--c-gold-seam);
  --accent-ink:    var(--c-gold-ink);
  --accent-on-ink: var(--c-gold-on-ink);
}

[data-season="pentecost"], [data-season="martyrs"] {
  --accent-wash:   var(--c-red-wash);
  --accent-line:   var(--c-red-line);
  --accent-seam:   var(--c-red-seam);
  --accent-ink:    var(--c-red-ink);
  --accent-on-ink: var(--c-red-on-ink);
}

[data-season="ordinary"], [data-season="epiphany"] {
  --accent-wash:   var(--c-green-wash);
  --accent-line:   var(--c-green-line);
  --accent-seam:   var(--c-green-seam);
  --accent-ink:    var(--c-green-ink);
  --accent-on-ink: var(--c-green-on-ink);
}
/* ============================================================================
   BONITHENA — type tokens
   One family: Junicode 2 (variable: weight 300–700, width 75–125%, roman +
   italic). Built for medievalists; carries the Anglo-Saxon letters Boniface
   wrote with (ƿ þ ð ᵹ) and polytonic Greek (Ἀθηνᾶ).
   Headings go wide and light at the top, narrower and heavier further down.
   Sizes are fluid: first clamp value = phone (375px), last = desktop (1280px+).
   Colour comes from bonithena.css; this file only reads its semantic tokens.
   ============================================================================ */

/* Fonts: subset to Latin, Latin Extended, Greek + Greek Extended, Anglo-Saxon
   and punctuation; ENLA axis pinned to 0. ~330 KB roman, ~360 KB italic. */
@font-face {
  font-family: "Junicode";
  src: url("../fonts/junicode-subset.woff2") format("woff2");
  font-weight: 300 700; font-stretch: 75% 125%; font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Junicode";
  src: url("../fonts/junicode-italic-subset.woff2") format("woff2");
  font-weight: 300 700; font-stretch: 75% 125%; font-style: italic;
  font-display: swap;
}

/* ── 1. primitives ───────────────────────────────────────────────────────── */

:root {
  --font-text:    "Junicode", Georgia, "Times New Roman", serif;
  --font-display: "Junicode", Georgia, "Times New Roman", serif;  /* same face today; swap here only */
  --font-mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --font-light:    300;
  --font-regular:  400;
  --font-semibold: 600;
  --font-bold:     700;

  --measure: 66ch;   /* max line length of running text */
}

/* ── 2. semantic scale ───────────────────────────────────────────────────────
   Five values per role: size · leading · weight · width · tracking.
   label and button add two more: caps (font-variant-caps) and transform.
   Italic roles: lede, caption, quote. Small-caps roles: label, button.
   Never use the `font` shorthand on top of these: it resets stretch + caps. */

:root {
  /* display: hero word, once per site */
  --type-display-size:     clamp(48px, 7.2vw + 21px, 104px);
  --type-display-leading:  0.98;
  --type-display-weight:   var(--font-light);
  --type-display-width:    125%;
  --type-display-tracking: -0.015em;

  /* h1: page title */
  --type-h1-size:     clamp(40px, 3.6vw + 26px, 68px);
  --type-h1-leading:  1.04;
  --type-h1-weight:   var(--font-regular);
  --type-h1-width:    112%;
  --type-h1-tracking: -0.01em;

  /* h2: section */
  --type-h2-size:     clamp(30px, 2vw + 22px, 46px);
  --type-h2-leading:  1.1;
  --type-h2-weight:   var(--font-regular);
  --type-h2-width:    106%;
  --type-h2-tracking: 0;

  /* h3: card, block */
  --type-h3-size:     clamp(23px, 0.9vw + 20px, 30px);
  --type-h3-leading:  1.2;
  --type-h3-weight:   var(--font-semibold);
  --type-h3-width:    100%;
  --type-h3-tracking: 0;

  /* h4: small heading */
  --type-h4-size:     clamp(19px, 0.4vw + 17.5px, 22px);
  --type-h4-leading:  1.3;
  --type-h4-weight:   var(--font-semibold);
  --type-h4-width:    100%;
  --type-h4-tracking: 0;

  /* lede: subheadline under h1/h2 (italic) */
  --type-lede-size:     clamp(20px, 0.6vw + 17.7px, 25px);
  --type-lede-leading:  1.45;
  --type-lede-weight:   var(--font-regular);
  --type-lede-width:    100%;
  --type-lede-tracking: 0;

  /* body: paragraph */
  --type-body-size:     clamp(17.5px, 0.2vw + 16.7px, 19px);
  --type-body-leading:  1.6;
  --type-body-weight:   var(--font-regular);
  --type-body-width:    100%;
  --type-body-tracking: 0;

  /* small: cards, footers, tables */
  --type-small-size:     16px;
  --type-small-leading:  1.5;
  --type-small-weight:   var(--font-regular);
  --type-small-width:    100%;
  --type-small-tracking: 0;

  /* caption: images, form help (italic) */
  --type-caption-size:     14.5px;
  --type-caption-leading:  1.45;
  --type-caption-weight:   var(--font-regular);
  --type-caption-width:    100%;
  --type-caption-tracking: 0;

  /* label: eyebrow, tag, table head (small caps) */
  --type-label-size:     14px;
  --type-label-leading:  1.2;
  --type-label-weight:   var(--font-semibold);
  --type-label-width:    100%;
  --type-label-tracking: 0.12em;
  --type-label-caps:      all-small-caps;
  --type-label-transform: none;

  /* button (small caps) */
  --type-button-size:     17px;
  --type-button-leading:  1;
  --type-button-weight:   var(--font-semibold);
  --type-button-width:    100%;
  --type-button-tracking: 0.1em;
  --type-button-caps:      all-small-caps;
  --type-button-transform: none;

  /* nav: top navigation */
  --type-nav-size:     17px;
  --type-nav-leading:  1;
  --type-nav-weight:   var(--font-regular);
  --type-nav-width:    110%;
  --type-nav-tracking: 0.02em;

  /* quote: pull quote (italic) */
  --type-quote-size:     clamp(24px, 1.2vw + 19.5px, 34px);
  --type-quote-leading:  1.3;
  --type-quote-weight:   var(--font-light);
  --type-quote-width:    100%;
  --type-quote-tracking: 0;
}

/* ── 3. base + classes ───────────────────────────────────────────────────────
   Elements get their role by default; .t-* classes apply a role to anything
   (e.g. an <h2> that should look like an h3: <h2 class="t-h3">).            */

body {
  font-family: var(--font-text);
  font-size: var(--type-body-size);
  line-height: var(--type-body-leading);
  font-weight: var(--type-body-weight);
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.t-display {
  font-family: var(--font-display);
  font-size: var(--type-display-size); line-height: var(--type-display-leading);
  font-weight: var(--type-display-weight); font-stretch: var(--type-display-width);
  letter-spacing: var(--type-display-tracking);
}
h1, .t-h1 {
  font-family: var(--font-display);
  font-size: var(--type-h1-size); line-height: var(--type-h1-leading);
  font-weight: var(--type-h1-weight); font-stretch: var(--type-h1-width);
  letter-spacing: var(--type-h1-tracking); font-style: normal; text-wrap: balance;
}
h2, .t-h2 {
  font-family: var(--font-display);
  font-size: var(--type-h2-size); line-height: var(--type-h2-leading);
  font-weight: var(--type-h2-weight); font-stretch: var(--type-h2-width);
  letter-spacing: var(--type-h2-tracking); font-style: normal; text-wrap: balance;
}
h3, .t-h3 {
  font-family: var(--font-text);
  font-size: var(--type-h3-size); line-height: var(--type-h3-leading);
  font-weight: var(--type-h3-weight); font-stretch: var(--type-h3-width);
  letter-spacing: var(--type-h3-tracking); font-style: normal;
}
h4, .t-h4 {
  font-family: var(--font-text);
  font-size: var(--type-h4-size); line-height: var(--type-h4-leading);
  font-weight: var(--type-h4-weight); font-stretch: var(--type-h4-width);
  letter-spacing: var(--type-h4-tracking); font-style: normal;
}
h1, h2, h3, h4 { color: var(--text-head, inherit); }

.t-lede {
  font-size: var(--type-lede-size); line-height: var(--type-lede-leading);
  font-weight: var(--type-lede-weight); font-stretch: var(--type-lede-width);
  letter-spacing: var(--type-lede-tracking); font-style: italic;
  max-width: 34em; text-wrap: pretty;
}
p, .t-body {
  max-width: var(--measure); text-wrap: pretty; hyphens: auto;
}
.t-body {
  font-size: var(--type-body-size); line-height: var(--type-body-leading);
  font-weight: var(--type-body-weight); font-stretch: var(--type-body-width);
}
p + p { margin-top: 0.9em; }

small, .t-small {
  font-size: var(--type-small-size); line-height: var(--type-small-leading);
  font-weight: var(--type-small-weight); font-stretch: var(--type-small-width);
}
figcaption, .t-caption {
  font-size: var(--type-caption-size); line-height: var(--type-caption-leading);
  font-weight: var(--type-caption-weight); font-stretch: var(--type-caption-width);
  font-style: italic;
}
.t-label {
  font-size: var(--type-label-size); line-height: var(--type-label-leading);
  font-weight: var(--type-label-weight); font-stretch: var(--type-label-width);
  letter-spacing: var(--type-label-tracking);
  font-variant-caps: var(--type-label-caps);   /* real smcp + c2sc glyphs */
  text-transform: var(--type-label-transform);
}
.t-button {
  font-size: var(--type-button-size); line-height: var(--type-button-leading);
  font-weight: var(--type-button-weight); font-stretch: var(--type-button-width);
  letter-spacing: var(--type-button-tracking);
  font-variant-caps: var(--type-button-caps);
  text-transform: var(--type-button-transform);
}
.t-nav {
  font-size: var(--type-nav-size); line-height: var(--type-nav-leading);
  font-weight: var(--type-nav-weight); font-stretch: var(--type-nav-width);
  letter-spacing: var(--type-nav-tracking);
}
blockquote, .t-quote {
  font-size: var(--type-quote-size); line-height: var(--type-quote-leading);
  font-weight: var(--type-quote-weight); font-stretch: var(--type-quote-width);
  letter-spacing: var(--type-quote-tracking); font-style: italic; text-wrap: balance;
}
cite, .t-cite {
  font-size: var(--type-label-size); font-weight: var(--type-label-weight);
  letter-spacing: var(--type-label-tracking); font-style: normal;
  font-variant-caps: var(--type-label-caps); text-transform: var(--type-label-transform);
}

/* links in running text: underlined, never colour alone */
p a, li a, .t-link {
  color: inherit;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em;
}
p a:hover, li a:hover, .t-link:hover { text-decoration-thickness: 2px; }

/* numbers that must line up: tables, prices, times */
.t-num, td, th { font-variant-numeric: lining-nums tabular-nums; }

/* form */
label { font-size: var(--type-small-size); font-weight: var(--font-semibold); }
input, textarea, select, button { font: inherit; }
input, textarea, select { font-size: var(--type-body-size); }
/* ============================================================================
   BONITHENA UI — 01b themes
   Semantic re-pointing only: no component rules live here. Imported right after
   tokens.css, so every component reads these through the same names it already
   uses (--surface, --text, --frame, --accent-*).

   Two parts:
     1. tokens the component layer needed and the upstream file does not have
        (computed from existing primitives, never a new hue)
     2. [data-surface="invert"] — the dark version. Set it on any container and
        everything inside inverts without touching component CSS.

   Every pair is checked by scripts/contrast_check.py (WCAG 2.x + APCA 0.1.9).
   Ratios in the comments below are what that script prints.
   ============================================================================ */

/* ── 1. additions to the light (default) scope ──────────────────────────── */
:root {
  /* one new primitive, specified by the owner for headings on ink:
     paper lifted past n0. 8.88:1 / Lc -74.2 on #313133 (needs >= 7:1) */
  --c-paper-lift: #D8D5D2;

  /* muted text that sits on a card face. In light the plain muted step already
     clears 4.5:1 on the card (6.62:1), so it is the same value. */
  --text-muted-card: var(--c-ink-mute);

  /* the boundary of a form control (input, select, checkbox, switch): WCAG 1.4.11
     wants 3:1 against what surrounds it. --frame-strong is decoration (2.49:1 on
     paper), so controls read this instead.  n5: 3.30:1 paper, 4.84:1 card. */
  --frame-control: var(--c-n5);

  /* validation: the red and green accents, independent of the season */
  --state-error-ink:  var(--c-red-ink);     /* 5.57:1 paper · 8.17:1 card */
  --state-error-line: var(--c-red-line);    /* 3.01:1 paper · 4.41:1 card */
  --state-ok-ink:     var(--c-green-ink);   /* 4.90:1 paper · 7.18:1 card */
  --state-ok-line:    var(--c-green-line);  /* 3.00:1 paper · 4.40:1 card */

  /* modal backdrop: ink at 62% (the brief), never pure black */
  --overlay-backdrop: color-mix(in srgb, var(--c-ink) 62%, transparent);

  /* spacing scale for page layout (page.css and a site's own layout file).
     Not colour, not type: just the steps, so a page never invents a gap. */
  --space-2xs: 4px;
  --space-xs:  10px;
  --space-s:   14px;
  --space-m:   20px;
  --space-l:   28px;
  --space-xl:  clamp(32px, 4vw, 48px);
  --space-2xl: clamp(40px, 5vw, 76px);
}

/* ── 2. invert ─────────────────────────────────────────────────────────────
   Values are the owner's spec; the three computed ones are marked.
   .bn-panel--invert and .bn-bar are ink by definition, so they are invert
   scopes too: a button or field inside them reads the dark tokens.       */
[data-surface="invert"],
.bn-panel--invert,
.bn-bar {
  --surface:        var(--c-n8);          /* #313133 */
  --surface-card:   var(--c-n7);          /* #3D3D3F */
  /* "the ink band" keeps meaning ink in both modes: inside invert it equals the
     surface. (buttons.css paints button faces with it inside this scope.) */
  --surface-invert: var(--c-n8);

  --text:        var(--c-n0);             /* #BDB9B6 · 6.66:1 on n8 · 5.56:1 on n7 */
  --text-head:   var(--c-paper-lift);     /* #D8D5D2 · 8.88:1 on n8 · 7.42:1 on n7 */
  --text-muted:  color-mix(in srgb, var(--c-n0) 78%, var(--c-n8));
                                          /* = #9E9B99 · 4.70:1 on n8 (floor 4.5)
                                             but only 3.92:1 on n7, hence:       */
  --text-muted-card: color-mix(in srgb, var(--c-n0) 88%, var(--c-n8));
                                          /* computed · = #ACA9A6 · 4.63:1 on n7 */
  --text-invert: var(--c-n0);

  --frame:         var(--c-n5);           /* #605E5F · 2.02:1 on n8 (decoration) */
  --frame-strong:  var(--c-n4);           /* #737171 · 2.68:1 on n8 (decoration) */
  --frame-control: var(--c-n2);           /* computed · #9C9997 · 4.58:1 n8 · 3.83:1 n7 */

  /* accents: line and ink become the on-ink step, so anything that drew in
     accent ink on paper now draws in the light accent on ink */
  --accent-line: var(--accent-on-ink);
  --accent-ink:  var(--accent-on-ink);
  /* the wash has to darken or on-ink text on it disappears (on-ink on the
     light wash is ~1.4:1). computed: 14% of on-ink into ink. Weakest season
     (violet): on-ink 5.06:1, body text 5.00:1 on it. */
  --accent-wash: color-mix(in srgb, var(--accent-on-ink) 14%, var(--c-n8));
  --accent-seam: color-mix(in srgb, var(--accent-on-ink) 45%, var(--c-n8));

  --state-error-ink:  var(--c-red-on-ink);    /* 7.77:1 n8 · 6.49:1 n7 */
  --state-error-line: var(--c-red-on-ink);
  --state-ok-ink:     var(--c-green-on-ink);  /* 8.64:1 n8 · 7.21:1 n7 */
  --state-ok-line:    var(--c-green-on-ink);

  background-color: var(--surface);
  color: var(--text);
}

/* a season set *inside* an invert scope re-assigns --accent-line/-ink to the
   paper values on that element; re-apply the invert mapping there. (When the
   season sits on the same element, or on an ancestor, the block above is enough:
   it is later in the cascade and reads --accent-on-ink from the season.) */
[data-surface="invert"] [data-season],
.bn-panel--invert [data-season],
.bn-bar [data-season] {
  --accent-line: var(--accent-on-ink);
  --accent-ink:  var(--accent-on-ink);
  --accent-wash: color-mix(in srgb, var(--accent-on-ink) 14%, var(--c-n8));
  --accent-seam: color-mix(in srgb, var(--accent-on-ink) 45%, var(--c-n8));
}
/* ============================================================================
   BONITHENA UI — 02 elements
   The nineteen engraving elements as CSS masks: the drawing is the alpha, the
   colour is `currentColor`. One class per element, one class per size.
   Small traces from assets/elements (≈25 KB each) — for the full-size engravings
   use design/elements/final/elements.
   ============================================================================ */

.bn-el {
  --bn-el-size: 32px;
  --bn-el-src: none;
  display: inline-block;
  width: var(--bn-el-size);
  height: var(--bn-el-size);
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--bn-el-src) center / contain no-repeat;
  mask: var(--bn-el-src) center / contain no-repeat;
  vertical-align: middle;
}

/* ---- sizes: the only knob components need to pass ------------------------- */
.bn-el--16  { --bn-el-size: 16px; }
.bn-el--20  { --bn-el-size: 20px; }
.bn-el--24  { --bn-el-size: 24px; }
.bn-el--32  { --bn-el-size: 32px; }
.bn-el--40  { --bn-el-size: 40px; }
.bn-el--48  { --bn-el-size: 48px; }
.bn-el--64  { --bn-el-size: 64px; }
.bn-el--96  { --bn-el-size: 96px; }
.bn-el--128 { --bn-el-size: 128px; }
.bn-el--160 { --bn-el-size: 160px; }
.bn-el--auto { --bn-el-size: 1em; }

/* ---- colour: ink by default, then the season ---------------------------- */
.bn-el--ink    { color: var(--text); }
.bn-el--inkdeep{ color: var(--text-head); }
.bn-el--muted  { color: var(--text-muted); }
.bn-el--accent { color: var(--accent-line); }
.bn-el--wash   { color: var(--accent-ink); }
.bn-el--invert { color: var(--text-invert); }
.bn-el--onink  { color: var(--accent-on-ink); }

/* ---- the set ------------------------------------------------------------ */
.bn-el--acorn         { --bn-el-src: url("../ui/elements/acorn.svg"); }
.bn-el--arc-roof      { --bn-el-src: url("../ui/elements/arc-roof.svg"); }
.bn-el--axe           { --bn-el-src: url("../ui/elements/axe.svg"); }
.bn-el--bee           { --bn-el-src: url("../ui/elements/bee.svg"); }
.bn-el--belly         { --bn-el-src: url("../ui/elements/belly.svg"); }
.bn-el--circle        { --bn-el-src: url("../ui/elements/circle.svg"); }
.bn-el--dive          { --bn-el-src: url("../ui/elements/dive.svg"); }
.bn-el--gate          { --bn-el-src: url("../ui/elements/gate.svg"); }
.bn-el--growth        { --bn-el-src: url("../ui/elements/growth.svg"); }
.bn-el--hand-shoulder { --bn-el-src: url("../ui/elements/hand-shoulder.svg"); }
.bn-el--helmet        { --bn-el-src: url("../ui/elements/helmet.svg"); }
.bn-el--linden        { --bn-el-src: url("../ui/elements/linden.svg"); }
.bn-el--mitre         { --bn-el-src: url("../ui/elements/mitre.svg"); }
.bn-el--oak-leaf      { --bn-el-src: url("../ui/elements/oak-leaf.svg"); }
.bn-el--oak           { --bn-el-src: url("../ui/elements/oak.svg"); }
.bn-el--scroll        { --bn-el-src: url("../ui/elements/scroll.svg"); }
.bn-el--shield        { --bn-el-src: url("../ui/elements/shield.svg"); }
.bn-el--swarm         { --bn-el-src: url("../ui/elements/swarm.svg"); }
.bn-el--two           { --bn-el-src: url("../ui/elements/two.svg"); }

/* ---- an element that fills its box (hero use, keeps the engraving) ------ */
.bn-el--fill {
  width: 100%;
  height: auto;
  aspect-ratio: var(--bn-el-ratio, 1);
  --bn-el-size: auto;
}
/* ============================================================================
   BONITHENA UI — 03 buttons
   A button here is struck metal, not a rectangle. Four families, all SVG:

     .bn-btn          Tablet  — the workhorse: cut corners, engraved double line
     .bn-btn--seal    Seal    — committing: a struck disc you press
     .bn-btn--axe     Axe     — the destructive one: the tablet gets a tail
     .bn-btn--quiet   Tablet  — no fill, hairline only (secondary / ghost)

   The frame arrives as a 9-slice mask over `background: currentColor`, so the
   corners keep their cut at any width and the frame takes the text colour.
   Browsers without mask-border fall back to a border-image frame in ink.
   Typography is deliberately inherited — type tokens belong to the font layer.
   ============================================================================ */

.bn-btn {
  /* per-button knobs */
  --bn-fill: var(--surface); /* the face; transparent fills are painted in paper */
  --bn-frame: currentColor;  /* the engraving */
  --bn-ink: var(--text);
  --bn-gap: 0.65em;
  --bn-cut-px: 9px;          /* corner cut of the frame */
  --bn-oct: polygon(var(--bn-cut-px) 0, calc(100% - var(--bn-cut-px)) 0, 100% var(--bn-cut-px),
                   100% calc(100% - var(--bn-cut-px)), calc(100% - var(--bn-cut-px)) 100%,
                   var(--bn-cut-px) 100%, 0 calc(100% - var(--bn-cut-px)), 0 var(--bn-cut-px));
  --bn-oct-inner: polygon(calc(var(--bn-cut-px) - 2px) 0, calc(100% - var(--bn-cut-px) + 2px) 0,
                   100% calc(var(--bn-cut-px) - 2px), 100% calc(100% - var(--bn-cut-px) + 2px),
                   calc(100% - var(--bn-cut-px) + 2px) 100%,
                   calc(var(--bn-cut-px) - 2px) 100%, 0 calc(100% - var(--bn-cut-px) + 2px),
                   0 calc(var(--bn-cut-px) - 2px));

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--bn-gap);
  min-height: 44px;
  padding: 0 clamp(16px, 1.9em, 26px);
  border: 0;
  background: none;
  color: var(--bn-ink);
  /* typography comes from the font layer; every var has a fallback so buttons
     still look right if design/css/type.css is absent */
  font-family: var(--font-text, inherit);
  font-size: var(--type-button-size, 13px);
  font-weight: var(--type-button-weight, 500);
  font-stretch: var(--type-button-width, normal);
  letter-spacing: var(--type-button-tracking, 0.08em);
  font-variant-caps: var(--type-button-caps, normal);
  text-transform: var(--type-button-transform, uppercase);
  line-height: var(--type-button-leading, 1);
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 120ms linear, transform 90ms ease-out;
}

/* the frame — an octagon (cut corners) in two nested fills: the frame colour,
   then the face inset by the stroke. Cut corners never stretch, edges never
   distort, and the whole thing is 2 elements instead of a 9-slice grid. */
.bn-btn::after {                    /* the frame: solid octagon */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--bn-frame);
  clip-path: var(--bn-oct);
  transition: background-color 120ms linear;
  pointer-events: none;
}
.bn-btn::before {                   /* the face: octagon inset by the stroke */
  content: "";
  position: absolute;
  inset: var(--bn-stroke, 1.8px);
  z-index: 2;
  background: var(--bn-fill);
  clip-path: var(--bn-oct-inner);
  transition: background-color 120ms linear;
  pointer-events: none;
}

.bn-btn > * { position: relative; z-index: 3; }

/* ---- sizes -------------------------------------------------------------- */
/* sizes scale the font layer's button size rather than replacing it */
.bn-btn--sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: calc(var(--type-button-size, 13px) * 0.85);
}
.bn-btn--lg {
  min-height: 56px;
  padding: 0 30px;
  font-size: calc(var(--type-button-size, 13px) * 1.08);
}
.bn-btn--xl {
  min-height: 68px;
  padding: 0 40px;
  font-size: calc(var(--type-button-size, 13px) * 1.15);
}

/* icon only: a square tablet; give it an aria-label */
.bn-btn--icon {
  --bn-cut-px: 8px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
}
.bn-btn--icon.bn-btn--sm { width: 36px; min-width: 36px; height: 36px; }
.bn-btn--icon.bn-btn--lg { width: 56px; min-width: 56px; height: 56px; }

/* ---- families ----------------------------------------------------------- */
/* primary: the face is the season wash, the frame darkens with it */
.bn-btn--primary {
  --bn-fill: var(--accent-wash);
  --bn-frame: var(--accent-ink);
  --bn-ink: var(--accent-ink);
}

/* secondary: paper face, ink frame */
.bn-btn--secondary {
  --bn-fill: var(--surface);
  --bn-frame: var(--text);
  --bn-ink: var(--text);
}

/* quiet: hairline only */
.bn-btn--quiet {
  --bn-fill: var(--surface);
  --bn-frame: var(--frame-strong);
  --bn-ink: var(--text-muted);
}

/* destructive: same tablet, a tail instead of a cut corner — the axe family */
.bn-btn--axe {
  --bn-fill: var(--surface);
  --bn-frame: var(--accent-ink);
  --bn-ink: var(--accent-ink);
}
.bn-btn--axe {
  /* a pointed tail on the right: same stroke, different silhouette */
  --bn-oct: polygon(var(--bn-cut-px) 0, calc(100% - 14px) 0, 100% 50%,
                   calc(100% - 14px) 100%, var(--bn-cut-px) 100%,
                   0 calc(100% - var(--bn-cut-px)), 0 var(--bn-cut-px));
  /* inner loop: same cut minus the stroke step as the tablet, so the cut
     corners keep one line weight; the tail runs parallel to the outer one */
  --bn-oct-inner: polygon(calc(var(--bn-cut-px) - 2px) 0, calc(100% - 13px) 0, 100% 50%,
                   calc(100% - 13px) 100%, calc(var(--bn-cut-px) - 2px) 100%,
                   0 calc(100% - var(--bn-cut-px) + 2px), 0 calc(var(--bn-cut-px) - 2px));
  padding-right: 34px;
}

/* ---- the Seal ------------------------------------------------------------
   A struck disc. No border-radius and no shadow anywhere: the disc is
   clip-path: circle(), the rim is assets/frames/seal-ring.svg as a mask.
   (Blink drops a mask on an element that also has border-radius; that was the
   bare-disc bug. Neither pseudo-element carries a radius now.)

   Two forms:
     icon only   <button class="bn-btn bn-btn--seal" aria-label="…">
                   <span class="bn-el bn-el--oak-leaf"></span></button>
     labelled    <a class="bn-btn bn-btn--seal bn-btn--lg" href="…">
                   <span class="bn-btn__disc" aria-hidden="true">
                     <span class="bn-icon bn-icon--mail"></span></span>
                   <span>Write to us</span></a>
                 the seal is pressed onto the start of a tablet: a sealed document.
   ------------------------------------------------------------------------ */
/* seal-ring.svg: the rim's outer edge sits at r = 51.5 of a 120 box, so the
   face is clipped to that circle (43%) and never shows outside the rim */
.bn-btn--seal:not(:has(> .bn-btn__disc)) {
  --bn-seal-face: circle(43% at 50% 50%);
  --bn-oct: var(--bn-seal-face);
  --bn-oct-inner: var(--bn-seal-face);
  width: 72px;
  height: 72px;
  min-height: 0;
  padding: 0;
  gap: 0;
  font-size: calc(var(--type-button-size, 13px) * 0.78);
  letter-spacing: calc(var(--type-button-tracking, 0.08em) * 0.75);
}
/* the face: the whole disc, wash, under the rim (a tablet's face sits over
   its frame; a seal's rim is struck over the face) */
.bn-btn--seal:not(:has(> .bn-btn__disc))::before {
  inset: 0;
  z-index: 0;
  background: var(--bn-fill);
}
/* the rim: ring + rivets, in the frame colour */
.bn-btn--seal:not(:has(> .bn-btn__disc))::after,
.bn-btn__disc::after {
  clip-path: none;
  -webkit-mask: url("../ui/frames/seal-ring.svg") center / 100% 100% no-repeat;
  mask: url("../ui/frames/seal-ring.svg") center / 100% 100% no-repeat;
}
.bn-btn--seal > .bn-el { --bn-el-size: 34px; }
.bn-btn--seal > .bn-icon { --bn-icon-size: 28px; }

/* labelled: the disc overlaps the start of the tablet, a little taller than it */
.bn-btn--seal:has(> .bn-btn__disc) {
  --bn-disc-px: 64px;
  min-height: 52px;
  padding-left: calc(var(--bn-disc-px) + 14px);
}
.bn-btn--seal:has(> .bn-btn__disc)::before,
.bn-btn--seal:has(> .bn-btn__disc)::after {
  left: calc(var(--bn-disc-px) / 2);
}
.bn-btn--seal:has(> .bn-btn__disc)::before { left: calc(var(--bn-disc-px) / 2 + var(--bn-stroke, 1.8px)); }
.bn-btn--seal.bn-btn--lg:has(> .bn-btn__disc) { --bn-disc-px: 72px; min-height: 56px; }
.bn-btn--seal.bn-btn--sm:has(> .bn-btn__disc) { --bn-disc-px: 52px; min-height: 40px; }
.bn-btn > .bn-btn__disc {             /* (0,2,0): beats `.bn-btn > *` */
  position: absolute;
  z-index: 4;
  left: 0;
  top: 50%;
  width: var(--bn-disc-px);
  height: var(--bn-disc-px);
  margin-top: calc(var(--bn-disc-px) / -2);
  display: grid;
  place-items: center;
  color: var(--bn-ink);
}
.bn-btn__disc::before,
.bn-btn__disc::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: background-color 120ms linear;
}
.bn-btn__disc::before {               /* the face: clipped to the rim's outer edge */
  z-index: -2;
  background: var(--bn-disc-fill, var(--bn-fill));
  clip-path: circle(43% at 50% 50%);
}
.bn-btn__disc::after {                /* the rim */
  z-index: -1;
  background: var(--bn-frame);
}
.bn-btn__disc > .bn-icon { --bn-icon-size: calc(var(--bn-disc-px) * 0.36); }
.bn-btn__disc > .bn-el   { --bn-el-size: calc(var(--bn-disc-px) * 0.5); }

/* the main action's colours: wash face, accent rim and ink */
.bn-btn--seal {
  --bn-fill: var(--accent-wash);
  --bn-frame: var(--accent-ink);
  --bn-ink: var(--accent-ink);
}

/* ---- states -------------------------------------------------------------
   idle   struck and cold
   hover  warmed: face takes the wash, frame goes to the accent ink
   press  physical: 1px down, the frame presses in
   focus  the shield rim: a 2px ring at 3:1
   done   the seal is set
   ------------------------------------------------------------------------ */
.bn-btn:hover:not(:disabled):not([aria-disabled="true"]) {
  --bn-fill: var(--accent-wash);
  --bn-frame: var(--accent-ink);
  --bn-ink: var(--accent-ink);
}
.bn-btn:active:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(1px);
}
.bn-btn:active:not(:disabled):not([aria-disabled="true"])::after {
  background: var(--accent-ink);
}
/* focus: the host's own outline. The pseudo-elements are clip-pathed and a
   clip-path clips outlines too, so the ring never lives on them. Where
   corner-shape exists the ring follows the same cut (bevel, never round). */
.bn-btn:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 3px;
}
@supports (corner-shape: bevel) {
  .bn-btn:not(.bn-btn--axe):not(.bn-btn--seal:not(:has(> .bn-btn__disc))) {
    border-radius: calc(var(--bn-cut-px) + 3px);
    corner-shape: bevel;
  }
}
.bn-btn:disabled,
.bn-btn[aria-disabled="true"] {
  --bn-fill: var(--surface);
  --bn-frame: var(--frame);
  --bn-ink: var(--text-muted);
  cursor: not-allowed;
}

/* on ink the transparent families paint the ink face */
.bn-panel--invert .bn-btn,
[data-surface="invert"] .bn-btn { --bn-fill: var(--surface-invert); }
[data-surface="invert"] .bn-btn--primary,
[data-surface="invert"] .bn-btn--seal { --bn-fill: var(--accent-wash); }
/* done: the seal is set, the face dries out and the frame keeps the ink */
.bn-btn[data-state="done"] {
  --bn-fill: var(--accent-wash);
  --bn-frame: var(--accent-ink);
  --bn-ink: var(--accent-ink);
}
.bn-btn[data-state="done"] .bn-btn__fly {
  animation: bn-fly 900ms ease-out 1 both;
}
@keyframes bn-fly {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to   { transform: translate(18px, -22px) scale(0.6); opacity: 0; }
}

/* ---- reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .bn-btn,
  .bn-btn::before,
  .bn-btn::after { transition: none; }
  .bn-btn:active { transform: none; }
  .bn-btn[data-state="done"] .bn-btn__fly { animation: none; }
}

/* ============================================================================
   THE GATE — a control, not a button: open/closed must read at a glance.
   Markup (inline SVG, so the bars can move):
     <button class="bn-gate" role="switch" aria-checked="false">
       <svg class="bn-gate__art" viewBox="0 0 120 96" aria-hidden="true">
         <use href="#bn-gate-posts"/><g class="bn-gate__bars">…bars…</g>
       </svg>
       <span class="bn-gate__label">Gate</span>
     </button>
   ============================================================================ */
.bn-gate {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-family: var(--font-text, inherit);
  font-size: calc(var(--type-label-size, 11px));
  letter-spacing: var(--type-label-tracking, 0.1em);
  font-variant-caps: var(--type-label-caps, normal);
  text-transform: var(--type-label-transform, uppercase);
  cursor: pointer;
}
.bn-gate__art {
  width: auto;
  height: 64px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
}
.bn-gate__bars {
  transform-box: fill-box;
  transform-origin: 8% 50%;
  transition: transform 260ms cubic-bezier(.2, .8, .2, 1), opacity 260ms linear;
}
.bn-gate[aria-checked="true"] {
  color: var(--accent-ink);
}
.bn-gate[aria-checked="true"] .bn-gate__bars {
  transform: perspective(240px) rotateY(74deg);
  opacity: 0.55;
}
.bn-gate:hover .bn-gate__bars { opacity: 0.85; }
.bn-gate[aria-checked="true"]:hover .bn-gate__bars { opacity: 0.7; }
.bn-gate:focus-visible { outline: none; }
.bn-gate:focus-visible .bn-gate__art {
  outline: 2px solid var(--accent-line);
  outline-offset: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .bn-gate__bars { transition: none; }
}
/* ============================================================================
   BONITHENA UI — 04 surfaces
   The frame is the separator: fixed corner marks + stretching hairlines, drawn
   as one mask over `background: currentColor`. No shadows, no radius.
   Four ORIENTED corner tiles — a single tile used four times turns three corners
   the wrong way, which is exactly how this file broke before.
   ============================================================================ */

.bn-panel {
  --bn-panel-cut: 20px;
  --bn-panel-frame: var(--frame-strong);
  --bn-panel-fill: transparent;
  position: relative;
  padding: 28px 26px;
  background: none;
  color: var(--text);
  isolation: isolate;
  box-sizing: border-box;
}

.bn-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bn-panel-fill);
  z-index: -2;
}

/* the frame: the four bracket corners (assets/frames) and a 1.2px hairline
   between them. The hairlines are gradient masks: an SVG tile stretched by
   mask-size kept its aspect ratio in Blink and drew a 16px dash mid-edge. */
.bn-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bn-panel-frame);
  -webkit-mask-image:
    url("../ui/frames/bracket-tl.svg"), url("../ui/frames/bracket-tr.svg"),
    url("../ui/frames/bracket-bl.svg"), url("../ui/frames/bracket-br.svg"),
    linear-gradient(var(--c-ink) 0 0), linear-gradient(var(--c-ink) 0 0),
    linear-gradient(var(--c-ink) 0 0), linear-gradient(var(--c-ink) 0 0);
  -webkit-mask-position:
    0 0, 100% 0, 0 100%, 100% 100%,
    var(--bn-panel-cut) 0, var(--bn-panel-cut) 100%,
    0 var(--bn-panel-cut), 100% var(--bn-panel-cut);
  -webkit-mask-size:
    var(--bn-panel-cut) var(--bn-panel-cut), var(--bn-panel-cut) var(--bn-panel-cut),
    var(--bn-panel-cut) var(--bn-panel-cut), var(--bn-panel-cut) var(--bn-panel-cut),
    calc(100% - var(--bn-panel-cut) * 2) 1.2px, calc(100% - var(--bn-panel-cut) * 2) 1.2px,
    1.2px calc(100% - var(--bn-panel-cut) * 2), 1.2px calc(100% - var(--bn-panel-cut) * 2);
  -webkit-mask-repeat: no-repeat;
  mask-image:
    url("../ui/frames/bracket-tl.svg"), url("../ui/frames/bracket-tr.svg"),
    url("../ui/frames/bracket-bl.svg"), url("../ui/frames/bracket-br.svg"),
    linear-gradient(var(--c-ink) 0 0), linear-gradient(var(--c-ink) 0 0),
    linear-gradient(var(--c-ink) 0 0), linear-gradient(var(--c-ink) 0 0);
  mask-position:
    0 0, 100% 0, 0 100%, 100% 100%,
    var(--bn-panel-cut) 0, var(--bn-panel-cut) 100%,
    0 var(--bn-panel-cut), 100% var(--bn-panel-cut);
  mask-size:
    var(--bn-panel-cut) var(--bn-panel-cut), var(--bn-panel-cut) var(--bn-panel-cut),
    var(--bn-panel-cut) var(--bn-panel-cut), var(--bn-panel-cut) var(--bn-panel-cut),
    calc(100% - var(--bn-panel-cut) * 2) 1.2px, calc(100% - var(--bn-panel-cut) * 2) 1.2px,
    1.2px calc(100% - var(--bn-panel-cut) * 2), 1.2px calc(100% - var(--bn-panel-cut) * 2);
  mask-repeat: no-repeat;
  pointer-events: none;
  z-index: -1;
}

.bn-panel--card   { --bn-panel-fill: var(--surface-card);   --bn-panel-frame: var(--text); }
.bn-panel--invert { --bn-panel-fill: var(--surface-invert);  --bn-panel-frame: var(--text-invert); color: var(--text-invert); }
.bn-panel--accent { --bn-panel-fill: var(--accent-wash);     --bn-panel-frame: var(--accent-ink); color: var(--accent-ink); padding-top: 34px; }
/* the season rule: a painted 10px band over the wash, not a shadow */
.bn-panel--accent::before {
  background: linear-gradient(var(--accent-line), var(--accent-line)) top / 100% 10px no-repeat, var(--bn-panel-fill);
}

.bn-panel__head {
  display: flex; align-items: center; gap: 10px; margin: 0 0 8px;
  font-family: var(--font-text, inherit);
  font-size: var(--type-label-size, 12px);
  letter-spacing: var(--type-label-tracking, 0.1em);
  font-weight: var(--type-label-weight, 500);
  font-variant-caps: var(--type-label-caps, normal);
  text-transform: var(--type-label-transform, uppercase);
}
.bn-panel__body { color: inherit; max-width: var(--measure, 66ch); font-size: var(--type-body-size, 1rem); line-height: var(--type-body-leading, 1.5); }
.bn-panel__rule { height: 1px; margin: 14px 0; background: currentColor; opacity: 0.35; border: 0; }

@supports not ((-webkit-mask-image: url("")) or (mask-image: url(""))) {
  .bn-panel { border: 1.5px solid var(--bn-panel-frame); }
}
/* ============================================================================
   BONITHENA UI — 05 common icons (43)
   A 24-unit stroked set for interface work: 1.75 stroke, butt caps, miter joins,
   right angles, cut corners. Same language as the bookmark frames; the engraving
   elements (02) are for display sizes, these are for 16-32 px.
   Masks like the elements, so colour is `currentColor`.
   ============================================================================ */

.bn-icon {
  --bn-icon-size: 24px;
  display: inline-block;
  width: var(--bn-icon-size);
  height: var(--bn-icon-size);
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--bn-icon-src) center / contain no-repeat;
  mask: var(--bn-icon-src) center / contain no-repeat;
  vertical-align: middle;
}

.bn-icon--16 { --bn-icon-size: 16px; }
.bn-icon--20 { --bn-icon-size: 20px; }
.bn-icon--24 { --bn-icon-size: 24px; }
.bn-icon--32 { --bn-icon-size: 32px; }
.bn-icon--48 { --bn-icon-size: 48px; }

/* in a button the icon inherits the button's ink */
.bn-btn .bn-icon { --bn-icon-size: 18px; }
.bn-btn--lg .bn-icon { --bn-icon-size: 20px; }
.bn-btn--sm .bn-icon { --bn-icon-size: 16px; }

.bn-icon--alert { --bn-icon-src: url("../ui/icons/alert.svg"); }
.bn-icon--arrow-left { --bn-icon-src: url("../ui/icons/arrow-left.svg"); }
.bn-icon--arrow-right { --bn-icon-src: url("../ui/icons/arrow-right.svg"); }
.bn-icon--arrow-up { --bn-icon-src: url("../ui/icons/arrow-up.svg"); }
.bn-icon--bell { --bn-icon-src: url("../ui/icons/bell.svg"); }
.bn-icon--calendar { --bn-icon-src: url("../ui/icons/calendar.svg"); }
.bn-icon--check { --bn-icon-src: url("../ui/icons/check.svg"); }
.bn-icon--chevron-down { --bn-icon-src: url("../ui/icons/chevron-down.svg"); }
.bn-icon--chevron-right { --bn-icon-src: url("../ui/icons/chevron-right.svg"); }
.bn-icon--clock { --bn-icon-src: url("../ui/icons/clock.svg"); }
.bn-icon--close { --bn-icon-src: url("../ui/icons/close.svg"); }
.bn-icon--download { --bn-icon-src: url("../ui/icons/download.svg"); }
.bn-icon--edit { --bn-icon-src: url("../ui/icons/edit.svg"); }
.bn-icon--external { --bn-icon-src: url("../ui/icons/external.svg"); }
.bn-icon--eye { --bn-icon-src: url("../ui/icons/eye.svg"); }
.bn-icon--filter { --bn-icon-src: url("../ui/icons/filter.svg"); }
.bn-icon--grid { --bn-icon-src: url("../ui/icons/grid.svg"); }
.bn-icon--help { --bn-icon-src: url("../ui/icons/help.svg"); }
.bn-icon--home { --bn-icon-src: url("../ui/icons/home.svg"); }
.bn-icon--info { --bn-icon-src: url("../ui/icons/info.svg"); }
.bn-icon--link { --bn-icon-src: url("../ui/icons/link.svg"); }
.bn-icon--list { --bn-icon-src: url("../ui/icons/list.svg"); }
.bn-icon--lock { --bn-icon-src: url("../ui/icons/lock.svg"); }
.bn-icon--logout { --bn-icon-src: url("../ui/icons/logout.svg"); }
.bn-icon--mail { --bn-icon-src: url("../ui/icons/mail.svg"); }
.bn-icon--menu { --bn-icon-src: url("../ui/icons/menu.svg"); }
.bn-icon--minus { --bn-icon-src: url("../ui/icons/minus.svg"); }
.bn-icon--moon { --bn-icon-src: url("../ui/icons/moon.svg"); }
.bn-icon--more { --bn-icon-src: url("../ui/icons/more.svg"); }
.bn-icon--pause { --bn-icon-src: url("../ui/icons/pause.svg"); }
.bn-icon--play { --bn-icon-src: url("../ui/icons/play.svg"); }
.bn-icon--plus { --bn-icon-src: url("../ui/icons/plus.svg"); }
.bn-icon--refresh { --bn-icon-src: url("../ui/icons/refresh.svg"); }
.bn-icon--search { --bn-icon-src: url("../ui/icons/search.svg"); }
.bn-icon--settings { --bn-icon-src: url("../ui/icons/settings.svg"); }
.bn-icon--shield-check { --bn-icon-src: url("../ui/icons/shield-check.svg"); }
.bn-icon--star { --bn-icon-src: url("../ui/icons/star.svg"); }
.bn-icon--sun { --bn-icon-src: url("../ui/icons/sun.svg"); }
.bn-icon--trash { --bn-icon-src: url("../ui/icons/trash.svg"); }
.bn-icon--unlock { --bn-icon-src: url("../ui/icons/unlock.svg"); }
.bn-icon--upload { --bn-icon-src: url("../ui/icons/upload.svg"); }
.bn-icon--user { --bn-icon-src: url("../ui/icons/user.svg"); }
.bn-icon--users { --bn-icon-src: url("../ui/icons/users.svg"); }
/* ============================================================================
   BONITHENA UI — 07 shapes (shared by forms, data and overlays)
   One octagon geometry for every new container, in the house technique:
   clip-path, never border-image, never border-radius on a visible edge.

     ::before  the face   — solid octagon, var(--bn-fill)   (transparent = hollow)
     ::after   the edge   — an octagon RING, var(--bn-frame)

   The ring is one polygon(evenodd, outer loop, inner loop), so the face can be
   transparent and the frame still reads on paper, card or ink. (The buttons use
   two nested solid fills, which only works with an opaque face.) --bn-ring2
   adds a second, thinner inner loop: the engraved double line.

   Knobs per component: --bn-cut-px, --bn-stroke, --bn-frame, --bn-fill,
   --bn-frame-inset (where face + edge sit inside the host), --bn-edge.
   Inset maths: a loop inset by d keeps a parallel diagonal when its cut is
   c + d·(√2 − 1), i.e. --bn-kN = cut + dN · 0.4142.

   Native controls (input, select, checkbox, switch) cannot take pseudo-elements
   and a clip-path would eat their focus ring, so forms.css cuts those with
   `corner-shape: bevel` instead (square in browsers without it).
   ============================================================================ */

.bn-badge,
.bn-tag,
.bn-avatar,
.bn-pagination__link,
.bn-stepper__num,
.bn-tooltip,
.bn-dialog,
.bn-progress {
  --bn-cut-px: 6px;
  --bn-stroke: 1px;
  --bn-gap2: 3px;          /* --bn-ring2 only: gap between the two lines */
  --bn-stroke2: 1px;       /* --bn-ring2 only: the inner, thinner line   */
  --bn-frame: var(--frame-strong);
  --bn-fill: transparent;
  --bn-frame-inset: 0;

  --bn-d0: 0px;
  --bn-k0: var(--bn-cut-px);
  --bn-d1: var(--bn-stroke);
  --bn-k1: calc(var(--bn-cut-px) + var(--bn-d1) * 0.4142);
  --bn-d2: calc(var(--bn-d1) + var(--bn-gap2));
  --bn-k2: calc(var(--bn-cut-px) + var(--bn-d2) * 0.4142);
  --bn-d3: calc(var(--bn-d2) + var(--bn-stroke2));
  --bn-k3: calc(var(--bn-cut-px) + var(--bn-d3) * 0.4142);

  --bn-oct: polygon(
    var(--bn-k0) var(--bn-d0),
    calc(100% - var(--bn-k0)) var(--bn-d0),
    calc(100% - var(--bn-d0)) var(--bn-k0),
    calc(100% - var(--bn-d0)) calc(100% - var(--bn-k0)),
    calc(100% - var(--bn-k0)) calc(100% - var(--bn-d0)),
    var(--bn-k0) calc(100% - var(--bn-d0)),
    var(--bn-d0) calc(100% - var(--bn-k0)),
    var(--bn-d0) var(--bn-k0),
    var(--bn-k0) var(--bn-d0));
  --bn-ring: polygon(evenodd,
    var(--bn-k0) var(--bn-d0),
    calc(100% - var(--bn-k0)) var(--bn-d0),
    calc(100% - var(--bn-d0)) var(--bn-k0),
    calc(100% - var(--bn-d0)) calc(100% - var(--bn-k0)),
    calc(100% - var(--bn-k0)) calc(100% - var(--bn-d0)),
    var(--bn-k0) calc(100% - var(--bn-d0)),
    var(--bn-d0) calc(100% - var(--bn-k0)),
    var(--bn-d0) var(--bn-k0),
    var(--bn-k0) var(--bn-d0),
    var(--bn-k1) var(--bn-d1),
    calc(100% - var(--bn-k1)) var(--bn-d1),
    calc(100% - var(--bn-d1)) var(--bn-k1),
    calc(100% - var(--bn-d1)) calc(100% - var(--bn-k1)),
    calc(100% - var(--bn-k1)) calc(100% - var(--bn-d1)),
    var(--bn-k1) calc(100% - var(--bn-d1)),
    var(--bn-d1) calc(100% - var(--bn-k1)),
    var(--bn-d1) var(--bn-k1),
    var(--bn-k1) var(--bn-d1));
  --bn-ring2: polygon(evenodd,
    var(--bn-k0) var(--bn-d0),
    calc(100% - var(--bn-k0)) var(--bn-d0),
    calc(100% - var(--bn-d0)) var(--bn-k0),
    calc(100% - var(--bn-d0)) calc(100% - var(--bn-k0)),
    calc(100% - var(--bn-k0)) calc(100% - var(--bn-d0)),
    var(--bn-k0) calc(100% - var(--bn-d0)),
    var(--bn-d0) calc(100% - var(--bn-k0)),
    var(--bn-d0) var(--bn-k0),
    var(--bn-k0) var(--bn-d0),
    var(--bn-k1) var(--bn-d1),
    calc(100% - var(--bn-k1)) var(--bn-d1),
    calc(100% - var(--bn-d1)) var(--bn-k1),
    calc(100% - var(--bn-d1)) calc(100% - var(--bn-k1)),
    calc(100% - var(--bn-k1)) calc(100% - var(--bn-d1)),
    var(--bn-k1) calc(100% - var(--bn-d1)),
    var(--bn-d1) calc(100% - var(--bn-k1)),
    var(--bn-d1) var(--bn-k1),
    var(--bn-k1) var(--bn-d1),
    var(--bn-k2) var(--bn-d2),
    calc(100% - var(--bn-k2)) var(--bn-d2),
    calc(100% - var(--bn-d2)) var(--bn-k2),
    calc(100% - var(--bn-d2)) calc(100% - var(--bn-k2)),
    calc(100% - var(--bn-k2)) calc(100% - var(--bn-d2)),
    var(--bn-k2) calc(100% - var(--bn-d2)),
    var(--bn-d2) calc(100% - var(--bn-k2)),
    var(--bn-d2) var(--bn-k2),
    var(--bn-k2) var(--bn-d2),
    var(--bn-k3) var(--bn-d3),
    calc(100% - var(--bn-k3)) var(--bn-d3),
    calc(100% - var(--bn-d3)) var(--bn-k3),
    calc(100% - var(--bn-d3)) calc(100% - var(--bn-k3)),
    calc(100% - var(--bn-k3)) calc(100% - var(--bn-d3)),
    var(--bn-k3) calc(100% - var(--bn-d3)),
    var(--bn-d3) calc(100% - var(--bn-k3)),
    var(--bn-d3) var(--bn-k3),
    var(--bn-k3) var(--bn-d3));

  --bn-edge: var(--bn-ring);

  position: relative;
  isolation: isolate;      /* face and edge sit at z -2 / -1 under the content */
  box-sizing: border-box;
}

.bn-badge::before,
.bn-tag::before,
.bn-avatar::before,
.bn-pagination__link::before,
.bn-stepper__num::before,
.bn-tooltip::before,
.bn-dialog::before,
.bn-progress::before {
  content: "";
  position: absolute;
  inset: var(--bn-frame-inset);
  z-index: -2;
  background: var(--bn-fill);
  clip-path: var(--bn-oct);
  pointer-events: none;
}

.bn-badge::after,
.bn-tag::after,
.bn-avatar::after,
.bn-pagination__link::after,
.bn-stepper__num::after,
.bn-tooltip::after,
.bn-dialog::after,
.bn-progress::after {
  content: "";
  position: absolute;
  inset: var(--bn-frame-inset);
  z-index: -1;
  background: var(--bn-frame);
  clip-path: var(--bn-edge);
  pointer-events: none;
  transition: background-color 120ms linear;
}

/* focusable hosts: the focus ring is the host's own outline (never clipped);
   where corner-shape exists the outline follows the same bevel */
@supports (corner-shape: bevel) {
  .bn-pagination__link {
    border-radius: var(--bn-cut-px);
    corner-shape: bevel;
  }
}
/* ============================================================================
   BONITHENA UI — 08 forms
   Fields are engraved boxes: one hairline in --frame-control (3:1 against
   paper and card, WCAG 1.4.11), cut corners, the card as the writing surface.
   No shadows, no radius on any visible edge.

     .bn-field      label above, control, hint, message      ([data-state])
     .bn-input      <input>           .bn-textarea  <textarea>
     .bn-select     wrapper around <select>; chevron in a cut-corner well (mask)
     .bn-search     wrapper around <input type=search>; magnifier inside (mask)
     .bn-check      square box, check / minus drawn from the icon masks
     .bn-radio      round, ink ring
     .bn-switch     the gate in miniature: bars closed, bars swung open

   Cut corners on native controls use `corner-shape: bevel`: an <input> has no
   pseudo-elements and a clip-path would clip its focus ring. Browsers without
   corner-shape get a square hairline box, never a rounded one.

   Validation: [data-state="error"|"ok"] on .bn-field or on the control, or
   aria-invalid="true" on the control. Colour is never the only signal — the
   message carries an icon and words.
   ============================================================================ */

/* ── field ─────────────────────────────────────────────────────────────── */
.bn-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;               /* also used on <fieldset> */
  color: var(--text);
}
.bn-field__label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0;              /* <legend> */
  color: var(--text);
  font-family: var(--font-text, inherit);
  font-size: var(--type-label-size, 13px);
  font-weight: var(--type-label-weight, 600);
  line-height: var(--type-label-leading, 1.2);
  letter-spacing: var(--type-label-tracking, 0.1em);
  font-variant-caps: var(--type-label-caps, normal);
  text-transform: var(--type-label-transform, uppercase);
}
.bn-field__req { color: var(--state-error-ink); }
.bn-field__opt { color: var(--text-muted); letter-spacing: 0.04em; }
.bn-field__hint,
.bn-field__msg {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--type-caption-size, 14px);
  line-height: var(--type-caption-leading, 1.45);
}
.bn-field__msg {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.bn-field__msg .bn-icon { --bn-icon-size: 16px; margin-top: 0.15em; }
.bn-field__options { display: grid; gap: 0 18px; }
.bn-field__options--row { display: flex; flex-wrap: wrap; }

/* ── the box: input, textarea, select ─────────────────────────────────── */
.bn-input,
.bn-textarea,
.bn-select > select {
  --bn-cut-px: 7px;
  --bn-ctl-line: var(--frame-control);
  --bn-ctl-face: var(--surface-card);
  --bn-ctl-ring: var(--accent-line);

  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--bn-ctl-line);
  background: var(--bn-ctl-face);
  color: var(--text);
  font-family: var(--font-text, inherit);
  /* 16px minimum: iOS zooms the page into any smaller field */
  font-size: max(16px, var(--type-small-size, 16px));
  line-height: var(--type-small-leading, 1.5);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 120ms linear;
}
.bn-textarea {
  min-height: 132px;
  padding: 11px 14px;
  resize: vertical;
}
.bn-input::placeholder,
.bn-textarea::placeholder { color: var(--text-muted-card); opacity: 1; }

.bn-input:hover,
.bn-textarea:hover,
.bn-select > select:hover { --bn-ctl-line: var(--text); }

.bn-input:focus-visible,
.bn-textarea:focus-visible,
.bn-select > select:focus-visible {
  --bn-ctl-line: var(--text);
  outline: 2px solid var(--bn-ctl-ring);
  outline-offset: 3px;
}
.bn-input:focus:not(:focus-visible),
.bn-textarea:focus:not(:focus-visible),
.bn-select > select:focus:not(:focus-visible) { outline: none; }

.bn-input:disabled,
.bn-textarea:disabled,
.bn-select > select:disabled {
  --bn-ctl-line: var(--frame);
  --bn-ctl-face: transparent;
  color: var(--text-muted);
  cursor: not-allowed;
}
.bn-input[readonly],
.bn-textarea[readonly] { --bn-ctl-face: transparent; }

@supports (corner-shape: bevel) {
  .bn-input,
  .bn-textarea,
  .bn-select > select {
    border-radius: var(--bn-cut-px);
    corner-shape: bevel;
  }
}

/* ── validation ───────────────────────────────────────────────────────── */
.bn-field[data-state="error"] :is(.bn-input, .bn-textarea, .bn-select > select),
:is(.bn-input, .bn-textarea, .bn-select > select):is([data-state="error"], [aria-invalid="true"]) {
  --bn-ctl-line: var(--state-error-line);
  --bn-ctl-ring: var(--state-error-line);
  border-width: 1.5px;
}
.bn-field[data-state="ok"] :is(.bn-input, .bn-textarea, .bn-select > select),
:is(.bn-input, .bn-textarea, .bn-select > select)[data-state="ok"] {
  --bn-ctl-line: var(--state-ok-line);
}
.bn-field[data-state="error"] .bn-field__msg { color: var(--state-error-ink); }
.bn-field[data-state="ok"] .bn-field__msg    { color: var(--state-ok-ink); }

/* ── select: a cut-corner well with the chevron mask ─────────────────── */
.bn-select {
  position: relative;
  display: block;
  min-width: 0;
  color: var(--text);
}
.bn-select > select {
  padding-right: 54px;
  cursor: pointer;
  text-overflow: ellipsis;
}
.bn-select::before,                 /* the well: paper inset into the card face */
.bn-select::after {                 /* the chevron */
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  right: 6px;
  width: 34px;
  pointer-events: none;
}
.bn-select::before {
  --c: 5px;
  background: var(--surface);
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)),
                     calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
}
.bn-select::after {
  background: currentColor;
  -webkit-mask: url("../ui/icons/chevron-down.svg") center / 18px 18px no-repeat;
  mask: url("../ui/icons/chevron-down.svg") center / 18px 18px no-repeat;
}
.bn-select:has(select:disabled) { color: var(--text-muted); }
.bn-select:has(select:disabled)::before { background: transparent; }

/* ── search: magnifier inside ─────────────────────────────────────────── */
.bn-search {
  position: relative;
  display: block;
  min-width: 0;
  color: var(--text-muted-card);
}
.bn-search::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  background: currentColor;
  -webkit-mask: url("../ui/icons/search.svg") center / contain no-repeat;
  mask: url("../ui/icons/search.svg") center / contain no-repeat;
  pointer-events: none;
  z-index: 1;
}
.bn-search > .bn-input { padding-left: 44px; }
.bn-search > .bn-input::-webkit-search-decoration { -webkit-appearance: none; }
.bn-search > .bn-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--text);
  -webkit-mask: url("../ui/icons/close.svg") center / contain no-repeat;
  cursor: pointer;
}

/* ── check, radio, switch: shared row ─────────────────────────────────── */
.bn-check,
.bn-radio,
.bn-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;              /* the whole label is the touch target */
  color: var(--text);
  font-family: var(--font-text, inherit);
  font-size: var(--type-small-size, 16px);
  line-height: var(--type-small-leading, 1.4);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* the real input stays in the tree (keyboard, screen readers, forms) and
   covers the row, so a click anywhere hits it */
.bn-check > input,
.bn-radio > input,
.bn-switch > input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
  z-index: 1;
}
.bn-check:has(input:disabled),
.bn-radio:has(input:disabled),
.bn-switch:has(input:disabled) { color: var(--text-muted); cursor: not-allowed; }

/* ── check: square box, cut corners, check drawn from the icon ────────── */
.bn-check__box {
  --bn-cut-px: 4px;
  box-sizing: border-box;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--frame-control);
  background: var(--surface-card);
  color: var(--accent-ink);
  transition: background-color 120ms linear, border-color 120ms linear;
}
.bn-check__box::after {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("../ui/icons/check.svg") center / contain no-repeat;
  mask: url("../ui/icons/check.svg") center / contain no-repeat;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 120ms linear, transform 160ms cubic-bezier(.2, .8, .2, 1);
}
.bn-check:hover .bn-check__box { border-color: var(--text); }
.bn-check > input:checked + .bn-check__box,
.bn-check > input:indeterminate + .bn-check__box {
  background: var(--accent-wash);
  border-color: var(--accent-ink);
}
.bn-check > input:checked + .bn-check__box::after { opacity: 1; transform: none; }
.bn-check > input:indeterminate + .bn-check__box::after {
  -webkit-mask-image: url("../ui/icons/minus.svg");
  mask-image: url("../ui/icons/minus.svg");
  opacity: 1;
  transform: none;
}
.bn-check > input:focus-visible + .bn-check__box {
  outline: 2px solid var(--accent-line);
  outline-offset: 3px;
}
.bn-check > input:disabled + .bn-check__box { border-color: var(--frame); background: transparent; }
.bn-check[data-state="ok"] .bn-check__box { border-color: var(--state-ok-line); }
.bn-check[data-state="error"] .bn-check__box,
.bn-check > input[aria-invalid="true"] + .bn-check__box { border-color: var(--state-error-line); }

/* ── radio: round, ink ring ───────────────────────────────────────────── */
/* the one round control. No border-radius: the ring, the face and the dot
   are radial gradients (closest-side), so nothing is clipped and the focus
   ring is a third, offset ring drawn the same way. */
.bn-radio__dot {
  --bn-radio-line: var(--frame-control);
  --bn-radio-face: var(--surface-card);
  position: relative;
  box-sizing: border-box;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: radial-gradient(circle closest-side,
    var(--bn-radio-face) calc(100% - 2px), var(--bn-radio-line) calc(100% - 1.5px),
    var(--bn-radio-line) calc(100% - 0.5px), transparent 100%);
  color: var(--accent-ink);
}
.bn-radio__dot::after {              /* the dot */
  content: "";
  width: 10px;
  height: 10px;
  background: radial-gradient(circle closest-side, currentColor calc(100% - 0.75px), transparent 100%);
  transform: scale(0);
  transition: transform 160ms cubic-bezier(.2, .8, .2, 1);
}
.bn-radio__dot::before {             /* focus: an offset ring, same technique */
  content: "";
  position: absolute;
  inset: -5px;
  background: radial-gradient(circle closest-side,
    transparent calc(100% - 2.5px), var(--accent-line) calc(100% - 2px),
    var(--accent-line) calc(100% - 0.5px), transparent 100%);
  opacity: 0;
}
.bn-radio:hover .bn-radio__dot { --bn-radio-line: var(--text); }
.bn-radio > input:checked + .bn-radio__dot { --bn-radio-line: var(--accent-ink); }
.bn-radio > input:checked + .bn-radio__dot::after { transform: none; }
.bn-radio > input:focus-visible + .bn-radio__dot::before { opacity: 1; }
.bn-radio > input:disabled + .bn-radio__dot { --bn-radio-line: var(--frame); --bn-radio-face: transparent; }
.bn-radio[data-state="error"] .bn-radio__dot,
.bn-radio > input[aria-invalid="true"] + .bn-radio__dot { --bn-radio-line: var(--state-error-line); }

/* ── switch: the gate in miniature ────────────────────────────────────── */
/* two posts, a rail top and bottom (the hairline), five bars. Off: the bars
   close the gate. On: they swing back on the left post, like .bn-gate. */
.bn-switch__track {
  --bn-cut-px: 4px;
  position: relative;
  box-sizing: border-box;
  flex: none;
  width: 58px;
  height: 30px;
  border: 1.5px solid var(--frame-control);
  background: var(--surface-card);
  color: var(--text);
  transition: background-color 160ms linear, border-color 160ms linear, color 160ms linear;
}
.bn-switch__track::before {          /* the posts */
  content: "";
  position: absolute;
  inset: 3px;
  background:
    linear-gradient(currentColor, currentColor) left / 2.5px 100% no-repeat,
    linear-gradient(currentColor, currentColor) right / 2.5px 100% no-repeat;
}
.bn-switch__track::after {           /* the bars */
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 10px;
  right: 10px;
  background: repeating-linear-gradient(90deg, currentColor 0 1.75px, transparent 1.75px 7.25px);
  transform-origin: 0 50%;
  transition: transform 260ms cubic-bezier(.2, .8, .2, 1), opacity 260ms linear;
}
.bn-switch:hover .bn-switch__track { border-color: var(--text); }
.bn-switch > input:checked + .bn-switch__track {
  background: var(--accent-wash);
  border-color: var(--accent-ink);
  color: var(--accent-ink);
}
.bn-switch > input:checked + .bn-switch__track::after {
  transform: perspective(60px) rotateY(72deg);
  opacity: 0.7;
}
.bn-switch > input:focus-visible + .bn-switch__track {
  outline: 2px solid var(--accent-line);
  outline-offset: 3px;
}
.bn-switch > input:disabled + .bn-switch__track {
  border-color: var(--frame);
  background: transparent;
  color: var(--frame-strong);
}
/* the state word next to the switch, if the markup has one for each state */
.bn-switch__on { display: none; }
.bn-switch:has(> input:checked) .bn-switch__on { display: inline; }
.bn-switch:has(> input:checked) .bn-switch__off { display: none; }

@supports (corner-shape: bevel) {
  .bn-check__box,
  .bn-switch__track {
    border-radius: var(--bn-cut-px);
    corner-shape: bevel;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bn-check__box, .bn-check__box::after, .bn-radio__dot::after,
  .bn-switch__track, .bn-switch__track::after { transition: none; }
}
/* ============================================================================
   BONITHENA UI — 09 data
   Ledger, not spreadsheet: hairline rows, no zebra fill, numbers that line up.

     .bn-table (+ .bn-table-wrap, --stack, --compact)   .bn-list
     .bn-badge  .bn-tag  .bn-avatar                     .bn-stat  .bn-kpi
     .bn-progress (+ --segmented)                       .bn-breadcrumb
     .bn-pagination                                     .bn-divider
     .bn-empty

   Framed pieces (badge, tag, avatar, pagination link, progress) use the shared
   face + ring from shapes.css.
   ============================================================================ */

/* ── table ─────────────────────────────────────────────────────────────── */
/* the wrapper scrolls sideways on a phone; it is focusable so a keyboard can
   scroll it too (tabindex="0" + an aria-label on the wrapper) */
.bn-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.bn-table-wrap:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }

.bn-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  font-size: var(--type-small-size, 16px);
  line-height: var(--type-small-leading, 1.5);
  font-variant-numeric: lining-nums tabular-nums;
}
.bn-table caption {
  caption-side: top;
  padding: 0 0 10px;
  text-align: left;
  color: var(--text-muted);
  font-size: var(--type-caption-size, 14px);
  line-height: var(--type-caption-leading, 1.45);
}
.bn-table th {
  padding: 10px 14px 9px;
  border-bottom: 3px double var(--frame-strong);   /* engraved: two hairlines */
  color: var(--text-muted);
  text-align: left;
  vertical-align: bottom;
  white-space: nowrap;
  font-size: var(--type-label-size, 13px);
  font-weight: var(--type-label-weight, 600);
  letter-spacing: var(--type-label-tracking, 0.1em);
  font-variant-caps: var(--type-label-caps, normal);
  text-transform: var(--type-label-transform, uppercase);
}
.bn-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--frame);
  vertical-align: top;
}
.bn-table th:first-child, .bn-table td:first-child { padding-left: 2px; }
.bn-table th:last-child,  .bn-table td:last-child  { padding-right: 2px; }
.bn-table tbody tr:last-child > * { border-bottom-color: var(--frame-strong); }
.bn-table tbody th { border-bottom: 1px solid var(--frame); color: var(--text-head); vertical-align: top; }

/* numeric columns: right-aligned, tabular, never wrapped */
.bn-table .bn-num,
.bn-table [data-num] {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: lining-nums tabular-nums;
}
.bn-table tfoot td {
  border-bottom: 0;
  border-top: 3px double var(--frame-strong);
  color: var(--text-head);
  font-weight: var(--font-semibold, 600);
}
.bn-table tr[aria-selected="true"] > * { background: var(--accent-wash); color: var(--accent-ink); }
.bn-table--compact td { padding-top: 7px; padding-bottom: 7px; }

/* --stack: on a phone every row becomes a block, the header moves into each
   cell via data-label="…" */
@media (max-width: 639px) {
  .bn-table--stack thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
  .bn-table--stack,
  .bn-table--stack caption,
  .bn-table--stack tbody,
  .bn-table--stack tfoot,
  .bn-table--stack tr,
  .bn-table--stack td { display: block; width: 100%; box-sizing: border-box; }
  .bn-table--stack tfoot tr { border-top: 3px double var(--frame-strong); border-bottom: 0; }
  .bn-table--stack tfoot td { border: 0; }
  .bn-table--stack tr { padding: 8px 0; border-bottom: 1px solid var(--frame); }
  .bn-table--stack tbody tr:last-child { border-bottom-color: var(--frame-strong); }
  .bn-table--stack td,
  .bn-table--stack tbody tr:last-child > td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 2px;
    border: 0;
    text-align: right;
  }
  .bn-table--stack td::before {
    content: attr(data-label);
    flex: none;
    color: var(--text-muted);
    text-align: left;
    font-size: var(--type-label-size, 13px);
    font-weight: var(--type-label-weight, 600);
    letter-spacing: var(--type-label-tracking, 0.1em);
    font-variant-caps: var(--type-label-caps, normal);
    text-transform: var(--type-label-transform, uppercase);
  }
  .bn-table--stack td:first-child { color: var(--text-head); font-weight: var(--font-semibold, 600); }
}

/* ── list ──────────────────────────────────────────────────────────────── */
.bn-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--frame-strong);
  border-bottom: 1px solid var(--frame-strong);
  color: var(--text);
}
.bn-list > li + li { border-top: 1px solid var(--frame); }
.bn-list__item {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 10px 2px;
  color: inherit;
  text-decoration: none;
}
.bn-list__main { flex: 1; min-width: 0; }
.bn-list__title {
  display: block;
  margin: 0;
  color: var(--text-head);
  overflow-wrap: anywhere;
}
.bn-list__meta {
  display: block;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--type-caption-size, 14px);
  line-height: var(--type-caption-leading, 1.45);
}
.bn-list__end {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-variant-numeric: lining-nums tabular-nums;
}
a.bn-list__item:hover .bn-list__title { color: var(--accent-ink); }
a.bn-list__item:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
a.bn-list__item::after {                      /* a link row says so */
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  -webkit-mask: url("../ui/icons/chevron-right.svg") center / contain no-repeat;
  mask: url("../ui/icons/chevron-right.svg") center / contain no-repeat;
}

/* ── badge: mask-framed pill, tiny caps ────────────────────────────────── */
.bn-badge {
  --bn-cut-px: 5px;
  --bn-frame: currentColor;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 22px;
  padding: 3px 9px 4px;
  color: var(--text);
  vertical-align: middle;
  white-space: nowrap;
  font-family: var(--font-text, inherit);
  font-size: calc(var(--type-label-size, 13px) * 0.86);
  font-weight: var(--type-label-weight, 600);
  line-height: 1;
  letter-spacing: var(--type-label-tracking, 0.1em);
  font-variant-caps: var(--type-label-caps, normal);
  text-transform: var(--type-label-transform, uppercase);
  font-variant-numeric: lining-nums tabular-nums;
}
.bn-badge .bn-icon, .bn-badge .bn-el { --bn-icon-size: 12px; --bn-el-size: 12px; }
.bn-badge--accent { --bn-fill: var(--accent-wash); --bn-frame: var(--accent-ink); color: var(--accent-ink); }
.bn-badge--solid  { --bn-fill: var(--text); --bn-frame: var(--text); color: var(--surface); }
.bn-badge--muted  { --bn-frame: var(--frame-strong); color: var(--text-muted); }
.bn-badge--error  { --bn-frame: var(--state-error-line); color: var(--state-error-ink); }
.bn-badge--ok     { --bn-frame: var(--state-ok-line); color: var(--state-ok-ink); }

/* ── tag: a label with a pointed end, optionally removable ─────────────── */
.bn-tag {
  --bn-tag-h: 30px;
  --bn-tag-c: calc(var(--bn-tag-h) / 2);        /* the point: 45° at this height */
  --bn-frame: var(--frame-strong);
  --bn-t1: calc(var(--bn-tag-c) + var(--bn-d1) * 0.4142);
  --bn-oct: polygon(var(--bn-tag-c) 0, calc(100% - var(--bn-k0)) 0, 100% var(--bn-k0),
                    100% calc(100% - var(--bn-k0)), calc(100% - var(--bn-k0)) 100%,
                    var(--bn-tag-c) 100%, 0 50%);
  --bn-ring: polygon(evenodd,
    var(--bn-tag-c) 0, calc(100% - var(--bn-k0)) 0, 100% var(--bn-k0),
    100% calc(100% - var(--bn-k0)), calc(100% - var(--bn-k0)) 100%,
    var(--bn-tag-c) 100%, 0 50%, var(--bn-tag-c) 0,
    var(--bn-t1) var(--bn-d1), calc(100% - var(--bn-k1)) var(--bn-d1),
    calc(100% - var(--bn-d1)) var(--bn-k1), calc(100% - var(--bn-d1)) calc(100% - var(--bn-k1)),
    calc(100% - var(--bn-k1)) calc(100% - var(--bn-d1)), var(--bn-t1) calc(100% - var(--bn-d1)),
    calc(var(--bn-d1) * 1.4142) 50%, var(--bn-t1) var(--bn-d1));
  --bn-cut-px: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--bn-tag-h);
  padding: 0 12px 0 calc(var(--bn-tag-c) + 4px);
  color: var(--text);
  white-space: nowrap;
  vertical-align: middle;
  font-size: var(--type-caption-size, 14px);
  line-height: 1;
}
.bn-tag--accent { --bn-fill: var(--accent-wash); --bn-frame: var(--accent-ink); color: var(--accent-ink); }
.bn-tag__remove {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0 -8px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.bn-tag__remove::before {                 /* the × from the icon set */
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("../ui/icons/close.svg") center / contain no-repeat;
  mask: url("../ui/icons/close.svg") center / contain no-repeat;
}
.bn-tag__remove::after { content: ""; position: absolute; inset: -10px; }   /* 44px hit area */
.bn-tag__remove:hover { color: var(--state-error-ink); }
.bn-tag__remove:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }

/* ── avatar: square, one cut corner, initials or an engraving ──────────── */
.bn-avatar {
  --bn-size: 44px;
  --bn-cut-px: calc(var(--bn-size) * 0.27);
  --bn-fill: var(--surface-card);
  --bn-frame: var(--frame-strong);
  --bn-oct: polygon(0 0, calc(100% - var(--bn-k0)) 0, 100% var(--bn-k0), 100% 100%, 0 100%);
  --bn-ring: polygon(evenodd,
    0 0, calc(100% - var(--bn-k0)) 0, 100% var(--bn-k0), 100% 100%, 0 100%, 0 0,
    var(--bn-d1) var(--bn-d1), calc(100% - var(--bn-k1)) var(--bn-d1),
    calc(100% - var(--bn-d1)) var(--bn-k1), calc(100% - var(--bn-d1)) calc(100% - var(--bn-d1)),
    var(--bn-d1) calc(100% - var(--bn-d1)), var(--bn-d1) var(--bn-d1));
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--bn-size);
  height: var(--bn-size);
  overflow: hidden;
  color: var(--text-head);
  vertical-align: middle;
  font-family: var(--font-text, inherit);
  font-size: calc(var(--type-label-size, 13px) * 1.1);
  font-weight: var(--type-label-weight, 600);
  letter-spacing: 0.06em;
  line-height: 1;
}
.bn-avatar--sm { --bn-size: 32px; font-size: calc(var(--type-label-size, 13px) * 0.85); }
.bn-avatar--lg { --bn-size: 64px; font-size: calc(var(--type-label-size, 13px) * 1.5); }
.bn-avatar--xl { --bn-size: 96px; font-size: calc(var(--type-label-size, 13px) * 2.1); }
.bn-avatar > .bn-el { --bn-el-size: 66%; color: var(--text); }
.bn-avatar > img { width: 100%; height: 100%; object-fit: cover; clip-path: var(--bn-oct); }
.bn-avatar--accent { --bn-fill: var(--accent-wash); --bn-frame: var(--accent-ink); color: var(--accent-ink); }
.bn-avatar--accent > .bn-el { color: var(--accent-ink); }

/* ── stat: big number, ornament, label ─────────────────────────────────── */
.bn-stat {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "orn value" "orn label" "orn delta";
  column-gap: 14px;
  align-items: center;
  color: var(--text);
  min-width: 0;
}
.bn-stat > .bn-el { grid-area: orn; --bn-el-size: clamp(32px, 8vw, 44px); color: var(--accent-line); }
.bn-stat__value {
  grid-area: value;
  margin: 0;
  color: var(--text-head);
  font-family: var(--font-display, inherit);
  font-size: var(--type-h2-size, 40px);
  font-weight: var(--type-h2-weight, 400);
  font-stretch: var(--type-h2-width, normal);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
.bn-stat__unit { font-size: calc(var(--type-h2-size, 40px) * 0.5); color: var(--text-muted); margin-left: 0.15em; }
.bn-stat__label {
  grid-area: label;
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: var(--type-label-size, 13px);
  font-weight: var(--type-label-weight, 600);
  letter-spacing: var(--type-label-tracking, 0.1em);
  font-variant-caps: var(--type-label-caps, normal);
  text-transform: var(--type-label-transform, uppercase);
  line-height: var(--type-label-leading, 1.2);
}
.bn-stat__delta {
  grid-area: delta;
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: var(--type-caption-size, 14px);
  font-variant-numeric: lining-nums tabular-nums;
}
.bn-stat__delta[data-trend="up"]   { color: var(--state-ok-ink); }
.bn-stat__delta[data-trend="down"] { color: var(--state-error-ink); }
.bn-stat--stack { grid-template-columns: minmax(0, 1fr); grid-template-areas: "orn" "value" "label" "delta"; }
.bn-stat--stack > .bn-el { margin-bottom: 10px; }

/* ── kpi row: stats between hairlines ─────────────────────────────────── */
/* intrinsic, not viewport-based: as many columns of >= --bn-kpi-min as the
   container holds, so a KPI row in a half-width panel behaves like one on a
   phone. Every item draws a hairline on its start and top edge; the ones on
   the first column / first row sit 1px outside the box and are clipped. */
.bn-kpi {
  --bn-kpi-min: 200px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--bn-kpi-min)), 1fr));
  border-top: 1px solid var(--frame-strong);
  border-bottom: 1px solid var(--frame-strong);
  overflow: hidden;
}
.bn-kpi > * {
  min-width: 0;
  margin: -1px 0 0 -1px;
  padding: 18px 16px 18px 18px;
  border-top: 1px solid var(--frame);
  border-left: 1px solid var(--frame);
}

/* ── progress: hairline track, bar drawn with masks ────────────────────── */
/* value as a unitless 0..1 on the host:  style="--bn-progress: .62"
   plus role="progressbar" aria-valuenow etc. on the same element */
.bn-progress {
  --bn-cut-px: 4px;
  --bn-progress: 0;
  --bn-pct: calc(var(--bn-progress) * 100%);
  display: block;
  height: 14px;
  padding: 3px;
  color: var(--accent-line);
}
.bn-progress::before {                   /* the bar, cut by a value mask */
  inset: 3px;
  background: currentColor;
  clip-path: none;
  -webkit-mask: linear-gradient(90deg, var(--c-ink) var(--bn-pct), transparent var(--bn-pct));
  mask: linear-gradient(90deg, var(--c-ink) var(--bn-pct), transparent var(--bn-pct));
  transition: -webkit-mask-position 200ms, mask-position 200ms;
}
.bn-progress--segmented {
  --bn-segments: 10;
  --bn-seg: calc(100% / var(--bn-segments));
  /* ghost segments, so the count reads before the bar reaches it */
  padding: 3px 0 3px 3px;
  background:
    repeating-linear-gradient(90deg, var(--frame) 0 calc(var(--bn-seg) - 3px), transparent 0 var(--bn-seg))
    content-box;
}
.bn-progress--segmented::before {
  right: 0;
  -webkit-mask:
    linear-gradient(90deg, var(--c-ink) var(--bn-pct), transparent var(--bn-pct)),
    repeating-linear-gradient(90deg, var(--c-ink) 0 calc(var(--bn-seg) - 3px), transparent 0 var(--bn-seg));
  -webkit-mask-composite: source-in;
  mask:
    linear-gradient(90deg, var(--c-ink) var(--bn-pct), transparent var(--bn-pct)),
    repeating-linear-gradient(90deg, var(--c-ink) 0 calc(var(--bn-seg) - 3px), transparent 0 var(--bn-seg));
  mask-composite: intersect;
}
.bn-progress--lg { height: 22px; }
.bn-progress[data-state="error"] { color: var(--state-error-line); }
.bn-progress[data-state="ok"]    { color: var(--state-ok-line); }
.bn-progress__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 6px;
  color: var(--text);
  font-size: var(--type-caption-size, 14px);
  line-height: var(--type-caption-leading, 1.45);
  font-variant-numeric: lining-nums tabular-nums;
}
.bn-progress__meta > :last-child { color: var(--text-muted); }

/* ── breadcrumb ────────────────────────────────────────────────────────── */
.bn-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: var(--type-small-size, 16px);
  line-height: var(--type-small-leading, 1.4);
}
.bn-breadcrumb li { display: inline-flex; align-items: center; min-width: 0; }
.bn-breadcrumb li + li::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  margin: 0 8px;
  background: var(--frame-strong);
  -webkit-mask: url("../ui/icons/chevron-right.svg") center / contain no-repeat;
  mask: url("../ui/icons/chevron-right.svg") center / contain no-repeat;
}
.bn-breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--frame-strong);
}
.bn-breadcrumb a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
.bn-breadcrumb a:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
.bn-breadcrumb [aria-current] { color: var(--text-head); font-weight: var(--font-semibold, 600); }

/* ── pagination ────────────────────────────────────────────────────────── */
.bn-pagination ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bn-pagination__link {
  --bn-cut-px: 7px;
  --bn-frame: var(--frame-strong);
  display: inline-grid;
  grid-auto-flow: column;
  place-items: center;
  gap: 6px;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-text, inherit);
  font-size: var(--type-small-size, 16px);
  font-variant-numeric: lining-nums tabular-nums;
}
.bn-pagination__link:hover { --bn-frame: var(--text); }
.bn-pagination__link[aria-current="page"] {
  --bn-fill: var(--accent-wash);
  --bn-frame: var(--accent-ink);
  --bn-stroke: 1.5px;
  color: var(--accent-ink);
  font-weight: var(--font-semibold, 600);
}
.bn-pagination__link:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
.bn-pagination__link[aria-disabled="true"] {
  --bn-frame: var(--frame);
  color: var(--text-muted);
  pointer-events: none;
}
.bn-pagination__gap { display: inline-grid; place-items: center; min-width: 24px; color: var(--text-muted); }
/* on a phone, pages far from the current one step aside */
@media (max-width: 639px) {
  .bn-pagination [data-far] { display: none; }
  .bn-pagination__label { display: none; }    /* "Previous" / "Next" words; the arrow stays */
}

/* ── divider: engraved double hairline, optional element centred ───────── */
.bn-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  height: auto;
  margin: 28px 0;
  border: 0;
  color: var(--frame-strong);
}
.bn-divider::before,
.bn-divider::after {
  content: "";
  flex: 1;
  height: 5px;
  background:
    linear-gradient(currentColor, currentColor) top / 100% 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) bottom / 100% 1px no-repeat;
}
.bn-divider:empty { gap: 0; }
.bn-divider > .bn-el { --bn-el-size: 28px; color: var(--text-muted); }
.bn-divider--accent { color: var(--accent-line); }
.bn-divider--accent > .bn-el { color: var(--accent-line); }

/* ── empty state ───────────────────────────────────────────────────────── */
.bn-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: clamp(28px, 6vw, 52px) 20px;
  text-align: center;
  color: var(--text);
}
.bn-empty > .bn-el { --bn-el-size: clamp(80px, 22vw, 128px); color: var(--text-muted); margin-bottom: 8px; }
.bn-empty__title {
  margin: 0;
  color: var(--text-head);
  font-family: var(--font-text, inherit);
  font-size: var(--type-h4-size, 20px);
  font-weight: var(--type-h4-weight, 600);
  line-height: var(--type-h4-leading, 1.3);
}
.bn-empty__text {
  margin: 0;
  max-width: 42ch;
  color: var(--text-muted);
  font-size: var(--type-small-size, 16px);
  line-height: var(--type-small-leading, 1.5);
}
.bn-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 10px; }
/* ============================================================================
   BONITHENA UI — 10 overlays and disclosure
     .bn-tooltip    hairline box on a plumb line (no arrow, no radius)
     .bn-dialog     octagon panel, engraved double edge; backdrop = ink at 62%
     .bn-toast      a ribbon: swallowtail at the start, axe tail at the end
     .bn-accordion  <details>; the marker is the plus / minus icon
     .bn-tabs       hairline tabs; the active one takes the wash + accent rule
     .bn-stepper    numbered octagon steps
   ============================================================================ */

/* ── tooltip ───────────────────────────────────────────────────────────── */
/* markup:
     <span class="bn-tooltip-host">
       <button aria-describedby="t1">…</button>
       <span class="bn-tooltip" role="tooltip" id="t1">Text</span>
     </span>
   shown on hover and on keyboard focus inside the host. Escape-to-dismiss
   (WCAG 1.4.13) needs four lines of script — see HOW_COMPONENTS.md. */
.bn-tooltip-host { position: relative; display: inline-flex; }

.bn-tooltip {
  --bn-cut-px: 4px;
  --bn-fill: var(--surface-card);
  --bn-frame: var(--text);
  --bn-tick: 8px;
  --bn-frame-inset: 0 0 var(--bn-tick) 0;    /* face + edge stop above the plumb line */
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: 100%;
  translate: -50% 0;
  width: max-content;
  max-width: min(260px, 80vw);
  margin-bottom: 2px;
  padding: 7px 11px calc(8px + var(--bn-tick));
  color: var(--text);
  text-align: left;
  white-space: normal;
  font-family: var(--font-text, inherit);
  font-size: var(--type-caption-size, 14px);
  font-weight: var(--font-regular, 400);
  letter-spacing: 0;
  text-transform: none;
  font-variant-caps: normal;
  line-height: var(--type-caption-leading, 1.4);
  /* the plumb line: one hairline from the box to the trigger */
  --bn-tick-x: 50%;
  background: linear-gradient(var(--text), var(--text)) var(--bn-tick-x) 100% / 1px var(--bn-tick) no-repeat;
  visibility: hidden;
  opacity: 0;
  transition: opacity 120ms linear, visibility 0s linear 120ms;
  pointer-events: none;
}
.bn-tooltip[data-side="bottom"] {
  --bn-frame-inset: var(--bn-tick) 0 0 0;
  bottom: auto;
  top: 100%;
  margin: 2px 0 0;
  padding: calc(8px + var(--bn-tick)) 11px 7px;
  background-position: var(--bn-tick-x) 0;
}
/* centred by default; near a screen edge pin it to the trigger's start / end
   (CSS cannot see the viewport edge without anchor positioning) */
.bn-tooltip[data-align="start"] { left: 0; translate: none; --bn-tick-x: 22px; }
.bn-tooltip[data-align="end"]   { left: auto; right: 0; translate: none; --bn-tick-x: calc(100% - 22px); }
.bn-tooltip-host:hover > .bn-tooltip,
.bn-tooltip-host:focus-within > .bn-tooltip,
.bn-tooltip[data-open] {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}
.bn-tooltip-host[data-dismissed] > .bn-tooltip { visibility: hidden; opacity: 0; }

/* ── dialog ────────────────────────────────────────────────────────────── */
/* <dialog class="bn-dialog"> opened with showModal(), or a plain element with
   role="dialog" inside .bn-backdrop when a framework draws its own overlay. */
.bn-dialog {
  --bn-cut-px: 16px;
  --bn-stroke: 1.5px;
  --bn-gap2: 3px;
  --bn-stroke2: 1px;
  --bn-fill: var(--surface-card);
  --bn-frame: var(--text);
  --bn-edge: var(--bn-ring2);
  flex-direction: column;
  width: min(560px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: clamp(24px, 5vw, 32px) clamp(18px, 5vw, 30px) clamp(18px, 4vw, 24px);
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: visible;
}
dialog.bn-dialog[open],
.bn-dialog:not(dialog) { display: flex; }
/* inside a drawn backdrop the dialog sizes to that box, not the viewport */
.bn-backdrop > .bn-dialog { width: min(560px, 100%); max-height: none; }
.bn-dialog::backdrop { background: var(--overlay-backdrop); }
.bn-dialog:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }

.bn-backdrop {
  display: grid;
  place-items: center;
  padding: 24px 12px;
  background: var(--overlay-backdrop);
}
.bn-backdrop--fixed { position: fixed; inset: 0; z-index: 40; }

.bn-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--frame);
}
.bn-dialog__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--text-muted-card);
  font-size: var(--type-label-size, 13px);
  font-weight: var(--type-label-weight, 600);
  letter-spacing: var(--type-label-tracking, 0.1em);
  font-variant-caps: var(--type-label-caps, normal);
  text-transform: var(--type-label-transform, uppercase);
  line-height: var(--type-label-leading, 1.2);
}
.bn-dialog__title {
  margin: 0;
  color: var(--text-head);
  font-family: var(--font-display, inherit);
  font-size: var(--type-h4-size, 20px);
  font-weight: var(--type-h4-weight, 600);
  line-height: var(--type-h4-leading, 1.3);
}
.bn-dialog__close { flex: none; margin: -6px -6px 0 0; padding: 0 12px; }
/* buttons paint their face with --surface; on the dialog's card face that
   reads as a grey block, so non-primary buttons take the card instead */
/* (0,2,0): above the variant, below :hover, so the hover wash still shows */
.bn-dialog .bn-btn:where(:not(.bn-btn--primary, .bn-btn--seal, [data-state="done"])) { --bn-fill: var(--surface-card); }
.bn-dialog__body {
  min-height: 0;
  padding: 16px 0 18px;
  overflow: auto;
  color: var(--text);
}
.bn-dialog__body > :first-child { margin-top: 0; }
.bn-dialog__body > :last-child { margin-bottom: 0; }
.bn-dialog__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--frame);
}
@media (max-width: 639px) {
  .bn-dialog__foot { flex-direction: column-reverse; }   /* primary action nearest the thumb */
  .bn-dialog__foot > .bn-btn { width: 100%; }
}

/* ── toast: a ribbon ───────────────────────────────────────────────────── */
/* frame = the full ribbon, face = the same ribbon inset by the stroke (two
   nested fills, like the axe button, so the face must be opaque).
   The tail slopes are 2:1 at 56px; taller toasts keep the shape, the stroke
   on the slopes thins by a fraction of a pixel. */
.bn-toast {
  --bn-notch: 14px;                       /* swallowtail depth (start) */
  --bn-tail: 14px;                        /* axe tail length (end) */
  --bn-stroke: 1.5px;
  --bn-frame: var(--text);
  --bn-fill: var(--surface-card);
  --bn-mark: var(--accent-line);
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(440px, 100%);
  min-height: 56px;
  padding: 10px calc(var(--bn-tail) + 8px) 10px calc(var(--bn-notch) + 12px);
  color: var(--text);
}
.bn-toast::before,
.bn-toast::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.bn-toast::before {                       /* frame */
  inset: 0;
  z-index: -2;
  background: var(--bn-frame);
  clip-path: polygon(0 0, calc(100% - var(--bn-tail)) 0, 100% 50%,
                     calc(100% - var(--bn-tail)) 100%, 0 100%, var(--bn-notch) 50%);
}
.bn-toast::after {                        /* face */
  inset: var(--bn-stroke);
  z-index: -1;
  background: var(--bn-fill);
  clip-path: polygon(calc(var(--bn-stroke) * 0.618) 0,
                     calc(100% - var(--bn-tail) + var(--bn-stroke) * 0.382) 0,
                     calc(100% - var(--bn-stroke) * 0.118) 50%,
                     calc(100% - var(--bn-tail) + var(--bn-stroke) * 0.382) 100%,
                     calc(var(--bn-stroke) * 0.618) 100%,
                     calc(var(--bn-notch) + var(--bn-stroke) * 0.118) 50%);
}
.bn-toast > .bn-el,
.bn-toast > .bn-icon { flex: none; color: var(--bn-mark); }
.bn-toast__body { flex: 1; min-width: 0; }
.bn-toast__title {
  margin: 0;
  color: var(--text-head);
  font-size: var(--type-label-size, 13px);
  font-weight: var(--type-label-weight, 600);
  letter-spacing: var(--type-label-tracking, 0.1em);
  font-variant-caps: var(--type-label-caps, normal);
  text-transform: var(--type-label-transform, uppercase);
  line-height: var(--type-label-leading, 1.2);
}
.bn-toast__text {
  margin: 2px 0 0;
  color: var(--text);
  font-size: var(--type-caption-size, 14px);
  line-height: var(--type-caption-leading, 1.45);
}
.bn-toast__close {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -6px -4px -6px 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted-card);
  cursor: pointer;
}
.bn-toast__close::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("../ui/icons/close.svg") center / contain no-repeat;
  mask: url("../ui/icons/close.svg") center / contain no-repeat;
}
.bn-toast__close::after { content: ""; position: absolute; inset: -6px; }   /* 44px target */
.bn-toast__close:hover { color: var(--text); }
.bn-toast__close:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }

.bn-toast--accent { --bn-frame: var(--accent-ink); --bn-mark: var(--accent-ink); }
.bn-toast--ok     { --bn-frame: var(--state-ok-line);    --bn-mark: var(--state-ok-ink); }
.bn-toast--error  { --bn-frame: var(--state-error-line); --bn-mark: var(--state-error-ink); }

/* the stack in the corner (bottom on a phone, full width) */
.bn-toaster {
  position: fixed;
  z-index: 50;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}
.bn-toaster > * { pointer-events: auto; animation: bn-toast-in 220ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes bn-toast-in { from { transform: translateX(24px); opacity: 0; } }
@media (max-width: 639px) {
  .bn-toaster { left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: auto; }
  .bn-toaster > * { width: 100%; }
}

/* ── accordion ─────────────────────────────────────────────────────────── */
.bn-accordion {
  border-top: 1px solid var(--frame-strong);
  border-bottom: 1px solid var(--frame-strong);
  color: var(--text);
}
.bn-accordion__item + .bn-accordion__item { border-top: 1px solid var(--frame); }
.bn-accordion__item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 10px 2px;
  color: var(--text-head);
  list-style: none;
  cursor: pointer;
  font-weight: var(--font-semibold, 600);
  -webkit-tap-highlight-color: transparent;
}
.bn-accordion__item > summary::-webkit-details-marker { display: none; }
.bn-accordion__item > summary::after {      /* plus, then minus: from the icon set */
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("../ui/icons/plus.svg") center / contain no-repeat;
  mask: url("../ui/icons/plus.svg") center / contain no-repeat;
  transition: transform 160ms ease-out;
}
.bn-accordion__item[open] > summary::after {
  -webkit-mask-image: url("../ui/icons/minus.svg");
  mask-image: url("../ui/icons/minus.svg");
  transform: rotate(180deg);
}
.bn-accordion__item > summary:hover { color: var(--accent-ink); }
.bn-accordion__item > summary:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
.bn-accordion__panel {
  max-width: var(--measure, 66ch);
  padding: 0 2px 20px;
  color: var(--text);
}
.bn-accordion__panel > :first-child { margin-top: 0; }
.bn-accordion__panel > :last-child { margin-bottom: 0; }

/* ── tabs ──────────────────────────────────────────────────────────────── */
/* role="tablist" / "tab" / "tabpanel"; arrow-key roving focus is a few lines
   of script (demo/components.html has it). The list scrolls sideways on a
   phone; its padding keeps the 3px-offset focus ring inside the scroll box. */
.bn-tabs__list {
  --bn-tabs-pad: 6px;
  display: flex;
  gap: 2px;
  margin: calc(var(--bn-tabs-pad) * -1);
  padding: var(--bn-tabs-pad);
  overflow-x: auto;
  scrollbar-width: none;
  /* the hairline under the tabs, drawn inside the padding so it survives the scroll clip */
  background: linear-gradient(var(--frame-strong), var(--frame-strong))
              var(--bn-tabs-pad) calc(100% - var(--bn-tabs-pad)) /
              calc(100% - var(--bn-tabs-pad) * 2) 1px no-repeat;
}
.bn-tabs__list::-webkit-scrollbar { display: none; }
.bn-tabs__tab {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-text, inherit);
  font-size: var(--type-nav-size, 16px);
  font-weight: var(--type-nav-weight, 400);
  letter-spacing: var(--type-nav-tracking, 0.02em);
  line-height: var(--type-nav-leading, 1);
  -webkit-tap-highlight-color: transparent;
}
.bn-tabs__tab:hover { color: var(--text); }
.bn-tabs__tab[aria-selected="true"] {
  background: var(--accent-wash);
  color: var(--accent-ink);
  font-weight: var(--font-semibold, 600);
}
.bn-tabs__tab[aria-selected="true"]::after {   /* the accent rule, sitting on the hairline */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent-line);
}
.bn-tabs__tab:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
.bn-tabs__tab:disabled { color: var(--frame-strong); cursor: not-allowed; }
.bn-tabs__panel { padding: 20px 2px 4px; color: var(--text); }
.bn-tabs__panel[hidden] { display: none; }
.bn-tabs__panel:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }

/* ── stepper ───────────────────────────────────────────────────────────── */
/* <ol class="bn-stepper"> of .bn-stepper__step; data-state="done" | "current"
   (with aria-current="step"); upcoming steps carry nothing. Vertical on a
   phone, a row from 640px. */
.bn-stepper {
  --bn-step-size: 38px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
}
.bn-stepper__step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.bn-stepper__step + .bn-stepper__step::before {    /* the connector */
  content: "";
  position: absolute;
  left: calc(var(--bn-step-size) / 2);
  top: -14px;
  height: 14px;
  width: 1px;
  background: var(--frame-strong);
}
.bn-stepper__num {
  --bn-cut-px: 10px;
  --bn-fill: var(--surface);
  --bn-frame: var(--frame-strong);
  flex: none;
  display: inline-grid;
  place-items: center;
  width: var(--bn-step-size);
  height: var(--bn-step-size);
  color: var(--text-muted);
  font-family: var(--font-text, inherit);
  font-size: var(--type-small-size, 16px);
  font-weight: var(--font-semibold, 600);
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
}
.bn-stepper__label {
  min-width: 0;
  font-size: var(--type-small-size, 16px);
  line-height: var(--type-small-leading, 1.35);
}
.bn-stepper__label small {
  display: block;
  color: var(--text-muted);
  font-size: var(--type-caption-size, 14px);
}
.bn-stepper__step[data-state="done"] { color: var(--text); }
.bn-stepper__step[data-state="done"] .bn-stepper__num {
  --bn-fill: var(--accent-wash);
  --bn-frame: var(--accent-ink);
  color: var(--accent-ink);
}
.bn-stepper__step[data-state="current"] { color: var(--text-head); }
.bn-stepper__step[data-state="current"] .bn-stepper__num {
  --bn-frame: var(--accent-ink);
  --bn-stroke: 2px;
  color: var(--accent-ink);
}
.bn-stepper__step[data-state="current"] .bn-stepper__label { font-weight: var(--font-semibold, 600); }
.bn-stepper__step[data-state="done"] + .bn-stepper__step::before { background: var(--accent-line); }
.bn-stepper__step a { color: inherit; text-decoration: none; }
.bn-stepper__step a:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }

@media (min-width: 640px) {
  .bn-stepper { flex-direction: row; gap: 0; }
  .bn-stepper__step {
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
  }
  .bn-stepper__step + .bn-stepper__step::before {
    top: calc(var(--bn-step-size) / 2);
    left: calc(-50% + var(--bn-step-size) / 2 + 8px);
    right: calc(50% + var(--bn-step-size) / 2 + 8px);
    width: auto;
    height: 1px;
  }
  .bn-stepper__label { padding: 0 6px; }
}

/* --list: numbered steps that carry a paragraph. Vertical at every width,
   each step under a hairline, the number in the octagon. Markup:
     <ol class="bn-stepper bn-stepper--list">
       <li class="bn-stepper__step"><span class="bn-stepper__num">01</span>
         <p class="bn-stepper__label"><strong>Name.</strong> What happens.</p></li> */
.bn-stepper.bn-stepper--list {
  --bn-step-size: 46px;
  flex-direction: column;
  gap: 0;
  margin: var(--space-l, 24px) 0 0;
  color: var(--text);
}
.bn-stepper--list > .bn-stepper__step {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--space-m, 18px);
  padding: 20px 0;
  text-align: left;
  background: linear-gradient(var(--frame), var(--frame)) left top / 100% 1px no-repeat;
}
.bn-stepper--list > .bn-stepper__step:last-child {
  background:
    linear-gradient(var(--frame), var(--frame)) left top / 100% 1px no-repeat,
    linear-gradient(var(--frame), var(--frame)) left bottom / 100% 1px no-repeat;
}
.bn-stepper--list > .bn-stepper__step + .bn-stepper__step::before { display: none; }
.bn-stepper--list .bn-stepper__num {
  --bn-frame: var(--accent-line);
  color: var(--accent-ink);
  font-family: var(--font-display, inherit);
  font-weight: var(--font-regular, 400);
  letter-spacing: 0.04em;
}
.bn-stepper--list .bn-stepper__label {
  max-width: 58ch;
  margin: 0;
  padding: calc((var(--bn-step-size) - var(--type-body-size, 18px) * var(--type-body-leading, 1.6)) / 2) 0 0;
  color: var(--text);
  font-size: var(--type-body-size, 18px);
  line-height: var(--type-body-leading, 1.6);
}
.bn-stepper--list .bn-stepper__label strong { color: var(--text-head); font-weight: var(--font-semibold, 600); }
@media (max-width: 560px) {
  .bn-stepper.bn-stepper--list { --bn-step-size: 38px; }
  .bn-stepper--list > .bn-stepper__step { gap: var(--space-s, 14px); padding: 18px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bn-tooltip, .bn-accordion__item > summary::after { transition: none; }
  .bn-toaster > * { animation: none; }
}
/* ============================================================================
   BONITHENA UI — 06 responsive
   Mobile first, breakpoint at 900px. Nothing here invents colour or type: it
   only re-binds the variables the components already read, so a phone gets a
   taller, fuller, thumb-sized version of the same object.

   Two rules that matter:
     - every interactive target is at least 44x44 CSS px on touch
     - sizes are fluid where the object is decorative, fixed where it is text
   ============================================================================ */

/* components size from their border box: without this, width:100% plus padding
   overflows the container on a phone */
.bn-wrap, .bn-btn, .bn-panel, .bn-el, .bn-icon, .bn-gate, .bn-grid, .bn-row { box-sizing: border-box; }

:root {
  /* fluid element sizes: a bee is 28px on a phone, 40px on a desktop */
  --bn-el-fluid-sm: clamp(24px, 6vw, 32px);
  --bn-el-fluid-md: clamp(36px, 9vw, 56px);
  --bn-el-fluid-lg: clamp(56px, 14vw, 96px);
  /* page gutters, respecting notches */
  --bn-gutter: clamp(16px, 4vw, 28px);
  --bn-page-max: 920px;
}

/* ---- layout helpers (the page needs three, so they live here) ----------- */
.bn-wrap {
  width: 100%;
  max-width: var(--bn-page-max);
  margin-inline: auto;
  padding-inline: max(var(--bn-gutter), env(safe-area-inset-left));
}

.bn-stack > * + * { margin-top: var(--bn-stack-gap, 16px); }

.bn-grid {
  display: grid;
  gap: var(--bn-grid-gap, 16px);
  grid-template-columns: minmax(0, 1fr);    /* minmax(0,…) so long content cannot blow the column out */
}
@media (min-width: 640px) {
  .bn-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bn-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .bn-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bn-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.bn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ---- buttons ------------------------------------------------------------ */
/* on a phone a primary action goes full width: thumbs, not aim */
@media (max-width: 639px) {
  .bn-btn--block-mobile {
    flex: 1 0 100%;
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }
  .bn-btn { min-height: 44px; }
  .bn-btn--sm { min-height: 40px; }
  .bn-btn--seal:not(:has(> .bn-btn__disc)) { width: 64px; height: 64px; }
  .bn-btn--axe { padding-right: 38px; }
}

/* the visible frame thickens slightly on touch, so a 1.8px line does not vanish */
@media (pointer: coarse) {
  .bn-btn { --bn-stroke: 2px; }
}

/* ---- panels ------------------------------------------------------------- */
/* the corner brackets need room: padding must clear the frame's corner marks */
.bn-panel { padding: clamp(26px, 5vw, 34px) clamp(22px, 4.5vw, 30px); }
@media (max-width: 639px) {
  .bn-panel { padding: 30px 20px 26px; }
  .bn-panel--accent { padding-top: 40px; }
}

/* ---- elements and icons ------------------------------------------------- */
.bn-el--fluid-sm { --bn-el-size: var(--bn-el-fluid-sm); }
.bn-el--fluid-md { --bn-el-size: var(--bn-el-fluid-md); }
.bn-el--fluid-lg { --bn-el-size: var(--bn-el-fluid-lg); }

.bn-el--fill { max-width: 100%; }
.bn-el--fill img, .bn-el--fill svg { display: block; }

/* icon row that wraps on a phone and stays inline on a desktop */
.bn-iconrow {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 3vw, 22px);
  color: var(--text);
  align-items: center;
}

/* ---- the gate ---------------------------------------------------------- */
@media (max-width: 639px) {
  .bn-gate { flex: 1 1 45%; }
  .bn-gate__art { height: 56px; }
}

/* ---- hero: see page.css ---------------------------------------------- */

/* page title and lede: the type layer's roles, never a size of our own */
.bn-title {
  margin: 8px 0 14px;
  color: var(--text-head);
  font-family: var(--font-display, inherit);
  font-size: var(--type-h1-size, 40px);
  font-weight: var(--type-h1-weight, 400);
  font-stretch: var(--type-h1-width, normal);
  line-height: var(--type-h1-leading, 1.05);
  letter-spacing: var(--type-h1-tracking, -0.01em);
  text-wrap: balance;
}
.bn-lede {
  max-width: 46ch;
  margin: 0 0 22px;
  color: var(--text);
  font-size: var(--type-lede-size, 20px);
  font-weight: var(--type-lede-weight, 400);
  line-height: var(--type-lede-leading, 1.45);
  letter-spacing: var(--type-lede-tracking, 0);
  text-wrap: pretty;
}

/* ---- header / footer band ---------------------------------------------- */
.bn-bar {
  background: var(--surface-invert);
  color: var(--text-invert);
  padding-block: 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}
.bn-bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
@media (max-width: 639px) {
  .bn-bar__inner { flex-wrap: wrap; row-gap: 12px; }
  .bn-bar__inner > .bn-row { width: 100%; justify-content: space-between; }
}
.bn-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text-head);
  text-decoration: none;
  font-family: var(--font-display, inherit);
  font-size: var(--type-h4-size, 19px);
  font-weight: var(--font-regular, 400);
  font-stretch: var(--type-nav-width, normal);
  letter-spacing: var(--type-nav-tracking, 0.02em);
  line-height: 1;
}
.bn-brand img, .bn-brand svg { width: 28px; height: 28px; flex: none; color: var(--text-head); }

/* ---- reduced motion: the gate bars and the seal press still work, they just
        do not animate ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .bn-gate__bars { transition: none; }
}
/* ============================================================================
   BONITHENA UI — 11 page
   The pieces a public page is built from, in the same language as the rest of
   the package: hairlines, cut corners, masks, engraving marks. No shadow, no
   border-radius, no colour or size of its own: every colour is a semantic
   token, every size is a --type-* role (or a calc() of one).

     .bn-page            <body>: ground, base rhythm, focus ring, no sideways scroll
     .bn-skip            skip link
     .bn-masthead        sticky head: .bn-brand, .bn-masthead__nav (.bn-navlink),
                         .bn-themeswitch (sun on ink, moon on paper)
     .bn-hero            words + art; --tight for a small plate; --plate: the
                         plate alone on top, large and centred, the words under it
     .bn-medallion       the emblem plate: a JPEG disc (clip-path: circle) in a
                         hairline mount; the plate is held at 104%; --sm, --lg
     .bn-swarm           five bees (the bee engraving) leave the plate, one shot
     .bn-band            a page section under a hairline; --ink runs edge to edge
                         as an invert scope; __title = the section title on one row
                         with its __mark (an engraving) in front of the words.
                         A size container (also .bn-container): the lists below
                         answer to its width, not the viewport. --split: rubric
                         (__head) beside the text (__body); --center: one centred
                         column (a close)
     .bn-quotes/.bn-quote  forum voices: hairline + short accent stroke, real italic;
                         two across by default, --3 for three, --1 for one
     .bn-symbols/.bn-symbol  a grid of symbol cards (inside .bn-band): an engraving
                         in front of the heading on one row, a paragraph at body size;
                         <li class="bn-panel bn-panel--card bn-symbol">
     .bn-creed           numbered beliefs as a manifesto: big lining numerals,
                         hairline rules, two columns when the band is wide
     .bn-specimens       engraving elements laid out like a plate of proofs
     .bn-pull            the pull line
     .bn-note            a muted closing note
     .bn-checklist       check / cross list (the check and close icons);
                         --wide: hairline rows, two columns; --rows: hairline
                         rows, one column
     .bn-deflist         term + explanation rows between hairlines
     .bn-news            source · date, then the statement (calendar icon)
     .bn-price           price card content, inside .bn-panel
     .bn-foot            the foot: brand, links
     .bn-reveal          one-shot scroll reveal (transform + opacity)

   Loaded after responsive.css: it builds on bn-bar, bn-row, bn-wrap, bn-grid,
   bn-title, bn-lede and bn-brand rather than restating them.

   Layout knobs a page may set: --bn-page-max, --bn-gutter, --bn-grid-gap,
   --bn-medallion-size, the --space-* scale (themes.css).
   ============================================================================ */

/* ── page ──────────────────────────────────────────────────────────────── */
.bn-page {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  /* bees and full-bleed bands may reach past the viewport; never scroll
     sideways. clip, not hidden, so the sticky head keeps working */
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}
.bn-page *, .bn-page *::before, .bn-page *::after { box-sizing: border-box; }
.bn-page :is(h1, h2, h3, h4) { margin: 0; text-wrap: balance; }
.bn-page p { margin: 0 0 var(--space-s, 14px); }
.bn-page p:last-child { margin-bottom: 0; }
.bn-page :is(p, li, dd, dt) { text-wrap: pretty; }
.bn-page a { color: inherit; }
.bn-page :focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) {
  html:has(> .bn-page) { scroll-behavior: smooth; }
}

/* the theme's colour scheme for native scrollbars and form chrome */
:root { color-scheme: light; }
:root[data-surface="invert"] { color-scheme: dark; }

/* ── skip link ─────────────────────────────────────────────────────────── */
.bn-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
  padding: 10px 14px;
  background: var(--surface-card);
  color: var(--text);
  font-size: var(--type-small-size, 16px);
}
.bn-skip:focus { left: 12px; top: 12px; }

/* ── masthead ──────────────────────────────────────────────────────────── */
/* <header class="bn-bar bn-masthead"><div class="bn-bar__inner bn-masthead__inner bn-wrap">
   bn-bar makes it ink on both themes (an invert scope); this adds the sticky
   position, the engraved double hairline and the nav. */
.bn-masthead {
  padding-block: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  color: var(--text);
  /* engraved: a hairline and, under it, a fainter second one */
  background-image:
    linear-gradient(var(--frame), var(--frame)),
    linear-gradient(var(--frame), var(--frame));
  background-size: 100% 1px, 100% 1px;
  background-position: left bottom 3px, left bottom;
  background-repeat: no-repeat;
}
.bn-masthead__inner {
  display: flex;
  align-items: center;
  gap: var(--space-m, 20px);
  min-height: 64px;
  padding-block: 10px 13px;
}
.bn-masthead__nav {
  display: flex;
  gap: var(--space-m, 22px);
  margin-left: auto;
}
.bn-navlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-text, inherit);
  font-size: calc(var(--type-nav-size, 17px) * 0.9);
  font-weight: var(--type-nav-weight, 400);
  font-stretch: var(--type-nav-width, normal);
  letter-spacing: var(--type-nav-tracking, 0.02em);
  line-height: var(--type-nav-leading, 1);
  background: linear-gradient(var(--accent-line), var(--accent-line)) left bottom 8px / 0 2px no-repeat;
  transition: color 160ms linear, background-size 160ms ease-out;
}
.bn-navlink:hover { color: var(--text-head); background-size: 100% 1px; }
/* the page you are on: head ink and a full accent rule that stays */
.bn-navlink[aria-current] { color: var(--text-head); background-size: 100% 2px; }

/* the theme switch: an icon tablet; the sun shows on ink (press for paper),
   the moon on paper (press for ink) */
.bn-themeswitch .bn-icon--moon { display: none; }
:root:not([data-surface="invert"]) .bn-themeswitch .bn-icon--sun { display: none; }
:root:not([data-surface="invert"]) .bn-themeswitch .bn-icon--moon { display: inline-block; }

/* phone: brand and switch on one row, the links on a second row that scrolls
   sideways if it has to. The head scrolls away (two sticky rows would eat a
   seventh of the screen). */
@media (max-width: 720px) {
  .bn-masthead { position: static; }
  .bn-masthead__inner { flex-wrap: wrap; gap: 0 var(--space-s, 14px); padding-block: 4px 3px; }
  .bn-masthead__inner > .bn-themeswitch { margin-left: auto; }
  .bn-masthead__nav {
    order: 3;
    width: calc(100% + 2 * var(--bn-gutter, 16px));
    margin: 0 calc(-1 * var(--bn-gutter, 16px));
    padding: 0 var(--bn-gutter, 16px);
    gap: var(--space-m, 20px);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .bn-masthead__nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 380px) {
  .bn-masthead__nav { gap: 8px; }   /* four links fit a 360px row without a sideways scroll */
}

/* ── hero ──────────────────────────────────────────────────────────────── */
.bn-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
  padding-block: clamp(32px, 5vw, 72px) clamp(24px, 3vw, 48px);
  /* the bees may leave the plate, not the screen (clip: no scroll container) */
  overflow-x: clip;
}
.bn-hero--tight { grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.6fr); }
.bn-hero__text { min-width: 0; }
.bn-hero__text > .bn-lede { margin-top: var(--space-m, 22px); }
.bn-hero--tight .bn-lede { max-width: 52ch; }
/* <p class="bn-row bn-hero__actions">: bn-row lays the buttons out, this only
   spaces the row from the words; bn-btn--block-mobile stacks them on a phone */
.bn-hero__actions {
  gap: var(--space-s, 12px) var(--space-m, 20px);
  margin: var(--space-l, 30px) 0 0;
  max-width: none;
}
.bn-hero__art {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
}
@media (max-width: 860px) {
  .bn-hero, .bn-hero--tight { grid-template-columns: minmax(0, 1fr); }
  .bn-hero__art { order: -1; }
}

/* ── medallion: the emblem plate ───────────────────────────────────────── */
/* <div class="bn-medallion"><div class="bn-medallion__disc">
     <img class="bn-medallion__plate" src="plate-560.jpg" srcset="… 2x" alt=""></div></div>
   The plate is a print, not a logo: one JPEG, the same on both themes. The
   disc is clip-path: circle() (never border-radius); the plate is held at
   104% so the drawing meets its own rim (HANDOVER 7.9). The mount is a card
   collar with an engraved double hairline, painted with gradients: no shadow. */
.bn-medallion {
  --bn-medallion-size: 520px;
  --bn-medallion-mount: 11px;
  position: relative;
  width: min(100%, var(--bn-medallion-size));
  aspect-ratio: 1;
  padding: var(--bn-medallion-mount);
  background: radial-gradient(circle closest-side,
    transparent calc(100% - var(--bn-medallion-mount) - 1px),
    var(--frame-strong) calc(100% - var(--bn-medallion-mount) - 0.5px),
    var(--surface-card) calc(100% - var(--bn-medallion-mount) + 0.5px),
    var(--surface-card) calc(100% - 1.75px),
    var(--frame-strong) calc(100% - 1.25px),
    var(--frame-strong) calc(100% - 0.25px),
    transparent 100%);
}
.bn-medallion__disc {
  width: 100%;
  height: 100%;
  overflow: hidden;
  clip-path: circle(50% at 50% 50%);
  /* pure CSS and never fully transparent: visible with no JS, in a static
     capture, and with the reveal off */
  animation: bn-plate-in 1s cubic-bezier(.2, .7, .2, 1) both;
}
.bn-medallion__plate {
  display: block;
  width: 104%;
  max-width: none;
  height: 104%;
  margin: -2%;
  object-fit: cover;
}
/* the print is a touch deep for ink: lift it on the dark page only */
[data-surface="invert"] .bn-medallion__plate { filter: brightness(1.14) contrast(1.05); }
.bn-medallion--sm { --bn-medallion-size: 320px; --bn-medallion-mount: 8px; }
@keyframes bn-plate-in {
  from { opacity: 0.35; transform: scale(0.985); }
  to   { opacity: 1; transform: none; }
}
@media (max-width: 860px) {
  .bn-medallion { width: min(68%, 340px); --bn-medallion-mount: 8px; }
  .bn-medallion--sm { width: min(46%, 190px); --bn-medallion-mount: 6px; }
}
.bn-medallion--lg { --bn-medallion-size: 640px; --bn-medallion-mount: 14px; }
@media (max-width: 860px) {
  .bn-medallion--lg { width: min(100%, 440px); --bn-medallion-mount: 10px; }
}

/* ── hero --plate: the plate is the opening image ──────────────────────── */
/* <section class="bn-hero bn-hero--plate bn-wrap">
     <div class="bn-hero__art" aria-hidden="true">
       <div class="bn-medallion bn-medallion--lg">…</div><div class="bn-swarm">…</div></div>
     <div class="bn-hero__text"><h1 class="bn-title">…</h1><p class="bn-lede">…</p>
       <p class="bn-row bn-hero__actions">…</p></div></section>
   One column at every width and everything centred: the plate first and
   large, the words under it. The art box is exactly the plate's width, so the
   swarm's percentages still land on the scroll. The plate never takes more
   than ~56% of the screen height, so the title stays in the first screen. */
.bn-hero--plate {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: clamp(24px, 3vw, 40px);
  padding-block: clamp(24px, 3vw, 44px) clamp(40px, 5vw, 76px);
  text-align: center;
}
.bn-hero--plate .bn-hero__art {
  display: block;
  order: 0;
  width: min(100%, 560px);
  width: min(100%, 560px, 56svh);
}
.bn-hero--plate .bn-medallion { width: 100%; }
.bn-hero--plate .bn-swarm { --bn-swarm-k: 1.2; }
.bn-hero--plate .bn-title { margin-inline: auto; }
.bn-hero--plate .bn-hero__text > .bn-lede { max-width: 42ch; margin-inline: auto; }
.bn-hero--plate .bn-hero__actions { justify-content: center; }
@media (max-width: 860px) {
  .bn-hero--plate .bn-hero__art { width: min(100%, 440px); }
  .bn-hero--plate .bn-swarm { --bn-swarm-k: .7; }
}

/* ── swarm: the bees leave the scroll ──────────────────────────────────── */
/* <div class="bn-swarm" aria-hidden="true"> five × <span class="bn-el bn-el--bee"></span>
   transform + opacity only, staggered, one shot. */
.bn-swarm { position: absolute; inset: 0; pointer-events: none; }
.bn-swarm > .bn-el {
  --bn-el-size: 34px;
  position: absolute;
  left: 62%;
  top: 26%;
  color: var(--text);
  opacity: 0;
  will-change: transform, opacity;
  animation: bn-bee 2.6s cubic-bezier(.25, .6, .2, 1) both;
}
.bn-swarm > :nth-child(1) { animation-delay: .55s; --bx: 96px;  --by: -54px; --br: 18deg; }
.bn-swarm > :nth-child(2) { animation-delay: .72s; --bx: 140px; --by: -6px;  --br: -12deg; --bn-el-size: 26px; }
.bn-swarm > :nth-child(3) { animation-delay: .66s; --bx: 118px; --by: 46px;  --br: 24deg;  --bn-el-size: 20px; }
.bn-swarm > :nth-child(4) { animation-delay: .84s; --bx: 168px; --by: -38px; --br: -20deg; --bn-el-size: 22px; }
.bn-swarm > :nth-child(5) { animation-delay: .92s; --bx: 152px; --by: 74px;  --br: 14deg;  --bn-el-size: 18px; }
@keyframes bn-bee {
  0%   { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(.7); }
  18%  { opacity: .85; }
  70%  { opacity: .8; }
  100% { opacity: 0; transform: translate(calc(var(--bx) * var(--bn-swarm-k, 1)), calc(var(--by) * var(--bn-swarm-k, 1))) rotate(var(--br)) scale(1); }
}
@media (max-width: 860px) {
  .bn-swarm { --bn-swarm-k: .55; }
  .bn-swarm > .bn-el { left: 68%; top: 22%; }
}

/* ── band: a page section ──────────────────────────────────────────────── */
/* <section class="bn-band bn-wrap">; the hairline is drawn inside the gutters
   so it lines up with the content. A band is a size container: the pieces
   inside (quotes, checklist, deflist, news) follow the band's width, not the
   viewport, so they behave the same in a half-width column. Anything else can
   opt in with .bn-container. */
.bn-band,
.bn-container { container-type: inline-size; }
.bn-band {
  --bn-band-rule: var(--frame);
  padding-block: clamp(40px, 5vw, 76px);
  background: linear-gradient(var(--bn-band-rule), var(--bn-band-rule))
              center top / calc(100% - 2 * var(--bn-gutter, 16px)) 1px no-repeat;
}
.bn-band > h2 { margin-bottom: var(--space-m, 18px); }
.bn-band > :is(ul, ol, dl, .bn-grid, .bn-quotes) + p { margin-top: var(--space-m, 22px); }
.bn-band__mark {
  display: block;
  margin: 0 0 var(--space-s, 14px);
  color: var(--accent-line);
}
/* Rule for the whole package: a mark or an icon stands IN FRONT of its words, on
   the same row, centred on them. A section title is
     <div class="bn-band__title"><span class="bn-band__mark bn-el bn-el--oak-leaf bn-el--48"
       aria-hidden="true"></span><h2>…</h2></div>
   A bare mark above a heading is the old pattern and is no longer used. */
.bn-band__title {
  display: flex;
  align-items: center;
  gap: var(--space-s, 14px) var(--space-m, 18px);
  margin: 0 0 var(--space-m, 18px);
}
.bn-band__title > h2 { margin: 0; min-width: 0; }
.bn-band__title > .bn-band__mark {
  --bn-el-size: clamp(36px, 5vw, 48px);
  flex: none;
  margin: 0;
}
.bn-band__head > .bn-band__title { margin: 0; }
.bn-band--center > .bn-band__title { justify-content: center; }
/* ink: runs edge to edge on paper (an invert scope: give it data-surface="invert").
   The full bleed is a border-image outset, not a shadow. */
.bn-band--ink {
  background: var(--surface);
  border-image: linear-gradient(var(--surface), var(--surface)) fill 0 / / 0 100vmax;
}
.bn-band--ink + .bn-band { background-image: none; }
.bn-band--door { --bn-band-rule: var(--frame-strong); }

/* --split: an editorial page. <section class="bn-band bn-band--split bn-wrap">
     <div class="bn-band__head">(mark) <h2>…</h2> (art)</div>
     <div class="bn-band__body"><p class="bn-lede">…</p>…</div></section>
   The heading is a rubric in a narrow left column and the text runs in a wide
   right one, tops level. Intrinsic, not a breakpoint: the two stack as soon as
   the body would get less than 58% of the band, so it behaves the same in a
   half-width column as on a phone. The body is a size container of its own: a
   checklist inside answers to the column. */
.bn-band--split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-m, 20px) clamp(40px, 6vw, 96px);
}
.bn-band__head { flex: 1 1 22rem; min-width: 0; }   /* wide enough for a mark and a short title on one row */
.bn-band__head > h2 { margin: 0; }
.bn-band__head > * + :not(h2) { margin-top: var(--space-l, 28px); }
.bn-band__body { flex: 999 1 0; min-width: min(100%, 58%); container-type: inline-size; }
.bn-band__body > .bn-lede { max-width: 60ch; }
.bn-band__body > :is(ul, ol, dl) { margin-top: 0; }
.bn-band__body > p + :is(ul, ol, dl) { margin-top: var(--space-m, 20px); }

/* --center: one centred column, for a close */
.bn-band--center { text-align: center; }
.bn-band--center > .bn-band__mark { margin-inline: auto; }
.bn-band--center > :is(.bn-lede, p) { margin-inline: auto; }
.bn-band--center > .bn-hero__actions { justify-content: center; }

/* ── lede inside a band ────────────────────────────────────────────────── */
.bn-band > .bn-lede { max-width: 56ch; margin-bottom: var(--space-m, 18px); }
/* a plain paragraph in a band is running text: body size, body leading, full
   ink (the lede above it is the larger voice; this is not a note) */
.bn-page .bn-band > p:not(.bn-lede):not(.bn-note):not(.bn-pull):not(.bn-row),
.bn-page .bn-band__body > p:not(.bn-lede):not(.bn-note):not(.bn-pull):not(.bn-row) {
  max-width: 62ch;
  color: var(--text);
  font-size: var(--type-body-size, 18px);
  line-height: var(--type-body-leading, 1.6);
}

/* --lg: the larger voice of an editorial block (a long paragraph that is the
   whole section): one step up from the lede, a touch tighter */
.bn-lede--lg {
  font-size: calc(var(--type-lede-size, 20px) * 1.14);
  line-height: calc(var(--type-lede-leading, 1.45) - 0.03);
}
.bn-band__body > .bn-lede--lg { max-width: 58ch; }

/* ── quotes: real words, set like an editorial pull ────────────────────── */
.bn-quotes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 48px) clamp(28px, 5vw, 64px);
  margin: var(--space-l, 30px) 0 0;
  padding: 0;
  list-style: none;
}
.bn-quotes--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px clamp(24px, 3.4vw, 44px); }
.bn-quotes--1 { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.bn-quote {
  position: relative;
  margin: 0;
  padding-top: 22px;
  /* a hairline with a short accent stroke riding its start */
  background:
    linear-gradient(var(--accent-line), var(--accent-line)) left top / 40px 2px no-repeat,
    linear-gradient(var(--frame-strong), var(--frame-strong)) left top / 100% 1px no-repeat;
}
.bn-quote blockquote {
  max-width: 34ch;
  margin: 0;
  color: var(--text-head);
  font-family: var(--font-display, inherit);
  font-size: calc(var(--type-quote-size, 28px) * 0.84);
  font-weight: var(--font-regular, 400);
  font-style: italic;
  line-height: var(--type-quote-leading, 1.3);
  letter-spacing: var(--type-quote-tracking, 0);
  text-wrap: pretty;
}
.bn-quotes--3 .bn-quote blockquote { max-width: none; font-size: calc(var(--type-quote-size, 28px) * 0.74); }
.bn-quotes--1 .bn-quote blockquote { max-width: 40ch; font-size: var(--type-quote-size, 28px); }
/* three quotes: three across, or stacked; never two and one */
@container (max-width: 820px) {
  .bn-quotes--3 { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .bn-quotes--3 .bn-quote blockquote { max-width: 40ch; font-size: calc(var(--type-quote-size, 28px) * 0.84); }
}
@container (max-width: 700px) {
  .bn-quotes { grid-template-columns: minmax(0, 1fr); gap: 26px; }
}

/* ── symbols: a grid of cards, each an engraving + a heading + a paragraph ─ */
/* <ul class="bn-grid bn-grid--3 bn-symbols"><li class="bn-panel bn-panel--card bn-symbol">
     <span class="bn-el bn-el--shield bn-el--48 bn-el--accent" aria-hidden="true"></span>
     <h3>…</h3><p>…</p></li>…</ul>
   bn-grid brings the columns (one on a phone, two from 640px, three from
   900px); every row is as tall as its tallest card. The engraving stands in
   front of the heading on one row; the paragraph runs under both. */
.bn-symbols {
  margin: var(--space-l, 30px) 0 0;
  padding: 0;
  list-style: none;
  grid-auto-rows: 1fr;
}
.bn-symbol {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: center;
  column-gap: var(--space-m, 18px);
  padding: clamp(24px, 2.4vw, 32px) clamp(22px, 2.2vw, 30px) clamp(26px, 2.6vw, 34px);
}
.bn-symbol > .bn-el {
  --bn-el-size: 48px;
  grid-column: 1;
  margin: 0;
}
.bn-symbol > h3 {
  grid-column: 2;
  margin: 0;
  font-size: var(--type-h4-size, 22px);
  line-height: var(--type-h4-leading, 1.3);
}
.bn-symbol > p {
  grid-column: 1 / -1;
  align-self: start;
  margin-top: var(--space-m, 18px);
  max-width: none;
  color: var(--text);
  font-size: var(--type-body-size, 18px);
  line-height: var(--type-body-leading, 1.6);
}
@media (max-width: 639px) {
  .bn-symbols { grid-auto-rows: auto; }
}

/* ── creed: numbered beliefs, set as a manifesto ───────────────────────── */
/* <ul class="bn-creed">
     <li class="bn-creed__item">
       <h3><span class="bn-creed__num">1.</span><span class="bn-creed__mark bn-el bn-el--scroll"
         aria-hidden="true"></span>Permission comes first.</h3>
       <p>One sentence.</p></li>…</ul>
   The number is part of the heading text (so it is read once, with it), set
   big in the display face with lining figures. Every belief hangs from a
   hairline with a short accent stroke; the mark (optional) is a small, muted
   engraving in front of the title words, on the same row. Two columns when the band is 760px or
   wider, one below. An odd count leaves one cell free in two columns: an oak,
   in the frame tone, stands in it. */
.bn-creed {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 clamp(40px, 6vw, 96px);
  margin: var(--space-xl, 40px) 0 0;
  padding: 0;
  list-style: none;
}
.bn-creed__item {
  position: relative;
  min-width: 0;
  padding: clamp(20px, 2.2vw, 28px) 0 clamp(32px, 4vw, 52px);
  background:
    linear-gradient(var(--accent-line), var(--accent-line)) left top / 56px 2px no-repeat,
    linear-gradient(var(--frame-strong), var(--frame-strong)) left top / 100% 1px no-repeat;
}
.bn-creed__item > h3 {
  margin: 0 0 var(--space-xs, 10px);
  color: var(--text-head);
  font-family: var(--font-display, inherit);
  font-size: var(--type-h3-size, 28px);
  font-weight: var(--type-h3-weight, 400);
  line-height: var(--type-h3-leading, 1.2);
  letter-spacing: var(--type-h3-tracking, 0);
}
.bn-creed__num {
  display: block;
  margin: 0 0 var(--space-s, 14px);
  color: var(--accent-ink);
  font-size: max(calc(var(--type-h1-size, 40px) * 1.3), calc(var(--type-display-size, 64px) * 0.86));
  line-height: 0.9;
  letter-spacing: var(--type-display-tracking, -0.012em);
  font-variant-numeric: lining-nums proportional-nums;
}
.bn-creed__item > p {
  max-width: 44ch;
  margin: 0;
  color: var(--text);
  font-size: calc(var(--type-body-size, 18px) * 1.2);   /* the beliefs are the page: not smaller than the text around them */
  line-height: 1.5;
}
.bn-creed__mark {
  --bn-el-size: clamp(32px, 3.4vw, 40px);
  margin: 0 var(--space-s, 12px) 0 0;
  color: var(--text-muted);
  vertical-align: middle;
}
/* a long title wraps under its own first word, not under the mark */
.bn-creed__item > h3:has(> .bn-creed__mark) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}
.bn-creed__item > h3:has(> .bn-creed__mark) > .bn-creed__num { grid-column: 1 / -1; }
@container (min-width: 760px) {
  .bn-creed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bn-creed:has(> :last-child:nth-child(odd))::after {
    content: "";
    align-self: center;
    justify-self: center;
    width: clamp(96px, 11vw, 150px);
    aspect-ratio: 1;
    background-color: var(--frame-strong);
    -webkit-mask: url("../ui/elements/oak.svg") center / contain no-repeat;
    mask: url("../ui/elements/oak.svg") center / contain no-repeat;
  }
}

/* ── specimens: engravings laid out like a plate of proofs ─────────────── */
/* <ul class="bn-specimens" aria-hidden="true">
     <li><span class="bn-el bn-el--two"></span></li>… (eight)</ul>
   Four across at every width, square cells, inner hairlines only: no box, no
   corner to round. Decoration, so aria-hidden and no labels. The last-row
   rule assumes a multiple of four. */
.bn-specimens {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 420px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
}
.bn-specimens > li {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background:
    linear-gradient(var(--frame), var(--frame)) right top / 1px 100% no-repeat,
    linear-gradient(var(--frame), var(--frame)) left bottom / 100% 1px no-repeat;
}
.bn-specimens > li:nth-child(4n) { background-size: 0 0, 100% 1px; }
.bn-specimens > li:nth-last-child(-n + 4) { background-size: 1px 100%, 0 0; }
.bn-specimens > li:nth-child(4n):nth-last-child(-n + 4) { background: none; }
.bn-specimens .bn-el { --bn-el-size: clamp(34px, 9vw, 56px); }

/* ── pull line ─────────────────────────────────────────────────────────── */
.bn-pull {
  max-width: 14ch;
  margin: clamp(44px, 6vw, 80px) 0 0;
  padding-top: clamp(22px, 3vw, 36px);
  color: var(--text-head);
  font-family: var(--font-display, inherit);
  font-size: calc(var(--type-display-size, 64px) * 0.8);
  font-weight: var(--type-h1-weight, 400);
  font-stretch: var(--type-h1-width, normal);
  line-height: 1.08;
  letter-spacing: var(--type-display-tracking, -0.012em);
  font-variant-numeric: lining-nums;
  text-wrap: balance;
  background:
    linear-gradient(var(--accent-line), var(--accent-line)) left top / 72px 3px no-repeat,
    linear-gradient(var(--frame-strong), var(--frame-strong)) left top / 100% 1px no-repeat;
}
.bn-page .bn-pull { margin: clamp(44px, 6vw, 80px) 0 0; }   /* beats .bn-page p, which would zero the top gap */
.bn-pull + p { margin-top: var(--space-l, 30px); }

/* ── note ──────────────────────────────────────────────────────────────── */
.bn-note {
  max-width: 62ch;
  color: var(--text);
  font-size: var(--type-body-size, 18px);
  line-height: var(--type-body-leading, 1.6);
}
.bn-page .bn-note { margin-top: var(--space-l, 26px); }

/* ── checklist: the check and close icons ──────────────────────────────── */
/* <ul class="bn-checklist"><li><span class="bn-icon bn-icon--check" aria-hidden="true"></span>Text</li>
   --cross: the close icon (refusals). --wide: two columns under hairlines. */
.bn-checklist {
  display: grid;
  gap: var(--space-xs, 10px);
  margin: var(--space-s, 12px) 0 0;
  padding: 0;
  list-style: none;
  color: var(--text);
}
.bn-checklist > li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--space-xs, 10px);
}
.bn-checklist > li > .bn-icon {
  --bn-icon-size: 20px;
  margin-top: 0.2em;
  color: var(--accent-ink);
}
.bn-checklist--wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(24px, 4vw, 56px);
  margin-top: var(--space-m, 22px);
  /* every row draws the hairline on its top; the list closes the bottom */
  background: linear-gradient(var(--frame), var(--frame)) left bottom / 100% 1px no-repeat;
}
.bn-checklist--wide > li {
  gap: var(--space-s, 14px);
  padding: 18px 0;
  font-size: var(--type-lede-size, 20px);
  line-height: 1.4;
  background: linear-gradient(var(--frame), var(--frame)) left top / 100% 1px no-repeat;
}
.bn-checklist--wide > li > .bn-icon { --bn-icon-size: 24px; margin-top: 0.15em; }

@container (max-width: 700px) {
  .bn-checklist--wide { grid-template-columns: minmax(0, 1fr); }
  .bn-checklist--wide > li { font-size: var(--type-body-size, 18px); }
}
/* figures stand on the line in a list read as statements ("100%") */
.bn-checklist--wide > li { font-variant-numeric: lining-nums; }
/* --rows: the hairline rows of --wide in one column at every width (items of
   very different length, which two columns would leave ragged); the lede size
   holds down to a 520px column */
.bn-checklist--rows { grid-template-columns: minmax(0, 1fr); }
@container (min-width: 520px) {
  .bn-checklist--rows > li { font-size: var(--type-lede-size, 20px); }
}

/* ── deflist: term + explanation rows ──────────────────────────────────── */
/* <dl class="bn-deflist"><div><dt>…</dt><dd>…</dd></div>…</dl>
   a .bn-icon inside the <dt> is set in the accent, before the term */
.bn-deflist { margin: var(--space-l, 24px) 0 0; padding: 0; }
.bn-deflist > div {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  align-items: baseline;
  gap: clamp(12px, 2vw, 28px);
  padding: 20px 0;
  background: linear-gradient(var(--frame), var(--frame)) left top / 100% 1px no-repeat;
}
.bn-deflist > div:last-child {
  background:
    linear-gradient(var(--frame), var(--frame)) left top / 100% 1px no-repeat,
    linear-gradient(var(--frame), var(--frame)) left bottom / 100% 1px no-repeat;
}
.bn-deflist dt {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs, 10px);
  color: var(--text-head);
  font-family: var(--font-display, inherit);
  font-size: var(--type-h4-size, 21px);
  font-weight: var(--font-regular, 400);
  line-height: var(--type-h4-leading, 1.3);
}
.bn-deflist dt > .bn-icon { --bn-icon-size: 20px; align-self: center; color: var(--accent-ink); }
.bn-deflist dd {
  max-width: 62ch;
  margin: 0;
  color: var(--text);
  font-size: var(--type-body-size, 18px);
  line-height: 1.55;
}
@container (max-width: 700px) {
  .bn-deflist > div { grid-template-columns: minmax(0, 1fr); gap: 6px; }
}

/* ── news: source · date, then what it said ────────────────────────────── */
.bn-news { margin: var(--space-l, 24px) 0 0; padding: 0; list-style: none; }
.bn-news > li {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(12px, 2vw, 28px);
  padding: 22px 0;
  background: linear-gradient(var(--frame), var(--frame)) left top / 100% 1px no-repeat;
}
.bn-news > li:last-child {
  background:
    linear-gradient(var(--frame), var(--frame)) left top / 100% 1px no-repeat,
    linear-gradient(var(--frame), var(--frame)) left bottom / 100% 1px no-repeat;
}
.bn-page .bn-news__src,
.bn-news__src {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--accent-ink);
  font-size: var(--type-label-size, 14px);
  font-weight: var(--type-label-weight, 600);
  line-height: var(--type-label-leading, 1.2);
  letter-spacing: var(--type-label-tracking, 0.12em);
  font-variant-caps: var(--type-label-caps, normal);
  text-transform: var(--type-label-transform, uppercase);
  font-variant-numeric: lining-nums;
}
.bn-news__src { align-self: start; min-height: calc(var(--type-lede-size, 20px) * 1.4); }
.bn-news__src > .bn-icon { --bn-icon-size: 16px; align-self: center; }
.bn-page .bn-news__text,
.bn-news__text {
  margin: 0;
  color: var(--text-head);
  font-size: var(--type-lede-size, 20px);
  line-height: 1.4;
}
@container (max-width: 760px) {
  .bn-news > li { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

/* ── price: the content of a price card (inside .bn-panel) ─────────────── */
.bn-price > h3 { margin-bottom: 8px; }
.bn-price p { color: var(--text); }
.bn-page .bn-price__amount,
.bn-price__amount {
  margin: 4px 0 8px;
  color: var(--text-head);
  font-family: var(--font-display, inherit);
  font-size: var(--type-h3-size, 28px);
  font-weight: var(--font-regular, 400);
  line-height: 1.15;
  font-variant-numeric: lining-nums;
}
.bn-page .bn-price__term,
.bn-price__term,
.bn-page .bn-price__amount:not(:has(+ .bn-price__term)),
.bn-price__amount:not(:has(+ .bn-price__term)) {
  margin-bottom: 18px;
  padding-bottom: 18px;
  background: linear-gradient(var(--frame), var(--frame)) left bottom / 100% 1px no-repeat;
}
.bn-page .bn-price__term,
.bn-price__term {
  margin-top: 0;
  color: var(--accent-ink);
  font-size: var(--type-label-size, 14px);
  font-weight: var(--type-label-weight, 600);
  line-height: var(--type-label-leading, 1.2);
  letter-spacing: var(--type-label-tracking, 0.12em);
  font-variant-caps: var(--type-label-caps, normal);
  text-transform: var(--type-label-transform, uppercase);
  font-variant-numeric: lining-nums;
}
/* side by side, a card without a term keeps the term's height so both rules sit level */
@media (min-width: 640px) {
  .bn-grid > .bn-price:not(:has(.bn-price__term)) .bn-price__amount {
    padding-bottom: calc(18px + 8px + 1.2 * var(--type-label-size, 14px));
  }
}
.bn-price .bn-checklist { margin-top: var(--space-s, 16px); }
.bn-price .bn-checklist > li { line-height: 1.45; }

/* ── foot ──────────────────────────────────────────────────────────────── */
.bn-foot {
  padding-block: clamp(36px, 5vw, 56px) 64px;
  color: var(--text-muted);
  font-size: var(--type-small-size, 16px);
  background: linear-gradient(var(--frame), var(--frame))
              center top / calc(100% - 2 * var(--bn-gutter, 16px)) 1px no-repeat;
}
.bn-foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-l, 24px);
  margin: var(--space-s, 12px) 0 0;
  padding: 0;
  list-style: none;
}
.bn-foot__links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--frame-strong);
}
.bn-foot__links a:hover { color: var(--text-head); text-decoration-color: var(--accent-line); }
.bn-foot__links a[aria-current] { color: var(--text-head); text-decoration-color: var(--accent-line); }
.bn-foot__links .bn-icon { --bn-icon-size: 18px; }

/* ── reveal: what starts below the first screen eases in once ──────────── */
.bn-reveal { opacity: 0; transform: translateY(10px); transition: opacity .6s ease-out, transform .6s ease-out; }
.bn-reveal.is-in { opacity: 1; transform: none; }

/* ── reduced motion: no plate fade, no swarm, no reveal ────────────────── */
@media (prefers-reduced-motion: reduce) {
  .bn-medallion__disc { animation: none; }
  .bn-swarm { display: none; }
  .bn-navlink { transition: none; }
}
@media (prefers-reduced-motion: reduce), print {
  .bn-reveal { opacity: 1; transform: none; transition: none; }
}
/* ============================================================================
   Bonithena — the two public pages: page layout only.
   Every visual comes from the UI package (design/ui: bn-* classes, its icons,
   engraving elements and frames); fonts and sizes from the type layer
   (design/css/type.css). This file only sets the page width, the gutters and
   the few gaps between package pieces. No colour, no font size, no shadow, no
   radius, no asset URL: if a page needs a new visual, it goes into the package.

   Dark is the standard: <html data-surface="invert">, the package's own dark
   scope; the switch removes it. The firm's accent is the oak green, set with
   <html data-season="ordinary"> — also a package switch, nothing redefined here.
   ========================================================================== */

:root {
  --bn-page-max: 1180px;
  --bn-gutter: clamp(16px, 4vw, 40px);
  --bn-grid-gap: clamp(16px, 3vw, 32px);
  --site-head: 64px;            /* the sticky masthead, for anchor jumps */
}

html { scroll-padding-top: calc(var(--site-head) + var(--space-s)); }
@media (max-width: 720px) {
  html { scroll-padding-top: var(--space-s); }   /* the masthead scrolls away on a phone */
}

/* the two price cards sit a step below the heading */
.site-prices { margin-top: var(--space-l); }

/* 404: the one block sits lower on the screen */
.site-404 { padding-block: 14vh var(--space-2xl); }
