/*
 * Reference gateway pages (MIT, @ptbk/gateway-pages). The first part is the Promptbook design tokens, copied from
 * packages/ui/src/theme/primitives.css and semantic.css; a test keeps the values identical. The gateway has no theme
 * switch, so dark mode follows the operating system instead of ui's `.dark` class. No font files are loaded: the
 * stacks fall back to system fonts.
 */
:root {
    /* Graphite: a near-neutral grey with a trace of blue, the chrome of both themes (U-17). */
    --ptbk-graphite-0: #ffffff;
    --ptbk-graphite-25: #fbfbfc;
    --ptbk-graphite-50: #f6f6f7;
    --ptbk-graphite-75: #f1f1f3;
    --ptbk-graphite-100: #ececee;
    --ptbk-graphite-150: #e6e6e9;
    --ptbk-graphite-200: #dfdfe3;
    --ptbk-graphite-300: #cacacf;
    --ptbk-graphite-400: #a0a0a8;
    --ptbk-graphite-450: #8a8a93;
    --ptbk-graphite-500: #74747d;
    --ptbk-graphite-550: #696972;
    --ptbk-graphite-600: #5d5d66;
    --ptbk-graphite-700: #45454d;
    --ptbk-graphite-750: #38383f;
    --ptbk-graphite-800: #2c2c32;
    --ptbk-graphite-825: #26262b;
    --ptbk-graphite-850: #212125;
    --ptbk-graphite-875: #1c1c20;
    --ptbk-graphite-900: #18181b;
    --ptbk-graphite-925: #141416;
    --ptbk-graphite-950: #111113;
    --ptbk-graphite-975: #0c0c0e;

    --ptbk-cyan-50: #ecfdff;
    --ptbk-cyan-100: #cff8fc;
    --ptbk-cyan-200: #a3eef8;
    --ptbk-cyan-300: #63ddf0;
    --ptbk-cyan-400: #25c6e0;
    --ptbk-cyan-500: #08a9c4;
    --ptbk-cyan-600: #0788a2;
    --ptbk-cyan-700: #0c6c82;
    --ptbk-cyan-800: #11596b;
    --ptbk-cyan-900: #134a59;
    --ptbk-cyan-950: #072f3b;

    --ptbk-teal-100: #d3eff3;
    --ptbk-teal-300: #6cc5d2;
    --ptbk-teal-400: #49b3c3;
    --ptbk-teal-900: #1a4249;

    --ptbk-mint-300: #74e6c6;
    --ptbk-mint-400: #3ad2a7;
    --ptbk-mint-450: #45b994;
    --ptbk-mint-500: #14b88c;
    --ptbk-mint-600: #079572;
    --ptbk-mint-700: #06765b;

    /*
     * Status hues. The light 50s and the dark 975s are the quiet soft fills: a trace of the hue over graphite, never a
     * saturated slab. The dark 350s are the readable text and dot colours, a step calmer than the 300s agents use.
     */
    --ptbk-green-50: #edf7f0;
    --ptbk-green-300: #86e8a8;
    --ptbk-green-350: #79c895;
    --ptbk-green-700: #17733c;
    --ptbk-green-975: #142019;

    --ptbk-amber-50: #fbf4e6;
    --ptbk-amber-300: #fcd364;
    --ptbk-amber-350: #e0b25c;
    --ptbk-amber-700: #a14b08;
    --ptbk-amber-975: #231d12;

    --ptbk-red-50: #fcf0f0;
    --ptbk-red-250: #f5b0b0;
    --ptbk-red-300: #fda4a4;
    --ptbk-red-350: #ee8f8f;
    --ptbk-red-600: #d42a2a;
    --ptbk-red-700: #b11f1f;
    --ptbk-red-800: #8f2424;
    --ptbk-red-975: #2a1718;

    --ptbk-blue-50: #eef3fc;
    --ptbk-blue-300: #9cc3fd;
    --ptbk-blue-350: #8fb3f2;
    --ptbk-blue-700: #1f4fc8;
    --ptbk-blue-975: #161c2a;

    --ptbk-violet-300: #c3b1fa;
    --ptbk-violet-700: #6b43c9;
    --ptbk-pink-300: #f5a3cd;
    --ptbk-pink-700: #b0286f;
    --ptbk-olive-300: #c9d77a;
    --ptbk-olive-700: #5c6a12;
    --ptbk-orange-300: #f8b878;

    --ptbk-font-text: 'Inter Variable', 'Inter Fallback', ui-sans-serif, system-ui, sans-serif;
    --ptbk-font-mono: 'JetBrains Mono Variable', 'JetBrains Mono Fallback', ui-monospace, monospace;

    --ptbk-font-size-2xs: 0.75rem;
    --ptbk-font-size-xs: 0.8125rem;
    --ptbk-font-size-sm: 0.875rem;
    --ptbk-font-size-md: 1rem;
    --ptbk-font-size-lg: 1.125rem;
    --ptbk-font-size-xl: 1.25rem;
    --ptbk-font-size-2xl: 1.5rem;
    --ptbk-font-size-3xl: 1.875rem;
    --ptbk-line-height-2xs: 1rem;
    --ptbk-line-height-xs: 1.125rem;
    --ptbk-line-height-sm: 1.25rem;
    --ptbk-line-height-md: 1.5rem;
    --ptbk-line-height-lg: 1.625rem;
    --ptbk-line-height-xl: 1.75rem;
    --ptbk-line-height-2xl: 2rem;
    --ptbk-line-height-3xl: 2.25rem;
    --ptbk-tracking-display: -0.02em;
    --ptbk-tracking-heading: -0.011em;
    --ptbk-weight-display: 600;

    --ptbk-space-unit: 0.25rem;

    --ptbk-radius-sm: 0.25rem;
    --ptbk-radius-md: 0.375rem;
    --ptbk-radius-lg: 0.625rem;
    --ptbk-radius-full: 9999px;

    --ptbk-shadow-1: 0 1px 1px rgb(17 17 19 / 0.04);
    --ptbk-shadow-2: 0 1px 2px rgb(17 17 19 / 0.04), 0 6px 16px -4px rgb(17 17 19 / 0.1);
    --ptbk-shadow-3: 0 2px 4px rgb(17 17 19 / 0.04), 0 16px 40px -8px rgb(17 17 19 / 0.16);
    --ptbk-shadow-dark-1: 0 1px 1px rgb(0 0 0 / 0.3);
    --ptbk-shadow-dark-2: 0 1px 2px rgb(0 0 0 / 0.35), 0 6px 16px -4px rgb(0 0 0 / 0.45);
    --ptbk-shadow-dark-3: 0 2px 4px rgb(0 0 0 / 0.35), 0 16px 40px -8px rgb(0 0 0 / 0.55);
    --ptbk-scrim: rgb(17 17 19 / 0.32);
    --ptbk-scrim-dark: rgb(0 0 0 / 0.56);

    --ptbk-duration-0: 0s;
    --ptbk-duration-100: 100ms;
    --ptbk-duration-150: 150ms;
    --ptbk-duration-200: 200ms;
    --ptbk-duration-250: 250ms;
    --ptbk-duration-300: 300ms;
    --ptbk-duration-600: 600ms;
    --ptbk-duration-900: 900ms;
    --ptbk-duration-2400: 2400ms;
    --ptbk-ease-linear: linear;
    --ptbk-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ptbk-ease-in: cubic-bezier(0.55, 0, 1, 0.45);
    --ptbk-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

:root {
    color-scheme: light;

    --color-surface: var(--ptbk-graphite-25);
    --color-raised: var(--ptbk-graphite-0);
    --color-sunken: var(--ptbk-graphite-75);
    /* Quiet washes of the text colour, so hover and selection read the same on the page, a raised panel or a wash. */
    --color-hover: color-mix(in oklab, var(--color-text) 5%, transparent);
    --color-selected: color-mix(in oklab, var(--color-text) 8%, transparent);

    /*
     * Soft buttons: the main action is a slightly stronger wash of the text colour, a destructive one a wash of the
     * danger colour; hover and press deepen them. Washes, so they sit on any surface (U-17 rev 1: no inverted fills).
     */
    --color-wash-strong: color-mix(in oklab, var(--color-text) 7%, transparent);
    --color-wash-strong-hover: color-mix(in oklab, var(--color-text) 10%, transparent);
    --color-wash-strong-active: color-mix(in oklab, var(--color-text) 14%, transparent);
    --color-danger-wash: color-mix(in oklab, var(--color-danger) 8%, transparent);
    --color-danger-wash-hover: color-mix(in oklab, var(--color-danger) 12%, transparent);
    --color-danger-wash-active: color-mix(in oklab, var(--color-danger) 16%, transparent);
    --color-danger-hairline: color-mix(in oklab, var(--color-danger) 28%, transparent);
    --color-neutral-soft: var(--ptbk-graphite-100);
    --color-scrim: var(--ptbk-scrim);

    --color-text: var(--ptbk-graphite-900);
    --color-text-muted: var(--ptbk-graphite-600);
    /* Placeholders and tertiary text on the page or a raised surface; still 4.5:1 there. */
    --color-text-subtle: var(--ptbk-graphite-550);
    /* Control boundaries (inputs, checkboxes): 3:1, so a field is findable without its label. */
    --color-border: var(--ptbk-graphite-450);
    --color-divider: var(--ptbk-graphite-200);
    /* The 1px line between sections and rows; quieter than a divider, never a control boundary. */
    --color-hairline: var(--ptbk-graphite-150);

    --color-primary: var(--ptbk-graphite-900);
    --color-primary-hover: var(--ptbk-graphite-750);
    --color-on-primary: var(--ptbk-graphite-0);

    --color-accent: var(--color-primary);
    --color-accent-hover: var(--color-primary-hover);
    --color-on-accent: var(--color-on-primary);
    --color-accent-text: var(--color-text);
    --color-accent-soft: var(--color-neutral-soft);

    --color-focus: var(--ptbk-cyan-600);
    --color-link: var(--ptbk-cyan-700);
    --color-link-hover: var(--ptbk-cyan-800);
    --color-selection: var(--ptbk-teal-100);
    --color-live: var(--ptbk-mint-600);

    --color-success: var(--ptbk-green-700);
    --color-success-soft: var(--ptbk-green-50);
    --color-warning: var(--ptbk-amber-700);
    --color-warning-soft: var(--ptbk-amber-50);
    --color-danger: var(--ptbk-red-700);
    --color-danger-hover: var(--ptbk-red-600);
    --color-on-danger: var(--ptbk-graphite-0);
    --color-danger-soft: var(--ptbk-red-50);
    /* The one filled red: the confirm step of a destructive action. White on a deep red in both themes, never salmon. */
    --color-danger-fill: var(--ptbk-red-700);
    --color-danger-fill-hover: var(--ptbk-red-600);
    --color-on-danger-fill: var(--ptbk-graphite-0);
    --color-info: var(--ptbk-blue-700);
    --color-info-soft: var(--ptbk-blue-50);

    /* Recognition colours for marks such as the engine fingerprint; each holds 3:1 against raised surfaces. */
    --color-identity-1: var(--ptbk-cyan-700);
    --color-identity-2: var(--ptbk-mint-700);
    --color-identity-3: var(--ptbk-blue-700);
    --color-identity-4: var(--ptbk-amber-700);
    --color-identity-5: var(--ptbk-red-700);
    --color-identity-6: var(--ptbk-graphite-700);

    /*
     * Agents without a profile colour get one of these by a stable hash of their key. Eight hues far enough apart to
     * tell agents in one thread apart; each is readable as text on every surface (4.5:1) in its theme.
     */
    --color-agent-1: var(--ptbk-blue-700);
    --color-agent-2: var(--ptbk-violet-700);
    --color-agent-3: var(--ptbk-pink-700);
    --color-agent-4: var(--ptbk-red-700);
    --color-agent-5: var(--ptbk-amber-700);
    --color-agent-6: var(--ptbk-olive-700);
    --color-agent-7: var(--ptbk-green-700);
    --color-agent-8: var(--ptbk-cyan-700);

    /* A soft surface is a faint wash of its tint (`--tint`, e.g. an agent's colour): no border, no shadow. */
    --soft-surface-wash: 5%;

    /* Inter everywhere (U-17); headings are its heavier, tighter cuts rather than a second family. */
    --font-display: var(--ptbk-font-text);
    --font-sans: var(--ptbk-font-text);
    --font-mono: var(--ptbk-font-mono);
    --heading-weight: var(--ptbk-weight-display);
    --tracking-display: var(--ptbk-tracking-display);
    --tracking-heading: var(--ptbk-tracking-heading);

    /* Comfortable density: 14px body (`text-sm`), 13px meta (`text-xs`), 12px only for counts and tiny labels. */
    --text-2xs: var(--ptbk-font-size-2xs);
    --text-2xs--line-height: var(--ptbk-line-height-2xs);
    --text-xs: var(--ptbk-font-size-xs);
    --text-xs--line-height: var(--ptbk-line-height-xs);
    --text-sm: var(--ptbk-font-size-sm);
    --text-sm--line-height: var(--ptbk-line-height-sm);
    --text-base: var(--ptbk-font-size-md);
    --text-base--line-height: var(--ptbk-line-height-md);
    --text-lg: var(--ptbk-font-size-lg);
    --text-lg--line-height: var(--ptbk-line-height-lg);
    --text-xl: var(--ptbk-font-size-xl);
    --text-xl--line-height: var(--ptbk-line-height-xl);
    --text-2xl: var(--ptbk-font-size-2xl);
    --text-2xl--line-height: var(--ptbk-line-height-2xl);
    --text-3xl: var(--ptbk-font-size-3xl);
    --text-3xl--line-height: var(--ptbk-line-height-3xl);

    --spacing: var(--ptbk-space-unit);

    --radius-control: var(--ptbk-radius-md);
    --radius-surface: var(--ptbk-radius-lg);
    --radius-pill: var(--ptbk-radius-full);
    --radius-small: var(--ptbk-radius-sm);

    /* Surfaces sit on hairlines and space, not shadows; only what floats (menus, popovers, dialogs) lifts. */
    --shadow-subtle: var(--ptbk-shadow-1);
    --shadow-raised: var(--ptbk-shadow-2);
    --shadow-overlay: var(--ptbk-shadow-3);

    --ease-enter: var(--ptbk-ease-out);
    --ease-exit: var(--ptbk-ease-in);
    --ease-standard: var(--ptbk-ease-in-out);

    /* Durations; pair them with an `--ease-*` token. */
    --motion-state: var(--ptbk-duration-150);
    --motion-enter: var(--ptbk-duration-200);
    --motion-exit: var(--ptbk-duration-150);
    --motion-page: var(--ptbk-duration-200);
    --motion-morph: var(--ptbk-duration-250);
    --motion-seal: var(--ptbk-duration-600);
    --motion-live: var(--ptbk-duration-2400);
    --motion-spin: var(--ptbk-duration-900);
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;

        --color-surface: var(--ptbk-graphite-950);
        --color-raised: var(--ptbk-graphite-900);
        --color-sunken: var(--ptbk-graphite-975);
        /* Repeated so a `.dark` subtree mixes its own text colour, not the one inherited from `:root`. */
        --color-hover: color-mix(in oklab, var(--color-text) 5%, transparent);
        --color-selected: color-mix(in oklab, var(--color-text) 8%, transparent);

        /*
         * Soft buttons: the main action is a slightly stronger wash of the text colour, a destructive one a wash of the
         * danger colour; hover and press deepen them. Washes, so they sit on any surface (U-17 rev 1: no inverted fills).
         */
        --color-wash-strong: color-mix(in oklab, var(--color-text) 7%, transparent);
        --color-wash-strong-hover: color-mix(in oklab, var(--color-text) 10%, transparent);
        --color-wash-strong-active: color-mix(in oklab, var(--color-text) 14%, transparent);
        --color-danger-wash: color-mix(in oklab, var(--color-danger) 8%, transparent);
        --color-danger-wash-hover: color-mix(in oklab, var(--color-danger) 12%, transparent);
        --color-danger-wash-active: color-mix(in oklab, var(--color-danger) 16%, transparent);
        --color-danger-hairline: color-mix(in oklab, var(--color-danger) 28%, transparent);
        --color-neutral-soft: var(--ptbk-graphite-825);
        --color-scrim: var(--ptbk-scrim-dark);

        --color-text: var(--ptbk-graphite-100);
        --color-text-muted: var(--ptbk-graphite-400);
        --color-text-subtle: var(--ptbk-graphite-450);
        --color-border: var(--ptbk-graphite-500);
        --color-divider: var(--ptbk-graphite-800);
        --color-hairline: var(--ptbk-graphite-825);

        --color-primary: var(--ptbk-graphite-100);
        --color-primary-hover: var(--ptbk-graphite-0);
        --color-on-primary: var(--ptbk-graphite-950);

        --color-focus: var(--ptbk-teal-400);
        --color-link: var(--ptbk-teal-300);
        --color-link-hover: var(--ptbk-teal-100);
        --color-selection: var(--ptbk-teal-900);
        --color-live: var(--ptbk-mint-450);

        --color-success: var(--ptbk-green-350);
        --color-success-soft: var(--ptbk-green-975);
        --color-warning: var(--ptbk-amber-350);
        --color-warning-soft: var(--ptbk-amber-975);
        --color-danger: var(--ptbk-red-350);
        --color-danger-hover: var(--ptbk-red-250);
        --color-on-danger: var(--ptbk-graphite-950);
        --color-danger-soft: var(--ptbk-red-975);
        --color-danger-fill: var(--ptbk-red-800);
        --color-danger-fill-hover: var(--ptbk-red-700);
        --color-info: var(--ptbk-blue-350);
        --color-info-soft: var(--ptbk-blue-975);

        --color-identity-1: var(--ptbk-cyan-300);
        --color-identity-2: var(--ptbk-mint-400);
        --color-identity-3: var(--ptbk-blue-300);
        --color-identity-4: var(--ptbk-amber-300);
        --color-identity-5: var(--ptbk-red-300);
        --color-identity-6: var(--ptbk-graphite-300);

        --color-agent-1: var(--ptbk-blue-300);
        --color-agent-2: var(--ptbk-violet-300);
        --color-agent-3: var(--ptbk-pink-300);
        --color-agent-4: var(--ptbk-red-300);
        --color-agent-5: var(--ptbk-orange-300);
        --color-agent-6: var(--ptbk-olive-300);
        --color-agent-7: var(--ptbk-green-300);
        --color-agent-8: var(--ptbk-cyan-300);

        /* Light tints on a dark surface read fainter, so the wash is a little stronger. */
        --soft-surface-wash: 9%;

        --shadow-subtle: var(--ptbk-shadow-dark-1);
        --shadow-raised: var(--ptbk-shadow-dark-2);
        --shadow-overlay: var(--ptbk-shadow-dark-3);
    }
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --motion-enter: var(--ptbk-duration-100);
        --motion-exit: var(--ptbk-duration-100);
        --motion-page: var(--ptbk-duration-0);
        --motion-morph: var(--ptbk-duration-0);
        --motion-seal: var(--ptbk-duration-0);
        --motion-live: var(--ptbk-duration-0);
        --ease-enter: var(--ptbk-ease-linear);
        --ease-exit: var(--ptbk-ease-linear);
    }
}
/* Pages. Everything below uses semantic tokens only. */

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

[hidden] {
    display: none !important;
}

/* Both languages are in the page; `<html lang>` picks one, English unless it says cs. */
:root:not([lang='cs']) [data-lang='cs'],
:root[lang='cs'] [data-lang='en'] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(var(--spacing) * 10) calc(var(--spacing) * 4);
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--text-base--line-height);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.masthead {
    width: 100%;
    max-width: 30rem;
    margin-bottom: calc(var(--spacing) * 4);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: calc(var(--spacing) * 2);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.wordmark {
    color: var(--color-text);
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.masthead-host {
    min-width: 0;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    overflow-wrap: anywhere;
}

.card {
    width: 100%;
    max-width: 30rem;
    padding: calc(var(--spacing) * 8);
    background: var(--color-raised);
    border: 1px solid var(--color-divider);
    border-radius: var(--radius-surface);
    box-shadow: var(--shadow-raised);
}

@media (max-width: 30rem) {
    body {
        padding-top: calc(var(--spacing) * 6);
    }
    .card {
        padding: calc(var(--spacing) * 5);
    }
}

section[data-state] {
    animation: gateway-enter var(--motion-enter) var(--ease-enter) both;
}

h1 {
    margin: 0 0 calc(var(--spacing) * 3);
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 600;
    line-height: var(--text-2xl--line-height);
    text-wrap: balance;
    overflow-wrap: anywhere;
}

/* Headings take focus when the state changes; the ring is for controls, not for them. */
h1:focus {
    outline: none;
}

p,
ul {
    margin: 0 0 calc(var(--spacing) * 4);
}

ul {
    padding-left: calc(var(--spacing) * 5);
}

li + li {
    margin-top: calc(var(--spacing) * 1);
}

.muted {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    line-height: var(--text-sm--line-height);
}

code {
    padding: 0.1em 0.35em;
    border-radius: var(--radius-small);
    background: var(--color-sunken);
    font-family: var(--font-mono);
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

a {
    color: var(--color-accent-text);
    text-underline-offset: 0.15em;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.actions {
    margin-top: calc(var(--spacing) * 6);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0 calc(var(--spacing) * 5);
    border: 0;
    border-radius: var(--radius-control);
    background: var(--color-accent);
    color: var(--color-on-accent);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--motion-state) var(--ease-standard);
}

.button:hover {
    background: var(--color-accent-hover);
}

@media (max-width: 30rem) {
    .button {
        width: 100%;
    }
}

.facts {
    margin: calc(var(--spacing) * 6) 0 calc(var(--spacing) * 4);
    padding: calc(var(--spacing) * 4);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: calc(var(--spacing) * 3) calc(var(--spacing) * 4);
    align-items: center;
    border-radius: var(--radius-control);
    background: var(--color-sunken);
}

.facts dt {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.facts dd {
    margin: 0;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    overflow-wrap: anywhere;
}

/* The join code is read aloud to whoever approves: large, spaced and in digits that cannot be mistaken. */
.join-code {
    margin-block: calc(var(--spacing) * 4);
    font-family: var(--font-mono);
    font-size: 2.25rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.fingerprint {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing) * 3);
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.seal {
    flex-shrink: 0;
    width: 3.5rem;
    height: 3.5rem;
}

.seal-large {
    display: block;
    width: 5rem;
    height: 5rem;
    margin-bottom: calc(var(--spacing) * 5);
}

.seal-small {
    width: 2rem;
    height: 2rem;
}

.seal-outline {
    fill: var(--color-raised);
    stroke: var(--color-accent);
}

.fp-cell {
    display: none;
}

.fp-cell.is-filled {
    display: inline;
}

.fp-tone-1 {
    fill: var(--color-identity-1);
}
.fp-tone-2 {
    fill: var(--color-identity-2);
}
.fp-tone-3 {
    fill: var(--color-identity-3);
}
.fp-tone-4 {
    fill: var(--color-identity-4);
}
.fp-tone-5 {
    fill: var(--color-identity-5);
}
.fp-tone-6 {
    fill: var(--color-identity-6);
}

/* The seal draws its outline and settles once, when the done state appears; reduced motion keeps it still. */
@media (prefers-reduced-motion: no-preference) {
    .seal-sealing .seal-outline {
        stroke-dasharray: 100;
        animation: gateway-seal-draw var(--motion-seal) var(--ease-enter) both;
    }
    .seal-sealing {
        transform-origin: center;
        animation: gateway-seal-settle var(--motion-seal) var(--ease-enter) both;
    }
}

.progress {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing) * 3);
}

.progress h1 {
    margin: 0;
}

.progress + p {
    margin-top: calc(var(--spacing) * 3);
}

.spinner {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--color-divider);
    border-top-color: var(--color-accent);
    border-radius: var(--radius-pill);
    animation: gateway-spin var(--motion-spin) linear infinite;
}

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

@keyframes gateway-enter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes gateway-seal-draw {
    from {
        stroke-dashoffset: 100;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes gateway-seal-settle {
    from {
        transform: scale(0.94);
    }
    to {
        transform: scale(1);
    }
}

@keyframes gateway-spin {
    to {
        transform: rotate(1turn);
    }
}
