/* ============================================================
   INFLECT DESIGN SYSTEM
   Premium financial intelligence platform
   Typography: Bricolage Grotesque + DM Sans + JetBrains Mono
   Palette: Obsidian slate + Emerald + Amber gold
   ============================================================ */

/* --- DESIGN TOKENS --- */
:root {
    /* Surfaces */
    --surface-0: #FFFFFF;
    --surface-1: #F8FAFC;
    --surface-2: #F1F5F9;
    --surface-3: #E2E8F0;
    --surface-4: #CBD5E1;

    /* Ink */
    --ink-900: #0F172A;
    --ink-800: #1E293B;
    --ink-700: #334155;
    --ink-600: #475569;
    --ink-500: #64748B;
    --ink-400: #94A3B8;
    --ink-300: #CBD5E1;

    /* Brand - Emerald */
    --brand: #059669;
    --brand-dark: #047857;
    --brand-darker: #065F46;
    --brand-light: #D1FAE5;
    --brand-50: #ECFDF5;
    --brand-glow: rgba(5, 150, 105, 0.08);
    --brand-glow-strong: rgba(5, 150, 105, 0.15);

    /* Accent - Gold */
    --gold: #D97706;
    --gold-light: #FEF3C7;
    --gold-50: #FFFBEB;

    /* Semantic */
    --success: #059669;
    --success-bg: #ECFDF5;
    --warning: #D97706;
    --warning-bg: #FFFBEB;
    --error: #DC2626;
    --error-bg: #FEF2F2;
    --info: #2563EB;
    --info-bg: #EFF6FF;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.06), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-brand: 0 4px 14px rgba(5, 150, 105, 0.25);
    --shadow-card-hover: 0 12px 28px rgba(15, 23, 42, 0.1), 0 4px 10px rgba(15, 23, 42, 0.04);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;

    /* Typography scale */
    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-lg: 1.0625rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
}


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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    color: var(--ink-700);
    background: var(--surface-1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.6;
    margin: 0;
}


/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
    color: var(--ink-900);
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin: 0;
    border: none;
    padding: 0;
}

h1 {
    font-size: var(--text-3xl);
    font-weight: 800;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-bottom: var(--space-6) !important;
}

h2 {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-4);
}

h3 {
    font-size: var(--text-xl);
    font-weight: 700;
}

h4 {
    font-size: var(--text-lg);
    font-weight: 600;
}

p {
    color: var(--ink-600);
    line-height: 1.7;
}

small {
    font-size: var(--text-sm);
    color: var(--ink-500);
}

strong {
    font-weight: 600;
    color: var(--ink-800);
}

.font-mono {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.text-display {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-weight: 800;
    font-size: var(--text-5xl);
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.text-caption {
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-400);
}


/* === NAVIGATION === */
.navbar {
    background: var(--ink-900);
    color: white;
    padding: 0;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(255,255,255,0.05);
    backdrop-filter: blur(12px);
}

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

.nav-brand {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: var(--text-xl);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.nav-brand a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-logo {
    height: 40px;
    width: auto;
    display: block;
    object-fit: contain;
    mix-blend-mode: screen;
}

.nav-brand a:hover {
    color: white;
    text-decoration: none;
    opacity: 0.9;
}

.nav-center ul {
    display: flex;
    gap: var(--space-1);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-center a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) ease;
}

.nav-center a:hover {
    color: white;
    background: rgba(255,255,255,0.08);
    text-decoration: none;
}

.nav-center a.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

/* Nav dropdown */
.nav-dropdown {
    position: relative;
}

ul.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 180px;
    background: var(--ink-900);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: var(--space-2) 0;
    box-shadow: 0 12px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.06);
    z-index: 1000;
    flex-direction: column;
    gap: 0;
    animation: dropdownReveal 0.15s var(--ease-out);
}

@keyframes dropdownReveal {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-dropdown-menu li {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: var(--space-2) var(--space-4);
    border-radius: 0;
    white-space: nowrap;
}

.nav-dropdown.open > ul.nav-dropdown-menu {
    display: flex;
}

.nav-end {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-email {
    color: rgba(255,255,255,0.5);
    font-size: var(--text-sm);
    font-weight: 400;
}

.nav-end a[role="button"] {
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-3);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--duration-fast) ease;
    cursor: pointer;
}

.nav-end a[role="button"]:hover {
    background: rgba(255,255,255,0.12);
    color: white;
    border-color: rgba(255,255,255,0.2);
}


/* === LAYOUT === */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

main.container {
    min-height: calc(100vh - 140px);
    padding-top: var(--space-8);
    padding-bottom: var(--space-12);
}

.page-header {
    margin-bottom: var(--space-8);
}

.page-header h1 {
    margin-bottom: var(--space-2) !important;
}

.page-header p {
    color: var(--ink-500);
    font-size: var(--text-lg);
    margin: 0;
}


/* === BUTTONS === */
button, [role="button"], .btn {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    border: none;
    transition: all var(--duration-normal) var(--ease-out);
}

button[type="submit"],
.primary-button,
.btn-primary {
    background: var(--brand) !important;
    color: white !important;
    border: none !important;
    padding: var(--space-3) var(--space-5) !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600;
    font-size: var(--text-sm) !important;
    font-family: 'DM Sans', system-ui, sans-serif !important;
    letter-spacing: 0;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all var(--duration-normal) var(--ease-out);
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

button[type="submit"]:hover,
.primary-button:hover,
.btn-primary:hover {
    background: var(--brand-dark) !important;
    box-shadow: var(--shadow-brand);
    transform: translateY(-1px);
}

button[type="submit"]:active,
.primary-button:active,
.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.outline,
.btn-outline {
    background: var(--surface-0) !important;
    color: var(--ink-700) !important;
    border: 1px solid var(--surface-3) !important;
    padding: var(--space-3) var(--space-5) !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600;
    font-size: var(--text-sm) !important;
    box-shadow: var(--shadow-xs);
    transition: all var(--duration-normal) var(--ease-out);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.outline:hover,
.btn-outline:hover {
    background: var(--surface-1) !important;
    border-color: var(--ink-300) !important;
    color: var(--ink-900) !important;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent !important;
    color: var(--ink-600) !important;
    border: none !important;
    padding: var(--space-2) var(--space-3) !important;
    border-radius: var(--radius-sm) !important;
}

.btn-ghost:hover {
    background: var(--surface-2) !important;
    color: var(--ink-900) !important;
}

/* Export buttons */
.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-1);
    color: var(--ink-600);
    border: 1px solid var(--surface-3);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    white-space: nowrap;
}
.btn-export:hover {
    background: var(--surface-2);
    color: var(--ink-900);
    border-color: var(--ink-300);
}

/* Saved view pills */
.saved-view-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-1);
    border: 1px solid var(--surface-3);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--ink-700);
    cursor: pointer;
    transition: all var(--duration-fast);
}
.saved-view-pill:hover {
    background: var(--brand-50);
    border-color: var(--brand);
    color: var(--brand-dark);
}
.saved-view-pill .sv-delete {
    color: var(--ink-300);
    cursor: pointer;
    margin-left: 2px;
    font-size: 14px;
    line-height: 1;
}
.saved-view-pill .sv-delete:hover {
    color: var(--error);
}
.saved-view-pill.pinned {
    background: var(--brand-50);
    border-color: var(--brand);
    color: var(--brand-dark);
}

/* Chat history drawer */
.chat-history-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface-0);
    z-index: 10;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease-out);
}
.chat-history-panel.open {
    transform: translateX(0);
}
.chat-history-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3);
}
.chat-history-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-fast);
    border-bottom: 1px solid var(--surface-2);
}
.chat-history-item:hover {
    background: var(--surface-1);
}
.chat-history-item.active {
    background: var(--brand-50);
    border-color: var(--brand);
}
.chat-history-item .chi-title {
    flex: 1;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-history-item .chi-date {
    font-size: 10px;
    color: var(--ink-400);
    white-space: nowrap;
}
.chat-history-item .chi-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--duration-fast);
}
.chat-history-item:hover .chi-actions {
    opacity: 1;
}
.chat-history-item .chi-actions button {
    background: none;
    border: none;
    color: var(--ink-400);
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    font-size: 12px;
    line-height: 1;
}
.chat-history-item .chi-actions button:hover {
    color: var(--ink-700);
    background: var(--surface-2);
}
.chat-history-item .chi-actions .btn-delete:hover {
    color: var(--error);
    background: var(--error-bg);
}

/* Compare mode highlight */
.compare-highlight-better { color: var(--success); font-weight: 600; }
.compare-highlight-worse { color: var(--error); font-weight: 600; }

.btn-danger {
    background: var(--error) !important;
    color: white !important;
}

.btn-danger:hover {
    background: #B91C1C !important;
}

.btn-sm {
    padding: var(--space-1) var(--space-3) !important;
    font-size: var(--text-xs) !important;
}

.btn-lg {
    padding: var(--space-4) var(--space-8) !important;
    font-size: var(--text-base) !important;
    border-radius: var(--radius-lg) !important;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm) !important;
}


/* === CARDS === */
.card {
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: var(--surface-4);
}

.card-flat {
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-xs);
}

.metric-card {
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    text-align: left;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--brand-dark));
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
}

.metric-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--brand);
    transform: translateY(-2px);
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-card small {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-400);
    display: block;
    margin-bottom: var(--space-2);
}

.metric-card p {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--ink-900);
    margin: 0;
    letter-spacing: -0.02em;
}


/* === WORKFLOW STEPPER === */
.workflow-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    padding: var(--space-4) var(--space-5);
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    overflow-x: auto;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
    position: relative;
}

.workflow-step:not(:last-child)::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--surface-3);
    margin: 0 var(--space-2);
    min-width: 20px;
}

.workflow-step.completed:not(:last-child)::after {
    background: var(--brand);
}

.workflow-step.active:not(:last-child)::after {
    background: linear-gradient(90deg, var(--brand) 0%, var(--surface-3) 100%);
}

.step-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 700;
    flex-shrink: 0;
    transition: all var(--duration-normal) var(--ease-out);
}

.workflow-step.completed .step-indicator {
    background: var(--brand);
    color: white;
}

.workflow-step.active .step-indicator {
    background: var(--brand);
    color: white;
    box-shadow: 0 0 0 4px var(--brand-glow-strong), var(--shadow-brand);
}

.workflow-step.upcoming .step-indicator {
    background: var(--surface-2);
    color: var(--ink-400);
    border: 2px solid var(--surface-3);
}

.step-label {
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
}

.workflow-step.completed .step-label { color: var(--brand); }
.workflow-step.active .step-label { color: var(--ink-900); font-weight: 700; }
.workflow-step.upcoming .step-label { color: var(--ink-400); }

/* Stat card emphasis variants */
.stat-highlight {
    background: rgba(217, 119, 6, 0.06) !important;
    border-color: rgba(217, 119, 6, 0.25) !important;
}

.stat-highlight .stat-value {
    color: var(--warning) !important;
}

.stat-highlight-dark {
    background: rgba(217, 119, 6, 0.15) !important;
    border-color: rgba(217, 119, 6, 0.3) !important;
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.5;
    white-space: nowrap;
}

.badge-success, .badge[style*="4CAF50"] {
    background: var(--success-bg) !important;
    color: var(--success) !important;
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-error {
    background: var(--error-bg);
    color: var(--error);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-neutral {
    background: var(--surface-2);
    color: var(--ink-600);
}

.badge-brand {
    background: var(--brand-50);
    color: var(--brand);
}

.confidence-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--text-xs);
    text-align: center;
}

.confidence-badge.high {
    background: var(--success-bg);
    color: var(--success);
}

.confidence-badge.medium {
    background: var(--warning-bg);
    color: var(--warning);
}

.confidence-badge.low {
    background: var(--error-bg);
    color: var(--error);
}


/* === STATUS INDICATORS === */
.status-completed { color: var(--success); }
.status-running { color: var(--info); }
.status-failed { color: var(--error); }
.status-pending { color: var(--ink-400); }

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: var(--space-2);
}

.status-dot.active {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.status-dot.running {
    background: var(--info);
    animation: pulse 2s infinite;
}

.status-dot.failed {
    background: var(--error);
}

.status-dot.pending {
    background: var(--ink-400);
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.3); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
}


/* === TABLES === */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: var(--space-4);
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

table thead {
    background: var(--surface-1);
}

table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--surface-3);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-weight: 600;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-500);
    white-space: nowrap;
}

table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--surface-2);
    font-size: var(--text-sm);
    color: var(--ink-700);
    vertical-align: middle;
}

table tbody tr {
    transition: background var(--duration-fast) ease;
}

table tbody tr:hover {
    background: var(--brand-glow);
}

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


/* === FORMS === */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="month"],
input[type="url"],
input[type="search"],
input[type="time"],
input[type="color"],
textarea,
select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-md);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: var(--text-base);
    color: var(--ink-800);
    background: var(--surface-0);
    transition: all var(--duration-fast) ease;
    line-height: 1.5;
    box-shadow: var(--shadow-xs);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow-strong), var(--shadow-xs);
}

input::placeholder,
textarea::placeholder {
    color: var(--ink-400);
}

label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--ink-700);
    letter-spacing: 0.01em;
}

small {
    display: block;
    margin-top: var(--space-1);
    color: var(--ink-400);
    font-size: var(--text-sm);
}

.form-group {
    margin-bottom: var(--space-5);
}

/* Checkbox styling */
input[type="checkbox"] {
    margin-right: var(--space-2);
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
    border-radius: 4px;
}

/* File upload area */
.upload-area {
    border: 2px dashed var(--surface-3);
    border-radius: var(--radius-lg);
    padding: var(--space-10);
    text-align: center;
    transition: all var(--duration-normal) var(--ease-out);
    cursor: pointer;
    background: var(--surface-1);
}

.upload-area:hover {
    border-color: var(--brand);
    background: var(--brand-glow);
}

.upload-area.drag-over {
    border-color: var(--brand);
    background: var(--brand-50);
    transform: scale(1.01);
}


/* === ALERTS === */
.error, .alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(220, 38, 38, 0.15);
    border-left: 4px solid var(--error);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
}

.warning, .alert-warning {
    background: var(--warning-bg);
    color: #92400E;
    border: 1px solid rgba(217, 119, 6, 0.15);
    border-left: 4px solid var(--warning);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
}

.success, .alert-success {
    background: var(--success-bg);
    color: var(--brand-darker);
    border: 1px solid rgba(5, 150, 105, 0.15);
    border-left: 4px solid var(--success);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
}

.info, .alert-info {
    background: var(--info-bg);
    color: #1E40AF;
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-left: 4px solid var(--info);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
}


/* === LINKS === */
a {
    color: var(--brand);
    text-decoration: none;
    transition: color var(--duration-fast) ease;
}

a:hover {
    color: var(--brand-dark);
    text-decoration: none;
}


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

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}


/* === DOWNLOAD BUTTONS === */
.download-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--ink-900);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--text-sm);
    transition: all var(--duration-normal) var(--ease-out);
    box-shadow: var(--shadow-sm);
}

.download-button:hover {
    background: var(--ink-800);
    text-decoration: none;
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}


/* === CODE === */
code {
    background: var(--surface-2);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85em;
    color: var(--ink-800);
    border: 1px solid var(--surface-3);
}

pre {
    background: var(--ink-900);
    color: #E2E8F0;
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    border: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-sm);
    line-height: 1.7;
    box-shadow: var(--shadow-lg);
}

pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: inherit;
}


/* === FOOTER === */
.site-footer {
    margin-top: 0;
    padding: var(--space-6) var(--space-6);
    text-align: center;
    border-top: 1px solid var(--surface-3);
    background: var(--surface-0);
    color: var(--ink-400);
}

.site-footer p {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--ink-400);
}

footer {
    margin-top: 0;
    padding: var(--space-6) var(--space-6);
    text-align: center;
    border-top: 1px solid var(--surface-3);
    background: var(--surface-0);
    color: var(--ink-400);
}

footer p {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--ink-400);
}

footer small {
    color: var(--ink-400);
}


/* === LOADING SPINNER === */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--surface-3);
    border-top: 2.5px solid var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}


/* === ENTRANCE ANIMATIONS === */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeUp var(--duration-slow) var(--ease-out) both;
}

.animate-in-delay-1 { animation-delay: 50ms; }
.animate-in-delay-2 { animation-delay: 100ms; }
.animate-in-delay-3 { animation-delay: 150ms; }
.animate-in-delay-4 { animation-delay: 200ms; }

main.container > * {
    animation: fadeUp 0.4s var(--ease-out) both;
}

main.container > *:nth-child(1) { animation-delay: 0ms; }
main.container > *:nth-child(2) { animation-delay: 40ms; }
main.container > *:nth-child(3) { animation-delay: 80ms; }
main.container > *:nth-child(4) { animation-delay: 120ms; }
main.container > *:nth-child(5) { animation-delay: 160ms; }
main.container > *:nth-child(6) { animation-delay: 200ms; }

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


/* === NARRATIVE COMPARISON REVEAL === */
@keyframes revealLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes revealRight {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes borderGlow {
    0% { box-shadow: none; }
    50% { box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15); }
    100% { box-shadow: none; }
}

.narrative-reveal {
    opacity: 0;
}
.narrative-reveal-left {
    animation: revealLeft 0.6s var(--ease-out) 0.3s both, borderGlow 1.5s ease 0.9s both;
}
.narrative-reveal-right {
    animation: revealRight 0.6s var(--ease-out) 0.5s both;
}


/* === DIVIDERS === */
.divider {
    border: none;
    height: 1px;
    background: var(--surface-3);
    margin: var(--space-6) 0;
}


/* === EMPTY STATES === */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-4);
    color: var(--ink-400);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    opacity: 0.3;
    filter: grayscale(1);
}

.empty-state-text {
    font-size: var(--text-lg);
    color: var(--ink-500);
    margin-bottom: var(--space-4);
}

/* === MARKETING SITE === */
.marketing-body {
    background: var(--surface-0);
    color: var(--ink-800);
    font-family: 'DM Sans', system-ui, sans-serif;
}

.marketing-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--surface-3);
}

.marketing-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
}

.marketing-nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.marketing-nav a {
    color: var(--ink-700);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: color 0.15s ease;
}

.marketing-nav a:hover {
    color: var(--ink-900);
}

.marketing-nav a.nav-login {
    color: var(--ink-600);
}

.marketing-main {
    min-height: 60vh;
}

.marketing-hero {
    padding: var(--space-16) var(--space-6) var(--space-12);
    text-align: center;
    background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-0) 100%);
}

.marketing-hero h1 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: clamp(2rem, 5vw, 3.75rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink-900);
    max-width: 22ch;
    margin: 0 auto var(--space-5);
}

.marketing-hero p.lede {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    line-height: 1.55;
    color: var(--ink-600);
    max-width: 52ch;
    margin: 0 auto var(--space-8);
}

.marketing-hero-ctas {
    display: inline-flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    justify-content: center;
}

.marketing-section {
    padding: var(--space-16) var(--space-6);
    max-width: 1140px;
    margin: 0 auto;
}

.marketing-section h2 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    line-height: 1.2;
    color: var(--ink-900);
    margin: 0 0 var(--space-6) 0;
}

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

.marketing-card {
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.marketing-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.marketing-card h3 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: var(--text-lg);
    margin: 0 0 var(--space-3) 0;
    color: var(--ink-900);
}

.marketing-eyebrow {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brand);
    font-weight: 700;
    margin-bottom: var(--space-3);
}

.marketing-footer {
    background: var(--ink-900);
    color: var(--surface-2);
    padding: var(--space-12) var(--space-6);
}

.marketing-footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-8);
}

.marketing-footer h4 {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--surface-3);
    margin: 0 0 var(--space-3) 0;
}

.marketing-footer a {
    color: var(--surface-2);
    text-decoration: none;
    display: block;
    font-size: var(--text-sm);
    padding: 2px 0;
}

.marketing-footer a:hover {
    color: var(--surface-0);
}

.marketing-footer-brand strong {
    font-family: 'Bricolage Grotesque', serif;
    font-size: var(--text-xl);
    color: var(--surface-0);
}

.marketing-footer-brand p {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    max-width: 36ch;
    color: var(--surface-3);
}

@media (max-width: 768px) {
    .marketing-footer-inner {
        grid-template-columns: 1fr;
    }
    .marketing-nav {
        gap: var(--space-3);
    }
    .marketing-nav a:not(.nav-login) {
        display: none;
    }
}

/* Marlow chip — used on home to introduce the persona */
.marlow-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--brand-light);
    color: var(--brand-dark);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-5);
}

.marlow-chip::before {
    content: "M";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand);
    color: white;
    font-family: 'Bricolage Grotesque', serif;
    font-weight: 700;
    font-size: 11px;
}

/* Branded empty-state shell (used by _empty_state.html) */
.empty-state-shell {
    max-width: 680px;
    margin: var(--space-8) auto;
}

.empty-state-breadcrumb {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    font-size: var(--text-sm);
    color: var(--ink-600);
    margin-bottom: var(--space-6);
}

.empty-state-card {
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-xl);
    padding: var(--space-10) var(--space-8);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.empty-state-card .empty-state-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-5);
    border-radius: var(--radius-full);
    background: var(--brand-light);
    color: var(--brand-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    filter: none;
    font-size: inherit;
}

.empty-state-title {
    font-family: var(--font-display, 'Bricolage Grotesque', serif);
    font-size: var(--text-2xl);
    color: var(--ink-900);
    margin: 0 0 var(--space-3) 0;
}

.empty-state-subtitle {
    color: var(--ink-700);
    font-size: var(--text-base);
    margin: 0 auto var(--space-5);
    max-width: 52ch;
}

.empty-state-body {
    color: var(--ink-600);
    font-size: var(--text-sm);
    margin: 0 auto var(--space-6);
    max-width: 56ch;
    text-align: left;
}

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

.empty-state-corr {
    margin: var(--space-6) 0 0 0;
    font-size: var(--text-xs);
    color: var(--ink-400);
}

.empty-state-corr code {
    background: var(--surface-1);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: var(--ink-600);
}


/* === MODALS / DIALOGS === */
dialog, .modal-overlay {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-8);
    background: var(--surface-0);
    max-width: 500px;
    width: 90%;
}

dialog::backdrop, .modal-overlay-bg {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}


/* === GLOBAL TABLE OVERFLOW PROTECTION === */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* === RESPONSIVE — TABLET (1024px) === */
@media (max-width: 1024px) {
    .nav-center ul {
        gap: var(--space-1);
    }

    .nav-center ul li a {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-sm);
    }
}

/* === RESPONSIVE — MOBILE (768px) === */
@media (max-width: 768px) {
    :root {
        --text-3xl: 1.5rem;
        --text-4xl: 1.875rem;
        --text-5xl: 2.25rem;
    }

    .nav-container {
        flex-wrap: wrap;
        gap: var(--space-2);
        height: auto;
        padding: var(--space-3) var(--space-4);
    }

    .nav-center {
        width: 100%;
        order: 3;
    }

    .nav-center ul {
        width: 100%;
        flex-wrap: wrap;
        gap: 0;
        justify-content: flex-start;
    }

    .nav-center ul li a {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-sm);
        white-space: nowrap;
    }

    .nav-end {
        width: 100%;
        order: 4;
        justify-content: space-between;
    }

    main.container {
        padding-top: var(--space-4);
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }

    /* Table mobile handling: smaller text, reduced padding, enable scroll */
    table {
        font-size: var(--text-sm);
    }

    table th, table td {
        padding: var(--space-2) var(--space-3);
    }

    /* Ensure all card wrappers containing tables scroll horizontally */
    .card:has(table), .table-responsive {
        overflow-x: auto;
    }

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

    /* Forms: stack flex rows, reduce min-widths */
    .filter-row, .query-builder, [style*="display: flex"][style*="gap"] {
        flex-wrap: wrap !important;
    }

    select, input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea {
        min-width: 0 !important;
        width: 100%;
    }
}

/* === RESPONSIVE — SMALL MOBILE (480px) === */
@media (max-width: 480px) {
    :root {
        --text-3xl: 1.25rem;
        --text-4xl: 1.5rem;
        --text-5xl: 1.75rem;
    }

    main.container {
        padding-left: var(--space-2);
        padding-right: var(--space-2);
    }

    .nav-container {
        padding: var(--space-2) var(--space-3);
    }

    table th, table td {
        padding: var(--space-1) var(--space-2);
        font-size: 0.75rem;
    }

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

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

    /* Stack buttons vertically */
    .btn-group, .action-buttons {
        flex-direction: column;
    }

    .btn-group > *, .action-buttons > * {
        width: 100%;
    }
}


/* === UTILITY CLASSES === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-muted { color: var(--ink-400); }
.text-brand { color: var(--brand); }
.bg-surface-0 { background: var(--surface-0); }
.bg-surface-1 { background: var(--surface-1); }
.bg-brand-glow { background: var(--brand-glow); }
.border { border: 1px solid var(--surface-3); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }


/* === REVIEW QUEUE SPECIFIC === */
.summary-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.summary-card {
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease-out);
}

.summary-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.summary-card .number {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--ink-900);
    margin: var(--space-2) 0;
    letter-spacing: -0.03em;
}

.summary-card .label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--ink-400);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.filter-tabs {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--surface-3);
    overflow-x: auto;
}

.filter-tab {
    padding: var(--space-3) var(--space-4);
    border: none;
    background: transparent;
    color: var(--ink-500);
    cursor: pointer;
    font-weight: 600;
    font-size: var(--text-sm);
    font-family: 'DM Sans', system-ui, sans-serif;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--duration-fast) ease;
    white-space: nowrap;
}

.filter-tab:hover {
    color: var(--ink-800);
    background: transparent !important;
}

.filter-tab.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-8);
}

.client-card {
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease-out);
}

.client-card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: var(--brand);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--surface-2);
}

.card-title {
    margin: 0;
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--ink-900);
}

.card-subtitle {
    font-size: var(--text-sm);
    color: var(--ink-400);
    margin: var(--space-1) 0 0 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-pending { background: var(--surface-2); color: var(--ink-500); }
.status-draft_ready { background: #DBEAFE; color: #1D4ED8; }
.status-in_review { background: #FEF3C7; color: #92400E; }
.status-approved { background: var(--success-bg); color: var(--success); }
.status-delivered { background: var(--brand-light); color: var(--brand-darker); }

.metrics-snapshot {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin: var(--space-4) 0;
    padding: var(--space-4);
    background: var(--surface-1);
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-2);
}

.metric-item {
    text-align: center;
}

.metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--ink-900);
    letter-spacing: -0.02em;
}

.metric-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--ink-400);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

.pipeline-steps {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    margin: var(--space-4) 0;
    font-size: var(--text-sm);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--surface-3);
    transition: all var(--duration-normal) var(--ease-out);
}

.step-dot.active {
    background: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow-strong);
}

.step-label {
    text-align: center;
    width: 56px;
    font-size: var(--text-xs);
    color: var(--ink-400);
    font-weight: 500;
}

.card-actions {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.action-button {
    flex: 1;
    min-width: 110px;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-family: 'DM Sans', system-ui, sans-serif;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-normal) var(--ease-out);
}

.action-button-primary {
    background: var(--brand);
    color: white;
    box-shadow: var(--shadow-sm);
}

.action-button-primary:hover {
    background: var(--brand-dark);
    color: white;
    text-decoration: none;
    box-shadow: var(--shadow-brand);
    transform: translateY(-1px);
}

.action-button-secondary {
    background: var(--surface-0);
    color: var(--ink-700);
    border: 1px solid var(--surface-3);
    box-shadow: var(--shadow-xs);
}

.action-button-secondary:hover {
    background: var(--surface-1);
    color: var(--ink-900);
    border-color: var(--ink-300);
    text-decoration: none;
    transform: translateY(-1px);
}

.updated-time {
    font-size: var(--text-xs);
    color: var(--ink-400);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--surface-2);
}


/* === PRICING PAGE === */
.pricing-card {
    background: var(--surface-0);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--duration-slow) var(--ease-out);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--surface-3);
}

.pricing-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-6px);
}

.pricing-card.featured {
    border: 2px solid var(--brand);
    transform: scale(1.03);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--brand);
}

.pricing-card.featured:hover {
    transform: scale(1.03) translateY(-6px);
    box-shadow: var(--shadow-xl), 0 0 0 1px var(--brand), 0 0 40px var(--brand-glow-strong);
}

.pricing-header-section {
    background: linear-gradient(145deg, var(--ink-900) 0%, var(--ink-800) 100%);
    color: white;
    padding: var(--space-8) var(--space-6);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.pricing-header-section::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(5, 150, 105, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.pricing-card.featured .pricing-header-section {
    background: linear-gradient(145deg, var(--brand-darker) 0%, var(--brand-dark) 40%, var(--brand) 100%);
}

.plan-name {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-2);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.plan-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-4xl);
    font-weight: 700;
    margin: var(--space-2) 0;
    line-height: 1;
    letter-spacing: -0.03em;
}

.plan-price small {
    display: block;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: var(--text-sm);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    margin-top: var(--space-2);
}

.plan-description {
    font-size: var(--text-sm);
    opacity: 0.8;
    margin-top: var(--space-2);
}

.pricing-content {
    padding: var(--space-6);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-6) 0;
    flex: 1;
}

.features-list li {
    padding: var(--space-3) 0;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    border-bottom: 1px solid var(--surface-2);
    color: var(--ink-700);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.features-list li:last-child {
    border-bottom: none;
}

.check-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand-50);
    color: var(--brand);
    font-weight: 700;
    font-size: 0.7rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.cta-button {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: var(--text-sm);
    font-family: 'DM Sans', system-ui, sans-serif;
    transition: all var(--duration-normal) var(--ease-out);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.cta-button.primary {
    background: var(--brand);
    color: white;
    box-shadow: var(--shadow-sm);
}

.cta-button.primary:hover {
    background: var(--brand-dark);
    box-shadow: var(--shadow-brand);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.cta-button.secondary {
    background: var(--surface-0);
    color: var(--ink-700);
    border: 1px solid var(--surface-3);
    box-shadow: var(--shadow-xs);
}

.cta-button.secondary:hover {
    background: var(--surface-1);
    border-color: var(--ink-300);
    color: var(--ink-900);
    text-decoration: none;
}


/* === COMPARISON TABLE === */
.comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.comparison-table thead {
    background: var(--surface-1);
}

.comparison-table th,
.comparison-table td {
    padding: var(--space-3) var(--space-4);
    text-align: center;
    border-bottom: 1px solid var(--surface-2);
}

.comparison-table th:first-child,
.comparison-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--ink-700);
}

.comparison-table th {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-500);
}

.comparison-table .check {
    color: var(--brand);
    font-weight: 700;
    font-size: 1.1rem;
}

.comparison-table .cross {
    color: var(--ink-300);
    font-weight: 400;
}


/* === FAQ === */
.faq-section {
    background: var(--surface-0);
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--surface-3);
}

.faq-item {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--surface-2);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-question {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-weight: 700;
    color: var(--ink-900);
    margin-bottom: var(--space-2);
    font-size: var(--text-base);
}

.faq-answer {
    color: var(--ink-600);
    line-height: 1.7;
    margin: 0;
    font-size: var(--text-sm);
}


/* === CONTACT CTA === */
.contact-cta {
    text-align: center;
    padding: var(--space-12) var(--space-8);
    background: linear-gradient(145deg, var(--ink-900) 0%, var(--ink-800) 50%, #1a3a2a 100%);
    color: white;
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.contact-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 30% 0%, rgba(5, 150, 105, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.contact-cta h3 {
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    color: white;
    font-size: var(--text-2xl);
    font-weight: 800;
    margin-bottom: var(--space-3);
    position: relative;
}

.contact-cta p {
    color: rgba(255,255,255,0.7);
    margin: 0 0 var(--space-6) 0;
    font-size: var(--text-base);
    position: relative;
}

.contact-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    background: white;
    color: var(--ink-900);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--text-sm);
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
    box-shadow: var(--shadow-md);
}

.contact-button:hover {
    background: var(--surface-1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: var(--ink-900);
}

.hero-shell {
    background:
        radial-gradient(circle at top right, rgba(5, 150, 105, 0.09), transparent 32%),
        linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-md);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: var(--space-6);
    align-items: start;
}

.hero-copy {
    max-width: 760px;
    font-size: var(--text-lg);
    color: var(--ink-600);
    margin: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--ink-500);
    font-weight: 700;
    margin-bottom: var(--space-3);
}

.eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
    transform: rotate(45deg);
    background: var(--brand);
}

.callout-card {
    background: var(--surface-0);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
}

.callout-card.subtle {
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.7) 0%, rgba(255, 255, 255, 0.96) 100%);
    border-color: rgba(5, 150, 105, 0.12);
}

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

.metric-subtext {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--ink-500);
    font-family: 'DM Sans', system-ui, sans-serif;
}

.list-tight {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--ink-700);
}

.list-tight li + li {
    margin-top: var(--space-2);
}

.actionable-card {
    position: relative;
    overflow: hidden;
}

.actionable-card::after {
    content: "Open";
    position: absolute;
    right: var(--space-5);
    top: var(--space-5);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-400);
    font-weight: 700;
}

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

.section-intro {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    align-items: start;
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
}

.section-intro p {
    margin: 0;
    max-width: 720px;
}

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

/* --- PROSE: rendered Markdown inside cards --- */
.prose p { margin: 0 0 0.75em; }
.prose p:last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 {
    margin: 1em 0 0.5em;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ink-900);
}
.prose h1:first-child, .prose h2:first-child,
.prose h3:first-child, .prose h4:first-child { margin-top: 0; }
.prose h2 { font-size: 1.15em; }
.prose h3 { font-size: 1.05em; }
.prose ul, .prose ol { margin: 0 0 0.75em 1.25em; padding: 0; }
.prose li { margin-bottom: 0.25em; }
.prose strong { font-weight: 700; color: var(--ink-900); }
.prose em { font-style: italic; }
.prose code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    background: var(--surface-2);
    padding: 0.15em 0.35em;
    border-radius: var(--radius-sm, 4px);
}
.prose table { width: 100%; border-collapse: collapse; margin: 0.75em 0; font-size: 0.92em; }
.prose th, .prose td { padding: 0.4em 0.6em; border: 1px solid var(--surface-3); text-align: left; }
.prose th { background: var(--surface-1); font-weight: 600; }

/* ── P&L interactive row hover ─────────────────────────── */
.pl-row-clickable:hover {
    background: rgba(5, 150, 105, 0.03) !important;
}
.pl-row-clickable:hover .pl-expand-icon {
    opacity: 0.7 !important;
}

/* ============================================================
   PRINT STYLES
   Clean, professional output for Cmd+P / browser PDF export.
   Hides nav, action bars, interactive controls. Preserves
   financial tables and charts at readable sizes.
   ============================================================ */
@media print {
    /* Hide non-content elements */
    .navbar, footer, .nav-dropdown,
    .action-bar, .hero-shell .overview-strip,
    [role="button"], button,
    .tab-button, .pl-expand-icon,
    #period-selector, select,
    a[role="button"] {
        display: none !important;
    }

    /* Show all tab content (don't hide behind tabs) */
    .tab-content {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 2rem;
    }

    /* Hide tab navigation bar */
    [style*="border-bottom: 2px solid"] {
        display: none !important;
    }

    /* Remove action bar at bottom */
    [style*="position: sticky; bottom: 0"] {
        display: none !important;
    }

    /* Reset backgrounds for printing */
    body {
        background: white !important;
        color: black !important;
        font-size: 10pt;
    }

    .hero-shell, [class*="hero"] {
        background: none !important;
        color: black !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-bottom: 1rem !important;
    }

    .hero-shell * {
        color: black !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }

    /* Tables: keep borders visible */
    table {
        font-size: 9pt;
        border-collapse: collapse;
    }

    th, td {
        border: 1px solid #ccc !important;
        padding: 4px 8px !important;
    }

    thead tr {
        background: #f0f0f0 !important;
    }

    /* Charts: ensure they print at reasonable size */
    canvas {
        max-width: 100% !important;
        height: auto !important;
        max-height: 250px !important;
    }

    /* Financial metric cards */
    .metric-card, [style*="border-radius"][style*="box-shadow"] {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    /* Ensure chart grid doesn't break oddly */
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr 1fr !important;
    }

    /* KPI sparklines: hide in print (too small to be useful) */
    [id^="spark-"] {
        display: none !important;
    }

    /* Page breaks */
    h2, h3 {
        page-break-after: avoid;
    }

    /* Remove link decorations */
    a {
        text-decoration: none !important;
        color: black !important;
    }

    /* Hide export buttons */
    button[onclick*="exportChart"] {
        display: none !important;
    }

    /* Print header */
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    /* Badge cleanup */
    .badge {
        border: 1px solid #999 !important;
        background: #f5f5f5 !important;
        color: black !important;
    }

    .chat-fab, .chat-sidebar, .chat-overlay { display: none !important; }
}

/* ============================================================
   AI CHAT PANEL
   ============================================================ */

.chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--brand);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.chat-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(5, 150, 105, 0.5);
}
.chat-fab svg { width: 24px; height: 24px; }

.chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.3);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.chat-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.chat-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100vw;
    background: var(--surface-0);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
}
.chat-sidebar.open { transform: translateX(0); }

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--surface-3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: var(--ink-900);
    color: white;
}
.chat-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.02em;
}
.chat-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.chat-header-actions button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.chat-header-actions button:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    word-wrap: break-word;
}
.chat-bubble.user {
    align-self: flex-end;
    background: var(--brand);
    color: white;
    border-bottom-right-radius: 4px;
}
.chat-bubble.assistant {
    align-self: flex-start;
    background: var(--surface-2);
    color: var(--ink-800);
    border-bottom-left-radius: 4px;
}
.chat-bubble.assistant strong { color: var(--ink-900); }
.chat-bubble.assistant code {
    background: var(--surface-3);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}
.chat-bubble .chat-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
    display: block;
}

.chat-typing {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    align-self: flex-start;
    background: var(--surface-2);
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}
.chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ink-400);
    animation: chatBounce 1.4s infinite ease-in-out;
}
.chat-typing span:nth-child(1) { animation-delay: 0s; }
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--surface-3);
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
    background: var(--surface-1);
}
.chat-input-area textarea {
    flex: 1;
    border: 1px solid var(--surface-4);
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    resize: none;
    min-height: 38px;
    max-height: 120px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.15s;
    background: var(--surface-0);
}
.chat-input-area textarea:focus {
    border-color: var(--brand);
}
.chat-input-area button {
    background: var(--brand);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    height: 38px;
}
.chat-input-area button:hover { background: var(--brand-dark); }
.chat-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-welcome {
    text-align: center;
    padding: 40px 20px;
    color: var(--ink-500);
}
.chat-welcome svg {
    margin-bottom: 12px;
    opacity: 0.4;
}
.chat-welcome h4 {
    margin: 0 0 8px;
    color: var(--ink-700);
    font-size: 15px;
}
.chat-welcome p {
    font-size: 13px;
    margin: 0;
    line-height: 1.6;
}
.chat-welcome .chat-suggestions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.chat-welcome .chat-suggestion {
    background: var(--surface-2);
    border: 1px solid var(--surface-3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--ink-600);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
}
.chat-welcome .chat-suggestion:hover {
    background: var(--surface-3);
    border-color: var(--brand);
    color: var(--ink-800);
}

/* ══════════════════════════════════════════════════════════
   Agent Chat — Full-page analyst interface
   ══════════════════════════════════════════════════════════ */

.agent-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: calc(100vh - 72px);
    overflow: hidden;
}

/* Sidebar */
.agent-sidebar {
    background: var(--surface-1);
    border-right: 1px solid var(--surface-3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.agent-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-4) var(--space-3);
    border-bottom: 1px solid var(--surface-3);
}
.agent-new-btn {
    width: 28px; height: 28px;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-4);
    background: var(--surface-0);
    color: var(--ink-600);
    font-size: 18px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
}
.agent-new-btn:hover { background: var(--brand-light); color: var(--brand); border-color: var(--brand); }

.agent-client-selector {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--surface-3);
}
.agent-client-selector select {
    width: 100%;
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-4);
    background: var(--surface-0);
    margin-top: var(--space-1);
}

.agent-conv-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-2) 0;
}
.agent-conv-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    cursor: pointer;
    font-size: var(--text-sm);
    color: var(--ink-700);
    border-left: 3px solid transparent;
    transition: background 0.12s;
}
.agent-conv-item:hover { background: var(--surface-2); }
.agent-conv-item.agent-conv-active {
    background: var(--brand-50);
    border-left-color: var(--brand);
    font-weight: 600;
}
.agent-conv-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.agent-conv-delete {
    background: none; border: none; color: var(--ink-400); cursor: pointer;
    font-size: 16px; padding: 0 4px; opacity: 0;
    transition: opacity 0.12s;
}
.agent-conv-item:hover .agent-conv-delete { opacity: 1; }
.agent-conv-delete:hover { color: var(--error); }

/* Main area */
.agent-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface-0);
}
.agent-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    border-bottom: 1px solid var(--surface-2);
    background: var(--surface-0);
}
.agent-header-context {
    font-size: var(--text-sm);
    color: var(--ink-500);
}

/* Tier badges */
.agent-tier-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}
.agent-tier-senior {
    background: #EFF6FF;
    color: #1D4ED8;
}
.agent-tier-client {
    background: var(--brand-light);
    color: var(--brand-dark);
}
.agent-tier-router {
    background: #F0FDF4;
    color: #15803D;
}
.agent-tier-thinking {
    background: #F3F4F6;
    color: #6B7280;
}

/* AI label */
.agent-ai-label {
    font-size: 10px;
    color: var(--ink-400);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Messages container */
.agent-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Message bubbles */
.agent-msg { max-width: 720px; }
.agent-msg-user {
    align-self: flex-end;
    background: var(--brand);
    color: white;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
}
.agent-msg-assistant {
    align-self: flex-start;
    background: var(--surface-1);
    border: 1px solid var(--surface-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
}
.agent-msg-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}
.agent-msg-content {
    font-size: var(--text-sm);
    line-height: 1.6;
}
.agent-msg-content code {
    background: rgba(0,0,0,0.06);
    padding: 1px 4px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 12px;
}
.agent-msg-user .agent-msg-content code {
    background: rgba(255,255,255,0.2);
}

/* Tool call cards */
.agent-tool-section { margin-bottom: var(--space-2); }
.agent-tool-card {
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    overflow: hidden;
    background: var(--surface-0);
}
.agent-tool-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--surface-2);
    cursor: pointer;
    font-size: var(--text-xs);
    color: var(--ink-700);
}
.agent-tool-icon { font-size: 14px; }
.agent-tool-toggle {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s;
}
.agent-tool-card.open .agent-tool-toggle { transform: rotate(180deg); }
.agent-tool-body {
    display: none;
    padding: var(--space-3);
    font-size: var(--text-xs);
}
.agent-tool-card.open .agent-tool-body { display: block; }
.agent-tool-body pre {
    background: var(--surface-1);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 11px;
    font-family: var(--font-mono);
    max-height: 200px;
    margin: var(--space-1) 0;
}

/* Thinking indicator */
.agent-thinking .agent-thinking-dots span.dot {
    animation: chatBounce 1.4s infinite;
}
.agent-thinking .agent-thinking-dots span.dot:nth-child(2) { animation-delay: 0.2s; }
.agent-thinking .agent-thinking-dots span.dot:nth-child(3) { animation-delay: 0.4s; }
.agent-thinking .agent-thinking-dots span.dot:nth-child(4) { animation-delay: 0.6s; }
.agent-thinking .agent-thinking-dots {
    font-size: var(--text-sm);
    color: var(--ink-500);
}

/* Welcome screen */
.agent-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    padding: var(--space-12) var(--space-6);
}
.agent-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
}
.agent-suggestions button {
    background: var(--surface-1);
    border: 1px solid var(--surface-3);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--ink-700);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}
.agent-suggestions button:hover {
    background: var(--surface-2);
    border-color: var(--brand);
    color: var(--ink-900);
}

/* Input bar */
.agent-input-bar {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--surface-2);
    background: var(--surface-0);
}
.agent-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: var(--space-2);
    max-width: 720px;
    margin: 0 auto;
}
.agent-input-wrap textarea {
    flex: 1;
    resize: none;
    min-height: 38px;
    max-height: 120px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--surface-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-family: inherit;
    line-height: 1.5;
    background: var(--surface-0);
}
.agent-input-wrap textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}
.agent-input-wrap button {
    width: 38px; height: 38px;
    border-radius: var(--radius-md);
    background: var(--brand);
    color: white;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background 0.12s;
}
.agent-input-wrap button:hover { background: var(--brand-dark); }
.agent-input-wrap button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Tool approval buttons */
.agent-approve-btn, .agent-reject-btn {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.12s;
}
.agent-approve-btn {
    background: var(--brand);
    color: white;
}
.agent-approve-btn:hover { background: var(--brand-dark); }
.agent-reject-btn {
    background: var(--surface-2);
    color: var(--ink-700);
    border: 1px solid var(--surface-4);
}
.agent-reject-btn:hover { background: var(--surface-3); }
.agent-pending-tools {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: var(--radius-md);
    padding: var(--space-3);
    margin-bottom: var(--space-2);
}

/* Mobile toggle button */
.agent-mobile-toggle {
    display: none;
    position: fixed;
    top: 80px;
    left: var(--space-3);
    z-index: 200;
    width: 40px; height: 40px;
    border-radius: var(--radius-md);
    background: var(--surface-0);
    border: 1px solid var(--surface-4);
    color: var(--ink-700);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .agent-layout { grid-template-columns: 1fr; }
    .agent-sidebar {
        display: none;
        position: fixed;
        top: 72px;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 199;
        box-shadow: 4px 0 16px rgba(0,0,0,0.15);
    }
    .agent-sidebar.agent-sidebar-open { display: flex; }
    .agent-mobile-toggle { display: flex; }
}


/* === REVIEW EDITOR: Inline edit + auto-diff modal === */

/* Save indicator toast */
.review-save-indicator {
    position: fixed;
    bottom: 80px;
    right: var(--space-6);
    background: var(--ink-900);
    color: white;
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.25s var(--ease-out);
    z-index: 1000;
    pointer-events: none;
}
.review-save-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Toggle arrow for collapsible sections */
.toggle-arrow.rotated { transform: rotate(90deg); }

/* Diff modal overlay */
.diff-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.25s ease;
    padding: var(--space-6);
}
.diff-modal-overlay.visible { opacity: 1; }

.diff-modal-content {
    background: var(--surface-0);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 680px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.diff-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--space-6);
    border-bottom: 1px solid var(--surface-3);
}

.diff-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--ink-400);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.diff-modal-close:hover { color: var(--ink-900); }

.diff-changes-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4) var(--space-6);
}

.diff-change-item {
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    transition: border-color 0.2s;
}
.diff-change-item:hover { border-color: var(--brand); }

.diff-change-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.diff-learn-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 600;
}

.diff-change-type {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.diff-change-desc {
    color: var(--ink-700);
    font-size: var(--text-sm);
    margin: 0 0 var(--space-3) 0;
}

.diff-text-block {
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    line-height: 1.5;
    margin-bottom: var(--space-2);
}
.diff-text-block small {
    display: block;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-1);
}
.diff-original {
    background: #fef2f2;
    border-left: 3px solid var(--error);
    color: var(--ink-700);
}
.diff-edited {
    background: #ecfdf5;
    border-left: 3px solid var(--success);
    color: var(--ink-700);
}

.diff-note-row {
    margin-top: var(--space-2);
}
.diff-note-input {
    width: 100%;
    font-size: var(--text-xs) !important;
    padding: var(--space-2) var(--space-3) !important;
}

.diff-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--surface-3);
    gap: var(--space-4);
    flex-wrap: wrap;
}

.diff-select-all {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ink-700);
}
.diff-select-all label { display: flex; align-items: center; gap: var(--space-2); cursor: pointer; }

.diff-modal-actions {
    display: flex;
    gap: var(--space-3);
}

/* Learning summary */
.learning-summary-success {
    text-align: center;
    padding: var(--space-8) var(--space-6) var(--space-4);
}
.learning-summary-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    font-size: 1.75rem;
    font-weight: 700;
}

.learning-cat-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
    margin-top: var(--space-3);
}
.learning-cat-badge {
    background: var(--surface-2);
    color: var(--ink-700);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

.learning-patterns {
    padding: 0 var(--space-6) var(--space-4);
}
.learning-patterns h3 {
    font-size: var(--text-sm);
    color: var(--ink-700);
    margin-bottom: var(--space-3);
}

.pattern-card {
    background: var(--surface-1);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    margin-bottom: var(--space-2);
}
.pattern-card p { margin: 0; font-size: var(--text-sm); }
.pattern-suggestion {
    color: var(--brand);
    font-weight: 600;
    font-size: var(--text-xs) !important;
    margin-top: var(--space-1) !important;
}

/* ============================================================
   MARKETING ARTIFACTS — memory cards, timelines, constraints,
   before/after comparisons. Used on the marketing site to show
   concrete product artifacts instead of abstract stock visuals.
   ============================================================ */

/* Memory card — a styled Marlow memory entry */
.memory-card {
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-xl);
    padding: var(--space-6) var(--space-6) var(--space-5);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.memory-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
    background: var(--brand);
}

.memory-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.memory-card-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.memory-card-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-xs);
    color: var(--ink-500);
}

.memory-card-quote {
    font-size: var(--text-lg);
    line-height: 1.55;
    color: var(--ink-900);
    margin: 0 0 var(--space-5) 0;
    font-family: 'Bricolage Grotesque', serif;
    font-weight: 500;
}

.memory-card-quote strong {
    color: var(--brand-darker);
}

.memory-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-3) var(--space-5);
    margin: 0;
}

.memory-meta > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.memory-meta dt {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-500);
    font-weight: 600;
}

.memory-meta dd {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--ink-800);
    line-height: 1.4;
}

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

.artifact-caption {
    color: var(--ink-600);
    font-size: var(--text-sm);
    line-height: 1.55;
    max-width: 64ch;
    margin: 0;
}

/* Artifact list — used on pricing for "what the free package gets you" */
.artifact-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.artifact-row {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: var(--space-4);
    align-items: flex-start;
}

.artifact-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--brand-light);
    color: var(--brand-darker);
    font-family: 'Bricolage Grotesque', serif;
    font-weight: 700;
    font-size: var(--text-base);
}

.artifact-row strong {
    display: block;
    font-family: 'Bricolage Grotesque', serif;
    font-size: var(--text-lg);
    color: var(--ink-900);
    margin-bottom: var(--space-1);
}

.artifact-row p {
    margin: 0;
    color: var(--ink-700);
    line-height: 1.55;
}

/* Timeline — month-by-month compounding arc */
.timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    border-left: 2px solid var(--surface-3);
    padding-left: var(--space-6);
    margin-top: var(--space-6);
}

.timeline-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: var(--space-6);
    align-items: flex-start;
    position: relative;
}

.timeline-row::before {
    content: "";
    position: absolute;
    left: calc(-1 * var(--space-6) - 8px);
    top: 8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--brand);
    border: 3px solid var(--surface-0);
    box-shadow: 0 0 0 2px var(--surface-3);
}

.timeline-month {
    font-family: 'Bricolage Grotesque', serif;
    font-weight: 700;
    font-size: var(--text-xl);
    color: var(--ink-900);
}

.timeline-content strong {
    display: block;
    color: var(--ink-900);
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.timeline-content p {
    margin: 0;
    color: var(--ink-700);
    line-height: 1.6;
}

@media (max-width: 640px) {
    .timeline-row {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }
    .timeline-month { font-size: var(--text-lg); }
}

/* Constraint list — a structured "what we won't do" block */
.constraint-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.constraint-list li {
    padding-left: var(--space-5);
    position: relative;
    line-height: 1.6;
    color: inherit;
}

.constraint-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--brand);
    font-weight: 700;
}

.constraint-list li strong {
    color: inherit;
}

/* Workflow steps — how-it-works numbered sequence */
.workflow-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    margin-top: var(--space-6);
}

.workflow-step {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: var(--space-5);
    align-items: flex-start;
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.workflow-step-num {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: var(--text-xl);
    color: var(--brand);
    letter-spacing: 0.02em;
}

.workflow-step strong {
    display: block;
    color: var(--ink-900);
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.workflow-step p {
    margin: 0;
    color: var(--ink-700);
    line-height: 1.6;
}

@media (max-width: 640px) {
    .workflow-step {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }
}

/* Before/after — narrative comparison cards */
.beforeafter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-6);
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
}

.beforeafter-card {
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.beforeafter-card header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--surface-3);
}

.beforeafter-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

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

.beforeafter-card p {
    margin: 0;
    color: var(--ink-800);
    line-height: 1.6;
    font-size: var(--text-base);
}

.beforeafter-before { border-left: 3px solid var(--ink-400); }
.beforeafter-before .beforeafter-tag { color: var(--ink-500); }

.beforeafter-edit { border-left: 3px solid #d97706; background: #FFFBEB; }
.beforeafter-edit .beforeafter-tag { color: #b45309; }

.beforeafter-after { border-left: 3px solid var(--brand); }
.beforeafter-after .beforeafter-tag { color: var(--brand-dark); }

/* Memory type grid — four kinds of memory on how-it-works */
.memory-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-5);
    margin-top: var(--space-6);
}

.memory-type {
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.memory-type h3 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: var(--text-base);
    color: var(--brand-darker);
    margin: 0 0 var(--space-3) 0;
    font-weight: 700;
}

.memory-type p {
    margin: 0;
    color: var(--ink-700);
    line-height: 1.6;
    font-size: var(--text-sm);
}

/* Belief list — about page operating beliefs */
.belief-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    margin-top: var(--space-6);
}

.belief {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: var(--space-5);
    align-items: flex-start;
}

.belief-num {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: var(--text-xl);
    color: var(--brand);
}

.belief h3 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: var(--text-xl);
    color: var(--ink-900);
    margin: 0 0 var(--space-2) 0;
    line-height: 1.25;
}

.belief p {
    margin: 0;
    color: var(--ink-700);
    line-height: 1.65;
}

@media (max-width: 640px) {
    .belief {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }
}

/* Memo — first-person founding story block */
.memo {
    background: var(--surface-1);
    border-left: 4px solid var(--brand);
    padding: var(--space-6) var(--space-6);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--ink-800);
}

.memo p { margin: 0 0 var(--space-4) 0; }
.memo p:last-child { margin-bottom: 0; }
.memo strong { color: var(--ink-900); }

/* FAQ block — pricing FAQs */
.faq-block {
    padding: var(--space-5) 0;
    border-bottom: 1px solid var(--surface-3);
}

.faq-block:last-child { border-bottom: none; }

.faq-block h3 {
    font-family: 'Bricolage Grotesque', serif;
    font-size: var(--text-lg);
    color: var(--ink-900);
    margin: 0 0 var(--space-2) 0;
}

.faq-block p {
    margin: 0;
    color: var(--ink-700);
    line-height: 1.65;
}

/* Variance table — used on blog posts for tabular artifacts */
.variance-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-sm);
    background: var(--surface-0);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: var(--space-6) 0;
}

.variance-table th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    background: var(--surface-1);
    color: var(--ink-700);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--surface-3);
    font-weight: 600;
}

.variance-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--surface-2);
    color: var(--ink-800);
}

.variance-table td.num { text-align: right; }
.variance-table td.fav { color: var(--brand-dark); }
.variance-table td.unfav { color: #b45309; }
.variance-table tr:last-child td { border-bottom: none; }
.variance-table tfoot td { font-weight: 600; background: var(--surface-1); }

/* Responsive tweaks for marketing artifacts */
@media (max-width: 640px) {
    .memory-meta { grid-template-columns: 1fr; }
    .artifact-row { grid-template-columns: 36px 1fr; gap: var(--space-3); }
}

