/* www.cfos.de — the ONE stylesheet.
   Re-theme by editing the tokens in :root, not the component rules.
   No dark theme (MIGRATION-PLAN D22). RTL via logical properties only.
   Layers, lowest to highest priority: reset, tokens, base, layout, components, legacy. */

@layer reset, tokens, base, layout, components, legacy;

/* ═════════════════════════════════════════════════════════════════════ tokens */
@layer tokens {
  :root {
    /* Fonts: the live site uses no web font, only this system stack
       (cfos-bootstrap.css, --font-family-sans-serif / -monospace). */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
      sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    /* Page colours: from the live site (cfos-bootstrap.css). */
    --bg: #ffffff;               /* body */
    --ink: #212529;              /* body text */
    --muted: #5a6169;            /* live #6c757d darkened: 4.5:1 also on --surface-2 */
    --line: #dee2e6;             /* table / card borders */
    --surface: #ffffff;
    --surface-2: #f8f9fa;        /* light panels, th, code */
    --footer-bg: #f5f5f5;        /* live .footer */
    --footer-line: #808080;      /* live .footer border-top */
    --link: #0062cc;             /* live #007bff is 4.0:1 on white (fails AA); live hover is #0056b3 */
    --link-hover: #0056b3;
    --accent: #fd7e14;           /* the cFos orange (--cfos, logo swoosh): decoration only, 2.6:1 as text */
    --accent-ink: #9a4600;       /* orange that passes 4.5:1 as text on white */
    --accent-tint: #fff1e6;
    --button: #fd7e14;           /* the live cFos orange (owner, D68); white on it would be 2.6:1, */
    --button-hover: #e96b02;     /* so the text is near-black: 6.8:1, hover 5.4:1 (WCAG AA) */
    --on-button: #1a1a1a;
    --badge: #1e7e34;            /* live badge-success #28a745 under white text is 3.1:1 -> its darker shade, 5:1 */
    --on-badge: #ffffff;
    --tint: #e7f0fb;             /* hover on light surfaces, .band, .note */
    --focus: #0062cc;
    --shadow: 0 .5rem 1.5rem rgb(33 37 41 / .2);
    --shadow-up: 0 -.25rem 1rem rgb(0 0 0 / .2);        /* phone bottom nav */
    --art-shadow: drop-shadow(0 .25rem .5rem rgb(0 0 0 / .4)); /* hero product boxes */

    /* Header: classic cFos blue (D19). The live 2018-2026 header is a dark
       photo (images/2018/speed-dial-dark.jpg, ~#0b1220), not a flat colour;
       #003399 is the cFos blue of the earlier site (css/cfos.11.x headings),
       chosen in D19. Change --blue to switch. */
    --blue: #003399;
    --blue-hi: #3366cc;          /* highlight of the current group (colour only) */
    --on-blue: #ffffff;
    --on-blue-muted: rgb(255 255 255 / .85);
    --hover-on-blue: rgb(255 255 255 / .12);
    /* index hero (wide screens): picture behind the whole header, darkened by the scrim.
       Relative URL: resolved against this stylesheet, so it also works under /test/. */
    --hero-image: url("../img/hero-bg.webp");
    --hero-scrim: none;   /* Ingo's dark network grid (D53) needs no darkening, as in his demo */
    --hero-text-shadow: 0 .0625rem .25rem rgb(0 0 0 / .7);   /* text over the picture */
    --focus-on-blue: #ffffff;

    /* scale */
    --r: .375rem;                /* radius, as the live cards/buttons (.25rem) but a touch softer */
    --r-lg: .75rem;
    /* width caps (house rule: maximized windows don't stretch the page).
       --page: one centred column for header content, main and footer;
       --measure: readable line length = the width of ALL body content (main, D60);
       header (--header-page) and footer (--page) are wider. */
    --page: 64rem;
    --header-page: 84rem;        /* the header's content is wider than main (Ingo's demo, D57) */
    --measure: 50rem;            /* was 42.5rem; owner D61 */
    --gutter: 1rem;
    --gap: 1.5rem;
    --touch: 2.75rem;            /* minimum target size */
    --side-heading: 1.25rem;     /* h2 in a sidebar / heading inside a table cell: below the content h3 */
    --media-pic: 12rem;          /* max picture width of a .media-row / stacked .media-start */
    --float-box: 21.25rem;       /* picture + caption float box (legacy width: 340px) */
    --ref-key: 15rem;            /* key column of a .ref table (longest scripting identifiers fit) */
    --logo-h: 6.25rem;           /* max height of a .logos cell picture (legacy 250x100 logo cells) */
    --logo-gap: 1rem;            /* gutter between .logos cells (legacy img.m-3) */
    --shot-before: 2.5rem;       /* space above a step screenshot (p.shot) */
    --shot-after: .75rem;        /* space between a screenshot and its step text */
    --brand-gap: 1.25rem;        /* space above a brand heading after a link list */
  }
}

/* ═════════════════════════════════════════════════════════════════════ reset */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
  img, svg, video, canvas { max-inline-size: 100%; block-size: auto; }
  img { vertical-align: middle; }
  input, button, textarea, select { font: inherit; }
  [hidden] { display: none !important; }
}

/* ═════════════════════════════════════════════════════════════════════ base */
@layer base {
  body {
    font: 1rem/1.5 var(--font);
    background: var(--bg);
    color: var(--ink);
    min-block-size: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-wrap: break-word;
  }
  h1, h2, h3, h4, h5, h6 { font-weight: 500; line-height: 1.2; text-wrap: balance; margin-block: 1.5em .5em; }
  /* D63: smaller maxima (h1 2.5 → 2.125rem, h2 2 → 1.625, h3 1.5 → 1.3): every page now shows
     its SEO title as h1 (D62) in a 50rem column; phone sizes (the minima) unchanged */
  h1 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.125rem); margin-block-start: 0; }
  h2 { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.625rem); }
  h3 { font-size: clamp(1.2rem, 1.1rem + .4vw, 1.3rem); }
  h4 { font-size: 1.2rem; }
  h5, h6 { font-size: 1rem; font-weight: 600; }
  p, ul, ol, dl, table, pre, blockquote, figure { margin-block: 0 1rem; }
  ul, ol { padding-inline-start: 1.5rem; }
  li + li { margin-block-start: .25rem; }
  dt { font-weight: 600; }
  dd { margin-inline-start: 1.5rem; margin-block-end: .5rem; }
  hr { border: 0; border-block-start: 1px solid var(--line); margin-block: 2rem; }
  small { font-size: .875em; }
  strong, b { font-weight: 600; }

  a { color: var(--link); text-underline-offset: .15em; }
  a:hover { color: var(--link-hover); }
  :focus-visible { outline: .1875rem solid var(--focus); outline-offset: .125rem; border-radius: .125rem; }

  code, kbd, samp, pre { font-family: var(--font-mono); font-size: .9em; }
  /* code is always LTR, also inside RTL pages: no bidi reordering of
     console output or syntax, isolated from the surrounding RTL text */
  code, kbd, samp, pre { direction: ltr; unicode-bidi: isolate; }
  code { background: var(--surface-2); padding: .1em .3em; border-radius: .25rem; }
  pre {
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
    padding: .75rem 1rem; overflow-x: auto; line-height: 1.45;
  }
  pre code { background: none; padding: 0; }
  /* a key / command chip as live (Bootstrap kbd: dark chip, light text), so
     the padding reads as the chip, not as spaces inside quotes */
  kbd { border-radius: .25rem; padding: .1em .35em; background: var(--ink); color: var(--bg); }
  /* a placeholder the reader replaces (<username>, <script url> … D31):
     monospace italic like a code parameter (same size as code, not smaller
     again inside pre/code); direction from its own text, isolated from the
     surrounding (RTL) text */
  var { font-family: var(--font-mono); font-size: .9em; font-style: italic; unicode-bidi: plaintext; }
  :where(pre, code, kbd, samp) var { font-size: 1em; }

  blockquote { border-inline-start: .25rem solid var(--line); padding-inline-start: 1rem; color: var(--muted); }

  /* tables: generic, as the live .table; wide ones scroll inside .table-wrap */
  table { border-collapse: collapse; inline-size: 100%; }
  caption { caption-side: bottom; color: var(--muted); padding-block: .5rem; text-align: start; }
  th, td { padding: .5rem .75rem; border-block-end: 1px solid var(--line); text-align: start; vertical-align: top; }
  thead th { border-block-end-width: 2px; }
  th { background: var(--surface-2); font-weight: 600; }

  .sr-only {
    position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
  .skip {
    position: absolute; inset-inline-start: .5rem; inset-block-start: -10rem; z-index: 100;
    background: var(--surface); color: var(--link); padding: .5rem 1rem; border-radius: var(--r); box-shadow: var(--shadow);
  }
  .skip:focus { inset-block-start: .5rem; }
  .sprite { position: absolute; inline-size: 0; block-size: 0; overflow: hidden; }
  .icon {
    inline-size: 1.5rem; block-size: 1.5rem; flex: none; fill: none; stroke: currentColor;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  }
}

/* ═════════════════════════════════════════════════════════════════════ layout */
@layer layout {
  main {
    flex: 1;
    /* ALL body content keeps the readable measure, centred (owner, D60): text, headings,
       grids, tables, code, cards. Wide tables scroll inside .table-wrap; grids use
       container queries and simply get fewer columns. Header (--header-page) and
       footer (--page) stay wider. */
    inline-size: min(100% - 2 * var(--gutter), var(--measure));
    margin-inline: auto;
    padding-block: 2rem 3rem;
  }
  .frozen, .prose { container-type: inline-size; }
}

/* ═════════════════════════════════════════════════════════════════════ components */
@layer components {

  /* ── header: ONE blue area — logo, three groups, language switch (D19) ── */
  .site-header {
    position: relative;
    z-index: 20;
    display: grid;
    /* equal side columns: the three groups sit centred on the bar (owner,
       2026-11-11); phones and the index hero set their own layout below */
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "brand groups lang";
    align-items: center;
    column-gap: 1rem;
    /* full-bleed blue; content capped at --header-page (wider than main's --page: on
       large screens a --page header was too narrow, Ingo's demo, D57) */
    padding-inline: max(var(--gutter), (100% - var(--header-page)) / 2 + var(--gutter));
    /* the hero picture behind every header, not only the index (owner, D59); --blue
       underneath while it loads */
    background: var(--hero-image) center 22% / cover no-repeat, var(--blue);
    color: var(--on-blue);
  }
  .site-header :focus-visible { outline-color: var(--focus-on-blue); }
  .brand {
    grid-area: brand;
    justify-self: start;
    display: inline-flex; align-items: center;
    min-block-size: var(--touch);
    padding-block: .25rem;
  }
  .brand img { inline-size: 8.125rem; block-size: auto; }
  .context { grid-area: context; display: none; }

  .groups-nav { grid-area: groups; }
  .groups {
    list-style: none; margin: 0; padding: 0;
    display: flex; gap: .25rem;
    justify-content: center;
  }
  .groups > li { margin: 0; }
  .group { position: relative; }

  /* <details> disclosure: no native marker */
  .disclosure > summary { list-style: none; }
  .disclosure > summary::-webkit-details-marker { display: none; }

  /* a group: pictogram + text (the hero adds tagline + picture) */
  .group > a, .group summary {
    display: flex; align-items: center; gap: .6rem;
    inline-size: 100%;
    min-block-size: 3.25rem;
    padding: .35rem .9rem;
    border-radius: var(--r-lg);
    color: var(--on-blue);
    text-decoration: none; cursor: pointer;
    user-select: none;
  }
  .group > a:hover, .group summary:hover { background: var(--hover-on-blue); color: var(--on-blue); }
  .group [aria-current] { background: var(--blue-hi); }     /* highlight = colour only */
  .group .head { display: flex; align-items: center; gap: .6rem; justify-content: center; }   /* centred: Ingo, D59 */
  .group .text { display: grid; line-height: 1.2; }
  .group .label { font-weight: 600; }
  .group .sub { font-size: .8rem; color: var(--on-blue-muted); }
  .group .chev { inline-size: 1rem; block-size: 1rem; }
  .disclosure[open] > summary .chev { rotate: 180deg; }
  .group .tagline, .group .art { display: none; }
  .xlang { font-weight: 400; font-size: .8em; opacity: .9; }

  /* language switch: small, far corner */
  .lang { grid-area: lang; position: relative; justify-self: end; }
  .lang > summary {
    display: inline-flex; align-items: center; gap: .25rem; justify-content: center;
    min-inline-size: var(--touch); min-block-size: var(--touch); padding: 0 .4rem;
    border-radius: var(--r-lg);
    color: var(--on-blue-muted); font-size: .8rem; cursor: pointer;
  }
  .lang > summary:hover, .lang[open] > summary { background: var(--hover-on-blue); color: var(--on-blue); }
  .lang .icon { inline-size: 1.25rem; block-size: 1.25rem; }

  /* dropdown menus (Classics, language) */
  .menu {
    position: absolute; z-index: 30;
    inset-block-start: calc(100% + .25rem);
    inset-inline-start: 0;
    min-inline-size: 17rem;
    max-inline-size: calc(100vw - 1rem);
    margin: 0; padding: .35rem; list-style: none;
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow);
  }
  .menu li { margin: 0; }
  .menu a {
    display: flex; align-items: center; flex-wrap: wrap; gap: 0 .35rem;
    min-block-size: var(--touch);
    padding: .5rem .8rem; border-radius: var(--r);
    color: var(--ink); text-decoration: none;
  }
  .menu a:hover { background: var(--tint); color: var(--ink); }
  .menu a[aria-current] { background: var(--blue-hi); color: var(--on-blue); }
  .site-header .menu :focus-visible { outline-color: var(--focus); }
  .lang .menu {
    inset-inline-start: auto; inset-inline-end: 0;
    min-inline-size: 12rem;
    max-block-size: min(26rem, 70dvh); overflow-y: auto;
  }

  /* index, wide: the header IS the hero — groups side by side, bigger (D19/D20) */
  @media (width >= 40rem) {
    .is-home .site-header {
      grid-template-columns: 1fr auto;
      grid-template-areas: "brand lang" "groups groups";
      padding-block: .5rem 1.5rem;
      /* the hero picture replaces the blue (owner, 2026-11-16); --blue stays underneath
         while it loads; the scrim keeps the white text readable on the bright parts */
      background: var(--hero-scrim), var(--hero-image) center 22% / cover no-repeat, var(--blue);
      text-shadow: var(--hero-text-shadow);
    }
    .is-home .site-header .menu { text-shadow: none; }   /* the Classics menu is a white panel */
    .is-home .groups {
      display: grid; grid-template-columns: 1fr 1.7fr 1fr; gap: 1rem;
      align-items: center;
      margin: 0;
    }
    .is-home .group > a, .is-home .group summary {
      flex-direction: column; align-items: stretch; justify-content: flex-start; gap: .75rem;
      padding: 1.25rem; border-radius: 1.25rem;
    }
    .is-home .group [aria-current] { background: transparent; }   /* the hero highlights nothing */
    .is-home .group [aria-current]:hover { background: var(--hover-on-blue); }
    .is-home .group .icon { inline-size: 2rem; block-size: 2rem; }
    .is-home .group .label { font-size: 1.5rem; font-weight: 700; }
    .is-home .group-analyzer .label { font-size: 2.25rem; letter-spacing: -.02em; }
    .is-home .group-analyzer > a { padding: 1.75rem; }
    .is-home .group .tagline { display: block; font-size: .95rem; line-height: 1.4; color: var(--on-blue-muted); text-align: center; }
    .is-home .group-analyzer .tagline { font-size: 1.1rem; }
    .is-home .group .chev { inline-size: 1.25rem; block-size: 1.25rem; }
    .is-home .group .art { display: block; }
    .is-home .art > * { display: block; inline-size: 100%; block-size: auto; }
    .is-home .art .art-ping { inline-size: 70%; margin-inline: auto; }   /* as in Ingo's demo */
    .is-home .group-classics .art { display: flex; justify-content: center; align-items: end; }
    .is-home .group-classics .art img {
      inline-size: 32%; max-inline-size: 7rem; margin-inline: .25rem;   /* Ingo's demo: side by side, no overlap */
      filter: var(--art-shadow);
    }
    .is-home .group-classics .art img:nth-child(2) { inline-size: 36%; max-inline-size: 8rem; z-index: 1; }
    /* the menu opens right under the "Classics" heading, inside its card */
    .is-home .group-classics .menu {
      inset-block-start: 3.75rem; inset-inline: .75rem;
      min-inline-size: 0; max-inline-size: none;
    }
  }

  /* phones: thin top strip + bottom navigation, every page incl. the index (D19) */
  @media (width < 40rem) {
    .site-header {
      grid-template-columns: auto 1fr auto;
      grid-template-areas: "brand context lang";
      column-gap: .5rem;
      padding-inline: .75rem;
      min-block-size: 3.25rem;
      position: sticky; inset-block-start: 0;
    }
    .brand img { inline-size: 6.5rem; }
    .context {
      display: block; min-inline-size: 0;
      font-weight: 600; font-size: .85rem; line-height: 1.2; text-align: center;
    }
    .groups {
      position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 25;
      margin: 0; padding: 0 0 env(safe-area-inset-bottom);
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
      background: var(--blue);
      box-shadow: var(--shadow-up);
    }
    .group > a, .group summary {
      flex-direction: column; justify-content: center; gap: .15rem;
      min-block-size: 3.75rem; padding: .4rem .25rem; border-radius: 0; text-align: center;
    }
    .group .head { flex-direction: column; gap: .15rem; }
    .group .text { justify-items: center; }
    .group .label { font-size: .78rem; }
    .group .sub, .group .chev { display: none; }   /* the program name is in the top strip (.context) */
    .group-classics .menu {                          /* opens upwards */
      inset-block-start: auto; inset-block-end: calc(100% + .25rem);
      inset-inline-start: auto; inset-inline-end: .25rem;
      min-inline-size: min(17rem, 100vw - .5rem);
    }
    body { padding-block-end: calc(4.25rem + env(safe-area-inset-bottom)); }
  }

  /* ── hint bar (D14): offers the visitor's language, never redirects ── */
  .hint-bar { background: var(--tint); border-block-end: 1px solid var(--line); text-align: center; }
  .hint-bar p { margin: 0; padding: .4rem 1rem; }
  .hint-bar a { display: inline-block; padding-block: .35rem; font-weight: 600; }

  /* ── Analyzer subnav ── */
  .subnav ul { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
  .subnav li { margin: 0; }
  .subnav a {
    display: inline-flex; align-items: center; gap: .3rem; min-block-size: 2.5rem; padding: 0 .9rem;
    border-radius: 99rem; background: var(--surface); border: 1px solid var(--line);
    color: var(--ink); text-decoration: none;
  }
  .subnav a:hover { background: var(--tint); color: var(--ink); }
  .subnav a[aria-current] { background: var(--blue-hi); border-color: var(--blue-hi); color: var(--on-blue); }

  /* ── Analyzer page (D49): sections with a pictogram, download call-to-action, specs ── */
  .product-logo { margin-block: 0 1rem; }
  .product-logo img { display: block; inline-size: min(17.25rem, 100%); block-size: auto; }
  .topic { margin-block-start: 2.5rem; }
  .topic > h2, .topic > summary > h2 { display: flex; align-items: center; gap: .75rem; margin-block: 0 .75rem; }

  /* collapsible topic (D51): the heading row is the toggle */
  .topic-more > summary { list-style: none; cursor: pointer; border-radius: var(--r); }
  .topic-more > summary::-webkit-details-marker { display: none; }
  .topic-more:not([open]) > summary > h2 { margin-block-end: 0; }
  .topic-more > summary:hover .toggle-hint { color: var(--link-hover); text-decoration: underline; }
  .toggle-hint {
    display: inline-flex; align-items: center; gap: .25rem; margin-inline-start: auto;
    font-size: .9rem; font-weight: 400; color: var(--link); white-space: nowrap;
  }
  .toggle-hint .chev { inline-size: 1.25rem; block-size: 1.25rem; }
  .topic-more[open] .toggle-hint .chev { transform: rotate(180deg); }
  .topic-more[open] .when-closed, .topic-more:not([open]) .when-open { display: none; }
  .topic-icon {
    inline-size: 2.75rem; block-size: 2.75rem; padding: .5rem;
    border-radius: 50%; background: var(--tint); color: var(--blue); stroke-width: 1.6;
  }
  /* wide: the pictogram hangs in the margin, heading and text share one edge */
  @container (width >= 40rem) {
    .topic { padding-inline-start: 3.5rem; }
    .topic > h2, .topic > summary > h2 { margin-inline-start: -3.5rem; }
  }
  .cta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-block: 1.5rem; }
  .button-download .icon { inline-size: 1.25rem; block-size: 1.25rem; }
  .pending-note { color: var(--muted); }
  /* "New" / "Beta" labels (D58): fixed size, so they look the same in the hero label,
     an h1 and next to a button */
  .pill {
    display: inline-block; vertical-align: middle;
    padding: .15rem .55rem; border-radius: 999px;
    font-size: .75rem; font-weight: 700; line-height: 1.3; letter-spacing: .04em;
    text-transform: uppercase; text-shadow: none; white-space: nowrap;
  }
  .pill-new { background: var(--accent); color: #1a1a1a; }          /* 6.8:1 on the orange */
  .pill-beta { background: var(--accent-tint); color: var(--accent-ink); border: 1px solid var(--accent-ink); }
  /* a pill in front of a heading's text sits a little lower than the cap height */
  h1 > .pill:first-child { margin-inline-end: .35rem; vertical-align: .35em; }

  .specs {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 1rem;
    padding: 0;
  }
  .specs > div { padding: .75rem 1rem; border: 1px solid var(--line); border-block-start: .25rem solid var(--accent); border-radius: var(--r); }
  .specs dt { margin-block-end: .25rem; }
  .specs dd { margin: 0; }
  /* the pictogram stands in for a product box picture (OEM page, D49) */
  .oem-pic { display: block; inline-size: 5rem; block-size: auto; margin-block-end: .75rem; }


  /* ── footer (D23) ── */
  .site-footer {
    padding-block: 1.25rem 1.5rem;
    padding-inline: max(var(--gutter), (100% - var(--page)) / 2);
    background: var(--footer-bg); border-block-start: 1px solid var(--footer-line);
    text-align: center; font-size: .9rem;
  }
  .site-footer p { margin: 0 0 .5rem; }
  .site-footer a { color: var(--muted); display: inline-block; padding-block: .3rem; }
  .site-footer a:hover { color: var(--ink); }
  .site-footer .motto { margin: 0; color: var(--muted); text-wrap: balance; }

  /* ── language list (404 pages; the root chooser page was removed in D52) ── */
  .language-list {
    list-style: none; padding: 0;
    display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(14rem, 100%), 1fr));
  }
  .language-list li { margin: 0; }
  .language-list a {
    display: flex; align-items: center; gap: .6rem; min-block-size: var(--touch); padding: .5rem .9rem;
    border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink);
  }
  .language-list a:hover { background: var(--tint); }
  .language-list .code { font: 600 .75rem var(--font-mono); color: var(--muted); min-inline-size: 3.5rem; }

  @media (prefers-reduced-motion: no-preference) {
    .group > a, .group summary, .menu a, .lang > summary, .subnav a { transition: background-color .15s; }
    .group .chev { transition: rotate .15s; }
    .toggle-hint .chev { transition: transform .15s; }
  }
}

/* ═════════════════════════════════════════════════════════════════════ legacy
   The class vocabulary of frozen bodies (contract with tools/freeze) — and the
   same classes are free to use in Tier B Markdown. */
@layer legacy {
  .frozen > :first-child { margin-block-start: 0; }
  .frozen img { block-size: auto; }
  /* contain .media-start floats inside their former card/column. Zero
     specificity: every component class below (.cols, .split, .media-row …)
     must win with its own display (r1: this rule had silently turned every
     grid into a single column) */
  :where(.frozen) div { display: flow-root; }
  /* sub-heading rows inside a table (was td.green) */
  th[scope="colgroup"] { background: var(--tint); }

  /* framed panel (was .card.border-cfos / .card / div.box): live orange frame */
  .box {
    background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r);
    padding: 1.25rem; margin-block: 0 var(--gap);
  }
  .box > :last-child { margin-block-end: 0; }
  .box > :first-child { margin-block-start: 0; }
  /* a box of running text hugs its text, so the
     frame has no empty right half; boxes holding a grid or table stay full width */
  .box:not(:has(.table-wrap, .cols, .media-row, .split)) { inline-size: fit-content; max-inline-size: 100%; }
  /* a box that only frames a table: one frame, the table fills it */
  .box:has(> .table-wrap:only-child) { padding: 0; overflow: hidden; }
  .box > .table-wrap:only-child { margin: 0; }
  /* OEM page (D50, owner): the boxes stack, each full width; .cols keeps its
     columns on every other page. In this layer, so it wins over .cols / .box. */
  .frozen[data-page-key="oem/oem"] .cols { display: block; }
  .frozen[data-page-key="oem/oem"] .box { inline-size: auto; }
  .frozen[data-page-key="oem/oem"] .cols > * { margin-block: 0 var(--gap); }
  /* one gap between stacked blocks, also before "OEM-Partner" (D51): no
     second margin from the last box of a column or the heading's own top margin */
  .frozen[data-page-key="oem/oem"] .cols > div > .box:last-child { margin-block-end: 0; }
  .frozen[data-page-key="oem/oem"] .cols > div > h2:first-child { margin-block-start: 0; }
  th > :is(h1, h2, h3, h4) { margin: 0; font-size: var(--side-heading); }

  /* responsive grid of its children (was .row + .col-*) */
  .cols {
    display: grid; gap: var(--gap); margin-block: 0 var(--gap);
    grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
    align-items: start;
  }
  .cols > * { min-inline-size: 0; margin-block: 0; }
  .cols > .box { block-size: 100%; }

  /* tinted block (was .row.parallax / .info-bar): inside the content column like every
     other box, no full-bleed background (owner, D61) */
  .band {
    background: var(--tint); border-radius: var(--r);
    padding: 1.5rem 1.25rem; margin-block: 0 var(--gap);
  }
  .band > :last-child { margin-block-end: 0; }
  /* the legacy band lay over a dark photo, so its pictograms are white line art
     (stop-watch-white.png): give them a cFos-blue tile so they stay visible */
  .band > .media-start { background: var(--blue); padding: .5rem; border-radius: var(--r); line-height: 0; inline-size: fit-content; }

  /* link styled as the orange cFos button (was .btn-cfos); may hold a <br> two-line label */
  .button {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    min-inline-size: 10em; min-block-size: var(--touch); padding: .375rem 1rem;
    border: 1px solid var(--button); border-radius: var(--r);
    background: var(--button); color: var(--on-button); font-weight: 700; text-decoration: none; text-align: center;
    line-height: 1.3;
  }
  .button:hover { background: var(--button-hover); border-color: var(--button-hover); color: var(--on-button); }
  /* a download whose file is not uploaded yet (D49): looks like a button, is not one */
  .button.is-pending { background: var(--surface-2); border-color: var(--line); color: var(--muted); cursor: default; }
  /* D71: a dated release before its moment: the orange button, not yet clickable (no href) */
  .button[aria-disabled="true"], .button[aria-disabled="true"]:hover { background: var(--button); border-color: var(--button); cursor: default; }
  .release-note { color: var(--muted); }

  /* small pill (was .badge-success "Freeware", numbered step pills) */
  .badge {
    display: inline-block; padding: .15rem .6rem; border-radius: 99rem;
    background: var(--badge); color: var(--on-badge);
    font-size: .8rem; font-weight: 600; line-height: 1.4; vertical-align: middle;
  }

  .lead { font-size: 1.25rem; font-weight: 300; }

  .note {
    padding: .75rem 1rem; margin-block: 0 var(--gap);
    background: var(--tint); border-inline-start: .25rem solid var(--blue-hi); border-radius: var(--r);
  }
  .note > :last-child { margin-block-end: 0; }

  /* list with check marks (was fa-check icons) */
  .checklist { list-style: none; padding-inline-start: 0; }
  .checklist > li { position: relative; padding-inline-start: 1.75rem; }
  .checklist > li::before {
    content: "✓" / "";
    position: absolute; inset-inline-start: 0; inset-block-start: 0;
    color: var(--accent-ink); font-weight: 700;
  }

  /* image beside the text at the inline end; stacked when the column is narrow */
  .media-end {
    float: inline-end; clear: inline-end;
    max-inline-size: 40%;
    margin-inline-start: var(--gap); margin-block: 0 1rem;
  }
  @container (width < 30rem) {
    .media-end { float: none; display: block; max-inline-size: 100%; margin-inline: auto; }
  }
  .frozen::after, .prose::after { content: ""; display: block; clear: both; }

  /* image at the inline START (product boxes beside the h1); stacked when narrow */
  .media-start {
    float: inline-start;
    max-inline-size: 40%;
    margin-inline-end: var(--gap); margin-block: 0 1rem;
  }
  /* picture + caption floating as one box (was div.pull-left style="width: 340px") */
  div.media-start { inline-size: var(--float-box); }
  @container (width < 30rem) {
    .media-start { float: none; display: block; max-inline-size: min(100%, var(--media-pic)); margin-inline: auto; }
    div.media-start { inline-size: auto; max-inline-size: 100%; }
  }

  /* picture beside a text column (was card flex-md-row + card-img, or a float
     closed by clear:left): two columns, the text never wraps under the picture */
  .media-row { display: grid; gap: var(--gap); margin-block: 0 var(--gap); align-items: start; }
  .media-row > * { min-inline-size: 0; }
  .media-row > :first-child { justify-self: center; max-inline-size: min(100%, var(--media-pic)); margin: 0; }
  .media-row > div > :first-child { margin-block-start: 0; }
  .media-row > div > :last-child { margin-block-end: 0; }
  .media-row h1 + h2 { margin-block-start: .25rem; }
  @container (width >= 30rem) {
    .media-row { grid-template-columns: auto 1fr; }
    .media-row > :first-child { max-inline-size: none; }
  }

  /* main part + former side column (was .col-md-8 / .col-md-4): stacked, the side
     column's items follow the main content at full width (owner, D64) */
  .split { display: grid; gap: var(--gap); margin-block: 0 var(--gap); }
  .split > * { min-inline-size: 0; }
  .split > * > :first-child { margin-block-start: 0; }

  /* list flowing in columns (was ul inside .col-* side by side, column-count: 4) */
  .multicol { columns: 8rem 4; column-gap: var(--gap); list-style: none; padding-inline-start: 0; }
  .multicol > li { break-inside: avoid; }

  /* short link list in one column, no bullets (per-brand router lists): looks
     like a .multicol that is too short to wrap into columns */
  .links { list-style: none; padding-inline-start: 0; }
  /* brand heading + its link list read as one unit (port-forwarding hub: 172
     brand sections, live ~80px each): list close to its heading, less space
     before the next brand */
  .frozen h2 + :is(ul.links, ul.multicol) { margin-block-start: -.25rem; }
  .frozen :is(ul.links, ul.multicol) + h2 { margin-block-start: var(--brand-gap); }

  /* step screenshot (a <p> of one large picture): the step text belongs to the
     picture above it — little space below the picture, more above it (live:
     ~30px picture → text, ~70-85px text → next picture) */
  .frozen p.shot { margin-block-end: var(--shot-after); }
  .frozen p.shot:not(:first-child) { margin-block-start: var(--shot-before); }

  /* legacy definition lists (x31 "Example 1:", diagram texts): no indent, as
     live (Bootstrap reboot dd { margin-left: 0 }) */
  .frozen dd { margin-inline-start: 0; }

  /* row of picture links (server logos): equal cells with gutters, pictures
     centred and scaled down; 2 per row on phones, 4 from 36rem */
  .logos {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--logo-gap); align-items: center; justify-items: center;
  }
  .logos > a { display: block; }
  .logos img { display: block; max-inline-size: 100%; block-size: auto; max-block-size: var(--logo-h); object-fit: contain; }
  @container (width >= 36rem) {
    .logos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }

  /* list item without check mark: a plain bullet, aligned with the check items */
  .checklist > li.plain::before { content: "•" / ""; color: var(--ink); }
  li.plain { list-style: none; }

  /* a row of buttons: gaps also when they wrap */
  .buttons { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: stretch; }
  .buttons > .button { max-inline-size: 100%; }

  /* wide tables (and anything wide) scroll inside, never the page */
  .table-wrap { overflow-x: auto; margin-block: 0 var(--gap); max-inline-size: 100%; }
  .table-wrap > table { margin-block-end: 0; }

  /* key | description tables: one key-column width on the whole page;
     on narrow containers each row stacks (key above its description) */
  /* wide: the key column grows to fit the longest signature (no break inside
     an identifier like content_type_from_ext(filename)); stacked below 36rem */
  table.ref > * > tr > td:first-child { inline-size: var(--ref-key); overflow-wrap: normal; word-break: normal; }
  @container (width < 36rem) {
    table.ref, table.ref > *, table.ref > * > tr, table.ref > * > tr > :is(td, th) { display: block; }
    table.ref > * > tr > td:first-child { inline-size: auto; border-block-end: 0; padding-block-end: 0; font-weight: 600; }
    table.ref > * > tr > :is(td, th) { padding-inline: .5rem; }
    .box:has(> .table-wrap:only-child) { padding: 0; }
    pre { padding: .5rem; }
  }

  .figure, figure { margin-inline: 0; }
  .figure { display: table; max-inline-size: 100%; margin-block: 0 var(--gap); }
  .figure img { display: block; }
  figure.figure { margin-inline: auto; }   /* a stand-alone picture is centred in the column (owner) */
  figcaption { font-size: .875rem; color: var(--muted); padding-block-start: .4rem; }
}

/* download page (D32) — src/content/download/download.njk + components/download-card.njk.
   A grid of product cards; each grid cell is a container, so a card lays
   itself out by its own width (the wide cFosSpeed card puts the Atlas notice
   beside its text). */
@layer components {
  .prose > .dl-cards {
    list-style: none; padding: 0; margin-block: 0 var(--gap); max-inline-size: none;
    display: grid; gap: var(--gap);
    grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr));
  }
  .dl-cards > li { margin: 0; display: grid; container-type: inline-size; min-inline-size: 0; }
  .dl-cards > li:has(> .dl-wide) { grid-column: 1 / -1; }

  .dl-card {
    display: flex; flex-direction: column;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--line); border-block-start: .25rem solid var(--accent); border-radius: var(--r);
  }
  .dl-card > * { margin-block: 0 1rem; }
  .dl-card > :last-child { margin-block-end: 0; }

  .dl-head { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
  .dl-head:not(:has(img)) { grid-template-columns: minmax(0, 1fr); } /* cards without a picture (cFosICS, cFos Bark) */
  .dl-head img { inline-size: 4.5rem; filter: var(--art-shadow); }
  .dl-head h2 { margin: 0 0 .25rem; font-size: 1.5rem; }
  .dl-head h2 .badge { margin-inline-start: .25rem; }
  .dl-tagline { margin: 0; color: var(--muted); }

  .dl-notice h3 { margin-block: 0 .5rem; font-size: 1.2rem; }
  .dl-notice p { margin-block-end: .5rem; }
  .dl-meta { font-size: .9rem; color: var(--muted); }

  .dl-files { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; }
  .dl-files > li { margin: 0; display: grid; gap: .25rem; justify-items: start; }
  .dl-files .button { max-inline-size: 100%; }
  .dl-file { color: var(--muted); }
  .dl-file bdi { overflow-wrap: anywhere; }
  .dl-size { white-space: nowrap; }

  .dl-links { padding-inline-start: 1.25rem; }
  .dl-beta { padding-inline-start: 1.25rem; margin-block: .25rem 0; }

  .dl-older { border-block-start: 1px solid var(--line); padding-block-start: .75rem; }
  .dl-older h3 { margin-block: 0 .5rem; font-size: 1.2rem; }
  .dl-older > :last-child { margin-block-end: 0; }

  .dl-hof { margin-block-start: calc(2 * var(--gap)); }

  /* wide card: text left (start), the notice beside it */
  @container (width >= 48rem) {
    .dl-wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: calc(2 * var(--gap)); align-content: start; }
    .dl-wide > * { grid-column: 1; }
    .dl-wide > .dl-notice { grid-column: 2; grid-row: 1 / span 6; align-self: start; }
  }
  @container (width < 22rem) {
    .dl-card { padding: 1rem; }
    .dl-head img { inline-size: 3.5rem; }
  }
}

/* contact page (D32) — footer link list + components/contact-form.njk, assets/js/contact.js */
@layer tokens {
  :root {
    --field-line: #6c757d;       /* form control border: 4.7:1 on white (>= 3:1 for non-text, WCAG 1.4.11) */
    --error: #b02a37;            /* error text and invalid border: 6.5:1 on white */
    --badge-room: 4.5rem;        /* footer space kept free for the fixed reCAPTCHA badge (contact page) */
  }
}
@layer components {
  /* footer: a centred, wrapping row of links (Download, Contact, Forum, News, Reviews, OEM partners, About / Imprint) */
  .site-footer ul { list-style: none; margin: 0 0 .5rem; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.5rem; }
  .site-footer li + li { margin: 0; }

  /* the form: one column */
  .contact-form { margin-block: 1.5rem; }
  .contact-form fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
  .contact-form fieldset:disabled { opacity: .6; }
  .contact-hint, .contact-note { color: var(--muted); }
  .contact-note { font-size: .875rem; }
  .contact-form .field { margin-block-end: 1.25rem; }
  .contact-form label { display: block; font-weight: 600; margin-block-end: .375rem; }
  .contact-form :is(select, input:not([type="hidden"]), textarea) {
    display: block; inline-size: 100%; min-block-size: var(--touch); padding: .5rem .75rem;
    border: 1px solid var(--field-line); border-radius: var(--r); background: var(--surface); color: var(--ink);
  }
  .contact-form textarea { min-block-size: 10rem; resize: vertical; line-height: 1.5; }
  /* an address is Latin text: left-to-right also on a right-to-left page */
  .contact-form input[type="email"] { direction: ltr; text-align: start; }
  .contact-form :is(select, input, textarea)[aria-invalid="true"] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
  .field-error { display: block; margin-block-start: .375rem; color: var(--error); font-weight: 600; }
  .contact-form button.button { cursor: pointer; }
  .contact-form button.button:disabled { opacity: .6; cursor: progress; }
  .contact-alert, .contact-status { margin-block: 1rem 0; font-weight: 600; }
  .contact-alert { color: var(--error); }
  .contact-status { padding: .75rem 1rem; background: var(--tint); border-inline-start: .25rem solid var(--blue-hi); border-radius: var(--r); }
  /* empty live regions stay in the layout (display: none would break the announcement) but take no room */
  .contact-alert:empty, .contact-status:empty { margin: 0; padding: 0; border: 0; }
  /* Google's badge is fixed at the bottom of the viewport: keep the footer text clear of it */
  body:has(.contact-form[data-badge]) .site-footer { padding-block-end: calc(1.5rem + var(--badge-room)); }
}

/* reviews + 404 (D33/D34) — src/content/reviews/reviews.de.md (+ reviews.json), src/content/404/404.njk.
   The 404 page needs no rules of its own: its link list is the .language-list grid.
   Reviews: one card per press entry (an ordered list, newest first), plain lists for the web
   links, a row of award pictures. Logical properties only (RTL-safe, though the page is German). */
@layer components {
  .review-index { columns: 20rem; column-gap: var(--gap); max-inline-size: none; }
  .review-index li { break-inside: avoid; }

  .reviews { list-style: none; padding: 0; max-inline-size: none; }
  .reviews > li {
    margin-block: 0 1rem; padding: 1rem 1.25rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
    scroll-margin-block-start: 1rem;
  }
  .reviews > li:target { border-color: var(--blue-hi); box-shadow: 0 0 0 .1875rem var(--tint); }
  .reviews h3 { margin-block: 0 .5rem; font-size: 1.1rem; line-height: 1.35; }
  .reviews img { display: block; max-inline-size: 100%; block-size: auto; margin-block-end: .5rem; }
  .reviews blockquote { margin-block: 0; }
  .reviews blockquote > :last-child { margin-block-end: 0; }
  .review-by { margin-block: .5rem 0; color: var(--muted); font-weight: 600; }

  /* the traffic shaping paper: picture beside its text */
  .review-report {
    display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap;
    margin-block: var(--gap); padding: 1rem 1.25rem;
    background: var(--tint); border-radius: var(--r);
  }
  .review-report > div { flex: 1 1 15rem; min-inline-size: 0; }
  .review-report h2 { margin-block: 0 .25rem; font-size: 1.2rem; }
  .review-report p { margin-block: 0 .25rem; }
  .review-report p:last-child { margin-block-end: 0; overflow-wrap: anywhere; }

  .awards { list-style: none; padding: 0; max-inline-size: none; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
  .awards li { margin: 0; }
  .awards img { display: block; max-inline-size: 100%; block-size: auto; }
  .awards a { display: inline-flex; align-items: center; min-block-size: var(--touch); }
}

/* news + artwork (D34) — src/content/news/ (generated by tools/news/build.mjs).
   News: a contents box, then one article per release (date line + h3), a rule
   between them; the article a #link lands on is marked. Artwork: a grid of
   cards (heading, preview at its own size up to the card width, download list).
   Logical properties only. */
@layer components {
  .news-toc {
    margin-block: 0 var(--gap); padding: 1rem 1.25rem;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  }
  .news-toc h2 { margin-block: 0 .5rem; font-size: 1.2rem; }
  .news-toc ol { margin: 0; padding-inline-start: 1.25rem; }
  .news-toc ol ol { margin-block: .25rem .5rem; list-style: none; padding-inline-start: .5rem; }
  .news-toc li + li { margin-block-start: .375rem; }
  .news-toc time { white-space: nowrap; }

  h2.news-section { margin-block-start: 2.5rem; }

  .news-item {
    border-block-start: 1px solid var(--line); padding-block-start: 1.25rem; margin-block-start: 2rem;
    scroll-margin-block-start: 1rem;
  }
  .news-item:target { border-block-start: .25rem solid var(--accent); }
  /* phones: the header bar is sticky (3.25rem): keep the date line of a #release below it */
  @media (width < 40rem) { .news-item, .news-toc, #press, #releases, #older, #about { scroll-margin-block-start: 4.25rem; } }
  .news-item > .news-date { margin-block: 0 .25rem; color: var(--muted); font-size: .9rem; }
  .news-item > h3 { margin-block-start: 0; }
  .news-item img { max-inline-size: 100%; block-size: auto; }

  .prose > .art-grid {
    list-style: none; padding: 0; margin-block: 0 var(--gap); max-inline-size: none;
    display: grid; gap: var(--gap);
    grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr));
  }
  .art-grid > .art-item {
    margin: 0; padding: 1rem 1.25rem; min-inline-size: 0;
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--line); border-block-start: .25rem solid var(--accent); border-radius: var(--r);
  }
  .art-item h3 { margin-block: 0 .75rem; font-size: 1.1rem; line-height: 1.35; }
  .art-thumb {
    margin-block: 0 .75rem; padding: .75rem; display: grid; place-items: center; min-block-size: 8rem;
    background: var(--surface-2); border-radius: var(--r);
  }
  .art-thumb img { display: block; max-inline-size: 100%; block-size: auto; }
  .art-files { list-style: none; padding: 0; margin: auto 0 0; }
  .art-files li + li { margin-block-start: .5rem; }
  .art-files a { overflow-wrap: anywhere; display: inline-block; min-block-size: 1.5rem; }
  .art-meta { display: block; color: var(--muted); font-size: .875rem; }
}
