/**
 * OrigaDoc - Stylesheet
 * Responsive, modern, clean aesthetic with full dark/light theme support.
 *
 * Design tokens live in :root below (colour, type, spacing, radius,
 * shadow, z-index). Product screens use them; only marketing selectors
 * (landing hero, sections, pricing cards, CTA band, guides, prose pages)
 * keep fluid clamp() or in-between sizes.
 *
 * Type roles: page title 1.75rem/600 (--type-page-title), section title
 * 1.125rem/600, state title 1.25rem/600, body 1rem, helper 0.875rem,
 * button 0.875rem/500 (small 0.8125rem), labels 500.
 *
 * Brand (2026-10-25): ink #14162B, cream #F5F2EA, bright teal #00C2B2 (logo
 * arrow, bars), deep teal #00796F (buttons, links), from the logo files.
 *
 * Breakpoints (max-width unless noted), the only ones in app.css and
 * account.css:
 *   340px  narrowest phones (smaller logo, step words only)
 *   380px  very narrow phones (header squeeze for long workspace names)
 *   480px  phones (one-column forms, compact public nav, dialogs)
 *   600px  the app header's tools take their own row; summaries stack
 *   640px  phones/small tablets: tables become cards, touch targets
 *   760px  tablets: app nav folds behind "Menu", stacked grids
 *   1099px the signed-out (public) nav folds behind "Menu" (2026-10-31)
 *   min-width 641px  the complement of 640 (desktop-only rules)
 *   min-width 1100px wide desktops
 *
 * Dark tokens are defined TWICE (the OS media query guarded by
 * :root:not([data-theme="light"]), and :root[data-theme="dark"] for the
 * theme switch): change both together.
 */

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* Light Theme Palette */
    --bg-page: #F8F7F3;
    --bg-card: #ffffff;
    --bg-card-subtle: #F2F0EA;
    --bg-raised: #ffffff; /* the chosen item of a segmented control */
    --border-color: #E6E3DA;
    --border-strong: #8A8679;
    --border-focus: #00796F;

    --text-primary: #14162B;
    --text-secondary: #474A5E;
    --text-muted: #646779;

    --brand-primary: #00796F;
    --brand-primary-hover: #005F57;
    --brand-primary-glow: rgba(0, 121, 111, 0.16);

    --accent-teal: #00C2B2;
    --accent-teal-bg: #E0F4F1;

    --color-error: #ef4444;
    --color-error-bg: #fef2f2;
    --color-error-border: #fecaca;

    --color-warning: #f59e0b;
    --color-warning-bg: #FFF8E6;
    --color-warning-border: #fde68a;

    --color-success: #10b981;
    --color-success-bg: #E6F4EA;
    --color-success-border: #a7f3d0;

    /* Text versions of the accent colours. The plain tokens above are for
       fills and borders; as text on their tinted backgrounds they fall
       below WCAG AA (4.5:1), so text uses these instead. */
    --brand-text: #00665D;
    --success-text: #1C6B35;
    --warning-text: #8A4B00;
    --error-text: #b91c1c;
    --teal-text: #00665D;

    /* Brand tints (fills/borders only) and the brand gradient. */
    --brand-tint-faint: rgba(0, 121, 111, 0.04);
    --brand-tint-subtle: #E0F4F1;
    --brand-tint-border: rgba(0, 121, 111, 0.28);
    --brand-gradient: linear-gradient(135deg, #14162B, #22264A);

    /* Content on a brand fill or gradient (same in both themes: the fills
       don't change with the theme). White on #00796F is 5.3:1; the
       gradient is the logo's ink (#14162B -> #22264A). */
    --on-brand: #ffffff;
    --on-brand-button-bg: #ffffff;
    --on-brand-button-bg-hover: #E0F4F1;
    --on-brand-button-text: #005F57;

    /* Logo palette (2026-10-25): ink, cream and the bright teal of the
       logo's arrow. Bright teal is a fill only (bars, dots), never text. */
    --brand-ink: #14162B;
    --brand-cream: #F5F2EA;
    --brand-bright: #00C2B2;
    --avatar-bg: #14162B;
    --avatar-text: #F5F2EA;

    /* Destructive fill: fixed red in both themes; white text on it meets
       WCAG AA (6.5:1). */
    --danger-fill: #b91c1c;
    --danger-fill-hover: #991b1b;

    /* Things that are white whatever the theme: rendered PDF pages, sample
       images, switch knobs, QR codes. */
    --surface-paper: #ffffff;

    --teal-tint-subtle: rgba(0, 194, 178, 0.08);
    --highlight-bg: rgba(245, 158, 11, 0.25);
    --highlight-bg-hover: rgba(245, 158, 11, 0.4);
    --highlight-glow: rgba(245, 158, 11, 0.3);
    --backdrop: rgba(20, 22, 43, 0.55);

    color-scheme: light;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 20px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.02);

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;

    /* Type scale (rem, 16px root) and the roles product screens use. */
    --text-xs: 0.75rem;     /* 12px: overlines, counts */
    --text-sm: 0.8125rem;   /* 13px: meta, small buttons, pills */
    --text-md: 0.875rem;    /* 14px: helper text, labels, buttons, tables */
    --text-base: 1rem;      /* 16px: body, inputs */
    --text-lg: 1.125rem;    /* 18px: section titles */
    --text-xl: 1.25rem;     /* 20px: state titles */
    --text-2xl: 1.5rem;     /* 24px: figures in stat cards */
    --text-3xl: 1.75rem;    /* 28px: page titles */

    --type-page-title: var(--text-3xl);
    --type-section-title: var(--text-lg);
    --type-state-title: var(--text-xl);
    --type-body: var(--text-base);
    --type-helper: var(--text-md);
    --type-label: var(--text-md);
    --type-button: var(--text-md);
    --type-button-sm: var(--text-sm);
    --type-stat: var(--text-2xl);

    /* Spacing: a 4px grid. */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.25rem;  /* 20px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */
    --space-10: 2.5rem;  /* 40px */
    --space-12: 3rem;    /* 48px */

    /* Control heights: compact controls and touch-sized targets. */
    --control-h-sm: 2.25rem;  /* 36px */
    --control-h: 2.5rem;      /* 40px */
    --control-h-touch: 2.75rem; /* 44px */

    /* Stacking order, lowest first. */
    --z-raised: 1;     /* above a stretched row link */
    --z-sticky: 5;     /* sticky bars inside the page (selection bar) */
    --z-popover: 20;   /* inline popover forms (New project) */
    --z-header: 50;    /* the sticky site header */
    --z-dropdown: 70;  /* menus */
    --z-dialog: 900;   /* non-native overlays (native <dialog> uses the top layer) */
    --z-toast: 999;
    --z-skip: 1000;    /* the skip link, above everything */
}

/* Dark theme: follows the OS unless the visitor chose a theme in the
   footer (data-theme on <html>, set by js/theme.js before first paint). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-page: #0E1020;
        --bg-card: #16182E;
        --bg-card-subtle: #1D2038;
        --bg-raised: #2A2D4B;
        --border-color: #2E3150;
        --border-strong: #6E7194;
        --border-focus: #00C2B2;

        --text-primary: #F5F2EA;
        --text-secondary: #CFCCD9;
        --text-muted: #9A98AF;

        --brand-primary: #00796F;
        --brand-primary-hover: #006B62;
        --brand-primary-glow: rgba(0, 194, 178, 0.22);

        --accent-teal: #00C2B2;
        --accent-teal-bg: rgba(0, 194, 178, 0.12);

        --color-error: #f87171;
        --color-error-bg: rgba(239, 68, 68, 0.12);
        --color-error-border: rgba(239, 68, 68, 0.3);

        --color-warning: #fbbf24;
        --color-warning-bg: rgba(245, 158, 11, 0.12);
        --color-warning-border: rgba(245, 158, 11, 0.3);

        --color-success: #34d399;
        --color-success-bg: rgba(16, 185, 129, 0.12);
        --color-success-border: rgba(16, 185, 129, 0.3);

        --brand-tint-faint: rgba(0, 194, 178, 0.06);
        --brand-tint-subtle: rgba(0, 194, 178, 0.13);
        --brand-tint-border: rgba(0, 194, 178, 0.38);

        /* Shadows need more opacity to show on dark surfaces. */
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.35);
        --backdrop: rgba(0, 0, 0, 0.65);

        --shadow-card: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);

        --brand-text: #3FD6C8;
        --success-text: #34d399;
        --warning-text: #fbbf24;
        --error-text: #f87171;
        --teal-text: #3FD6C8;


        /* The avatar inverts like the logo: cream with ink initials. */
        --avatar-bg: #F5F2EA;
        --avatar-text: #14162B;

        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg-page: #0E1020;
    --bg-card: #16182E;
    --bg-card-subtle: #1D2038;
    --bg-raised: #2A2D4B;
    --border-color: #2E3150;
    --border-strong: #6E7194;
    --border-focus: #00C2B2;

    --text-primary: #F5F2EA;
    --text-secondary: #CFCCD9;
    --text-muted: #9A98AF;

    --brand-primary: #00796F;
    --brand-primary-hover: #006B62;
    --brand-primary-glow: rgba(0, 194, 178, 0.22);

    --accent-teal: #00C2B2;
    --accent-teal-bg: rgba(0, 194, 178, 0.12);

    --color-error: #f87171;
    --color-error-bg: rgba(239, 68, 68, 0.12);
    --color-error-border: rgba(239, 68, 68, 0.3);

    --color-warning: #fbbf24;
    --color-warning-bg: rgba(245, 158, 11, 0.12);
    --color-warning-border: rgba(245, 158, 11, 0.3);

    --color-success: #34d399;
    --color-success-bg: rgba(16, 185, 129, 0.12);
    --color-success-border: rgba(16, 185, 129, 0.3);

    --brand-tint-faint: rgba(0, 194, 178, 0.06);
    --brand-tint-subtle: rgba(0, 194, 178, 0.13);
    --brand-tint-border: rgba(0, 194, 178, 0.38);

    /* Shadows need more opacity to show on dark surfaces. */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.35);
    --backdrop: rgba(0, 0, 0, 0.65);

    --shadow-card: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);

    --brand-text: #3FD6C8;
    --success-text: #34d399;
    --warning-text: #fbbf24;
    --error-text: #f87171;
    --teal-text: #3FD6C8;


    /* The avatar inverts like the logo: cream with ink initials. */
    --avatar-bg: #F5F2EA;
    --avatar-text: #14162B;

    color-scheme: dark;
}

/* Base Reset & Typography */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Keep the scrollbar's room reserved on every page (2026-10-23): without it a
   short page (no scrollbar) and a long one centred the header and the content
   7-15 px apart, so moving between pages shifted everything sideways. */
html {
    scrollbar-gutter: stable;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout Container */
.app-container {
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
    padding: var(--space-8) var(--space-4) var(--space-12);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    flex: 1;
}

/* Cards. One elevated card (.card; the converter's .main-card and the
   sign-in pages' .account-card are the same surface), one flat section
   card (.card-flat; Dashboard-style sections and stat cards), and an inset
   variant on the subtle background (.card-subtle; option boxes, file
   cards, summaries inside a card). Each component keeps its own padding
   or layout where it needs a different one. */
.card,
.main-card,
.account-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-8);
}

.card-flat,
.dashboard-section,
.dashboard-stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-5);
}

.card-subtle,
.file-card,
.file-list-card,
.proofread-option-card,
.conversion-summary,
.advanced-options,
.table-card {
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.card-subtle {
    padding: var(--space-4);
}

.main-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    position: relative;
    overflow: hidden;
}

/* Flow Step Transitions */
.flow-step {
    transition: opacity var(--transition-normal);
}

.flow-step.hidden {
    display: none !important;
}

/* Generic toggle used by app.js on every show/hide-able element. Only a
   few components had their own `.x.hidden` rule, so e.g. the file card,
   the result warning and the simplifications badge stayed visible (and
   focusable) while "hidden". */
.hidden {
    display: none !important;
}

/* Drag and Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem var(--space-5);
    text-align: center;
    cursor: pointer;
    background-color: var(--bg-card-subtle);
    transition: border-color var(--transition-normal), background-color var(--transition-normal), transform var(--transition-normal), opacity var(--transition-normal);
    outline: none;
    user-select: none;
}

.drop-zone:hover {
    border-color: var(--brand-primary);
    background-color: var(--brand-tint-faint);
}

.drop-zone.drag-over {
    border-color: var(--brand-primary);
    background-color: var(--brand-tint-subtle);
    transform: scale(1.008);
}

.drop-zone .drop-choose-btn {
    max-width: 100%;
    white-space: normal;
    line-height: 1.3;
}

.drop-zone .drop-choose-btn svg {
    flex-shrink: 0;
}

/* Once a file is chosen, "Continue: choose pages" is the one primary
   action; choosing a different file steps back to a secondary style. */
.drop-zone.has-file {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
}

.drop-zone.has-file .drop-choose-btn {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
    box-shadow: none;
    font-size: var(--text-md);
    padding: 0.55rem 1.1rem;
}

.drop-zone.has-file .drop-choose-btn:hover:not(:disabled) {
    background-color: var(--bg-card-subtle);
    box-shadow: none;
    transform: none;
}

.drop-subheading {
    font-size: var(--text-md);
    color: var(--text-secondary);
    margin-top: 0.625rem;
}

.drop-limit-hint {
    margin-top: 0.375rem;
    font-size: var(--text-sm);
    color: var(--text-secondary); /* --text-muted fails WCAG AA contrast at this size */
}

/* Signed-out upload box (2026-11-03): three icon chips instead of a caption. */
.drop-chips {
    list-style: none;
    margin: var(--space-3) 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
}

.drop-chip,
.drop-chip-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.drop-chip {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    background: var(--bg-card);
}

.drop-chip svg {
    flex-shrink: 0;
    color: var(--brand-text);
}

.drop-chip-link {
    text-decoration: none;
}

.drop-chip-link:hover {
    color: var(--brand-text);
    text-decoration: underline;
}

.drop-chip-link:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 3px;
    border-radius: var(--radius-full);
}

/* The rest of the upload step appears once a file is chosen. */
.drop-zone:not(.has-file) ~ .upload-after-file {
    display: none;
}

.upload-privacy-note {
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-align: center;
}

.advanced-options-note {
    font-size: var(--text-md);
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Upload -> Choose pages -> Convert, above the converter. */
.flow-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-6);
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-secondary);
}

.flow-steps li {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.flow-step-number {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
}

.flow-steps li[aria-current="step"] {
    color: var(--brand-text);
}

.flow-steps li[aria-current="step"] .flow-step-number {
    border-color: var(--brand-primary);
    background-color: var(--brand-primary);
    color: var(--on-brand);
}

.flow-steps li.is-done .flow-step-number {
    border-color: var(--success-text);
    color: var(--success-text);
}

/* A finished step that isn't the current one shows a check instead of its
   number: steps can be finished out of order (Translate's languages). */
.flow-steps li.is-done:not([aria-current="step"]) .flow-step-number {
    font-size: 0;
}

.flow-steps li.is-done:not([aria-current="step"]) .flow-step-number::after {
    content: '\2713';
    font-size: var(--text-xs);
}

/* The last step once finished is both current and done: keep its number
   readable (green text on the blue fill disappeared). */
.flow-steps li.is-done[aria-current="step"] .flow-step-number {
    border-color: var(--brand-primary);
    color: var(--on-brand);
}

@media (max-width: 480px) {
    .flow-steps {
        gap: var(--space-1) 0.625rem;
        font-size: var(--text-md);
    }

    .flow-steps li {
        gap: 0.3rem;
    }

    .flow-step-number {
        width: 1.25rem;
        height: 1.25rem;
        font-size: var(--text-xs);
    }
}

/* Narrowest phones: words only, joined by arrows; the current step keeps
   its colour and weight. */
@media (max-width: 340px) {
    .flow-step-number {
        display: none;
    }

    .flow-steps li + li::before {
        content: '\203A';
        margin-right: 0.35rem;
        color: var(--text-secondary);
    }

    .flow-steps li[aria-current="step"] {
        text-decoration: underline;
        text-underline-offset: 0.2em;
    }
}

/* Selected File Card */
.file-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem var(--space-5);
    margin-top: var(--space-5);
}

.file-card-info {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    overflow: hidden;
}

/* File type label (PDF, JPG...): a neutral tag, not an error colour.
   --text-secondary on --bg-card-subtle: 6.9:1 light, 9.6:1 dark. */
.file-badge {
    background-color: var(--bg-card-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-size: var(--text-sm);
    font-weight: 700;
    padding: 0.125rem var(--space-2);
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.file-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.file-name {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 480px;
}

.file-size {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.btn-icon:hover:not(:disabled) {
    color: var(--error-text);
    background-color: var(--color-error-bg);
}

/* Action Bar & Buttons */
.action-bar {
    margin-top: var(--space-6);
    display: flex;
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-sans);
    font-size: var(--type-button);
    font-weight: 500;
    padding: 0.65rem var(--space-5);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background-color: var(--brand-primary);
    color: var(--on-brand);
    box-shadow: 0 2px 4px var(--brand-primary-glow);
}

.btn-primary:hover:not(:disabled):not([aria-disabled="true"]) {
    background-color: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px var(--brand-primary-glow);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled):not([aria-disabled="true"]) {
    background-color: var(--bg-card-subtle);
    border-color: var(--border-focus);
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: var(--text-base);
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 0.45rem 0.875rem;
    font-size: var(--type-button-sm);
    gap: 0.4rem;
}

/* One disabled look for every button variant (a disabled control must look
   unavailable, not just say so). Hover rules are guarded with
   :not(:disabled), so nothing lights up on hover either. */
.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Processing State */
.processing-card {
    padding: var(--space-10) var(--space-6);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.spinner-wrapper {
    margin-bottom: var(--space-2);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3.5px solid var(--border-color);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

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

/* Page Selection (Logged-In, Credit-Metered Flow) */
.page-select-card {
    padding: 0;
    text-align: left;
    align-items: stretch;
}

.page-checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: var(--space-2);
    max-height: 280px;
    overflow-y: auto;
    padding: var(--space-3);
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.page-checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-md);
    cursor: pointer;
    /* Comfortable touch target (the bare 13px checkbox was the only
       tappable area on phones). */
    min-height: 2.5rem;
    padding: 0 var(--space-2);
    border-radius: var(--radius-sm);
}

.page-checkbox-item:hover {
    background-color: var(--bg-card);
}

.page-checkbox-item input {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.page-select-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-3);
    margin-bottom: var(--space-3);
}

.page-select-bulk {
    display: flex;
    gap: 0.375rem;
}

.page-range-label {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
}

/* Text inputs and selects: one base. .account-input is the form control
   everywhere; the page picker's range field (.page-range-input) is the same
   control, a little shorter. */
.account-input,
.page-range-input {
    padding: 0.625rem var(--space-3);
    font-family: var(--font-sans);
    font-size: var(--type-body);
    color: var(--text-primary);
    background-color: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.account-input:focus,
.page-range-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--brand-primary-glow);
}

.page-range-input {
    flex: 1 1 10rem;
    max-width: 16rem;
    padding: 0.45rem var(--space-3);
}

.page-range-input[aria-invalid="true"] {
    border-color: var(--color-warning-border);
}

.page-range-hint {
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.page-select-notice {
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-md);
    background-color: var(--color-warning-bg);
    border: 1px solid var(--color-warning-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

.page-select-notice a,
.page-select-notice button.link-like {
    color: var(--brand-text);
    font-weight: 600;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.page-select-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-top: var(--space-4);
}

.page-select-cost-label {
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.page-select-actions {
    display: flex;
    gap: var(--space-2);
    /* Stays on the right when the "Cost:" label is hidden (signed in: the
       summary above shows the cost), like the upload step's .action-bar. */
    margin-left: auto;
}

.processing-title {
    font-size: var(--type-state-title);
    font-weight: 600;
    color: var(--text-primary);
}

.processing-desc {
    font-size: var(--text-base);
    color: var(--text-secondary);
    max-width: 420px;
}

.processing-timer {
    font-family: var(--font-mono);
    font-size: var(--text-md);
    color: var(--text-muted);
    background-color: var(--bg-card-subtle);
    padding: 0.3rem var(--space-3);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

/* Error State */
.error-card {
    padding: var(--space-12) var(--space-6);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    background-color: var(--color-error-bg);
    border: 1px solid var(--color-error-border);
    border-radius: var(--radius-md);
}

.error-icon-wrapper {
    color: var(--error-text);
}

.error-title {
    font-size: var(--type-state-title);
    font-weight: 600;
    color: var(--error-text);
}

.error-message {
    font-size: var(--text-base);
    color: var(--text-primary);
    max-width: 520px;
    line-height: 1.5;
}

.error-actions {
    margin-top: var(--space-2);
}

.result-meta-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.stat-badge {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    padding: 0.4rem var(--space-3);
    border-radius: var(--radius-md);
    min-width: 76px;
}

.stat-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-value {
    font-size: var(--text-base);
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.result-warning {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background-color: var(--color-warning-bg);
    border: 1px solid var(--color-warning-border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-md);
    color: var(--warning-text);
}

.sample-result-banner {
    background-color: var(--accent-teal-bg);
    border: 1px solid var(--accent-teal);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-md);
    color: var(--text-primary);
    margin-bottom: var(--space-4);
}

.sample-result-banner.hidden {
    display: none;
}

.sample-result-banner a {
    color: var(--brand-text);
    font-weight: 600;
}

.text-display-container {
    margin-top: var(--space-4);
}

.text-result-area {
    width: 100%;
    min-height: 380px;
    height: 55vh;
    max-height: 700px;
    padding: var(--space-5);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    resize: vertical;
    white-space: pre-wrap;
    outline: none;
    transition: border-color var(--transition-fast);
}

.text-result-area:focus {
    border-color: var(--border-focus);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--text-primary);
    color: var(--bg-page);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-size: var(--text-md);
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
    pointer-events: none;
    z-index: var(--z-toast);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 640px) {
    /* Full-width bar on phones, clear of the home indicator. */
    .toast {
        left: 1rem;
        right: 1rem;
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        text-align: center;
    }
}

/* Utility classes */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Proofread Toggle Card */
.proofread-option-card {
    margin-top: var(--space-5);
    padding: 0.875rem var(--space-5);
}

.toggle-control {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    cursor: pointer;
    user-select: none;
}

.toggle-control input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch {
    width: 42px;
    height: 24px;
    background-color: var(--border-color);
    border-radius: var(--radius-full);
    position: relative;
    flex-shrink: 0;
    transition: background-color var(--transition-fast);
    margin-top: 2px;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--surface-paper);
    top: 3px;
    left: 3px;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle-control input:checked ~ .toggle-switch {
    background-color: var(--brand-primary);
}

.toggle-control input:checked ~ .toggle-switch::after {
    transform: translateX(18px);
}

.toggle-text-block {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.toggle-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.toggle-description {
    font-size: var(--text-md);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Word Export Setting Pill in Result Actions */
.export-setting-pill {
    display: flex;
    align-items: center;
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.35rem var(--space-3);
    transition: border-color var(--transition-fast);
}

.export-setting-pill:hover {
    border-color: var(--border-strong);
}

.toggle-control-sm {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
}

.toggle-switch-sm {
    width: 32px;
    height: 18px;
    background-color: var(--border-color);
    border-radius: var(--radius-full);
    position: relative;
    flex-shrink: 0;
    transition: background-color var(--transition-fast);
}

.toggle-switch-sm::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--surface-paper);
    top: 2px;
    left: 2px;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle-control input:checked ~ .toggle-switch-sm {
    background-color: var(--brand-primary);
}

.toggle-control input:checked ~ .toggle-switch-sm::after {
    transform: translateX(14px);
}

.toggle-text-block-sm {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.toggle-title-sm {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.toggle-desc-sm {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    display: none;
}

@media (min-width: 1100px) {
    .toggle-desc-sm {
        display: block;
    }
}

/* Proofread Banner */
.proofread-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    background: linear-gradient(135deg, var(--brand-tint-subtle), var(--teal-tint-subtle));
    border: 1px solid var(--brand-tint-border);
    border-radius: var(--radius-md);
    padding: 0.875rem var(--space-5);
    margin-top: var(--space-4);
}

.proofread-banner-icon {
    color: var(--brand-text);
    flex-shrink: 0;
    margin-top: 2px;
}

.proofread-banner-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.proofread-banner-desc {
    font-size: var(--text-md);
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Structure & Review Report Banner */
.structure-report-banner {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.875rem var(--space-5);
    margin-top: 0.875rem;
    box-shadow: var(--shadow-sm);
}

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

.structure-report-title-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-base);
}

.structure-icon {
    color: var(--brand-text);
    flex-shrink: 0;
}

.structure-report-heading {
    font-weight: 600;
    color: var(--text-primary);
}

.structure-report-summary {
    color: var(--text-secondary);
    font-weight: 500;
}

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

/* Pills: the one status/label family. .pill + a tone modifier
   (--neutral, --success, --warning, --error, --brand); every colour is a
   theme token, so pills follow the theme. Older names are aliases of the
   same declarations: .badge/.badge-success/.badge-neutral (result screen),
   .feature-soon-badge ("Soon") and .project-tab-count (tab counts). Text
   contrast on the tinted fills is at least 4.8:1 in both themes. */
.pill,
.badge,
.feature-soon-badge,
.project-tab-count {
    display: inline-block;
    white-space: nowrap;
    padding: 0.125rem var(--space-2);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
}

.pill-neutral,
.badge-neutral,
.feature-soon-badge,
.project-tab-count {
    background-color: var(--bg-card-subtle);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.pill-success,
.badge-success {
    background-color: var(--color-success-bg);
    border-color: var(--color-success-border);
    color: var(--success-text);
}

.pill-warning {
    background-color: var(--color-warning-bg);
    border-color: var(--color-warning-border);
    color: var(--warning-text);
}

.pill-error {
    background-color: var(--color-error-bg);
    border-color: var(--color-error-border);
    color: var(--error-text);
}

.pill-brand {
    background-color: var(--brand-tint-subtle);
    border-color: var(--brand-tint-border);
    color: var(--brand-text);
}

/* The normal, finished state ("Ready", "Uploaded"): plain text, no pill,
   so only states that need attention carry colour (2026-10-27). */
.status-plain {
    white-space: nowrap;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

/* Compact pills: counts and "Soon". */
.pill-sm,
.feature-soon-badge,
.project-tab-count {
    padding: 0 0.375rem;
    font-size: var(--text-xs);
}

.feature-soon-badge {
    margin-left: var(--space-2);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: middle;
    line-height: 1.4;
}

/* Stat Badge Accent */
.stat-badge-accent {
    border-color: var(--brand-tint-border);
    background-color: var(--brand-tint-subtle);
}

.stat-badge-accent .stat-value {
    color: var(--brand-text);
}

/* Underline tabs: THE look for switching a whole view -- the result
   preview's views (.view-tabs, buttons with role=tab), the project/projects
   lists (.project-tabs, links with aria-current) and the project page's
   Convert | Translate (.work-switch, account.css, one step larger). A filter
   or a figure switch uses the segmented .segmented below instead. */
.view-tabs,
.project-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.view-tab-btn,
.project-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: var(--space-2) 0.875rem;
    margin-bottom: -1px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-secondary);
    font: inherit;
    font-size: var(--type-button);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.view-tab-btn:hover,
.project-tabs a:hover {
    color: var(--text-primary);
}

.view-tab-btn.active,
.view-tab-btn[aria-selected="true"],
.project-tabs a[aria-current],
.project-tabs a[aria-selected="true"] {
    color: var(--text-primary);
    font-weight: 600;
    border-bottom-color: var(--brand-primary);
}

.view-tab-btn:focus-visible,
.project-tabs a:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: -2px;
}

/* Segmented filter toggle (UI audit 2026-11-04): THE look for filtering a
   list or switching a figure -- a pill track, the chosen pill raised. Items
   are the track's buttons or links: <button aria-pressed>, role=tab with
   aria-selected, or links with aria-current. An optional count sits in
   .segmented-count. .segmented-wrap: for many items that may wrap on a
   phone (there a rounded track instead of a pill, rows filled evenly). Used by the dashboard (All |
   Translated, This month | All time, Characters | Words) and billing's
   Credit activity filters. */
.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    max-width: 100%;
    padding: 3px;
    border-radius: var(--radius-full);
    background-color: var(--bg-card-subtle);
}

.segmented > button,
.segmented > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 2rem;
    padding: 0 var(--space-3);
    border: 0;
    border-radius: var(--radius-full);
    background: none;
    color: var(--text-secondary);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.segmented > button:hover,
.segmented > a:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.segmented > [aria-pressed="true"],
.segmented > [aria-selected="true"],
.segmented > [aria-current]:not([aria-current="false"]) {
    background-color: var(--bg-raised);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.segmented > button:focus-visible,
.segmented > a:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 1px;
}

.segmented-count {
    color: inherit;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
    .segmented > button,
    .segmented > a {
        transition: none;
    }
}

/* Phones: touch-sized items. */
@media (max-width: 640px) {
    .segmented > button,
    .segmented > a {
        min-height: var(--control-h-touch);
    }

    /* Wrapped rows: a rounded track, and the rows fill it evenly instead of
       leaving a ragged end. */
    .segmented-wrap {
        border-radius: var(--radius-lg);
    }

    .segmented-wrap > button,
    .segmented-wrap > a {
        flex: 1 1 auto;
    }
}

/* The result preview's tab row: tabs sit on the rule, the highlight
   switch on the right. */
.view-tabs-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-5);
    border-bottom: 1px solid var(--border-color);
}

.view-tabs-bar .highlight-checkbox-label {
    padding-bottom: var(--space-2);
}

.highlight-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* View Panes */
.view-pane {
    margin-top: var(--space-3);
}

.view-pane.hidden {
    display: none !important;
}

/* Highlighted Text Box */
.highlighted-text-box {
    width: 100%;
    min-height: 380px;
    height: 55vh;
    max-height: 700px;
    overflow-y: auto;
    padding: var(--space-5);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    white-space: pre-wrap;
    outline: none;
}

/* Highlighted OCR Correction */
mark.ocr-correction {
    background-color: var(--highlight-bg);
    color: inherit;
    font-weight: 600;
    padding: 0.1rem 0.3rem;
    border-radius: var(--radius-sm);
    border-bottom: 2px solid var(--color-warning);
    cursor: help;
    position: relative;
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

mark.ocr-correction:hover {
    background-color: var(--highlight-bg-hover);
    box-shadow: 0 0 8px var(--highlight-glow);
}

/* Text in a picture or stamp (scanning-error flags): marked, but apart. */
mark.ocr-correction.is-picture {
    background-color: transparent;
    border-bottom-style: dashed;
    font-weight: inherit;
}

.no-highlights mark.ocr-correction {
    background-color: transparent !important;
    border-bottom-color: transparent !important;
    font-weight: inherit !important;
}

/* The suggested correction after a highlighted token (js/app.js,
   renderSuggestionPreview()); hidden with the highlights. */
.ocr-suggestion {
    font-size: 0.8125em;
    font-weight: 600;
    color: var(--warning-text);
    margin-left: 0.15rem;
}

.no-highlights .ocr-suggestion {
    display: none;
}

/* Tables Container & Cards */
.tables-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    max-height: 60vh;
    overflow-y: auto;
    padding: var(--space-2) var(--space-1);
}

.table-card {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.table-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.table-card-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.table-card-actions {
    display: flex;
    gap: 0.4rem;
}

.table-responsive-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* Data tables: one look for every table of records -- the converter's
   table preview (.styled-table, built by js/app.js), the Dashboard-style
   tables (.dashboard-table: billing, team, usage, documents, activity,
   translation quote) and the plan comparison (.compare-table). A neutral
   header row on --bg-card-subtle in label type, 1px row rules. Each table
   keeps its own cell padding (density). */
.styled-table,
.dashboard-table,
.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-md);
    text-align: left;
}

.styled-table th,
.dashboard-table thead th,
.compare-table thead th,
.compare-table thead td {
    background-color: var(--bg-card-subtle);
    color: var(--text-secondary);
    font-size: var(--type-label);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.styled-table {
    background-color: var(--bg-card);
}

/* The preview's header cells are the document's own first row: content,
   so they keep the primary text colour. */
.styled-table th {
    color: var(--text-primary);
    padding: 0.65rem 0.875rem;
    white-space: nowrap;
}

.styled-table td {
    padding: 0.6rem 0.875rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: top;
}

.styled-table tr:last-child td {
    border-bottom: none;
}

.styled-table tr:hover td {
    background-color: var(--brand-tint-faint);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .app-container {
        padding: var(--space-5) var(--space-3) var(--space-8);
    }

    .main-card {
        padding: var(--space-5);
    }

    .drop-zone {
        padding: var(--space-5) 0.875rem;
    }

    .flow-steps {
        gap: var(--space-1) 0.875rem;
        font-size: var(--text-sm);
    }

}

/* Post-demo sign-up prompt */
.demo-upsell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-4);
    padding: var(--space-4) var(--space-5);
    background-color: var(--accent-teal-bg);
    border: 1px solid var(--accent-teal);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    color: var(--text-primary);
}

.demo-upsell-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1 1 16rem;
}

.demo-upsell-text span {
    color: var(--text-secondary);
}

/* Page picker thumbnails (rendered by pdf.js when available). Without the
   .with-thumbs class the picker stays the plain numbered list. */
.page-checkbox-caption {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.page-thumb {
    display: none;
}

.page-select-card .processing-desc {
    max-width: none;
}

.page-checkbox-list.with-thumbs {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    max-height: 560px;
}

.page-checkbox-list.with-thumbs .page-checkbox-item {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-2);
    border: 1px solid transparent;
    position: relative;
}

/* Magnifier on each thumbnail: opens the large preview (#page-preview). */
.page-zoom-btn {
    display: none;
}

.page-checkbox-list.with-thumbs .page-zoom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    background-color: var(--bg-card);
    color: var(--text-primary);
    cursor: zoom-in;
    box-shadow: var(--shadow-md);
}

.page-zoom-btn:hover {
    border-color: var(--brand-primary);
}

.page-preview {
    /* The global reset zeroes margins; a modal <dialog> centres by margin: auto. */
    margin: auto;
    width: min(920px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.page-preview::backdrop {
    background-color: var(--backdrop);
}

.page-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-color);
}

.page-preview-title {
    font-size: var(--text-base);
    font-weight: 600;
    margin: 0;
}

.page-preview-nav {
    display: flex;
    gap: var(--space-2);
}

.page-preview-body {
    display: flex;
    justify-content: center;
    padding: var(--space-4);
    overflow: auto;
    max-height: calc(100vh - 7rem);
    background-color: var(--bg-card-subtle);
}

.page-preview-body canvas {
    display: block;
    max-width: 100%;
    height: auto;
    background-color: var(--surface-paper);
    box-shadow: var(--shadow-lg);
}

.page-checkbox-list.with-thumbs .page-checkbox-item:has(input:checked) {
    border-color: var(--brand-primary);
    background-color: var(--bg-card);
}

.page-checkbox-list.with-thumbs .page-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    min-height: 194px;
    margin: 0 auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.page-thumb canvas {
    display: block;
    width: 150px;
    height: auto;
}

.page-checkbox-list.with-thumbs .page-checkbox-caption {
    justify-content: center;
}

/* =========================================================================
   Shared site chrome (includes/PageChrome.php)
   ========================================================================= */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* The real checkbox is hidden behind the switch, so show focus on the switch. */
.toggle-control input:focus-visible ~ .toggle-switch,
.toggle-control input:focus-visible ~ .toggle-switch-sm {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: var(--z-skip);
    padding: var(--space-2) var(--space-4);
    background-color: var(--brand-primary);
    color: var(--on-brand);
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 0.75rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background-color: color-mix(in srgb, var(--bg-page) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
}

.site-header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: var(--space-3) var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-decoration: none;
    flex-shrink: 0;
}

/* The wordmark (img/logo-light.svg / logo-dark.svg, PageChrome::logoMark()):
   one of the two shows, by the same theme selectors as the colour tokens. */
.site-logo {
    display: block;
    height: 28px;
    width: auto;
}

.site-logo-dark {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .site-logo-light {
        display: none;
    }

    :root:not([data-theme="light"]) .site-logo-dark {
        display: block;
    }
}

:root[data-theme="dark"] .site-logo-light {
    display: none;
}

:root[data-theme="dark"] .site-logo-dark {
    display: block;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-1) var(--space-5);
    flex: 1;
    flex-wrap: wrap;
}

.site-nav-spacer {
    flex: 1;
}

.site-nav-link {
    font-size: var(--text-md);
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.35rem 0;
    /* 40 px tall targets on desktop too (2026-11-02 audit: they were 32). */
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
}

/* The header's sign-up button reads at body-label size, not 13 px. */
.site-nav > .btn-sm {
    font-size: var(--text-md);
}

.site-nav-link:hover,
.site-nav-link[aria-current="page"] {
    color: var(--text-primary);
}

.site-nav-link[aria-current="page"] {
    font-weight: 600;
}

@media (max-width: 760px) {
    .site-header-inner {
        gap: var(--space-3);
        padding: 0.625rem var(--space-4);
    }
}

/* The signed-out header folds its section links behind "Menu" below 1100px
   (2026-10-31): with Convert, Solutions, Translate, Examples, Pricing and
   Guides the row no longer fits beside Sign in and the sign-up button on
   tablets (it wrapped to two rows up to ~1000px). The app header keeps its
   own 760px fold. */
@media (max-width: 1099px) {
    .site-nav {
        gap: var(--space-1) 0.875rem;
        justify-content: flex-end;
    }

    .site-nav-spacer {
        display: none;
    }

    /* The section links fold behind "Menu" (js/nav.js) into a panel
       under the header. */
    .site-nav .site-nav-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        min-height: 44px;
        font: inherit;
        font-size: var(--text-md);
        font-weight: 600;
        color: var(--text-primary);
        background: none;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-full);
        padding: 0.3rem 0.8rem;
        cursor: pointer;
    }

    /* The header's sign-up button: touch height on phones (2026-10-27). */
    .site-nav > .btn {
        min-height: 44px;
    }

    .site-nav .site-nav-toggle[aria-expanded="true"] {
        background-color: var(--bg-card-subtle);
    }

    .site-nav .site-nav-sections {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0.15rem;
        padding: var(--space-2) var(--space-4) 0.875rem;
        background-color: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
    }

    .site-nav .site-nav-sections.is-open {
        display: flex;
    }

    .site-nav .site-nav-sections .site-nav-link {
        display: block;
        padding: var(--space-3) var(--space-2);
        border-radius: var(--radius-sm);
    }

    .site-nav .site-nav-sections .site-nav-link:hover {
        background-color: var(--bg-card-subtle);
    }
}

.site-nav-short {
    display: none;
}

/* Public header: section links inline on wide screens; the Menu toggle
   and the copy of "Sign in" inside the panel only appear on phones. */
.site-nav-toggle,
.site-nav-sections-signin {
    display: none;
}

.site-nav-sections {
    display: flex;
    align-items: center;
    gap: var(--space-1) var(--space-5);
}

/* The "Convert" menu in the public header (2026-10-29): a js/nav.js menu whose
   button looks like the other section links. Two-class selectors so they win
   over .app-menu-button, which comes later in this file. */
.site-nav .site-nav-menu-button {
    min-height: 2.5rem; /* same 40 px target as the other menu links */
    padding: 0.35rem 0;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: 0;
    border-radius: 0;
}

.site-nav .site-nav-menu-button:hover,
.site-nav .site-nav-menu-button[aria-expanded="true"],
.site-nav .site-nav-menu-button[data-current="true"] {
    color: var(--text-primary);
    background: none;
}

.site-nav .site-nav-menu-button[data-current="true"] {
    font-weight: 600;
}

.site-nav .site-nav-menu .app-menu-item[aria-current="page"] {
    font-weight: 600;
}

/* Inside the "Menu" panel the list opens in place, indented under
   its button, instead of floating over the page. */
@media (max-width: 1099px) {
    .site-nav .site-nav-sections .site-nav-menu-button {
        display: flex;
        width: 100%;
        justify-content: center;
        padding: var(--space-3) var(--space-2);
        border-radius: var(--radius-sm);
    }

    .site-nav .site-nav-sections .site-nav-menu-button:hover {
        background-color: var(--bg-card-subtle);
    }

    /* The open list sits in its own tinted box with smaller type, so the
       links after it (Translate, Examples ...) don't read as more Convert
       items (2026-10-29). */
    .site-nav .site-nav-menu .app-menu-panel {
        position: static;
        min-width: 0;
        max-width: none;
        margin: var(--space-1) 0 var(--space-2);
        padding: var(--space-1) 0;
        border: 0;
        border-radius: var(--radius-md);
        box-shadow: none;
        background-color: var(--bg-card-subtle);
    }

    .site-nav .site-nav-menu .app-menu-item {
        justify-content: center;
        transform: none;
        font-size: var(--text-md);
    }
}

@media (max-width: 480px) {
    .site-nav-long {
        display: none;
    }

    .site-nav-short {
        display: inline;
    }

    /* Menu keeps its name for screen readers; the word itself hides. */
    .site-nav .site-nav-toggle {
        padding: 0.3rem 0.65rem;
    }

    .site-nav .site-nav-toggle span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    /* Room for Menu + Sign up at 320 px: Sign in moves into the panel. */
    .site-nav .site-nav-signin {
        display: none;
    }

    .site-nav .site-nav-sections .site-nav-sections-signin {
        display: block;
    }
}

@media (max-width: 340px) {
    .site-header .site-logo {
        height: 22px;
    }
}

/* Touch-sized tap targets on small screens (at least ~40px tall). */
@media (max-width: 640px) {
    .site-nav-link {
        display: inline-block;
        padding: 0.6rem 0;
    }

    .site-footer-links {
        gap: 0;
    }

    .site-footer-links a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0.25rem 0;
    }

    .theme-switch button {
        min-height: 2.5rem;
        padding: 0.4rem 0.85rem;
    }
}

.site-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
    padding: var(--space-10) var(--space-5) var(--space-6);
    margin-top: auto;
}

/* The footer's content box matches the header's (1120 px including its
   1.25rem sides), so footer text lines up with the logo and the page
   content (UI audit 2026-11-04: it sat 20 px further left). */
.site-footer-inner {
    max-width: calc(1120px - 2 * var(--space-5));
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-8);
}

/* With the "Convert" column (signed out, 2026-10-29): four columns. */
.site-footer-inner:has(> :nth-child(4)) {
    grid-template-columns: 2fr 1fr 1fr 1fr;
}

.site-footer-brand p {
    margin-top: var(--space-3);
    font-size: var(--text-md);
    color: var(--text-secondary);
    max-width: 22rem;
}

.site-footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.site-footer-heading {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.site-footer-links a {
    font-size: var(--text-md);
    color: var(--text-secondary);
    text-decoration: none;
}

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

.site-footer-bottom {
    max-width: calc(1120px - 2 * var(--space-5));
    margin: var(--space-8) auto 0;
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-6);
}

.site-footer-copy {
    font-size: var(--text-md);
    color: var(--text-secondary);
}

/* Language switch (2026-11-04, includes/I18n.php): a globe menu in the
   signed-out header, a row of links in the footer, a row in account
   settings. Each language's name is written in that language. */
.site-nav .site-language-button {
    gap: 0.3rem;
}

.site-language-code {
    font-size: var(--text-sm);
    font-weight: 600;
}

.site-nav-sections-languages {
    display: none;
}

.site-nav-language-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 2.75rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-decoration: none;
}

.site-nav-language-link:hover {
    color: var(--text-primary);
}

.site-nav-language-link[aria-current="true"] {
    color: var(--text-primary);
    font-weight: 600;
}

.site-nav-language-link .app-icon {
    width: 14px;
    height: 14px;
}

/* Below 1100 px the header has no room for the globe: the languages sit at
   the foot of the Menu panel instead. */
@media (max-width: 1099px) {
    .site-nav .site-language-menu {
        display: none;
    }

    .site-nav .site-nav-sections .site-nav-sections-languages {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0 var(--space-4);
        margin-top: var(--space-2);
        padding-top: var(--space-2);
        border-top: 1px solid var(--border-color);
    }
}

.site-footer-languages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 var(--space-4);
}

.site-footer-language {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 2.75rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-decoration: none;
}

.site-footer-language:hover {
    color: var(--brand-text);
    text-decoration: underline;
}

.site-footer-language[aria-current="true"] {
    color: var(--text-primary);
    font-weight: 600;
}

.site-footer-language .app-icon {
    width: 14px;
    height: 14px;
}

.settings-language-choices {
    border: 0;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-2);
}

.settings-language-choice {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 2.75rem;
    font-size: var(--text-md);
    color: var(--text-primary);
    cursor: pointer;
}

.settings-language-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    padding: 0 0 var(--space-3);
}

/* Chinese pages: the system's Chinese fonts after Inter (whose Latin letters
   stay), never a font CDN (blocked in mainland China). */
:root:lang(zh-Hans) {
    --font-sans: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans SC', 'Source Han Sans SC', sans-serif;
}

:root:lang(zh-Hant) {
    --font-sans: 'Inter', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans CJK TC', 'Noto Sans TC', 'Source Han Sans TC', sans-serif;
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0.2rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    background-color: var(--bg-page);
}

.theme-switch[hidden] {
    display: none;
}

.theme-switch-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    padding: 0 0.4rem 0 0.6rem;
}

.theme-switch button {
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: 0;
    border-radius: var(--radius-full);
    padding: 0.3rem var(--space-3);
    cursor: pointer;
}

.theme-switch button:hover {
    color: var(--text-primary);
}

.theme-switch button[aria-pressed="true"] {
    background-color: var(--bg-card-subtle);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
    .site-footer-inner,
    .site-footer-inner:has(> :nth-child(4)) {
        grid-template-columns: 1fr 1fr;
    }

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

/* Same sides as the header and the page on phones and tablets. */
@media (max-width: 760px) {
    .site-footer,
    .site-footer.site-footer-compact {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
}

/* =========================================================================
   Converter page
   ========================================================================= */

.converter-heading {
    font-size: var(--type-page-title);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Hidden while a conversion runs (js/app.js setFlowStep()); display:flex
   on .flow-steps would otherwise override the hidden attribute. */
.flow-steps[hidden] {
    display: none;
}

/* Signed in (an internal screen): the step indicator is left-aligned; the
   drop zone itself stays centred. The signed-out landing keeps its centred
   hero layout. */
.app-container:not(.is-landing) .flow-steps {
    justify-content: flex-start;
}

/* Under the upload area (signed in): one privacy line and a small Help
   disclosure with the troubleshooting, folded so the first screen stays
   about choosing a file. */
.upload-footnote {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-1) var(--space-4);
    margin-top: var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.upload-footnote .upload-privacy-note {
    margin: 0;
    text-align: left;
}

.upload-help > summary {
    cursor: pointer;
    color: var(--brand-text);
    text-decoration: underline;
}

.upload-help[open] {
    flex-basis: 100%;
}

.upload-help-list {
    margin: 0.6rem 0 0;
    padding: var(--space-3) var(--space-4) var(--space-3) var(--space-8);
    font-size: var(--text-md);
    text-align: left;
    line-height: 1.55;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-card-subtle);
}

.upload-help-list li + li {
    margin-top: 0.35rem;
}

/* Before converting: file, selection, pages needed, balance after. */
.conversion-summary {
    margin-top: var(--space-4);
    padding: 0.85rem var(--space-4);
    text-align: left;
}

.conversion-summary-file {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-3);
}

.conversion-summary-name {
    min-width: 0;
    font-weight: 600;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.conversion-summary-meta {
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.conversion-summary-file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-left: 0;
    flex-basis: 100%;
}

.conversion-summary-figures {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
    margin: var(--space-3) 0 0;
}

.conversion-summary-figures dt {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.conversion-summary-figures dd {
    margin: 0.15rem 0 0;
    font-weight: 600;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.conversion-summary-figures dd.is-short {
    color: var(--error-text);
}

@media (max-width: 600px) {
    .conversion-summary-figures {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

    .conversion-summary-file-actions {
        margin-left: 0;
    }
}

.converter-card {
    scroll-margin-top: 5rem;
}

/* Settings folded under "Advanced options" so a first visit is just
   "choose a file, convert". */
.advanced-options {
    margin-top: var(--space-5);
}

.advanced-options > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: 0.875rem var(--space-5);
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

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

.advanced-options > summary::after {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid var(--text-secondary);
    border-bottom: 2px solid var(--text-secondary);
    transform: rotate(45deg);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.advanced-options[open] > summary::after {
    transform: rotate(-135deg);
}

.advanced-options-summary-hint {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: var(--text-md);
    margin-left: auto;
}

.advanced-options-body {
    padding: 0 var(--space-5) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.advanced-options-body .proofread-option-card {
    margin-top: 0;
    background-color: var(--bg-card);
}

/* Progress steps */
.processing-steps {
    list-style: none;
    display: flex;
    gap: var(--space-2);
    margin: var(--space-1) 0;
    flex-wrap: wrap;
    justify-content: center;
}

.processing-steps li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-md);
    color: var(--text-muted);
    padding: 0.3rem var(--space-3);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.processing-steps li::before {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--border-strong);
}

.processing-steps li.is-active {
    color: var(--text-primary);
    border-color: var(--brand-primary);
    font-weight: 600;
}

.processing-steps li.is-active::before {
    background-color: var(--brand-primary);
}

.processing-steps li.is-done {
    color: var(--text-secondary);
}

.processing-steps li.is-done::before {
    background-color: var(--color-success);
}

.processing-estimate {
    font-size: var(--text-md);
    color: var(--text-secondary);
}

/* Result header: one obvious download, everything else secondary */
.result-summary {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--border-color);
}

.result-ready-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.result-ready-title {
    font-size: var(--type-state-title);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.result-ready-sub {
    font-size: var(--text-base);
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.result-secondary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.btn-ghost {
    background: none;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.btn-ghost:hover:not(:disabled):not([aria-disabled="true"]) {
    color: var(--text-primary);
    background-color: var(--bg-card-subtle);
    border-color: var(--border-color);
}

.result-layout-options {
    margin-top: 0;
}

.result-layout-options .advanced-options-body {
    flex-direction: row;
    flex-wrap: wrap;
}

.result-layout-options .export-setting-pill {
    flex: 1 1 18rem;
    padding: 0.625rem 0.875rem;
    background-color: var(--bg-card);
}

.result-layout-options .toggle-desc-sm {
    display: block;
}

.result-layout-options .toggle-title-sm {
    white-space: normal;
}

.result-layout-note {
    flex-basis: 100%;
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.result-accuracy-note {
    font-size: var(--text-md);
    color: var(--text-secondary);
    margin-top: var(--space-4);
}

@media (max-width: 640px) {
    .result-ready-row .btn-lg {
        width: 100%;
    }

    .result-secondary-actions .btn {
        flex: 1 1 auto;
    }

    .action-bar .btn-lg {
        width: 100%;
    }
}

/* =========================================================================
   Landing page (anonymous visitors)
   ========================================================================= */

.hero {
    text-align: center;
    padding: var(--space-1) 0 0;
}

.hero-title {
    font-size: clamp(1.75rem, 4.2vw, 2.625rem);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.03em;
    max-width: 24ch;
    margin: 0 auto;
}

.hero-sub {
    font-size: clamp(1rem, 1.8vw, var(--text-lg));
    color: var(--text-secondary);
    max-width: 40rem;
    margin: 0.625rem auto 0;
    line-height: 1.5;
}

.landing-section {
    padding: var(--space-12) 0 0;
    scroll-margin-top: 4.5rem;
}

.section-title {
    font-size: clamp(1.5rem, 3.2vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    text-align: center;
}

.section-sub {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    text-align: center;
    max-width: 40rem;
    margin: 0.625rem auto 0;
}

/* A real conversion (index.php #example): the scan and Word's rendering of
   the result, side by side, then the table close up. The images are white
   pages, so they keep a border in both themes. */
.example-pair {
    margin-top: 1.75rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
}

.example-figure {
    margin: 0;
}

.example-figure img {
    display: block;
    width: 100%;
    height: auto;
    background-color: var(--surface-paper);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.example-figure figcaption {
    margin-top: var(--space-2);
    font-size: var(--text-base);
    color: var(--text-secondary);
    text-align: center;
}

.example-subtitle {
    font-size: var(--text-lg);
    font-weight: 700;
    text-align: center;
    margin-top: var(--space-8);
}

.example-closeups {
    max-width: 760px;
    margin: var(--space-4) auto 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.example-notes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
    max-width: 880px;
    margin: var(--space-8) auto 0;
}

.example-notes-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-lg);
    font-weight: 700;
}

.example-notes-title svg {
    flex-shrink: 0;
    color: var(--success-text);
}

.example-notes-title-muted svg {
    color: var(--text-secondary);
}

.example-notes ul {
    margin: 0.625rem 0 0;
    padding-left: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: var(--text-base);
    line-height: 1.55;
    color: var(--text-secondary);
}

.example-downloads {
    margin-top: var(--space-6);
    text-align: center;
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.example-downloads-note {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-md);
}

/* Home page pricing teaser (2026-10-29): the cards are on pricing.php. */
.pricing-teaser {
    text-align: center;
}

.pricing-teaser > .btn {
    margin-top: var(--space-5);
}

/* Translate page (translate.php) and the pricing page's translation rates
   (2026-10-29). */
.translate-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin: var(--space-6) 0 0;
}

.translate-rates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--space-4);
    max-width: 44rem;
    margin: var(--space-6) auto 0;
}

.translate-rate {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    text-align: center;
    color: var(--text-secondary);
}

.translate-rate-amount {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.translate-languages .language-list {
    display: block;
    columns: 4 11rem;
    column-gap: var(--space-6);
    list-style: none;
    padding-left: 0;
}

.translate-languages .language-list li {
    margin-bottom: 0.35rem;
    break-inside: avoid;
}

/* Translate page, simplified (2026-11-03): the create button with its note,
   chips, tiles whose sentence is in a tooltip, the "good to check" lines and
   the language filter. */
.translate-hero-cta {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
}

.translate-hero-note {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.translate-popular {
    margin-top: var(--space-4);
}

.icon-tile.icon-tile-tip {
    padding: 0;
}

.icon-tile-tip .ptip {
    position: static;
    display: flex;
    width: 100%;
    height: 100%;
}

.ptip-tile .ptip-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-5) var(--space-3);
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius-lg);
}

.ptip-tile .icon-tile-label {
    text-decoration: underline dotted;
    text-decoration-color: var(--text-muted);
    text-underline-offset: 3px;
}

/* In a tile, the tooltip spans the tile so it never leaves a phone screen. */
.icon-tile-tip .ptip-text {
    left: var(--space-2);
    right: var(--space-2);
    bottom: calc(100% + 6px);
    transform: none;
    width: auto;
    max-width: none;
    text-align: center;
}

.translate-checks {
    list-style: none;
    padding: 0;
    margin: var(--space-6) auto 0;
    max-width: 40rem;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.translate-checks li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.translate-checks .ptip-text {
    left: 0;
    transform: none;
}

.translate-checks .aud-icon {
    width: 18px;
    height: 18px;
    margin-top: 0.15rem;
    color: var(--warning-text);
}

.language-filter-row {
    margin: 0 0 var(--space-4);
}

.language-filter {
    width: 100%;
    max-width: 20rem;
    min-height: var(--control-height, 2.5rem);
    padding: var(--space-2) var(--space-3);
    font: inherit;
    font-size: var(--text-md);
    color: var(--text-primary);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.language-filter:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 1px;
}

.language-none {
    color: var(--text-secondary);
}

/* Link to compare.php under the example (2026-10-29). */
.example-compare {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-3) var(--space-5);
    max-width: 52rem;
    margin: var(--space-8) auto 0;
    padding: var(--space-5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    text-align: center;
}

.example-compare p {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--text-base);
}

.example-compare p strong {
    color: var(--text-primary);
}

/* Showcase example (includes/partials/showcase_example.php, js/showcase.js,
   2026-11-01): tabs between real conversions, and two switches that pick one
   of four pictures of each Word view (handwriting highlighted or not, with
   formatting marks or not). Pictures not shown are display:none, so their
   lazy images never load until chosen. */
.showcase-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-6);
}

.showcase-tab {
    font: inherit;
    font-size: var(--text-md);
    font-weight: 500;
    min-height: 2.5rem;
    padding: 0 var(--space-4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
}

.showcase-tab[aria-selected="true"] {
    background: var(--brand-tint-subtle);
    border-color: var(--brand-primary);
    color: var(--brand-text);
    font-weight: 600;
}

.showcase-switches {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2) var(--space-3);
    margin-top: var(--space-4);
}

.showcase-switch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font: inherit;
    font-size: var(--text-md);
    font-weight: 500;
    min-height: 2.5rem;
    padding: 0 var(--space-4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
}

.showcase-switch[aria-pressed="true"] {
    background: var(--brand-tint-subtle);
    border-color: var(--brand-primary);
    color: var(--brand-text);
    font-weight: 600;
}

.showcase-tab:focus-visible,
.showcase-switch:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.showcase-hw-symbol {
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    border-radius: 2px;
    background: #ffeb3b;
    border: 1px solid #b59f00;
}

.showcase-marks-symbol {
    font-size: 1.125em;
    font-weight: 700;
    line-height: 1;
}

p.showcase-switch-note {
    display: block;
    margin: var(--space-2) auto 0;
    max-width: 40rem;
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.showcase-panel + .showcase-panel {
    margin-top: var(--space-10);
}

.showcase-panel-title {
    margin-top: var(--space-6);
    font-size: var(--text-lg);
    font-weight: 700;
    text-align: center;
}

.showcase.is-enhanced .showcase-panel-title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.showcase-caption {
    margin: var(--space-4) auto 0;
    text-align: center;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.showcase-kind {
    margin: var(--space-2) auto 0;
    text-align: center;
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.showcase.is-enhanced .showcase-panel + .showcase-panel {
    margin-top: 0;
}

/* Beats .example-figure img { display: block }. */
.showcase .example-figure .showcase-v {
    display: none;
}

.showcase:not(.show-hw):not(.show-marks) .example-figure .showcase-v-std-plain,
.showcase:not(.show-hw).show-marks .example-figure .showcase-v-std-marks,
.showcase.show-hw:not(.show-marks) .example-figure .showcase-v-hw-plain,
.showcase.show-hw.show-marks .example-figure .showcase-v-hw-marks {
    display: block;
}

.showcase .example-pair {
    margin-top: var(--space-5);
}

.showcase-compare-link {
    margin: var(--space-3) 0 0;
    text-align: center;
    font-size: var(--text-md);
}

/* How it works: three numbered steps in a row, no cards. */
.steps-list {
    list-style: none;
    margin: var(--space-6) 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
}

.steps-list li {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
}

.steps-list h3 {
    font-size: var(--text-lg);
    font-weight: 700;
}

.steps-list p {
    margin-top: var(--space-1);
    font-size: var(--text-base);
    line-height: 1.55;
    color: var(--text-secondary);
}

.step-number {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--brand-primary-glow);
    color: var(--brand-text);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 760px) {
    .steps-list,
    .example-notes,
    .guide-pair {
        grid-template-columns: 1fr;
    }

    .steps-list {
        gap: var(--space-4);
    }
}

@media (max-width: 480px) {
    .example-pair {
        gap: var(--space-3);
    }

    .example-figure figcaption {
        font-size: var(--text-md);
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

.pricing-grid {
    display: grid;
    gap: var(--space-4);
    margin-top: var(--space-5);
}

/* Pricing */
.pricing-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 238px));
    justify-content: center;
}

/* Pricing is split into "Pay as you go" and "Monthly plans" groups. */
.pricing-group-title {
    font-size: var(--text-lg);
    font-weight: 700;
    text-align: center;
    margin: var(--space-10) 0 0;
}

.pricing-group-sub {
    font-size: var(--text-base);
    color: var(--text-secondary);
    text-align: center;
    max-width: 38rem;
    margin: 0.35rem auto 0;
}

.pricing-group-sub + .pricing-grid {
    margin-top: var(--space-5);
}

.price-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
}

.price-card-featured {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 1px var(--brand-primary), var(--shadow-lg);
}

.price-badge {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--on-brand);
    background-color: var(--brand-primary);
    padding: 0.2rem var(--space-3);
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.price-name {
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--text-secondary);
}

.price-amount {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.price-detail {
    font-size: var(--text-base);
    color: var(--text-secondary);
}

.price-per-page {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--success-text);
}

.price-spacer {
    flex: 1;
    min-height: 0.75rem;
}

.pricing-footnote {
    text-align: center;
    font-size: var(--text-md);
    color: var(--text-secondary);
    margin-top: var(--space-5);
}

/* Complicated layouts (index.php #complex-layouts): one card per topic.
   A published guide's card is clickable as a whole through its heading
   link; an unpublished one is plain information. */
.topic-grid {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

.topic-card {
    position: relative;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.125rem var(--space-5);
}

.topic-card h3 {
    font-size: var(--text-lg);
    font-weight: 700;
}

.topic-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.topic-card h3 a::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
}

.topic-card h3 a:focus-visible {
    outline: none;
}

.topic-card h3 a:focus-visible::after {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.topic-card-linked:hover {
    border-color: var(--brand-primary);
}

.topic-card p {
    margin-top: 0.35rem;
    font-size: var(--text-base);
    line-height: 1.55;
    color: var(--text-secondary);
}

.topic-card-more {
    display: inline-block;
    margin-top: var(--space-2);
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--brand-text);
}

/* An unpublished guide's card: plain text, so it doesn't look like a link. */
.topic-card-soon {
    display: inline-block;
    margin-top: var(--space-2);
    font-size: var(--text-md);
    color: var(--text-muted);
}

/* Audience pages (includes/AudiencePage.php, 2026-10-31): three measured
   figures under the converter, and the small label over each worked example. */
.proof-figures {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
}

.proof-figures li {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.proof-figures strong {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.proof-figures span {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.proof-figures-note {
    margin-top: var(--space-3);
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.section-kicker {
    text-align: center;
    color: var(--brand-text);
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: var(--space-1);
}

@media (max-width: 760px) {
    .proof-figures {
        grid-template-columns: 1fr;
    }
}

/* Audience pages with hero buttons (legal-services, 2026-11-01): the
   converter moves to its own #try section further down, so the hero holds
   two buttons and a short note. */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.hero-note {
    margin-top: var(--space-3);
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.section-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

/* The structure proof: three measured figures, OrigaDoc's in brand colour,
   then the two Word files of one scan with formatting marks on. */
.evidence-figures {
    margin-top: var(--space-8);
}

.evidence-figures li.is-ours {
    border-color: var(--brand-tint-border);
    background-color: var(--brand-tint-faint);
}

.evidence-figures li.is-ours strong {
    color: var(--brand-text);
}

.evidence-pair {
    max-width: 46rem;
    margin-left: auto;
    margin-right: auto;
}

/* Kinds of documents: a short checklist in columns. */
.use-list,
.workflow-points {
    list-style: none;
    padding: 0;
    margin: 1.75rem auto 0;
    display: grid;
    gap: var(--space-3) var(--space-6);
}

.use-list {
    max-width: 52rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workflow-points {
    max-width: 40rem;
}

.use-list li,
.workflow-points li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--text-primary);
}

.use-list svg,
.workflow-points svg {
    flex: none;
    margin-top: 0.2rem;
    color: var(--brand-text);
}

/* Where documents go: one plain statement first, then the steps. */
.privacy-callout {
    max-width: 44rem;
    margin: 1.75rem auto 0;
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--brand-tint-border);
    border-left: 4px solid var(--brand-primary);
    border-radius: var(--radius-lg);
    background-color: var(--brand-tint-faint);
}

.privacy-callout h3 {
    font-size: var(--text-lg);
    font-weight: 700;
}

.privacy-callout p {
    margin-top: var(--space-1);
    color: var(--text-secondary);
    line-height: 1.55;
}

.app-container.is-landing .try-section .converter-card {
    margin-top: var(--space-6);
}

.cta-band-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
}

.cta-band-actions .btn {
    margin-top: 0;
}

.cta-band .btn.btn-cta-quiet {
    background-color: transparent;
    color: var(--on-brand);
    border: 1px solid currentColor;
}

.cta-band .btn.btn-cta-quiet:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 600px) {
    .use-list {
        grid-template-columns: 1fr;
    }

    .hero-actions .btn,
    .cta-band-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Three cards in a row (index.php benefits and use cases, 2026-10-29). */
.topic-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 760px) {
    .topic-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* "Why OrigaDoc" on the ad landing pages (includes/AdLandingPage.php):
   the home page's icons above each card's heading. */
.ad-point svg {
    display: block;
    color: var(--brand-text);
    margin-bottom: var(--space-2);
}

/* Ad landing pages, 2026-11-07: the free-account line under the converter
   (quiet, like .hero-follow) and the "Try 1 page free" buttons mid-page. */
.ad-signup-note {
    max-width: 44rem;
    margin: var(--space-4) auto 0;
    text-align: center;
    font-size: var(--text-md);
    line-height: 1.5;
    color: var(--text-secondary);
}

.ad-try-again {
    margin-top: var(--space-6);
    text-align: center;
}

@media (max-width: 600px) {
    .ad-try-again .btn {
        width: 100%;
        justify-content: center;
    }
}

/* The second one (after "Why OrigaDoc") only where the page is long. */
@media (min-width: 761px) {
    .ad-try-again-narrow {
        display: none;
    }
}

/* Under the converter on the home page (2026-10-29, homepage audit): the
   proof line and the hero's second link, both quiet next to the main button. */
.hero-follow {
    max-width: 44rem;
    margin: var(--space-4) auto 0;
    text-align: center;
    font-size: var(--text-md);
    line-height: 1.5;
    color: var(--text-secondary);
}

.hero-team {
    margin-top: var(--space-2);
    font-weight: 600;
}

.hero-team-note {
    font-weight: 400;
    color: var(--text-muted);
}

/* Published guides under the use-case cards (index.php #complex-layouts). */
.usecase-guides {
    margin-top: var(--space-4);
    text-align: center;
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.good-to-know {
    max-width: 880px;
    margin: 1.75rem auto 0;
}

.good-to-know-title {
    font-size: var(--text-base);
    font-weight: 700;
}

.good-to-know ul {
    margin: var(--space-2) 0 0;
    padding-left: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: var(--text-base);
    line-height: 1.55;
    color: var(--text-secondary);
}

.good-to-know strong {
    color: var(--text-primary);
}

@media (max-width: 640px) {
    .topic-grid {
        grid-template-columns: 1fr;
    }
}

/* Guides (public/guides/index.php): an article column with figures. */
.guide-page {
    max-width: 52rem;
    width: 100%;
    margin: 0 auto;
    padding: 1.75rem var(--space-5) 3.5rem;
}

/* Breadcrumbs (PageChrome::breadcrumbs(); were guide-only until 2026-10-29). */
.breadcrumb {
    margin-bottom: var(--space-4);
}

.breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.breadcrumb li + li::before {
    content: '\203A';
    margin-right: 0.35rem;
}

.breadcrumb a,
.guide-article a:not(.btn),
.guide-list a {
    color: var(--brand-text);
    text-underline-offset: 0.15em;
}

.guide-list h2 a {
    text-decoration: none;
}

.guide-list h2 a:hover {
    text-decoration: underline;
}

.guide-header {
    margin-top: var(--space-4);
}

.guide-title {
    font-size: clamp(1.75rem, 4vw, 2.375rem);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.guide-dates {
    margin-top: var(--space-2);
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.guide-lead {
    margin-top: var(--space-5);
    font-size: var(--text-lg);
    line-height: 1.6;
    color: var(--text-secondary);
}

.guide-article h2,
.guide-list h2 {
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    margin-top: 2.25rem;
}

.guide-article h3 {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-top: 1.75rem;
}

.guide-article p,
.guide-article li {
    font-size: var(--text-base);
    line-height: 1.65;
}

.guide-article > p,
.guide-article ul {
    margin-top: var(--space-3);
}

.guide-article ul {
    padding-left: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.guide-checklist li::marker {
    color: var(--success-text);
}

.guide-checklist-fix li::marker {
    color: var(--warning-text);
}

.guide-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.guide-figure {
    margin: var(--space-4) 0 0;
}

.guide-figure img {
    display: block;
    width: 100%;
    height: auto;
    background-color: var(--surface-paper);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.guide-pair .guide-figure {
    margin-top: 0;
}

.guide-figure figcaption {
    margin-top: var(--space-2);
    font-size: var(--text-md);
    color: var(--text-secondary);
    text-align: center;
}

.guide-downloads {
    margin-top: var(--space-8);
    padding: var(--space-4) var(--space-5);
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--text-md);
}

.guide-downloads-note {
    display: block;
    margin-top: var(--space-1);
    font-size: var(--text-md);
    color: var(--text-secondary);
}

/* How public pages end (PageChrome::pageEnding(), 2026-10-29): two related
   links, then the call-to-action band. */
.page-related {
    margin-top: 3.5rem;
}

.page-related-title {
    font-size: var(--text-lg);
    font-weight: 600;
}

.page-related .topic-grid {
    margin-top: var(--space-4);
}

.page-related + .cta-band {
    margin-top: var(--space-8);
}

.guide-list {
    list-style: none;
    margin: var(--space-4) 0 0;
    padding: 0;
}

.guide-list li {
    padding: var(--space-5) 0;
    border-bottom: 1px solid var(--border-color);
}

.guide-list h2 {
    margin-top: 0;
    font-size: var(--text-xl);
}

.guide-list p {
    margin-top: 0.35rem;
    color: var(--text-secondary);
}

.guide-draft-banner {
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border: 2px dashed var(--color-warning);
    border-radius: var(--radius-md);
    color: var(--warning-text);
    font-size: var(--text-md);
}

@media (max-width: 480px) {
    .guide-pair {
        gap: 0.625rem;
    }

    .guide-figure figcaption {
        font-size: var(--text-sm);
    }
}

/* The free trial, apart from the paid choices. */
.free-trial-band {
    margin: 1.75rem auto 0;
    max-width: 880px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4) var(--space-6);
    flex-wrap: wrap;
    padding: 1.125rem var(--space-6);
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}


.free-trial-title {
    font-size: var(--text-lg);
    font-weight: 700;
}

.free-trial-band .price-chips {
    flex: 1 1 18rem;
    min-width: 0;
    justify-content: center;
}

.free-trial-band .price-chips li {
    white-space: nowrap;
}

.pricing-more-link {
    text-align: center;
    margin-top: var(--space-3);
}

/* Page packs / Monthly plans switch (js/landing.js). Without JavaScript
   the tab bar stays hidden and both groups show with their headings. */
.pricing-switch {
    margin-top: var(--space-8);
}

.pricing-tabs {
    display: flex;
    justify-content: center;
    width: fit-content;
    margin: 0 auto;
    padding: var(--space-1);
    gap: var(--space-1);
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
}

.pricing-tabs[hidden] {
    display: none;
}

.pricing-tabs-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
}

.pricing-tabs-row .pricing-tabs {
    margin: 0;
}

.pricing-currency {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin: 0;
}

.pricing-tabs button {
    font: inherit;
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: 0;
    border-radius: var(--radius-full);
    padding: var(--space-2) 1.125rem;
    min-height: 2.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.25;
}

.pricing-tab-sub {
    font-size: var(--text-xs);
    font-weight: 400;
    color: var(--text-muted);
}

.pricing-tabs button:hover {
    color: var(--text-primary);
}

.pricing-tabs button[aria-selected="true"] {
    color: var(--text-primary);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.pricing-tabs button:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.pricing-panel[hidden] {
    display: none;
}

/* With the tabs showing, each group's heading would repeat the tab name. */
.pricing-switch.is-switchable .pricing-group-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.pricing-switch.is-switchable .pricing-group-sub {
    margin-top: var(--space-4);
}

.compare-details {
    max-width: 880px;
    margin: 1.75rem auto 0;
}

.compare-details > summary {
    width: fit-content;
    margin: 0 auto;
    cursor: pointer;
    font-weight: 600;
    color: var(--brand-text);
    padding: var(--space-2) var(--space-1);
}

.compare-details[open] > summary {
    margin-bottom: var(--space-3);
}

/* FAQ */
.faq-list {
    max-width: 46rem;
    margin: var(--space-8) auto 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.faq-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-base);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
}

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

.faq-item summary::after {
    content: '+';
    font-size: var(--text-xl);
    line-height: 1;
    color: var(--text-secondary);
}

.faq-item[open] summary::after {
    content: '\2212';
}

.faq-item p {
    padding: 0 var(--space-5) 1.1rem;
    font-size: var(--text-base);
    color: var(--text-secondary);
    line-height: 1.6;
}

.cta-band {
    margin-top: 3.5rem;
    padding: var(--space-10) var(--space-6);
    border-radius: var(--radius-lg);
    text-align: center;
    background: var(--brand-gradient);
    color: var(--on-brand);
}

.cta-band h2 {
    font-size: clamp(1.5rem, 3.2vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.cta-band p {
    margin-top: var(--space-2);
    font-size: var(--text-lg);
    opacity: 0.92;
}

.cta-band .btn {
    margin-top: var(--space-5);
    background-color: var(--on-brand-button-bg);
    color: var(--on-brand-button-text);
}

.cta-band .btn:hover {
    background-color: var(--on-brand-button-bg-hover);
}

/* Wider container on the landing page so sections can breathe; the
   converter card itself stays at its own comfortable width. */
.app-container.is-landing {
    max-width: 1040px;
}

.app-container.is-landing .converter-card {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
}

/* =========================================================================
   Legal / content pages
   ========================================================================= */

.prose-page {
    max-width: 46rem;
    width: 100%;
    margin: 0 auto;
    padding: var(--space-10) var(--space-5) 3.5rem;
}

.prose-page h1 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.025em;
}

.prose-updated {
    margin-top: var(--space-2);
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.prose-page h2 {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-top: var(--space-8);
}

.prose-page p,
.prose-page li {
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--text-secondary);
}

.prose-page p {
    margin-top: var(--space-3);
}

.prose-page ul {
    margin: var(--space-3) 0 0 var(--space-5);
}

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

.prose-page strong {
    color: var(--text-primary);
}

/* Text links only: a button keeps its own colours (2026-11-02 audit: the
   Contact page's buttons were teal on teal). */
.prose-page a:not(.btn) {
    color: var(--brand-text);
    font-weight: 600;
}

/* The breadcrumb looks the same as on every other page: the reading-page
   list rules (bigger text, space between items) don't apply to it. */
.prose-page .breadcrumb li {
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    margin-top: 0;
}

.prose-page .breadcrumb a {
    font-weight: inherit;
}

/* Headings receive focus programmatically when a step appears (app.js
   showSection); the focus move is for screen readers, not a visible ring. */
h2[tabindex="-1"]:focus,
[role="heading"][tabindex="-1"]:focus {
    outline: none;
}

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

    .spinner {
        animation-duration: 2.5s;
    }

    .btn-primary:hover:not(:disabled),
    .drop-zone.drag-over {
        transform: none;
    }
}

/* ---- SaaS UX pass (2026-10-18) ---- */

/* Plan comparison table (Pricing::comparisonTable()). Scrolls inside its
   own box on narrow screens, so the page itself never scrolls sideways. */
.table-scroll {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
}

.table-scroll:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.compare-table {
    min-width: 560px;
}

/* Row labels wrap inside a fixed-width column and stay pinned while the
   plans scroll sideways on narrow screens (2026-11-08). */
.compare-table tbody th,
.compare-table thead td {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 11rem;
    min-width: 8rem;
    border-right: 1px solid var(--border-color);
}

.compare-table tbody th {
    background-color: var(--bg-card);
}

.compare-table td {
    min-width: 7rem;
}

.compare-nowrap {
    white-space: nowrap;
}

.compare-note {
    display: block;
    margin-top: 0.15rem;
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--text-muted);
}

.compare-table th,
.compare-table td {
    padding: 0.65rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.compare-table tbody th {
    color: var(--text-secondary);
    font-weight: 600;
}

.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td {
    border-bottom: 0;
}

/* First-visit tip on the page picker */
.page-select-hint {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin: var(--space-3) 0;
    padding: 0.65rem 0.9rem;
    font-size: var(--text-md);
    color: var(--text-primary);
    background-color: var(--accent-teal-bg);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-teal);
    border-radius: var(--radius-md);
    text-align: left;
}

.page-select-hint p {
    margin: 0;
}

.page-select-hint .btn {
    flex-shrink: 0;
}

/* "Did this come out right?" under a result */
.result-feedback {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-color);
}

.result-feedback-ask {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.result-feedback-question {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: var(--space-1);
}

.result-feedback-more {
    display: grid;
    gap: var(--space-2);
    max-width: 36rem;
}

.result-feedback-more .btn {
    justify-self: start;
}

.result-feedback-note {
    width: 100%;
    resize: vertical;
    font: inherit;
}

.result-feedback-status {
    margin: 0 0 var(--space-2);
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.result-feedback-status:empty {
    display: none;
}

/* Phone-width check (2026-10-18). */
.page-select-hint {
    flex-wrap: wrap;
}

.page-select-hint p {
    flex: 1 1 14rem;
}

@media (max-width: 640px) {
    /* The picker sits inside the converter card, which already has its
       own padding: don't pad it twice on a phone. */
    .page-select-card {
        padding: var(--space-5) 0;
    }

    /* "Did this come out right?" on its own line, Yes / No together below. */
    .result-feedback-question {
        flex-basis: 100%;
    }

    .advanced-options-summary-hint {
        display: none;
    }

    /* A button holding an email address may need to wrap on small phones. */
    .prose-page .btn {
        white-space: normal;
        overflow-wrap: anywhere;
        max-width: 100%;
    }
}

/* ===================================================================
   Signed-in app header and compact footer (2026-10-19,
   includes/PageChrome.php, js/nav.js):
   Logo | Convert | Dashboard ........ Workspace v | N pages left | Avatar v
   =================================================================== */

.site-header-app .site-header-inner {
    gap: var(--space-4);
}

.app-nav-toggle {
    display: none;
}

.app-primary-nav {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.app-nav-link {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.45rem var(--space-3);
    border-radius: var(--radius-sm);
}

.app-nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-card-subtle);
}

/* Active destination: a tinted background (not colour alone: also bold). */
.app-nav-link[aria-current="page"] {
    color: var(--brand-text);
    font-weight: 600;
    background-color: color-mix(in srgb, var(--brand-primary) 12%, transparent);
}

.app-header-tools {
    position: relative;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.app-menu {
    position: relative;
    min-width: 0;
}

.app-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    min-height: 2.25rem;
    font: inherit;
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 0.3rem var(--space-3);
    cursor: pointer;
}

.app-menu-button:hover,
.app-menu-button[aria-expanded="true"] {
    background-color: var(--bg-card-subtle);
}

/* "You're in this area" (account pages for the avatar, the team page for
   the workspace): the same tinted background as the active nav link, not
   a ring that reads like a stuck focus outline (UI audit 2026-11-04).
   Focus stays the global 2px outline. */
.app-menu-button[data-current="true"] {
    background-color: color-mix(in srgb, var(--brand-primary) 12%, transparent);
}

.app-icon {
    flex-shrink: 0;
}

.app-icon-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
    transition: transform var(--transition-fast);
}

.app-menu-button[aria-expanded="true"] .app-icon-chevron {
    transform: rotate(180deg);
}

.app-workspace-button {
    /* Never wider than its menu, which shrinks when the header is
       crowded (a plain 16rem overrode .app-menu-button's 100% and let a
       long workspace name spill past the edge at ~780 px). */
    max-width: min(16rem, 100%);
    font-weight: 500;
    border-color: transparent;
}

.app-workspace-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The page balance (PageChrome::balanceStatus()): plain text, not a
   control. When it is low, buyers get a small "Add pages" link beside it. */
.app-balance-status {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-2);
    white-space: nowrap;
}

.app-balance-text {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.app-balance-add {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--brand-text);
    text-decoration: underline;
}

.app-balance-add[hidden] {
    display: none;
}

.app-avatar-button {
    padding: 0.15rem var(--space-2) 0.15rem 0.15rem;
    border-color: transparent;
}

.app-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: var(--avatar-bg);
    color: var(--avatar-text);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.app-avatar-lg {
    width: 2.5rem;
    height: 2.5rem;
    font-size: var(--text-md);
}

/* Dropdown panels */
.app-menu-panel {
    position: absolute;
    top: calc(100% + 0.4rem);
    z-index: var(--z-dropdown);
    min-width: 15rem;
    max-width: min(20rem, calc(100vw - 2rem));
    padding: 0.35rem;
    text-align: left;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.app-menu-panel[hidden] {
    display: none;
}

.app-menu-panel-start {
    left: 0;
}

.app-menu-panel-end {
    right: 0;
}

.app-menu-up .app-menu-panel {
    top: auto;
    bottom: calc(100% + 0.4rem);
}

.app-menu-heading {
    margin: 0;
    padding: 0.45rem 0.7rem 0.2rem;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-muted);
}

.app-menu-form {
    margin: 0;
}

.app-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    width: 100%;
    min-height: 2.5rem;
    padding: var(--space-2) 0.7rem;
    font: inherit;
    font-size: var(--text-md);
    color: var(--text-primary);
    text-align: left;
    text-decoration: none;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.app-menu-item:hover:not(:disabled),
.app-menu-item:focus-visible {
    background-color: var(--bg-card-subtle);
}

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

.app-menu-item-current {
    cursor: default;
}

.app-menu-item-current:hover {
    background: none;
}

.app-menu-item-current .app-icon-check {
    color: var(--brand-text);
}

.app-menu-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-menu-item-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.app-menu-item-hint {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.app-menu-separator {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 0.35rem 0;
}

.app-menu-note {
    margin: 0;
    padding: 0.45rem 0.7rem;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.app-menu-identity {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.7rem;
}

.app-menu-identity-email {
    min-width: 0;
    font-size: var(--text-md);
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.app-menu-theme {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem var(--space-2);
}

.app-menu-theme-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.theme-switch-compact {
    display: flex;
}

.theme-switch-compact[hidden] {
    display: none;
}

.theme-switch-compact button {
    flex: 1;
}

/* Sign out: a neutral item, kept apart at the bottom by its separator
   (was red, which read as a warning). */
.app-menu-signout {
    color: var(--text-secondary);
}

.app-menu-signout:hover,
.app-menu-signout:focus-visible {
    color: var(--text-primary);
}

/* Compact footer on signed-in pages: after the content (body is a flex
   column and the footer has margin-top: auto, so on short pages it sits
   at the bottom of the window without covering anything). */
.site-footer-compact {
    padding: 0.9rem var(--space-5);
    background-color: transparent;
}

.site-footer-compact-inner {
    max-width: calc(1120px - 2 * var(--space-5));
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-1) var(--space-6);
}

.site-footer-compact-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1) 0.6rem;
}

.site-footer-compact-links > :not(:first-child)::before {
    content: "\00B7";
    margin-right: 0.6rem;
    color: var(--text-muted);
}

.site-footer-compact-link,
.site-footer-compact .app-menu-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: 2.25rem;
    padding: var(--space-1) 0.15rem;
    font: inherit;
    font-size: var(--text-md);
    font-weight: 400;
    color: var(--text-secondary);
    text-decoration: none;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
}

.site-footer-compact-link:hover,
.site-footer-compact .app-menu-button:hover,
.site-footer-compact .app-menu-button[aria-expanded="true"] {
    color: var(--text-primary);
    background: none;
    text-decoration: underline;
}

.site-footer-compact .app-menu {
    display: inline-flex;
    align-items: center;
}

/* Tablets and phones: the two destinations fold behind "Menu"; the
   workspace, balance and account controls stay visible. Not sticky here,
   so the header never covers the page. */
@media (max-width: 760px) {
    .site-header-app {
        position: relative;
    }

    .site-header-app .site-header-inner {
        flex-wrap: wrap;
        row-gap: var(--space-2);
    }

    .site-header-app .site-brand {
        order: 1;
    }

    .app-nav-toggle {
        order: 2;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        min-height: 2.5rem;
        font: inherit;
        font-size: var(--text-md);
        font-weight: 600;
        color: var(--text-primary);
        background: none;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-full);
        padding: 0.3rem 0.8rem;
        cursor: pointer;
    }

    .app-nav-toggle[aria-expanded="true"] {
        background-color: var(--bg-card-subtle);
    }

    .app-header-tools {
        order: 3;
    }

    .app-primary-nav {
        order: 4;
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        padding: var(--space-1) 0 0.35rem;
        border-top: 1px solid var(--border-color);
    }

    .app-primary-nav.is-open {
        display: flex;
    }

    .app-nav-link {
        padding: 0.7rem var(--space-3);
    }

    .app-menu-button {
        min-height: 2.5rem;
    }

    /* Touch-sized target for the contextual Add pages link. */
    .app-balance-add {
        display: inline-flex;
        align-items: center;
        min-height: 2.5rem;
    }
}

/* Phones and tablets (UI audit 2026-11-04): one header row. The workspace
   switcher lives in the avatar menu (PageChrome::accountMenu(),
   .app-menu-workspaces); at 600 px and narrower the balance does too
   (.app-menu-balance), since logo, Menu, balance and avatar don't fit one
   row at 360 px. Desktop keeps the separate controls. */
.app-menu-phone {
    display: none;
}

.app-menu-balance {
    display: none;
    margin: 0;
    padding: 0.45rem 0.7rem;
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
}

@media (max-width: 760px) {
    .app-header-tools > .app-workspace-menu {
        display: none;
    }

    .app-menu-phone {
        display: block;
    }
}

@media (max-width: 600px) {
    .app-nav-toggle {
        margin-left: auto;
    }

    .app-header-tools {
        margin-left: 0;
    }

    .app-header-tools > .app-balance-status {
        display: none;
    }

    .app-menu-balance {
        display: block;
    }

    .app-header-tools > .app-menu:last-child {
        flex-shrink: 0;
    }

    .app-menu-panel {
        min-width: min(15rem, calc(100vw - 2rem));
    }
}

/* Very narrow phones. */
@media (max-width: 380px) {
    .app-header-tools {
        gap: var(--space-1);
    }

    .app-avatar-button .app-icon-chevron {
        display: none;
    }

    .app-avatar-button {
        padding-right: 0.15rem;
    }
}

/* ===== Several files (2026-10-20): the upload step's list and the queue
   step (index.php #file-list-card, #queue-section; js/app.js). ===== */
.file-list-card {
    margin-top: var(--space-5);
    padding: var(--space-3) var(--space-4);
}

.file-list-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.file-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0.375rem 0;
    border-top: 1px solid var(--border-color);
}

.file-list-item:first-child {
    border-top: 0;
}

.file-list-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.file-list-name,
.queue-item-name {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-card {
    padding: var(--space-6) var(--space-1) var(--space-2);
}

.queue-head {
    margin-bottom: var(--space-4);
}

.queue-desc {
    margin-top: 0.375rem;
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.queue-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

/* File | Pages | Status | Actions */
.queue-item {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.1fr) auto;
    align-items: center;
    gap: var(--space-3) var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border-color);
}

.queue-item:first-child {
    border-top: 0;
}

.queue-item-file {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.queue-item-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.queue-item-detail,
.queue-item-hint,
.queue-status-note {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.queue-item-pages {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: var(--space-1) var(--space-2);
    min-width: 0;
}

.queue-item-pages .page-range-input {
    max-width: none;
    width: 100%;
    min-width: 0;
    font-size: var(--text-md);
    padding: 0.375rem 0.625rem;
}

.queue-item-pages .page-range-input:disabled {
    background-color: var(--bg-card-subtle);
    color: var(--text-secondary);
}

.queue-item-hint {
    grid-column: 2;
}

.queue-item-status {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.queue-status-text {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
}

.queue-item[data-state="done"] .queue-status-text {
    color: var(--success-text);
}

.queue-item[data-state="invalid"] .queue-status-text,
.queue-item[data-state="failed"] .queue-status-text {
    color: var(--error-text);
}

.queue-item[data-state="stalled"] .queue-status-text {
    color: var(--warning-text);
}

.queue-item[data-state="skipped"] .queue-status-text,
.queue-item[data-state="waiting"] .queue-status-text,
.queue-item[data-state="held"] .queue-status-text,
.queue-item[data-state="queued"] .queue-status-text {
    color: var(--text-secondary);
    font-weight: 500;
}

.queue-item[data-state="converting"],
.queue-item[data-state="sending"] {
    background-color: var(--bg-card-subtle);
}

.queue-item-actions {
    display: flex;
    gap: var(--space-1);
    justify-content: flex-end;
    white-space: nowrap;
}

.queue-totals {
    margin-top: var(--space-4);
}

.queue-progress {
    margin-top: var(--space-3);
    font-size: var(--text-md);
    color: var(--text-primary);
}

#queue-section .page-select-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* A refused file has no pages to choose. */
.queue-item[data-state="invalid"] .queue-item-pages {
    visibility: hidden;
}

/* Phones and narrow cards: each file becomes a small card, stacked so
   the file name keeps the full width: file, pages, status, buttons. */
@media (max-width: 760px) {
    .queue-item {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-2);
    }

    .queue-item[data-state="invalid"] .queue-item-pages {
        display: none;
    }

    .queue-item-actions {
        justify-content: flex-start;
    }

    .queue-item-actions:not(:has(.btn:not(.hidden))) {
        display: none;
    }
}

/* Crowded desktop header (three links + a long workspace name, ~760-1000
   px): links and the avatar keep their size; the workspace name is the
   part that shrinks (and truncates). */
.app-primary-nav {
    flex-shrink: 0;
}

.app-nav-link {
    white-space: nowrap;
}

.app-header-tools > .app-workspace-menu {
    flex: 0 1 auto;
    min-width: 2.5rem;
}

.app-header-tools > .app-balance-status,
.app-header-tools > .app-menu:last-child {
    flex-shrink: 0;
}

/* Wider signed-in pages on desktop (user request 2026-10-20). The
   Dashboard-style pages (account.css .dashboard-page) now line up with the
   header's content (1120 px, 1.25rem sides); the converter grows by the
   same 160 px. Reading pages (.prose-page) keep their narrower measure.
   2026-10-23: the converter (signed in, and the landing page) now uses the
   header's own box too -- 1120 px with 1.25rem sides -- so every page's
   content edge lines up with the logo and the avatar (it was 1040 px with
   1rem sides, 36 px inside the header on each side). */
.app-container:not(.is-landing),
.app-container.is-landing {
    max-width: 1120px;
    padding-left: var(--space-5);
    padding-right: var(--space-5);
}

@media (max-width: 760px) {
    .app-container:not(.is-landing),
    .app-container.is-landing {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
}

/* Enterprise (Pricing::enterpriseCard()): priced by sales, so a quieter
   card next to the self-serve plans. */
.price-card-enterprise {
    background-color: var(--bg-card-subtle);
}

.price-amount-custom {
    font-size: var(--text-2xl);
}

/* Convert: the required project picker (2026-10-20, index.php #project-picker). */
.project-picker {
    margin: 0 0 var(--space-4);
    display: grid;
    gap: 0.375rem;
}

.project-picker[hidden] {
    display: none;
}

.project-picker-label {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
}

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

.project-select {
    flex: 1 1 16rem;
    max-width: 28rem;
    min-width: 0;
}

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

.project-new[hidden] {
    display: none;
}

.project-new .account-input {
    flex: 1 1 14rem;
    max-width: 28rem;
    min-width: 0;
}

.project-picker-hint,
.queue-project,
.conversion-summary-project {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.queue-project {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

/* Converting without a project (the global converter): the compact picker
   comes first and the upload waits for it. */
.project-picker .project-picker-row .project-picker-label {
    flex: 0 0 auto;
}

.drop-zone.is-waiting-project {
    opacity: 0.6;
    cursor: not-allowed;
}

.drop-zone.is-waiting-project .drop-choose-btn:disabled {
    cursor: not-allowed;
}

.processing-leave {
    margin-top: var(--space-3);
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.processing-leave.hidden,
#result-project-link.hidden {
    display: none;
}

.result-ready-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

@media (max-width: 640px) {
    .result-ready-actions {
        width: 100%;
    }

    .result-ready-actions > .btn {
        flex: 1 1 auto;
    }
}

/* The converter embedded in a project page (2026-10-21). */
.project-work {
    margin-bottom: var(--space-8);
}

.project-work .converter-card {
    margin: 0;
}

.project-work .flow-steps {
    justify-content: flex-start;
}

/* Tab panels (Convert | Translate, js/translate.js). */
[role="tabpanel"][hidden] {
    display: none;
}

/* Translate mode (2026-10-21 redesign): upload progress and files that need converting first. */
.translate-uploads {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-1);
    font-size: var(--text-md);
}

.translate-uploads:empty {
    display: none;
}

.translate-upload-ok { color: var(--success-text); }
.translate-upload-error { color: var(--error-text); }

/* What the Translate tab is doing now (js/translate.js setStatus()). */
.translate-status {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--brand-tint-subtle, var(--bg-card-subtle));
    font-size: var(--text-md);
    color: var(--text-primary);
}

.translate-status[hidden] {
    display: none;
}

.translate-status[data-kind="error"] {
    background-color: var(--bg-card-subtle);
    color: var(--error-text);
}

.translate-status-spinner {
    display: none;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 2.5px solid var(--border-color);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

.translate-status.is-busy .translate-status-spinner {
    display: block;
}

.translate-status-body {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    gap: var(--space-2);
}

.translate-status-text {
    margin: 0;
    overflow-wrap: anywhere;
}

.translate-status-text .link-like {
    margin-left: var(--space-1);
}

.translate-status-progress {
    width: 100%;
    max-width: 28rem;
    height: 6px;
    border: 0;
    border-radius: var(--radius-full);
    background-color: var(--border-color);
    accent-color: var(--brand-primary);
    appearance: none;
}

.translate-status-progress[hidden] {
    display: none;
}

.translate-status-progress::-webkit-progress-bar {
    background-color: var(--border-color);
    border-radius: var(--radius-full);
}

.translate-status-progress::-webkit-progress-value {
    background-color: var(--brand-primary);
    border-radius: var(--radius-full);
}

.translate-status-progress::-moz-progress-bar {
    background-color: var(--brand-primary);
    border-radius: var(--radius-full);
}

@media (prefers-reduced-motion: reduce) {
    .translate-status-spinner {
        animation-duration: 2.5s;
    }
}

/* Conversion settings (2026-10-21): one container, three compact rows with
   subtle dividers; title and description on the left, the switch on the
   right. Descriptions wrap on narrow screens; the switch never shrinks. */
.conversion-settings-list {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
}

.toggle-control.setting-row {
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
}

.setting-row + .setting-row {
    border-top: 1px solid var(--border-color);
}

.setting-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1 1 auto;
    min-width: 0;
}

.setting-title {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--text-primary);
}

.setting-desc {
    font-size: var(--text-sm);
    line-height: 1.45;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

/* The settings list (.conversion-settings-list) is the one container: the disclosure around it has no
   frame of its own (the result screen's layout options keep theirs). */
#conversion-settings {
    border: 0;
    background: none;
}

#conversion-settings > summary {
    padding: var(--space-2) 0;
}

#conversion-settings .advanced-options-body {
    padding: 0;
}

.setting-row .toggle-switch {
    margin-top: 0;
}

/* A sub-setting (2026-10-26): no divider from its parent, indented with a
   short guide line, greyed out while unavailable (same text either way). */
.setting-row + .setting-row.setting-row-sub {
    border-top: 0;
    padding-top: 0;
}

.setting-row-sub .setting-text {
    padding-left: var(--space-4);
    border-left: 2px solid var(--border-color);
}

.setting-row-sub:has(input:disabled) .setting-title,
.setting-row-sub:has(input:disabled) .setting-desc {
    color: var(--text-muted);
}

/* Project page: the settings in a pop-up (2026-10-26), wider than a
   confirmation so the descriptions don't wrap word by word. */
.confirm-dialog.settings-dialog {
    width: min(34rem, calc(100vw - 2rem));
}

.settings-dialog .confirm-dialog-message {
    margin-bottom: var(--space-4);
}

.settings-dialog .conversion-settings-list {
    margin-bottom: var(--space-5);
}

.setting-row input:disabled ~ .toggle-switch {
    opacity: 0.55;
}

.setting-row:has(input:disabled) {
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .toggle-control.setting-row {
        gap: var(--space-3);
        padding: var(--space-3);
        min-height: var(--control-h-touch);
    }
}

/* Google Analytics cookie choice (js/analytics.js; only where analytics is on). */
.site-footer-link-button {
    padding: 0;
    font: inherit;
    font-size: var(--text-md);
    color: var(--text-secondary);
    text-align: left;
    background: none;
    border: 0;
    cursor: pointer;
}

.site-footer-link-button:hover {
    color: var(--brand-text);
    text-decoration: underline;
}

.analytics-settings-button {
    cursor: pointer;
}

.analytics-banner {
    position: fixed;
    right: var(--space-4);
    bottom: var(--space-4);
    left: var(--space-4);
    z-index: var(--z-dialog);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-4);
    align-items: center;
    justify-content: space-between;
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-4);
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-lg);
}

.analytics-banner-text {
    flex: 1 1 22rem;
    margin: 0;
    font-size: var(--text-md);
    line-height: 1.5;
}

.analytics-banner-text a {
    color: var(--brand-text);
}

.analytics-banner-actions {
    display: flex;
    gap: var(--space-2);
}

@media (max-width: 640px) {
    .analytics-banner {
        right: 16px;
        bottom: 16px;
        left: 16px;
    }

    .site-footer-link-button {
        padding: 0.55rem 0;
    }

    .analytics-banner-actions,
    .analytics-banner-actions .btn {
        flex: 1 1 0;
    }

    .analytics-banner-actions .btn {
        min-height: 44px;
    }
}


/* Landing page on phones (2026-10-27): the example's close-ups and notes and
   "Good to know" fold (details[data-open-wide], open on wider screens by
   js/landing.js); pricing cards become compact rows; sections sit closer. */
/* One fold-out marker everywhere on the public pages: "+" closed, "−" open,
   as in the FAQ (2026-10-27; "Compare all features" had the browser's arrow). */
.example-more-summary,
.good-to-know > summary,
.compare-details > summary {
    cursor: pointer;
    list-style: none;
}

.example-more-summary::-webkit-details-marker,
.good-to-know > summary::-webkit-details-marker,
.compare-details > summary::-webkit-details-marker {
    display: none;
}

.compare-details > summary::after {
    content: ' +';
}

.compare-details[open] > summary::after {
    content: ' \2212';
}

/* Touch-sized fold-out lines on phones (44 px). */
@media (max-width: 760px) {
    .example-more > .example-more-summary,
    .good-to-know > summary {
        display: flex;
        align-items: center;
        min-height: 44px;
        gap: 0.3em;
    }

    .compare-details > summary {
        min-height: 44px;
        display: flex;
        align-items: center;
        gap: 0.3em;
    }
}

.example-more-summary {
    display: block;
    width: fit-content;
    margin: var(--space-6) auto 0;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--brand-text);
}

.example-more-summary::after,
.good-to-know > summary::after {
    content: ' +';
}

.example-more[open] > .example-more-summary::after,
.good-to-know[open] > summary::after {
    content: ' \2212';
}

/* Wider screens: open, so the summary line isn't needed (only for the ones
   js/landing.js opens there; a folded example keeps its line, 2026-11-03). */
@media (min-width: 761px) {
    .example-more[data-open-wide] > .example-more-summary {
        display: none;
    }
}

@media (max-width: 760px) {
    .landing-section {
        padding-top: var(--space-10);
    }

    .example-subtitle {
        margin-top: var(--space-5);
    }

    .example-notes {
        margin-top: var(--space-5);
        gap: var(--space-4);
    }

    .good-to-know {
        padding: var(--space-3) var(--space-4);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        background-color: var(--bg-card);
    }

    .topic-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .topic-card {
        padding: var(--space-4);
    }

    .topic-card p {
        font-size: var(--text-md);
    }

    .steps-list p {
        font-size: var(--text-md);
    }
}

@media (max-width: 480px) {
    /* A price card as one row: what you get on the left, the button on the right. */
    .price-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: var(--space-3);
        row-gap: 0.15rem;
        padding: var(--space-4);
    }

    .price-card > * {
        grid-column: 1;
    }

    .price-card > .btn {
        grid-column: 2;
        grid-row: 1 / span 6;
        align-self: center;
    }

    .price-card > .price-spacer {
        display: none;
    }

    .price-amount {
        font-size: var(--text-2xl);
    }

    .price-badge {
        position: static;
        transform: none;
        justify-self: start;
        margin-bottom: var(--space-1);
        font-size: var(--text-xs);
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .pricing-group-title {
        margin-top: var(--space-6);
    }
}

@media (max-width: 760px) {
    /* FAQ: one joined list instead of separate cards. */
    .faq-list {
        gap: 0;
    }

    .faq-item {
        border-radius: 0;
    }

    .faq-item + .faq-item {
        border-top: 0;
    }

    .faq-item:first-child {
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

    .faq-item:last-child {
        border-radius: 0 0 var(--radius-md) var(--radius-md);
    }

    .faq-item summary {
        min-height: var(--control-h-touch);
        align-items: center;
        padding: var(--space-3) var(--space-4);
    }
}

@media (max-width: 760px) {
    .section-sub {
        font-size: var(--text-base);
    }
}

/* ------------------------------------------------------------------------
   Shared with account.css (2026-10-27). The public pages (landing, guides,
   legal pages) skip account.css while signed out (PageChrome::headLinks
   'account_styles' => false), so the few account.css rules they use are
   repeated here, last, where they cascade exactly as when account.css came
   after app.css. Signed-in pages load both copies; keep them identical.
   ------------------------------------------------------------------------ */
body {
    margin: 0;
}

.account-link {
    color: var(--brand-text);
    text-decoration: none;
    font-weight: 600;
}

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

.compare-details {
    margin-top: var(--space-4);
}

.compare-details > summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--brand-text);
    font-size: var(--text-base);
}

.compare-details .table-scroll {
    margin-top: var(--space-3);
}

@media (max-width: 640px) {
    .compare-details > summary {
        padding: var(--space-2) 0;
    }
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
}

@media print {
    .site-header,
    .site-footer,
    .skip-link,
    .no-print {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
        border: none !important;
        min-height: 0 !important;
        padding: 0 !important;
    }
}

/* "Highlight handwritten text" setting (2026-10-28, includes/HandwritingSetting.php,
   js/handwriting.js): text left, then the colour swatch (only while on) and the
   switch; the swatch opens the colour list underneath. Swatches are Word's
   highlight colours (turquoise is kept for flagged words). */
.handwriting-setting.setting-row {
    padding: var(--space-3) var(--space-4);
}

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

.handwriting-text {
    cursor: pointer;
}

.handwriting-switch {
    flex: none;
}

.hl-swatch-button {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex: none;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
}

.hl-swatch-button:hover {
    border-color: var(--text-muted);
}

.hl-swatch-button:focus-visible,
.hl-option:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

.hl-swatch-button[hidden] {
    display: none;
}

.is-palette-open .hl-swatch-chevron {
    transform: rotate(180deg);
}

.hl-swatch {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    flex: none;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: var(--radius-sm);
}

.hl-picker {
    position: relative;
    flex: none;
}

.hl-picker[hidden] {
    display: none;
}

/* Floats under the swatch (never pushes the rows below). */
.hl-palette {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    z-index: var(--z-dropdown);
    display: flex;
    gap: var(--space-2);
    padding: var(--space-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-card);
}

.hl-palette[hidden] {
    display: none;
}

.hl-option {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    cursor: pointer;
}

.hl-option[aria-checked="true"] {
    box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--text-primary);
}

.hl-swatch[data-color="yellow"] { background-color: #FFFF00; }
.hl-swatch[data-color="green"] { background-color: #00FF00; }
.hl-swatch[data-color="magenta"] { background-color: #FF00FF; }
.hl-swatch[data-color="red"] { background-color: #FF0000; }
.hl-swatch[data-color="lightGray"] { background-color: #C0C0C0; }

/* The result screen's smaller option pills: switch first, like the others. */
.handwriting-setting-sm .handwriting-main {
    gap: 0.6rem;
}

.handwriting-setting-sm .handwriting-switch {
    order: -1;
}

.handwriting-setting-sm .hl-palette {
    right: auto;
    left: 0;
}

@media (max-width: 640px) {
    .hl-swatch-button {
        min-height: var(--control-h-touch);
        padding-inline: 0.6rem;
    }

    .hl-option {
        width: 2.25rem;
        height: 2.25rem;
    }
}

/* "Redacted areas" setting (2026-10-28, includes/RedactionSetting.php): three
   radio buttons as a segmented control -- "[Redacted]", Black box, Leave out. */
.redaction-setting.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3) var(--space-4);
    padding: var(--space-3) var(--space-4);
}

.seg-control {
    display: inline-flex;
    flex: none;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-card-subtle);
}

.seg-option {
    position: relative;
    display: flex;
}

.seg-option input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.seg-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    white-space: nowrap;
}

.seg-option input:hover + span {
    color: var(--text-primary);
}

.seg-option input:checked + span {
    background-color: var(--bg-card);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.seg-option input:focus-visible + span {
    outline: 2px solid var(--brand-primary);
    outline-offset: 1px;
}

/* The result screen's smaller option pills: the choices under the text. */
.redaction-setting-sm {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
}

@media (max-width: 640px) {
    .redaction-setting.setting-row {
        flex-wrap: wrap;
    }

    .seg-control {
        width: 100%;
    }

    .seg-option {
        flex: 1 1 0;
    }

    .seg-option span {
        min-height: var(--control-h-touch);
        padding-inline: 0.4rem;
    }
}

/* ---- Marketing brief, 2026-11-02 ---- */

/* Hero: who it is for, under the H1. */
.hero-audience {
    font-size: var(--text-md);
    font-weight: 600;
    color: var(--brand-text);
    margin: var(--space-2) auto 0;
}

/* "Choose a file -- try 1 page free" after the real conversions. */
.mid-cta {
    margin: var(--space-8) 0 0;
    text-align: center;
}

/* Simplified home page (2026-11-03): proof figure, icon grids, file-type
   chips, pricing band. Colours from tokens, so both themes work. */
.home-proof {
    margin: var(--space-8) auto 0;
    text-align: center;
}

.home-proof-figure {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text-primary);
}

.home-proof-vs {
    font-weight: 500;
    color: var(--text-muted);
}

.home-proof-note {
    margin-top: var(--space-2);
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.home-more-link {
    margin-top: var(--space-5);
    text-align: center;
    font-size: var(--text-md);
    font-weight: 600;
}

.icon-grid {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
}

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

.icon-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-5) var(--space-3);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.icon-tile svg {
    width: 28px;
    height: 28px;
    color: var(--brand-text);
}

.icon-tile-linked a {
    color: var(--text-primary);
    text-decoration: none;
}

/* The whole tile is the link. */
.icon-tile-linked a::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
}

.icon-tile-linked:hover {
    border-color: var(--brand-primary);
}

.icon-tile-linked a:focus-visible {
    outline: none;
}

.icon-tile-linked a:focus-visible::after {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.type-chips {
    list-style: none;
    margin: var(--space-5) 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    scroll-margin-top: 4.5rem;
}

.type-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0 var(--space-4);
    border: 1px solid var(--brand-tint-border);
    border-radius: var(--radius-full);
    background: var(--brand-tint-subtle);
    color: var(--brand-text);
    font-size: var(--text-md);
    font-weight: 600;
    text-decoration: none;
}

.type-chip:hover {
    border-color: var(--brand-primary);
}

.type-chip:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.pricing-band {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2) 0;
    max-width: 56rem;
    margin: var(--space-4) auto 0;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.pricing-band span + span::before {
    content: '\00B7';
    padding: 0 var(--space-3);
    color: var(--text-muted);
}

.pricing-band-team {
    margin-top: var(--space-3);
    font-size: var(--text-md);
}

@media (max-width: 760px) {
    .icon-grid,
    .icon-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .type-chip {
        min-height: 2.75rem;
    }

    .pricing-band {
        flex-direction: column;
        align-items: center;
        font-size: var(--text-base);
    }

    .pricing-band span + span::before {
        content: none;
    }
}

/* "Working on your own" across the top of the one-person-or-team cards. */
.topic-card-wide {
    grid-column: 1 / -1;
}

/* An FAQ item holding a list ("Good to know before you convert"). */
.faq-item ul {
    margin: 0;
    padding: 0 var(--space-5) 1.1rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Home example: on wide screens both pages show to a capped height, top
   first, until "See full pages" (js/showcase.js). Without JavaScript, or on
   phones, the pages show in full and the button stays hidden. */
.showcase-full-row {
    display: none;
}

@media (min-width: 761px) {
    .showcase.is-enhanced .example-pair:not(.is-full) .showcase-crop {
        max-height: 34rem;
        overflow: hidden;
        -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent);
        mask-image: linear-gradient(to bottom, #000 82%, transparent);
    }

    .showcase.is-enhanced .showcase-full-row:not([hidden]) {
        display: block;
        margin: var(--space-3) 0 0;
        text-align: center;
    }
}

/* Home #translate: a real translation, two small pages side by side. */
.translation-example {
    max-width: 640px;
    margin: var(--space-6) auto var(--space-5);
}

.translation-example-title {
    font-size: var(--text-md);
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
}

.translation-example-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.translation-example .example-figure figcaption {
    font-size: var(--text-md);
}

/* Approximate per-word translation example (pricing, translate). */
.translate-example-line {
    max-width: 40rem;
    margin: var(--space-4) auto 0;
    text-align: center;
    font-size: var(--text-md);
    color: var(--text-secondary);
}

/* Customer quotes and logos (includes/partials/social_proof.php; empty = hidden). */
.social-proof-quote {
    margin: 0;
}

.social-proof-quote p {
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
}

.social-proof-name {
    margin-top: var(--space-3);
    font-size: var(--text-md);
    color: var(--text-secondary);
}

.social-proof-logos {
    list-style: none;
    margin: var(--space-8) 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--space-6) var(--space-8);
}

.social-proof-logos img {
    display: block;
    max-height: 2rem;
    width: auto;
}

/* Page not found (public/404.php). */
.not-found-code {
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--text-muted);
    margin: 0;
}

.not-found-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.not-found-actions .btn {
    text-decoration: none;
}

/* Pricing: the title sits as close under the breadcrumb as on the other
   pages (2026-11-02 audit: the section's own top padding doubled the gap). */
.pricing-page > .breadcrumb + .landing-section {
    padding-top: var(--space-2);
}

/* Cookie choice on phones: a slim bottom bar (about 80 px), short wording,
   Decline and Accept side by side with the same weight. */
.analytics-banner-short {
    display: none;
}

@media (max-width: 640px) {
    .analytics-banner {
        right: 0;
        bottom: 0;
        left: 0;
        flex-wrap: nowrap;
        gap: var(--space-3);
        max-width: none;
        padding: var(--space-2) var(--space-4);
        border-width: 1px 0 0;
        border-radius: 0;
    }

    .analytics-banner-text {
        flex: 1 1 auto;
        min-width: 0;
        font-size: var(--text-sm);
        line-height: 1.35;
    }

    .analytics-banner-long {
        display: none;
    }

    .analytics-banner-short {
        display: inline;
    }

    .analytics-banner-actions {
        flex: 0 0 auto;
    }

    .analytics-banner-actions .btn {
        flex: 0 0 auto;
        padding-inline: var(--space-3);
    }
}

/* Monthly | Yearly over the plan cards (2026-11-02, Pricing::intervalSwitch()):
   no script -- the checked radio in the nearest [data-interval-scope] shows one
   of each card's .interval-monthly / .interval-yearly parts. A browser without
   :has() shows both, which still reads correctly. */
.interval-switch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    margin: 0 0 var(--space-4);
}

.interval-saving {
    margin-left: 0.35rem;
    color: var(--success-text);
    font-size: var(--text-xs);
    font-weight: 600;
}

[data-interval-scope]:has(input[data-interval="year"]:checked) .interval-monthly,
[data-interval-scope]:has(input[data-interval="month"]:checked) .interval-yearly {
    display: none !important;
}

/* Side-by-side pop-up (js/pair-zoom.js, 2026-11-02): either picture of a
   pair opens both, large. Signed-out pages don't load account.css, so the
   dialog's whole look lives here. */
.is-zoomable .example-figure img {
    cursor: zoom-in;
}

.is-zoomable .example-figure img:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 3px;
}

html.has-pair-dialog {
    overflow: hidden;
}

.pair-dialog {
    margin: auto;
    width: min(96rem, calc(100vw - 2rem));
    height: calc(100vh - 2rem);
    max-height: none;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background-color: var(--bg-page);
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
}

.pair-dialog[open] {
    display: flex;
    flex-direction: column;
}

.pair-dialog::backdrop {
    background-color: rgba(10, 12, 24, 0.6);
}

.pair-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-card);
}

.pair-dialog-title {
    margin: 0;
    font-size: var(--text-md);
    font-weight: 600;
}

.pair-dialog-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: var(--space-5);
    padding: var(--space-5);
}

.pair-dialog-col {
    margin: 0;
}

.pair-dialog-col figcaption {
    margin-bottom: var(--space-2);
    font-size: var(--text-base);
    color: var(--text-secondary);
    text-align: center;
}

.pair-dialog-col img {
    display: block;
    width: 100%;
    height: auto;
    background-color: var(--surface-paper);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

@media (max-width: 760px) {
    .pair-dialog {
        width: calc(100vw - 1rem);
        height: calc(100vh - 1rem);
    }

    .pair-dialog-body {
        grid-template-columns: minmax(0, 1fr);
        padding: var(--space-3);
    }

    .pair-dialog-head .btn {
        min-height: 44px;
    }
}

/* The pop-up's own switches (showcase pairs): show the version they pick. */
.pair-dialog-switches {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-left: auto;
}

.pair-dialog-switches[hidden] {
    display: none;
}

.pair-dialog-col img.showcase-v {
    display: none;
}

.pair-dialog-body:not(.show-hw):not(.show-marks) img.showcase-v-std-plain,
.pair-dialog-body:not(.show-hw).show-marks img.showcase-v-std-marks,
.pair-dialog-body.show-hw:not(.show-marks) img.showcase-v-hw-plain,
.pair-dialog-body.show-hw.show-marks img.showcase-v-hw-marks {
    display: block;
}

@media (max-width: 760px) {
    .pair-dialog-head {
        flex-wrap: wrap;
    }

    .pair-dialog-switches {
        order: 3;
        width: 100%;
        margin-left: 0;
    }
}

/* "Know where your documents go" points (AudiencePage, 2026-11-02 audit):
   folded to their titles on phones, open and plain on wider screens
   (js/landing.js opens details[data-open-wide] from 761 px). */
.privacy-point > summary {
    list-style: none;
    cursor: pointer;
}

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

@media (max-width: 760px) {
    .privacy-point > summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-3);
        min-height: 44px;
    }

    .privacy-point > summary::after {
        content: '+';
        font-weight: 600;
        color: var(--brand-text);
    }

    .privacy-point[open] > summary::after {
        content: '\2212';
    }

    .privacy-points {
        gap: var(--space-2);
    }

    .privacy-points .topic-card {
        padding-top: var(--space-1);
        padding-bottom: var(--space-1);
    }

    .privacy-point[open] > p {
        padding-bottom: var(--space-3);
    }
}

@media (min-width: 761px) {
    .privacy-point > summary {
        cursor: default;
        pointer-events: none;
    }
}

/* Narrow phones (<= 380 px): the header's sign-up button and the converter's
   step labels go back to 13 px, so the header stays on one row and the three
   steps on one line (checked at 360 and 320 px). */
@media (max-width: 380px) {
    .site-nav > .btn-sm {
        font-size: var(--text-sm);
    }

    .flow-steps {
        font-size: var(--text-sm);
    }
}

/* 320 px: logo, Menu and "Sign up free" didn't fit one row (the button
   wrapped under Menu, found in the 2026-11-02 audit): tighter gaps. */
@media (max-width: 340px) {
    .site-header-public .site-header-inner {
        gap: var(--space-2);
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }

    .site-header-public .site-nav {
        gap: var(--space-1) var(--space-2);
    }

    .site-header-public .site-nav > .btn-sm {
        padding-left: 0.7rem;
        padding-right: 0.7rem;
    }
}

/* Pricing page, simplified (2026-11-03): icon chips, icon facts on the plan
   cards, the team row and small tooltips (Pricing::icon(), Pricing::tip()). */
.picon {
    flex: none;
    color: var(--brand-text);
}

.price-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: var(--text-base);
    color: var(--text-primary);
}

.price-chips li {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.pricing-group-chips {
    justify-content: center;
    margin: var(--space-5) 0 var(--space-4);
    color: var(--text-secondary);
}

.price-facts {
    list-style: none;
    margin: var(--space-3) 0 0;
    padding: var(--space-3) 0 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-align: left;
}

.price-facts li,
.price-facts .ptip-trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.team-row {
    max-width: 880px;
    margin: var(--space-6) auto 0;
    padding: var(--space-4) var(--space-5);
    background-color: var(--bg-card-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    scroll-margin-top: var(--space-8);
}

.team-row-title {
    font-weight: 600;
    margin: 0 0 var(--space-3);
}

.team-row .price-chips {
    font-size: var(--text-sm);
}

/* Tooltips: hover, keyboard focus and tap (js/landing.js toggles .is-open). */
.ptip {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.ptip-trigger {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: help;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

.ptip-trigger:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.ptip-icon .ptip-trigger {
    text-decoration: none;
    margin-left: var(--space-2);
    min-width: 1.75rem;
    min-height: 1.75rem;
    justify-content: center;
}

.ptip-i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    font-size: var(--text-xs);
    font-weight: 700;
    font-style: italic;
    color: var(--text-muted);
}

.ptip-text {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    z-index: var(--z-dropdown, 50);
    width: max-content;
    max-width: min(16rem, 80vw);
    padding: var(--space-2) var(--space-3);
    background-color: var(--text-primary);
    color: var(--bg-card);
    font-size: var(--text-xs);
    font-weight: 400;
    font-style: normal;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.15));
    display: none;
    pointer-events: none;
}

.ptip:hover .ptip-text,
.ptip-trigger:focus-visible + .ptip-text,
.ptip.is-open .ptip-text {
    display: block;
}

/* The "i" beside Monthly | Yearly sits at the row's end: open leftwards. */
.ptip-icon .ptip-text {
    left: auto;
    right: 0;
    transform: none;
}

.price-facts .ptip-text {
    left: 0;
    transform: none;
}

@media (max-width: 640px) {
    .free-trial-band {
        padding: var(--space-4);
    }
    .pricing-tabs button {
        padding-inline: var(--space-3);
    }
    .team-row {
        padding: var(--space-4);
    }
    .ptip-icon .ptip-trigger {
        margin-left: var(--space-1);
    }
}

.ptip.is-dismissed .ptip-text {
    display: none;
}

/* Audience pages, shortened (2026-11-03, the law page): icon chips for the
   kinds of documents, icon tiles, icon rows and the free-page chips in the
   hero (includes/AudiencePage.php icon()). */
.hero .drop-chips {
    margin-top: var(--space-4);
}

.aud-icon {
    flex: none;
    color: var(--brand-text);
}

.aud-chips {
    list-style: none;
    padding: 0;
    margin: 1.5rem auto 0;
    max-width: 52rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2) var(--space-3);
}

.aud-chips li {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.aud-chips .aud-icon {
    width: 18px;
    height: 18px;
}

.topic-card.icon-card > .aud-icon {
    display: block;
    margin-bottom: var(--space-2);
}

.topic-card.icon-card p {
    margin-top: var(--space-1);
}

/* How it works with icons (2026-11-03): the icon sits before the step's title. */
.steps-list li.has-icon h3 {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.steps-list li.has-icon .aud-icon {
    width: 22px;
    height: 22px;
}

.aud-price-note {
    margin-top: var(--space-2);
}

.workflow-points li.has-icon {
    align-items: center;
    font-weight: 500;
}

.workflow-points li.has-icon .aud-icon {
    margin-top: 0;
    width: 22px;
    height: 22px;
}

.privacy-tiles {
    margin-top: 1.75rem;
}

.example-more .example-downloads {
    margin-top: var(--space-4);
}
