:root {
    --background: #f3f5f7;
    --surface: #ffffff;
    --text: #20252b;
    --muted: #69727d;
    --border: #d7dde3;
    --primary: #315f78;
    --primary-dark: #24495d;
    --danger: #a53030;
    --success: #2f6e45;
    --warning: #8b6516;
    --radius: 8px;
    --shadow: 0 6px 20px rgba(20, 35, 45, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--background);
}

body {
    margin: 0;
    min-height: 100vh;
}

a {
    color: var(--primary);
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: #1f2c34;
    color: #fff;
}

.header-inner {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.35rem;
    font-weight: 700;
}

.signed-in {
    color: #a9c7d6;
    font-size: 0.92rem;
}

.signed-in-label {
    color: #a9c7d6;
}

.signed-in-name {
    color: #c9e2ee;
    font-weight: 700;
}

.main-nav {
    background: #2d3c45;
}

.nav-inner {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 5px;
    padding-bottom: 5px;
    flex-wrap: wrap;
}

.main-nav a,
.nav-button {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: #fff;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}

.main-nav a:hover,
.nav-button:hover {
    background: rgba(255, 255, 255, 0.10);
}

.logout-form {
    margin-left: auto;
}

.main-content {
    padding-top: 30px;
    padding-bottom: 50px;
}

h1,
h2,
h3 {
    margin-top: 0;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.grid {
    display: grid;
    gap: 20px;
}

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

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

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.stat-label {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-row-full {
    grid-column: 1 / -1;
}

label {
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #bcc6ce;
    border-radius: 6px;
    padding: 9px 11px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(49, 95, 120, 0.18);
    border-color: var(--primary);
}

.help-text {
    color: var(--muted);
    font-size: 0.86rem;
}

.button-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

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

.button-secondary {
    background: #fff;
    color: var(--primary);
}

.button-danger {
    border-color: var(--danger);
    background: var(--danger);
}

.notice {
    border-radius: 6px;
    padding: 13px 15px;
    margin-bottom: 20px;
    border: 1px solid;
}

.notice-success {
    color: #245535;
    background: #eaf6ed;
    border-color: #b9ddc2;
}

.notice-error {
    color: #7f2525;
    background: #fbecec;
    border-color: #e4b8b8;
}

.notice-warning {
    color: #694d11;
    background: #fff7dc;
    border-color: #ead795;
}

.error-list {
    margin: 0;
    padding-left: 20px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: #48535d;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.status-active {
    color: #245535;
    background: #e4f2e8;
}

.status-suspended {
    color: #7f2525;
    background: #f6e2e2;
}

.auth-shell {
    width: min(520px, calc(100% - 32px));
    margin: 55px auto;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
}

.auth-card > h1 {
    margin-bottom: 24px;
}

.auth-card .form-row {
    margin-bottom: 17px;
}

.site-footer {
    color: var(--muted);
    padding: 24px 0 38px;
    text-align: center;
    font-size: 0.88rem;
}

.app-footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.footer-credit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 620px) {
    .site-footer {
        padding: 22px 0 30px;
    }

    .app-footer-inner {
        flex-direction: column;
        gap: 4px;
        line-height: 1.5;
    }

    .footer-separator {
        display: none;
    }
}

.inline-form {
    display: inline;
}

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

.small-button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.88rem;
}



button:disabled,
input:disabled,
select:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.status-inactive {
    color: #59616a;
    background: #e9edf0;
}

.money {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.money-negative {
    color: var(--danger);
}

.account-limit-summary {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    padding: 10px 14px;
    color: var(--muted);
    white-space: nowrap;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-heading h2,
.section-heading p {
    margin-bottom: 0;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
}

.checkbox-row input {
    width: 19px;
    min-height: 19px;
    height: 19px;
    margin: 0;
}

.danger-zone {
    border-color: #dfb4b4;
}

.stat-limit {
    color: var(--muted);
    font-size: 1rem;
    font-weight: 400;
}

.account-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.account-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 92px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.account-card:hover {
    border-color: #9babb6;
    box-shadow: 0 5px 14px rgba(20, 35, 45, 0.08);
}

.account-card-name {
    margin-bottom: 5px;
    font-weight: 700;
}

.account-card-type {
    color: var(--muted);
    font-size: 0.88rem;
}

.account-card-balance {
    font-size: 1.25rem;
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}



.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.transaction-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.search-wide {
    grid-column: span 2;
}

.register-card {
    padding-left: 18px;
    padding-right: 18px;
}

.register-table {
    min-width: 1120px;
}

.register-table th,
.register-table td {
    padding-left: 8px;
    padding-right: 8px;
}

.status-uncleared {
    color: #59616a;
    background: #e9edf0;
}

.status-cleared {
    color: #235673;
    background: #e1eff7;
}

.status-reconciled {
    color: #245535;
    background: #e4f2e8;
}

.result-limit-notice {
    margin-top: 20px;
    margin-bottom: 0;
}



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

.reconciliation-summary {
    margin-bottom: 24px;
}

.difference-card {
    border-width: 2px;
}

.difference-zero {
    border-color: #77b486;
    background: #f3faf5;
}

.difference-open {
    border-color: #d7a0a0;
    background: #fff7f7;
}

.difference-open .stat-value {
    color: var(--danger);
}

.selection-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.reconcile-table {
    min-width: 980px;
}

.reconcile-table .select-column {
    width: 72px;
    text-align: center;
}

.reconcile-checkbox {
    width: 20px;
    min-height: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
}

.reconcile-select-all-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.reconcile-select-all-label input {
    width: 20px;
    min-height: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
}

.detail-list > div {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.detail-list dt {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 0;
    font-weight: 700;
}



.status-completed {
    color: #245535;
    background: #e4f2e8;
}

.status-reopened {
    color: #7a3e10;
    background: #fff0dc;
}



.form-row-span-2 {
    grid-column: span 2;
}

.is-hidden {
    display: none !important;
}

.split-editor {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #f8fafb;
}

.split-editor h3 {
    margin: 0 0 4px;
}

.split-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.2fr) minmax(130px, 0.65fr) minmax(220px, 1.5fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px 0;
    border-top: 1px solid var(--border);
}

.split-row:first-child {
    border-top: 0;
}

.split-remove-cell {
    padding-bottom: 1px;
}

.split-summary {
    display: flex;
    justify-content: flex-end;
    gap: 24px;
    margin-top: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}

.snapshot-split-list {
    margin: 7px 0 0;
    padding-left: 18px;
}

.snapshot-split-list li + li {
    margin-top: 4px;
}

.snapshot-table {
    min-width: 1040px;
}

@media (max-width: 780px) {
    .grid-2,
    .grid-3,
    .grid-4,
    .form-grid,
    .account-card-grid,
    .transaction-form-grid,
    .search-grid,
    .detail-list {
        grid-template-columns: 1fr;
    }

    .search-wide {
        grid-column: auto;
    }

    .form-row-full,
    .form-row-span-2 {
        grid-column: auto;
    }

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

    .split-remove-cell {
        padding-bottom: 0;
    }

    .split-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .signed-in {
        display: none;
    }

    .logout-form {
        margin-left: 0;
    }
}


@media (max-width: 560px) {
    .account-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .account-limit-summary {
        white-space: normal;
    }
}

/* Phase 7: horizontal transaction entry and visual polish */
:root {
    --background: #eef2f5;
    --surface: #ffffff;
    --surface-soft: #f7f9fb;
    --text: #1f2930;
    --muted: #66727c;
    --border: #d4dde3;
    --border-strong: #b9c6cf;
    --primary: #315f78;
    --primary-hover: #193f54;
    --secondary-hover: #2b4f63;
    --danger: #a53030;
    --danger-hover: #7b1f1f;
    --radius: 9px;
    --shadow: 0 5px 18px rgba(24, 42, 53, 0.07);
    --shadow-hover: 0 8px 22px rgba(24, 42, 53, 0.12);
}

body {
    color: var(--text);
    line-height: 1.45;
}

.page-shell {
    width: min(1480px, calc(100% - 36px));
}

.main-content {
    padding-top: 32px;
    padding-bottom: 54px;
}

h1 {
    margin-bottom: 5px;
    font-size: clamp(1.65rem, 2.2vw, 2.15rem);
    line-height: 1.15;
}

h2 {
    margin-bottom: 18px;
    font-size: 1.25rem;
}

h3 {
    margin-bottom: 12px;
}

p {
    margin-top: 0;
}

.page-heading {
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 24px;
}

.page-heading p {
    margin: 0;
    color: var(--muted);
}

.page-actions,
.actions,
.button-row,
.selection-actions {
    gap: 9px;
}

.card {
    padding: 26px;
    margin-bottom: 24px;
    border-color: var(--border);
    box-shadow: var(--shadow);
}

.card > :last-child {
    margin-bottom: 0;
}

.grid {
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 22px;
    box-shadow: var(--shadow);
}

.form-grid,
.transaction-form-grid,
.search-grid,
.detail-list {
    gap: 17px 18px;
}

.form-row {
    gap: 6px;
    min-width: 0;
}

label {
    color: #34424c;
    font-size: 0.88rem;
    line-height: 1.2;
}

input,
select,
textarea {
    min-height: 42px;
    border-color: var(--border-strong);
    padding: 9px 11px;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
    border-color: #8fa1ad;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(49, 95, 120, 0.17);
}

.help-text {
    line-height: 1.35;
}

.button,
button.button {
    min-height: 41px;
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(18, 38, 49, 0.08);
    transition: background 130ms ease, border-color 130ms ease, color 130ms ease,
        box-shadow 130ms ease, transform 130ms ease;
}

.button:hover,
button.button:hover {
    border-color: var(--primary-hover);
    background: var(--primary-hover);
    color: #fff;
    box-shadow: 0 4px 10px rgba(18, 38, 49, 0.18);
    transform: translateY(-1px);
}

.button:focus-visible,
button.button:focus-visible,
.nav-button:focus-visible,
.main-nav a:focus-visible {
    outline: 3px solid rgba(74, 151, 191, 0.38);
    outline-offset: 2px;
}

.button-secondary,
button.button-secondary {
    border-color: #8fa5b2;
    background: #f8fafb;
    color: #24495d;
}

.button-secondary:hover,
button.button-secondary:hover {
    border-color: var(--secondary-hover);
    background: var(--secondary-hover);
    color: #fff;
}

.button-danger,
button.button-danger {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

.button-danger:hover,
button.button-danger:hover {
    border-color: var(--danger-hover);
    background: var(--danger-hover);
    color: #fff;
}

.button:disabled,
button.button:disabled,
.button:disabled:hover,
button.button:disabled:hover {
    box-shadow: none;
    transform: none;
}

.main-nav a,
.nav-button {
    transition: background 120ms ease, color 120ms ease;
}

.main-nav a:hover,
.nav-button:hover {
    background: #4b6473;
    color: #fff;
}

.section-heading {
    align-items: center;
    margin-bottom: 18px;
}

.table-wrap {
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
}

table {
    background: #fff;
}

th {
    padding-top: 11px;
    padding-bottom: 11px;
    background: #f4f7f9;
    color: #46545e;
}

td {
    padding-top: 12px;
    padding-bottom: 12px;
}

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

tbody tr:hover td {
    background: #f8fafb;
}

.notice {
    line-height: 1.45;
}

.account-card {
    box-shadow: 0 1px 3px rgba(24, 42, 53, 0.04);
}

.account-card:hover {
    border-color: #7f98a7;
    box-shadow: var(--shadow-hover);
}

/* Balanced horizontal transaction entry. */
.transaction-entry-card {
    overflow: visible;
}

.transaction-entry-card > h2 {
    margin-bottom: 14px;
}

.transaction-entry-tabs {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    margin: 0 0 22px;
    border-bottom: 1px solid var(--border);
}

.transaction-entry-tab {
    appearance: none;
    position: relative;
    margin: 0 0 -1px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-bottom-color: var(--border);
    border-radius: 6px 6px 0 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.transaction-entry-tab:hover {
    color: var(--text);
    background: rgba(184, 135, 59, 0.08);
}

.transaction-entry-tab.is-active {
    border-color: var(--border);
    border-bottom-color: var(--surface);
    background: var(--surface);
    color: var(--bronze-dark);
}

.transaction-entry-tab:focus-visible {
    outline: 3px solid rgba(184, 135, 59, 0.28);
    outline-offset: 2px;
}

.transaction-entry-panel[hidden] {
    display: none !important;
}

.transfer-current-account {
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin: 0 0 18px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--surface-soft);
}

.register-transfer-memo {
    grid-column: span 3;
}

.transaction-entry-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 18px;
    align-items: end;
}


.transaction-entry-grid > *,
.transaction-entry-options > * {
    min-width: 0;
}

.transaction-entry-options {
    flex-wrap: wrap;
}

.transaction-entry-grid .form-row {
    height: 100%;
    justify-content: flex-end;
}

.transaction-entry-grid input,
.transaction-entry-grid select {
    min-height: 40px;
    padding: 8px 9px;
}

.transaction-field-credit-debit {
    grid-column: span 2;
    height: 100%;
}

.transaction-amount-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    height: 100%;
    align-items: end;
}

.transaction-field-credit input,
.transaction-field-debit input {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.transaction-entry-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 36px;
    margin-top: 13px;
    padding-top: 13px;
    border-top: 1px solid #e1e7eb;
}

.transaction-entry-options .checkbox-row {
    flex: 0 0 auto;
}

.transaction-category-help {
    text-align: right;
}

.transaction-entry-card .button-row {
    justify-content: flex-end;
    margin-top: 18px;
    padding-top: 17px;
    border-top: 1px solid #e1e7eb;
}

.split-editor {
    margin-top: 16px;
    padding: 18px 20px;
    border-color: #cbd6dc;
    background: var(--surface-soft);
}

.split-row {
    gap: 14px;
}

.split-summary {
    padding: 13px 2px 0;
}

.register-card {
    padding: 20px;
}

.register-table th,
.register-table td {
    padding-left: 10px;
    padding-right: 10px;
}


@media (max-width: 960px) {
    .page-shell {
        width: min(1480px, calc(100% - 28px));
    }

    .transaction-entry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .transaction-form-grid,
    .search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .transaction-entry-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .transaction-category-help {
        text-align: left;
    }
}

@media (max-width: 780px) {
    .card {
        padding: 21px;
    }

    .page-heading {
        align-items: flex-start;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .button {
        flex: 1 1 auto;
    }

    .transaction-entry-card .button-row {
        justify-content: flex-start;
    }

    .table-wrap {
        border-radius: 5px;
    }
}

@media (max-width: 620px) {
    .page-shell {
        width: min(1480px, calc(100% - 20px));
    }

    .main-content {
        padding-top: 22px;
    }

    .card,
    .stat-card {
        padding: 18px;
    }

    .transaction-entry-grid,
    .transaction-form-grid,
    .search-grid {
        grid-template-columns: 1fr;
    }

    .transaction-field-credit-debit,
    .register-transfer-memo {
        grid-column: auto;
    }

    .transaction-entry-tabs {
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
        border-bottom: 0;
    }

    .transaction-entry-tab {
        margin: 0;
        border: 1px solid var(--border);
        border-radius: 5px;
        text-align: left;
    }

    .transaction-entry-tab.is-active {
        border-color: var(--bronze);
        background: rgba(184, 135, 59, 0.1);
    }

    .transfer-current-account {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .button-row,
    .page-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .button-row .button,
    .page-actions .button {
        width: 100%;
    }
}


/* Phase 8 reports */
.report-page-heading {
    align-items: flex-start;
}

.report-filter-card {
    padding-top: 20px;
    padding-bottom: 20px;
}

.report-filter-grid {
    display: grid;
    grid-template-columns: minmax(155px, 0.8fr) minmax(155px, 0.8fr) minmax(220px, 1.3fr) auto;
    gap: 16px;
    align-items: end;
}

.report-filter-actions,
.report-export-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.report-summary-grid {
    margin-bottom: 24px;
}

.report-stat-card {
    position: relative;
    overflow: hidden;
}

.report-stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: #758895;
}

.report-income-card::before,
.report-net-card::before {
    background: var(--success);
}

.report-expense-card::before,
.report-negative-card::before {
    background: var(--danger);
}

.report-stat-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.82rem;
}

.money-positive {
    color: var(--success);
}

.report-section {
    scroll-margin-top: 18px;
}

.report-section-heading {
    gap: 18px;
}

.report-section-heading h2,
.report-panel h3 {
    margin-bottom: 5px;
}

.report-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.report-panel {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-soft, #f8fafb);
}

.category-report-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 18px;
}

.category-report-row {
    min-width: 0;
}

.category-report-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.category-report-heading span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.category-report-heading strong {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}

.category-report-meta {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.8rem;
}

.report-bar-track {
    width: 100%;
    height: 8px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #dde4e8;
}

.report-bar {
    min-width: 2px;
    height: 100%;
    border-radius: inherit;
}

.report-bar-income {
    background: var(--success);
}

.report-bar-expense {
    background: var(--danger);
}

.report-table {
    min-width: 760px;
}

.report-table tfoot th,
.report-table tfoot td {
    padding-top: 13px;
    padding-bottom: 13px;
    border-top: 2px solid #aebbc3;
    background: #eef3f5;
}

.balance-history-table {
    min-width: 860px;
}

.balance-history-table th:not(:first-child),
.balance-history-table td:not(:first-child) {
    text-align: right;
}

.transaction-report-table {
    min-width: 1100px;
}

.empty-state {
    margin: 18px 0 0;
    padding: 18px;
    border: 1px dashed #bbc6cc;
    border-radius: 6px;
    background: #fff;
    color: var(--muted);
}

@media (max-width: 1180px) {
    .report-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .report-filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 780px) {
    .report-filter-grid,
    .report-two-column,
    .report-summary-grid {
        grid-template-columns: 1fr;
    }

    .report-filter-actions,
    .report-export-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .report-filter-actions .button,
    .report-export-actions .button {
        width: 100%;
    }

    .category-report-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

@media print {
    @page {
        margin: 0.45in;
    }

    html,
    body {
        background: #fff;
    }

    body {
        color: #000;
        font-size: 10pt;
    }

    .site-header,
    .main-nav,
    .site-footer,
    .no-print {
        display: none !important;
    }

    .page-shell {
        width: 100%;
        max-width: none;
    }

    .main-content {
        padding: 0;
    }

    .page-heading {
        margin-bottom: 14px;
    }

    .card,
    .stat-card,
    .report-panel {
        break-inside: avoid;
        box-shadow: none;
        border-color: #aaa;
    }

    .card {
        margin-bottom: 14px;
        padding: 14px;
    }

    .stat-card {
        padding: 12px;
    }

    .report-summary-grid,
    .report-two-column {
        gap: 10px;
    }

    .report-summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .table-wrap {
        overflow: visible;
        border-color: #aaa;
    }

    .report-table,
    .balance-history-table,
    .transaction-report-table {
        min-width: 0;
        width: 100%;
        font-size: 8pt;
    }

    th,
    td {
        padding: 5px 6px;
    }

    tbody tr:hover td {
        background: transparent;
    }

    a {
        color: #000;
        text-decoration: none;
    }
}

/* Phase 9 scheduled transactions */
.dashboard-scheduled-card {
    color: inherit;
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-scheduled-card:hover {
    transform: translateY(-2px);
    border-color: #9fb1bc;
    box-shadow: 0 9px 24px rgba(20, 35, 45, 0.12);
}

.scheduled-summary-grid {
    margin-bottom: 24px;
}

.scheduled-overdue-card,
.scheduled-due-card {
    position: relative;
    overflow: hidden;
}

.scheduled-overdue-card::before,
.scheduled-due-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
}

.scheduled-overdue-card::before {
    background: var(--danger);
}

.scheduled-due-card::before {
    background: var(--warning);
}

.recurring-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.recurring-form-grid > * {
    min-width: 0;
}

.recurring-field-name,
.recurring-field-payee,
.recurring-field-memo {
    grid-column: span 2;
}

.recurring-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 18px 0 4px;
}

.scheduled-table {
    min-width: 1180px;
}

.scheduled-table th:last-child,
.scheduled-table td:last-child {
    width: 250px;
}

.scheduled-actions {
    display: grid;
    grid-template-columns: repeat(2, 112px);
    align-items: stretch;
    gap: 8px;
}

.scheduled-actions form {
    width: 100%;
    margin: 0;
}

.scheduled-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 36px;
    padding-left: 8px;
    padding-right: 8px;
    text-align: center;
}

.scheduled-row-overdue td {
    background: #fff9f9;
}

.status-overdue {
    color: #7f2525;
    background: #f6e2e2;
}

.status-due {
    color: #694d11;
    background: #fff1c7;
}

.status-upcoming,
.status-scheduled {
    color: #24495d;
    background: #e4eef3;
}

.status-posted {
    color: #245535;
    background: #e4f2e8;
}

.status-skipped {
    color: #59616a;
    background: #e9edf0;
}

.status-scheduled {
    margin-top: 5px;
    padding-top: 3px;
    padding-bottom: 3px;
    font-size: 0.74rem;
}

.scheduled-history-table {
    min-width: 880px;
}

@media (max-width: 1080px) {
    .recurring-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-summary-grid,
    .scheduled-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .recurring-form-grid,
    .dashboard-summary-grid,
    .scheduled-summary-grid {
        grid-template-columns: 1fr;
    }

    .recurring-field-name,
    .recurring-field-payee,
    .recurring-field-memo {
        grid-column: auto;
    }

    .recurring-options {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Phase 10 category hierarchy */
.category-management-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 22px;
    align-items: stretch;
    margin-bottom: 24px;
}

.category-management-grid > .card {
    margin-bottom: 0;
}

.starter-category-card {
    display: flex;
    flex-direction: column;
}

.starter-category-card form {
    margin-top: auto;
    padding-top: 12px;
}

.category-count {
    flex: 0 0 auto;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #f5f8f9;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.category-table {
    min-width: 780px;
}

.parent-category-row td {
    background: #f8fafb;
}

.parent-category-row strong {
    font-size: 0.98rem;
}

.subcategory-row td:first-child {
    padding-left: 28px;
}

.category-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.category-name-cell.is-subcategory strong {
    font-weight: 600;
}

.subcategory-branch {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 1rem;
}

.status-default {
    background: #e8eef9;
    color: #274d88;
}

.notice-info {
    border-color: #9db6d8;
    background: #eef5ff;
    color: #24466f;
}

@media (max-width: 900px) {
    .category-management-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .category-management-grid {
        gap: 16px;
    }
}

/* Phase 11 payee memory and backups */
.payee-memory-field {
    position: relative;
}

.payee-memory-control,
.inline-autocomplete-control {
    position: relative;
    min-width: 0;
    border-radius: 6px;
    background: #fff;
}

.inline-autocomplete-control input {
    position: relative;
    z-index: 2;
    background: transparent;
}

.inline-autocomplete-ghost {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: transparent;
    font: inherit;
    line-height: normal;
    pointer-events: none;
    white-space: pre;
}

.inline-autocomplete-ghost[hidden] {
    display: none;
}

.inline-autocomplete-ghost-content {
    display: inline-flex;
    flex: 0 0 auto;
    min-width: max-content;
    will-change: transform;
}

.inline-autocomplete-prefix {
    visibility: hidden;
    white-space: pre;
}

.inline-autocomplete-suffix {
    color: #8a949d;
    white-space: pre;
}

.status-warning {
    color: #6b4a09;
    background: #fff0bd;
}

.backup-card {
    width: 100%;
    max-width: none;
}

.backup-section-heading {
    align-items: flex-start;
}

.backup-summary-grid {
    margin: 20px 0;
}

.backup-summary-item {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #f7f9fa;
}

.backup-summary-item span,
.backup-summary-item strong {
    display: block;
}

.backup-summary-item span {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.84rem;
}

.backup-summary-item strong {
    overflow-wrap: anywhere;
    font-size: 1.05rem;
}

.backup-warning {
    margin-top: 18px;
}

@media (max-width: 780px) {
    .backup-summary-grid {
        grid-template-columns: 1fr;
    }
}


/* Phase 12 sortable tables and paused reconciliation */
th.sortable-column {
    padding: 0;
}

.table-sort-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    padding: 11px 10px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-align: left;
    text-transform: inherit;
    cursor: pointer;
}

.register-table .table-sort-button {
    padding-left: 8px;
    padding-right: 8px;
}

.reconcile-table .select-column .table-sort-button {
    justify-content: center;
}

.table-sort-button:hover,
.table-sort-button:focus-visible {
    background: #e6edf1;
    color: #243846;
}

.table-sort-button:focus-visible {
    outline: 2px solid #2f6f92;
    outline-offset: -2px;
}

.table-sort-label {
    min-width: 0;
}

.table-sort-indicator {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    opacity: 0.32;
}

.table-sort-indicator {
    border-top: 6px solid currentColor;
}

th[aria-sort="ascending"] .table-sort-indicator {
    border-top: 0;
    border-bottom: 6px solid currentColor;
    opacity: 1;
}

th[aria-sort="descending"] .table-sort-indicator {
    border-top: 6px solid currentColor;
    border-bottom: 0;
    opacity: 1;
}

.reconciliation-paused-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.reconciliation-paused-notice > div:first-child {
    min-width: 0;
}

.compact-button-row {
    flex: 0 0 auto;
    margin: 0;
}

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

@media (max-width: 780px) {
    .reconciliation-paused-notice {
        align-items: stretch;
        flex-direction: column;
    }

    .reconciliation-paused-notice > .button,
    .reconciliation-paused-notice .compact-button-row,
    .reconciliation-paused-notice .compact-button-row .button,
    .reconciliation-paused-notice .inline-form {
        width: 100%;
    }
}


/* Phase 13 optional monthly budgets */
.sr-only {
    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;
}

.budget-page-heading {
    align-items: flex-start;
}

.month-navigation,
.budget-month-form {
    display: flex;
    align-items: center;
    gap: 9px;
}

.budget-month-form {
    margin: 0;
}

.budget-month-form input[type="month"] {
    min-width: 168px;
}

.budget-summary-grid {
    margin-bottom: 24px;
}

.budget-stat-card {
    position: relative;
    overflow: hidden;
}

.budget-stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: #758895;
}

.budget-stat-near::before {
    background: #c18416;
}

.budget-stat-over::before {
    background: var(--danger);
}

.budget-stat-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.82rem;
}

.budget-management-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
    gap: 22px;
    margin-bottom: 24px;
}

.budget-management-grid > .card {
    margin-bottom: 0;
}

.budget-entry-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) minmax(150px, 0.7fr) auto;
    gap: 16px;
    align-items: end;
}

.budget-entry-action {
    display: flex;
    align-items: flex-end;
}

.budget-copy-card {
    display: flex;
    flex-direction: column;
}

.budget-copy-card form {
    margin-top: auto;
    padding-top: 8px;
}

.budget-section-heading {
    align-items: flex-start;
}

.budget-empty-state {
    padding: 28px;
    border: 1px dashed #b9c4ca;
    border-radius: 7px;
    background: #f8fafb;
    text-align: center;
}

.budget-empty-state h3 {
    margin-bottom: 7px;
}

.budget-empty-state p {
    max-width: 620px;
    margin: 0 auto;
    color: var(--muted);
}

.budget-table {
    min-width: 1050px;
}

.budget-table td {
    vertical-align: middle;
}

.budget-table tfoot th,
.budget-table tfoot td {
    border-top: 2px solid #aebbc3;
    background: #eef3f5;
}

.budget-inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 210px;
    margin: 0;
}

.budget-inline-form input {
    width: 112px;
    min-width: 0;
}

.budget-percent {
    margin-bottom: 6px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.budget-progress-track {
    width: 130px;
    max-width: 100%;
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #dde4e8;
}

.budget-progress {
    min-width: 2px;
    height: 100%;
    border-radius: inherit;
}

.budget-progress-on_track {
    background: var(--success);
}

.budget-progress-near {
    background: #c18416;
}

.budget-progress-over {
    background: var(--danger);
}

.status-budget-on_track {
    background: #dff3e5;
    color: #23633a;
}

.status-budget-near {
    background: #fff0bd;
    color: #6b4a09;
}

.status-budget-over {
    background: #fbe1e1;
    color: #842b2b;
}

.budget-row-near td {
    background: #fffdf5;
}

.budget-row-over td {
    background: #fff8f8;
}

@media (max-width: 1120px) {
    .budget-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 780px) {
    .budget-page-heading,
    .month-navigation {
        align-items: stretch;
        flex-direction: column;
    }

    .month-navigation,
    .month-navigation .button,
    .budget-month-form,
    .budget-month-form input[type="month"] {
        width: 100%;
    }

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

    .budget-entry-action,
    .budget-entry-action .button {
        width: 100%;
    }
}

/* Phase 14 imports, restore tools, and audit retention */
.import-upload-grid,
.import-mapping-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.import-mapping-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.import-summary-grid,
.audit-summary-grid {
    margin-bottom: 24px;
}

.import-preview-table,
.import-review-table {
    min-width: 980px;
}

.import-review-table td,
.import-preview-table td {
    vertical-align: top;
}

.import-confirm-form {
    margin-bottom: 20px;
}

.import-row-invalid td {
    background: #fff4f4;
}

.import-row-duplicate td {
    background: #fffaf0;
}

.status-error {
    background: #fbe1e1;
    color: #842b2b;
}

.restore-section-heading {
    align-items: flex-start;
}

.restore-summary-grid {
    margin-bottom: 20px;
}

.restore-count-table {
    min-width: 520px;
}

.restore-warning {
    margin-top: 20px;
}

.restore-confirm-form {
    max-width: 520px;
    margin: 20px 0 14px;
}

.restore-backup-card {
    border-color: #d9b7b7;
}

.audit-date-value {
    font-size: 1rem;
    line-height: 1.35;
}

.audit-retention-grid {
    display: grid;
    grid-template-columns: minmax(220px, 360px) auto;
    gap: 16px;
    align-items: end;
}

.audit-retention-action {
    display: flex;
    align-items: flex-end;
}

.audit-log-table {
    min-width: 1120px;
}

.audit-details-cell {
    min-width: 280px;
    white-space: normal;
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .import-upload-grid,
    .import-mapping-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .import-summary-grid,
    .audit-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .import-upload-grid,
    .import-mapping-grid,
    .import-summary-grid,
    .audit-summary-grid,
    .audit-retention-grid {
        grid-template-columns: 1fr;
    }

    .audit-retention-action,
    .audit-retention-action .button {
        width: 100%;
    }
}

/* Confirmed destructive account deletion */
.confirmation-dialog {
    width: min(620px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 24px 70px rgba(20, 35, 45, 0.30);
}

.confirmation-dialog::backdrop {
    background: rgba(18, 25, 30, 0.72);
}

.confirmation-dialog-content {
    padding: 24px;
}

.confirmation-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.confirmation-dialog-header h2,
.confirmation-dialog-header p {
    margin-bottom: 4px;
}

.confirmation-dialog-header p {
    color: var(--muted);
}

.confirmation-dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.confirmation-dialog-close:hover {
    border-color: #8f9ca5;
    background: #e8edf0;
}

.account-delete-warning {
    margin-bottom: 16px;
}

.account-delete-list {
    margin: 0 0 20px;
    padding-left: 22px;
}

.account-delete-list li + li {
    margin-top: 7px;
}

.confirmation-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.app-confirm-dialog {
    width: min(560px, calc(100% - 32px));
}

.app-confirm-message {
    margin: 0;
    color: var(--text);
    line-height: 1.6;
    white-space: pre-line;
}

.app-confirm-dialog .confirmation-dialog-actions {
    margin-top: 24px;
}

@media (max-width: 560px) {
    .confirmation-dialog-content {
        padding: 20px;
    }

    .confirmation-dialog-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .confirmation-dialog-actions .button {
        width: 100%;
    }
}


/* Register boundary between future and current/past transactions */
.register-table tbody tr.transaction-date-divider td {
    border-top: 4px solid #b8873b;
}

.register-table tbody tr.transaction-date-divider:hover td {
    border-top-color: #8f6427;
}


.account-number-mask {
    display: inline-block;
    margin-top: 3px;
    font-family: Consolas, "Courier New", monospace;
    letter-spacing: 0.04em;
    white-space: nowrap;
}


/* Accounts page view customization */
.accounts-view-dialog {
    width: min(720px, calc(100% - 32px));
}

.accounts-view-instructions {
    margin: -4px 0 16px;
}

.accounts-view-list {
    display: grid;
    gap: 9px;
    max-height: min(54vh, 560px);
    overflow-y: auto;
    padding: 2px;
}

.accounts-view-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease;
}

.accounts-view-item:hover {
    border-color: #a9b2b8;
}

.accounts-view-item.is-dragging {
    opacity: 0.55;
    border-color: var(--bronze);
    box-shadow: 0 8px 24px rgba(20, 35, 45, 0.14);
}

.accounts-view-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--surface-soft);
    color: var(--muted);
    font: inherit;
    font-size: 1.15rem;
    letter-spacing: -0.2em;
    cursor: grab;
}

.accounts-view-drag-handle:active {
    cursor: grabbing;
}

.accounts-view-visible {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    cursor: pointer;
}

.accounts-view-visible > input {
    flex: 0 0 auto;
    width: 20px;
    min-height: 20px;
    height: 20px;
    margin: 0;
}

.accounts-view-account-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.accounts-view-account-details strong {
    overflow-wrap: anywhere;
}

.accounts-view-account-details .account-number-mask {
    margin-top: 2px;
}

.accounts-view-move-actions {
    display: inline-flex;
    gap: 5px;
}

.accounts-view-move-actions .icon-button {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    font-size: 1rem;
}

@media (max-width: 640px) {
    .accounts-view-item {
        grid-template-columns: 38px minmax(0, 1fr) auto;
    }

    .accounts-view-item > .status {
        grid-column: 2;
        justify-self: start;
    }

    .accounts-view-move-actions {
        grid-column: 3;
        grid-row: 1 / span 2;
        flex-direction: column;
    }
}


/* Add Financial Account single-row layout */
.add-account-inline-grid {
    display: grid;
    grid-template-columns:
        minmax(185px, 1.5fr)
        minmax(145px, 0.8fr)
        minmax(145px, 0.85fr)
        minmax(150px, 0.9fr)
        minmax(170px, 0.95fr)
        auto;
    align-items: end;
    gap: 14px;
}

.add-account-inline-grid .form-row {
    min-width: 0;
}

.add-account-inline-grid label {
    white-space: nowrap;
}

.add-account-inline-grid input,
.add-account-inline-grid select {
    min-width: 0;
}

.add-account-submit {
    display: flex;
    align-items: flex-end;
    align-self: end;
}

.add-account-submit .button {
    min-width: 118px;
    white-space: nowrap;
}

@media (max-width: 1120px) {
    .add-account-inline-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .add-account-submit {
        align-self: end;
        padding-top: 0;
    }

    .add-account-submit .button {
        width: 100%;
    }
}

@media (max-width: 780px) {
    .add-account-inline-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .add-account-inline-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .add-account-inline-grid label {
        white-space: normal;
    }
}


/* Phase 18 transaction pagination */
.transaction-results-heading {
    margin-bottom: 14px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.pagination-links,
.pagination-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-status {
    padding: 0 5px;
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.pagination .button.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.pagination-jump label {
    margin: 0;
    white-space: nowrap;
}

.pagination-jump input {
    width: 76px;
    min-height: 34px;
    padding: 5px 7px;
}

/* Phase 18 account-register date filtering */
.register-section-heading {
    align-items: flex-end;
    gap: 20px;
}

.register-date-filter {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.register-date-filter .form-row {
    min-width: 145px;
    margin: 0;
}

.register-date-filter label {
    white-space: nowrap;
}

.register-date-filter select,
.register-date-filter input {
    min-height: 36px;
    padding: 6px 8px;
}

.register-custom-date-fields {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.register-custom-date-fields[hidden] {
    display: none !important;
}

.register-filter-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    padding-bottom: 1px;
}

@media (max-width: 900px) {
    .register-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .register-date-filter {
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .pagination-links,
    .pagination-jump {
        justify-content: center;
    }

    .register-date-filter,
    .register-custom-date-fields {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .register-date-filter .form-row,
    .register-filter-actions {
        width: 100%;
    }

    .register-filter-actions .button {
        flex: 1 1 0;
    }
}


/* Phase 19 row-action spacing */
.table-wrap tbody td {
    padding-top: 14px;
    padding-bottom: 14px;
}

.table-wrap tbody .row-action-cell,
.table-wrap tbody td:last-child {
    padding-left: 14px;
    padding-right: 14px;
}

.table-wrap tbody td:last-child .button.small-button,
.row-action-button {
    min-width: 88px;
    padding-left: 14px;
    padding-right: 14px;
}

.table-wrap tbody td:last-child .actions,
.row-actions {
    gap: 12px;
}

.accounts-table .row-action-cell {
    min-width: 205px;
}

.register-table .row-action-cell {
    min-width: 112px;
    text-align: center;
}

/* Phase 19 Accounts Edit View column controls */
.accounts-view-column-options {
    margin: 0 0 18px;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-soft);
}

.accounts-view-column-options h3 {
    margin: 0 0 10px;
    font-size: 0.98rem;
}

.accounts-view-column-checkboxes {
    display: flex;
    align-items: center;
    gap: 12px 24px;
    flex-wrap: wrap;
}

.accounts-view-column-checkboxes .checkbox-row {
    margin: 0;
}

.accounts-view-column-checkboxes input {
    width: 20px;
    min-height: 20px;
    height: 20px;
}

@media (max-width: 620px) {
    .accounts-view-column-checkboxes {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .accounts-table .row-action-cell {
        min-width: 190px;
    }
}


/* Phase 20 advanced transaction search */
.transaction-filter-error {
    margin-top: 16px;
}

.register-section-heading {
    margin-bottom: 12px;
}

.register-advanced-filter {
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-soft);
}

.register-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 12px;
}

.register-filter-grid .form-row {
    min-width: 0;
    margin: 0;
}

.register-filter-search {
    grid-column: span 2;
}

.register-filter-grid label {
    white-space: nowrap;
}

.register-filter-grid input,
.register-filter-grid select {
    min-width: 0;
    min-height: 38px;
    padding: 7px 9px;
}

.register-advanced-filter .register-custom-date-fields {
    display: contents;
}

.register-advanced-filter .register-custom-date-fields[hidden] {
    display: none !important;
}

.register-advanced-filter .register-filter-actions {
    justify-content: flex-end;
    margin-top: 12px;
    padding: 0;
}

@media (max-width: 980px) {
    .register-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .register-filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .register-filter-search {
        grid-column: auto;
    }

    .register-filter-grid label {
        white-space: normal;
    }

    .register-advanced-filter .register-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .register-advanced-filter .register-filter-actions .button {
        width: 100%;
    }
}


/* Phase 21 automatic server backups */
.automatic-backup-settings-form {
    margin-top: 20px;
}

.automatic-backup-settings-grid {
    display: grid;
    grid-template-columns:
        minmax(210px, 1.25fr)
        minmax(150px, 0.8fr)
        minmax(150px, 0.8fr)
        minmax(150px, 0.7fr)
        auto;
    align-items: end;
    gap: 14px;
}

.automatic-backup-settings-grid .form-row {
    min-width: 0;
    margin: 0;
}

.automatic-backup-enabled {
    min-height: 42px;
    margin: 0;
    padding-bottom: 7px;
}

.automatic-backup-enabled input {
    width: 20px;
    min-height: 20px;
    height: 20px;
}

.automatic-backup-settings-action {
    display: flex;
    align-items: flex-end;
}

.automatic-backup-settings-action .button {
    white-space: nowrap;
}

.automatic-backup-cron-setup {
    margin-top: 20px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-soft);
}

.automatic-backup-cron-setup h3 {
    margin: 0 0 8px;
}

.automatic-backup-cron-setup p {
    margin: 8px 0;
}

.automatic-backup-command {
    overflow-x: auto;
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    white-space: nowrap;
}

.automatic-backup-run-form {
    margin-top: 16px;
}

.automatic-backup-history-table {
    min-width: 1120px;
}

.automatic-backup-history-table td {
    vertical-align: middle;
}

.backup-run-error {
    max-width: 360px;
    margin-top: 6px;
    white-space: normal;
}

@media (max-width: 1120px) {
    .automatic-backup-settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .automatic-backup-settings-action,
    .automatic-backup-settings-action .button {
        width: 100%;
    }
}

@media (max-width: 620px) {
    .automatic-backup-settings-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .automatic-backup-enabled {
        padding-bottom: 0;
    }
}


/* Phase 22 duplicate transaction warning */
.duplicate-transaction-warning {
    margin-bottom: 18px;
}

.duplicate-transaction-warning h3 {
    margin: 0 0 8px;
}

.duplicate-transaction-warning > p {
    margin: 8px 0 12px;
}

.duplicate-transaction-table-wrap {
    margin: 12px 0;
    border-color: rgba(139, 93, 9, 0.28);
}

.duplicate-transaction-table {
    min-width: 980px;
    background: #ffffff;
}

.duplicate-transaction-table th,
.duplicate-transaction-table td {
    padding-top: 10px;
    padding-bottom: 10px;
}

.duplicate-warning-help {
    margin-bottom: 0 !important;
}


/* Phase 23 dashboard alerts */
.dashboard-alerts-card {
    padding-bottom: 22px;
}

.dashboard-alerts-heading {
    align-items: flex-start;
}

.dashboard-alert-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.dashboard-alert-count.has-alerts {
    color: #694d11;
    border-color: #e1c976;
    background: #fff7dc;
}

.dashboard-alert-count.all-clear {
    color: #245535;
    border-color: #b9ddc2;
    background: #eaf6ed;
}

.dashboard-all-clear {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding: 16px 18px;
    border: 1px solid #b9ddc2;
    border-radius: 7px;
    background: #f0f8f2;
    color: #245535;
}

.dashboard-all-clear span {
    color: #496b54;
    font-size: 0.9rem;
}

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

.dashboard-alert {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 18px 18px 17px 20px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #ffffff;
    overflow: hidden;
}

.dashboard-alert::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
}

.dashboard-alert-danger::before {
    background: var(--danger);
}

.dashboard-alert-warning::before {
    background: var(--warning);
}

.dashboard-alert-info::before {
    background: var(--primary);
}

.dashboard-alert-danger {
    background: #fffafa;
}

.dashboard-alert-warning {
    background: #fffdf7;
}

.dashboard-alert-info {
    background: #fbfdff;
}

.dashboard-alert-header h3 {
    margin: 4px 0 0;
    font-size: 1.02rem;
    line-height: 1.35;
}

.dashboard-alert-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dashboard-alert > p {
    margin: 10px 0 12px;
    color: #4f5963;
    line-height: 1.45;
}

.dashboard-alert-items {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--border);
    list-style: none;
}

.dashboard-alert-items li {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.dashboard-alert-items li:last-child {
    border-bottom: 0;
}

.dashboard-alert-items strong {
    overflow-wrap: anywhere;
}

.dashboard-alert-items span {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.4;
}

.dashboard-alert-items-with-actions li {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-alert-items-with-actions li > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.dashboard-alert-items-with-actions .button {
    flex: 0 0 auto;
    min-width: 86px;
}

.dashboard-alert-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 14px;
}

@media (max-width: 900px) {
    .dashboard-alert-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 620px) {
    .dashboard-alerts-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-alert-items-with-actions li {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-alert-items-with-actions .button,
    .dashboard-alert-actions .button {
        width: 100%;
    }
}


/* Phase 24 dashboard amount privacy */
.dashboard-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-heading-actions form {
    margin: 0;
}

.dashboard-privacy-default {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.86rem;
    white-space: nowrap;
}

.dashboard-privacy-default strong {
    margin-left: 4px;
    color: var(--text);
}

.dashboard-hidden-amount {
    display: inline-block;
    min-width: 5.4ch;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.dashboard-hidden-amount-inline {
    min-width: auto;
    font-size: 0.92em;
}

/* Phase 24 one-row personal backup summary */
.personal-backup-summary-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
}

.personal-backup-summary-grid .backup-summary-item {
    padding: 13px 11px;
    text-align: center;
}

.personal-backup-summary-grid .backup-summary-item span {
    min-height: 2.1em;
    margin-bottom: 5px;
    line-height: 1.2;
}

@media (max-width: 1120px) {
    .personal-backup-summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .dashboard-heading-actions {
        align-items: stretch;
        width: 100%;
        justify-content: flex-start;
    }

    .dashboard-heading-actions form,
    .dashboard-heading-actions .button,
    .dashboard-privacy-default {
        width: 100%;
    }

    .dashboard-privacy-default {
        justify-content: center;
    }

    .personal-backup-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 430px) {
    .personal-backup-summary-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* Phase 25 Find & Replace */
.find-replace-search-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 14px;
}

.find-replace-search-grid .form-row {
    min-width: 0;
    margin: 0;
}

.find-replace-text-find {
    grid-column: span 2;
}

.find-replace-scope {
    grid-column: span 2;
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px 20px;
    min-height: 74px;
    margin: 0;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-soft);
}

.find-replace-scope legend {
    padding: 0 5px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.find-replace-scope .checkbox-row {
    margin: 0;
}

.find-replace-search-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    grid-column: span 2;
}

.find-replace-result-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.find-replace-empty {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 17px 18px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-soft);
}

.find-replace-empty span {
    color: var(--muted);
}

.find-replace-replacement-panel {
    display: grid;
    grid-template-columns:
        minmax(220px, 0.85fr)
        minmax(280px, 1.35fr)
        auto;
    align-items: end;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-soft);
}

.find-replace-replacement-panel h3 {
    margin: 0 0 4px;
}

.find-replace-replacement-panel p {
    margin: 0;
}

.find-replace-replacement-panel .form-row {
    margin: 0;
}

.find-replace-submit-area {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.find-replace-selected-count {
    color: var(--muted);
    white-space: nowrap;
}

.find-replace-selected-count strong {
    color: var(--text);
}

.find-replace-selection-actions {
    margin-bottom: 10px;
}

.find-replace-table {
    min-width: 1260px;
}

.find-replace-check-column {
    width: 58px;
    text-align: center;
}

.find-replace-row-checkbox,
.find-replace-select-all-label input {
    width: 20px;
    min-height: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
}

.find-replace-select-all-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.find-replace-current-value {
    max-width: 300px;
    min-width: 180px;
    overflow-wrap: anywhere;
    white-space: normal;
}

.muted-value {
    color: var(--muted);
    font-style: italic;
}

.find-replace-guidance-item {
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-soft);
}

.find-replace-guidance-item h3 {
    margin: 0 0 7px;
    font-size: 1rem;
}

.find-replace-guidance-item p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

@media (max-width: 1080px) {
    .find-replace-search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .find-replace-replacement-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .find-replace-submit-area {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .find-replace-search-grid,
    .find-replace-replacement-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .find-replace-text-find,
    .find-replace-scope,
    .find-replace-search-actions,
    .find-replace-submit-area {
        grid-column: auto;
    }

    .find-replace-scope {
        align-items: stretch;
        flex-direction: column;
    }

    .find-replace-search-actions,
    .find-replace-submit-area {
        align-items: stretch;
        flex-direction: column;
    }

    .find-replace-search-actions .button,
    .find-replace-submit-area .button {
        width: 100%;
    }
}


/* Phase 26 Payee search */
.payee-search-form {
    margin-bottom: 16px;
}

.payee-search-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: end;
    gap: 12px;
}

.payee-search-row .form-row {
    margin: 0;
}

.payee-search-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.payee-search-summary {
    margin-bottom: 16px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.9rem;
}

.payee-search-summary strong {
    color: var(--text);
}

@media (max-width: 640px) {
    .payee-search-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .payee-search-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .payee-search-actions .button {
        width: 100%;
    }
}


/* Phase 27 Settings & Tools */
.settings-page-heading {
    align-items: flex-start;
}

.settings-section {
    scroll-margin-top: 18px;
}

.settings-account-grid {
    display: grid;
    grid-template-columns:
        minmax(260px, 0.8fr)
        minmax(360px, 1.2fr);
    gap: 18px;
}

.settings-profile-panel,
.settings-preference-panel {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.settings-profile-panel h3,
.settings-preference-panel h3 {
    margin: 5px 0 9px;
}

.settings-preference-panel > p {
    margin: 0 0 15px;
    color: var(--muted);
    line-height: 1.5;
}

.settings-tool-kicker {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.065em;
    line-height: 1.3;
    text-transform: uppercase;
}

.settings-profile-details {
    display: grid;
    gap: 11px;
    margin: 18px 0;
}

.settings-profile-details > div {
    display: grid;
    gap: 3px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.settings-profile-details > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.settings-profile-details dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.settings-profile-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.settings-radio-list {
    display: grid;
    gap: 10px;
}

.settings-radio-option {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #ffffff;
    cursor: pointer;
}

.settings-radio-option:has(input:checked) {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.settings-radio-option input {
    flex: 0 0 auto;
    width: 18px;
    min-height: 18px;
    height: 18px;
    margin: 2px 0 0;
}

.settings-radio-option span {
    display: grid;
    gap: 4px;
}

.settings-radio-option small {
    color: var(--muted);
    font-size: 0.83rem;
    font-weight: 400;
    line-height: 1.4;
}

.settings-inline-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 15px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
}

.settings-inline-link > div {
    display: grid;
    gap: 4px;
}

.settings-inline-link span {
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.settings-inline-link .button {
    flex: 0 0 auto;
}

.settings-tool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.settings-tool-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-tool-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 220px;
    flex-direction: column;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text);
    text-decoration: none;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}

.settings-tool-card:hover,
.settings-tool-card:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 8px 22px rgba(20, 35, 45, 0.11);
    transform: translateY(-2px);
}

.settings-tool-card h3 {
    margin: 7px 0 9px;
    font-size: 1.05rem;
}

.settings-tool-card p {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.5;
}

.settings-tool-action {
    margin-top: auto;
    color: var(--primary);
    font-size: 0.87rem;
    font-weight: 700;
}

@media (max-width: 1050px) {
    .settings-tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .settings-account-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 620px) {
    .settings-tool-grid,
    .settings-tool-grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }

    .settings-tool-card {
        min-height: 0;
    }

    .settings-inline-link {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-inline-link .button {
        width: 100%;
    }
}


/* Phase 29 register performance and date-range preferences */
.register-quick-ranges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.register-quick-ranges > span {
    margin-right: 2px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.register-quick-ranges .button.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.settings-register-preference-panel {
    grid-column: 1 / -1;
}

.settings-register-preference-panel .form-row {
    max-width: 360px;
    margin-bottom: 0;
}

@media (max-width: 620px) {
    .register-quick-ranges {
        align-items: stretch;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .register-quick-ranges > span {
        grid-column: 1 / -1;
    }

    .register-quick-ranges .button {
        width: 100%;
    }
}


/* Phase 30 transaction CSV export */
.settings-tool-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.export-filter-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    margin-bottom: 18px;
}

.export-filter-search {
    grid-column: span 6;
}

.export-filter-search-field,
.export-filter-amount {
    grid-column: span 3;
}

.export-filter-account {
    grid-column: span 4;
}

.export-filter-type,
.export-filter-status,
.export-filter-from,
.export-filter-through {
    grid-column: span 2;
}

.export-filter-status select,
.export-filter-from input,
.export-filter-through input {
    min-width: 0;
}

.export-match-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.export-format-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.export-format-panel legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.export-format-panel .settings-radio-option {
    height: 100%;
}

.export-information {
    margin-bottom: 18px;
}

.export-explanation {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.export-explanation h3 {
    margin: 0 0 8px;
}

.export-explanation p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

@media (max-width: 980px) {
    .settings-tool-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .export-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .export-filter-search,
    .export-filter-search-field,
    .export-filter-amount,
    .export-filter-account,
    .export-filter-type,
    .export-filter-status,
    .export-filter-from,
    .export-filter-through {
        grid-column: span 1;
    }

    .export-filter-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .settings-tool-grid-3,
    .export-filter-grid,
    .export-format-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .export-filter-search {
        grid-column: auto;
    }
}


/* Phase 31 reconciliation performance and sticky summary */
.reconciliation-summary .stat-card {
    min-height: 58px;
    height: auto;
    justify-content: center;
    gap: 2px;
    padding: 7px 12px;
}

.reconciliation-summary .stat-label {
    margin-bottom: 0;
    font-size: 0.8rem;
    line-height: 1.05;
}

.reconciliation-summary .stat-value {
    font-size: 1.3rem;
    line-height: 1.05;
}

.reconciliation-summary-sentinel {
    height: 1px;
    margin-top: -1px;
}

.reconciliation-summary {
    position: sticky;
    top: 12px;
    z-index: 25;
    transition:
        gap 160ms ease,
        padding 160ms ease,
        background 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.reconciliation-summary .stat-card {
    transition:
        padding 160ms ease,
        border-radius 160ms ease,
        box-shadow 160ms ease;
}

.reconciliation-summary .stat-label,
.reconciliation-summary .stat-value {
    transition:
        margin 160ms ease,
        font-size 160ms ease,
        line-height 160ms ease;
}

.reconciliation-summary.is-compact {
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: rgba(243, 245, 247, 0.96);
    box-shadow: 0 8px 24px rgba(20, 35, 45, 0.16);
    backdrop-filter: blur(7px);
}

.reconciliation-summary.is-compact .stat-card {
    display: flex;
    min-width: 0;
    min-height: 34px;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    padding: 2px 7px;
    border-radius: 7px;
    box-shadow: none;
}

.reconciliation-summary.is-compact .stat-label {
    min-width: 0;
    margin-bottom: 0;
    overflow: hidden;
    font-size: 0.78rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reconciliation-summary.is-compact .stat-value {
    flex: 0 0 auto;
    font-size: 1.12rem;
    line-height: 1;
    white-space: nowrap;
}

.reconciliation-transaction-heading {
    gap: 14px;
}

.reconciliation-status-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.reconciliation-count-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.reconciliation-cleared-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

@media (max-width: 780px) {
    .reconciliation-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reconciliation-summary .stat-card {
        min-height: 52px;
        padding: 6px 9px;
    }

    .reconciliation-summary .stat-label {
        font-size: 0.72rem;
    }

    .reconciliation-summary .stat-value {
        font-size: 1.12rem;
    }

    .reconciliation-summary.is-compact {
        top: 6px;
        gap: 3px;
        padding: 3px;
    }

    .reconciliation-summary.is-compact .stat-card {
        min-height: 32px;
        gap: 5px;
        padding: 2px 5px;
    }

    .reconciliation-summary.is-compact .stat-label {
        font-size: 0.72rem;
    }

    .reconciliation-summary.is-compact .stat-value {
        font-size: 1rem;
    }

    .reconciliation-status-actions {
        justify-content: flex-start;
    }

    .reconciliation-cleared-summary {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Phase 32 register bulk actions and voided transactions */
.register-bulk-form {
    margin: 0;
}

.register-bulk-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-soft);
}

.register-bulk-selection,
.register-bulk-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.register-bulk-controls select {
    width: auto;
    min-width: 190px;
}

.register-bulk-note {
    margin-bottom: 14px;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 0.86rem;
}

.register-select-column {
    width: 48px;
    min-width: 48px;
    text-align: center;
}

.register-select-all-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.register-row-checkbox,
.register-select-all-label input {
    width: 20px;
    min-height: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
}

.transaction-row-voided td {
    background: #f7f7f7;
}

.transaction-row-voided:hover td {
    background: #f0f0f0;
}

.voided-amount {
    color: var(--muted);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.status-voided {
    color: #5a3c3c;
    background: #eee3e3;
}

@media (max-width: 780px) {
    .register-bulk-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .register-bulk-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .register-bulk-controls select,
    .register-bulk-controls .button {
        width: 100%;
    }
}


/* Phase 32 UI adjustment: overlay success confirmations */
.flash-notice-overlay {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 100000;
    width: min(620px, calc(100% - 32px));
    margin: 0;
    transform: translateX(-50%);
    box-shadow: 0 12px 32px rgba(20, 35, 45, 0.24);
    opacity: 1;
    transition:
        opacity 220ms ease,
        transform 220ms ease;
}

.flash-notice-overlay.is-hiding {
    opacity: 0;
    transform: translate(-50%, -10px);
    pointer-events: none;
}

@media (max-width: 620px) {
    .flash-notice-overlay {
        top: 10px;
        width: calc(100% - 20px);
    }
}


/* Phase 34 calendar-based scheduled recurrence */
.recurring-repeat-control {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(250px, 1.4fr);
    gap: 10px;
    align-items: center;
}

.recurring-repeat-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.recurring-repeat-detail[hidden] {
    display: none !important;
}

.recurring-repeat-detail select {
    width: auto;
    min-width: 88px;
}

.recurring-repeat-detail span {
    color: var(--muted);
    white-space: nowrap;
}

.recurring-repeat-field .help-text {
    margin-top: 4px;
}

@media (max-width: 780px) {
    .recurring-repeat-control {
        grid-template-columns: 1fr;
    }

    .recurring-repeat-detail {
        flex-wrap: wrap;
    }

    .recurring-repeat-detail select {
        flex: 1 1 110px;
    }
}

.recurring-repeat-field .help-text {
    margin-top: 4px;
}

@media (max-width: 680px) {
    .recurring-interval-control {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* Phase 35 scheduled occurrence amount review */
.scheduled-post-dialog {
    width: min(620px, calc(100% - 32px));
}

.scheduled-post-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.scheduled-post-summary > div {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-soft);
}

.scheduled-post-summary span,
.scheduled-post-summary strong {
    display: block;
}

.scheduled-post-summary span {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.scheduled-post-summary strong {
    overflow-wrap: anywhere;
}

.scheduled-post-amount-field input {
    max-width: 240px;
    font-size: 1.15rem;
    font-weight: 700;
}

.scheduled-post-split-note {
    margin: 18px 0 0;
}

@media (max-width: 560px) {
    .scheduled-post-summary {
        grid-template-columns: 1fr;
    }

    .scheduled-post-amount-field input {
        max-width: none;
    }
}


/* Phase 36 clickable account rows */
.accounts-table .account-register-row {
    cursor: pointer;
}

.accounts-table .account-register-row td {
    transition:
        background 120ms ease,
        box-shadow 120ms ease;
}

.accounts-table .account-register-row:hover td {
    background: #f3f7f9;
}

.accounts-table .account-register-row:focus {
    outline: none;
}

.accounts-table .account-register-row:focus-visible td {
    background: #eef5f8;
    box-shadow:
        inset 0 2px 0 var(--primary),
        inset 0 -2px 0 var(--primary);
}

.accounts-table .account-register-row:focus-visible td:first-child {
    box-shadow:
        inset 2px 0 0 var(--primary),
        inset 0 2px 0 var(--primary),
        inset 0 -2px 0 var(--primary);
}

.accounts-table .account-register-row:focus-visible td:last-child {
    box-shadow:
        inset -2px 0 0 var(--primary),
        inset 0 2px 0 var(--primary),
        inset 0 -2px 0 var(--primary);
}

.accounts-table .account-register-row .row-action-cell {
    cursor: default;
}

.accounts-table .account-register-row .row-actions {
    justify-content: flex-end;
}


/* Phase 38 aligned account and register controls */
.accounts-table .account-action-heading,
.accounts-table .row-action-cell {
    width: 112px;
    text-align: center;
}

.accounts-table .account-register-row .row-actions {
    justify-content: center;
}

.accounts-table .row-action-cell .button {
    min-width: 74px;
}

.register-quick-ranges .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 94px;
    width: 94px;
}

@media (max-width: 620px) {
    .register-quick-ranges .button {
        flex-basis: auto;
        width: 100%;
    }
}


/* Phase 43 account row actions */
.accounts-table .account-action-heading,
.accounts-table .row-action-cell {
    width: 310px;
    min-width: 310px;
}

.accounts-table .account-register-row .row-actions {
    flex-wrap: nowrap;
}

.accounts-table .row-action-cell .button {
    min-width: 88px;
}


/* Phase 44 category search */
.category-search-form {
    margin-bottom: 18px;
}

.category-search-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.category-search-row .form-row {
    flex: 1 1 420px;
    margin: 0;
}

.category-search-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.category-search-summary {
    margin: 0 0 16px;
    color: var(--muted);
}

.category-search-summary strong {
    color: var(--text);
}

@media (max-width: 620px) {
    .category-search-row {
        align-items: stretch;
        flex-direction: column;
    }

    .category-search-actions {
        width: 100%;
    }

    .category-search-actions .button {
        flex: 1 1 0;
    }
}


/* Phase 49 improved mobile navigation */
.header-user-area {
    display: flex;
    align-items: center;
    gap: 18px;
}

.mobile-nav-toggle {
    display: none;
}

.main-nav a.is-current {
    border-color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.16);
    box-shadow: none;
}

@media (max-width: 780px) {
    .page-shell {
        width: min(100% - 24px, 1180px);
    }

    .header-inner {
        min-height: 64px;
        gap: 12px;
    }

    .brand {
        min-width: 0;
        overflow: hidden;
        font-size: 1.2rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-user-area {
        flex: 0 0 auto;
        gap: 10px;
    }

    .signed-in {
        display: none;
    }

    .mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 42px;
        padding: 8px 11px;
        border: 1px solid rgba(255, 255, 255, 0.35);
        border-radius: 7px;
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        font: inherit;
        font-size: 0.9rem;
        font-weight: 700;
        cursor: pointer;
    }

    .mobile-nav-toggle:hover,
    .mobile-nav-toggle:focus-visible,
    .mobile-nav-toggle.is-active {
        background: rgba(255, 255, 255, 0.16);
        border-color: rgba(255, 255, 255, 0.65);
    }

    .mobile-nav-toggle:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

    .mobile-nav-toggle-icon {
        display: grid;
        width: 18px;
        gap: 4px;
    }

    .mobile-nav-toggle-icon span {
        display: block;
        width: 100%;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transform-origin: center;
        transition:
            transform 160ms ease,
            opacity 160ms ease;
    }

    .mobile-nav-toggle.is-active
        .mobile-nav-toggle-icon
        span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .mobile-nav-toggle.is-active
        .mobile-nav-toggle-icon
        span:nth-child(2) {
        opacity: 0;
    }

    .mobile-nav-toggle.is-active
        .mobile-nav-toggle-icon
        span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .main-nav {
        display: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 10px 22px rgba(16, 27, 34, 0.22);
    }

    .main-nav.is-mobile-open {
        display: block;
    }

    .nav-inner {
        min-height: 0;
        padding-top: 10px;
        padding-bottom: 12px;
        align-items: stretch;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 4px;
    }

    .main-nav a,
    .nav-button {
        width: 100%;
        min-height: 46px;
        justify-content: flex-start;
        padding: 11px 14px;
        border-radius: 7px;
        box-sizing: border-box;
        font-weight: 600;
    }

    .main-nav a.is-current {
        border-color: rgba(255, 255, 255, 0.65);
        background: rgba(255, 255, 255, 0.16);
        box-shadow: none;
    }

    .logout-form {
        width: 100%;
        margin: 6px 0 0;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
    }

    .logout-form .nav-button {
        background: rgba(255, 255, 255, 0.06);
    }

    .main-content {
        padding-top: 22px;
    }
}

@media (min-width: 781px) {
    .main-nav {
        display: block !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-nav-toggle-icon span {
        transition: none;
    }
}


/* Phase 50 self-service password reset */
.auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}

.auth-label-row label {
    margin: 0;
}

.auth-label-row a,
.auth-secondary-links a {
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-primary-button {
    width: 100%;
    justify-content: center;
}

.auth-secondary-links {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.auth-action-stack {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.auth-action-stack .button {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
}

@media (max-width: 520px) {
    .auth-shell {
        width: min(100% - 24px, 520px);
        margin: 28px auto;
    }

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


/* Phase 51 profile and password settings */
.profile-password-card {
    padding: 0;
    overflow: hidden;
}

.profile-password-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 0.85fr)
        minmax(0, 1.15fr);
    align-items: stretch;
}

.profile-password-section {
    min-width: 0;
    padding: 24px;
}

.profile-password-change-section {
    border-left: 1px solid var(--border);
    background: var(--surface-soft);
}

.profile-password-section .section-heading {
    margin-bottom: 18px;
}

.profile-name-field {
    max-width: none;
}

@media (max-width: 900px) {
    .profile-password-grid {
        grid-template-columns: 1fr;
    }

    .profile-password-change-section {
        border-top: 1px solid var(--border);
        border-left: 0;
    }
}

@media (max-width: 620px) {
    .profile-password-section {
        padding: 20px;
    }
}


/* Phase 53 login page bottom links */
.login-footer-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 16px;
}

.login-footer-links a {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.login-footer-links a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

@media (max-width: 420px) {
    .login-footer-links {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
}


/* Phase 57 public account registration */
.auth-shell-signup {
    width: min(680px, calc(100% - 32px));
}

.signup-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.signup-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.auth-checkbox {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    margin: 2px 0 20px;
    font-weight: 400;
    line-height: 1.45;
}

.auth-checkbox input {
    width: 18px;
    min-height: 18px;
    margin: 2px 0 0;
}

.signup-footer-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    font-weight: 600;
}

.signup-footer-links a,
.auth-signup-prompt a {
    font-weight: 700;
}

.auth-signup-prompt {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    text-align: center;
    font-size: 0.92rem;
}

.login-footer-links:has(a:only-child) {
    justify-content: flex-start;
}

.signup-setting-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 620px) {
    .signup-form-grid,
    .signup-setting-options {
        grid-template-columns: 1fr;
    }

    .signup-footer-links {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
}


/* Phase 61 customer account deletion */
.customer-delete-dialog {
    width: min(650px, calc(100% - 32px));
}

.customer-delete-dialog.is-fallback-open {
    position: fixed;
    inset: 50% auto auto 50%;
    z-index: 10000;
    display: block;
    max-height: calc(100vh - 32px);
    margin: 0;
    overflow: auto;
    transform: translate(-50%, -50%);
    box-shadow:
        0 0 0 100vmax rgba(15, 27, 34, 0.62),
        var(--shadow-hover);
}

.customer-delete-backup-note {
    margin: -4px 0 20px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-soft);
}


/* Phase 63 optional desktop sticky navbar */
@media (min-width: 781px) {
    body.sticky-desktop-nav .main-nav {
        position: sticky;
        top: 0;
        z-index: 900;
        box-shadow:
            0 5px 14px rgba(15, 27, 34, 0.18);
    }

    body.sticky-desktop-nav .reconciliation-summary {
        top: calc(
            var(--sticky-nav-height, 48px) + 12px
        );
    }
}

/* Phase 64 compact Navigation preference */
.settings-navigation-section {
    padding: 18px 20px;
}

.settings-navigation-compact {
    display: grid;
    grid-template-columns:
        minmax(300px, 1fr)
        auto
        auto;
    align-items: center;
    gap: 20px;
}

.settings-navigation-summary {
    min-width: 0;
}

.settings-navigation-summary h2 {
    margin: 3px 0 4px;
    font-size: 1.15rem;
}

.settings-navigation-summary p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.settings-navigation-options {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-navigation-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #ffffff;
    cursor: pointer;
    white-space: nowrap;
}

.settings-navigation-option:has(input:checked) {
    border-color: var(--primary);
    background: #eef5f8;
    box-shadow: 0 0 0 1px var(--primary);
}

.settings-navigation-option input {
    width: 17px;
    min-height: 17px;
    height: 17px;
    margin: 0;
}

.settings-navigation-option span {
    font-size: 0.88rem;
    font-weight: 700;
}

.settings-navigation-save {
    min-width: 82px;
    justify-content: center;
}

@media (max-width: 900px) {
    .settings-navigation-compact {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .settings-navigation-summary {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .settings-navigation-section {
        padding: 16px;
    }

    .settings-navigation-compact {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .settings-navigation-options {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-navigation-option,
    .settings-navigation-save {
        width: 100%;
    }
}


/* Phase 67 Ledger55 application branding */
.app-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.app-brand-picture {
    display: inline-flex;
    align-items: center;
}

.app-brand-logo {
    display: block;
    width: auto;
    height: 30px;
    max-width: 175px;
}

@media (min-width: 781px) {
    .app-brand-logo {
        filter:
            brightness(1.42)
            saturate(0.9);
    }
}

@media (max-width: 780px) {
    .app-brand-logo {
        height: 28px;
        max-width: 82px;
    }
}


/* Phase 77 settings-only guided application tour */
.application-tour-layer {
    position: fixed;
    inset: 0;
    z-index: 20000;
}

.application-tour-layer[hidden],
.application-tour-toast[hidden] {
    display: none;
}

.application-tour-shield {
    position: fixed;
    inset: 0;
    z-index: 20000;
    cursor: default;
}

.application-tour-spotlight,
.application-tour-tooltip {
    opacity: 0;
    visibility: hidden;
}

.application-tour-layer.is-ready
.application-tour-spotlight,
.application-tour-layer.is-ready
.application-tour-tooltip {
    opacity: 1;
    visibility: visible;
}

.application-tour-spotlight {
    position: fixed;
    z-index: 20001;
    border: 3px solid #ffffff;
    border-radius: 10px;
    box-shadow:
        0 0 0 9999px rgba(15, 27, 34, 0.72),
        0 0 0 5px rgba(49, 95, 120, 0.92),
        0 8px 24px rgba(0, 0, 0, 0.28);
    pointer-events: none;
    transition:
        top 180ms ease,
        left 180ms ease,
        width 180ms ease,
        height 180ms ease,
        opacity 110ms ease;
}

.application-tour-tooltip {
    position: fixed;
    z-index: 20002;
    width: min(390px, calc(100vw - 24px));
    padding: 21px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 14px 38px rgba(15, 27, 34, 0.28);
    outline: none;
    transition: opacity 110ms ease;
}

.application-tour-tooltip h2 {
    margin-bottom: 10px;
    font-size: 1.28rem;
}

.application-tour-tooltip > p {
    margin-bottom: 18px;
    color: var(--muted);
    line-height: 1.55;
}

.application-tour-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.application-tour-exit {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: none;
    cursor: pointer;
}

.application-tour-exit:hover,
.application-tour-exit:focus-visible {
    color: var(--primary-hover);
    text-decoration: underline;
}

.application-tour-error {
    margin: 14px 0;
    padding: 10px 12px;
    border: 1px solid #dfb4b4;
    border-radius: var(--radius);
    background: #f9e8e8;
    color: var(--danger);
    font-size: 0.9rem;
}

.application-tour-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.application-tour-controls .button {
    min-width: 96px;
}

[data-application-tour-active-target="1"] {
    scroll-margin-top: 90px;
}

.application-tour-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 20030;
    width: min(430px, calc(100% - 36px));
    padding: 14px 17px;
    border: 1px solid #a8c8b4;
    border-radius: var(--radius);
    background: #eef8f1;
    color: #245535;
    box-shadow: var(--shadow-hover);
    font-weight: 650;
}

.settings-tour-section {
    padding: 18px 20px;
}

.settings-tour-compact {
    display: grid;
    grid-template-columns:
        minmax(300px, 1fr)
        auto
        auto;
    align-items: center;
    gap: 20px;
}

.settings-tour-summary {
    min-width: 0;
}

.settings-tour-summary h2 {
    margin-bottom: 4px;
    font-size: 1.14rem;
}

.settings-tour-summary p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
}

.settings-tour-status {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
}

.settings-tour-button {
    white-space: nowrap;
}

@media (max-width: 780px) {
    .application-tour-tooltip {
        padding: 18px;
    }

    .application-tour-tooltip h2 {
        font-size: 1.16rem;
    }

    .settings-tour-compact {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 14px;
    }

    .settings-tour-status {
        width: fit-content;
    }

    .settings-tour-button {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .application-tour-tooltip {
        width: calc(100vw - 18px);
        padding: 16px;
    }

    .application-tour-controls .button {
        min-width: 86px;
    }

    .application-tour-progress {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}


/* Phase 79 compact mobile dashboard */
@media (max-width: 780px) {
    .dashboard-summary-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .dashboard-summary-grid .stat-card {
        min-width: 0;
        min-height: 94px;
        padding: 14px;
    }

    .dashboard-summary-grid .stat-label {
        margin-bottom: 5px;
        font-size: 0.78rem;
        line-height: 1.25;
    }

    .dashboard-summary-grid .stat-value {
        min-width: 0;
        font-size: clamp(
            1.05rem,
            5vw,
            1.45rem
        );
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    .dashboard-summary-grid .stat-limit {
        font-size: 0.78rem;
    }

    #active-accounts .account-card-grid {
        gap: 9px;
    }

    #active-accounts .account-card {
        align-items: center;
        flex-direction: row;
        min-height: 64px;
        padding: 11px 13px;
        gap: 12px;
    }

    #active-accounts .account-card > div:first-child {
        min-width: 0;
    }

    #active-accounts .account-card-name {
        margin-bottom: 2px;
        overflow: hidden;
        font-size: 0.94rem;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #active-accounts .account-card-type {
        font-size: 0.78rem;
        line-height: 1.2;
    }

    #active-accounts .account-card-balance {
        flex: 0 0 auto;
        font-size: 1.05rem;
        line-height: 1.2;
    }
}

@media (max-width: 380px) {
    .dashboard-summary-grid {
        gap: 8px;
    }

    .dashboard-summary-grid .stat-card {
        min-height: 88px;
        padding: 12px 10px;
    }

    .dashboard-summary-grid .stat-label {
        font-size: 0.73rem;
    }

    .dashboard-summary-grid .stat-value {
        font-size: clamp(
            0.98rem,
            4.9vw,
            1.18rem
        );
    }

    #active-accounts .account-card {
        padding: 10px 11px;
    }

    #active-accounts .account-card-balance {
        font-size: 0.98rem;
    }
}
