/**
 * ============================================================================
 * CodeIQ — Editorial Skin (authoritative)
 * ============================================================================
 * ONE stylesheet that carries the entire CodeIQ visual language, written
 * against the IQ Suite editorial design system (iq-suite-editorial.css /
 * dashboard.html standard): warm cream surfaces, Fraunces serif display,
 * DM Sans body, JetBrains Mono data, hairline rules, 2px micro-radius,
 * pill controls, salmon/wine product accent.
 *
 * Loaded LAST in codeiq/index.html. It supersedes and replaced these files
 * (deleted): theme-codeiq-ui.css, brand-colors.css, codeiq-units-editorial.css,
 * splash.css. Structural rules those files carried (sticky table columns,
 * loading skeletons, floating action bar) live in §12 here.
 *
 * CONTRACTS — do not break:
 *  - Class names / ids / data-attrs are the JS API (TabManager & friends).
 *  - Review-table column WIDTHS are measured per platform
 *    (review-table-redesign.css + review-apple.css .col-*). Never restyle
 *    width/min-width/max-width of .col-* here.
 *  - !important is used ONLY where a legacy sheet it must beat uses it
 *    (transaction-progress.css, CodeIQModal.css hot spots).
 *
 * MAP
 *  §0  Token bridge (retokens --review-*, --cc-*, radii, shadows)
 *  §1  Foundation (type, focus, scrollbars, selection)
 *  §2  Chrome (tab bar, session tabs, user menu, credits widget)
 *  §3  Command Center (dashboard)
 *  §4  Session states (header, stats, setup, company select, context panel)
 *  §5  Upload flow (tabs, bank cards, invoices, merchant, summary)
 *  §6  Progress (init li-*, pipeline tp-*)
 *  §7  Review screen (header, method ledger, bank tabs, controls, table)
 *  §8  Panels (accounts, transfers, VAT audit, invoices)
 *  §9  Modals (frame + every modal)
 *  §10 Toasts, footer, splash
 *  §11 Motion library
 *  §12 Ported structural rules
 * ============================================================================
 */


/* ============================================================
   §0 TOKEN BRIDGE
   ============================================================ */

:root {
    /* Editorial primitives (mirror iq-suite-editorial.css) */
    --ed-cream: #faf8f5;
    --ed-ivory: #f5f2ed;
    --ed-paper: #edeae4;
    --ed-card: #ffffff;
    --ed-ink: #1a1a1a;
    --ed-ink-2: #3d3d3d;
    --ed-ink-3: #6b6b6b;
    --ed-ink-4: #999999;
    --ed-rule: #d4d0c8;
    --ed-rule-soft: #e8e4de;
    --ed-rule-strong: #8a8578;

    /* CodeIQ product accent — salmon / wine */
    --ed-salmon: #c4576a;
    --ed-wine: #9a4054;
    --ed-wine-deep: #7a3345;
    --ed-wash: #fbecee;
    --ed-wash-soft: #fdf5f7;

    /* Editorial status family (muted, warm) */
    --ed-sage: #4a7c4a;
    --ed-sage-deep: #3a6238;
    --ed-sage-wash: #edf3ec;
    --ed-gold: #8a621a;
    --ed-gold-wash: #f7f0df;
    --ed-rust: #b04a3a;
    --ed-rust-wash: #f9ebe7;
    --ed-slate: #5b6eae;       /* RiQ blue, reserved for RiQ + transfers */
    --ed-slate-wash: #eef0f8;
    --ed-teal: #3a6e78;        /* invoices */
    --ed-teal-wash: #e9f1f2;

    /* Editorial shadows: hairline + long soft lift, never puffy */
    --ed-lift: 0 1px 0 var(--ed-rule), 0 24px 44px -34px rgba(26, 22, 18, 0.35);
    --ed-lift-lg: 0 1px 0 var(--ed-rule), 0 48px 80px -48px rgba(26, 22, 18, 0.4);
    --ed-hairline-shadow: 0 1px 2px rgba(26, 22, 18, 0.05);

    /* Radius discipline: 2px signature, pills for controls only */
    --radius-sm: 2px;
    --radius-md: 2px;
    --radius-lg: 2px;
    --radius-xl: 2px;
    --radius-2xl: 2px;

    /* Soften main.css shadows app-wide */
    --shadow-sm: var(--ed-hairline-shadow);
    --shadow-md: 0 2px 10px rgba(26, 22, 18, 0.06);
    --shadow-lg: var(--ed-lift);
    --shadow-xl: var(--ed-lift-lg);

    /* Command Center tokens (command-center.css consumes these) */
    --cc-bg-primary: transparent;
    --cc-bg-secondary: var(--ed-cream);
    --cc-bg-elevated: var(--ed-card);
    --cc-bg-inset: var(--ed-ivory);
    --cc-accent: var(--ed-wine);
    --cc-accent-light: var(--ed-salmon);
    --cc-accent-subtle: rgba(196, 87, 106, 0.08);
    --cc-accent-glow: rgba(196, 87, 106, 0.12);
    --cc-border: var(--ed-rule);
    --cc-border-strong: var(--ed-rule-strong);
    --cc-divider: var(--ed-rule-soft);
    --cc-radius-sm: 2px;
    --cc-radius-md: 2px;
    --cc-radius-lg: 2px;
    --cc-shadow-sm: var(--ed-hairline-shadow);
    --cc-shadow-md: var(--ed-hairline-shadow);
    --cc-shadow-lg: var(--ed-lift);
    --cc-shadow-glow: none;
}

/* Review interface tokens (review-apple.css consumes these on .review-interface) */
.review-interface {
    --review-bg: transparent;
    --review-surface: #ffffff;
    --review-surface-2: var(--ed-cream);
    --review-surface-3: var(--ed-ivory);
    --review-border: var(--ed-rule);
    --review-border-strong: var(--ed-rule-strong);
    --review-line: var(--ed-rule);
    --review-line-soft: var(--ed-rule-soft);
    --review-text: var(--ed-ink);
    --review-muted: var(--ed-ink-3);
    --review-accent: var(--ed-salmon);
    --review-accent-strong: var(--ed-wine);
    --review-accent-soft: var(--ed-wash);
    --review-magenta: var(--ed-salmon);
    --review-deep: var(--ed-wine-deep);
    --review-success: var(--ed-sage);
    --review-warning: var(--ed-gold);
    --review-danger: var(--ed-rust);
    --review-info: var(--ed-wine);
    --review-info-strong: var(--ed-wine-deep);
    --review-info-soft: var(--ed-wash);
    --review-info-border: rgba(154, 64, 84, 0.26);
    --review-shadow-xs: var(--ed-hairline-shadow);
    --review-shadow-sm: none;
    --review-shadow-md: none;
    --review-shadow-lg: var(--ed-lift);
    --review-radius-sm: 2px;
    --review-radius-md: 2px;
    --review-radius-lg: 2px;
    --review-radius-xl: 2px;
    --table-bg: #ffffff;
    --table-border-color: var(--ed-rule-soft);
}


/* ============================================================
   §1 FOUNDATION
   ============================================================ */

body.editorial {
    background: var(--ed-cream);
    color: var(--ed-ink);
    font-family: var(--sans, 'DM Sans', sans-serif);
    -webkit-font-smoothing: antialiased;
}

/* Form controls inherit the editorial stack, everywhere */
.codeiq-dashboard button,
.codeiq-dashboard input,
.codeiq-dashboard select,
.codeiq-dashboard textarea {
    font-family: inherit;
}

/* Focus discipline: one visible ring, salmon, no glow soup */
.codeiq-dashboard :focus-visible {
    outline: 2px solid var(--ed-salmon);
    outline-offset: 1px;
}
.codeiq-dashboard :focus:not(:focus-visible) {
    outline: none;
}

::selection {
    background: var(--ed-wash);
    color: var(--ed-wine-deep);
}

/* Quiet, warm scrollbars */
.codeiq-dashboard ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
.codeiq-dashboard ::-webkit-scrollbar-track {
    background: var(--ed-ivory);
}
.codeiq-dashboard ::-webkit-scrollbar-thumb {
    background: var(--ed-rule);
    border-radius: 999px;
    border: 2px solid var(--ed-ivory);
}
.codeiq-dashboard ::-webkit-scrollbar-thumb:hover {
    background: var(--ed-rule-strong);
}

/* Editorial micro-label utility (mono, tracked, uppercase) */
.ed-microlabel {
    font-family: var(--mono, 'JetBrains Mono', monospace);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
}

/* ------------------------------------------------------------
   Global buttons — .action-btn family (used on every surface)
   ------------------------------------------------------------ */
.codeiq-dashboard .action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 9px 18px;
    border-radius: 2px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    background: transparent;
    color: var(--ed-ink);
    box-shadow: none;
    transition: background 200ms cubic-bezier(.2,.8,.2,1),
                color 200ms cubic-bezier(.2,.8,.2,1),
                border-color 200ms cubic-bezier(.2,.8,.2,1),
                transform 200ms cubic-bezier(.2,.8,.2,1);
}
.codeiq-dashboard .action-btn:hover {
    transform: translateY(-1px);
}
.codeiq-dashboard .action-btn:active {
    transform: translateY(0);
}
.codeiq-dashboard .action-btn.primary {
    background: var(--ed-ink);
    color: var(--ed-cream);
    border-color: var(--ed-ink);
}
.codeiq-dashboard .action-btn.primary:hover {
    background: var(--ed-wine);
    border-color: var(--ed-wine);
    box-shadow: 0 8px 20px -12px var(--ed-wine);
}
.codeiq-dashboard .action-btn.primary:disabled,
.codeiq-dashboard .action-btn.primary.not-all-ready {
    background: var(--ed-paper);
    border-color: var(--ed-paper);
    color: var(--ed-ink-4);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
.codeiq-dashboard .action-btn.secondary {
    color: var(--ed-ink-2);
    border-color: var(--ed-rule);
    background: #fff;
}
.codeiq-dashboard .action-btn.secondary:hover {
    color: var(--ed-ink);
    background: var(--ed-ivory);
    border-color: var(--ed-rule-strong);
}
.codeiq-dashboard .action-btn.success {
    background: var(--ed-sage-deep);
    color: #fff;
    border-color: var(--ed-sage-deep);
}
.codeiq-dashboard .action-btn.success:hover {
    background: var(--ed-sage);
    border-color: var(--ed-sage);
    box-shadow: 0 8px 20px -12px var(--ed-sage);
}
.codeiq-dashboard .action-btn.danger {
    background: #fff;
    color: var(--ed-rust);
    border-color: rgba(176, 74, 58, 0.4);
}
.codeiq-dashboard .action-btn.danger:hover {
    background: var(--ed-rust);
    border-color: var(--ed-rust);
    color: #fff;
}


/* ============================================================
   §2 CHROME — tab bar, session tabs, user menu, credits
   ============================================================ */

/* Masthead: flat warm glass, single hairline */
.codeiq-dashboard .tab-bar {
    background: rgba(250, 248, 245, 0.92);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid var(--ed-rule);
    box-shadow: none;
    height: 58px;
    min-height: 58px;
    padding: 0 clamp(16px, 2.5vw, 32px);
    display: flex;
    align-items: stretch;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky, 1020);
}

.codeiq-dashboard .codeiq-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 0 0;
    border-right: 1px solid var(--ed-rule);
    margin-right: 16px;
    min-width: 0;
    flex-shrink: 0;
}
.codeiq-dashboard .codeiq-logo {
    height: 30px;
    width: auto;
    max-width: 118px;
    object-fit: contain;
}
/* The logo SVG already carries the wordmark; the text span duplicates it */
.codeiq-dashboard .codeiq-title {
    display: none;
}

/* --- Session tabs: quiet editorial file-tabs on the baseline rule --- */
.codeiq-dashboard .tabs-container {
    display: flex;
    align-items: stretch;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.codeiq-dashboard .tab {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 0 14px;
    max-width: 250px;
    position: relative;
    cursor: pointer;
    opacity: 1;
    box-shadow: none;
    transition: background 180ms ease;
}
.codeiq-dashboard .tab::before {
    display: none;
}
/* baseline indicator */
.codeiq-dashboard .tab::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -1px;
    height: 2px;
    background: var(--ed-salmon);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 240ms cubic-bezier(.2,.8,.2,1);
}
.codeiq-dashboard .tab:hover {
    background: rgba(255, 255, 255, 0.65);
}
.codeiq-dashboard .tab.active {
    background: transparent;
    box-shadow: none;
    border-bottom: none;
}
.codeiq-dashboard .tab.active::after {
    transform: scaleX(1);
}

.codeiq-dashboard .tab .tab-icon {
    display: flex;
    align-items: center;
    color: var(--ed-ink-3);
    flex-shrink: 0;
}
.codeiq-dashboard .tab .tab-icon img,
.codeiq-dashboard .tab .tab-icon svg {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.codeiq-dashboard .tab-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.codeiq-dashboard .tab-title {
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ed-ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.codeiq-dashboard .tab.active .tab-title {
    color: var(--ed-ink);
    font-weight: 600;
}
.codeiq-dashboard .tab-subtitle {
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
}
.codeiq-dashboard .tab.active .tab-subtitle {
    color: var(--ed-wine);
}

.codeiq-dashboard .tab-status {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.codeiq-dashboard .status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ed-rule-strong);
}
.codeiq-dashboard .status-indicator.status-ready,
.codeiq-dashboard .status-indicator.ready {
    background: var(--ed-sage);
}
.codeiq-dashboard .status-indicator.status-processing,
.codeiq-dashboard .status-indicator.processing {
    background: var(--ed-salmon);
    animation: pulseDot 2.2s ease-in-out infinite;
}
.codeiq-dashboard .status-indicator.status-error,
.codeiq-dashboard .status-indicator.error {
    background: var(--ed-rust);
}

.codeiq-dashboard .tab-close {
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    color: var(--ed-ink-4);
    cursor: pointer;
    opacity: 0;
    transition: opacity 160ms ease, color 160ms ease, background 160ms ease;
    flex-shrink: 0;
}
.codeiq-dashboard .tab:hover .tab-close,
.codeiq-dashboard .tab.active .tab-close {
    opacity: 1;
}
.codeiq-dashboard .tab-close:hover {
    color: var(--ed-wine);
    background: var(--ed-wash);
}

/* Overflow "+N more" tab & dropdown */
.codeiq-dashboard .tab-overflow-menu.overflow-hidden {
    display: none;
}
.codeiq-dashboard .overflow-dropdown {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: var(--ed-lift);
}

/* --- Right-side controls --- */
.codeiq-dashboard .tab-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding-left: 16px;
    border-left: 1px solid var(--ed-rule);
}

.codeiq-dashboard .back-to-dashboard-btn,
.codeiq-dashboard .codeiq-tour-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 14px;
    background: transparent;
    border: 1px solid var(--ed-rule);
    border-radius: 999px;
    color: var(--ed-ink-3);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 180ms ease;
}
.codeiq-dashboard .back-to-dashboard-btn:hover,
.codeiq-dashboard .codeiq-tour-btn:hover {
    color: var(--ed-ink);
    border-color: var(--ed-rule-strong);
    background: #fff;
    transform: translateY(-1px);
}
.codeiq-dashboard .back-to-dashboard-btn svg,
.codeiq-dashboard .codeiq-tour-btn svg {
    width: 13px;
    height: 13px;
}

.codeiq-dashboard .user-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 6px 0 4px;
    background: transparent;
    border: 1px solid var(--ed-rule);
    border-radius: 999px;
    color: var(--ed-ink-2);
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 180ms ease, background 180ms ease;
}
.codeiq-dashboard .user-menu-btn:hover {
    border-color: var(--ed-rule-strong);
    background: #fff;
}
.codeiq-dashboard .user-menu-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    flex: 0 0 auto;
}
.codeiq-dashboard .user-menu-btn .dropdown-arrow {
    font-size: 8px;
    color: var(--ed-ink-4);
    padding-right: 4px;
}

.codeiq-dashboard .user-menu-dropdown {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: var(--ed-lift);
    padding: 6px;
    min-width: 210px;
}
.codeiq-dashboard .user-menu-dropdown .user-info {
    padding: 8px 10px;
}
.codeiq-dashboard .user-menu-dropdown .user-email {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.04em;
    color: var(--ed-ink-3);
    overflow: hidden;
    text-overflow: ellipsis;
}
.codeiq-dashboard .user-menu-dropdown .menu-divider {
    height: 1px;
    background: var(--ed-rule-soft);
    margin: 4px 0;
}
.codeiq-dashboard .user-menu-dropdown .menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 2px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--ed-ink-2);
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
}
.codeiq-dashboard .user-menu-dropdown .menu-item:hover {
    background: var(--ed-ivory);
    color: var(--ed-ink);
}

/* --- Credits widget (floating under brand) --- */
.codeiq-dashboard .credits-widget {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 999px;
    box-shadow: var(--ed-hairline-shadow);
    padding: 5px 14px;
    cursor: pointer;
    transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.codeiq-dashboard .credits-widget:hover {
    border-color: var(--ed-rule-strong);
    transform: translateY(-1px);
}
.codeiq-dashboard .credits-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}
.codeiq-dashboard .credits-icon {
    color: var(--ed-wine);
}
.codeiq-dashboard .credits-available {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--ed-ink-2);
    font-variant-numeric: tabular-nums;
}

.codeiq-dashboard .credits-popover {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: var(--ed-lift);
    overflow: hidden;
}
.codeiq-dashboard .credits-popover .popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ed-rule-soft);
}
.codeiq-dashboard .credits-popover .popover-header h4 {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    margin: 0;
}
.codeiq-dashboard .credits-popover .popover-close {
    background: none;
    border: none;
    color: var(--ed-ink-4);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
}
.codeiq-dashboard .credits-popover .popover-close:hover {
    color: var(--ed-ink);
    background: var(--ed-ivory);
}
.codeiq-dashboard .credits-popover .popover-body {
    padding: 14px 16px 16px;
}
.codeiq-dashboard .credits-progress-container {
    margin-bottom: 12px;
}
.codeiq-dashboard .credits-progress-bar {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: var(--ed-paper);
    overflow: visible;
}
.codeiq-dashboard .credits-progress-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    width: var(--credits-used-pct, 0%);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ed-salmon), var(--ed-wine));
    transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.codeiq-dashboard .credits-progress-bar .progress-label {
    position: absolute;
    top: 12px;
    right: 0;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--ed-ink-3);
    font-variant-numeric: tabular-nums;
}
.codeiq-dashboard .credits-breakdown {
    display: flex;
    flex-direction: column;
    margin-top: 18px;
    border-top: 1px solid var(--ed-rule-soft);
}
.codeiq-dashboard .credit-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--ed-rule-soft);
}
.codeiq-dashboard .credit-row .credit-label {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
}
.codeiq-dashboard .credit-row .credit-value {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--ed-ink);
    font-variant-numeric: tabular-nums;
}
.codeiq-dashboard .credit-row .credit-value.bonus {
    color: var(--ed-sage);
}
.codeiq-dashboard .credit-row.total .credit-value {
    font-family: var(--serif);
    font-size: 18px;
    color: var(--ed-wine);
}
.codeiq-dashboard .popover-actions {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.codeiq-dashboard .btn-buy-credits {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    background: var(--ed-ink);
    color: var(--ed-cream);
    border: 1px solid var(--ed-ink);
    border-radius: 2px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 200ms ease, border-color 200ms ease;
}
.codeiq-dashboard .btn-buy-credits:hover {
    background: var(--ed-wine);
    border-color: var(--ed-wine);
}
.codeiq-dashboard .subscribe-upsell-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--ed-ink-3);
    text-decoration: none;
    transition: color 150ms ease;
}
.codeiq-dashboard .subscribe-upsell-link:hover {
    color: var(--ed-wine);
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* ============================================================
   §3 COMMAND CENTER — the CodeIQ dashboard
   ============================================================ */

.codeiq-dashboard .command-center {
    max-width: 1280px;
    margin: 0 auto;
    padding: 44px clamp(20px, 4vw, 56px) 80px;
    background: transparent;
}

/* Masthead: serif display with italic accent, mono kicker underneath */
.codeiq-dashboard .cc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 34px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--ed-rule);
}
.codeiq-dashboard .cc-header-title h1 {
    font-family: var(--serif);
    font-size: clamp(30px, 3.6vw, 44px);
    font-weight: 300;
    letter-spacing: -0.035em;
    line-height: 1.06;
    color: var(--ed-ink);
    margin: 0;
}
.codeiq-dashboard .cc-header-title h1 span {
    font-style: italic;
    font-weight: 400;
    color: var(--ed-salmon);
}
.codeiq-dashboard .cc-header-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
}
.codeiq-dashboard .cc-header-subtitle::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ed-sage);
    animation: pulseDot 2.4s ease-in-out infinite;
}
.codeiq-dashboard .cc-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.codeiq-dashboard .cc-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    background: var(--ed-ink);
    color: var(--ed-cream);
    border: 1px solid var(--ed-ink);
    border-radius: 2px;
    font-family: var(--sans);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: none;
    transition: background 220ms cubic-bezier(.2,.8,.2,1), border-color 220ms ease,
                transform 220ms ease, box-shadow 220ms ease;
}
.codeiq-dashboard .cc-btn-primary:hover {
    background: var(--ed-wine);
    border-color: var(--ed-wine);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px -12px var(--ed-wine);
}
.codeiq-dashboard .cc-platform-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Credits bar: a quiet ledger rail */
.codeiq-dashboard .codeiq-credits-bar {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: none;
    padding: 14px 20px;
    margin-bottom: 34px;
}
.codeiq-dashboard .credits-bar-content {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}
.codeiq-dashboard .credits-bar-progress {
    flex: 1;
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.codeiq-dashboard .credits-bar-track {
    flex: 1;
    height: 6px;
    background: var(--ed-paper);
    border-radius: 999px;
    overflow: hidden;
}
.codeiq-dashboard .credits-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--ed-salmon), var(--ed-wine));
    transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.codeiq-dashboard .credits-bar-text {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.08em;
    color: var(--ed-ink-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.codeiq-dashboard .credits-bar-info {
    display: flex;
    align-items: stretch;
    gap: 0;
}
.codeiq-dashboard .credits-bar-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 18px;
    border-left: 1px solid var(--ed-rule-soft);
}
.codeiq-dashboard .credits-bar-item:first-child {
    border-left: 0;
    padding-left: 0;
}
.codeiq-dashboard .credits-bar-label {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
}
.codeiq-dashboard .credits-bar-value {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--ed-ink);
    font-variant-numeric: tabular-nums;
}
.codeiq-dashboard .credits-bar-value.bonus {
    color: var(--ed-sage);
}
.codeiq-dashboard .credits-bar-value.available {
    color: var(--ed-wine);
}
.codeiq-dashboard .credits-bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.codeiq-dashboard .credits-bar-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.codeiq-dashboard .credits-bar-btn.buy {
    background: var(--ed-ink);
    color: var(--ed-cream);
    border: 1px solid var(--ed-ink);
}
.codeiq-dashboard .credits-bar-btn.buy:hover {
    background: var(--ed-wine);
    border-color: var(--ed-wine);
    transform: translateY(-1px);
}
.codeiq-dashboard .credits-bar-btn.subscribe {
    background: transparent;
    color: var(--ed-ink-3);
    border: 1px solid var(--ed-rule);
}
.codeiq-dashboard .credits-bar-btn.subscribe:hover {
    color: var(--ed-ink);
    border-color: var(--ed-rule-strong);
    background: var(--ed-ivory);
}

/* Metrics: dashboard-standard hairline stat grid (1px gap on rule) */
.codeiq-dashboard .cc-metrics-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--ed-rule);
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 34px;
    padding: 0;
    box-shadow: none;
}
@media (max-width: 1100px) {
    .codeiq-dashboard .cc-metrics-panel { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .codeiq-dashboard .cc-metrics-panel { grid-template-columns: 1fr; }
}
.codeiq-dashboard .cc-metric-card {
    background: var(--ed-cream);
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 20px 24px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: background 260ms ease;
}
.codeiq-dashboard .cc-metric-card:hover {
    background: #fff;
    transform: none;
    border-color: transparent;
    box-shadow: none;
}
.codeiq-dashboard .cc-metric-card::before,
.codeiq-dashboard .cc-metric-card::after {
    display: none;
}
.codeiq-dashboard .cc-metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
}
.codeiq-dashboard .cc-metric-label {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
}
.codeiq-dashboard .cc-metric-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ed-sage);
    box-shadow: none;
    animation: none;
}
.codeiq-dashboard .cc-metric-indicator.warning {
    background: var(--ed-rule-strong);
}
.codeiq-dashboard .cc-metric-value {
    font-family: var(--serif);
    font-size: clamp(30px, 3vw, 40px);
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--ed-ink);
    font-variant-numeric: lining-nums;
}
.codeiq-dashboard .cc-metric-value.accent {
    color: var(--ed-wine);
}

/* Sections: mono §-rule headers, hairline card bodies */
.codeiq-dashboard .cc-command-section,
.codeiq-dashboard .cc-activity-section {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}
.codeiq-dashboard .cc-section-header {
    margin-bottom: 16px;
    padding: 0;
    border: none;
}
.codeiq-dashboard .cc-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.codeiq-dashboard .cc-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ed-rule);
}
.codeiq-dashboard .cc-section-icon {
    display: none;
}
.codeiq-dashboard .cc-section-title h3 {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    margin: 0;
}

/* Quick commands: editorial index rows with → markers */
.codeiq-dashboard .cc-commands-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border-top: 1px solid var(--ed-rule);
}
.codeiq-dashboard .cc-command-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ed-rule);
    border-radius: 0;
    box-shadow: none;
    padding: 18px 6px;
    cursor: pointer;
    text-align: left;
    position: relative;
    transition: background 220ms ease, padding-left 220ms cubic-bezier(.2,.8,.2,1);
}
.codeiq-dashboard .cc-command-btn:hover {
    background: #fff;
    padding-left: 14px;
    transform: none;
    border-color: var(--ed-rule);
    box-shadow: none;
}
.codeiq-dashboard .cc-command-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--ed-rule);
    background: #fff;
    color: var(--ed-ink-2);
    box-shadow: none;
}
.codeiq-dashboard .cc-command-icon svg {
    width: 15px;
    height: 15px;
}
.codeiq-dashboard .cc-command-icon.purple,
.codeiq-dashboard .cc-command-icon.magenta {
    color: var(--ed-wine);
    background: var(--ed-wash-soft);
    border-color: rgba(154, 64, 84, 0.25);
}
.codeiq-dashboard .cc-command-icon.green {
    color: var(--ed-sage);
    background: var(--ed-sage-wash);
    border-color: rgba(74, 124, 74, 0.25);
}
.codeiq-dashboard .cc-command-icon.blue {
    color: var(--ed-slate);
    background: var(--ed-slate-wash);
    border-color: rgba(91, 110, 174, 0.25);
}
.codeiq-dashboard .cc-command-icon.amber {
    color: var(--ed-gold);
    background: var(--ed-gold-wash);
    border-color: rgba(138, 98, 26, 0.3);
}
.codeiq-dashboard .cc-command-info {
    flex: 1;
    min-width: 0;
}
.codeiq-dashboard .cc-command-info h4 {
    font-family: var(--serif);
    font-size: 16.5px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ed-ink);
    margin: 0 0 2px;
}
.codeiq-dashboard .cc-command-info p {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
    margin: 0;
}
.codeiq-dashboard .cc-command-arrow {
    color: var(--ed-ink-4);
    transition: transform 240ms cubic-bezier(.2,.8,.2,1), color 240ms ease;
}
.codeiq-dashboard .cc-command-btn:hover .cc-command-arrow {
    transform: translateX(4px);
    color: var(--ed-wine);
}
.codeiq-dashboard .cc-command-badge {
    background: var(--ed-wine);
    color: #fff;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 999px;
}
.codeiq-dashboard .cc-command-btn-highlight {
    background: var(--ed-wash-soft);
}

/* Activity log: hairline ledger lines, mono timestamps */
.codeiq-dashboard .cc-activity-list {
    border-top: 1px solid var(--ed-rule);
    max-height: none;
    background: transparent;
    gap: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}
.codeiq-dashboard .cc-activity-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 13px 6px;
    border-bottom: 1px solid var(--ed-rule);
    background: transparent;
    border-radius: 0;
    transition: background 200ms ease;
}
.codeiq-dashboard .cc-activity-item:hover {
    background: #fff;
}
.codeiq-dashboard .cc-activity-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ed-rule-strong);
    flex-shrink: 0;
    align-self: center;
    box-shadow: none;
}
.codeiq-dashboard .cc-activity-dot.success { background: var(--ed-sage); }
.codeiq-dashboard .cc-activity-dot.info    { background: var(--ed-slate); }
.codeiq-dashboard .cc-activity-dot.accent  { background: var(--ed-salmon); }
.codeiq-dashboard .cc-activity-dot.warning { background: var(--ed-gold); }
.codeiq-dashboard .cc-activity-content {
    flex: 1;
    min-width: 0;
}
.codeiq-dashboard .cc-activity-content p {
    font-family: var(--sans);
    font-size: 13px;
    line-height: 1.45;
    color: var(--ed-ink-2);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.codeiq-dashboard .cc-activity-time {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
    white-space: nowrap;
}
.codeiq-dashboard .cc-activity-empty {
    border-top: 1px solid var(--ed-rule);
    padding: 44px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--ed-ink-4);
}
.codeiq-dashboard .cc-activity-empty p {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 15px;
    color: var(--ed-ink-3);
    margin: 0;
}

/* System status footer: mono microlabels with live dots */
.codeiq-dashboard .cc-status-bar {
    margin-top: 40px;
    padding-top: 18px;
    border-top: 1px solid var(--ed-rule);
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}
.codeiq-dashboard .cc-status-group {
    display: flex;
    align-items: center;
    gap: 28px;
}
.codeiq-dashboard .cc-status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.codeiq-dashboard .cc-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ed-sage);
    animation: pulseDot 2.6s ease-in-out infinite;
    box-shadow: none;
}
.codeiq-dashboard .cc-status-item:nth-child(2) .cc-status-dot { animation-delay: -0.9s; }
.codeiq-dashboard .cc-status-item:nth-child(3) .cc-status-dot { animation-delay: -1.7s; }
.codeiq-dashboard .cc-status-label {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
}

/* Platform connection chips rendered by IntegrationsPanel */
.codeiq-dashboard .cc-platform-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    cursor: pointer;
    transition: border-color 180ms ease, color 180ms ease, transform 180ms ease;
}
.codeiq-dashboard .cc-platform-indicator:hover {
    border-color: var(--ed-rule-strong);
    color: var(--ed-ink);
    transform: translateY(-1px);
}


/* ============================================================
   §4 SESSION STATES — header, stats, setup, company selection
   ============================================================ */

.codeiq-dashboard .session-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 36px clamp(20px, 4vw, 56px) 72px;
}

/* Session header: serif client name + mono platform tag */
.codeiq-dashboard .session-header {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--ed-rule);
}
.codeiq-dashboard .session-header h2 {
    font-family: var(--serif);
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--ed-ink);
    margin: 0;
    background: none;
    -webkit-text-fill-color: currentColor;
    flex: 1;
    min-width: 200px;
}
.codeiq-dashboard .platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--ed-rule);
    background: #fff;
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500 !important;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-ink-2) !important;
    box-shadow: none;
}
.codeiq-dashboard .session-status.ready {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-sage);
    background: transparent;
    border: none;
    padding: 0;
}
.codeiq-dashboard .session-status.ready .status-icon {
    width: 13px;
    height: 13px;
}

/* Session stats: hairline meter row (dashboard hero-meter pattern) */
.codeiq-dashboard .session-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    margin: 0 0 24px;
    background: transparent;
    border: none;
    border-top: 1px solid var(--ed-rule);
    border-bottom: 1px solid var(--ed-rule);
    border-radius: 0;
    box-shadow: none;
}
.codeiq-dashboard .stat-card {
    background: transparent;
    border: none;
    border-left: 1px solid var(--ed-rule);
    border-radius: 0;
    box-shadow: none;
    padding: 18px 22px;
    margin: 0;
    display: flex;
    flex-direction: column-reverse;
    gap: 7px;
    text-align: left;
    transition: background 220ms ease;
}
.codeiq-dashboard .stat-card:first-child {
    border-left: 0;
}
.codeiq-dashboard .stat-card::before,
.codeiq-dashboard .stat-card::after {
    display: none;
}
.codeiq-dashboard .stat-card.clickable-stat-card:hover {
    background: #fff;
    transform: none;
    box-shadow: none;
}
.codeiq-dashboard .stat-card .stat-value {
    font-family: var(--serif);
    font-size: 30px;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--ed-ink);
    margin: 0;
}
.codeiq-dashboard .stat-card .stat-label {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
}

/* Per-client coding context panel (classes added in TabManager) */
.codeiq-dashboard .client-context-panel {
    margin: 0 0 24px;
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    padding: 16px 20px 14px;
}
.codeiq-dashboard .client-context-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.codeiq-dashboard .client-context-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}
.codeiq-dashboard .client-context-title strong {
    font-family: var(--serif);
    font-size: 15.5px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ed-ink);
}
.codeiq-dashboard .client-context-title small {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
}
.codeiq-dashboard .client-context-saved {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-sage);
    opacity: 0;
    transition: opacity 200ms ease;
}
.codeiq-dashboard .client-context-panel textarea {
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    background: var(--ed-cream);
    font-family: var(--sans);
    font-size: 13px;
    line-height: 1.55;
    color: var(--ed-ink);
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 180ms ease, background 180ms ease;
}
.codeiq-dashboard .client-context-panel textarea:focus {
    border-color: var(--ed-salmon);
    background: #fff;
}
.codeiq-dashboard .client-context-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}
.codeiq-dashboard .client-context-count {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--ed-ink-4);
    font-variant-numeric: tabular-nums;
}
.codeiq-dashboard .client-context-save {
    background: var(--ed-ink);
    color: var(--ed-cream);
    border: 1px solid var(--ed-ink);
    padding: 7px 16px;
    border-radius: 2px;
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.codeiq-dashboard .client-context-save:hover {
    background: var(--ed-wine);
    border-color: var(--ed-wine);
    transform: translateY(-1px);
}

/* Setup / initial state */
.codeiq-dashboard .setup-container {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    padding: 56px 32px;
    text-align: center;
}
.codeiq-dashboard .setup-content h3 {
    font-family: var(--serif);
    font-size: 24px;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
    margin: 0 0 8px;
}
.codeiq-dashboard .setup-content p {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 15px;
    color: var(--ed-ink-3);
    margin: 0 0 24px;
}

/* Company selection & master search share card language */
.codeiq-dashboard .company-selection-container .company-card,
.codeiq-dashboard .company-option {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    transition: border-color 240ms ease, transform 300ms cubic-bezier(.2,.8,.2,1);
}
.codeiq-dashboard .company-selection-container .company-card:hover,
.codeiq-dashboard .company-option:hover {
    border-color: var(--ed-ink);
    transform: translateY(-2px);
    box-shadow: none;
}


/* ============================================================
   §5 UPLOAD FLOW — tabs, bank cards, invoices, merchant, summary
   ============================================================ */

/* Upload tab rail: mono uppercase tabs on a hairline, salmon baseline active */
.upload-section .upload-tabs {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ed-rule);
    border-radius: 0;
    padding: 0;
    gap: 4px;
}
.upload-section .upload-tab {
    position: relative;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 12px 16px 14px;
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    box-shadow: none;
    transition: color 200ms ease, background 200ms ease;
}
.upload-section .upload-tab svg {
    width: 14px;
    height: 14px;
}
.upload-section .upload-tab::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 2px;
    background: var(--ed-salmon);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 260ms cubic-bezier(.2,.8,.2,1);
}
.upload-section .upload-tab:hover:not(.active) {
    color: var(--ed-ink);
    background: rgba(255, 255, 255, 0.6);
}
.upload-section .upload-tab.active {
    background: transparent;
    color: var(--ed-ink);
    font-weight: 500;
    box-shadow: none;
}
.upload-section .upload-tab.active::after {
    transform: scaleX(1);
}
.upload-section .invoice-count-badge,
.upload-section .merchant-count-badge {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    background: var(--ed-wash);
    color: var(--ed-wine);
    border: none;
    border-radius: 999px;
    padding: 2px 7px;
    font-variant-numeric: tabular-nums;
}

/* Section headers inside tabs: serif headline + italic standfirst */
.upload-section .upload-header h3,
.upload-section .invoice-header-text h3,
.upload-section .merchant-setup-header h3,
.upload-section .merchant-active h3 {
    font-family: var(--serif);
    font-size: 21px;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
}
.upload-section .upload-header p,
.upload-section .invoice-header-text p,
.upload-section .merchant-setup-header p,
.upload-section .merchant-active p {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 14.5px;
    color: var(--ed-ink-3);
}

/* Client bank inbox button (class added in TabManager; inline styles removed) */
.upload-section .client-inbox-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ed-ink);
    color: var(--ed-cream);
    border: 1px solid var(--ed-ink);
    padding: 8px 16px;
    border-radius: 2px;
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: none;
    transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.upload-section .client-inbox-btn:hover {
    background: var(--ed-wine);
    border-color: var(--ed-wine);
    transform: translateY(-1px);
}

/* --- Bank cards: white ledger cards, hairline, 2px --- */
.upload-section .bank-card {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: none;
    transition: border-color 260ms ease, transform 320ms cubic-bezier(.2,.8,.2,1);
}
.upload-section .bank-card:hover {
    border-color: var(--ed-ink);
    box-shadow: none;
    transform: translateY(-2px);
}
.upload-section .bank-card .bank-name {
    font-family: var(--serif);
    font-size: 16.5px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ed-ink);
}
.upload-section .bank-card .bank-type {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    background: var(--ed-ivory);
    border: none;
    border-radius: 2px;
    padding: 3px 8px;
}
.upload-section .bank-card .bank-balance {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    font-size: 13px;
    color: var(--ed-ink-2);
    background: transparent;
    padding: 0;
}
.upload-section .bank-card .account-number {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ed-ink-4);
    letter-spacing: 0.08em;
}
.upload-section .bank-card .platform-badge {
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: 0.16em;
    background: var(--ed-wash);
    color: var(--ed-wine) !important;
    text-shadow: none !important;
    box-shadow: none;
    border: none;
    border-radius: 2px;
    padding: 3px 8px;
}

/* Drop zones: hairline dash on cream, salmon invitation */
.upload-section .upload-area {
    background: var(--ed-cream);
    border: 1px dashed var(--ed-rule-strong);
    border-radius: 2px;
    transition: background 200ms ease, border-color 200ms ease;
}
.upload-section .upload-area:hover,
.upload-section .upload-area.drag-over {
    background: var(--ed-wash-soft);
    border-color: var(--ed-salmon);
}
.upload-section .upload-area .upload-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--ed-wine);
    border: 1px solid var(--ed-rule);
    border-radius: 50%;
    box-shadow: none;
    transition: border-color 200ms ease, transform 200ms ease;
}
.upload-section .upload-area:hover .upload-icon {
    border-color: rgba(196, 87, 106, 0.4);
    transform: translateY(-2px);
}
.upload-section .upload-area .upload-text {
    color: var(--ed-ink-2);
    font-weight: 500;
    font-size: 14px;
}
.upload-section .upload-area .upload-hint {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
}
.upload-section .upload-area .upload-hint .browse,
.upload-section .upload-area .browse-link {
    color: var(--ed-wine);
    font-weight: 600;
}

/* Uploading state */
.upload-section .upload-progress-text {
    color: var(--ed-ink);
    font-weight: 600;
}
.upload-section .upload-progress-subtext {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ed-ink-4);
}
.upload-section .upload-progress-bar {
    background: var(--ed-paper);
    border-radius: 999px;
    overflow: hidden;
}
.upload-section .upload-progress-fill {
    background: linear-gradient(90deg, var(--ed-salmon), var(--ed-wine));
    border-radius: 999px;
}

/* Uploaded state: quiet sage confirmation */
.upload-section .upload-area.has-file {
    background: var(--ed-sage-wash);
    border: 1px solid rgba(74, 124, 74, 0.35);
}
.upload-section .file-info .file-name {
    font-family: var(--mono);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ed-ink);
}
.upload-section .file-info .file-size {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.04em;
    color: var(--ed-sage);
}
.upload-section .file-info .file-icon {
    background: #fff;
    color: var(--ed-sage);
    border: 1px solid rgba(74, 124, 74, 0.3);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-section .file-info .remove-file {
    color: var(--ed-ink-4);
    transition: color 180ms ease;
}
.upload-section .file-info .remove-file:hover {
    color: var(--ed-rust);
}

/* Toggle row */
.upload-section .no-transactions-toggle .toggle-label {
    font-size: 12.5px;
    color: var(--ed-ink-3);
}
.upload-section .toggle-slider {
    background: var(--ed-paper);
    border: 1px solid var(--ed-rule);
    transition: background 200ms ease, border-color 200ms ease;
}
.upload-section .no-transactions-checkbox:checked + .toggle-slider {
    background: var(--ed-wine);
    border-color: var(--ed-wine);
}

/* --- Upload summary: hairline meter footer --- */
.upload-section .upload-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    border-top: 1px solid var(--ed-rule);
    padding: 20px 0 0;
    margin-top: 8px;
}
.codeiq-dashboard .upload-section .summary-stats {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex: 1 1 auto;
    margin: 0;
    flex-wrap: wrap;
    grid-template-columns: none;
}
.codeiq-dashboard .upload-section .summary-stat {
    display: flex;
    flex-direction: column-reverse;
    gap: 5px;
    align-items: flex-start;
    text-align: left;
    background: transparent;
    border: none;
    border-left: 1px solid var(--ed-rule);
    border-radius: 0;
    padding: 2px 22px;
}
.codeiq-dashboard .upload-section .summary-stat:first-child {
    border-left: 0;
    padding-left: 0;
}
.upload-section .process-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.upload-section .summary-stat .stat-value {
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
    font-variant-numeric: lining-nums;
}
.upload-section .summary-stat .stat-label {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
}

/* --- Invoice tab columns --- */
.upload-section .invoice-column {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: none;
    overflow: hidden;
    transition: border-color 260ms ease;
}
.upload-section .invoice-column:hover {
    border-color: var(--ed-rule-strong);
}
.upload-section .invoice-column .column-header {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ed-rule-soft);
    position: relative;
}
.upload-section .invoice-column .column-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
}
.upload-section .invoice-column.sales .column-header::before { background: var(--ed-sage); }
.upload-section .invoice-column.purchase .column-header::before { background: var(--ed-rust); }
.upload-section .invoice-column .column-icon {
    border-radius: 50%;
    box-shadow: none;
}
.upload-section .invoice-column.sales .column-icon {
    background: var(--ed-sage-wash);
    color: var(--ed-sage);
    border: 1px solid rgba(74, 124, 74, 0.3);
}
.upload-section .invoice-column.purchase .column-icon {
    background: var(--ed-rust-wash);
    color: var(--ed-rust);
    border: 1px solid rgba(176, 74, 58, 0.3);
}
.upload-section .invoice-column .column-title h4 {
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ed-ink);
}
.upload-section .invoice-column .column-hint {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
}
.upload-section .invoice-column .column-count {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    background: var(--ed-ivory);
    color: var(--ed-ink-2);
    border: none;
    border-radius: 999px;
}
.upload-section .invoice-drop-zone,
.upload-section .invoice-column.sales .invoice-drop-zone,
.upload-section .invoice-column.purchase .invoice-drop-zone {
    background: var(--ed-cream);
    border: 1px dashed var(--ed-rule-strong);
    border-radius: 2px;
    transition: background 200ms ease, border-color 200ms ease;
}
.upload-section .invoice-drop-zone:hover,
.upload-section .invoice-drop-zone.dragover,
.upload-section .invoice-column.sales .invoice-drop-zone:hover,
.upload-section .invoice-column.sales .invoice-drop-zone.dragover,
.upload-section .invoice-column.purchase .invoice-drop-zone:hover,
.upload-section .invoice-column.purchase .invoice-drop-zone.dragover {
    background: var(--ed-wash-soft);
    border-color: var(--ed-salmon);
}
.upload-section .invoice-drop-zone .drop-icon { color: var(--ed-wine); }
.upload-section .invoice-drop-zone .drop-text { color: var(--ed-ink-2); }
.upload-section .invoice-drop-zone .drop-hint {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
}
.upload-section .invoice-drop-zone .browse-link {
    color: var(--ed-wine);
    font-weight: 600;
}

/* Queue */
.upload-section .invoice-mini-queue {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
}
.upload-section .mini-queue-list .queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--ed-rule-soft);
}
.upload-section .mini-queue-list .queue-item:last-child { border-bottom: none; }
.upload-section .queue-item .queue-file-name {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ed-ink-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.upload-section .queue-item .queue-status {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 2px;
    flex-shrink: 0;
}
.upload-section .queue-item .queue-status.pending {
    background: var(--ed-ivory);
    color: var(--ed-ink-3);
    border: none;
}
.upload-section .mini-extract-btn {
    background: var(--ed-ink);
    color: var(--ed-cream);
    border: 1px solid var(--ed-ink);
    border-radius: 2px;
    font-weight: 500;
    transition: background 200ms ease, border-color 200ms ease;
}
.upload-section .mini-extract-btn:hover {
    background: var(--ed-wine);
    border-color: var(--ed-wine);
}
.upload-section .manual-entry-inline {
    border: 1px dashed var(--ed-rule-strong);
    color: var(--ed-ink-3);
    background: transparent;
    border-radius: 2px;
    font-size: 12.5px;
    transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}
.upload-section .manual-entry-inline:hover {
    border-color: var(--ed-salmon);
    color: var(--ed-wine);
    background: var(--ed-wash-soft);
}

/* --- Merchant tab --- */
.upload-section .merchant-account-card {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: none;
    cursor: pointer;
    transition: border-color 240ms ease, transform 300ms cubic-bezier(.2,.8,.2,1);
}
.upload-section .merchant-account-card:hover {
    border-color: var(--ed-ink);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: none;
}
.upload-section .merchant-account-card-icon {
    background: var(--ed-wash);
    color: var(--ed-wine);
    border: 1px solid rgba(196, 87, 106, 0.22);
    border-radius: 50%;
    transition: background 220ms ease, color 220ms ease;
}
.upload-section .merchant-account-card:hover .merchant-account-card-icon {
    background: var(--ed-wine);
    color: #fff;
}
.upload-section .merchant-account-card-name {
    font-family: var(--serif);
    font-size: 15px;
    font-weight: 500;
    color: var(--ed-ink);
}
.upload-section .merchant-account-card-detail {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: var(--ed-ink-4);
}


/* ============================================================
   §6 PROGRESS — init screen (li-*) and coding pipeline (tp-*)
   ============================================================ */

/* --- Shared shell: white plate, hairline, long-lift shadow --- */
.enhanced-loading,
.tp-shell {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: var(--ed-lift);
}

/* --- Init screen --- */
.enhanced-loading .li-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 26px;
    letter-spacing: -0.025em;
    color: var(--ed-ink);
}
.enhanced-loading .li-subtitle {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    color: var(--ed-ink-3);
}
.enhanced-loading .li-subtitle .estimate-value {
    font-family: var(--mono);
    font-style: normal;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--ed-ink-3);
}
.enhanced-loading .li-percentage {
    font-family: var(--mono);
    background: transparent;
    color: var(--ed-wine);
    font-weight: 500;
    font-size: 24px;
    font-variant-numeric: tabular-nums;
    border: none;
    padding: 0;
}

/* Progress ring: thin editorial stroke */
.enhanced-loading .circular-progress .progress-bg {
    stroke: var(--ed-paper);
    stroke-width: 3;
}
.enhanced-loading .circular-progress .progress-fill {
    stroke-width: 3;
    stroke-linecap: butt;
}
.enhanced-loading .li-hero-ring {
    filter: none;
}
.enhanced-loading .li-hero-logo {
    background: transparent;
    box-shadow: none;
}
.enhanced-loading .li-hero-fallback {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
}
.enhanced-loading .li-phase-name {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ed-wine);
    background: transparent;
    border: none;
    border-top: 1px solid var(--ed-rule);
    border-radius: 0;
    padding: 10px 0 0;
}

/* "Now" banner */
.enhanced-loading .li-now {
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule);
    border-left: 2px solid var(--ed-salmon);
    border-radius: 2px;
    box-shadow: none;
}
.enhanced-loading .li-now-kicker {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.22em;
    color: var(--ed-wine);
}
.enhanced-loading .li-now-icon {
    background: var(--ed-wash);
    color: var(--ed-wine);
    border: 1px solid rgba(196, 87, 106, 0.2);
}
.enhanced-loading .li-now-title {
    font-family: var(--serif);
    font-weight: 500;
    color: var(--ed-ink);
}
.enhanced-loading .li-now-message { color: var(--ed-ink-3); }

/* Section heads */
.enhanced-loading .li-section-head {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    border-bottom: 1px solid var(--ed-rule);
    padding-bottom: 9px;
}

/* Pipeline steps: rail carries state */
.enhanced-loading .li-steps-list .step {
    background: transparent;
    border: none;
    border-left: 2px solid var(--ed-rule);
    border-radius: 0;
    padding-left: 14px;
    transition: border-color 250ms ease, background 250ms ease;
}
.enhanced-loading .li-steps-list .step + .step { margin-top: 2px; }
.enhanced-loading .li-steps-list .step .li-step-icon {
    background: var(--ed-ivory);
    color: var(--ed-ink-4);
    border: 1px solid var(--ed-rule);
    border-radius: 50%;
    transition: all 250ms ease;
}
.enhanced-loading .li-steps-list .step .li-step-title {
    color: var(--ed-ink-3);
    font-weight: 500;
}
.enhanced-loading .li-steps-list .step .li-step-status {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
}
.enhanced-loading .li-steps-list .step.completed { border-left-color: var(--ed-sage); }
.enhanced-loading .li-steps-list .step.completed .li-step-icon {
    background: var(--ed-sage-wash);
    color: var(--ed-sage);
    border-color: rgba(74, 124, 74, 0.3);
}
.enhanced-loading .li-steps-list .step.completed .li-step-title { color: var(--ed-ink-2); }
.enhanced-loading .li-steps-list .step.completed .li-step-status { color: var(--ed-sage); }
.enhanced-loading .li-steps-list .step.active {
    border-left-color: var(--ed-salmon);
    background: linear-gradient(90deg, var(--ed-wash) 0%, rgba(251, 236, 238, 0) 85%);
}
.enhanced-loading .li-steps-list .step.active .li-step-icon {
    background: var(--ed-wine);
    color: #fff;
    border-color: var(--ed-wine);
    box-shadow: none;
}
.enhanced-loading .li-steps-list .step.active .li-step-title {
    color: var(--ed-ink);
    font-weight: 600;
}
.enhanced-loading .li-steps-list .step.active .li-step-status { color: var(--ed-wine); }

/* Live counts */
.enhanced-loading .li-stat {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ed-rule-soft);
    border-radius: 0;
    padding: 12px 2px;
}
.enhanced-loading .li-stat:last-child { border-bottom: none; }
.enhanced-loading .li-stat-label {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
}
.enhanced-loading .li-stat-value {
    font-family: var(--serif);
    font-size: 1.55rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
    font-variant-numeric: lining-nums tabular-nums;
}

/* Fact card: an editorial pull-quote */
.enhanced-loading .li-fact-card {
    background: var(--ed-ivory);
    border: none;
    border-left: 2px solid var(--ed-rule-strong);
    border-radius: 0;
}
.enhanced-loading .li-fact-kicker {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.22em;
    color: var(--ed-ink-4);
}
.enhanced-loading .li-fact-text {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 1rem;
    color: var(--ed-ink-2);
    line-height: 1.55;
}
.enhanced-loading .li-cancel {
    border: 1px solid var(--ed-rule);
    color: var(--ed-ink-3);
    background: #fff;
    border-radius: 2px;
    transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}
.enhanced-loading .li-cancel:hover {
    border-color: var(--ed-rule-strong);
    color: var(--ed-ink);
    background: var(--ed-ivory);
}

/* --- Coding pipeline (tp-*) — transaction-progress.css fights with !important --- */
.tp-shell .tp-title {
    font-family: var(--serif) !important;
    font-size: 22px !important;
    font-weight: 400 !important;
    letter-spacing: -0.02em !important;
    color: var(--ed-ink);
}
.tp-shell .tp-subtitle {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    color: var(--ed-ink-3);
}
.tp-shell .tp-counter {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: var(--ed-ink-2);
    background: transparent;
    border: none;
    border-right: 1px solid var(--ed-rule);
    border-radius: 0;
    padding-right: 14px;
}
.tp-shell .tp-percentage {
    font-family: var(--mono);
    font-size: 20px;
    font-weight: 500;
    background: transparent;
    color: var(--ed-wine);
    border: none;
    padding: 0;
    font-variant-numeric: tabular-nums;
}

/* Phase rail */
.tp-shell .tp-phase-circle {
    background: #fff;
    border: 1px solid var(--ed-rule-strong);
    color: var(--ed-ink-4);
    box-shadow: none;
    transition: all 300ms ease;
}
.tp-shell .tp-phase-link {
    background: var(--ed-rule);
    height: 1px;
}
.tp-shell .tp-phase-name {
    font-family: var(--mono) !important;
    font-size: 9px !important;
    font-weight: 500 !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
    color: var(--ed-ink-4) !important;
}
.tp-shell .tp-phase.completed .tp-phase-circle {
    background: var(--ed-sage-wash);
    border-color: rgba(74, 124, 74, 0.45);
    color: var(--ed-sage);
}
.tp-shell .tp-phase.completed .tp-phase-link { background: rgba(74, 124, 74, 0.4); }
.tp-shell .tp-phase.completed .tp-phase-name { color: var(--ed-sage) !important; }
.tp-shell .tp-phase.active .tp-phase-circle {
    background: var(--ed-wine);
    border-color: var(--ed-wine);
    color: #fff;
    box-shadow: 0 0 0 4px var(--ed-wash);
}
.tp-shell .tp-phase.active .tp-phase-name {
    color: var(--ed-wine) !important;
    font-weight: 500 !important;
}

/* Bar */
.tp-shell .tp-bar-track {
    background: var(--ed-paper);
    border-radius: 999px;
    height: 5px;
}
.tp-shell .tp-bar-fill {
    background: linear-gradient(90deg, var(--ed-salmon), var(--ed-wine));
    border-radius: 999px;
}
.tp-shell .tp-bar-shimmer,
.tp-shell .tp-bar-particles {
    display: none;
}

/* Current phase card */
.tp-shell .tp-current {
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule);
    border-left: 2px solid var(--ed-salmon);
    border-radius: 2px;
    box-shadow: none;
}
.tp-shell .tp-current-icon {
    background: var(--ed-wash);
    color: var(--ed-wine);
    border: 1px solid rgba(196, 87, 106, 0.2);
}
.tp-shell .tp-current-name {
    font-family: var(--serif);
    font-weight: 500;
    color: var(--ed-ink);
}
.tp-shell .tp-current-desc { color: var(--ed-ink-3); }

/* Stat cells: hairline grid feel */
.tp-shell .tp-stats-grid {
    gap: 1px;
    background: var(--ed-rule);
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    overflow: hidden;
}
.tp-shell .tp-stat {
    background: var(--ed-cream);
    border: none;
    border-radius: 0;
    box-shadow: none;
    transition: background 240ms ease;
}
.tp-shell .tp-stat:hover {
    background: #fff;
    border-color: transparent;
}
.tp-shell .tp-stat-icon {
    background: transparent;
    color: var(--ed-ink-4);
    border: none;
    border-radius: 0;
}
.tp-shell .tp-stat-value {
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 400;
    letter-spacing: -0.02em;
    font-variant-numeric: lining-nums tabular-nums;
    color: var(--ed-ink);
}
.tp-shell .tp-stat-label {
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.16em;
    color: var(--ed-ink-4);
}
/* Hero stat ("Remaining") speaks in wine, no gradient */
.tp-shell .tp-stat-hero {
    background: var(--ed-wash-soft);
    border: none;
}
.tp-shell .tp-stat-hero .tp-stat-icon { color: var(--ed-wine); background: transparent; border: none; }
.tp-shell .tp-stat-hero .tp-stat-value { color: var(--ed-wine); }
.tp-shell .tp-stat-hero .tp-stat-label { color: var(--ed-wine); }

/* RiQ enhancement strip */
.tp-shell .riq-enhancement-section {
    background: var(--ed-slate-wash);
    border: 1px solid rgba(91, 110, 174, 0.25);
    border-left: 2px solid var(--ed-slate);
    border-radius: 2px;
}
.tp-shell .riq-label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ed-slate);
}
.tp-shell .riq-status {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    color: var(--ed-ink-3);
}

/* Footer */
.tp-shell .tp-footer {
    border-top: 1px solid var(--ed-rule);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: var(--ed-ink-4);
}
.tp-shell .tp-footer .tp-eta { color: var(--ed-ink-3); }
.tp-shell .tp-velocity strong {
    font-family: var(--mono);
    color: var(--ed-ink-2);
}


/* ============================================================
   §7 REVIEW SCREEN — masthead, method ledger, bank tabs,
      controls, transaction table, pagination
   ============================================================ */

/* The whole review sits on one white sheet — a document on the cream desk */
.review-interface .review-content-area {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: var(--ed-lift);
}

/* --- Masthead --- */
.review-interface .review-header {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ed-rule);
    border-radius: 0;
    box-shadow: none;
    padding: 26px 28px 22px;
    margin-bottom: 0;
}
.review-interface .review-header-content {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.review-interface .review-title {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1 1 380px;
    min-width: 0;
}
.review-interface .review-title-block {
    flex: 1;
    min-width: 0;
}
.review-interface .back-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 999px;
    color: var(--ed-ink-3);
    cursor: pointer;
    margin-top: 6px;
    transition: color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.review-interface .back-btn:hover {
    color: var(--ed-ink);
    border-color: var(--ed-rule-strong);
    transform: translateX(-2px);
}
.review-interface .review-title h2 {
    font-family: var(--serif);
    font-size: clamp(24px, 2.6vw, 34px);
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1.12;
    color: var(--ed-ink);
    margin: 0;
    background: none;
    -webkit-text-fill-color: currentColor;
}
.review-interface .review-title h2 .header-divider {
    display: none;
}
.review-interface .review-title h2 .client-name {
    display: block;
    font-style: italic;
    font-weight: 400;
    color: var(--ed-salmon);
    padding: 0.04em 0 0.08em;
}
.review-interface .review-subtitle {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    margin: 8px 0 0;
}
.review-interface .review-subtitle .subtitle-count {
    color: var(--ed-wine);
    font-variant-numeric: tabular-nums;
}

/* View toggle: mono editorial rail */
.review-interface .review-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.review-interface .review-view-toggle {
    display: inline-flex;
    flex: 0 1 auto;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ed-rule);
    border-radius: 0;
    padding: 0;
    gap: 2px;
    box-shadow: none;
}
.review-interface .view-toggle-btn {
    position: relative;
    flex: 0 0 auto;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 9px 13px 11px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    cursor: pointer;
    box-shadow: none;
    transition: color 200ms ease, background 200ms ease;
}
.review-interface .view-toggle-btn::after {
    content: '';
    position: absolute;
    left: 9px;
    right: 9px;
    bottom: -1px;
    height: 2px;
    background: var(--ed-salmon);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 260ms cubic-bezier(.2,.8,.2,1);
}
.review-interface .view-toggle-btn:hover:not(.active):not(:disabled) {
    color: var(--ed-ink);
    background: rgba(255, 255, 255, 0.7);
}
.review-interface .view-toggle-btn.active {
    background: transparent;
    color: var(--ed-ink);
    box-shadow: none;
}
.review-interface .view-toggle-btn.active::after {
    transform: scaleX(1);
}
.review-interface .view-toggle-btn:disabled {
    color: var(--ed-rule-strong);
    cursor: not-allowed;
}

/* --- Method ledger (stat pills → hairline strip) --- */
.review-interface .metrics-container {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0 28px;
    margin: 24px 0;
}
.review-interface .stats-pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    background: var(--ed-rule);
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    overflow: hidden;
    padding: 0;
    box-shadow: none;
}
.review-interface .stat-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 7px;
    flex: 1 1 128px;
    min-width: 0;
    min-height: 0;
    height: auto;
    background: var(--ed-cream);
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 15px 18px 13px;
    cursor: pointer;
    position: relative;
    text-align: left;
    animation: none;
    transition: background 240ms ease;
}
.review-interface .stat-pill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--ed-salmon);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 280ms cubic-bezier(.2,.8,.2,1);
}
.review-interface .stat-pill:hover {
    background: #fff;
    transform: none;
    box-shadow: none;
}
.review-interface .stat-pill.active {
    background: #fff;
    border: none;
    color: inherit;
    box-shadow: none;
}
.review-interface .stat-pill.active::before {
    transform: scaleX(1);
}
.review-interface .stat-pill .stat-count {
    font-family: var(--serif);
    font-size: 24px;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--ed-ink);
    font-variant-numeric: lining-nums tabular-nums;
    order: 2;
}
.review-interface .stat-pill .stat-label {
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    order: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.review-interface .stat-pill .stat-label::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ed-rule-strong);
    flex-shrink: 0;
}
.review-interface .stat-pill.stat-total .stat-label::before { background: var(--ed-ink); }
.review-interface .stat-pill[data-filter="historical"] .stat-label::before { background: var(--ed-wine); }
.review-interface .stat-pill[data-filter="universal_pattern"] .stat-label::before { background: var(--ed-salmon); }
.review-interface .stat-pill[data-filter="transfer_detection"] .stat-label::before { background: var(--ed-slate); }
.review-interface .stat-pill[data-filter="mcc_category_match"] .stat-label::before { background: var(--ed-gold); }
.review-interface .stat-pill[data-filter="semantic"] .stat-label::before { background: var(--ed-sage); }
.review-interface .stat-pill[data-filter="invoice_payment"] .stat-label::before,
.review-interface .stat-pill[data-filter="invoice"] .stat-label::before { background: var(--ed-teal); }
.review-interface .stat-pill[data-filter="riq_enhancement"] .stat-label::before { background: var(--ed-slate); }
.review-interface .stat-pill[data-filter="user_learning"] .stat-label::before { background: var(--ed-ink); }
.review-interface .stat-pill.active .stat-label {
    color: var(--ed-ink);
}

/* --- Transaction panel: flush section of the white sheet --- */
.review-interface .review-transaction-panel {
    background: transparent;
    border: none;
    border-top: 1px solid var(--ed-rule);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    margin: 0;
}

/* Bank account tabs: file tabs on a hairline */
.review-interface .bank-tabs-wrapper {
    background: var(--ed-cream);
    border-bottom: 1px solid var(--ed-rule);
    padding: 0 18px;
    border-radius: 0;
}
.review-interface .bank-account-tabs {
    display: flex;
    gap: 2px;
    background: transparent;
    border: none;
    padding: 0;
}
.review-interface .bank-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 13px 14px 14px;
    cursor: pointer;
    transition: color 200ms ease, background 200ms ease;
}
.review-interface .bank-tab::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -1px;
    height: 2px;
    background: var(--ed-salmon);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 260ms cubic-bezier(.2,.8,.2,1);
}
.review-interface .bank-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.7);
}
.review-interface .bank-tab.active {
    background: transparent;
    border: none;
    box-shadow: none;
}
.review-interface .bank-tab.active::after {
    transform: scaleX(1);
}
.review-interface .bank-tab .bank-tab-name {
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ed-ink-3);
    transition: color 200ms ease;
}
.review-interface .bank-tab.active .bank-tab-name {
    color: var(--ed-ink);
    font-weight: 600;
}
.review-interface .bank-tab .bank-tab-count {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    color: var(--ed-ink-4);
    background: transparent;
    border: none;
    padding: 0;
    font-variant-numeric: tabular-nums;
}
.review-interface .bank-tab.active .bank-tab-count {
    color: var(--ed-wine);
    background: transparent;
}

/* --- Controls row: search, filters, group, RiQ --- */
.review-interface .review-controls-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ed-rule-soft);
    border-radius: 0;
    box-shadow: none;
    padding: 14px 18px;
    margin: 0;
}
.review-interface .search-container {
    position: relative;
}
.review-interface .transaction-search-input {
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    padding: 8px 34px 8px 12px;
    font-family: var(--sans);
    font-size: 13px;
    color: var(--ed-ink);
    box-shadow: none;
    transition: border-color 180ms ease, background 180ms ease;
}
.review-interface .transaction-search-input::placeholder {
    color: var(--ed-ink-4);
}
.review-interface .transaction-search-input:focus {
    background: #fff;
    border-color: var(--ed-salmon);
    box-shadow: none;
    outline: none;
}
.review-interface .search-container .search-icon {
    color: var(--ed-ink-4);
}
.review-interface .selection-counter {
    background: var(--ed-wash);
    border: none;
    border-radius: 999px;
    padding: 5px 12px;
    box-shadow: none;
}
.review-interface .selection-counter .counter-text {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ed-wine);
}
.review-interface .selection-counter .counter-value {
    font-variant-numeric: tabular-nums;
}
.review-interface .filter-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
}
.review-interface .search-and-filters {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}
.review-interface .transaction-filter-select {
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    padding: 8px 28px 8px 10px;
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ed-ink-2);
    box-shadow: none;
    cursor: pointer;
    transition: border-color 180ms ease, background 180ms ease;
}
.review-interface .transaction-filter-select:hover {
    border-color: var(--ed-rule-strong);
    background: #fff;
}
.review-interface .transaction-filter-select:focus {
    border-color: var(--ed-salmon);
    box-shadow: none;
    outline: none;
}
.review-interface .btn-group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    padding: 8px 14px;
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ed-ink-2);
    cursor: pointer;
    box-shadow: none;
    transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}
.review-interface .btn-group-toggle:hover {
    border-color: var(--ed-rule-strong);
    color: var(--ed-ink);
    background: var(--ed-ivory);
}
.review-interface .btn-group-toggle.active {
    background: var(--ed-ink);
    border-color: var(--ed-ink);
    color: var(--ed-cream);
}
.review-interface .btn-analyse-riq {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ed-slate-wash);
    border: 1px solid rgba(91, 110, 174, 0.3);
    border-radius: 999px;
    padding: 8px 16px;
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ed-slate);
    cursor: pointer;
    box-shadow: none;
    transition: border-color 200ms ease, background 200ms ease, transform 200ms ease;
}
.review-interface .btn-analyse-riq:hover {
    background: #fff;
    border-color: var(--ed-slate);
    transform: translateY(-1px);
    box-shadow: none;
}
.review-interface .btn-analyse-riq img {
    width: 18px;
    height: 18px;
}

/* --- The table --- */
.review-interface .review-table-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}
.review-interface .review-table-container {
    background: #fff;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.review-interface .transaction-table thead th,
.review-interface .transactions-table thead th {
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    background: var(--ed-cream);
    border-bottom: 1px solid var(--ed-rule);
    text-shadow: none;
}
.review-interface .sortable-header:hover {
    background: var(--ed-ivory);
    color: var(--ed-ink);
}
.review-interface .sort-indicator {
    color: var(--ed-rule-strong);
    font-size: 9px;
}
.review-interface .sortable-header.sort-asc .sort-indicator,
.review-interface .sortable-header.sort-desc .sort-indicator {
    color: var(--ed-wine);
}

.review-interface .transaction-row td {
    border-bottom: 1px solid var(--ed-rule-soft);
    background: #fff;
}
.review-interface .transaction-row:hover td {
    background: var(--ed-cream);
}
.review-interface .transaction-row.selected td {
    background: var(--ed-wash-soft);
}

.review-interface .date-cell {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.02em;
    color: var(--ed-ink-3);
    font-variant-numeric: tabular-nums;
}
.review-interface .description-cell {
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ed-ink);
}
.review-interface .amount-cell {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}
.review-interface .amount-cell.negative {
    color: var(--ed-ink-2);
}
.review-interface .amount-cell.positive {
    color: var(--ed-sage);
}

/* In-cell selects: quiet until engaged */
.review-interface select.account-select,
.review-interface select.vat-select,
.review-interface .account-select,
.review-interface .vat-select {
    background: transparent;
    border: 1px solid transparent;
    border-bottom: 1px solid var(--ed-rule-soft);
    border-radius: 0;
    font-family: var(--sans);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ed-ink-2);
    box-shadow: none;
    cursor: pointer;
    transition: border-color 180ms ease, background 180ms ease;
}
.review-interface select.account-select:hover,
.review-interface select.vat-select:hover,
.review-interface .account-select:hover,
.review-interface .vat-select:hover {
    background: #fff;
    border-color: var(--ed-rule);
    border-bottom-color: var(--ed-rule);
}
.review-interface select.account-select:focus,
.review-interface select.vat-select:focus,
.review-interface .account-select:focus,
.review-interface .vat-select:focus {
    background: #fff;
    border-color: var(--ed-salmon);
    box-shadow: none;
    outline: none;
}
.review-interface .account-select.invoice-mode {
    border-bottom-color: rgba(58, 110, 120, 0.4);
    color: var(--ed-teal);
}

/* Confidence: mono figure with a state dot, not a filled pill */
.review-interface .confidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    box-shadow: none;
}
.review-interface .confidence-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}
.review-interface .confidence-badge.confidence-high {
    color: var(--ed-sage);
    background: transparent;
}
.review-interface .confidence-badge.confidence-high::before { background: var(--ed-sage); }
.review-interface .confidence-badge.confidence-medium {
    color: var(--ed-gold);
    background: transparent;
}
.review-interface .confidence-badge.confidence-medium::before { background: var(--ed-gold); }
.review-interface .confidence-badge.confidence-low {
    color: var(--ed-rust);
    background: transparent;
}
.review-interface .confidence-badge.confidence-low::before { background: var(--ed-rust); }

/* Method badges: mono micro-tags, wash + ink of their method */
.review-interface .method-badge {
    display: inline-block;
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 2px;
    border: none;
    background: var(--ed-ivory);
    color: var(--ed-ink-3);
    box-shadow: none;
    white-space: nowrap;
}
.review-interface .method-badge.method-historical,
.review-interface .method-badge.method-historical_pattern {
    background: var(--ed-wash);
    color: var(--ed-wine);
}
.review-interface .method-badge.method-universal_pattern,
.review-interface .method-badge.method-universal {
    background: var(--ed-wash-soft);
    color: var(--ed-salmon);
}
.review-interface .method-badge.method-transfer_detection,
.review-interface .method-badge.method-savings_pot {
    background: var(--ed-slate-wash);
    color: var(--ed-slate);
}
.review-interface .method-badge.method-mcc_category_match,
.review-interface .method-badge.method-merchant_precoded {
    background: var(--ed-gold-wash);
    color: var(--ed-gold);
}
.review-interface .method-badge.method-semantic {
    background: var(--ed-sage-wash);
    color: var(--ed-sage);
}
.review-interface .method-badge[class*="method-invoice"] {
    background: var(--ed-teal-wash);
    color: var(--ed-teal);
}
.review-interface .method-badge.method-user_learning,
.review-interface .method-badge.method-user_learning_override,
.review-interface .method-badge.method-manual {
    background: var(--ed-ink);
    color: var(--ed-cream);
}
.review-interface .method-badge.method-riq_enhancement,
.review-interface .method-badge.method-riq {
    background: var(--ed-slate-wash);
    color: var(--ed-slate);
}

/* Type badges: quiet direction chips */
.review-interface .transaction-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--ed-rule);
    background: #fff;
    color: var(--ed-ink-3);
    box-shadow: none;
    white-space: nowrap;
    transition: border-color 180ms ease;
}
.review-interface .transaction-type-badge.clickable:hover {
    border-color: var(--ed-rule-strong);
}
.review-interface .transaction-type-badge.type-money-in {
    border-color: rgba(74, 124, 74, 0.35);
    color: var(--ed-sage);
    background: var(--ed-sage-wash);
}
.review-interface .transaction-type-badge.type-money-out {
    border-color: var(--ed-rule);
    color: var(--ed-ink-2);
    background: var(--ed-ivory);
}
.review-interface .transaction-type-badge.type-transfer {
    border-color: rgba(91, 110, 174, 0.35);
    color: var(--ed-slate);
    background: var(--ed-slate-wash);
}
.review-interface .transaction-type-badge.type-unknown {
    border-style: dashed;
}

/* Checkboxes: warm accent */
.review-interface input[type="checkbox"] {
    accent-color: var(--ed-wine);
}
.review-interface .riq-flag-star {
    color: var(--ed-gold);
}

/* FX rate cell */
.review-interface .conversion-rate-cell {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ed-ink-4);
    font-variant-numeric: tabular-nums;
}

/* Scroll shadows: soften to warm ink */
.review-interface .scroll-shadow.left {
    background: linear-gradient(90deg, rgba(26, 22, 18, 0.06), transparent);
}
.review-interface .scroll-shadow.right {
    background: linear-gradient(270deg, rgba(26, 22, 18, 0.06), transparent);
}

/* --- Pagination: mono ledger footer --- */
.review-interface .review-pagination {
    background: var(--ed-cream);
    border: none;
    border-top: 1px solid var(--ed-rule);
    border-radius: 0;
    box-shadow: none;
    padding: 12px 18px;
    margin: 0;
}
.review-interface .pagination-info {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    font-variant-numeric: tabular-nums;
}
.review-interface .pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.review-interface .pagination-btn,
.review-interface .review-pagination .pagination-btn {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 999px;
    padding: 6px 14px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--ed-ink-2);
    cursor: pointer;
    box-shadow: none;
    transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}
.review-interface .pagination-btn:hover:not(:disabled),
.review-interface .review-pagination .pagination-btn:hover:not(:disabled) {
    border-color: var(--ed-rule-strong);
    color: var(--ed-ink);
    background: var(--ed-ivory);
    transform: none;
}
.review-interface .pagination-btn:disabled,
.review-interface .review-pagination .pagination-btn:disabled {
    color: var(--ed-rule-strong);
    cursor: not-allowed;
}
.review-interface .pagination-current,
.review-interface .review-pagination .pagination-current {
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ed-wine);
    background: var(--ed-wash);
    border-radius: 999px;
    min-width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

/* Grouped rows (Group mode) */
.review-interface .group-header-row td {
    background: var(--ed-ivory);
    border-bottom: 1px solid var(--ed-rule);
}
.review-interface .group-count-badge {
    font-family: var(--mono);
    font-size: 9px;
    background: var(--ed-wash);
    color: var(--ed-wine);
    border-radius: 999px;
    padding: 2px 8px;
    font-variant-numeric: tabular-nums;
}

/* Review header action buttons (mirror global .action-btn treatment) */
.review-interface .action-btn {
    border-radius: 2px;
    font-weight: 500;
    box-shadow: none;
}
.review-interface .action-btn.secondary {
    background: #fff;
    color: var(--ed-ink-2);
    border: 1px solid var(--ed-rule);
}
.review-interface .action-btn.secondary:hover {
    background: var(--ed-ivory);
    color: var(--ed-ink);
    border-color: var(--ed-rule-strong);
}
.review-interface .action-btn.success {
    background: var(--ed-sage-deep);
    color: #fff;
    border: 1px solid var(--ed-sage-deep);
}
.review-interface .action-btn.success:hover {
    background: var(--ed-sage);
    border-color: var(--ed-sage);
    box-shadow: 0 8px 20px -12px var(--ed-sage);
}
.review-interface .action-btn.primary {
    background: var(--ed-ink);
    color: var(--ed-cream);
    border: 1px solid var(--ed-ink);
}
.review-interface .action-btn.primary:hover {
    background: var(--ed-wine);
    border-color: var(--ed-wine);
}

/* Search field icon (TabManager markup: .search-container > .search-icon) */
.review-interface .search-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.review-interface .search-container .search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    color: var(--ed-ink-4);
    pointer-events: none;
}
.review-interface .search-container .transaction-search-input {
    padding: 8px 34px 8px 12px;
}


/* ============================================================
   §8 PANELS — accounts, transfers, VAT audit, invoices
   ============================================================ */

.review-interface .vat-audit-panel,
.review-interface .account-summary-panel,
.review-interface .transfers-panel,
.review-interface .invoices-panel {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* --- Accounts view --- */
.review-interface .acct-summary-header {
    border-bottom: 1px solid var(--ed-rule);
}
.review-interface .acct-summary-title {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
}
.review-interface .acct-summary-subtitle {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    color: var(--ed-ink-3);
}
.review-interface .acct-total-label {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
}
.review-interface .acct-total-value {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
    font-variant-numeric: lining-nums tabular-nums;
}
.review-interface .acct-search,
.review-interface .acct-sort {
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    font-family: var(--sans);
    box-shadow: none;
}
.review-interface .acct-search:focus,
.review-interface .acct-sort:focus {
    background: #fff;
    border-color: var(--ed-salmon);
    box-shadow: none;
    outline: none;
}
.review-interface .acct-insight-chip {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 999px;
    box-shadow: none;
}
.review-interface .acct-insight-label {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
}
.review-interface .acct-type-header {
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule);
    border-radius: 2px 2px 0 0;
}
.review-interface .acct-type-header:hover {
    background: var(--ed-ivory);
}
.review-interface .acct-type-name {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ed-ink-2);
}
.review-interface .acct-type-count {
    font-family: var(--mono);
    font-size: 9.5px;
    background: var(--ed-wash);
    color: var(--ed-wine);
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}
.review-interface .acct-type-total {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    color: var(--ed-ink-2);
}
.review-interface .acct-card {
    background: #fff;
    border-left: 2px solid transparent;
    border-bottom: 1px solid var(--ed-rule-soft);
    border-right: 1px solid var(--ed-rule);
    transition: background 200ms ease, border-left-color 200ms ease;
}
.review-interface .acct-card:hover {
    background: var(--ed-cream);
    border-left-color: var(--ed-salmon);
    box-shadow: none;
    transform: none;
}
.review-interface .acct-card-name {
    font-family: var(--sans);
    font-weight: 500;
    color: var(--ed-ink);
}
.review-interface .acct-card-code {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--ed-ink-4);
}
.review-interface .acct-card-total {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--ed-ink);
    font-variant-numeric: lining-nums tabular-nums;
}
.review-interface .acct-card-txns,
.review-interface .acct-card-confidence {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ed-ink-4);
    font-variant-numeric: tabular-nums;
}
.review-interface .acct-card-bar {
    background: var(--ed-paper);
    border-radius: 999px;
    overflow: hidden;
}
.review-interface .acct-card-bar-fill {
    background: linear-gradient(90deg, var(--ed-salmon), var(--ed-wine));
    border-radius: 999px;
}
.review-interface .acct-uncoded-warning {
    background: var(--ed-gold-wash);
    border: 1px solid rgba(138, 98, 26, 0.3);
    border-left: 2px solid var(--ed-gold);
    border-radius: 2px;
}
.review-interface .acct-uncoded-btn {
    background: var(--ed-ink);
    color: var(--ed-cream);
    border: 1px solid var(--ed-ink);
    border-radius: 2px;
    transition: background 200ms ease;
}
.review-interface .acct-uncoded-btn:hover {
    background: var(--ed-wine);
    border-color: var(--ed-wine);
}

/* --- Transfers view --- */
.review-interface .transfers-overview {
    background: var(--ed-ink);
    border-radius: 2px;
    padding: 20px 24px;
}
.review-interface .transfers-overview-heading {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--ed-cream);
}
.review-interface .transfers-overview-label {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(250, 248, 245, 0.6);
}
.review-interface .transfers-overview-stat {
    font-family: var(--serif);
    font-weight: 400;
    color: #fff;
    font-variant-numeric: lining-nums tabular-nums;
}
.review-interface .transfer-pair-card {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    transition: border-color 240ms ease, transform 300ms cubic-bezier(.2,.8,.2,1);
}
.review-interface .transfer-pair-card:hover {
    border-color: var(--ed-ink);
    box-shadow: none;
    transform: translateY(-2px);
}
.review-interface .transfer-pair-amount {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--ed-ink);
    font-variant-numeric: lining-nums tabular-nums;
}
.review-interface .transfer-pair-meta {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    color: var(--ed-ink-4);
}
.review-interface .transfer-side {
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule-soft);
    border-radius: 2px;
}
.review-interface .transfer-side-label {
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
}
.review-interface .transfer-side-bank {
    font-family: var(--sans);
    font-weight: 600;
    color: var(--ed-ink);
}
.review-interface .transfer-side-desc {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--ed-ink-3);
}
.review-interface .transfer-arrow {
    color: var(--ed-slate);
    font-family: var(--mono);
}
.review-interface .transfer-pair-status {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-radius: 999px;
}
.review-interface .transfer-status-dot {
    background: var(--ed-slate);
}
.review-interface .transfers-empty,
.review-interface .acct-empty,
.review-interface .vat-empty {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    color: var(--ed-ink-3);
}

/* --- VAT audit view --- */
.review-interface .vat-audit-sidebar {
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
}
.review-interface .vat-sidebar-header {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    border-bottom: 1px solid var(--ed-rule);
}
.review-interface .vat-box {
    background: #fff;
    border: 1px solid var(--ed-rule-soft);
    border-radius: 2px;
}
.review-interface .vat-box-label {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
}
.review-interface .vat-box-value {
    font-family: var(--serif);
    font-weight: 400;
    color: var(--ed-ink);
    font-variant-numeric: lining-nums tabular-nums;
}
.review-interface .vat-chip {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    transition: border-color 200ms ease;
}
.review-interface .vat-chip:hover {
    border-color: var(--ed-rule-strong);
}
.review-interface .vat-chip-code {
    font-family: var(--mono);
    font-weight: 500;
    color: var(--ed-wine);
}
.review-interface .vat-chip-name {
    color: var(--ed-ink-2);
}
.review-interface .vat-chip-amount,
.review-interface .vat-chip-count {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    color: var(--ed-ink-3);
}
.review-interface .vat-filter-pill {
    border-radius: 999px;
    border: 1px solid var(--ed-rule);
    background: #fff;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    transition: all 180ms ease;
}
.review-interface .vat-filter-pill:hover {
    border-color: var(--ed-rule-strong);
    color: var(--ed-ink);
}
.review-interface .vat-filter-pill.active {
    background: var(--ed-ink);
    border-color: var(--ed-ink);
    color: var(--ed-cream);
}
.review-interface .vat-group-card,
.review-interface .vat-exception-card {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: none;
    transition: border-color 240ms ease;
}
.review-interface .vat-group-card:hover,
.review-interface .vat-exception-card:hover {
    border-color: var(--ed-rule-strong);
}
.review-interface .vat-group-title {
    font-family: var(--sans);
    font-weight: 600;
    color: var(--ed-ink);
}
.review-interface .vat-group-account {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ed-ink-4);
}
.review-interface .vat-group-pill {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: 2px;
    background: var(--ed-wash);
    color: var(--ed-wine);
}
.review-interface .vat-group-sample-row {
    border-bottom: 1px solid var(--ed-rule-soft);
}
.review-interface .vat-group-sample-desc {
    color: var(--ed-ink-2);
}
.review-interface .vat-group-sample-amount {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    color: var(--ed-ink-3);
}
.review-interface .vat-group-apply-btn,
.review-interface .vat-exc-resolve {
    background: var(--ed-ink);
    color: var(--ed-cream);
    border: 1px solid var(--ed-ink);
    border-radius: 2px;
    font-weight: 500;
    transition: background 200ms ease, border-color 200ms ease;
}
.review-interface .vat-group-apply-btn:hover,
.review-interface .vat-exc-resolve:hover {
    background: var(--ed-wine);
    border-color: var(--ed-wine);
}
.review-interface .vat-exc-dismiss {
    background: transparent;
    color: var(--ed-ink-3);
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    transition: all 180ms ease;
}
.review-interface .vat-exc-dismiss:hover {
    color: var(--ed-ink);
    border-color: var(--ed-rule-strong);
    background: var(--ed-ivory);
}
.review-interface .vat-return-preview {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
}
.review-interface .vat-return-header {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    border-bottom: 1px solid var(--ed-rule-soft);
}
.review-interface .vat-return-disclaimer {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    color: var(--ed-ink-4);
}
.review-interface .vat-worklist-summary {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--ed-ink-3);
}
.review-interface .vat-audit-search {
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: none;
}
.review-interface .vat-audit-search:focus {
    background: #fff;
    border-color: var(--ed-salmon);
    outline: none;
    box-shadow: none;
}

/* --- Invoices panel + txn picker cards --- */
.review-interface .invoice-txn-picker-modal,
.review-interface .invoice-adjustment-modal {
    border-radius: 2px;
    border: 1px solid var(--ed-rule);
    box-shadow: var(--ed-lift-lg);
}
.review-interface .invoice-txn-picker-header,
.review-interface .invoice-adjustment-header {
    border-bottom: 1px solid var(--ed-rule);
}
.review-interface .invoice-txn-picker-title,
.review-interface .invoice-adjustment-title {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--ed-ink);
}
.review-interface .invoice-txn-picker-item {
    border: 1px solid var(--ed-rule-soft);
    border-radius: 2px;
    transition: border-color 180ms ease, background 180ms ease;
}
.review-interface .invoice-txn-picker-item:hover {
    background: var(--ed-cream);
    border-color: var(--ed-rule-strong);
}
.review-interface .invoice-txn-amount {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
}
.review-interface .invoice-txn-match-pill {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: 999px;
    background: var(--ed-teal-wash);
    color: var(--ed-teal);
}


/* ============================================================
   §9 MODALS — one frame language for every dialog
   ============================================================ */

/* Overlay: warm ink, gentle blur */
.codeiq-modal-overlay,
.modal-overlay,
.mapping-modal-overlay,
.codeiq-validation-modal-overlay,
.posting-completion-modal-overlay {
    background: rgba(26, 22, 18, 0.45) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* Frame */
.codeiq-modal {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px !important;
    box-shadow: var(--ed-lift-lg) !important;
}
.codeiq-modal-header {
    border-bottom: 1px solid var(--ed-rule-soft);
}
.codeiq-modal-title {
    font-family: var(--serif) !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    letter-spacing: -0.02em;
    color: var(--ed-ink) !important;
}
.codeiq-modal-message {
    color: var(--ed-ink-2);
    line-height: 1.55;
}
.codeiq-modal-close {
    background: transparent;
    border: 1px solid var(--ed-rule);
    border-radius: 999px;
    color: var(--ed-ink-3);
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.codeiq-modal-close:hover {
    color: var(--ed-ink);
    border-color: var(--ed-rule-strong);
    background: var(--ed-ivory);
}
.codeiq-modal-footer {
    border-top: 1px solid var(--ed-rule-soft);
}
.codeiq-modal-input {
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    background: var(--ed-cream);
    font-family: var(--sans);
    transition: border-color 180ms ease, background 180ms ease;
}
.codeiq-modal-input:focus {
    background: #fff;
    border-color: var(--ed-salmon);
    box-shadow: none;
    outline: none;
}

/* Modal buttons (both naming generations) */
.codeiq-modal-btn,
.codeiq-button {
    border-radius: 2px !important;
    font-family: var(--sans) !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em;
    box-shadow: none !important;
    text-transform: none !important;
    transition: background 200ms ease, color 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.codeiq-modal-btn-primary,
.codeiq-button-primary {
    background: var(--ed-ink) !important;
    color: var(--ed-cream) !important;
    border: 1px solid var(--ed-ink) !important;
}
.codeiq-modal-btn-primary:hover,
.codeiq-button-primary:hover {
    background: var(--ed-wine) !important;
    border-color: var(--ed-wine) !important;
    transform: translateY(-1px);
}
.codeiq-modal-btn-cancel,
.codeiq-modal-btn-secondary,
.codeiq-button-secondary {
    background: #fff !important;
    color: var(--ed-ink-2) !important;
    border: 1px solid var(--ed-rule) !important;
}
.codeiq-modal-btn-cancel:hover,
.codeiq-modal-btn-secondary:hover,
.codeiq-button-secondary:hover {
    background: var(--ed-ivory) !important;
    color: var(--ed-ink) !important;
    border-color: var(--ed-rule-strong) !important;
}
.codeiq-button-success {
    background: var(--ed-sage-deep) !important;
    color: #fff !important;
    border: 1px solid var(--ed-sage-deep) !important;
}
.codeiq-button-success:hover {
    background: var(--ed-sage) !important;
    border-color: var(--ed-sage) !important;
}

/* --- Low-confidence review modal --- */
.low-confidence-modal .codeiq-modal-header {
    background: #fff;
    border-bottom: 1px solid var(--ed-rule);
}
.low-confidence-modal .transaction-card {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: none;
}
.low-confidence-modal .transaction-card.critical {
    border-left: 2px solid var(--ed-rust);
}
.low-confidence-modal .transaction-card.warning {
    border-left: 2px solid var(--ed-gold);
}
.low-confidence-modal .transaction-card.corrected {
    border-left: 2px solid var(--ed-sage);
    background: var(--ed-sage-wash);
}
.low-confidence-modal .modal-account-dropdown {
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    background: var(--ed-cream);
}
.low-confidence-modal .modal-account-dropdown:focus {
    border-color: var(--ed-salmon);
    background: #fff;
    box-shadow: none;
}

/* --- RiQ analysis modal: RiQ speaks in slate --- */
.riq-analysis-modal .codeiq-modal-header,
.riq-analysis-modal .riq-header {
    background: #fff;
    border-bottom: 1px solid var(--ed-rule);
}
.riq-analysis-modal .riq-transaction-card {
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
}
.riq-analysis-modal .riq-reasoning {
    background: var(--ed-slate-wash);
    border: 1px solid rgba(91, 110, 174, 0.25);
    border-left: 2px solid var(--ed-slate);
    border-radius: 2px;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    color: var(--ed-ink-2);
}
.riq-analysis-modal .chat-message.riq {
    background: var(--ed-slate-wash);
    border-radius: 2px;
}
.riq-analysis-modal .chat-message.user {
    background: var(--ed-ivory);
    border-radius: 2px;
}
.riq-analysis-modal .chat-input-area textarea,
.riq-analysis-modal .chat-input-area input {
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    background: var(--ed-cream);
}
.riq-analysis-modal .chat-input-area textarea:focus,
.riq-analysis-modal .chat-input-area input:focus {
    border-color: var(--ed-slate);
    background: #fff;
    box-shadow: none;
    outline: none;
}

/* --- Posting completion modal --- */
.posting-completion-modal {
    border-radius: 2px !important;
    border: 1px solid var(--ed-rule);
    box-shadow: var(--ed-lift-lg) !important;
    overflow: hidden;
}
.posting-completion-modal .posting-modal-header {
    background: #fff !important;
    border-bottom: 1px solid var(--ed-rule);
    color: var(--ed-ink) !important;
}
.posting-completion-modal .posting-modal-header h2,
.posting-completion-modal .posting-modal-header h3 {
    font-family: var(--serif) !important;
    font-weight: 400 !important;
    letter-spacing: -0.02em;
    color: var(--ed-ink) !important;
}
.posting-completion-modal .stat-item {
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule-soft);
    border-radius: 2px;
}
.posting-completion-modal .stat-item .stat-value {
    font-family: var(--serif);
    font-weight: 400;
    color: var(--ed-ink);
}
.posting-completion-modal .stat-item .stat-label {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
}
.posting-completion-modal .guidance-section {
    background: var(--ed-ivory);
    border: none;
    border-left: 2px solid var(--ed-rule-strong);
    border-radius: 0;
}
.posting-completion-modal .btn-primary {
    background: var(--ed-ink) !important;
    color: var(--ed-cream) !important;
    border: 1px solid var(--ed-ink) !important;
    border-radius: 2px !important;
    box-shadow: none !important;
}
.posting-completion-modal .btn-primary:hover {
    background: var(--ed-wine) !important;
    border-color: var(--ed-wine) !important;
}

/* --- Persistent / posting center --- */
.persistent-center-container {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: var(--ed-lift);
}
.persistent-center-container .center-content {
    background: transparent;
}
.persistent-center-container .session-status {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.persistent-center-container .btn-link {
    color: var(--ed-wine);
    text-decoration: none;
}
.persistent-center-container .btn-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- Session creation modal (index.html) --- */
#session-modal .modal-content {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px !important;
    box-shadow: var(--ed-lift-lg) !important;
}
#session-modal .modal-header h3 {
    font-family: var(--serif) !important;
    font-size: 24px !important;
    font-weight: 400 !important;
    letter-spacing: -0.02em;
    color: var(--ed-ink) !important;
}
#session-modal .form-group label {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
}
#session-modal .form-group select {
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    background: var(--ed-cream);
}
#session-modal .form-group select:focus {
    border-color: var(--ed-salmon);
    background: #fff;
    box-shadow: none;
}
#session-modal .info-card {
    background: var(--ed-ivory);
    border: none;
    border-left: 2px solid var(--ed-rule-strong);
    border-radius: 0;
}
#session-modal .connection-status {
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
}
#session-modal .connect-btn {
    background: var(--ed-ink);
    color: var(--ed-cream);
    border-radius: 2px;
    font-weight: 500;
}
#session-modal .connect-btn:hover:not(:disabled) {
    background: var(--ed-wine);
}

/* --- Mapping modal (index.html markup + mapping.css) --- */
.mapping-modal-container {
    background: #fff !important;
    border: 1px solid var(--ed-rule);
    border-radius: 2px !important;
    box-shadow: var(--ed-lift-lg) !important;
}
.mapping-modal-header h2 {
    font-family: var(--serif) !important;
    font-weight: 400 !important;
    letter-spacing: -0.02em;
    color: var(--ed-ink) !important;
}
.mapping-modal-header p {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    color: var(--ed-ink-3);
}
.mapping-toggle-button {
    border-radius: 999px !important;
    border: 1px solid var(--ed-rule) !important;
    background: #fff !important;
    color: var(--ed-ink-2) !important;
    font-family: var(--mono) !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    box-shadow: none !important;
    transition: all 180ms ease;
}
.mapping-toggle-button:hover {
    border-color: var(--ed-rule-strong) !important;
    color: var(--ed-ink) !important;
}
.mapping-toggle-button.active,
.mapping-toggle-button.selected {
    background: var(--ed-ink) !important;
    border-color: var(--ed-ink) !important;
    color: var(--ed-cream) !important;
}
.mapping-confirm-mapping {
    background: var(--ed-ink) !important;
    color: var(--ed-cream) !important;
    border: 1px solid var(--ed-ink) !important;
    border-radius: 2px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    transition: background 200ms ease, transform 200ms ease;
}
.mapping-confirm-mapping:hover {
    background: var(--ed-wine) !important;
    border-color: var(--ed-wine) !important;
    transform: translateY(-1px);
}
.mapping-instruction {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    color: var(--ed-ink-2);
}

/* --- Validation warning modal (index.html) --- */
.codeiq-validation-modal-container {
    border: 1px solid var(--ed-rule) !important;
    border-radius: 2px !important;
    box-shadow: var(--ed-lift-lg) !important;
}
.codeiq-validation-modal-header {
    background: #fff !important;
    border-bottom: 1px solid var(--ed-rule) !important;
}
.codeiq-validation-modal-header h2 {
    font-family: var(--serif) !important;
    font-weight: 400 !important;
    color: var(--ed-ink) !important;
    letter-spacing: -0.02em;
}
.codeiq-validation-modal-header p {
    font-family: var(--serif) !important;
    font-style: italic;
    font-weight: 300 !important;
    color: var(--ed-ink-3) !important;
    opacity: 1 !important;
}
.codeiq-validation-modal-avatar {
    background: #fff !important;
    padding: 6px 20px !important;
}
.codeiq-validation-modal-avatar img {
    animation: none !important;
    filter: none !important;
}
.codeiq-validation-item {
    border-radius: 2px !important;
    box-shadow: none !important;
    border: 1px solid var(--ed-rule) !important;
    border-left-width: 2px !important;
}
.codeiq-validation-item.error {
    border-left-color: var(--ed-rust) !important;
    background: var(--ed-rust-wash) !important;
}
.codeiq-validation-item.warning {
    border-left-color: var(--ed-gold) !important;
    background: var(--ed-gold-wash) !important;
}
.codeiq-validation-help-box {
    background: var(--ed-ivory) !important;
    border: none !important;
    border-left: 2px solid var(--ed-rule-strong) !important;
    border-radius: 0 !important;
}
.codeiq-validation-help-box h3,
.codeiq-validation-help-box p,
.codeiq-validation-help-box ul,
.codeiq-validation-help-box strong {
    color: var(--ed-ink-2) !important;
}
.codeiq-validation-btn-secondary,
.codeiq-validation-btn-primary {
    border-radius: 2px !important;
    text-transform: none !important;
    letter-spacing: 0.01em !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}
.codeiq-validation-btn-primary {
    background: var(--ed-ink) !important;
    color: var(--ed-cream) !important;
}
.codeiq-validation-btn-primary:hover {
    background: var(--ed-wine) !important;
    transform: translateY(-1px) !important;
}
.codeiq-validation-btn-secondary {
    background: #fff !important;
    color: var(--ed-ink-2) !important;
    border: 1px solid var(--ed-rule) !important;
}
.codeiq-validation-btn-secondary:hover {
    background: var(--ed-ivory) !important;
    color: var(--ed-ink) !important;
    border-color: var(--ed-rule-strong) !important;
}

/* --- Statement (merchant) mapping sheet --- */
.stmt-map {
    border-radius: 2px !important;
    border: 1px solid var(--ed-rule);
    box-shadow: var(--ed-lift-lg) !important;
}
.stmt-btn-primary {
    background: var(--ed-ink) !important;
    color: var(--ed-cream) !important;
    border-radius: 2px !important;
}
.stmt-btn-primary:hover {
    background: var(--ed-wine) !important;
}
.stmt-ai-chip {
    border-radius: 999px !important;
    background: var(--ed-slate-wash) !important;
    color: var(--ed-slate) !important;
    border: 1px solid rgba(91, 110, 174, 0.3) !important;
}


/* ============================================================
   §10 TOASTS, FOOTER, SPLASH
   ============================================================ */

/* Toasts: quiet editorial slips */
.toast {
    background: #fff !important;
    border: 1px solid var(--ed-rule) !important;
    border-left-width: 2px !important;
    border-radius: 2px !important;
    box-shadow: var(--ed-lift) !important;
    font-family: var(--sans);
}
.toast-success { border-left-color: var(--ed-sage) !important; }
.toast-error   { border-left-color: var(--ed-rust) !important; }
.toast-warning { border-left-color: var(--ed-gold) !important; }
.toast-info    { border-left-color: var(--ed-slate) !important; }
.toast .toast-icon {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
}
.toast .toast-message {
    color: var(--ed-ink);
    font-size: 13px;
}

/* Footer product shortcuts (injected below RiQ) */
#codeiq-footer .product-shortcuts {
    border-top: 1px solid var(--ed-rule);
    background: var(--ed-cream);
}
#codeiq-footer .ps-eyebrow {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
}
#codeiq-footer .product-shortcut {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}
#codeiq-footer .product-shortcut:hover {
    background: #fff;
    border-color: var(--ed-rule);
    transform: translateY(-1px);
}
#codeiq-footer .ps-mark {
    font-family: var(--serif);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
}
#codeiq-footer .ps-mark em {
    font-style: italic;
    font-weight: 400;
}
#codeiq-footer .product-shortcut-tagline {
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
}

/* Splash: keep the ceremony, warm the light */
.codeiq-splash {
    background: var(--ed-cream) !important;
}
.codeiq-splash .aurora-layer {
    opacity: 0.5 !important;
    mix-blend-mode: multiply;
}
.codeiq-splash .splash-tagline {
    font-family: var(--serif) !important;
    font-style: italic;
    font-weight: 300 !important;
    font-size: clamp(17px, 2vw, 22px) !important;
    letter-spacing: -0.01em !important;
    color: var(--ed-ink-2) !important;
    text-transform: none !important;
}
.codeiq-splash .micro-row {
    font-family: var(--mono) !important;
    background: rgba(255, 255, 255, 0.75) !important;
    border: 1px solid var(--ed-rule) !important;
    border-radius: 2px !important;
    box-shadow: none !important;
    color: var(--ed-ink-2) !important;
}
.codeiq-splash .micro-desc { color: var(--ed-ink-2) !important; }
.codeiq-splash .micro-arrow { color: var(--ed-salmon) !important; }
.codeiq-splash .micro-account { color: var(--ed-wine) !important; }
.codeiq-splash .micro-check { color: var(--ed-sage) !important; }
.codeiq-splash .micro-summary .summary-count {
    font-family: var(--serif) !important;
    font-weight: 400 !important;
    color: var(--ed-wine) !important;
}
.codeiq-splash .micro-summary .summary-label {
    font-family: var(--mono) !important;
    font-size: 10px !important;
    letter-spacing: 0.18em !important;
    text-transform: uppercase !important;
    color: var(--ed-ink-3) !important;
}
.codeiq-splash .workflow-step .step-icon {
    background: #fff !important;
    border: 1px solid var(--ed-rule) !important;
    color: var(--ed-wine) !important;
    box-shadow: none !important;
}
.codeiq-splash .workflow-step .step-label {
    font-family: var(--mono) !important;
    font-size: 10px !important;
    letter-spacing: 0.18em !important;
    text-transform: uppercase !important;
    color: var(--ed-ink-3) !important;
}
.codeiq-splash .workflow-connector {
    background: var(--ed-rule) !important;
}
.codeiq-splash .splash-skip-hint,
.codeiq-splash .splash-enter-cta {
    font-family: var(--mono) !important;
    font-size: 10px !important;
    letter-spacing: 0.2em !important;
    text-transform: uppercase !important;
    color: var(--ed-ink-4) !important;
}

/* Error screen */
.error-screen .error-content {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: var(--ed-lift);
}
.error-screen h2 {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.02em;
}


/* ============================================================
   §11 MOTION — purposeful, quick, reduced-motion aware
   ============================================================ */

@keyframes edRise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes edFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Command-center entrance: staggered rise */
.codeiq-dashboard .command-center .bleed-in {
    animation: edRise 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.codeiq-dashboard .cc-metrics-panel.bleed-in { animation-delay: 60ms; }
.codeiq-dashboard .cc-command-section.bleed-in { animation-delay: 120ms; }
.codeiq-dashboard .cc-activity-section.bleed-in { animation-delay: 180ms; }
.codeiq-dashboard .cc-metric-card.bleed-in,
.codeiq-dashboard .cc-command-btn.bleed-in {
    animation: none;
    opacity: 1;
    transform: none;
}

/* Review surface entrance */
.review-interface .review-content-area {
    animation: edRise 460ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Table rows settle in */
@keyframes edRowIn {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}
.review-interface .transaction-row {
    animation: edRowIn 300ms ease-out both;
}
.review-interface .transaction-row:nth-child(2)  { animation-delay: 20ms; }
.review-interface .transaction-row:nth-child(3)  { animation-delay: 40ms; }
.review-interface .transaction-row:nth-child(4)  { animation-delay: 60ms; }
.review-interface .transaction-row:nth-child(5)  { animation-delay: 80ms; }
.review-interface .transaction-row:nth-child(6)  { animation-delay: 100ms; }
.review-interface .transaction-row:nth-child(7)  { animation-delay: 120ms; }
.review-interface .transaction-row:nth-child(8)  { animation-delay: 140ms; }
.review-interface .transaction-row:nth-child(n+9) { animation-delay: 160ms; }

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


/* ============================================================
   §12 PORTED STRUCTURAL RULES
   (from deleted theme-codeiq-ui.css — sticky columns, skeletons,
    floating action bar)
   ============================================================ */

.transaction-table th.sticky-column,
.transaction-table td.checkbox-cell {
    position: sticky;
    left: 0;
    z-index: 15;
    background-color: var(--table-bg, #fff);
    border-right: 1px solid var(--table-border-color, var(--ed-rule-soft));
}
.transaction-table th.sticky-column-2,
.transaction-table td.date-cell.sticky {
    position: sticky;
    left: 60px;
    z-index: 15;
    background-color: var(--table-bg, #fff);
    border-right: 1px solid var(--table-border-color, var(--ed-rule-soft));
}
.transaction-table thead th.sticky-column,
.transaction-table thead th.sticky-column-2 {
    z-index: 25;
    background-color: var(--ed-cream);
}

.skeleton-row {
    background-color: var(--ed-ivory);
    animation: pulse-bg 1.5s infinite ease-in-out;
}
.skeleton-cell {
    height: 38px;
    border-bottom: 1px solid var(--table-border-color, var(--ed-rule-soft));
}
.skeleton-line {
    background-color: var(--ed-paper);
    height: 12px;
    border-radius: 2px;
    width: 80%;
    margin-bottom: 4px;
}
.skeleton-line-short { width: 40%; }
@keyframes pulse-bg {
    0%, 100% { background-color: var(--ed-ivory); }
    50%      { background-color: var(--ed-paper); }
}

.floating-action-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1030;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--ed-rule);
    border-radius: 999px;
    padding: 10px 22px;
    box-shadow: var(--ed-lift);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: opacity 300ms ease, transform 300ms ease, visibility 300ms ease;
    opacity: 0;
    visibility: hidden;
}
.floating-action-bar.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.fab-count {
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ed-wine);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.fab-actions {
    display: flex;
    gap: 10px;
}

.dropdown-menu.show {
    animation: edFadeIn 0.2s ease-out;
}

/* Clickable stat affordance (Patterns Learned "view →") */
.codeiq-dashboard .stat-label-affordance {
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-salmon);
    margin-left: 6px;
    opacity: 0;
    transition: opacity 180ms ease;
}
.codeiq-dashboard .clickable-stat-card:hover .stat-label-affordance {
    opacity: 1;
}

/* Init screen section plates: sharp corners */
.enhanced-loading .li-pipeline,
.enhanced-loading .li-stats,
.enhanced-loading .li-body > section {
    border-radius: 2px;
}

/* No graph-paper texture behind the dashboard — clean cream */
.command-center::before,
.tab-content:has(.command-center)::before {
    display: none;
}

/* Hero stat ("Remaining") owns its full row — no exposed grid backing */
.tp-shell .tp-stat-hero {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
}

/* --- Welcome modal (WelcomeModal.js / CodeIQModal.css welcome-*) --- */
.codeiq-welcome-modal .welcome-modal-header {
    background: #fff !important;
    border-bottom: 1px solid var(--ed-rule) !important;
    color: var(--ed-ink) !important;
}
.codeiq-welcome-modal .welcome-modal-header *,
.codeiq-welcome-modal .welcome-logo-title {
    color: var(--ed-ink) !important;
    text-shadow: none !important;
}
.codeiq-welcome-modal .welcome-logo-title .welcome-subtitle,
.codeiq-welcome-modal .welcome-modal-header p {
    font-family: var(--serif) !important;
    font-style: italic;
    font-weight: 300 !important;
    color: var(--ed-ink-3) !important;
}
.codeiq-welcome-modal .welcome-modal-body h2,
.codeiq-welcome-modal .welcome-modal-body h3 {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
}
.codeiq-welcome-modal .scenario-card {
    background: #fff !important;
    border: 1px solid var(--ed-rule) !important;
    border-radius: 2px !important;
    box-shadow: none !important;
}
.codeiq-welcome-modal .scenario-card:hover {
    border-color: var(--ed-rule-strong) !important;
    transform: none !important;
}
.codeiq-welcome-modal .scenario-with-history {
    border-left: 2px solid var(--ed-sage) !important;
}
.codeiq-welcome-modal .scenario-new-company {
    border-left: 2px solid var(--ed-gold) !important;
}
.codeiq-welcome-modal .scenario-title {
    font-family: var(--serif) !important;
    font-weight: 500 !important;
    color: var(--ed-ink) !important;
}
.codeiq-welcome-modal .scenario-icon {
    color: var(--ed-wine) !important;
}
.codeiq-welcome-modal .accuracy-badge {
    font-family: var(--mono) !important;
    font-size: 9px !important;
    font-weight: 500 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    border-radius: 2px !important;
    box-shadow: none !important;
}
.codeiq-welcome-modal .accuracy-badge.badge-high {
    background: var(--ed-sage-wash) !important;
    color: var(--ed-sage) !important;
}
.codeiq-welcome-modal .accuracy-badge.badge-learning {
    background: var(--ed-gold-wash) !important;
    color: var(--ed-gold) !important;
}
.codeiq-welcome-modal .welcome-benefits {
    background: var(--ed-ivory) !important;
    border: none !important;
    border-left: 2px solid var(--ed-rule-strong) !important;
    border-radius: 0 !important;
}
.codeiq-welcome-modal .benefits-title {
    font-family: var(--serif) !important;
    font-weight: 500 !important;
    color: var(--ed-ink) !important;
}
.codeiq-welcome-modal .welcome-get-started-btn {
    background: var(--ed-ink) !important;
    color: var(--ed-cream) !important;
    border: 1px solid var(--ed-ink) !important;
    border-radius: 2px !important;
    box-shadow: none !important;
    font-family: var(--sans) !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
}
.codeiq-welcome-modal .welcome-get-started-btn::before {
    display: none !important;
}
.codeiq-welcome-modal .welcome-get-started-btn:hover {
    background: var(--ed-wine) !important;
    border-color: var(--ed-wine) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 24px -12px var(--ed-wine) !important;
}

/* --- Terms & Conditions modal (inline-styled JS; !important beats inline) --- */
.codeiq-tc-modal {
    border-radius: 2px !important;
    border: 1px solid var(--ed-rule) !important;
    box-shadow: var(--ed-lift-lg) !important;
}
.codeiq-tc-modal .tc-modal-header {
    background: #fff !important;
    border-bottom: 1px solid var(--ed-rule) !important;
}
.codeiq-tc-modal .tc-modal-header img {
    filter: none !important;
}
.codeiq-tc-modal .tc-modal-header h2 {
    font-family: var(--serif) !important;
    color: var(--ed-ink) !important;
    font-weight: 400 !important;
    letter-spacing: -0.02em !important;
}
.codeiq-tc-modal .tc-modal-header p {
    font-family: var(--serif) !important;
    font-style: italic !important;
    font-weight: 300 !important;
    color: var(--ed-ink-3) !important;
}
.codeiq-tc-modal .tc-modal-body h3 {
    font-family: var(--serif) !important;
    font-weight: 500 !important;
    letter-spacing: -0.01em !important;
    background: none !important;
    -webkit-text-fill-color: var(--ed-ink) !important;
    color: var(--ed-ink) !important;
}
.codeiq-tc-modal .tc-modal-body h3 span {
    display: none !important; /* emoji chips */
}
.codeiq-tc-modal .tc-modal-body > div > div,
.codeiq-tc-modal .tc-modal-body [style*="border-radius"] {
    border-radius: 2px !important;
}
.codeiq-tc-modal #tc-decline-btn {
    background: #fff !important;
    color: var(--ed-ink-2) !important;
    border: 1px solid var(--ed-rule) !important;
    border-radius: 2px !important;
    font-weight: 500 !important;
}
.codeiq-tc-modal #tc-decline-btn:hover {
    background: var(--ed-ivory) !important;
    color: var(--ed-ink) !important;
    border-color: var(--ed-rule-strong) !important;
}
.codeiq-tc-modal #tc-accept-btn {
    background: var(--ed-ink) !important;
    color: var(--ed-cream) !important;
    border: 1px solid var(--ed-ink) !important;
    border-radius: 2px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}
.codeiq-tc-modal #tc-accept-btn:hover {
    background: var(--ed-wine) !important;
    border-color: var(--ed-wine) !important;
}

/* Welcome modal wordmark: defeat gradient text-fill from CodeIQModal.css */
.codeiq-welcome-modal .welcome-modal-header h1,
.codeiq-welcome-modal .welcome-modal-header h2,
.codeiq-welcome-modal .welcome-logo-title * {
    background: none !important;
    -webkit-text-fill-color: var(--ed-ink) !important;
    color: var(--ed-ink) !important;
    text-shadow: none !important;
}

/* RiQ modal txn direction chip */
.riq-analysis-modal .txn-amount,
.chat-transaction-header .txn-amount {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}
.chat-transaction-header .txn-amount-in { color: var(--ed-sage); }
.chat-transaction-header .txn-amount-out { color: var(--ed-ink-2); }
.chat-transaction-header .txn-direction {
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
}
.chat-transaction-header .txn-amount-in .txn-direction { background: var(--ed-sage-wash); color: var(--ed-sage); }
.chat-transaction-header .txn-amount-out .txn-direction { background: var(--ed-ivory); color: var(--ed-ink-3); }


/* ============================================================
   §13 VIEW SYSTEM — stable masthead, one rhythm for every view
   ============================================================ */

.review-interface .vat-audit-panel,
.review-interface .account-summary-panel,
.review-interface .transfers-panel,
.review-interface .invoices-panel {
    padding: 22px 28px 36px;
    border-top: 1px solid var(--ed-rule);
    margin: 0;
}

/* The method ledger is Transactions filtering UI — other views don't carry it */
.review-content-area[data-active-view]:not([data-active-view="transactions"]) .metrics-container {
    display: none;
}
.review-content-area[data-active-view]:not([data-active-view="transactions"]) .review-transaction-panel {
    border-top: none;
}

/* Mono section rule opening each view (mirrors dashboard § labels) */
.review-interface .vat-audit-panel::before,
.review-interface .account-summary-panel::before,
.review-interface .transfers-panel::before,
.review-interface .invoices-panel::before {
    display: block;
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    margin-bottom: 20px;
}
.review-interface .vat-audit-panel::before        { content: '§ VAT audit · session return check'; }
.review-interface .account-summary-panel::before  { content: '§ Accounts · where the money went'; }
.review-interface .transfers-panel::before        { content: '§ Transfers · paired movements'; }
.review-interface .invoices-panel::before         { content: '§ Invoices · outstanding & matched'; }


/* ============================================================
   §14 VAT AUDIT VIEW — curated
   ============================================================ */

.review-interface .vat-return-preview {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0 0 26px;
}
.review-interface .vat-return-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 10px;
    border-bottom: 1px solid var(--ed-rule);
    background: transparent;
    cursor: pointer;
}
.review-interface .vat-return-header h4 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--serif);
    font-size: 16.5px;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--ed-ink);
    background: none;
    -webkit-text-fill-color: currentColor;
    opacity: 1;
    margin: 0;
}
.review-interface .vat-return-header h4 svg {
    color: var(--ed-wine);
    width: 15px;
    height: 15px;
}
.review-interface .vat-return-toggle {
    color: var(--ed-ink-4);
    transition: transform 240ms cubic-bezier(.2,.8,.2,1);
}
.review-interface .vat-return-body {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    background: var(--ed-rule);
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 14px;
    padding: 0;
}
.review-interface .vat-box {
    flex: 1 1 150px;
    min-width: 0;
    background: var(--ed-cream);
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column-reverse;
    gap: 6px;
    transition: background 220ms ease;
}
.review-interface .vat-box:hover { background: #fff; }
.review-interface .vat-box-label {
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
}
.review-interface .vat-box-value {
    font-family: var(--serif);
    font-size: 21px;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
    font-variant-numeric: lining-nums tabular-nums;
}
.review-interface .vat-return-disclaimer {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 12.5px;
    color: var(--ed-ink-4);
    margin: 10px 0 0;
}

/* Sidebar: VAT code mix as ledger rows */
.review-interface .vat-audit-sidebar {
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    padding: 0;
    overflow: hidden;
    box-shadow: none;
}
.review-interface .vat-sidebar-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--ed-rule);
    margin: 0;
    background: transparent;
}
.review-interface .vat-sidebar-header h4 {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    margin: 0;
}
.review-interface .vat-chip-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}
.review-interface .vat-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ed-rule-soft);
    border-left: 2px solid transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 11px 16px 11px 14px;
    cursor: pointer;
    transition: background 200ms ease, border-left-color 200ms ease;
}
.review-interface .vat-chip:hover {
    background: #fff;
    border-color: var(--ed-rule-soft);
    border-left-color: var(--ed-rule-strong);
}
.review-interface .vat-chip.active {
    background: #fff;
    border-left-color: var(--ed-salmon);
}
.review-interface .vat-chip-code {
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-wine);
}
.review-interface .vat-chip-name {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--ed-ink);
}
.review-interface .vat-chip-count {
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--ed-ink-4);
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.review-interface .vat-chip-amount {
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ed-ink-2);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* No-VAT reset action — block layout, copy above button */
.review-interface .vat-no-vat-action {
    display: block;
    margin: 12px;
    padding: 12px 14px;
    border-radius: 2px;
    border: none;
    background: var(--ed-ivory);
}
.review-interface .vat-no-vat-action.has-exposure {
    background: var(--ed-gold-wash);
    border-left: 2px solid var(--ed-gold);
}
.review-interface .vat-no-vat-action.is-clean {
    background: var(--ed-sage-wash);
    border-left: 2px solid var(--ed-sage);
}
.review-interface .vat-no-vat-copy {
    display: block;
    font-family: var(--sans);
    font-size: 12.5px;
    color: var(--ed-ink-2);
    line-height: 1.5;
    word-break: normal;
    overflow-wrap: break-word;
    margin: 0 0 10px;
}
.review-interface .vat-clear-session-btn {
    display: block;
    width: 100%;
    margin: 0;
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    padding: 8px 12px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--ed-ink-2);
    cursor: pointer;
    box-shadow: none;
    transition: all 180ms ease;
}
.review-interface .vat-clear-session-btn:hover:not(:disabled) {
    border-color: var(--ed-rule-strong);
    color: var(--ed-ink);
    background: var(--ed-ivory);
}
.review-interface .vat-clear-session-btn:disabled {
    color: var(--ed-rule-strong);
    cursor: not-allowed;
}

/* Worklist summary: serif hero count */
.review-interface .vat-worklist-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-left: 2px solid var(--ed-gold);
    border-radius: 2px;
    box-shadow: none;
    padding: 14px 18px;
    margin: 14px 0;
}
.review-interface .vat-worklist-summary.is-clear {
    border-left-color: var(--ed-sage);
}
.review-interface .vws-hero {
    display: flex;
    align-items: baseline;
    gap: 14px;
}
.review-interface .vws-count {
    font-family: var(--serif);
    font-size: 34px;
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--ed-ink);
    background: transparent;
    font-variant-numeric: lining-nums;
}
.review-interface .vws-tick {
    font-size: 18px;
    color: var(--ed-sage);
}
.review-interface .vws-label {
    display: block;
    font-family: var(--sans);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ed-ink);
}
.review-interface .vws-sub {
    display: block;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
    margin-top: 3px;
}
.review-interface .vws-progress {
    flex: 0 1 220px;
    height: 4px;
    background: var(--ed-paper);
    border-radius: 999px;
    overflow: hidden;
}
.review-interface .vws-progress-fill {
    height: 100%;
    background: var(--ed-sage);
    border-radius: 999px;
    transition: width 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Exception cards */
.review-interface .vat-exception-card {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: none;
    padding: 16px 18px;
    margin-bottom: 12px;
    transition: border-color 240ms ease;
}
.review-interface .vat-exception-card:hover {
    border-color: var(--ed-rule-strong);
}
.review-interface .vxc-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.review-interface .vxc-title {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--ed-ink);
}
.review-interface .vxc-sub {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.08em;
    color: var(--ed-ink-4);
    margin-top: 3px;
}
.review-interface .vxc-risk {
    text-align: right;
}
.review-interface .vxc-risk strong {
    display: block;
    font-family: var(--serif);
    font-size: 19px;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--ed-ink);
    font-variant-numeric: lining-nums tabular-nums;
}
.review-interface .vxc-risk small {
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
}
.review-interface .vxc-breakdown {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 12px 0 8px;
}
.review-interface .vat-x-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 2px;
    border: none;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
}
.review-interface .vat-x-chip.is-dominant {
    background: var(--ed-ivory);
    color: var(--ed-ink-2);
}
.review-interface .vat-x-chip.is-odd {
    background: var(--ed-rust-wash);
    color: var(--ed-rust);
}
.review-interface .vxc-chip-n {
    font-variant-numeric: tabular-nums;
    opacity: 0.75;
}
.review-interface .vxc-note {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 13px;
    color: var(--ed-ink-3);
    margin-bottom: 12px;
}
.review-interface .vxc-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-top: 1px solid var(--ed-rule-soft);
    padding-top: 12px;
}
.review-interface .vxc-apply-label {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
}
.review-interface .vat-exc-select {
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    padding: 7px 10px;
    font-family: var(--sans);
    font-size: 12.5px;
    color: var(--ed-ink);
}
.review-interface .vat-exc-select:focus {
    border-color: var(--ed-salmon);
    background: #fff;
    outline: none;
    box-shadow: none;
}
.review-interface .vat-exc-resolve {
    padding: 8px 16px;
    font-size: 12.5px;
}
.review-interface .vat-exc-dismiss {
    padding: 8px 14px;
    font-size: 12.5px;
}
.review-interface .vat-reviewed-line {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--ed-ink-4);
    margin: 6px 0 18px;
}
.review-interface .vat-reviewed-line .linklike {
    background: none;
    border: none;
    color: var(--ed-wine);
    font-family: inherit;
    font-size: inherit;
    letter-spacing: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Recode drawer */
.review-interface .vat-recode {
    border: 1px dashed var(--ed-rule-strong);
    border-radius: 2px;
    background: transparent;
    box-shadow: none;
}
.review-interface .vat-recode-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: transparent;
    border: none;
    padding: 13px 16px;
    cursor: pointer;
    text-align: left;
    transition: background 200ms ease;
}
.review-interface .vat-recode-toggle:hover {
    background: var(--ed-wash-soft);
}
.review-interface .vrt-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--ed-rule);
    background: #fff;
    color: var(--ed-wine);
    flex-shrink: 0;
}
.review-interface .vrt-title {
    display: block;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--ed-ink);
}
.review-interface .vrt-desc {
    display: block;
    font-size: 12px;
    color: var(--ed-ink-3);
    margin-top: 2px;
}
.review-interface .vrt-count {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--ed-wash);
    color: var(--ed-wine);
    border-radius: 999px;
    padding: 4px 11px;
    white-space: nowrap;
}
.review-interface .vat-audit-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.review-interface .vat-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ed-wash);
    color: var(--ed-wine);
    border: none;
    border-radius: 999px;
    padding: 5px 6px 5px 12px;
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.review-interface .vat-filter-pill button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0 4px;
}


/* ============================================================
   §15 ACCOUNTS VIEW — curated
   ============================================================ */

.review-interface .acct-summary-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    background: transparent;
    border: none;
    border-bottom: none;
    padding: 0;
    margin-bottom: 16px;
}
.review-interface .acct-summary-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
}
.review-interface .acct-summary-title h3 {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
    margin: 0;
}
.review-interface .acct-count {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
    background: transparent;
    padding: 0;
}
.review-interface .acct-summary-subtitle {
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ed-ink-3);
    margin: 6px 0 0;
}
.review-interface .acct-summary-totals {
    display: flex;
    align-items: stretch;
    gap: 0;
}
.review-interface .acct-total-item {
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
    padding: 0 22px;
    border-left: 1px solid var(--ed-rule);
    background: transparent;
    text-align: left;
}
.review-interface .acct-total-item:first-child { border-left: 0; padding-left: 0; }
.review-interface .acct-total-label {
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
}
.review-interface .acct-total-value {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
    font-variant-numeric: lining-nums tabular-nums;
}
.review-interface .acct-total-value.income { color: var(--ed-sage); }
.review-interface .acct-total-value.expense { color: var(--ed-ink-2); }
.review-interface .acct-total-value.net.positive { color: var(--ed-wine); }
.review-interface .acct-total-value.net.negative { color: var(--ed-rust); }

.review-interface .acct-summary-insights {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.review-interface .acct-insight-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 13px;
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 999px;
    box-shadow: none;
}
.review-interface .acct-insight-chip.warning {
    background: var(--ed-gold-wash);
    border-color: rgba(138, 98, 26, 0.3);
}
.review-interface .acct-insight-chip strong {
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 500;
    color: var(--ed-ink);
    font-variant-numeric: tabular-nums;
}
.review-interface .acct-insight-chip.warning strong { color: var(--ed-gold); }

.review-interface .acct-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: transparent;
    padding: 14px 0;
    border-top: 1px solid var(--ed-rule);
    border-bottom: 1px solid var(--ed-rule-soft);
    margin-bottom: 18px;
}
.review-interface .acct-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    box-shadow: none;
    padding: 7px 12px;
    color: var(--ed-ink-4);
    flex: 0 1 320px;
}
.review-interface .acct-search input {
    border: none;
    background: transparent;
    font-family: var(--sans);
    font-size: 13px;
    color: var(--ed-ink);
    width: 100%;
    outline: none;
}
.review-interface .acct-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}
.review-interface .acct-sort label {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-ink-4);
}
.review-interface .acct-sort select {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-radius: 2px;
    padding: 7px 10px;
    font-family: var(--sans);
    font-size: 12.5px;
    color: var(--ed-ink-2);
    box-shadow: none;
}

/* Uncoded warning strip */
.review-interface .acct-uncoded-warning {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--ed-gold-wash);
    border: none;
    border-left: 2px solid var(--ed-gold);
    border-radius: 2px;
    box-shadow: none;
    padding: 14px 18px;
    margin-bottom: 20px;
}
.review-interface .acct-uncoded-icon { color: var(--ed-gold); }
.review-interface .acct-uncoded-text h4 {
    font-family: var(--serif);
    font-size: 15px;
    font-weight: 500;
    color: var(--ed-ink);
    margin: 0 0 2px;
}
.review-interface .acct-uncoded-text p {
    font-size: 12.5px;
    color: var(--ed-ink-3);
    margin: 0;
}
.review-interface .acct-uncoded-btn {
    margin-left: auto;
    padding: 8px 16px;
    font-size: 12.5px;
    white-space: nowrap;
}

/* Type groups: section rules, hairline card grids */
.review-interface .acct-type-group {
    margin-bottom: 26px;
    border: none;
    background: transparent;
    box-shadow: none;
}
.review-interface .acct-type-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ed-rule);
    border-radius: 0;
    padding: 0 0 10px;
    cursor: pointer;
    transition: none;
}
.review-interface .acct-type-header:hover { background: transparent; }
.review-interface .acct-type-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.review-interface .acct-type-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ed-rule);
    background: #fff;
    color: var(--ed-ink-3);
}
.review-interface .acct-type-icon svg { width: 12px; height: 12px; }
.review-interface .acct-type-icon.income   { color: var(--ed-sage);  background: var(--ed-sage-wash);  border-color: rgba(74,124,74,0.3); }
.review-interface .acct-type-icon.expense  { color: var(--ed-rust);  background: var(--ed-rust-wash);  border-color: rgba(176,74,58,0.3); }
.review-interface .acct-type-icon.asset    { color: var(--ed-slate); background: var(--ed-slate-wash); border-color: rgba(91,110,174,0.3); }
.review-interface .acct-type-icon.liability{ color: var(--ed-gold);  background: var(--ed-gold-wash);  border-color: rgba(138,98,26,0.3); }
.review-interface .acct-type-icon.bank     { color: var(--ed-teal);  background: var(--ed-teal-wash);  border-color: rgba(58,110,120,0.3); }
.review-interface .acct-type-name {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ed-ink);
}
.review-interface .acct-type-count {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.04em;
    color: var(--ed-ink-4);
    background: transparent;
    border-radius: 0;
    padding: 0;
    font-variant-numeric: tabular-nums;
}
.review-interface .acct-type-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.review-interface .acct-type-total {
    font-family: var(--serif);
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.01em;
    font-variant-numeric: lining-nums tabular-nums;
    color: var(--ed-ink);
}
.review-interface .acct-type-total.negative { color: var(--ed-ink-2); }
.review-interface .acct-type-chevron { color: var(--ed-ink-4); }

.review-interface .acct-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1px;
    background: var(--ed-rule);
    border: 1px solid var(--ed-rule);
    border-top: none;
    border-radius: 0 0 2px 2px;
    overflow: hidden;
}
.review-interface .acct-card {
    background: var(--ed-cream);
    border: none;
    border-left: 2px solid transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 14px 18px;
    cursor: pointer;
    transition: background 220ms ease, border-left-color 220ms ease;
}
.review-interface .acct-card:hover {
    background: #fff;
    border-left-color: var(--ed-salmon);
    transform: none;
    box-shadow: none;
}
.review-interface .acct-card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}
.review-interface .acct-card-name {
    font-family: var(--sans);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ed-ink);
}
.review-interface .acct-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 0 10px;
}
.review-interface .acct-card-txns {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ed-ink-4);
    font-variant-numeric: tabular-nums;
}
.review-interface .acct-card-confidence {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: transparent;
    border: none;
    padding: 0;
}
.review-interface .acct-card-confidence.high   { color: var(--ed-sage); }
.review-interface .acct-card-confidence.medium { color: var(--ed-gold); }
.review-interface .acct-card-confidence.low    { color: var(--ed-rust); }
.review-interface .acct-card-amounts {
    display: flex;
    align-items: center;
    gap: 14px;
}
.review-interface .acct-card-total {
    font-family: var(--serif);
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.01em;
    font-variant-numeric: lining-nums tabular-nums;
    color: var(--ed-ink);
    white-space: nowrap;
}
.review-interface .acct-card-total.negative { color: var(--ed-ink-2); }
.review-interface .acct-card-bar {
    flex: 1;
    height: 3px;
    background: var(--ed-paper);
    border-radius: 999px;
    overflow: hidden;
}
.review-interface .acct-card-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--ed-rule-strong);
}
.review-interface .acct-card-bar-fill.income  { background: var(--ed-sage); }
.review-interface .acct-card-bar-fill.expense { background: var(--ed-salmon); }
.review-interface .acct-click-hint {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 13px;
    color: var(--ed-ink-4);
    text-align: center;
    margin-top: 8px;
}


/* ============================================================
   §16 TRANSFERS VIEW — curated
   ============================================================ */

.review-interface .transfers-overview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
    background: var(--ed-ink);
    border: none;
    border-radius: 2px;
    padding: 22px 26px;
    margin-bottom: 20px;
}
.review-interface .transfers-overview-heading h3 {
    font-family: var(--serif);
    font-size: 21px;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ed-cream);
    margin: 0 0 5px;
}
.review-interface .transfers-overview-heading p {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 13.5px;
    color: rgba(250, 248, 245, 0.65);
    margin: 0;
}
.review-interface .transfers-overview-stats {
    display: flex;
    align-items: stretch;
    gap: 0;
}
.review-interface .transfers-overview-stat {
    display: flex;
    flex-direction: column-reverse;
    gap: 5px;
    padding: 0 22px;
    border-left: 1px solid rgba(250, 248, 245, 0.18);
    background: transparent;
}
.review-interface .transfers-overview-stat:first-child { border-left: 0; }
.review-interface .transfers-overview-stat strong {
    font-family: var(--serif);
    font-size: 24px;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: #fff;
    font-variant-numeric: lining-nums tabular-nums;
}
.review-interface .transfers-overview-stat strong.matched   { color: #a9c8a9; }
.review-interface .transfers-overview-stat strong.unmatched { color: #e0c184; }

.review-interface .transfer-pairs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 14px;
}
.review-interface .transfer-pair-card {
    padding: 16px 18px;
}
.review-interface .transfer-pair-card.matched   { border-left: 2px solid var(--ed-slate); }
.review-interface .transfer-pair-card.unmatched { border-left: 2px solid var(--ed-gold); }
.review-interface .transfer-pair-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    background: transparent;
    border: none;
    padding: 0;
}
.review-interface .transfer-pair-amount {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--ed-ink);
    font-variant-numeric: lining-nums tabular-nums;
}
.review-interface .transfer-pair-context {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 12.5px;
    color: var(--ed-ink-3);
    margin-top: 3px;
}
.review-interface .transfer-pair-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    border: none;
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
}
.review-interface .transfer-pair-status.matched {
    background: var(--ed-slate-wash);
    color: var(--ed-slate);
}
.review-interface .transfer-pair-status.matched .transfer-status-dot { background: var(--ed-slate); }
.review-interface .transfer-pair-status.unmatched {
    background: var(--ed-gold-wash);
    color: var(--ed-gold);
}
.review-interface .transfer-pair-status.unmatched .transfer-status-dot { background: var(--ed-gold); }
.review-interface .transfer-status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}
.review-interface .transfer-pair-sides {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}
.review-interface .transfer-side {
    background: var(--ed-cream);
    border: 1px solid var(--ed-rule-soft);
    border-radius: 2px;
    padding: 11px 13px;
    min-width: 0;
}
.review-interface .transfer-side-bank {
    font-size: 12.5px;
    margin: 3px 0 2px;
}
.review-interface .transfer-side-desc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.review-interface .transfer-pair-meta {
    display: flex;
    gap: 20px;
    border-top: 1px solid var(--ed-rule-soft);
    margin-top: 12px;
    padding-top: 10px;
}
.review-interface .transfer-pair-meta strong {
    color: var(--ed-ink-2);
    font-weight: 500;
}


/* ============================================================
   §17 POSTING CENTER — curated
   ============================================================ */

.persistent-center-container {
    background: #fff !important;
    border: 1px solid var(--ed-rule) !important;
    border-radius: 2px !important;
    box-shadow: var(--ed-lift-lg) !important;
    overflow: hidden;
}
.persistent-center-container .center-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ed-cream) !important;
    border-bottom: 1px solid var(--ed-rule) !important;
    padding: 12px 16px !important;
}
.persistent-center-container .center-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono) !important;
    font-size: 10px !important;
    font-weight: 500 !important;
    letter-spacing: 0.22em !important;
    text-transform: uppercase !important;
    color: var(--ed-ink-2) !important;
    margin: 0 !important;
}
.persistent-center-container .center-title::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ed-salmon);
    animation: pulseDot 2.2s ease-in-out infinite;
}
.persistent-center-container .control-btn {
    width: 24px !important;
    height: 24px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: 1px solid var(--ed-rule) !important;
    border-radius: 999px !important;
    color: var(--ed-ink-3) !important;
    cursor: pointer;
    transition: all 160ms ease;
}
.persistent-center-container .control-btn:hover {
    color: var(--ed-ink) !important;
    border-color: var(--ed-rule-strong) !important;
    background: #fff !important;
}
.persistent-center-container .center-content {
    background: #fff !important;
    padding: 0 !important;
}
.persistent-center-container .posting-center-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 8px 16px;
    border-bottom: 1px solid var(--ed-rule-soft);
}
.persistent-center-container .clear-completed-btn {
    background: none !important;
    border: none !important;
    font-family: var(--mono) !important;
    font-size: 9px !important;
    font-weight: 500 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    color: var(--ed-ink-4) !important;
    cursor: pointer;
    padding: 2px 0 !important;
    transition: color 160ms ease;
}
.persistent-center-container .clear-completed-btn:hover {
    color: var(--ed-wine) !important;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* One posting job = one ledger entry */
.persistent-center-container .posting-session {
    position: relative;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--ed-rule) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 16px 16px 14px !important;
    margin: 0 !important;
}
.persistent-center-container .posting-session:last-child {
    border-bottom: none !important;
}
.persistent-center-container .close-session-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    border-radius: 50%;
    color: var(--ed-ink-4) !important;
    font-size: 14px;
    cursor: pointer;
    transition: all 160ms ease;
}
.persistent-center-container .close-session-btn:hover {
    color: var(--ed-wine) !important;
    background: var(--ed-wash) !important;
}
.persistent-center-container .session-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    background: transparent !important;
    border: none !important;
    padding: 0 18px 0 0 !important;
    margin: 0 0 10px !important;
}
.persistent-center-container .session-title {
    font-family: var(--serif) !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    letter-spacing: -0.01em;
    color: var(--ed-ink) !important;
    margin: 0 !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
}
.persistent-center-container .session-platform {
    font-family: var(--mono) !important;
    font-size: 8.5px !important;
    font-weight: 500 !important;
    letter-spacing: 0.16em !important;
    text-transform: uppercase !important;
    color: var(--ed-ink-4) !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-left: 8px;
}
.persistent-center-container .session-status {
    font-family: var(--mono) !important;
    font-size: 8.5px !important;
    font-weight: 500 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    padding: 3px 10px !important;
    border-radius: 999px !important;
    border: none !important;
    white-space: nowrap;
}
.persistent-center-container .session-status.posting,
.persistent-center-container .session-status.in-progress,
.persistent-center-container .session-status.in_progress {
    background: var(--ed-wash) !important;
    color: var(--ed-wine) !important;
}
.persistent-center-container .session-status.completed,
.persistent-center-container .session-status.complete {
    background: var(--ed-sage-wash) !important;
    color: var(--ed-sage) !important;
}
.persistent-center-container .session-status.failed,
.persistent-center-container .session-status.error {
    background: var(--ed-rust-wash) !important;
    color: var(--ed-rust) !important;
}
.persistent-center-container .progress-bar-container {
    height: 4px !important;
    background: var(--ed-paper) !important;
    border-radius: 999px !important;
    overflow: hidden;
    margin: 0 0 8px !important;
}
.persistent-center-container .progress-bar {
    height: 100% !important;
    background: linear-gradient(90deg, var(--ed-salmon), var(--ed-wine)) !important;
    border-radius: 999px !important;
    transition: width 500ms cubic-bezier(0.16, 1, 0.3, 1);
}
.persistent-center-container .progress-stats {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-family: var(--mono) !important;
    font-size: 10px !important;
    letter-spacing: 0.05em;
    color: var(--ed-ink-3) !important;
    font-variant-numeric: tabular-nums;
}
.persistent-center-container .failed-count {
    color: var(--ed-rust) !important;
    font-weight: 500;
}

/* Breakdown: hairline ledger rows */
.persistent-center-container .posting-breakdown {
    background: var(--ed-cream) !important;
    border: 1px solid var(--ed-rule-soft) !important;
    border-radius: 2px !important;
    padding: 10px 12px !important;
    margin-top: 12px !important;
}
.persistent-center-container .breakdown-title {
    font-family: var(--mono) !important;
    font-size: 8.5px !important;
    font-weight: 500 !important;
    letter-spacing: 0.18em !important;
    text-transform: uppercase !important;
    color: var(--ed-ink-4) !important;
    margin-bottom: 8px !important;
}
.persistent-center-container .breakdown-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 5px 0 !important;
    border-bottom: 1px solid var(--ed-rule-soft);
    background: transparent !important;
}
.persistent-center-container .breakdown-item:last-child { border-bottom: none; }
.persistent-center-container .breakdown-label {
    font-family: var(--sans) !important;
    font-size: 12px !important;
    color: var(--ed-ink-2) !important;
}
.persistent-center-container .breakdown-value {
    font-family: var(--mono) !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: var(--ed-ink) !important;
    font-variant-numeric: tabular-nums;
}

/* Failed section */
.persistent-center-container .failed-transactions-section {
    background: var(--ed-rust-wash) !important;
    border: none !important;
    border-left: 2px solid var(--ed-rust) !important;
    border-radius: 2px !important;
    padding: 10px 12px !important;
    margin-top: 10px !important;
}
.persistent-center-container .failed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.persistent-center-container .failed-title {
    font-family: var(--sans) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--ed-rust) !important;
}
.persistent-center-container .btn-link {
    font-family: var(--mono) !important;
    font-size: 9px !important;
    font-weight: 500 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    color: var(--ed-wine) !important;
    background: none !important;
    border: none !important;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.persistent-center-container .failed-transaction-item {
    background: #fff !important;
    border: 1px solid var(--ed-rule-soft) !important;
    border-radius: 2px !important;
    padding: 9px 11px !important;
    margin-top: 8px !important;
}
.persistent-center-container .failed-txn-description {
    font-family: var(--sans) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--ed-ink) !important;
}
.persistent-center-container .failed-txn-details {
    font-family: var(--mono) !important;
    font-size: 10px !important;
    color: var(--ed-ink-4) !important;
    font-variant-numeric: tabular-nums;
}
.persistent-center-container .failed-txn-error {
    font-family: var(--serif) !important;
    font-style: italic;
    font-weight: 300 !important;
    font-size: 12px !important;
    color: var(--ed-rust) !important;
    margin-top: 4px;
}
.persistent-center-container .empty-state {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    color: var(--ed-ink-3);
    text-align: center;
    padding: 28px 16px;
}

/* Invoices view */
.review-interface .invoice-card {
    background: #fff;
    border: 1px solid var(--ed-rule);
    border-left: 2px solid var(--ed-teal);
    border-radius: 2px;
    box-shadow: none;
    transition: border-color 220ms ease;
}
.review-interface .invoice-card:hover { border-color: var(--ed-rule-strong); border-left-color: var(--ed-teal); }
.review-interface .invoice-card.matched { border-left-color: var(--ed-sage); }
.review-interface .invoice-number {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--ed-ink);
}
.review-interface .invoice-contact {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--ed-ink-2);
}
.review-interface .invoice-amount {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 400;
    font-variant-numeric: lining-nums tabular-nums;
    color: var(--ed-ink);
}
.review-interface .invoice-payment-status {
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 3px 9px;
}
.review-interface .invoice-payment-status.fully-paid { background: var(--ed-sage-wash); color: var(--ed-sage); }
.review-interface .invoice-payment-status.shortfall  { background: var(--ed-gold-wash); color: var(--ed-gold); }
.review-interface .invoice-payment-status.overpaid   { background: var(--ed-rust-wash); color: var(--ed-rust); }
.review-interface .invoice-batch-badge {
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--ed-teal-wash);
    color: var(--ed-teal);
    border-radius: 2px;
    padding: 2px 6px;
    margin-left: 6px;
}

/* §13-17 refinements */

/* Posting session close: top-right, quiet (legacy pins it top-left) */
.persistent-center-container .close-session-btn {
    left: auto !important;
    right: 12px !important;
    top: 12px !important;
}

/* Accounts card grid: borders live on the cards so partial rows stay cream */
.review-interface .acct-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}
.review-interface .acct-card {
    border: none;
    border-left: 2px solid transparent;
    border-right: 1px solid var(--ed-rule);
    border-bottom: 1px solid var(--ed-rule);
    background: var(--ed-cream);
}

/* Insights strip: kill any legacy band behind the chips */
.review-interface .acct-summary-insights {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

/* Sort control: quiet the label */
.review-interface .acct-sort label {
    background: transparent;
    border: none;
    padding: 0;
}

/* Search field (live markup: .transaction-search-container, icon LEFT at 12px) */
.review-interface .transaction-search-container {
    margin: 0;
    max-width: 320px;
}
.review-interface .transaction-search-container .transaction-search-input {
    padding: 8px 12px 8px 36px;
}

/* Command-center safety: anything still bleed-in-hidden inside the dashboard
   becomes visible even if the splash reveal never fires (restored sessions) */
body.bleed-active .codeiq-dashboard .command-center .bleed-in {
    opacity: 1;
}

/* The "all transactions" pill: same cream as its siblings (legacy set it
   transparent, which exposed the hairline-grid backing as a grey box) */
.review-interface .stat-pill.stat-total {
    background: var(--ed-cream);
}
.review-interface .stat-pill.stat-total:hover,
.review-interface .stat-pill.stat-total.active {
    background: #fff;
}

/* Box 5 (net VAT) emphasis: wine voice on wash, not grey */
.review-interface .vat-box.highlight {
    background: var(--ed-wash-soft);
}
.review-interface .vat-box.highlight .vat-box-label { color: var(--ed-wine); }
.review-interface .vat-box.highlight .vat-box-value { color: var(--ed-wine); }
.review-interface .vat-box.highlight:hover { background: var(--ed-wash); }
