:root {
    color-scheme: light;
    /* Everything pinned sits below the top bar plus the pinned page header and tabs; app.js measures the two heights
       on wide screens (live review 2026-11-16, #24). */
    --page-top-height: 0px;
    --page-tabs-height: 0px;
    --sticky-top: calc(70px + var(--page-top-height) + var(--page-tabs-height));
    --primary: #556ee6;
    --primary-dark: #4458b8;
    --ink: #343a40;
    --muted: #74788d;
    --line: #e9e9ef;
    --surface: #ffffff;
    --canvas: #f5f6f8;
    --sidebar: #fbfcff;
    --success: #34c38f;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Workflow setup uses the same Skote palette and native Bootstrap forms. */
.workflow-builder { display: grid; grid-template-columns: 190px minmax(240px, 1fr) minmax(300px, .95fr); align-items: start; gap: 22px; }
.workflow-builder > * { min-width: 0; }
.workflow-palette .card-body { padding: 16px 12px; }
.workflow-palette-item { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 12px 9px; border: 1px solid var(--step-border); background: var(--step-bg); color: #30384d; border-radius: 7px; text-decoration: none; font-size: 13px; }
.workflow-palette-item span { color: var(--step-color); font-size: 20px; font-weight: 700; }
.workflow-palette-text { min-width: 0; font-weight: 600; }
.workflow-palette-text small { display: block; margin-top: 2px; color: #5b6275; font-size: 11px; font-weight: 400; line-height: 1.3; }
.step-trigger, .step-approval { --step-bg: #edf5ff; --step-border: #bdd5ee; --step-color: #2577b8; }
.step-document { --step-bg: #f5effc; --step-border: #d9c3eb; --step-color: #8554ba; }
.step-automation { --step-bg: #edf9f1; --step-border: #b7dfc4; --step-color: #188149; }
.step-condition { --step-bg: #fff6ed; --step-border: #edd4b9; --step-color: #b26819; }
.step-client_request { --step-bg: #fff0f5; --step-border: #ecc4d4; --step-color: #b0466e; }
.step-output { --step-bg: #f0f3f8; --step-border: #d1d8e3; --step-color: #526884; }
.workflow-block { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--step-border); background: var(--step-bg); border-radius: 9px; text-decoration: none; color: #263248; }
article.workflow-block { display: block; padding-bottom: 6px; }
.workflow-block-link { display: flex; align-items: flex-start; gap: 12px; color: inherit; text-decoration: none; }
.workflow-block.is-selected { outline: 2px solid var(--primary); outline-offset: 2px; }
.workflow-block strong { font-size: 14px; }
.workflow-block small, .workflow-branches small { display: block; margin-top: 5px; font-size: 12px; color: #51586b; overflow-wrap: anywhere; }
.workflow-step-number { display: grid; flex: 0 0 36px; height: 36px; place-items: center; background: var(--step-color); border-radius: 8px; color: white; font-weight: 700; }
.workflow-step-controls { display: flex; gap: 6px; margin-top: 8px; }
.workflow-step-controls .btn { color: #51586b; font-size: 12px; padding: 2px 9px; }
/* Reorder buttons big enough to hit (demo review #143); chips show due, assignee and subtasks at a glance (#144). */
.workflow-step-controls .workflow-move { min-width: 34px; min-height: 30px; font-size: 16px; line-height: 1; background: #fff; }
.workflow-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.workflow-chip { padding: 1px 8px; border: 1px solid var(--step-border); border-radius: 999px; background: #fff; color: #3d4557; font-size: 11px; font-weight: 500; }
.workflow-connector { height: 34px; display: grid; place-items: center; color: #738fb4; font-weight: 700; position: relative; }
.workflow-connector::before { content: ""; position: absolute; inset: 0 auto; border-left: 1px solid #c7d5e5; z-index: -1; }
/* The "+" adds a step at that point (close walkthrough, 2026-11-05); a dashed block shows where until it is saved. */
.workflow-insert { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 1px solid #c7d5e5; border-radius: 50%; background: #fff; color: #738fb4; font-weight: 700; line-height: 1; }
.workflow-insert:hover, .workflow-insert:focus-visible, .workflow-insert[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }
.workflow-connector .dropdown-menu { width: min(280px, calc(100vw - 32px)); font-size: 13px; }
.workflow-connector .dropdown-item, .workflow-connector .dropdown-header { white-space: normal; }
.workflow-placeholder { border-style: dashed; }
.workflow-branches { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 8px 0; }
.workflow-branches > div { border: 1px solid var(--line); border-radius: 7px; padding: 10px; background: white; }
.workflow-editor, .workflow-placeholder { scroll-margin-top: 8px; }
.workflow-editor .form-label { font-size: 13px; }
.workflow-editor .form-control, .workflow-editor .form-select { font-size: 13px; }
.workflow-editor .card-header, .workflow-editor .card-footer { padding: 18px; }
.workflow-editor .card-footer { position: sticky; bottom: 0; z-index: 2; border-top: 1px solid var(--line); box-shadow: 0 -6px 14px rgba(15, 23, 42, .06); }
.section-number { display: inline-grid; width: 30px; height: 30px; margin-right: 8px; place-items: center; border-radius: 50%; background: var(--primary); color: white; font-size: 15px; }
.assignment-choice { display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding: 22px; border: 1px solid var(--line); border-radius: 8px; height: 100%; cursor: pointer; }
.assignment-choice span { grid-column: 2; }
.assignment-choice:has(input:checked) { background: #f2f3ff; border-color: var(--primary); }
.assignment-summary { position: sticky; top: calc(var(--sticky-top) + 20px); }
@media (max-width: 1199.98px) {
    .workflow-builder { grid-template-columns: 160px minmax(0, 1fr); gap: 16px; }
    .workflow-editor { grid-column: 2; }
}
@media (max-width: 575.98px) {
    .workflow-builder { grid-template-columns: minmax(0, 1fr); }
    .workflow-editor { grid-column: 1; }
    #workflow-palette-items.show { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .workflow-palette h2, .workflow-palette p { grid-column: 1 / -1; margin: 0; }
    .workflow-palette-item { margin: 0; }
    .assignment-summary { position: static; }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-size: 15px;
    line-height: 1.5;
}

a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .62; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; }

@media (max-width: 575.98px) {
    .posting-allocation-table thead { display: none; }
    .posting-allocation-table tbody tr { display: block; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
    .posting-allocation-table tbody td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; border: 0; overflow-wrap: anywhere; }
    .posting-allocation-table tbody td::before { content: attr(data-label); text-align: left; font-weight: 600; }
    .posting-allocation-table tfoot tr { display: flex; justify-content: space-between; gap: 8px; }
    .posting-allocation-table tfoot th { border: 0; }
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 210px;
    color: #51566c;
    background: var(--sidebar);
    border-right: 1px solid var(--line);
    transition: transform 180ms ease;
}

.app-brand,
.auth-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}

.app-brand {
    height: 70px;
    padding: 0 24px;
    color: var(--ink);
}

.app-brand-mark {
    display: block;
    flex: none;
    width: 34px;
    height: auto;
}

.sidebar-nav { padding: 18px 12px; }

.nav-heading {
    display: block;
    padding: 0 13px 9px;
    color: #6a7187;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border-radius: 6px;
    text-decoration: none;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.active { color: var(--primary-dark); background: #edf0ff; }

.nav-icon {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.main-column { min-height: 100vh; margin-left: 210px; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    height: 70px;
    padding: 0 28px;
    background: var(--surface);
    box-shadow: 0 2px 4px rgba(15, 23, 42, .05);
}

.topbar-spacer { flex: 1; }
/* Superadmin "log in as" (owner, 2026-10-15). */
.impersonation-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 8px 28px; border-bottom: 1px solid #e6b44c; background: #fff4d6; color: #5c4300; font-size: 13px; }
.sidebar-toggle { display: none; }

.icon-button,
.user-menu-button {
    border: 0;
    background: transparent;
    color: var(--muted);
}

.icon-button { padding: 10px; font-size: 21px; }

.user-menu { position: relative; }

.user-menu-button {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px;
    border-radius: 7px;
}

.user-menu-button:hover,
.user-menu-button:focus-visible { background: var(--canvas); }

.avatar {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    color: var(--primary-dark);
    background: #eef0fc;
    font-weight: 700;
}

.user-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    padding: 7px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .12);
}

.user-menu-panel a,
.user-menu-panel button {
    display: block;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 5px;
    color: var(--ink);
    background: transparent;
    text-align: left;
    text-decoration: none;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover { background: var(--canvas); }

.page-content { margin: 0 auto; padding: 26px; }

.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.page-heading h1,
.welcome-card h2,
.panel h2,
.summary-card h2 { margin: 0; }
.page-heading h1 { font-size: 24px; }

.welcome-card,
.panel,
.summary-card {
    background: var(--surface);
    border: 1px solid rgba(233, 233, 239, .8);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .035);
}

.welcome-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 170px;
    padding: 30px;
    border-top: 3px solid var(--primary);
}

.welcome-card h2 { font-size: 26px; }
.welcome-card p:last-child { margin: 8px 0 0; color: var(--muted); }

.role-badge {
    padding: 6px 10px;
    color: #187657;
    background: #daf4ea;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.summary-grid,
.settings-grid {
    display: grid;
    gap: 24px;
    margin-top: 24px;
}

.summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }

.summary-card { display: flex; gap: 18px; padding: 24px; }
.summary-card h2 { font-size: 16px; }
.summary-card p { margin: 6px 0 0; color: var(--muted); }

.summary-icon {
    display: inline-grid;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #187657;
    background: #daf4ea;
    border-radius: 50%;
    font-weight: 800;
}

.summary-icon.muted { color: var(--primary-dark); background: #eef0fc; }

.panel { padding: 26px; }
.panel-heading { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 18px; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); }

.stack-form { display: grid; gap: 18px; margin-top: 22px; }
/* align-content: start keeps a control its own height when a neighboring field in the same row is taller (help text). */
.field { display: grid; align-content: start; gap: 7px; }
.field label { font-weight: 600; }

.field input,
.field select {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    color: var(--ink);
    background: #fff;
}

.field input:focus,
.field select:focus {
    border-color: #aab7f3;
    outline: 3px solid rgba(85, 110, 230, .13);
}

.field-error { margin: 0; color: #d84242; font-size: 13px; }
.check-row { display: flex; align-items: center; gap: 8px; }

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    padding: 10px 17px;
    border: 1px solid var(--primary);
    border-radius: 5px;
    color: #fff;
    background: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.primary-button:hover,
.primary-button:focus-visible { background: var(--primary-dark); border-color: var(--primary-dark); }
.full-width { width: 100%; justify-self: stretch; }

.status-message {
    margin-top: 20px;
    padding: 11px 13px;
    color: #187657;
    background: #e4f7f0;
    border-radius: 5px;
}

.status-message.error { color: #a12a2a; background: #fdeaea; }

.integration-panel { grid-column: 1 / -1; }

.connection-heading,
.connection-title,
.connection-actions {
    display: flex;
    align-items: center;
}

.connection-heading { justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.connection-title { gap: 14px; }
.connection-title h2 { font-size: 18px; }
.connection-title p { margin: 4px 0 0; color: var(--muted); }

.integration-mark {
    display: inline-grid;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #2ca01c;
    font-weight: 800;
    text-transform: uppercase;
}

.connection-badge { padding: 5px 9px; border-radius: 999px; color: var(--muted); background: var(--canvas); font-size: 12px; font-weight: 700; white-space: nowrap; }
.connection-badge.ready { color: var(--primary-dark); background: #eef0fc; }
.connection-badge.connected { color: #187657; background: #daf4ea; }
.connection-copy { margin: 20px 0; color: var(--muted); }
.connection-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.connection-details div { padding: 14px; border: 1px solid var(--line); border-radius: 6px; }
.connection-details dt { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.connection-details dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.connection-actions { gap: 10px; }
.connection-actions form { margin: 0; }

.secondary-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 15px;
    border-radius: 5px;
    background: #fff;
    font-weight: 600;
    text-decoration: none;
}

.secondary-button { border: 1px solid #ced4da; color: var(--ink); }
.danger-button { border: 1px solid #efb1b1; color: #b42f2f; }
.secondary-button:hover,
.secondary-button:focus-visible { background: var(--canvas); }
.danger-button:hover,
.danger-button:focus-visible { background: #fdeaea; }

.config-list { margin: 0 0 18px; padding-left: 22px; }
.callback-label { margin: 0 0 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.callback-uri { display: block; padding: 11px 13px; border-radius: 5px; background: var(--canvas); overflow-wrap: anywhere; }

.transaction-status-message { margin: 0 0 18px; }
.heading-action-group { display: flex; align-items: center; gap: 10px; }
.heading-action-group form { margin: 0; }
.quickbooks-refresh-button { display: inline-flex; width: 38px; height: 38px; padding: 0; align-items: center; justify-content: center; }
.quickbooks-refresh-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.transaction-import-modal-body { display: grid; gap: 18px; }
.transaction-import-copy p { margin: 0 0 3px; color: var(--muted); }
.transaction-import-copy small { color: var(--muted); }
.transaction-import-error { margin: 0; }
.transaction-drop-zone {
    display: grid;
    justify-items: center;
    min-height: 220px;
    padding: 25px;
    border: 2px dashed #c3cbe4;
    border-radius: 9px;
    color: var(--muted);
    background: #f8f9fb;
    text-align: center;
    cursor: pointer;
    transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}
.transaction-drop-zone:hover,
.transaction-drop-zone:focus-visible { border-color: var(--primary); outline: 0; background: rgba(85, 110, 230, .06); }
.transaction-drop-zone.drag-over { border-color: var(--primary); background: rgba(85, 110, 230, .1); box-shadow: 0 0 0 3px rgba(85, 110, 230, .16); }
.transaction-drop-zone.has-file { border-style: solid; border-color: #8bd7bc; background: #f4fcf9; }
.transaction-drop-icon { display: inline-grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: var(--primary); background: rgba(85, 110, 230, .12); }
.transaction-drop-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.transaction-drop-zone p { display: grid; gap: 2px; margin: 10px 0 12px; }
.transaction-drop-zone p strong { color: var(--ink); font-size: 15px; }
.transaction-drop-zone p span { font-size: 12px; }
.transaction-file-button { padding: 7px 13px; color: var(--primary-dark); border-color: #9eacf1; cursor: pointer; }
.transaction-file-name { min-height: 18px; margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.transaction-drop-zone.has-file .transaction-file-name { color: #187657; }
.transaction-example-link { margin-top: 8px; color: var(--primary-dark); font-size: 12px; font-weight: 600; text-decoration: none; }
.transaction-example-link:hover,
.transaction-example-link:focus-visible { text-decoration: underline; }
.import-history-wrap { padding-top: 2px; }
.import-history-wrap h3 { margin: 0 0 9px; font-size: 14px; }
.import-history { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.import-history li { display: grid; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.import-history strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.import-history span { color: var(--muted); font-size: 11px; }

.transaction-connection-callout {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.transaction-connection-callout h2 { margin: 0; font-size: 18px; }
.transaction-connection-callout p { margin: 4px 0 0; color: var(--muted); }
.transaction-connection-callout .primary-button { margin-left: auto; white-space: nowrap; }

.transaction-sync-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 13px 16px;
    border: 1px solid #dfe3f7;
    border-radius: 8px;
    background: #f8f9ff;
    color: var(--muted);
    font-size: 13px;
}

.transaction-sync-strip div { display: flex; align-items: center; gap: 10px; }
.transaction-sync-strip strong { color: var(--ink); }
/* clip, not hidden: a hidden-overflow ancestor would stop the toolbar below from sticking. */
.transaction-list-panel { padding: 0; overflow: clip; }

.transaction-toolbar {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto;
    align-items: center;
    gap: 22px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
}

/* Pinned under the sticky topbar while the list scrolls, like 3P Mercury's Lead Vault and Restock toolbars
   (owner request 2026-09-29). The review tiles scroll away; phones keep the static toolbar. */
@media (min-width: 992px) {
    .transaction-toolbar { position: sticky; top: var(--sticky-top); z-index: 6; background: var(--surface); box-shadow: 0 6px 10px -8px rgba(15, 23, 42, .25); }
}

.transaction-search {
    display: flex;
    width: min(620px, 100%);
    margin-left: auto;
}

.transaction-search input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 9px 13px;
    border: 1px solid #ced4da;
    border-right: 0;
    border-radius: 6px 0 0 6px;
}

.transaction-search input:focus { z-index: 1; border-color: #aab7f3; outline: 3px solid rgba(85, 110, 230, .13); }
.transaction-search .primary-button { flex: 0 0 auto; border-radius: 0 6px 6px 0; }
.transaction-toolbar-actions { display: flex; align-items: center; gap: 9px; }
.filter-button { gap: 8px; }

.transaction-bulk-controls { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 7px; max-width: 100%; }
.transaction-bulk-controls form { margin: 0; }
.transaction-job-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.transaction-job-status [data-review-progress]::before { content: "\00b7"; margin-right: 6px; }
.transaction-job-status [data-analysis-progress][hidden] + [data-review-progress]::before { content: none; }
.transaction-job-status [data-posting-progress]::before { content: "\00b7"; margin-right: 6px; }
.transaction-job-status [data-analysis-progress][hidden] + [data-posting-progress]::before,
.transaction-job-status [data-analysis-progress][hidden] + [data-posting-progress][hidden] + [data-review-progress]::before { content: none; }
.quickbooks-post-status { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.quickbooks-post-table .quickbooks-post-select { width: 32px; }
.quickbooks-post-table tr.is-blocked td { color: var(--muted); }
.quickbooks-post-client th { background: #f8f8fb; font-size: 12px; }
.quickbooks-post-skipped { margin-top: 16px; }
.quickbooks-post-skipped summary { cursor: pointer; font-weight: 600; }
.quickbooks-post-changes { list-style: none; margin: 0; padding: 0; }
.quickbooks-outbox { display: flex; align-items: center; margin-right: 8px; }
.quickbooks-outbox-button { white-space: nowrap; }
/* The button lays out as flex, which drops the space before the count. */
.quickbooks-outbox-count { margin-left: .3em; }
.quickbooks-post-changes li + li { margin-top: 2px; }
/* A notification toast opens the records it is about. */
.toast-link { cursor: pointer; }
.transaction-select-visible { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--muted); font-size: 11px; white-space: nowrap; }
.transaction-select-visible input,
.transaction-row-select { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.transaction-row-select:disabled { cursor: not-allowed; opacity: .35; }
.transaction-action-menu-button { width: 42px; height: 42px; padding: 0; font-size: 24px; line-height: 1; }
.transaction-action-menu-button::after { display: none; }
.transaction-import-button { min-height: 42px; gap: 7px; padding: 9px 13px; }
.transaction-import-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.transaction-toolbar-actions .dropdown-menu { min-width: 220px; }

.filter-count {
    display: inline-grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    color: #fff;
    background: var(--primary);
    font-size: 11px;
}

.transaction-table-wrap { overflow-x: auto; }
.transaction-table { width: 100%; min-width: 1170px; border-collapse: collapse; }
.transaction-review-table { min-width: 1040px; }
.transaction-review-table th,
.transaction-review-table td { padding-right: 12px; padding-left: 12px; }
.transaction-table th,
.transaction-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.transaction-table th { color: var(--muted); background: #fafafd; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.transaction-table tbody tr:hover { background: #fafbff; }
.transaction-table tbody tr.is-selected { background: #f1f3ff; }
.transaction-table tbody tr:last-child td { border-bottom: 0; }
.transaction-table td { font-size: 14px; }
.transaction-table .transaction-selection-column { width: 52px; padding-right: 5px; text-align: center; }
.transaction-table .money-column { text-align: right; white-space: nowrap; }
.transaction-table .money-column small { margin-left: 3px; color: var(--muted); font-size: 10px; }

.transaction-type-badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--primary-dark);
    background: #eef0fc;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.transaction-source { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.transaction-name-cell { display: block; min-width: 0; }
/* Notes on a row and the row actions menu (owner, 2026-10-15). */
.transaction-note-indicator { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 6px; border: 1px solid #d9def3; border-radius: 4px; background: #f4f6fe; color: var(--primary); font-size: 11px; font-weight: 600; line-height: 1.5; vertical-align: 1px; }
.transaction-note-indicator svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.transaction-note-indicator:hover, .transaction-note-indicator:focus-visible { border-color: #9daaf4; background: #eef0ff; }
.transaction-table td.col-actions { padding-right: 10px; padding-left: 0; text-align: right; }
.transaction-row-menu-button { display: inline-grid; width: 32px; height: 32px; padding: 0; place-items: center; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.transaction-row-menu-button:hover, .transaction-row-menu-button:focus-visible, .transaction-row-menu-button[aria-expanded="true"] { border-color: #d9def3; background: #eef0ff; color: var(--primary); }
.transaction-row-menu .dropdown-menu { font-size: 14px; }
.transaction-memo { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.transaction-review { width: 300px; min-width: 260px; }
.transaction-review-table .transaction-review { width: 260px; min-width: 235px; }
.transaction-review > strong,
.transaction-review > small { display: block; }
.transaction-review > small,
.analysis-state { color: var(--muted); font-size: 11px; }
.analysis-state.failed { color: #b42f2f; }
.ai-suggestion { padding: 10px; border: 1px solid #dfe3f7; border-left: 3px solid var(--primary); border-radius: 6px; background: #fafbff; }
.transaction-review .ai-suggestion + .ai-suggestion { margin-top: 8px; }
.ai-suggestion.anomaly-review { border-left-color: #d99a25; background: #fffaf0; }
.ai-suggestion.anomaly-high { border-left-color: #d84242; background: #fff5f5; }
.ai-suggestion > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ai-suggestion > div:first-child span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.ai-suggestion p { margin: 6px 0 8px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.ai-rule-candidate { margin: 8px 0; padding: 7px 8px; border-left: 2px solid var(--primary); background: #f2f4ff; font-size: 11px; }
.ai-rule-candidate strong,
.ai-rule-candidate span { display: block; }
.ai-rule-candidate span { margin-top: 2px; color: var(--muted); }
.repeatable-opportunity { display: grid; gap: 6px; margin-top: 8px; padding: 10px; border: 1px solid #b8dfd0; border-radius: 8px; background: #f1fbf7; font-size: 11px; }
.repeatable-opportunity > span { color: var(--muted); }
.repeatable-opportunity .small-review-button { justify-self: start; }
.anomaly-badge { display: inline-flex; margin-top: 6px; padding: 3px 6px; border-radius: 999px; color: #955f09; background: #fbe9bd; font-size: 10px; font-weight: 700; }
.anomaly-high .anomaly-badge { color: #a12a2a; background: #fbd6d6; }
.suggestion-actions { display: flex; gap: 6px; }
.suggestion-actions form { margin: 0; }
.small-review-button { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 4px; background: #fff; font-size: 11px; font-weight: 700; text-decoration: none; }
.small-review-button.approve { border: 1px solid #8bd7bc; color: #187657; }
.small-review-button.reject { border: 1px solid #efb1b1; color: #b42f2f; }
.small-review-button.rule,
.small-review-button.change { border: 1px solid #c8cff4; color: var(--primary); }
.small-review-button.analyze { border: 1px solid #9daaf4; color: var(--primary); }
.small-review-button.analyze:disabled { cursor: wait; opacity: .7; }
.small-review-button.approve:hover,
.small-review-button.approve:focus-visible { background: #e4f7f0; }
.small-review-button.reject:hover,
.small-review-button.reject:focus-visible { background: #fdeaea; }
.small-review-button.rule:hover,
.small-review-button.rule:focus-visible,
.small-review-button.change:hover,
.small-review-button.change:focus-visible { background: #eef0ff; }
.small-review-button.analyze:hover,
.small-review-button.analyze:focus-visible { background: #eef0ff; }
.transaction-row-analysis-form { margin-top: 7px; }
.transaction-empty { padding: 58px 24px !important; color: var(--muted); text-align: center !important; }

@media (min-width: 1200px) {
    .transaction-review-table { min-width: 0; table-layout: fixed; }
    /* Named columns, so hiding Client (one client) keeps the proportions. */
    .transaction-review-table th.transaction-selection-column { width: 4%; }
    .transaction-review-table th.col-client { width: 12%; }
    .transaction-review-table th.col-date { width: 8%; }
    .transaction-review-table th.col-type { width: 8%; }
    .transaction-review-table th.col-name { width: 28%; }
    .transaction-review-table th.col-review { width: 27%; }
    .transaction-review-table th.col-amount { width: 9%; }
    .transaction-review-table th.col-actions { width: 4%; }
    .transaction-review-table .transaction-review { width: auto; min-width: 0; }
}

.transaction-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 24px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.transaction-pagination > div { display: flex; gap: 5px; }
.pagination-link { display: inline-grid; min-width: 34px; min-height: 34px; place-items: center; padding: 5px 9px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); text-decoration: none; }
.pagination-link:hover,
.pagination-link:focus-visible,
.pagination-link.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.pagination-link.disabled { color: #adb2bd; background: var(--canvas); }

.offcanvas-backdrop {
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(15, 23, 42, .42);
    opacity: 0;
    transition: opacity 180ms ease;
}

.filter-offcanvas {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 50;
    width: min(470px, 100vw);
    background: var(--surface);
    box-shadow: -18px 0 50px rgba(15, 23, 42, .18);
    transform: translateX(100%);
    transition: transform 180ms ease;
}

.offcanvas-backdrop.open { opacity: 1; }
.filter-offcanvas.open { transform: translateX(0); }
.offcanvas-open { overflow: hidden; }
.filter-form { display: grid; grid-template-rows: auto 1fr auto; height: 100%; }

.filter-header,
.filter-footer { display: flex; align-items: center; gap: 12px; padding: 20px 24px; }
.filter-header { justify-content: space-between; border-bottom: 1px solid var(--line); }
.filter-header h2 { margin: 0; font-size: 20px; }
.filter-header .eyebrow { margin-bottom: 2px; }
.offcanvas-close { width: 38px; height: 38px; border: 0; border-radius: 50%; color: var(--muted); background: var(--canvas); font-size: 25px; line-height: 1; }
.offcanvas-close:hover,
.offcanvas-close:focus-visible { color: var(--ink); background: #e8eaf0; }
.filter-body { padding: 24px; overflow-y: auto; }
.filter-body > * + * { margin-top: 22px; }
.filter-group { margin-inline: 0; padding: 18px; border: 1px solid var(--line); border-radius: 8px; }
.filter-group legend { padding: 0 6px; font-weight: 700; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.filter-footer { border-top: 1px solid var(--line); background: #fafafd; }

.auth-body {
    min-height: 100vh;
    background: #f8f7fb;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(480px, .92fr);
    min-height: 100vh;
}

.auth-promo {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 52px clamp(42px, 7vw, 110px);
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 78% 22%, rgba(66, 211, 167, .28), transparent 30%),
        radial-gradient(circle at 12% 82%, rgba(129, 145, 255, .25), transparent 34%),
        linear-gradient(145deg, #252b42 0%, #303957 56%, #253e48 100%);
}

.auth-promo::after {
    position: absolute;
    right: -110px;
    bottom: -150px;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
    box-shadow: 0 0 0 55px rgba(255, 255, 255, .025), 0 0 0 110px rgba(255, 255, 255, .02);
    content: "";
}

.auth-promo .auth-brand { color: #fff; }

.auth-promo-copy {
    position: relative;
    z-index: 1;
    max-width: 690px;
    margin: auto 0;
    padding: 70px 0;
}

.auth-kicker,
.auth-card-kicker {
    margin: 0 0 13px;
    color: #54d6aa;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.auth-promo-copy .auth-promo-title {
    max-width: 650px;
    margin: 0;
    color: var(--bs-heading-color, inherit);
    font-weight: 500;
    font-size: clamp(42px, 5vw, 72px);
    line-height: 1.06;
    letter-spacing: -.045em;
}

.auth-promo-copy > p:not(.auth-kicker):not(.auth-promo-title) {
    max-width: 610px;
    margin: 25px 0 0;
    color: #dce1ef;
    font-size: 19px;
}

.auth-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.auth-benefits li {
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    font-size: 13px;
    font-weight: 600;
}

.auth-product-note {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #aeb7ce;
    font-size: 12px;
}

.auth-form-panel {
    display: grid;
    align-content: center;
    justify-items: center;
    min-height: 100vh;
    padding: 44px;
    background:
        radial-gradient(circle at 90% 8%, rgba(85, 110, 230, .12), transparent 27%),
        linear-gradient(145deg, #fbfaff 0%, #f4f5fa 100%);
}

.auth-card {
    width: min(520px, 100%);
    padding: 40px;
    background: var(--surface);
    border: 1px solid rgba(85, 110, 230, .15);
    border-top: 4px solid var(--primary);
    border-radius: 18px;
    box-shadow: 0 18px 55px rgba(42, 48, 66, .12);
}

.auth-brand-mobile { display: none; color: var(--ink); }
.auth-intro { text-align: left; }
.auth-intro h1 { margin: 0; font-size: 29px; line-height: 1.2; letter-spacing: -.025em; }
.auth-intro p { margin: 7px 0 0; color: var(--muted); }
.auth-intro .auth-card-kicker { margin-bottom: 9px; color: var(--primary); }
.auth-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.auth-privacy-note { margin: 15px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.auth-switch { margin: 22px 0 0; padding-top: 19px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.auth-switch a,
.auth-privacy-note a { color: var(--primary-dark); font-weight: 700; }
.auth-footer { margin: 20px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 1040px) {
    .auth-shell { grid-template-columns: minmax(0, .9fr) minmax(460px, 1.1fr); }
    .auth-promo { padding: 42px; }
    .auth-promo-copy .auth-promo-title { font-size: 48px; }
    .auth-promo-copy > p:not(.auth-kicker):not(.auth-promo-title) { font-size: 17px; }
    .auth-form-panel { padding: 34px; }
}

@media (max-width: 820px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar-open .sidebar { transform: translateX(0); box-shadow: 12px 0 30px rgba(15, 23, 42, .2); }
    .sidebar-open .main-column::before { position: fixed; z-index: 19; inset: 0; background: rgba(15, 23, 42, .35); content: ""; }
    .main-column { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .page-content { padding: 22px 18px; }
    .summary-grid,
    .settings-grid { grid-template-columns: 1fr; }
    .connection-heading { align-items: flex-start; }
    .connection-details { grid-template-columns: 1fr; }
    .transaction-toolbar { grid-template-columns: 1fr; }
    .import-history { grid-template-columns: 1fr; }
    .transaction-search { width: 100%; }
    .auth-shell { display: block; }
    .auth-promo { display: none; }
    .auth-form-panel { min-height: 100vh; padding: 28px; }
    .auth-brand-mobile { display: flex; margin-bottom: 30px; }
}

@media (max-width: 520px) {
    .topbar { padding: 0 14px; }
    .user-menu-name { display: none; }
    .welcome-card { align-items: flex-start; gap: 20px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
    .heading-action-group { flex-wrap: wrap; }
    .auth-form-panel { padding: 18px; }
    .auth-card { padding: 28px 22px; border-radius: 13px; }
    .auth-field-grid { grid-template-columns: 1fr; }
    .transaction-connection-callout { align-items: flex-start; flex-wrap: wrap; }
    .transaction-drop-zone { min-height: 200px; padding: 22px 16px; }
    .transaction-connection-callout .primary-button { width: 100%; margin-left: 0; }
    .transaction-sync-strip { align-items: flex-start; flex-direction: column; }
    .transaction-toolbar { display: flex; align-items: stretch; flex-direction: column; gap: 15px; padding: 18px; }
    .transaction-toolbar-actions { justify-content: flex-end; }
    .transaction-bulk-controls { margin-right: auto; }
    .transaction-table-wrap { overflow: visible; }
    .transaction-table thead { display: none; }
    .transaction-table,
    .transaction-table tbody,
    .transaction-table tr,
    .transaction-table td { display: block; width: 100%; }
    .transaction-table { min-width: 0; }
    .transaction-table tbody { padding: 10px 14px; }
    .transaction-table tr { margin: 10px 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 7px rgba(15, 23, 42, .035); }
    .transaction-table td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); text-align: right; }
    .transaction-table td::before { color: var(--muted); content: attr(data-label); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
    .transaction-table td:last-child { border-bottom: 0; }
    .transaction-table .money-column { text-align: right; }
    .transaction-memo { max-width: none; white-space: normal; }
    .transaction-review { min-width: 0; text-align: left !important; }
    .transaction-review .ai-suggestion { grid-column: 1 / -1; }
    .transaction-empty { display: block !important; }
    .transaction-empty::before { content: none !important; }
    .transaction-pagination { align-items: stretch; flex-direction: column; padding: 18px; }
    .transaction-pagination > div { overflow-x: auto; }
    .filter-grid { grid-template-columns: 1fr; }
    .filter-header,
    .filter-body,
    .filter-footer { padding-inline: 18px; }
}

.notification-button {
    position: relative;
    display: inline-grid;
    width: 42px;
    height: 42px;
    margin-right: 8px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 7px;
}

.notification-button:hover,
.notification-button:focus-visible {
    border-color: var(--primary);
    background: #f8f9ff;
}

.notification-button svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.notification-button.has-unread { border-color: var(--primary); }
.notification-button.has-unread svg { color: #d99a25; }

.notification-button.has-unread::after {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 7px;
    height: 7px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: #d99a25;
    content: "";
}

.app-notifications-modal-dialog { max-width: min(720px, calc(100vw - 24px)); }
.notification-modal-body { max-height: min(64vh, 580px); overflow-y: auto; }
.notification-modal-footer #app-notifications-dismiss-all { margin-right: auto; }

.notification-empty {
    margin: 0;
    padding: 28px 20px;
    color: var(--muted);
    text-align: center;
}

.notification-empty.error { color: #b42f2f; }

.notification-item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.notification-item:last-child { border-bottom: 0; }
.notification-item:hover { background: #f8f9ff; }

.notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.notification-item.is-unread .notification-dot { background: #d99a25; }

.notification-content { display: grid; min-width: 0; gap: 3px; }
.notification-content strong { line-height: 1.3; }
.notification-content span,
.notification-content small { color: var(--muted); }
.notification-content small { margin-top: 2px; font-size: 12px; }

.notification-actions { display: inline-flex; align-items: center; gap: 7px; }
.notification-actions .primary-button,
.notification-actions .danger-button { padding: 7px 11px; font-size: 13px; }

.button-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: button-spin 700ms linear infinite;
}

.button-status-icon {
    display: inline-grid;
    width: 18px;
    height: 18px;
    margin-right: 7px;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
}

.primary-button.async-action-complete { border-color: #187657; background: #187657; }
.primary-button.async-action-failed { border-color: #b42f2f; background: #b42f2f; }

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

@media (max-width: 575.98px) {
    .user-menu-name { display: none; }

    .notification-item { grid-template-columns: 10px minmax(0, 1fr); }
    .notification-actions { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
    .button-spinner { animation-duration: 1.4s; }
}

/* Client command center and review rules */
.client-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.summary-card {
    display: grid;
    gap: 4px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 3px 12px rgb(37 47 74 / 5%);
}

.summary-card span,
.summary-card small { color: var(--muted); }
.summary-card strong { font-size: 28px; line-height: 1.1; }
.summary-card a { color: var(--accent); font-weight: 700; text-decoration: none; }
.client-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.safe-mode-note {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border: 1px solid #b9ded0;
    border-radius: 999px;
    color: #28745d;
    background: #eefaf5;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.client-command-list,
.rule-list { border-top: 1px solid var(--line); }

.client-command-row,
.rule-list-row {
    display: grid;
    grid-template-columns: auto minmax(190px, 1.5fr) repeat(4, minmax(95px, .75fr)) auto auto;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
    transition: background-color 140ms ease;
}

.client-command-row:hover,
.client-command-row:focus-visible,
.rule-list-row:hover,
.rule-list-row:focus-visible { color: var(--text); background: #f8f9ff; }
.client-command-row.is-archived { opacity: .65; }
.client-command-row > span:not(.client-avatar),
.rule-list-row > span { display: grid; gap: 2px; min-width: 0; }
.client-command-row small,
.rule-list-row small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.client-avatar {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(145deg, var(--accent), #7a6ce7);
    font-weight: 800;
}

.client-avatar.large { width: 52px; height: 52px; border-radius: 14px; font-size: 20px; }
.client-command-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-text { color: #966c1e; }
.connection-text.connected { color: #28745d; }

.workflow-pill {
    display: inline-flex !important;
    width: max-content;
    padding: 5px 9px;
    border-radius: 999px;
    color: #5f6680;
    background: #eef0f7;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.status-in_progress,
.status-active,
.status-pending { color: #3558a5; background: #edf2ff; }
.status-waiting,
.status-conflict,
.status-overridden { color: #9a5d1b; background: #fff2df; }
.status-review,
.status-preview { color: #6746a7; background: #f1eaff; }
.status-complete,
.status-approved { color: #28745d; background: #eaf8f2; }
.status-paused,
.status-rejected,
.status-stale { color: #8b4b4b; background: #faeded; }

.client-empty-state { display: grid; justify-items: center; gap: 10px; padding: 54px 24px; text-align: center; }
.client-empty-state h2,
.client-empty-state p { margin: 0; }
.client-empty-state p { max-width: 560px; color: var(--muted); }
.focused-form-panel,
.rule-form-panel { max-width: 960px; margin: 0 auto; }
.rule-sentence-builder { display: grid; gap: 12px; padding: 18px; border: 1px solid #cad3ff; border-radius: 12px; background: #f8f9ff; }
.rule-sentence-builder h3 { margin: 0; font-size: 18px; }
.rule-sentence { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.rule-sentence > strong { color: var(--muted); font-size: 13px; }
.rule-sentence > input,
.rule-sentence > select { min-height: 42px; flex: 1 1 190px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 9px 11px; }
.rule-primary-condition { flex: 4 1 500px; }
.rule-advanced-options { border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.rule-advanced-options > summary { cursor: pointer; padding: 15px 18px; font-weight: 800; }
.rule-advanced-options[open] > summary { border-bottom: 1px solid var(--line); }
.rule-advanced-body { display: grid; gap: 18px; padding: 18px; }
.client-form-grid,
.rule-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.client-form-wide,
.rule-form-wide { grid-column: 1 / -1; }
.client-active-toggle { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; }
.client-active-toggle span { display: grid; gap: 3px; }
.client-active-toggle small { color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }

.page-parent-link { color: var(--primary); text-decoration: none; }
.page-parent-link:hover,
.page-parent-link:focus-visible { color: var(--primary); text-decoration: underline; }

/* 18px, as on phones, so a QuickBooks client's main tabs fit a 1280 laptop with an overflow page open (owner, 2026-10-15). */
.client-workspace-nav {
    display: flex;
    gap: 18px;
    margin: -8px 0 20px;
    padding: 0 20px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.client-workspace-nav > a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 13px 1px 11px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.client-workspace-nav > a:hover,
.client-workspace-nav > a:focus-visible,
.client-workspace-nav > a.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.client-workspace-nav > a span { padding: 1px 6px; border-radius: 999px; background: #eef0f7; font-size: 11px; }
/* Less-used client pages (owner, 2026-10-15): the bar carries the tab strip's frame so the menu can sit outside the
   scrolling, phone-faded tabs. */
.client-workspace-bar { display: flex; align-items: stretch; margin: -8px 0 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.client-workspace-bar > .client-workspace-nav { flex: 1 1 auto; min-width: 0; margin: 0; border-bottom: 0; background: none; }
.client-workspace-more { display: flex; flex: none; align-items: center; padding-right: 12px; }
.client-workspace-more-button { padding: 8px 6px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 20px; line-height: 1; }
.client-workspace-more-button:hover, .client-workspace-more-button:focus-visible, .client-workspace-more-button[aria-expanded="true"] { color: var(--primary-dark); }

.client-workspace-summary { margin-bottom: 16px; padding: 22px; }
.client-workspace-identity { display: flex; align-items: center; gap: 14px; }
.client-workspace-identity p { margin: 3px 0 0; color: var(--muted); }
.client-workspace-title-line { display: flex; align-items: center; gap: 10px; }
.client-workspace-title-line h2 { font-size: 20px; }
.client-workspace-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin: 20px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.client-workspace-metrics div { min-width: 0; padding: 12px 14px; background: var(--surface); }
.client-workspace-metrics dt { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.client-workspace-metrics dd { margin: 3px 0 0; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.client-attention-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding: 13px 16px;
    border: 1px solid #f0d5ad;
    border-radius: 8px;
    color: #7d5019;
    background: #fff8ed;
}

.client-attention-strip.is-clear { border-color: #c9e5db; color: #28745d; background: #f1faf6; }
.client-attention-strip > div { display: flex; align-items: center; gap: 11px; }
.client-attention-strip svg { flex: 0 0 auto; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.client-attention-strip > div > span { display: grid; }
.client-attention-strip small { color: var(--muted); }
.client-attention-strip > a { flex: 0 0 auto; color: inherit; font-weight: 800; text-decoration: none; }
.client-attention-strip > a:hover,
.client-attention-strip > a:focus-visible { text-decoration: underline; }

.client-workspace-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 20px; align-items: start; }
.rule-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.rule-impact-panel { margin-bottom: 20px; }
.rule-impact-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 0 20px 20px; }
.rule-impact-grid > div { display: grid; gap: 3px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfe; }
.rule-impact-grid strong { font-size: 24px; }
.rule-impact-grid span,
.rule-impact-note { color: var(--muted); font-size: 12px; }
.rule-impact-grid .has-warning { border-color: #e9c273; background: #fff9ed; }
.rule-impact-note { margin: -8px 20px 18px; }
.client-workspace-aside { display: grid; gap: 20px; }
.client-detail-card .panel-heading { padding-bottom: 16px; }
.client-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--line); }
.client-facts div { display: grid; gap: 4px; padding: 13px; background: var(--surface); }
.client-facts dt { color: var(--muted); font-size: 12px; }
.client-facts dd { margin: 0; font-weight: 700; }
.client-recent-panel { min-width: 0; }
.qbo-client-card { scroll-margin-top: 8px; }
.qbo-client-card .connection-heading { align-items: flex-start; }
.qbo-client-card .connection-title { align-items: flex-start; }
.qbo-client-card .connection-details { grid-template-columns: 1fr; }
.qbo-client-card .connection-actions { align-items: stretch; flex-wrap: wrap; }

.rules-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
    padding: 24px;
    border: 1px solid #dfe2f1;
    border-radius: 13px;
    background: linear-gradient(135deg, #fbfbff, #f3f6ff);
}

.rules-intro h2,
.rules-intro p { margin-bottom: 4px; }
.rules-intro p { color: var(--muted); }
.rule-list-row { grid-template-columns: auto minmax(220px, 1.5fr) minmax(150px, 1fr) 100px auto auto; }
.rule-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #9ba1b5; }
.rule-status-dot.status-active { background: #39a77f; }
.rule-status-dot.status-draft { background: #7d72df; }
.rule-status-dot.status-paused { background: #d49346; }

.rule-builder,
.rule-scope { display: grid; gap: 14px; margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 11px; }
.rule-builder-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.rule-builder-heading legend,
.rule-scope > legend { float: none; width: auto; margin: 0; font-size: 17px; font-weight: 800; }
.rule-builder-heading p,
.scope-targets p { margin: 3px 0 0; color: var(--muted); }
.rule-condition-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr) 38px; gap: 8px; margin-top: 9px; }
.rule-condition-row input, .rule-condition-row select { min-width: 0; width: 100%; padding: 8px; border: 1px solid #ced4da; border-radius: 5px; background: white; }
.rule-condition-row .rule-remove-condition { grid-column: -2 / -1; }
.rule-form-panel { max-width: none; }
.field textarea { width: 100%; padding: 10px 12px; border: 1px solid #ced4da; border-radius: 6px; }
.rule-remove-condition { width: 38px; border: 1px solid #efd0d0; border-radius: 7px; color: #a63d3d; background: #fff7f7; font-size: 21px; }
.rule-condition-validation { grid-column: 1 / -1; margin: 0; }
.scope-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.scope-choice { display: flex; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.scope-choice:has(input:checked) { border-color: #8b84dc; background: #f6f5ff; }
.scope-choice span { display: grid; gap: 4px; }
.scope-choice small { color: var(--muted); }
.scope-targets { padding-top: 8px; }
.scope-targets h3 { margin: 0 0 7px; font-size: 14px; }
.scope-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.scope-checkboxes label { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fafbfe; }
.rule-detail-title { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: var(--muted); }
.rule-condition-summary { display: grid; gap: 10px; margin: 0; padding-left: 23px; }
.rule-results-panel { margin-top: 20px; }
.rule-results-panel .transaction-table td > strong,
.rule-results-panel .transaction-table td > small { display: block; }
.rule-results-panel .transaction-table td > strong { overflow-wrap: anywhere; }
.rule-results-panel .transaction-table .workflow-pill + strong { margin-top: 5px; }

@media (min-width: 768px) {
    .rule-results-panel .transaction-table { min-width: 900px; }
}

@media (max-width: 1100px) {
    .client-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .client-workspace-grid { grid-template-columns: 1fr; }
    .client-workspace-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .client-command-row { grid-template-columns: auto minmax(180px, 1fr) repeat(2, minmax(95px, .7fr)) auto auto; }
    .client-command-row > span:nth-child(4),
    .client-command-row > span:nth-child(5) { display: none; }
    .rule-list-row { grid-template-columns: auto minmax(200px, 1fr) 130px auto auto; }
    .rule-list-row > span:nth-child(3) { display: none; }
}

@media (max-width: 767.98px) {
    .client-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .client-summary-grid .summary-card { padding: 16px; }
    .client-command-name strong { white-space: normal; }
    .rule-detail-grid,
    .rule-impact-grid,
    .client-form-grid,
    .rule-form-grid,
    .scope-choice-grid { grid-template-columns: 1fr; }
    .client-command-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .client-command-row > span:not(.client-avatar):not(.client-command-name):not(.workflow-pill),
    .client-command-row > span:last-child { display: none; }
    .rule-list-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .rule-list-row > span:nth-child(4),
    .rule-list-row > span:last-child { display: none; }
    /* Field and operator on the first line; value (and upper value) with the remove button on the second. */
    .rule-condition-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 38px; }
    .rule-condition-row > [data-rule-condition-operator] { grid-column: span 2; }
    .rule-remove-condition { grid-column: 2; justify-self: end; }
    .client-list-heading,
    .rules-intro,
    .rule-builder-heading { align-items: flex-start; flex-direction: column; }
    .rule-sentence { align-items: stretch; flex-direction: column; }
    .rule-sentence > input,
    .rule-sentence > select,
    .rule-primary-condition { width: 100%; flex-basis: auto; }
    .client-workspace-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .client-workspace-metrics div:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .client-workspace-aside { grid-template-columns: 1fr; }
    .client-attention-strip { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
    .client-workspace-nav { gap: 22px; margin-right: -18px; margin-left: -18px; padding: 0 18px; }
    .client-workspace-bar { margin-right: -18px; margin-left: -18px; }
    .client-workspace-summary { padding: 18px; }
    .client-workspace-title-line { align-items: flex-start; flex-direction: column; gap: 6px; }
    .client-workspace-metrics { grid-template-columns: 1fr; }
}

.transaction-detail-button { padding: 0; border: 0; background: none; color: var(--primary-dark); text-align: left; font-weight: 600; overflow-wrap: break-word; }
.transaction-detail-button:hover, .transaction-detail-button:focus-visible { text-decoration: underline; }
.transaction-review-layout > * { min-width: 0; }
.transaction-detail-panel { margin: 12px; align-self: start; scroll-margin-top: 8px; }
.transaction-detail-panel .card-header { padding: 18px; }
.transaction-detail-panel .nav-link { padding: 8px 10px; }
.transaction-detail-panel .nav-tabs { flex-wrap: nowrap; }
.transaction-detail-panel .nav-link .badge { margin-left: 2px; font-size: 11px; }
@media (min-width: 1200px) {
    .transaction-review-layout.has-detail { display: grid; grid-template-columns: minmax(0, 1fr) 370px; }
    /* Column classes, not positions: the Client column is optional (Codex review R1). */
    .has-detail .transaction-review-table .col-client,
    .has-detail .transaction-review-table .col-type { display: none; }
    .has-detail .transaction-review-table th.transaction-selection-column { width: 7%; }
    .has-detail .transaction-review-table th.col-date { width: 16%; }
    .has-detail .transaction-review-table th.col-name { width: 22%; }
    .has-detail .transaction-review-table th.col-review { width: 30%; }
    .has-detail .transaction-review-table th.col-amount { width: 18%; }
    .has-detail .transaction-review-table th.col-actions { width: 7%; }
    .has-detail .transaction-review-table .ai-suggestion p,
    .has-detail .transaction-review-table .ai-rule-candidate { display: none; }
    .has-detail .transaction-review-table th, .has-detail .transaction-review-table td { padding: 12px 8px; }
}

/* Books report package (screen and print). */
.report-table td, .report-table th { white-space: nowrap; }
.report-table td:first-child { white-space: normal; }
.report-table .report-section th { background: #f3f5f8; font-weight: 600; }
/* Footer spacer rows are only shown when printing (reports/print). */
.report-print-spacer { display: none; }
.report-table .report-end td { border: 0; padding: 0; height: 0; line-height: 0; }
.report-table .report-header td { font-weight: 600; }
.report-table .report-total td { font-weight: 600; border-top: 1px solid #adb5bd; }
.report-table .report-computed td { font-weight: 600; background: #fafbfc; }
.report-table .report-net td { font-weight: 700; border-top: 1px solid #212529; border-bottom: 3px double #212529; }
.report-notes { padding-left: 1.5rem; }

/* Bootstrap components use the Decyml brand color, matching the app's own buttons. */
:root { --bs-primary: #556ee6; --bs-primary-rgb: 85, 110, 230; --bs-link-color: #556ee6; --bs-link-color-rgb: 85, 110, 230; --bs-link-hover-color: #4458b8; --bs-link-hover-color-rgb: 68, 88, 184; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary-dark); --bs-btn-hover-border-color: var(--primary-dark); --bs-btn-active-bg: var(--primary-dark); --bs-btn-active-border-color: var(--primary-dark); --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary); }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-active-bg: var(--primary-dark); --bs-btn-active-border-color: var(--primary-dark); --bs-btn-disabled-color: var(--primary); --bs-btn-disabled-border-color: var(--primary); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* The client overview's recent-activity table has five columns and fits its card. */
.client-recent-panel .transaction-table { min-width: 0; }

/* One client selected: its name is in the page header, so the Client column is hidden. */
.transaction-review-table.single-client .col-client { display: none; }
/* AI explanations show two lines in the list; the detail panel has the full text. */
.transaction-review-table .ai-suggestion p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 520px) {
    /* Phone cards keep date, name, account and amount; the type is in the detail panel. */
    .transaction-review-table td.col-type { display: none; }
}

/* Statement review: rows beside the original PDF on wide screens, and a sticky confirm bar with the live balance check. */
.statement-pdf-pane { display: none; }
@media (min-width: 1200px) {
    .statement-review-layout.with-pdf { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
    .statement-review-layout.with-pdf .statement-pdf-pane { display: block; position: sticky; top: calc(var(--sticky-top) + 14px); height: calc(100vh - var(--sticky-top) - 30px); }
}
.statement-pdf-pane iframe { width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.statement-rows-table { min-width: 560px; }
.statement-rows-table .col-date { width: 142px; }
.statement-rows-table .col-check { width: 90px; }
.statement-rows-table th { white-space: nowrap; }
.statement-rows-table .form-control { padding-right: 8px; padding-left: 8px; }
/* Placeholders label the fields on phones, where the header row is hidden; on wider screens the headers do. */
@media (min-width: 576px) {
    .statement-rows-table .form-control::placeholder { color: transparent; }
}
.statement-rows-table .col-amount { width: 112px; }
.statement-rows-table .col-remove { width: 34px; }
/* Phones: each statement row is a small card (date and amount, then description, then check number). */
@media (max-width: 575.98px) {
    .statement-rows-table { display: block; min-width: 0; }
    .statement-rows-table thead,
    .statement-rows-table colgroup { display: none; }
    .statement-rows-table tbody { display: block; width: 100%; }
    .statement-rows-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; grid-template-areas: "date amount remove" "desc desc desc" "check check check"; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
    .statement-rows-table td { display: block; padding: 0; border: 0; }
    .statement-rows-table td:nth-child(1) { grid-area: date; }
    .statement-rows-table td:nth-child(2) { grid-area: desc; }
    .statement-rows-table td:nth-child(3) { grid-area: check; }
    .statement-rows-table td:nth-child(4) { grid-area: amount; }
    .statement-rows-table td:nth-child(5) { grid-area: remove; align-self: center; }
}
.statement-rows-table td { padding: 4px 4px; vertical-align: middle; }
.statement-row-remove { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 20px; line-height: 1; }
.statement-row-remove:hover, .statement-row-remove:focus-visible { color: #b42318; background: #fdecea; }
.statement-confirm-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 -4px 14px rgba(15, 23, 42, .07); }
.statement-balance-status { flex-basis: 100%; font-size: 13px; font-weight: 600; }
.statement-balance-status[data-state="balanced"] { color: #0f7b4b; }
.statement-balance-status[data-state="off"] { color: #b42318; }
.statement-balance-status[data-state="unknown"] { color: var(--muted); }
.statement-confirm-bar .form-check { flex: 1 1 320px; }
.check-pdf-frame { display: block; width: 100%; height: min(70vh, 720px); border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.statement-danger-zone { margin-top: 32px; padding: 16px; border: 1px solid #f1c9c5; border-radius: 8px; background: #fffafa; }

/* Client workspace tabs on small screens: tighter, with a fade that shows more tabs scroll into view. */
.client-workspace-nav { scrollbar-width: thin; }
@media (max-width: 767.98px) {
    .client-workspace-nav { gap: 18px; padding: 0 14px; -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
    .client-recent-panel .recent-type { display: none !important; }
}

/* The avatar gradient used an undefined --accent, which dropped the whole background and hid the white initial. */
.client-avatar { background: linear-gradient(145deg, var(--primary), #7a6ce7); }
/* Clients whose books are in Decyml have no QuickBooks card, so recent activity uses the full width. */
.client-workspace-grid.single { grid-template-columns: minmax(0, 1fr); }

/* Phone transaction cards: name and amount on the first line, date and category below, checkbox at the side. */
@media (max-width: 520px) {
    .transaction-review-table tr { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "select name amount" "select date date" "select client client" "select review review"; column-gap: 10px; row-gap: 4px; padding: 12px 14px; }
    .transaction-review-table td { display: block; padding: 0; border: 0; text-align: left; }
    .transaction-review-table td::before { content: none; }
    .transaction-review-table td.transaction-selection-column { grid-area: select; padding-top: 2px; }
    .transaction-review-table td.col-date { grid-area: date; color: var(--muted); font-size: 12px; }
    .transaction-review-table td.col-client { grid-area: client; color: var(--muted); font-size: 12px; }
    .transaction-review-table td.col-name { grid-area: name; font-weight: 600; min-width: 0; }
    .transaction-review-table td.col-review { grid-area: review; }
    .transaction-review-table td.col-amount { grid-area: amount; text-align: right; white-space: nowrap; }
    .transaction-review-table td.transaction-empty { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
    /* Review counts as a compact three-across grid so the list starts sooner on phones. */
    .transaction-review-counts { --bs-gutter-x: .5rem; --bs-gutter-y: .5rem; }
    .transaction-review-counts > div { flex: 0 0 33.333%; max-width: 33.333%; }
    .transaction-review-counts .card-body { padding: 10px; }
    .transaction-review-counts .h3 { margin-bottom: 2px; font-size: 1.25rem; }
    .transaction-review-counts .small { display: block; font-size: 11px; line-height: 1.25; }
    [data-transaction-analyze-action] { white-space: nowrap; }
}
.client-attention-strip > a { padding: 4px 0; white-space: nowrap; }
@media (max-width: 520px) {
    /* Right-aligned actions overflowed off the left edge when wider than the phone; wrap them from the left instead. */
    .transaction-toolbar-actions { flex-wrap: wrap; justify-content: flex-start; }
}

/* A scrolling table wrapper must contain its absolutely positioned children (visually hidden header labels);
   otherwise they escape the scroll area and widen the whole page on phones. */
.table-responsive { position: relative; }

/* Phones: simple tables stack each row, with the column name above each value (data-label). */
@media (max-width: 575.98px) {
    .stack-table thead { display: none; }
    .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
    .stack-table tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
    .stack-table td { padding: 3px 0; border: 0; }
    .stack-table td[data-label]::before { display: block; color: var(--muted); content: attr(data-label); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
    .stack-table td.stack-table-empty { display: none; }
    .stack-table td.text-end { text-align: left !important; }
}

/* Small standalone links: at least a 24px tall tap target. */
.tap-link { display: inline-block; padding: 4px 0; }

/* Rule builder: "Add condition" keeps its own width, and the value takes the upper value's column unless "between" shows it. */
.rule-builder > [data-add-rule-condition] { justify-self: start; }
.rule-condition-row:has(> [data-rule-condition-value-to][hidden]) > input[name$="[value]"] { grid-column: span 2; }
.field label .field-hint { margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }

/* Client overview on phones: recent activity as two-line rows (name and amount, then date and category). */
@media (max-width: 520px) {
    .client-recent-panel .transaction-table tbody { padding: 0; }
    .client-recent-panel .transaction-table tr { display: grid; grid-template-areas: "name amount" "date review"; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; margin: 0; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
    .client-recent-panel .transaction-table td { display: block; padding: 0; border: 0; text-align: left; }
    .client-recent-panel .transaction-table td::before { content: none; }
    .client-recent-panel .transaction-table td:nth-child(1) { grid-area: date; color: var(--muted); font-size: 12px; }
    .client-recent-panel .transaction-table td:nth-child(3) { grid-area: name; font-weight: 600; overflow-wrap: break-word; }
    .client-recent-panel .transaction-table td:nth-child(4) { grid-area: review; font-size: 12px; text-align: right; }
    .client-recent-panel .transaction-table td:nth-child(5) { grid-area: amount; text-align: right; }
    .client-recent-panel .transaction-table td.transaction-empty { grid-column: 1 / -1; }
}

/* Dense review rows (demo review #82): one line per proposal with its source, category, a short reason, and actions. */
.transaction-review-table td { padding-top: 8px; padding-bottom: 8px; }
.transaction-review-table .col-client { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 28px; }
.review-line + .review-line { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--line); }
.review-line:not(:has(.review-tag)) { grid-template-columns: minmax(0, 1fr) auto; }
.review-text { min-width: 0; line-height: 1.25; }
.review-text strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.review-text small { display: block; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.review-flag-text { color: #955f09; font-weight: 600; }
.review-actions { display: inline-flex; gap: 4px; white-space: nowrap; }
.review-actions form { margin: 0; }
.review-tag { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; color: #3949a3; background: #e8ebfc; }
.review-tag.rule { color: #3949a3; background: #e8ebfc; }
.review-tag.ai { color: #0f6a52; background: #dff5ec; }
.review-tag.ai.confidence-medium { color: #7a5a06; background: #fcefc7; }
.review-tag.ai.confidence-low { color: #a12a2a; background: #fbd6d6; }
.review-tag.flag { color: #955f09; background: #fbe9bd; }
.review-tag.warn { color: #8a4b00; background: #ffe2c2; }
.review-tag.transfer { color: #0b6282; background: #d7f0f9; }
.review-tag.muted { color: #555b6e; background: #eceef3; }
.small-review-button.neutral { border: 1px solid #d3d7e2; color: #4c5264; }
.small-review-button.neutral:hover,
.small-review-button.neutral:focus-visible { background: #f1f2f6; }
.small-review-button:disabled { cursor: wait; opacity: .75; }
.transaction-detail-panel .review-text strong,
.transaction-detail-panel .review-text small { white-space: normal; }
.transaction-detail-panel .review-line { grid-template-columns: auto minmax(0, 1fr); }
.transaction-detail-panel .review-actions { grid-column: 1 / -1; }
.detail-review-lines:empty { display: none; }
.detail-review-lines { margin-bottom: 12px; }
.review-chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.review-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: 1px solid #cfd5f3; border-radius: 999px; color: var(--primary); background: #fff; font-size: 12px; font-weight: 600; text-decoration: none; }
.review-chip span { padding: 0 6px; border-radius: 999px; background: #eef0ff; font-size: 11px; }
.review-chip:hover,
.review-chip:focus-visible { background: #f3f5ff; }
.review-chip.active { border-color: var(--primary); color: #fff; background: var(--primary); }
.review-chip.active span { color: var(--primary); background: #fff; }

/* In-place updates (demo review #60): the changed row flashes, a new item is highlighted, a finished one fades out. */
@keyframes inplace-flash { from { background-color: #fff7d6; } to { background-color: transparent; } }
.inplace-changed,
.inplace-changed > td { animation: inplace-flash 1.8s ease-out; }
.inplace-new,
.inplace-new > td { animation: inplace-flash 2.2s ease-out; box-shadow: inset 3px 0 0 var(--primary); }
.inplace-leaving { opacity: 0; transition: opacity .3s ease-out; }
@media (prefers-reduced-motion: reduce) {
    .inplace-changed, .inplace-changed > td, .inplace-new, .inplace-new > td { animation: none; }
    .inplace-leaving { transition: none; }
}

/* Rule library grouped by what the rule does, with a publish checkbox on previewed drafts (demo review #35, #44). */
.rule-group-heading { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 20px 8px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.rule-group-heading span { padding: 0 7px; border-radius: 999px; background: #eef0f6; font-size: 11px; letter-spacing: 0; }
.rules-list-panel .rule-list-row { grid-template-columns: 22px minmax(220px, 1.6fr) minmax(150px, 1fr) 130px auto; }
.rules-list-panel .rule-list-row > .rule-select { display: flex; align-items: center; }
.rule-list-main { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.rule-list-main > span:last-child { display: grid; gap: 2px; min-width: 0; }
.rule-list-main:hover strong,
.rule-list-main:focus-visible strong { color: var(--primary); text-decoration: underline; }
.workflow-pill.status-draft { white-space: nowrap; }
.starter-group { margin: 0 0 14px; padding: 0; border: 0; }
.starter-group legend { margin-bottom: 6px; }
.starter-rule { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.starter-rule + .starter-rule { margin-top: 6px; }
.starter-rule:hover { background: #f8f9ff; }
.starter-rule input { margin-top: 4px; }
.starter-rule strong,
.starter-rule small { display: block; }
.starter-rule small { color: var(--muted); font-size: 12px; }
.starter-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.starter-count.has-matches { color: var(--primary); font-weight: 700; }
.starter-threshold input { max-width: 180px; }
@media (max-width: 1100px) {
    .rules-list-panel .rule-list-row { grid-template-columns: 22px minmax(200px, 1fr) 130px auto; }
    .rules-list-panel .rule-list-row > span:nth-child(3) { display: none; }
}
@media (max-width: 767.98px) {
    .rules-list-panel .rule-list-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
    .rules-list-panel .rule-list-row > span:nth-child(4) { display: none; }
    .rules-list-panel .rule-list-row > span:last-child { display: inline-flex; }
}

/* Chart of accounts: template cards (demo review #58) and an Edit button instead of a bare disclosure link. */
.chart-template-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcff; }
.account-edit > summary { list-style: none; }
.account-edit > summary::-webkit-details-marker { display: none; }
.account-edit[open] > summary { background: #eef0f6; }

/* Sticky action bar for long forms (owner preference, demo review #48): the save action stays in view. */
.form-action-bar { position: sticky; top: calc(var(--sticky-top) + 6px); z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 14px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 6px 16px rgba(15, 23, 42, .07); }
.form-action-bar .statement-balance-status { flex-basis: auto; }
@media (max-width: 767.98px) { .form-action-bar { top: 72px; } }

/* Before you deliver: one callout per open item, each with the button that fixes it (demo review #109). */
.deliver-items { display: grid; gap: 8px; margin-bottom: 16px; }
.deliver-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 14px; border: 1px solid #f3d9a4; border-left: 3px solid #d99a25; border-radius: 8px; background: #fffaf0; font-size: 14px; }
.deliver-item > span { flex: 1 1 320px; }
.deliver-item .btn { white-space: nowrap; }

/* Rule page (demo review #36, #49): one plain sentence first, then the facts in a compact row. */
.rule-sentence { font-size: 17px; font-weight: 600; color: var(--ink); }
.rule-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.rule-facts > div { min-width: 160px; }
.rule-facts dt { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.rule-facts dd { margin: 0; }
.rule-matches-table td { vertical-align: top; }
[data-rule-edit-fields]:disabled { opacity: .85; }

/* Searchable account pickers (select2, demo review #102) sized and colored like Bootstrap's form-select. */
.select2-container--default .select2-selection--single { height: calc(1.5em + .75rem + 2px); border: 1px solid var(--bs-border-color, #ced4da); border-radius: var(--bs-border-radius, .375rem); background: var(--surface); }
.select2-container--default .select2-selection--single .select2-selection__rendered { padding: .375rem 2.25rem .375rem .75rem; line-height: 1.5; color: var(--ink); }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--muted); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 100%; right: .5rem; }
.select2-container.select2-sm .select2-selection--single { height: calc(1.5em + .5rem + 2px); border-radius: var(--bs-border-radius-sm, .25rem); font-size: .875rem; }
.select2-container.select2-sm .select2-selection--single .select2-selection__rendered { padding: .25rem 2rem .25rem .5rem; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single { border-color: #aab7f3; box-shadow: 0 0 0 .25rem rgba(85, 110, 230, .25); outline: 0; }
.select2-container--default.select2-container--disabled .select2-selection--single { background: var(--bs-secondary-bg, #e9ecef); }
select.is-invalid + .select2-container .select2-selection--single { border-color: var(--bs-form-invalid-border-color, #dc3545); }
.select2-dropdown { border-color: var(--bs-border-color, #ced4da); font-size: .875rem; z-index: 1060; }
.select2-container--default .select2-results__group { color: var(--muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--primary); }
.select2-container--default .select2-search--dropdown .select2-search__field { border-color: var(--bs-border-color, #ced4da); border-radius: var(--bs-border-radius-sm, .25rem); padding: .25rem .5rem; }

/* Workflows list: a dashed "New workflow" placeholder after the last template (demo review #148). */
.workflow-new-card { display: flex; width: 100%; height: 100%; min-height: 150px; align-items: center; justify-content: center; gap: 8px; border: 2px dashed #c3cadb; border-radius: 8px; background: transparent; color: var(--primary); font-weight: 600; }
.workflow-new-card span { font-size: 22px; line-height: 1; }
.workflow-new-card:hover, .workflow-new-card:focus-visible { border-color: var(--primary); background: #f5f6ff; }

/* Monthly run page (demo review #149-#151): brand color for the current step, who and when per step, locked steps
   that say what they wait on, and the step review kept in view at the foot of the current step. */
.run-step-nav { --bs-list-group-active-bg: var(--primary); --bs-list-group-active-border-color: var(--primary); }
.run-step-marker { display: inline-grid; flex: 0 0 22px; height: 22px; place-items: center; border-radius: 50%; background: #eef0f6; color: var(--ink); font-size: 12px; font-weight: 700; }
.run-step-nav .active .run-step-marker { background: rgba(255, 255, 255, .25); color: #fff; }
.run-step-nav .is-locked { color: var(--muted); }
.run-step-nav small { margin-top: 3px; padding-left: 30px; }
.run-overdue { color: #c23b3b; font-weight: 600; }
.run-step-locked { padding: 8px 12px; border-left: 3px solid #b9c1d3; border-radius: 4px; background: #f6f7fa; color: #4a5163; font-size: 14px; }
.run-evidence { padding: 8px 12px; border-radius: 6px; background: #f3f6fb; }
.run-review-bar { position: sticky; bottom: 0; z-index: 4; margin: 16px -16px -16px; padding: 14px 16px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; background: #fff; box-shadow: 0 -6px 14px rgba(15, 23, 42, .08); }
.transaction-drop-zone.is-too-large { border-style: solid; border-color: #e3a3a3; background: #fff6f6; }
.transaction-drop-zone.is-too-large .transaction-file-name { color: #b42318; }

/* Long settings forms keep Save in view (owner preference, demo review #48); short forms are unaffected. */
.focused-form-panel .form-actions { position: sticky; bottom: 0; z-index: 3; margin-top: 16px; padding: 12px 0; border-top: 1px solid var(--line); background: var(--surface); }

/* P&L comparison tiles (demo review #142): current figure, change and a simple current-versus-prior bar. */
.kpi-tile .kpi-delta { display: inline-block; font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-tile .kpi-delta.is-better { color: #1f8a5b; }
.kpi-tile .kpi-delta.is-worse { color: #c23b3b; }
.kpi-bars { display: grid; gap: 4px; margin-top: 10px; }
.kpi-bar { display: block; height: 6px; min-width: 2px; border-radius: 3px; background: #d5dae6; }
.kpi-bar.is-current { background: var(--primary); }
.kpi-bar.is-negative { background: #e08a8a; }

/* Header: the firm and role under the user's name (demo review #9). */
.user-menu-name { display: grid; text-align: left; line-height: 1.2; }
.user-menu-firm { color: var(--muted); font-size: 11px; font-weight: 400; }
/* The rule above came after the phone rules that hide the name, so on phones the name and firm wrapped into a tall
   column and pushed the header buttons over each other (browser check 2026-11-16). The avatar opens the same menu. */
@media (max-width: 575.98px) { .user-menu-name { display: none; } }

/* New-firm setup checklist on My Work (demo review #7). */
.setup-mark { display: inline-grid; flex: 0 0 24px; height: 24px; place-items: center; border-radius: 50%; background: #eef0f6; color: var(--ink); font-size: 12px; font-weight: 700; }
.setup-mark.is-done { background: #dff4ea; color: #1f8a5b; }

/* Client setup (demo review #14, #17, #19, #20): next steps after creating a client, tags as chips beside the
   cadence, a neutral CSV import state, and the Clients breadcrumb that looks like the link it is. */
.next-steps-callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px; border-left: 3px solid var(--primary); }
.client-tag-chip { display: inline-block; margin-left: 4px; padding: 0 7px; border: 1px solid var(--line); border-radius: 999px; background: #f6f7fb; color: var(--ink); font-size: 11px; font-weight: 500; }
.connection-text.neutral { color: var(--muted); }
.statement-waiting-pdf { display: block; width: 100%; height: 70vh; min-height: 420px; border: 0; }

/* My Work on phones: each task is a card with its client, due date and action in view (Codex review R7). */
@media (max-width: 575.98px) {
    .work-table td.work-actions { text-align: left !important; padding-top: 8px; }
}
@media (max-width: 520px) {
    /* A single client's list hides the client line, so its card has no empty row. */
    .transaction-review-table.single-client tr { grid-template-areas: "select name amount" "select date date" "select review review"; }
}

/* Close state under the client name (Codex review R3): the run's next step and owner, or a hand-set status labelled as such. */
.client-close-detail { color: var(--ink) !important; }
.client-close-detail.is-manual { color: var(--muted) !important; font-style: italic; }

/* My Work (daily-work plan): approvals and the owner's unassigned list sit above ready work; assigning stays on the page. */
.work-assign .form-select { min-width: 170px; }
.work-waiting summary { cursor: pointer; }
@media (max-width: 575.98px) { .work-assign { justify-content: flex-start !important; } }

/* UX rehearsal 2026-09-25. The shared confirm dialog sits above any open modal. */
.app-confirm-modal { z-index: 1065; }
.modal-backdrop ~ .modal-backdrop { z-index: 1060; }
/* The workflow return bar stays one line; the link truncates instead of wrapping on phones. */
.workflow-return > a { min-width: 0; }
@media (max-width: 575.98px) { .workflow-return { padding: 8px 12px; font-size: 14px; } }
/* Transactions toolbar: search and actions share one line at laptop widths. */
@media (min-width: 821px) {
    .transaction-toolbar { grid-template-columns: minmax(280px, 1fr) auto; row-gap: 14px; }
    .transaction-toolbar .transaction-search { margin-left: 0; }
    .transaction-toolbar-actions { flex-wrap: wrap; justify-content: flex-end; }
}
.transaction-toolbar-actions .primary-button,
.transaction-toolbar-actions .secondary-button { white-space: nowrap; }
/* Searchable selects use Bootstrap's form-select chevron. */
.select2-container--default .select2-selection--single .select2-selection__arrow { width: 16px; right: .75rem; background: var(--bs-form-select-bg-img) no-repeat center / 16px 12px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b { display: none; }
.select2-container.select2-sm .select2-selection--single .select2-selection__arrow { right: .5rem; }
/* The client QuickBooks card sits in a narrow column: its status badge wraps under the title instead of squeezing it. */
.qbo-client-card .connection-heading { flex-wrap: wrap; row-gap: 10px; }
.qbo-client-card .connection-title { flex: 1 1 220px; }
.transaction-connection-callout .secondary-button { white-space: nowrap; }
@media (max-width: 520px) { .transaction-connection-callout .secondary-button { width: 100%; margin-left: 0 !important; } }
/* Statement rows name their account under the type: give the Type column room for it on one line. */
@media (min-width: 1200px) {
    .transaction-review-table th.col-type { width: 10%; }
    .transaction-review-table th.col-review { width: 29%; }
}
.transaction-source { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The status badge always sits under the QuickBooks title; beside it, the title text was squeezed into a narrow column. */
.qbo-client-card .connection-title { flex-basis: 100%; }
/* Two-factor settings inside the app: the same narrow form as sign-in, in a panel. */
.two-factor-panel { max-width: 36rem; }
.recovery-code-option { margin: 4px 0 8px; }
.recovery-code-option > summary { margin-bottom: 8px; color: var(--primary); cursor: pointer; }
/* QuickBooks attachments (2026-10-05): receipts on a transaction's Source tab, and a posted check's image status. The
   shared drop zone is compact inside the narrow detail panel. */
.quickbooks-attachment-list { margin: 0 0 10px; }
.quickbooks-attachment { padding: 8px 0; border-top: 1px solid #eceef3; }
.quickbooks-attachment:last-child { border-bottom: 1px solid #eceef3; }
.quickbooks-attachment-file { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.quickbooks-attachment-file > a { min-width: 0; overflow-wrap: anywhere; }
.quickbooks-attachment-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.quickbooks-attachments .transaction-drop-zone { min-height: 0; padding: 14px; }
.quickbooks-attachments .transaction-drop-icon { width: 32px; height: 32px; }
.quickbooks-attachments .transaction-drop-icon svg { width: 18px; height: 18px; }
.quickbooks-attachments .transaction-drop-zone p { margin: 6px 0 8px; }
.quickbooks-check-image { margin: 0 0 12px; }
/* QuickBooks transaction edits (2026-10-05): the detail panel's Edit for QuickBooks section, with what QuickBooks shows
   now as a two-column list, a sticky Save bar sized for the narrow panel, and compact split lines. */
.qb-edits-now { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; margin-bottom: 10px; }
.qb-edits-now dt { color: var(--muted); font-weight: 500; }
.qb-edits-now dd { margin: 0; min-width: 0; }
.qb-edits-pending .review-line { min-width: 0; }
.qb-edit-bar { top: calc(var(--sticky-top) + 2px); margin-bottom: 10px; padding: 8px 10px; }
.qb-edit-split fieldset { margin-top: 6px; }
.qb-edit-line { margin-bottom: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }
.qb-edit-line .form-check { min-height: 0; }
/* QuickBooks vendors (2026-10-05): the dense vendor list with its filters and search, duplicate groups, and the merge
   dialog. */
.vendor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.vendor-toolbar .vendor-search { flex: 0 1 240px; margin-left: auto; }
.vendor-table { font-size: 13px; }
.vendor-table th, .vendor-table td { padding-top: 6px; padding-bottom: 6px; }
.vendor-table .vendor-select { width: 28px; }
.vendor-table .vendor-email { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vendor-table .vendor-address { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vendor-table .vendor-change { min-width: 120px; }
.vendor-table .vendor-actions { text-align: right; white-space: nowrap; }
.vendor-table .vendor-menu-button::after { display: none; }
.vendor-table tr.is-inactive td { color: var(--muted); }
/* Payee review (competitive plan Release 4): the new-vendor note and the 1099 decision sit inline with their buttons;
   on a phone the 1099 table stacks (stack-table) and its actions start at the left. */
.vendor-review-form { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; }
.vendor-review-form .form-control, .vendor-review-form .form-select { width: auto; min-width: 10rem; }
.vendor-1099-table .vendor-actions { white-space: normal; min-width: 15rem; }
@media (max-width: 575.98px) {
    .stack-table td.vendor-actions { text-align: left; min-width: 0; }
    .stack-table .vendor-review-form { justify-content: flex-start; }
}
/* Client metrics grid (Release 4.6): inputs keep a readable width, so the grid scrolls on a phone instead of squeezing. */
.metric-grid input { min-width: 4.25rem; }
.metric-grid td { padding-left: 3px; padding-right: 3px; }
@media (max-width: 575.98px) { .metric-grid input { min-width: 5.5rem; } }
.vendor-table .vendor-group-row th { padding-top: 10px; background: var(--canvas); font-weight: 600; }
.vendor-merge-table td { vertical-align: middle; }
@media (max-width: 575.98px) { .vendor-toolbar .vendor-search { flex-basis: 100%; margin-left: 0; } }

/* Client contacts (2026-10-06): form section legends, the client search box, and link-style buttons on sign-in pages. */
.client-form-legend { margin-bottom: 6px; color: var(--ink); font-size: 15px; font-weight: 600; }
.client-search-input { width: 240px; }
.auth-switch .auth-link-button { padding: 0; border: 0; background: none; color: var(--primary-dark); font-weight: 700; text-decoration: underline; cursor: pointer; }
@media (max-width: 575.98px) { .client-search-input { width: 100%; } }
/* Client overview (2026-10-06): the primary contact sits at the right of the client identity, below it on small screens. */
.client-workspace-identity { flex-wrap: wrap; }
.client-workspace-contact { margin-left: auto; min-width: 0; font-size: 13px; text-align: right; }
.client-workspace-contact-label { display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.client-workspace-contact-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 12px; }
.client-workspace-contact-links a { overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
    .client-workspace-contact { flex-basis: 100%; margin-left: 0; text-align: left; }
    .client-workspace-contact-links { justify-content: flex-start; }
}

/* Practice workflow (2026-10-15): header timer, task timers, priorities, work tags and the firm's close list. */
.header-timer { display: flex; align-items: center; margin-right: 8px; min-width: 0; }
.header-timer-start { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.header-timer-running { display: flex; align-items: center; gap: 2px; min-width: 0; max-width: 420px; padding: 2px 4px 2px 10px; border: 1px solid #b9c6f4; border-radius: 8px; background: #f1f4fe; }
.header-timer-running.is-paused { border-color: var(--line); background: #f6f7f9; }
.header-timer-running.is-long { border-color: #e6b44c; background: #fff8e6; }
.header-timer-label { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink); text-decoration: none; font-size: 13px; }
.header-timer-label:hover, .header-timer-label:focus-visible { color: var(--primary-dark); }
.header-timer-elapsed { font-variant-numeric: tabular-nums; font-weight: 650; }
.header-timer-context { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.header-timer-action { padding: 4px 7px; border: 0; background: transparent; font-size: 12px; line-height: 1; color: var(--muted); }
.header-timer-action:hover, .header-timer-action:focus-visible { color: var(--primary); }
.header-timer-action.is-stop:hover, .header-timer-action.is-stop:focus-visible { color: #c3364a; }
/* Offered on another client's page while a timer runs (owner, 2026-10-15). */
.header-timer-switch { display: inline-flex; align-items: center; gap: 4px; min-width: 0; margin-left: 6px; padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.header-timer-switch-name { display: inline-block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.timer-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c3364a; flex: none; }
.is-paused .timer-dot { background: #a3a9b8; }
.timer-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; flex: none; }
.timer-button { display: inline-flex; align-items: center; gap: 5px; }
.timer-button.is-running .timer-dot { width: 7px; height: 7px; }
@media (max-width: 640px) {
    .header-timer-context { display: none; }
    .timer-button-label { display: none; }
}
.priority-chip { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap; background: #eef1f6; color: #5e697e; }
.priority-chip.is-urgent { background: #fdeaec; color: #a3263a; }
.priority-chip.is-high { background: #fff3df; color: #8a5300; }
.priority-select { width: auto; min-width: 96px; }
.priority-select.is-urgent { border-color: #e7a4ae; color: #a3263a; font-weight: 600; }
.priority-select.is-high { border-color: #e9c48a; color: #8a5300; font-weight: 600; }
.work-tag { display: inline-block; margin-left: 4px; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; background: #f6f7fb; color: var(--ink); font-size: 11px; font-weight: 500; }
.close-filters, .list-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin-bottom: 14px; }
.close-filters .form-select, .list-filters .form-select { min-width: 130px; }
.close-status-counts { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); }
.close-status-counts strong { color: var(--ink); }
.close-progress { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.close-progress progress { width: 64px; height: 8px; }
.close-hold-reason { max-width: 240px; overflow-wrap: anywhere; }
.task-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px 20px; margin: 0; }
.task-meta dt { color: var(--muted); font-size: 12px; font-weight: 500; }
.task-meta dd { margin: 0; }
.task-description { white-space: pre-line; overflow-wrap: anywhere; }
.time-totals { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.time-totals .summary-card strong { font-variant-numeric: tabular-nums; }
.time-breakdown td:last-child, .time-breakdown th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.time-entry-note { max-width: 320px; overflow-wrap: anywhere; }
/* Conversations (practice workflow plan, packages D-F). */
.nav-badge { display: inline-block; min-width: 20px; margin-left: auto; padding: 1px 6px; border-radius: 4px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; line-height: 1.5; text-align: center; }
.conversation-messages { list-style: none; margin: 0 0 12px; padding: 0; }
.conversation-message { padding: 10px 0; border-top: 1px solid var(--line); }
.conversation-message:first-child { border-top: 0; }
.conversation-message-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; }
.conversation-message-head time { color: var(--muted); font-size: 12px; }
.conversation-message-body { margin-top: 4px; overflow-wrap: anywhere; white-space: normal; }
.conversation-message.is-email .conversation-message-body { max-height: 420px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fafbfd; font-size: 13px; }
.conversation-message-deleted { margin: 4px 0 0; color: var(--muted); font-style: italic; }
.conversation-email-meta { margin: 4px 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.conversation-mentions { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.conversation-attachments { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.conversation-message-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 14px; margin-top: 4px; font-size: 12px; }
.conversation-message-actions summary { color: var(--muted); cursor: pointer; }
.conversation-composer-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.conversation-mention-picker { min-width: 220px; flex: 1 1 220px; }
.conversation-list li > a { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.conversation-list li:first-child > a { border-top: 0; }
.conversation-list li > a:hover, .conversation-list li > a:focus-visible { background: var(--canvas); }
.conversation-list li.is-unread strong { color: var(--primary-dark); }
.conversation-list-kind { color: var(--muted); font-size: 12px; }
.conversation-list-main { display: flex; flex-direction: column; min-width: 0; }
.conversation-list-main small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.conversation-list-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--muted); }
@media (max-width: 640px) {
    .conversation-list li > a { grid-template-columns: minmax(0, 1fr) auto; }
    .conversation-list-kind { display: none; }
}
/* Categorization history and Search memo in the transaction detail panel (practice workflow plan, package H). */
.history-categories { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0 0 8px; padding: 0; list-style: none; }
.history-list { margin: 0; padding: 0; list-style: none; }
.history-row { padding: 10px 0; border-top: 1px solid var(--line); }
.history-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.history-evidence { margin: 4px 0 0; padding: 0; list-style: none; }
.history-evidence li { margin-top: 3px; overflow-wrap: anywhere; }
.history-more { padding-top: 10px; border-top: 1px solid var(--line); }
.memo-search-form { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--canvas); }
/* W-9 recipient page (practice workflow plan, package G). */
.w9-body { min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink); }
.w9-shell { width: 100%; max-width: 640px; margin: 0 auto; padding: 40px 16px; }
.w9-footer { margin-top: 14px; color: var(--muted); font-size: 12px; text-align: center; }

/* Firm client grid (competitive plan Release 2.5). */
.client-grid-views { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.client-grid-view { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 999px; font-size: .875rem; }
.client-grid-view.is-active { border-color: var(--bs-primary, #556ee6); background: rgba(85, 110, 230, .08); }
.client-grid-needs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; border: 0; margin: 0; padding: 0; }
.client-grid-needs legend { float: none; width: auto; margin-right: 6px; }
.client-grid-table td { vertical-align: top; }
.client-grid-progress { display: block; width: 100%; max-width: 140px; height: 4px; margin-top: 6px; border-radius: 2px; background: rgba(0, 0, 0, .08); overflow: hidden; }
.client-grid-progress > span { display: block; height: 100%; background: var(--bs-success, #34c38f); }
.client-grid-ontime { display: inline-block; margin: 0 4px 4px 0; padding: 1px 6px; border-radius: 4px; font-size: .75rem; white-space: nowrap; background: rgba(0, 0, 0, .05); }
.client-grid-ontime.is-on-time { background: rgba(52, 195, 143, .15); color: #1d7a57; }
.client-grid-ontime.is-late { background: rgba(244, 106, 106, .15); color: #a52a2a; }
.client-grid-table tr.is-archived td { opacity: .7; }

/* Close preparation on the close page (competitive plan Release 3.1). */
.close-automation-stages .list-group-item { font-size: .9rem; }
.close-automation-stages .close-stage-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.close-automation-stages .close-stage-status { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .25rem; max-width: 45%; }
.close-findings .list-group-item { font-size: .9rem; }
.close-findings .list-group-item.is-dismissed { opacity: .6; text-decoration: line-through; }
/* Routine rows and first-time payees on Transactions (competitive plan Release 3.4). */
.routine-mark { display: inline-block; margin-top: 2px; padding: 0 6px; border-radius: 4px; font-size: .7rem; font-weight: 600; line-height: 1.5; }
.routine-mark.is-routine { background: rgba(0, 0, 0, .05); color: #6c757d; }
.routine-mark.is-new { background: rgba(241, 180, 76, .2); color: #8a5a00; }

/* One error standard (live review 2026-11-16, #27): a page banner that can't be missed, and errors at their action. */
.page-errors { margin: 0 0 16px; padding: 12px 16px; border: 1px solid #f1b0b0; border-left: 4px solid #c0392b; border-radius: 8px; background: #fdeaea; color: #8a1f1f; font-size: 14px; font-weight: 600; }
.page-errors ul { margin: 0; padding-left: 18px; }
.page-errors li:only-child { margin-left: -18px; list-style: none; }
.inline-error { margin: 0 0 10px; padding: 8px 12px; border-left: 4px solid #c0392b; border-radius: 6px; background: #fdeaea; color: #8a1f1f; font-size: 14px; font-weight: 600; }
.form-control.is-invalid, .form-select.is-invalid { border-color: #c0392b; box-shadow: 0 0 0 .15rem rgba(192, 57, 43, .15); }
.form-select.is-invalid + .select2-container .select2-selection { border-color: #c0392b; box-shadow: 0 0 0 .15rem rgba(192, 57, 43, .15); }
.field-error[data-invalid-note] { margin-top: 4px; color: #a12a2a; font-weight: 600; }

/* Toasts wide enough to read a whole notice, wrapping long words (live review 2026-11-16, #48). */
#toast-container > div { width: 380px; max-width: calc(100vw - 32px); overflow-wrap: anywhere; opacity: .97; }
#toast-container > div:hover { opacity: 1; }
#toast-container .toast-title { margin-bottom: 2px; }

/* A QuickBooks change's state, readable at a glance (live review 2026-11-16, #35 and #36). */
.posting-state { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #eef0f4; color: #495057; font-size: 12px; font-weight: 600; }
.posting-state.is-draft { background: #fff4e0; color: #8a5a00; }
.posting-state.is-ready { background: #e8ecfd; color: #3b4fb8; }
.posting-state.is-posted { background: #e3f6ec; color: #1d7a46; }
.posting-state.is-failed, .posting-state.is-uncertain { background: #fdeaea; color: #a12a2a; }
.posting-state.is-held { background: #fff4e0; color: #8a5a00; }

.posting-path { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 16px; padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid #f1b44c; border-radius: 8px; background: var(--surface); }
.posting-path.is-ready { border-left-color: var(--primary); }
.posting-path-state { flex: 1 1 100%; margin: 0; font-size: 14px; }
.posting-path-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: posting-step; }
.posting-path-steps li { counter-increment: posting-step; padding: 3px 10px; border-radius: 999px; background: #eef0f4; color: #5b6275; font-size: 13px; font-weight: 600; }
.posting-path-steps li::before { content: counter(posting-step) " "; }
.posting-path-steps li.is-done::before { content: "¹3  "; }
.posting-path-steps li.is-current { background: var(--primary); color: #fff; }
.posting-path-steps li.is-done { background: #e3f6ec; color: #1d7a46; }
.posting-path-later { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.posting-path .btn { margin-left: auto; }
.posting-path-later .btn { margin-left: 0; }

/* Close preparation while it runs: a status that reads as work in progress (live review 2026-11-16, #47). */
.close-preparing { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; }
.close-preparing .button-spinner { margin-right: 0; }

/* The page header (title, actions, Return bar) and the page's tabs stay pinned under the top bar on wide screens, with
   the canvas behind them so content scrolls out of sight underneath (live review 2026-11-16, #24). */
.page-top { display: flow-root; }
/* Every anchor jump lands below the pinned bars; a target's own scroll-margin-top adds only its gap. */
html { scroll-padding-top: calc(var(--sticky-top) + 12px); }
@media (min-width: 992px) {
    .page-top:not(:empty) { position: sticky; top: 70px; z-index: 8; margin: -10px -26px 0; padding: 10px 26px 0; background: var(--canvas); }
    /* A client's tabs pin as their whole bar (tabs plus the "more" menu); section tabs pin on their own. */
    .client-workspace-bar,
    :not(.client-workspace-bar) > .client-workspace-nav { position: sticky; top: calc(70px + var(--page-top-height)); z-index: 7; box-shadow: -26px 0 0 var(--canvas), 26px 0 0 var(--canvas), 0 6px 10px -8px rgba(15, 23, 42, .2); }
}

/* The close page, one step at a time (live review 2026-11-16, #31): the picked step only, and the step list pinned
   beside it on wide screens. */
.run-step-hidden { display: none; }
.run-step-nav a.is-selected:not(.active) { background: #eef1fd; border-color: #c9d1f8; }
@media (min-width: 992px) {
    .run-step-nav { position: sticky; top: calc(var(--sticky-top) + 16px); max-height: calc(100vh - var(--sticky-top) - 36px); overflow-y: auto; }
}

/* The run's review box: a title, an optional note behind "Add a note", then the buttons (live review 2026-11-16, #25). */
.run-review-title { margin: 0 0 6px; font-weight: 600; }
.run-review-note { margin-bottom: 10px; }
.run-review-note > summary { display: inline-block; color: var(--primary); font-size: 14px; cursor: pointer; }

/* A two-person step the current user prepared: why it waits (live review 2026-11-16, #42). */
.run-signoff-waiting { padding: 6px 10px; border-radius: 6px; background: rgba(85, 110, 230, .1); color: #3b4fb8; font-size: 14px; font-weight: 600; }

/* Error pages (resources/views/errors; live review 2026-11-16, #41). */
.error-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; padding: 24px 16px; background: #f4f5f8; color: var(--ink); }
.error-card { width: 100%; max-width: 480px; padding: 32px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 10px 30px rgba(15, 23, 42, .08); }
.error-brand { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 24px; color: inherit; font-size: 18px; font-weight: 700; text-decoration: none; }
.error-code { margin: 0 0 4px; color: #6c757d; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.error-title { margin: 0 0 12px; font-size: 24px; font-weight: 700; }
.error-message { margin: 0 0 24px; font-size: 15px; line-height: 1.5; }
.error-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ==========================================================================================================================
   Decyml look (live review 2026-11-16, #39), as approved in the mockups (https://claude.ai/artifact/Y8FEPASn2xCempKSmuPayi).
   Kept last so it settles the shared pieces over the older rules above: a slightly deeper indigo so white button text
   passes contrast, clear headings, 12px cards, 8px buttons, soft status chips and table headers that read as labels.
   ========================================================================================================================== */
:root {
    --primary: #4c63d6;
    --primary-dark: #3b50b8;
    --primary-ink: #2f3f8f;
    --primary-soft: #eef1fd;
    --primary-line: #c9d1f8;
    --ink: #1f2433;
    --muted: #5b6275;
    --line: #e6e8ef;
    --canvas: #f5f6fa;
    --bs-primary: #4c63d6;
    --bs-primary-rgb: 76, 99, 214;
    --bs-link-color: #4458b8;
    --bs-link-color-rgb: 68, 88, 184;
    --bs-link-hover-color: #2f3f8f;
    --bs-link-hover-color-rgb: 47, 63, 143;
    --bs-body-color: #1f2433;
    --bs-secondary-color: #5b6275;
    --bs-border-color: #e6e8ef;
}

/* Headings: the page title, card titles and section labels each read at their own level. */
.page-heading h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.eyebrow { font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.card h2.h5, .card .card-body > .h5, .panel h2, .panel-heading h2 { font-size: 18px; font-weight: 700; letter-spacing: -.005em; }
.card h3.h6 { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.text-muted { color: var(--muted) !important; }

/* Cards and panels. */
.card { --bs-card-border-color: var(--line); --bs-card-border-radius: 12px; --bs-card-inner-border-radius: 11px; box-shadow: 0 1px 3px rgba(15, 23, 42, .04); }
.welcome-card, .panel, .summary-card { border-color: var(--line); border-radius: 12px; }

/* Buttons: one shape everywhere; the primary is the indigo, everything else stays quiet. */
.btn { --bs-btn-border-radius: 8px; --bs-btn-font-weight: 600; }
.btn-sm { --bs-btn-border-radius: 7px; }
.primary-button, .secondary-button, .danger-button { border-radius: 8px; }
.secondary-button { border-color: #d5d9e4; }
.btn-outline-primary { --bs-btn-color: var(--primary-ink); --bs-btn-border-color: var(--primary-line); --bs-btn-bg: #fff; --bs-btn-hover-color: var(--primary-ink); --bs-btn-hover-bg: var(--primary-soft); --bs-btn-hover-border-color: var(--primary-line); --bs-btn-active-color: var(--primary-ink); --bs-btn-active-bg: var(--primary-soft); --bs-btn-active-border-color: var(--primary); }
.btn-link { --bs-btn-color: #4458b8; --bs-btn-hover-color: var(--primary-ink); }

/* Status chips: soft colours with dark text in place of solid Bootstrap badges. */
.badge { --bs-badge-font-weight: 700; --bs-badge-border-radius: 999px; --bs-badge-padding-x: .7em; --bs-badge-padding-y: .4em; letter-spacing: .01em; }
.badge.text-bg-success { background-color: #e3f6ec !important; color: #1d7a46 !important; }
.badge.text-bg-warning { background-color: #fff4e0 !important; color: #8a5a00 !important; }
.badge.text-bg-danger { background-color: #fdeaea !important; color: #a12a2a !important; }
.badge.text-bg-primary { background-color: #e8ecfd !important; color: var(--primary-ink) !important; }
.badge.text-bg-info { background-color: #e6f3fa !important; color: #1e5f80 !important; }
.badge.text-bg-secondary, .badge.text-bg-light { background-color: #eceef4 !important; color: #3a4052 !important; border-color: transparent !important; }
.status-message { border-radius: 10px; font-weight: 600; }

/* Menu and tabs. */
.nav-link { border-radius: 8px; }
.nav-link.active { color: var(--primary-ink); background: var(--primary-soft); font-weight: 600; }
.client-workspace-nav > a { color: var(--muted); }

/* Tables: header cells read as labels, rows breathe a little. */
.table { --bs-table-color: var(--ink); --bs-table-border-color: #eef0f5; }
.table > thead th:not(.report-page *) { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }

/* Form fields. */
.form-control, .form-select { border-color: #d5d9e4; border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(76, 99, 214, .18); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* Colour where text was black on white (owner, 2026-11-16: "why so black and white and devoid of any style?"):
   in-page links are indigo instead of inheriting black with an underline; table headers sit on a tinted band with a
   soft row hover; and small building blocks (icon tiles, meta chips, empty states) bring the mockups' colour to every
   page. :where() keeps these as weak as the old "a { color: inherit }", so any class that colours a link still wins. */
:where(.page-content, .modal-body) a:where(:not(.workflow-block-link):not(.workflow-palette-item)) { color: #4458b8; text-decoration: none; }
:where(.page-content, .modal-body) a:where(:not(.workflow-block-link):not(.workflow-palette-item):hover) { color: var(--primary-ink); text-decoration: underline; }
.table > thead th:not(.report-page *) { background: #f4f6fb; border-bottom-color: var(--line); padding-top: .6rem; padding-bottom: .6rem; }
.table > thead th:first-child:not(.report-page *) { border-top-left-radius: 8px; }
.table > thead th:last-child:not(.report-page *) { border-top-right-radius: 8px; }
.table-hover > tbody > tr:hover > *, .table > tbody > tr:hover > td { background-color: #fafbff; }
.min-w-0 { min-width: 0; }
.icon-tile { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.icon-tile.is-teal { background: #e3f5f2; color: #1f7f73; }
.icon-tile.is-amber { background: #fff4e0; color: #8a5a00; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.meta-chips > span { padding: 3px 10px; border-radius: 999px; background: #eef0f5; color: #3a4052; font-size: 13px; font-weight: 600; }
.empty-state { padding: 14px 16px; border: 1px dashed #cfd5e3; border-radius: 12px; background: #fafbfd; color: #3a4052; }
.empty-state-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.card h3.h5 a, .card h2.h5 a { color: var(--ink); }
.card h3.h5 a:hover, .card h2.h5 a:hover { color: var(--primary-ink); }

/* Summary tiles: a label, a large figure and a change chip, used on Reports and statements. */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-tile { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.stat-tile.is-attention { border-color: #f3d7a3; background: #fff7e8; }
.stat-tile-label { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-tile.is-attention .stat-tile-label { color: #8a5a00; font-weight: 700; }
.stat-tile-value { margin: 4px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-tile-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.change-chip { padding: 2px 8px; border-radius: 999px; background: #eceef4; color: #3a4052; font-size: 12px; font-weight: 700; }
.change-chip.is-good { background: #e3f6ec; color: #1d7a46; }
.change-chip.is-bad { background: #fdeaea; color: #a12a2a; }

/* The close page, as in the mockup: step list with check circles and a soft current row; a "Step N of M" header; the
   close preparation's "Ready for you" as count chips; stages and the long explanation folded away. */
.run-step-nav { padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.run-step-nav .list-group-item { margin-bottom: 2px; padding: 9px 10px; border: 0; border-radius: 8px; color: #3a4052; }
.run-step-nav .list-group-item small { color: var(--muted); }
.run-step-nav .list-group-item.active { background: var(--primary-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--primary); }
.run-step-nav .list-group-item.active small { color: var(--muted); }
/* The step on screen is the one highlighted row; when another step is picked, the current step keeps only its indigo
   number (browser check 2026-11-16). */
.run-step-nav a.is-selected:not(.active) { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.run-step-nav:has(a.is-selected) .list-group-item.active:not(.is-selected) { background: transparent; box-shadow: none; }
.run-step-nav .run-step-name { font-weight: 600; }
.run-step-marker { flex-basis: 24px; height: 24px; background: #eceef4; color: #3a4052; font-weight: 800; }
.run-step-marker.is-done { background: #e3f6ec; color: #1d7a46; }
.run-step-nav .active .run-step-marker { background: var(--primary); color: #fff; }
.run-step-card { border-radius: 12px; }
.run-step-card.is-current { border-color: var(--primary-line) !important; box-shadow: 0 2px 10px rgba(76, 99, 214, .08); }
.run-step-eyebrow { margin: 0 0 4px; color: #4458b8; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.run-step-title { margin: 0 0 12px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.run-review-bar { background: #fafbfd; }
.ready-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ready-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; color: var(--ink); font-size: 14px; text-decoration: none; }
.ready-chip:hover { border-color: var(--primary-line); background: var(--primary-soft); color: var(--ink); }
.ready-chip strong { padding: 1px 8px; border-radius: 999px; background: #fff4e0; color: #8a5a00; }
.close-automation-about summary, .close-automation-stages-box > summary { color: #4458b8; font-weight: 600; cursor: pointer; }
.close-automation-stages-box > summary { color: var(--ink); font-size: 14px; }
.close-automation-about p { max-width: 70ch; }

/* Reports, as in the mockup: a jump menu for the long page and footnote markers that stand out (#22, #40). */
.report-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.report-jump a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: #4458b8; font-size: 13px; font-weight: 600; text-decoration: none; }
.report-jump a:hover { border-color: var(--primary-line); background: var(--primary-soft); color: var(--primary-ink); }
/* The jump menu stays in view on wide screens, below the pinned header and tabs, and its targets land below it
   (browser check 2026-11-16, owner rule: navigation stays pinned on long pages). */
@media (min-width: 992px) {
    .report-jump { position: sticky; top: calc(var(--sticky-top) + 6px); z-index: 5; padding: 6px 0; background: var(--canvas); box-shadow: -26px 0 0 var(--canvas), 26px 0 0 var(--canvas); }
    .page-content:has(.report-jump) [id^="report-"][id$="-heading"] { scroll-margin-top: 72px; }
}
.report-table sup, .pl-table sup, table sup { color: #4458b8; font-weight: 700; }
.report-notes li::marker { color: #4458b8; font-weight: 700; }
.metric-grid.is-recent .is-earlier { display: none; }
.metric-grid.is-recent { width: auto; }
.metric-grid.is-recent input { min-width: 7.5rem; }
.metric-chart figcaption strong { font-size: 16px; }
/* On phones the twelve months keep a readable size and the chart scrolls sideways in its card, like a wide table (code
   review 2026-11-16, #23: squeezed to the screen, its labels were about 6px). */
@media screen and (max-width: 575.98px) { .metric-chart { overflow-x: auto; } .metric-chart svg { min-width: 560px; } }

/* Small icon buttons (move, remove, cancel) in place of text links and bare arrows (live review 2026-11-16, #5 and #6).
   Page content only: the top bar's icon buttons (menu toggle, bell, timer) keep their own rules. */
.page-content .icon-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); text-decoration: none; }
.page-content .icon-button:hover:not(:disabled), .page-content .icon-button:focus-visible { border-color: var(--line); background: #f1f3f8; color: var(--ink); }
.page-content .icon-button.is-danger:hover:not(:disabled), .page-content .icon-button.is-danger:focus-visible { border-color: #f1b0b0; background: #fdeaea; color: #a12a2a; }
.page-content .icon-button:disabled { opacity: .35; }
.workflow-step-controls { align-items: center; gap: 2px; }

/* The P&L line note button: quiet until the row is hovered (live review 2026-11-16, #40). */
.page-content .note-line-button { width: 24px; height: 24px; margin-left: 6px; vertical-align: middle; opacity: .45; }
.report-table tr:hover .note-line-button, .table tr:hover .note-line-button, .note-line-button:focus-visible { opacity: 1; }
/* A line with a note: a light highlight beside its number (live review 2026-11-16, #40). */
tr.has-note > td { background-color: #fff8e1; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
@media print { .page-content .note-line-button { display: none; } }

/* The shared pop-up for short tasks (live review 2026-11-16, #34 and #44). */
.remote-modal .modal-body > [data-modal-content] > .client-workspace-nav { display: none; }
.remote-modal .modal-body .page-errors { margin-bottom: 12px; }

/* The builder's new step: named on its card, with a cancel button (live review 2026-11-16, #3 and #4). */
.workflow-placeholder { align-items: center; }
.workflow-placeholder-body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 4px; min-width: 0; }
.workflow-placeholder-body small { color: var(--muted); }
@media (min-width: 1200px) {
    .workflow-editor { position: sticky; top: calc(var(--sticky-top) + 16px); max-height: calc(100vh - var(--sticky-top) - 32px); overflow-y: auto; }
}

/* The page header as a band (owner, 2026-11-16, Workflows screenshot: "header still looks same"): a white card with a
   soft indigo-to-teal wash and ring, an icon tile in the My Work banner's colours (the page's sidebar icon, or a
   client's initial on that client's pages), and an indigo eyebrow. The ring is a background layer, not an overflow
   clip, so menus in the heading actions still open outside the card. */
.page-heading {
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    margin-bottom: 16px;
    padding: 14px 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background:
        radial-gradient(circle at calc(100% + 30px) -70px, transparent 0 104px, rgba(76, 99, 214, .08) 105px 140px, transparent 141px),
        linear-gradient(105deg, #fff 38%, #eff2fe 76%, #e2f1f4);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
}
.page-heading-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-heading-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #4c63d6, #2a8aa0); color: #fff; box-shadow: 0 6px 14px -6px rgba(76, 99, 214, .65); }
.page-heading-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.page-heading-icon.is-letter { font-size: 20px; font-weight: 700; }
.page-heading .eyebrow { margin-bottom: 2px; color: #4458b8; }
.page-heading h1 { font-size: 24px; overflow-wrap: anywhere; }
@media (max-width: 520px) {
    /* The title and its actions start at the left on phones, as before the band. */
    .page-heading { align-items: flex-start; padding: 14px 16px; }
    .page-heading-icon { width: 38px; height: 38px; border-radius: 10px; }
    .page-heading h1 { font-size: 21px; }
}

/* Page tabs as a pill bar under the header: the open tab is an indigo pill instead of a thin underline. */
.client-workspace-nav,
.client-workspace-bar { gap: 2px; margin: 0 0 20px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .04); }
.client-workspace-bar > .client-workspace-nav { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
/* Same width per tab as the underline tabs (owner, 2026-10-15: a QuickBooks client's main tabs fit a 1280 laptop). */
.client-workspace-nav > a { padding: 7px 9px; border-bottom: 0; border-radius: 8px; color: var(--muted); font-weight: 600; }
.client-workspace-nav > a:hover,
.client-workspace-nav > a:focus-visible { background: var(--canvas); color: var(--ink); }
.client-workspace-nav > a.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 700; }
.client-workspace-nav > a span { background: #eceef4; color: #3a4052; }
.client-workspace-nav > a.active span { background: #fff; color: var(--primary-ink); }
.client-workspace-more { padding-right: 0; }
.client-workspace-more-button { padding: 4px 10px; border-bottom: 0; border-radius: 8px; }
.client-workspace-more-button:hover,
.client-workspace-more-button[aria-expanded="true"] { background: var(--canvas); }
.remote-modal .modal-body > [data-modal-content] > .client-workspace-bar { display: none; }
@media (max-width: 767.98px) {
    /* Section tabs (two or three) fit a phone, so only a client's longer tab row keeps the scroll fade. */
    :not(.client-workspace-bar) > .client-workspace-nav { -webkit-mask-image: none; mask-image: none; }
}
@media (min-width: 992px) {
    /* Pinned tabs keep the canvas at their sides so rows scroll out of sight beside them, not only under them. */
    .client-workspace-bar,
    :not(.client-workspace-bar) > .client-workspace-nav { box-shadow: -26px 0 0 var(--canvas), 26px 0 0 var(--canvas), 0 6px 10px -8px rgba(15, 23, 42, .2); }
}

/* Icon tiles draw their own line icons, so new markup needs no SVG attributes. */
.icon-tile svg, .empty-state-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-tile.is-violet { background: #f1eaff; color: #6746a7; }
.panel-title-with-icon { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* A colour per client (owner, 2026-11-16): the list avatar and the client's page header share it, so a client is
   recognisable by colour as well as initial. Picked from the client id, so it never changes. */
.client-tone-0 { background: linear-gradient(145deg, #4c63d6, #7a6ce7); }
.client-tone-1 { background: linear-gradient(145deg, #178a7c, #2aa6a0); }
.client-tone-2 { background: linear-gradient(145deg, #7044c9, #a65ad8); }
.client-tone-3 { background: linear-gradient(145deg, #d9771a, #e5a03a); }
.client-tone-4 { background: linear-gradient(145deg, #c93d6e, #e0698a); }
.client-tone-5 { background: linear-gradient(145deg, #2577c9, #3fa9d6); }

/* Clients list: icon tiles on the summary cards, connection as a status chip, waiting review as an amber chip. */
.summary-card.has-icon { position: relative; padding-right: 72px; }
.summary-card .summary-card-icon { position: absolute; top: 18px; right: 18px; color: var(--primary); }
.summary-card .summary-card-icon.is-amber { color: #8a5a00; }
.summary-card .summary-card-icon.is-violet { color: #6746a7; }
.summary-card .summary-card-icon.is-teal { color: #1f7f73; }
.summary-card > span:not(.icon-tile) { font-size: 13px; font-weight: 600; }
.client-command-row .connection-text { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 3px 10px; border-radius: 999px; background: #fff4e0; color: #8a5a00; font-size: 12px; }
.client-command-row .connection-text::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.client-command-row .connection-text.connected { background: #e3f6ec; color: #1d7a46; }
.client-command-row .connection-text.neutral { background: #eceef4; color: #3a4052; }
.review-count-chip { width: max-content; min-width: 30px; padding: 2px 9px; border-radius: 999px; background: #eceef4; color: var(--muted); font-size: 13px; text-align: center; }
.review-count-chip.is-waiting { background: #fff4e0; color: #8a5a00; }

/* Client Overview: the summary numbers as separate tiles, amber when review is waiting and red when the close is late. */
.client-workspace-metrics { gap: 10px; overflow: visible; border: 0; border-radius: 0; background: none; }
.client-workspace-metrics div { border: 1px solid var(--line); border-radius: 10px; background: #fafbff; }
.client-workspace-metrics div.is-attention { border-color: #f3d7a3; background: #fff7e8; }
.client-workspace-metrics div.is-attention dt { color: #8a5a00; }
.client-workspace-metrics div.is-danger { border-color: #f1c9c5; background: #fff5f5; }
.client-workspace-metrics dt { letter-spacing: .04em; }
.client-workspace-metrics dd { font-size: 16px; }

/* Transactions: the review counts as coloured tiles (owner, 2026-11-16 colour pass). Each count has its own colour
   (a dot by the label and the number), lifts on hover, and the open filter is tinted in that colour. */
.review-count-card { --tone: #4c63d6; --tone-soft: #eef1fd; --tone-ink: #2f3f8f; transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease; }
.review-count-card .card-body { padding: 14px 16px; }
.review-count-label { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
/* Phones keep the three-across tiles with their 11px labels; the number carries the colour, so the dot goes. */
@media (max-width: 575.98px) {
    .review-count-card .card-body { padding: 10px; }
    .review-count-label { font-size: 11px; line-height: 1.25; }
    .review-count-label::before { display: none; }
}
.review-count-label::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }
.review-count-card strong { margin: 6px 0 0; color: var(--tone-ink); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.review-count-card:hover,
.review-count-card:focus-visible { border-color: var(--tone); box-shadow: 0 8px 18px -12px var(--tone); transform: translateY(-1px); }
.review-count-card.border-primary { border-color: var(--tone) !important; background: var(--tone-soft); box-shadow: inset 0 0 0 1px var(--tone); }
.review-count-card.is-all { --tone: #5b6275; --tone-soft: #eef0f5; --tone-ink: #1f2433; }
.review-count-card.is-flagged { --tone: #d9901a; --tone-soft: #fff4e0; --tone-ink: #8a5a00; }
.review-count-card.is-reviewed { --tone: #2f9e63; --tone-soft: #e3f6ec; --tone-ink: #1d7a46; }
.review-count-card.is-awaiting { --tone: #7a86a8; --tone-soft: #eef0f7; --tone-ink: #3a4052; }
.review-count-card.is-transfers { --tone: #2577c9; --tone-soft: #e6f1fb; --tone-ink: #1e5f80; }
.review-count-card.is-uncategorized { --tone: #e0703a; --tone-soft: #fdeee6; --tone-ink: #9a4a1c; }
.review-count-card.is-client_answered { --tone: #7c4dd6; --tone-soft: #f1eaff; --tone-ink: #6746a7; }
@media (prefers-reduced-motion: reduce) {
    .review-count-card { transition: none; }
    .review-count-card:hover, .review-count-card:focus-visible { transform: none; }
}

/* Vendor rows (live review 2026-11-16, #14: "looks messy"): one action row on one line. The note (or the 1099 reason)
   and its button are one attached group, then Edit or Request W-9, then the "more" menu. Phones wrap the row. */
.vendor-row-actions { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 6px; }
.vendor-row-actions .vendor-review-form.input-group { flex: 0 1 auto; flex-wrap: nowrap; gap: 0; width: auto; }
.vendor-row-actions .vendor-review-form .form-control { flex: 0 1 13rem; width: 13rem; min-width: 7rem; }
.vendor-row-actions .vendor-review-form .form-select { flex: 0 1 12rem; width: 12rem; min-width: 7rem; }
/* The hidden fields come first in these forms, so Bootstrap treats the visible field as a middle one; give it back its
   left corners and edge. */
.vendor-row-actions .vendor-review-form.input-group > .form-control,
.vendor-row-actions .vendor-review-form.input-group > .form-select { margin-left: 0 !important; border-top-left-radius: var(--bs-border-radius-sm) !important; border-bottom-left-radius: var(--bs-border-radius-sm) !important; }
.vendor-row-actions .btn,
.vendor-row-actions .secondary-button { white-space: nowrap; }
.vendor-review-done { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 575.98px) {
    .vendor-row-actions { flex-wrap: wrap; justify-content: flex-start; }
    .vendor-row-actions .vendor-review-form.input-group { flex: 1 1 100%; }
    .vendor-row-actions .vendor-review-form .form-control,
    .vendor-row-actions .vendor-review-form .form-select { flex: 1 1 auto; width: auto; }
}

/* Transaction review's checklist items carry their review list's live count (live review 2026-11-16, #32): amber with
   items open, green when none are, grey when no flag rule finds them yet. Each chip opens the list. */
.review-list-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; background: #eceef4; color: #3a4052; font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.review-list-chip.is-open { background: #fff4e0; color: #8a5a00; }
.review-list-chip.is-clear { background: #e3f6ec; color: #1d7a46; }
.review-list-chip:hover,
.review-list-chip:focus-visible { text-decoration: none; box-shadow: inset 0 0 0 1px currentColor; }

/* The run page (live review 2026-11-16, #31): a completed step reads as one line (who, when, the note's start); in
   "Show all steps" its details fold away behind Open. Phones pick a step from a menu instead of the long list. */
.run-step-done-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin: -4px 0 12px; color: #1d7a46; font-size: 14px; font-weight: 600; }
.run-step-done-line .text-muted { font-weight: 400; }
.run-step-open { display: none; margin-left: auto; font-weight: 600; }
[data-run-steps].is-all .run-step-card.is-completed .run-step-body { display: none; }
[data-run-steps].is-all .run-step-card.is-completed .run-step-open { display: inline; }
@media (max-width: 991.98px) {
    .has-run-picker .run-step-nav { display: none; }
}
@media (min-width: 992px) {
    .run-step-picker { display: none !important; }
}

/* The way back to the close (live review 2026-11-16, #24): a soft indigo bar whose button names the close, with the
   client and workflow beside it and Leave workflow quiet at the end. */
.workflow-return { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 14px; padding: 8px 10px; border: 1px solid var(--primary-line); border-radius: 12px; background: var(--primary-soft); }
.workflow-return > a.workflow-return-button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.workflow-return > a.workflow-return-button:hover,
.workflow-return > a.workflow-return-button:focus-visible { background: var(--primary-ink); color: #fff; text-decoration: none; }
.workflow-return-context { min-width: 0; overflow: hidden; color: var(--primary-ink); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 140px; }
.workflow-return-leave { margin-left: auto; }
.workflow-return-leave .btn-link { --bs-btn-color: var(--muted); padding: 2px 4px; font-size: 13px; }

/* The pinned page header gets compact once the page scrolls (#24), so it takes less of the screen while pinned. */
@media (min-width: 992px) {
    .page-top.is-stuck .page-heading { margin-bottom: 10px; padding: 8px 16px; transition: padding 160ms ease; }
    .page-top.is-stuck .page-heading-icon { width: 34px; height: 34px; border-radius: 10px; }
    .page-top.is-stuck .page-heading-icon svg { width: 18px; height: 18px; }
    .page-top.is-stuck .page-heading-icon.is-letter { font-size: 16px; }
    .page-top.is-stuck .page-heading .eyebrow { display: none; }
    .page-top.is-stuck .page-heading h1 { font-size: 19px; }
    .page-top.is-stuck .workflow-return { margin-bottom: 10px; padding: 5px 8px; }
}
@media (min-width: 992px) and (prefers-reduced-motion: reduce) {
    .page-top.is-stuck .page-heading { transition: none; }
}

/* The QuickBooks change form (live review 2026-11-16, #35): a one-line statement draft shows the account first, the
   rest behind "More options"; the form's actions sit where it ends and stay in view at the bottom while lines scroll. */
[data-allocation-form].is-folded .allocation-optional { display: none !important; }
.posting-save-bar { position: sticky; top: auto; bottom: 12px; margin: 16px 0 0; box-shadow: 0 -8px 18px -14px rgba(15, 23, 42, .4); }

/* Ask the client (live review 2026-11-16, #44): each document to request is its own line with a document mark, so the
   list reads differently from the title and note boxes. */
.document-request-rows .input-group-text { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary); }
.document-request-rows .form-control { border-color: var(--primary-line); }
/* A one-line draft is short, so its actions sit in place at the form's end: pinned to the bottom of the screen they
   covered the account field before any scrolling (browser check 2026-11-16). Longer forms keep the pinned bar. */
[data-allocation-simple] .posting-save-bar { position: static; box-shadow: none; }

/* Card titles (owner, 2026-11-16: the large black titles read as dated). A titled card or panel gets a soft indigo wash
   behind its header, like the page header; its title is deep indigo at a calmer size with a short indigo-violet bar,
   and a section title on the page canvas reads as a small label with a fading rule. Headings that bring their own icon
   or step number skip the bar. The report package keeps its plain document headings. */
:root { --title-ink: #27317a; }
.card:has(h2:not(.modal-title):not(.visually-hidden)):not(:has(.report-page)),
.panel:has(> .panel-heading, > h2) { background-image: linear-gradient(180deg, #f2f4fe 0, rgba(242, 244, 254, 0) 120px); }
:is(:is(.card, .panel) :is(h2.h4, h2.h5, h3.h5), .card .card-body > .h5, .panel h2):not(.report-page *):not(.visually-hidden) { color: var(--title-ink); font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.card h3.h5 { font-size: 16px; }
.card h3.h5 a, .card h2.h5 a { color: inherit; }
:is(:is(.card, .panel) h2:is(.h4, .h5), .panel h2):not(.report-page *, .work-section-head h2, .work-panel-heading h2, .panel-title-with-icon h2, .connection-title h2, .client-empty-state h2, .visually-hidden):not(:has(.section-number))::before {
    content: ""; display: inline-block; width: 4px; height: .95em; margin-right: 10px; border-radius: 4px; background: linear-gradient(180deg, var(--primary), #8b6cf0); vertical-align: -.12em;
}
.panel-heading { border-bottom: 0; background: linear-gradient(90deg, var(--primary-line), var(--line) 55%) left bottom / 100% 1px no-repeat; }
.page-content section:not(.card, .panel, .report-break) > h2.h4:first-child { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--primary-ink); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.page-content section:not(.card, .panel, .report-break) > h2.h4:first-child::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--primary-line), rgba(201, 209, 248, 0)); }
/* A panel already has its padding; an inner .p-3 wrapper (client questions, messages, loans, W-9 requests, overnight
   preparation) doubled it into a box within a box (browser check 2026-11-16). */
.panel > .p-3 { padding: 0 !important; }
