/*
 * zenlygram.org portal — one same-origin stylesheet, no build step, no CDN.
 *
 * Direction (shared with the landing page at /): one dark "glass" concept for every page — a black
 * canvas with a faint blue glow, glass surfaces (a dark translucent fill, a hairline edge, backdrop
 * blur), light-weight display type in DM Sans (Onest for Cyrillic; both self-hosted under
 * /portal/fonts), white pill primary actions and ghost secondaries, one blue accent. The tokens below
 * are that palette; the structural sections that follow are the original components, and the "glass
 * theme" section near the end restates their look in this language. Marketing pages
 * (<html class="marketing">: features, pricing, download) share the same canvas.
 *
 * Contrast pairs AIM at WCAG AA (4.5:1 text, 3:1 control edges and focus); they are design-time
 * estimates from the hex values and must be measured in a browser before being relied on.
 * The CSP is style-src 'self': nothing in the views uses a style attribute.
 *
 * Structure: fonts → tokens → base → layout (header/footer/sidebar) → components (buttons, groups,
 * badges, notices, forms, tables, prose) → marketing canvas → media queries → glass theme → user
 * preferences.
 */

/* Self-hosted webfonts, the files the landing ships: DM Sans (variable, weights 300-500) for Latin,
   Onest for Cyrillic; each face is limited to its script, so a page fetches only what it shows. */
@font-face {
    font-family: "DM Sans";
    font-style: normal;
    font-weight: 300 500;
    font-display: swap;
    src: url("fonts/dm-sans-latin-ext.woff2") format("woff2");
    unicode-range: U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: "DM Sans";
    font-style: normal;
    font-weight: 300 500;
    font-display: swap;
    src: url("fonts/dm-sans-latin.woff2") format("woff2");
    unicode-range: U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 300 500;
    font-display: swap;
    src: url("fonts/onest-cyrillic-ext.woff2") format("woff2");
    unicode-range: U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
@font-face {
    font-family: "Onest";
    font-style: normal;
    font-weight: 300 500;
    font-display: swap;
    src: url("fonts/onest-cyrillic.woff2") format("woff2");
    unicode-range: U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116;
}

:root {
    /* One scheme for the whole site: the landing's black canvas. Native controls and scrollbars follow. */
    color-scheme: dark;

    --bg: #000000;
    --canvas-glow: radial-gradient(ellipse 70% 55% at 72% 46%, rgba(60, 110, 220, 0.22), transparent 70%),
        radial-gradient(circle at 50% 50%, rgba(122, 177, 254, 0.10), transparent 55%);
    --surface: rgba(12, 13, 19, 0.72);
    --surface-sunken: rgba(255, 255, 255, 0.05);
    --card: rgba(10, 11, 16, 0.62);
    --text: #f4f6fb;
    --hint: #8b90a0;             /* ≈7.2:1 on black, ≈6.9:1 on a card */
    --hint-strong: #b7bccb;
    --link: #8dbbff;             /* ≈9.5:1 on black */
    --accent: #7ab1fe;
    --accent-hover: #9cc6ff;
    --accent-text: #06101f;
    --accent-tint: rgba(122, 177, 254, 0.14);
    --ghost-text: #a9cbff;
    --danger: #ff7b7b;
    --danger-tint: rgba(255, 123, 123, 0.12);
    --ok: #5cf2a5;
    --ok-tint: rgba(92, 242, 165, 0.12);
    --warn: #f2c14e;
    --warn-tint: rgba(242, 193, 78, 0.12);
    --separator: rgba(255, 255, 255, 0.09);
    --rule: rgba(255, 255, 255, 0.18);
    --control-border: rgba(255, 255, 255, 0.34);   /* 2.89:1 edge on black — under 3:1; admin.css sets the staff shell's own */
    --focus: #7ab1fe;
    --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.09);
    --shadow-lift: 0 24px 60px -24px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.09);
    --glass-blur: blur(16px) saturate(140%);

    --font: "DM Sans", "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --serif: var(--font);        /* the former serif voice: the same face, light weight */
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    --display-page: clamp(2.375rem, 1.4rem + 3.6vw, 4.5rem);
    --h1: clamp(2rem, 1.5rem + 1.8vw, 2.875rem);
    --h2: clamp(1.5rem, 1.25rem + 1vw, 2.125rem);
    --h2-band: clamp(1.875rem, 1.3rem + 2.4vw, 3.375rem);
    --h3: 1.25rem;

    --radius: 18px;
    --radius-lg: 24px;
    --radius-control: 12px;
    --radius-pill: 999px;
    --pad: 18px;
    --gap: 12px;
    --touch: 44px;
    --measure: 68ch;
    --container: 1200px;
    --ease: 160ms ease-out;
    --ease-settle: cubic-bezier(0.2, 0.7, 0.2, 1);
    /* A short overshoot for decorative marketing entrances only; controls keep --ease. */
    --ease-spring: cubic-bezier(0.22, 1.32, 0.36, 1);
    /* Pinned header height used for anchor/focus scroll padding and the sticky sidebar. portal.js
     * publishes the measured value as --site-header-height; these per-layout estimates apply without
     * it (no JS, no ResizeObserver): two rows (brand + tools, then the nav) below 960px. */
    --header-estimate: 7.25rem;
    --header-space: var(--site-header-height, var(--header-estimate));

    /* Marketing-only names, kept so the canvas section keeps working: the cobalt accent is the
     * landing's blue, "ink" is a glass surface, and the primary button is white on black. */
    --cobalt: #7ab1fe;
    --ink: rgba(10, 11, 16, 0.62);
    --btn-fill: #ffffff;
    --btn-label: #000000;
    --btn-fill-hover: #e6efff;
    --btn-label-hover: #000000;
}

/* Marketing pages share the same canvas now; only the scheme pin stays explicit. */
:root.marketing {
    color-scheme: dark;
}

@media (prefers-contrast: more) {
    :root,
    :root.marketing {
        --hint: #b4b9c6;
        --hint-strong: #d3d7e0;
        --separator: rgba(255, 255, 255, 0.22);
        --rule: rgba(255, 255, 255, 0.4);
        --control-border: rgba(255, 255, 255, 0.6);
    }
}

/* ── base ──────────────────────────────────────────────────────────────── */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* Anchors, the skip link and focused controls land below the pinned header, not under it. */
    scroll-padding-top: calc(var(--header-space) + 12px);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 400 17px/1.55 var(--font);
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}

[hidden] {
    display: none !important;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    line-height: 1.2;
    font-weight: 700;
    text-wrap: balance;
}

h1 {
    font-size: var(--h1);
    line-height: 1.12;
    letter-spacing: -0.022em;
}

h2 {
    font-size: var(--h2);
    font-weight: 650;
    line-height: 1.18;
    letter-spacing: -0.018em;
}

h3 {
    font-size: var(--h3);
    font-weight: 650;
    letter-spacing: -0.01em;
}

h4 {
    font-size: 1rem;
}

p,
ul,
ol,
dl,
figure,
blockquote {
    margin: 0;
}

p,
li,
dd {
    text-wrap: pretty;
}

a {
    color: var(--link);
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
}

a:hover {
    text-decoration-thickness: 2px;
}

img,
svg {
    display: block;
    max-width: 100%;
}

svg.icon {
    width: 1.25em;
    height: 1.25em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

hr {
    border: 0;
    border-top: 1px solid var(--separator);
    margin: 0;
}

code,
kbd,
samp {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
}

.num,
time,
.money {
    font-variant-numeric: tabular-nums;
}

.money {
    white-space: nowrap;
}

::selection {
    background: rgba(10, 99, 201, 0.2);
}

/* ── focus ─────────────────────────────────────────────────────────────── */

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

[tabindex="-1"]:focus:not(:focus-visible) {
    outline: none;
}

/* The error summary takes programmatic focus on re-render; keep a visible ring so sighted keyboard
 * users see where they are. */
.error-summary:focus {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Fixed, above the pinned header: wherever the page is scrolled, the focused skip link is on screen
 * and never painted underneath the header. */
.skip-link {
    position: fixed;
    left: 8px;
    top: -100px;
    z-index: 40;
    padding: 10px 16px;
    border-radius: var(--radius-control);
    background: var(--accent);
    color: var(--accent-text);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 8px;
}

/* Marketing pages: enlarged text can make the link taller than its 100px offset, so while unfocused it
 * is also moved up by its own height (fully off screen at any text size) and kept within the viewport
 * width; focus resets the transform, so the focused link shows exactly as on every other page. */
:where(.marketing) .skip-link {
    max-width: calc(100% - 16px);
    transform: translateY(calc(-100% - 100px));
}

:where(.marketing) .skip-link:focus {
    transform: none;
}

/* ── layout ────────────────────────────────────────────────────────────── */

.wrap {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--pad);
}

.site-main {
    flex: 1 0 auto;
    padding-block: 28px 64px;
}

.site-main:focus {
    outline: none;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

.stack-lg {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.muted {
    color: var(--hint);
}

.small {
    font-size: 0.9375rem;
}

.lede {
    font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
    line-height: 1.5;
    color: var(--hint);
    max-width: 54ch;
}

.measure {
    max-width: var(--measure);
}

.page-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.page-head .back {
    align-self: flex-start;
}

.eyebrow {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--hint);
}

/* header — pinned on every page by CSS alone (no JS needed). It stays compact so it never eats a short
 * screen: below 960px the nav is one horizontally scrollable row instead of wrapping into more rows,
 * short landscape screens fold everything into a single row, and the menu panels scroll inside
 * themselves. Its height feeds scroll-padding-top through --header-space. The frosted fill applies only
 * where backdrop blur exists; otherwise the fill is solid, so labels never sit on scrolling text. */

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--bg);
    border-bottom: 1px solid var(--separator);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .site-header {
        background: color-mix(in srgb, var(--bg) 90%, transparent);
        -webkit-backdrop-filter: saturate(180%) blur(18px);
        backdrop-filter: saturate(180%) blur(18px);
    }
}

@media (prefers-reduced-transparency: reduce) {
    .site-header {
        background: var(--bg);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* Marketing header: the shared frosted bar on the paper canvas — an explicit 90% paper fill (no
 * color-mix, so an engine with backdrop blur but without color-mix still gets a fill) that alone keeps
 * nav labels ≥4.5:1 even over the ink exhibit scrolling beneath (source estimate); opaque without
 * backdrop blur, under reduced transparency and under increased contrast. Same specificity as the
 * rules above and later, so it wins; the forced-colours Canvas rule comes later still. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    :where(.marketing) .site-header {
        background: rgba(243, 241, 236, 0.9);
    }
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
    :where(.marketing) .site-header {
        background: var(--bg);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

/* One header row: brand + tools on the first line; the primary nav takes its own full-width line below
 * 960px (no hidden duplicate menu, works without JS), and joins the row from 960px. */
.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0 12px;
    min-height: 60px;
}

.nav-primary {
    order: 3;
    flex: 1 0 100%;
    min-width: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: var(--touch);
    color: var(--text);
    text-decoration: none;
}

.brand img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.brand-word {
    font-size: 1.125rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    /* When the tools wrap below the brand at 320px they stay right-aligned, so right-anchored menu
     * panels do not run off the left edge. */
    margin-inline-start: auto;
}

.lang-code {
    font-weight: 600;
    letter-spacing: 0.03em;
}

.header-tools .btn {
    min-height: var(--touch);
    padding: 8px 16px;
    font-size: 0.9375rem;
}

/* Below 960px: one row that scrolls sideways (touch, trackpad, or focus moving along it). The block
 * padding keeps focus rings inside the scroll box; the inline padding plus the negative margin lets
 * the row run to the screen edge while the first label stays aligned with the brand. */
.nav-primary ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 0 2px;
    padding: 4px 6px 6px;
    margin: 0 -16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 16px;
    scrollbar-width: thin;
    list-style: none;
}

.nav-primary li {
    flex: none;
}

.nav-primary a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
    padding: 0 10px;
    border-radius: var(--radius-control);
    color: var(--hint);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--ease), background-color var(--ease);
}

.nav-primary a:hover {
    color: var(--text);
    background: var(--surface-sunken);
}

/* Current page: full-contrast text plus an accent underline bar — never colour alone. */
.nav-primary a[aria-current="page"] {
    color: var(--text);
    font-weight: 600;
}

.nav-primary a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 6px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}

/* language menu: native <details>; JS only adds Escape / outside click */

.menu {
    position: relative;
}

.menu > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--touch);
    padding: 0 12px;
    border: 1px solid var(--separator);
    border-radius: var(--radius-pill);
    cursor: pointer;
    list-style: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: border-color var(--ease), background-color var(--ease);
}

.menu > summary::-webkit-details-marker {
    display: none;
}

.menu > summary:hover {
    background: var(--surface-sunken);
    border-color: var(--control-border);
}

.menu[open] > summary {
    border-color: var(--control-border);
}

.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 5;
    min-width: 12rem;
    padding: 6px;
    border: 1px solid var(--separator);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lift);
    list-style: none;
    margin: 0;
}

.menu[open] > .menu-panel {
    animation: menu-in var(--ease);
}

@keyframes menu-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
}

/* The header is pinned, so an open panel cannot scroll away with the page: on a short or zoomed screen
 * it is bounded to the space under the header and scrolls inside itself (contained, so reaching its end
 * does not scroll the page). Only the panel scrolls; the header itself never clips it. */
.site-header .menu-panel {
    max-height: max(5.5rem, calc(100vh - var(--header-space) - 16px));
    overflow-y: auto;
    overscroll-behavior: contain;
}

@supports (height: 100dvh) {
    .site-header .menu-panel {
        max-height: max(5.5rem, calc(100dvh - var(--header-space) - 16px));
    }
}

.menu-panel a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: var(--touch);
    padding: 0 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
}

.menu-panel a:hover {
    background: var(--surface-sunken);
}

.menu-panel a[aria-current="true"] {
    font-weight: 600;
}

/* footer — a quiet soft-gray surface in the page's own scheme; the disclaimer stays full hint contrast */

.site-footer {
    flex: none;
    padding-block: 48px 40px;
    border-top: 1px solid var(--separator);
    background: var(--surface-sunken);
    color: var(--hint);
    font-size: 0.9375rem;
}

.footer-grid {
    display: grid;
    gap: 28px;
}

.footer-grid h2 {
    margin-bottom: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--text);
}

.footer-grid ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.footer-grid a:not(.brand) {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
    color: var(--hint);
    text-decoration: none;
}

.footer-grid a:not(.brand):hover {
    color: var(--text);
    text-decoration: underline;
}

.disclaimer {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--separator);
    max-width: var(--measure);
    color: var(--hint);
}

/* Marketing footer: the same quiet sunken paper, under a stronger rule. */
:where(.marketing) .site-footer {
    border-top-color: var(--rule);
}

/* Long localized footer links (legal titles at large text sizes) wrap inside their column instead of
 * running past it; normal-size labels are unaffected. */
:where(.marketing) .footer-grid a:not(.brand) {
    max-width: 100%;
    overflow-wrap: anywhere;
}

/* account / admin shell: sidebar + content */

.shell {
    display: grid;
    /* One track that may shrink below its content: the phone side navigation is a single nowrap row
     * that scrolls inside itself, and an auto track would grow to its full width and take the page with it. */
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

.nav-side ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.nav-side a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: var(--touch);
    padding: 0 12px;
    border: 1px solid var(--separator);
    border-radius: var(--radius-control);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
}

.nav-side a:hover {
    background: var(--surface-sunken);
}

.nav-side a[aria-current="page"] {
    color: var(--ghost-text);
    background: var(--accent-tint);
    border-color: transparent;
    font-weight: 600;
}

.shell-content {
    min-width: 0;
}

/* ── buttons ───────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--touch);
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    font: inherit;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}

.btn-lg {
    min-height: 52px;
    padding: 12px 28px;
    font-size: 1.0625rem;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-text);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

/* Secondary = outlined; the edge uses the 3:1 control-border token so the control stays findable. */
.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--control-border);
}

.btn-secondary:hover {
    background: var(--surface-sunken);
    border-color: var(--text);
}

.btn-quiet {
    background: transparent;
    color: var(--link);
    border-color: var(--separator);
}

.btn-quiet:hover {
    background: var(--surface-sunken);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn[disabled],
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
}

form[aria-busy="true"] .btn[type="submit"] {
    cursor: progress;
}

.btn-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-row > .btn {
    width: 100%;
}

.btn-link {
    padding: 0;
    min-height: var(--touch);
    border: 0;
    background: none;
    color: var(--link);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 0.16em;
    cursor: pointer;
}

.inline-form {
    display: inline;
}

/* ── grouped lists (iOS Settings style, never nested) ──────────────────── */

.group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group + .group {
    margin-top: 28px;
}

.group-title {
    padding-inline: var(--pad);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.3;
    color: var(--hint);
    text-transform: none;
}

h2.group-title,
h3.group-title {
    font-size: 0.9375rem;
}

.group-body {
    margin: 0;
    padding: 0;
    list-style: none;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.group-foot {
    padding-inline: var(--pad);
    font-size: 0.875rem;
    color: var(--hint);
}

.row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 12px var(--pad);
}

.group-body > .row + .row,
.group-body > li + li {
    border-top: 1px solid var(--separator);
}

.row-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.row-label {
    font-weight: 500;
}

.row-sub {
    font-size: 0.9375rem;
    color: var(--hint);
}

.row-value {
    flex: none;
    max-width: 55%;
    text-align: right;
    color: var(--hint);
}

.row-icon {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 8px;
    background: var(--accent-tint);
    color: var(--ghost-text);
}

a.row {
    color: inherit;
    text-decoration: none;
}

a.row:hover {
    background: var(--surface-sunken);
}

a.row .chevron {
    color: var(--hint);
}

.row-block {
    display: block;
    padding: 14px var(--pad);
}

.row-block > * + * {
    margin-top: 10px;
}

/* definition rows inside a group (history entries, details) */

.kv {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px 16px;
}

.kv dt {
    font-size: 0.875rem;
    color: var(--hint);
}

.kv dd {
    margin: 0 0 8px;
}

/* Short amounts stay unbroken elsewhere; inside definition rows a long original-currency label
 * (e.g. "1 234 JPY (в минимальных денежных единицах)") must wrap rather than be clipped at 320px. */
.kv .money {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* ── badges (status = icon + text, never colour alone) ─────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 3px 10px 3px 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
    background: var(--surface-sunken);
    color: var(--hint);
}

.badge svg.icon {
    width: 1rem;
    height: 1rem;
}

.badge-ok {
    background: var(--ok-tint);
    color: var(--ok);
}

.badge-warn {
    background: var(--warn-tint);
    color: var(--warn);
}

.badge-danger {
    background: var(--danger-tint);
    color: var(--danger);
}

.badge-accent {
    background: var(--accent-tint);
    color: var(--ghost-text);
}

/* ── notices / flash / error summary ───────────────────────────────────── */

.notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px var(--pad);
    border: 1px solid var(--separator);
    border-left-width: 4px;
    border-radius: var(--radius-control);
    background: var(--surface);
}

.notice > svg.icon {
    margin-top: 0.12em;
}

.notice-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.notice-title {
    font-weight: 700;
    font-size: 1rem;
}

.notice-info {
    border-left-color: var(--accent);
}

.notice-info > svg.icon {
    color: var(--ghost-text);
}

.notice-success {
    border-left-color: var(--ok);
}

.notice-success > svg.icon {
    color: var(--ok);
}

.notice-warning {
    border-left-color: var(--warn);
}

.notice-warning > svg.icon {
    color: var(--warn);
}

.notice-error {
    border-left-color: var(--danger);
}

.notice-error > svg.icon {
    color: var(--danger);
}

.flash {
    margin-bottom: 20px;
}

.error-summary {
    margin-bottom: 24px;
    padding: 16px;
    border: 2px solid var(--danger);
    border-radius: var(--radius-control);
    background: var(--surface);
}

.error-summary h2 {
    font-weight: 700;
    font-size: 1.0625rem;
    letter-spacing: 0;
    margin-bottom: 8px;
}

.error-summary ul {
    padding-left: 1.2em;
}

.error-summary a {
    color: var(--danger);
    font-weight: 600;
}

/* ── forms ─────────────────────────────────────────────────────────────── */

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 40rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field > label,
.field-label,
legend {
    font-weight: 600;
}

.hint {
    font-size: 0.9375rem;
    color: var(--hint);
}

.field-error {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    color: var(--danger);
    font-weight: 600;
    font-size: 0.9375rem;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--control-border);
    border-radius: var(--radius-control);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    line-height: 1.4;
    box-shadow: inset 0 1px 2px rgba(23, 25, 28, 0.04);
    transition: border-color var(--ease), box-shadow var(--ease);
}

textarea {
    min-height: 8rem;
    resize: vertical;
}

textarea.tall {
    min-height: 18rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9375rem;
}

input[readonly] {
    background: var(--surface-sunken);
}

input.code-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.02em;
}

[aria-invalid="true"] {
    border-color: var(--danger);
    border-width: 2px;
}

fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

fieldset > legend {
    padding: 0;
    margin-bottom: 8px;
}

.check {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-height: var(--touch);
    padding: 10px 0;
}

.check input {
    flex: none;
    width: 22px;
    height: 22px;
    margin: 1px 0 0;
    accent-color: var(--accent);
}

.check label {
    cursor: pointer;
}

/* plan / mode choice: radios rendered as selectable rows */

.choices {
    display: grid;
    gap: 10px;
}

.choice {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px var(--pad);
    border: 1px solid var(--control-border);
    border-radius: var(--radius-control);
    background: var(--surface);
    cursor: pointer;
    transition: border-color var(--ease), box-shadow var(--ease);
}

.choice input {
    flex: none;
    width: 22px;
    height: 22px;
    margin: 1px 0 0;
    accent-color: var(--accent);
}

.choice:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.choice:has(input:focus-visible) {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.choice-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.choice-title {
    font-weight: 600;
}

.copy-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.copy-field input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9375rem;
}

.copy-status {
    min-height: 1.5em;
    font-size: 0.9375rem;
    color: var(--ok);
    font-weight: 600;
}

/* ── tables (staff only) ───────────────────────────────────────────────── */

/* The scroll region is positioned: a visually-hidden (absolutely positioned) header or link text inside a wide table
 * then stays inside the region instead of escaping to the viewport and widening the page (the /admin/roles phone
 * overflow); it is also the containing block a sticky identity column needs. */
.table-wrap {
    position: relative;
    overflow-x: auto;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

table.data caption {
    padding: 12px var(--pad);
    text-align: left;
    font-weight: 600;
}

table.data th,
table.data td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid var(--separator);
}

table.data thead th {
    border-top: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--hint);
    white-space: nowrap;
}

table.data td.num,
table.data th.num {
    text-align: right;
}

/* A badge's overflow-wrap:anywhere shrinks a table column's min-content to one character, so the auto
 * table layout crushed status columns to one letter per line. Inside data tables keep badges whole; a wide
 * table then scrolls inside its labelled .table-wrap region instead. Badges elsewhere still wrap. */
table.data .badge {
    white-space: nowrap;
    overflow-wrap: normal;
}

.filters {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.pagination {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}

/* ── tickets / messages ────────────────────────────────────────────────── */

.thread {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 44rem;
}

.message-meta {
    font-size: 0.8125rem;
    color: var(--hint);
}

.message-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.message-internal .bubble {
    border: 1px dashed var(--warn);
    background: var(--warn-tint);
    color: var(--text);
}

/* ── chat bubble (account status, support threads) ─────────────────────── */

.bubble {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 9px 14px;
    border-radius: 18px 18px 18px 6px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    line-height: 1.35;
}

.bubble-out {
    border-radius: 18px 18px 6px 18px;
    background: var(--accent);
    color: var(--accent-text);
    align-self: flex-end;
}

.bubble-status {
    font-weight: 600;
}

.bubble-status.is-ok svg.icon {
    color: var(--ok);
}

.bubble-status.is-warn svg.icon {
    color: var(--warn);
}

.bubble-status.is-muted svg.icon {
    color: var(--hint);
}

.account-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

/* ── prose (CMS + legal) ───────────────────────────────────────────────── */

.prose {
    max-width: var(--measure);
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.prose h2 {
    font-size: 1.5rem;
    margin-top: 0.75em;
}

.prose h3 {
    font-size: 1.1875rem;
    margin-top: 0.5em;
}

.prose ul,
.prose ol {
    padding-left: 1.3em;
}

.prose li + li {
    margin-top: 0.35em;
}

.prose blockquote {
    padding-left: 14px;
    border-left: 3px solid var(--separator);
    color: var(--hint);
}

.prose pre {
    overflow-x: auto;
    padding: 12px;
    border-radius: var(--radius-control);
    background: var(--surface-sunken);
}

.prose img {
    border-radius: var(--radius-control);
}

.prose table {
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
}

.prose th,
.prose td {
    padding: 6px 10px;
    border: 1px solid var(--separator);
}

/* ── shared content blocks (admin sections, help FAQ/CTA, content index, check lists) ───────────── */

.section {
    padding-block: 48px;
}

.section + .section {
    border-top: 1px solid var(--separator);
}

.section-head {
    margin-bottom: 20px;
}

.section-more {
    margin-top: 24px;
}

.arrow-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--touch);
    font-weight: 600;
    text-decoration: none;
}

.arrow-link:hover {
    text-decoration: underline;
}

a.arrow-link > svg.icon {
    display: block;
    width: 1.1em;
    height: 1.1em;
    transition: transform var(--ease);
}

.arrow-link:hover > svg.icon {
    transform: translateX(3px);
}

.check-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.check-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.check-list svg.icon {
    color: var(--ok);
    margin-top: 0.15em;
}

/* FAQ — hairline accordion, no panel */

.faq {
    display: flex;
    flex-direction: column;
    max-width: 48rem;
    border-top: 1px solid var(--separator);
}

.faq details {
    border-bottom: 1px solid var(--separator);
}

.faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 60px;
    padding: 14px 2px;
    font-weight: 600;
    font-size: 1.0625rem;
    cursor: pointer;
    list-style: none;
}

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

.faq summary:hover {
    color: var(--ghost-text);
}

.faq summary svg.icon {
    transition: transform var(--ease);
    color: var(--hint);
}

.faq details[open] summary svg.icon {
    transform: rotate(90deg);
    color: var(--ghost-text);
}

.faq .faq-answer {
    padding: 0 2px 20px;
    color: var(--hint);
    max-width: var(--measure);
}

/* teasers (content index, home news) */

.teaser-list {
    display: grid;
    gap: 20px;
    list-style: none;
    padding: 0;
}

.teaser {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.teaser h3 a {
    color: var(--text);
    text-decoration: none;
}

.teaser h3 a:hover {
    text-decoration: underline;
}

/* help page closing block: a quiet soft-gray panel */
.cta-band {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 28px var(--pad);
    border-radius: var(--radius-lg);
    background: var(--surface-sunken);
}

.cta-band .btn-row {
    align-self: stretch;
}

/* checkout status: the spinner exists only while portal.js is actually polling (no JS ⇒ no fake
 * activity); the localized status text next to it always carries the meaning. */

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    flex: none;
    border: 2px solid var(--separator);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

[data-poll-phase="checking"] .spinner {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.status-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 1.5em;
    font-weight: 600;
}

.amount-big {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: lining-nums tabular-nums;
}

.preview-panel {
    padding: 16px;
    border: 1px dashed var(--control-border);
    border-radius: var(--radius-control);
}

.locale-tabs {
    display: grid;
    gap: 28px;
}

/* The standalone error page's brand mark. */
.hero-mark {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    margin-bottom: 6px;
}

/* ── page helpers ──────────────────────────────────────────────────────── */

.h3-like {
    font-size: var(--h3);
    font-weight: 650;
    letter-spacing: -0.01em;
}

/* A plain form block on the page background (no surface around it, so its bordered
 * choices are never a card inside a card). */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 24px;
    border-top: 1px solid var(--separator);
}

.form-section + .form-section,
.group + .form-section,
.form-section + .group {
    margin-top: 28px;
}

.group-body + .group-body {
    margin-top: 12px;
}

ol.steps {
    padding-left: 1.3em;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Icons that sit inside running text (plain links, headings, paragraphs) flow inline;
 * flex containers (buttons, rows, badges, notices) lay them out themselves. */
a:not(.btn):not(.row):not(.brand):not(.arrow-link) > svg.icon,
h2 > svg.icon,
p > svg.icon,
.plan-meta > span > svg.icon,
.bubble > svg.icon {
    display: inline-block;
    vertical-align: -0.22em;
}

a:not(.btn):not(.row):not(.brand):not(.arrow-link) > svg.icon {
    margin-right: 4px;
}

.page-head .back {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
}

.preview-panel .eyebrow {
    margin-bottom: 10px;
}

.choice .row-sub {
    display: block;
}

/* ── marketing canvas (html.marketing: home / features / pricing / download) — "light studio" ──────
 * <main> is unwrapped there: each page is a run of full-width .band sections with their own .wrap on
 * one continuous paper canvas. Quality is carried by type, measure and spacing rather than surfaces:
 * start-aligned heads with a system-serif voice, ruled splits (a hairline over a 4/7 head–body grid),
 * hairline lists and one selective cobalt. A paper sheet exists only for a table of values (plans) or
 * a status (notices). The ink objects (.ink: home's first screen and pinned header — styled by
 * cinematic-hero.css — its feature exhibit and the closing access bands) are the only dark surfaces,
 * and the scene viewport and the exhibit's stage the only glass. Rules on shared classes are
 * :where(.marketing)-scoped or use marketing-only classes, so the user-preference blocks at the end of
 * the sheet (same specificity, later) still win and functional pages keep their own look. Every grid
 * and flex child that holds text can shrink (min-width: 0) and every large heading caps its measure at
 * min(Nch, 100%), so 200% text and long RU/UZ words wrap inside their column instead of overflowing. */

.marketing .site-main {
    padding-block: 0;
}

:root.marketing ::selection {
    background: rgba(31, 71, 209, 0.18);
}

/* Ink: the dark product surfaces. They re-scope the marketing tokens, so every shared component inside
 * (text, links, focus ring, hairlines, buttons, arrow links, points) switches to its on-ink value.
 * Source estimates on #0f1216: text ≈16:1, strong hint ≈11:1, hint ≈8:1, link/focus ≈9.8:1, cobalt
 * ≈8:1, control edge ≈5:1; the paper-filled primary button keeps ink on paper (≈15:1). */
.ink {
    --text: #eef0f3;
    --hint: #a6acb6;
    --hint-strong: #c3c8d0;
    --link: #a9bbff;
    --ghost-text: #a9bbff;
    --focus: #a9bbff;
    --cobalt: #8ea7ff;
    --separator: rgba(238, 240, 243, 0.14);
    --rule: rgba(238, 240, 243, 0.28);
    --control-border: #7f8792;
    --surface: #181c22;
    --surface-sunken: #1d222a;
    --btn-fill: #f3f1ec;
    --btn-label: #15171b;
    --btn-fill-hover: #ffffff;
    --btn-label-hover: #15171b;
    background: var(--ink);
    color: var(--text);
}

:root.marketing .ink ::selection {
    background: rgba(142, 167, 255, 0.34);
}

@media (prefers-contrast: more) {
    .ink {
        --hint: #c6cbd3;
        --hint-strong: #dde0e5;
        --separator: rgba(238, 240, 243, 0.32);
        --rule: rgba(238, 240, 243, 0.5);
        --control-border: #a3a9b3;
    }
}

/* Marketing actions: squared ink buttons, not glowing pills. Primary is ink on paper (paper on ink
 * inside .ink) and turns cobalt (white on ink) on hover; secondary is an outline on the 3:1 control
 * edge. Labels never split inside a word (the global .btn overflow-wrap: anywhere would let flex
 * shrink a label to one letter per line, "Скачат|ь"); under heavy text zoom they wrap at spaces. */
:where(.marketing) .btn {
    border-radius: 12px;
    overflow-wrap: normal;
}

:where(.marketing) .btn-primary {
    border-color: var(--btn-fill);
    background: var(--btn-fill);
    color: var(--btn-label);
}

:where(.marketing) .btn-primary:hover {
    border-color: var(--btn-fill-hover);
    background: var(--btn-fill-hover);
    color: var(--btn-label-hover);
}

.main-alerts > .flash,
.main-alerts > .error-summary {
    margin-block: 24px 0;
}

.band-notice {
    padding-top: 24px;
}

.band {
    position: relative;
    padding-block: 56px;
}

.wrap.narrow {
    max-width: 52rem;
}

/* Section heads (features, pricing, download): start-aligned on the content edge. Every section-level
 * heading on the canvas speaks in the serif voice at regular weight; its measure is capped. */
.band-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    max-width: 46rem;
    margin-bottom: 32px;
}

.band-head h2,
.split-head h2,
.chapter-head h2,
.band-access h2 {
    max-width: min(18ch, 100%);
    font-family: var(--serif);
    font-size: var(--h2-band);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.015em;
    overflow-wrap: break-word;
}

.band-lede {
    max-width: 46ch;
    font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
    line-height: 1.5;
    color: var(--hint-strong);
}

/* An expiry/platform caveat: always visible, full hint contrast, no decoration. */
.caveat {
    max-width: 60ch;
    color: var(--hint);
    font-size: 0.9375rem;
}

.band-more,
.band-actions {
    margin-top: 28px;
}

/* Page introductions (features, pricing, download): headline and lede start-aligned on the paper, the
 * page's body (price sheet, notices, platforms) directly under them on the same edge. */
.intro {
    padding-block: 48px 40px;
}

.intro-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
}

.intro-inner .lede {
    max-width: 46ch;
    font-size: clamp(1.125rem, 1.05rem + 0.45vw, 1.375rem);
    color: var(--hint-strong);
}

.intro-body {
    margin-top: 40px;
}

.intro-body > .notice {
    max-width: 46rem;
}

.display {
    /* The measure, capped at the column so very large text never overflows (clips) it. */
    max-width: min(20ch, 100%);
    font-size: var(--display-page);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.03em;
    overflow-wrap: break-word;
}

/* Closing actions (the access band): below 600px the primary action takes the full row; the quiet link
 * sits under it. (Home's first screen is styled by cinematic-hero.css.) */
.access-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 28px;
}

.access-actions > .btn {
    flex: 1 1 100%;
}

/* real screenshots only (contract: never fabricated) */
.device {
    width: min(100%, 320px);
    overflow: hidden;
    border-radius: 28px;
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--separator), var(--shadow-lift);
}

.device img {
    width: 100%;
    height: auto;
}

/* ── the feature exhibit (home): one ink instrument ─────────────────────────────────────────────────
 * The native radio group, the decorative stage and the readouts on one grid whose areas change per
 * width (responsive blocks): stacked below 720px with the drawing first and the choices as an em-sized
 * auto-fit grid (2×2 on a phone, one per row under enlarged text); stage | readout from 720px; title and
 * choices beside the stage with the readout below from 960px; choices | stage | readout from 1200px;
 * one column whenever the stage is absent. The qualifier (availability depends on platform, version
 * and Pro terms) closes it as a full-width foot line, always visible. */
.band-exhibit {
    padding-block: 0 56px;
}

.exhibit {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    /* Below 720px the aria-hidden drawing comes first visually (DOM and control order are unchanged), so
     * a working mechanism, not only type and choices, reaches the first screen. */
    grid-template-areas: "stage" "title" "picks" "readout" "foot";
    gap: 24px;
    padding: 20px;
    border-radius: 24px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 40px 80px -52px rgba(38, 32, 20, 0.7);
}

.exhibit > * {
    min-width: 0;
}

.exhibit-title {
    grid-area: title;
    max-width: min(24ch, 100%);
    font-size: 1.25rem;
    font-weight: 650;
    line-height: 1.25;
    letter-spacing: -0.01em;
    overflow-wrap: break-word;
}

.exhibit-picks {
    grid-area: picks;
    margin: 0;
    padding: 0;
    border: 0;
}

/* The legend is an instrument label: small monospaced capitals in the hint tone. */
.exhibit-legend {
    margin-bottom: 12px;
    padding: 0;
    color: var(--hint);
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.picks {
    display: grid;
    /* em, not a rem breakpoint: under enlarged computed text the keys drop to one per row at 320px. */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 6.75em), 1fr));
    gap: 8px;
    counter-reset: pick;
}

/* A choice: icon, generated index over the name and short line, and a drawn radio, on a hairline key
 * (below 960px icon and radio sit over the name; responsive block). */
.pick {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    min-height: var(--touch);
    padding: 14px;
    border: 1px solid var(--separator);
    border-radius: 14px;
    background: rgba(238, 240, 243, 0.025);
    color: var(--text);
    cursor: pointer;
    counter-increment: pick;
    transition: background-color var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.pick:hover {
    border-color: var(--control-border);
    background: rgba(238, 240, 243, 0.06);
}

/* The native radio itself, transparent and covering the whole label: pointer hits land on it, and the
 * focus scroll-into-view (arrow keys, Tab) targets the full choice instead of a 1px clip, so the
 * selected choice is never left mostly under the pinned header or below the fold. Still a real,
 * focusable, labelled radio for assistive technology; the visible cues are the drawn dot, the icon and
 * the key below. */
.pick-control {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    scroll-margin-block: 6px;
    border-radius: inherit;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.pick-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    color: var(--hint);
    transition: color var(--ease);
}

.pick-icon svg.icon {
    width: 20px;
    height: 20px;
}

.pick-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.pick-name {
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.3;
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
}

/* The generated index (empty alt text where supported, so the radio's accessible name stays the
 * feature's name and short line). */
.pick-name::before {
    content: counter(pick, decimal-leading-zero);
    content: counter(pick, decimal-leading-zero) / "";
    display: block;
    margin-bottom: 4px;
    color: var(--hint);
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.pick-short {
    color: var(--hint);
    font-size: 0.9375rem;
    line-height: 1.45;
}

/* A drawn radio: a ring that fills thick when checked — a shape cue that survives forced colours. */
.pick-dot {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border: 2px solid var(--control-border);
    border-radius: 50%;
    transition: border-width var(--ease), border-color var(--ease);
}

.pick input:checked ~ .pick-dot {
    border: 6px solid var(--cobalt);
}

.pick input:checked ~ .pick-icon {
    color: var(--cobalt);
}

/* Selected: a cobalt edge and a 3px start bar on a lifted key — shape cues on top of the filled radio. */
.pick:has(input:checked) {
    border-color: var(--cobalt);
    background: rgba(142, 167, 255, 0.1);
    box-shadow: inset 3px 0 0 var(--cobalt);
}

.pick:has(input:focus-visible) {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

@supports not selector(:has(*)) {
    .pick input:focus-visible ~ .pick-dot {
        outline: 2px solid var(--focus);
        outline-offset: 3px;
    }
}

/* Only the selected feature's readout and mechanism are shown on screen; print and engines without
 * :has() keep every readout (and never show the stage, below). */
@media screen {
    .exhibit:has(#feature-vault:checked) :is(.mech, .readout):not(.mech-vault, .readout-vault),
    .exhibit:has(#feature-chat_lock:checked) :is(.mech, .readout):not(.mech-chat_lock, .readout-chat_lock),
    .exhibit:has(#feature-edit_history:checked) :is(.mech, .readout):not(.mech-edit_history, .readout-edit_history),
    .exhibit:has(#feature-tasks:checked) :is(.mech, .readout):not(.mech-tasks, .readout-tasks) {
        display: none;
    }
}

/* The stage: the exhibit's one glass window — a recessed well with corner registration marks and a
 * soft cobalt key light; a glass streak lies on each mechanism (so it sweeps once per selection).
 * Decorative (aria-hidden, no controls inside). Shown only on screen where :has() and container units
 * exist; otherwise the readouts simply show without a drawing. Mechanism geometry is in cqi of the
 * stage (100cqi wide, 80cqi tall at its fixed 5/4 ratio), so each drawing scales as one at any width
 * or text size, and the stage clips it, so it never reaches the copy. Its width is in px, not rem, so
 * it keeps its size under text zoom and leaves the width to the copy. */
.exhibit-stage {
    grid-area: stage;
    display: none;
    position: relative;
    width: min(100%, 280px);
    justify-self: center;
    align-self: start;
    aspect-ratio: 5 / 4;
    overflow: hidden;
    border-radius: 18px;
    container-type: inline-size;
    background:
        radial-gradient(56% 52% at 50% 46%, rgba(78, 108, 230, 0.2), rgba(78, 108, 230, 0) 72%),
        linear-gradient(180deg, #0b0d11 0%, #060709 100%);
    box-shadow: inset 0 0 0 1px rgba(238, 240, 243, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -28px 48px -28px rgba(0, 0, 0, 0.8);
}

@supports selector(:has(*)) and (width: 1cqi) {
    @media screen {
        .exhibit-stage {
            display: block;
        }
    }
}

.exhibit-stage::before {
    --mark: rgba(238, 240, 243, 0.28);
    content: "";
    position: absolute;
    inset: 12px;
    z-index: 3;
    pointer-events: none;
    background:
        linear-gradient(var(--mark), var(--mark)) 0 0 / 12px 1px no-repeat,
        linear-gradient(var(--mark), var(--mark)) 0 0 / 1px 12px no-repeat,
        linear-gradient(var(--mark), var(--mark)) 100% 0 / 12px 1px no-repeat,
        linear-gradient(var(--mark), var(--mark)) 100% 0 / 1px 12px no-repeat,
        linear-gradient(var(--mark), var(--mark)) 0 100% / 12px 1px no-repeat,
        linear-gradient(var(--mark), var(--mark)) 0 100% / 1px 12px no-repeat,
        linear-gradient(var(--mark), var(--mark)) 100% 100% / 12px 1px no-repeat,
        linear-gradient(var(--mark), var(--mark)) 100% 100% / 1px 12px no-repeat;
}

.mech {
    position: absolute;
    inset: 0;
}

.mech > span {
    position: absolute;
    display: block;
}

.mech::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0) 34%, rgba(255, 255, 255, 0.07) 44%,
        rgba(255, 255, 255, 0.015) 51%, rgba(255, 255, 255, 0) 58%);
}

/* Part vocabulary shared by the four drawings: a tray (.m-col); neutral bars (.m-bar: a capsule with
 * a short light mark, extruded by a hard lower lip and a soft drop); the cobalt "this one" (.m-on);
 * sheets and tasks below. Shapes only — no text, avatars, timestamps, bubble tails or badges. Each
 * drawing's static state is its final state; the motion block only plays the change into it. */
.m-col {
    border-radius: 5cqi;
    background: linear-gradient(180deg, rgba(238, 240, 243, 0.05), rgba(238, 240, 243, 0.015));
    box-shadow: inset 0 0 0 1px rgba(238, 240, 243, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.m-bar {
    height: 9cqi;
    border-radius: 4.5cqi;
    background: linear-gradient(180deg, #2c323c, #1f242c);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0.7cqi 0 #0a0c10, 0 2cqi 3cqi -1.5cqi rgba(0, 0, 0, 0.8);
}

.m-bar::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 9%;
    width: 36%;
    height: 1.4cqi;
    margin-top: -0.7cqi;
    border-radius: 1cqi;
    background: rgba(238, 240, 243, 0.24);
}

.m-on {
    background: linear-gradient(180deg, #3d58c9, #2b409e);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 0 0 1px rgba(170, 190, 255, 0.5),
        0 0.7cqi 0 #141e52, 0 2.4cqi 4cqi -1.5cqi rgba(40, 70, 210, 0.6);
}

.m-on::before {
    background: rgba(255, 255, 255, 0.6);
}

/* Vault — hiding chosen chats: a column of five bars; the chosen (cobalt) one lifts out into the
 * recess beside it, the two below close the gap one slot up, a frosted lid draws shut over the recess
 * and four PIN dots seal it. At rest: four bars, an empty last slot, the chosen bar under the lid. */
.mech-vault .m-col {
    top: 8cqi;
    left: 8cqi;
    width: 40cqi;
    height: 64cqi;
}

.mech-vault .m-bar {
    left: 12cqi;
    width: 32cqi;
}

.mech-vault .m-r1 {
    top: 12cqi;
}

.mech-vault .m-r2 {
    top: 24cqi;
}

.mech-vault .m-r4 {
    top: 36cqi;
}

.mech-vault .m-r5 {
    top: 48cqi;
}

.mech-vault .m-recess {
    top: 24cqi;
    left: 56cqi;
    width: 38cqi;
    height: 30cqi;
    border-radius: 5cqi;
    background: #040506;
    box-shadow: inset 0 1.2cqi 2.4cqi rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(238, 240, 243, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.06);
}

.mech-vault .m-pick {
    top: 34.5cqi;
    left: 59cqi;
}

/* Opaque frosted solid by default (a faint cobalt glow hints at what it covers); real translucent
 * frost only with backdrop blur and no reduced-transparency or increased-contrast preference. */
.mech-vault .m-lid {
    top: 24cqi;
    left: 56cqi;
    width: 38cqi;
    height: 30cqi;
    border-radius: 5cqi;
    background:
        radial-gradient(46% 34% at 50% 42%, rgba(70, 100, 225, 0.4), rgba(70, 100, 225, 0)),
        linear-gradient(170deg, #3a4254, #262c39);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), inset 0 0 0 1px rgba(200, 212, 240, 0.2);
}

@media (prefers-reduced-transparency: no-preference) {
    @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
        .mech-vault .m-lid {
            background: linear-gradient(170deg, rgba(205, 216, 242, 0.2), rgba(120, 140, 192, 0.08) 55%, rgba(205, 216, 242, 0.14));
            -webkit-backdrop-filter: blur(1.8cqi) saturate(130%);
            backdrop-filter: blur(1.8cqi) saturate(130%);
        }
    }
}

@media (prefers-contrast: more) {
    .mech-vault .m-lid {
        background: linear-gradient(170deg, #3a4254, #262c39);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

.mech-vault .m-seal {
    top: 47.6cqi;
    left: 67cqi;
    width: 16cqi;
    height: 2.4cqi;
    background: radial-gradient(circle closest-side, #d3ddff 0 70%, rgba(211, 221, 255, 0) 80%) 0 50% / 4cqi 2.4cqi repeat-x;
}

/* Chat lock — locking one chat: four bars, each with a title mark and a fainter preview line; the
 * cobalt one stays where it is while PIN dots mask its preview and a shackle seats onto its end. */
.mech-chat_lock .m-col {
    top: 7cqi;
    left: 14cqi;
    width: 72cqi;
    height: 63cqi;
}

.mech-chat_lock .m-bar {
    left: 19cqi;
    width: 62cqi;
    height: 10cqi;
    border-radius: 5cqi;
}

.mech-chat_lock .m-bar::before {
    top: 36%;
    width: 30%;
}

.mech-chat_lock .m-bar::after {
    content: "";
    position: absolute;
    top: 60%;
    left: 9%;
    width: 52%;
    height: 1.1cqi;
    margin-top: -0.55cqi;
    border-radius: 1cqi;
    background: rgba(238, 240, 243, 0.13);
}

.mech-chat_lock .m-r1 {
    top: 11cqi;
}

.mech-chat_lock .m-r2 {
    top: 29cqi;
}

.mech-chat_lock .m-r3 {
    top: 43cqi;
}

.mech-chat_lock .m-r4 {
    top: 57cqi;
}

/* Drawn before the bars, so the locked bar covers the shackle's feet. */
.mech-chat_lock .m-shackle {
    top: 21.6cqi;
    left: 69cqi;
    width: 7.6cqi;
    height: 8.4cqi;
    border: 1.2cqi solid #c7d3ff;
    border-bottom: 0;
    border-radius: 3.8cqi 3.8cqi 0 0;
}

.mech-chat_lock .m-mask {
    top: 33.7cqi;
    left: 23.6cqi;
    width: 34.2cqi;
    height: 2.6cqi;
    border-radius: 1.3cqi;
    background:
        radial-gradient(circle closest-side, rgba(222, 230, 255, 0.9) 0 62%, rgba(222, 230, 255, 0) 74%) 0.3cqi 50% / 3.4cqi 2.6cqi repeat-x,
        #33499f;
}

/* Edit history — earlier versions: the current (cobalt) sheet in front; three ghost sheets, each with
 * different line lengths (the content changed), fan out up and behind it, fainter with age, while a
 * version spine fills from the current version back. --fan-* is each ghost's start offset (motion). */
.mech-edit_history .m-sheet {
    width: 48cqi;
    height: 16cqi;
    border-radius: 4cqi;
}

.m-sheet::before,
.m-sheet::after {
    content: "";
    position: absolute;
    left: 8%;
    height: 1.5cqi;
    border-radius: 1cqi;
    background: rgba(200, 212, 255, 0.3);
}

.m-sheet::before {
    top: 34%;
    width: var(--line-a);
}

.m-sheet::after {
    top: 62%;
    width: var(--line-b);
}

.m-ghost {
    background: rgba(142, 167, 255, 0.05);
    box-shadow: inset 0 0 0 1px rgba(170, 190, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.m-sheet.m-on::before {
    background: rgba(255, 255, 255, 0.6);
}

.m-sheet.m-on::after {
    background: rgba(255, 255, 255, 0.34);
}

.mech-edit_history .m-v3 {
    --line-a: 40%;
    --line-b: 58%;
    --fan-x: -24cqi;
    --fan-y: 36cqi;
    top: 13cqi;
    left: 38cqi;
    opacity: 0.4;
}

.mech-edit_history .m-v2 {
    --line-a: 70%;
    --line-b: 30%;
    --fan-x: -16cqi;
    --fan-y: 24cqi;
    top: 25cqi;
    left: 30cqi;
    opacity: 0.62;
}

.mech-edit_history .m-v1 {
    --line-a: 50%;
    --line-b: 72%;
    --fan-x: -8cqi;
    --fan-y: 12cqi;
    top: 37cqi;
    left: 22cqi;
    opacity: 0.85;
}

.mech-edit_history .m-now {
    --line-a: 62%;
    --line-b: 40%;
    top: 49cqi;
    left: 14cqi;
}

/* Four version nodes on one thread, centred on the sheets' rows (12cqi apart); the newest is filled. */
.mech-edit_history .m-spine {
    top: 19.8cqi;
    left: 90.8cqi;
    width: 2.4cqi;
    height: 38.4cqi;
    background:
        radial-gradient(circle closest-side, #aebfff 0 64%, rgba(174, 191, 255, 0) 74%) 50% 100% / 2.4cqi 2.4cqi no-repeat,
        radial-gradient(circle closest-side at 50% 1.2cqi, #0a0c10 0 40%, rgba(170, 190, 255, 0.75) 46% 64%, rgba(170, 190, 255, 0) 74%) 50% 0 / 2.4cqi 12cqi repeat-y,
        linear-gradient(rgba(170, 190, 255, 0.3), rgba(170, 190, 255, 0.3)) 50% 50% / 0.3cqi calc(100% - 2.4cqi) no-repeat;
}

/* Tasks — organising: four task bars (a check box and a title mark) settle from a loose, shuffled
 * spread into one ordered column, then ticks land in sequence on the first three; the fourth stays
 * open. --from-* is each bar's start offset (motion). */
.mech-tasks .m-col {
    top: 8cqi;
    left: 12cqi;
    width: 76cqi;
    height: 64cqi;
}

.m-task {
    --line: rgba(238, 240, 243, 0.26);
    left: 18cqi;
    width: 64cqi;
    height: 10cqi;
    border-radius: 3cqi;
    background:
        linear-gradient(var(--line), var(--line)) 14cqi 50% / var(--len) 1.4cqi no-repeat,
        linear-gradient(180deg, #2c323c, #1f242c);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0.7cqi 0 #0a0c10, 0 2cqi 3cqi -1.5cqi rgba(0, 0, 0, 0.8);
}

.m-task::before {
    content: "";
    position: absolute;
    top: 2.2cqi;
    left: 3.2cqi;
    width: 5.6cqi;
    height: 5.6cqi;
    border: 0.45cqi solid rgba(238, 240, 243, 0.5);
    border-radius: 1.4cqi;
}

.m-done {
    --line: rgba(238, 240, 243, 0.13);
}

.m-done::before {
    border-color: #8ea7ff;
    background-color: #8ea7ff;
}

.m-done::after {
    content: "";
    position: absolute;
    top: 3.3cqi;
    left: 5.25cqi;
    width: 1.5cqi;
    height: 2.8cqi;
    border: solid #0f1216;
    border-width: 0 0.55cqi 0.55cqi 0;
    transform: rotate(45deg);
}

.mech-tasks .m-t1 {
    --len: 30cqi;
    --from-x: 8cqi;
    --from-y: 28cqi;
    --from-r: -4deg;
    top: 13cqi;
}

.mech-tasks .m-t2 {
    --len: 22cqi;
    --from-x: -7cqi;
    --from-y: 4cqi;
    --from-r: 4deg;
    top: 27cqi;
}

.mech-tasks .m-t3 {
    --len: 36cqi;
    --from-x: 10cqi;
    --from-y: -28cqi;
    --from-r: 3deg;
    top: 41cqi;
}

.mech-tasks .m-t4 {
    --len: 26cqi;
    --from-x: -5cqi;
    --from-y: -3cqi;
    --from-r: -5deg;
    top: 55cqi;
}

.exhibit-readouts {
    grid-area: readout;
    display: grid;
    gap: 40px;
}

.readout {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
}

.readout > * {
    max-width: 100%;
}

.readout h3 {
    max-width: min(16ch, 100%);
    font-size: clamp(1.625rem, 1.3rem + 1.2vw, 2.25rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.025em;
    overflow-wrap: break-word;
}

.readout-long {
    max-width: 44ch;
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--hint-strong);
}

.readout .points {
    align-self: stretch;
}

.exhibit-foot {
    grid-area: foot;
    padding-top: 18px;
    border-top: 1px solid var(--separator);
    color: var(--hint);
    font-size: 0.9375rem;
}

/* ── ruled bands (home privacy, Pro, sharing, news, FAQ) ─────────────────────────────────────────────
 * One editorial split: a hairline, then the serif heading (with any lede and caveat) in the narrow
 * column and the content in the wide one from 960px (responsive block), stacked and start-aligned on
 * one edge below it. No panels, light fields, numbering or icon tiles. */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--rule);
}

.split > * {
    min-width: 0;
}

.split-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.split-head > * {
    max-width: 100%;
}

.split-head h2 {
    max-width: min(16ch, 100%);
}

.split-body {
    max-width: 46rem;
}

.split-more {
    margin-top: 20px;
}

/* Keep enlarged text inside the ruled bands, including long words beside inline icons. */
.split :is(h2, h3, p, li, summary) {
    min-width: 0;
    overflow-wrap: anywhere;
}

.facts {
    margin: 0;
    padding: 0;
    list-style: none;
}

.fact {
    padding-block: 18px;
    font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
    line-height: 1.5;
}

.fact:first-child {
    padding-top: 0;
}

.fact + .fact {
    border-top: 1px solid var(--separator);
}

/* Home's FAQ: the shared hairline accordion under the split's own rule (the help page keeps its own). */
:where(.marketing) .split .faq {
    max-width: 46rem;
    border-top: 0;
}

:where(.marketing) .split .faq details:first-child > summary {
    min-height: var(--touch);
    padding-top: 0;
}

.band-pro .check-list-lined li {
    font-size: 1.0625rem;
}

.band-pro .panel {
    width: 100%;
}

/* Hairline lists (free access, how pricing works, download notes): rows divided by hairlines, the
 * inline icon in cobalt; no surface. */
.check-list-lined {
    gap: 0;
    padding: 0;
}

.check-list-lined li {
    gap: 14px;
    padding-block: 16px;
}

.check-list-lined li:first-child {
    padding-top: 0;
}

.check-list-lined li + li {
    border-top: 1px solid var(--separator);
}

.check-list-lined svg.icon {
    color: var(--cobalt);
}

/* Long localized list lines (free-access facts at large text sizes) shrink with their row and wrap
 * inside it instead of overflowing; normal-size lines are unaffected. */
:where(.marketing) .check-list li > span {
    min-width: 0;
    overflow-wrap: break-word;
}

/* Longer factual statements (features): the serif voice in a reading measure, set off by an ink rule. */
.statement {
    max-width: 46ch;
    padding-left: 22px;
    border-left: 2px solid var(--text);
    font-family: var(--serif);
    font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
    line-height: 1.45;
}

/* Two short items side by side from 720px (home sharing, pricing in-app/refunds): ruled columns. */
.pair {
    display: grid;
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pair-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
}

.pair-item > * {
    min-width: 0;
    max-width: 100%;
}

.pair-item :is(h2, h3) {
    font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem);
}

/* Inside a ruled split the split's own hairline already leads the items. */
.split .pair-item {
    padding-top: 0;
    border-top: 0;
}

/* Paper sheet: the one surface on the paper canvas, for a table of values (plans) — a rule-strength
 * edge, cells divided by hairlines (each cell draws its top and start edges; the sheet clips the outer
 * ones). flex-wrap lets the last row's cells stretch, so a wrapped row never leaves an empty cell, and
 * long localized prices wrap instead of being clipped. */
.panel {
    overflow: hidden;
    border: 1px solid var(--rule);
    border-radius: 16px;
    background: var(--surface);
}

/* Plans read as one price strip, not a full-width table. */
.panel:has(> .plans) {
    max-width: 60rem;
}

.panel-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -1px 0 0 -1px;
    padding: 0;
    list-style: none;
}

.panel-grid > * {
    flex: 1 1 15rem;
    min-width: 0;
    border-top: 1px solid var(--separator);
    border-left: 1px solid var(--separator);
}

.panel-foot {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px var(--pad);
    border-top: 1px solid var(--separator);
}

/* plans */

.plan {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 28px 24px;
}

.plan-name {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}

.plan-price {
    font-size: clamp(2rem, 1.7rem + 1.2vw, 2.75rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-variant-numeric: lining-nums tabular-nums;
}

.plan .money {
    white-space: normal;
    overflow-wrap: anywhere;
}

.plan-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    color: var(--hint);
    font-size: 0.9375rem;
}

.plan-savings {
    margin-top: 6px;
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    background: var(--accent-tint);
    color: var(--ghost-text);
    font-weight: 600;
}

/* Small ink icon tile (features chapters): the canvas's only icon tiles, echoing the exhibit. */
.story-icon {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 12px 24px -16px rgba(38, 32, 20, 0.7);
    color: #b9c8ff;
}

.story-icon svg.icon {
    width: 22px;
    height: 22px;
}

.story-icon-lg {
    width: 56px;
    height: 56px;
    border-radius: 14px;
}

.story-icon-lg svg.icon {
    width: 26px;
    height: 26px;
}

/* Features page: one ruled chapter per feature — ink icon tile and serif heading in the narrow column,
 * description, points and qualifiers in the wide one from 960px; a supplied screenshot takes the right
 * column beside both (responsive block). No card. */
.chapter {
    padding-block: 32px;
}

.chapter-inner {
    display: grid;
    gap: 20px 64px;
    padding-top: 28px;
    border-top: 1px solid var(--rule);
}

.chapter-inner > * {
    min-width: 0;
}

.chapter-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
}

.chapter-head h2 {
    max-width: min(14ch, 100%);
}

.chapter-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chapter-long {
    max-width: 40ch;
    font-size: clamp(1.1875rem, 1.1rem + 0.45vw, 1.4375rem);
    line-height: 1.45;
    letter-spacing: -0.01em;
}

.chapter-media {
    justify-self: start;
}

.points {
    list-style: none;
    padding: 0;
    max-width: 58ch;
    border-top: 1px solid var(--separator);
}

.points li {
    position: relative;
    padding: 12px 0 12px 20px;
    border-bottom: 1px solid var(--separator);
}

/* Centred on the first line (line-height 1.55). */
.points li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: calc(12px + 0.775em - 3px);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cobalt);
}

/* Downloads: one ruled hairline list — the platform name beside its releases from 720px. A release is
 * its channel and date with a labelled button; no published link is a quiet status line (an icon and
 * two lines of text, no surface), visibly not an action. */
.platforms {
    display: grid;
    max-width: 60rem;
    border-top: 1px solid var(--rule);
}

.platform {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px 40px;
    padding-block: 24px;
    border-bottom: 1px solid var(--separator);
}

.platform > * {
    min-width: 0;
}

.platform-title {
    font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.release-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.release + .release {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--separator);
}

.release > * + * {
    margin-top: 6px;
}

.release > p:last-child {
    margin-top: 14px;
}

.release .row-label {
    font-weight: 600;
}

.release-empty {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.release-empty > * + * {
    margin-top: 0;
}

.release-empty > svg.icon {
    margin-top: 0.15em;
    color: var(--hint);
}

/* The APK this site serves itself: the button, then its facts. The file's checksum and the certificate's
 * fingerprint are unbroken runs of hex (64 and 95 characters): each stands in a box of its own and breaks
 * inside it — between the groups the markup offers (<wbr>), and anywhere at all should even a group not fit —
 * so no screen, a 390px phone included, is ever narrower than the page; one tap selects the whole run. */
.release-direct .release-action {
    margin-top: 12px;
}

.release-facts {
    display: grid;
    gap: 14px;
    margin: 14px 0 0;
}

.release-facts > div {
    min-width: 0;
}

.release-facts dt {
    font-size: 0.9375rem;
    color: var(--hint);
}

.release-facts dd {
    margin: 6px 0 0;
}

.release-facts dd > * + * {
    margin-top: 6px;
}

/* What follows the facts is about the install as a whole, not about the last fact: it stands apart from it. */
.release-facts + p {
    margin-top: 14px;
}

.release-hash {
    display: block;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--separator);
    border-radius: var(--radius-control);
    background: var(--surface-sunken);
    font-size: 0.8125rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
    -webkit-user-select: all;
    user-select: all;
}

/* What only somebody who checks a file needs — the checksum, the fingerprint, the two installs — stands behind one
 * native <details>, closed until opened: no script, the browser's own control. Its summary is a quiet link-like row,
 * the label and the site's chevron (it turns down once the entry is open): as tall as a touch target and as wide as
 * its words plus 8px on either side — room for a finger and for the focus ring — while the words still start on the
 * entry's own edge; the label wraps where the screen is narrower than it. Nothing above it moves when it opens. The
 * focus ring is the site's own (:focus-visible): no rule here takes it away. */
.release-more > summary {
    display: flex;
    align-items: center;
    gap: 2px;
    width: fit-content;
    max-width: calc(100% + 16px);
    min-height: var(--touch);
    margin-inline: -8px;
    padding-inline: 8px;
    border-radius: var(--radius-control);
    color: var(--link);
    font-size: 0.9375rem;
    cursor: pointer;
    list-style: none;
}

.release-more > summary::-webkit-details-marker {
    display: none;
}

/* The underline is for a pointer that hovers: a touch screen would keep it after a tap, until the next one elsewhere. */
@media (hover: hover) {
    .release-more > summary:hover {
        text-decoration: underline;
    }
}

.release-more > summary > svg.icon {
    transition: transform var(--ease);
}

.release-more[open] > summary > svg.icon {
    transform: rotate(90deg);
}

/* The checksum file closes the opened entry: it stands apart from the paragraph before it, as it did. */
.release-more > p:last-child {
    margin-top: 14px;
}

/* ── access (home, features): the closing ink band ─────────────────────────────────────────────────
 * Where to get the app: the serif heading, the download page's official-links rule and the
 * unofficial-client note (home), and the actions — beside the copy from 960px, bottom-aligned. It links
 * to the real download route only and never claims that a file was fetched. */
.band-access {
    padding-block: 64px;
}

.access {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
}

.access > * {
    min-width: 0;
}

.access-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.access-copy > * {
    max-width: 100%;
}

.band-access h2 {
    max-width: min(16ch, 100%);
    font-size: clamp(2rem, 1.3rem + 2.8vw, 3.5rem);
}

.access-body {
    max-width: 46ch;
    color: var(--hint-strong);
    font-size: 1.125rem;
    line-height: 1.5;
}

.access-note {
    max-width: 52ch;
    color: var(--hint);
    font-size: 0.9375rem;
}

/* ── responsive ────────────────────────────────────────────────────────── */

/* Narrow phones (≤379px): tighten header spacing so brand + tools share one row with the nav below.
 * Targets stay 44px; flex-wrap still lets the tools drop a line when they need it (signed-in, zoom). */
@media (max-width: 379px) {
    .header-inner {
        column-gap: 8px;
    }

    .header-inner > .brand {
        gap: 8px;
    }

    .header-tools {
        gap: 4px;
    }

    .header-tools .menu > summary {
        padding-inline: 9px;
    }

    .header-tools .btn {
        padding-inline: 12px;
    }
}

/* Below 960px each feature choice stacks its icon and drawn radio over the index and name, so the keys
 * fit a 2×2 on a phone or one row on wider screens (em-sized auto-fit) and the drawing starts high.
 * The short line is only visually hidden (it stays in each radio's accessible name; the selected
 * readout carries the full text). Each key is still one whole label covered by its transparent radio,
 * far above the 44px minimum; rows share a height so the names line up. */
@media (max-width: 959px) {
    .pick {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto 1fr;
        grid-template-areas:
            "icon dot"
            "text text";
        gap: 12px 8px;
        padding: 12px;
    }

    .pick-icon {
        grid-area: icon;
    }

    .pick-dot {
        grid-area: dot;
    }

    .pick-text {
        grid-area: text;
        align-self: end;
    }

    .pick-short {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

@media (min-width: 600px) {
    :root {
        --pad: 20px;
    }

    .wrap {
        padding-inline: 28px;
    }

    .btn-row {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .btn-row > .btn {
        width: auto;
    }

    .teaser-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .kv {
        grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
    }

    .kv dd {
        margin: 0;
    }

    .kv dt,
    .kv dd {
        padding-block: 4px;
    }

    .filters {
        grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
        align-items: end;
    }

    .cta-band {
        padding: 36px 40px;
    }

    .panel-foot {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 14px 28px;
        padding: 24px 32px;
    }

    .panel-foot .hint {
        flex: 1 1 18rem;
    }

    .access-actions > .btn {
        flex: 0 0 auto;
    }

    .exhibit {
        padding: 28px;
        border-radius: 28px;
    }
}

@media (min-width: 720px) {
    .pair {
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
        gap: 48px;
    }

    .platform {
        grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
        align-items: start;
    }

    /* Exhibit: the choices in one row where their em-sized keys fit, the drawing beside its readout. */
    .exhibit {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas:
            "title title"
            "picks picks"
            "stage readout"
            "foot foot";
        column-gap: 28px;
        align-items: start;
    }

    .exhibit-stage {
        width: 100%;
    }
}

@media (min-width: 960px) {
    .wrap {
        padding-inline: 40px;
    }

    .site-main {
        padding-block: 48px 96px;
    }

    :root {
        --header-estimate: 4.0625rem;
    }

    .header-inner {
        flex-wrap: nowrap;
        gap: 28px;
        min-height: 64px;
    }

    .nav-primary {
        order: 0;
        flex: 1 1 auto;
    }

    /* Still a scroll box (long Russian labels at 960–1100px), so the 4px keeps focus rings unclipped. */
    .nav-primary ul {
        padding: 4px;
        margin: 0 -4px;
        scroll-padding-inline: 4px;
    }

    .section {
        padding-block: 64px;
    }

    .band {
        padding-block: 88px;
    }

    .intro {
        padding-block: 80px 64px;
    }

    .band-head {
        margin-bottom: 48px;
    }

    /* Exhibit: title and choices beside the drawing, the readout across the width below. */
    .band-exhibit {
        padding-block: 0 88px;
    }

    .exhibit {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        grid-template-rows: auto 1fr auto auto;
        grid-template-areas:
            "title stage"
            "picks stage"
            "readout readout"
            "foot foot";
        gap: 32px clamp(32px, 4vw, 56px);
        padding: 40px;
        border-radius: 32px;
    }

    .picks {
        grid-template-columns: minmax(0, 1fr);
    }

    .split {
        grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
        column-gap: clamp(48px, 7vw, 120px);
        padding-top: 32px;
    }

    .chapter {
        padding-block: 40px;
    }

    .chapter-inner {
        grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
        align-items: start;
        padding-top: 36px;
    }

    .chapter.has-media .chapter-inner {
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    }

    .chapter.has-media .chapter-head {
        grid-column: 1;
        grid-row: 1;
    }

    .chapter.has-media .chapter-body {
        grid-column: 1;
        grid-row: 2;
    }

    .chapter.has-media .chapter-media {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
    }

    .band-access {
        padding-block: 104px;
    }

    .access {
        grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
        column-gap: clamp(40px, 6vw, 96px);
        align-items: end;
    }

    .footer-grid {
        grid-template-columns: 2fr repeat(3, minmax(0, 1fr));
        gap: 40px;
    }

    .footer-brand {
        grid-column: auto;
    }

    .shell {
        grid-template-columns: 15rem minmax(0, 1fr);
        gap: 40px;
        align-items: start;
    }

    /* Sticks below the pinned header; a sidebar longer than the remaining height scrolls itself
     * instead of hanging off the bottom of a short window (4px keeps focus rings inside). */
    .nav-side {
        position: sticky;
        top: calc(var(--header-space) + 24px);
        max-height: calc(100vh - var(--header-space) - 48px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 4px;
        margin: -4px;
    }

    .nav-side ul {
        flex-direction: column;
        gap: 2px;
    }

    .nav-side a {
        display: flex;
        background: transparent;
        border: 0;
    }
}

/* 960–1199px: the readout spans the instrument under choices and drawing — name, description and link
 * beside the points. */
@media (min-width: 960px) and (max-width: 1199px) {
    .readout {
        display: grid;
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        column-gap: clamp(32px, 4vw, 56px);
        align-content: start;
    }

    .readout > :not(.points) {
        grid-column: 1;
    }

    .readout > .points {
        grid-column: 2;
        grid-row: 1 / span 3;
    }
}

/* From 1200px: choices | drawing | readout, the qualifier across the foot. The choices become a compact
 * selector (index, icon, name, radio): the short line is only visually hidden there, as below 960px,
 * because the readout beside it carries the full description. */
@media (min-width: 1200px) {
    .exhibit {
        grid-template-columns: minmax(0, 3fr) minmax(0, 5.4fr) minmax(0, 3.6fr);
        grid-template-rows: auto 1fr auto;
        grid-template-areas:
            "title stage readout"
            "picks stage readout"
            "foot foot foot";
    }

    .pick {
        align-items: center;
    }

    .pick-short {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

/* Without the stage (forced colours, print, engines without :has() or container units) the exhibit is
 * one column — title, choices, readout(s), qualifier — so the readout keeps the full width instead of
 * sitting beside an empty drawing column. Forced colours keep the working native choice. */
@supports not (selector(:has(*)) and (width: 1cqi)) {
    .exhibit {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-template-areas: "title" "picks" "readout" "foot";
    }
}

@media print, (forced-colors: active) {
    .exhibit {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-template-areas: "title" "picks" "readout" "foot";
    }
}

/* Short screens below 960px (landscape phones, heavy zoom): a drawing bounded by the viewport height
 * keeps the exhibit's choices near the top. */
@media (max-width: 959px) and (max-height: 32rem) {
    .exhibit-stage {
        max-width: 90vh;
    }
}

/* Short screens below 960px (landscape phones, heavy zoom): one header row — brand, the sideways
 * scrolling nav, tools — so the pinned header stays ~61px instead of two rows. Under 600px the brand
 * word is visually hidden but still names the home link for assistive technology. */
@media (max-width: 959px) and (max-height: 32rem) {
    :root {
        --header-estimate: 3.8125rem;
    }

    .header-inner {
        flex-wrap: nowrap;
        column-gap: 8px;
    }

    .nav-primary {
        order: 0;
        flex: 1 1 0;
    }

    .nav-primary ul {
        padding: 4px;
        margin: 0;
        scroll-padding-inline: 4px;
    }

    .header-tools {
        margin-inline-start: 0;
    }
}

@media (max-width: 599px) and (max-height: 32rem) {
    .header-inner > .brand .brand-word {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

/* ── motion: marketing pages only (html.marketing), CSS-driven ───────────────────────────────────
 * Everything here sits behind prefers-reduced-motion: no-preference, a live query, so switching the OS
 * setting applies at once without script; account, staff, checkout and other functional pages get none
 * of it. Rules this block keeps:
 *   - Readable content is never hidden or delayed: text and controls move by transform only; opacity
 *     and clip-path animate only decorative mechanism parts inside the aria-hidden stage.
 *   - Everything time-based is finite: the introductions settle once per load (under 1s); a mechanism
 *     plays once (≤2.1s) each time its feature is selected (shown again after display: none restarts
 *     it) and rests on its final state, which is also its static drawing. Nothing loops, nothing is
 *     scroll-driven, nothing plays on its own after that.
 *   - The exhibit's pointer tilt is the one script-fed input (next block).
 *   - Hover/focus feedback only on real links, buttons and the feature choices. */

@media (prefers-reduced-motion: no-preference) {
    html.marketing {
        scroll-behavior: smooth;
    }

    .marketing .intro :is(.display, .intro-inner > .lede) {
        animation: intro-rise 760ms var(--ease-settle) both;
    }

    .marketing .intro .display {
        animation-delay: 60ms;
    }

    .marketing .intro .intro-inner > .lede {
        animation-delay: 160ms;
    }

    /* The glass over the selected drawing catches one sweep of light. */
    .mech::after {
        animation: glass-sweep 1200ms var(--ease-settle) 300ms both;
    }

    /* Vault: the chosen bar lifts out and is carried into the recess; the bars below close the gap;
     * the lid draws shut; the PIN dots fill one by one. */
    .mech-vault .m-pick {
        animation: vault-carry 1000ms var(--ease-settle) 150ms both;
    }

    .mech-vault :is(.m-r4, .m-r5) {
        animation: vault-close 520ms var(--ease-settle) 560ms both;
    }

    .mech-vault .m-lid {
        animation: lid-shut 480ms var(--ease-settle) 1100ms both;
    }

    .mech-vault .m-seal {
        animation: dots-fill 520ms steps(4, end) 1500ms both;
    }

    /* Chat lock: PIN dots mask the preview line one by one; then the shackle drops and seats. */
    .mech-chat_lock .m-mask {
        animation: dots-fill 700ms steps(10, end) 250ms both;
    }

    .mech-chat_lock .m-shackle {
        animation: shackle-seat 640ms var(--ease-spring) 950ms both;
    }

    /* Edit history: the earlier versions fan out from behind the current one, newest first; the
     * version spine fills from the current version back. */
    .mech-edit_history .m-ghost {
        animation: sheet-fan 700ms var(--ease-settle) 120ms both;
    }

    .mech-edit_history .m-v2 {
        animation-delay: 240ms;
    }

    .mech-edit_history .m-v3 {
        animation-delay: 360ms;
    }

    .mech-edit_history .m-spine {
        animation: spine-fill 700ms var(--ease-settle) 300ms both;
    }

    /* Tasks: the loose bars settle into order; then the ticks land one after another. */
    .mech-tasks .m-task {
        animation: task-settle 620ms var(--ease-settle) both;
    }

    .mech-tasks .m-t2 {
        animation-delay: 60ms;
    }

    .mech-tasks .m-t3 {
        animation-delay: 120ms;
    }

    .mech-tasks .m-t4 {
        animation-delay: 180ms;
    }

    .mech-tasks .m-done::before {
        animation: tick-box 260ms var(--ease-settle) 760ms both;
    }

    .mech-tasks .m-done::after {
        animation: tick-land 380ms var(--ease-spring) 760ms both;
    }

    .mech-tasks .m-t2::before,
    .mech-tasks .m-t2::after {
        animation-delay: 960ms;
    }

    .mech-tasks .m-t3::before,
    .mech-tasks .m-t3::after {
        animation-delay: 1160ms;
    }
}

/* Pointer tilt (home exhibit stage only). With a hovering fine pointer, portal.js writes the unitless
 * --hero-pointer-x/--hero-pointer-y (-1 left/top edge … +1 right/bottom edge of the stage; re-clamped
 * here) on the [data-hero-interactive] stage while a mouse moves over it, and removes them on
 * leave/cancel, a hidden tab, a relevant preference change or teardown. The visible drawing then turns
 * toward the pointer by at most 6° about Y and 5° about X inside the stage's perspective, and its glass
 * streak glides the other way like a reflection. The transition is the only easing — nothing loops —
 * and removal glides back to rest. Only the decorative drawing moves: the stage frame, the choices and
 * every readout stay put; touch, no script, reduced motion and forced colours keep the resting pose
 * (absent properties resolve to 0). */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) and (forced-colors: none) {
    .marketing .exhibit-stage {
        --tilt-x: clamp(-1, var(--hero-pointer-x, 0), 1);
        --tilt-y: clamp(-1, var(--hero-pointer-y, 0), 1);
        perspective: 900px;
    }

    .marketing .mech {
        transform: rotateX(calc(var(--tilt-y) * -5deg)) rotateY(calc(var(--tilt-x) * 6deg));
        transition: transform 420ms var(--ease-settle);
    }

    .marketing .mech::after {
        translate: calc(var(--tilt-x) * -12%) 0;
        transition: translate 420ms var(--ease-settle);
    }
}

@keyframes intro-rise {
    from {
        transform: translateY(18px);
    }
}

@keyframes glass-sweep {
    from {
        opacity: 0;
        transform: translateX(-60%);
    }
}

@keyframes vault-carry {
    0% {
        transform: translate(-47cqi, 1.5cqi);
    }

    28% {
        transform: translate(-47cqi, -1.5cqi) scale(1.05);
    }

    72% {
        transform: translate(0, -6cqi) scale(1.05);
    }

    100% {
        transform: none;
    }
}

@keyframes vault-close {
    from {
        transform: translateY(12cqi);
    }
}

@keyframes lid-shut {
    from {
        clip-path: inset(0 0 100% 0 round 5cqi);
    }

    to {
        clip-path: inset(0 round 5cqi);
    }
}

@keyframes dots-fill {
    from {
        clip-path: inset(0 100% 0 0);
    }

    to {
        clip-path: inset(0);
    }
}

@keyframes shackle-seat {
    from {
        opacity: 0;
        transform: translateY(-7cqi);
    }

    50% {
        opacity: 1;
    }
}

@keyframes sheet-fan {
    from {
        opacity: 0;
        transform: translate(var(--fan-x), var(--fan-y));
    }
}

@keyframes spine-fill {
    from {
        clip-path: inset(100% 0 0 0);
    }

    to {
        clip-path: inset(0);
    }
}

@keyframes task-settle {
    from {
        transform: translate(var(--from-x), var(--from-y)) rotate(var(--from-r));
    }
}

@keyframes tick-box {
    from {
        border-color: rgba(238, 240, 243, 0.5);
        background-color: rgba(142, 167, 255, 0);
    }
}

@keyframes tick-land {
    from {
        opacity: 0;
        transform: rotate(45deg) scale(0.2);
    }
}

/* ── glass theme ───────────────────────────────────────────────────────────────────────────────────
 * The one concept of zenlygram.org, shared with the landing page: a black canvas with a faint blue
 * glow, glass surfaces (a dark translucent fill, a hairline edge, backdrop blur), light-weight display
 * type in DM Sans (Onest for Cyrillic), white pill primary actions and ghost secondaries, one blue
 * accent. The rules here restate the components above in that language; they sit before the
 * user-preference blocks, which still win (same specificity, later). Everything is CSS: the views did
 * not change, so the markup, the a11y hooks and the responsive structure above are untouched. */

body {
    position: relative;
    background: var(--bg);
    font-weight: 400;
}

/* The canvas glow: fixed, behind everything, the same two gradients as the landing's backdrop. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: var(--canvas-glow), var(--bg);
}

::selection {
    background: rgba(122, 177, 254, 0.35);
}

:root.marketing ::selection,
:root.marketing .ink ::selection {
    background: rgba(122, 177, 254, 0.35);
}

/* ── type: light display voice, tight tracking ── */

h1,
h2,
h3,
h4,
.h3-like {
    font-weight: 500;
    text-wrap: balance;
}

h1 {
    font-size: var(--h1);
    font-weight: 300;
    line-height: 1.06;
    letter-spacing: -0.035em;
}

h2 {
    font-size: var(--h2);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

h3,
.h3-like {
    font-size: var(--h3);
    font-weight: 500;
    letter-spacing: -0.015em;
}

h4 {
    font-weight: 500;
}

.display {
    font-weight: 300;
    line-height: 1.02;
    letter-spacing: -0.04em;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.18);
}

.lede,
.band-lede,
.intro-inner .lede,
.access-body {
    color: var(--hint-strong);
    font-weight: 400;
}

.eyebrow {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--hint);
}

.band-head h2,
.split-head h2,
.chapter-head h2,
.band-access h2 {
    font-family: var(--font);
    font-weight: 300;
    letter-spacing: -0.035em;
    line-height: 1.04;
}

.statement {
    font-family: var(--font);
    font-weight: 300;
    letter-spacing: -0.02em;
    color: var(--text);
    padding-left: 22px;
    border-left: 2px solid transparent;
    border-image: linear-gradient(180deg, var(--accent), rgba(122, 177, 254, 0.1)) 1;
}

.chapter-long {
    font-weight: 300;
    color: var(--text);
}

.plan-price,
.amount-big {
    font-weight: 300;
    letter-spacing: -0.04em;
}

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

code,
kbd,
samp,
textarea.tall,
input.code-input,
.copy-field input {
    font-family: var(--mono);
}

/* ── header: the landing's bar ── */

.site-header,
:where(.marketing) .site-header,
.site-header.ink {
    --text: #f4f6fb;
    --hint: #8b90a0;
    background: rgba(0, 0, 0, 0.82);
    border-bottom: 1px solid var(--separator);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
    .site-header,
    :where(.marketing) .site-header {
        background: var(--bg);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

.header-inner {
    min-height: 64px;
}

.brand {
    gap: 10px;
}

.brand img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.brand-word {
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    text-transform: lowercase;
}

.nav-primary a {
    padding: 0 12px;
    border-radius: 10px;
    color: var(--hint);
    font-size: 0.9375rem;
    font-weight: 400;
}

.nav-primary a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.nav-primary a[aria-current="page"] {
    color: var(--text);
    font-weight: 500;
}

.nav-primary a[aria-current="page"]::after {
    left: 12px;
    right: 12px;
    bottom: 7px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ffffff, transparent);
}

.menu > summary {
    border: 1px solid var(--separator);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text);
    font-weight: 500;
}

.menu > summary:hover,
.menu[open] > summary {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.22);
}

.lang-code {
    font-weight: 500;
    letter-spacing: 0.04em;
}

.menu-panel {
    border: 1px solid var(--separator);
    border-radius: 16px;
    background: rgba(10, 11, 16, 0.92);
    box-shadow: var(--shadow-lift);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}

.menu-panel a {
    color: var(--text);
    border-radius: 10px;
}

.menu-panel a:hover {
    background: rgba(255, 255, 255, 0.07);
}

.menu-panel .btn-quiet {
    width: 100%;
    justify-content: flex-start;
    border: 0;
    background: transparent;
    color: var(--text);
    font-weight: 400;
    padding: 0 12px;
}

.menu-panel .btn-quiet:hover {
    background: rgba(255, 255, 255, 0.07);
}

.header-tools .btn-secondary {
    border-radius: 12px;
}

.skip-link {
    background: #ffffff;
    color: #000000;
    font-weight: 500;
    border-radius: 10px;
}

/* ── footer: the landing's ── */

.site-footer,
:where(.marketing) .site-footer {
    padding-block: 48px 64px;
    border-top: 1px solid var(--separator);
    background: transparent;
    color: var(--hint);
}

.footer-grid h2 {
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text);
}

.footer-grid a:not(.brand) {
    color: var(--hint);
    transition: color var(--ease), transform var(--ease);
}

.footer-grid a:not(.brand):hover {
    color: var(--text);
    text-decoration: none;
    transform: translateX(4px);
}

.footer-grid {
    padding-bottom: 32px;
    border-bottom: 1px solid var(--separator);
}

.disclaimer {
    margin-top: 24px;
    padding-top: 0;
    border-top: 0;
    color: var(--hint);
    font-size: 0.875rem;
}

/* ── buttons: white pill primary, ghost glass secondary ── */

.btn {
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 10px 20px;
    overflow-wrap: normal;
    transition: background-color var(--ease), border-color var(--ease), color var(--ease), box-shadow 0.4s var(--ease-settle), transform 0.2s var(--ease-settle);
}

.btn:active {
    transform: scale(0.97);
}

.btn-lg {
    min-height: 52px;
    padding: 13px 28px;
    font-size: 1.0625rem;
    border-radius: 14px;
}

.btn-primary,
:where(.marketing) .btn-primary,
.ink .btn-primary {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
}

.btn-primary:hover,
:where(.marketing) .btn-primary:hover,
.ink .btn-primary:hover {
    background: #e6efff;
    border-color: #e6efff;
    color: #000000;
    box-shadow: 0 0 32px rgba(255, 255, 255, 0.18), 0 0 70px rgba(122, 177, 254, 0.16);
}

.btn-secondary,
.ink .btn-secondary {
    background: rgba(17, 19, 24, 0.7);
    border-color: var(--separator);
    color: var(--text);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover,
.ink .btn-secondary:hover {
    background: rgba(28, 31, 40, 0.8);
    border-color: rgba(255, 255, 255, 0.22);
    color: var(--text);
}

.btn-quiet {
    background: transparent;
    border-color: var(--separator);
    color: var(--ghost-text);
}

.btn-quiet:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.22);
}

.btn-danger {
    background: var(--danger-tint);
    border-color: rgba(255, 123, 123, 0.4);
    color: #ffb4b4;
}

.btn-danger:hover {
    background: rgba(255, 123, 123, 0.22);
    border-color: rgba(255, 123, 123, 0.6);
    color: #ffd0d0;
}

.btn-link {
    color: var(--link);
}

.arrow-link {
    font-weight: 500;
}

/* ── glass surfaces ── */

.group-body,
.panel,
.table-wrap,
.cta-band,
.device,
.teaser-list .teaser,
.locale-tabs > *,
.preview-panel {
    background: var(--card);
    border: 1px solid var(--separator);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}

.group-body {
    border-radius: var(--radius);
}

.group-body > .row + .row,
.group-body > li + li {
    border-top-color: var(--separator);
}

.group-title {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--hint);
}

h2.group-title,
h3.group-title {
    font-size: 0.75rem;
}

.row-icon {
    background: var(--accent-tint);
    color: var(--ghost-text);
    border-radius: 10px;
}

a.row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.cta-band {
    border-radius: var(--radius-lg);
    padding: 32px var(--pad);
}

.preview-panel {
    border-style: dashed;
    border-color: var(--control-border);
    border-radius: var(--radius);
}

.teaser-list .teaser {
    padding: 22px;
    border-radius: var(--radius);
}

.notice {
    border: 1px solid var(--separator);
    border-radius: 16px;
    background: var(--card);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}

.notice-title {
    font-weight: 500;
}

.error-summary {
    border: 1px solid var(--danger);
    border-radius: 16px;
    background: var(--card);
}

.error-summary h2 {
    font-weight: 500;
    font-size: 1.0625rem;
}

.bubble {
    background: var(--card);
    border: 1px solid var(--separator);
    box-shadow: none;
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}

.bubble-out {
    background: #2b5bb5;
    border-color: #2b5bb5;
    color: #ffffff;
}

.bubble-status {
    font-weight: 500;
}

/* badges: pill tints */

.badge {
    font-weight: 500;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--hint-strong);
}

.badge-ok {
    background: var(--ok-tint);
    border-color: rgba(92, 242, 165, 0.2);
    color: var(--ok);
}

.badge-warn {
    background: var(--warn-tint);
    border-color: rgba(242, 193, 78, 0.2);
    color: var(--warn);
}

.badge-danger {
    background: var(--danger-tint);
    border-color: rgba(255, 123, 123, 0.2);
    color: var(--danger);
}

.badge-accent {
    background: var(--accent-tint);
    border-color: rgba(122, 177, 254, 0.25);
    color: var(--ghost-text);
}

/* ── forms: dark glass fields ── */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="datetime-local"],
select,
textarea {
    border-color: var(--control-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    box-shadow: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(122, 177, 254, 0.18);
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: rgba(139, 144, 160, 0.8);
}

input[readonly] {
    background: rgba(255, 255, 255, 0.03);
}

.field > label,
.field-label,
legend {
    font-weight: 500;
}

.choice {
    border-color: var(--separator);
    border-radius: 16px;
    background: var(--card);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}

.choice:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.choice:has(input:checked) {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 0 30px rgba(122, 177, 254, 0.15);
}

.choice-title {
    font-weight: 500;
}

.check input,
.choice input {
    accent-color: var(--accent);
}

.copy-status {
    font-weight: 500;
}

/* account / admin shell */

.nav-side a {
    border-color: var(--separator);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--hint);
    font-weight: 500;
}

.nav-side a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.nav-side a[aria-current="page"] {
    color: var(--text);
    background: #1d2029;
    border-color: transparent;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* tables */

.table-wrap {
    border-radius: var(--radius);
}

table.data thead th {
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

table.data caption {
    font-weight: 500;
}

/* prose */

.prose blockquote {
    border-left-color: var(--accent);
}

.prose pre {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--separator);
}

/* FAQ: the landing's glass rows */

.faq {
    gap: 12px;
    border-top: 0;
}

.faq details {
    border: 1px solid var(--separator);
    border-radius: 16px;
    background: rgba(10, 11, 16, 0.55);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: border-color 0.3s, background-color 0.3s;
}

.faq details:hover,
.faq details[open] {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(20, 22, 30, 0.7);
}

.faq summary {
    min-height: 60px;
    padding: 16px 20px;
    font-weight: 400;
    font-size: 1rem;
}

.faq summary:hover {
    color: var(--text);
}

.faq summary svg.icon {
    color: var(--accent);
}

.faq details[open] summary svg.icon {
    color: var(--accent);
}

.faq .faq-answer {
    margin: 0 20px 20px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(20, 22, 29, 0.8);
    color: #c3c7d3;
    font-size: 0.9375rem;
    line-height: 1.6;
}

:where(.marketing) .split .faq {
    border-top: 0;
}

:where(.marketing) .split .faq details:first-child > summary {
    padding-top: 16px;
}

/* status / checkout */

.spinner {
    border-color: var(--separator);
    border-top-color: var(--accent);
}

.status-line {
    font-weight: 500;
}

.hero-mark {
    border-radius: 20px;
    box-shadow: 0 0 60px rgba(122, 177, 254, 0.25);
}

/* ── marketing canvas on the black canvas ── */

.marketing .site-main {
    padding-block: 0;
}

.ink,
:where(.marketing) .ink {
    --text: #f4f6fb;
    --hint: #8b90a0;
    --hint-strong: #b7bccb;
    --link: #8dbbff;
    --ghost-text: #a9cbff;
    --focus: #7ab1fe;
    --cobalt: #7ab1fe;
    --separator: rgba(255, 255, 255, 0.09);
    --rule: rgba(255, 255, 255, 0.18);
    --control-border: rgba(255, 255, 255, 0.34);
    --surface: rgba(12, 13, 19, 0.72);
    --surface-sunken: rgba(255, 255, 255, 0.05);
    --btn-fill: #ffffff;
    --btn-label: #000000;
    --btn-fill-hover: #e6efff;
    --btn-label-hover: #000000;
    background: transparent;
    color: var(--text);
}

.band {
    padding-block: 64px;
}

.intro {
    padding-block: 72px 48px;
}

.intro-inner {
    gap: 22px;
}

.intro-body {
    margin-top: 48px;
}

.pair-item {
    border-top-color: var(--separator);
}

.pair-item :is(h2, h3) {
    font-weight: 400;
}

.fact + .fact,
.check-list-lined li + li,
.points li,
.points,
.release + .release,
.platform,
.platforms,
.chapter-inner {
    border-color: var(--separator);
}

.check-list-lined svg.icon,
.check-list svg.icon {
    color: var(--accent);
}

.points li::before {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.story-icon {
    background: rgba(122, 177, 254, 0.12);
    border: 1px solid rgba(122, 177, 254, 0.28);
    box-shadow: 0 0 30px rgba(122, 177, 254, 0.14);
    color: #bcd6ff;
}

.platform-title {
    font-weight: 400;
    letter-spacing: -0.02em;
}

.release .row-label {
    font-weight: 500;
}

.plan-name {
    font-weight: 500;
}

.plan-savings {
    font-weight: 500;
}

.panel {
    border-radius: 22px;
    border-color: var(--separator);
}

.panel-grid > *,
.panel-foot {
    border-color: var(--separator);
}

/* the closing band: one glass card with the landing's halo */

.band-access {
    padding-inline: var(--pad);
}

.band-access .access {
    position: relative;
    overflow: hidden;
    max-width: calc(var(--container) - 2 * var(--pad));
    padding: clamp(28px, 4vw, 56px);
    border: 1px solid var(--separator);
    border-radius: 28px;
    background: radial-gradient(ellipse at 15% 0%, rgba(122, 177, 254, 0.16), transparent 60%), var(--card);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}

.band-access h2 {
    font-weight: 300;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.18);
}

/* The standalone error pages (500/503 and every error before a route matched) have no header or footer:
 * their one block sits in the middle of the screen instead of hugging the top-left corner. */
body > .site-main:first-child:last-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding-block: 64px;
}

@supports (min-height: 100dvh) {
    body > .site-main:first-child:last-child {
        min-height: 100dvh;
    }
}

/* the old home's exhibit, if it is ever shown: glass instead of ink */
.exhibit {
    background: var(--card);
    border: 1px solid var(--separator);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ── spacing on wide screens: the landing's generosity ── */

@media (min-width: 960px) {
    .band {
        padding-block: 88px;
    }

    .intro {
        padding-block: 96px 56px;
    }

    .site-main {
        padding-block: 40px 96px;
    }

    .page-head {
        margin-bottom: 36px;
    }
}

/* ── after review: alignment, controls and small-screen details ── */

body {
    font-synthesis: none; /* the faces stop at 500: never a faked bold */
}

/* native selects take the glass field (a drawn chevron; the CSP allows data: images) */
select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b90a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

select option {
    background: #0c0d13;
    color: var(--text);
}

/* the sideways nav row says that it scrolls: a fade at its end, tighter labels on narrow phones */
@media (max-width: 959px) {
    .nav-primary ul {
        padding-inline-end: 32px;
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
        mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
    }
}

@media (max-width: 379px) {
    .nav-primary a {
        padding: 0 8px;
        font-size: 0.875rem;
    }

    .header-tools .menu + .menu > summary > span:not(.visually-hidden) {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .row-value {
        max-width: 60%;
    }

    .row-value .badge {
        white-space: nowrap;
    }
}

/* narrow reading columns start on the page's own left edge instead of jumping to the centre */
.band > .wrap.narrow {
    margin-inline: max(0px, calc((100% - var(--container)) / 2)) auto;
}

.access-actions {
    justify-content: flex-end;
    gap: 10px 12px;
}

/* the help page's closing card: the landing's centred closing band */
.cta-band {
    align-items: center;
    text-align: center;
    padding: 44px var(--pad);
}

.cta-band .btn-row {
    align-self: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

.cta-band .btn-row > .btn {
    width: auto;
}

/* page heads: one rhythm; ledes in the lede voice; the back link as a quiet arrow link */
.stack-lg > .page-head {
    margin-bottom: 0;
}

.page-head > .muted {
    max-width: 60ch;
    font-size: 1.0625rem;
    line-height: 1.5;
    color: var(--hint-strong);
}

.page-head .back {
    gap: 6px;
    color: var(--hint);
    font-weight: 500;
    text-decoration: none;
}

.page-head .back::before {
    content: "\2190";
}

.page-head .back:hover {
    color: var(--text);
}

/* the account shell: air between a notice and its neighbours */
.shell-content > .group + .notice,
.shell-content > .notice + .group,
.shell-content > .notice + .stack-lg,
.shell-content > .notice + .notice,
.shell-content > .notice + .form,
.shell-content > .account-head + .notice {
    margin-top: 28px;
}

.shell-content:has(> form.form) > .notice {
    max-width: 40rem;
}

.account-head .bubble {
    border-radius: 14px;
}

.copy-status:empty {
    min-height: 0;
    margin-top: 0;
}

.row .chevron {
    flex: none;
    display: inline-flex;
    color: var(--accent);
}

.row .chevron svg.icon {
    width: 20px;
    height: 20px;
}

/* a bare icon at the start of a row becomes the same tile as .row-icon */
.row > svg.icon:first-child:not(.chevron) {
    box-sizing: content-box;
    width: 1.1em;
    height: 1.1em;
    padding: 6px;
    border-radius: 10px;
    background: var(--accent-tint);
    color: var(--ghost-text);
}

.group > .group-title + .group-foot {
    padding: 14px var(--pad);
    border: 1px dashed var(--separator);
    border-radius: var(--radius);
}

.group-foot a,
.prose a {
    text-decoration-color: rgba(141, 187, 255, 0.45);
    text-underline-offset: 3px;
}

.field + .btn-row,
.choices + .field {
    margin-top: 16px;
}

.nav-side a[aria-current="page"],
.field-error {
    font-weight: 500;
}

/* tables: whole timestamps, a touch smaller, a visible scrollbar where they scroll */
table.data {
    font-size: 0.875rem;
}

table.data time {
    white-space: nowrap;
}

.table-wrap {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* the side navigation below 960px: one sideways row of pills, like the primary nav */
@media (max-width: 959px) {
    .nav-side {
        margin-inline: calc(-1 * var(--pad));
        padding-inline: var(--pad);
    }

    .nav-side ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        padding: 2px 32px 8px 2px;
        scrollbar-width: none;
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
        mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
    }

    .nav-side li {
        flex: none;
    }

    .nav-side a {
        white-space: nowrap;
    }

    .nav-side a[aria-current="page"] {
        scroll-margin-inline: 16px;
    }
}

/* the staff sidebar on a short window: the whole list, scrolling with the page */
@media (min-width: 960px) {
    .nav-side {
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
    }

    .nav-side ul {
        gap: 4px;
    }

    .nav-side a {
        min-height: 40px;
        font-size: 0.9rem;
    }
}

@media (min-width: 960px) and (max-height: 860px) {
    .admin-shell .nav-side {
        position: static;
        max-height: none;
        overflow: visible;
    }
}

@media (min-width: 960px) {
    .footer-grid {
        grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
    }
}

/* ── user preferences ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .spinner,
    [data-poll-phase] .spinner {
        display: none;
    }

    .arrow-link:hover > svg.icon {
        transform: none;
    }
}

@media (forced-colors: active) {
    /* All marketing motion is decoration; forced-colours users get the static page (!important beats the
     * more specific motion selectors): no animations, no transitions, no hover nudge, and the purely
     * decorative stage is removed (its readouts stay). */
    .marketing *,
    .marketing *::before,
    .marketing *::after {
        animation: none !important;
        transition: none !important;
    }

    .marketing .arrow-link:hover > svg.icon {
        transform: none;
    }

    .exhibit-stage {
        display: none;
    }

    /* Forced colours keep an author background's alpha: the pinned header must be opaque Canvas. */
    .site-header {
        background: Canvas;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .btn,
    .badge,
    .notice,
    .group-body,
    .choice,
    .table-wrap,
    .bubble,
    .faq,
    .nav-side a,
    .menu-panel,
    .cta-band,
    .panel,
    .pick,
    .story-icon,
    .ink {
        border: 1px solid CanvasText;
    }

    /* Selection stays a shape, not a fill: a 2px Highlight edge and a Highlight ring on the dot. */
    .pick:has(input:checked) {
        border: 2px solid Highlight;
    }

    .pick input:checked ~ .pick-dot {
        border-color: Highlight;
    }

    .nav-primary a[aria-current="page"],
    .nav-side a[aria-current="page"] {
        outline: 2px solid Highlight;
    }

    .nav-primary a::after,
    .points li::before {
        background: CanvasText;
    }

    .statement {
        border-left-color: CanvasText;
    }

    svg.icon {
        stroke: CanvasText;
    }
}

@media print {
    /* Paper again: the dark glass tokens would print black boxes with light text. */
    :root,
    :root.marketing,
    .ink {
        --bg: #ffffff;
        --surface: #ffffff;
        --surface-sunken: #f3f4f6;
        --card: #ffffff;
        --text: #000000;
        --hint: #444444;
        --hint-strong: #222222;
        --link: #000000;
        --accent: #000000;
        --accent-text: #ffffff;
        --accent-tint: #eeeeee;
        --ghost-text: #000000;
        --cobalt: #000000;
        --ink: #ffffff;
        --separator: #bbbbbb;
        --rule: #888888;
        --control-border: #666666;
        --btn-fill: #000000;
        --btn-label: #ffffff;
        --canvas-glow: none;
        --glass-blur: none;
    }

    body::before {
        display: none;
    }

    .site-header,
    .group-body,
    .panel,
    .notice,
    .table-wrap,
    .cta-band,
    .bubble,
    .choice,
    .faq details,
    .band-access .access {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}

@media print {
    .site-header,
    .site-footer,
    .nav-side,
    .skip-link,
    .exhibit-picks,
    .story-icon {
        display: none;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
    }

    body {
        background: #ffffff;
        color: #000000;
    }

    .band {
        padding-block: 24px;
        background: none;
    }

    .panel {
        box-shadow: none;
        border-color: #000000;
    }

    /* Download releases print as outlined text: printing drops the button fill. */
    .release .btn {
        background: none;
        color: #000000;
        border-color: #000000;
    }

    /* Marketing pages print as plain black on white: the paper tokens resolve to paper and black ink,
     * the ink objects lose their fill and re-scope to the same black tokens, and every feature readout
     * prints (the :has() selection filter and the stage apply to screen media only). */
    :root.marketing {
        color-scheme: light;
        --bg: #ffffff;
        --surface: #ffffff;
        --surface-sunken: #ffffff;
        --text: #000000;
        --hint: #333333;
        --hint-strong: #1a1a1a;
        --link: #000000;
        --accent: #000000;
        --accent-tint: rgba(0, 0, 0, 0.06);
        --ok: #16703d;
        --ok-tint: rgba(26, 127, 69, 0.09);
        --warn: #8a5100;
        --warn-tint: rgba(154, 91, 0, 0.09);
        --danger: #b71c1c;
        --danger-tint: rgba(198, 40, 40, 0.08);
        --accent-text: #ffffff;
        --ghost-text: #000000;
        --focus: #000000;
        --control-border: #000000;
        --separator: rgba(0, 0, 0, 0.25);
        --rule: rgba(0, 0, 0, 0.45);
        --cobalt: #000000;
    }

    .ink {
        --text: #000000;
        --hint: #333333;
        --hint-strong: #1a1a1a;
        --link: #000000;
        --ghost-text: #000000;
        --focus: #000000;
        --cobalt: #000000;
        --separator: rgba(0, 0, 0, 0.25);
        --rule: rgba(0, 0, 0, 0.45);
        --control-border: #000000;
        background: none;
        color: #000000;
        box-shadow: none;
    }

    .exhibit {
        padding: 0;
    }

    /* Marketing actions print as outlined black text. */
    :where(.marketing) :is(.btn-primary, .btn-secondary) {
        background: none;
        color: #000000;
        border-color: #000000;
        box-shadow: none;
    }
}
