:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --text: #1d2738;
    --muted: #5f6f86;
    --border: #dce3ef;
    --primary: #1f4fb8;
    --primary-hover: #163c8f;
    --ok-bg: #eaf7ef;
    --ok-border: #5ba572;
    --shadow: 0 8px 24px rgba(19, 38, 73, 0.08);
}
* {
    box-sizing: border-box;
}
html {
    overflow-x: clip;
}
body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f8faff 0%, var(--bg) 35%, var(--bg) 100%);
    overflow-x: clip;
    max-width: 100%;
}
.page {
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
    min-width: 0;
}
.page--wide {
    max-width: min(100%, 96rem);
}
body.nav-drawer-open {
    overflow: hidden;
}
.app-header {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
    padding: 0 0 0.25rem;
    max-width: 100%;
    min-width: 0;
}
.app-header__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
}
.brand-wrap {
    min-width: 0;
}
.brand {
    margin: 0;
    font-size: 1.3rem;
    letter-spacing: 0.02em;
}
.brand-subtitle {
    margin: 0.3rem 0 0;
    font-size: 0.86rem;
    color: var(--muted);
}
.header-search {
    position: relative;
    flex: 1 1 14rem;
    min-width: 12rem;
    max-width: 32rem;
    z-index: 50;
}
.header-search.is-open {
    z-index: 1100;
}
.header-search__field {
    position: relative;
    display: flex;
    align-items: center;
}
.header-search__icon {
    position: absolute;
    inset-inline-start: 0.65rem;
    display: inline-flex;
    color: var(--muted);
    pointer-events: none;
}
.header-search__input {
    width: 100%;
    max-width: none;
    min-height: 2.15rem;
    margin: 0;
    padding-block: 0.35rem;
    padding-inline-start: 2.15rem;
    padding-inline-end: 4.1rem;
    border: 1px solid var(--border, #d0d7e2);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 0.92rem;
}
.header-search__input::-webkit-search-decoration,
.header-search__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}
.header-search__shortcut {
    position: absolute;
    inset-inline-end: 0.45rem;
    padding: 0.1rem 0.35rem;
    border: 1px solid #d5deeb;
    border-radius: 4px;
    background: #f8fafc;
    color: #64748b;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
    pointer-events: none;
}
.header-search__panel {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    z-index: 1100;
    margin: 0;
    padding: 0.35rem;
    border: 1px solid var(--border, #d0d7e2);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    max-height: 24rem;
    overflow: auto;
}
.header-search__panel[hidden] {
    display: none;
}
.header-search__list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.header-search__section {
    margin: 0.35rem 0 0.1rem;
    padding: 0.2rem 0.5rem;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.header-search__section:first-child {
    margin-top: 0;
}
.header-search__option {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin: 0;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
}
.header-search__option:hover,
.header-search__option.is-active {
    background: #2563eb;
    color: #fff;
}
.header-search__option-label {
    font-weight: 600;
    font-size: 0.92rem;
}
.header-search__option-group {
    font-size: 0.75rem;
    color: var(--muted);
}
.header-search__option:hover .header-search__option-group,
.header-search__option.is-active .header-search__option-group {
    color: rgba(255, 255, 255, 0.82);
}
.header-search__empty {
    margin: 0;
    padding: 0.55rem 0.5rem;
    color: var(--muted);
    font-size: 0.88rem;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-direction: row;
    flex-wrap: nowrap;
    margin-inline-start: auto;
    min-width: 0;
    overflow: visible;
}
.timekeeper-chip {
    position: relative;
    flex: 0 0 auto;
}
.timekeeper-chip__trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    min-height: 2.15rem;
    margin: 0;
    padding: 0.2rem 0.5rem 0.2rem 0.4rem;
    border: 1px solid var(--border, #d0d7e2);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font: inherit;
    cursor: pointer;
    line-height: 1;
}
.timekeeper-chip__trigger:hover,
.timekeeper-chip__trigger:focus-visible {
    border-color: #93b4f6;
    outline: 2px solid #bfd2f6;
    outline-offset: 2px;
}
.timekeeper-chip.is-running .timekeeper-chip__trigger {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}
.timekeeper-chip.is-paused .timekeeper-chip__trigger {
    border-color: #e6c200;
    background: #fff8e6;
    color: #854d0e;
}
.timekeeper-chip__hourglass {
    width: 0.92rem;
    height: 0.92rem;
    flex-shrink: 0;
}
.timekeeper-chip__time {
    font-variant-numeric: tabular-nums;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    min-width: 2.1rem;
}
.timekeeper-chip__panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    inset-inline-end: 0;
    z-index: 1200;
    width: min(22rem, calc(100vw - 2rem));
    padding: 0.75rem 0.85rem 0.8rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
}
.timekeeper-chip__panel[hidden] {
    display: none;
}
.timekeeper-chip__panel-title {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.timekeeper-chip__panel-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.35rem 0 0.15rem;
}
.timekeeper-chip__panel-detail {
    margin: 0 0 0.55rem;
    font-size: 0.82rem;
    color: var(--muted);
}
.timekeeper-chip__facts {
    margin: 0 0 0.55rem;
    display: grid;
    gap: 0.3rem;
}
.timekeeper-chip__facts div {
    display: grid;
    grid-template-columns: 5rem 1fr;
    gap: 0.4rem;
    align-items: baseline;
}
.timekeeper-chip__facts dt {
    margin: 0;
    font-size: 0.7rem;
    color: var(--muted);
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.timekeeper-chip__facts dd {
    margin: 0;
    font-size: 0.86rem;
    min-width: 0;
    overflow-wrap: anywhere;
}
.timekeeper-chip__facts div.is-editing {
    align-items: center;
}
.timekeeper-chip__fact-text[hidden],
.timekeeper-chip__facts select[hidden] {
    display: none !important;
}
.timekeeper-chip__facts select {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.18rem 0.35rem;
    font: inherit;
    font-size: 0.82rem;
    line-height: 1.3;
}
.timekeeper-chip__elapsed-lg {
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    font-size: 1.05rem;
}
.timekeeper-chip__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.timekeeper-chip__stop-btn,
.timekeeper-chip__start-btn {
    min-height: 0;
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 650;
    border-radius: 6px;
    border: 1px solid #d5deeb;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
}
.timekeeper-chip__start-btn {
    background: #ecfdf3;
    border-color: #bbf7d0;
    color: #166534;
}
.timekeeper-chip__stop-btn {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}
.timekeeper-chip__start-btn[hidden],
.timekeeper-chip__stop-btn[hidden] {
    display: none !important;
}
.timekeeper-chip__mode {
    display: flex;
    margin: 0.55rem 0 0;
    border: 1px solid #d5deeb;
    border-radius: 6px;
    overflow: hidden;
}
.timekeeper-chip__mode-btn {
    flex: 1 1 0;
    min-height: 0;
    margin: 0;
    padding: 0.35rem 0.6rem;
    border: 0;
    border-radius: 0;
    background: #f8fafc;
    color: #64748b;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 650;
    cursor: pointer;
}
.timekeeper-chip__mode-btn + .timekeeper-chip__mode-btn {
    border-left: 1px solid #d5deeb;
}
.timekeeper-chip__mode-btn.is-on {
    background: #ecfdf3;
    color: #166534;
}
.timekeeper-chip__billable {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: 0.45rem;
    width: auto;
    margin: 0 0 0.55rem;
    padding: 0;
}
.timekeeper-chip__billable label {
    margin: 0;
    padding: 0;
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--text, #1e293b);
    cursor: pointer;
}
.timekeeper-chip__work {
    margin: 0 0 0.65rem;
}
.timekeeper-chip__work[hidden] {
    display: none !important;
}
.timekeeper-chip__work label {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
}
.timekeeper-chip__work textarea {
    display: block;
    width: 100%;
    max-width: none;
    min-height: 3.2rem;
    margin: 0;
    padding: 0.35rem 0.45rem;
    font: inherit;
    font-size: 0.82rem;
    line-height: 1.35;
    resize: vertical;
}
a.timekeeper-chip__open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.65rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid #d5deeb;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 650;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}
a.timekeeper-chip__open-btn:hover {
    background: #eef2f7;
    color: #1e293b;
}
.tk-entries-table th,
.tk-entries-table td {
    padding: 0.35rem 0.4rem;
    font-size: 0.8rem;
    vertical-align: middle;
}
.tk-entries-table .tk-col-start,
.tk-entries-table .tk-col-end,
.tk-entries-table .tk-col-hours,
.tk-entries-table .tk-col-capture,
.tk-entries-table .tk-col-actions {
    white-space: nowrap;
    width: 1%;
}
.tk-entries-table .tk-col-user,
.tk-entries-table .tk-col-client,
.tk-entries-table .tk-col-workflow {
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tk-entry-billable-cell {
    vertical-align: middle;
    white-space: nowrap;
    width: 38%;
    min-width: 12rem;
    max-width: none;
}
.tk-entry-billable,
.tk-entry-billing {
    margin: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    width: 100%;
}
.tk-entry-billable .report-options__field--toggle,
.tk-entry-billing__toggle {
    margin: 0;
    padding: 0;
    min-height: 0;
    width: auto;
    flex: 0 0 auto;
}
.tk-entry-work {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}
.tk-entry-work[hidden] {
    display: none !important;
}
.tk-entry-work input[type="text"] {
    display: block;
    width: 100%;
    max-width: none;
    min-height: 0;
    height: 1.7rem;
    padding: 0.15rem 0.4rem;
    font: inherit;
    font-size: 0.76rem;
    line-height: 1.25;
}
.tk-entry-billable-flag {
    flex: 0 0 auto;
    font-size: 0.76rem;
}
.tk-entry-work-text {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.76rem;
    color: var(--muted);
}
@media (max-width: 1200px) {
    .table-scroll.table-scroll--stack tbody td.tk-entry-billable-cell {
        flex: 1 1 100%;
        min-width: 0;
        max-width: none;
        width: auto;
        white-space: normal;
    }
    .tk-entries-table .tk-col-user,
    .tk-entries-table .tk-col-client,
    .tk-entries-table .tk-col-workflow {
        max-width: none;
        overflow: visible;
        text-overflow: unset;
        white-space: normal;
    }
}
.timekeeper-report-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.85rem;
}
.connection-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-direction: row;
    flex-shrink: 1;
    min-width: 0;
}
.connection-switcher label,
.client-switcher__label {
    margin: 0;
    font-size: 0.76rem;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.connection-switcher select,
.client-switcher__toggle {
    width: auto;
    min-width: 180px;
    max-width: 260px;
    padding: 0.42rem;
    border-radius: 6px;
}
.client-switcher__dropdown {
    position: relative;
    min-width: 0;
    flex: 1 1 auto;
}
/* Open list must stack above .app-nav (z-index 40, later in the DOM). The
   panel opens over the full-width nav bar; a matching z-index lets the nav
   steal clicks from the first client row. Match header-search.is-open. */
.client-switcher__dropdown.is-open {
    z-index: 1100;
}
.client-switcher__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    width: 100%;
    min-height: 2.15rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--border, #d0d7e2);
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;
}
.client-switcher__toggle:hover {
    border-color: #93b4f6;
}
.client-switcher__toggle:focus,
.client-switcher__toggle:focus-visible {
    border-color: #93b4f6;
    outline: 2px solid #bfd2f6;
    outline-offset: 2px;
}
.client-switcher__selected {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    overflow: hidden;
}
.client-switcher__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.client-switcher__placeholder {
    color: var(--muted);
}
.client-switcher__caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #64748b;
    flex: 0 0 auto;
}
.client-switcher__panel {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    z-index: 1100;
    min-width: 100%;
    width: max-content;
    max-width: 22rem;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    border: 1px solid var(--border, #d0d7e2);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    max-height: 16rem;
    overflow: auto;
}
.client-switcher__option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.35rem 0.45rem;
    border-radius: 4px;
    cursor: pointer;
}
.client-switcher__option:hover,
.client-switcher__option:focus {
    background: #2563eb;
    color: #fff;
    outline: none;
}
.client-switcher__option.is-selected {
    font-weight: 600;
}
.client-switcher__option:hover .client-switcher__placeholder,
.client-switcher__option:focus .client-switcher__placeholder {
    color: #fff;
}
.client-switcher__option:hover .client-system-icon--bookwright,
.client-switcher__option:focus .client-system-icon--bookwright {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}
.client-system-icon {
    flex: 0 0 auto;
}
.client-system-icon--qbo {
    display: block;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
}
.client-system-icon--bookwright {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}
.account-menu {
    position: relative;
    flex-shrink: 0;
}
.account-menu__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}
.account-menu__trigger:hover,
.account-menu__trigger:focus-visible {
    background: transparent;
    outline: 2px solid #b6c9ef;
    outline-offset: 2px;
}
.account-menu__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    user-select: none;
}
.account-menu__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;
}
.account-menu__dropdown {
    position: absolute;
    top: calc(100% + 0.35rem);
    inset-inline-end: 0;
    min-width: 11.5rem;
    margin: 0;
    padding: 0.35rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 1000;
}
.account-menu__dropdown[hidden] {
    display: none;
}
.account-menu__dropdown a,
.account-menu__dropdown button[role="menuitem"],
.account-menu__logout button {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 7px;
    padding: 0.45rem 0.55rem;
    color: #1f2937;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}
.account-menu__dropdown a:hover,
.account-menu__dropdown button[role="menuitem"]:hover,
.account-menu__logout button:hover {
    background: #f1f5ff;
    color: #1f2937;
}
.account-menu__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    margin-inline-start: 0.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    vertical-align: middle;
}
.account-menu__logout {
    margin: 0;
}
.feedback-dialog {
    border: 0;
    border-radius: 12px;
    padding: 0;
    max-width: 28rem;
    width: calc(100vw - 2rem);
    box-shadow: var(--shadow);
}
.feedback-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}
.feedback-dialog__inner {
    padding: 1.1rem 1.2rem 1.2rem;
}
.feedback-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}
.feedback-dialog__header h2 {
    margin: 0;
    font-size: 1.15rem;
}
.feedback-dialog__close {
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 0.15rem 0.35rem;
}
.feedback-dialog__close:hover {
    color: #1f2937;
}
.feedback-dialog__intro {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.9rem;
}
.feedback-dialog__form .form-field label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.88rem;
}
.feedback-dialog__form input[type="text"],
.feedback-dialog__form select,
.feedback-dialog__form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}
.feedback-dialog__form .form-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}
.feedback-meta {
    color: var(--muted);
    font-size: 0.9rem;
}
.feedback-meta dt {
    font-weight: 600;
    color: #374151;
    margin-top: 0.55rem;
}
.feedback-meta dd {
    margin: 0.15rem 0 0;
}
.feedback-context,
.feedback-cursor-brief {
    width: 100%;
    box-sizing: border-box;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.82rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    white-space: pre-wrap;
}
.feedback-cursor-brief {
    min-height: 12rem;
}
.feedback-unread {
    font-weight: 700;
}
.feedback-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1rem;
}
.feedback-filters .form-field {
    margin-bottom: 0;
}
.feedback-response {
    margin-top: 1.25rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--ok-border);
    border-radius: 10px;
    background: var(--ok-bg);
}
.feedback-response h3 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
}
.feedback-admin-form select,
.feedback-admin-form textarea {
    width: 100%;
    max-width: 40rem;
    box-sizing: border-box;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}
.feedback-filters select {
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}
.app-nav {
    width: 100%;
    position: relative;
    z-index: 40;
}
.app-nav__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fbff;
    color: #1e3a8a;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}
.app-nav__toggle:hover,
.app-nav__toggle:focus-visible {
    background: #edf3ff;
    border-color: #c8d8f7;
    outline: 2px solid #bfd2f6;
    outline-offset: 2px;
}
.app-nav__toggle-bars {
    display: block;
    width: 1.1rem;
    height: 0.85rem;
    background:
        linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
        linear-gradient(currentColor, currentColor) 0 50% / 100% 2px no-repeat,
        linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
}
.app-nav__toggle-label {
    line-height: 1;
}
.app-nav__backdrop {
    display: none;
}
.app-nav__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.3rem;
    width: 100%;
    padding-top: 0.1rem;
    overflow: visible;
    align-items: center;
}
.app-nav__list > li {
    position: relative;
}
.app-nav a {
    text-decoration: none;
    color: #1e3a8a;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.38rem 0.62rem;
    background: #f8fbff;
    transition: 0.15s ease-in-out;
    font-size: 0.82rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}
.app-nav__group {
    border: 1px solid var(--border);
    background: #f8fbff;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
}
.app-nav__parent-link {
    text-decoration: none;
    color: #1e3a8a;
    font-weight: 600;
    padding: 0.38rem 0.62rem;
    font-size: 0.82rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}
.app-nav__parent-link:hover {
    background: #edf3ff;
}
.app-nav__link--disabled,
.app-nav__link--disabled:hover {
    color: #8a96ab;
    background: #f4f7fb;
    cursor: not-allowed;
    pointer-events: none;
}
span.app-nav__parent-link.app-nav__link--disabled {
    display: inline-flex;
}
.app-nav a:hover {
    background: #edf3ff;
    border-color: #c8d8f7;
}
.app-nav a.is-active,
.app-nav__group.is-active,
.app-nav__group.is-active .app-nav__parent-link {
    background: #e8f0ff;
    border-color: #b6c9ef;
    color: #173a8d;
}
.app-nav__submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    max-height: min(70vh, 28rem);
    overflow-x: hidden;
    overflow-y: auto;
    margin: 0;
    padding: 0.35rem;
    padding-top: 0.5rem;
    list-style: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: none;
    z-index: 999;
}
.app-nav__list > li:last-child .app-nav__submenu {
    left: auto;
    right: 0;
}
/* Invisible bridge so moving from parent link to submenu does not break hover */
.app-nav__submenu::before {
    content: "";
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
}
.app-nav__submenu li {
    margin: 0;
}
.app-nav__submenu a {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 7px;
    padding: 0.4rem 0.5rem;
    color: #1f2937;
    font-weight: 500;
    text-decoration: none;
}
.app-nav__submenu a:hover {
    background: #f1f5ff;
}
.app-nav__hint {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    padding: 0.4rem 0.5rem;
}
.app-nav__submenu-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0.55rem 0.5rem 0.2rem;
    margin-top: 0.15rem;
}
.app-nav__submenu-label:first-child {
    margin-top: 0;
    padding-top: 0.35rem;
}
.app-nav__item:hover > .app-nav__submenu,
.app-nav__item:focus-within > .app-nav__submenu,
.app-nav__item.is-open > .app-nav__submenu {
    display: block;
}
.card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}
h2 {
    margin-top: 0;
}
p {
    color: var(--muted);
    line-height: 1.5;
}
.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}
.messages li,
.messages__item {
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.5rem;
    border: 1px solid #cde7d4;
    border-left: 4px solid var(--ok-border);
    background: var(--ok-bg);
}
.messages li.error,
.messages__item.error {
    background: #fef3f2;
    border-color: #f9dbda;
    border-left-color: #b42318;
    color: #7a271a;
}
.messages li.warning,
.messages__item.warning {
    background: #fffaeb;
    border-color: #fedf89;
    border-left-color: #b54708;
    color: #7a2e0e;
}
.messages li.info,
.messages__item.info {
    background: #eff4ff;
    border-color: #c7d7fe;
    border-left-color: var(--primary);
    color: #1d2738;
}
.messages li.success,
.messages__item.success {
    background: var(--ok-bg);
    border-color: #cde7d4;
    border-left-color: var(--ok-border);
}
form p {
    margin-bottom: 0.9rem;
}
label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}
input, select, textarea {
    width: 100%;
    max-width: 640px;
    padding: 0.6rem 0.65rem;
    border: 1px solid #c9d5e6;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
}
input[type="radio"],
input[type="checkbox"] {
    width: auto;
    max-width: none;
    height: auto;
    padding: 0;
    margin: 0;
    border: initial;
    border-radius: 0;
    background: transparent;
    accent-color: var(--primary, #1f4fb8);
}
label:has(> input[type="radio"]) {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0 0 0.4rem;
    font-weight: 500;
    line-height: 1.35;
    cursor: pointer;
}
label:has(> input[type="radio"]) > input[type="radio"] {
    flex: 0 0 auto;
    margin-top: 0.2em;
}
.radio-options {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid #bfd2f6;
    border-color: #93b0e8;
}
table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
table:has(.ss-dropdown),
table:has(.ms-dropdown) {
    overflow: visible;
}
th, td {
    border-bottom: 1px solid #e5ebf5;
    text-align: left;
    padding: 0.6rem 0.65rem;
    font-size: 0.95rem;
    vertical-align: top;
}
thead th {
    background: #f4f7fd;
    color: #2b3e62;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
tbody tr:nth-child(even) {
    background: #fafcff;
}
tbody tr:hover {
    background: #f2f7ff;
}
.amount-col {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.amount-col--wrap {
    white-space: normal;
    max-width: 5.5rem;
    line-height: 1.2;
}
.amount-col--attention {
    color: #9a3412;
    font-weight: 600;
}
.flash {
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    margin: 0 0 1rem;
    border: 1px solid #cde7d4;
    border-left: 4px solid var(--ok-border);
    background: var(--ok-bg);
}
.flash--warning {
    background: #fffaeb;
    border-color: #fedf89;
    border-left-color: #b54708;
    color: #7a2e0e;
}
.recon-workbook-table tbody tr.is-reconciled > td {
    background: var(--ok-bg);
}
.recon-workbook-table tbody tr.is-reconciled > td:first-child {
    box-shadow: inset 4px 0 0 var(--ok-border);
}
.recon-workbook-table tbody tr.is-reconciled:hover > td {
    background: #d9efe2;
}
.recon-workbook-table tbody tr.is-warning > td,
.recon-workbook-table tbody tr.is-unsubstantiated > td {
    background: #fff7ed;
}
.recon-workbook-table tbody tr.is-unsubstantiated > td:first-child {
    box-shadow: inset 4px 0 0 #ea580c;
}
.recon-workbook-table tbody tr.is-warning.is-unsubstantiated > td,
.recon-workbook-table tbody tr.is-warning > td {
    background: #ffedd5;
}
.recon-workbook-table tbody tr.is-unsubstantiated:hover > td,
.recon-workbook-table tbody tr.is-warning:hover > td {
    background: #fed7aa;
}
/* Wide layout: prevent cell paint-over when many columns share the row. */
.recon-workbook-table th,
.recon-workbook-table td {
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: top;
}
.recon-workbook-table td:first-child {
    min-width: 10rem;
    max-width: 16rem;
}
.recon-workbook-table .recon-ledger-pin {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
}
.recon-workbook-table .amount-col {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}
.recon-workbook-table a.recon-subst-amount {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.12em;
}
.recon-workbook-table a.recon-subst-amount:hover {
    color: var(--primary);
}
.recon-workbook-table .recon-alerts-cell,
.recon-workbook-table .recon-subst-cell {
    max-width: 9.5rem;
}
@media (max-width: 1200px) {
    /* Card stack owns layout; drop desktop cell width caps. */
    .table-scroll--stack .recon-workbook-table td:first-child,
    .table-scroll--stack .recon-workbook-table .recon-alerts-cell,
    .table-scroll--stack .recon-workbook-table .recon-subst-cell {
        min-width: 0;
        max-width: none;
    }
    .table-scroll--stack .recon-workbook-table tbody tr.is-reconciled {
        background: var(--ok-bg);
        box-shadow: inset 4px 0 0 var(--ok-border);
    }
    .table-scroll--stack .recon-workbook-table tbody tr.is-unsubstantiated {
        background: #fff7ed;
        box-shadow: inset 4px 0 0 #ea580c;
    }
    .table-scroll--stack .recon-workbook-table tbody tr.is-warning,
    .table-scroll--stack .recon-workbook-table tbody tr.is-warning.is-unsubstantiated {
        background: #ffedd5;
    }
    .table-scroll--stack .recon-workbook-table tbody tr.is-reconciled:hover {
        background: #d9efe2;
    }
    .table-scroll--stack .recon-workbook-table tbody tr.is-unsubstantiated:hover,
    .table-scroll--stack .recon-workbook-table tbody tr.is-warning:hover {
        background: #fed7aa;
    }
    .table-scroll--stack .recon-workbook-table tbody tr.is-reconciled > td,
    .table-scroll--stack .recon-workbook-table tbody tr.is-unsubstantiated > td,
    .table-scroll--stack .recon-workbook-table tbody tr.is-warning > td {
        background: transparent;
        box-shadow: none;
    }
    /* Balanced two-column fields; actions sit at the bottom. */
    .table-scroll--stack .recon-workbook-table tbody td[data-stack="secondary"] {
        flex: 1 1 calc(50% - 0.4rem);
        min-width: calc(50% - 0.55rem);
        max-width: calc(50% - 0.2rem);
    }
    .table-scroll--stack .recon-workbook-table tbody td.recon-stack-status { order: 10; }
    .table-scroll--stack .recon-workbook-table tbody td.recon-stack-type { order: 11; }
    .table-scroll--stack .recon-workbook-table tbody td.recon-stack-ledger { order: 12; }
    .table-scroll--stack .recon-workbook-table tbody td.recon-stack-subst { order: 13; }
    .table-scroll--stack .recon-workbook-table tbody td.recon-stack-stype { order: 14; }
    .table-scroll--stack .recon-workbook-table tbody td.recon-stack-alerts { order: 15; }
    /* Keep thumbs-up on the card title row (after account), not buried in actions. */
    .table-scroll--stack .recon-workbook-table tbody td.recon-quick-reconcile-col {
        order: 2;
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
        max-width: none;
        text-align: right;
        margin-left: auto;
    }
    .table-scroll--stack .recon-workbook-table tbody td[data-stack="amount"][data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.1rem;
        color: var(--muted, #64748b);
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        text-align: right;
    }
    .table-scroll--stack .recon-workbook-table tbody td[data-stack="meta"] {
        order: 20;
        flex: 1 1 100%;
        margin-top: 0.25rem;
        padding-top: 0.45rem;
        border-top: 1px solid var(--border, #e2e8f0);
    }
    .table-scroll--stack .recon-workbook-table tbody tr[data-recon-narrow-hide="1"] {
        display: none !important;
    }
}
.recon-workbook-narrow-filters {
    display: none;
}
@media (max-width: 1200px) {
    .recon-workbook-narrow-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem 0.65rem;
        align-items: center;
        margin: 0 0 0.75rem;
    }
    .recon-workbook-narrow-filters__search {
        flex: 1 1 12rem;
        min-width: 10rem;
    }
    .recon-workbook-narrow-filters__search input {
        width: 100%;
        box-sizing: border-box;
    }
    .recon-workbook-narrow-filters__status select {
        min-width: 9rem;
    }
    .recon-workbook-narrow-filters__attention {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        font-size: 0.86rem;
        color: var(--muted, #64748b);
        white-space: nowrap;
    }
}
.recon-manual-balance-icon {
    display: inline-block;
    margin-left: 0.2rem;
    color: #8a6a00;
    font-size: 0.8rem;
    line-height: 1;
    cursor: help;
    vertical-align: baseline;
}
.recon-quick-reconcile-col {
    width: 2.5rem;
    white-space: nowrap;
    text-align: center;
    overflow: visible;
}
.recon-workbook-table td.recon-quick-reconcile-col {
    overflow: visible;
}
.recon-quick-reconcile-form {
    display: inline-flex;
    margin: 0;
}
.recon-workbook-table tbody tr[id^="recon-line-"] {
    scroll-margin-top: 1.5rem;
}
.recon-quick-reconcile-error {
    display: block;
    margin-top: 0.3rem;
    color: #8a1f11;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: normal;
    text-align: left;
}
.recon-quick-reconcile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    min-width: 0;
    min-height: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}
.recon-quick-reconcile-btn:hover,
.recon-quick-reconcile-btn:focus {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #166534;
}
.recon-quick-reconcile-btn.is-reconciled {
    color: #166534;
}
.recon-quick-reconcile-btn.is-reconciled:hover,
.recon-quick-reconcile-btn.is-reconciled:focus {
    color: #14532d;
}
.recon-quick-reconcile-btn.is-static {
    cursor: default;
    pointer-events: none;
}
.recon-quick-reconcile-btn svg {
    width: 1.05rem;
    height: 1.05rem;
    display: block;
}
.recon-subst-type {
    cursor: help;
}
.recon-alerts-cell {
    white-space: normal;
}
.recon-alert {
    display: inline-block;
    white-space: nowrap;
    font-size: 0.72rem;
    line-height: 1.2;
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
    margin-right: 0.15rem;
}
.recon-alert:hover {
    text-decoration: none;
    border-bottom-style: solid;
}
.recon-alert--info {
    color: #4b5563;
}
.recon-alert--ok {
    color: #166534;
}
.recon-alert--warn {
    color: #8a6a00;
}
.recon-alert--fail {
    color: #9b1c1c;
}
.recon-line-alerts {
    list-style: none;
    margin: 0;
    padding: 0;
}
.recon-line-alerts > li {
    display: block;
    margin: 0.35rem 0;
    border-bottom: none;
}
.recon-line-alerts > li.recon-alert--info {
    color: #166534;
}

/* ------------------------------------------------------------------ */
/* Bank reconciliation detail — QBO-style summary header + compact forms */
/* ------------------------------------------------------------------ */
.recon-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem 0.6rem;
    margin: 0.35rem 0 0.85rem;
}
.recon-summary__figure {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.5rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e6ebf2;
    border-radius: 8px;
    min-width: 8.5rem;
}
.recon-summary__label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    font-weight: 600;
}
.recon-summary__value {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
}
.recon-summary__sub {
    font-size: 0.74rem;
    color: var(--muted);
}
.recon-summary__op {
    display: flex;
    align-items: center;
    padding: 0 0.1rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--muted);
}
.recon-summary__figure--diff {
    background: #fff7ed;
    border-color: #fed7aa;
}
.recon-summary__figure--diff .recon-summary__value {
    color: #b45309;
}
.recon-summary__figure--diff.is-zero {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.recon-summary__figure--diff.is-zero .recon-summary__value {
    color: #166534;
}
.recon-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 1rem;
    font-size: 0.9rem;
    color: #334155;
}
.recon-meta__item {
    white-space: nowrap;
}
.recon-diff-breakdown {
    margin: 0.15rem 0 0.85rem;
    padding: 0.65rem 0.85rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    font-size: 0.88rem;
}
.recon-diff-breakdown h3 {
    margin: 0 0 0.4rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9a3412;
}
.recon-diff-breakdown__formula {
    margin: 0 0 0.5rem;
}
.recon-diff-breakdown dl {
    display: grid;
    grid-template-columns: minmax(10rem, 1fr) auto;
    gap: 0.2rem 1.25rem;
    margin: 0;
}
.recon-diff-breakdown dt {
    color: var(--muted);
}
.recon-diff-breakdown dd {
    margin: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.recon-diff-breakdown dd a {
    margin-left: 0.35rem;
    font-weight: 600;
}
.recon-diff-breakdown p {
    margin: 0.5rem 0 0;
    color: #334155;
}
.recon-diff-breakdown p:last-child {
    margin-bottom: 0;
}
.recon-diff-combos {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px solid #fed7aa;
}
.recon-diff-combos h4 {
    display: inline;
    margin: 0 0.35rem 0 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9a3412;
}
.recon-diff-combos__option {
    margin-top: 0.55rem;
}
.recon-diff-combos__option + .recon-diff-combos__option {
    padding-top: 0.55rem;
    border-top: 1px dashed #fed7aa;
}
.recon-diff-combos__meta {
    margin: 0 0 0.35rem;
    font-weight: 600;
}
.recon-diff-combos__table {
    margin: 0;
}
.recon-diff-combos__actions {
    margin-top: 0.4rem;
}
tr.recon-diff-combo-row td {
    background: #fff7ed;
}

/* Small chromeless icon link (e.g. Chart of Accounts settings). */
.recon-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #64748b;
    text-decoration: none;
}
.recon-icon-link:hover,
.recon-icon-link:focus-visible {
    color: #334155;
    background: #f1f5f9;
    border-color: #e2e8f0;
    outline: none;
}
.recon-icon-link svg {
    width: 1rem;
    height: 1rem;
    display: block;
}
.attachment-file {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    vertical-align: middle;
}
.attachment-file__csv {
    width: 1.45rem;
    height: 1.45rem;
    min-height: 0;
    flex-shrink: 0;
}
.attachment-file__csv svg {
    width: 0.95rem;
    height: 0.95rem;
}

/* Native info popover (details/summary) — no JS framework required. */
.info-pop {
    position: relative;
    display: inline-block;
}
.info-pop > summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 1px solid transparent;
    color: #64748b;
}
.info-pop > summary::-webkit-details-marker,
.info-pop > summary::marker {
    display: none;
    content: "";
}
.info-pop > summary:hover,
.info-pop[open] > summary {
    color: var(--primary, #1f4fb8);
    background: #eef3fc;
    border-color: #c9d8f5;
}
.info-pop > summary:focus-visible {
    outline: 2px solid var(--primary, #1f4fb8);
    outline-offset: 1px;
}
.info-pop > summary svg {
    width: 1rem;
    height: 1rem;
    display: block;
}
.info-pop__panel {
    position: absolute;
    z-index: 40;
    top: calc(100% + 0.35rem);
    left: 0;
    width: min(24rem, 82vw);
    max-width: calc(100vw - 1rem);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
    padding: 0.7rem 0.85rem;
    font-size: 0.85rem;
    line-height: 1.45;
    color: #475569;
    white-space: normal;
}
.info-pop--right .info-pop__panel {
    left: auto;
    right: 0;
}
.info-pop__panel p {
    margin: 0 0 0.5rem;
}
.info-pop__panel p:last-child {
    margin-bottom: 0;
}

/* Section heading with an inline info popover. */
.section-head,
.recon-section-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 1.1rem 0 0.5rem;
}
.section-head:first-child,
.recon-section-head:first-child {
    margin-top: 0;
}
.section-head h2,
.section-head h3,
.section-head h4,
.recon-section-head h3,
.recon-section-head h4 {
    margin: 0;
}

/* Compact wrapping form row: labels share a band so inputs stay level; Save sits with fields. */
.recon-form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem 1.25rem;
}
.recon-form-row .form-field {
    margin-bottom: 0;
    min-width: 0;
    flex: 1 1 11rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.recon-form-row .form-field input,
.recon-form-row .form-field select {
    max-width: none;
    width: 100%;
}
.recon-form-row .recon-field-labelrow {
    min-height: 2.6em;
    align-items: flex-end;
}
.recon-form-row__action {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
}
.recon-form-row__action .button,
.recon-form-row__action .secondary {
    margin: 0;
    white-space: nowrap;
}
.recon-field-labelrow {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.recon-field-labelrow label {
    margin: 0;
}
.recon-field-tip {
    display: inline-flex;
    align-items: center;
    color: #94a3b8;
    cursor: help;
}
.recon-field-tip svg {
    width: 0.9rem;
    height: 0.9rem;
    display: block;
}
@media (max-width: 640px) {
    .recon-form-row__action {
        flex: 1 1 100%;
    }
    .recon-form-row__action .button,
    .recon-form-row__action .secondary {
        width: 100%;
        min-height: 2.75rem;
        text-align: center;
    }
}

.report-table th,
.report-table td {
    padding: 0.12rem 0.4rem;
    font-size: 0.78rem;
    line-height: 1.15;
    vertical-align: middle;
    border-bottom-color: #edf1f7;
}
.report-table thead th {
    padding: 0.16rem 0.4rem;
    font-size: 0.65rem;
    letter-spacing: 0.03em;
}
.report-table thead th.trend-parent-header {
    text-align: center;
    font-weight: 600;
    border-bottom: 1px solid #d8e0ec;
}
.report-table thead th.trend-child-header {
    text-align: center;
    font-weight: 500;
}
.report-table thead th.trend-parent-subtotal-header,
.report-table td.trend-parent-subtotal-col {
    font-weight: 600;
    background: #f8fafd;
}
.report-table th.trend-total-col,
.report-table td.trend-total-col {
    border-left: 1px solid #d8e0ec;
    padding-left: 0.55rem;
}
.subtotal-row td {
    font-weight: 600;
    background: #f4f7fd;
}
.report-table .section-total-row td {
    font-weight: 700;
    border-top: 1px solid #d8e0ec;
}
.report-table .subtotal-row td,
.report-table .calculated-row td {
    padding-top: 0.16rem;
    padding-bottom: 0.12rem;
}
.section-header-row td {
    font-weight: 700;
    background: #eef2f8;
    border-top: 1px solid #d8e0ec;
}
.report-table .section-header-row td {
    padding-top: 0.2rem;
    padding-bottom: 0.12rem;
    font-size: 0.8rem;
}

/* Customer / project / transaction hierarchy on balance detail reports */
.balance-detail-table .balance-detail-table__date-col,
.balance-detail-table .balance-detail-table__due-col,
.balance-detail-table .balance-detail-table__num-col {
    white-space: nowrap;
}
.balance-detail-table .balance-detail-table__type-col {
    white-space: normal;
}
.balance-detail-table .balance-detail-table__project-col,
.balance-detail-table .balance-detail-table__memo-col {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    vertical-align: top;
}
.balance-detail-table .balance-detail-table__memo-col {
    min-width: 8rem;
    width: 38%;
}
.balance-detail-table .balance-detail-table__project-col {
    min-width: 6rem;
    max-width: 12rem;
}
.balance-detail-table .balance-detail-row--customer td {
    padding-left: 0.55rem;
    /* Name label: subtle band, smaller type; totals carry the emphasis */
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    background: #f7f9fc;
    border-top: 1px solid #e4eaf3;
}
.balance-detail-table .balance-detail-row--project td {
    padding-left: 1.35rem;
    font-weight: 600;
    font-size: 0.8rem;
    background: #f5f7fb;
    color: #3d4f6f;
    border-top-color: transparent;
}
.balance-detail-table .balance-detail-row--txn td:first-child {
    padding-left: 2.15rem;
}
.balance-detail-table .balance-detail-row--aged td {
    background: #fff6e8;
}
.balance-detail-table .balance-detail-row--flagged td {
    box-shadow: inset 3px 0 0 #c47b16;
}
.balance-detail-table .balance-detail-row--project-total td:first-child {
    padding-left: 1.35rem;
    font-weight: 600;
    color: #3d4f6f;
}
.balance-detail-table .balance-detail-row--customer-total td {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: #eef2f8;
    border-top: 1px solid #c8d2e3;
    border-bottom: 1px solid #d8e0ec;
    padding-top: 0.22rem;
    padding-bottom: 0.38rem;
}
.balance-detail-table .balance-detail-row--customer-total td:first-child {
    padding-left: 0.55rem;
}
/* Grand total: louder than per-customer/vendor subtotals */
.balance-detail-table .balance-detail-row--grand-total td {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #1a2b45;
    background: #dde5f2;
    border-top: 2px solid #8fa3c4;
    border-bottom: 2px solid #8fa3c4;
    padding-top: 0.45rem;
    padding-bottom: 0.5rem;
}
.balance-detail-table .balance-detail-row--grand-total td:first-child {
    padding-left: 0.55rem;
}
/* Breathing room between one name's total and the next name's header */
.balance-detail-table .balance-detail-row--customer-total + .balance-detail-row--customer td {
    padding-top: 0.55rem;
    border-top: 2px solid #c5d0e0;
}
.balance-detail-table .balance-detail-row--project-total + .balance-detail-row--project td {
    padding-top: 0.35rem;
}
.calculated-row td {
    border-top: 1px solid #d8e0ec;
}
.report-table tbody tr:nth-child(even) {
    background: transparent;
}
.report-account-number {
    display: inline-block;
    margin-right: 0.45rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted, #64748b);
}
.report-table tbody tr:hover > td {
    background: #e8f0ff;
}
.report-table-scroll--freeze .report-table tbody tr:hover > td,
.report-table-scroll--freeze .report-table tbody tr:hover > td:first-child {
    background: #e8f0ff;
}
.report-totals {
    margin-top: 0.2rem;
    max-width: 480px;
    margin-left: auto;
}
.card.report-output {
    padding: 0.55rem 0.75rem;
    max-width: 100%;
    min-width: 0;
    /* Contain stray wide tables; intentional swipe lives on .report-table-scroll. */
    overflow-x: auto;
    overflow-y: visible;
}
.card.report-output h3 {
    margin: 0 0 0.3rem;
    font-size: 0.95rem;
}
.report-disclosure {
    margin: 0.85rem 0 0.35rem;
}
.report-disclosure > summary {
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.report-table-scroll {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.report-table-scroll--freeze {
    overflow: auto;
    max-height: min(90vh, 72rem);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    /* Reserve scrollbar space so rightmost amounts aren't clipped under an
       overlay scrollbar, and so the table doesn't shift when the bar appears. */
    scrollbar-gutter: stable;
    /* Contain horizontal only so page can still scroll while hovered. */
    overscroll-behavior-x: contain;
}
.report-table-scroll--freeze .report-table {
    border-collapse: separate;
    border-spacing: 0;
}
.report-table-scroll--freeze thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f4f7fd;
    box-shadow: 0 1px 0 var(--border);
}
/* Keep second trend header row under the first when both are sticky. */
.report-table-scroll--freeze thead tr:nth-child(2) th {
    top: 1.55rem;
}
.report-table-scroll--freeze thead th:first-child {
    left: 0;
    z-index: 3;
    background: #f4f7fd;
    box-shadow:
        1px 0 0 var(--border),
        0 1px 0 var(--border);
}
.report-table-scroll--freeze .report-table tbody td:first-child,
.report-table-scroll--freeze .report-table tfoot td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--border);
}
.report-table-scroll--freeze .subtotal-row td,
.report-table-scroll--freeze .calculated-row td,
.report-table-scroll--freeze .section-total-row td {
    background: #f4f7fd;
}
.report-table-scroll--freeze .section-header-row td {
    background: #eef2f8;
}
.report-table-scroll--freeze .subtotal-row td:first-child,
.report-table-scroll--freeze .calculated-row td:first-child,
.report-table-scroll--freeze .section-total-row td:first-child,
.report-table-scroll--freeze .section-header-row td:first-child {
    z-index: 1;
}
.report-table-scroll--freeze .report-table__cell--active {
    background: #e8f0ff;
}
.report-table-scroll--freeze .workers-comp-matrix__cell--active {
    background: #e8f0ff;
}
.report-table-scroll--freeze-header-only .report-table tbody td:first-child,
.report-table-scroll--freeze-header-only .report-table tfoot td:first-child {
    position: static;
    box-shadow: none;
}

/* Budget editor: keep account select sticky and wide enough on horizontal scroll.
   Use the account class (not td:first-child) so sticky still works with nested controls. */
.gl-budget-edit-table.report-table-scroll--freeze thead th.gl-budget-edit-table__account,
.gl-budget-edit-table.report-table-scroll--freeze tbody td.gl-budget-edit-table__account {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 16rem;
    max-width: 22rem;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--border);
}
.gl-budget-edit-table.report-table-scroll--freeze thead th.gl-budget-edit-table__account {
    z-index: 3;
    background: #f4f7fd;
    box-shadow:
        1px 0 0 var(--border),
        0 1px 0 var(--border);
}
.gl-budget-edit-table .gl-budget-edit-table__account select {
    width: 100%;
    max-width: 22rem;
}
.gl-budget-edit-table.report-table-scroll--freeze tbody tr:hover > td.gl-budget-edit-table__account {
    background: #eef3fb;
}

/* Collapse % / Basis when every visible line is fixed. */
.gl-budget-edit-table--hide-percent-cols .gl-budget-edit-table__percent,
.gl-budget-edit-table--hide-percent-cols .gl-budget-edit-table__basis {
    display: none;
}

/* Mixed budgets: hide irrelevant controls per row. */
.gl-budget-edit-row--fixed .gl-budget-edit-table__percent,
.gl-budget-edit-row--fixed .gl-budget-edit-table__basis {
    visibility: hidden;
}
.gl-budget-edit-row--percent .gl-budget-edit-table__month {
    visibility: hidden;
}

.gl-budget-edit-table .gl-budget-edit-table__month input {
    width: 4.75rem;
    min-width: 4.75rem;
}
.gl-budget-edit-table .gl-budget-edit-table__percent input {
    width: 4.5rem;
    min-width: 4.5rem;
}
.gl-budget-edit-table .gl-budget-edit-table__basis select {
    min-width: 10rem;
    max-width: 14rem;
}

.report-table-scroll .report-table {
    width: max-content;
    min-width: 100%;
    overflow: visible;
}
/* AR/AP (and workbook line) detail: wrap long memos so all columns stay in view. */
.report-table-scroll .balance-detail-table {
    width: 100%;
    max-width: 100%;
}
/* Sparse WC matrices (e.g. label + amount) should shrink-wrap, not stretch full width. */
.report-table-scroll:has(> .workers-comp-matrix) {
    width: fit-content;
    max-width: 100%;
    max-height: none;
    margin-inline: auto;
}
.report-table-scroll > .workers-comp-matrix {
    min-width: 0;
}
.workers-comp-matrix th:first-child,
.workers-comp-matrix td:first-child {
    padding-right: 1.5rem;
}
.report-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}
.report-table-wrap .report-table {
    width: max-content;
    min-width: 100%;
    overflow: visible;
}
.report-toolbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.5rem;
}
.report-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
}
.report-toolbar__actions > form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}
.report-toolbar__actions > button.secondary {
    flex: 0 0 auto;
}
.report-toolbar__actions .report-options {
    flex: 1 1 28rem;
}
.report-toolbar__title {
    margin: 0;
    width: 100%;
    text-align: center;
    font-size: 1.15rem;
}
.report-toolbar__heading {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}
.report-toolbar__heading .report-toolbar__title {
    grid-column: 2;
    width: auto;
}
.report-toolbar__icons {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.report-toolbar__icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #64748b;
    text-decoration: none;
}
.report-toolbar__icon-link:hover,
.report-toolbar__icon-link:focus-visible {
    color: #334155;
    background: #f1f5f9;
    border-color: #e2e8f0;
    outline: none;
}
.report-toolbar__icon-link svg {
    width: 1.1rem;
    height: 1.1rem;
    display: block;
}
.report-toolbar__icon-link--qbo img {
    width: 1.15rem;
    height: 1.15rem;
    display: block;
    border-radius: 50%;
}
/* Override global primary button styles for outline toolbar icon buttons. */
button.report-toolbar__icon-link {
    background: transparent;
    color: #64748b;
    border: 1px solid transparent;
    padding: 0;
    min-height: 2rem;
    font-weight: inherit;
    font-size: inherit;
    box-shadow: none;
}
button.report-toolbar__icon-link:hover:not(:disabled),
button.report-toolbar__icon-link:focus-visible {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}
button.report-toolbar__icon-link.is-active,
button.report-toolbar__icon-link.is-active:hover:not(:disabled),
button.report-toolbar__icon-link.is-active:focus-visible {
    color: var(--primary, #1f4fb8);
    background: #eef3fc;
    border-color: #c9d8f5;
}
button.report-toolbar__icon-link:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: transparent;
    color: #64748b;
}
.report-toolbar .report-options {
    width: 100%;
    margin: 0;
}
.report-options__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    gap: 0.45rem 0.75rem;
}
.report-options:not(.is-custom-dates) .report-options__field--custom-dates {
    display: none;
}
.report-options__field--date_range_preset select {
    min-width: 14rem;
    max-width: 18rem;
}
.report-options--workers-comp {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.report-options--workers-comp .report-options__row--primary {
    gap: 0.75rem 1.1rem;
}
.report-options--workers-comp .report-options__row--filters {
    padding-top: 0.15rem;
    border-top: 1px solid var(--border, #e2e8f0);
}
.report-options__hint {
    margin: 0.25rem 0 0;
    color: var(--muted, #64748b);
    font-size: 0.8rem;
    max-width: 16rem;
    line-height: 1.3;
}
.report-options__group {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.45rem 0.75rem;
}
.report-options__group--filters {
    justify-content: center;
}
.report-options__field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.report-options__field > label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.2;
    white-space: nowrap;
}
.report-options__field input,
.report-options__field select {
    width: auto;
    min-width: 9.5rem;
    max-width: 16rem;
    padding: 0.38rem 0.5rem;
    font-size: 0.88rem;
    border-radius: 6px;
}
.report-options__field--start_date input,
.report-options__field--end_date input,
.report-options__field--as_of_date input {
    width: 7.75rem;
    min-width: 7.75rem;
    max-width: 7.75rem;
    padding: 0.32rem 0.35rem;
    font-size: 0.82rem;
}
.report-options__field--customer_qbo_id .ms-dropdown {
    min-width: 12rem;
}
.report-options__field--account_qbo_id .ms-dropdown {
    min-width: 14rem;
}
.report-options__field--filter_work_code,
.report-options__field--filter_internal_work_code,
.report-options__field--filter_employee {
    min-width: 8rem;
}
.report-options__field--filter_work_code .ms-dropdown,
.report-options__field--filter_internal_work_code .ms-dropdown,
.report-options__field--filter_project .ms-dropdown,
.report-options__field--filter_vendor .ms-dropdown,
.report-options__field--filter_transaction_type .ms-dropdown {
    min-width: 12rem;
}
.report-options__field--customer_qbo_id,
.report-options__field--account_qbo_id,
.report-options__field--filter_work_code,
.report-options__field--filter_internal_work_code,
.report-options__field--filter_project,
.report-options__field--filter_vendor,
.report-options__field--filter_transaction_type {
    position: relative;
    z-index: 2;
}
.report-options__field--customer_qbo_id:has(.ms-dropdown--open),
.report-options__field--account_qbo_id:has(.ms-dropdown--open),
.report-options__field--filter_work_code:has(.ms-dropdown--open),
.report-options__field--filter_internal_work_code:has(.ms-dropdown--open),
.report-options__field--filter_project:has(.ms-dropdown--open),
.report-options__field--filter_vendor:has(.ms-dropdown--open),
.report-options__field--filter_transaction_type:has(.ms-dropdown--open),
.report-options__field:has(.ss-dropdown--open) {
    z-index: 30;
}
.report-options__field--filter_employee input {
    min-width: 8rem;
    max-width: 11rem;
}
.report-options__field--toggle,
.report-options__field:has(> input[type="checkbox"]) {
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-start;
    gap: 0.4rem;
    width: auto;
    padding-bottom: 0.1rem;
}
.report-options__field--toggle > input[type="checkbox"],
.report-options__field:has(> input[type="checkbox"]) > input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 2.35rem;
    height: 1.35rem;
    min-width: 2.35rem;
    max-width: 2.35rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #cbd5e1;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    flex: 0 0 auto;
    transition: background-color 0.15s ease;
}
.report-options__field--toggle > input[type="checkbox"]::before,
.report-options__field:has(> input[type="checkbox"]) > input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
    transition: transform 0.15s ease;
}
.report-options__field--toggle > input[type="checkbox"]:checked,
.report-options__field:has(> input[type="checkbox"]) > input[type="checkbox"]:checked {
    background: var(--primary, #1f4fb8);
}
.report-options__field--toggle > input[type="checkbox"]:checked::before,
.report-options__field:has(> input[type="checkbox"]) > input[type="checkbox"]:checked::before {
    transform: translateX(1rem);
}
.report-options__field--toggle > input[type="checkbox"]:focus-visible,
.report-options__field:has(> input[type="checkbox"]) > input[type="checkbox"]:focus-visible {
    outline: 2px solid #bfd2f6;
    outline-offset: 2px;
}
.report-options__field--toggle > label,
.report-options__field:has(> input[type="checkbox"]) > label {
    margin: 0;
    padding-bottom: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text, #1e293b);
    line-height: 1.2;
    white-space: nowrap;
}
.ms-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
    min-width: 11rem;
}
.ms-dropdown__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-height: 2rem;
    padding: 0.28rem 0.55rem;
    border: 1px solid var(--border, #d0d7e2);
    border-radius: 6px;
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.ms-dropdown__toggle:hover {
    border-color: #93b4f6;
    background: #fff;
    color: inherit;
}
.ms-dropdown__toggle:focus,
.ms-dropdown__toggle:focus-visible {
    border-color: #93b4f6;
    outline: 2px solid #bfd2f6;
    outline-offset: 2px;
}
.ms-dropdown__caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #64748b;
    flex: 0 0 auto;
}
.ms-dropdown__panel {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    z-index: 20;
    min-width: 100%;
    width: max-content;
    max-width: 18rem;
    padding: 0.45rem;
    border: 1px solid var(--border, #d0d7e2);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.ms-dropdown__search {
    margin-bottom: 0.4rem;
}
.ms-dropdown__search-input,
.ss-dropdown__search-input {
    width: 100%;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
    padding: 0.28rem 0.45rem;
    border: 1px solid var(--border, #d0d7e2);
    border-radius: 6px;
    font: inherit;
}
.ms-dropdown__actions {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}
.ms-dropdown__actions .secondary {
    padding: 0.2rem 0.45rem;
    font-size: 0.75rem;
}
.ms-dropdown__options {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-height: 14rem;
    overflow: auto;
}
.ms-dropdown__option {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.4rem;
    margin: 0;
    padding: 0.2rem 0.25rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}
/* Beat form-field `label { display: block }` rules that nest these options. */
.ms-dropdown label.ms-dropdown__option {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    margin-bottom: 0;
    font-weight: 500;
    text-align: left;
}
.ms-dropdown__option:hover {
    background: #f2f7ff;
}
.ms-dropdown__option input {
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0.15rem 0 0;
    flex: 0 0 auto;
}
.ms-dropdown__empty {
    margin: 0.25rem;
    color: #64748b;
    font-size: 0.85rem;
}
.ss-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 100%;
    min-width: 11rem;
}
.ss-dropdown--open {
    z-index: 50;
}
td:has(.ss-dropdown--open),
th:has(.ss-dropdown--open) {
    position: relative;
    z-index: 50;
    overflow: visible;
}
.insurance-policy-card:has(.ss-dropdown--open) {
    z-index: 20;
}
.ss-dropdown__native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.ss-dropdown__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    height: 2rem;
    min-height: 2rem;
    max-height: 2rem;
    padding: 0.28rem 0.55rem;
    border: 1px solid var(--border, #d0d7e2);
    border-radius: 6px;
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
}
.ss-dropdown__toggle [data-ss-summary] {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ss-dropdown__toggle:hover {
    border-color: #93b4f6;
    background: #fff;
    color: inherit;
}
.ss-dropdown__toggle:focus,
.ss-dropdown__toggle:focus-visible {
    border-color: #93b4f6;
    outline: 2px solid #bfd2f6;
    outline-offset: 2px;
}
.ss-dropdown__caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #64748b;
    flex: 0 0 auto;
}
.ss-dropdown__panel {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    z-index: 40;
    box-sizing: border-box;
    min-width: 100%;
    width: max-content;
    max-width: min(22rem, calc(100vw - 1.5rem));
    padding: 0.45rem;
    border: 1px solid var(--border, #d0d7e2);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.ss-dropdown--drop-up .ss-dropdown__panel {
    top: auto;
    bottom: calc(100% + 0.25rem);
}
.ss-dropdown--open .ss-dropdown__panel {
    z-index: 80;
}
.table-scroll:has(.ss-dropdown--open),
.card:has(.ss-dropdown--open) {
    overflow: visible;
}
.form-grid .form-field:has(.ss-dropdown--open),
.form-field:has(.ss-dropdown--open) {
    overflow: visible;
    z-index: 40;
}
.ss-dropdown__search {
    margin-bottom: 0.4rem;
}
.ss-dropdown__options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 14rem;
    overflow: auto;
}
.ss-dropdown__option {
    display: flex;
    flex-shrink: 0;
    align-items: flex-start;
    justify-content: flex-start;
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    box-sizing: border-box;
    height: auto;
    margin: 0;
    padding: 0.7rem 0.8rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text, #1d2738);
    font: inherit;
    font-weight: 500;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.12s ease;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
/* Global `button:hover` uses white text. Option hover must keep dark text
   on the light highlight or labels disappear. Prefix with `button` so this
   stays ahead of `button:hover` even if rule order changes. */
button.ss-dropdown__option:hover,
button.ss-dropdown__option:focus,
button.ss-dropdown__option:focus-visible,
button.ss-dropdown__option--selected {
    background: #e4edfb;
    color: var(--text, #1d2738);
}
.ss-dropdown__empty-action {
    margin-top: 0.35rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border, #d0d7e2);
}
.ss-dropdown__empty-action[hidden] {
    display: none !important;
}
.ss-dropdown__empty-action > button,
.ss-dropdown__empty-action > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2rem;
    margin: 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}
.workers-comp-settings .ss-dropdown {
    min-width: 16rem;
    max-width: 28rem;
}
.report-options__field--max_hierarchy_level input {
    min-width: 3.5rem;
    max-width: 4rem;
}
.report-options__field--summarization select {
    min-width: 6.5rem;
    max-width: 8rem;
}
.report-options__help {
    display: block;
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--muted);
    line-height: 1.35;
    max-width: 16rem;
}
.help-tip-label,
.report-options__label--tip {
    cursor: help;
    text-decoration: underline dotted;
    text-underline-offset: 0.15em;
}
.report-options__field {
    position: relative;
}
.help-tip,
.help-tip[hidden],
.report-options__help--tip,
.report-options__help--tip[hidden] {
    /* Override .report-options__help { display: block }, which otherwise
       beats the UA [hidden] rule and leaves tips permanently visible. */
    display: none;
    position: absolute;
    z-index: 20;
    top: 1.55rem;
    left: 0;
    margin: 0;
    max-width: min(22rem, 70vw);
    padding: 0.55rem 0.7rem;
    border: 1px solid #c9d4e5;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
    color: #334155;
    line-height: 1.4;
}
.help-tip.is-open,
.report-options__help--tip.is-open {
    display: block;
}
/* Must beat `.report-table td { padding: … }` (0,1,1) or hierarchy indent is ignored. */
.report-table td.report-table__account-cell {
    white-space: nowrap;
    padding-left: calc(0.3rem + var(--report-indent, 0) * 0.85rem);
}
.report-vendor-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05rem;
    height: 1.05rem;
    min-height: 0;
    margin-right: 0.2rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    vertical-align: middle;
    font-weight: inherit;
    font-size: inherit;
    line-height: 1;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}
.report-vendor-expand:hover,
.report-vendor-expand:focus {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}
.report-vendor-expand:disabled {
    opacity: 0.55;
    cursor: wait;
}
.report-vendor-expand__icon {
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 0.22rem solid transparent;
    border-bottom: 0.22rem solid transparent;
    border-left: 0.3rem solid currentColor;
    transform: translateX(1px);
    transition: transform 0.12s ease;
}
tr.is-vendor-expanded > .report-table__account-cell .report-vendor-expand__icon {
    transform: translateX(1px) rotate(90deg);
}
.report-vendor-row > td {
    color: #475569;
    font-weight: 400;
    background: #f8fafc;
}
.report-vendor-row__label {
    font-style: italic;
}
.report-vendor-row--empty > td,
.report-vendor-row--error > td {
    font-style: italic;
    color: #64748b;
}
.report-vendor-row--error > td {
    color: #b91c1c;
}
tr.is-vendor-loading > td {
    opacity: 0.72;
}
.report-breakout-menu {
    position: fixed;
    z-index: 1200;
    min-width: 10.5rem;
    padding: 0.35rem;
    border: 1px solid #c9d4e5;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}
.report-breakout-menu__title {
    padding: 0.3rem 0.55rem 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
}
.report-breakout-menu__item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.4rem 0.55rem;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #0f172a;
    text-align: left;
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
}
.report-breakout-menu__item:hover,
.report-breakout-menu__item:focus {
    background: #eef4ff;
    color: #1d4ed8;
    outline: none;
}
.report-breakout-menu__item.is-active {
    background: #e8eefc;
    color: #1e40af;
    font-weight: 600;
}
.report-run-meta {
    margin: 0.85rem 0 0;
    font-size: 0.78rem;
    font-style: italic;
    color: var(--muted);
    font-weight: 400;
}
.report-run-meta strong {
    font-style: italic;
    font-weight: 600;
    color: inherit;
}
.report-options__field ul.errorlist {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.75rem;
    color: #b42318;
}
.report-options__actions {
    flex-shrink: 0;
    padding-bottom: 0.05rem;
}
.report-options__actions button {
    white-space: nowrap;
    padding: 0.42rem 0.9rem;
    border-radius: 8px;
}
.report-settings {
    width: 100%;
    margin-top: 0.35rem;
}
.report-settings:not(.is-open):not(:has(> .report-settings__toggle)) {
    margin-top: 0;
}
.report-settings > .report-settings__toggle {
    margin: 0.15rem 0 0.25rem;
}
.report-settings__pane {
    margin-top: 0.35rem;
    padding: 0.55rem 0.15rem 0.25rem;
    border-top: 1px solid var(--border, #e2e8f0);
}
.report-toolbar__icon-link.report-settings__toggle.is-active,
.report-settings > .report-settings__toggle.is-active {
    color: var(--primary, #1f4fb8);
    background: #eef3fc;
    border-color: #c9d8f5;
}
.report-options__row--secondary,
.report-settings__pane .report-options__row--filters {
    justify-content: flex-start;
}
/* Settings pane: label + control on one line; boolean toggles share a row. */
.report-settings__pane .report-options__row--secondary {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.75rem;
}
.report-settings__pane .report-options__row--secondary > .report-options__field:not(.report-options__field--toggle):not(:has(> input[type="checkbox"])) {
    flex: 1 1 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 0.85rem;
    width: 100%;
}
.report-settings__pane .report-options__row--secondary > .report-options__field:not(.report-options__field--toggle):not(:has(> input[type="checkbox"])) > label {
    flex: 0 0 auto;
    min-width: 5.5rem;
    margin: 0;
}
.report-settings__pane .report-options__row--secondary > .report-options__field:not(.report-options__field--toggle):not(:has(> input[type="checkbox"])) > input,
.report-settings__pane .report-options__row--secondary > .report-options__field:not(.report-options__field--toggle):not(:has(> input[type="checkbox"])) > select,
.report-settings__pane .report-options__row--secondary > .report-options__field:not(.report-options__field--toggle):not(:has(> input[type="checkbox"])) .ss-dropdown,
.report-settings__pane .report-options__row--secondary > .report-options__field:not(.report-options__field--toggle):not(:has(> input[type="checkbox"])) .ms-dropdown {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;
}
.report-settings__pane .report-options__row--secondary > .report-options__field--toggle,
.report-settings__pane .report-options__row--secondary > .report-options__field:has(> input[type="checkbox"]) {
    flex: 0 1 auto;
    width: auto;
    max-width: none;
}
.report-toolbar__intro {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}
.ledger-balance-card .report-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem 0.85rem;
}
.ledger-balance-card .report-toolbar__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
    width: auto;
    flex: 1 1 12rem;
    min-width: 0;
}
.ledger-balance-card .report-toolbar__heading .report-toolbar__title {
    grid-column: auto;
    width: auto;
    text-align: left;
    font-size: 1.15rem;
}
.ledger-balance-card .report-toolbar__icons {
    grid-column: auto;
    justify-self: auto;
}
.ledger-balance-card .report-toolbar__title {
    width: auto;
    text-align: left;
    font-size: 1.15rem;
}
.ledger-balance-card .report-toolbar__actions {
    width: auto;
    flex: 0 1 auto;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem 0.5rem;
}
.ledger-balance-card .report-toolbar__actions > a.secondary,
.ledger-balance-toolbar-nav > a.secondary,
.ledger-balance-toolbar-form .report-options__actions button,
.ledger-balance-open-items__actions > button,
.ledger-balance-open-items__actions > a.secondary,
.ledger-balance-open-items__action-group > button,
.ledger-balance-open-items__action-group > a.secondary,
.ledger-balance-voids button.secondary {
    min-height: 1.85rem;
    padding: 0.22rem 0.6rem;
    font-size: 0.78rem;
    border-radius: 6px;
    white-space: nowrap;
}
.ledger-balance-card .report-toolbar__actions .report-options {
    flex: 0 1 auto;
}
.ledger-balance-toolbar-nav {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}
.ledger-balance-card__heading {
    flex: 1 1 14rem;
    min-width: 0;
}
.ledger-balance-card__meta {
    flex: 1 0 100%;
    margin: 0.1rem 0 0;
    font-size: 0.82rem;
}
.ledger-balance-toolbar-form {
    width: auto;
    margin: 0;
    flex: 0 1 auto;
}
.ledger-balance-toolbar-form .report-options__row {
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}
.ledger-balance-toolbar-form .report-options__field--as_of_date {
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
}
.ledger-balance-toolbar-form .report-options__field--as_of_date > label {
    margin: 0;
}
.ledger-balance-toolbar-form .report-options__field--as_of_date input {
    min-height: 1.85rem;
    height: 1.85rem;
    box-sizing: border-box;
}
.ledger-balance-toolbar-form .report-options__actions {
    padding-bottom: 0;
}
.ledger-balance-open-items__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.7rem;
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 0.1rem 0 0.45rem;
    margin-bottom: 0.35rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.ledger-balance-open-items__action-group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}
.ledger-balance-open-items__action-group + .ledger-balance-open-items__action-group {
    padding-left: 0.5rem;
    border-left: 1px solid var(--border);
}
.ledger-balance-open-items__select-icons {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
}
.ledger-balance-open-items__actions .report-toolbar__icon-link,
.ledger-balance-open-items__actions button.report-toolbar__icon-link {
    width: 1.85rem;
    height: 1.85rem;
    min-height: 1.85rem;
}
.ledger-balance-open-items__selected {
    margin: 0 0 0 auto;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.ledger-balance-open-items__actions .ledger-balance-view-toolbar {
    margin: 0;
    gap: 0.35rem 0.5rem;
}
.ledger-balance-view-toolbar {
    margin: 0 0 0.65rem;
    gap: 0.45rem 0.65rem;
}
.ledger-balance-view-toolbar__summarize {
    gap: 0.35rem;
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 500;
}
.ledger-balance-view-toolbar__summarize select {
    min-width: 9.5rem;
    max-width: 14rem;
    min-height: 1.85rem;
    height: 1.85rem;
    box-sizing: border-box;
    padding: 0.22rem 0.45rem;
    font-size: 0.78rem;
    color: #334155;
    border-color: #e2e8f0;
    background: #fff;
}
.ledger-balance-view-toolbar__icons {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
}
.ledger-balance-open-items__scroll {
    max-height: min(65vh, 42rem);
}
.ledger-balance-open-items__scroll .report-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}
.ledger-balance-table__select-col {
    width: 3rem;
}
.ledger-balance-table__date-col {
    width: 5.75rem;
}
.ledger-balance-table__type-col {
    width: 6.75rem;
}
.ledger-balance-table__name-col {
    width: 14%;
}
.ledger-balance-table__num-col {
    width: 4.75rem;
}
.ledger-balance-table__bw-job-col {
    width: 18%;
}
.ledger-balance-table__udf-col {
    width: 12%;
}
.ledger-balance-udf-select {
    width: 100%;
    max-width: 14rem;
}
.ledger-balance-udf-select.is-overridden,
.ledger-balance-table__udf-col.is-overridden {
    background: #fff8e6;
}
.ledger-balance-table__memo-col {
    width: 18%;
}
.ledger-balance-table__edit-col {
    width: 2.5rem;
    white-space: nowrap;
    text-align: center;
}
.ledger-balance-table .amount-col {
    width: 6.5rem;
}
.ledger-balance-table__truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ledger-balance-row--cleared-later > td {
    color: #6b7280;
    opacity: 0.72;
}
.ledger-balance-row--cleared-later a {
    color: #64748b;
}
.ledger-balance-table tbody tr.ledger-balance-row--cleared-later:hover > td {
    background: #eef2f7;
    opacity: 0.9;
}
.report-table-scroll--freeze .ledger-balance-table tbody tr.ledger-balance-row--cleared-later:hover > td:first-child {
    background: #eef2f7;
}
/* PDF/print prep: wrap long memo/name cells so fit-width scale stays readable. */
.report-print-target .ledger-balance-table__truncate,
body.printing-report .ledger-balance-table__truncate {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
}
.report-print-target .ledger-balance-open-items__scroll,
body.printing-report .report-print-target .ledger-balance-open-items__scroll {
    width: 100% !important;
    max-width: 100% !important;
    max-height: none;
}
.report-print-target .ledger-balance-table,
.report-print-target .ledger-balance-summary-table,
body.printing-report .report-print-target .ledger-balance-table,
body.printing-report .report-print-target .ledger-balance-summary-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}
.ledger-balance-table tbody tr:hover > td {
    background: #e8f0ff;
}
.report-table-scroll--freeze .ledger-balance-table tbody tr:hover > td:first-child {
    background: #e8f0ff;
}
.ledger-balance-table tbody tr.report-drilldown__group-row:hover > td,
.report-table-scroll--freeze .ledger-balance-table tbody tr.report-drilldown__group-row:hover > td:first-child {
    background: #e2e8f0;
}
.ledger-balance-summary-table {
    margin-top: 0.85rem;
    width: 100%;
    table-layout: fixed;
}
.ledger-balance-table.ledger-balance-table--with-select .report-drilldown__child-row td:first-child {
    padding-left: 0.5rem;
}
.ledger-balance-table.ledger-balance-table--with-select .report-drilldown__child-row td:nth-child(2) {
    padding-left: 1.75rem;
}
.ledger-balance-table:not(.ledger-balance-table--with-select) .report-drilldown__child-row td:first-child {
    padding-left: 1.75rem;
}
.ledger-balance-table .gmr-th {
    min-height: 0;
}
.ledger-balance-table .gmr-th__toggle {
    padding: 0.15rem 0.1rem;
    white-space: nowrap;
    justify-content: flex-start;
    text-align: left;
}
.ledger-balance-table .amount-col .gmr-th__toggle {
    justify-content: flex-end;
    text-align: right;
}
.ledger-balance-table thead th.gmr-col {
    overflow: visible;
}
.ledger-balance-table .gmr-th__menu {
    text-align: left;
    left: 0;
    min-width: 15rem;
}
.ledger-balance-table .gmr-th__menu-label,
.ledger-balance-table .gmr-th__bulk,
.ledger-balance-table .gmr-th__menu-actions,
.ledger-balance-table .gmr-th__choices {
    text-align: left;
}
.ledger-balance-table .gmr-th__menu-actions,
.ledger-balance-table .gmr-th__bulk {
    justify-content: flex-start;
}
.ledger-balance-table .gmr-th__choices label {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr);
    align-items: center;
    column-gap: 0.45rem;
    margin: 0;
    padding: 0.15rem 0;
    text-align: left;
}
.ledger-balance-table .gmr-th__choices input[type="checkbox"] {
    margin: 0;
    width: 1rem;
    height: 1rem;
    justify-self: start;
}
.ledger-balance-table .gmr-th__choices label span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ledger-balance-date-range {
    display: grid;
    gap: 0.45rem;
    margin: 0.15rem 0 0.35rem;
}
.ledger-balance-date-range label {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr);
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 400;
    text-align: left;
}
.ledger-balance-date-range input[type="date"] {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    padding: 0.3rem 0.4rem;
    font: inherit;
}
.ledger-balance-filter-empty td {
    text-align: center;
    color: #64748b;
    font-style: italic;
}
.th-filter {
    position: relative;
    white-space: nowrap;
}
.th-filter__label {
    margin-right: 0.35rem;
}
.th-filter__toggle {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 2px;
    color: #94a3b8;
    vertical-align: middle;
    line-height: 0;
    border-radius: 4px;
}
.th-filter__toggle:hover {
    color: #334155;
    background: #e2e8f0;
}
.th-filter__toggle.is-active {
    color: #2563eb;
}
.th-filter__toggle svg {
    width: 14px;
    height: 14px;
    display: block;
}
.th-filter__popover {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15);
    padding: 0.5rem;
    display: flex;
    gap: 0.4rem;
    align-items: center;
    min-width: 190px;
}
.th-filter__control {
    padding: 0.3rem 0.4rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.85rem;
    flex: 1;
    font-weight: 400;
}
.th-filter__clear {
    border: none;
    background: #f1f5f9;
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
}
.th-filter__clear:hover {
    background: #e2e8f0;
}
.th-filter__toggle-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 400;
    white-space: nowrap;
    cursor: pointer;
}
.th-filter__toggle-label input {
    margin: 0;
    cursor: pointer;
}
.account-filter-empty td {
    text-align: center;
    color: #64748b;
    font-style: italic;
}
.report-options .errorlist.nonfield {
    width: 100%;
    margin: 0 0 0.5rem;
    padding: 0;
    list-style: none;
    color: #b42318;
    font-size: 0.85rem;
}
.help {
    font-size: 0.85rem;
    color: var(--muted);
}
.button, button,
a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 2.35rem;
    background: var(--primary);
    color: #fff;
    border: 0;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.86rem;
    line-height: 1.2;
    text-decoration: none;
    transition: 0.15s ease-in-out;
}
.button:hover, button:hover,
a.button:hover {
    background: var(--primary-hover);
    color: #fff;
}
/* Chromeless / in-row icon controls: bare `button` inherits action min-height above.
   Opt out here so statement rows (e.g. P&L vendor expand) stay dense. */
.report-vendor-expand,
.report-drilldown__group-toggle,
.edit-icon-btn,
.report-txn-edit-icon-btn,
.delete-icon-btn,
.missing-attachments-icon-btn,
.bank-stmt-action,
.txn-worklist-review-btn,
.recon-quick-reconcile-btn,
.txn-edit-dialog__close,
.consignor-match-table .delete-row-btn,
.th-filter__clear,
.delete-row-btn,
.receipt-line-delete-btn,
.receipt-explain-line-btn,
.receipt-restore-line-btn,
.receipt-line-style-btn,
.expense-log-inbox,
.expense-log-attach-menu__item,
.ss-dropdown__option,
.reclassify-account-pick,
.closeout-partner-block__toggle {
    min-height: 0;
}
button.secondary {
    background: #5f6f86;
}
button.secondary:hover {
    background: #4a586c;
}
a.secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 2.35rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: #5f6f86;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.86rem;
    line-height: 1.2;
}
a.secondary:hover {
    background: #4a586c;
    color: #fff;
}
button.danger,
.button.danger {
    background: #b42318;
}
button.danger:hover,
.button.danger:hover {
    background: #912018;
}
a.secondary.danger {
    background: #b42318;
}
a.secondary.danger:hover {
    background: #912018;
    color: #fff;
}
.form-field {
    position: relative;
    margin-bottom: 0.9rem;
}
.form-field__head {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-bottom: 0.35rem;
    min-width: 0;
}
.form-field__head > label {
    margin-bottom: 0;
}
.form-field__head .info-pop {
    flex: 0 0 auto;
}
.form-field.report-options__field--toggle > .form-field__head,
.form-field:has(> input[type="checkbox"]) > .form-field__head {
    margin-bottom: 0;
}
.form-field.report-options__field--toggle .form-field__head > label,
.form-field:has(> input[type="checkbox"]) .form-field__head > label {
    margin: 0;
    padding-bottom: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text, #1e293b);
    line-height: 1.2;
}
.form-errors,
.form-errors .errorlist {
    margin: 0 0 0.85rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #f9dbda;
    background: #fef3f2;
    color: #b42318;
    list-style: none;
}
.form-field .errorlist {
    margin: 0.35rem 0 0;
    padding: 0;
    list-style: none;
    color: #b42318;
    font-size: 0.86rem;
    font-weight: 600;
}
.form-field:has(.errorlist) > label,
.form-field:has(.errorlist) .form-field__head > label {
    color: #b42318;
}
.form-field:has(.errorlist) input,
.form-field:has(.errorlist) select,
.form-field:has(.errorlist) textarea,
.form-field:has(.errorlist) .ss-dropdown__toggle {
    border-color: #b42318;
}
.form-field:has(.errorlist) input:focus,
.form-field:has(.errorlist) select:focus,
.form-field:has(.errorlist) textarea:focus,
.form-field:has(.errorlist) .ss-dropdown__toggle:focus,
.form-field:has(.errorlist) .ss-dropdown__toggle:focus-visible {
    border-color: #b42318;
    outline-color: #f9dbda;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1.25rem;
}
.form-grid .form-field {
    margin-bottom: 0;
    min-width: 0;
}
.form-grid .js-native-only {
    min-width: 0;
}
.form-grid .form-field input:not([type="radio"]):not([type="checkbox"]),
.form-grid .form-field select,
.form-grid .form-field textarea {
    max-width: none;
}
.form-field--full,
.form-grid .form-field:has(input[type="radio"]) {
    grid-column: 1 / -1;
}
.closeout-partner-list {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}
.closeout-partner-block {
    margin: 0;
    padding: 1rem 1.1rem 1.15rem;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 10px;
    background: #f8fafc;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    overflow: visible;
}
.closeout-partner-block.is-collapsed {
    padding-bottom: 0.85rem;
}
.closeout-partner-block__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.closeout-partner-block.is-collapsed .closeout-partner-block__head {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}
.closeout-partner-block__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0.1rem 0.15rem 0.1rem 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
}
.closeout-partner-block__toggle:hover,
.closeout-partner-block__toggle:focus-visible {
    background: transparent;
    color: inherit;
}
.closeout-partner-block__toggle:focus-visible {
    outline: 2px solid var(--primary, #1f4fb8);
    outline-offset: 2px;
}
.closeout-partner-block__chevron {
    flex: 0 0 auto;
    width: 0.55rem;
    height: 0.55rem;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg);
    margin: 0 0.2rem 0.15rem 0.15rem;
}
.closeout-partner-block.is-collapsed .closeout-partner-block__chevron {
    transform: rotate(-45deg);
    margin-bottom: 0;
}
.closeout-partner-block__heading {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 0;
    flex-wrap: wrap;
}
.closeout-partner-block__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text, #1e293b);
}
.closeout-partner-block__name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted, #5f6f86);
    min-width: 0;
}
.closeout-partner-block__name:not([hidden])::before {
    content: "— ";
    font-weight: 500;
}
.closeout-partner-empty {
    margin: 0;
}
.closeout-partner-actions {
    margin: 0.75rem 0 0;
}
.closeout-documents__list {
    list-style: none;
    margin: 0 0 0.55rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.closeout-documents__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
}
.closeout-documents__delete {
    margin: 0;
}
.closeout-documents--run {
    margin-top: 0.35rem;
}
a.closeout-cost-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.12em;
}
a.closeout-cost-link:hover {
    color: var(--link, #1d4ed8);
}
.closeout-form input[name$="-DELETE"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* Formset DELETE checkbox + trash label (.delete-icon-btn) */
.delete-cell input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.delete-cell:has(input[type="checkbox"]:checked) .delete-icon-btn {
    color: #b42318;
}
.closeout-partner-block:has(input[name$="-DELETE"]:checked),
.closeout-form tr:has(input[name$="-DELETE"]:checked) {
    display: none;
}
.closeout-form .report-table input,
.closeout-form .report-table select {
    width: 100%;
    max-width: none;
}
.closeout-txn-search {
    display: grid;
    gap: 0.75rem;
}
.closeout-txn-search__hint {
    margin: 0;
}
.closeout-txn-search__form {
    display: grid;
    gap: 0.65rem;
}
.closeout-txn-search__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.65rem;
    align-items: end;
}
.closeout-txn-search__field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1 1 8.5rem;
    min-width: 7rem;
    max-width: 14rem;
}
.closeout-txn-search__field > span {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted, #64748b);
    line-height: 1.2;
    white-space: nowrap;
}
.closeout-txn-search__field input,
.closeout-txn-search__field select {
    width: 100%;
}
.closeout-txn-search__field--date {
    flex: 0 1 8.75rem;
    max-width: 8.75rem;
}
.closeout-txn-search__field--type,
.closeout-txn-search__field--doc,
.closeout-txn-search__field--amount {
    flex: 0 1 8rem;
    max-width: 9rem;
}
.closeout-txn-search__field--books {
    flex: 1 1 11rem;
    max-width: 16rem;
}
.closeout-txn-search__actions {
    display: flex;
    align-items: end;
    padding-bottom: 1px;
}
.closeout-txn-search__status[hidden],
.closeout-txn-search [data-txn-results-wrap][hidden] {
    display: none;
}
@media print {
    .report-screen-only,
    .closeout-txn-search {
        display: none !important;
    }
}
.consignor-row__panel {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.75rem 0.25rem 0.35rem;
}
.consignor-row__panel h4 {
    margin: 0;
    font-size: 0.95rem;
}
.consignor-row.is-editing .consignor-row__summary {
    background: #f1f5f9;
}
.consignor-match-row__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.consignor-match-row.is-editing .consignor-match-row__summary {
    background: #eef2ff;
}
.consignor-match-row__form {
    margin: 0.35rem 0 0.15rem;
}
@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}
.recon-entry-mode {
    border: 0;
    min-inline-size: 0;
    padding: 0;
    margin: 0 0 0.85rem;
}
.recon-entry-mode legend {
    padding: 0;
    margin-bottom: 0.4rem;
    font-weight: 600;
}
.recon-entry-mode__options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}
.recon-entry-mode__option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0;
    padding: 0.65rem 0.8rem;
    border: 1px solid #c9d5e6;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-weight: 500;
    min-width: 12rem;
    flex: 1 1 14rem;
}
.recon-entry-mode__option:has(input:checked) {
    border-color: #93b0e8;
    background: #f4f8ff;
    outline: 2px solid #bfd2f6;
}
.recon-entry-mode__option input {
    width: auto;
    max-width: none;
    margin: 0.15rem 0 0;
    flex: 0 0 auto;
}
.recon-entry-mode__option span {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.recon-entry-mode__option .text-muted {
    font-weight: 400;
    font-size: 0.85rem;
}
.expense-log-attach,
.receipt-upload-attach {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 0.85rem;
}
.receipt-upload-attach {
    margin: 0;
    flex-wrap: wrap;
}
.receipt-upload-merge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    min-height: 2.75rem;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text, #1e293b);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.receipt-upload-merge input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 2.35rem;
    height: 1.35rem;
    min-width: 2.35rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #cbd5e1;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    flex: 0 0 auto;
    transition: background-color 0.15s ease;
}
.receipt-upload-merge input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
    transition: transform 0.15s ease;
}
.receipt-upload-merge input[type="checkbox"]:checked {
    background: var(--primary, #1f4fb8);
}
.receipt-upload-merge input[type="checkbox"]:checked::before {
    transform: translateX(1rem);
}
.receipt-upload-merge input[type="checkbox"]:focus-visible {
    outline: 2px solid #bfd2f6;
    outline-offset: 2px;
}
.expense-log-meta .expense-log-attach {
    margin: 0;
    min-width: 2.75rem;
}
.expense-log-attach-picker {
    position: relative;
    flex: 0 0 auto;
}
.expense-log-attach-files {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
.expense-log-attach-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    min-width: 11rem;
    padding: 0.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.expense-log-attach-menu[hidden] {
    display: none;
}
.expense-log-attach-menu__item,
button.expense-log-attach-menu__item {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.45rem 0.75rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text, #1e293b);
    font-weight: 600;
    box-shadow: none;
}
button.expense-log-attach-menu__item:hover,
button.expense-log-attach-menu__item:focus-visible {
    background: #f8fafc;
    color: var(--text, #1e293b);
}
.expense-log-attach__control,
.receipt-upload-attach__control,
button.expense-log-inbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    flex: 0 0 auto;
}
button.expense-log-inbox[hidden] {
    display: none;
}
.expense-log-attach__control input[type="file"],
.receipt-upload-attach__control input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}
.expense-log-attach__control:hover,
.expense-log-attach__control:focus-within,
.receipt-upload-attach__control:hover,
.receipt-upload-attach__control:focus-within,
button.expense-log-attach__control:hover,
button.expense-log-attach__control:focus-visible,
button.expense-log-inbox:hover,
button.expense-log-inbox:focus-visible {
    color: #1e293b;
    border-color: #cbd5e1;
    background: #f8fafc;
}
.expense-log-attach__control.is-attached,
.receipt-upload-attach__control.is-attached,
button.expense-log-inbox.is-attached {
    color: var(--primary, #1f4fb8);
    border-color: #bfd2f6;
    background: #eff6ff;
}
.expense-log-attach__control svg,
.receipt-upload-attach__control svg,
button.expense-log-inbox svg {
    width: 1.35rem;
    height: 1.35rem;
    display: block;
}
.expense-log-attach__names,
.receipt-upload-attach__names {
    margin: 0;
    font-size: 0.86rem;
    color: var(--muted);
    min-width: 0;
    word-break: break-word;
}
.receipt-upload-attach__names {
    flex: 1 1 100%;
}
.txn-entry-attach {
    margin: 0;
}
.txn-entry-attach .txn-entry-fill-btn {
    min-height: 2.75rem;
    height: 2.75rem;
    padding: 0 0.85rem;
}
.form-field .txn-entry-attach + .form-help,
.txn-entry-attach-status--error {
    margin-top: 0.35rem;
}
.txn-entry-attach-status--error {
    color: var(--danger, #b42318);
}
.form-field > .section-head {
    margin: 0 0 0.35rem;
}
.expense-log-page #expense-log-attach-names:not([hidden]) {
    margin: -0.45rem 0 0.85rem;
}
.expense-log-meta {
    grid-template-columns: minmax(8.75rem, 1.2fr) minmax(7rem, 0.95fr) max-content auto;
    column-gap: 0.75rem;
    align-items: end;
    margin-bottom: 0.85rem;
}
.expense-log-meta__date input[type="date"] {
    min-width: 0;
}
.expense-log-meta__currency select {
    min-width: 0;
    padding-right: 1.45rem;
}
.expense-log-customer {
    margin-bottom: 0.85rem;
}
.expense-log-customer select,
.expense-log-customer .ss-dropdown {
    max-width: none;
}
.expense-log-meta__billable {
    width: max-content;
}
.expense-log-meta__billable label {
    font-size: 0.86rem;
    line-height: 1.2;
    white-space: nowrap;
}
.expense-log-meta__billable input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    width: 2.35rem;
    height: 1.35rem;
    min-width: 2.35rem;
    margin: 0.35rem 0 0.2rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #cbd5e1;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
    cursor: pointer;
}
.expense-log-meta__billable input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
    transition: transform 0.15s ease;
}
.expense-log-meta__billable input[type="checkbox"]:checked {
    background: var(--primary, #1f4fb8);
}
.expense-log-meta__billable input[type="checkbox"]:checked::before {
    transform: translateX(1rem);
}
.expense-log-meta__billable input[type="checkbox"]:focus-visible {
    outline: 2px solid #bfd2f6;
    outline-offset: 2px;
}
.expense-log-actions {
    flex-wrap: nowrap;
}
.expense-log-actions > button {
    flex: 1 1 0;
}
@media (max-width: 640px) {
    .expense-log-page .expense-log-toolbar-links {
        display: none;
    }
    .expense-log-meta {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 0.65rem;
        row-gap: 0.75rem;
    }
    .expense-log-meta .expense-log-attach {
        justify-self: end;
        align-self: end;
    }
    .expense-log-meta__billable {
        align-self: end;
    }
    .expense-log-actions {
        margin-top: 0.85rem;
    }
}
.form-help,
.text-muted {
    margin: 0.35rem 0 0;
    font-size: 0.86rem;
    color: var(--muted);
    font-weight: 400;
}
.receipt-settings-form input,
.receipt-settings-form select {
    max-width: 40rem;
}
.receipt-upload-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    align-items: flex-start;
}
.receipt-upload-form .form-field {
    width: 100%;
    max-width: 40rem;
}
.receipt-upload-form button[type="submit"] {
    min-height: 2.75rem;
    padding: 0.55rem 1.1rem;
}
.table-scroll {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}
.table-scroll > table {
    width: max-content;
    min-width: 100%;
}
/* Operational lists: stack rows into cards before the table would need horizontal scroll.
   Mark cells with data-label and optional data-stack="primary|amount|meta|secondary|omit".
   Breakpoint is sized for wide lists (~9-10 nowrap columns), not phone-only. Pair with
   page--wide on those list pages so large screens can still show the table. */
.table-scroll--stack > table {
    width: 100%;
    min-width: 100%;
}
@media (max-width: 1200px) {
    .table-scroll.table-scroll--stack {
        overflow-x: hidden;
    }
    .table-scroll.table-scroll--stack > table {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100%;
    }
    .table-scroll.table-scroll--stack thead {
        display: none;
    }
    .table-scroll.table-scroll--stack tbody,
    .table-scroll.table-scroll--stack tfoot {
        display: block;
        width: 100%;
    }
    .table-scroll.table-scroll--stack tbody tr,
    .table-scroll.table-scroll--stack tfoot tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.35rem 0.55rem;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        margin: 0 0 0.65rem;
        padding: 0.75rem;
        border: 1px solid var(--border, #e2e8f0);
        border-radius: 0.65rem;
        background: var(--surface, #fff);
    }
    .table-scroll.table-scroll--stack tbody tr:last-child,
    .table-scroll.table-scroll--stack tfoot tr:last-child {
        margin-bottom: 0;
    }
    .table-scroll.table-scroll--stack tbody td,
    .table-scroll.table-scroll--stack tfoot td,
    .table-scroll.table-scroll--stack tfoot th {
        display: block;
        box-sizing: border-box;
        width: auto;
        max-width: 100%;
        padding: 0;
        border: none;
        background: transparent;
        text-align: left;
        font-size: 0.9rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
        word-break: break-word;
        white-space: normal;
    }
    .table-scroll.table-scroll--stack tfoot th[data-stack="primary"] {
        order: 1;
        flex: 1 1 calc(100% - 7.5rem);
        min-width: 0;
        font-weight: 600;
        color: var(--text, #1d2738);
    }
    .table-scroll.table-scroll--stack tbody td[data-label]:not([data-stack="primary"]):not([data-stack="amount"]):not([data-stack="meta"]):not([data-stack="omit"])::before,
    .table-scroll.table-scroll--stack tbody td[data-stack="secondary"][data-label]::before,
    .table-scroll.table-scroll--stack tfoot td[data-label]:not([data-stack="primary"]):not([data-stack="amount"]):not([data-stack="omit"])::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.1rem;
        color: var(--muted, #64748b);
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }
    .table-scroll.table-scroll--stack tbody td[data-stack="primary"],
    .table-scroll.table-scroll--stack tfoot td[data-stack="primary"] {
        order: 1;
        flex: 1 1 calc(100% - 7.5rem);
        min-width: 0;
        font-weight: 600;
        color: var(--text, #1d2738);
    }
    .table-scroll.table-scroll--stack tbody td[data-stack="amount"],
    .table-scroll.table-scroll--stack tfoot td[data-stack="amount"] {
        order: 2;
        flex: 0 0 auto;
        margin-left: auto;
        font-size: 1.05rem;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        text-align: right;
        white-space: nowrap;
    }
    .table-scroll.table-scroll--stack tbody td[data-stack="meta"] {
        order: 3;
        flex: 1 1 100%;
    }
    .table-scroll.table-scroll--stack tbody td[data-stack="secondary"],
    .table-scroll.table-scroll--stack tbody td:not([data-stack]):not(.receipt-line-actions-cell),
    .table-scroll.table-scroll--stack tfoot td[data-stack="secondary"],
    .table-scroll.table-scroll--stack tfoot td:not([data-stack]) {
        order: 10;
        flex: 1 1 calc(50% - 0.4rem);
        min-width: 8rem;
    }
    .table-scroll.table-scroll--stack tbody td[data-stack="omit"],
    .table-scroll.table-scroll--stack tfoot td[data-stack="omit"] {
        display: none !important;
    }
    .table-scroll.table-scroll--stack tbody td[colspan],
    .table-scroll.table-scroll--stack tfoot td[colspan] {
        flex: 1 1 100%;
    }
}
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-running { background: #e8f0ff; color: #1f4fb8; }
.status-pending { background: #eef2f7; color: #4b5563; border: 1px solid var(--border); }
.status-succeeded { background: var(--ok-bg); color: #1d6b36; border: 1px solid var(--ok-border); }
.status-canceled { background: #fff8e6; color: #8a6a00; border: 1px solid #e6c200; }
.status-passed { background: var(--ok-bg); color: #1d6b36; border: 1px solid var(--ok-border); }
.status-warned { background: #fff8e6; color: #8a6a00; border: 1px solid #e6c200; }
.status-new { background: #e8f0ff; color: #1f4fb8; border: 1px solid #c7d7f5; }
.status-acknowledged { background: #eef2f7; color: #4b5563; border: 1px solid var(--border); }
.status-planned { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.status-declined { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.status-done { background: var(--ok-bg); color: #1d6b36; border: 1px solid var(--ok-border); }
.status-open { background: #e8f0ff; color: #1f4fb8; border: 1px solid #c7d7f5; }
.status-answered { background: #e8f0ff; color: #1f4fb8; border: 1px solid #c7d7f5; }
.status-attested { background: #eef2f7; color: #4b5563; border: 1px solid var(--border); }
.status-resolved { background: var(--ok-bg); color: #1d6b36; border: 1px solid var(--ok-border); }
.status-approved { background: var(--ok-bg); color: #1d6b36; border: 1px solid var(--ok-border); }
.status-rejected { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.status-in_progress { background: #e8f0ff; color: #1f4fb8; border: 1px solid #c7d7f5; }
.status-waiting_review { background: #fff8e6; color: #8a6a00; border: 1px solid #e6c200; }
.status-cancelled { background: #eef2f7; color: #4b5563; border: 1px solid var(--border); }
.status-failed { background: #fdecea; color: #9b1c1c; border: 1px solid #e57373; }
.status-completed { background: var(--ok-bg); color: #1d6b36; border: 1px solid var(--ok-border); }
.status-preview { background: #e8f0ff; color: #1f4fb8; border: 1px solid #c7d7f5; }
.status-posting { background: #e8f0ff; color: #1f4fb8; border: 1px solid #c7d7f5; }
.status-posted { background: var(--ok-bg); color: #1d6b36; border: 1px solid var(--ok-border); }
.status-draft { background: #eef2f7; color: #4b5563; border: 1px solid var(--border); }
.status-accepted { background: var(--ok-bg); color: #1d6b36; border: 1px solid var(--ok-border); }
.status-closed { background: #eef2f7; color: #4b5563; border: 1px solid var(--border); }
.status-calculated { background: #e8f0ff; color: #1f4fb8; border: 1px solid #c7d7f5; }
.status-locked { background: #eef2f7; color: #4b5563; border: 1px solid var(--border); }
.status-success { background: var(--ok-bg); color: #1d6b36; border: 1px solid var(--ok-border); }
.status-partial { background: #fff8e6; color: #8a6a00; border: 1px solid #e6c200; }
.status-void { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.status-voided { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.status-uploaded { background: #eef2f7; color: #4b5563; border: 1px solid var(--border); }
.status-parsing { background: #e8f0ff; color: #1f4fb8; border: 1px solid #c7d7f5; }
.status-duplicate { background: #fff8e6; color: #8a6a00; border: 1px solid #e6c200; }
.status-skipped { background: #eef2f7; color: #4b5563; border: 1px solid var(--border); }
.status-partial_failure { background: #fff8e6; color: #8a6a00; border: 1px solid #e6c200; }
.status-complete { background: var(--ok-bg); color: #1d6b36; border: 1px solid var(--ok-border); }
.status-incomplete { background: #fff8e6; color: #8a6a00; border: 1px solid #e6c200; }
.status-active { background: var(--ok-bg); color: #1d6b36; border: 1px solid var(--ok-border); }
.status-suspended { background: #fff8e6; color: #8a6a00; border: 1px solid #e6c200; }
.batch-progress {
    height: 0.55rem;
    background: #eef2f7;
    border-radius: 999px;
    overflow: hidden;
    margin: 0.75rem 0;
}
.batch-progress__bar {
    height: 100%;
    background: #1f4fb8;
    border-radius: 999px;
    transition: width 0.35s ease;
}
.batch-outcome-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 2rem;
    margin: 1rem 0 0;
}
.batch-outcome-stats > div {
    min-width: 5rem;
}
.batch-outcome-stats dt {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted, #6b7280);
    margin: 0;
}
.batch-outcome-stats dd {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0.15rem 0 0;
}
.batch-results-table td {
    vertical-align: top;
}
.activity-message {
    max-width: 36rem;
    white-space: normal;
    word-break: break-word;
}
tr.row-fail td { background: #fff5f5; }
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    margin-top: 1rem;
}
.form-actions--inline {
    margin-top: 0;
    gap: 0.45rem;
}
.form-actions--inline input[type="text"] {
    min-width: 8rem;
    max-width: 14rem;
}
code.webhook-url {
    display: block;
    word-break: break-all;
    font-size: 0.85rem;
    line-height: 1.35;
}
.page-context {
    margin-bottom: 1rem;
}
.page-context__top {
    display: flex;
    gap: 0.65rem;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.breadcrumbs {
    font-size: 0.84rem;
    color: var(--muted);
}
.breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
}
.page-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.page-heading {
    margin: 0;
}
.stepper {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fbff;
    display: grid;
    gap: 0.35rem;
}
.stepper__item {
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--muted);
}
.stepper__item.is-current {
    background: #e8f0ff;
    color: var(--primary);
    font-weight: 700;
}
.stepper__item.is-complete {
    background: var(--ok-bg);
    color: #1d6b36;
}
.stepper__item a {
    color: inherit;
}
.home-action-link {
    margin-left: auto;
    padding: 0.3rem 0.55rem;
    font-size: 0.8rem;
    flex: 0 0 auto;
}
.home-action-queue {
    list-style: none;
    padding: 0;
    margin: 0;
}
.home-action-queue__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
}
.home-action-queue__item:last-child {
    border-bottom: 0;
}
.home-action-queue__copy {
    flex: 1 1 16rem;
    min-width: 0;
}
.home-action-queue__copy p {
    margin: 0.2rem 0 0;
}
.home-muted {
    color: var(--muted);
    margin: 0;
}
.home-portfolio-intro {
    margin: 0 0 1.25rem;
}
.home-portfolio-intro__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin: 0 0 0.35rem;
}
.home-portfolio-intro h1 {
    margin: 0;
    font-size: 1.65rem;
}
.home-portfolio-intro p {
    margin: 0;
    color: var(--muted);
}
.home-portfolio {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 1rem;
}
.home-portfolio-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 0;
    text-align: left;
}
.home-portfolio-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.home-portfolio-card__title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}
.home-system-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #e8f0ff;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.home-portfolio-card__meta {
    display: grid;
    gap: 0.55rem;
    margin: 0;
}
.home-portfolio-card__meta div {
    display: grid;
    gap: 0.1rem;
}
.home-portfolio-card__meta dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
}
.home-portfolio-card__meta dd {
    margin: 0;
    font-size: 0.9rem;
}
.home-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.home-flag {
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eef2f7;
    color: var(--muted);
}
.home-flag--warning {
    background: #fff4e5;
    color: #9a5b00;
}
.home-flag--danger {
    background: #fde8e8;
    color: #b42318;
}
.home-flag--info {
    background: #e8f0ff;
    color: var(--primary);
}
.home-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}
.home-hero__eyebrow {
    margin: 0 0 0.25rem;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}
.home-hero__title {
    margin: 0 0 0.45rem;
    font-size: 1.7rem;
}
.home-hero__meta {
    margin: 0;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}
.home-hero__sep {
    color: var(--border);
}
.home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.home-close-strip__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}
.home-close-strip__header h2 {
    margin: 0;
}
.home-close-strip__header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}
.home-close-strip__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.home-close-strip__item a {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border, #d8dde6);
    border-radius: 0.4rem;
    text-decoration: none;
    color: inherit;
    background: var(--surface-muted, #f7f8fa);
}
.home-close-strip__item a:hover {
    border-color: var(--accent, #2f5bea);
}
.home-close-strip__item strong {
    font-size: 0.92rem;
}
.home-close-strip__item span {
    font-size: 0.8rem;
    color: var(--muted);
}
.home-close-strip__item--open a {
    border-color: #c9851a;
    background: #fff8eb;
}
.home-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}
.home-kpi-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin: 0 0 0.75rem;
}
.home-kpi-toolbar h2 {
    margin: 0;
}
.home-date-range {
    margin: 0;
    flex: 1 1 16rem;
}
.home-date-range .report-options__row {
    justify-content: flex-end;
}
.home-kpi {
    margin: 0;
    padding: 1rem 1.05rem;
}
a.home-kpi--link {
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
a.home-kpi--link:hover {
    border-color: #b7c7e8;
    box-shadow: 0 10px 28px rgba(19, 38, 73, 0.1);
}
.home-kpi__label {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}
.home-kpi__value {
    margin: 0.35rem 0 0.15rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.home-kpi__value--negative {
    color: #b42318;
}
.home-kpi__period {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}
.cite-ref {
    font-size: 0.78em;
    font-weight: 700;
    vertical-align: super;
    margin-left: 0.12em;
    text-decoration: none;
}
.cite-ref:hover,
.cite-ref:focus {
    text-decoration: underline;
}
.benchmark-table {
    min-width: 52rem;
}
.benchmark-table th.num,
.benchmark-table td.num {
    text-align: right;
    white-space: nowrap;
}
.benchmark-table__formula {
    display: block;
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 400;
    white-space: normal;
}
.mgmt-metrics-block {
    margin-top: 1rem;
}
.mgmt-metrics-block:first-child {
    margin-top: 0;
}
.ratio-vs-ahead {
    color: #1d6b36;
    font-weight: 600;
}
.ratio-vs-behind {
    color: #9b1c1c;
    font-weight: 600;
}
.report-citations {
    margin: 0;
    padding-left: 1.25rem;
}
.report-citations cite {
    font-style: normal;
}
.report-citations__links {
    display: block;
    margin-top: 0.35rem;
}
.report-citations .text-muted {
    margin: 0.4rem 0 0;
}
.report-citations__notes {
    margin: 0.85rem 0 0;
    padding-left: 1.25rem;
    color: var(--muted);
    font-size: 0.88rem;
}
.home-chart-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-bottom: 0.75rem;
}
.home-chart-card__header h2 {
    margin: 0;
}
.home-chart-card__header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}
.home-chart {
    position: relative;
    height: 16rem;
}
.home-empty-finance p {
    color: var(--muted);
}
.home-activity {
    opacity: 0.98;
}
@media (max-width: 640px) {
    .home-hero__title {
        font-size: 1.4rem;
    }
    .home-hero__actions {
        width: 100%;
    }
    .home-hero__actions > * {
        flex: 1 1 auto;
    }
    .home-kpi-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .home-date-range .report-options__row {
        justify-content: flex-start;
    }
    .home-kpi-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
    }
    .home-kpi {
        padding: 0.85rem 0.9rem;
    }
    .home-kpi__value {
        font-size: 1.15rem;
        word-break: break-word;
    }
    .home-close-strip__list {
        grid-template-columns: 1fr;
    }
    .home-chart {
        height: 12.5rem;
    }
    .home-chart-card__header {
        flex-direction: column;
        align-items: flex-start;
    }
    .card {
        padding: 1rem;
    }
}
.report-hub {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
    gap: 1.25rem 1.5rem;
    margin-top: 1rem;
}
.report-hub__heading {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.report-hub__list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.report-hub__list li {
    margin: 0 0 0.45rem;
}
.report-hub__list a {
    font-weight: 600;
}
.report-hub__label {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.report-hub__label:first-child {
    margin-top: 0;
}
@media (max-width: 880px) {
    .brand-subtitle {
        display: none;
    }
    .app-header__top {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.65rem 0.75rem;
    }
    .brand-wrap {
        flex: 1 1 auto;
    }
    .header-search {
        flex: 1 1 100%;
        max-width: none;
        width: 100%;
        min-width: 0;
    }
    .header-search__input {
        min-height: 2.75rem;
        padding-inline-end: 0.7rem;
    }
    .header-search__shortcut {
        display: none;
    }
    .header-right {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.55rem;
        margin-left: 0;
    }
    .connection-switcher {
        flex: 1 1 12rem;
        min-width: 0;
        max-width: 100%;
        width: auto;
    }
    .connection-switcher select,
    .client-switcher__toggle {
        min-width: 0;
        max-width: none;
        flex: 1;
        min-height: 2.75rem;
    }
    .client-switcher__dropdown {
        width: 100%;
    }
    .client-switcher__panel {
        max-width: min(22rem, calc(100vw - 2rem));
    }
    .account-menu {
        flex: 0 0 auto;
    }
    .account-menu__trigger {
        width: 2.75rem;
        height: 2.75rem;
        min-width: 2.75rem;
        min-height: 2.75rem;
    }
    .account-menu__avatar {
        width: 2.75rem;
        height: 2.75rem;
    }
    .app-nav__toggle {
        display: inline-flex;
        margin-left: auto;
    }
    .app-nav__backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 90;
        border: 0;
        padding: 0;
        margin: 0;
        background: rgba(15, 23, 42, 0.4);
        cursor: pointer;
    }
    .app-nav__backdrop[hidden] {
        display: none;
    }
    .app-nav {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
        width: min(20rem, calc(100vw - 2.5rem));
        max-width: 100%;
        margin: 0;
        padding: 1rem 0.85rem 1.5rem;
        background: #fff;
        border-left: 1px solid var(--border);
        box-shadow: -8px 0 28px rgba(15, 23, 42, 0.12);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .app-nav.is-drawer-open {
        display: block;
    }
    .app-nav__list {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 0.35rem;
        overflow: visible;
    }
    .app-nav__list > li {
        width: 100%;
    }
    .app-nav a,
    .app-nav__parent-link {
        min-height: 2.75rem;
        width: 100%;
        justify-content: flex-start;
        white-space: normal;
        padding: 0.55rem 0.7rem;
    }
    .app-nav__group {
        display: flex;
        width: 100%;
    }
    .app-nav__submenu {
        position: static;
        min-width: 0;
        width: 100%;
        max-height: none;
        overflow: visible;
        left: auto;
        right: auto;
        margin: 0.25rem 0 0.15rem;
        padding: 0.25rem 0 0.25rem 0.45rem;
        border: 0;
        border-left: 2px solid #c8d8f7;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }
    .app-nav__list > li:last-child .app-nav__submenu {
        left: auto;
        right: auto;
    }
    .app-nav__submenu::before {
        display: none;
    }
    .app-nav__item:hover > .app-nav__submenu,
    .app-nav__item:focus-within > .app-nav__submenu {
        display: none;
    }
    .app-nav__item.is-open > .app-nav__submenu {
        display: block;
    }
    .app-nav__submenu a {
        min-height: 2.5rem;
        display: flex;
        align-items: center;
        white-space: normal;
    }
}

.square-sales-summary .summary-metrics {
    width: 100%;
    max-width: 32rem;
}
.square-sales-summary .summary-metrics th {
    font-weight: 500;
    text-align: left;
    padding: 0.35rem 0.75rem 0.35rem 0;
}
.square-sales-summary .summary-metrics tr.summary-metrics__child th {
    padding-left: 1.5rem;
    font-weight: 400;
    color: #475569;
}
.square-sales-summary .summary-metrics td.amount {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.square-sales-summary .summary-metrics tr.negative td.amount {
    color: #9a3412;
}
.square-sales-summary .muted {
    color: #64748b;
    font-weight: 400;
    font-size: 0.9rem;
}

.report-drill-link,
.workers-comp-drill-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(37, 99, 235, 0.45);
    text-underline-offset: 0.12em;
}
.timekeeper-report-table tbody tr.is-active > td {
    background: #e8f0ff;
}
.report-drill-link:hover,
.report-drill-link:focus,
.workers-comp-drill-link:hover,
.workers-comp-drill-link:focus {
    color: #1d4ed8;
}
.report-table__cell--active,
.workers-comp-matrix__cell--active {
    background: #e8f0ff;
    box-shadow: inset 0 0 0 1px #93b4f6;
}
.workers-comp-matrix tbody tr:hover > td {
    background: #e8f0ff;
}
.report-table-scroll--freeze .workers-comp-matrix tbody tr:hover > td:first-child {
    background: #e8f0ff;
}
.workers-comp-matrix tbody tr:hover .workers-comp-matrix__cell--active {
    background: #d9e7ff;
}
.workers-comp-drilldown__table tbody tr:hover > td {
    background: #e8f0ff;
}
.workers-comp-report > h3,
.workers-comp-report > .workers-comp-meta {
    text-align: center;
}
.workers-comp-meta--warnings {
    color: #9a3412;
}
.insurance-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.35rem 0 1rem;
}
.insurance-subnav a.secondary.is-active {
    background: var(--primary);
    pointer-events: none;
}
.insurance-setup-callout {
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid #c7d7f5;
    border-radius: 8px;
    background: #f4f8ff;
}
.insurance-setup-callout h3 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
}
.insurance-setup-callout .section-head {
    margin-bottom: 0.35rem;
}
.insurance-setup-callout .section-head h3 {
    margin: 0;
}
.insurance-setup-callout p {
    margin: 0 0 0.65rem;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}
.insurance-overrides-form {
    margin-top: 1.5rem;
}
.insurance-setup-callout__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
}
.insurance-vendor-status {
    margin: 0;
    padding: 0;
    list-style: none;
}
.insurance-vendor-status li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
    padding: 0.4rem 0;
    border-top: 1px solid #dbe6f8;
    font-size: 0.9rem;
}
.insurance-vendor-status li:first-child {
    border-top: 0;
}
.insurance-vendor-status__ok {
    color: #067647;
    font-weight: 600;
}
.insurance-vendor-status__missing {
    color: #b42318;
    font-weight: 600;
}
.insurance-policy-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.35rem 0;
}
.insurance-coverage-section {
    margin-top: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border, #e2e8f0);
}
.insurance-coverage-section > h3 {
    margin: 0 0 0.65rem;
    font-size: 1.02rem;
}
.insurance-add-policy-panel {
    margin-bottom: 0.85rem;
}
.insurance-add-policy-panel[hidden],
.insurance-policy-card [data-coverage-panel][hidden],
.insurance-policy-card [data-method-panel][hidden] {
    display: none !important;
}
.insurance-policy-card {
    position: relative;
    margin-bottom: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    background: #fafbfc;
}
.insurance-policy-card__fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-inline-size: 0;
}
.insurance-policy-card__type {
    max-width: 22rem;
}
.insurance-policy-card__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1.25rem;
    margin-bottom: 0.55rem;
}
.insurance-policy-card__grid .form-field,
.insurance-policy-card__grid .report-options__field {
    margin-bottom: 0;
    min-width: 0;
}
@media (max-width: 640px) {
    .insurance-policy-card__grid {
        grid-template-columns: 1fr;
    }
}
.insurance-policy-card__wc {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 0.55rem 0 0;
}
.insurance-policy-card .form-actions {
    margin-top: 0.75rem;
}
.insurance-policy-card__secondary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.85rem 1.25rem;
    margin-top: 0.75rem;
    align-items: start;
}
.insurance-policy-card__notes {
    margin-bottom: 0;
}
.insurance-policy-card__notes textarea {
    width: 100%;
    min-height: 6rem;
    max-width: none;
    resize: vertical;
}
@media (max-width: 720px) {
    .insurance-policy-card__secondary {
        grid-template-columns: 1fr;
    }
}
.insurance-policy-delete {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    margin: 0;
}
.insurance-class-rates h4 {
    margin: 0.25rem 0 0.45rem;
    font-size: 0.9rem;
}
.insurance-class-rates .report-table {
    overflow: visible;
}
.insurance-class-rates td {
    overflow: visible;
}
.insurance-class-rates .form-actions {
    margin-top: 0.55rem;
}
.insurance-policy-documents {
    margin: 0;
    padding: 0;
    border: 0;
}
.insurance-policy-documents h4 {
    margin: 0 0 0.4rem;
    font-size: 0.9rem;
}
.insurance-policy-documents__list {
    list-style: none;
    margin: 0 0 0.55rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.insurance-policy-documents__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
}
.insurance-policy-documents__meta {
    color: var(--muted);
    font-size: 0.78rem;
}
.insurance-policy-documents__delete {
    margin: 0;
}
.insurance-policy-documents__upload .form-field {
    margin-bottom: 0.35rem;
}
.insurance-policy-documents__upload .form-actions {
    margin-top: 0.35rem;
}
.insurance-policy-documents__upload input[type="file"] {
    max-width: 22rem;
}
.loan-documents__list {
    list-style: none;
    margin: 0 0 0.55rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.loan-documents__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
}
.loan-documents__delete {
    margin: 0;
}
.loan-documents__upload .form-actions {
    margin-top: 0.35rem;
}
.loan-documents__upload input[type="file"] {
    max-width: 22rem;
}
.insurance-revenue-fields {
    margin-top: 0.15rem;
}
.insurance-class-codes__table {
    width: max-content;
    min-width: min(100%, 42rem);
}
.insurance-class-codes__checkbox {
    text-align: center;
}
/* Class-code editor actions use shared .form-actions */}
.row-muted td {
    color: var(--muted);
}
.report-drilldown,
.workers-comp-drilldown {
    margin-top: 0.75rem;
}
.report-drilldown__header,
.workers-comp-drilldown__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}
.report-drilldown__header-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
    margin-left: auto;
}
.report-drilldown__header h3,
.workers-comp-drilldown__header h3 {
    margin: 0;
    font-size: 0.95rem;
}
.report-drilldown__meta,
.workers-comp-drilldown__meta {
    margin: 0;
    color: #64748b;
    font-size: 0.85rem;
}
.report-drilldown__close,
.workers-comp-drilldown__close {
    margin-left: 0;
    font-size: 0.85rem;
}
.report-drilldown__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin: 0 0 0.75rem;
}
.report-drilldown__summarize,
.report-drilldown__sort-by {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
}
.report-drilldown__summarize select,
.report-drilldown__sort-by select {
    min-width: 11rem;
}
.report-drilldown__sort-by,
.report-drilldown__sort-dir {
    display: none;
}
.report-drilldown__expand-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.report-drilldown__sort-btn {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    padding: 0;
    text-align: inherit;
}
.report-drilldown__sort-btn.is-active {
    color: #1d4ed8;
}
.report-drilldown__sort-indicator {
    display: inline-block;
    min-width: 0.85em;
    font-size: 0.75em;
}
.report-drilldown__group-row td {
    background: #f1f5f9;
}
.report-drilldown__group-toggle {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font: inherit;
    padding: 0;
    text-align: left;
}
.report-drilldown__group-chevron {
    color: #94a3b8;
    font-weight: 400;
    font-size: 0.8em;
}
.report-drilldown__group-chevron::before {
    content: "???";
    display: inline-block;
    width: 1em;
}
.report-drilldown__group-row.is-expanded .report-drilldown__group-chevron::before {
    content: "???";
}
.report-drilldown__group-meta {
    color: #64748b;
    font-weight: 400;
    font-size: 0.85rem;
}
.report-drilldown__group-label {
    display: none;
    font: inherit;
    color: inherit;
}
.report-print-only {
    display: none;
}
.report-print-target .report-print-only,
body.printing-report .report-print-only {
    display: inline;
}
/* Root that is itself print-only must stay block so fit-width can measure height. */
body.printing-report .report-print-root.report-print-only {
    display: block !important;
}
.report-print-target .report-screen-only {
    display: none !important;
}
.report-print-target .report-drilldown__group-label.report-print-only,
body.printing-report .report-drilldown__group-label.report-print-only {
    display: inline;
}
.report-print-target .report-drilldown__group-row td,
body.printing-report .report-drilldown__group-row td {
    background: #f1f5f9 !important;
    font-weight: 600;
}
.report-drilldown__child-row td:first-child {
    padding-left: 1.75rem;
}
.report-drilldown__attach-col {
    width: 3.5rem;
    text-align: center;
    white-space: nowrap;
}
.report-drilldown__attach-count {
    display: inline-block;
    margin-left: 0.15rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1d4ed8;
    vertical-align: middle;
}
.report-drilldown .missing-attachments-docs__toggle.is-attached {
    color: #1d4ed8;
}
.report-drilldown:has(.missing-attachments-docs__popover:not([hidden])) .report-table-scroll,
.report-drilldown:has(.missing-attachments-docs__popover:not([hidden])) .report-table,
.report-table-scroll:has(.missing-attachments-docs__popover:not([hidden])) {
    overflow: visible;
}
.report-drilldown__table tbody tr:hover > td {
    background: #e8f0ff;
}
.report-drilldown__group-row:hover > td {
    background: #e2e8f0;
}
.report-drilldown__edit-col {
    width: 2.5rem;
    white-space: nowrap;
    text-align: center;
}
/* Chromeless pencil / trash icon controls (canonical). Do not combine with `.secondary`. */
.table-icon-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}
.table-icon-actions > a:not(.edit-icon-btn):not(.delete-icon-btn) {
    margin-right: 0.35rem;
}
.edit-icon-btn,
a.edit-icon-btn,
button.edit-icon-btn,
.report-txn-edit-icon-btn,
.delete-icon-btn,
a.delete-icon-btn,
button.delete-icon-btn,
label.delete-icon-btn,
.delete-row-btn,
a.delete-row-btn,
button.delete-row-btn,
.receipt-line-delete-btn,
.mgmt-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 1.85rem;
    height: 1.85rem;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-weight: 500;
    font-size: inherit;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
}
.edit-icon-btn:hover,
a.edit-icon-btn:hover,
button.edit-icon-btn:hover,
.report-txn-edit-icon-btn:hover {
    color: #0f172a;
    background: #e2e8f0;
}
.delete-icon-btn:hover,
a.delete-icon-btn:hover,
button.delete-icon-btn:hover,
label.delete-icon-btn:hover,
.delete-row-btn:hover,
a.delete-row-btn:hover,
button.delete-row-btn:hover,
.receipt-line-delete-btn:hover,
.mgmt-delete-btn:hover {
    color: #9b1c1c;
    background: #fee2e2;
}
.edit-icon-btn:focus-visible,
a.edit-icon-btn:focus-visible,
button.edit-icon-btn:focus-visible,
.report-txn-edit-icon-btn:focus-visible,
.delete-icon-btn:focus-visible,
a.delete-icon-btn:focus-visible,
button.delete-icon-btn:focus-visible,
label.delete-icon-btn:focus-visible,
.delete-row-btn:focus-visible,
a.delete-row-btn:focus-visible,
button.delete-row-btn:focus-visible,
.receipt-line-delete-btn:focus-visible,
.mgmt-delete-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}
.edit-icon-btn svg,
.report-txn-edit-icon-btn svg,
.delete-icon-btn svg,
.delete-row-btn svg,
.receipt-line-delete-btn svg,
.mgmt-delete-btn svg {
    width: 1rem;
    height: 1rem;
    display: block;
}
.report-txn-edit-icon-btn.recon-thumb-btn:hover {
    color: #166534;
    background: #dcfce7;
}
.report-drilldown__edit-btn {
    padding: 0.2rem 0.55rem;
    font-size: 0.8rem;
}
/* Desktop: keep Amount + Edit visible while panning wide drill tables. */
.report-drilldown .report-table-scroll {
    max-width: 100%;
}
.report-drilldown .report-table-scroll .report-drilldown__table {
    border-collapse: separate;
    border-spacing: 0;
}
.report-drilldown__col--date,
.report-drilldown__cell--date {
    max-width: 7.5rem;
}
.report-drilldown__col--type,
.report-drilldown__cell--type {
    max-width: 7rem;
}
.report-drilldown__col--doc,
.report-drilldown__cell--doc {
    max-width: 6.5rem;
}
.report-drilldown__col--project,
.report-drilldown__cell--project,
.report-drilldown__col--bw-job,
.report-drilldown__cell--bw-job,
.report-drilldown__col--vendor,
.report-drilldown__cell--vendor,
.report-drilldown__col--account,
.report-drilldown__cell--account {
    max-width: 10rem;
}
.report-drilldown__col--memo,
.report-drilldown__cell--memo {
    max-width: 16rem;
}
.report-drilldown__table tbody td.report-drilldown__cell--date,
.report-drilldown__table tbody td.report-drilldown__cell--type,
.report-drilldown__table tbody td.report-drilldown__cell--doc,
.report-drilldown__table tbody td.report-drilldown__cell--project,
.report-drilldown__table tbody td.report-drilldown__cell--bw-job,
.report-drilldown__table tbody td.report-drilldown__cell--vendor,
.report-drilldown__table tbody td.report-drilldown__cell--account,
.report-drilldown__table tbody td.report-drilldown__cell--memo {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.report-drilldown__col--amount,
.report-drilldown__cell--amount {
    min-width: 5.75rem;
}
.report-drilldown__col--edit,
.report-drilldown__edit-col {
    min-width: 5rem;
    width: 5rem;
}
.report-drilldown__table thead th.gmr-col {
    vertical-align: bottom;
    background: #f4f7fd;
}
.report-drilldown__table thead th.amount-col,
.report-drilldown__table tbody td.report-drilldown__cell--amount,
.report-drilldown__table tfoot td.amount-col {
    position: sticky;
    right: 5rem;
    z-index: 2;
    background: var(--surface, #fff);
    box-shadow: -6px 0 8px -6px rgba(15, 23, 42, 0.18);
}
.report-drilldown__table thead th.report-drilldown__edit-col,
.report-drilldown__table tbody td.report-drilldown__cell--edit,
.report-drilldown__table tfoot td.report-drilldown__edit-col {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--surface, #fff);
    box-shadow: -1px 0 0 var(--border, #e2e8f0);
}
.report-drilldown__table thead th.amount-col,
.report-drilldown__table thead th.report-drilldown__edit-col {
    z-index: 5;
    background: #f4f7fd;
}
.report-drilldown__table tbody tr:hover > td.report-drilldown__cell--amount,
.report-drilldown__table tbody tr:hover > td.report-drilldown__cell--edit {
    background: #e8f0ff;
}
.report-drilldown__table tbody tr.report-drilldown__group-row > td.amount-col,
.report-drilldown__table tbody tr.report-drilldown__group-row > td.report-drilldown__edit-col {
    background: #f1f5f9;
}
.report-drilldown__table tfoot td.amount-col,
.report-drilldown__table tfoot td.report-drilldown__edit-col {
    background: #f4f7fd;
}
.report-drilldown .gmr-th__menu {
    z-index: 60;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Transaction edit dialog */
.txn-edit-dialog {
    border: none;
    border-radius: 0.75rem;
    padding: 0;
    width: min(76rem, calc(100vw - 1.5rem));
    max-height: min(92vh, 52rem);
}
.txn-edit-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}
.txn-edit-dialog__inner {
    padding: 0.85rem 1rem 1rem;
    overflow: auto;
    max-height: min(92vh, 52rem);
}
.txn-edit-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}
.txn-edit-dialog__header h2 {
    margin: 0;
    font-size: 1.1rem;
}
.txn-edit-dialog__meta {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
}
.txn-edit-dialog__close {
    appearance: none;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
}
.txn-edit-dialog__close:hover {
    color: #0f172a;
}
.txn-edit-dialog__status {
    margin: 0 0 0.6rem;
}
.txn-edit-dialog__status.is-error {
    color: #b91c1c;
}
.txn-edit-dialog__readonly {
    margin: 0 0 0.6rem;
    padding: 0.5rem 0.65rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}
.txn-edit-header-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
    align-items: end;
}
.txn-edit-header-fields .form-field {
    margin-bottom: 0;
    min-width: 0;
}
.txn-edit-field--date {
    flex: 0 0 10rem;
    width: 10rem;
}
.txn-edit-field--number {
    flex: 0 0 7.5rem;
    width: 7.5rem;
}
.txn-edit-field--vendor {
    flex: 1 1 12rem;
    min-width: 10rem;
}
.txn-edit-field--memo {
    flex: 2 1 14rem;
    min-width: 10rem;
}
.txn-edit-dialog__form .form-field > label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
}
.txn-edit-dialog__form input[type="text"],
.txn-edit-dialog__form input[type="date"],
.txn-edit-dialog__form input[type="number"],
.txn-edit-dialog__form select,
.txn-edit-dialog__form textarea {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}
.txn-edit-dialog__form input[type="text"],
.txn-edit-dialog__form input[type="date"],
.txn-edit-dialog__form input[type="number"],
.txn-edit-dialog__form select {
    height: 2rem;
    min-height: 2rem;
    padding: 0.2rem 0.45rem;
}
.txn-edit-field--vendor .ss-dropdown {
    min-width: 0;
}
/* Let searchable account/class/customer panels escape the dialog scroll box. */
.txn-edit-dialog:has(.ss-dropdown--open),
.txn-edit-dialog__inner:has(.ss-dropdown--open) {
    overflow: visible;
}
.txn-edit-dialog__form .form-field:has(.ss-dropdown--open) {
    position: relative;
    z-index: 60;
}
.txn-edit-dialog__form .field-hint,
.txn-edit-dialog__ic-form .field-hint {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
}
.txn-edit-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}
.txn-edit-dialog__ic-form {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}
.txn-edit-lines-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.7rem 0 0.35rem;
}
.txn-edit-lines-head h3 {
    margin: 0;
    font-size: 0.9rem;
}
.txn-edit-lines-wrap {
    margin-bottom: 0.5rem;
}
.txn-edit-lines__header,
.txn-edit-line__fields {
    display: grid;
    grid-template-columns:
        minmax(8.5rem, 1.5fr)
        minmax(7.5rem, 1.25fr)
        6.15rem
        minmax(6.5rem, 0.9fr)
        minmax(6.5rem, 0.9fr)
        1.7rem;
    gap: 0.3rem 0.4rem;
    align-items: center;
}
.txn-edit-dialog.is-journal .txn-edit-lines__header,
.txn-edit-dialog.is-journal .txn-edit-line__fields {
    grid-template-columns:
        minmax(8.5rem, 1.5fr)
        minmax(7.5rem, 1.25fr)
        3.5rem
        6.15rem
        minmax(6.5rem, 0.9fr)
        minmax(6.5rem, 0.9fr)
        1.7rem;
}
.txn-edit-lines__header {
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}
.txn-edit-lines__header-amount {
    text-align: right;
}
.txn-edit-line__posting,
.txn-edit-lines__header-posting {
    display: none;
}
.txn-edit-dialog.is-journal .txn-edit-line__posting,
.txn-edit-dialog.is-journal .txn-edit-lines__header-posting {
    display: block;
}
.txn-edit-lines {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.4rem;
}
.txn-edit-line {
    border: none;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0;
    padding: 0.15rem 0 0.2rem;
    background: transparent;
}
.txn-edit-line.is-focus {
    box-shadow: inset 3px 0 0 #2563eb;
    padding-left: 0.4rem;
}
.txn-edit-line.is-readonly {
    background: #f8fafc;
}
.txn-edit-line__readonly {
    margin: 0 0 0.15rem;
    font-size: 0.75rem;
}
.txn-edit-line .form-field {
    margin-bottom: 0;
    min-width: 0;
}
.txn-edit-line .ss-dropdown {
    min-width: 0;
    width: 100%;
}
.txn-edit-line__amount input {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.txn-edit-line__posting select {
    padding-left: 0.3rem;
    padding-right: 0.3rem;
    text-align: center;
}
.txn-edit-line__remove {
    display: flex;
    justify-content: center;
    align-items: center;
}
.txn-edit-line__remove .delete-icon-btn {
    min-height: 0;
}
.txn-edit-lines__total {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
}
.txn-edit-lines__total.is-error {
    color: #b91c1c;
}
.txn-edit-dialog [data-txn-edit-add-line] {
    margin-bottom: 0.65rem;
}
@media (max-width: 840px) {
    .txn-edit-lines__header {
        display: none;
    }
    .txn-edit-line__fields,
    .txn-edit-dialog.is-journal .txn-edit-line__fields {
        grid-template-columns: 1fr 1fr;
    }
    .txn-edit-line__account,
    .txn-edit-line__description {
        grid-column: 1 / -1;
    }
    .txn-edit-line__remove {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
    .txn-edit-line .form-field > label.visually-hidden {
        position: static;
        width: auto;
        height: auto;
        margin: 0 0 0.15rem;
        overflow: visible;
        clip: auto;
        white-space: normal;
        border: 0;
        font-size: 0.75rem;
        font-weight: 600;
    }
    .txn-edit-dialog.is-journal .txn-edit-line__posting {
        display: block;
    }
}

@media (max-width: 700px) {
    /* Drill-first: collapse statement until the user asks for it. */
    .page.has-report-drilldown:not(.is-showing-statement) .report-print-root,
    .page.has-report-drilldown:not(.is-showing-statement) > .card.report-output {
        display: none;
    }
    .page.has-report-drilldown.is-showing-statement .report-print-root,
    .page.has-report-drilldown.is-showing-statement > .card.report-output {
        display: block;
    }
    body.printing-report .page.has-report-drilldown .report-print-root,
    .report-print-target .page.has-report-drilldown .report-print-root {
        display: block !important;
    }

    .page,
    .app-header,
    .card.report-drilldown,
    .report-drilldown {
        max-width: 100%;
        min-width: 0;
    }
    .report-drilldown {
        position: relative;
        overflow-x: hidden;
    }
    .report-drilldown__header {
        position: sticky;
        top: 0;
        z-index: 4;
        background: var(--surface, #fff);
        padding: 0.35rem 0 0.5rem;
        margin: 0 0 0.55rem;
        border-bottom: 1px solid var(--border, #e2e8f0);
    }
    .report-drilldown__header-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }
    .report-drilldown__toolbar {
        gap: 0.55rem 0.65rem;
        max-width: 100%;
    }
    .report-drilldown__summarize,
    .report-drilldown__sort-by {
        flex: 1 1 9rem;
        min-width: 0;
        display: inline-flex;
        max-width: 100%;
    }
    .report-drilldown__sort-dir {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.28rem 0.55rem;
        min-width: 2.25rem;
    }
    .report-drilldown__summarize select,
    .report-drilldown__sort-by select {
        min-width: 0;
        width: 100%;
        max-width: none;
    }
    /* Beat .report-table-scroll .report-table { width: max-content } so cards
       do not force page-wide horizontal overflow / clipped chrome. */
    .report-drilldown .report-table-scroll {
        overflow-x: hidden;
        overflow-y: visible;
        max-width: 100%;
        width: 100%;
    }
    .report-drilldown .report-table-scroll .report-table,
    .report-drilldown__table {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100%;
    }
    .report-drilldown__table thead {
        display: none;
    }
    .report-drilldown__table tbody,
    .report-drilldown__table tfoot {
        display: block;
        width: 100%;
        max-width: 100%;
    }
    .report-drilldown__table tbody tr[data-drilldown-row],
    .report-drilldown__table tbody tr.report-drilldown__child-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.2rem 0.4rem;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        margin: 0 0 0.65rem;
        padding: 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.65rem;
        background: #fff;
        overflow: hidden;
    }
    .report-drilldown__table tbody tr[data-drilldown-row] > td,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td {
        position: static;
        display: block;
        box-sizing: border-box;
        width: auto;
        max-width: 100%;
        padding: 0;
        border: none;
        background: transparent !important;
        box-shadow: none;
        text-align: left;
        font-size: 0.9rem;
        line-height: 1.35;
        overflow-wrap: anywhere;
        word-break: break-word;
        white-space: normal;
    }
    .report-drilldown__table tbody tr[data-drilldown-row] > td::before,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td::before {
        content: none;
    }
    .report-drilldown__table tbody tr[data-drilldown-row] > td.is-empty,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.is-empty {
        display: none !important;
    }
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--date,
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--type,
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--doc,
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--project,
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--bw-job,
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--vendor,
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--account,
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--memo,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--date,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--type,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--doc,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--project,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--bw-job,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--vendor,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--account,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--memo {
        max-width: none;
        text-overflow: unset;
        white-space: normal;
        overflow: visible;
    }
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--date,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--date {
        order: 1;
        flex: 1 1 calc(100% - 7.5rem);
        min-width: 0;
        max-width: calc(100% - 7.5rem);
        font-weight: 600;
        color: var(--text, #1d2738);
    }
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--amount,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--amount {
        order: 2;
        flex: 0 0 auto;
        margin: 0 0 0 auto;
        padding: 0;
        font-size: 1.05rem;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        text-align: right;
        white-space: nowrap;
        line-height: 1.2;
    }
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--type,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--type {
        order: 3;
        flex: 0 1 auto;
        min-width: 0;
        color: #475569;
    }
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--doc,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--doc {
        order: 4;
        flex: 1 1 auto;
        min-width: 0;
        color: #475569;
    }
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--type:not(.is-empty)::before,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--type:not(.is-empty)::before {
        content: none;
    }
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--doc:not(.is-empty)::before,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--doc:not(.is-empty)::before {
        content: "?";
        margin-right: 0.35rem;
        color: #94a3b8;
        font-weight: 400;
    }
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--vendor,
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--project,
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--bw-job,
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--account,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--vendor,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--project,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--bw-job,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--account {
        order: 5;
        display: inline-flex;
        align-items: center;
        flex: 0 1 auto;
        max-width: 100%;
        margin-top: 0.15rem;
        padding: 0.12rem 0.45rem;
        border-radius: 999px;
        background: #f1f5f9;
        color: #475569;
        font-size: 0.78rem;
        line-height: 1.3;
    }
    .report-drilldown__table--single-account tbody tr[data-drilldown-row] > td.report-drilldown__cell--account,
    .report-drilldown__table--single-account tbody tr.report-drilldown__child-row > td.report-drilldown__cell--account {
        display: none !important;
    }
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--memo,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--memo {
        order: 6;
        flex: 1 1 100%;
        width: 100%;
        margin-top: 0.25rem;
        color: #64748b;
        font-size: 0.84rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--attach,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--attach {
        order: 7;
        display: inline-flex;
        align-items: center;
        flex: 0 0 auto;
        margin-top: 0.35rem;
        width: auto;
        text-align: left;
    }
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__cell--edit,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__cell--edit {
        order: 8;
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        flex: 1 1 auto;
        margin-top: 0.35rem;
        margin-left: auto;
        width: auto;
        min-width: 2.5rem;
        text-align: right;
    }
    .report-drilldown__table tbody tr[data-drilldown-row] > td.report-drilldown__edit-col::before,
    .report-drilldown__table tbody tr.report-drilldown__child-row > td.report-drilldown__edit-col::before {
        content: none;
    }
    .edit-icon-btn,
    .report-txn-edit-icon-btn,
    .delete-icon-btn {
        width: 2.25rem;
        height: 2.25rem;
    }
    .report-drilldown__edit-btn {
        min-height: 2.25rem;
        padding: 0.35rem 0.75rem;
    }
    .report-drilldown__table tbody tr.report-drilldown__group-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.35rem 0.75rem;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        margin-bottom: 0.5rem;
        padding: 0.55rem 0.75rem;
        border: 1px solid #cbd5e1;
        border-radius: 0.5rem;
        overflow: hidden;
        background: #f1f5f9;
    }
    .report-drilldown__table tbody tr.report-drilldown__group-row td {
        display: block;
        position: static;
        box-sizing: border-box;
        width: auto;
        max-width: 100%;
        background: transparent;
        box-shadow: none;
    }
    .report-drilldown__table tbody tr.report-drilldown__group-row td[colspan] {
        flex: 1 1 auto;
        min-width: 0;
    }
    .report-drilldown__table tbody tr.report-drilldown__group-row td.amount-col {
        flex: 0 0 auto;
        text-align: right;
        font-weight: 700;
        white-space: nowrap;
    }
    .report-drilldown__table tbody tr.report-drilldown__group-row td.report-drilldown__edit-col {
        display: none;
    }
    .report-drilldown__table tfoot {
        display: block;
        width: 100%;
    }
    .report-drilldown__table tfoot tr {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.75rem;
        padding: 0.5rem 0.25rem;
        max-width: 100%;
    }
    .report-drilldown__table tfoot td {
        display: block;
        position: static;
        border: none;
        background: transparent;
        box-shadow: none;
    }
    .report-drilldown__table tfoot td[colspan] {
        flex: 1;
        min-width: 0;
    }
    .report-drilldown__table tfoot td.amount-col {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    .report-drilldown__table tfoot td.report-drilldown__edit-col {
        display: none;
    }
    .txn-edit-dialog {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    .txn-edit-dialog__inner {
        max-height: 100vh;
        padding: 1rem;
    }
}

.workers-comp-drilldown__actions-form {
    margin: 0;
}
.workers-comp-drilldown__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}
.workers-comp-drilldown__selected {
    margin: 0;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 600;
}
.workers-comp-drilldown__select-col {
    width: 3.5rem;
}
.workers-comp-drilldown__excluded {
    margin-top: 1rem;
}
.workers-comp-drilldown__excluded summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-summary__context {
    margin: 0 0 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
}
.project-summary__empty {
    margin: 0.5rem 0 0;
    color: var(--muted);
}
.project-summary-metrics {
    display: grid;
    gap: 0.4rem;
}
.project-summary-metrics--row {
    grid-template-columns: repeat(var(--summary-cols, 3), minmax(0, 1fr));
}
.project-summary-metrics--billing {
    margin-top: 0.1rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--border);
}
@media (max-width: 900px) {
    .project-summary-metrics--row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .project-summary-metrics--billing {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 520px) {
    .project-summary-metrics--row,
    .project-summary-metrics--billing {
        grid-template-columns: 1fr;
    }
}
.project-summary-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.35rem 0.55rem;
    background: #fff;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}
.project-summary-card__label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #64748b;
    line-height: 1.2;
}
.project-summary-card__value {
    font-size: 0.95rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    color: var(--text);
    text-align: right;
    white-space: nowrap;
}
.project-summary-card--income {
    border-left: 3px solid #22c55e;
}
.project-summary-card--expense {
    border-left: 3px solid #ef4444;
}
.project-summary-card--cogs {
    border-left: 3px solid #f59e0b;
}
.project-summary-card--gross {
    border-left: 3px solid #14b8a6;
}
.project-summary-card--gross-pct {
    border-left: 3px solid #06b6d4;
}
.project-summary-card--non-op {
    border-left: 3px solid #a855f7;
}
.project-summary-card--net {
    border-left: 3px solid #3b82f6;
}
.project-summary-card--billed {
    border-left: 3px solid #6366f1;
}
.project-summary-card--paid {
    border-left: 3px solid #10b981;
}
.project-summary-card--outstanding {
    border-left: 3px solid #f97316;
}
.project-summary-breakdown {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.project-summary-breakdown__title {
    margin: 0 0 0.45rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}
.project-summary-table tbody tr:hover > td {
    background: #e8f0ff;
}
.project-summary-table tbody tr.report-row--unassigned:hover > td {
    background: #eef2f8;
}

.report-print-header {
    text-align: center;
    margin: 0.2in 0 0.85rem;
    padding: 0 0.5rem;
}
/* Screen: hide document title/period that already appear in the toolbar.
   PDF export: show again once .report-print-target is applied (pre-print measure + print).
   Management Report section headers omit report-print-only so they stay visible on screen. */
.report-print-header.report-print-only {
    display: none;
}
.report-print-target .report-print-header.report-print-only,
body.printing-report .report-print-header.report-print-only {
    display: block;
}
.report-print-header__title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}
.report-print-header__subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: #64748b;
}
.report-print-header__context {
    margin: 0.15rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}
.report-section-heading {
    margin: 0 0 0.55rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.report-print-root {
    margin-left: auto;
    margin-right: auto;
}

.management-report-section + .management-report-section {
    break-before: page;
    page-break-before: always;
}

.management-report-title-page {
    min-height: 9.5in;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: #fff;
    overflow: hidden;
}
.mgmt-title-page__banner {
    background: #1e3a5f;
    color: #fff;
    text-align: center;
    padding: 1.35rem 1rem 1.1rem;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}
.mgmt-title-page__report-title {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
}
.mgmt-title-page__company {
    margin: 0.55rem 0 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.mgmt-title-page__period {
    margin: 0.85rem 0 0;
    font-size: 0.92rem;
    font-weight: 500;
}
.mgmt-title-page__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.5in 0.5in 0.35in;
    box-sizing: border-box;
}
.mgmt-title-page__client-logo {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-height: 4.5in;
    padding: 0.5rem 0;
}
.mgmt-title-page__client-logo img {
    max-width: 72%;
    max-height: 3.75in;
    object-fit: contain;
}
.mgmt-title-page__footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 1rem 0.5in;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.mgmt-title-page__prepared {
    display: grid;
    gap: 0.15rem;
}
.mgmt-title-page__label {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.mgmt-title-page__value {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
}
.mgmt-title-page__ks-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 600;
}
.mgmt-title-page__ks-brand img {
    width: 2.4rem;
    height: auto;
}
.mgmt-notes-page {
    font-size: 1.84rem;
    line-height: 1.55;
}
.management-report-section:has(.mgmt-notes-page) .report-print-header__title {
    font-size: 2.7rem;
}
.management-report-section:has(.mgmt-notes-page) .report-print-header__subtitle {
    font-size: 1.64rem;
}
.mgmt-notes-page p {
    margin: 0 0 0.85rem;
}
.mgmt-notes-page p.mgmt-notes-gap {
    margin: 0 0 0.85rem;
    min-height: 0.35rem;
}
.mgmt-notes-page ul {
    margin: 0 0 0.85rem 1.2rem;
    padding: 0;
}
.mgmt-notes-page li {
    margin-bottom: 0.35rem;
}
.mgmt-narrative {
    font-size: 0.92rem;
    line-height: 1.55;
    color: #1f2937;
}
.mgmt-narrative p {
    margin: 0 0 0.85rem;
}
.mgmt-narrative ul,
.mgmt-narrative ol {
    margin: 0 0 0.85rem 1.2rem;
    padding: 0;
}
.mgmt-narrative li {
    margin-bottom: 0.35rem;
}
.mgmt-narrative .mgmt-measure-list {
    margin: 0.35rem 0 0.85rem 1.2rem;
    /* Lists inherit explicit size from the renderer when placed beside sized prose. */
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}
.mgmt-branding-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}
.mgmt-branding-preview__image {
    max-height: 4rem;
    max-width: 12rem;
    object-fit: contain;
}

.mgmt-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mgmt-toc-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.15rem 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.mgmt-toc-entry:last-child {
    border-bottom: 0;
}

.mgmt-toc-entry__link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.mgmt-toc-entry__link:hover {
    text-decoration: underline;
}

.mgmt-toc-entry__number {
    min-width: 1.5rem;
    color: #64748b;
}

.mgmt-toc-entry__subtitle {
    grid-column: 2;
    color: #64748b;
    font-size: 0.9rem;
    text-align: right;
}

@media print {
    .management-report-section + .management-report-section {
        break-before: page;
        page-break-before: always;
    }

    .mgmt-toc-entry__link,
    .report-print-target a,
    .report-drill-link,
    .workers-comp-drill-link {
        color: inherit !important;
        text-decoration: none !important;
        cursor: text !important;
    }
}

.report-reconciliation-alert {
    border-color: #f0c36d;
    background: #fff8e6;
}

.report-reconciliation-alert ul {
    margin: 0.5rem 0 0.75rem;
    padding-left: 1.25rem;
}

.management-run-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

@media print {
    html.printing-report,
    body.printing-report {
        background: #fff;
        margin: 0;
        padding: 0;
        overflow-x: visible;
        max-width: none;
    }
    body.printing-report .report-screen-only,
    body.printing-report .messages,
    .report-screen-only {
        display: none !important;
    }
    body.printing-report .report-print-target,
    body.printing-report .report-print-target * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    html.printing-report.printing-report-singlepage,
    body.printing-report.printing-report-singlepage {
        height: var(--report-print-height, auto);
        max-height: var(--report-print-height, auto);
        overflow: hidden !important;
    }
    html.printing-report.printing-report-multipage,
    body.printing-report.printing-report-multipage {
        height: auto;
        max-height: none;
        overflow: visible !important;
    }
    body.printing-report .page {
        min-height: 0;
        width: 100%;
        /* Drop screen max-width (1120px / page--wide) so landscape sections
           are not clamped to a portrait-ish containing block. */
        max-width: none;
        padding: 0;
        margin: 0;
        /* Block layout fills the named @page box. Flex + min-width:auto
           shrink-wrapped landscape cards to the left of the sheet. */
        display: block;
    }
    body.printing-report .page > *:not(.report-print-target),
    body.printing-report .app-header {
        display: none !important;
    }
    body.printing-report .report-print-target {
        display: block !important;
        position: relative;
        top: 0;
        left: auto;
        right: auto;
        margin-left: auto !important;
        margin-right: auto !important;
        min-width: 0;
        /* Scale is applied via zoom on .report-print-center so the section
           can fill the page while tables stay centered. */
        transform: none;
        transform-origin: top center;
        width: var(--report-print-width, 100%);
        /* Do not clamp to page width: wide tables set width to natural size
           then zoom down. max-width:page would leave the card portrait-narrow
           while columns overflow. */
        max-width: none;
    }
    body.printing-report-singlepage .report-print-target {
        page-break-after: avoid;
        page-break-before: avoid;
        page-break-inside: avoid;
    }
    body.printing-report-multipage .report-print-target {
        page-break-inside: auto;
        break-after: avoid;
        page-break-after: avoid;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
    body.printing-report-multipage .management-report-section:not(:first-child) {
        break-before: page;
        page-break-before: always;
    }
    /* Zero bottom margin on the last section so a full last page cannot
       overflow onto a blank one. */
    body.printing-report-multipage .report-print-target > .management-report-section:last-of-type,
    body.printing-report-multipage .report-print-target > *:last-child > .management-report-section {
        break-after: avoid;
        page-break-after: avoid;
        margin-bottom: 0 !important;
    }
    body.printing-report .feedback-dialog {
        display: none !important;
    }
    body.printing-report .report-print-target .management-report-section {
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box;
        padding-top: 0.1in;
        overflow: visible !important;
        width: 100%;
        min-width: 0;
        max-width: none;
    }
    body.printing-report .report-print-target .report-print-center {
        display: block;
        box-sizing: border-box;
        margin-left: auto;
        margin-right: auto;
    }
    body.printing-report .report-print-target .management-report-section--landscape .report-table-scroll,
    body.printing-report .report-print-target .management-report-section--landscape .report-table-wrap,
    body.printing-report .report-print-target .management-report-section--landscape .table-scroll {
        margin-left: auto;
        margin-right: auto;
    }
    body.printing-report .report-print-target .mgmt-narrative {
        width: 100%;
        max-width: none;
        orphans: 1;
        widows: 1;
    }
    body.printing-report .report-print-target .report-print-header {
        margin-top: 0.05in;
    }
    body.printing-report .report-print-target .report-print-header.report-print-only {
        display: block;
    }
    body.printing-report .management-report-section--landscape .report-table {
        font-size: 0.78rem;
    }
    body.printing-report .report-print-target .project-summary-metrics--row {
        grid-template-columns: repeat(var(--summary-cols, 3), minmax(0, 1fr)) !important;
    }
    body.printing-report .report-print-target .card {
        break-inside: auto;
        page-break-inside: auto;
        box-shadow: none;
        border: 1px solid #d1d5db;
        margin-bottom: 0.35rem;
        padding: 0.45rem 0.55rem;
    }
    body.printing-report .report-print-target .report-print-header {
        margin-bottom: 0.55rem;
    }
    body.printing-report .report-print-target .report-print-header__title {
        font-size: 1.15rem;
    }
    body.printing-report .report-print-target .management-report-section:has(.mgmt-notes-page) .report-print-header__title {
        font-size: 2.3rem;
    }
    body.printing-report .report-print-target .management-report-section:has(.mgmt-notes-page) .report-print-header__subtitle {
        font-size: 1.64rem;
    }
    body.printing-report .report-print-target .mgmt-notes-page {
        font-size: 1.84rem;
        orphans: 1;
        widows: 1;
    }
    body.printing-report .report-print-target .project-summary-card {
        padding: 0.2rem 0.35rem;
    }
    body.printing-report .report-print-target .report-table {
        font-size: 0.82rem;
        width: 100% !important;
        min-width: 100% !important;
        max-width: none !important;
    }
    body.printing-report .report-print-target .report-table-scroll .report-table,
    body.printing-report .report-print-target .report-table-wrap .report-table {
        /* Beat screen `width: max-content` so the table fills the print card. */
        width: 100% !important;
        min-width: 100% !important;
        max-width: none !important;
    }
    body.printing-report-landscape .report-print-target .report-table {
        font-size: 0.78rem;
    }
    body.printing-report .report-print-target .report-table-scroll,
    body.printing-report .report-print-target .report-table-wrap,
    body.printing-report .report-print-target .table-scroll {
        overflow: visible;
        max-width: none;
        width: 100%;
        background-image: none;
    }
    /* Print page width is often <1200px, so stack-as-cards would otherwise
       activate during PDF export. Keep real tables in the print target. */
    body.printing-report .report-print-target .table-scroll.table-scroll--stack > table {
        display: table !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: none !important;
    }
    body.printing-report .report-print-target .table-scroll.table-scroll--stack thead {
        display: table-header-group !important;
    }
    body.printing-report .report-print-target .table-scroll.table-scroll--stack tbody {
        display: table-row-group !important;
    }
    body.printing-report .report-print-target .table-scroll.table-scroll--stack tfoot {
        display: table-footer-group !important;
    }
    body.printing-report .report-print-target .table-scroll.table-scroll--stack tr {
        display: table-row !important;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        width: auto;
        max-width: none;
    }
    body.printing-report .report-print-target .table-scroll.table-scroll--stack td,
    body.printing-report .report-print-target .table-scroll.table-scroll--stack th {
        display: table-cell !important;
        width: auto;
        max-width: none;
        padding: 0.35rem 0.5rem;
        border: none;
        border-bottom: 1px solid #e5e7eb;
        background: transparent;
        text-align: inherit;
        font-size: inherit;
        line-height: inherit;
        overflow-wrap: normal;
        word-break: normal;
        white-space: nowrap;
        order: 0;
        flex: none;
        margin: 0;
    }
    body.printing-report .report-print-target .table-scroll.table-scroll--stack td[data-label]::before,
    body.printing-report .report-print-target .table-scroll.table-scroll--stack th[data-label]::before {
        content: none !important;
        display: none !important;
    }
    body.printing-report .report-print-target .table-scroll.table-scroll--stack .amount-col {
        text-align: right;
    }
    /* Sparse WC matrices stay shrink-wrapped and centered. */
    body.printing-report .report-print-target .report-table-scroll:has(> .workers-comp-matrix) {
        width: fit-content;
        max-width: 100%;
        margin-inline: auto;
    }
    body.printing-report .report-print-target .report-table-scroll--freeze,
    body.printing-report .report-print-target .ledger-balance-open-items__scroll {
        max-height: none;
        border: none;
        border-radius: 0;
        scrollbar-gutter: auto;
    }
    body.printing-report .report-print-target .report-table-scroll--freeze th,
    body.printing-report .report-print-target .report-table-scroll--freeze td {
        position: static;
        box-shadow: none;
    }
    body.printing-report-singlepage .report-print-target .report-table {
        font-size: 0.72rem;
    }
    body.printing-report .report-print-target thead th {
        background-color: #f4f7fd !important;
        color: #2b3e62 !important;
    }
    body.printing-report .report-print-target .section-header-row td {
        background-color: #eef2f8 !important;
        border-top-color: #d8e0ec !important;
    }
    body.printing-report .report-print-target .subtotal-row td {
        background-color: #f4f7fd !important;
    }
    body.printing-report .report-print-target .section-total-row td {
        border-top-color: #d8e0ec !important;
    }
    body.printing-report .report-print-target .calculated-row td {
        border-top-color: #d8e0ec !important;
    }
    body.printing-report .report-print-target .balance-detail-row--grand-total td {
        background-color: #dde5f2 !important;
        border-top-color: #8fa3c4 !important;
        border-bottom-color: #8fa3c4 !important;
        color: #1a2b45 !important;
    }
    body.printing-report .report-print-target .project-summary-card {
        background-color: #fff !important;
    }
    body.printing-report .report-print-target .management-report-title-page {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        /* Leave a small buffer under the printable area so min-height cannot
           spill a nearly-empty trailing page after the cover. */
        min-height: 9.2in;
    }
    body.printing-report .report-print-target .management-report-title-page .mgmt-title-page__banner,
    body.printing-report .report-print-target .management-report-title-page .mgmt-title-page__footer {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }
    body.printing-report .mgmt-title-page__banner {
        background-color: #1e3a5f !important;
        color: #fff !important;
        margin-top: -0.1in !important;
    }
    body.printing-report .app-header,
    body.printing-report .app-nav,
    body.printing-report .stepper {
        display: none !important;
    }
    @page {
        size: letter portrait;
        margin: 0.7in 0.5in 0.5in 0.5in;
    }
}

.bookwright-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.bookwright-action-card {
    display: block;
    padding: 1rem;
    border: 1px solid var(--border, #d8dee4);
    border-radius: 8px;
    background: var(--surface, #fff);
    text-decoration: none;
    color: inherit;
}

.bookwright-action-card:hover {
    border-color: var(--primary, #1e3a5f);
}

.bookwright-action-card span {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted, #5c6770);
    font-size: 0.9rem;
}

.bookwright-line-form {
    border: 1px solid var(--border, #d8dee4);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.form-field--inline {
    display: inline-block;
    margin-right: 0.75rem;
    vertical-align: top;
}

.bookwright-book-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.bookwright-book-list li {
    margin-bottom: 0.5rem;
}

.bookwright-book-list__button {
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border, #d8dee4);
    border-radius: 8px;
    background: var(--surface, #fff);
    cursor: pointer;
}

.bookwright-book-list__button:hover {
    border-color: var(--primary, #1e3a5f);
}

.receipt-preview-fields {
    display: grid;
    gap: 0.45rem 1.25rem;
    margin: 0 0 0.85rem;
}

.receipt-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.85rem;
    margin: 0.35rem 0 0;
    font-size: 0.92rem;
}

.receipt-detail-meta > a {
    white-space: nowrap;
}

.receipt-detail-posted {
    margin: 0.5rem 0 0;
}

.receipt-toolbar-form {
    display: inline-flex;
    margin: 0;
}

.card--alert {
    border-left: 4px solid #b42318;
}

.receipt-confidence-list {
    margin: 0;
    padding-left: 1.25rem;
}

.report-toolbar__heading .status-badge {
    align-self: center;
}

@media (min-width: 52rem) {
    .receipt-preview-fields {
        grid-template-columns: 1fr 1fr;
    }

    .receipt-preview-field--wide {
        grid-column: 1 / -1;
    }
}

.receipt-preview-field {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    align-items: center;
    gap: 0.35rem 0.75rem;
    margin: 0;
}

@media (max-width: 640px) {
    .receipt-preview-field {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 0.25rem;
    }
}

/* display:grid above beats the UA [hidden] { display:none } rule */
.receipt-preview-field[hidden] {
    display: none;
}

.receipt-preview-field > label {
    margin: 0;
    font-weight: 600;
    line-height: 1.25;
}

.receipt-preview-control {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
}

.receipt-usd-equiv {
    font-size: 0.88rem;
}

.receipt-fx-difference {
    font-size: 0.88rem;
}

.receipt-fx-treatment {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    margin: 0.35rem 0 0;
    padding: 0;
    border: 0;
}

.receipt-fx-treatment__legend {
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0;
    margin: 0 0 0.15rem;
}

.receipt-fx-treatment ul,
.receipt-fx-treatment > div {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
}

.receipt-fx-treatment li,
.receipt-fx-treatment > div > div {
    margin: 0;
}

.receipt-fx-treatment label {
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.receipt-preview-control > select[name="currency"] {
    max-width: 11rem;
}

.receipt-create-vendor-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.receipt-create-vendor-btn[hidden] {
    display: none !important;
}

.receipt-vendor-create-status {
    flex: 1 1 100%;
    font-size: 0.88rem;
    margin: 0;
}

.receipt-vendor-create-status.is-error {
    color: #b91c1c;
}

.receipt-vendor-dialog {
    border: 0;
    border-radius: 12px;
    padding: 0;
    max-width: 28rem;
    width: calc(100vw - 2rem);
    box-shadow: var(--shadow);
}

.receipt-vendor-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.receipt-vendor-dialog__inner {
    padding: 1.1rem 1.2rem 1.2rem;
}

.receipt-vendor-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.receipt-vendor-dialog__header h3 {
    margin: 0;
    font-size: 1.15rem;
}

.receipt-vendor-dialog__close {
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 0.15rem 0.35rem;
}

.receipt-vendor-dialog__close:hover {
    color: #1f2937;
}

.receipt-vendor-dialog__intro {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.receipt-vendor-dialog__form .form-field {
    margin-bottom: 0.85rem;
}

.receipt-vendor-dialog__form .form-field label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.88rem;
}

.receipt-vendor-dialog__form input[type="text"],
.receipt-vendor-dialog__form input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}

.receipt-vendor-dialog__form .form-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-top: 0.35rem;
}

.receipt-preview-control > select,
.receipt-preview-control > input,
.receipt-preview-control > textarea {
    max-width: 100%;
}

.receipt-preview-control > textarea {
    width: 100%;
    min-height: 2.75rem;
}

.receipt-preview-field--wide {
    align-items: start;
}

.receipt-preview-field--wide > label {
    padding-top: 0.35rem;
}

.receipt-ledger-match > .receipt-preview-field {
    margin-bottom: 0.5rem;
}

.receipt-line-table {
    width: 100%;
    table-layout: fixed;
}

.receipt-line-table .receipt-col-description {
    width: 34%;
}

.receipt-line-table .receipt-col-receipt-amount,
.receipt-line-table .receipt-col-posting-amount {
    width: 6.25rem;
}

.receipt-line-table .receipt-col-category {
    width: 24%;
}

.receipt-line-table .receipt-col-project {
    width: 22%;
}

.receipt-line-table .receipt-col-billable {
    width: 4.75rem;
}

.receipt-line-table .receipt-col-actions {
    width: 3.5rem;
}

.receipt-line-actions-cell {
    vertical-align: top;
    text-align: right;
    white-space: nowrap;
}

.receipt-line-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin: 0.75rem 0 1rem;
}

.receipt-footer-add {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.receipt-line-table tfoot tr[hidden],
.table-scroll.table-scroll--stack .receipt-line-table tfoot tr[hidden],
.receipt-add-footer-btn[hidden] {
    display: none !important;
}

.receipt-line-toolbar-hint {
    margin: 0;
    flex: 1 1 16rem;
}

.receipt-line-row--template {
    display: none !important;
}

/* Stacked receipt line cards: full-width controls, no forced table min-width. */
@media (max-width: 1200px) {
    .table-scroll.table-scroll--stack > .receipt-line-table {
        min-width: 0 !important;
        table-layout: auto;
    }
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-description-row,
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-description-cell input[name$="-description"],
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-receipt-amount-cell input,
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-footer-amount-cell input,
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-panel select,
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-panel .ss-dropdown,
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-project-cell select,
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-project-cell .ss-dropdown {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    /* Keep the closed trigger full-width; let the open panel size to readable
       option text (capped by viewport via searchable_select.js). */
    /* Header: description + trash top-right */
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-description-cell {
        order: 1;
        flex: 1 1 calc(100% - 2.75rem);
        min-width: 0;
    }
    .table-scroll.table-scroll--stack .receipt-line-table tbody td.receipt-line-actions-cell {
        order: 2;
        flex: 0 0 auto;
        width: auto;
        max-width: none;
        min-width: 0;
        margin-left: auto;
        align-self: flex-start;
        text-align: right;
        padding-bottom: 0;
    }
    /* Keep receipt + posting amounts together on one row */
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-receipt-amount-cell,
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-posting-amount-cell {
        order: 3;
        flex: 1 1 calc(50% - 0.4rem);
        margin-left: 0;
        text-align: left;
        font-size: 0.9rem;
        font-weight: 500;
        white-space: normal;
    }
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-receipt-amount-cell::before,
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-posting-amount-cell::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.1rem;
        color: var(--muted, #64748b);
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-posting-amount-cell .receipt-allocated-amount {
        font-weight: 700;
        font-size: 1.05rem;
    }
    .table-scroll.table-scroll--stack .receipt-line-table td[data-stack="meta"] {
        order: 4;
        flex: 1 1 100%;
        min-width: 0;
    }
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-category-cell {
        order: 4;
        flex: 1 1 100%;
    }
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-project-cell,
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-billable-cell {
        order: 5;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-project-cell {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        max-width: none;
    }
    .table-scroll.table-scroll--stack .receipt-line-table .receipt-line-billable-cell {
        flex: 0 0 auto;
        width: auto;
        max-width: none;
        align-self: flex-end;
    }
}

.receipt-line-table td:has(.receipt-line-panel) .ss-dropdown,
.receipt-line-table .receipt-line-project-cell .ss-dropdown,
.receipt-project-bulk .ss-dropdown {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.receipt-project-bulk {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem 0.75rem;
    margin: 0 0 0.75rem;
    max-width: 100%;
    min-width: 0;
}

.receipt-project-bulk__row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 0.5rem 0.75rem;
    min-width: 0;
}

.receipt-bulk-project-field {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
}

.receipt-bulk-project-field > label {
    margin: 0 0 0.2rem;
}

.receipt-bulk-project-field .ss-dropdown,
.receipt-bulk-project-field .receipt-bulk-project-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.receipt-bulk-billable {
    margin: 0;
    flex: 0 0 auto;
    width: auto;
    align-self: flex-end;
    padding-bottom: 0.35rem;
}

.receipt-parse-mode {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.receipt-parse-mode .is-active {
    font-weight: 600;
    box-shadow: inset 0 0 0 1px currentColor;
}

.receipt-line-billable-cell {
    vertical-align: top;
    white-space: nowrap;
}

.receipt-line-billable-field {
    margin: 0;
    width: auto;
}

@media (min-width: 1201px) {
    .receipt-line-billable-cell .receipt-line-billable-field label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
}

.receipt-project-bulk .ss-dropdown,
.receipt-line-project-cell .ss-dropdown {
    min-width: 0;
    max-width: 100%;
}

.receipt-preview-form {
    max-width: 100%;
    min-width: 0;
}

.receipt-close-date-note {
    display: inline-block;
    margin-left: 0.5rem;
    color: #8a5a00;
    font-size: 0.9em;
    cursor: help;
    border-bottom: 1px dotted #8a5a00;
}

.receipt-preview-field--stale-date {
    align-items: start;
}

.receipt-preview-field--stale-date > label {
    padding-top: 0.45rem;
}

.receipt-preview-field--stale-date input[name="txn_date"] {
    border-color: #b54708;
    background: #fffaeb;
}

.receipt-stale-date-alert {
    flex: 1 1 100%;
    margin: 0;
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    background: #fffaeb;
    border: 1px solid #fedf89;
    border-left: 4px solid #b54708;
    color: #7a2e0e;
    font-size: 0.88rem;
    font-weight: 600;
}

.receipt-stale-date-alert[hidden] {
    display: none !important;
}

.receipt-line-table .receipt-line-receipt-amount-cell,
.receipt-line-table .receipt-line-posting-amount-cell {
    vertical-align: top;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.receipt-line-table .receipt-line-description-cell {
    min-width: 0;
    overflow: hidden;
}

.receipt-line-description-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.receipt-line-description-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    flex: 0 0 auto;
}

.receipt-line-table .receipt-line-description-cell input[name$="-description"] {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.receipt-explain-line-btn,
.receipt-restore-line-btn {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    min-height: 0;
    border: 1px solid #9aa3ad;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    line-height: 1;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Global `button { display: inline-flex }` beats the UA [hidden] rule. */
.receipt-explain-line-btn[hidden],
.receipt-restore-line-btn[hidden] {
    display: none;
}

.receipt-explain-line-btn:hover:not(:disabled),
.receipt-restore-line-btn:hover:not(:disabled),
.receipt-explain-line-btn:focus-visible,
.receipt-restore-line-btn:focus-visible {
    border-color: #475569;
    background: #f8fafc;
}

.receipt-explain-line-btn:disabled,
.receipt-restore-line-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.receipt-explain-status {
    flex: 0 1 auto;
    font-size: 0.75rem;
    white-space: nowrap;
}

.receipt-explain-unavailable {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    border: 1px dashed #cbd5e1;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
}

.receipt-explain-help {
    margin: 0.75rem 0 1rem;
    font-size: 0.875rem;
}

.receipt-line-amount-input {
    width: 100%;
    max-width: 9.75rem;
    box-sizing: border-box;
    font-variant-numeric: tabular-nums;
}

.receipt-line-table tfoot th {
    width: 8rem;
    white-space: nowrap;
}

.receipt-line-table .receipt-footer-amount-cell input {
    width: 9.75rem;
    max-width: 11rem;
}

.receipt-line-category-cell {
    vertical-align: top;
}

.receipt-line-category-row {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    min-width: 0;
}

.receipt-line-category-panels {
    flex: 1 1 auto;
    min-width: 0;
}

.receipt-line-style-toggle {
    position: relative;
    flex: 0 0 auto;
}

.receipt-line-style-toggle ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.receipt-line-style-toggle li {
    margin: 0;
}

.receipt-line-style-toggle label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.receipt-line-style-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 6.5rem;
    min-height: 0;
    margin: 0;
    padding: 0.2rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    border: 1px solid var(--border, #d8dee4);
    border-radius: 4px;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.receipt-line-style-btn:hover {
    border-color: var(--primary, #1e3a5f);
    color: var(--primary, #1e3a5f);
    background: #fff;
}

.receipt-line-posting-amount-cell .receipt-allocated-amount {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    min-width: 0;
    max-width: 6.25rem;
}

.receipt-line-amount-hint {
    display: block;
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

.receipt-subtotal-status {
    margin-left: 0.5rem;
    font-size: 0.9rem;
}

.receipt-subtotal-status--ok {
    color: #1e7e34;
}

.receipt-subtotal-status--warn {
    color: #c0392b;
}

.receipt-line-tip-fee .receipt-line-posting-amount-cell .receipt-allocated-amount,
.receipt-line-loyalty-reward .receipt-line-posting-amount-cell .receipt-allocated-amount,
.receipt-line-fx-fee .receipt-line-posting-amount-cell .receipt-allocated-amount {
    font-weight: 500;
}

/* ?????? Mobile progressive polish (phone + narrow tablet) ?????? */
@media (max-width: 640px) {
    .page {
        padding: 1rem 0.75rem 2rem;
    }
    /* Hide "Active client" label on mobile to save space. */
    .client-switcher__label {
        display: none;
    }
    /* Hint that wide report tables pan horizontally (shell stays viewport-width). */
    .report-table-scroll {
        background-image: linear-gradient(
            to left,
            rgba(255, 255, 255, 0.92),
            rgba(255, 255, 255, 0)
        );
        background-position: right center;
        background-size: 1.35rem 100%;
        background-repeat: no-repeat;
    }
    /* Avoid nested freeze scroll fighting the page on phones. */
    .report-table-scroll--freeze {
        max-height: none;
        overflow-x: auto;
        overflow-y: visible;
        scrollbar-gutter: auto;
    }
    .report-table-scroll--freeze thead th,
    .report-table-scroll--freeze thead th:first-child,
    .report-table-scroll--freeze .report-table tbody td:first-child,
    .report-table-scroll--freeze .report-table tfoot td:first-child {
        position: static;
        left: auto;
        top: auto;
        z-index: auto;
        box-shadow: none;
    }
    .report-table td.report-table__account-cell {
        padding-left: calc(0.25rem + var(--report-indent, 0) * 0.55rem);
    }
    .report-toolbar__heading {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.45rem 0.5rem;
        align-items: center;
        justify-items: stretch;
        text-align: left;
    }
    .report-toolbar__heading .report-toolbar__title {
        grid-column: 1;
        text-align: left;
    }
    .report-toolbar__icons {
        grid-column: 2;
        justify-self: end;
        flex-wrap: nowrap;
        flex-shrink: 0;
    }
    .report-toolbar__actions {
        justify-content: stretch;
        align-items: stretch;
    }
    .report-toolbar__actions .report-options {
        flex: 1 1 100%;
    }
    /* Keep date controls + Run on one compact row to save vertical space. */
    .report-options__row--primary {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: flex-end;
        justify-content: flex-start;
        gap: 0.35rem 0.4rem;
        padding-bottom: 0.15rem;
    }
    .report-options__row--primary > .report-options__field {
        width: auto;
        flex: 1 1 0;
        min-width: 0;
    }
    .report-options__row--primary > .report-options__field--date_range_preset {
        flex: 1.15 1 0;
        min-width: 5.5rem;
    }
    .report-options__row--primary > .report-options__field--start_date,
    .report-options__row--primary > .report-options__field--end_date,
    .report-options__row--primary > .report-options__field--as_of_date {
        flex: 0 1 auto;
        min-width: 6.25rem;
    }
    .report-options__row--primary > .report-options__actions {
        flex: 0 0 auto;
        align-self: flex-end;
    }
    .report-options__row--primary .report-options__field > label {
        white-space: nowrap;
        font-size: 0.68rem;
    }
    .report-options__row--primary .report-options__field input,
    .report-options__row--primary .report-options__field select,
    .report-options__row--primary .report-options__field--date_range_preset select,
    .report-options__row--primary .report-options__field--start_date input,
    .report-options__row--primary .report-options__field--end_date input,
    .report-options__row--primary .report-options__field--as_of_date input {
        width: 100%;
        min-width: 0;
        max-width: none;
        padding: 0.32rem 0.35rem;
        font-size: 0.8rem;
    }
    .report-options__row--primary .report-options__actions button {
        padding: 0.36rem 0.65rem;
        font-size: 0.82rem;
    }
    .ledger-balance-card .report-toolbar__actions {
        justify-content: flex-end;
        align-items: center;
    }
    .ledger-balance-card .report-toolbar__actions .report-options {
        flex: 0 1 auto;
    }
    .ledger-balance-toolbar-form .report-options__row--primary {
        align-items: center;
    }
    .ledger-balance-toolbar-form .report-options__row--primary > .report-options__actions {
        align-self: center;
    }
    .ledger-balance-toolbar-form .report-options__field--as_of_date input {
        width: 7.75rem;
        min-width: 7.75rem;
        max-width: 7.75rem;
        min-height: 1.85rem;
        height: 1.85rem;
    }
    .ledger-balance-toolbar-form .report-options__actions button {
        min-height: 1.85rem;
        padding: 0.22rem 0.6rem;
        font-size: 0.78rem;
    }
    .ledger-balance-open-items__selected {
        margin-left: 0;
    }
    .report-options__row:not(.report-options__row--primary):not(.report-options__row--secondary),
    .report-options__group {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }
    .report-options__row:not(.report-options__row--primary):not(.report-options__row--secondary) > .report-options__field,
    .report-options__group > .report-options__field {
        width: 100%;
        flex: 1 1 auto;
    }
    .report-options__row:not(.report-options__row--primary):not(.report-options__row--secondary) .report-options__field > label,
    .report-options__group .report-options__field > label {
        white-space: normal;
    }
    .report-options__row:not(.report-options__row--primary):not(.report-options__row--secondary) .report-options__field input,
    .report-options__row:not(.report-options__row--primary):not(.report-options__row--secondary) .report-options__field select,
    .report-options__group .report-options__field input,
    .report-options__group .report-options__field select {
        width: 100%;
        min-width: 0;
        max-width: none;
    }
    .report-options__row--secondary,
    .report-settings__pane .report-options__row,
    .report-settings__pane .report-options__group {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 0.5rem 0.65rem;
    }
    .report-settings__pane .report-options__field:not(.report-options__field--toggle):not(:has(> input[type="checkbox"])) {
        width: 100%;
        flex: 1 1 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.55rem 0.75rem;
    }
    .report-settings__pane .report-options__field:not(.report-options__field--toggle):not(:has(> input[type="checkbox"])) > label {
        flex: 0 0 auto;
        min-width: 5.25rem;
        white-space: nowrap;
    }
    .report-settings__pane .report-options__field--toggle,
    .report-settings__pane .report-options__field:has(> input[type="checkbox"]) {
        width: auto;
        flex: 0 1 auto;
        max-width: none;
    }
    .report-settings__pane .report-options__field:not(.report-options__field--toggle):not(:has(> input[type="checkbox"])) input,
    .report-settings__pane .report-options__field:not(.report-options__field--toggle):not(:has(> input[type="checkbox"])) select,
    .report-settings__pane .report-options__field:not(.report-options__field--toggle):not(:has(> input[type="checkbox"])) .ss-dropdown,
    .report-settings__pane .report-options__field:not(.report-options__field--toggle):not(:has(> input[type="checkbox"])) .ms-dropdown,
    .report-settings__pane .report-options__field--date_range_preset select,
    .report-settings__pane .report-options__field--start_date input,
    .report-settings__pane .report-options__field--end_date input,
    .report-settings__pane .report-options__field--as_of_date input {
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
    }
    .report-options__field--customer_qbo_id .ms-dropdown,
    .report-options__field--account_qbo_id .ms-dropdown,
    .report-options__field--filter_work_code .ms-dropdown,
    .report-options__field--filter_internal_work_code .ms-dropdown,
    .report-options__field--filter_project .ms-dropdown,
    .report-options__field--filter_vendor .ms-dropdown,
    .report-options__field--filter_transaction_type .ms-dropdown,
    .report-options__field--customer_qbo_id,
    .report-options__field--account_qbo_id,
    .report-options__field--filter_work_code,
    .report-options__field--filter_internal_work_code,
    .report-options__field--filter_employee,
    .report-options__field--filter_project,
    .report-options__field--filter_vendor,
    .report-options__field--filter_transaction_type {
        min-width: 0;
        width: 100%;
        max-width: none;
    }
    .report-options__hint {
        max-width: none;
    }
    .receipt-upload-form,
    .receipt-upload-form .form-field,
    .receipt-upload-form button[type="submit"] {
        width: 100%;
        max-width: none;
    }
    .receipt-upload-form button[type="submit"] {
        display: block;
    }
    .receipt-project-bulk {
        gap: 0.45rem;
    }
    .receipt-project-bulk__row {
        flex-wrap: nowrap;
        align-items: flex-end;
    }
    .receipt-bulk-project-field {
        flex: 1 1 0;
        width: auto;
        max-width: none;
        min-width: 0;
    }
    .receipt-project-bulk .receipt-bulk-project-select,
    .receipt-project-bulk .ss-dropdown {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: none;
    }
    /* Stacked cards already set min-width:0; do not force a desktop table width. */
    .table-scroll.table-scroll--stack > .receipt-line-table {
        table-layout: auto;
        min-width: 0 !important;
    }
    .receipt-vendor-dialog,
    .feedback-dialog {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
        margin: auto;
    }
    .form-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .form-actions > button,
    .form-actions > a {
        flex: 1 1 auto;
        min-height: 2.75rem;
        text-align: center;
    }
    .report-hub {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /*
     * Phone report tables: a sticky Account column with nowrap labels can be
     * wider than the remaining viewport, so Amount digits stay permanently
     * covered even at max horizontal scroll. Drop left-freeze on narrow
     * screens (keep sticky headers), let labels wrap, and protect amount width.
     */
    .report-table-scroll--freeze thead th:first-child {
        left: auto;
        box-shadow: 0 1px 0 var(--border);
    }
    .report-table-scroll--freeze .report-table tbody td:first-child,
    .report-table-scroll--freeze .report-table tfoot td:first-child,
    .gl-budget-edit-table.report-table-scroll--freeze thead th.gl-budget-edit-table__account,
    .gl-budget-edit-table.report-table-scroll--freeze tbody td.gl-budget-edit-table__account {
        position: static;
        left: auto;
        box-shadow: none;
    }
    .gl-budget-edit-table.report-table-scroll--freeze thead th.gl-budget-edit-table__account {
        position: sticky;
        top: 0;
        z-index: 2;
        box-shadow: 0 1px 0 var(--border);
    }
    .report-table__account-cell {
        white-space: normal;
        max-width: min(16rem, 62vw);
        line-height: 1.25;
        overflow-wrap: break-word;
    }
    .report-table .amount-col {
        min-width: 5.75rem;
        padding-right: 0.85rem;
        box-sizing: border-box;
    }
}

@media (max-width: 880px) {
    .app-nav__toggle-label {
        display: none;
    }
}

/* App-shell RTL (Arabic preferred language) */
[dir="rtl"] .header-right {
    margin-inline-start: auto;
}
[dir="rtl"] .account-menu__dropdown a,
[dir="rtl"] .account-menu__dropdown button[role="menuitem"],
[dir="rtl"] .account-menu__logout button {
    text-align: start;
}
@media (max-width: 880px) {
    [dir="rtl"] .app-nav__toggle {
        margin-inline-start: auto;
        margin-left: 0;
    }
    [dir="rtl"] .app-nav {
        right: auto;
        left: 0;
        border-left: 0;
        border-right: 1px solid var(--border);
        box-shadow: 8px 0 28px rgba(15, 23, 42, 0.12);
    }
    [dir="rtl"] .app-nav__submenu {
        padding: 0.25rem 0.45rem 0.25rem 0;
        border-left: 0;
        border-right: 2px solid #c8d8f7;
    }
}



/* Intercompany party mapping */
.ic-mapping-form .ic-mapping-org {
    margin: 1.25rem 0 0;
    padding: 0.85rem 1rem 1rem;
    border: 1px solid var(--border, #d8dee8);
    border-radius: 8px;
}
.ic-mapping-form .ic-mapping-org legend {
    padding: 0 0.35rem;
    font-weight: 600;
}
.ic-mapping-form .ic-mapping-org h5 {
    margin: 1rem 0 0.4rem;
    font-size: 0.95rem;
    font-weight: 600;
}
.ic-mapping-form .ic-mapping-org h5:first-of-type {
    margin-top: 0.35rem;
}
.ic-mapping-form details.help-toggle {
    margin-top: 0.85rem;
}
.ic-mapping-form details.help-toggle > summary {
    cursor: pointer;
    font-weight: 500;
}
.ic-mapping-form details.help-toggle[open] > summary {
    margin-bottom: 0.5rem;
}

/* ?? GMR pay-period report ?? */
.gmr-report {
    max-width: 100%;
    min-width: 0;
}
.gmr-report__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
}
.gmr-report__title-row h2 {
    margin-bottom: 0.35rem;
}
.gmr-report__exports {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.85rem;
    font-size: 0.92rem;
}
.gmr-report__nav {
    flex-wrap: wrap;
}
.gmr-print-header {
    display: none;
    margin-bottom: 0.75rem;
}
.report-print-target .gmr-print-header,
body.printing-report .gmr-print-header {
    display: block;
}
.gmr-print-header h2 {
    margin: 0 0 0.25rem;
}
.gmr-print-header .muted {
    margin: 0;
}
.gmr-compare {
    margin-bottom: 1rem;
}
.gmr-compare-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}
.gmr-compare-kicker {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.gmr-compare-kicker--paid {
    color: #4a5568;
}
.gmr-compare-kicker--should {
    color: #176b54;
}
.gmr-compare-pane--paid {
    border-top: 4px solid #64748b;
}
.gmr-compare-pane--should {
    background: #eef8f4;
    border-color: #b7d9cc;
    border-top: 4px solid #1f8a6e;
}
.gmr-compare-pane--should .gmr-summary-table thead th,
.gmr-compare-pane--should .gmr-detail-table-wrap,
.gmr-compare-pane--should .gmr-detail-table thead th,
.gmr-compare-pane--should .gmr-detail-table thead th:first-child,
.gmr-compare-pane--should .gmr-detail-table tbody td:first-child {
    background: #eef8f4;
}
.gmr-compare-pane--should .gmr-summary-table tfoot th {
    background: #d8efe6;
}
.gmr-compare-pane--should .gmr-detail-table .gmr-person-row td,
.gmr-compare-pane--should .gmr-detail-table .gmr-person-row td:first-child {
    background: #e3f3ec;
}
.gmr-compare-pane--should .gmr-detail-table .gmr-total-row th,
.gmr-compare-pane--should .gmr-detail-table .gmr-total-row th:first-child {
    background: #d8efe6;
}
.gmr-compare-pane--should .gmr-card--person,
.gmr-compare-pane--should .gmr-card--total {
    background: #e3f3ec;
}
.gmr-compare-pane--should .gmr-card--position {
    background: #f4fbf8;
}
.gmr-col--should {
    background: #eef8f4;
}
thead .gmr-col--should,
.gmr-print-variance thead .gmr-col--should {
    background: #d8efe6;
    color: #176b54;
}
.gmr-compare-pane--detail {
    min-width: 0;
}
.gmr-compare-pair--detail .gmr-detail {
    margin-bottom: 0;
}
@media (max-width: 1100px) {
    .gmr-compare-pair {
        grid-template-columns: 1fr;
    }
}
.gmr-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}
.gmr-summary-card {
    min-width: 0;
    margin-bottom: 0;
}
.gmr-summary-card h2 {
    font-size: 1.05rem;
}
.gmr-summary-scroll {
    max-height: 22rem;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.gmr-summary-table {
    width: 100%;
    border-collapse: collapse;
}
.gmr-summary-table th,
.gmr-summary-table td {
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.gmr-summary-table .num,
.gmr-detail-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.gmr-summary-table thead th {
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
    box-shadow: 0 1px 0 var(--border);
}
.gmr-summary-table tfoot th {
    border-top: 1px solid var(--border);
    background: #f4f7fd;
}

.gmr-detail {
    margin-bottom: 1.5rem;
    min-width: 0;
    max-width: 100%;
}
.gmr-detail__heading h2 {
    margin-bottom: 0.25rem;
}
.gmr-detail__heading .muted {
    margin-top: 0;
    margin-bottom: 0.75rem;
}
.gmr-detail-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}
.gmr-detail-table {
    width: 100%;
    min-width: 48rem;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
    table-layout: auto;
}
.gmr-detail-table th,
.gmr-detail-table td {
    padding: 0.28rem 0.4rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    line-height: 1.25;
}
.gmr-detail-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f4f7fd;
    box-shadow: 0 1px 0 var(--border);
    white-space: normal;
    max-width: 5.5rem;
    font-weight: 600;
    font-size: 0.72rem;
    line-height: 1.15;
    vertical-align: bottom;
}
.gmr-detail-table thead th:first-child {
    max-width: 12rem;
    min-width: 9rem;
    white-space: normal;
}
.gmr-detail-table thead th:first-child,
.gmr-detail-table tbody td:first-child,
.gmr-detail-table tfoot th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--border);
}
.gmr-detail-table thead th:first-child {
    z-index: 3;
    background: #f4f7fd;
}
.gmr-detail-table .gmr-person-row td {
    background: #f8fafc;
    font-weight: 600;
}
.gmr-detail-table .gmr-person-row td:first-child {
    background: #f8fafc;
}
.gmr-detail-table .gmr-person-row--collapsed td {
    font-weight: 500;
}
.gmr-detail-table .gmr-position-name {
    padding-left: 1.15rem;
    font-weight: 400;
    color: var(--muted);
}
.gmr-detail-table tfoot th {
    background: #eef2f8;
}
.gmr-detail-table tfoot th:first-child {
    background: #eef2f8;
    z-index: 2;
}
.gmr-detail-table .gmr-total-row th {
    background: #eef2f8;
    font-weight: 700;
    border-top: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
.gmr-detail-table .gmr-total-row th.num {
    text-align: right;
}
.gmr-detail-table .gmr-total-row th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #eef2f8;
    box-shadow: 1px 0 0 var(--border);
}

.gmr-detail--mobile {
    display: none;
}
.gmr-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--surface);
}
.gmr-card--person {
    box-shadow: var(--shadow);
}
.gmr-card--position {
    margin: 0.65rem 0 0;
    background: #f8fafc;
    box-shadow: none;
}
.gmr-card--total {
    background: #eef2f8;
}
.gmr-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-bottom: 0.55rem;
}
.gmr-card__header h3,
.gmr-card__header h4 {
    margin: 0;
    font-size: 1rem;
}
.gmr-card__header h4 {
    font-size: 0.95rem;
    font-weight: 600;
}
.gmr-card__rate {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
    white-space: nowrap;
}
.gmr-card__metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.75rem;
    margin: 0;
}
.gmr-card__metrics > div {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.2rem 0;
    border-bottom: 1px solid #eef2f8;
}
.gmr-card__metrics dt {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}
.gmr-card__metrics dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    text-align: right;
}
.gmr-cash-table-wrap {
    overflow-x: auto;
    max-width: 28rem;
    margin-bottom: 0.75rem;
}
.gmr-cash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.gmr-cash-table th,
.gmr-cash-table td {
    padding: 0.08rem 0.4rem;
    vertical-align: middle;
    line-height: 1.2;
}
.gmr-cash-table thead th {
    padding: 0.18rem 0.4rem;
    font-size: 0.72rem;
}
.gmr-cash-table tfoot th,
.gmr-cash-table tfoot td {
    border-bottom: none;
    font-weight: 700;
    padding: 0.28rem 0.4rem;
    background: #f4f7fd;
}
.gmr-cash-table .num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
input.gmr-cash-amount {
    width: 6.25rem;
    max-width: 100%;
    min-height: 0;
    height: 1.5rem;
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    font-size: 0.88rem;
    line-height: 1.2;
}
.gmr-paste-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem 1.25rem;
    margin-bottom: 0.75rem;
}
.gmr-paste-grid textarea {
    width: 100%;
    max-width: none;
    min-height: 7.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.35;
    resize: vertical;
}
@media (max-width: 1100px) {
    .gmr-paste-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .gmr-paste-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .gmr-summary-grid {
        grid-template-columns: 1fr;
    }
}
/* Flip to cards before the dense detail table needs horizontal scroll (~48rem). */
@media (max-width: 1100px) {
    .gmr-detail--desktop {
        display: none;
    }
    .gmr-detail--mobile {
        display: block;
        padding-right: 0.15rem;
    }
}

/* GMR print / PDF (report_export.js) */
body.printing-report .gmr-print-header {
    display: block;
    margin-top: 0;
    padding-top: 0;
}
body.printing-report .report-print-target > .gmr-print-header.report-print-header {
    margin-top: 0;
}
body.printing-report .gmr-summary-scroll,
body.printing-report .gmr-detail-table-wrap {
    max-height: none !important;
    overflow: visible !important;
}
body.printing-report .gmr-summary-grid {
    grid-template-columns: 1fr 1fr;
    break-inside: avoid;
}
body.printing-report .gmr-print-variance {
    margin-bottom: 0.75rem;
}
body.printing-report .gmr-print-variance h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}
body.printing-report .gmr-compare-pair {
    display: grid;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.55rem;
    align-items: stretch;
    break-inside: avoid;
    page-break-inside: avoid;
}
body.printing-report .gmr-compare-pair > * {
    margin-top: 0;
}
body.printing-report .gmr-compare-pair .gmr-summary-table td:first-child,
body.printing-report .gmr-compare-pair .gmr-summary-table th:first-child {
    white-space: nowrap;
}
body.printing-report .gmr-col--should {
    background: #eef8f4 !important;
}
body.printing-report thead .gmr-col--should {
    background: #d8efe6 !important;
    color: #176b54 !important;
}
/* Detail tables are wide; stack paid then should-have so fit-width stays readable. */
body.printing-report .gmr-compare-pair--detail {
    grid-template-columns: 1fr !important;
    break-inside: auto;
    page-break-inside: auto;
}
/* Keep natural table width so fit-width zoom can include Hourly cost. */
body.printing-report .gmr-detail-table {
    min-width: max-content;
    width: max-content;
    font-size: 0.7rem;
}
body.printing-report .gmr-detail-table thead th,
body.printing-report .gmr-detail-table tbody td:first-child,
body.printing-report .gmr-detail-table tbody th:first-child,
body.printing-report .gmr-detail-table tfoot th:first-child {
    position: static;
    box-shadow: none;
}
/* Avoid browser repeating <tfoot> at the bottom of every printed page. */
body.printing-report .gmr-summary-table tfoot,
body.printing-report .gmr-detail-table tfoot {
    display: table-row-group;
}
body.printing-report .gmr-detail--desktop {
    display: block !important;
}
body.printing-report .gmr-card,
body.printing-report .gmr-detail--mobile {
    display: none !important;
}
body.printing-report .gmr-summary-card {
    box-shadow: none;
    break-inside: avoid;
}
body.printing-report .gmr-detail-table .gmr-total-row {
    break-inside: avoid;
    page-break-inside: avoid;
}
@media print {
    body.printing-report .gmr-print-header {
        display: block;
    }
    body.printing-report .gmr-summary-table tfoot,
    body.printing-report .gmr-detail-table tfoot {
        display: table-row-group;
    }
}

/* Transaction worklist review (thumbs-up) controls */
.txn-worklist-review-col {
    width: 2.5rem;
    white-space: nowrap;
    text-align: center;
}
.txn-worklist-review-form {
    display: inline-flex;
    margin: 0;
}
.txn-worklist-review-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    min-width: 0;
    min-height: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}
.txn-worklist-review-btn:hover,
.txn-worklist-review-btn:focus {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}
.txn-worklist-review-btn.is-reviewed {
    color: #2563eb;
}
.txn-worklist-review-btn.is-reviewed:hover,
.txn-worklist-review-btn.is-reviewed:focus {
    color: #1d4ed8;
}
.txn-worklist-review-btn svg {
    width: 1.05rem;
    height: 1.05rem;
    display: block;
}
.report-toolbar__actions .txn-worklist-review-btn {
    width: 2.35rem;
    height: 2.35rem;
}
.report-toolbar__actions .txn-worklist-review-btn svg {
    width: 1.2rem;
    height: 1.2rem;
}
.txn-worklist-parse-btn {
    min-height: 2rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}
@media (max-width: 1200px) {
    .table-scroll.table-scroll--stack .txn-worklist-parse-btn {
        width: 100%;
    }
    .table-scroll.table-scroll--stack tbody td.txn-worklist-line-desc {
        flex: 1 1 100%;
        min-width: 100%;
        order: 5;
    }
    /* Keep thumbs-up on the card title row (after amount), not omitted. */
    .table-scroll.table-scroll--stack tbody td.txn-worklist-review-col {
        order: 2;
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
        text-align: right;
    }
}

/* Cash notes review cards */
.cash-note-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.cash-note-draft {
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    background: #fcfcfd;
}
.cash-note-draft__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin-bottom: 0.65rem;
}
.cash-note-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
}
.cash-note-list-actions .secondary {
    min-height: 0;
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
}
.cash-note-expense-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}
.cash-note-expense-head > label {
    margin: 0;
}
.cash-note-split-toggle {
    margin: 0;
    width: auto;
    flex-shrink: 0;
}
.cash-note-draft__include {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-weight: 500;
}
.cash-note-draft__amount {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    min-width: 0;
}
.cash-note-draft__amount input,
.cash-note-draft__amount select {
    width: auto;
    max-width: none;
    min-width: 0;
}
.cash-note-draft__amount input[type="text"] {
    width: 5.5rem;
}
.cash-note-draft__amount select {
    width: 5rem;
}
.cash-note-usd-equiv {
    white-space: nowrap;
}
.cash-note-draft__status {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.cash-note-draft__grid {
    margin-bottom: 0.35rem;
}
.cash-note-splits {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #d0d5dd;
}
.cash-note-split-row + .cash-note-split-row {
    margin-top: 0.5rem;
}
@media (min-width: 640px) {
    .cash-note-draft__amount {
        flex-wrap: nowrap;
    }
    .cash-note-draft__top > input[type="date"] {
        width: auto;
        max-width: none;
    }
}
@media (min-width: 900px) {
    .cash-note-draft__grid.form-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Bank / CC reconciliation match workspace */
.recon-matched-groups {
    margin: 0 0 0.75rem;
}
.recon-matched-groups > summary {
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}
.recon-matched-groups > summary .text-muted {
    font-weight: 400;
}
.match-groups td,
.match-groups th {
    vertical-align: top;
}
.match-groups .match-stmt {
    background: #f4f8ff;
}
.match-groups tr.match-group-start > td {
    border-top: 2px solid #b8c4d8;
}
.match-groups tr.match-group-cont > td {
    border-top-color: transparent;
}
.match-groups tr.match-split td {
    background-color: #fbfcff;
}
.match-groups tr.match-split .match-stmt {
    background: #e9f1ff;
}
.match-groups tr.match-unbalanced .match-stmt {
    background: #fff1ee;
}
.match-groups .match-warn {
    color: #b4232a;
    font-weight: 600;
}
.match-groups .match-tag {
    display: inline-block;
    padding: 0 0.4rem;
    border-radius: 0.5rem;
    background: #dbe7ff;
    font-size: 0.8rem;
}
.match-groups .match-meta {
    font-size: 0.85em;
}
@media (max-width: 1200px) {
    .table-scroll--stack .match-groups tr.match-group-start > td,
    .table-scroll--stack .match-groups tr.match-group-cont > td {
        border-top: none;
        background: transparent;
    }
    .table-scroll--stack .match-groups tr.match-split {
        background: #fbfcff;
        box-shadow: inset 4px 0 0 #93b0e8;
    }
    .table-scroll--stack .match-groups tr.match-unbalanced {
        background: #fff1ee;
        box-shadow: inset 4px 0 0 #b4232a;
    }
}
.bank-stmt-actions {
    white-space: nowrap;
}
.bank-stmt-actions .inline-form {
    display: inline;
}
.statement-files-list li {
    margin-bottom: 0.35rem;
}
.statement-files-list .inline-form {
    display: inline;
    margin-left: 0.5rem;
}
.statement-files-list .inline-form button,
.report-table .inline-form button:not(.missing-attachments-icon-btn) {
    min-height: 0;
    padding: 0.1rem 0.6rem;
    font-size: 0.85rem;
}
.bank-bulk-clear-form {
    margin-bottom: 0.5rem;
}
.bank-bulk-clear-form .text-muted {
    margin-left: 0.75rem;
}
.bank-manual-match-legend {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}
.bank-manual-match-list {
    max-height: 16rem;
    overflow: auto;
    border: 1px solid #c5cdd8;
    border-radius: 8px;
    padding: 0.35rem 0.55rem 0.5rem;
    background: #fff;
}
.bank-manual-match-list .bank-manual-match-heading {
    margin: 0.45rem 0 0.2rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #5b6573;
}
.bank-manual-match-list label {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0;
    padding: 0.2rem 0;
    font-weight: 400;
    cursor: pointer;
}
.bank-manual-match-list input[type="checkbox"] {
    width: auto;
    max-width: none;
    min-width: 1rem;
    margin: 0.2rem 0 0;
    padding: 0;
    flex: 0 0 auto;
}
#manual-match-summary {
    margin: 0.35rem 0 0;
}
#manual-match-summary.is-unbalanced {
    color: #b4232a;
}
.bank-stmt-dialog {
    max-width: 32rem;
    width: calc(100% - 2rem);
    padding: 1.25rem;
    border: 1px solid #c5cdd8;
    border-radius: 8px;
}
.bank-stmt-dialog h3 {
    margin-top: 0;
}
.bank-stmt-dialog #bank-stmt-summary {
    margin-bottom: 0.75rem;
}
.list-plain {
    margin: 0;
    padding-left: 1.1rem;
}
.uf-writeoff-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin: 0 0 0.65rem;
}
.uf-writeoff-toolbar__select-all {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-weight: 600;
}
.uf-writeoff-toolbar__selected {
    margin: 0 0 0 auto;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}
.uf-writeoff-table__select-col {
    width: 3.25rem;
}
.uf-writeoff-form {
    margin-top: 1rem;
}
.uf-writeoff-form h3 {
    margin: 0 0 0.65rem;
}

.am-table__hint {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
}
.am-amount-btn {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    min-height: 0;
    font: inherit;
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    white-space: nowrap;
}
.am-amount-btn:hover {
    color: #1e3a8a;
}
.loan-am-dialog {
    max-width: 32rem;
}
.loan-am-dialog .form-grid {
    margin-bottom: 0.75rem;
}
.report-table tr.is-best-fit td {
    background: #f0fdf4;
}


/* Estimate import preview */
.estimate-import-totals {
    margin: 0.75rem 0 1rem;
}
.estimate-import-row--excluded {
    opacity: 0.45;
}
.estimate-import-preview-table input[type="text"] {
    width: 100%;
    min-width: 4.5rem;
    box-sizing: border-box;
}

/* Estimate detail — aligned numeric / type columns */
.estimate-detail-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}
.estimate-detail-table th,
.estimate-detail-table td {
    vertical-align: top;
    overflow: hidden;
    text-overflow: ellipsis;
}
.estimate-detail-table .num,
.estimate-detail-table th.num,
.estimate-detail-table td.num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.estimate-detail-table__scope { width: 16%; }
.estimate-detail-table__desc { width: 22%; }
.estimate-detail-table__type { width: 12%; }
.estimate-detail-table__vendor { width: 14%; }
.estimate-detail-table__amount { width: 10%; }
.estimate-detail-table__pct { width: 8%; }
.estimate-detail-table__notes { width: 8%; }
.estimate-detail-table__actions { width: 8%; }
.estimate-detail-table__actions-row td {
    padding-top: 0.15rem;
    padding-bottom: 0.75rem;
    border-top: 0;
    font-size: 0.9rem;
}
.estimate-detail-table__row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
    align-items: center;
}
.estimate-detail-table__row-actions form {
    display: inline;
}
.estimate-detail-table__row-actions button.secondary {
    min-height: 0;
    padding: 0.15rem 0.4rem;
    font-size: 0.85rem;
}
@media (max-width: 1200px) {
    .estimate-detail-table {
        table-layout: auto;
    }
}

.reclassify-page {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.reclassify-layout {
    display: grid;
    grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}
.reclassify-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
}
.reclassify-basis {
    border: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}
.reclassify-basis legend {
    font-size: 0.82rem;
    font-weight: 600;
    color: #2b3e62;
    margin-bottom: 0.25rem;
}
.reclassify-basis__option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
}
.reclassify-accounts {
    max-height: 28rem;
    min-width: 0;
}
.reclassify-accounts table {
    width: 100%;
}
.reclassify-accounts td,
.reclassify-accounts th {
    overflow: hidden;
}
.reclassify-accounts td:first-child {
    max-width: 13rem;
}
.reclassify-account-pick {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary, #0f766e);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    min-height: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.reclassify-account-pick:hover {
    background: transparent;
    color: var(--primary, #0f766e);
    text-decoration: underline;
}
.reclassify-accounts__type {
    display: block;
    font-size: 0.78rem;
}
.reclassify-accounts tr.is-selected > td {
    background: #e8f3f1;
}
.reclassify-filters__find {
    display: flex;
    align-items: flex-end;
}
.reclassify-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    margin: 0.65rem 0 0;
    padding: 0;
}
.reclassify-pills li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #eef4ff;
    border: 1px solid #d5e2f7;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.85rem;
}
.reclassify-pills__clear {
    color: inherit;
    text-decoration: none;
    font-size: 1.1rem;
    line-height: 1;
    min-height: 0;
    padding: 0;
}
.reclassify-bulk {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin: 0.35rem 0 0.65rem;
}
.reclassify-bulk p {
    margin: 0;
}
.reclassify-dest {
    display: grid;
    grid-template-columns: minmax(12rem, 28rem) auto;
    gap: 0.75rem 1rem;
    align-items: end;
    margin: 0 0 0.75rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border, #d5e2f7);
    border-radius: 8px;
    background: #f8fbff;
}
.reclassify-dest[hidden] {
    display: none;
}
.reclassify-dest .form-actions {
    margin: 0;
}
.reclassify-table {
    min-width: 0;
}
.reclassify-table table {
    width: max-content;
    min-width: 100%;
}
.reclassify-table th,
.reclassify-table td {
    overflow: hidden;
    text-overflow: ellipsis;
}
.reclassify-table__check {
    width: 2rem;
    text-align: center;
}
.reclassify-table__check input {
    min-height: 0;
}
.reclassify-apply {
    min-width: 0;
}
@media (max-width: 1100px) {
    .reclassify-layout {
        grid-template-columns: 1fr;
    }
    .reclassify-accounts {
        max-height: 16rem;
    }
    .reclassify-dest {
        grid-template-columns: 1fr;
    }
}
