:root {
    /* COLOR TOKENS (existing) */
    --text-primary: #0f172a;
    --text-muted: #475569;
    --bg-soft: #f8fafc;
    --bg-surface: #ffffff;
    --bg-app: #eef3ff;
    --border-subtle: #e2e8f0;
    --royal-blue: #4169e1;
    --brand-blue: #3b82f6;
    --brand-blue-dark: #2563eb;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --alert: #dc2626;
    --alert-bg: #fef2f2;
    --shadow-soft: 0 16px 40px rgba(15, 23, 42, 0.08);
    --radius-lg: 16px;
    --radius-md: 12px;
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.62);
    --glass-blur: 12px;

    /* TYPOGRAPHY SCALE (NEW) */
    /* Font Sizes - Using rem for scalability */
    --fs-xs: 0.75rem;      /* 12px - Use sparingly */
    --fs-sm: 0.875rem;     /* 14px - WCAG recommended minimum */
    --fs-base: 1rem;       /* 16px - Body text default */
    --fs-md: 1.125rem;     /* 18px - Labels, emphasis */
    --fs-lg: 1.5rem;       /* 24px - Subheadings */
    --fs-xl: 2rem;         /* 32px - Main headings */
    --fs-2xl: 2.5rem;      /* 40px - Hero headings (future) */

    /* Line Heights */
    --lh-tight: 1.2;       /* Headings */
    --lh-normal: 1.5;      /* Body text */
    --lh-relaxed: 1.75;    /* Large blocks */

    /* Font Weights */
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
}

* { 
    box-sizing: border-box; 
}

/* BASE TYPOGRAPHY */
body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top right, #dbeafe 0, var(--bg-soft) 45%);
    color: var(--text-primary);
    font-family: Inter, Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    font-weight: var(--fw-normal);
}

/* SEMANTIC HEADING HIERARCHY */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
}

h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
h4, h5, h6 { font-size: var(--fs-base); }

/* LAYOUT */
.page-shell {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px;
}

.site-header,
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-header { 
    margin-bottom: 24px; 
}

.site-footer {
    margin-top: 20px;
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

/* BRAND */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: var(--fw-bold);
    letter-spacing: 0.2px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--brand-blue), var(--brand-blue-dark));
    color: #fff;
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
}

.brand-logo {
    height: 60px;
    width: auto;
    max-width: 120px;
    display: inline-block;
}

/* PAGE STRUCTURE */
.page-heading {
    margin: 0 0 24px;
}

.page-title {
    margin: 0;
    font-size: var(--fs-xl);
    line-height: var(--lh-tight);
}

.page-subtitle {
    margin: 10px 0 0;
    font-size: var(--fs-sm);
    color: var(--text-muted);
    line-height: var(--lh-normal);
}

.card-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 30px;
}

/* TRUST HEADER */
.trust-header {
    padding: 22px;
    border-radius: var(--radius-md);
    border: 1px solid #bfdbfe;
    background: linear-gradient(140deg, #eff6ff, #ffffff);
    margin-bottom: 24px;
}

.trust-header h1 {
    margin: 0;
    font-size: var(--fs-xl);
}

.trust-header p {
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

/* FORMS */
.form-group { 
    margin-bottom: 18px; 
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: var(--fw-semibold);
    font-size: var(--fs-md);
    color: var(--text-primary);
}

.input-control {
    width: 100%;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 11px 12px;
    font-size: var(--fs-sm);
    line-height: var(--lh-normal);
    color: var(--text-primary);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.input-control:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}

.field-hint {
    margin: 7px 0 0;
    color: var(--text-muted);
    font-size: var(--fs-sm);
    line-height: var(--lh-normal);
}

.validation-error {
    margin-top: 6px;
    color: var(--alert);
    font-size: var(--fs-sm);
    line-height: var(--lh-normal);
    display: none;
}

/* FILE UPLOAD */
.drop-zone {
    border: 2px dashed #93c5fd;
    border-radius: var(--radius-md);
    padding: 18px;
    display: grid;
    gap: 7px;
    justify-items: start;
    background: #f8fbff;
}

.drop-zone.dragover { 
    background: #eff6ff; 
    border-color: var(--brand-blue); 
}

.file-icon { 
    font-size: var(--fs-lg); 
}

/* BUTTONS */
.button-primary {
    border: none;
    border-radius: 10px;
    padding: 11px 16px;
    background: var(--brand-blue);
    color: #fff;
    font-weight: var(--fw-semibold);
    font-size: var(--fs-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.button-primary:hover { 
    background: var(--brand-blue-dark); 
}

.button-primary:disabled { 
    opacity: 0.7; 
    cursor: not-allowed; 
}

.button-secondary {
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 11px 16px;
    background: #fff;
    color: var(--text-primary);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.button-secondary:hover {
    background: #f8fafc;
}

.button-quiet {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 0;
    color: var(--brand-blue-dark);
    text-decoration: none;
    font-weight: var(--fw-medium);
    font-size: var(--fs-sm);
}

.button-quiet:hover {
    text-decoration: underline;
}

/* SPINNER */
.spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: spin 0.9s linear infinite;
}

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

/* STATUS CARDS */
.status-card {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    padding: 16px;
    margin-bottom: 16px;
}

.status-head {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: var(--fw-bold);
    font-size: var(--fs-base);
    margin-bottom: 8px;
}

.status-icon { 
    width: 20px; 
    height: 20px; 
    flex-shrink: 0;
}

.status-card.success {
    background: var(--success-bg);
    border-color: #bbf7d0;
}

.status-card.error {
    background: var(--alert-bg);
    border-color: #fecaca;
}

.status-card p {
    margin: 8px 0;
    font-size: var(--fs-sm);
    line-height: var(--lh-normal);
}

.status-card strong {
    font-weight: var(--fw-bold);
}

.status-card ul,
.status-card li {
    font-size: var(--fs-sm);
    line-height: var(--lh-normal);
}

/* SUMMARY GRID */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.summary-item {
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px;
    background: #fff;
}

.summary-item .label { 
    color: var(--text-muted); 
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    margin-bottom: 4px;
}

.summary-item .value { 
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
}

/* ACTIONS & LINKS */
.action-row,
.cta-row {
    display: flex; 
    gap: 12px; 
    align-items: center;
    flex-wrap: wrap;
}

.link-quiet { 
    color: var(--brand-blue-dark); 
    text-decoration: none; 
    font-weight: var(--fw-medium);
    font-size: var(--fs-sm);
    transition: text-decoration 0.2s ease;
}

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

.empty-state {
    text-align: center;
    padding: 28px 20px;
    border: 1px dashed #cbd5e1;
    background: linear-gradient(160deg, rgba(248, 250, 252, 0.88), rgba(255, 255, 255, 0.94));
}

.empty-state h3 {
    margin: 0;
    color: #1e3a8a;
}

.empty-state p {
    margin: 8px auto 0;
    max-width: 56ch;
    color: var(--text-muted);
}

.empty-state .cta-row {
    justify-content: center;
    margin-top: 14px;
}

/* UTILITIES */
.required { 
    color: var(--alert); 
}

.hidden { 
    display: none !important; 
}

/* AUTH PAGE */
.auth-page {
    min-height: 70vh;
    display: grid;
    place-items: center;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    padding: 28px;
}

.auth-card-header h1 {
    margin: 2px 0 8px;
    font-size: var(--fs-xl);
    letter-spacing: -0.3px;
}

.auth-kicker {
    margin: 0;
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    line-height: var(--lh-tight);
}

.auth-card-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--fs-sm);
    line-height: var(--lh-normal);
}

.auth-form {
    margin-top: 22px;
}

.password-field {
    position: relative;
}

.password-field .input-control {
    padding-right: 80px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--brand-blue-dark);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-xs);
    cursor: pointer;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--brand-blue);
}

.auth-meta-row {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 10px;
}

.auth-form-error {
    margin-bottom: 12px;
}

.auth-submit {
    width: 100%;
    justify-content: center;
    min-height: 44px;
}

.auth-divider {
    margin-top: 14px;
    position: relative;
    text-align: center;
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid var(--border-subtle);
}

.auth-divider span {
    position: relative;
    z-index: 1;
    background: #fff;
    padding: 0 10px;
    color: var(--text-muted);
    font-size: var(--fs-xs);
    letter-spacing: 0.08em;
    line-height: var(--lh-tight);
}

.auth-signup {
    margin: 16px 0 0;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--fs-sm);
    line-height: var(--lh-normal);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    
    /* This creates the 'button' look */
    background: white;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    padding: 10px 16px;
    
    /* This removes the 'blue link' look */
    color: #5f6368;
    text-decoration: none;
    font-family: sans-serif;
    font-weight: 500;
    width: 100%;
    transition: background-color 0.2s;
}

.btn-google:hover {
    background-color: #f7f7f7;
    color: #3c4043;
}

.btn-google img {
    display: block;
}
  
.ui-artifact-card {
    background: var(--bg-surface);
    /* Strict Constraint: Sharp corners (0px radius) */
    border: 1px solid var(--border-subtle);
    /* The "Action Required" Visual Cue */
    border-left: 4px solid var(--alert-red); 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin: 2rem auto;
    max-width: 800px;
    width: 100%;
}
  
.artifact-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: #F9FAFB;
    border-bottom: 1px solid var(--border-subtle);
}

.status-indicator {
    height: 8px;
    width: 8px;
    background-color: var(--alert-red);
    border-radius: 50%;
    margin-right: 0.75rem;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}
  
.artifact-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
  
.artifact-content {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
}  

/* RESPONSIVE TYPOGRAPHY - TABLET & UP */
@media (min-width: 768px) {
    .page-title {
        font-size: var(--fs-xl);
    }

    .auth-card-header h1 {
        font-size: var(--fs-xl);
    }
}

/* RESPONSIVE TYPOGRAPHY - MOBILE */
@media (max-width: 640px) {
    :root {
        /* Slight reduction on mobile for 16px base */
        --fs-sm: 0.8125rem;   /* 13px minimum for readability */
    }

    .card-container {
        padding: 20px;
    }

    .auth-card {
        padding: 22px 18px;
    }

    .page-title {
        font-size: 1.75rem;   /* 28px instead of 32px on mobile */
    }

    .auth-card-header h1 {
        font-size: 1.75rem;   /* 28px on mobile */
    }

    label {
        font-size: var(--fs-base);  /* 16px labels on mobile */
    }

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

    .action-row,
    .cta-row {
        flex-direction: column;
    }

    .action-row .button-primary,
    .action-row .link-quiet,
    .cta-row .button-primary,
    .cta-row .button-secondary,
    .cta-row .button-quiet {
        width: 100%;
        text-align: center;
    }
}

/* ACCESSIBILITY - High contrast mode support */
@media (prefers-contrast: more) {
    body {
        font-weight: var(--fw-medium);
    }

    label {
        font-weight: var(--fw-bold);
    }
}

/* ACCESSIBILITY - Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* DASHBOARD (POST-LOGIN) */
.dashboard-site-header {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.dashboard-nav {
    display: inline-flex;
    gap: 18px;
    align-items: center;
}

.nav-link {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
}

.nav-link-active {
    color: var(--text-primary);
    border-bottom-color: var(--brand-blue-dark);
}

.dashboard-page {
    display: grid;
    gap: 16px;
}

.dashboard-section {
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    padding: 18px;
}

.app-section {
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 255, 0.86));
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    padding: 18px;
}

.app-section-header {
    margin-bottom: 14px;
}

.app-section-header h2 {
    color: #1e3a8a;
}

.system-status {
    border-width: 2px;
    background: linear-gradient(160deg, #fffdf8, #fff8ee);
}

.system-status .status-label {
    margin: 0;
    text-transform: uppercase;
    font-size: var(--fs-xs);
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.system-status h1 {
    margin-top: 8px;
    font-size: 1.875rem;
}

.system-status .status-summary {
    margin: 8px 0 0;
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
}

.system-status .status-note {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

.system-status-ok {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.system-status-ok h1,
.system-status-ok .status-summary {
    color: #166534;
}

.system-status-drift {
    border-color: #fdba74;
    background: linear-gradient(145deg, #fff7ed, #fffbf5);
}

.system-status-drift h1,
.system-status-drift .status-summary {
    color: #9a3412;
}

.dashboard-insight-pair {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 16px;
    align-items: start;
}

.section-heading-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.section-heading-row p {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

.events-table,
.data-table {
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.86);
}

.events-row,
.data-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    text-align: left;
}

.events-header,
.data-row-header {
    background: #f8fafc;
    color: var(--text-muted);
    font-size: var(--fs-xs);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: var(--fw-semibold);
}

.events-item {
    border: 0;
    border-top: 1px solid var(--border-subtle);
    background: transparent;
    cursor: pointer;
    font-size: var(--fs-sm);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.events-item:hover {
    background: #f4f7ff;
}

.events-item.is-selected {
    background: #eaf1ff;
}

.events-item.is-focused {
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.38);
    position: relative;
    z-index: 1;
}

.money-diff {
    color: #15803d;
    font-weight: var(--fw-semibold);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid #c7d7f8;
    background: #eff4ff;
    color: #2c477a;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    padding: 3px 8px;
    border-radius: 999px;
}

.status-pill-recurring {
    border-color: #c8e8d3;
    background: #f2fbf6;
    color: #1f6b46;
}

.support-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text-primary);
}

.support-list li + li {
    margin-top: 8px;
}

.markdown-page h1,
.markdown-page h2,
.markdown-page h3 {
    margin: 18px 0 10px;
}

.markdown-page p {
    margin: 0 0 10px;
    color: var(--text-primary);
}

.markdown-page ul {
    margin: 0 0 10px;
    padding-left: 20px;
}

.explanation-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

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

.explanation-grid div {
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: #f8fafc;
}

.explanation-grid dt {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 6px;
}

.explanation-grid dd {
    margin: 0;
    font-size: var(--fs-sm);
}

.system-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.system-info-grid article {
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 12px;
}

.system-info-grid h3 {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 5px;
}

.system-info-grid p {
    margin: 0;
    font-weight: var(--fw-semibold);
}

.status-text-good {
    color: #15803d;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-actions .button-secondary,
.dashboard-actions .button-primary,
.dashboard-actions .button-quiet {
    text-decoration: none;
}

@media (max-width: 768px) {
    .dashboard-insight-pair {
        grid-template-columns: 1fr;
    }

    .events-row,
    .data-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

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

/* APP LAYOUT */
.app-body {
    background: linear-gradient(180deg, #f7f9ff 0%, var(--bg-app) 100%);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(6px);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--border-subtle);
}

.app-header-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.app-page-shell {
    max-width: 1080px;
    padding-top: 28px;
}

.app-nav {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.app-utilities {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.logout-form {
    margin: 0;
}

.utility-logout {
    padding: 8px 12px;
    font-size: var(--fs-xs);
}

.utility-link {
    font-size: var(--fs-sm);
}

.app-footer {
    max-width: 960px;
    margin: 0 auto 24px;
    padding: 0 20px;
}

/* MARKETING LAYOUT */
.marketing-body {
    background: #ffffff;
}

.marketing-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.marketing-nav {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.marketing-cta {
    text-decoration: none;
    padding: 9px 14px;
}

.marketing-footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    border-top: 1px solid var(--border-subtle);
    gap: 20px;
    flex-wrap: wrap;
}

.marketing-footer-copy {
    display: grid;
    gap: 4px;
    color: var(--text-muted);
}

.marketing-trust-note {
    font-size: var(--fs-sm);
}

.marketing-footer-legal {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

@media (max-width: 780px) {
    .app-header-inner {
        flex-wrap: wrap;
    }

    .app-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }

    .marketing-header {
        padding-top: 14px;
    }
}
.billing-card {
    display: grid;
    gap: 12px;
}

.billing-meta {
    display: grid;
    gap: 6px;
    color: var(--text-primary);
}

.billing-meta p {
    margin: 0;
}
.error-toast-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
}

.error-toast {
  width: min(350px, calc(100vw - 2rem));
  background: #fff;
  border-left: 4px solid #c62828;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 0.75rem 0.875rem;
}

.error-toast--enter {
  animation: error-toast-slide-in 220ms ease-out;
}

@keyframes error-toast-slide-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

.error-toast__header { display: flex; align-items: center; gap: 0.5rem; }
.error-toast__icon { color: #c62828; }
.error-toast__title { flex: 1; font-size: 0.95rem; }
.error-toast__close { background: transparent; border: 0; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.error-toast__body { margin: 0.5rem 0 0.75rem; font-size: 0.9rem; color: #1f2937; }
.error-toast__actions { display: flex; justify-content: flex-end; }
/* Onboarding wizard */
.wizard-shell { display: grid; gap: 18px; }
.wizard-header p { max-width: 70ch; }
.wizard-stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.wizard-step { border: 1px solid var(--border-subtle); border-radius: 12px; padding: 10px; background: #fff; color: var(--text-muted); display:flex; align-items:center; gap:8px; }
.wizard-step span { width: 22px; height: 22px; border-radius: 999px; background: #dbeafe; color: #1d4ed8; display:inline-flex; align-items:center; justify-content:center; font-size: 12px; font-weight: 700; }
.wizard-step.is-active { border-color: #93c5fd; background: #eff6ff; color: var(--text-primary); }
.wizard-step.is-complete span { background: #dcfce7; color: #166534; }
.wizard-card { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 18px; background: #fff; }
.wizard-upload-card .drop-zone { margin-top: 10px; }
.wizard-mapping-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 18px; }
.wizard-status-card, .wizard-summary-grid { display:grid; gap: 8px; }
.wizard-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.wizard-warning { color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 10px; }
.wizard-ignored { margin-top: 8px; border-top: 1px solid var(--border-subtle); padding-top: 10px; }
.wizard-checkbox { display:flex; align-items:center; gap:8px; font-size: var(--fs-sm); }
.wizard-validation-message { display: none; margin-bottom: 10px; }
.wizard-sample pre { overflow:auto; max-height: 240px; background:#f8fafc; border:1px solid var(--border-subtle); border-radius:8px; padding:10px; font-size: 12px; }

@media (max-width: 900px) {
  .wizard-stepper { grid-template-columns: 1fr 1fr; }
  .wizard-mapping-grid, .wizard-summary-grid { grid-template-columns: 1fr; }
}

.wizard-error-panel {
    margin: 24px auto;
    max-width: 560px;
    text-align: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 28px 24px;
    display: none;
}

.wizard-error-panel.is-visible {
    display: block;
}

.wizard-error-code {
    margin: 12px 0 8px;
    color: var(--alert);
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
}

.wizard-error-message {
    margin: 0 0 20px;
    color: var(--text-muted);
    font-size: var(--fs-sm);
}
