/* Shared design tokens and the handful of rules every theme needs (PRD §3.13, WEB-09).
 *
 * Light is the base palette on `:root`; the dark values are declared twice, once behind the
 * media query and once behind `[data-theme="dark"]`, so a reader's explicit choice wins in both
 * directions — a light choice on a dark OS included. A theme overrides tokens, not rules.
 */

:root {
    color-scheme: light dark;

    --bg: #ffffff;
    --bg-raised: #f6f7f9;
    --bg-sunken: #eceef1;
    --fg: #16181c;
    --fg-muted: #5c6370;
    --line: #d7dae0;
    --accent: var(--theme-accent, #1d4ed8);
    --accent-fg: #ffffff;
    --focus: #1d4ed8;

    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: var(--font-body);
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    --step-0: 1rem;
    --step-1: 1.15rem;
    --step-2: 1.4rem;
    --step-3: 1.85rem;
    --step-4: 2.4rem;
    --step-5: 3rem;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;

    --radius: 0.375rem;
    --shell: var(--theme-content-width, 76rem);
}

:root[data-density="compact"] {
    --space-5: 1rem;
    --space-6: 1.25rem;
    --space-7: 2rem;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #14161a;
        --bg-raised: #1c1f25;
        --bg-sunken: #0f1114;
        --fg: #e8eaee;
        --fg-muted: #a2a9b5;
        --line: #333944;
        --accent: var(--theme-accent-dark, #7aa7ff);
        --accent-fg: #0b0d10;
        --focus: #7aa7ff;
    }
}

/* The native controls (fields, boxes, radios, selects) follow the reader's choice too — otherwise a
 * light choice on a dark OS draws dark fields on a light page, and the reverse. */
:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #14161a;
    --bg-raised: #1c1f25;
    --bg-sunken: #0f1114;
    --fg: #e8eaee;
    --fg-muted: #a2a9b5;
    --line: #333944;
    --accent: var(--theme-accent-dark, #7aa7ff);
    --accent-fg: #0b0d10;
    --focus: #7aa7ff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* A component that sets its own `display` beats the browser's `[hidden] { display: none }`, so
   anything this project hides from script — and everything it reveals — needs this to be true.
   Found by the consent banner, which `display: flex` kept on screen after it was hidden. */
[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: var(--step-0) / 1.6 var(--font-body);
}

img,
picture,
video {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent);
}

/* Polish has words wider than a phone at headline sizes ("cyberbezpieczeństwo"), and generated
 * articles quote source addresses in the text: break them rather than widen the page.
 * `anywhere`, not `break-word`, so a grid track shrinks too. Section and tag names are
 * typed by an Admin and printed as kickers, filter chips and choices: the same, and so is a
 * subscriber's address. The rule the rest follow: **anything a person typed, printed outside
 * `.article-body`** — leads, and the article titles that "See also" and "Most read" print as
 * links, and a profile, and the Admin's own label on the support link. A compound noun or a
 * pasted address in any of them has nothing to break on. Found twice the hard way: Minimal's
 * article overflowed a 320 px screen by 14 px (17c), and Wire's three "See also" links reached
 * 338 px on CI's fonts while fitting on the laptop's (17d). */
h1,
h2,
h3,
.article-body,
.article__lead,
.card__lead,
.card__kicker,
.related__item,
.most-read__item,
.author-box,
.support-link,
.prefs-chip,
.prefs__options label,
.prefs__note,
.newsletter__address {
    overflow-wrap: anywhere;
}

/* …except a table cell: `anywhere` let a column shrink to one letter, and on a phone every table
 * was squeezed until words broke in the middle ("Obser/ver"). A cell breaks between words only.
 * What does not fit then scrolls sideways inside its box — the renderer puts every body table in
 * `.table-scroll` (rendering/render.py) — and the page never does. Below 48em a column keeps 6rem,
 * so five columns scroll instead of stacking a word per line, while a field/description pair still
 * fits a 360 px phone. Here, not in a theme's article.css: the box exists on public pages only, as
 * does this file, and the editor must keep a plain table whose cells TinyMCE can select. */
.article-body :is(th, td) {
    overflow-wrap: normal;
    word-break: normal;
    hyphens: manual;
}

.table-scroll {
    overflow-x: auto;
}

@media (max-width: 48em) {
    .table-scroll :is(th, td) {
        min-width: 6rem;
    }
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--space-4);
}

.skip-link {
    position: absolute;
    left: var(--space-4);
    top: -4rem;
    z-index: 10;
    padding: var(--space-2) var(--space-4);
    background: var(--bg-raised);
    color: var(--fg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.skip-link:focus {
    top: var(--space-2);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* htmx's own indicator rules, which it is told not to inject (a nonce-less <style>). */
.htmx-indicator {
    opacity: 0;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
    transition: opacity 200ms ease-in;
}

/* Revealed by the boot script: without JavaScript the control could not do anything. */
.theme-toggle {
    display: none;
}

:root[data-js="on"] .theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--bg-raised);
    color: var(--fg);
    cursor: pointer;
}

.theme-toggle__mark {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: linear-gradient(120deg, var(--fg) 0 50%, transparent 50% 100%);
    border: 1px solid var(--fg);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- Reader preferences (PRD §6.4) --------------------------------------------------------- */

/* Controls that only script can make work; without it they are never offered. */
[data-js-only] {
    display: none;
}

:root[data-js="on"] [data-js-only] {
    display: block;
}

.site-header__tools {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-left: auto;
}

.lang-switch {
    display: flex;
    gap: var(--space-2);
    font-size: 0.85rem;
}

.lang-switch__current {
    color: var(--fg-muted);
    font-weight: 600;
}

.prefs-trigger {
    font-size: 0.85rem;
    white-space: nowrap;
}

.prefs-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    max-width: var(--shell);
    margin: 0 auto;
    padding: var(--space-3) var(--space-4) 0;
    font-size: 0.85rem;
}

.prefs-chip {
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg-raised);
}

.prefs-chips__reset button {
    padding: var(--space-1) var(--space-3);
    border: 1px solid transparent;
    border-radius: 999px;
    background: none;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
}

.prefs-dialog {
    width: min(42rem, calc(100vw - 2rem));
    max-height: 85vh;
    overflow: auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--fg);
}

.prefs-dialog::backdrop {
    background: rgb(0 0 0 / 55%);
}

.prefs {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-5);
}

.prefs__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.prefs__title {
    margin: 0;
    font-size: var(--step-2);
}

.prefs__close {
    display: none;
    padding: 0 var(--space-2);
    border: 0;
    background: none;
    color: var(--fg-muted);
    font-size: var(--step-3);
    line-height: 1;
    cursor: pointer;
}

:root[data-js="on"] dialog .prefs__close {
    display: block;
}

.prefs__group {
    margin: 0;
    padding: 0;
    border: 0;
}

.prefs__legend {
    display: block;
    margin-bottom: var(--space-2);
    padding: 0;
    color: var(--fg-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Django renders the choices as a <div> of <div>s: as many columns as fit, a switch and its label. */
.prefs__options > div {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: var(--space-1) var(--space-4);
}

.prefs select {
    padding: var(--space-1) var(--space-2);
    font: inherit;
}

.prefs__options label,
.prefs__choice {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

/* A consent sentence runs over lines: its switch sits by the first one. */
.newsletter .prefs__choice {
    align-items: flex-start;
}

/* On/off choices are switches (owner's choice); forced colours keep the native box. */
input[type="checkbox"] {
    appearance: none;
    position: relative;
    flex: none;
    width: 2.25rem;
    height: 1.25rem;
    margin: 0.1rem 0 0;
    border: 1px solid var(--fg-muted);
    border-radius: 1rem;
    background: var(--bg-sunken);
    cursor: pointer;
}

input[type="checkbox"]::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0.125rem;
    width: 0.875rem;
    height: 0.875rem;
    margin: auto 0;
    border-radius: 50%;
    background: var(--fg-muted);
    transition: transform 0.15s;
}

input[type="checkbox"]:checked {
    border-color: var(--accent);
    background: var(--accent);
}

input[type="checkbox"]:checked::before {
    background: var(--accent-fg);
    transform: translateX(calc(1.125rem - 2px));
}

@media (forced-colors: active) {
    input[type="checkbox"] {
        appearance: auto;
    }
}

/* The tag fields base.js builds over the hidden checkboxes. */
.tag-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: text;
}

.tag-input:focus-within {
    outline: 2px solid var(--focus);
}

.tag-input__chips {
    display: contents;
}

.tag-input__chip {
    display: inline-flex;
    align-items: center;
    padding-left: var(--space-3);
    border-radius: 999px;
    background: var(--bg-sunken);
}

.tag-input__remove {
    padding: var(--space-1) var(--space-2);
    border: 0;
    background: none;
    color: var(--fg-muted);
    font: inherit;
    cursor: pointer;
}

.tag-input__field {
    flex: 1 1 8rem;
    padding: var(--space-1);
    border: 0;
    outline: 0;
    background: none;
    color: var(--fg);
    font: inherit;
}

.tag-input__list {
    margin: var(--space-1) 0 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    list-style: none;
}

.tag-input__list li {
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
}

.tag-input__list [aria-selected="true"],
.tag-input__list li:hover {
    background: var(--bg-sunken);
}

.tag-input__none {
    color: var(--fg-muted);
}

.prefs__appearance {
    display: none;
    gap: var(--space-4);
}

:root[data-js="on"] .prefs__appearance {
    display: flex;
    flex-wrap: wrap;
}

.prefs__note {
    margin: 0;
    color: var(--fg-muted);
    font-size: 0.85rem;
}

.prefs__actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.prefs__actions button {
    padding: var(--space-2) var(--space-5);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-raised);
    color: var(--fg);
    font: inherit;
    cursor: pointer;
}

/* Two classes: `.prefs__actions button` above would otherwise outrank it (the look 13b meant). */
.prefs__actions .prefs__save {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-fg);
}

/* The newsletter's form (ADR-41) wears the same look. */
.prefs input[type="email"] {
    width: 100%;
    max-width: 24rem;
    padding: var(--space-2);
    font: inherit;
}

.prefs__error {
    margin: var(--space-1) 0 0;
    font-weight: 600;
}

/* --- Advertisements (MON-01, ADR-45) --------------------------------------------------------- */

/* The label is above the creative, quiet but never hidden, and the box clips: a 300x250 creative
   is wider than the content column on a phone and a third-party iframe ignores `max-width`. */
.ad-slot {
    margin: var(--space-5) 0;
    text-align: center;
    /* As a grid item its automatic minimum size is its content's, so a creative wider than the
       column would stretch the whole grid — and the page with it. */
    min-width: 0;
}

.ad-slot__label {
    margin: 0 0 var(--space-1);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg-muted);
}

.ad-slot__body {
    overflow: hidden;
    max-width: 100%;
}

.ad-slot__body > * {
    max-width: 100%;
    /* A creative is a fixed size — 300x250, 728x90 — and cannot be stretched to fill the column:
       what a network serves is an iframe of exactly that width. So centre it instead. The
       `text-align` above centres an inline one (an iframe, an image); this centres a block that
       carries its own width, and does nothing to one that fills the column anyway (AdSense's
       own `<ins style="display:block">`), whose auto margins compute to zero. */
    margin-inline: auto;
}

/* How an advertisement sits between the cards is the listing's own arrangement, so it lives with
   the theme that arranges them — Classic spans it across its grid (MON-02). */

/* In the middle of an article it keeps the text's measure and its own air. */
.article-body > .ad-slot {
    margin: var(--space-6) 0;
}

/* --- The consent banner (MON-03, ADR-46) ----------------------------------------------------- */

/* A strip at the foot of the window rather than a curtain over the page: the reader can read
   while deciding, and nothing is held hostage. It is `hidden` until `base.js` finds no answer. */
.consent {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-raised);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgb(0 0 0 / 12%);
}

.consent__title {
    margin: 0;
    font-size: 1rem;
}

.consent__text {
    margin: 0;
    max-width: 70ch;
    font-size: 0.9375rem;
    color: var(--fg-muted);
}

.consent__options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
}

.consent__option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.consent__buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

.consent__button {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.consent__button--yes {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-fg);
}

.consent__choose,
.footer__consent {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

@media (min-width: 48rem) {
    .consent {
        padding: var(--space-5) var(--space-6);
    }
}

/* `.article__disclosure` (MON-04) and `.newsletter-box` (ADR-41 §15) are drawn here but styled by
   the theme — both are ordinary prose in the theme's own type, and Classic gives the box its
   `.widget` frame. The newsletter *page*'s own heading is not a theme matter: */
.newsletter > .prefs__title {
    margin-top: var(--space-6);
}

/* The full page carries its own <h1>; the form's heading is for the dialog, which has none. */
.prefs-page .prefs {
    padding: 0;
}

.prefs-page .prefs__head {
    display: none;
}

/* --- Reader discussion (2026-10-04) ------------------------------------------------------- */

/* The invitation to the post where readers discuss the article, under its text: a box any theme
 * reads as an aside, in the theme's own tokens. The arrow says the link leaves the portal. */
.discussion {
    margin: var(--space-6) 0 0;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
}

.discussion__link {
    font-weight: 700;
}

.discussion__link::after {
    content: " →";
}

/* --- Search (WEB-06) ------------------------------------------------------------------------ */

.search-box {
    display: flex;
    min-width: 0;
}

.search-box input {
    width: 10rem;
    min-width: 0;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    background: var(--bg);
    color: var(--fg);
    font: inherit;
    font-size: 0.85rem;
}

.search-box button {
    display: inline-flex;
    align-items: center;
    padding: var(--space-2);
    border: 1px solid var(--line);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--bg-raised);
    color: var(--fg);
    cursor: pointer;
}

/* Below 64rem the magnifier alone: it opens the search page, and the menu keeps the room. */
@media (max-width: 63.99rem) {
    .site-header .search-box input {
        display: none;
    }

    .site-header .search-box button {
        border-radius: var(--radius);
    }
}

.search-box--page {
    margin-bottom: var(--space-4);
}

.search-box--page input {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    font-size: var(--step-1);
}

/* What the box understands: a <details> right under it, examples beside their meaning from 36rem. */
.search-help {
    margin: calc(-1 * var(--space-2)) 0 var(--space-4);
    color: var(--fg-muted);
    font-size: 0.9rem;
}

.search-help summary {
    display: inline-flex;
    gap: var(--space-2);
    align-items: center;
    cursor: pointer;
    list-style: none;
}

.search-help summary::-webkit-details-marker {
    display: none;
}

.search-help__icon {
    display: inline-grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-weight: 700;
    line-height: 1;
}

.search-help dl {
    display: grid;
    gap: var(--space-1) var(--space-4);
    margin: var(--space-3) 0 var(--space-2);
}

.search-help dt {
    color: var(--fg);
}

.search-help dd {
    margin: 0 0 var(--space-2);
}

@media (min-width: 36rem) {
    .search-help dl {
        grid-template-columns: max-content 1fr;
    }

    .search-help dd {
        margin: 0;
    }
}

/* --- Header menu and the ☰ panel (WEB-07) --------------------------------------------------- */

/* What opens the sub-items lives here, so every theme gets it; how they look is the theme's. */
.menu__item {
    position: relative;
}

.menu__children {
    display: none;
}

/* Only where a pointer can hover: a tap would leave the list stuck open on a touch screen. */
@media (hover: hover) {
    .menu__item--has-children:hover > .menu__children {
        display: block;
    }
}

/* Without JavaScript keyboard focus opens the list. With it the ▾ button does, since focus left
 * on the button would otherwise keep open a list the reader has just closed. */
:root:not([data-js="on"]) .menu__item--has-children:focus-within > .menu__children,
.menu__item--has-children[data-open] > .menu__children {
    display: block;
}

.menu__group,
.menu__expand {
    align-items: center;
    gap: var(--space-2);
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.menu__group {
    display: inline-flex;
}

/* Beside a link the button only makes sense with the script that drives it. */
.menu__expand {
    display: none;
}

:root[data-js="on"] .menu__expand {
    display: inline-flex;
    justify-content: center;
    min-width: 1.25rem;
    min-height: 1.5rem;
    vertical-align: middle;
}

.menu__caret {
    width: 0.4em;
    height: 0.4em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-25%) rotate(45deg);
}

[aria-expanded="true"] > .menu__caret {
    transform: translateY(25%) rotate(225deg);
}

/* The portal's logo (0.10.0), drawn by height: a theme sets --theme-logo-height with its
 * `logo_height` option. When a narrow screen squeezes the row, the name beside the logo gives
 * way first, then the picture — object-fit keeps its proportions instead of stretching it. */
.site-header__brand--logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.site-header__logo {
    flex: 0 1 auto;
    width: auto;
    height: var(--theme-logo-height, 2.5rem);
    max-width: 100%;
    min-width: 0;
    object-fit: contain;
    object-position: left center;
}

.site-header__name {
    flex: 0 1000 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* On a wide screen the panel is no box at all: the menu and the tools sit in the header's row. */
.site-header__panel {
    display: contents;
}

.nav-toggle {
    display: none;
}

/* A theme that wants the ☰ on wider screens too repeats this block under its own, wider query;
 * everything in it only switches the panel on, so nothing has to be undone. */
@media (max-width: 47.99rem) {
    :root[data-js="on"] .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.75rem;
        height: 2.75rem;
        margin-left: auto;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--bg-raised);
        color: var(--fg);
        cursor: pointer;
    }

    .nav-toggle__close,
    .nav-toggle[aria-expanded="true"] .nav-toggle__open {
        display: none;
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle__close {
        display: block;
    }

    /* A long portal name gives way to the button instead of pushing it off the screen. */
    :root[data-js="on"] .site-header__brand {
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* A phone's header row is short: a tall logo is capped rather than doubling it. */
    .site-header__logo {
        height: min(var(--theme-logo-height, 2.5rem), 2.25rem);
    }

    :root[data-js="on"] .site-header__panel {
        display: none;
        flex: 1 0 100%;
        flex-direction: column;
        gap: var(--space-4);
        max-height: calc(100dvh - var(--header-height, 3.5rem) - var(--space-4));
        overflow-y: auto;
        padding-block: var(--space-2) var(--space-4);
        border-top: 1px solid var(--line);
    }

    :root[data-js="on"] .site-header[data-nav="open"] .site-header__panel {
        display: flex;
    }

    /* The menu first, whatever order a theme gives it in the header's row. */
    :root[data-js="on"] .site-header__panel .site-nav {
        order: 0;
        flex-basis: auto;
    }

    /* In the panel the menu reads top to bottom, sub-items listed under their item, indented. */
    :root[data-js="on"] .site-header__panel .menu {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0;
    }

    :root[data-js="on"] .site-header__panel .menu__item {
        white-space: normal;
    }

    :root[data-js="on"] .site-header__panel .menu a,
    :root[data-js="on"] .site-header__panel .menu__group {
        display: block;
        padding-block: var(--space-3);
    }

    :root[data-js="on"] .site-header__panel .menu__group {
        cursor: default;
        text-align: left;
    }

    :root[data-js="on"] .site-header__panel .menu__expand,
    :root[data-js="on"] .site-header__panel .menu__caret {
        display: none;
    }

    :root[data-js="on"] .site-header__panel .menu__children {
        display: block;
        position: static;
        min-width: 0;
        margin: 0 0 var(--space-2);
        padding: 0 0 0 var(--space-4);
        border: 0;
        border-left: 2px solid var(--line);
        border-radius: 0;
        background: none;
        box-shadow: none;
    }

    :root[data-js="on"] .site-header__panel .site-header__tools {
        flex-wrap: wrap;
        gap: var(--space-3) var(--space-4);
        margin-left: 0;
    }

    /* The whole box again, not the magnifier alone: the panel has the room. 1rem keeps a phone
     * from zooming in when the box gets focus. */
    :root[data-js="on"] .site-header__panel .search-box {
        flex-basis: 100%;
    }

    :root[data-js="on"] .site-header__panel .search-box input {
        display: block;
        flex: 1;
        padding: var(--space-2) var(--space-3);
        font-size: 1rem;
    }

    :root[data-js="on"] .site-header__panel .search-box button {
        border-radius: 0 var(--radius) var(--radius) 0;
    }
}
