
/* marketing.css — the marketing theme and the stage primitives (2026-10-18
   homepage redesign). Opt-in: linked by SiteLayout only for marketingTheme
   pages, together with the body.theme-marketing class the token set is
   scoped under, so the portal and partner-portal pages never load it and
   keep site.css's monochrome look unchanged.

   Rules for every region of this file:
   - Colour literals live in the two token blocks below and nowhere else
     (WEB-123 pins this sheet's chromatic literals to the ratified marketing
     palette, owner ruling 2026-10-18).
   - Every BEFORE state (opacity 0, a transform-from, a hidden-until-played
     element) is written ONLY under html.sw-motion [data-stage].is-armed —
     motion.js adds both after it has computed the opening frame, so JS off
     and reduced motion always show the finished frame (QA-UNIT24-WEB-75).
   - Transform and opacity only; text inside stages in cqi.
   - One region per package, appended below the core; never edit another
     package's region. */

/* ===== core (P1): tokens ===== */

.theme-marketing {
    /* Surfaces and text, light. */
    --mk-bg: #fbfbfd;
    --mk-bg-raised: #ffffff;
    --mk-bg-sunken: #f2f2f5;
    --mk-border: #e2e2e7;
    --mk-border-strong: #c9c9cf;
    --mk-text: #1d1d1f;
    --mk-text-muted: #5f5f66;
    --mk-header-bg: rgba(251, 251, 253, 0.78);

    /* Accent palette: one action colour, three glow hues for depth. */
    --mk-accent: #0066cc;
    --mk-accent-hover: #0058b0;
    --mk-on-accent: #ffffff;
    --mk-glow-a: rgba(94, 92, 230, 0.30);
    --mk-glow-b: rgba(50, 173, 230, 0.26);
    --mk-glow-c: rgba(255, 55, 95, 0.18);

    /* Layered soft shadows. */
    --mk-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.04);
    --mk-shadow-2: 0 2px 6px rgba(0, 0, 0, 0.05), 0 12px 32px rgba(0, 0, 0, 0.08);
    --mk-shadow-3: 0 4px 12px rgba(0, 0, 0, 0.06), 0 24px 60px rgba(0, 0, 0, 0.12),
        0 60px 120px rgba(0, 0, 0, 0.08);
    --mk-contact-shadow: rgba(0, 0, 0, 0.18);

    /* Product UI inside device screens. */
    --ui-bg: #ffffff;
    --ui-sidebar: #f4f4f7;
    --ui-panel: #f7f7f9;
    --ui-text: #1d1d1f;
    --ui-muted: #5f5f66;
    --ui-border: #e5e5ea;
    --ui-accent: #0066cc;
    --ui-selection: #e5f0fd;
    --ui-indigo: #5856d6;
    --ui-red: #d70015;

    /* iOS grouped surfaces (hero v2 sheets and forms). */
    --ios-grouped: #f2f2f7;
    --ios-cell: #ffffff;
    --ios-sep: #e3e3e8;
    --ios-ph: #8e8e93;
    --ios-glass: rgba(255, 255, 255, 0.72);
    --ios-dim: rgba(0, 0, 0, 0.22);

    /* sw-device frames (owner-supplied FeedbackKit tokens, 2026-10-19). */
    --sw-device-frame: #1d1f24;
    --sw-device-frame-edge: #3a3d45;
    --sw-device-bezel: #050506;
    --sw-device-screen: #ffffff;
    --sw-device-base: #c9ccd2;
    --sw-device-base-shade: #9a9ea6;
    --sw-shadow-xl: 0 24px 60px -12px rgba(15, 23, 42, 0.18);

    /* macOS window controls (P3; every Mac stage). The same in both themes. */
    --mac-close: #ff5f57;
    --mac-minimize: #febc2e;
    --mac-zoom: #28c840;

    /* PDF paper: white in both themes, as a real PDF preview is (P3). */
    --pdf-paper: #ffffff;
    --pdf-ink: #1d1d1f;
    --pdf-muted: #6e6e73;
    --pdf-rule: #e5e5ea;

    /* Status chips, each pair >= 4.5:1 (QA-UNIT24-WEB-74). */
    --chip-neutral-fg: #3a3a3c;
    --chip-neutral-bg: #ececf0;
    --chip-info-fg: #0058b0;
    --chip-info-bg: #e5f0fd;
    --chip-accent-fg: #4b3fc4;
    --chip-accent-bg: #ecebfd;
    --chip-success-fg: #1b6e33;
    --chip-success-bg: #e3f5e8;
    --chip-warn-fg: #8a4b00;
    --chip-warn-bg: #fdf0dc;
    --chip-danger-fg: #b3261e;
    --chip-danger-bg: #fde7e6;
    --badge-fg: #5f5f66;
    --badge-bg: #f2f2f5;

    /* Motion (LESSONS: 1 s transform, 0.7 s opacity, one curve). */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-1: 160ms;
    --dur-2: 320ms;
    --dur-3: 640ms;
    --dur-4: 900ms;
    --t-transform: 1s;
    --t-opacity: 0.7s;

    /* Spacing scale and radii. */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;
    --space-9: 6rem;
    --space-10: 8rem;
    --radius-s: 8px;
    --radius-m: 12px;
    --radius-l: 18px;
    --radius-xl: 28px;
    --radius-pill: 999px;

    --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display",
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* The shared site.css tokens, re-pointed for marketing pages only. */
    --bg: var(--mk-bg);
    --bg-raised: var(--mk-bg-raised);
    --bg-card: var(--mk-bg-raised);
    --border: var(--mk-border);
    --text: var(--mk-text);
    --text-muted: var(--mk-text-muted);
    --accent: var(--mk-accent);
    --accent-bright: var(--mk-accent-hover);

    color-scheme: light;
    background: var(--mk-bg);
    color: var(--mk-text);
    font-size: 1.0625rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* Dark: the OS setting, unless the visitor forced light with the theme
   toggle (html[data-theme], theme-init.js, 2026-10-19); and the same tokens
   again when they forced dark. Keep the two copies identical. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-marketing {
        --mk-bg: #050507;
        --mk-bg-raised: #141416;
        --mk-bg-sunken: #0c0c0e;
        --mk-border: #2a2a2e;
        --mk-border-strong: #3d3d42;
        --mk-text: #f5f5f7;
        --mk-text-muted: #a1a1a8;
        --mk-header-bg: rgba(5, 5, 7, 0.72);

        --mk-accent: #2997ff;
        --mk-accent-hover: #47a6ff;
        --mk-on-accent: #050507;
        --mk-glow-a: rgba(94, 92, 230, 0.42);
        --mk-glow-b: rgba(50, 173, 230, 0.30);
        --mk-glow-c: rgba(255, 55, 95, 0.24);

        --mk-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
        --mk-shadow-2: 0 2px 6px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.5);
        --mk-shadow-3: 0 4px 12px rgba(0, 0, 0, 0.5), 0 24px 60px rgba(0, 0, 0, 0.55),
            0 60px 120px rgba(0, 0, 0, 0.45);
        --mk-contact-shadow: rgba(0, 0, 0, 0.6);

        --ui-bg: #1c1c1e;
        --ui-sidebar: #232326;
        --ui-panel: #252528;
        --ui-text: #f5f5f7;
        --ui-muted: #a1a1a8;
        --ui-border: #38383c;
        --ui-accent: #2997ff;
        --ui-selection: #0d2a4a;
        --ui-indigo: #5e5ce6;
        --ui-red: #d70015;

        --ios-grouped: #000000;
        --ios-cell: #1c1c1e;
        --ios-sep: #38383a;
        --ios-ph: #8e8e93;
        --ios-glass: rgba(60, 60, 64, 0.62);
        --ios-dim: rgba(0, 0, 0, 0.45);

        --sw-device-frame: #2a2d34;
        --sw-device-frame-edge: #4b4f59;
        --sw-device-bezel: #050506;
        --sw-device-screen: #0b1220;
        --sw-device-base: #5b6069;
        --sw-device-base-shade: #3d4148;
        --sw-shadow-xl: 0 24px 60px -12px rgba(0, 0, 0, 0.6);

        --mac-close: #ff5f57;
        --mac-minimize: #febc2e;
        --mac-zoom: #28c840;

        --pdf-paper: #ffffff;
        --pdf-ink: #1d1d1f;
        --pdf-muted: #6e6e73;
        --pdf-rule: #e5e5ea;

        --chip-neutral-fg: #d1d1d6;
        --chip-neutral-bg: #2c2c30;
        --chip-info-fg: #6cb6ff;
        --chip-info-bg: #0d2a4a;
        --chip-accent-fg: #a9a3ff;
        --chip-accent-bg: #221e4a;
        --chip-success-fg: #5fd38a;
        --chip-success-bg: #0f2e1b;
        --chip-warn-fg: #ffb340;
        --chip-warn-bg: #3a2508;
        --chip-danger-fg: #ff8a80;
        --chip-danger-bg: #3d1412;
        --badge-fg: #a1a1a8;
        --badge-bg: #1c1c1f;

        color-scheme: dark;
    }
}

:root[data-theme="dark"] .theme-marketing {
    --mk-bg: #050507;
    --mk-bg-raised: #141416;
    --mk-bg-sunken: #0c0c0e;
    --mk-border: #2a2a2e;
    --mk-border-strong: #3d3d42;
    --mk-text: #f5f5f7;
    --mk-text-muted: #a1a1a8;
    --mk-header-bg: rgba(5, 5, 7, 0.72);

    --mk-accent: #2997ff;
    --mk-accent-hover: #47a6ff;
    --mk-on-accent: #050507;
    --mk-glow-a: rgba(94, 92, 230, 0.42);
    --mk-glow-b: rgba(50, 173, 230, 0.30);
    --mk-glow-c: rgba(255, 55, 95, 0.24);

    --mk-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
    --mk-shadow-2: 0 2px 6px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.5);
    --mk-shadow-3: 0 4px 12px rgba(0, 0, 0, 0.5), 0 24px 60px rgba(0, 0, 0, 0.55),
        0 60px 120px rgba(0, 0, 0, 0.45);
    --mk-contact-shadow: rgba(0, 0, 0, 0.6);

    --ui-bg: #1c1c1e;
    --ui-sidebar: #232326;
    --ui-panel: #252528;
    --ui-text: #f5f5f7;
    --ui-muted: #a1a1a8;
    --ui-border: #38383c;
    --ui-accent: #2997ff;
    --ui-selection: #0d2a4a;
    --ui-indigo: #5e5ce6;
    --ui-red: #d70015;

    --ios-grouped: #000000;
    --ios-cell: #1c1c1e;
    --ios-sep: #38383a;
    --ios-ph: #8e8e93;
    --ios-glass: rgba(60, 60, 64, 0.62);
    --ios-dim: rgba(0, 0, 0, 0.45);

    --sw-device-frame: #2a2d34;
    --sw-device-frame-edge: #4b4f59;
    --sw-device-bezel: #050506;
    --sw-device-screen: #0b1220;
    --sw-device-base: #5b6069;
    --sw-device-base-shade: #3d4148;
    --sw-shadow-xl: 0 24px 60px -12px rgba(0, 0, 0, 0.6);

    --mac-close: #ff5f57;
    --mac-minimize: #febc2e;
    --mac-zoom: #28c840;

    --pdf-paper: #ffffff;
    --pdf-ink: #1d1d1f;
    --pdf-muted: #6e6e73;
    --pdf-rule: #e5e5ea;

    --chip-neutral-fg: #d1d1d6;
    --chip-neutral-bg: #2c2c30;
    --chip-info-fg: #6cb6ff;
    --chip-info-bg: #0d2a4a;
    --chip-accent-fg: #a9a3ff;
    --chip-accent-bg: #221e4a;
    --chip-success-fg: #5fd38a;
    --chip-success-bg: #0f2e1b;
    --chip-warn-fg: #ffb340;
    --chip-warn-bg: #3a2508;
    --chip-danger-fg: #ff8a80;
    --chip-danger-bg: #3d1412;
    --badge-fg: #a1a1a8;
    --badge-bg: #1c1c1f;

    color-scheme: dark;
}

/* ===== core (P1): chrome on marketing pages ===== */

/* The root carries site.css's dark-only color-scheme; a marketing page
   follows the OS instead (scrollbars, form controls, the canvas). */
:root:has(> body.theme-marketing) {
    color-scheme: light dark;
    /* The page, not the hero box, clips the hero cluster's bleed at the
       true viewport edge: no horizontal scroll at 320-767 px (hero v2;
       body's own clip does not stop the root scroller). Clip never makes
       a scroll container, so the sticky header is unaffected. */
    overflow-x: clip;
}

:root[data-theme="light"]:has(> body.theme-marketing) {
    color-scheme: light;
}

:root[data-theme="dark"]:has(> body.theme-marketing) {
    color-scheme: dark;
}

.theme-marketing .site-header {
    background: var(--mk-header-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
}

.theme-marketing .site-nav .nav-login,
.theme-marketing .site-nav .nav-login:hover {
    color: var(--mk-on-accent);
}

.theme-marketing .site-nav:popover-open {
    box-shadow: var(--mk-shadow-3);
}

.theme-marketing h1,
.theme-marketing h2,
.theme-marketing h3 {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.theme-marketing .footer-social img {
    filter: brightness(0);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-marketing .footer-social img {
        filter: brightness(0) invert(1);
    }
}

:root[data-theme="dark"] .theme-marketing .footer-social img {
    filter: brightness(0) invert(1);
}

/* ===== core (P1): stage primitives ===== */

/* The stage: a fixed aspect-ratio box (6/5 default; hero 100/51; phone
   100/108). Children are placed in percent of it by --x --y --w (unitless
   numbers), stacked by --z and leaned by --r (degrees). Set the four per
   element from a stage's own region, never inline (CSP). */
.stage {
    position: relative;
    width: 100%;
    aspect-ratio: var(--stage-ratio, 6 / 5);
    container-type: inline-size;
    isolation: isolate;
    font-size: 1.6cqi;
    color: var(--ui-text);
}

.stage--hero {
    --stage-ratio: 100 / 51;
}

.stage--phone {
    --stage-ratio: 100 / 108;
}

.stage-item {
    position: absolute;
    left: calc(var(--x, 0) * 1%);
    top: calc(var(--y, 0) * 1%);
    width: calc(var(--w, 100) * 1%);
    z-index: var(--z, 1);
    rotate: calc(var(--r, 0) * 1deg);
}

/* The soft three-colour glow behind a device cluster. */
.stage-glow {
    position: absolute;
    inset: 8% 6%;
    z-index: 0;
    border-radius: 50%;
    background:
        radial-gradient(closest-side at 30% 40%, var(--mk-glow-a), transparent),
        radial-gradient(closest-side at 70% 35%, var(--mk-glow-b), transparent),
        radial-gradient(closest-side at 55% 75%, var(--mk-glow-c), transparent);
    filter: blur(6cqi);
    pointer-events: none;
}

/* ----- device frames: sw-device (hero v2, 2026-10-19) -----
   The owner-supplied FeedbackKit pure-CSS frames, renamed fk- -> sw-
   (DEVICE-FRAMES handoff). No images. The figure is the inline-size
   container and every length INSIDE it is in cqi; never put cqi on
   .sw-device itself (it would resolve against the stage). The variant
   radius / bezel / screen ratio are custom properties, so the screen
   radius is concentric (radius - bezel). Colours only from the
   --sw-device-* tokens in the marketing token blocks. Inside a stage the
   stage root is the one role="img" and every figure is aria-hidden.

   SAFARI FIX (keep): Safari does not apply an ancestor's overflow + radius
   to a composited descendant (transform, will-change, transition,
   animation), so animating screen content showed square corners over the
   bezel. The fix is a matching rounded clip-path on .sw-device__content
   (never on the screen, which would clip the screen's own shadow); a
   variant that changes the screen radius sets the matching clip-path. */
.sw-device {
    --sw-device-radius: 0cqi;
    --sw-device-bezel-size: 0cqi;
    --sw-device-screen-ratio: 9 / 19.5;
    container-type: inline-size;
    position: relative;
    display: block;
    width: var(--sw-device-width, 100%);
    margin: 0;
}

.sw-device__body {
    position: relative;
    padding: var(--sw-device-bezel-size);
    border-radius: var(--sw-device-radius);
    background: var(--sw-device-bezel);
    box-shadow: 0 0 0 0.6cqi var(--sw-device-frame), 0 0 0 0.9cqi var(--sw-device-frame-edge), var(--sw-shadow-xl);
}

.sw-device__screen {
    position: relative;
    overflow: hidden;
    aspect-ratio: var(--sw-device-screen-ratio);
    border-radius: calc(var(--sw-device-radius) - var(--sw-device-bezel-size));
    background: var(--sw-device-screen);
    isolation: isolate;
}

.sw-device__content {
    position: absolute;
    inset: 0;
    overflow: hidden;
    clip-path: inset(0 round calc(var(--sw-device-radius) - var(--sw-device-bezel-size)));
}

.sw-device__sensor,
.sw-device__glare,
.sw-device__buttons,
.sw-device__base {
    pointer-events: none;
}

.sw-device__glare {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0) 38%);
    mix-blend-mode: screen;
}

.sw-device__sensor {
    position: absolute;
    z-index: 3;
    inset-inline-start: 50%;
    background: var(--sw-device-bezel);
    transform: translateX(-50%);
}

[dir="rtl"] .sw-device__sensor {
    transform: translateX(50%);
}

.sw-device__buttons,
.sw-device__base {
    display: none;
}

/* iPhone */
.sw-device--iphone {
    --sw-device-radius: 16cqi;
    --sw-device-bezel-size: 3.4cqi;
    --sw-device-screen-ratio: 9 / 19.5;
}

.sw-device--iphone .sw-device__sensor {
    top: calc(var(--sw-device-bezel-size) + 2.2cqi);
    width: 30cqi;
    height: 8.6cqi;
    border-radius: var(--radius-pill);
}

.sw-device--iphone .sw-device__buttons {
    display: block;
    position: absolute;
    inset: 0;
}

.sw-device--iphone .sw-device__buttons::before,
.sw-device--iphone .sw-device__buttons::after {
    content: "";
    position: absolute;
    width: 1.1cqi;
    border-radius: 0.6cqi;
    background: var(--sw-device-frame-edge);
}

.sw-device--iphone .sw-device__buttons::before {
    left: -1.9cqi;
    top: 22%;
    height: 7%;
    box-shadow: 0 9cqi 0 var(--sw-device-frame-edge), 0 23cqi 0 var(--sw-device-frame-edge);
}

.sw-device--iphone .sw-device__buttons::after {
    right: -1.9cqi;
    top: 30%;
    height: 11%;
}

/* iPad (landscape 4:3) */
.sw-device--ipad {
    --sw-device-radius: 4.2cqi;
    --sw-device-bezel-size: 2.6cqi;
    --sw-device-screen-ratio: 4 / 3;
}

.sw-device--ipad .sw-device__sensor {
    top: calc(var(--sw-device-bezel-size) / 2 - 0.45cqi);
    width: 0.9cqi;
    height: 0.9cqi;
    border-radius: 50%;
    background: var(--sw-device-frame-edge);
}

/* Mac (MacBook): the body sits inside 7cqi side margins over the base. */
.sw-device--mac {
    --sw-device-radius: 2.6cqi;
    --sw-device-bezel-size: 1.6cqi;
    --sw-device-screen-ratio: 16 / 10;
}

.sw-device--mac .sw-device__body {
    margin-inline: 7cqi;
    margin-bottom: 3.4cqi;
    border-end-start-radius: 0.6cqi;
    border-end-end-radius: 0.6cqi;
    padding-bottom: 2.4cqi;
    box-shadow: 0 0 0 0.35cqi var(--sw-device-frame-edge), var(--sw-shadow-xl);
}

.sw-device--mac .sw-device__screen {
    border-radius: 1cqi;
}

/* SAFARI FIX: must match the Mac screen radius above. */
.sw-device--mac .sw-device__content {
    clip-path: inset(0 round 1cqi);
}

.sw-device--mac .sw-device__sensor {
    top: var(--sw-device-bezel-size);
    width: 13cqi;
    height: 2cqi;
    border-end-start-radius: 0.8cqi;
    border-end-end-radius: 0.8cqi;
}

.sw-device--mac .sw-device__base {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3.6cqi;
    border-radius: 0.4cqi 0.4cqi 6cqi 6cqi / 0.4cqi 0.4cqi 2.8cqi 2.8cqi;
    background: linear-gradient(180deg, var(--sw-device-base) 0%, var(--sw-device-base) 45%, var(--sw-device-base-shade) 100%);
    box-shadow: var(--sw-shadow-xl);
}

.sw-device--mac .sw-device__base::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 15cqi;
    height: 1.2cqi;
    transform: translateX(-50%);
    border-radius: 0 0 1.2cqi 1.2cqi;
    background: var(--sw-device-base-shade);
}

/* The screen root a stage draws into (one per device), inside
   .sw-device__content; each stage sets its type scale per variant, in cqi
   (which resolves against the whole device width). */
.sw-screen {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: var(--ui-bg);
    color: var(--ui-text);
    font-family: var(--font-display);
    line-height: 1.35;
}

/* ----- UI pieces ----- */

.card {
    background: var(--ui-bg);
    border: 0.12em solid var(--ui-border);
    border-radius: 0.9em;
    box-shadow: var(--mk-shadow-1);
    padding: 0.8em 1em;
}

/* A tool call: icon, label, and a status (spinner while running, a check
   when complete; the running mark carries data-until in the fragment). */
.tool-card {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.55em 0.8em;
    border: 0.12em solid var(--ui-border);
    border-radius: 0.7em;
    background: var(--ui-panel);
    color: var(--ui-text);
}

.tool-card-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-card-status {
    display: inline-grid;
    flex: 0 0 auto;
    width: 1.2em;
    height: 1.2em;
}

.tool-card-status > * {
    grid-area: 1 / 1;
}

.tool-check {
    color: var(--chip-success-fg);
    font-weight: 700;
}

.tool-spinner {
    border: 0.18em solid var(--ui-border);
    border-top-color: var(--ui-accent);
    border-radius: 50%;
}

/* The approval gate: title, detail, one prominent and one quiet action. */
.approval-card {
    display: grid;
    gap: 0.6em;
    padding: 0.9em 1em;
    border: 0.12em solid var(--ui-border);
    border-radius: 0.9em;
    background: var(--ui-bg);
    box-shadow: var(--mk-shadow-2);
}

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

.approval-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}

.approval-yes,
.approval-no {
    padding: 0.4em 0.9em;
    border-radius: var(--radius-pill);
    font-weight: 600;
}

.approval-yes {
    background: var(--ui-accent);
    color: var(--mk-on-accent);
}

.approval-no {
    background: var(--chip-neutral-bg);
    color: var(--chip-neutral-fg);
}

/* Status chips. A chip STACK keeps every state in one grid cell, so a
   state change is an opacity cross-fade and never a reflow. */
.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15em 0.65em;
    border-radius: var(--radius-pill);
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    color: var(--chip-neutral-fg);
    background: var(--chip-neutral-bg);
}

.chip--info { color: var(--chip-info-fg); background: var(--chip-info-bg); }
.chip--accent { color: var(--chip-accent-fg); background: var(--chip-accent-bg); }
.chip--success { color: var(--chip-success-fg); background: var(--chip-success-bg); }
.chip--warn { color: var(--chip-warn-fg); background: var(--chip-warn-bg); }
.chip--danger { color: var(--chip-danger-fg); background: var(--chip-danger-bg); }

.chip-stack {
    display: inline-grid;
    justify-items: start;
}

.chip-stack > .chip {
    grid-area: 1 / 1;
}

/* The "Sample data" badge on every money figure (BRIEF: honest data). */
.sample-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1em 0.55em;
    border: 0.08em solid var(--mk-border-strong);
    border-radius: var(--radius-pill);
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--badge-fg);
    background: var(--badge-bg);
    white-space: nowrap;
}

/* The pointer and the tap ripple. Positioned with --x/--y like any item;
   a move is a data-at step whose --from is the offset it travels from. */
.cursor {
    position: absolute;
    left: calc(var(--x, 0) * 1%);
    top: calc(var(--y, 0) * 1%);
    z-index: 20;
    width: 2.2cqi;
    aspect-ratio: 3 / 4;
    background: var(--ui-text);
    clip-path: polygon(0 0, 100% 72%, 56% 70%, 74% 100%, 58% 100%, 42% 74%, 0 100%);
    pointer-events: none;
}

.tap-ripple {
    position: absolute;
    left: calc(var(--x, 0) * 1%);
    top: calc(var(--y, 0) * 1%);
    z-index: 19;
    width: 6cqi;
    aspect-ratio: 1;
    margin: -3cqi 0 0 -3cqi;
    border-radius: 50%;
    background: var(--ui-accent);
    opacity: 0.25;
    pointer-events: none;
}

/* Elements a later step replaces: hidden in the finished frame (no double
   reading), shown and cross-faded only while the stage is armed. A loop
   whose finished frame sits MID-loop (the hero, 2026-10-19) marks the
   timed elements that frame contains with data-final, so they stay; the
   /dev/design finished copy (root renamed data-stage-static) obeys the
   same rule. */
:is([data-stage], [data-stage-static]):not(.is-armed) [data-until]:not([data-final]) {
    display: none;
}

/* ===== core (P1): the motion gate =====
   Everything below is a before state or a transition, and every selector
   starts with html.sw-motion [data-stage].is-armed. */

html.sw-motion [data-stage].is-armed [data-at],
html.sw-motion [data-stage].is-armed [data-until] {
    transition:
        opacity var(--t-opacity) var(--ease) var(--d, 0ms),
        transform var(--t-transform) var(--ease) var(--d, 0ms);
}

html.sw-motion [data-stage].is-armed [data-at]:not(.is-on),
html.sw-motion [data-stage].is-armed [data-until]:not(.is-on) {
    opacity: 0;
    transform: var(--from, none);
}

html.sw-motion [data-stage].is-armed.is-fading [data-fade] {
    opacity: 0;
}

html.sw-motion [data-stage].is-armed.is-instant,
html.sw-motion [data-stage].is-armed.is-instant * {
    transition: none !important;
    animation: none !important;
}

html.sw-motion [data-stage].is-armed.is-pinned [data-at],
html.sw-motion [data-stage].is-armed.is-pinned .stage-item {
    will-change: transform, opacity;
}

html.sw-motion [data-stage].is-armed [data-type].is-typing::after {
    content: "";
    display: inline-block;
    width: 0.08em;
    height: 1em;
    margin-left: 0.06em;
    vertical-align: -0.12em;
    background: currentColor;
    animation: sw-caret 1s steps(1) infinite;
}

html.sw-motion [data-stage].is-armed .tool-spinner {
    animation: sw-spin 0.9s linear infinite;
}

html.sw-motion [data-stage].is-armed .tap-ripple.is-on {
    animation: sw-ripple var(--dur-3) var(--ease) both;
}

@keyframes sw-caret {
    50% { opacity: 0; }
}

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

@keyframes sw-ripple {
    from { transform: scale(0.3); opacity: 0.45; }
    to { transform: scale(1.6); opacity: 0; }
}

/* ===== P2: FAQ ===== */

/* Native <details>: opens without JS; the answer is always in the DOM. */
.theme-marketing .faq-list {
    display: grid;
    gap: 0.75rem;
    max-width: 46rem;
    margin-inline: auto;
}

.theme-marketing .faq-item {
    border: 1px solid var(--mk-border);
    border-radius: 14px;
    background: var(--mk-bg-raised);
    padding: 0 1.25rem;
}

.theme-marketing .faq-question {
    cursor: pointer;
    min-height: 44px;
    padding: 1rem 0;
    font-weight: 600;
    color: var(--mk-text);
}

.theme-marketing .faq-answer {
    margin: 0 0 1rem;
    color: var(--mk-text-muted);
}

/* ===== P3: hero (append below) ===== */

/* --- the hero section: copy first, then the F1 cluster below it --- */

.theme-marketing .mk-hero {
    /* Full-bleed breakout (site.css .hero's recipe): cancel the column and
       main's top padding; clip the cluster's lean and the phones' drift. */
    margin: -2.5rem calc(50% - 50vw) 0;
    padding: 3.5rem var(--gutter) 1.5rem;
    text-align: center;
    /* No overflow clip here (hero v2): the cluster may bleed past the hero
       box, and only the page (body overflow-x: clip, site.css) clips it,
       at the true viewport edge. */
    position: relative;
}

.theme-marketing .mk-hero-copy {
    max-width: 52rem;
    margin: 0 auto;
}

.theme-marketing .mk-kicker {
    margin: 0 0 0.9rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--mk-accent);
}

.theme-marketing .mk-hero h1 {
    margin: 0 auto 1.1rem;
    font-size: clamp(2.3rem, 6.2vw, 4.6rem);
    line-height: 1.04;
    letter-spacing: -0.035em;
    max-width: 15em;
}

.theme-marketing .mk-hero h1 .dot {
    color: var(--mk-accent);
}

.theme-marketing .mk-hero .hero-sub {
    max-width: 38rem;
    margin: 0 auto 1.8rem;
    font-size: clamp(1.06rem, 1.6vw, 1.3rem);
    line-height: 1.5;
    color: var(--mk-text-muted);
}

.theme-marketing .mk-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.9rem 1.1rem;
}

.theme-marketing .mk-hero-actions .badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 0;
}

.theme-marketing .mk-hero-actions .badge {
    height: 44px;
    width: auto;
}

.theme-marketing .mk-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 1.5rem;
    border-radius: var(--radius-pill);
    background: var(--mk-accent);
    color: var(--mk-on-accent);
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--mk-shadow-1);
}

.theme-marketing .mk-btn-primary:hover {
    background: var(--mk-accent-hover);
    color: var(--mk-on-accent);
}

.theme-marketing .mk-btn-primary:focus-visible {
    outline: 3px solid var(--mk-accent);
    outline-offset: 3px;
}

.theme-marketing .mk-hero .hero-note {
    margin: 1.2rem 0 0;
    font-size: 0.92rem;
    color: var(--mk-text-muted);
}

.theme-marketing .mk-hero-stage {
    max-width: 1240px;
    margin: clamp(1.5rem, 3.5vw, 3rem) auto 0;
}

@media (max-width: 480px) {
    .theme-marketing .mk-hero {
        margin-top: -1.6rem;
        padding-top: 2.6rem;
        text-align: left;
    }

    .theme-marketing .mk-hero-actions {
        justify-content: flex-start;
    }

    .theme-marketing .mk-btn-primary {
        width: 100%;
    }
}

/* The provider strip's logos are flattened to white for the dark-only site;
   turning the theme on for the homepage (P3) needs the light twin, exactly
   as the core region does for the footer icons. */
.theme-marketing .provider-logo {
    filter: brightness(0);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-marketing .provider-logo {
        filter: brightness(0) invert(1);
    }
}

:root[data-theme="dark"] .theme-marketing .provider-logo {
    filter: brightness(0) invert(1);
}

/* --- shared mock-UI chrome (P3; P4/P5 Mac and iPhone stages reuse it) --- */

.ic {
    width: 1.1em;
    height: 1.1em;
    flex: 0 0 auto;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 0;
}

.mac-window {
    flex: 1 1 auto;
    min-height: 0;
    margin: 1.1em 1.5em 1.3em;
    overflow: hidden;
    border-radius: 1.05em;
    background: var(--ui-bg);
    box-shadow: 0 0 0 0.07em var(--ui-border), 0 1.2em 3em rgba(0, 0, 0, 0.26);
}

.mac-sidebar {
    background: color-mix(in oklab, var(--ui-sidebar) 80%, transparent);
    border-right: 0.07em solid var(--ui-border);
}

.mac-traffic {
    display: flex;
    gap: 0.5em;
}

.mac-traffic i {
    width: 0.85em;
    height: 0.85em;
    border-radius: 50%;
    background: var(--mac-close);
}

.mac-traffic i:nth-child(2) { background: var(--mac-minimize); }
.mac-traffic i:nth-child(3) { background: var(--mac-zoom); }

/* A grid cell that stacks its children: a state change is a cross-fade in
   place, never a reflow (LESSONS: chip states in one cell). */
.mc-stack {
    display: grid;
}

.mc-stack > * {
    grid-area: 1 / 1;
}

/* ===== P3: the macOS Main Chat window pieces =====
   Born in the P3 F1 hero stage; F1 is retired (hero v2, 2026-10-19). What
   is left is the approval choice card and the stack / slot helpers the F2,
   F5, F6 and F7 record windows use; the Main Chat window pieces went with
   the P5 F5 rework (memory moved into the record assistant). */

.mc-slot {
    display: grid;
}

.mc-slot > * {
    grid-area: 1 / 1;
}

/* The approval gate in its answered state: option 1 chosen, option 2
   dimmed, exactly as the choice card reads once submitted. */
.mc-choice {
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.mc-choice-head {
    display: flex;
    align-items: flex-start;
    gap: 0.8em;
    padding: 0.75em 0.9em 0.65em;
}

.mc-choice-head .approval-title {
    flex: 1 1 auto;
    font-size: 0.95em;
}

.mc-choice-x {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 1.6em;
    height: 1.6em;
    border-radius: 50%;
    color: var(--ui-muted);
    background: var(--ui-panel);
}

.mc-choice-x .ic {
    width: 0.85em;
    height: 0.85em;
}

.mc-opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7em;
    padding: 0.5em 0.9em;
    border-top: 0.07em solid var(--ui-border);
}

.mc-opt-num {
    display: inline-grid;
    flex: 0 0 auto;
    width: 1.65em;
    height: 1.65em;
    font-size: 0.85em;
    font-weight: 700;
}

.mc-opt-num > * {
    grid-area: 1 / 1;
    display: grid;
    place-items: center;
    border-radius: 0.4em;
    color: var(--ui-muted);
    background: var(--chip-neutral-bg);
}

.mc-opt-num > .mc-opt-num-on {
    color: var(--mk-on-accent);
    background: var(--ui-accent);
}

.mc-opt-label {
    flex: 1 1 auto;
    min-width: 0;
}

.mc-opt-mark {
    display: inline-grid;
    flex: 0 0 auto;
    width: 1.25em;
    height: 1.25em;
}

.mc-opt-mark > * {
    grid-area: 1 / 1;
}

.mc-radio {
    border: 0.12em solid var(--ui-border);
    border-radius: 50%;
}

.mc-radio-on {
    color: var(--ui-accent);
}

.mc-radio-on .ic {
    width: 100%;
    height: 100%;
}

.mc-radio-on .ic path {
    stroke: var(--ui-bg);
}

.mc-choice-foot {
    justify-content: flex-end;
    padding: 0.5em 0.9em 0.6em;
    border-top: 0.07em solid var(--ui-border);
}

.mc-confirm {
    padding: 0.3em 0.9em;
    border-radius: 0.45em;
    font-size: 0.88em;
    font-weight: 700;
    color: var(--mk-on-accent);
    background: var(--ui-accent);
}

.mc-placeholder {
    color: var(--ui-muted);
}

/* The thinking dots (the hero loop). */

@keyframes sw-dot {
    0%, 80%, 100% { opacity: 0.25; }
    40% { opacity: 1; }
}

/* ===== P4: chapters (ChapterSection) ===== */

/* A chapter: an answer-first head, then one step per stage, the copy (a real
   h3 and a sentence or two) beside the stage. Full-bleed like the hero so
   the stages get the width; the inner column stays at 1240 px. */
.theme-marketing .mk-chapter {
    margin: 0 calc(50% - 50vw);
    padding: clamp(3.5rem, 9vw, 7rem) var(--gutter) clamp(2rem, 5vw, 4rem);
    overflow-x: clip;
}

.theme-marketing .mk-chapter-head {
    max-width: 46rem;
    margin: 0 auto clamp(2.5rem, 6vw, 4.5rem);
    text-align: center;
}

.theme-marketing .mk-chapter-head h2 {
    margin: 0 0 0.9rem;
    font-size: clamp(2.1rem, 5vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.032em;
}

.theme-marketing .mk-chapter-lead {
    max-width: 36rem;
    margin: 0 auto;
    font-size: clamp(1.06rem, 1.5vw, 1.25rem);
    line-height: 1.5;
    color: var(--mk-text-muted);
}

.theme-marketing .mk-steps {
    display: grid;
    gap: clamp(3.5rem, 9vw, 6rem);
    max-width: 1240px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.theme-marketing .mk-step-pin {
    display: grid;
    gap: clamp(1.25rem, 3vw, 2rem);
    align-items: center;
}

.theme-marketing .mk-step-copy h3 {
    margin: 0 0 0.6rem;
    font-size: clamp(1.45rem, 2.6vw, 2.1rem);
    line-height: 1.15;
    letter-spacing: -0.024em;
    color: var(--mk-text);
}

.theme-marketing .mk-step-copy p {
    max-width: 30rem;
    margin: 0;
    font-size: clamp(1.02rem, 1.3vw, 1.15rem);
    line-height: 1.55;
    color: var(--mk-text-muted);
}

.theme-marketing .mk-step-stage {
    min-width: 0;
}

@media (min-width: 900px) {
    .theme-marketing .mk-step-pin {
        grid-template-columns: minmax(14rem, 0.78fr) minmax(0, 2fr);
        gap: clamp(2rem, 4vw, 4rem);
    }

    .theme-marketing .mk-step:nth-child(even) .mk-step-pin {
        grid-template-columns: minmax(0, 2fr) minmax(14rem, 0.78fr);
    }

    .theme-marketing .mk-step:nth-child(even) .mk-step-copy {
        order: 2;
    }
}

/* Pinned scroll-scrub (motion.js contract): only on a large screen, only
   with script and motion. Each step is a tall track and its pin box sticks
   under the header, so copy and stage stay on screen together for the whole
   scrub (no half-empty run-in); the stage is bounded by the viewport height
   so it never overflows the box. Everywhere else the steps stack normally
   and each stage plays once on its timer. */
@media (min-width: 1024px) and (min-height: 640px) and (prefers-reduced-motion: no-preference) and (scripting: enabled) {
    .theme-marketing .mk-steps {
        gap: 0;
    }

    .theme-marketing .mk-step {
        height: 210vh;
    }

    .theme-marketing .mk-step-pin {
        position: sticky;
        top: 4.25rem;
        height: calc(100vh - 4.25rem);
        align-content: center;
    }

    .theme-marketing .mk-step-stage {
        width: min(100%, calc((100vh - 8rem) * 100 / 66));
        justify-self: center;
    }
}

/* ===== P4: F2, F5 — macOS windows for the chapter stages ===== */

/* One floating macOS window over the glow (no laptop: the window gets every
   pixel). The stage is 100/66; the window is 16/10 at 96 % of it. */
.chap-stage {
    --stage-ratio: 100 / 66;
    margin: 0;
    text-align: left;
}

.chap-glow {
    inset: 6% 4% 0;
}

.chap-window {
    --x: 2;
    --y: 3;
    --w: 96;
    --z: 1;
}

.chap-window .mac-window {
    position: relative;
    aspect-ratio: 16 / 10;
    margin: 0;
    font-size: 1.45cqi;
    box-shadow: 0 0 0 0.07em var(--ui-border), var(--mk-shadow-3);
}

.ic-knock path {
    stroke: var(--ui-bg);
}

/* ---- the record window (F2): title bar, sidebar, content, inspector ---- */

.cw {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    font-family: var(--font-display);
    letter-spacing: -0.005em;
}

.cw-bar,
.cw-body {
    display: grid;
    grid-template-columns: 20.5% minmax(0, 1fr) 34%;
    min-height: 0;
}

.cw-bar {
    align-items: center;
    height: 3.4em;
    border-bottom: 0.07em solid var(--ui-border);
    background: var(--ui-bg);
}

.cw-bar-side {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    height: 100%;
    padding: 0 1em;
    background: var(--ui-sidebar);
}

.cw-bar-main {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1em;
    min-width: 0;
    padding: 0 1em;
}

.cw-title {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.2;
}

.cw-title-main {
    overflow: hidden;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cw-subtitle {
    font-size: 0.82em;
    color: var(--ui-muted);
}

.cw-tools {
    display: flex;
    gap: 0.35em;
    padding: 0.25em;
    border-radius: var(--radius-pill);
    background: var(--ui-panel);
    box-shadow: 0 0 0 0.07em var(--ui-border);
}

.cw-tool,
.cw-icon {
    display: inline-grid;
    place-items: center;
    width: 2em;
    height: 2em;
    border-radius: 50%;
    color: var(--ui-muted);
}

.cw-tool .ic,
.cw-icon .ic {
    width: 1.2em;
    height: 1.2em;
}

.cw-save.is-clean {
    opacity: 0.45;
}

.cw-ai-toggle {
    color: var(--ui-accent);
}

.cw--inspector .cw-ai-toggle {
    background: var(--ui-selection);
}

.cw-bar-insp {
    display: flex;
    align-items: center;
    gap: 0.4em;
    height: 100%;
    padding: 0 0.8em 0 1em;
    border-left: 0.07em solid var(--ui-border);
    background: var(--ui-panel);
}

.cw-insp-title {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 0.45em;
    min-width: 0;
    font-weight: 700;
    white-space: nowrap;
}

.cw-spark {
    color: var(--ui-accent);
}

.cw-sidebar {
    display: grid;
    align-content: start;
    gap: 0.2em;
    margin: 0;
    padding: 0.8em 0.6em;
    list-style: none;
    border-right: none;
    background: var(--ui-sidebar);
}

.cw-sidebar li {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.45em 0.6em;
    border-radius: 0.5em;
    white-space: nowrap;
    overflow: hidden;
}

.cw-sidebar .ic {
    color: var(--ui-accent);
}

.cw-sidebar li.is-selected {
    background: var(--ui-selection);
    font-weight: 600;
}

/* The detail column fills the window like CustomerBasicInformationView:
   leading-aligned, GroupBoxes at full width, capped at the app's 700 pt
   (53.8 em of 13 pt), a cap this window never reaches (owner review
   2026-10-19: closed, the cards fill the window; open, they narrow). */
.cw-content {
    display: grid;
    grid-template-columns: minmax(0, 53.8em);
    align-content: start;
    gap: 1.1em;
    min-width: 0;
    padding: 1.3em 1.6em;
    overflow: hidden;
    background: var(--ui-bg);
}

/* A macOS GroupBox: the label row above a softly filled rounded box. */
.cw-box {
    display: grid;
    gap: 0.5em;
    min-width: 0;
}

.cw-box-label {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-weight: 700;
}

.cw-box-label .ic {
    color: var(--ui-muted);
}

.cw-box-body {
    position: relative;
    display: grid;
    gap: 0.8em;
    padding: 0.9em 1em;
    border-radius: 0.75em;
    background: var(--ui-panel);
    box-shadow: 0 0 0 0.07em var(--ui-border);
}

.cw-field {
    position: relative;
    display: grid;
    gap: 0.3em;
    min-width: 0;
}

.cw-label {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--ui-muted);
}

.cw-input {
    display: block;
    min-height: 2.2em;
    padding: 0.45em 0.7em;
    border-radius: 0.5em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--ui-bg);
    box-shadow: 0 0 0 0.07em var(--ui-border);
}

.cw-select {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8em;
    justify-self: start;
    min-width: 9em;
    min-height: 2.2em;
    padding: 0.4em 0.6em 0.4em 0.8em;
    border-radius: 0.5em;
    font-weight: 600;
    background: var(--ui-bg);
    box-shadow: 0 0 0 0.07em var(--ui-border), var(--mk-shadow-1);
}

.cw-select .ic {
    color: var(--ui-muted);
}

.cw-caption {
    display: flex;
    align-items: center;
    gap: 0.45em;
    min-height: 1.4em;
    font-size: 0.82em;
    color: var(--ui-muted);
}

/* The field that just changed: an accent ring that pulses once. */
.cw-flash {
    position: absolute;
    inset: -0.35em;
    border-radius: 0.8em;
    box-shadow: 0 0 0 0.16em var(--ui-accent), 0 0 1.4em var(--mk-glow-b);
    pointer-events: none;
}

.cw-box-body > .cw-flash {
    inset: 0.45em 0.6em auto;
    height: 3.3em;
}

/* ---- the inspector column ---- */

.cw-inspector {
    position: relative;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    border-left: 0.07em solid var(--ui-border);
    background: var(--ui-panel);
}

/* The inspector (macOS .inspector): the window keeps its size, the column
   opens from the trailing edge and the content narrows (owner review
   2026-10-19). The panel keeps its open width (34 % of the 96 % window =
   32.64 cqi of the stage) while its track grows from 0, so it slides in
   from under the window edge (.mac-window clips it) instead of squeezing. */
.cw--inspector .cw-bar-insp,
.cw--inspector .cw-inspector {
    justify-self: start;
    width: 32.64cqi;
}

html.sw-motion [data-stage].is-armed .cw--inspector :is(.cw-bar, .cw-body) {
    transition: grid-template-columns var(--dur-3) var(--ease);
}

html.sw-motion [data-stage].is-armed .cw--inspector:not(:has(.cw-inspector.is-on)) :is(.cw-bar, .cw-body) {
    grid-template-columns: 20.5% minmax(0, 1fr) 0%;
}

.cw-thread {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.75em;
    min-height: 0;
    padding: 1em;
    overflow: hidden;
}

.cw-empty {
    display: grid;
    justify-items: center;
    gap: 0.5em;
    margin: 3.2em 0 auto;
    text-align: center;
}

.cw-empty-mark {
    width: 2.6em;
    height: 2.6em;
    color: var(--ui-accent);
    opacity: 0.6;
}

.cw-empty-title {
    color: var(--ui-muted);
}

.cw-empty-sub {
    max-width: 16em;
    font-size: 0.82em;
    color: var(--ui-muted);
}

.cw-bubble-user {
    align-self: flex-end;
    max-width: 85%;
    margin: 0;
    padding: 0.6em 0.8em;
    border-radius: 1em;
    line-height: 1.35;
    color: var(--mk-on-accent);
    background: var(--ui-accent);
}

.cw-thinking {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin: 0;
    font-size: 0.85em;
    color: var(--ui-muted);
}

.cw-thinking .tool-spinner {
    width: 1em;
    height: 1em;
}

.cw-call {
    font-size: 0.95em;
    background: var(--ui-bg);
}

.cw-call .tool-card-label {
    display: grid;
}

.cw-call .tool-card-label > * {
    grid-area: 1 / 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cw-tool-ic {
    color: var(--ui-accent);
}

.tool-check .ic-knock circle {
    fill: var(--chip-success-fg);
}

.cw-answer {
    display: grid;
    gap: 0.3em;
    padding: 0.55em 0.75em;
    border-radius: 0.6em;
    font-size: 0.88em;
    background: var(--chip-neutral-bg);
}

.cw-answer-q,
.cw-answer-a {
    display: flex;
    align-items: flex-start;
    gap: 0.45em;
}

.cw-answer-q {
    color: var(--ui-muted);
}

.cw-answer-q .ic circle {
    fill: var(--ui-muted);
}

.cw-answer-a {
    font-weight: 700;
}

.cw-answer-a .ic circle {
    fill: var(--ui-accent);
}

.cw-reply {
    margin: 0;
    padding: 0.6em 0.8em;
    border-radius: 0.8em;
    line-height: 1.4;
    background: var(--ui-bg);
    box-shadow: 0 0 0 0.07em var(--ui-border);
}

/* The approval card floats over the thread, above the composer. */
.cw-choice {
    position: absolute;
    z-index: 4;
    left: 0.7em;
    right: 0.7em;
    bottom: 4.4em;
    font-size: 0.92em;
    --from: translateY(1.5em);
}

.cw-opt-other {
    color: var(--ui-muted);
}

.cw-opt-pencil {
    display: inline-grid;
    place-items: center;
    width: 1.65em;
    height: 1.65em;
    border-radius: 0.4em;
    background: var(--chip-neutral-bg);
}

.cw-composer {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.7em 0.8em;
    border-top: 0.07em solid var(--ui-border);
}

.cw-composer-field {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.5em 0.7em;
    border-radius: 0.65em;
    white-space: nowrap;
    overflow: hidden;
    background: var(--ui-bg);
}

.cw-composer-field > * {
    overflow: hidden;
    text-overflow: ellipsis;
}

.cw-send {
    display: inline-grid;
    flex: 0 0 auto;
    color: var(--ui-accent);
}

.cw-send .ic {
    width: 1.7em;
    height: 1.7em;
}

/* ---- F5: the record memory list (P5 rework keeps these) ---- */

.f5-notes {
    gap: 0;
    padding: 0.3em 1em;
}

.f5-note {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1em;
    padding: 0.7em 0;
}

.f5-note .ic {
    color: var(--ui-muted);
}

/* ---- the pointers, in each window's own percent box ---- */

.chap-stage .cursor {
    width: 1.5cqi;
    filter: drop-shadow(0 0 0.12cqi var(--ui-bg)) drop-shadow(0 0.15cqi 0.3cqi rgba(0, 0, 0, 0.3));
}

.chap-stage .tap-ripple {
    width: 3.4cqi;
    margin: -1.7cqi 0 0 -1.7cqi;
}

.f2-cursor-a { --x: 96.3; --y: 3.6; --from: translate(-14em, 12em); }
.f2-ripple-a { --x: 96.6; --y: 4.1; }
.f2-cursor-b { --x: 84; --y: 68.2; --from: translate(-16em, -8em); }
.f2-ripple-b { --x: 84.2; --y: 68.7; }
.f2-cursor-c { --x: 93.9; --y: 89; --from: translate(-6.5em, -8.6em); }
.f2-ripple-c { --x: 94.1; --y: 89.5; }

/* ---- small screens: larger type, fewer columns, never a horizontal scroll ---- */

@media (max-width: 700px) {
    .chap-stage {
        --stage-ratio: 100 / 96;
    }

    .chap-window {
        --x: 0;
        --y: 2;
        --w: 100;
    }

    .chap-window .mac-window {
        aspect-ratio: 10 / 9.4;
        font-size: 2.45cqi;
    }

    .cw-bar {
        grid-template-columns: auto minmax(0, 1fr) 50%;
    }

    .cw-body {
        grid-template-columns: minmax(0, 1fr) 50%;
    }

    .cw--inspector .cw-bar-insp,
    .cw--inspector .cw-inspector {
        width: 50cqi;
    }

    html.sw-motion [data-stage].is-armed .cw--inspector:not(:has(.cw-inspector.is-on)) .cw-bar {
        grid-template-columns: auto minmax(0, 1fr) 0%;
    }

    html.sw-motion [data-stage].is-armed .cw--inspector:not(:has(.cw-inspector.is-on)) .cw-body {
        grid-template-columns: minmax(0, 1fr) 0%;
    }

    .cw-bar-side {
        padding: 0 0.2em 0 1em;
        background: none;
    }

    .cw-bar-side .cw-icon,
    .cw-sidebar,
    .cw-subtitle {
        display: none;
    }

    .cw-bar-main {
        padding: 0 0.6em;
    }

    .cw-content {
        padding: 1em;
    }

    .cw-select {
        min-width: 0;
    }

    .f2-cursor-a { --x: 95.2; --y: 3.9; }
    .f2-ripple-a { --x: 95.5; --y: 4.4; }
    .f2-cursor-b { --x: 76; --y: 65.7; }
    .f2-ripple-b { --x: 76.2; --y: 66.2; }
    .f2-cursor-c { --x: 90.1; --y: 85.1; --from: translate(-5em, -6em); }
    .f2-ripple-c { --x: 90.3; --y: 85.6; }
}

/* ---- motion: the P4 entrances (inert without the core gate) ---- */

.f2 .cw-thread > [data-at],
.f2 .mc-slot > [data-at],
.f5 .cw-thread > [data-at],
.f5 .mc-slot > [data-at] {
    --from: translateY(0.7em);
}

html.sw-motion [data-stage].is-armed .cw-flash.is-on {
    animation: sw-flash 1.4s var(--ease) both;
}

@keyframes sw-flash {
    0% { opacity: 0; }
    20% { opacity: 1; }
    100% { opacity: 0; }
}

/* ===== hero v2: the hero loop (hero-loop.html, 2026-10-19) =====
   One stage, three slots in one 37.5 s seamless loop (FLOW-A v2, FLOW-B,
   FLOW-C): A 0-14,600 ms Main Chat on the Mac, B 14,600-26,600 voice on the
   iPhone, C 26,600-37,500 the create-flow assistant on the iPad; C's end is
   A's opening frame. The HTML is A at 11,600 ms (the numbered PDF), where
   the clock opens (data-stage-start).
   The primary device grows (data-primary, from data-primary-track); the
   other two ONLY shrink and step aside: never an opacity drop, veil, blur
   or filter (owner, 2026-10-19). Every class is hv- prefixed; every before
   state sits under the core motion gate. */

.hv {
    --stage-ratio: 100 / 60;
    margin: 0;
    text-align: left;
}

.hv-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.hv-glow {
    inset: 4% 2% 0;
}

.hv-cluster {
    position: absolute;
    inset: 0;
    z-index: 1;
    /* The lean: --depth goes 0 -> 1 as the hero scrolls up (the timeline
       driver sets it from the scroll hook); without JS it is 1, flat. */
    --lean: calc(1 - var(--depth, 1));
    transform: perspective(240cqi) rotateX(calc(var(--lean) * 8deg)) scale(calc(1 - var(--lean) * 0.03));
    transform-origin: 50% 100%;
}

.hv-mac { --x: 10; --y: 3; --w: 80; --z: 1; }
.hv-ipad { --x: 1.5; --y: 56; --w: 31; --z: 3; }
.hv-iphone { --x: 82; --y: 42; --w: 13.5; --z: 4; }

/* The phones drift faster than the Mac while the hero scrolls. */
.hv-ipad,
.hv-iphone {
    translate: 0 calc(var(--lean) * 6cqi);
}

/* ---- primary grows, the others shrink and step aside (transform only) ---- */
.hv-focus {
    transition: transform 900ms var(--ease);
}

.hv-mac .hv-focus { transform-origin: 50% 30%; }
.hv-ipad .hv-focus { transform-origin: 0 100%; }
.hv-iphone .hv-focus { transform-origin: 100% 100%; }

.hv[data-primary="mac"] .hv-mac .hv-focus { transform: scale(1.1); }
.hv[data-primary="mac"] .hv-ipad .hv-focus { transform: translate(-14%, 12%) scale(0.9); }
.hv[data-primary="mac"] .hv-iphone .hv-focus { transform: translate(32%, 10%) scale(0.9); }

.hv[data-primary="iphone"] .hv-iphone { --z: 7; }
.hv[data-primary="iphone"] .hv-iphone .hv-focus { transform: translate(-6%, -6%) scale(1.18); }
.hv[data-primary="iphone"] .hv-mac .hv-focus { transform: translateY(-2%) scale(0.92); }
.hv[data-primary="iphone"] .hv-ipad .hv-focus { transform: translate(-14%, 12%) scale(0.9); }

.hv[data-primary="ipad"] .hv-ipad { --z: 6; }
/* Slot C (owner review fix pass 2, Issue 12): the iPad is 20% larger than
   its earlier primary size (1.16 x 1.2 = 1.392). The origin is its
   bottom-left corner and the translate is unchanged, so that corner stays
   exactly where it was; >= 768 px only (below, C runs on the iPhone). */
.hv[data-primary="ipad"] .hv-ipad .hv-focus { transform: translate(4%, -8%) scale(1.392); }
.hv[data-primary="ipad"] .hv-mac .hv-focus { transform: translateY(-2%) scale(0.92); }
.hv[data-primary="ipad"] .hv-iphone .hv-focus { transform: translate(32%, 10%) scale(0.9); }

/* ---- shared pieces ---- */
.hv-ic {
    width: 1.1em;
    height: 1.1em;
    flex: 0 0 auto;
}

.hv-stack {
    display: inline-grid;
}

.hv-stack > * {
    grid-area: 1 / 1;
}

.hv-muted { color: var(--ui-muted); }
.hv-accent { color: var(--ui-accent); }
.hv-ph { color: var(--ui-muted); }
.hv-ok { color: var(--chip-success-fg); }

.hv-orb {
    display: inline-grid;
    place-items: center;
    width: 3.4em;
    height: 3.4em;
    border-radius: 50%;
    color: var(--mk-on-accent);
    background: var(--ui-accent);
    box-shadow: 0 0.6em 1.8em color-mix(in oklab, var(--ui-accent) 35%, transparent);
}

.hv-orb .hv-ic {
    width: 1.5em;
    height: 1.5em;
}

.hv-btn {
    margin-top: 0.4em;
    padding: 0.45em 1.1em;
    border-radius: 0.55em;
    font-weight: 600;
    color: var(--mk-on-accent);
    background: var(--ui-accent);
}

.hv-spin {
    width: 1em;
    height: 1em;
    border-radius: 50%;
    border: 0.16em solid var(--ui-border);
    border-top-color: var(--ui-accent);
}

.hv-pulse {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0.18em color-mix(in oklab, var(--ui-accent) 60%, transparent);
    pointer-events: none;
}

.hv-date {
    font-size: 0.85em;
    color: var(--ui-muted);
}

.hv-row-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.hv-rows {
    --row-h: 3.05em;
    position: relative;
    display: grid;
    gap: 0.15em;
}

.hv-old {
    display: grid;
    gap: inherit;
    transition: transform var(--dur-3) var(--ease);
}

/* ---- Mac: Main Chat window ---- */
.hv-mscr {
    container-type: size;
    display: flex;
    flex-direction: column;
    font-size: 1.1cqi;
    background:
        radial-gradient(70% 90% at 12% 18%, var(--mk-glow-a), transparent),
        radial-gradient(60% 80% at 88% 22%, var(--mk-glow-b), transparent),
        var(--mk-bg-sunken);
}

.hv-menubar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 1.5em;
    height: 2em;
    padding: 0 1.2em;
    font-size: 0.86em;
    background: color-mix(in oklab, var(--ui-bg) 55%, transparent);
}

.hv-win {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0.9em 1.3em 1.1em;
    display: grid;
    grid-template-columns: 24% minmax(0, 1fr);
    overflow: hidden;
    border-radius: 1em;
    background: var(--ui-bg);
    box-shadow: 0 0 0 0.07em var(--ui-border), 0 1.2em 3em rgba(0, 0, 0, 0.26);
}

.hv-list {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.7em;
    min-width: 0;
    padding: 0.8em 0.6em;
    background: var(--ui-sidebar);
    border-right: 0.07em solid var(--ui-border);
}

.hv-list-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 1.9em;
    padding: 0 0.2em;
}

.hv-traffic {
    display: flex;
    gap: 0.45em;
}

.hv-traffic i {
    width: 0.8em;
    height: 0.8em;
    border-radius: 50%;
    background: var(--mac-close);
}

.hv-traffic i:nth-child(2) { background: var(--mac-minimize); }
.hv-traffic i:nth-child(3) { background: var(--mac-zoom); }

.hv-tb {
    display: flex;
    gap: 0.35em;
}

.hv-tb > span {
    display: inline-grid;
    place-items: center;
    width: 1.9em;
    height: 1.9em;
    border-radius: 0.6em;
    color: var(--ui-muted);
    background: color-mix(in oklab, var(--ui-text) 6%, transparent);
}

.hv-search {
    display: flex;
    align-items: center;
    gap: 0.45em;
    padding: 0.4em 0.6em;
    border-radius: 0.55em;
    background: color-mix(in oklab, var(--ui-text) 6%, transparent);
    color: var(--ui-muted);
    white-space: nowrap;
    overflow: hidden;
}

.hv-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.55em;
    height: var(--row-h);
    padding: 0 0.6em;
    border-radius: 0.55em;
    min-width: 0;
}

.hv-row.is-selected { background: var(--ui-selection); }
.hv-row-ic { color: var(--ui-accent); }

.hv-row-main {
    display: grid;
    min-width: 0;
}

.hv-ctx {
    position: absolute;
    z-index: 5;
    left: 46%;
    top: 6.4em;
    display: grid;
    gap: 0.1em;
    width: 9.5em;
    padding: 0.35em;
    border-radius: 0.6em;
    background: var(--ui-bg);
    box-shadow: 0 0 0 0.07em var(--ui-border), var(--mk-shadow-2);
    font-size: 0.95em;
    --from: scale(0.96);
    transform-origin: 0 0;
}

.hv-ctx-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.55em;
    padding: 0.3em 0.55em;
    border-radius: 0.4em;
}

.hv-ctx-item > .hv-ic {
    position: relative;
}

.hv-ctx-arch {
    isolation: isolate;
}

.hv-ctx-arch:has(.hv-ctx-hl.is-on) {
    color: var(--mk-on-accent);
}

.hv-ctx-hl {
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    background: var(--ui-accent);
}

.hv-ctx-sep {
    height: 0.07em;
    margin: 0.2em 0.4em;
    background: var(--ui-border);
}

.hv-ctx-del { color: var(--chip-danger-fg); }

.hv-detail {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
}

.hv-dbar {
    display: flex;
    align-items: center;
    height: 3em;
    padding: 0 1.2em;
    border-bottom: 0.07em solid var(--ui-border);
    font-weight: 700;
}

.hv-dbody {
    position: relative;
    min-height: 0;
    overflow: hidden;
}

.hv-noconv,
.hv-empty,
.hv-idetail,
.hv-bempty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    padding: 2em;
    text-align: center;
}

.hv-empty { inset: 0 0 6em; }

.hv-noconv strong,
.hv-empty strong,
.hv-bempty strong {
    font-size: 1.35em;
}

.hv-noconv .hv-muted,
.hv-empty .hv-muted {
    max-width: 26em;
}

.hv-chat {
    position: absolute;
    inset: 0;
    background: var(--ui-bg);
}

.hv-shell {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    transition: transform var(--dur-3) var(--ease), opacity 480ms var(--ease);
}

.hv-stream {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: transform var(--dur-3) var(--ease);
}

.hv-flow {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    padding: 1em 1.4em 0.6em;
}

.hv-me {
    display: grid;
    justify-items: end;
}

.hv-me p {
    margin: 0;
    max-width: 78%;
    padding: 0.55em 0.9em;
    border-radius: 1.1em 1.1em 0.3em 1.1em;
    background: var(--ui-accent);
    color: var(--mk-on-accent);
}

.hv-turn {
    display: grid;
    gap: 0.45em;
}

.hv-ai {
    display: flex;
    align-items: center;
    gap: 0.45em;
    font-size: 0.8em;
    font-weight: 700;
    color: var(--ui-accent);
}

.hv-ai-orb {
    display: inline-grid;
    place-items: center;
    width: 2.3em;
    height: 2.3em;
    border-radius: 50%;
    color: var(--mk-on-accent);
    background: var(--ui-accent);
}

.hv-tbody {
    display: grid;
    gap: 0.45em;
    padding-left: 2.35em;
}

.hv-thinking {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    justify-self: start;
    padding: 0.4em 0.8em;
    border-radius: 0.7em;
    background: var(--ui-panel);
    color: var(--ui-muted);
}

.hv-thinking b {
    color: var(--ui-text);
}

.hv-dots {
    display: inline-flex;
    gap: 0.2em;
}

.hv-dots i {
    width: 0.3em;
    height: 0.3em;
    border-radius: 50%;
    background: currentColor;
}

.hv-tool {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.5em 0.75em;
    border: 0.08em solid var(--ui-border);
    border-radius: 0.7em;
    background: var(--ui-panel);
}

.hv-tool-ic {
    color: var(--ui-accent);
    width: 1em;
    height: 1em;
}

.hv-tool-l {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hv-tool--to .hv-tool-l {
    display: grid;
}

.hv-to {
    font-size: 0.82em;
    color: var(--ui-muted);
}

.hv-tool-s {
    width: 1.1em;
    height: 1.1em;
}

.hv-chev {
    width: 0.8em;
    height: 0.8em;
    color: var(--ui-muted);
}

.hv-gen {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.5em 0.8em;
    border-radius: 0.7em;
    color: var(--chip-warn-fg);
    background: var(--chip-warn-bg);
}

.hv-art {
    display: flex;
    align-items: center;
    gap: 0.7em;
    padding: 0.6em 0.8em;
    border-radius: 0.8em;
    background: color-mix(in oklab, var(--ui-accent) 5%, var(--ui-bg));
    box-shadow: inset 0 0 0 0.07em color-mix(in oklab, var(--ui-accent) 18%, transparent);
}

.hv-art-ic {
    display: inline-grid;
    place-items: center;
    width: 2.1em;
    height: 2.1em;
    border-radius: 0.5em;
    color: var(--ui-accent);
    background: color-mix(in oklab, var(--ui-accent) 13%, transparent);
}

.hv-art-t {
    display: grid;
    justify-items: start;
    gap: 0.15em;
    flex: 1 1 auto;
    min-width: 0;
}

.hv-cap {
    padding: 0.05em 0.5em;
    border-radius: var(--radius-pill);
    font-size: 0.75em;
    font-weight: 600;
    color: var(--chip-info-fg);
    background: var(--chip-info-bg);
}

.hv-reply,
.hv-bai {
    margin: 0;
    line-height: 1.45;
    padding: 0.6em 0.8em;
    border-radius: 0.9em;
    background: var(--ui-panel);
}

/* The approval gate (FloatingChoiceOverlay), docked above the composer. */
.hv-choice {
    position: absolute;
    left: 1.2em;
    right: 1.2em;
    bottom: 6.4em;
    z-index: 3;
    overflow: hidden;
    border-radius: 0.9em;
    background: var(--ui-bg);
    box-shadow: 0 0 0 0.07em var(--ui-border), var(--mk-shadow-2);
    --from: translateY(130%);
}

.hv-ch-head {
    display: flex;
    align-items: center;
    gap: 0.8em;
    padding: 0.7em 0.9em;
    font-size: 0.95em;
}

.hv-ch-head b { flex: 1 1 auto; }

.hv-ch-x {
    display: inline-grid;
    place-items: center;
    width: 1.6em;
    height: 1.6em;
    border-radius: 50%;
    color: var(--ui-muted);
    background: var(--ui-panel);
}

.hv-ch-x .hv-ic {
    width: 0.8em;
    height: 0.8em;
}

.hv-opt {
    display: flex;
    align-items: center;
    gap: 0.7em;
    padding: 0.45em 0.9em;
    border-top: 0.07em solid var(--ui-border);
}

.hv-num {
    display: inline-grid;
    width: 1.6em;
    height: 1.6em;
    font-size: 0.85em;
    font-weight: 700;
}

.hv-num > * {
    grid-area: 1 / 1;
    display: grid;
    place-items: center;
    border-radius: 0.4em;
    color: var(--ui-muted);
    background: color-mix(in oklab, var(--ui-text) 8%, transparent);
}

.hv-num > .hv-num-on {
    color: var(--mk-on-accent);
    background: var(--ui-accent);
}

.hv-num .hv-ic {
    width: 1.6em;
    height: 1.6em;
    padding: 0.35em;
}

.hv-opt-l { flex: 1 1 auto; }

.hv-mark {
    display: inline-grid;
    width: 1.2em;
    height: 1.2em;
}

.hv-mark > * { grid-area: 1 / 1; }

.hv-radio {
    border: 0.12em solid var(--ui-border);
    border-radius: 50%;
}

.hv-radio-on {
    width: 100%;
    height: 100%;
    color: var(--ui-accent);
}

.hv-ch-foot {
    display: flex;
    justify-content: flex-end;
    min-height: 2.3em;
    padding: 0.45em 0.9em;
    border-top: 0.07em solid var(--ui-border);
}

.hv-confirm {
    padding: 0.25em 0.9em;
    border-radius: 0.45em;
    font-size: 0.88em;
    font-weight: 700;
    color: var(--mk-on-accent);
    background: var(--ui-accent);
}

.hv-composer {
    position: relative;
    z-index: 4;
    flex: 0 0 auto;
    display: grid;
    gap: 0.35em;
    margin: 0.4em 1.2em 1em;
    padding: 0.6em 0.6em 0.45em 0.9em;
    border: 0.07em solid var(--ui-border);
    border-radius: 1em;
    background: var(--ui-bg);
    box-shadow: var(--mk-shadow-1);
}

.hv-ctext {
    white-space: nowrap;
    overflow: hidden;
    min-height: 1.35em;
}

.hv-crow {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hv-provider {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.15em 0.55em;
    border-radius: var(--radius-pill);
    font-size: 0.82em;
    color: var(--ui-muted);
    background: var(--ui-panel);
    white-space: nowrap;
}

.hv-lock {
    width: 0.8em;
    height: 0.8em;
}

.hv-send {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 1.8em;
    height: 1.8em;
    border-radius: 50%;
    color: var(--mk-on-accent);
    background: var(--ui-accent);
}

.hv-send .hv-ic {
    width: 0.95em;
    height: 0.95em;
}

.hv-send--off {
    color: var(--ui-bg);
    background: color-mix(in oklab, var(--ui-text) 22%, transparent);
}

/* The artifact panel in its full-width state (artifactFullScreen). */
.hv-panel {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: var(--ui-panel);
    --from: translateX(100%);
}

.hv-phead {
    display: flex;
    align-items: center;
    gap: 0.7em;
    padding: 0.6em 1em 0.6em 3.2em;
    background: var(--ui-bg);
    border-bottom: 0.07em solid var(--ui-border);
}

.hv-bordered {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.25em 0.65em;
    border-radius: 0.45em;
    font-size: 0.85em;
    border: 0.07em solid var(--ui-border);
    background: var(--ui-panel);
}

.hv-px {
    width: 1.25em;
    height: 1.25em;
    color: var(--ui-muted);
}

.hv-showchat {
    position: absolute;
    top: 0.55em;
    left: 0.6em;
    display: inline-grid;
    place-items: center;
    width: 2em;
    height: 2em;
    border-radius: 0.45em;
    color: var(--ui-muted);
}

.hv-pbody {
    display: grid;
    min-height: 0;
    overflow: hidden;
    padding: 1.1em 1.6em 0;
}

.hv-genpdf {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    margin: 0;
    color: var(--ui-muted);
    align-self: center;
}

.hv-pdfwrap {
    --from: translateY(1.4em) scale(0.98);
    width: 66%;
    margin: 0 auto;
}

/* The invoice PDF on white paper in both themes, as a real preview is.
   The modern layout's labels; numbered (it was finalized). */
.hv-pdf {
    container-type: inline-size;
    display: grid;
    align-content: start;
    gap: 4.2cqi;
    aspect-ratio: 1 / 1.414;
    padding: 6.5cqi 7cqi;
    border-radius: 0.3em;
    color: var(--pdf-ink);
    background: var(--pdf-paper);
    line-height: 1.4;
    font-size: 1.3cqi;
    box-shadow: 0 0.1em 0.3em rgba(0, 0, 0, 0.12), 0 1em 2.4em rgba(0, 0, 0, 0.14);
}

.hv-pdf p { margin: 0; }

.hv-pdf-top,
.hv-pdf-meta {
    display: flex;
    justify-content: space-between;
    gap: 2cqi;
}

.hv-pdf-from,
.hv-pdf-meta > div {
    display: grid;
    gap: 0.3cqi;
    align-content: start;
}

.hv-pdf-brand {
    display: inline-flex;
    align-items: center;
    gap: 1.2cqi;
    font-weight: 700;
    font-size: 1.1em;
}

.hv-pdf-brand i {
    width: 3.6cqi;
    height: 3.6cqi;
    border-radius: 0.9cqi;
    background: var(--pdf-ink);
}

.hv-pdf-title {
    font-size: 5.6cqi;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

.hv-pdf-m { color: var(--pdf-muted); }

.hv-pdf-dates {
    grid-template-columns: auto auto;
    column-gap: 2.4cqi;
    text-align: right;
}

.hv-pdf-table {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    column-gap: 3cqi;
    row-gap: 1.2cqi;
    padding-bottom: 1.6cqi;
    border-bottom: 0.25cqi solid var(--pdf-rule);
}

.hv-pdf-th {
    padding-bottom: 1cqi;
    border-bottom: 0.25cqi solid var(--pdf-rule);
    color: var(--pdf-muted);
    font-weight: 600;
}

.hv-r {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hv-pdf-totals {
    display: grid;
    grid-template-columns: 1fr auto auto;
    column-gap: 2.6cqi;
    row-gap: 0.9cqi;
    align-items: center;
}

.hv-pdf-totals > .sample-badge {
    grid-row: 1 / span 3;
    justify-self: start;
    align-self: end;
    font-size: 0.85em;
}

.hv-pdf-totals > :not(.sample-badge) {
    grid-column: auto;
}

.hv-pdf-totals > .hv-pdf-m,
.hv-pdf-totals > b:not(.hv-r) {
    grid-column: 2;
}

/* The pointer and its clicks, in the Mac screen's own box (cqw / cqh of
   .hv-mscr); one pointer that glides between named poses (data-pos). */
.hv-cursor {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 30;
    width: 1.3em;
    aspect-ratio: 3 / 4;
    background: var(--ui-text);
    clip-path: polygon(0 0, 100% 72%, 56% 70%, 74% 100%, 58% 100%, 42% 74%, 0 100%);
    translate: var(--cx, 62cqw) var(--cy, 80cqh);
    pointer-events: none;
}

.hv-tap {
    left: var(--cx);
    top: var(--cy);
    width: 3em;
    margin: -1.5em 0 0 -1.5em;
}

.hv-mscr .hv-tap {
    left: 0;
    top: 0;
    translate: var(--cx) var(--cy);
}

.hv-cursor[data-pos="rest"] { --cx: 64cqw; --cy: 84cqh; }
.hv-cursor[data-pos="new"], .hv-p-new { --cx: 61.6cqw; --cy: 65.6cqh; }
.hv-cursor[data-pos="optA"], .hv-p-optA,
.hv-cursor[data-pos="optB"], .hv-p-optB,
.hv-cursor[data-pos="optC"], .hv-p-optC { --cx: 54.6cqw; --cy: 66.3cqh; }
.hv-cursor[data-pos="confA"], .hv-p-confA,
.hv-cursor[data-pos="confB"], .hv-p-confB,
.hv-cursor[data-pos="confC"], .hv-p-confC { --cx: 92cqw; --cy: 81.4cqh; }
.hv-cursor[data-pos="art"], .hv-p-art { --cx: 56.5cqw; --cy: 55.1cqh; }
.hv-cursor[data-pos="px"], .hv-p-px { --cx: 96.1cqw; --cy: 16cqh; }
.hv-cursor[data-pos="row"], .hv-p-row { --cx: 11.1cqw; --cy: 22.1cqh; }
.hv-cursor[data-pos="arch"], .hv-p-arch { --cx: 17.2cqw; --cy: 25.3cqh; }

/* ---- iPad + iPhone (iOS) ---- */
.hv-pscr,
.hv-hscr {
    display: flex;
    flex-direction: column;
}

.hv-pscr { font-size: 2.6cqi; }
.hv-hscr { font-size: 5.4cqi; }

.hv-sb {
    position: relative;
    z-index: 20;
    display: flex;
    flex: 0 0 auto;
    justify-content: space-between;
    align-items: center;
    padding: 0.5em 1.4em 0.3em;
    font-size: 0.8em;
    font-weight: 600;
}

.hv-hscr .hv-sb { padding: 0.95em 1.5em 0.6em; }

.hv-sbi {
    display: inline-flex;
    gap: 0.35em;
    align-items: center;
}

.hv-wifi {
    width: 0.95em;
    height: 0.7em;
    background: currentColor;
    clip-path: polygon(50% 100%, 0 20%, 100% 20%);
    border-radius: 0.95em 0.95em 0 0;
}

.hv-batt {
    width: 1.5em;
    height: 0.72em;
    border: 0.1em solid currentColor;
    border-radius: 0.22em;
    padding: 0.08em;
    background: linear-gradient(90deg, currentColor 72%, transparent 72%) content-box;
}

.hv-split {
    display: grid;
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: 38% minmax(0, 1fr);
}

.hv-ilist,
.hv-hlist {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.hv-ilist { border-right: 0.07em solid var(--ui-border); }

.hv-inav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.4em;
    padding: 0.35em 0.8em 0.55em;
}

.hv-inav > :last-child { justify-self: end; }

.hv-inav b {
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hv-ihead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3em 0.9em;
    font-size: 0.82em;
    color: var(--ui-muted);
}

.hv-iarch {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    font-size: 0.85em;
}

.hv-irows {
    --row-h: 2.9em;
    gap: 0;
}

.hv-irow {
    position: relative;
    display: grid;
    align-content: center;
    height: var(--row-h);
    padding: 0 0.5em;
    border-bottom: 0.07em solid var(--ui-border);
    min-width: 0;
    background: var(--ui-bg);
}

.hv-irow .hv-row-title { font-weight: 500; }

.hv-idetail {
    position: relative;
    gap: 0.5em;
    padding: 1em;
}

.hv-big {
    width: 2.4em;
    height: 2.4em;
    color: var(--ui-muted);
}

.hv-idetail .hv-muted { font-size: 0.9em; }

.hv-views {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
}

.hv-hlist,
.hv-hchat,
.hv-b {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--ui-bg);
}

.hv-hchat,
.hv-b {
    z-index: 2;
    --from: translateX(100%);
}

.hv-back {
    display: inline-flex;
    align-items: center;
    gap: 0.1em;
    color: var(--ui-accent);
    font-size: 0.85em;
    white-space: nowrap;
}

.hv-hstream .hv-flow,
.hv-bstream .hv-flow {
    gap: 0.6em;
    padding: 0.6em 0.75em 0.4em;
}

.hv-hstream .hv-me p,
.hv-bstream .hv-me p {
    max-width: 88%;
}

.hv-hstream .hv-tool,
.hv-bstream .hv-tool {
    padding: 0.4em 0.6em;
    font-size: 0.86em;
}

.hv-hcomp,
.hv-bcomp {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.4em 0.75em 1.5em;
    padding: 0.35em 0.35em 0.35em 0.9em;
    border: 0.07em solid var(--ui-border);
    border-radius: 1.4em;
    background: var(--ui-bg);
}

.hv-hcomp .hv-send {
    width: 1.6em;
    height: 1.6em;
}

/* ---- B: voice on the iPhone ---- */
.hv-glass {
    display: inline-grid;
    place-items: center;
    width: 1.9em;
    height: 1.9em;
    border-radius: 50%;
    background: color-mix(in oklab, var(--ui-text) 7%, var(--ui-bg));
    box-shadow: inset 0 0 0 0.06em var(--ui-border);
}

.hv-bempty {
    position: relative;
    inset: auto;
    flex: 1 1 auto;
    padding: 0.5em;
    gap: 0.35em;
    font-size: 0.85em;
}

.hv-bempty .hv-orb {
    width: 2.2em;
    height: 2.2em;
}

.hv-bempty .hv-orb .hv-ic {
    width: 1em;
    height: 1em;
}

.hv-bstream .hv-flow {
    flex: 1 1 auto;
    justify-content: flex-end;
}

.hv-bai {
    justify-self: start;
    max-width: 90%;
    font-size: 0.92em;
    border: 0.07em solid var(--ui-border);
}

.hv-bbottom {
    position: relative;
    flex: 0 0 auto;
}

.hv-bcomp {
    display: grid;
    gap: 0.35em;
    margin-top: 0.3em;
    padding: 0.5em 0.5em 0.4em 0.8em;
    border-radius: 1.2em;
}

.hv-brow {
    display: flex;
    align-items: center;
    gap: 0.4em;
}

.hv-brow .hv-provider {
    flex: 1 1 auto;
    padding: 0;
    background: none;
    font-size: 0.72em;
}

/* A neutral multicolour dot, never the Apple Intelligence glyph (trademark). */
.hv-aidot {
    width: 0.9em;
    height: 0.9em;
    border-radius: 50%;
    background: conic-gradient(from 200deg, var(--ui-indigo), var(--ui-accent), var(--ui-red), var(--chip-warn-fg), var(--ui-indigo));
}

.hv-mic {
    width: 1.55em;
    height: 1.55em;
}

.hv-mic > span {
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.hv-mic0 {
    color: var(--ui-muted);
    background: color-mix(in oklab, var(--ui-text) 10%, transparent);
}

.hv-mic0 .hv-ic {
    width: 0.8em;
    height: 0.8em;
}

.hv-mic1 {
    color: var(--mk-on-accent);
    background: var(--ui-accent);
}

.hv-brow .hv-send {
    width: 1.55em;
    height: 1.55em;
}

/* The waveform glyph: seven rounded bars (SF "waveform"). */
.hv-wave {
    display: inline-flex;
    align-items: center;
    gap: 0.12em;
    height: 1em;
}

.hv-wave i {
    display: block;
    width: 0.12em;
    height: 60%;
    border-radius: 0.1em;
    background: currentColor;
}

.hv-wave i:nth-child(1) { height: 30%; }
.hv-wave i:nth-child(2) { height: 62%; }
.hv-wave i:nth-child(3) { height: 100%; }
.hv-wave i:nth-child(4) { height: 74%; }
.hv-wave i:nth-child(5) { height: 48%; }
.hv-wave i:nth-child(6) { height: 86%; }
.hv-wave i:nth-child(7) { height: 36%; }
.hv-wave--tint { color: var(--ui-accent); font-size: 1.15em; }
.hv-mic1 .hv-wave { font-size: 0.75em; }

.hv-voice {
    position: absolute;
    left: 0.6em;
    right: 0.6em;
    bottom: calc(100% - 0.6em);
    z-index: 3;
    display: grid;
    gap: 0.45em;
    padding: 0.6em 0.7em;
    border-radius: 0.9em;
    background: var(--ui-panel);
    border: 0.07em solid var(--ui-border);
    box-shadow: var(--mk-shadow-2);
    font-size: 0.92em;
    --from: translateY(1em);
}

.hv-voice-h {
    display: flex;
    align-items: center;
    gap: 0.45em;
}

.hv-voice-l {
    flex: 1 1 auto;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--ui-muted);
}

.hv-voice-c {
    font-size: 0.85em;
    color: var(--ui-accent);
}

.hv-meter {
    position: relative;
    display: block;
    height: 0.22em;
    border-radius: var(--radius-pill);
    background: color-mix(in oklab, var(--ui-muted) 25%, transparent);
    overflow: hidden;
}

.hv-meter i {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--ui-accent);
    transform-origin: 0 50%;
    transform: scaleX(0.55);
}

/* The approval card (FloatingChoiceOverlay .approval): replaces the composer. */
.hv-appr {
    position: absolute;
    left: 0.45em;
    right: 0.45em;
    bottom: 1.1em;
    z-index: 4;
    display: grid;
    border-radius: 0.85em;
    background: var(--ui-bg);
    border: 0.05em solid var(--ui-border);
    box-shadow: var(--mk-shadow-2);
    font-size: 0.9em;
    --from: translateY(115%);
}

.hv-appr-h {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.5em;
    align-items: start;
    padding: 0.6em 0.7em;
    border-bottom: 0.05em solid var(--ui-border);
}

.hv-appr-ic {
    display: grid;
    place-items: center;
    width: 1.7em;
    height: 1.7em;
    border-radius: 0.35em;
    color: var(--mk-on-accent);
    background: var(--ui-accent);
}

.hv-appr-t {
    display: grid;
    gap: 0.1em;
    min-width: 0;
}

.hv-appr-t span {
    font-size: 0.86em;
    color: var(--ui-muted);
}

.hv-appr-trust {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5em;
    padding: 0.4em 0.7em;
    font-size: 0.82em;
    color: var(--ui-muted);
    border-bottom: 0.05em solid var(--ui-border);
}

.hv-switch {
    position: relative;
    flex: 0 0 auto;
    width: 1.9em;
    height: 1.1em;
    border-radius: var(--radius-pill);
    background: color-mix(in oklab, var(--ui-muted) 30%, transparent);
}

.hv-switch::after {
    content: "";
    position: absolute;
    top: 0.1em;
    left: 0.1em;
    width: 0.9em;
    height: 0.9em;
    border-radius: 50%;
    background: var(--ios-cell);
    box-shadow: 0 0.05em 0.15em rgba(0, 0, 0, 0.3);
}

.hv-appr-a {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55em;
    padding: 0.5em 0.7em 0.6em;
}

.hv-decline,
.hv-approve {
    padding: 0.35em 0;
    border-radius: var(--radius-pill);
    text-align: center;
    font-size: 0.9em;
}

.hv-decline {
    color: var(--chip-danger-fg);
    background: var(--chip-danger-bg);
}

.hv-approve {
    color: var(--mk-on-accent);
    background: var(--ui-accent);
    font-weight: 700;
}

/* The swipe-to-archive row on the Conversations list. */
.hv-bswipe {
    position: relative;
    transition: transform var(--dur-3) var(--ease), opacity var(--t-opacity) var(--ease);
    height: var(--row-h);
    --from: scaleY(0.2);
    transform-origin: 50% 0;
}

.hv-acts {
    position: absolute;
    inset: 0 0 0 auto;
    display: flex;
    width: 42%;
}

.hv-acts > span {
    flex: 1;
    display: grid;
    place-items: center;
    color: var(--mk-on-accent);
}

.hv-act-a { background: var(--ui-indigo); }
.hv-act-d { background: var(--ui-red); }

.hv-slide {
    --from: none;
    transform: translateX(-42%);
    transition: transform var(--dur-3) var(--ease);
}

/* Tap positions, in percent of the nearest positioned box. */
.hv-tap-compose { --cx: 89%; --cy: 4%; }
.hv-tap-mic { --cx: 75%; --cy: 93%; }
.hv-tap-approve { --cx: 72%; --cy: 92%; }
.hv-tap-back { --cx: 11%; --cy: 4%; }
.hv-tap-arch { --cx: 67%; --cy: 50%; }

/* ---- B: the week's timesheet on the iPad ---- */
.hv-ts {
    position: absolute;
    inset: 1.9em 0 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.8em;
    padding: 0.6em 1.4em 1em;
    overflow: hidden;
    background: var(--ui-bg);
    font-size: 1.15em;
}

.hv-ts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6em;
}

.hv-ts-period {
    font-size: 1.35em;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hv-ts-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6em;
}

.hv-ts-card {
    display: grid;
    gap: 0.25em;
    padding: 0.55em 0.7em;
    border-radius: 0.7em;
    background: var(--ui-panel);
    border: 0.07em solid var(--ui-border);
}

.hv-ts-l {
    font-size: 0.8em;
    color: var(--ui-muted);
}

.hv-ts-v {
    font-size: 1.15em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.hv-ts-lines {
    position: relative;
    display: grid;
}

.hv-ts-new {
    position: relative;
    --from: translateY(-0.8em);
}

.hv-ts-day {
    display: flex;
    justify-content: space-between;
    padding: 0.45em 0.2em;
    font-size: 0.82em;
    color: var(--ui-muted);
    border-bottom: 0.07em solid var(--ui-border);
}

.hv-ts-day b {
    color: var(--ui-text);
    font-weight: 600;
    margin-right: 0.3em;
}

.hv-ts-line {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.8em;
    padding: 0.5em 0.2em;
}

.hv-ts-hrs {
    display: grid;
    justify-items: center;
    width: 2.6em;
    padding: 0.3em 0;
    border-radius: 0.45em;
    background: var(--chip-success-bg);
    font-size: 0.75em;
    color: var(--ui-muted);
}

.hv-ts-hrs b {
    font-size: 1.5em;
    color: var(--ui-text);
}

.hv-ts-proj { font-weight: 600; }

.hv-ts-old {
    transition: transform var(--dur-3) var(--ease);
}

.hv-ts-ring {
    position: absolute;
    inset: -0.2em -0.4em;
    border-radius: 0.8em;
    box-shadow: 0 0 0 0.16em var(--ui-accent);
    pointer-events: none;
}

/* ---- C: the create-flow assistant (iPad; the iPhone below 768 px) ---- */
.hv-c {
    position: absolute;
    inset: 1.9em 0 0;
    z-index: 3;
    display: flex;
    background: var(--ui-bg);
}

.hv-c--phone {
    display: none;
    inset: 0;
    font-size: 0.86em;
}

.hv-c-ledger {
    display: flex;
    flex: 1 1 auto;
}

.hv-c-side {
    width: 22%;
    padding: 1.2em 1em;
    display: flex;
    flex-direction: column;
    gap: 0.95em;
    background: var(--ui-sidebar);
    border-right: 0.07em solid var(--ui-border);
}

.hv-c-side i,
.hv-c-tr i {
    display: block;
    height: 0.62em;
    border-radius: var(--radius-pill);
    background: color-mix(in oklab, var(--ui-muted) 22%, transparent);
}

.hv-c-side i:nth-child(odd) { width: 60%; }
.hv-c-side i.is-sel { background: color-mix(in oklab, var(--ui-accent) 45%, transparent); }

.hv-c-main {
    position: relative;
    flex: 1 1 auto;
    padding: 0.4em 1.4em;
    min-width: 0;
}

.hv-c-tbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hv-c-title {
    font-size: 1.55em;
    font-weight: 700;
}

.hv-c-add {
    display: inline-grid;
    place-items: center;
    width: 1.8em;
    height: 1.8em;
    border-radius: 50%;
    color: var(--mk-on-accent);
    background: var(--ui-accent);
}

.hv-c-search {
    display: flex;
    align-items: center;
    gap: 0.45em;
    margin: 0.4em 0 0.6em;
    padding: 0.45em 0.7em;
    border-radius: 0.8em;
    background: var(--ui-panel);
    color: var(--ui-muted);
}

.hv-c-th,
.hv-c-tr {
    display: grid;
    grid-template-columns: 2.2fr 1fr 1.4fr 1fr;
    gap: 1em;
    align-items: center;
    padding: 0.7em 0.3em;
    border-bottom: 0.07em solid var(--ui-border);
    font-size: 0.86em;
}

.hv-c-th {
    color: var(--ui-muted);
    font-weight: 600;
}

.hv-c--phone .hv-c-tr { grid-template-columns: 1fr; padding: 1em 0.3em; }
.hv-c--phone .hv-c-tr i { width: 62%; }
.hv-c-tap-add { --cx: 92%; --cy: 4%; }

.hv-c-dim {
    position: absolute;
    inset: 0;
    z-index: 8;
    background: var(--ios-dim);
}

.hv-c-dim2 { z-index: 10; }

.hv-c-sheet {
    position: absolute;
    z-index: 9;
    left: 19%;
    right: 19%;
    top: 0.7em;
    bottom: 0;
    display: flex;
    flex-direction: column;
    border-radius: 1.6em 1.6em 0 0;
    overflow: hidden;
    background: var(--ios-grouped);
    box-shadow: 0 -0.3em 2em rgba(0, 0, 0, 0.18);
    --from: translateY(105%);
    transition: transform var(--dur-3) var(--ease), opacity var(--dur-2) var(--ease);
}

.hv-c-as {
    z-index: 11;
    top: 1.2em;
    background: var(--ios-cell);
}

.hv-c--phone .hv-c-sheet {
    left: 0;
    right: 0;
    top: 0.4em;
}

.hv-c--phone .hv-c-as { top: 0.8em; }

.hv-c-nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6em;
    padding: 0.8em 0.9em 0.4em;
}

.hv-c-st {
    font-weight: 600;
}

.hv-c-glass,
.hv-c-gi,
.hv-c-gap {
    display: inline-grid;
    place-items: center;
    width: 2.1em;
    height: 2.1em;
    border-radius: 50%;
}

.hv-c-glass {
    background: var(--ios-glass);
    box-shadow: inset 0 0 0 0.06em var(--ui-border), 0 0.15em 0.5em rgba(0, 0, 0, 0.08);
    color: var(--ui-muted);
}

.hv-c-glass .hv-ic,
.hv-c-gi .hv-ic {
    width: 1.25em;
    height: 1.25em;
}

.hv-c-group {
    display: inline-flex;
    gap: 0.25em;
    padding: 0.15em;
    border-radius: var(--radius-pill);
    background: var(--ios-glass);
    box-shadow: inset 0 0 0 0.06em var(--ui-border), 0 0.15em 0.5em rgba(0, 0, 0, 0.08);
}

.hv-c-gi { position: relative; }
.hv-c-save0 { color: var(--ios-ph); }
.hv-c-save1 { color: var(--ui-accent); }

.hv-c-pulse {
    width: 2.1em;
    height: 2.1em;
    border-radius: 50%;
    box-shadow: 0 0 0 0.12em var(--ui-accent);
    pointer-events: none;
}

.hv-c-tap-x { --cx: 2em; --cy: 50%; }
.hv-c-tap-ai { --cx: calc(100% - 4.4em); --cy: 50%; }
.hv-c-tap-done { --cx: 2em; --cy: 50%; }
.hv-c-tap-send { --cx: calc(100% - 1.9em); --cy: 50%; }

.hv-c-body {
    padding: 0.2em 1.1em 1em;
    overflow: hidden;
}

.hv-c-gh {
    display: flex;
    align-items: center;
    gap: 0.4em;
    margin: 0.9em 0.9em 0.35em;
    color: var(--ui-muted);
    font-size: 0.82em;
}

.hv-c-group2 {
    margin-top: 0.4em;
    border-radius: 0.9em;
    background: var(--ios-cell);
    overflow: hidden;
}

.hv-c-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.5em;
    padding: 0 0.95em;
}

.hv-c-row + .hv-c-row {
    border-top: 0.07em solid var(--ios-sep);
}

.hv-c-val {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    color: var(--ui-muted);
}

.hv-c-val .hv-ic {
    width: 0.9em;
    height: 0.9em;
}

.hv-c-dot {
    width: 0.5em;
    height: 0.5em;
    border-radius: 50%;
    background: var(--chip-success-fg);
}

.hv-c-ph { color: var(--ios-ph); }

/* The field highlight sweep and the Save pulse are marketing emphasis
   layered on the app (owner, 2026-10-19), not app UI. */
.hv-c-hl {
    position: absolute;
    inset: 0.18em 0.3em;
    border-radius: 0.6em;
    box-shadow: 0 0 0 0.12em var(--ui-accent), 0 0 1.2em color-mix(in oklab, var(--ui-accent) 40%, transparent);
    background: color-mix(in oklab, var(--ui-accent) 8%, transparent);
    pointer-events: none;
}

.hv-c-thread {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.75em;
    padding: 0.9em 1.1em;
    overflow: hidden;
}

.hv-c-thread p { margin: 0; }

.hv-c-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45em;
    margin: auto 0;
    color: var(--ui-muted);
}

.hv-c-empty .hv-ic {
    width: 2.6em;
    height: 2.6em;
    color: color-mix(in oklab, var(--ui-accent) 60%, transparent);
}

.hv-c-me {
    align-self: flex-end;
    max-width: 78%;
    padding: 0.55em 0.85em;
    border-radius: 1em;
    background: color-mix(in oklab, var(--ui-accent) 15%, transparent);
}

.hv-c-think {
    display: flex;
    align-items: center;
    gap: 0.45em;
    color: var(--ui-muted);
    font-size: 0.82em;
}

.hv-c-tool {
    display: flex;
    align-items: center;
    gap: 0.6em;
    align-self: flex-start;
    min-width: 50%;
    padding: 0.5em 0.8em;
    border-radius: 0.7em;
    border: 0.08em solid var(--ui-border);
    background: var(--ui-panel);
    font-size: 0.86em;
}

.hv-c-tool > .hv-stack:first-of-type { flex: 1 1 auto; }

.hv-c-reply {
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    max-width: 78%;
    padding: 0.55em 0.85em;
    border-radius: 1em;
    background: var(--ios-grouped);
}

.hv-c-input {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 0.5em;
    padding: 0.7em 0.8em 1em;
    border-top: 0.07em solid var(--ios-sep);
}

.hv-c-field {
    flex: 1 1 auto;
    min-height: 2.3em;
    padding: 0.55em 0.8em;
    border-radius: 1.15em;
    background: var(--ios-grouped);
}

.hv-c-send {
    width: 2em;
    height: 2em;
}

.hv-c-send .hv-ic {
    width: 2em;
    height: 2em;
    padding: 0.45em;
    border-radius: 50%;
    color: var(--ui-bg);
}

.hv-c-s0 { background: var(--ios-ph); }
.hv-c-s1 { background: var(--ui-accent); }

/* ---- the sync light (A only): Mac row -> iPad / iPhone row, at turn ends ---- */
.hv-sync {
    position: absolute;
    inset: 0;
    z-index: 20;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.hv-arc {
    fill: none;
    stroke: var(--ui-accent);
    stroke-width: 0.32;
    stroke-linecap: round;
    stroke-dasharray: 16 200;
    stroke-dashoffset: 16;
    filter: drop-shadow(0 0 0.6px var(--ui-accent));
}

/* ---- 768-1023 px: the same cluster, a slightly taller box ---- */
@media (max-width: 1023px) {
    .hv { --stage-ratio: 100 / 64; }
    .hv-iphone { --x: 80; --y: 38; --w: 16; }
}

/* ---- below 768 px: iPhone forward, the Mac behind it bleeding past the
   viewport edge (the page clips at the viewport, never the hero box), the
   iPad and the PDF never shown; slot C runs on the iPhone. ---- */
@media (max-width: 767px) {
    .hv { --stage-ratio: 100 / 118; }
    .hv-ipad,
    .hv-panel,
    .hv-sync,
    .hv-cursor,
    .hv-mscr .hv-tap {
        display: none;
    }
    .hv-mac { --x: 40; --y: 14; --w: 100; }
    .hv-iphone { --x: 3; --y: 1; --w: 56; --z: 4; }
    .hv-hscr { font-size: 5.9cqi; }
    .hv[data-primary] .stage-item .hv-focus { transform: none; }
    .hv-c--phone { display: flex; flex-direction: column; }
    .hv-c--phone .hv-c-main { padding: 0.6em 1em; }
    .hv-glow { inset: 0 -6%; }
    .hv-bempty .hv-muted { display: none; }
}

@media (max-width: 400px) {
    .hv { --stage-ratio: 100 / 126; }
    .hv-iphone { --w: 60; }
    .hv-mac { --x: 44; --y: 16; }
}

/* blog stages F3 / F4 */
.f3, .f4 { --stage-ratio: 100 / 80; margin: 0; }
.f3-pad { --x: 6; --y: 8; --w: 88; }
.f3-phone, .f4-phone { --x: 32; --y: 4; --w: 36; }
.f3-phone { display: none; }
@media (max-width: 767px) {
    .f3, .f4 { --stage-ratio: 100 / 134; }
    .f3-pad { display: none; }
    .f3-phone, .f4-phone { display: block; --x: 20; --y: 3; --w: 60; }
}

/* ---- motion: the hero's entrances and states (inert without the gate) ---- */
.hv-x,
.hv-me[data-at],
.hv-art[data-at] {
    --from: translateY(0.6em);
}

html.sw-motion [data-stage].is-armed .hv-x:not(.is-on) {
    display: none;
}

html.sw-motion [data-stage].is-armed .hv-x.is-on {
    animation: hv-rise 520ms var(--ease) both;
}

html.sw-motion [data-stage].is-armed .hv-new {
    --from: translateY(-30%) scale(0.97);
}

html.sw-motion [data-stage].is-armed .hv-rows:not(.hv-irows):has(> .hv-new:not(.is-on)) > .hv-old {
    transform: translateY(calc(-1 * (var(--row-h) + 0.15em)));
}

/* iOS lists: slot 1 is A's new row or B's row, whichever is on. */
html.sw-motion [data-stage].is-armed .hv-ipad .hv-irows:has(> .hv-new:not(.is-on)) > .hv-old {
    transform: translateY(calc(-1 * var(--row-h)));
}

html.sw-motion [data-stage].is-armed .hv-irows:has(> .hv-new:not(.is-on)) > .hv-bswipe,
html.sw-motion [data-stage].is-armed .hv-irows:has(> .hv-new:not(.is-on)):has(> .hv-bswipe.is-on) > .hv-old {
    transform: translateY(calc(-1 * var(--row-h)));
}

html.sw-motion [data-stage].is-armed .hv-irows:has(> .hv-new:not(.is-on)):has(> .hv-bswipe:not(.is-on)) > .hv-old {
    transform: translateY(calc(-2 * var(--row-h)));
}

html.sw-motion [data-stage].is-armed .hv-slide:not(.is-on) {
    opacity: 1;
    transform: none;
}

html.sw-motion [data-stage].is-armed .hv-shell:has(.hv-choice.is-on) .hv-stream {
    transform: translateY(-12.4em);
}

html.sw-motion [data-stage].is-armed .hv-chat:has(> .hv-panel.is-on) .hv-shell {
    transform: translateX(-8%) scale(0.97);
    opacity: 0;
}

html.sw-motion [data-stage].is-armed .hv-b:has(.hv-appr.is-on) .hv-bstream {
    transform: translateY(-4.8em);
}

html.sw-motion [data-stage].is-armed .hv-ts:has(.hv-ts-new:not(.is-on)) .hv-ts-old {
    transform: translateY(-5.6em);
}

html.sw-motion [data-stage].is-armed .hv-c-form:has(~ .hv-c-as.is-on) {
    transform: translateY(-0.8em) scale(0.94);
}

html.sw-motion [data-stage].is-armed .hv-pulse.is-on {
    animation: hv-pulse 700ms var(--ease) both;
}

html.sw-motion [data-stage].is-armed .hv-ts-ring.is-on {
    animation: hv-pulse 1.5s var(--ease) both;
}

html.sw-motion [data-stage].is-armed .hv-c-hl.is-on {
    animation: hv-hl 1000ms var(--ease) both;
}

html.sw-motion [data-stage].is-armed .hv-c-pulse.is-on {
    animation: hv-ring 850ms var(--ease) 2 both;
}

html.sw-motion [data-stage].is-armed .hv-arc.is-on {
    animation: hv-arc 620ms cubic-bezier(0.45, 0, 0.2, 1) both;
}

html.sw-motion [data-stage].is-armed .hv-spin {
    animation: sw-spin 0.9s linear infinite;
}

html.sw-motion [data-stage].is-armed .hv-dots i {
    animation: sw-dot 1.2s ease-in-out infinite;
}

html.sw-motion [data-stage].is-armed .hv-dots i:nth-child(2) { animation-delay: 0.15s; }
html.sw-motion [data-stage].is-armed .hv-dots i:nth-child(3) { animation-delay: 0.3s; }

html.sw-motion [data-stage].is-armed .hv-wave i {
    animation: hv-var 1.05s ease-in-out infinite;
}

html.sw-motion [data-stage].is-armed .hv-wave i:nth-child(2) { animation-delay: 0.11s; }
html.sw-motion [data-stage].is-armed .hv-wave i:nth-child(3) { animation-delay: 0.22s; }
html.sw-motion [data-stage].is-armed .hv-wave i:nth-child(4) { animation-delay: 0.33s; }
html.sw-motion [data-stage].is-armed .hv-wave i:nth-child(5) { animation-delay: 0.44s; }
html.sw-motion [data-stage].is-armed .hv-wave i:nth-child(6) { animation-delay: 0.55s; }
html.sw-motion [data-stage].is-armed .hv-wave i:nth-child(7) { animation-delay: 0.66s; }

html.sw-motion [data-stage].is-armed .hv-meter i {
    animation: hv-level 2.2s steps(22, end) infinite;
}

html.sw-motion [data-stage].is-armed .hv-cursor {
    transition: translate 450ms var(--ease), opacity 300ms var(--ease);
}

html.sw-motion [data-stage].is-armed .hv-c-ph,
html.sw-motion [data-stage].is-armed .hv-c-row .hv-stack > * {
    transition: none;
}

html.sw-motion [data-stage].is-armed.is-pinned .hv-focus,
html.sw-motion [data-stage].is-armed .hv-focus {
    will-change: transform;
}

@keyframes hv-rise {
    from { opacity: 0; transform: translateY(0.7em); }
    to { opacity: 1; transform: none; }
}

@keyframes hv-pulse {
    0% { opacity: 0; transform: scale(0.98); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.05); }
}

@keyframes hv-hl {
    0% { opacity: 0; }
    25% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes hv-ring {
    0% { opacity: 0.9; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.7); }
}

@keyframes hv-arc {
    0% { stroke-dashoffset: 16; opacity: 0; }
    15% { opacity: 1; }
    100% { stroke-dashoffset: -100; opacity: 0.2; }
}

@keyframes hv-var {
    0%, 100% { opacity: 0.35; }
    35% { opacity: 1; }
    70% { opacity: 0.35; }
}

@keyframes hv-level {
    0% { transform: scaleX(0.18); }
    9% { transform: scaleX(0.62); }
    18% { transform: scaleX(0.4); }
    27% { transform: scaleX(0.78); }
    36% { transform: scaleX(0.52); }
    45% { transform: scaleX(0.3); }
    54% { transform: scaleX(0.7); }
    63% { transform: scaleX(0.86); }
    72% { transform: scaleX(0.45); }
    81% { transform: scaleX(0.6); }
    90% { transform: scaleX(0.25); }
    100% { transform: scaleX(0.18); }
}

/* ===== hero v2: the theme toggle (nav, marketing pages only) =====
   System / Light / Dark in one real <button>; theme-init.js applies the
   stored choice to html[data-theme] before first paint and cycles it on
   click. 44 x 44 hit area; at 320 px it sits beside the menu button and
   the wordmark truncates first. */
.theme-marketing .theme-toggle {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    order: 3;
    width: 2.75rem;
    height: 2.75rem;
    margin-left: 0.25rem;
    padding: 0;
    border: 1px solid var(--mk-border);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--mk-text);
    cursor: pointer;
}

.theme-marketing .theme-toggle:hover {
    background: var(--mk-bg-sunken);
}

.theme-marketing .theme-toggle:focus-visible {
    outline: 2px solid var(--mk-accent);
    outline-offset: 2px;
}

.theme-marketing .theme-toggle svg {
    width: 1.15rem;
    height: 1.15rem;
}

.theme-marketing .theme-toggle .tt-sun,
.theme-marketing .theme-toggle .tt-moon {
    display: none;
}

:root[data-theme="light"] .theme-marketing .theme-toggle .tt-sys,
:root[data-theme="dark"] .theme-marketing .theme-toggle .tt-sys {
    display: none;
}

:root[data-theme="light"] .theme-marketing .theme-toggle .tt-sun,
:root[data-theme="dark"] .theme-marketing .theme-toggle .tt-moon {
    display: block;
}

@media (max-width: 899px) {
    .theme-marketing .theme-toggle {
        order: 0;
        margin-left: auto;
    }

    .theme-marketing .theme-toggle ~ .nav-toggle {
        margin-left: 0.25rem;
    }
}

/* The hero's small print, under the cluster (hero v2). */
.theme-marketing .mk-hero-fine {
    display: grid;
    gap: 0.2rem;
    margin: clamp(1rem, 2.5vw, 1.75rem) auto 0;
    max-width: 40rem;
    font-size: 0.82rem;
    color: var(--mk-text-muted);
}

.theme-marketing .mk-hero-fine p {
    margin: 0;
}

/* ===== P5: "From hours to paid" (F7, F6) and the record memory (F5) =====
   macOS windows on the same floating-window recipe as F2 (.chap-window
   .mac-window, the cw-* record-window pieces), plus the few pieces those
   stages add: a toolbar text button, a macOS Table, a document sidebar
   summary, a totals bar and a sheet. Colours only from the tokens. */

/* ---- window grids: no inspector column ---- */

.cw--plain .cw-bar,
.cw--plain .cw-body {
    grid-template-columns: 19% minmax(0, 1fr);
}

.cw--doc .cw-bar,
.cw--doc .cw-body {
    grid-template-columns: 13em minmax(0, 1fr);
}

/* The sidebars are sized in em, never percent, so every real label reads
   in full at every width (owner review 2026-10-19: "Allowances & VAT",
   "Customer Documents"). */
.cw--outbox .cw-bar,
.cw--outbox .cw-body {
    grid-template-columns: 14.6em minmax(0, 1fr);
}

.cw--plain .cw-bar-main {
    gap: 0.6em;
}

/* A toolbar button with a text label (macOS 26 glass capsule). */
.mw-button {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.4em;
    height: 2.1em;
    padding: 0 0.85em 0 0.7em;
    border-radius: var(--radius-pill);
    font-weight: 600;
    white-space: nowrap;
    color: var(--ui-text);
    background: var(--ui-panel);
    box-shadow: 0 0 0 0.07em var(--ui-border), var(--mk-shadow-1);
}

.mw-button .ic {
    color: var(--ui-accent);
}

.mw-button--primary {
    color: var(--mk-on-accent);
    background: var(--ui-accent);
}

.mw-button--primary .ic {
    color: var(--mk-on-accent);
}

/* The pressed state under a click. */
.mw-press {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: color-mix(in oklab, var(--ui-accent) 22%, transparent);
    pointer-events: none;
}

.mw-bar-actions {
    flex: 0 0 auto;
    justify-items: end;
}

.mw-bar-group {
    display: flex;
    align-items: center;
    gap: 0.6em;
}

.mw-count {
    margin-left: auto;
    padding: 0 0.5em;
    border-radius: var(--radius-pill);
    font-size: 0.8em;
    color: var(--ui-muted);
    background: color-mix(in oklab, var(--ui-accent) 18%, transparent);
}

/* The detail pane: content, then a strip pinned to the bottom. */
.mw-pane {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--ui-bg);
}

.mw-pane.mc-stack > * {
    min-height: 0;
}

.mw-pane-inner {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
}

/* ---- a macOS Table: header row, then rows; columns per table ---- */

.mt {
    display: grid;
    align-content: start;
    min-width: 0;
    padding: 0.4em 0.6em;
}

.mt-head,
.mt-row {
    display: grid;
    grid-template-columns: var(--mt-cols);
    align-items: center;
    gap: 0 1em;
    padding: 0 0.6em;
    min-width: 0;
}

.mt-head {
    height: 2em;
    font-weight: 600;
    color: var(--ui-muted);
    border-bottom: 0.07em solid var(--ui-border);
}

.mt-row {
    height: 2.6em;
    border-radius: 0.45em;
    font-variant-numeric: tabular-nums;
}

.mt-row:nth-child(odd) {
    background: color-mix(in oklab, var(--ui-text) 3.5%, transparent);
}

.mt-head > * {
    font-size: 0.86em;
}

/* The header cells shrink their text, never the row: the columns are em of
   the row, so the header and the rows share one grid. */
.mt-head > *,
.mt-row > * {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mt-num {
    text-align: right;
}

.mt-mid {
    display: flex;
    justify-content: center;
}

.mt-dim,
.mt-notes {
    color: var(--ui-muted);
}

.mt-item {
    font-weight: 600;
}

.mt-mono {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.94em;
}

.mt--entries { --mt-cols: 7.6em 6.4em 3.4em 3.8em 7.4em minmax(0, 1fr); }
.mt--lines { --mt-cols: 1em minmax(7.4em, 1fr) 3em 4.9em 5.3em 5.3em; }

/* Room for every figure at 1024 px, where the window text is ~10 px and a
   1 px shortfall ellipsizes "€2,586.38" (owner review 2026-10-19). */
.mt--lines > * {
    column-gap: 0.6em;
}
.mt--alloc { --mt-cols: 7em 7em 6em 6em; }
.mt--outbox { --mt-cols: 9em 5.4em minmax(8.6em, 1fr); }

/* A badge with an icon (TimesheetEntryStatusBadge, PaymentStatusBadge). */
.mw-chip {
    gap: 0.35em;
    font-size: 0.8em;
}

.mw-chip .ic {
    width: 1em;
    height: 1em;
}

.ic-cut {
    stroke: var(--ui-bg);
}

.chip--success .ic-cut {
    stroke: var(--chip-success-bg);
}

/* The Billable column's filled coin. */
.mw-bill {
    display: inline-grid;
    place-items: center;
    width: 1.15em;
    height: 1.15em;
    border-radius: 50%;
    background: var(--ui-accent);
}

.mw-bill::before {
    content: "$";
    font-size: 0.72em;
    font-weight: 700;
    color: var(--mk-on-accent);
}

/* The page-totals strip under a Table. */
.mw-foot {
    display: flex;
    align-items: center;
    gap: 1.2em;
    padding: 0.5em 1.1em;
    font-size: 0.82em;
    color: var(--ui-muted);
    background: var(--ui-panel);
    border-top: 0.07em solid var(--ui-border);
    white-space: nowrap;
}

.mw-foot-count {
    display: grid;
    margin-right: auto;
    line-height: 1.25;
}

.mw-foot-sub {
    font-size: 0.86em;
    opacity: 0.8;
}

.mw-foot-bill {
    color: var(--ui-accent);
    font-weight: 600;
}

/* ---- the document window: summary sidebar, totals bar ---- */

.mw-doc-side {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    border-right: none;
    background: var(--ui-sidebar);
}

.mw-summary {
    display: grid;
    justify-items: center;
    gap: 0.45em;
    padding: 0.8em 0.6em 0.75em;
    text-align: center;
    border-bottom: 0.07em solid var(--ui-border);
}

.mw-docno {
    font-size: 1.45em;
    font-weight: 700;
    color: var(--ui-accent);
    letter-spacing: -0.01em;
}

.mw-entity {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    font-size: 0.92em;
}

.mw-entity .ic {
    width: 0.85em;
    height: 0.85em;
    color: var(--ui-muted);
}

.mw-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35em;
}

.mw-dates {
    display: grid;
    gap: 0.2em;
    font-size: 0.8em;
    color: var(--ui-muted);
}

.mw-dates > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35em;
}

.mw-dates .ic {
    width: 0.95em;
    height: 0.95em;
}

.mw-tabs li {
    display: block;
    margin: 0;
    padding: 0;
}

.mw-tab {
    display: flex;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    align-items: center;
    gap: 0.6em;
    padding: 0.36em 0.6em;
    border-radius: 0.5em;
    color: var(--ui-muted);
}

.mw-tabs {
    align-content: start;
}

/* A tab whose selection changes is a two-state stack in one cell. */
.mw-tabs li.mc-stack {
    display: grid;
}

/* History sits apart at the bottom of the document sidebar
   (DocumentDetailSidebar.historyTab). */
.mw-tabs--foot {
    padding-top: 0.2em;
}

/* A row the app inserts at a step (the Payments tab once a document is
   finalized, the payment badge, the dates, Paid / Outstanding): before its
   step it takes no space, so nothing leaves a blank gap that fills later.
   The finished frame shows it (the rule lives behind the motion gate). */
html.sw-motion [data-stage].is-armed [data-collapse]:not(.is-on) {
    display: none;
}

@starting-style {
    html.sw-motion [data-stage].is-armed [data-collapse].is-on {
        opacity: 0;
    }
}

.mw-tab.is-selected {
    color: var(--ui-text);
    font-weight: 600;
    background: var(--ui-selection);
}

/* ONE row, always (owner review fix pass 2, Issue 13): Subtotal, Tax,
   Total, a rule, Paid and Outstanding, as DocumentTotalsBar lays them out
   (an HStack with a Divider before Paid), on the Overview and the Payments
   tab alike. */
.mw-totals {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0 0.9em;
    padding: 0.8em 1em;
    background: var(--ui-panel);
    border-top: 0.07em solid var(--ui-border);
}

.mw-total {
    display: grid;
    justify-items: end;
    gap: 0.1em;
    font-variant-numeric: tabular-nums;
}

.mw-total > span {
    font-size: 0.78em;
    color: var(--ui-muted);
}

.mw-total b {
    font-size: 1.05em;
    font-weight: 600;
}

.mw-total--grand b {
    font-size: 1.25em;
    font-weight: 700;
}

.mw-total--due b {
    font-size: 1.25em;
    font-weight: 700;
}

.mw-total b.mc-stack {
    justify-items: end;
}

/* A step that has ended takes no room in the one-row bar: the draft's
   Sample data badge once Paid / Outstanding appear, and the earlier of two
   stacked figures (Paid €0.00 → €2,586.38) once the later one is on. */
html.sw-motion [data-stage].is-armed .mw-totals > .sample-badge[data-until]:not(.is-on),
html.sw-motion [data-stage].is-armed .mw-total > b.mc-stack > :not(.is-on) {
    display: none;
}

.mw-totals-rule {
    align-self: stretch;
    width: 0.07em;
    margin-block: 0.2em;
    background: var(--ui-border);
}

.mw-total--paid b,
.mw-paid {
    color: var(--chip-success-fg);
}

.mw-due {
    color: var(--chip-warn-fg);
}

.mw-totals .sample-badge {
    align-self: center;
    order: -1;
    margin-right: auto;
}

/* The Payments tab with nothing allocated (ContentUnavailableView). */
.mw-empty {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.35em;
    padding: 1em;
    text-align: center;
    color: var(--ui-muted);
}

.mw-empty .ic {
    width: 2.6em;
    height: 2.6em;
    margin-bottom: 0.3em;
}

.mw-empty b {
    font-size: 1.1em;
    color: var(--ui-text);
}

.mw-empty span {
    max-width: 18em;
    font-size: 0.86em;
}

/* The Peppol status pill (PeppolOutboxStatusBadge: icon + label, tinted). */
.mw-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    font-weight: 600;
}

.mw-status .ic {
    width: 1.05em;
    height: 1.05em;
}

.mw-status--ready { color: var(--ui-accent); }
.mw-status--sending { color: var(--ui-indigo); }
.mw-status--sent { color: var(--chip-success-fg); }
.mw-status--ack { color: color-mix(in oklab, var(--chip-success-fg) 55%, var(--chip-info-fg)); }

.mw-status--ack .ic-cut {
    stroke: var(--ui-bg);
}

.mt-row--new {
    background: var(--ui-selection);
}

/* A macOS sheet over a dimmed window (F6 Paid In Full). */
.mw-dim {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: color-mix(in oklab, var(--ui-text) 14%, transparent);
}

.mw-sheet {
    position: absolute;
    z-index: 6;
    top: 3.4em;
    left: 50%;
    width: 46%;
    margin-left: -23%;
    display: grid;
    border-radius: 0 0 1em 1em;
    background: var(--ui-panel);
    box-shadow: 0 0 0 0.07em var(--ui-border), var(--mk-shadow-3);
    --from: translateY(-6%);
}

.f6-sheet-head {
    display: grid;
    gap: 0.15em;
    padding: 0.9em 1.1em 0.4em;
}

.f6-sheet-head b {
    font-size: 1.1em;
}

.f6-sheet-head span {
    font-size: 0.86em;
    color: var(--ui-muted);
}

.f6-sheet-box {
    padding: 0.5em 1.1em 0.8em;
}

.f6-kv {
    display: flex;
    justify-content: space-between;
    gap: 1em;
}

.f6-kv span {
    color: var(--ui-muted);
}

.f6-sheet-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.6em;
    padding: 0.7em 1.1em 0.9em;
    border-top: 0.07em solid var(--ui-border);
}

/* ---- placement: two windows per stage, the second in front ---- */

.f7-project {
    --x: 1;
    --y: 2;
    --w: 80;
}

/* F6 is one cluster (owner review 2026-10-19): the invoice window on the
   left, the PEPPOL Outbox open beside it over the invoice's empty lines
   area, never over its toolbar, line, sidebar or totals bar. */
.f6 {
    --stage-ratio: 100 / 53;
}

.f6-doc {
    --x: 0;
    --y: 1;
    --w: 68;
}

.f6-doc .mac-window {
    aspect-ratio: 16 / 12.1;
}

.f7-invoice {
    --x: 31;
    --y: 29.4;
    --w: 69;
    --z: 2;
    --from: translate(3%, 5%) scale(0.97);
}

.f6-outbox {
    --x: 37;
    --y: 25.7;
    --w: 63;
    --z: 2;
}

.f7-invoice .mac-window {
    aspect-ratio: 16 / 10.8;
}

.f6-outbox .mac-window {
    aspect-ratio: 16 / 6.5;
}

/* The stage's one Sample data badge once the invoice carries Paid and
   Outstanding (the totals bar has no room for it then; fix pass 2,
   Issue 13): the cluster's free bottom-right corner, under the Outbox. */
.f6-sample {
    --x: 70;
    --y: 77;
    --w: 30;
    --z: 2;
    text-align: right;
    font-size: 1.5cqi;
}

/* macOS source-list rows: about 2.2 lines tall, no list margins. */
.cw--outbox .cw-sidebar li {
    margin: 0;
    padding: 0.36em 0.6em;
}

.mw-pane-inner > .mw-empty,
.mw-pane-inner > .mt--alloc {
    grid-area: 1 / 1;
}

/* ---- the pointers (percent of each window, measured on the finished layout) ---- */

.f7-cursor-a { --x: 82; --y: 4.6; --from: translate(-10em, 14em); }
.f7-ripple-a { --x: 82.4; --y: 4.9; }
.f6-cursor-a { --x: 79.1; --y: 4.2; --from: translate(-12em, 13em); }
.f6-ripple-a { --x: 79.5; --y: 4.7; }
.f6-cursor-b { --x: 11.2; --y: 58.5; --from: translate(16em, -6em); }
.f6-ripple-b { --x: 11.5; --y: 59.1; }
.f6-cursor-c { --x: 58.4; --y: 4.2; --from: translate(-26em, 26em); }
.f6-ripple-c { --x: 58.8; --y: 4.7; }
.f6-cursor-d { --x: 58; --y: 58.8; --from: translate(2em, -18em); }
.f6-ripple-d { --x: 58.4; --y: 59.4; }
.f6-cursor-e { --x: 55; --y: 40; --from: translate(-40em, 12em); }
.f6-ripple-e { --x: 55.3; --y: 40.5; }

/* Clicking the invoice window's Payments tab brings it forward over the
   Outbox (macOS raises the window you click; fix pass 2, Issue 14, so the
   Payments empty state is never covered); clicking the Outbox row
   afterwards puts the Outbox in front again, the finished frame's order. */
html.sw-motion [data-stage].is-armed.f6:has(.f6-raise.is-on) .f6-doc {
    --z: 3;
}

/* ---- motion: the P5 entrances (inert without the core gate) ---- */

.f7 .mt-row[data-at],
.f7 .mw-totals[data-at] {
    --from: translateY(0.5em);
}

html.sw-motion [data-stage].is-armed .mw-press.is-on {
    animation: sw-flash 0.6s var(--ease) both;
}

/* ---- small screens: one window wide, the second over its lower half,
   fewer columns and larger type; never a horizontal scroll ---- */

@media (max-width: 700px) {
    .f6,
    .f7 {
        --stage-ratio: 100 / 118;
    }

    .f7 .mac-window,
    .f6 .mac-window {
        font-size: 2.9cqi;
    }

    .f7-project,
    .f6-doc {
        --x: 0;
        --y: 1;
        --w: 100;
    }

    .f7-project .mac-window {
        aspect-ratio: 10 / 5.8;
    }

    .f7 {
        --stage-ratio: 100 / 146;
    }

    .f7-project {
        --y: 0.4;
    }

    .f6-doc .mac-window {
        aspect-ratio: 10 / 10;
    }

    /* Phones: the Outbox sits under the invoice, so neither covers the
       other's sidebar or totals bar. */
    /* 154 -> 160 (fix pass 2): room for the Sample data badge under the
       Outbox; the windows' y are re-derived so they do not move. */
    .f6 {
        --stage-ratio: 100 / 160;
    }

    .f6-doc {
        --y: 0.58;
    }

    .f6-sample {
        --x: 5;
        --y: 95;
        --w: 95;
        font-size: 2.9cqi;
    }

    .f7-invoice,
    .f6-outbox {
        --x: 5;
        --y: 50;
        --w: 95;
    }

    .f7-invoice .mac-window {
        aspect-ratio: 10 / 9;
    }

    .f7-invoice {
        --y: 40.6;
    }

    .f6-outbox {
        --y: 62.08;
    }

    .f6-outbox .mac-window {
        aspect-ratio: 10 / 5.4;
    }

    .cw--plain .cw-bar,
    .cw--plain .cw-body {
        grid-template-columns: auto minmax(0, 1fr);
    }

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

    .cw--doc .cw-body {
        grid-template-columns: 36% minmax(0, 1fr);
    }

    .mw-doc-side .cw-sidebar {
        display: grid;
        padding: 0.5em 0.3em;
    }

    .mw-doc-side .mw-tab {
        gap: 0.4em;
        padding: 0.32em 0.4em;
    }

    .cw--plain .cw-tools,
    .f7 .cw-ai-toggle,
    .f6 .cw-ai-toggle,
    .cw--outbox .cw-sidebar,
    .mt-tax,
    .mw-foot-count,
    .mt--entries > * > :nth-child(2),
    .mt--entries > * > :nth-child(6),
    .mt--lines > * > :nth-child(4),
    .mt--lines > * > :nth-child(5),
    .mt--outbox > * > :nth-child(3) {
        display: none;
    }

    .mt--entries { --mt-cols: minmax(0, 1fr) 3.4em 3.8em 6.6em; }
    .mt--lines { --mt-cols: 1em minmax(0, 1fr) 2.6em 5.2em; }
    .mt--alloc { --mt-cols: 7em minmax(0, 1fr) 4.4em; }
    .mt--alloc > * > :nth-child(2) { display: none; }
    .mt--outbox { --mt-cols: 9.8em minmax(0, 1fr); }

    .mw-totals .mw-total:first-child,
    .mw-totals .mt-tax {
        display: none;
    }

    .mw-totals {
        gap: 0.4em 1em;
        padding: 0.6em 0.8em;
    }

    .mw-docno {
        font-size: 1.15em;
    }

    .mw-sheet {
        width: 84%;
        margin-left: -42%;
    }

    .mw-button {
        padding: 0 0.6em;
    }

    .f6-paid-btn + .mw-button,
    .f6-cursor-b,
    .f6-ripple-b {
        display: none;
    }

    .f7-cursor-a { --x: 80.2; --y: 7.8; }
    .f7-ripple-a { --x: 80.6; --y: 8.4; }
    .f6-cursor-a { --x: 80.7; --y: 5; }
    .f6-ripple-a { --x: 81.1; --y: 5.5; }
    .f6-cursor-c { --x: 86.1; --y: 5; }
    .f6-ripple-c { --x: 86.5; --y: 5.5; }
    .f6-cursor-d { --x: 72.2; --y: 61.2; }
    .f6-ripple-d { --x: 72.6; --y: 61.8; }
}

/* ---- F5: memory in the record's AI Assistant (P5 rework) ----
   The F2 record window; the inspector column holds two inspectors in one
   cell (closed, then opened again for a new conversation), and its title
   bar segment switches between the chat and the Memory list. */

.f5-insp {
    grid-column: -2;
    grid-row: 1;
}

.f5-insp-bar {
    display: grid;
    align-items: center;
}

.f5-bar-mode {
    display: flex;
    align-items: center;
    gap: 0.4em;
    min-width: 0;
}

.f5-insp > .cw-thread,
.f5-insp > .f5-memory {
    grid-area: 1 / 1;
}

.f5-insp > .cw-composer {
    grid-row: 2;
}

.f5-memory {
    display: grid;
    align-content: start;
    padding: 1em 0.8em;
}

.f5-mem-box .cw-box-body {
    background: var(--ui-bg);
}

.f5-note {
    font-weight: 600;
}

.f5-cursor-a { --x: 93.3; --y: 3.6; --from: translate(-14em, 16em); }
.f5-ripple-a { --x: 93.7; --y: 4.1; }

@media (max-width: 700px) {
    .f5-cursor-a { --x: 89.3; --y: 3.9; }
    .f5-ripple-a { --x: 89.7; --y: 4.4; }
}

/* ---- P5: the remaining homepage sections on the marketing system ----
   Provider strip, Features, founders, roadmap teaser, Pricing, FAQ and
   the closing CTA: one section head (kicker, display h2, answer-first
   lead), raised cards with the layered shadows, and the three-colour glow
   for depth, in both themes. Section markup is unchanged apart from the
   kickers; the site.css base rules still apply under these. */

.theme-marketing .features,
.theme-marketing .roadmap-teaser,
.theme-marketing .pricing,
.theme-marketing .faq,
.theme-marketing .founders-teaser {
    position: relative;
    max-width: 1240px;
    margin: 0 auto;
    padding: clamp(4rem, 9vw, 7rem) 0 0;
    border-top: none;
    text-align: center;
}

.theme-marketing .features > h2,
.theme-marketing .roadmap-teaser > h2,
.theme-marketing .pricing > h2,
.theme-marketing .faq > h2,
.theme-marketing .closing-cta > h2 {
    margin: 0 auto 0.9rem;
    max-width: 18em;
    font-size: clamp(1.8rem, 4.6vw, 3.2rem);
    line-height: 1.06;
    letter-spacing: -0.032em;
}

.theme-marketing .features > .section-sub,
.theme-marketing .roadmap-teaser > .section-sub,
.theme-marketing .pricing > .section-sub,
.theme-marketing .faq > .section-sub,
.theme-marketing .closing-cta > .section-sub {
    max-width: 36rem;
    margin: 0 auto clamp(2rem, 5vw, 3.25rem);
    font-size: clamp(1.04rem, 1.4vw, 1.2rem);
    line-height: 1.5;
    color: var(--mk-text-muted);
}

/* A raised marketing card: hairline border, a lit top edge, layered shadow. */
.theme-marketing .feature-card,
.theme-marketing .teaser-row,
.theme-marketing .price-card,
.theme-marketing .faq-item {
    position: relative;
    border: 1px solid var(--mk-border);
    border-radius: var(--radius-l);
    background:
        linear-gradient(180deg, color-mix(in oklab, var(--mk-bg-raised) 100%, var(--mk-text) 2%), var(--mk-bg-raised));
    box-shadow: var(--mk-shadow-1), inset 0 1px 0 color-mix(in oklab, var(--mk-text) 6%, transparent);
    text-align: left;
}

/* ---- provider strip: one quiet glass band ---- */

.theme-marketing .provider-strip {
    max-width: 62rem;
    margin: clamp(2.5rem, 6vw, 4.5rem) auto 0;
    padding: 1.4rem clamp(1rem, 4vw, 2.5rem) 1.6rem;
    border: 1px solid var(--mk-border);
    border-radius: var(--radius-xl);
    background: color-mix(in oklab, var(--mk-bg-raised) 70%, transparent);
    box-shadow: var(--mk-shadow-1);
}

.theme-marketing .provider-strip-line {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--mk-text-muted);
}

.theme-marketing .provider-logos {
    gap: 1.1rem 2.6rem;
}

.theme-marketing .provider-logo {
    height: 24px;
    opacity: 0.62;
}

/* ---- features: icon tiles on raised cards ---- */

.theme-marketing .feature-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.5rem), 1fr));
    gap: clamp(0.9rem, 1.6vw, 1.25rem);
}

.theme-marketing .feature-card {
    padding: 1.5rem 1.5rem 1.6rem;
}

.theme-marketing .feature-icon {
    display: grid;
    place-items: center;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: var(--radius-m);
    color: var(--mk-accent);
    background:
        radial-gradient(120% 120% at 20% 10%, var(--mk-glow-b), transparent 70%),
        color-mix(in oklab, var(--mk-accent) 10%, var(--mk-bg-raised));
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--mk-accent) 22%, transparent);
}

.theme-marketing .feature-icon svg {
    width: 1.45rem;
    height: 1.45rem;
}

.theme-marketing .feature-card h3 {
    margin: 1rem 0 0.35rem;
    font-size: 1.12rem;
    letter-spacing: -0.012em;
}

.theme-marketing .feature-card p {
    font-size: 0.97rem;
    line-height: 1.5;
    color: var(--mk-text-muted);
}

/* The eighth tile is a link to /roadmap (fix pass 2, Issue 15): dashed like
   the Coming soon Max card, and its hover / focus change colour only, so no
   tile ever moves out of its row. */
.theme-marketing .feature-card--more {
    display: block;
    color: inherit;
    text-decoration: none;
    border-style: dashed;
    background: color-mix(in oklab, var(--mk-bg-raised) 60%, transparent);
    box-shadow: none;
    transition: border-color var(--motion-dur-quick) var(--motion-ease);
}

.theme-marketing .feature-card--more:hover {
    border-color: var(--mk-accent);
}

.theme-marketing .feature-card--more:hover h3,
.theme-marketing .feature-card--more:focus-visible h3 {
    color: var(--mk-accent);
}

.theme-marketing .feature-card--more:focus-visible {
    outline: 2px solid var(--mk-accent);
    outline-offset: 3px;
}

/* ---- founders: one card, the two portraits overlapping ---- */

.theme-marketing .founders-teaser {
    max-width: 46rem;
}

.theme-marketing .founders-photos {
    gap: 0;
    margin-bottom: 1.2rem;
}

.theme-marketing .founder-photo {
    width: 84px;
    height: 84px;
    border: 3px solid var(--mk-bg);
    box-shadow: var(--mk-shadow-2);
}

.theme-marketing .founder-photo + .founder-photo {
    margin-left: -14px;
}

.theme-marketing .founders-headline {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.2vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.028em;
    line-height: 1.1;
}

.theme-marketing .founders-line {
    font-size: 1.06rem;
    color: var(--mk-text-muted);
}

/* The section links: a quiet pill with the accent text. */
.theme-marketing .mk-pill-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    min-height: 44px;
    margin-top: 1.4rem;
    padding: 0 1.2rem;
    border: 1px solid var(--mk-border-strong);
    border-radius: var(--radius-pill);
    color: var(--mk-accent);
    background: var(--mk-bg-raised);
    box-shadow: var(--mk-shadow-1);
    text-decoration: none;
}

.theme-marketing .mk-pill-link:hover {
    color: var(--mk-accent-hover);
    text-decoration: none;
    border-color: var(--mk-accent);
}

.theme-marketing .mk-pill-link:focus-visible {
    outline: 3px solid var(--mk-accent);
    outline-offset: 3px;
}

/* ---- roadmap teaser: planned-next cards ---- */

.theme-marketing .roadmap-teaser {
    max-width: 1240px;
}

.theme-marketing .teaser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: clamp(0.9rem, 1.6vw, 1.25rem);
}

.theme-marketing .teaser-row {
    display: grid;
    align-content: start;
    justify-items: start;
    gap: 0.5rem;
    padding: 1.3rem 1.4rem 1.5rem;
}

.theme-marketing .teaser-title {
    margin: 0.35rem 0 0;
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 650;
    letter-spacing: -0.012em;
    color: var(--mk-text);
}

.theme-marketing .teaser-detail {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--mk-text-muted);
}

/* ---- pricing: raised cards, the plan the most teams pick lit ---- */

.theme-marketing .pricing-grid {
    max-width: 1100px;
    margin: 0 auto;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: clamp(0.9rem, 1.6vw, 1.25rem);
}

.theme-marketing .price-card {
    padding: 1.7rem 1.7rem 1.9rem;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.theme-marketing .price-card.highlighted {
    border-color: color-mix(in oklab, var(--mk-accent) 55%, var(--mk-border));
    box-shadow: 0 0 0 1px color-mix(in oklab, var(--mk-accent) 40%, transparent), var(--mk-shadow-3);
    background:
        radial-gradient(90% 60% at 50% 0%, color-mix(in oklab, var(--mk-glow-a) 60%, transparent), transparent 70%),
        var(--mk-bg-raised);
}

.theme-marketing .price-card.coming-soon {
    border-style: dashed;
    background: color-mix(in oklab, var(--mk-bg-raised) 60%, transparent);
    box-shadow: none;
}

.theme-marketing .card-badge {
    color: var(--mk-on-accent);
    background: var(--mk-accent);
    border-color: var(--mk-accent);
}

.theme-marketing .card-badge--soon {
    color: var(--mk-text);
    background: none;
    border-color: var(--mk-border);
}

.theme-marketing .billing-switch {
    border-color: var(--mk-border);
    background: var(--mk-bg-sunken);
}

.theme-marketing .billing-opt {
    color: var(--mk-text-muted);
}

/* Phones (owner review fix pass 2, Issue 11): the Monthly / Annual switch
   stays pinned under the sticky nav while the cards scroll, on an opaque
   full-bleed band so no card shows through behind it. Sticky keeps its
   place in the flow, so pinning never shifts the layout; the band's
   margin replaces the switch's own, so the unpinned layout is the same.
   Inside the pricing section only: it lets go when the section ends. */
@media (max-width: 767px) {
    .theme-marketing .billing-bar {
        /* The sticky nav's height at these widths: its 0.9rem block padding
           twice, the 44 px theme / menu buttons and the 1 px bottom border
           (measured 73.8 px at 320 and 390). */
        --mk-nav-h: calc(1.8rem + 2.75rem + 1px);
        position: sticky;
        top: calc(var(--mk-nav-h) + env(safe-area-inset-top, 0px));
        z-index: 5;
        margin: 0 calc(-1 * var(--gutter)) 1.6rem;
        padding: 0.5rem max(var(--gutter), env(safe-area-inset-right, 0px)) 0.5rem max(var(--gutter), env(safe-area-inset-left, 0px));
        background: var(--mk-bg);
    }

    .theme-marketing .billing-bar .billing-switch {
        margin: 0 auto;
    }
}

.theme-marketing .billing-opt[aria-pressed="true"] {
    color: var(--mk-on-accent);
    background: var(--mk-accent);
    box-shadow: var(--mk-shadow-1);
}

.theme-marketing .tier-bullets.tier-bullets--soon li::before {
    color: var(--mk-text-muted);
    font-weight: 400;
}

.theme-marketing .price .amount {
    font-family: var(--font-display);
    font-size: clamp(2.3rem, 4vw, 2.9rem);
    letter-spacing: -0.035em;
}

.theme-marketing .tier-bullets li {
    margin: 0.45rem 0;
}

.theme-marketing .tier-bullets li::before {
    color: var(--mk-accent);
    font-weight: 700;
}

.theme-marketing .partners,
.theme-marketing .pricing-footnote {
    max-width: 40rem;
    margin-inline: auto;
    color: var(--mk-text-muted);
}

/* ---- FAQ: cards that open in place, a turning chevron ---- */

.theme-marketing .faq-list {
    gap: 0.7rem;
    text-align: left;
}

.theme-marketing .faq-item {
    padding: 0 1.4rem;
    border-radius: var(--radius-m);
}

.theme-marketing .faq-item[open] {
    box-shadow: var(--mk-shadow-2);
}

.theme-marketing .faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    list-style: none;
    font-size: 1.04rem;
}

.theme-marketing .faq-question::-webkit-details-marker {
    display: none;
}

.theme-marketing .faq-question::after {
    content: "";
    flex: 0 0 auto;
    width: 0.55rem;
    height: 0.55rem;
    margin-right: 0.2rem;
    border-right: 2px solid var(--mk-text-muted);
    border-bottom: 2px solid var(--mk-text-muted);
    transform: rotate(45deg) translateY(-2px);
    transition: transform var(--dur-2) var(--ease);
}

.theme-marketing .faq-item[open] .faq-question::after {
    transform: rotate(225deg) translateY(-2px);
}

.theme-marketing .faq-question:focus-visible {
    outline: 3px solid var(--mk-accent);
    outline-offset: 4px;
    border-radius: 6px;
}

.theme-marketing .faq-answer {
    line-height: 1.55;
}

/* ---- closing CTA: the glow panel the page ends on ---- */

.theme-marketing .closing-cta {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    max-width: 1240px;
    margin: clamp(4rem, 9vw, 7rem) auto clamp(2.5rem, 5vw, 4rem);
    padding: clamp(3rem, 7vw, 5.5rem) clamp(1.25rem, 5vw, 3rem);
    border: 1px solid var(--mk-border);
    border-radius: var(--radius-xl);
    background: var(--mk-bg-raised);
    box-shadow: var(--mk-shadow-3);
}

.theme-marketing .closing-cta::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto;
    height: 120%;
    z-index: -1;
    background:
        radial-gradient(40% 50% at 25% 30%, var(--mk-glow-a), transparent),
        radial-gradient(40% 50% at 75% 25%, var(--mk-glow-b), transparent),
        radial-gradient(45% 50% at 55% 90%, var(--mk-glow-c), transparent);
    filter: blur(30px);
    pointer-events: none;
}

.theme-marketing .closing-cta > .section-sub a {
    color: var(--mk-accent);
    font-weight: 600;
}

.theme-marketing .cta-contact {
    color: var(--mk-text-muted);
}

.theme-marketing .cta-contact a {
    color: var(--mk-accent);
}

@media (max-width: 480px) {
    .theme-marketing .features,
    .theme-marketing .roadmap-teaser,
    .theme-marketing .pricing,
    .theme-marketing .faq,
    .theme-marketing .founders-teaser,
    .theme-marketing .closing-cta {
        text-align: left;
    }

    .theme-marketing .features > h2,
    .theme-marketing .roadmap-teaser > h2,
    .theme-marketing .pricing > h2,
    .theme-marketing .faq > h2,
    .theme-marketing .closing-cta > h2,
    .theme-marketing .features > .section-sub,
    .theme-marketing .roadmap-teaser > .section-sub,
    .theme-marketing .pricing > .section-sub,
    .theme-marketing .faq > .section-sub,
    .theme-marketing .closing-cta > .section-sub {
        margin-left: 0;
    }

    .theme-marketing .founders-photos {
        justify-content: flex-start;
    }

    .theme-marketing .closing-cta .badges {
        justify-content: flex-start;
    }
}

/* Eight feature cards: never a ragged last row. */
@media (min-width: 640px) {
    .theme-marketing .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1100px) {
    .theme-marketing .feature-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ===== fix pass 3: the footer theme control and the blog index =====
   The footer's System / Light / Dark control: three real buttons with
   aria-pressed, wired by theme-init.js (data-theme-set) and kept in step
   with the nav toggle. 44 px tall; fits one row at 320 px. */
.theme-marketing .footer-theme {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.3rem;
    border: 1px solid var(--mk-border);
    border-radius: var(--radius-pill);
    background: var(--mk-bg-sunken);
}

.theme-marketing .footer-theme button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0 1.1rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--mk-text-muted);
    font: inherit;
    cursor: pointer;
}

.theme-marketing .footer-theme button:hover {
    color: var(--mk-text);
}

.theme-marketing .footer-theme button[aria-pressed="true"] {
    background: var(--mk-bg-raised);
    color: var(--mk-text);
    font-weight: 600;
    box-shadow: var(--mk-shadow-1);
}

.theme-marketing .footer-theme button[aria-pressed="true"] svg {
    color: var(--mk-accent);
}

.theme-marketing .footer-theme button:focus-visible {
    outline: 2px solid var(--mk-accent);
    outline-offset: 2px;
}

.theme-marketing .footer-theme svg {
    width: 1.1rem;
    height: 1.1rem;
}

@media (max-width: 480px) {
    .theme-marketing .footer-theme button {
        gap: 0.4rem;
        padding: 0 0.65rem;
        font-size: 0.95rem;
    }
}

/* The blog index shell: heading, answer-first intro, then the post cards
   or the empty state (dashed, like the More to come tile). */
.theme-marketing .blog-index {
    max-width: 52rem;
    margin: 0 auto;
    padding: clamp(2.5rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 5rem);
}

.theme-marketing .blog-index h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1.08;
}

.theme-marketing .blog-index > .section-sub {
    margin: 0;
    max-width: 40rem;
    font-size: 1.2rem;
    color: var(--mk-text-muted);
}

.theme-marketing .blog-empty,
.theme-marketing .blog-card {
    border-radius: var(--radius-l);
    background: var(--mk-bg-raised);
    box-shadow: var(--mk-shadow-1);
}

.theme-marketing .blog-empty {
    margin-top: 2.5rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border: 1px dashed var(--mk-border-strong);
}

.theme-marketing .blog-empty h2,
.theme-marketing .blog-card h2 {
    margin: 0 0 0.6rem;
    font-size: 1.45rem;
}

.theme-marketing .blog-empty p,
.theme-marketing .blog-card p {
    margin: 0;
    color: var(--mk-text-muted);
}

.theme-marketing .blog-empty-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.75rem;
}

.theme-marketing .blog-list {
    display: grid;
    gap: 1.25rem;
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
}

.theme-marketing .blog-card {
    padding: 1.5rem 1.75rem;
    border: 1px solid var(--mk-border);
}

.theme-marketing .blog-card h2 a {
    color: var(--mk-text);
    text-decoration: none;
}

.theme-marketing .blog-card h2 a:hover {
    color: var(--mk-accent);
}

.theme-marketing .blog-card .blog-card-date {
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
}
