/* Bundled design system. Generated from index.css imports to avoid runtime @import waterfalls. */

/* === _tokens.css === */
/*
   Tokens. Single source of truth.
   Register: product (restrained). Accent ≤10% of any surface.
   All neutrals tinted toward hue 230 (cool blue cast). No #fff / #000.
*/

:root {
    /* Ink — neutral scale, hue 230, low chroma */
    --ink-50:  oklch(98.5% 0.004 230);
    --ink-100: oklch(96%   0.006 230);
    --ink-200: oklch(91%   0.008 230);
    --ink-300: oklch(85%   0.010 230);
    --ink-400: oklch(70%   0.012 230);
    --ink-500: oklch(55%   0.014 230);
    --ink-600: oklch(43%   0.016 230);
    --ink-700: oklch(33%   0.018 230);
    --ink-800: oklch(23%   0.018 230);
    --ink-900: oklch(15%   0.014 230);

    /* Accent — North Atlantic teal, hue 195 */
    --accent-50:  oklch(97% 0.012 195);
    --accent-100: oklch(93% 0.034 195);
    --accent-200: oklch(86% 0.058 195);
    --accent-300: oklch(75% 0.080 195);
    --accent-400: oklch(66% 0.095 195);
    --accent-500: oklch(58% 0.100 195);
    --accent-600: oklch(50% 0.098 195);
    --accent-700: oklch(42% 0.090 195);
    --accent-800: oklch(34% 0.078 195);
    --accent-900: oklch(26% 0.060 195);

    /* Surfaces */
    --surface:        oklch(99%   0.003 230);
    --surface-muted:  oklch(97.5% 0.005 230);
    --surface-sunken: oklch(95%   0.007 230);

    /* Status */
    --success:     oklch(58% 0.14 150);
    --success-bg:  oklch(96% 0.04 150);
    --warning:     oklch(70% 0.15  75);
    --warning-bg:  oklch(97% 0.04  75);
    --danger:      oklch(58% 0.20  25);
    --danger-bg:   oklch(97% 0.04  25);

    /* Typography */
    --font-display: 'DM Serif Display', 'Iowan Old Style', Georgia, serif;
    --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    --text-3xs:  0.625rem;   /* 10px — micro labels (info-label, footer-column h4) */
    --text-2xs:  0.6875rem;  /* 11px — badge text, table th, kbd */
    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-md:   1.0625rem;
    --text-lg:   1.25rem;
    --text-xl:   1.5rem;
    --text-2xl:  1.875rem;
    --text-3xl:  2.375rem;
    --text-4xl:  3rem;
    --text-5xl:  3.75rem;

    --weight-regular: 400;
    --weight-medium:  500;
    --weight-semi:    600;
    --weight-bold:    700;

    --leading-tight: 1.25;
    --leading-snug:  1.4;
    --leading-base:  1.55;
    --leading-loose: 1.7;

    --tracking-tight:   -0.02em;
    --tracking-normal:   0;
    --tracking-wide:     0.04em;

    /* Spacing — 4px base */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-7:  1.75rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* Radii */
    --radius-xs:   3px;
    --radius-sm:   5px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-xl:   18px;
    --radius-full: 9999px;

    /* Shadows. Tinted with ink hue so they don't look gray on tinted surfaces. */
    --shadow-xs: 0 1px 2px oklch(15% 0.014 230 / 0.05);
    --shadow-sm: 0 1px 3px oklch(15% 0.014 230 / 0.07), 0 1px 2px oklch(15% 0.014 230 / 0.04);
    --shadow-md: 0 4px 10px -2px oklch(15% 0.014 230 / 0.08), 0 2px 4px -2px oklch(15% 0.014 230 / 0.05);
    --shadow-lg: 0 12px 24px -6px oklch(15% 0.014 230 / 0.10), 0 4px 8px -4px oklch(15% 0.014 230 / 0.06);
    --shadow-xl: 0 24px 48px -12px oklch(15% 0.014 230 / 0.18), 0 8px 16px -8px oklch(15% 0.014 230 / 0.10);
    --shadow-popover: 0 16px 36px -10px oklch(15% 0.014 230 / 0.16), 0 4px 12px -4px oklch(15% 0.014 230 / 0.08);

    /* Motion. Ease-out exponential only. No bounce. */
    --duration-1: 90ms;
    --duration-2: 140ms;
    --duration-3: 220ms;
    --duration-4: 360ms;
    --duration-5: 480ms;
    --ease-out-quart:    cubic-bezier(0.25, 1, 0.5, 1);
    --ease-out-quint:    cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out-expo:     cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out-sine:  cubic-bezier(0.45, 0, 0.55, 1);
    --press-scale: 0.985;

    /* Focus ring. Tinted accent at low alpha, plus crisp 1px ring for contrast. */
    --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px oklch(50% 0.098 195 / 0.55);

    /* Layout */
    --container-narrow: 720px;
    --container-base:   1080px;
    --container-wide:   1320px;
    --container-max:    1600px;

    /* Breakpoint vocabulary: sm 600px, md 900px, lg 1024px, xl 1280px.
       Custom properties cannot be used in @media, so keep these as docs only. */

    /* Z-index */
    --z-base:     0;
    --z-sticky:   100;
    --z-dropdown: 200;
    --z-overlay:  300;
    --z-modal:    400;
    --z-toast:    500;
}

/* === _base.css === */
/* Reset, body defaults, focus, motion. */

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

html {
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: var(--leading-base);
    color: var(--ink-900);
    background: var(--surface-muted);
    font-feature-settings: 'cv11', 'ss01';
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: inherit;
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--ink-900);
}

h1 { font-size: var(--text-3xl); font-weight: var(--weight-semi); }
h2 { font-size: var(--text-2xl); font-weight: var(--weight-semi); }
h3 { font-size: var(--text-xl);  font-weight: var(--weight-semi); }
h4 { font-size: var(--text-lg);  font-weight: var(--weight-semi); }
h5 { font-size: var(--text-md);  font-weight: var(--weight-semi); }
h6 { font-size: var(--text-sm);  font-weight: var(--weight-semi); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--ink-500); }

p { margin: 0; }

a {
    color: var(--accent-700);
    text-decoration: none;
    transition: color var(--duration-1) var(--ease-out-quart);
}
a:hover { color: var(--accent-800); }

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

button { cursor: pointer; background: none; border: 0; padding: 0; }

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

/* Tabular numerals everywhere — financial data is the product. */
.num, td.num, .mono, code, kbd, samp {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum', 'zero';
}

/* Focus — keyboard only. */
:focus { outline: 0; }
:focus-visible {
    outline: 0;
    box-shadow: var(--focus-ring);
}

/* Selection */
::selection {
    background: var(--accent-200);
    color: var(--ink-900);
}

/* Neutralize browser autofill colour wash. Chromium applies its own
   inset background; an inset box-shadow on our surface colour wins. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: var(--ink-900);
    -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
    box-shadow: 0 0 0 1000px var(--surface) inset;
    caret-color: var(--ink-900);
    transition: background-color 9999s ease-out 0s;
}

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

/* === _buttons.css === */
/*
   Canonical buttons. Additive foundation for retiring per-surface button
   namespaces without changing current screens while legacy partials remain.
*/

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 36px;
    padding: 0 var(--space-4);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    line-height: 1;
    color: var(--ink-800);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
    transition:
        background var(--duration-2) var(--ease-out-quart),
        color var(--duration-2) var(--ease-out-quart),
        border-color var(--duration-2) var(--ease-out-quart),
        box-shadow var(--duration-2) var(--ease-out-quart),
        transform var(--duration-2) var(--ease-out-quart);
}

.btn--primary {
    color: var(--surface);
    background: var(--ink-900);
    border-color: var(--ink-900);
}

.btn--primary:hover {
    color: var(--surface);
    background: var(--ink-800);
    border-color: var(--ink-800);
}

.btn--ghost {
    color: var(--ink-800);
    background: transparent;
    border-color: var(--ink-200);
}

.btn--ghost:hover {
    color: var(--ink-900);
    background: var(--surface-sunken);
    border-color: var(--ink-300);
}

.btn--danger {
    color: var(--surface);
    background: var(--danger);
    border-color: var(--danger);
}

.btn--danger:hover {
    color: var(--surface);
    filter: brightness(0.95);
}

.btn--icon {
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--ink-600);
    background: transparent;
    border-color: transparent;
    border-radius: var(--radius-sm);
}

.btn--icon:hover {
    color: var(--ink-900);
    background: var(--surface-sunken);
}

.btn--text {
    padding: 0 var(--space-2);
    color: var(--ink-700);
    background: none;
    border: none;
}

.btn--text:hover {
    color: var(--ink-900);
}

.btn--sm {
    height: 28px;
    padding: 0 var(--space-3);
    font-size: var(--text-xs);
}

.btn--lg {
    height: 44px;
    padding: 0 var(--space-5);
    font-weight: var(--weight-semi);
}

.btn--full {
    width: 100%;
}

.btn--icon.btn--sm {
    width: 28px;
    height: 28px;
}

.btn--icon.btn--lg {
    width: 44px;
    height: 44px;
}

.btn:active:not(:disabled) {
    transform: scale(var(--press-scale));
}

.btn:focus-visible {
    outline: 0;
    box-shadow: var(--focus-ring);
}

.btn--primary,
.btn--ghost,
.btn--danger,
.btn--text {
    border-radius: var(--radius-full);
}

.btn--icon {
    border-radius: var(--radius-sm);
}

.btn:disabled,
.btn--loading {
    opacity: .5;
    cursor: not-allowed;
}

.btn:disabled {
    pointer-events: none;
}

.btn--loading::after {
    content: "";
    width: 1em;
    height: 1em;
    border: 1px solid currentColor;
    border-right-color: transparent;
    border-radius: var(--radius-full);
    animation: btn-spin var(--duration-5) linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .btn:active:not(:disabled) {
        transform: none;
    }

    .btn--loading::after {
        animation: none;
    }
}

/*
   Migration aliases. These selectors intentionally mirror the canonical button
   roles so legacy class names still resolve once later phases remove their
   surface-specific partial rules.
*/

:where(
    .btn-primary,
    .btn-submit,
    .btn-start,
    .submit-btn,
    .adm-btn-primary,
    .btn-create-user,
    .btn-create-company,
    .ws-btn-primary,
    .review-cta-btn,
    .cta-primary,
    .nav-cta,
    .btn-checkout,
    .feed-new-link,
    .admin-err-btn,
    .btn-account-save,
    .btn-account-save--lg,
    .btn-recover,
    .btn-submit-primary,
    .btn-submit-pay,
    .btn-submit-locked,
    .btn-secondary,
    .btn-ghost,
    .btn-back,
    .btn-back-full,
    .btn-back-link,
    .btn-download,
    .btn-load-more,
    .btn-retry,
    .adm-btn-secondary,
    .adm-btn-file,
    .adm-retry-btn,
    .ws-btn-ghost,
    .review-secondary-btn,
    .cta-secondary,
    .btn-home-link,
    .feed-new-link--secondary,
    .shortcut-overlay-btn,
    .template-btn,
    .adm-btn-danger,
    .action-btn,
    .adm-action-btn,
    .adm-pg-btn,
    .pg-btn,
    .sidebar-toggle-btn,
    .input-icon-btn,
    .rail-add-btn,
    .row-info-btn
) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 36px;
    padding: 0 var(--space-4);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
    transition:
        background var(--duration-2) var(--ease-out-quart),
        color var(--duration-2) var(--ease-out-quart),
        border-color var(--duration-2) var(--ease-out-quart),
        box-shadow var(--duration-2) var(--ease-out-quart),
        transform var(--duration-2) var(--ease-out-quart);
}

:where(
    .btn-primary,
    .btn-submit,
    .btn-start,
    .submit-btn,
    .adm-btn-primary,
    .btn-create-user,
    .btn-create-company,
    .ws-btn-primary,
    .review-cta-btn,
    .cta-primary,
    .nav-cta,
    .btn-checkout,
    .feed-new-link,
    .admin-err-btn,
    .btn-account-save,
    .btn-account-save--lg,
    .btn-recover,
    .btn-submit-primary,
    .btn-submit-pay,
    .btn-submit-locked
) {
    color: var(--surface);
    background: var(--ink-900);
    border-color: var(--ink-900);
    border-radius: var(--radius-full);
}

:where(
    .btn-primary,
    .btn-submit,
    .btn-start,
    .submit-btn,
    .adm-btn-primary,
    .btn-create-user,
    .btn-create-company,
    .ws-btn-primary,
    .review-cta-btn,
    .cta-primary,
    .nav-cta,
    .btn-checkout,
    .feed-new-link,
    .admin-err-btn,
    .btn-account-save,
    .btn-account-save--lg,
    .btn-recover,
    .btn-submit-primary,
    .btn-submit-pay,
    .btn-submit-locked
):hover {
    color: var(--surface);
    background: var(--ink-800);
    border-color: var(--ink-800);
}

:where(
    .btn-secondary,
    .btn-ghost,
    .btn-back,
    .btn-back-full,
    .btn-back-link,
    .btn-download,
    .btn-load-more,
    .btn-retry,
    .adm-btn-secondary,
    .adm-btn-file,
    .adm-retry-btn,
    .ws-btn-ghost,
    .review-secondary-btn,
    .cta-secondary,
    .btn-home-link,
    .feed-new-link--secondary,
    .shortcut-overlay-btn,
    .template-btn
) {
    color: var(--ink-800);
    background: transparent;
    border-color: var(--ink-200);
    border-radius: var(--radius-full);
}

:where(
    .btn-secondary,
    .btn-ghost,
    .btn-back,
    .btn-back-full,
    .btn-back-link,
    .btn-download,
    .btn-load-more,
    .btn-retry,
    .adm-btn-secondary,
    .adm-btn-file,
    .adm-retry-btn,
    .ws-btn-ghost,
    .review-secondary-btn,
    .cta-secondary,
    .btn-home-link,
    .feed-new-link--secondary,
    .shortcut-overlay-btn,
    .template-btn
):hover {
    color: var(--ink-900);
    background: var(--surface-sunken);
    border-color: var(--ink-300);
}

:where(.adm-btn-danger) {
    color: var(--surface);
    background: var(--danger);
    border-color: var(--danger);
    border-radius: var(--radius-full);
}

:where(.adm-btn-danger):hover {
    color: var(--surface);
    filter: brightness(0.95);
}

:where(
    .action-btn,
    .adm-action-btn,
    .adm-pg-btn,
    .pg-btn,
    .sidebar-toggle-btn,
    .input-icon-btn,
    .rail-add-btn,
    .row-info-btn
) {
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--ink-600);
    background: transparent;
    border-color: transparent;
    border-radius: var(--radius-sm);
}

:where(
    .action-btn,
    .adm-action-btn,
    .adm-pg-btn,
    .pg-btn,
    .sidebar-toggle-btn,
    .input-icon-btn,
    .rail-add-btn,
    .row-info-btn
):hover {
    color: var(--ink-900);
    background: var(--surface-sunken);
}

:where(.btn-back-full, .btn-checkout, .btn-submit, .review-cta-btn) {
    width: 100%;
}

:where(.btn-account-save--lg) {
    height: 44px;
    padding: 0 var(--space-5);
    font-weight: var(--weight-semi);
}

:where(
    .btn-primary,
    .btn-submit,
    .btn-start,
    .submit-btn,
    .adm-btn-primary,
    .btn-create-user,
    .btn-create-company,
    .ws-btn-primary,
    .review-cta-btn,
    .cta-primary,
    .nav-cta,
    .btn-checkout,
    .feed-new-link,
    .admin-err-btn,
    .btn-account-save,
    .btn-account-save--lg,
    .btn-recover,
    .btn-submit-primary,
    .btn-submit-pay,
    .btn-submit-locked,
    .btn-secondary,
    .btn-ghost,
    .btn-back,
    .btn-back-full,
    .btn-back-link,
    .btn-download,
    .btn-load-more,
    .btn-retry,
    .adm-btn-secondary,
    .adm-btn-file,
    .adm-retry-btn,
    .ws-btn-ghost,
    .review-secondary-btn,
    .cta-secondary,
    .btn-home-link,
    .feed-new-link--secondary,
    .shortcut-overlay-btn,
    .template-btn,
    .adm-btn-danger,
    .action-btn,
    .adm-action-btn,
    .adm-pg-btn,
    .pg-btn,
    .sidebar-toggle-btn,
    .input-icon-btn,
    .rail-add-btn,
    .row-info-btn
):active:not(:disabled) {
    transform: scale(var(--press-scale));
}

:where(
    .btn-primary,
    .btn-submit,
    .btn-start,
    .submit-btn,
    .adm-btn-primary,
    .btn-create-user,
    .btn-create-company,
    .ws-btn-primary,
    .review-cta-btn,
    .cta-primary,
    .nav-cta,
    .btn-checkout,
    .feed-new-link,
    .admin-err-btn,
    .btn-account-save,
    .btn-account-save--lg,
    .btn-recover,
    .btn-submit-primary,
    .btn-submit-pay,
    .btn-submit-locked,
    .btn-secondary,
    .btn-ghost,
    .btn-back,
    .btn-back-full,
    .btn-back-link,
    .btn-download,
    .btn-load-more,
    .btn-retry,
    .adm-btn-secondary,
    .adm-btn-file,
    .adm-retry-btn,
    .ws-btn-ghost,
    .review-secondary-btn,
    .cta-secondary,
    .btn-home-link,
    .feed-new-link--secondary,
    .shortcut-overlay-btn,
    .template-btn,
    .adm-btn-danger,
    .action-btn,
    .adm-action-btn,
    .adm-pg-btn,
    .pg-btn,
    .sidebar-toggle-btn,
    .input-icon-btn,
    .rail-add-btn,
    .row-info-btn
):focus-visible {
    outline: 0;
    box-shadow: var(--focus-ring);
}

:where(
    .btn-primary,
    .btn-submit,
    .btn-start,
    .submit-btn,
    .adm-btn-primary,
    .btn-create-user,
    .btn-create-company,
    .ws-btn-primary,
    .review-cta-btn,
    .cta-primary,
    .nav-cta,
    .btn-checkout,
    .feed-new-link,
    .admin-err-btn,
    .btn-account-save,
    .btn-account-save--lg,
    .btn-recover,
    .btn-submit-primary,
    .btn-submit-pay,
    .btn-submit-locked,
    .btn-secondary,
    .btn-ghost,
    .btn-back,
    .btn-back-full,
    .btn-back-link,
    .btn-download,
    .btn-load-more,
    .btn-retry,
    .adm-btn-secondary,
    .adm-btn-file,
    .adm-retry-btn,
    .ws-btn-ghost,
    .review-secondary-btn,
    .cta-secondary,
    .btn-home-link,
    .feed-new-link--secondary,
    .shortcut-overlay-btn,
    .template-btn,
    .adm-btn-danger,
    .action-btn,
    .adm-action-btn,
    .adm-pg-btn,
    .pg-btn,
    .sidebar-toggle-btn,
    .input-icon-btn,
    .rail-add-btn,
    .row-info-btn
):disabled,
:where(.feed-new-link[aria-disabled="true"]) {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    :where(
        .btn-primary,
        .btn-submit,
        .btn-start,
        .submit-btn,
        .adm-btn-primary,
        .btn-create-user,
        .btn-create-company,
        .ws-btn-primary,
        .review-cta-btn,
        .cta-primary,
        .nav-cta,
        .btn-checkout,
        .feed-new-link,
        .admin-err-btn,
        .btn-account-save,
        .btn-account-save--lg,
        .btn-recover,
        .btn-submit-primary,
        .btn-submit-pay,
        .btn-submit-locked,
        .btn-secondary,
        .btn-ghost,
        .btn-back,
        .btn-back-full,
        .btn-back-link,
        .btn-download,
        .btn-load-more,
        .btn-retry,
        .adm-btn-secondary,
        .adm-btn-file,
        .adm-retry-btn,
        .ws-btn-ghost,
        .review-secondary-btn,
        .cta-secondary,
        .btn-home-link,
        .feed-new-link--secondary,
        .shortcut-overlay-btn,
        .template-btn,
        .adm-btn-danger,
        .action-btn,
        .adm-action-btn,
        .adm-pg-btn,
        .pg-btn,
        .sidebar-toggle-btn,
        .input-icon-btn,
        .rail-add-btn,
        .row-info-btn
    ):active:not(:disabled) {
        transform: none;
    }
}

/* === _utilities.css === */
/* Layout & spacing utilities. Used by admin pages and shared components. */

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-space-between { justify-content: space-between; }
.flex-1 { flex: 1; min-width: 0; }
.full-width { width: 100%; }

.gap-0 { gap: 0; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }
.mb-12 { margin-bottom: var(--space-12); }
.mt-4 { margin-top: var(--space-4); }

.flex-column { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.text-center { text-align: center; }

.pa-1 { padding: var(--space-1); }
.pa-2 { padding: var(--space-2); }
.pa-3 { padding: var(--space-3); }
.pa-4 { padding: var(--space-4); }
.pa-6 { padding: var(--space-6); }
.pa-8 { padding: var(--space-8); }

.mono-font {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.text-display {
    font-family: var(--font-display);
    letter-spacing: var(--tracking-tight);
}

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

.muted-text { color: var(--ink-400); }

.hidden { display: none; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === _layout.css === */
/*
   App shell. Covers MainLayout (top bar) and AdminLayout (side rail).
   Restrained. Single accent ≤10%.
*/

/* ─── MainLayout — top bar shell ──────────────────────────────────────── */

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--surface-muted);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--surface);
    border-bottom: 1px solid var(--ink-200);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.brand-link {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    color: inherit;
    text-decoration: none;
}
.brand-link:hover { color: inherit; }

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-2);
    font-size: var(--text-lg);
    font-weight: var(--weight-semi);
    letter-spacing: var(--tracking-tight);
}

.brand-mark   { color: var(--ink-900); }
.brand-region { color: var(--accent-700); font-size: var(--text-base); font-weight: var(--weight-medium); }
.brand-separator { width: 1px; height: 14px; background: var(--ink-300); align-self: center; }
.brand-tagline {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--ink-500);
}

/* Auth/admin buttons in top bar */
.auth-buttons { display: inline-flex; align-items: center; gap: var(--space-2); }

.btn-primary, .btn-secondary, .admin-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 36px;
    padding: 0 var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}

.btn-primary {
    background: var(--ink-900);
    color: var(--surface);
    border: 1px solid var(--ink-900);
    border-radius: var(--radius-full);
}
.btn-primary:hover { background: var(--ink-800); border-color: var(--ink-800); color: var(--surface); }
.btn-primary:active { transform: scale(var(--press-scale)); }

.btn-secondary {
    background: var(--surface);
    color: var(--ink-800);
    border: 1px solid var(--ink-200);
}
.btn-secondary:hover { background: var(--surface-sunken); border-color: var(--ink-300); }

.admin-link {
    background: var(--accent-50);
    color: var(--accent-800);
    border: 1px solid var(--accent-200);
}
.admin-link:hover { background: var(--accent-100); border-color: var(--accent-300); }
.btn-primary:active,
.btn-secondary:active,
.admin-link:active { transform: scale(var(--press-scale)); }

/* User menu trigger */
.user-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.logout-inline-form {
    margin: 0;
}

.logout-inline {
    height: 36px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
}

.user-trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 36px;
    padding: 0 var(--space-2) 0 var(--space-2);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: background var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.user-trigger:hover {
    background: var(--surface-sunken);
    border-color: var(--ink-200);
}
.user-trigger:active { transform: scale(var(--press-scale)); }
.user-trigger:focus-visible {
    outline: 0;
    box-shadow: var(--focus-ring);
}

.user-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    background: var(--accent-100);
    color: var(--accent-700);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-wide);
    border: 1px solid var(--accent-200);
    flex-shrink: 0;
}

.user-name-display {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-700);
    letter-spacing: -0.01em;
}

.user-trigger .chevron {
    color: var(--ink-400);
    transition: color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-2) var(--ease-out-quart);
}
.user-trigger:hover .chevron { color: var(--ink-600); }
.user-trigger[aria-expanded="true"] .chevron { transform: rotate(180deg); color: var(--ink-600); }

/* User dropdown */
@keyframes dropdownReveal {
    from { opacity: 0; transform: scale(0.96) translateY(-4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 228px;
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-popover);
    z-index: var(--z-dropdown);
    overflow: hidden;
    animation: dropdownReveal var(--duration-3) var(--ease-out-expo) both;
    transform-origin: top right;
}

.dropdown-header {
    padding: var(--space-4) var(--space-4) var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border-bottom: 1px solid var(--ink-100);
}

.dropdown-header-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--accent-100);
    color: var(--accent-700);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-wide);
    border: 1px solid var(--accent-200);
    flex-shrink: 0;
}

.dropdown-user-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dropdown-user-name {
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropdown-user-email {
    font-size: var(--text-xs);
    color: var(--ink-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-section { padding: var(--space-1) 0; }

.dropdown-divider { height: 1px; background: var(--ink-100); margin: var(--space-1) 0; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    height: 40px;
    padding: 0 var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-700);
    text-decoration: none;
    text-align: left;
    position: relative;
    transition: background var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart);
}
.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 2px;
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    background: var(--accent-500);
    opacity: 0;
    transition: opacity var(--duration-1) var(--ease-out-quart);
}
.dropdown-item svg {
    color: var(--ink-400);
    flex-shrink: 0;
    transition: color var(--duration-1) var(--ease-out-quart);
}
.dropdown-item:hover {
    background: var(--surface-sunken);
    color: var(--ink-900);
}
.dropdown-item:hover::before { opacity: 1; }
.dropdown-item:hover svg { color: var(--accent-600); }
.dropdown-item:focus-visible {
    outline: 0;
    box-shadow: inset 0 0 0 2px oklch(50% 0.098 195 / 0.40);
}

.dropdown-item.danger {
    color: var(--ink-600);
}
.dropdown-item.danger svg { color: var(--ink-400); }
.dropdown-item.danger::before { background: var(--danger); }
.dropdown-item.danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}
.dropdown-item.danger:hover svg { color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
    .user-dropdown { animation: none; }
    .user-trigger .chevron { transition: none; }
}

/* Main body */
.app-main {
    flex: 1;
    background: var(--surface-muted);
}
.app-footer {
    border-top: 1px solid var(--ink-100);
    background: var(--surface);
}
.app-footer-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-4) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}
.app-footer-copy { font-size: var(--text-xs); color: var(--ink-500); }
.app-footer-links { display: flex; gap: var(--space-5); }
.app-footer-links a {
    font-size: var(--text-xs);
    color: var(--ink-500);
    text-decoration: none;
    transition: color var(--duration-1) var(--ease-out-quart);
}
.app-footer-links a:hover { color: var(--ink-800); }

.animate-page-enter { animation: pageEnter var(--duration-3) var(--ease-out-expo); }
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Error fallback */
.error-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: var(--space-8);
}
.error-fallback-inner {
    text-align: center;
    max-width: 440px;
    padding: var(--space-8);
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    animation: error-rise 0.36s var(--ease-out-quart) both;
}
/* Spot illustration sits flush above the heading; its white field blends into the card surface. */
.error-illustration {
    display: block;
    width: 240px;
    max-width: 70%;
    height: auto;
    margin: 0 auto var(--space-4);
    /* line art on a white field — multiply drops the white so it blends onto the card surface */
    mix-blend-mode: multiply;
}
/* Icon sits in a soft danger-tinted badge — reads as an error without alarming red. */
.error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-5);
    color: var(--danger);
    background: var(--danger-bg);
    border-radius: 999px;
}
.error-icon svg { width: 30px; height: 30px; }
.error-fallback h2 {
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    letter-spacing: -0.02em;
    color: var(--ink-900);
    margin: 0 0 var(--space-3);
}
.error-fallback p {
    color: var(--ink-500);
    font-size: var(--text-base);
    line-height: 1.55;
    max-width: 34ch;
    margin: 0 auto var(--space-7);
}
.error-actions { display: flex; align-items: center; justify-content: center; gap: var(--space-3); }

.btn-recover, .btn-home-link {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 var(--space-6);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.btn-recover {
    background: var(--ink-900);
    color: var(--surface);
    border: 1px solid var(--ink-900);
}
.btn-recover:hover { background: var(--ink-800); border-color: var(--ink-800); }
.btn-recover:active { transform: translateY(1px); }

.btn-home-link {
    background: var(--ink-900);
    color: var(--surface);
    border: 1px solid var(--ink-900);
    border-radius: var(--radius-full);
    height: 44px;
    padding: 0 var(--space-7);
    font-weight: var(--weight-semi);
}
.btn-home-link:hover { background: var(--ink-800); border-color: var(--ink-800); color: var(--surface); }

@keyframes error-rise {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .error-fallback-inner { animation: none; }
}

/* ─── AdminLayout — side rail shell ───────────────────────────────────── */

.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
    background: var(--surface-muted);
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--ink-200);
    padding: var(--space-5) var(--space-3);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-brand {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    padding: 0 var(--space-3) var(--space-5);
    font-size: var(--text-lg);
    font-weight: var(--weight-semi);
    letter-spacing: var(--tracking-tight);
    border-bottom: 1px solid var(--ink-100);
    margin-bottom: var(--space-4);
}
.brand-xbrl { color: var(--ink-900); }
.brand-fo   { color: var(--accent-700); font-size: var(--text-base); font-weight: var(--weight-medium); }
.brand-badge {
    margin-left: auto;
    font-size: var(--text-3xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.08em;
    color: var(--ink-500);
    padding: 3px 6px;
    background: var(--ink-100);
    border-radius: var(--radius-xs);
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.admin-nav-section {
    margin-top: var(--space-4);
    margin-bottom: var(--space-1);
    padding: 0 var(--space-3);
    font-size: var(--text-3xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.08em;
    color: var(--ink-400);
}
.admin-nav-section:first-child { margin-top: 0; }

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: 36px;
    padding: 0 var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-600);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart);
}
.admin-nav-item:hover { background: var(--surface-sunken); color: var(--ink-900); }
.admin-nav-item.active {
    background: var(--accent-50);
    color: var(--accent-800);
}
.admin-nav-item.active .nav-icon { color: var(--accent-700); }

.nav-icon {
    width: 18px;
    height: 18px;
    color: var(--ink-500);
    flex: 0 0 18px;
}

.admin-user-chip {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-top: 1px solid var(--ink-100);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
}
.admin-user-chip .user-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    background: var(--accent-100);
    color: var(--accent-800);
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
}
.admin-user-chip .user-email {
    font-size: var(--text-xs);
    color: var(--ink-600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-sidebar-spacer { flex: 1; }

.admin-body {
    padding: var(--space-6) var(--space-8);
    min-width: 0;  /* allow children to shrink in grid */
}

.admin-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--ink-700);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    position: fixed;
    top: var(--space-3);
    left: var(--space-3);
    z-index: var(--z-overlay);
}

.admin-nav-backdrop {
    position: fixed;
    inset: 0;
    background: oklch(15% 0.014 230 / 0.4);
    z-index: var(--z-overlay);
    animation: backdropIn var(--duration-2) var(--ease-out-quart);
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.admin-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: var(--space-8);
}
.admin-error-inner { text-align: center; max-width: 420px; }
.admin-err-btn {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--surface);
    background: var(--ink-900);
    border: 1px solid var(--ink-900);
    border-radius: var(--radius-md);
    transition: background var(--duration-1) var(--ease-out-quart);
}
.admin-err-btn:hover { background: var(--ink-800); }

/* ─── Global snackbar host ────────────────────────────────────────────── */

.app-snackbar-stack {
    position: fixed;
    right: var(--space-4);
    bottom: var(--space-4);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: min(420px, calc(100vw - 2 * var(--space-4)));
}

.app-snackbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--ink-700);
    background: var(--ink-900);
    color: var(--surface);
    box-shadow: var(--shadow-lg);
    padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
    animation: fadeInUp var(--duration-2) var(--ease-out-quart);
}

.app-snackbar.is-success { background: var(--success); border-color: var(--success); }
.app-snackbar.is-warning { background: var(--warning); border-color: var(--warning); }
.app-snackbar.is-error { background: var(--danger); border-color: var(--danger); }
.app-snackbar.is-info { background: var(--ink-800); border-color: var(--ink-800); }

.app-snackbar-message {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.4;
    font-weight: var(--weight-medium);
}

.app-snackbar-dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: inherit;
    opacity: 0.85;
    transition: opacity var(--duration-1) var(--ease-out-quart),
                background var(--duration-1) var(--ease-out-quart);
}

.app-snackbar-dismiss:hover {
    opacity: 1;
    background: oklch(100% 0 0 / 0.14);
}
.app-snackbar-dismiss:active { transform: scale(var(--press-scale)); }
.app-snackbar-dismiss:focus-visible {
    outline: 0;
    box-shadow: inset 0 0 0 2px oklch(100% 0 0 / 0.32);
}

/* ─── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .header-inner { padding: 0 var(--space-4); }
    .admin-body { padding: var(--space-5) var(--space-5); }
}

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 208px 1fr; }
}

/* ─── Language toggle (top bar) ───────────────────────────────────────── */

.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-400);
}
.lang-option {
    color: var(--ink-400);
    text-decoration: none;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: color var(--duration-2) var(--ease-out-quart),
                background var(--duration-2) var(--ease-out-quart);
}
.lang-option:hover { color: var(--ink-700); background: var(--ink-50); }
.lang-option.active { color: var(--ink-900); font-weight: 600; }
.lang-option:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px oklch(50% 0.098 195 / 0.18);
}
.lang-divider { color: var(--ink-300); user-select: none; }

@media (max-width: 768px) {
    .header-inner { height: 52px; padding: 0 var(--space-3); }
    .brand-tagline { display: none; }
    .user-name-display { display: none; }

    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: calc(var(--z-overlay) + 10);
        width: 260px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform var(--duration-3) var(--ease-out-expo);
    }
    .admin-sidebar.nav-open { transform: translateX(0); }
    .admin-hamburger { display: inline-flex; }
    .admin-body { padding-top: calc(40px + var(--space-6)); }
    .app-snackbar-stack {
        right: var(--space-3);
        left: var(--space-3);
        width: auto;
        bottom: var(--space-3);
    }
}

/* === _workspace.css === */
/*
   Workspace ("/"). Two-panel: companies rail (left, narrow) + reports list (right).
   Plus onboarding empty state.
*/

.workspace {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-5) var(--space-6);
}

@media (max-width: 768px) {
    .workspace { padding: var(--space-3) var(--space-4); }
    /* Stack the reports-feed header so the (sometimes long) action/instruction
       does not collide with the "Workspace" title on narrow screens. */
    .reports-feed-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
    }
    .feed-new-group { width: 100%; }
}

/* ─── Onboarding (no companies, no reports) ───────────────────────────── */

.onboarding {
    max-width: 640px;
    margin: 0 auto;
    padding: var(--space-24) var(--space-4) var(--space-16);
}

.hero { text-align: left; margin-bottom: var(--space-12); }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 28px;
    padding: 0 var(--space-3);
    background: var(--accent-50);
    border: 1px solid var(--accent-100);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-5);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--accent-600);
}

.badge-text {
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    letter-spacing: var(--tracking-wide);
    color: var(--accent-800);
}

.hero-title {
    font-family: var(--font-sans);
    font-size: var(--text-4xl);
    font-weight: var(--weight-semi);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--ink-900);
    margin-bottom: var(--space-4);
}

.title-line { display: block; }
.title-accent { display: block; color: var(--accent-700); }

.hero-subtitle {
    font-size: var(--text-md);
    line-height: var(--leading-base);
    color: var(--ink-600);
    max-width: 52ch;
}

.onboard-action {
    padding: var(--space-6) 0;
    border-top: 1px solid var(--ink-100);
    border-bottom: 1px solid var(--ink-100);
    margin-bottom: var(--space-10);
}

.action-label {
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--ink-500);
    margin-bottom: var(--space-2);
}

.action-desc {
    font-size: var(--text-sm);
    color: var(--ink-600);
    margin-bottom: var(--space-4);
}

.btn-start {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 40px;
    padding: 0 var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--surface);
    background: var(--ink-900);
    border: 1px solid var(--ink-900);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.btn-start:hover { background: var(--ink-800); border-color: var(--ink-800); }
.btn-start:active { transform: scale(var(--press-scale)); }
.btn-start:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.btn-start .arrow { transition: transform var(--duration-2) var(--ease-out-quart); }
.btn-start:hover .arrow { transform: translateX(2px); }

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}
@media (max-width: 720px) { .features { grid-template-columns: 1fr; gap: var(--space-4); } }

.feature-card { padding-top: var(--space-3); }


.feature-card h4 {
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
    margin-bottom: var(--space-1);
}

.feature-card p {
    font-size: var(--text-sm);
    color: var(--ink-600);
    line-height: var(--leading-base);
}

/* ─── Main workspace (has data) ───────────────────────────────────────── */

.workspace-content { display: block; }

.panels {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--space-6);
    align-items: start;
}

@media (max-width: 900px) {
    .panels { grid-template-columns: 1fr; gap: var(--space-4); }
}

/* Companies rail */

.companies-panel {
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    position: sticky;
    top: 76px;
}

.rail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-1) var(--space-2) var(--space-3);
}

.rail-label {
    font-size: var(--text-3xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-500);
}

.rail-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--ink-500);
    border-radius: var(--radius-sm);
    transition: background var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart);
}
.rail-add-btn:hover { background: var(--surface-sunken); color: var(--ink-900); }
.rail-add-btn:focus-visible { outline: 0; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

.workspace-search-box {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    height: 32px;
    padding: 0 var(--space-2);
    margin-bottom: var(--space-2);
    background: var(--surface-muted);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--ink-500);
}

.workspace-search-box input {
    flex: 1;
    height: 100%;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: var(--text-xs);
    color: var(--ink-900);
}
.workspace-search-box input::placeholder { color: var(--ink-400); }
.workspace-search-box:focus-within {
    border: 1px solid var(--accent-200);
    box-shadow: var(--focus-ring);
}

.company-list { display: flex; flex-direction: column; gap: 1px; }

.company-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    height: 32px;
    padding: 0 var(--space-2);
    text-align: left;
    border-radius: var(--radius-sm);
    transition: background var(--duration-1) var(--ease-out-quart);
}
.company-item:hover { background: var(--surface-muted); }
.company-item:active { background: var(--accent-100); transform: scale(var(--press-scale)); }
.company-item:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.company-item.selected { background: var(--accent-50); }
.company-item.selected .company-name { color: var(--accent-800); font-weight: var(--weight-semi); }
.company-item.selected .report-count { color: var(--accent-700); }

.company-name {
    font-size: var(--text-sm);
    color: var(--ink-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.report-count {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
    color: var(--ink-500);
}

@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: oklch(15% 0.014 230 / 0.4);
    z-index: var(--z-overlay);
    animation: backdropIn var(--duration-2) var(--ease-out-quart);
}

/* Reports panel */

.reports-panel {
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-width: 0;
}

.reports-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--ink-100);
}

.feed-header-title-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.sidebar-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--ink-600);
    border-radius: var(--radius-sm);
}
.sidebar-toggle-btn:hover { background: var(--surface-sunken); color: var(--ink-900); }
.sidebar-toggle-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

@media (max-width: 900px) {
    .sidebar-toggle-btn { display: inline-flex; }
    .companies-panel {
        position: fixed;
        top: 0;
        left: 0;
        z-index: calc(var(--z-overlay) + 10);
        width: 260px;
        height: 100vh;
        border-radius: 0;
        border-right: 1px solid var(--ink-200);
        transform: translateX(-100%);
        transition: transform var(--duration-3) var(--ease-out-expo);
    }
    .companies-panel.sidebar-open { transform: translateX(0); }
}

.workspace-header-title {
    font-size: var(--text-xl);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
    margin: 0;
}

.feed-new-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.feed-new-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-1);
}

.feed-new-hint {
    margin: 0;
    font-size: var(--text-2xs);
    color: var(--ink-500);
}

.feed-new-hint--empty {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 var(--space-3);
    color: var(--ink-700);
    background: var(--surface-muted);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
}

.feed-new-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 32px;
    padding: 0 var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    color: var(--surface);
    background: var(--ink-900);
    border: 1px solid var(--ink-900);
    border-radius: var(--radius-full);
    transition: background var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.feed-new-link:hover { background: var(--ink-800); border-color: var(--ink-800); color: var(--surface); }
.feed-new-link:active { transform: scale(var(--press-scale)); }
.feed-new-link:disabled,
.feed-new-link[aria-disabled="true"] {
    opacity: 0.46;
    cursor: not-allowed;
    transform: none;
}

.feed-new-link--secondary {
    color: var(--ink-800);
    background: var(--surface);
    border-color: var(--ink-200);
}
.feed-new-link--secondary:hover { background: var(--surface-sunken); border-color: var(--ink-300); color: var(--ink-900); }
.feed-new-link:focus-visible {
    outline: 0;
    box-shadow: var(--focus-ring);
}

/* Filter toolbar */

.reports-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--ink-100);
    background: var(--surface-muted);
}

.filter-tabs { display: inline-flex; align-items: center; gap: var(--space-1); }

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 28px;
    padding: 0 var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--ink-600);
    border-radius: var(--radius-sm);
    transition: background var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart);
}
.filter-tab:hover { background: var(--surface); color: var(--ink-900); }
.filter-tab.active { background: var(--surface); color: var(--ink-900); box-shadow: var(--shadow-xs); }
.filter-tab:focus-visible { outline: 0; box-shadow: var(--focus-ring); }

.tab-count {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    font-variant-numeric: tabular-nums;
    color: var(--ink-500);
}
.filter-tab.active .tab-count { color: var(--accent-700); }

.report-search {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 32px;
    padding: 0 var(--space-3);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    color: var(--ink-500);
}
.report-search:focus-within {
    border-color: var(--accent-200);
    box-shadow: var(--focus-ring);
}
.search-input {
    width: 200px;
    height: 100%;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: var(--text-sm);
    color: var(--ink-900);
}
.search-input::placeholder { color: var(--ink-400); }

/* Empty state */

.empty-reports {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-16) var(--space-8);
    color: var(--ink-500);
    text-align: center;
}

.empty-icon { color: var(--ink-400); margin-bottom: var(--space-3); }
.empty-reports p { font-size: var(--text-sm); margin: 0; }
.empty-reports__action {
    margin-top: var(--space-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--ink-200);
    background: var(--surface);
    color: var(--ink-700);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    transition: background var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart);
}
.empty-reports__action:hover {
    background: var(--surface-sunken);
    border-color: var(--ink-300);
    color: var(--ink-900);
}
.empty-reports__action:focus-visible {
    outline: 0;
    box-shadow: var(--focus-ring);
}

.reports-spinner { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.reports-loading {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-5);
    border-top: 1px solid var(--ink-100);
}

.reports-loading__row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.8fr) 84px 96px 96px 52px;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-2) 0;
}

.reports-loading__line {
    display: block;
    height: 12px;
    border-radius: var(--radius-xs);
    background: linear-gradient(90deg, var(--ink-100), var(--ink-50), var(--ink-100));
    background-size: 200% 100%;
    animation: reportsSkeletonShimmer 1.4s ease-in-out infinite;
}

.reports-loading__line--company { width: 75%; }
.reports-loading__line--title { width: 100%; height: 14px; }
.reports-loading__line--type { width: 76%; }
.reports-loading__line--status { width: 84%; }
.reports-loading__line--date { width: 92%; }
.reports-loading__line--action { width: 70%; justify-self: end; }

.reports-loading__label {
    margin: var(--space-3) 0 0;
    font-size: var(--text-xs);
    color: var(--ink-500);
}

/* Reports list */

.reports-list { display: flex; flex-direction: column; }

.report-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr) 90px 110px 110px 64px;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--ink-100);
    cursor: pointer;
    transition: background var(--duration-1) var(--ease-out-quart);
}
.report-row:last-child { border-bottom: 0; }
.report-row:hover { background: var(--surface-muted); }
.report-row:focus-visible {
    outline: 0;
    background: var(--surface-muted);
    box-shadow: var(--focus-ring);
}
.report-row--without-company { grid-template-columns: minmax(0, 2fr) 90px 110px 110px 64px; }

.report-company-col {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--ink-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-info { min-width: 0; }

.report-name {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-type-col {
    font-size: var(--text-xs);
    color: var(--ink-600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    height: 22px;
    padding: 0 var(--space-2);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semi);
    letter-spacing: var(--tracking-wide);
    border-radius: var(--radius-full);
    width: max-content;
}
.report-status::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: var(--radius-full);
    background: currentColor;
}
.report-status.draft       { background: var(--ink-100);    color: var(--ink-700); }
.report-status.in-progress { background: var(--accent-50);  color: var(--accent-800); }
.report-status.pending     { background: var(--warning-bg); color: var(--warning); }
.report-status.submitted   { background: var(--accent-100); color: var(--accent-800); }
.report-status.approved    { background: var(--success-bg); color: var(--success); }
.report-status.rejected    { background: var(--danger-bg);  color: var(--danger); }

.report-date {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
    color: var(--ink-500);
    white-space: nowrap;
}

.report-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    justify-content: flex-end;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--ink-500);
    border-radius: var(--radius-sm);
    transition: background var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart);
}
.action-btn:hover { background: var(--surface-sunken); color: var(--ink-900); }
.action-btn.delete:hover { background: var(--danger-bg); color: var(--danger); }
.action-btn:focus-visible { outline: 0; box-shadow: var(--focus-ring); }

/* Pagination */

.load-more-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4) var(--space-5);
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 36px;
    padding: 0 var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-700);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    transition: background var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart);
}
.btn-load-more:hover { background: var(--surface-sunken); border-color: var(--ink-300); }
.btn-load-more:focus-visible { outline: 0; box-shadow: var(--focus-ring); }

.remaining-count {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--ink-500);
    font-variant-numeric: tabular-nums;
}

/* Reveal-on-scroll stagger (used by the report rows) */

.animate-fade-in-up {
    opacity: 0;
    transform: translateY(6px);
    animation: fadeInUp var(--duration-3) var(--ease-out-expo) forwards;
}
.stagger-1 { animation-delay: 20ms; }
.stagger-2 { animation-delay: 50ms; }
.stagger-3 { animation-delay: 80ms; }
.stagger-4 { animation-delay: 110ms; }
.stagger-5 { animation-delay: 140ms; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes reportsSkeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .animate-fade-in-up { animation: none; opacity: 1; transform: none; }
    .reports-loading__line { animation: none; }
    .sidebar-backdrop { animation: none; }
    .companies-panel { transition: none; }
}

@media (max-width: 768px) {
    .reports-feed-header { padding: var(--space-3) var(--space-4); }
    .reports-toolbar { padding: var(--space-2) var(--space-4); flex-wrap: wrap; }
    .report-search { display: none; }
    .feed-new-group { align-items: stretch; }
    .report-row {
        grid-template-columns: 1fr 80px 64px;
        gap: var(--space-2);
        padding: var(--space-3) var(--space-4);
    }
    .report-row .report-company-col,
    .report-row .report-type-col,
    .report-row .report-date {
        display: none;
    }
    .reports-feed-header .feed-new-label { display: inline; }
    .reports-feed-header .feed-new-link svg { display: none; }
    .reports-loading { padding: var(--space-4); }
    .reports-loading__row {
        grid-template-columns: minmax(0, 1fr) 72px 42px;
        gap: var(--space-2);
    }
    .reports-loading__line--company,
    .reports-loading__line--type,
    .reports-loading__line--date {
        display: none;
    }
    .reports-loading__line--status,
    .reports-loading__line--action {
        width: 100%;
    }
}

/* ─── Workspace modal (CompanyDialog) ────────────────────────────────── */

.ws-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-overlay);
    background: oklch(15% 0.014 230 / 0.32);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(48px, 10vh, 96px) var(--space-4) var(--space-6);
    overflow-y: auto;
    animation: ws-modal-fade-in var(--duration-4) var(--ease-out-quart);
}

.ws-modal {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    box-shadow:
        0 1px 2px oklch(15% 0.014 230 / 0.06),
        0 12px 32px oklch(15% 0.014 230 / 0.10);
    padding: var(--space-6) var(--space-6) var(--space-5);
    animation: ws-modal-rise var(--duration-4) var(--ease-out-quart);
}

.ws-modal-title {
    font-family: var(--font-sans);
    font-size: var(--text-lg);
    font-weight: var(--weight-semi);
    letter-spacing: -0.01em;
    color: var(--ink-900);
    margin: 0 0 var(--space-1);
}

.ws-modal-sub {
    font-size: var(--text-sm);
    color: var(--ink-500);
    margin: 0 0 var(--space-5);
    line-height: 1.5;
}

.ws-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.ws-field {
    display: flex;
    flex-direction: column;
}

.ws-field > label {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--ink-700);
    margin-bottom: var(--space-1);
}

.ws-input {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-3);
    background: var(--surface);
    border: 1px solid var(--ink-300);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
    color: var(--ink-900);
    transition:
        border-color var(--duration-2) var(--ease-out-quart),
        box-shadow var(--duration-2) var(--ease-out-quart);
}
.ws-input[data-mono] {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    letter-spacing: 0.04em;
}
.ws-input::placeholder { color: var(--ink-400); }
.ws-input:focus {
    outline: 0;
    border-color: var(--accent-600);
    box-shadow: 0 0 0 3px oklch(50% 0.098 195 / 0.18);
}
.ws-input:user-invalid {
    border-color: var(--danger);
}
.ws-input:user-invalid:focus {
    box-shadow: 0 0 0 3px oklch(58% 0.20 25 / 0.15);
}
.ws-input-invalid,
.ws-input-invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px oklch(58% 0.20 25 / 0.15);
}

.ws-field-help {
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    color: var(--ink-500);
}
.ws-field-error {
    margin-top: var(--space-1);
    font-size: var(--text-xs);
    color: var(--danger);
}

.ws-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--ink-100);
}

.ws-btn-ghost,
.ws-btn-primary {
    height: 44px;
    padding: 0 var(--space-5);
    border-radius: var(--radius-full);
    font: var(--weight-medium) var(--text-sm) var(--font-sans);
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--duration-2) var(--ease-out-quart),
        transform var(--duration-1) var(--ease-out-quart);
}
.ws-btn-ghost {
    background: var(--surface);
    border-color: var(--ink-200);
    color: var(--ink-800);
}
.ws-btn-ghost:hover { background: var(--ink-50); }
.ws-btn-ghost:active { transform: scale(var(--press-scale)); }
.ws-btn-ghost:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ws-btn-primary {
    background: var(--ink-900);
    color: var(--surface);
    box-shadow:
        0 1px 2px oklch(15% 0.014 230 / 0.06),
        0 4px 12px oklch(15% 0.014 230 / 0.05);
}
.ws-btn-primary:hover { background: var(--ink-800); }
.ws-btn-primary:active { transform: scale(var(--press-scale)); }
.ws-btn-primary:focus-visible { outline: none; box-shadow: var(--focus-ring); }

@keyframes ws-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes ws-modal-rise {
    from { opacity: 0; transform: translate3d(0, 8px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .ws-modal-backdrop,
    .ws-modal { animation: none; }
    .ws-btn-primary:active,
    .ws-btn-ghost:active { transform: none; }
}

/* === _auth.css === */
/*
   Auth pages — landing-matched.
   Centered stack: top bar · eyebrow · bold heading (accent emphasis) · sub · card.
   Black-pill primary CTA. Petrol accent reserved for emphasis text, links,
   focus rings. Background is paper-white with one slow aurora wash + masked
   dot grid. Motion respects prefers-reduced-motion.
*/

.auth-page {
    position: relative;
    min-height: 100vh;
    background: var(--surface);
    color: var(--ink-900);
    font-family: var(--font-sans);
    overflow: hidden;
    isolation: isolate;
    display: flex;
    flex-direction: column;
}

/* Aurora wash — one calm gradient pair drifting on a 110s loop. */
.auth-page::before {
    content: '';
    position: absolute;
    inset: -10%;
    z-index: -2;
    background:
        radial-gradient(60% 60% at 18% 18%, oklch(50% 0.098 195 / 0.10), transparent 60%),
        radial-gradient(50% 50% at 86% 78%, oklch(45% 0.080 215 / 0.07), transparent 60%);
    filter: saturate(105%);
    animation: auth-drift 110s ease-in-out infinite alternate;
}

/* Faint dot grid under a radial mask so it fades to clean white near the card. */
.auth-page::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(circle at 1px 1px, oklch(15% 0.014 230 / 0.035) 1px, transparent 1px);
    background-size: 24px 24px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at center, rgba(0,0,0,0.55), transparent 75%);
            mask-image: radial-gradient(ellipse 80% 70% at center, rgba(0,0,0,0.55), transparent 75%);
}

@keyframes auth-drift {
    0%   { transform: translate3d(-2%, -1%, 0) scale(1.04); }
    100% { transform: translate3d(2%, 2%, 0) scale(1.10); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page::before { animation: none; }
}

/* ─── Top bar (brand left, single secondary link right) ──────────────── */

.auth-topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
    padding: var(--space-5) var(--space-6);
}

/* Right-side group: language toggle sits beside the contextual topbar link. */
.auth-topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

/* Brand-logo styles are module-level so VerifyEmail.razor and Terms.razor
   (and any future surface that drops the topbar) still get the brand styling. */
.brand-logo {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-2);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-tight);
    text-decoration: none;
    color: var(--ink-900);
}
.brand-logo .brand-xbrl { color: var(--ink-900); }
.brand-logo .brand-fo   { color: var(--ink-500); font-weight: var(--weight-medium); }

.auth-topbar-link {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-900);
    text-decoration: none;
    transition: color var(--duration-1) var(--ease-out-quart);
}
.auth-topbar-link:hover { color: var(--ink-700); }
.auth-topbar-link:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

/* ─── Centered stack ─────────────────────────────────────────────────── */

.auth-container {
    position: relative;
    z-index: 1;
    flex: 1;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: clamp(var(--space-8), 6vh, var(--space-16)) var(--space-6) var(--space-10);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.auth-eyebrow {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-500);
    margin-bottom: var(--space-4);
}

.auth-headline {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: var(--weight-bold);
    line-height: 1.08;
    letter-spacing: -0.022em;
    color: var(--ink-900);
    margin: 0;
}
.auth-headline .accent { color: var(--accent-700); }

.auth-lede {
    margin: var(--space-3) 0 var(--space-7);
    font-size: var(--text-sm);
    line-height: var(--leading-base);
    color: var(--ink-600);
    max-width: 40ch;
}

/* ─── Card ───────────────────────────────────────────────────────────── */

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    padding: var(--space-7) var(--space-6);
    text-align: left;
    box-shadow: var(--shadow-sm);
}

/* Legacy .auth-header kept for back-compat on Verify/Reset state views.
   Heading + sub now live in the centered stack above the card. */
.auth-header {
    margin-bottom: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.auth-header h1 {
    font-size: var(--text-xl);
    font-weight: var(--weight-semi);
    line-height: 1.15;
    letter-spacing: var(--tracking-tight);
    color: var(--ink-900);
    margin: 0;
}
.auth-header p {
    font-size: var(--text-sm);
    color: var(--ink-600);
    line-height: var(--leading-base);
    margin: 0;
    max-width: 38ch;
}

.header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--accent-50);
    color: var(--accent-700);
    margin: 0 auto var(--space-3);
}
.header-icon svg { width: 22px; height: 22px; }

/* ─── Alerts ─────────────────────────────────────────────────────────── */

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
    border: 1px solid transparent;
}
.auth-alert svg { flex-shrink: 0; margin-top: 1px; }
.auth-alert-error {
    color: var(--danger);
    background: var(--danger-bg);
    border-color: oklch(58% 0.20 25 / 0.18);
}
.auth-alert-success {
    color: var(--success);
    background: var(--success-bg);
    border-color: oklch(58% 0.14 150 / 0.18);
}

/* ─── Form ───────────────────────────────────────────────────────────── */

.auth-form { display: flex; flex-direction: column; gap: var(--space-4); }

.form-group { display: flex; flex-direction: column; gap: var(--space-2); }

.input-label {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-700);
    letter-spacing: 0.002em;
}
.required { color: var(--danger); margin-left: 2px; }

.input-wrapper { position: relative; }

/* Leading icons removed from the new design — kept as no-op for any markup
   that still references .input-icon so we don't break unused pages. */
.input-icon {
    position: absolute;
    top: 50%;
    left: var(--space-3);
    transform: translateY(-50%);
    color: var(--ink-400);
    pointer-events: none;
    width: 18px;
    height: 18px;
    display: none;
}

.input-icon-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-400);
    transition: color var(--duration-1) var(--ease-out-quart),
                background-color var(--duration-1) var(--ease-out-quart);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 0;
    cursor: pointer;
}
.input-icon-btn:hover { color: var(--ink-700); background: var(--ink-50); }
.input-icon-btn:active { transform: scale(var(--press-scale)); }
.input-icon-btn.end { right: var(--space-2); }

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-3);
    font-family: inherit;
    font-size: var(--text-sm);
    color: var(--ink-900);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-md);
    transition: border-color var(--duration-1) var(--ease-out-quart),
                box-shadow var(--duration-1) var(--ease-out-quart);
}
.form-input::placeholder { color: var(--ink-400); }
.form-input:hover { border-color: var(--ink-300); }
.form-input:focus {
    outline: 0;
    border-color: var(--accent-600);
    box-shadow: var(--focus-ring);
}
/* Leading icon is hidden now — drop the extra left padding. */
.form-input.has-icon { padding-left: var(--space-3); }
.form-input.has-end-icon { padding-right: calc(var(--space-3) + 36px); }
.form-input.input-error { border-color: var(--danger); }
.form-input.input-error:focus { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px oklch(58% 0.20 25 / 0.45); }

/* Stripe-style invalid signal: red border after the user has interacted
   with the field (blurred or submitted). :user-invalid fires only after
   first interaction, so empty initial state stays neutral. Pairs with
   HTML5 `required`, `type="email"`, and `minlength` attributes on the
   four auth pages so users see the error inline without needing a
   per-field Blazor validation component. */
.form-input:user-invalid {
    border-color: var(--danger);
}
.form-input:user-invalid:focus {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px oklch(58% 0.20 25 / 0.45);
}

.hint-text { font-size: var(--text-xs); color: var(--ink-500); }

/* Options row */

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-top: calc(var(--space-1) * -1);
}
.form-options-start { justify-content: flex-start; }

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--ink-700);
    cursor: pointer;
    user-select: none;
}

.form-checkbox {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--ink-300);
    border-radius: var(--radius-xs);
    background: var(--surface);
    cursor: pointer;
    transition: background-color var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart);
    position: relative;
    flex-shrink: 0;
}
.form-checkbox:focus { outline: none; box-shadow: var(--focus-ring); }
.form-checkbox:checked {
    background: var(--ink-900);
    border-color: var(--ink-900);
}
.form-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid var(--surface);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-link, .terms-link, .back-link {
    font-size: var(--text-sm);
    color: var(--accent-700);
    text-decoration: none;
    font-weight: var(--weight-medium);
    transition: color var(--duration-1) var(--ease-out-quart);
}
.forgot-link:hover, .terms-link:hover, .back-link:hover {
    color: var(--accent-800);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.forgot-link:focus-visible, .terms-link:focus-visible, .back-link:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}

/* Password strength */

.password-strength { display: flex; flex-direction: column; gap: var(--space-1); }
.password-strength.mb-4 { margin-bottom: var(--space-4); }

.strength-bar {
    width: 100%;
    height: 4px;
    background: var(--ink-100);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.strength-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--duration-2) var(--ease-out-quart),
                background var(--duration-2) var(--ease-out-quart);
}
.strength-width-low    { width: 25%; }
.strength-width-medium { width: 50%; }
.strength-width-good   { width: 75%; }
.strength-width-strong { width: 100%; }
.strength-fill.strength-error   { background: var(--danger); }
.strength-fill.strength-warning { background: var(--warning); }
.strength-fill.strength-info    { background: var(--accent-500); }
.strength-fill.strength-success { background: var(--success); }
.strength-text { font-size: var(--text-xs); font-weight: var(--weight-medium); }
.strength-text.strength-error   { color: var(--danger); }
.strength-text.strength-warning { color: var(--warning); }
.strength-text.strength-info    { color: var(--accent-700); }
.strength-text.strength-success { color: var(--success); }

/* ─── Submit button — black pill, landing-matched ─────────────────────── */

.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 46px;
    width: 100%;
    padding: 0 var(--space-6);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--surface);
    background: var(--ink-900);
    border: 0;
    border-radius: var(--radius-full);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--duration-2) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart),
                box-shadow var(--duration-2) var(--ease-out-quart);
    box-shadow:
        0 1px 2px oklch(15% 0.014 230 / 0.06),
        0 4px 12px oklch(15% 0.014 230 / 0.05);
    margin-top: var(--space-2);
}
.btn-submit svg { transition: transform var(--duration-3) var(--ease-out-quart); }
.btn-submit:hover {
    background: var(--ink-800);
    color: var(--surface);
    box-shadow:
        0 1px 2px oklch(15% 0.014 230 / 0.06),
        0 10px 24px oklch(15% 0.014 230 / 0.12);
}
.btn-submit:hover svg { transform: translateX(2px); }
.btn-submit:active { transform: scale(var(--press-scale)); }
.btn-submit:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-submit:disabled:hover svg { transform: none; }

@media (hover: none) {
    .btn-submit:hover { background: var(--ink-900); }
    .btn-submit:hover svg { transform: none; }
}

/* Loading spinner inside button */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ─── Back-link button (used on Forgot success state, Verify states) ─── */

.btn-back, .btn-back-full {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 44px;
    padding: 0 var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-800);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-full);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart);
}
.btn-back:hover, .btn-back-full:hover {
    background: var(--ink-50);
    border-color: var(--ink-300);
}
.btn-back:active, .btn-back-full:active { transform: scale(var(--press-scale)); }
.btn-back:focus-visible, .btn-back-full:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-full); }
.btn-back-full { width: 100%; }

/* ─── Footer below card ──────────────────────────────────────────────── */

.auth-footer {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--ink-700);
    margin-top: var(--space-5);
}
.auth-footer a {
    color: var(--accent-700);
    font-weight: var(--weight-medium);
    text-decoration: none;
    transition: color var(--duration-1) var(--ease-out-quart);
}
.auth-footer a:hover { color: var(--accent-800); text-decoration: underline; text-underline-offset: 2px; }

.auth-page-footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    text-align: center;
    font-size: var(--text-xs);
    color: var(--ink-500);
    padding: var(--space-6) var(--space-6) var(--space-7);
}

/* ─── State views (verify, reset success/error) ──────────────────────── */

/* Centered card variant used by non-form states (success, invalid-link). */
.auth-card--centered {
    text-align: center;
    padding: var(--space-8) var(--space-6);
}

.loading-state, .success-state, .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-4);
    padding: var(--space-2) 0;
}
.loading-state h1, .success-state h1, .error-state h1 {
    font-size: var(--text-xl);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
    margin: 0;
    letter-spacing: var(--tracking-tight);
}

.state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}
.state-icon.success {
    background: var(--accent-50);
    color: var(--accent-700);
}
.state-icon.error {
    background: var(--danger-bg);
    color: oklch(45% 0.14 25);
}

.state-support-text {
    font-size: var(--text-sm);
    color: var(--ink-600);
    line-height: var(--leading-base);
    max-width: 30ch;
    margin: 0;
}

.pending-illustration {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-5);
}
.pending-illustration img {
    width: 200px;
    max-width: 65%;
    height: auto;
    mix-blend-mode: multiply;
}

.state-text {
    font-size: var(--text-sm);
    color: var(--ink-600);
    line-height: var(--leading-base);
    max-width: 32ch;
}
.error-text   { color: var(--danger);  font-size: var(--text-sm); }
.success-text { color: var(--success); font-size: var(--text-sm); }

/* ─── Resend block (verify email) ────────────────────────────────────── */

.resend-section {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--ink-100);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}
.resend-text {
    font-size: var(--text-xs);
    color: var(--ink-500);
    text-align: center;
    width: 100%;
}
.resend-loading {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--ink-600);
}

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .auth-topbar { padding: var(--space-4); }
    .auth-container { padding: var(--space-6) var(--space-4) var(--space-8); }
    .auth-card { padding: var(--space-6) var(--space-5); }
}

/* === _admin.css === */
/*
   Admin backoffice. Dashboard, Users, Payments, Reports, Companies,
   Translations, Settings.
   Side-rail shell + dense data tables + KPI grid.
*/

/* ─── Page shell ──────────────────────────────────────────────────────── */

.adm-page,
.users-page,
.companies-page,
.settings-page,
.adm-dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    max-width: var(--container-max);
    min-width: 0;
}

.adm-page-header,
.dash-header,
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--ink-100);
}

.adm-page-title,
.dash-title,
.page-title {
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    color: var(--ink-900);
    margin: 0 0 var(--space-1);
    letter-spacing: -0.018em;
}

.adm-page-subtitle,
.dash-subtitle,
.page-subtitle {
    font-size: var(--text-sm);
    color: var(--ink-600);
    margin: 0;
}

/* Uppercase tracked-mono eyebrow — sits above the page title, matches
   the landing's FAROESE FINANCIAL REPORTING kicker pattern. */
.adm-eyebrow,
.page-header__kicker {
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    font-weight: var(--weight-semi);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-500);
    margin: 0 0 var(--space-2);
}

/* Shared <PageHeader> component (Components/Shared/PageHeader.razor) */
.page-header__intro {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}
.page-header__title {
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    color: var(--ink-900);
    margin: 0;
    letter-spacing: -0.018em;
}
.page-header__subtitle {
    font-size: var(--text-sm);
    color: var(--ink-600);
    margin: 0;
}
.page-header__actions { display: inline-flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

/* ─── Empty state ────────────────────────────────────────────────────── */

.admin-empty-state {
    min-height: 200px;
    padding: var(--space-8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.admin-empty-state__icon {
    display: inline-flex;
    color: var(--ink-500);
    opacity: 0.5;
    margin-bottom: var(--space-3);
}
.admin-empty-state__title {
    margin: 0 0 var(--space-2);
    font-size: var(--text-lg);
    font-weight: var(--weight-semi);
    color: var(--ink-800);
}
.admin-empty-state__subtitle {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--ink-600);
    opacity: 0.9;
}
.admin-empty-state__action {
    margin-top: var(--space-4);
}

.header-content { display: flex; flex-direction: column; gap: var(--space-1); }
.header-text { display: flex; flex-direction: column; gap: var(--space-1); }
.header-actions { display: inline-flex; align-items: center; gap: var(--space-2); }

.header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--ink-100);
    color: var(--ink-700);
}
/* All card-header icons share one calm neutral treatment — the design system
   carries a single accent, and per-section icon tints (orange/green/teal) read
   as inconsistent "slop". Status colour lives in the badges, not the chrome. */
.header-icon.email,
.header-icon.payment,
.header-icon.pricing,
.header-icon.system { background: var(--ink-100); color: var(--ink-700); }

/* `.header-icon` is a global class also used by the centered auth header, which
   sets `margin: 0 auto …`. In an admin card header the icon sits inline beside
   its title, so reset the inherited auto margins (scoped, so auth is untouched). */
.card-header .header-icon,
.app-info-header .header-icon { margin: 0; }

/* ─── KPI grid ────────────────────────────────────────────────────────── */

.adm-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

.adm-kpi-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5);
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    transition: border-color var(--duration-1) var(--ease-out-quart),
                box-shadow var(--duration-1) var(--ease-out-quart);
}
.adm-kpi-card--link {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.adm-kpi-card--link:hover {
    border-color: var(--ink-200);
    box-shadow: var(--shadow-sm);
}

.adm-kpi-label {
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-500);
}

.adm-kpi-value {
    font-family: var(--font-mono);
    font-size: var(--text-2xl);
    font-weight: var(--weight-semi);
    font-variant-numeric: tabular-nums;
    color: var(--ink-900);
    line-height: 1;
}
.adm-kpi-value--warn { color: var(--warning); }
.adm-kpi-value--error { color: var(--danger); }

.adm-kpi-trend {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--ink-500);
}
.adm-kpi-trend.neutral { color: var(--ink-500); }
.adm-kpi-trend.up      { color: var(--success); }
.adm-kpi-trend.down    { color: var(--danger); }

.adm-kpi-skeleton .adm-skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, var(--ink-100), var(--ink-50), var(--ink-100));
    background-size: 200% 100%;
    border-radius: var(--radius-xs);
    animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── Two-col layout ──────────────────────────────────────────────────── */

.adm-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: var(--space-4);
    align-items: start;
}
@media (max-width: 1100px) {
    .adm-two-col { grid-template-columns: 1fr; }
}

/* ─── Panel ───────────────────────────────────────────────────────────── */

.adm-panel {
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.adm-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--ink-100);
}

.adm-panel-title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
    margin: 0;
}

.adm-panel-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    white-space: nowrap;
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--accent-700);
    text-decoration: none;
    flex-shrink: 0;
}
.adm-panel-link:hover { color: var(--accent-800); text-decoration: underline; }
.adm-inline-link {
    margin-top: var(--space-3);
    display: inline-block;
}

/* ─── Filter row + search ─────────────────────────────────────────────── */

.adm-filter-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--surface-muted);
    border-bottom: 1px solid var(--ink-100);
    flex-wrap: wrap;
}

.adm-search-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 360px;
}
.adm-search-icon {
    position: absolute;
    top: 50%;
    left: var(--space-3);
    transform: translateY(-50%);
    color: var(--ink-400);
    pointer-events: none;
}
.adm-search {
    width: 100%;
    height: 32px;
    padding: 0 var(--space-3) 0 calc(var(--space-3) + 16px + var(--space-2));
    font-size: var(--text-sm);
    color: var(--ink-900);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    transition: border-color var(--duration-1) var(--ease-out-quart),
                box-shadow var(--duration-1) var(--ease-out-quart);
}
.adm-search:focus { outline: 0; box-shadow: var(--focus-ring); }

.adm-select {
    height: 32px;
    /* room for the custom chevron on the right */
    padding: 0 calc(var(--space-3) + 16px) 0 var(--space-3);
    font-size: var(--text-sm);
    color: var(--ink-800);
    background-color: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    cursor: pointer;
    /* strip the native OS dropdown chrome so it matches .adm-search */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    /* custom ink-500 chevron */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-2) center;
    transition: border-color var(--duration-1) var(--ease-out-quart),
                box-shadow var(--duration-1) var(--ease-out-quart);
}
.adm-select:focus { outline: 0; box-shadow: var(--focus-ring); }

/* ─── Tables ──────────────────────────────────────────────────────────── */

.adm-table-wrap { overflow-x: auto; }
.adm-table-surface {
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-top: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
}

.adm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.adm-table thead th {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-500);
    background: var(--surface-muted);
    border-bottom: 1px solid var(--ink-100);
    text-align: left;
    white-space: nowrap;
}
.adm-table thead th.adm-th-mono { font-family: var(--font-mono); text-align: right; }
.adm-table thead th.adm-th-select { width: 36px; }
.adm-table thead th.adm-th-actions { width: 130px; }

.adm-table tbody td,
.adm-table tbody tr td {
    padding: var(--space-3) var(--space-4);
    color: var(--ink-800);
    border-bottom: 1px solid var(--ink-100);
    vertical-align: middle;
}
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-table tbody tr.adm-tr { cursor: pointer; transition: background var(--duration-1) var(--ease-out-quart); }
.adm-table tbody tr.adm-tr:hover { background: var(--surface-muted); }
.adm-table tbody tr.adm-tr.is-selected {
    background: var(--accent-50);
    box-shadow: inset 3px 0 0 var(--accent-600);
}

.adm-col-actions { width: 92px; }

.adm-td-mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.adm-cell-primary {
    font-weight: var(--weight-medium);
    color: var(--ink-900);
}
.adm-cell-secondary {
    font-size: var(--text-xs);
    color: var(--ink-500);
}
.adm-cell-muted { color: var(--ink-400); }
.adm-cell-date-primary { font-size: var(--text-sm); color: var(--ink-900); }
.adm-cell-user { display: flex; align-items: center; gap: var(--space-2); }
.adm-inline-separator {
    margin-left: var(--space-2);
    color: var(--ink-400);
}
.adm-inline-gap { margin-left: var(--space-1); }
.adm-company-vtal { color: var(--ink-700); }

.adm-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--ink-100);
    color: var(--ink-700);
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    flex-shrink: 0;
}

.adm-company-badge {
    font-size: var(--text-xs);
    color: var(--ink-500);
    padding: 2px var(--space-2);
    background: var(--ink-50);
    border-radius: var(--radius-xs);
}

.adm-table-total td {
    background: var(--surface-muted);
    font-weight: var(--weight-semi);
}

.adm-empty,
.adm-empty-cell {
    text-align: center;
    padding: var(--space-12) var(--space-4);
    color: var(--ink-500);
    font-size: var(--text-sm);
}

.adm-row-skeleton td .adm-skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, var(--ink-100), var(--ink-50), var(--ink-100));
    background-size: 200% 100%;
    border-radius: var(--radius-xs);
    animation: shimmer 1.4s ease-in-out infinite;
}

.adm-status-table { width: 100%; border-collapse: collapse; }
.adm-status-table td {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--ink-800);
    border-bottom: 1px solid var(--ink-100);
    vertical-align: middle;
}
.adm-status-table tr:last-child td { border-bottom: 0; }
.adm-status-table .adm-table-total td { background: var(--surface-muted); font-weight: var(--weight-semi); }

/* ─── Translation editor: missing-FO row highlight ───────────────────── */

.adm-row--missing-fo { box-shadow: inset 3px 0 0 0 var(--warning); background: var(--warning-bg); }
.adm-table tbody tr.adm-tr.adm-row--missing-fo:hover { background: var(--warning-bg); box-shadow: inset 3px 0 0 0 var(--warning); }

/* ─── Translation editor table ────────────────────────────────────────── */

.adm-table--translations {
    table-layout: fixed;
    min-width: 1100px;
}
.adm-table--translations th:nth-child(1) { width: 24%; }
.adm-table--translations th:nth-child(2) { width: 23%; }
.adm-table--translations th:nth-child(3) { width: 23%; }
.adm-table--translations th:nth-child(4) { width: 20%; }
.adm-table--translations th:nth-child(5) { width: 120px; }
.adm-table--translations th:nth-child(6) { width: 92px; }

.adm-translation-key {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    line-height: 1.45;
    color: var(--ink-800);
    white-space: nowrap;
}

.adm-inline-input {
    width: 100%;
    height: 34px;
    padding: 0 var(--space-2);
    font-size: var(--text-sm);
    color: var(--ink-900);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    transition: border-color var(--duration-1) var(--ease-out-quart),
                box-shadow var(--duration-1) var(--ease-out-quart);
}
.adm-inline-input:focus {
    outline: 0;
    box-shadow: var(--focus-ring);
}
.adm-inline-input::placeholder { color: var(--ink-400); }

/* ─── Settings: editable price row ──────────────────────────────────────── */
.setting-price-edit {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.setting-price-edit .adm-inline-input {
    width: 96px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.setting-price-unit {
    font-size: var(--text-sm);
    color: var(--ink-500);
}
.settings-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-3);
}

/* ─── Numbers ─────────────────────────────────────────────────────────── */

.adm-num {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--ink-900);
    font-weight: var(--weight-medium);
}
.adm-num--warn { color: var(--warning); }

.adm-mono-sm {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
}

.adm-timestamp {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
    color: var(--ink-500);
    white-space: nowrap;
}

.adm-discount { font-size: var(--text-xs); color: var(--success); font-weight: var(--weight-medium); }

/* ─── Activity rows (dashboard) ───────────────────────────────────────── */

.adm-activity-list { display: flex; flex-direction: column; }
.adm-activity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--ink-100);
}
.adm-activity-row:last-child { border-bottom: 0; }
.adm-activity-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-activity-name { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--ink-900); }
.adm-activity-sub  { font-size: var(--text-xs); color: var(--ink-500); }
.adm-activity-right { display: flex; align-items: center; gap: var(--space-3); }
.adm-activity-amount {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: var(--weight-semi);
    color: var(--ink-900);
}

/* ─── Pagination ──────────────────────────────────────────────────────── */

.adm-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--ink-100);
    background: var(--surface-muted);
    flex-wrap: wrap;
}
.adm-pagination-info { font-size: var(--text-xs); color: var(--ink-500); }
.adm-pagination-btns { display: inline-flex; align-items: center; gap: var(--space-3); }
.adm-pg-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-700);
    padding: 0 var(--space-1);
    font-variant-numeric: tabular-nums;
}

.adm-pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 32px;
    padding: 0 var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--ink-700);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-full);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart);
}
.adm-pg-btn:hover:not(:disabled) { background: var(--surface-sunken); border-color: var(--ink-300); }
.adm-pg-btn:disabled,
.adm-pg-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.adm-pg-btn svg { width: 12px; height: 12px; }

/* ─── Actions ─────────────────────────────────────────────────────────── */

.adm-actions { display: inline-flex; align-items: center; gap: var(--space-1); }

.adm-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--ink-500);
    border-radius: var(--radius-sm);
    transition: background var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.adm-action-btn:hover { background: var(--surface-sunken); color: var(--ink-900); }
.adm-action-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.adm-action-btn:active { transform: scale(var(--press-scale)); }

/* Ghost pill — secondary actions (Export CSV, Cancel, Retry). */
.adm-btn-secondary,
.adm-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 38px;
    padding: 0 var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-800);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-full);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart);
}
.adm-btn-secondary:hover,
.adm-retry-btn:hover {
    background: var(--surface-sunken);
    border-color: var(--ink-300);
}

/* Header action cluster — export/import/create. Wraps onto its own line on
   narrow viewports rather than overflowing the header. */
.adm-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

/* File-upload styled as a ghost pill: the native <input> is layered invisibly
   over the label so the whole pill is the click target. */
.adm-btn-file {
    position: relative;
    overflow: hidden;
}
.adm-btn-file input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.adm-btn-file:has(input[type="file"]:disabled) {
    opacity: 0.55;
    pointer-events: none;
}

/* Primary CTA — black pill (matches landing's "Create your report").
   Drop accent-fill; accent is reserved for emphasis text + links + rings. */
.adm-btn-primary,
.btn-create-user,
.btn-create-company {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 38px;
    padding: 0 var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--surface);
    background: var(--ink-900);
    border: 0;
    border-radius: var(--radius-full);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--duration-2) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart),
                box-shadow var(--duration-2) var(--ease-out-quart);
    box-shadow: 0 1px 2px oklch(15% 0.014 230 / 0.06),
                0 4px 12px oklch(15% 0.014 230 / 0.05);
}
.adm-btn-primary:hover,
.btn-create-user:hover,
.btn-create-company:hover {
    background: var(--ink-800);
    color: var(--surface);
    box-shadow: 0 1px 2px oklch(15% 0.014 230 / 0.06),
                0 10px 24px oklch(15% 0.014 230 / 0.12);
}
.adm-btn-primary:active,
.btn-create-user:active,
.btn-create-company:active { transform: scale(0.985); }

/* ─── Drawer ──────────────────────────────────────────────────────────── */

/* Drawer host wraps the page + drawer in a relative parent so the absolutely
   positioned drawer overlays the table. When the drawer is open, the main
   content gets `.adm-drawer-host--open` which dims the page to 55%. */
.adm-drawer-host {
    position: relative;
    min-height: 0;
}
.adm-drawer-host--open .adm-drawer-main {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity var(--duration-2) var(--ease-out-quart);
}

.adm-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 520px;
    background: var(--surface);
    border-left: 1px solid var(--ink-100);
    box-shadow: -20px 0 60px oklch(15% 0.014 230 / 0.08);
    display: flex;
    flex-direction: column;
    z-index: var(--z-drawer, 90);
    animation: slideInRight var(--duration-3) var(--ease-out-expo);
}

.adm-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6) var(--space-4);
    border-bottom: 1px solid var(--ink-100);
    gap: var(--space-3);
}
.adm-drawer-head-info {
    min-width: 0;
    flex: 1;
}
.adm-drawer-head h3 {
    font-size: var(--text-xl);
    font-weight: var(--weight-bold);
    letter-spacing: -0.012em;
    color: var(--ink-900);
    margin: 0 0 var(--space-1);
}
.adm-drawer-head .adm-drawer-sub {
    font-size: var(--text-sm);
    color: var(--ink-500);
}

.adm-drawer-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-muted);
    color: var(--ink-700);
    border: 0;
    border-radius: var(--radius-full);
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.adm-drawer-close:hover { background: var(--ink-100); color: var(--ink-900); }
.adm-drawer-close:active { transform: scale(var(--press-scale)); }

.adm-drawer-body {
    padding: var(--space-5) var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    flex: 1;
    overflow-y: auto;
}
.adm-drawer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--ink-100);
    background: var(--surface-muted);
}

.adm-drawer-section h4 {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semi);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-500);
    margin: 0 0 var(--space-3);
}

.adm-drawer-empty {
    font-size: var(--text-sm);
    color: var(--ink-500);
    padding: var(--space-3) 0;
}

/* Compact stat tiles inside the drawer (Reports / Payments / Spent). */
.adm-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
}
.adm-stat-tile {
    padding: var(--space-3) var(--space-4);
    background: var(--surface-muted);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-sm);
}
.adm-stat-val {
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.adm-stat-label {
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    font-weight: var(--weight-semi);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-500);
    margin-top: var(--space-2);
}

/* Compact pill cards for assigned-companies / drawer-list rows. */
.adm-drawer-list { display: flex; flex-direction: column; gap: var(--space-2); }
.adm-drawer-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-3);
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-sm);
}
.adm-drawer-row-body { flex: 1; min-width: 0; }
.adm-drawer-row-title { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--ink-900); display: inline-flex; align-items: center; gap: var(--space-2); }
.adm-drawer-row-meta { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-500); margin-top: 2px; font-variant-numeric: tabular-nums; }
.adm-drawer-row-meta--plain {
    font-family: inherit;
    letter-spacing: 0;
}
.adm-drawer-row-actions { display: inline-flex; gap: var(--space-1); flex-shrink: 0; }

.adm-drawer-report {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--ink-50);
    font-size: var(--text-sm);
}
.adm-drawer-report:last-child { border-bottom: 0; }
.adm-drawer-report-meta {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-500);
    margin-top: 2px;
}

.animate-slide-in-right {
    animation: slideInRight var(--duration-3) var(--ease-out-expo);
}
@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .adm-drawer,
    .animate-slide-in-right { animation: none; }
    .adm-drawer-host--open .adm-drawer-main { transition: none; }
    .adm-modal-backdrop { animation: none; }
    .adm-modal { animation: none; }
    .adm-kpi-skeleton .adm-skeleton-line,
    .adm-row-skeleton td .adm-skeleton-line { animation: none; background: var(--ink-100); }
}

/* ─── KPI strip — clickable filter cells ──────────────────────────────── */

.adm-kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--ink-100);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.adm-kpi-cell {
    background: var(--surface);
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    cursor: pointer;
    border: 0;
    font-family: inherit;
    text-align: left;
    color: inherit;
    transition: background var(--duration-1) var(--ease-out-quart);
}
.adm-kpi-cell:hover { background: var(--surface-muted); }
.adm-kpi-cell:focus-visible {
    outline: 0;
    box-shadow: inset 0 0 0 2px var(--accent-600);
}
.adm-kpi-cell--static {
    cursor: default;
    gap: var(--space-1);
}
.adm-kpi-cell--static:hover { background: var(--surface); }
/* Settings metadata cells read as a quiet bar: small uppercase label (markup-ordered
   first) over a restrained body-size value — not the large stat numbers used elsewhere. */
.adm-kpi-cell--static .adm-kpi-cell-val {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    line-height: 1.2;
}
.adm-kpi-cell.is-active {
    background: var(--accent-50);
}
.adm-kpi-cell.is-active .adm-kpi-cell-val { color: var(--accent-700); }
.adm-kpi-cell.is-active .adm-kpi-cell-label { color: var(--accent-700); }

.adm-check-success {
    color: var(--success);
    margin-left: 4px;
}

.adm-cell-never {
    color: var(--ink-400);
    font-size: var(--text-xs);
}

.adm-kpi-cell-val {
    font-family: var(--font-mono);
    font-size: var(--text-2xl);
    font-weight: var(--weight-semi);
    font-variant-numeric: tabular-nums;
    color: var(--ink-900);
    line-height: 1;
}
.adm-kpi-cell-label {
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    font-weight: var(--weight-semi);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-500);
}

@media (max-width: 880px) {
    .adm-kpi-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .adm-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }
    .adm-kpi-card {
        padding: var(--space-3) var(--space-4);
    }
    .adm-activity-row {
        padding: var(--space-3);
    }
    .adm-activity-amount {
        font-size: var(--text-sm);
    }
    .adm-status-table td {
        padding: var(--space-2) var(--space-3);
    }
    .adm-panel-header {
        padding: var(--space-3);
    }
}

/* ─── Search + toolbar (native) ───────────────────────────────────────── */

.adm-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-bottom: 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    flex-wrap: wrap;
}
.adm-toolbar-spacer { flex: 1; }

/* ─── Form fields used inside .adm-modal ──────────────────────────────── */

.adm-form { display: flex; flex-direction: column; gap: var(--space-4); }
.adm-form-section { display: flex; flex-direction: column; gap: var(--space-3); }
.adm-form-section + .adm-form-section {
    padding-top: var(--space-4);
    border-top: 1px solid var(--ink-100);
}
.adm-form-section-label {
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    font-weight: var(--weight-semi);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-500);
    margin: 0;
}

.adm-field { display: flex; flex-direction: column; gap: 6px; }
.adm-field--span-2 { grid-column: span 2; }
.adm-field--end { justify-content: flex-end; }
.adm-field--grow { flex: 1; }
.adm-field label {
    font-size: var(--text-xs);
    color: var(--ink-600);
    font-weight: var(--weight-medium);
}
.adm-field input[type="text"],
.adm-field input[type="email"],
.adm-field input[type="password"],
.adm-field input[type="tel"],
.adm-field select,
.adm-field textarea {
    height: 38px;
    padding: 0 var(--space-3);
    font: var(--weight-regular) var(--text-sm)/1 var(--font-sans);
    color: var(--ink-900);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    transition: border-color var(--duration-1) var(--ease-out-quart),
                box-shadow var(--duration-1) var(--ease-out-quart);
}
.adm-field input.mono-font,
.adm-field input[data-mono] {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}
.adm-field input:focus,
.adm-field select:focus,
.adm-field textarea:focus {
    outline: 0;
    box-shadow: var(--focus-ring);
}
.adm-field input[aria-invalid="true"],
.adm-field select[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px oklch(58% 0.20 25 / 0.12); }
.adm-field-help { font-size: var(--text-xs); color: var(--ink-500); }
.adm-field-help.danger { color: var(--danger); }
.adm-field-error { font-size: var(--text-xs); color: var(--danger); }

.adm-field-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}
.adm-field-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
}
@media (max-width: 560px) {
    .adm-field-grid-2,
    .adm-field-grid-3 { grid-template-columns: 1fr; }
}

/* Checkbox row (Active / Email verified). */
.adm-switch-row {
    display: flex;
    gap: var(--space-5);
    flex-wrap: wrap;
}
.adm-switch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--ink-800);
    user-select: none;
}
.adm-switch input { width: 16px; height: 16px; accent-color: var(--accent-600); cursor: pointer; }

.adm-company-picker {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-sm);
    padding: var(--space-2);
}

.adm-company-picker__row {
    display: flex;
    padding: var(--space-2);
    border-radius: var(--radius-xs);
}

.adm-company-picker__name { flex: 1; }

.adm-company-picker__vtal { color: var(--ink-500); }

.adm-company-add-row {
    display: flex;
    gap: var(--space-2);
    align-items: flex-end;
}

/* Wide modal variant — used for Edit user + Edit/Create company which carry
   more fields than the default 420px confirm width. */
.adm-modal--wide {
    max-width: 560px;
}
.adm-modal--xl {
    max-width: 680px;
}
.adm-modal-head { display: flex; flex-direction: column; gap: var(--space-1); }
.adm-modal-head .adm-eyebrow { margin: 0; color: var(--accent-700); }
.adm-modal-head h2 { margin: 0; }
.adm-modal-sub { font-size: var(--text-sm); color: var(--ink-600); margin: 0; }

/* Search input inside the toolbar. */
.adm-toolbar .adm-search-wrap { flex: 0 1 360px; }

/* Selected-bulk banner — native inline toolbar. */
.adm-bulk-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--accent-50);
    border-top: 1px solid var(--accent-100);
    border-bottom: 1px solid var(--accent-100);
    font-size: var(--text-sm);
    color: var(--accent-800);
}
.adm-bulk-banner strong { font-weight: var(--weight-semi); }

/* ─── Detail grid (drawer + record views) ─────────────────────────────── */

.adm-detail-grid { display: flex; flex-direction: column; gap: var(--space-2); }
.adm-detail-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: var(--space-3);
    align-items: baseline;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--ink-50);
}
.adm-detail-row:last-child { border-bottom: 0; }
.adm-detail-label {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--ink-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.adm-detail-val {
    font-size: var(--text-sm);
    color: var(--ink-900);
    overflow-wrap: anywhere;
}
.adm-detail-bold { font-weight: var(--weight-semi); }

/* ─── Badges ──────────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    height: 22px;
    padding: 0 var(--space-2);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semi);
    letter-spacing: 0.02em;
    border-radius: var(--radius-xs);
    white-space: nowrap;
}
.badge-neutral   { background: var(--ink-100);    color: var(--ink-700); }
.badge-success   { background: var(--success-bg); color: var(--success); }
.badge-error     { background: var(--danger-bg);  color: var(--danger); }
.badge-warning   { background: var(--warning-bg); color: var(--warning); }
.badge-info      { background: var(--accent-50);  color: var(--accent-800); }
.badge-pending   { background: var(--warning-bg); color: var(--warning); }
.badge-submitted { background: var(--accent-100); color: var(--accent-800); }
.badge-annual    { background: var(--accent-50);  color: var(--accent-800); }
.badge-tax       { background: var(--ink-100);    color: var(--ink-800); }

/* ─── Status dots ─────────────────────────────────────────────────────── */

.adm-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--ink-300);
    flex-shrink: 0;
}
.adm-dot--draft     { background: var(--ink-300); }
.adm-dot--pending   { background: var(--warning); }
.adm-dot--progress  { background: var(--accent-500); }
.adm-dot--submitted { background: var(--success); }

/* ─── Settings (info + setting cards) ─────────────────────────────────── */

/* Masonry column flow rather than a 2×2 grid: with a CSS grid, the short
   Pricing card sits in the same row as the tall Stripe card and leaves a void
   beneath it. Columns pack each card directly under the previous one, so cards
   of uneven height tile tightly with no gaps. */
.settings-grid {
    columns: 2;
    column-gap: var(--space-4);
}
.settings-grid > .settings-card {
    break-inside: avoid;
    margin-bottom: var(--space-4);
}
@media (max-width: 720px) {
    .settings-grid { columns: 1; }
}

.settings-card,
.app-info-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.card-header,
.app-info-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--ink-100);
}

.card-title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
    margin: 0;
}
.card-subtitle { font-size: var(--text-xs); color: var(--ink-500); margin: 0; }
.card-content { padding: var(--space-3) var(--space-5); }
.card-note {
    font-size: var(--text-xs);
    color: var(--ink-500);
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--ink-100);
    background: var(--surface-muted);
}
.card-note.future { color: var(--accent-700); background: var(--accent-50); }

.settings-list { display: flex; flex-direction: column; }
.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--ink-50);
}
.setting-item:last-child { border-bottom: 0; }
.setting-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setting-label { font-size: var(--text-sm); color: var(--ink-800); font-weight: var(--weight-medium); }
.setting-description { font-size: var(--text-xs); color: var(--ink-500); }

.setting-value { font-size: var(--text-sm); color: var(--ink-900); }
.setting-value.highlight { color: var(--accent-700); font-weight: var(--weight-semi); }
.setting-value.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.setting-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    height: 22px;
    padding: 0 var(--space-2);
    font-size: var(--text-3xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--radius-xs);
    background: var(--ink-100);
    color: var(--ink-700);
}
.setting-badge.active   { background: var(--success-bg); color: var(--success); }
.setting-badge.live     { background: var(--success-bg); color: var(--success); }
.setting-badge.test     { background: var(--warning-bg); color: var(--warning); }

/* App info grid (Settings page) */

.app-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
}
.info-item { display: flex; flex-direction: column; gap: 2px; }
.info-label {
    font-size: var(--text-3xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-500);
}
.info-value { font-size: var(--text-sm); color: var(--ink-900); }

/* ─── Misc error inline ───────────────────────────────────────────────── */

.adm-error-inline {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    margin: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid oklch(58% 0.20 25 / 0.18);
    border-radius: var(--radius-sm);
}

.adm-notice-inline {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    margin: var(--space-3) 0;
    font-size: var(--text-sm);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    color: var(--ink-700);
}
.adm-notice-inline.is-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: oklch(63% 0.11 157 / 0.2);
}
.adm-notice-inline.is-error {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: oklch(58% 0.2 25 / 0.2);
}
.adm-notice-inline.is-warn {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: oklch(72% 0.16 85 / 0.24);
}
.adm-notice-inline.is-info {
    background: var(--accent-50);
    color: var(--accent-800);
    border-color: oklch(55% 0.1 195 / 0.22);
}

.companies-page .company-list { display: flex; flex-direction: column; gap: var(--space-2); }
.label-col { font-weight: var(--weight-medium); color: var(--ink-700); }

/* ─── Confirm modal (delete confirmation, etc.) ──────────────────────── */

.adm-modal-backdrop {
    position: fixed;
    inset: 0;
    background: oklch(15% 0.014 230 / 0.45);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    animation: adm-fade-in var(--duration-2) var(--ease-out-quart);
}
@keyframes adm-fade-in { from { opacity: 0; } to { opacity: 1; } }

.adm-modal {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    animation: adm-modal-enter var(--duration-4) var(--ease-out-expo);
}

/* Keyboard focus rings on admin buttons (input/search/action already covered). */
.adm-btn-primary:focus-visible,
.btn-create-user:focus-visible,
.btn-create-company:focus-visible,
.adm-btn-secondary:focus-visible,
.adm-retry-btn:focus-visible,
.adm-btn-danger:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}
@keyframes adm-modal-enter {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.adm-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger-bg);
    color: var(--danger);
}
.adm-modal-icon.danger { background: var(--danger-bg); color: var(--danger); }
.adm-modal-icon.warning { background: var(--warning-bg); color: var(--warning); }

.adm-modal h2 {
    font-size: var(--text-lg);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
    margin: 0;
    letter-spacing: -0.005em;
}
.adm-modal p {
    font-size: var(--text-sm);
    color: var(--ink-600);
    line-height: var(--leading-base);
    margin: 0;
}
.adm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

/* Destructive confirm — red pill. Used ONLY in the confirm modal, never
   as a bare row action. */
.adm-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 38px;
    padding: 0 var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--surface);
    background: var(--danger);
    border: 0;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.adm-btn-danger:hover { background: oklch(50% 0.20 25); }
.adm-btn-danger:active { transform: scale(0.985); }

/* === _wizard.css === */
/*
   Wizard. The five-step accounting report flow (Annual + Tax).
   Shell (top bar + step nav + footer) + per-step content (forms, ledger
   tables, balance indicator, policy text, review).
*/

/* ─── Shell ───────────────────────────────────────────────────────────── */

.wizard-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    background: var(--surface);
}

.wizard-shell::before {
    content: "";
    position: fixed;
    inset: -20%;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(50% 44% at 18% 14%, oklch(50% 0.098 195 / 0.08), transparent 62%),
        radial-gradient(42% 36% at 86% 12%, oklch(45% 0.080 215 / 0.055), transparent 62%);
}

.wizard-shell::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(circle at 1px 1px, oklch(15% 0.014 230 / 0.026) 1px, transparent 1px);
    background-size: 24px 24px;
    -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 32%, rgba(0, 0, 0, 0.45), transparent 76%);
            mask-image: radial-gradient(ellipse 70% 55% at 50% 32%, rgba(0, 0, 0, 0.45), transparent 76%);
}

.wizard-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--surface);
    border-bottom: 1px solid var(--ink-200);
}

.wizard-header .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 var(--space-6);
    gap: var(--space-4);
}

.wizard-header .header-left,
.wizard-header .header-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.wizard-header .btn-back {
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--ink-600);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.wizard-header .btn-back:hover { background: var(--surface-sunken); color: var(--ink-900); }
.wizard-header .btn-back:active { transform: scale(var(--press-scale)); }

.brand-container { display: flex; flex-direction: column; gap: 2px; }

/* Save indicator */

.save-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 28px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    transition: background var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart);
}
.save-indicator.saved   { background: var(--success-bg); color: var(--success); }
.save-indicator.saving  { background: var(--accent-50);  color: var(--accent-700); }
.save-indicator.error   { background: var(--danger-bg);  color: var(--danger); }
.save-indicator.idle    { background: var(--ink-100);    color: var(--ink-500); }

.save-icon { display: inline-flex; align-items: center; justify-content: center; }
.save-pulse {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: currentColor;
    animation: pulse 1.2s var(--ease-out-quart) infinite;
}
.save-indicator.idle .save-pulse {
    animation: none;
    opacity: 0.72;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.save-text { white-space: nowrap; }

/* ─── Step nav (timeline of step tabs) ────────────────────────────────── */

.wizard-nav {
    background: oklch(99% 0.003 230 / 0.86);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ink-100);
    overflow-x: auto;
}

.step-tabs {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, minmax(112px, 1fr));
    align-items: stretch;
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 var(--space-6);
    min-height: 56px;
}

.step-progress-fill {
    position: absolute;
    left: var(--space-6);
    bottom: 0;
    width: calc((100% - (var(--space-6) * 2)) * var(--wizard-progress, 0) / 100);
    height: 2px;
    background: var(--accent-600);
    transform-origin: left center;
    transition: width var(--duration-3) var(--ease-out-quint);
}

.step-tab {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0 var(--space-3);
    min-width: 0;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-500);
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    cursor: default;
    transition:
        color var(--duration-1) var(--ease-out-quart),
        border-color var(--duration-2) var(--ease-out-quart),
        transform var(--duration-1) var(--ease-out-quart);
    white-space: nowrap;
    text-decoration: none;
}
.step-tab.clickable { cursor: pointer; }
.step-tab.clickable:hover { color: var(--ink-800); }
.step-tab.clickable:active { transform: scale(var(--press-scale)); }
.step-tab.completed { color: var(--ink-700); }
.step-tab.completed .step-tab-number { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.step-tab.completed .step-tab-num { display: none; }
.step-tab.completed .step-tab-check { display: inline-flex; }
.step-tab.current   { color: var(--ink-900); border-bottom-color: var(--accent-600); font-weight: var(--weight-semi); }
.step-tab.current .step-tab-number {
    background: var(--accent-600);
    color: var(--surface);
    border-color: var(--accent-600);
    transform: scale(1.04);
}
.step-tab.incomplete .step-tab-number { background: var(--surface); color: var(--ink-600); border-color: var(--ink-300); }
.step-tab:disabled { opacity: 0.6; }

.step-tab-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: var(--surface);
    border: 1px solid var(--ink-300);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semi);
    color: var(--ink-600);
    transition:
        background var(--duration-1) var(--ease-out-quart),
        color var(--duration-1) var(--ease-out-quart),
        border-color var(--duration-1) var(--ease-out-quart),
        transform var(--duration-1) var(--ease-out-quart);
}

.step-tab-num { display: inline-flex; align-items: center; justify-content: center; }
.step-tab-check { display: none; width: 13px; height: 13px; }

.progress-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--ink-300);
    align-self: center;
}

/* ─── Content frame ───────────────────────────────────────────────────── */

.content-frame {
    flex: 1;
    max-width: var(--container-wide);
    width: 100%;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6) var(--space-12);
}

.content-inner { display: flex; flex-direction: column; gap: var(--space-6); }

.wizard-step {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    width: 100%;
    max-width: var(--container-narrow);
    margin-inline: auto;
}

.wizard-step-form {
    display: block;
}

.wizard-step-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.wizard-step:not(.step1-page) .wizard-step-body {
    overflow-x: auto;
    overflow-y: visible;
    padding: var(--space-4);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.wizard-step:not(.step1-page) .wizard-step-body > .editor-ledger__group-label:first-child,
.wizard-step:not(.step1-page) .wizard-step-body > .editor-body__group-label:first-child {
    margin-top: 0;
}

/* Textarea-form steps (Policies, Notes): drop the outer body card so fields
   sit airily on the page with their section labels — matches the approved
   Stripe-grade mockup. Ledger steps (Income, Balance) keep the framed,
   horizontally-scrollable container above. */
.wizard-step.policies-page .wizard-step-body,
.wizard-step.notes-page .wizard-step-body {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.submit-row {
    display: flex;
    justify-content: flex-end;
    padding-top: var(--space-3);
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 40px;
    padding: 0 var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--surface);
    background: var(--ink-900);
    border: 1px solid var(--ink-900);
    border-radius: var(--radius-full);
    box-shadow: 0 1px 2px oklch(15% 0.014 230 / 0.06), 0 8px 18px oklch(15% 0.014 230 / 0.08);
    transition:
        background var(--duration-1) var(--ease-out-quart),
        border-color var(--duration-1) var(--ease-out-quart),
        box-shadow var(--duration-2) var(--ease-out-quart),
        transform var(--duration-1) var(--ease-out-quart);
}

.submit-btn:hover {
    background: var(--ink-800);
    border-color: var(--ink-800);
    box-shadow: 0 1px 2px oklch(15% 0.014 230 / 0.06), 0 12px 24px oklch(15% 0.014 230 / 0.10);
}
.submit-btn:active { transform: scale(var(--press-scale)); }

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.wizard-step-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.step-title-row {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.step-eyebrow {
    margin: 0;
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--ink-500);
}

.step-title {
    margin: 0;
    font-size: var(--text-3xl);
    line-height: 1.08;
    letter-spacing: var(--tracking-tight);
    color: var(--ink-900);
}

.step-description {
    margin: 0;
    color: var(--ink-600);
    line-height: var(--leading-base);
    font-size: var(--text-sm);
    max-width: 68ch;
}

/* Centered single-column wizard form steps (1–5). Scoped to .wizard-step, so
   the Step 6 review (rendered in .review-page, two-column) is unaffected.
   The header centers; field labels stay left-aligned within the narrow column. */
.wizard-step .wizard-step-header { align-items: center; text-align: center; }
.wizard-step .step-title-row { flex-direction: column-reverse; align-items: center; gap: var(--space-2); }
.wizard-step .step-description { margin-inline: auto; max-width: 56ch; }

.step1-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 264px;
    align-items: start;
    gap: var(--space-5);
}

.step1-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.step1-context {
    position: sticky;
    top: 132px;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.step1-context-card,
.step1-context-note {
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    padding: var(--space-4);
}

.step1-context-card h2 {
    margin: 0 0 var(--space-3);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    color: var(--ink-900);
}

.step1-context-card p {
    margin: 0;
    color: var(--ink-700);
    font-size: var(--text-sm);
    line-height: var(--leading-base);
}

.step1-context-card dl {
    margin: 0;
    display: flex;
    flex-direction: column;
}

.step1-context-card dl > div {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-top: 1px solid var(--ink-100);
}

.step1-context-card dt {
    color: var(--ink-600);
    font-size: var(--text-sm);
}

.step1-context-card dd {
    margin: 0;
    color: var(--ink-900);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    text-align: right;
}

.step1-context-note {
    color: var(--accent-800);
    background: var(--accent-50);
    border-color: oklch(50% 0.098 195 / 0.22);
    font-size: var(--text-sm);
    line-height: var(--leading-base);
}

/* ─── Step header (WizardStepHeader) ──────────────────────────────────── */

.header-intro {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--ink-100);
}

.header-title-area, .header-label-area { display: flex; align-items: baseline; gap: var(--space-3); }

.header-label, .step-counter-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.08em;
    color: var(--accent-700);
    text-transform: uppercase;
}

.header-title {
    font-size: var(--text-2xl);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
    margin: 0;
    letter-spacing: var(--tracking-tight);
}

.header-subtitle {
    font-size: var(--text-sm);
    color: var(--ink-600);
    max-width: 70ch;
}

.header-values {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.header-year {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-500);
    padding: 2px var(--space-2);
    background: var(--ink-50);
    border-radius: var(--radius-xs);
}

/* ─── Section card ────────────────────────────────────────────────────── */

.section-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--ink-100);
}

.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--accent-50);
    color: var(--accent-700);
    flex-shrink: 0;
}

.section-title {
    font-size: var(--text-md);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
    margin: 0;
}


/* ─── Form patterns (FormField, FormGrid, FormCheckbox) ───────────────── */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
}

.form-field { display: flex; flex-direction: column; gap: var(--space-2); }
.form-field.info-full { grid-column: 1 / -1; }
.form-field--span-1 { grid-column: span 1; }
.form-field--span-2 { grid-column: span 2; }
.form-field--span-3 { grid-column: span 3; }
.form-field--span-4 { grid-column: span 4; }
.form-field--span-5 { grid-column: span 5; }
.form-field--span-6 { grid-column: span 6; }
.form-field--span-7 { grid-column: span 7; }
.form-field--span-8 { grid-column: span 8; }
.form-field--span-9 { grid-column: span 9; }
.form-field--span-10 { grid-column: span 10; }
.form-field--span-11 { grid-column: span 11; }
.form-field--span-12 { grid-column: span 12; }

.field-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-800);
}

.field-content { display: flex; flex-direction: column; gap: var(--space-1); }

.field-hint, .checkbox-hint {
    font-size: var(--text-xs);
    color: var(--ink-500);
}


.form-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--surface-muted);
    border-radius: var(--radius-sm);
}

.checkbox-input {
    margin-top: 2px;
    flex-shrink: 0;
}
.checkbox-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.checkbox-label .checkbox-text { font-size: var(--text-sm); color: var(--ink-800); }

/* ─── Currency input ──────────────────────────────────────────────────── */

.currency-field {
    position: relative;
    display: flex;
    align-items: stretch;
}

.currency-input {
    flex: 1;
    height: 40px;
    padding: 0 var(--space-4) 0 var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    text-align: right;
    color: var(--ink-900);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    transition: border-color var(--duration-1) var(--ease-out-quart),
                box-shadow var(--duration-1) var(--ease-out-quart);
}
.currency-input::placeholder { color: var(--ink-400); }
.currency-input:hover { border-color: var(--ink-300); }
.currency-input:focus { outline: 0; border-color: var(--accent-500); box-shadow: var(--focus-ring); }
.currency-input.negative { color: var(--danger); }

.currency-suffix, .currency-badge {
    display: inline-flex;
    align-items: center;
    padding: 0 var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-500);
    background: var(--surface-muted);
    border: 1px solid var(--ink-200);
    border-left: 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.currency-hint {
    font-size: var(--text-xs);
    color: var(--ink-500);
}

.currency-error {
    font-size: var(--text-xs);
    color: var(--danger);
}


/* ─── Policy textarea (long-form) ─────────────────────────────────────── */

.editor-textarea {
    width: 100%;
    min-height: 120px;
    padding: var(--space-3);
    font-family: inherit;
    font-size: var(--text-sm);
    line-height: var(--leading-base);
    color: var(--ink-900);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    resize: vertical;
    transition: border-color var(--duration-1) var(--ease-out-quart),
                box-shadow var(--duration-1) var(--ease-out-quart);
}

/* ─── Ledger table (financial line items) ─────────────────────────────── */

.ledger-table {
    width: 100%;
    border-collapse: collapse;
}

.ledger-header,
.column-headers {
    display: grid;
    grid-template-columns: 80px 1fr 140px 140px;
    gap: var(--space-3);
    align-items: baseline;
    padding: var(--space-2) var(--space-5);
    background: var(--surface-muted);
    border-bottom: 1px solid var(--ink-100);
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-500);
}
.ledger-header .current,
.ledger-header .prior { text-align: right; }

.ledger-body { display: flex; flex-direction: column; }

.ledger-section { border-bottom: 1px solid var(--ink-100); }
.ledger-section:last-child { border-bottom: 0; }

.ledger-section-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    background: var(--surface-muted);
}

.ledger-section-label-group { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.ledger-section-code {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-500);
    letter-spacing: 0.02em;
}

.ledger-section-title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
}

.ledger-section-subtitle {
    font-size: var(--text-xs);
    color: var(--ink-500);
}

.ledger-section-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--ink-400);
}

.ledger-section-content { display: flex; flex-direction: column; }

.ledger-row {
    display: grid;
    grid-template-columns: 80px 1fr 140px 140px;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-2) var(--space-5);
    border-top: 1px solid var(--ink-50);
    transition: background var(--duration-1) var(--ease-out-quart);
}
.ledger-row:hover { background: var(--surface-muted); }
.ledger-row.IsSubtotal,
.ledger-row.is-subtotal {
    background: var(--surface-muted);
    font-weight: var(--weight-semi);
    border-top: 1px solid var(--ink-200);
}

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

.row-title {
    font-size: var(--text-sm);
    color: var(--ink-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.prior, .ledger-row > .prior {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--ink-500);
}
.current {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--ink-900);
}

.textarea-with-default {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

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

.textarea-label {
    min-width: 0;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-900);
}

.textarea-check {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: var(--success);
}
.textarea-check svg { width: 14px; height: 14px; }

/* ─── Balance indicator ───────────────────────────────────────────────── */

.balance-summary {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--ink-100);
}
.balance-column { display: flex; flex-direction: column; gap: var(--space-1); align-items: stretch; }
.balance-column:last-child { align-items: stretch; }
.balance-divider {
    width: 1px;
    height: 32px;
    background: var(--ink-200);
    justify-self: center;
}
.balance-header {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.04em;
    color: var(--ink-500);
    text-transform: uppercase;
}
.balance-header-icon {
    display: inline-flex;
    align-items: center;
    color: var(--ink-400);
}
.summary-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-4);
    width: 100%;
    align-items: baseline;
}
.summary-label {
    font-size: var(--text-xs);
    color: var(--ink-600);
}
.summary-value {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: var(--text-sm);
    color: var(--ink-900);
    text-align: right;
    white-space: nowrap;
}
.summary-row.total {
    border-top: 1px solid var(--ink-200);
    padding-top: var(--space-2);
    margin-top: var(--space-1);
}
.summary-row.total .summary-label,
.summary-row.total .summary-value {
    font-weight: var(--weight-bold);
    color: var(--ink-900);
}
.balance-status {
    margin: 0 var(--space-5) var(--space-4);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--ink-200);
}
.balance-status-icon {
    display: inline-flex;
    align-items: center;
}
.balance-status.is-balanced {
    color: var(--success);
    border-color: oklch(58% 0.14 150 / 0.35);
    background: var(--success-bg);
}
.balance-status.is-error {
    color: var(--danger);
    border-color: oklch(58% 0.20 25 / 0.35);
    background: var(--danger-bg);
}

.app-notice ul {
    margin: 0;
    padding-left: 26px;
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
}

/* ─── Collapsible section ─────────────────────────────────────────────── */

.chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--ink-500);
    transition: transform var(--duration-2) var(--ease-out-quart);
}
.card-body { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--ink-100); }

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    color: var(--ink-500);
    flex-shrink: 0;
}

/* ─── Wizard footer (next/prev) ───────────────────────────────────────── */

.wizard-footer,
.review-footer {
    position: sticky;
    bottom: 0;
    z-index: var(--z-sticky);
    background: var(--surface);
    border-top: 1px solid var(--ink-200);
    padding: var(--space-3) 0;
}

.wizard-footer .footer-inner,
.review-footer .footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 var(--space-6);
}
.footer-left, .footer-right {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.footer-center {
    flex: 1;
    text-align: center;
    color: var(--ink-500);
    font-size: var(--text-xs);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 40px;
    padding: 0 var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--surface);
    background: var(--ink-900);
    border: 1px solid var(--ink-900);
    border-radius: var(--radius-full);
    transition: background var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.btn-primary:hover { background: var(--ink-800); border-color: var(--ink-800); color: var(--surface); }
.btn-primary:active { transform: scale(var(--press-scale)); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-submit-primary,
.btn-submit-pay,
.btn-submit-locked {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 40px;
    padding: 0 var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--surface);
    background: var(--ink-900);
    border: 1px solid var(--ink-900);
    border-radius: var(--radius-full);
    transition: background var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.btn-submit-primary:hover,
.btn-submit-pay:hover { background: var(--ink-800); border-color: var(--ink-800); }
.btn-submit-primary:active,
.btn-submit-pay:active { transform: scale(var(--press-scale)); }
.btn-submit-locked { background: var(--ink-700); border-color: var(--ink-700); cursor: not-allowed; }

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 40px;
    padding: 0 var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-800);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.btn-download:hover { background: var(--surface-sunken); border-color: var(--ink-300); }
.btn-download:active { transform: scale(var(--press-scale)); }

/* ─── Review step ─────────────────────────────────────────────────────── */

.review-page { display: flex; flex-direction: column; gap: var(--space-5); }

.review-sheet {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-4);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.review-center-container {
    max-width: var(--container-base);
    margin: 0 auto;
    width: 100%;
}
.review-loading {
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.review-loading-spinner {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: 3px solid var(--ink-200);
    border-top-color: var(--accent-600);
    animation: review-spin var(--duration-5) linear infinite;
}
@keyframes review-spin { to { transform: rotate(360deg); } }

.review-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--ink-100);
}
.review-header-left { display: flex; flex-direction: column; gap: var(--space-2); }
.review-title {
    font-size: var(--text-2xl);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
    margin: 0;
    letter-spacing: var(--tracking-tight);
}
.review-subtitle { font-size: var(--text-sm); color: var(--ink-600); }

.review-progress { display: flex; flex-direction: column; gap: var(--space-2); }
.review-progress-track {
    width: 220px;
    height: 6px;
    background: var(--ink-100);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.review-progress-fill {
    width: 0;
    height: 100%;
    background: var(--accent-600);
    border-radius: var(--radius-full);
    transition: width var(--duration-3) var(--ease-out-quart);
}
.review-progress-fill--step-0 { width: 0; }
.review-progress-fill--step-1 { width: 20%; }
.review-progress-fill--step-2 { width: 40%; }
.review-progress-fill--step-3 { width: 60%; }
.review-progress-fill--step-4 { width: 80%; }
.review-progress-fill--complete { width: 100%; }
.review-progress-label {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--ink-700);
}
.review-progress-sub { font-size: var(--text-xs); color: var(--ink-500); }

.review-sections { display: flex; flex-direction: column; }

.review-section-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--ink-100);
}
.review-section-row:last-child { border-bottom: 0; }

.review-row-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    line-height: 1;
}
.review-row-icon.done  { background: var(--success-bg); color: var(--success); }
.review-row-icon.warn  { background: var(--danger-bg);  color: var(--danger); }
.review-row-icon.empty { background: var(--ink-100);    color: var(--ink-400); }

.review-row-name {
    flex: 0 0 auto;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-900);
}
.review-row-detail {
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--text-sm);
    color: var(--ink-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.review-row-detail.warn { color: var(--danger); }

.review-row-link {
    flex: 0 0 auto;
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--accent-600);
}
.review-row-link:hover { text-decoration: underline; }

/* ─── Step 6 review — two-column "sticky checkout" layout ──────────────── */

.review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--space-6);
    align-items: start;
}
.review-left { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }

/* Validation guidance / ready banner */
.review-guidance {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
}
.review-guidance--danger  { background: var(--danger-bg);  border-color: oklch(58% 0.20 25 / 0.22); }
.review-guidance--warn    { background: var(--warning-bg); border-color: oklch(70% 0.15 75 / 0.30); }
.review-guidance--warn .review-guidance-icon { color: var(--warning); }
.review-guidance--success { background: var(--success-bg); border-color: oklch(58% 0.14 150 / 0.25); align-items: center; }
.review-guidance-icon { flex: 0 0 auto; margin-top: 1px; display: inline-flex; }
.review-guidance--danger  .review-guidance-icon { color: var(--danger); }
.review-guidance--success .review-guidance-icon,
.review-guidance--success { color: var(--ink-800); }
.review-guidance--success .review-guidance-icon { color: var(--success); }
.review-guidance-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.review-guidance-title { margin: 0; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--ink-900); }
.review-guidance-list { margin: 0; padding-left: var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); font-size: var(--text-sm); color: var(--ink-700); }
.review-guidance-link { color: var(--accent-700); font-weight: var(--weight-medium); text-decoration: none; }
.review-guidance-link:hover { text-decoration: underline; }
.review-guidance-xbrl-err { color: var(--danger); }

.review-status-block { border: 1px solid var(--ink-200); border-radius: var(--radius-md); padding: 0 var(--space-4); }

/* Sticky checkout panel */
.review-checkout {
    position: sticky;
    top: var(--space-6);
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
}
.review-checkout-title { margin: 0; font-size: var(--text-md); font-weight: var(--weight-semi); color: var(--ink-900); }

.review-price-options { display: flex; flex-direction: column; gap: var(--space-2); }
.review-price-option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition:
        border-color var(--duration-2) var(--ease-out-quart),
        background var(--duration-2) var(--ease-out-quart),
        box-shadow var(--duration-2) var(--ease-out-quart);
}
.review-price-option:hover:not(.is-selected) { border-color: var(--ink-300); }
.review-price-option.is-selected {
    border-color: var(--accent-500);
    background: var(--accent-50);
    box-shadow: inset 0 0 0 1px var(--accent-500);
}
.review-price-radio { flex: 0 0 auto; margin-top: 2px; accent-color: var(--accent-600); }
.review-price-option-content { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; flex: 1; }
.review-price-option-name-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.review-price-option-name { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--ink-900); }
.review-price-option-amount { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: var(--weight-semi); color: var(--ink-900); }
.review-price-option-sub { font-size: var(--text-xs); color: var(--ink-500); line-height: var(--leading-snug); }
.review-price-best-value {
    flex: 0 0 auto;
    font-size: var(--text-2xs);
    font-weight: var(--weight-semi);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--accent-700);
    background: var(--accent-100);
    padding: 1px var(--space-2);
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.review-checkout-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: var(--space-3);
    border-top: 1px solid var(--ink-100);
}
.review-checkout-total-label { font-size: var(--text-sm); color: var(--ink-600); }
.review-checkout-total-amount { font-family: var(--font-mono); font-size: var(--text-md); font-weight: var(--weight-semi); color: var(--ink-900); }

.review-checkout-cta { display: flex; flex-direction: column; gap: var(--space-2); }
.review-cta-btn {
    width: 100%;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: var(--ink-900);
    color: var(--surface);
    border: 0;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    cursor: pointer;
    transition:
        background var(--duration-1) var(--ease-out-quart),
        transform var(--duration-1) var(--ease-out-quart);
}
.review-cta-btn:hover:not(:disabled) { background: var(--ink-800); }
.review-cta-btn:active:not(:disabled) { transform: scale(var(--press-scale)); }
.review-cta-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Calm "why is checkout disabled" hint — was a bare unstyled sentence reading
   as a raw error. Now a centered muted micro-note that matches the secure-line
   treatment below the CTA, not an alarming red string. */
.submit-blocked-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    margin: calc(var(--space-1) * -1) 0 0;
    font-size: var(--text-xs);
    line-height: 1.4;
    text-align: center;
    color: var(--ink-500);
}

.review-checkout-secondary { display: flex; gap: var(--space-2); }
.review-checkout-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    margin: 0;
    font-size: var(--text-xs);
    color: var(--ink-500);
}
.review-checkout-secure svg { flex: 0 0 auto; }
.review-secondary-btn {
    flex: 1;
    height: 38px;
    background: var(--surface);
    color: var(--ink-700);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition:
        background var(--duration-1) var(--ease-out-quart),
        border-color var(--duration-1) var(--ease-out-quart),
        transform var(--duration-1) var(--ease-out-quart);
}
.review-secondary-btn:hover:not(:disabled) { background: var(--surface-sunken); border-color: var(--ink-300); }
.review-secondary-btn:active:not(:disabled) { transform: scale(var(--press-scale)); }

@media (max-width: 960px) {
    .review-layout { grid-template-columns: 1fr; }
    .review-checkout { position: static; }
}
@media (prefers-reduced-motion: reduce) {
    .review-cta-btn:active:not(:disabled),
    .review-secondary-btn:active:not(:disabled) { transform: none; }
}

.review-card {
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.review-card .card-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--ink-100);
}
.review-card .card-body { padding: var(--space-4) var(--space-5); }
.review-card .card-title { flex: 1; min-width: 0; margin: 0; font-size: var(--text-sm); font-weight: var(--weight-semi); color: var(--ink-900); }
.card-edit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 0;
    background: transparent;
    border: 0;
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--accent-600);
    cursor: pointer;
    transition: color var(--duration-1) var(--ease-out-quart);
}
.card-edit:hover { color: var(--accent-700); text-decoration: underline; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    height: 22px;
    padding: 0 var(--space-2);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semi);
    border-radius: var(--radius-xs);
    background: var(--ink-100);
    color: var(--ink-700);
}
.status-badge.status-complete { background: var(--success-bg); color: var(--success); }
.status-badge.error { background: var(--danger-bg); color: var(--danger); }

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-3) var(--space-5);
}
.info-item { display: flex; flex-direction: column; gap: 2px; }
.info-label { font-size: var(--text-2xs); font-weight: var(--weight-bold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-500); }
.info-value { font-size: var(--text-sm); color: var(--ink-900); }
.info-mono  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.info-primary { font-weight: var(--weight-semi); }
.info-full { grid-column: 1 / -1; }

.financial-summary {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3) 0;
}

.review-footer-submit-group {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.review-footer-secondary, .review-footer-primary {
    display: inline-flex;
    align-items: center;
}

/* ─── Declaration card (review) ───────────────────────────────────────── */

.declaration-section { padding: var(--space-5); }
.declaration-card {
    background: var(--accent-50);
    border: 1px solid var(--accent-100);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
}
.declaration-header { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-3); }
.declaration-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--accent-700);
    flex-shrink: 0;
}
.declaration-title-group { display: flex; flex-direction: column; gap: 2px; }
.declaration-title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
}
.declaration-text { font-size: var(--text-sm); color: var(--ink-700); line-height: var(--leading-base); }
.declaration-body { display: flex; flex-direction: column; gap: var(--space-2); }
.declaration-checkbox {
    display: inline-flex;
    align-items: flex-start;
    gap: var(--space-2);
    cursor: pointer;
}
.declaration-checkbox input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--accent-600);
}


/* ─── Keyboard shortcut overlay ───────────────────────────────────────── */

.shortcut-overlay-backdrop {
    position: fixed;
    inset: 0;
    background: oklch(15% 0.014 230 / 0.5);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.shortcut-overlay-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: 100%;
    margin: var(--space-4);
    overflow: hidden;
}

.shortcut-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--ink-100);
}
.shortcut-overlay-header h3 { font-size: var(--text-md); font-weight: var(--weight-semi); margin: 0; }

.shortcut-overlay-close {
    width: 32px;
    height: 32px;
    color: var(--ink-500);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.shortcut-overlay-close:hover { background: var(--surface-sunken); color: var(--ink-900); }

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

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

.shortcut-label { font-size: var(--text-sm); color: var(--ink-700); }
.shortcut-hint { font-size: var(--text-xs); color: var(--ink-500); }

.shortcut-keys { display: inline-flex; align-items: center; gap: var(--space-1); }
.shortcut-keys kbd, .shortcut-keys .key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 var(--space-1);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    color: var(--ink-700);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-bottom-width: 2px;
    border-radius: var(--radius-xs);
}
.shortcut-plus { font-size: var(--text-xs); color: var(--ink-400); }

.shortcut-overlay-footer {
    padding: var(--space-3) var(--space-5);
    background: var(--surface-muted);
    border-top: 1px solid var(--ink-100);
    display: flex;
    justify-content: flex-end;
}
.shortcut-overlay-btn {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 var(--space-3);
    font-size: var(--text-xs);
    color: var(--ink-800);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
}

/* ─── Loading skeletons ───────────────────────────────────────────────── */

.skeleton-header-shell,
.skeleton-line,
.skeleton-section {
    background: linear-gradient(90deg, var(--ink-100), var(--ink-50), var(--ink-100));
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
    animation: shimmer 1.4s linear infinite;
}
.skeleton-header-shell {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}
.skeleton-line {
    border-radius: var(--radius-sm);
}
.skeleton-line--title {
    width: 55%;
    height: 36px;
}
.skeleton-line--subtitle {
    width: 70%;
    height: 16px;
}
.skeleton-section { height: 200px; margin-bottom: var(--space-3); }

@media (prefers-reduced-motion: reduce) {
    .review-progress-fill,
    .step-progress-fill,
    .step-tab,
    .step-tab-number,
    .submit-btn {
        transition-duration: 1ms;
    }

    .save-pulse,
    .review-loading-spinner,
    .skeleton-line,
    .skeleton-section {
        animation: none;
    }

    .step-tab.clickable:active,
    .step-tab.current .step-tab-number,
    .submit-btn:active {
        transform: none;
    }
}

/* ─── Errors ──────────────────────────────────────────────────────────── */

.error-box, .error-message {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid oklch(58% 0.20 25 / 0.18);
    border-radius: var(--radius-sm);
}

.divider-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--ink-300);
}

.disabled-overlay {
    position: absolute;
    inset: 0;
    background: oklch(99% 0.003 230 / 0.65);
    z-index: var(--z-base);
    pointer-events: all;
}

.dialog-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}
.step1-prior-modal-backdrop {
    position: fixed;
    inset: 0;
    background: oklch(15% 0.014 230 / 0.45);
    z-index: var(--z-modal);
}
.step1-prior-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100vw - 32px));
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: calc(var(--z-modal) + 1);
    overflow: hidden;
}
.step1-prior-modal .dialog-title-row {
    justify-content: flex-start;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--ink-100);
    font-weight: var(--weight-semi);
}
.step1-prior-modal-icon {
    display: inline-flex;
    align-items: center;
    color: var(--accent-600);
}
.step1-prior-modal-body {
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.step1-prior-modal-message {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--ink-800);
}
.step1-prior-modal-description {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--ink-600);
}
.step1-prior-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--ink-100);
}

/* ─── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .content-frame { padding: var(--space-4) var(--space-3) var(--space-8); }
    .wizard-header .header-inner { padding: 0 var(--space-3); height: 52px; }
    .step-tabs {
        grid-template-columns: repeat(6, minmax(104px, 1fr));
        min-width: 680px;
        padding: 0 var(--space-3);
    }
    .step-progress-fill { left: var(--space-3); width: calc((100% - (var(--space-3) * 2)) * var(--wizard-progress, 0) / 100); }
    .step-tab { padding: 0 var(--space-2); font-size: var(--text-xs); }
    .save-text { display: none; }
    .step-title-row { gap: var(--space-2); }
    .step-title { font-size: var(--text-2xl); }
    .step1-layout { grid-template-columns: 1fr; }
    .step1-context { position: static; }
    .ledger-header, .ledger-row { grid-template-columns: 70px 1fr 120px; }
    .ledger-header .prior, .ledger-row > .prior { display: none; }
    .balance-summary { grid-template-columns: 1fr; }
    .balance-divider { display: none; }
}

/* === _editor.css === */
/*
   Editor — consolidated report editor shell + primitives.
*/

.editor {
    min-height: 100vh;
    background:
        radial-gradient(1200px 400px at 50% -140px, var(--accent-50), transparent 65%),
        var(--surface-muted);
}

/* ─── Topbar ─────────────────────────────────────────────────────────── */

.editor-topbar {
    position: sticky;
    top: 0;
    z-index: calc(var(--z-sticky) + 30);
    height: 60px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-5);
    background: oklch(99% 0.003 230 / 0.9);
    border-bottom: 1px solid var(--ink-200);
    backdrop-filter: blur(12px);
}

.editor-topbar__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--ink-600);
    border-radius: var(--radius-sm);
    transition: background var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.editor-topbar__back:hover { background: var(--surface-sunken); color: var(--ink-900); }
.editor-topbar__back:active { transform: scale(var(--press-scale)); }

.editor-topbar__title {
    min-width: 0;
    font-size: var(--text-md);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.editor-topbar__savedot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--ink-300);
    box-shadow: 0 0 0 3px oklch(15% 0.014 230 / 0.04);
}
.editor-topbar__savedot--pending {
    background: var(--accent-600);
    animation: editorSavedotPulse 1s var(--ease-out-quart) infinite;
}
.editor-topbar__savedot--saved { background: var(--success); }
.editor-topbar__savedot--error { background: var(--danger); }
.editor-topbar__savedot--idle { background: var(--ink-300); }

.editor-topbar__status {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

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

.editor-topbar__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 34px;
    padding: 0 var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    white-space: nowrap;
    transition: background var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.editor-topbar__btn:active { transform: scale(var(--press-scale)); }
.editor-topbar__btn:disabled,
.editor-topbar__btn[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
}

.editor-topbar__btn--outlined {
    background: var(--surface);
    color: var(--ink-800);
    border: 1px solid var(--ink-200);
}
.editor-topbar__btn--outlined:hover { background: var(--surface-sunken); border-color: var(--ink-300); }

.editor-topbar__btn--primary {
    background: var(--ink-900);
    color: var(--surface);
    border: 1px solid var(--ink-900);
    box-shadow: var(--shadow-sm);
}
.editor-topbar__btn--primary:hover { background: var(--ink-800); border-color: var(--ink-800); color: var(--surface); }

.editor-topbar__btn--admin-bypass {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid oklch(70% 0.15 75 / 0.35);
}
.editor-topbar__btn--admin-bypass:hover {
    background: oklch(96% 0.05 75);
}

/* ─── Shell rails + center ───────────────────────────────────────────── */

.editor-leftrail,
.editor-rightrail {
    position: fixed;
    top: 76px;
    max-height: calc(100vh - 92px);
    overflow: auto;
    z-index: calc(var(--z-sticky) + 10);
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.editor-leftrail {
    left: var(--space-5);
    width: 248px;
    padding: var(--space-3);
}

.editor-rightrail {
    right: var(--space-5);
    width: 284px;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.editor-center {
    max-width: 1620px;
    margin: 0 auto;
    padding: var(--space-5) 320px var(--space-12) 286px;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.editor-form-body {
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}
.editor-form-body.is-submitted {
    border-color: var(--accent-200);
}

.editor-loading-shell {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.editor-loading-card {
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.editor-loading-line {
    height: 14px;
    border-radius: var(--radius-xs);
    background: linear-gradient(90deg, var(--ink-100), var(--ink-50), var(--ink-100));
    background-size: 200% 100%;
    animation: editorSkeletonShimmer 1.5s linear infinite;
}

.editor-loading-line--title {
    width: 40%;
    height: 18px;
}

.editor-loading-line--body {
    width: 100%;
}

.editor-loading-line--short {
    width: 68%;
}

/* ─── Left rail ──────────────────────────────────────────────────────── */

.editor-leftrail__header {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semi);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-500);
    margin-bottom: var(--space-2);
}

.editor-leftrail__anchor {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-2);
    text-align: left;
    border-radius: var(--radius-sm);
    color: var(--ink-700);
    transition: background var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.editor-leftrail__anchor:hover {
    background: var(--surface-muted);
    color: var(--ink-900);
}
.editor-leftrail__anchor:active { transform: scale(var(--press-scale)); }
.editor-leftrail__anchor--active {
    background: var(--accent-50);
    color: var(--accent-800);
}
.editor-leftrail__anchor--locked {
    opacity: 0.55;
    cursor: not-allowed;
}

.editor-leftrail__tick {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: var(--weight-bold);
    background: var(--ink-100);
    color: var(--ink-600);
}
.editor-leftrail__tick--complete { background: var(--success-bg); color: var(--success); }
.editor-leftrail__tick--error { background: var(--danger-bg); color: var(--danger); }
.editor-leftrail__tick--pending { background: var(--ink-100); color: var(--ink-600); }

.editor-leftrail__badge {
    min-width: 20px;
    height: 20px;
    padding: 0 var(--space-1);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: var(--weight-semi);
    background: var(--danger-bg);
    color: var(--danger);
}

.editor-leftrail__footer {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--ink-100);
    font-size: var(--text-xs);
    color: var(--ink-500);
}

/* ─── Right rail ─────────────────────────────────────────────────────── */

.editor-rightrail__panel {
    padding: var(--space-3);
    background: var(--surface-muted);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
}

.editor-rightrail__eyebrow,
.editor-rightrail__header {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-500);
}

.editor-rightrail__score {
    margin-top: var(--space-2);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
}
.editor-rightrail__score span:first-child {
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    color: var(--ink-900);
    font-weight: var(--weight-semi);
}
.editor-rightrail__score span:last-child {
    font-size: var(--text-xs);
    color: var(--ink-500);
}

.editor-rightrail__meter {
    margin-top: var(--space-2);
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--ink-100);
    overflow: hidden;
}
.editor-rightrail__meter > span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent-500), var(--accent-700));
    border-radius: var(--radius-full);
    transition: width var(--duration-4) var(--ease-out-expo);
}
.editor-rightrail__meter--0 > span { width: 0%; }
.editor-rightrail__meter--10 > span { width: 10%; }
.editor-rightrail__meter--20 > span { width: 20%; }
.editor-rightrail__meter--30 > span { width: 30%; }
.editor-rightrail__meter--40 > span { width: 40%; }
.editor-rightrail__meter--50 > span { width: 50%; }
.editor-rightrail__meter--60 > span { width: 60%; }
.editor-rightrail__meter--70 > span { width: 70%; }
.editor-rightrail__meter--80 > span { width: 80%; }
.editor-rightrail__meter--90 > span { width: 90%; }
.editor-rightrail__meter--100 > span { width: 100%; }

.editor-rightrail__summary {
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--ink-600);
    line-height: var(--leading-snug);
}

.editor-rightrail__empty {
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--ink-200);
    background: var(--surface-muted);
    font-size: var(--text-xs);
    color: var(--ink-500);
}

.editor-rightrail__pill {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    text-align: left;
    color: var(--ink-700);
    background: var(--surface-muted);
    border: 1px solid var(--ink-100);
}
.editor-rightrail__pill--success {
    background: var(--success-bg);
    border-color: oklch(58% 0.14 150 / 0.3);
    color: var(--success);
}
.editor-rightrail__pill--error {
    background: var(--danger-bg);
    border-color: oklch(58% 0.20 25 / 0.3);
    color: var(--danger);
}
.editor-rightrail__pill--clickable {
    cursor: pointer;
    transition: background var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.editor-rightrail__pill--clickable:hover {
    background: var(--surface);
    border-color: var(--ink-200);
    color: var(--ink-900);
}
.editor-rightrail__pill--clickable:active { transform: scale(var(--press-scale)); }

/* ─── Submitted-lock banner ──────────────────────────────────────────── */

.submitted-lock-banner {
    margin: 0 auto;
    width: min(1620px, calc(100% - var(--space-10)));
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--accent-50);
    border: 1px solid var(--accent-100);
    border-radius: var(--radius-md);
}

.banner-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--accent-100);
    color: var(--accent-800);
    flex-shrink: 0;
}

.banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.banner-text strong {
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
}
.banner-text span:not(.banner-timestamp) {
    font-size: var(--text-xs);
    color: var(--ink-600);
}

.banner-timestamp {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-500);
}

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

.banner-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 32px;
    padding: 0 var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    color: var(--ink-800);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.banner-btn:hover { background: var(--surface-sunken); border-color: var(--ink-300); }
.banner-btn:active { transform: scale(var(--press-scale)); }
.banner-btn.primary {
    color: var(--surface);
    background: var(--ink-900);
    border-color: var(--ink-900);
}
.banner-btn.primary:hover { background: var(--ink-800); border-color: var(--ink-800); color: var(--surface); }

/* ─── Sections ───────────────────────────────────────────────────────── */

.editor-section {
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    transition: border-color var(--duration-2) var(--ease-out-quart),
                box-shadow var(--duration-2) var(--ease-out-quart),
                transform var(--duration-2) var(--ease-out-quart);
}

.editor-section__head {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    text-align: left;
    border: 0;
    background: transparent;
    transition: background var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.editor-section__head:hover { background: var(--surface-muted); }
.editor-section__head:active { transform: scale(var(--press-scale)); }

.editor-section__icon {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
}
.editor-section__icon--complete { background: var(--success-bg); color: var(--success); }
.editor-section__icon--error { background: var(--danger-bg); color: var(--danger); }

.editor-section__name {
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
}
.editor-section__summary {
    font-size: var(--text-xs);
    color: var(--ink-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.editor-section__action {
    font-size: var(--text-xs);
    color: var(--accent-700);
    font-weight: var(--weight-semi);
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.editor-section--complete { border-color: oklch(58% 0.14 150 / 0.26); }
.editor-section--error { border-color: oklch(58% 0.20 25 / 0.26); }
.editor-section--editing { border-color: var(--ink-200); }
.editor-section--editing { box-shadow: 0 8px 24px -18px oklch(15% 0.014 230 / 0.18); }

.editor-section__body {
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    animation: editorSectionBodyIn var(--duration-3) var(--ease-out-expo);
}

.editor-section__editing-label {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-500);
}

/* ─── Cards + rows ───────────────────────────────────────────────────── */

.editor-card {
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.editor-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--ink-100);
}

.editor-card__header h3 {
    margin: 0;
    color: var(--ink-900);
    font-size: var(--text-md);
    font-weight: var(--weight-bold);
    letter-spacing: 0;
}

.editor-card__header p {
    margin: var(--space-1) 0 0;
    color: var(--ink-600);
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
}

.editor-card__badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-full);
    background: var(--accent-50);
    color: var(--accent-800);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    white-space: nowrap;
}

.editor-card > .editor-body__row,
.editor-card > .editor-body__row--single,
.editor-card > .editor-toggle-row,
.editor-card > .editor-card__section-label,
.editor-card > .editor-body__list,
.editor-card > .editor-body__add-link,
.editor-card > .editor-card__next-list {
    margin-left: var(--space-5);
    margin-right: var(--space-5);
}

.editor-card > .editor-body__row:first-of-type,
.editor-card > .editor-body__row--single:first-of-type,
.editor-card > .editor-card__next-list {
    margin-top: var(--space-4);
}

.editor-card > .editor-body__row,
.editor-card > .editor-body__row--single,
.editor-card > .editor-card__section-label,
.editor-card > .editor-body__list {
    margin-bottom: var(--space-4);
}

.editor-card > .editor-toggle-row,
.editor-card > .editor-body__add-link {
    margin-bottom: var(--space-5);
}

.editor-card--next {
    border-color: var(--ink-200);
    box-shadow: var(--shadow-xs);
}

.editor-card__section-label,
.editor-body__group-label,
.editor-ledger__group-label {
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semi);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-500);
}
.editor-card__section-label--spaced { margin-top: var(--space-2); }

.editor-card--collapsible > summary {
    list-style: none;
}
.editor-card__summary {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    color: var(--ink-800);
}
.editor-card__summary::-webkit-details-marker { display: none; }
.editor-card__chevron {
    color: var(--ink-500);
    transition: transform var(--duration-2) var(--ease-out-quart);
}
.editor-card[open] .editor-card__chevron { transform: rotate(90deg); }
.editor-card__summary-hint {
    margin-left: auto;
    font-size: var(--text-xs);
    color: var(--ink-500);
}
.editor-card__collapsible-body {
    margin-top: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.editor-body__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}
.editor-body__row--single { grid-template-columns: 1fr; }

.editor-body__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.editor-body__list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: var(--space-2);
    align-items: center;
}
.editor-body__list-item > button {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    color: var(--danger);
}
.editor-body__list-item > button:hover { background: var(--danger-bg); }

.editor-body__add-link {
    align-self: flex-start;
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
    color: var(--accent-700);
}

/* ─── Fields ─────────────────────────────────────────────────────────── */

.editor-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.editor-field__label-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--ink-700);
}

.editor-field__required {
    color: var(--danger);
}

.editor-field__help {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--ink-500);
    background: var(--ink-100);
}

.editor-field__input,
.editor-textarea {
    width: 100%;
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-900);
    transition: border-color var(--duration-1) var(--ease-out-quart),
                box-shadow var(--duration-1) var(--ease-out-quart);
}

.editor-field__input {
    height: 38px;
    padding: 0 var(--space-3);
    font-size: var(--text-sm);
}

.editor-field__input--text {
    font-size: var(--text-sm);
}

.editor-field__input:focus,
.editor-textarea:focus {
    outline: 0;
    border-color: var(--accent-500);
    box-shadow: var(--focus-ring);
}

.editor-field__input--invalid {
    border-color: var(--danger);
    background: oklch(98% 0.018 25);
    box-shadow: 0 0 0 1px oklch(58% 0.20 25 / 0.12);
}
.editor-field__input--invalid:focus {
    box-shadow: 0 0 0 3px oklch(58% 0.20 25 / 0.15);
}

.editor-field__gutter {
    margin-top: 2px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid oklch(58% 0.20 25 / 0.22);
    border-radius: var(--radius-sm);
    background: var(--danger-bg);
    font-size: var(--text-xs);
    line-height: var(--leading-snug);
    color: var(--danger);
}

.editor-textarea {
    min-height: 110px;
    padding: var(--space-3);
    font-size: var(--text-sm);
    line-height: var(--leading-base);
    resize: vertical;
}

.textarea-hint {
    font-size: var(--text-xs);
    color: var(--ink-400);
    margin-bottom: var(--space-1);
}

.section-suggestion-note {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
    padding: var(--space-3) var(--space-4);
    background: var(--accent-50);
    border: 1px solid var(--accent-100);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    color: var(--ink-600);
    line-height: 1.45;
}
.section-suggestion-note svg {
    width: 16px;
    height: 16px;
    flex: none;
    margin-top: 1px;
    color: var(--accent-700);
}

.editor-toggle-row {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--ink-700);
}

.editor-toggle {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-600);
}

/* ─── Ledger ─────────────────────────────────────────────────────────── */

.editor-ledger {
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}

.editor-ledger--body {
    border: 0;
}

.editor-ledger__columns,
.editor-ledger-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 72px minmax(190px, 220px) minmax(170px, 210px);
    gap: 0;
}

.editor-ledger__columns {
    border-top: 1px solid var(--ink-200);
    border-bottom: 1px solid var(--ink-100);
    background: var(--surface-muted);
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-500);
}

.editor-ledger__columns > span,
.editor-ledger-row > * {
    min-width: 0;
    padding: var(--space-2) var(--space-3);
}

.editor-ledger__column-label {
    display: flex;
    align-items: center;
}

.editor-ledger__column-code {
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid var(--ink-100);
}

.editor-ledger__column-year {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    min-height: 38px;
    border-left: 1px solid var(--ink-100);
    text-align: right;
}

.editor-ledger__column-year strong {
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    color: var(--ink-700);
    letter-spacing: 0;
}

.editor-ledger__column-year--prior {
    background: var(--ink-50);
}

.editor-ledger__columns--no-prior,
.editor-ledger-row--no-prior {
    grid-template-columns: minmax(260px, 1fr) 72px minmax(190px, 220px);
}

.editor-ledger-row {
    border-bottom: 1px solid var(--ink-100);
    align-items: stretch;
    min-height: 42px;
    transition: background var(--duration-1) var(--ease-out-quart);
}
.editor-ledger-row:last-child { border-bottom: 0; }
.editor-ledger-row:hover { background: var(--surface-muted); }

.editor-ledger-row__label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: var(--text-sm);
    color: var(--ink-900);
}

.editor-ledger-row__sublabel {
    margin-top: 2px;
    font-size: var(--text-xs);
    color: var(--ink-500);
}

.editor-ledger-row__code {
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid var(--ink-100);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-500);
}

.editor-ledger-row__input,
.editor-ledger-row__value,
.editor-ledger-row__prior {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.editor-ledger-row__current {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-left: 1px solid var(--ink-100);
}

.editor-ledger-row__current--editable {
    padding: 0;
    transition: background var(--duration-1) var(--ease-out-quart),
                box-shadow var(--duration-1) var(--ease-out-quart);
}

.editor-ledger-row__current--editable:hover {
    background: var(--ink-50);
}

.editor-ledger-row__current--editable:focus-within {
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--accent-500);
}

.editor-ledger-row__current--invalid,
.editor-ledger-row__current--invalid:focus-within {
    box-shadow: inset 0 0 0 1px var(--danger);
    background: var(--danger-bg);
}

.editor-ledger-row__input {
    box-sizing: border-box;
    width: 100%;
    min-height: 42px;
    height: 100%;
    padding: 0 var(--space-3);
    border: 0;
    border-radius: 0;
    color: var(--ink-900);
    background: transparent;
    box-shadow: none;
}

.editor-ledger-row__input:focus {
    outline: 0;
    box-shadow: none;
}

.editor-ledger-row__value {
    color: var(--ink-900);
    font-weight: var(--weight-semi);
}

.editor-ledger-row__prior {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    align-self: stretch;
    border-left: 1px solid var(--ink-100);
    color: var(--ink-600);
    background: var(--ink-50);
}

.editor-ledger-row__prior--empty {
    color: var(--ink-400);
}

.editor-ledger-row--computed {
    background: var(--surface-muted);
}

.app-notice,
.editor-ledger__note {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 56px;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    background: var(--ink-50);
    color: var(--ink-600);
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
}

.app-notice__icon,
.editor-ledger__note > svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: currentColor;
}

.app-notice__icon svg,
.editor-ledger__note > svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

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

.app-notice__title,
.editor-ledger__note strong {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    color: var(--ink-900);
}

.app-notice__detail,
.app-notice__meta {
    font-size: var(--text-xs);
    color: currentColor;
}

.app-notice__meta {
    margin-top: 2px;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: var(--weight-semi);
}

.app-notice--success {
    border-color: oklch(58% 0.14 150 / 0.28);
    background: var(--success-bg);
    color: var(--success);
}

.app-notice--success .app-notice__title {
    color: oklch(38% 0.11 150);
}

.app-notice--warning,
.editor-ledger__note--warning {
    border-color: oklch(70% 0.15 75 / 0.28);
    background: var(--warning-bg);
    color: oklch(45% 0.12 75);
}

.app-notice--warning .app-notice__title,
.editor-ledger__note--warning strong {
    color: oklch(40% 0.12 75);
}

.app-notice--error,
.editor-ledger__note--error {
    border-color: oklch(58% 0.20 25 / 0.28);
    background: var(--danger-bg);
    color: var(--danger);
}

.app-notice--error .app-notice__title,
.editor-ledger__note--error strong {
    color: var(--danger);
}

.editor-ledger__note {
    margin-top: var(--space-2);
}

/* ─── Annual Balance Sheet ───────────────────────────────────────────── */

.annual-balance-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
}

.annual-balance-pane {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.annual-balance-pane > .editor-ledger__group-label:first-child {
    margin-top: 0;
}

.editor-ledger-group {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.editor-ledger-group__header {
    padding: var(--space-4) 0 var(--space-3);
    border-top: 1px solid var(--ink-300);
    border-bottom: 1px solid var(--ink-100);
}

.editor-ledger-group__copy {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.editor-ledger-group__eyebrow {
    font-family: var(--font-mono);
    font-size: var(--text-3xs);
    font-weight: var(--weight-semi);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-500);
}

.editor-ledger-group__title {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: var(--ink-900);
}

.editor-ledger-group__description {
    margin: 0;
    max-width: 72ch;
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
    color: var(--ink-600);
}

.editor-ledger-group__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.editor-ledger-subsection {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.editor-ledger-subsection__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    padding-bottom: var(--space-1);
}

.editor-ledger-subsection__title {
    margin: 0;
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semi);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-600);
}

.editor-ledger-subsection__description {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--ink-500);
}

.editor-ledger-subsection__body {
    min-width: 0;
}

/* ─── Review section ─────────────────────────────────────────────────── */

.editor-review-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.editor-review-list__item {
    display: grid;
    grid-template-columns: auto minmax(0, 0.7fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.editor-review-list__item.is-complete {
    background: var(--success-bg);
    border-color: oklch(58% 0.14 150 / 0.26);
}
.editor-review-list__item.is-incomplete {
    background: var(--warning-bg);
    border-color: oklch(70% 0.15 75 / 0.28);
}

.editor-review-list__icon {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    background: var(--surface);
    color: var(--ink-700);
}

.editor-review-list__name {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-900);
}

.editor-review-list__summary {
    font-size: var(--text-xs);
    color: var(--ink-600);
    text-align: right;
}

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

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1460px) {
    .editor-leftrail { width: 220px; left: var(--space-3); }
    .editor-rightrail { width: 260px; right: var(--space-3); }
    .editor-center { padding-left: 250px; padding-right: 286px; }
}

@media (max-width: 1260px) {
    .editor-topbar {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: var(--space-2);
        padding: 0 var(--space-3);
    }
    .editor-topbar__status,
    .editor-topbar__savedot { display: none; }

    .editor-leftrail,
    .editor-rightrail {
        position: static;
        width: auto;
        max-height: none;
        margin: var(--space-4);
    }

    .editor-center {
        max-width: var(--container-base);
        padding: 0 var(--space-4) var(--space-10);
    }

    .submitted-lock-banner {
        width: calc(100% - var(--space-8));
    }
}

@media (max-width: 820px) {
    .editor-topbar__actions .editor-topbar__btn--outlined { display: none; }

    .editor-topbar__title {
        font-size: var(--text-sm);
    }

    .editor-form-body { padding: var(--space-4); }

    .editor-body__row,
    .editor-body__list-item,
    .editor-review-list__item {
        grid-template-columns: 1fr;
    }

    .editor-ledger__columns,
    .editor-ledger-row,
    .editor-ledger__columns--no-prior,
    .editor-ledger-row--no-prior {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .editor-ledger__column-code,
    .editor-ledger__column-year,
    .editor-ledger-row__code,
    .editor-ledger-row__prior {
        display: none;
    }

    .editor-ledger-row__input,
    .editor-ledger-row__value {
        min-width: 110px;
    }

    .submitted-lock-banner {
        grid-template-columns: 1fr;
    }
    .banner-actions { justify-self: stretch; }
    .banner-btn { flex: 1; justify-content: center; }
}

@keyframes editorSavedotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@keyframes editorSectionBodyIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes editorSkeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === _payments.css === */
/*
   Payments. Checkout, PaymentSuccess, PaymentCancel, PaymentHistory.
*/

/* ─── Shared page containers ──────────────────────────────────────────── */

.checkout-page,
.history-page,
.payment-success-page,
.payment-cancel-page {
    min-height: 100vh;
    background: var(--surface-muted);
    padding: var(--space-6) var(--space-4);
}

/* (a) Vertically center the checkout card in the full viewport */
.checkout-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-block: var(--space-8);
}

.checkout-container,
.history-container,
.cancel-container {
    max-width: var(--container-base);
    margin: 0 auto;
}

.btn-back-link, .btn-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--ink-600);
    text-decoration: none;
    margin-bottom: var(--space-4);
}
.btn-back-link:hover, .btn-back:hover { color: var(--ink-900); }

/* ─── Checkout ────────────────────────────────────────────────────────── */

.checkout-card {
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.product-section { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--ink-100); }

.product-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.product-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent-50);
    color: var(--accent-700);
    flex-shrink: 0;
}
.product-icon.pdf  { background: var(--accent-50);  color: var(--accent-700); }
.product-icon.xbrl { background: var(--ink-100);    color: var(--ink-700); }
.product-icon.zip  { background: var(--warning-bg); color: var(--warning); }

.product-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.product-name {
    font-size: var(--text-md);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
}
.product-meta { display: inline-flex; gap: var(--space-2); font-size: var(--text-xs); color: var(--ink-500); }
.product-type, .product-period { color: var(--ink-500); }

/* Pricing section */

.pricing-section { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--ink-100); }

.discount-progress-card {
    background: var(--accent-50);
    border: 1px solid var(--accent-100);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--accent-800);
}
.current-discount {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    position: relative;
    height: 8px;
    background: var(--surface);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--accent-600);
    border-radius: var(--radius-full);
    transition: width var(--duration-3) var(--ease-out-quart);
}

.progress-markers {
    position: relative;
    height: 16px;
}
.marker {
    position: absolute;
    top: 0;
    width: 1px;
    height: 6px;
    background: var(--accent-300);
    transform: translateX(-50%);
}
.marker-10  { left: 10%; }
.marker-30  { left: 30%; }
.marker-60  { left: 60%; }
.marker-100 { left: 100%; }
.marker-discount { background: var(--accent-700); }
.marker-label {
    position: absolute;
    top: 8px;
    transform: translateX(-50%);
    font-size: var(--text-3xs);
    font-family: var(--font-mono);
    color: var(--ink-500);
}

.progress-note { font-size: var(--text-xs); color: var(--accent-800); }

.price-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    border-top: 1px solid var(--ink-100);
    margin-top: var(--space-2);
}
.total-amount {
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
}
.amount-currency { color: var(--ink-500); font-size: var(--text-sm); margin-left: 4px; }

/* Trust + actions */

.trust-indicators {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-5);
    background: var(--surface-muted);
    border-bottom: 1px solid var(--ink-100);
    font-size: var(--text-xs);
    color: var(--ink-600);
}
.trust-item { display: inline-flex; align-items: center; gap: var(--space-2); }
.stripe-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-weight: var(--weight-medium);
}
.stripe-logo {
    height: 16px;
    color: oklch(45% 0.18 280);
}

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

/* Primary CTA = ink-filled pill (DESIGN.md). Accent is reserved for emphasis,
   links, and focus rings — never the default primary button fill. */
.btn-checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 46px;
    width: 100%;
    padding: 0 var(--space-5);
    font-size: var(--text-md);
    font-weight: var(--weight-semi);
    color: var(--surface);
    background: var(--ink-900);
    border: 1px solid var(--ink-900);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.btn-checkout:hover { background: var(--ink-800); border-color: var(--ink-800); }
.btn-checkout:active { transform: scale(var(--press-scale)); }
.btn-checkout:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Focused checkout: narrow centered column so the CTA reads as a button,
      not a full-width slab (Stripe-style). Header stacks compactly. ── */
.checkout-container {
    max-width: 27.5rem;
    width: 100%;
}
.checkout-card .card-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-5) var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--ink-100);
}
.checkout-card .card-header h1 {
    margin: 0;
    font-size: var(--text-2xl);
    font-weight: var(--weight-semi);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
    color: var(--ink-900);
}
.checkout-card .card-header .header-subtitle { margin: 0; }

/* ── Focused payment confirmation pages: centered columns, not full-width.
      Cancel = compact card with restrained danger treatment. ── */
.payment-cancel-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 8rem);
}
.cancel-container {
    max-width: 27.5rem;
    width: 100%;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    padding: var(--space-10) var(--space-8) var(--space-8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

/* Restrained danger icon: muted ring instead of vivid red */
.cancel-container .cancel-icon {
    background: var(--danger-bg);
    color: oklch(52% 0.14 25);
    margin-bottom: 0;
}

.cancel-container h1 {
    margin: 0;
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
    color: var(--ink-900);
}

.cancel-container p {
    margin: 0;
    font-size: var(--text-base);
    color: var(--ink-600);
    line-height: var(--leading-base);
}

.cancel-container .cancel-actions {
    margin-top: var(--space-2);
    gap: var(--space-3);
}

/* ── payment-success-page: vertically centered focused column ── */
.payment-success-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-block: var(--space-16);
}

.payment-success-notice {
    width: 100%;
    max-width: 38rem;
    margin: 0 0 var(--space-5);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px solid var(--ink-100);
    background: var(--surface);
    font-size: var(--text-sm);
    color: var(--ink-800);
}
.payment-success-notice--success {
    background: var(--success-bg);
    color: var(--success);
    border-color: oklch(62% 0.16 152 / 0.2);
}

/* ── Loading shimmer state ── */
.success-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-5);
    text-align: center;
    color: var(--ink-600);
    font-size: var(--text-sm);
}

/* ── Pending (waiting) state ── */
.success-pending {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-4);
    width: 100%;
    max-width: 38rem;
    padding: var(--space-12) var(--space-8);
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.success-pending h1 {
    margin: 0;
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
    color: var(--ink-900);
}

.success-pending p {
    margin: 0;
    font-size: var(--text-base);
    color: var(--ink-600);
    line-height: var(--leading-base);
}

.success-pending .hint {
    font-size: var(--text-sm);
    color: var(--ink-400);
}

.success-pending .success-actions {
    margin-top: var(--space-4);
}

/* ── Confirmed (success) state ── */
.success-confirmed {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 38rem;
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.success-confirmed-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-10) var(--space-8) var(--space-8);
}

.success-illustration {
    display: block;
    width: 200px;
    max-width: 60%;
    height: auto;
    margin: 0 auto;
    mix-blend-mode: multiply;
}

.success-confirmed-header h1 {
    margin: 0;
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
    color: var(--ink-900);
}

.success-confirmed-header p {
    margin: 0;
    font-size: var(--text-base);
    color: var(--ink-600);
    line-height: var(--leading-base);
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ─── Payment success ─────────────────────────────────────────────────── */

.success-icon,
.cancel-icon,
.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-4);
}
.success-icon  { background: var(--success-bg); color: var(--success); }
.cancel-icon   { background: var(--danger-bg);  color: var(--danger); }
.empty-icon    { background: var(--ink-100);    color: var(--ink-500); }

/* ── Epic dual-ring spinner: slate track + accent arc ── */
.pending-spinner-wrap {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.pending-spinner {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-full);
    border: 3px solid transparent;
    border-top-color: var(--accent-600);
    border-right-color: var(--accent-400);
    animation: pendingSpinOuter 1.1s var(--ease-out-quart) infinite;
}

.pending-spinner-inner {
    position: absolute;
    inset: 8px;
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    border-bottom-color: var(--accent-500);
    border-left-color: var(--accent-300);
    animation: pendingSpinInner 0.75s linear infinite reverse;
}

@keyframes pendingSpinOuter {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pendingSpinInner {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .pending-spinner,
    .pending-spinner-inner {
        animation: none;
        border-color: var(--ink-200);
        border-top-color: var(--accent-500);
    }
}

.success-spinner {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    border: 2px solid var(--ink-200);
    border-top-color: var(--accent-600);
    display: inline-block;
    animation: successSpin 1s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .success-spinner { animation: none; }
}

.success-actions,
.cancel-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

/* Bottom action row inside the confirmed card */
.success-confirmed .success-actions {
    padding: var(--space-6) var(--space-8);
    border-top: 1px solid var(--ink-100);
    width: 100%;
}

.btn-primary, .btn-secondary, .btn-ghost, .btn-start, .btn-retry {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 40px;
    padding: 0 var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--duration-1) var(--ease-out-quart),
                border-color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.btn-primary, .btn-start {
    color: var(--surface);
    background: var(--ink-900);
    border: 1px solid var(--ink-900);
    border-radius: var(--radius-full);
}
.btn-primary:hover, .btn-start:hover { background: var(--ink-800); border-color: var(--ink-800); color: var(--surface); }
.btn-primary:active, .btn-start:active { transform: scale(var(--press-scale)); }

.btn-secondary, .btn-retry {
    color: var(--ink-800);
    background: var(--surface);
    border: 1px solid var(--ink-200);
}
.btn-secondary:hover, .btn-retry:hover { background: var(--surface-sunken); border-color: var(--ink-300); }

.btn-ghost {
    color: var(--ink-700);
    background: transparent;
    border: 0;
}
.btn-ghost:hover { color: var(--ink-900); }

/* Receipt block */

.receipt-section {
    width: 100%;
    background: var(--surface-muted);
    border-top: 1px solid var(--ink-100);
    padding: var(--space-5) var(--space-6);
    text-align: left;
}

.receipt-header {
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-500);
    margin-bottom: var(--space-3);
}

.receipt-item {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--ink-100);
    align-items: center;
}
.receipt-item:last-of-type { border-bottom: 0; }

.receipt-item-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent-50);
    color: var(--accent-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.receipt-item-details { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.receipt-item-company { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--ink-900); }
.receipt-item-type { font-size: var(--text-xs); color: var(--ink-500); }
.receipt-item-year { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-500); }
.receipt-item-price {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: var(--weight-semi);
    color: var(--ink-900);
}

.receipt-meta { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) 0; border-bottom: 1px solid var(--ink-100); }
.receipt-meta-item { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--text-xs); color: var(--ink-600); }
.receipt-meta-label { color: var(--ink-500); }
.receipt-meta-value { color: var(--ink-900); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.receipt-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: var(--space-3);
    margin-top: var(--space-2);
    border-top: 1px solid var(--ink-200);
}
.receipt-total-label { font-size: var(--text-sm); font-weight: var(--weight-semi); color: var(--ink-900); }
.receipt-total-value {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
}

/* Download grid */

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-3);
    padding: var(--space-5) var(--space-6);
    width: 100%;
}

.download-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: border-color var(--duration-1) var(--ease-out-quart),
                box-shadow var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.download-card:hover { border-color: var(--accent-300); box-shadow: var(--shadow-sm); }
.download-card:active { transform: scale(var(--press-scale)); }
.download-card:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.download-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--accent-700);
}
.download-label { font-size: var(--text-sm); font-weight: var(--weight-semi); color: var(--ink-900); }
.download-desc  { font-size: var(--text-xs); color: var(--ink-500); }

/* ─── Payment history ─────────────────────────────────────────────────── */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
}
.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent-50);
    color: var(--accent-700);
}
.stat-content { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-value {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
}
.stat-label { font-size: var(--text-xs); color: var(--ink-500); }

.payments-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.payment-card {
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: var(--space-4);
    transition: border-color var(--duration-1) var(--ease-out-quart);
}
.payment-card:hover { border-color: var(--ink-200); }

.payment-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.payment-company { font-size: var(--text-sm); font-weight: var(--weight-semi); color: var(--ink-900); }
.payment-info { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--ink-500); }
.payment-type, .payment-year { color: var(--ink-500); }

.payment-meta { display: flex; flex-direction: column; gap: 2px; }
.meta-item { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--text-xs); }
.meta-label { color: var(--ink-500); }
.meta-value { color: var(--ink-900); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.payment-amount {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: var(--text-md);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
}

.payment-status {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 var(--space-2);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semi);
    border-radius: var(--radius-xs);
    background: var(--ink-100);
    color: var(--ink-700);
}
.payment-status.success { background: var(--success-bg); color: var(--success); }
.payment-status.warning { background: var(--warning-bg); color: var(--warning); }
.payment-status.error   { background: var(--danger-bg);  color: var(--danger); }

.payment-actions { display: inline-flex; gap: var(--space-2); }

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--ink-500);
    border-radius: var(--radius-sm);
    transition: background var(--duration-1) var(--ease-out-quart),
                color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.action-btn:hover { background: var(--surface-sunken); color: var(--ink-900); }
.action-btn:active { transform: scale(var(--press-scale)); }
/* Semantic variants used in PaymentHistory ("view report" / "complete payment"). */
.action-btn.primary { color: var(--accent-700); }
.action-btn.primary:hover { background: var(--accent-50); color: var(--accent-800); }
.action-btn.warning { color: var(--warning); }
.action-btn.warning:hover { background: var(--warning-bg); color: var(--warning); }

.invoice-link { color: var(--accent-700); font-size: var(--text-xs); }
.invoice-link:hover { color: var(--accent-800); }

.payment-empty,
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-4);
    color: var(--ink-500);
}

.pagination-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
}
.pagination-info { font-size: var(--text-xs); color: var(--ink-500); }
.pagination-btns { display: inline-flex; align-items: center; gap: var(--space-2); }
.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 32px;
    color: var(--ink-700);
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
}
.pg-btn:hover:not(:disabled) { background: var(--surface-sunken); border-color: var(--ink-300); }
.pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pg-label { font-size: var(--text-xs); color: var(--ink-500); }

/* ─── States ──────────────────────────────────────────────────────────── */

.loading-state, .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-3);
    padding: var(--space-12) var(--space-4);
    color: var(--ink-500);
}

.spinner {
    width: 20px;
    height: 22px;
    border: 2px solid var(--ink-200);
    border-top-color: var(--accent-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.staggered-fade {
    animation: fadeInUp var(--duration-3) var(--ease-out-expo) backwards;
}

.amount, .amount-value, .currency, .mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.hint, .header-subtitle { font-size: var(--text-sm); color: var(--ink-500); }

.step-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    height: 22px;
    padding: 0 var(--space-2);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semi);
    border-radius: var(--radius-xs);
    background: var(--accent-50);
    color: var(--accent-800);
}

@media (prefers-reduced-motion: reduce) {
    .spinner,
    .btn-spinner { animation: none; border-top-color: var(--accent-600); }
    .staggered-fade { animation: none; }
}

@media (max-width: 768px) {
    .payment-card {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }
    .payment-meta, .payment-actions { justify-self: start; }
}

/* === _account.css === */
/*
   User-facing account surfaces: Settings (account), Profile, Legal/Terms.
   Card-on-muted shell, form sections, read-only fields.
*/

/* ─── Settings — account page ─────────────────────────────────────────── */

.account-page {
    min-height: 100vh;
    background: var(--surface-muted);
    padding: var(--space-6) var(--space-4) var(--space-12);
}

.account-container {
    max-width: var(--container-narrow);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.account-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-16) var(--space-4);
    color: var(--ink-500);
    font-size: var(--text-sm);
}

.account-spinner {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    border: 2px solid var(--ink-200);
    border-top-color: var(--accent-600);
    animation: accountSpin 1s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .account-spinner { animation: none; border-top-color: var(--accent-600); }
}

.account-notice {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px solid var(--ink-100);
    background: var(--surface);
    font-size: var(--text-sm);
    color: var(--ink-800);
}
.account-notice--success { background: var(--success-bg); color: var(--success); border-color: oklch(62% 0.16 152 / 0.2); }
.account-notice--warning { background: var(--warning-bg); color: var(--warning); border-color: oklch(83% 0.16 88 / 0.3); }
.account-notice--error { background: var(--danger-bg); color: var(--danger); border-color: oklch(58% 0.20 25 / 0.2); }

.account-section {
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.account-section-label {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--ink-100);
    font-size: var(--text-2xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.06em;
    color: var(--ink-500);
    text-transform: uppercase;
}

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

.account-section-divider {
    height: 1px;
    background: var(--ink-100);
    margin: var(--space-2) calc(-1 * var(--space-5));
}

.account-form-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Editable text input + native selects share one geometry. The editable input
   uses a white surface (vs. the grey surface-sunken of .account-readonly-value)
   so "editable" vs. "read-only" reads at a glance, and matches the app-wide
   input language instead of the bare browser-default box. */
.account-input,
.account-native-select {
    height: 40px;
    padding: 0 var(--space-3);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-900);
    font-size: var(--text-sm);
    transition: border-color var(--duration-1) var(--ease-out-quart),
                box-shadow var(--duration-1) var(--ease-out-quart);
}
.account-input { width: 100%; }
.account-input::placeholder { color: var(--ink-400); }
.account-input:hover,
.account-native-select:hover { border-color: var(--ink-300); }
.account-input:focus,
.account-native-select:focus {
    outline: 0;
    border-color: var(--accent-500);
    box-shadow: var(--focus-ring);
}

.account-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) 0;
    border: 0;
    border-bottom: 1px solid var(--ink-50);
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
    transition: background var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.account-switch-row:last-child { border-bottom: 0; }
.account-switch-row:hover { background: var(--surface-muted); }
.account-switch-row:active { transform: scale(var(--press-scale)); }
.account-switch-copy {
    font-size: var(--text-sm);
    color: var(--ink-900);
    font-weight: var(--weight-medium);
}
.account-switch-track {
    width: 42px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--ink-200);
    padding: 2px;
    transition: background var(--duration-1) var(--ease-out-quart);
}
.account-switch-thumb {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    background: var(--surface);
    box-shadow: 0 1px 2px oklch(15% 0.014 230 / 0.15);
    transform: translateX(0);
    transition: transform var(--duration-1) var(--ease-out-quart);
}
.account-switch-row.is-on .account-switch-track { background: var(--accent-600); }
.account-switch-row.is-on .account-switch-thumb { transform: translateX(18px); }
.account-switch-row:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px oklch(0.77 0.11 180 / 0.2);
    border-radius: var(--radius-sm);
}

.account-readonly-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--ink-50);
}
.account-readonly-field:last-child { border-bottom: 0; }

.account-readonly-value {
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 var(--space-3);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
    color: var(--ink-600);
    font-size: var(--text-sm);
}

.account-role-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 var(--space-2);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semi);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--accent-50);
    color: var(--accent-800);
    border-radius: var(--radius-xs);
    width: max-content;
}

/* Security section action row */

.account-security-action {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--ink-50);
    color: inherit;
    text-decoration: none;
}
.account-security-action:last-child { border-bottom: 0; }
.account-security-action:hover .account-security-title { color: var(--accent-700); }

.account-security-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-security-title { font-size: var(--text-sm); font-weight: var(--weight-semi); color: var(--ink-900); }
.account-security-desc  { font-size: var(--text-xs); color: var(--ink-500); }
.account-security-chevron { color: var(--ink-400); flex-shrink: 0; }

/* Form footer */

.account-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    margin: 0 calc(-1 * var(--space-5)) calc(-1 * var(--space-4));
    background: var(--surface-muted);
    border-top: 1px solid var(--ink-100);
}

.btn-account-save,
.btn-account-save--lg {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 36px;
    padding: 0 var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--surface);
    background: var(--ink-900);
    border: 1px solid var(--ink-900);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.btn-account-save:hover,
.btn-account-save--lg:hover { background: var(--ink-800); border-color: var(--ink-800); }
.btn-account-save:active,
.btn-account-save--lg:active { transform: scale(var(--press-scale)); }
.btn-account-save--lg { height: 40px; padding: 0 var(--space-5); }

.account-footer {
    text-align: center;
    font-size: var(--text-xs);
    color: var(--ink-500);
    padding-top: var(--space-3);
}

/* ─── Legal — Terms page ──────────────────────────────────────────────── */

.terms-page {
    min-height: 100vh;
    background: var(--surface-muted);
    padding: var(--space-8) var(--space-4) var(--space-16);
}

.terms-container {
    max-width: var(--container-narrow);
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    padding: var(--space-8) var(--space-8) var(--space-10);
}

@media (max-width: 640px) {
    .terms-container { padding: var(--space-5); }
}

.terms-header {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--ink-100);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.terms-header h1 {
    font-size: var(--text-2xl);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
    margin: 0;
    letter-spacing: var(--tracking-tight);
}
.last-updated {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-500);
}

.terms-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    color: var(--ink-700);
    line-height: var(--leading-loose);
    font-size: var(--text-sm);
}
.terms-content h2 {
    font-size: var(--text-md);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
    margin-top: var(--space-4);
    margin-bottom: var(--space-1);
}
.terms-content h3 {
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
}
.terms-content p { margin: 0; }
.terms-content ul, .terms-content ol { padding-left: var(--space-5); margin: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.terms-content a { color: var(--accent-700); }
.terms-content a:hover { color: var(--accent-800); }

.terms-footer {
    margin-top: var(--space-8);
    padding-top: var(--space-4);
    border-top: 1px solid var(--ink-100);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    font-size: var(--text-xs);
    color: var(--ink-500);
}

/* === _document-import.css === */
/*
   Document Import — PDF/Excel ingestion + dropzone + processing state.
*/

.import-page {
    min-height: 100vh;
    background: var(--surface-muted);
    padding: var(--space-6) var(--space-4) var(--space-12);
}

.import-page > * {
    max-width: var(--container-narrow);
    margin-left: auto;
    margin-right: auto;
}
.import-shell {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}
.import-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}
.import-hero-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}
.import-hero-title h1 {
    margin: 0;
    font-size: var(--text-2xl);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
    line-height: var(--leading-tight);
}
.import-hero-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    color: var(--accent-600);
}
.import-hero p {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--ink-500);
}
.import-card {
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}
.import-drop-card {
    padding: var(--space-4);
    box-shadow: var(--shadow-xs);
}

/* Drop zone */

.document-drop-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    min-height: 220px;
    padding: var(--space-6) var(--space-6);
    background: var(--surface-muted);
    border: 2px dashed var(--ink-200);
    border-radius: var(--radius-md);
    color: var(--ink-500);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--duration-2) var(--ease-out-quart),
                background var(--duration-2) var(--ease-out-quart);
}
.document-drop-zone:hover,
.document-drop-zone.is-dragover,
.document-drop-zone.drag-over {
    border-color: var(--accent-400);
    background: var(--accent-50);
    color: var(--accent-800);
}

.drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.drop-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-1);
}

.drop-icon svg {
    width: 40px;
    height: 40px;
    color: var(--ink-300);
    transition: color var(--duration-2) var(--ease-out-quart);
}
.document-drop-zone:hover .drop-icon svg,
.document-drop-zone.is-dragover .drop-icon svg,
.document-drop-zone.drag-over .drop-icon svg { color: var(--accent-500); }

.drop-content h3 {
    font-size: var(--text-base);
    font-weight: var(--weight-semi);
    color: var(--ink-800);
    margin: 0;
}

.drop-content p {
    font-size: var(--text-sm);
    color: var(--ink-500);
    margin: 0;
}
.drop-link {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--accent-600);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    transition: color var(--duration-1) var(--ease-out-quart),
                transform var(--duration-1) var(--ease-out-quart);
}
.drop-link:hover { color: var(--accent-700); }
.drop-link:active { transform: scale(var(--press-scale)); }
.drop-hint {
    font-size: var(--text-xs);
    color: var(--ink-400);
}

/* Processing overlay (shown while parsing) */

.processing-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    background: oklch(99% 0.003 230 / 0.94);
    border-radius: var(--radius-md);
    color: var(--ink-700);
    font-size: var(--text-sm);
}
.import-spinner {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 3px solid var(--ink-200);
    border-top-color: var(--accent-600);
    animation: import-spin 0.9s linear infinite;
}
.import-status-title {
    margin: 0;
    font-size: var(--text-md);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
}
.import-status-subtitle {
    margin: 0;
    color: var(--ink-600);
}
@keyframes import-spin { to { transform: rotate(360deg); } }

/* Result block (after parse) */

.result-display {
    padding: var(--space-5) var(--space-6);
    background: var(--surface);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.result-display pre,
.result-display code {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-700);
    background: var(--surface-muted);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 0;
}

.action-buttons {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    flex-wrap: wrap;
}
.result-icon {
    display: inline-flex;
    align-items: center;
}
.result-icon.success,
.result-title.success { color: var(--success); }
.result-icon.error,
.result-title.error,
.result-copy.error { color: var(--danger); }
.result-title {
    margin: 0;
    font-size: var(--text-md);
    font-weight: var(--weight-semi);
}
.result-copy {
    margin: 0;
    color: var(--ink-700);
}
.result-chip {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 var(--space-2);
    border-radius: var(--radius-full);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semi);
}
.result-chip.is-success { background: var(--success-bg); color: var(--success); }
.result-chip.is-info { background: var(--accent-50); color: var(--accent-700); }
.result-chip.is-warning { background: var(--warning-bg); color: var(--warning); }
.result-chip.is-error { background: var(--danger-bg); color: var(--danger); }
.result-alert {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--ink-200);
    font-size: var(--text-xs);
}
.result-alert.info {
    background: var(--accent-50);
    border-color: var(--accent-100);
    color: var(--ink-700);
}

/* Summary + metadata */

.import-section-title,
.import-subsection-title {
    margin: 0 0 var(--space-3);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-md);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
}
.import-section-icon {
    display: inline-flex;
    align-items: center;
    color: var(--ink-500);
}
.import-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-4);
}
.import-metric {
    background: var(--surface-muted);
    border: 1px solid var(--ink-100);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.import-metric-label {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--ink-500);
}
.import-metric-value {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--weight-semi);
    color: var(--ink-900);
}
.import-metric-icon {
    display: inline-flex;
    align-items: center;
}
.import-metric-icon.is-success { color: var(--success); }
.import-metric-icon.is-info { color: var(--accent-700); }
.import-metric-icon.is-warning { color: var(--warning); }
.import-metric-icon.is-error { color: var(--danger); }
.import-progress-ring {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 4px solid var(--ink-200);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: var(--weight-semi);
}
.import-progress-ring.is-success { border-color: oklch(58% 0.14 150 / 0.45); color: var(--success); }
.import-progress-ring.is-info { border-color: oklch(70% 0.12 230 / 0.45); color: var(--accent-700); }
.import-progress-ring.is-warning { border-color: oklch(78% 0.15 85 / 0.45); color: var(--warning); }
.import-progress-ring.is-error { border-color: oklch(58% 0.20 25 / 0.45); color: var(--danger); }
.import-divider {
    border: 0;
    border-top: 1px solid var(--ink-100);
}
.import-company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-3) var(--space-4);
}
.import-company-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.import-company-label {
    font-size: var(--text-2xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-500);
    font-weight: var(--weight-semi);
}
.import-company-value {
    font-size: var(--text-sm);
    color: var(--ink-900);
}
.import-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}
.import-chip {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-full);
    border: 1px solid var(--ink-200);
    background: var(--surface);
    color: var(--ink-700);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: 0.01em;
}
.import-types-note {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--ink-500);
    line-height: var(--leading-base);
}

/* Mobile — sm breakpoint: 600px */
@media (max-width: 600px) {
    .import-page {
        padding: var(--space-4) var(--space-3) var(--space-10);
    }

    .import-shell {
        gap: var(--space-4);
    }

    .import-hero-title {
        flex-direction: column;
        gap: var(--space-2);
    }

    .import-hero-title h1 {
        font-size: var(--text-xl);
        text-align: center;
    }

    .import-drop-card {
        padding: var(--space-3);
    }

    .document-drop-zone {
        min-height: 180px;
        padding: var(--space-5) var(--space-4);
    }

    .drop-icon svg {
        width: 36px;
        height: 36px;
    }

    .import-card {
        padding: var(--space-3);
    }

    .import-chip-row {
        gap: var(--space-2);
    }

    .import-chip {
        height: 28px;
        padding: 0 var(--space-3);
        font-size: var(--text-xs);
    }

    .import-metric-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

/* === _developer.css === */
/* Developer-only design-system reference surfaces. */

.dev-design-system {
    max-width: 1120px;
    margin: 0 auto;
    padding: var(--space-12) var(--space-5) var(--space-20);
    display: flex;
    flex-direction: column;
    gap: var(--space-7);
}

.dev-ds-header h1 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-2xl);
    color: var(--ink-900);
}

.dev-ds-header p {
    margin: 0;
    max-width: 680px;
    color: var(--ink-600);
}

.dev-ds-panel {
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.dev-ds-panel h2 {
    margin: 0 0 var(--space-4);
    font-size: var(--text-lg);
}

.dev-ds-panel h3 {
    margin: var(--space-6) 0 var(--space-3);
    font-size: var(--text-sm);
    color: var(--ink-700);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

.dev-swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3);
}

.dev-ds-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-2) 0 var(--space-4);
    font-size: var(--text-sm);
}

.dev-ds-table th,
.dev-ds-table td {
    border: 1px solid var(--ink-200);
    padding: var(--space-2) var(--space-3);
    text-align: left;
}

.dev-ds-table th { background: var(--ink-50); }

.dev-typo-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.dev-h1,
.dev-h2,
.dev-h3,
.dev-h4 {
    margin: 0 0 var(--space-1);
    color: var(--ink-900);
}

.dev-h1 { font-size: var(--text-2xl); }
.dev-h2 { font-size: var(--text-xl); }
.dev-h3 { font-size: var(--text-lg); }
.dev-h4 { font-size: var(--text-md); }

.dev-body1,
.dev-body2,
.dev-muted {
    margin: 0;
}

.dev-muted {
    color: var(--ink-500);
    font-size: var(--text-sm);
}

.dev-color-swatch {
    display: flex;
    flex-direction: column;
    min-height: 120px;
    overflow: hidden;
    background: var(--surface);
    border-radius: var(--radius-lg);
}

.dev-color-swatch.has-border {
    border: 1px solid var(--ink-200);
}

.dev-color-swatch__color {
    flex: 1;
    min-height: 80px;
}

.dev-color-swatch__meta {
    padding: var(--space-3) var(--space-4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-1);
    background: var(--surface);
}

.dev-color-swatch__name {
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    color: var(--ink-900);
}

.dev-color-swatch__hex {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--ink-500);
}

/* === _landing.css === */
/*
   Landing — guilloché background + self-assembling filing card.
   Light theme, North-Atlantic teal accent, black pill CTAs.
   Motion: Emil Kowalski's playbook — custom ease-out, stagger, transform+opacity only.
   prefers-reduced-motion respected throughout.
*/

/* ── BACKGROUND: animated guilloché (engraved security line-work) ──────── */

.engrave {
    position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
    -webkit-mask-image: radial-gradient(120% 95% at 72% 46%, #000 18%, transparent 70%);
            mask-image: radial-gradient(120% 95% at 72% 46%, #000 18%, transparent 70%);
}
.engrave svg {
    position: absolute; left: 50%; top: 48%;
    width: min(1500px, 150vw); height: min(1500px, 150vw);
    transform: translate(-50%, -50%);
}
.engrave .g-a { animation: spin-cw  140s linear infinite; transform-origin: center; }
.engrave .g-b { animation: spin-ccw 200s linear infinite; transform-origin: center; }
.engrave path { fill: none; vector-effect: non-scaling-stroke; }
.engrave .g-a path { stroke: oklch(54% .10 198 / .24); stroke-width: 1; }
.engrave .g-b path { stroke: oklch(58% .07 208 / .17); stroke-width: 1; }
@keyframes spin-cw  { to { transform: rotate(360deg);  } }
@keyframes spin-ccw { to { transform: rotate(-360deg); } }

.ambient {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(80% 60% at 30% 38%, oklch(99% .003 230 / .85), transparent 60%);
}

/* ─── Shell ──────────────────────────────────────────────────────────── */

.landing {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
    color: var(--ink-900);
    font-family: var(--font-sans);
}

/* ─── Nav ────────────────────────────────────────────────────────────── */

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    padding: var(--space-5) var(--space-6);
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-2);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-tight);
    color: var(--ink-900);
    text-decoration: none;
}
.brand .brand-xbrl { color: var(--ink-900); }
.brand .brand-fo   { color: var(--ink-500); font-weight: var(--weight-medium); }

.nav-actions { display: inline-flex; align-items: center; gap: var(--space-4); }

.nav-link {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-700);
    text-decoration: none;
    transition: color var(--duration-1) var(--ease-out-quart);
}
.nav-link:hover { color: var(--ink-900); }

.nav-cta {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 var(--space-4);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--surface);
    background: var(--ink-900);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: background var(--duration-1) var(--ease-out-quart),
                transform  var(--duration-1) var(--ease-out-quart);
}
.nav-cta:hover  { background: var(--ink-800); color: var(--surface); }
.nav-cta:active { transform: scale(var(--press-scale)); }
.nav-cta:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ─── Main grid ───────────────────────────────────────────────────────── */

.main {
    flex: 1;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem var(--space-6) 3rem;
    display: grid;
    grid-template-columns: 1.04fr .96fr;
    align-items: center;
    gap: 3.5rem;
}

/* Left column — copy */
.copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-6);
    max-width: 480px;
    min-width: 0;
}

/* ─── Entry stagger ────────────────────────────────────────────────────── */

.reveal { opacity: 0; transform: translateY(14px); animation: rise .7s var(--ease-out-expo) forwards; }
.d1 { animation-delay: .04s; }
.d2 { animation-delay: .12s; }
.d3 { animation-delay: .20s; }
.d4 { animation-delay: .28s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ─── Headline ────────────────────────────────────────────────────────── */

.headline {
    font-size: clamp(2.15rem, 4vw, 3.5rem);
    font-weight: var(--weight-semi);
    line-height: 1.06;
    letter-spacing: -0.034em;
    color: var(--ink-900);
    margin: 0;
    max-width: 14ch;
}
.headline .line   { display: block; }
.headline .accent { color: var(--accent-700); position: relative; width: max-content; max-width: 100%; }
.headline .accent::after {
    content: "";
    position: absolute; left: 0; bottom: .04em;
    height: 3px; width: 100%;
    background: linear-gradient(90deg, var(--accent-500), oklch(72% .10 195));
    border-radius: 2px;
    transform: scaleX(0); transform-origin: left;
    animation: draw 1s var(--ease-out-quart) .55s forwards;
}
@keyframes draw { to { transform: scaleX(1); } }

.lede {
    font-size: var(--text-md);
    line-height: 1.55;
    color: var(--ink-600);
    margin: 0;
    max-width: 50ch;
}

/* CTA row */

.cta-row {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-2);
    flex-wrap: wrap;
}

.cta-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 48px;
    padding: 0 var(--space-6);
    font-size: var(--text-sm);
    font-weight: var(--weight-semi);
    color: var(--surface);
    background: var(--ink-900);
    border-radius: var(--radius-full);
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: background var(--duration-1) var(--ease-out-quart),
                transform  var(--duration-1) var(--ease-out-expo),
                box-shadow var(--duration-2) var(--ease-out-quart);
}
.cta-primary svg { transition: transform var(--duration-3) var(--ease-out-quart); }
.cta-primary:hover { background: var(--ink-800); box-shadow: var(--shadow-xl); color: var(--surface); }
.cta-primary:hover svg { transform: translateX(2px); }
.cta-primary:active { transform: scale(var(--press-scale)); }
.cta-primary:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.cta-secondary {
    display: inline-flex;
    align-items: center;
    height: 48px;
    padding: 0 var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink-700);
    background: transparent;
    text-decoration: none;
    border-radius: var(--radius-full);
    transition: background var(--duration-1) var(--ease-out-quart),
                color      var(--duration-1) var(--ease-out-quart);
}
.cta-secondary:hover  { color: var(--ink-900); background: var(--ink-50); }
.cta-secondary:active { transform: scale(var(--press-scale)); }
.cta-secondary:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-full); }

/* ─── Hero visual: stage + filing card ───────────────────────────────── */

.stage {
    position: relative;
    justify-self: center;
    width: 100%;
    max-width: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filing {
    position: relative;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 60px -24px oklch(15% .014 230 / .22),
                0 10px 22px -12px oklch(15% .014 230 / .12);
    padding: 1.4rem 1.5rem 1.55rem;
    animation: float 9s var(--ease-in-out-sine) infinite alternate;
    will-change: transform;
}
@keyframes float { 0% { transform: translateY(0); } 100% { transform: translateY(-12px); } }

/* Segmented control */
.seg {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--ink-100);
    border-radius: var(--radius-full);
    padding: 3px;
    margin-bottom: 1rem;
}
.seg-btn {
    position: relative; z-index: 1;
    border: 0; background: transparent;
    font-family: var(--font-sans);
    font-size: .8125rem; font-weight: var(--weight-semi);
    color: var(--ink-500);
    padding: 7px 0;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: color .2s;
}
.seg-btn.is-active { color: var(--ink-900); }
.seg-ind {
    position: absolute; z-index: 0;
    top: 3px; bottom: 3px; left: 3px;
    width: calc(50% - 3px);
    background: var(--surface);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    transition: transform .34s var(--ease-out-expo);
}
.seg.tax .seg-ind { transform: translateX(100%); }

/* Filing header */
.filing-head2 {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: .9rem;
}
.filing-title {
    font-size: var(--text-md);
    font-weight: var(--weight-semi);
    letter-spacing: -.01em;
    color: var(--ink-900);
    margin: 0;
}

/* Validated badge (scoped to landing card to avoid collision with shared .badge) */
.filing .badge {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .6875rem; font-weight: var(--weight-semi);
    color: var(--success);
    background: var(--success-bg);
    border: 1px solid oklch(58% .14 150 / .25);
    padding: 4px 9px;
    border-radius: var(--radius-full);
    opacity: 0; transform: scale(.8) translateY(-2px);
}
.filing .badge.on { animation: stamp .5s var(--ease-out-expo) forwards; }
@keyframes stamp {
    0%   { opacity: 0; transform: scale(.6) rotate(-6deg); }
    60%  { opacity: 1; transform: scale(1.08) rotate(1deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}
.filing .badge svg { width: 11px; height: 11px; }

/* Filing rows */
.frow {
    display: grid; grid-template-columns: 1fr auto;
    align-items: center; gap: var(--space-2);
    padding: .5rem 0;
    border-bottom: 1px solid var(--ink-100);
    opacity: 0; transform: translateY(6px);
}
.frow.in { animation: rowin .5s var(--ease-out-quart) forwards; }
@keyframes rowin { to { opacity: 1; transform: none; } }
.fleft { display: flex; align-items: baseline; gap: var(--space-2); min-width: 0; }
.flabel { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--ink-800); }
.ftag {
    font-family: var(--font-mono); font-size: .625rem;
    color: var(--accent-700);
    background: var(--accent-50);
    border: 1px solid var(--accent-100);
    border-radius: 4px;
    padding: 1px 5px;
    white-space: nowrap;
    opacity: 0; transform: translateX(-4px);
}
.ftag.in { animation: tagin .45s var(--ease-out-quart) forwards; }
@keyframes tagin { to { opacity: 1; transform: none; } }
.fval {
    font-family: var(--font-mono);
    font-size: var(--text-sm); font-weight: var(--weight-semi);
    color: var(--ink-900);
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.ftotal {
    border-bottom: none;
    border-top: 1.5px solid var(--ink-300);
    margin-top: .35rem;
    padding-top: .7rem;
}
.ftotal .flabel { font-weight: var(--weight-semi); color: var(--ink-900); }
.ftotal .fval   { font-size: var(--text-md); }

/* Reconciliation line */
.recon {
    display: flex; align-items: center; gap: .4rem;
    margin-top: .7rem;
    font-size: var(--text-xs);
    color: var(--ink-500);
    opacity: 0;
}
.recon.on { animation: rise .5s var(--ease-out-quart) forwards; }
.recon b  { color: var(--success); font-weight: var(--weight-semi); }

/* ─── Footer ──────────────────────────────────────────────────────────── */

.landing-footer {
    position: relative; z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
    padding: var(--space-5) var(--space-6) var(--space-6);
    font-size: var(--text-xs);
    color: var(--ink-500);
    border-top: 1px solid var(--ink-100);
}
.footer-links { display: inline-flex; gap: var(--space-5); }
.footer-links a {
    color: var(--ink-500);
    text-decoration: none;
    transition: color var(--duration-1) var(--ease-out-quart);
}
.footer-links a:hover { color: var(--ink-900); }
.footer-links a:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

/* ─── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 880px) {
    .main { grid-template-columns: 1fr; gap: 2.5rem; }
    .copy { max-width: 600px; }
    .stage { max-width: 420px; order: 2; }
}

@media (max-width: 560px) {
    .nav-link { display: none; }
    .landing-footer { flex-direction: column; gap: var(--space-3); }
}

/* ─── Reduced motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .engrave .g-a, .engrave .g-b, .filing { animation: none !important; }
    .reveal, .frow, .ftag, .badge, .recon {
        opacity: 1 !important; transform: none !important; animation: none !important;
    }
    .headline .accent::after { transform: scaleX(1); animation: none; }
}

/* Hover gates on touch */
@media (hover: none) {
    .cta-primary:hover { background: var(--ink-900); box-shadow: var(--shadow-md); }
    .cta-primary:hover svg { transform: none; }
}
