:root {
    --bg-cream: #f5efe4;
    --bg-shell: rgba(255, 255, 255, 0.78);
    --header-bg: #f8f6f2;
    --ink-900: #1f2a2e;
    --ink-700: #526167;
    --line: rgba(31, 42, 46, 0.12);
    --accent: #224870;
    --mint: #3b7a57;
    --coral: #b55239;
    --radius-lg: 28px;
    --shadow: 0 18px 50px rgba(37, 58, 72, 0.12);
}

.login-shell {
    min-height: 65vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at 18% 15%, rgba(59, 122, 87, 0.14), transparent 28%),
        linear-gradient(150deg, rgba(245, 239, 228, 0.96), rgba(229, 239, 232, 0.88));
    border-radius: 0 0 32px 32px;
}

.login-card {
    width: min(100%, 32rem);
    padding: clamp(1.5rem, 4vw, 2.75rem);
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.login-card h1 {
    margin: .35rem 0 .75rem;
}

.login-form {
    display: grid;
    gap: .75rem;
    margin-top: 1.5rem;
}

.login-form label {
    font-weight: 700;
}

.login-form input {
    width: 100%;
}

.login-form .primary-button {
    margin-top: .5rem;
    background: linear-gradient(110deg, var(--accent), #2d5d89);
}

.login-note {
    margin: 1.25rem 0 0;
    color: var(--ink-700);
    font-size: .9rem;
}

.login-sign-up,
.signup-sign-in {
    margin: 1.25rem 0 0;
    text-align: center;
    color: var(--ink-700);
}

.login-sign-up a,
.signup-sign-in a {
    color: var(--accent);
    font-weight: 800;
}

.signup-shell {
    display: grid;
    place-items: center;
    padding: 2rem 1rem 3rem;
    background:
        radial-gradient(circle at 18% 15%, rgba(59, 122, 87, 0.14), transparent 28%),
        linear-gradient(150deg, rgba(245, 239, 228, 0.96), rgba(229, 239, 232, 0.88));
}

.signup-card {
    width: min(100%, 48rem);
    padding: clamp(1.5rem, 4vw, 2.75rem);
    border: 1px solid var(--line);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.signup-card h1 {
    margin: .35rem 0 .75rem;
}

.signup-form {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.signup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.signup-grid > div {
    display: grid;
    gap: .4rem;
}

.signup-grid .full {
    grid-column: 1 / -1;
}

.signup-form label {
    font-weight: 700;
}

.signup-form .primary-button {
    width: 100%;
}

.sidebar-user {
    margin: 0 0 .65rem;
    color: var(--muted);
    font-size: .85rem;
}
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 30%),
        linear-gradient(160deg, #efe1cf 0%, #f5efe4 35%, #e5efe8 100%);
    color: var(--ink-900);
    font-family: Aptos, "Trebuchet MS", "Segoe UI Variable Display", sans-serif;
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    padding: 0.82rem 1.2rem;
    transition: transform 140ms ease, box-shadow 140ms ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(34, 72, 112, 0.22);
}

button:disabled {
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.55;
}

.form-actions > button,
.register-section-actions > button,
.account-actions-cell button,
.scheduled-payment-actions button,
.register-mobile-actions button,
.register-action-group button,
.reconcile-actions button,
.collapse-card-button {
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1.1;
}

.ghost-button,
.danger-button {
    box-shadow: none;
}

.ghost-button {
    background: rgba(34, 72, 112, 0.08);
    color: var(--accent);
}

.ghost-button:hover {
    box-shadow: none;
    background: rgba(34, 72, 112, 0.14);
}

.danger-button {
    background: rgba(181, 82, 57, 0.14);
    color: var(--coral);
}

.danger-button:hover {
    box-shadow: none;
    background: rgba(181, 82, 57, 0.2);
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(31, 42, 46, 0.14);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.9rem 1rem;
    color: var(--ink-900);
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(34, 72, 112, 0.18);
    border-color: rgba(34, 72, 112, 0.45);
}

.page-shell {
    width: min(1280px, calc(100vw - 2rem));
    margin: 1rem auto;
    background: var(--bg-shell);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 34px;
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.app-grid {
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: calc(100vh - 2rem);
}

.app-grid-anonymous {
    grid-template-columns: minmax(0, 1fr);
}

.anonymous-page-content {
    width: 100%;
    padding-top: 1.5rem;
}

.anonymous-topbar {
    margin: 0;
    padding: 1.6rem 1.75rem 1.3rem;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--ink-900);
    box-shadow: none;
}

.anonymous-topbar .topbar-copy p {
    color: var(--ink-900);
}

.anonymous-topbar .status-chip {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--line);
    color: var(--ink-700);
}

.sidebar {
    background:
        linear-gradient(180deg, rgba(34, 72, 112, 0.96), rgba(31, 42, 46, 0.96)),
        linear-gradient(45deg, transparent 35%, rgba(255, 255, 255, 0.08) 35%, rgba(255, 255, 255, 0.08) 40%, transparent 40%);
    color: white;
    padding: 1.4rem;
}

.brand-card,
.sidebar-footer,
.hero-panel,
.panel,
.metric-card,
.category-card {
    border-radius: var(--radius-lg);
}

.brand-card,
.sidebar-footer {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 1rem;
}

.brand-kicker,
.eyebrow {
    display: inline-flex;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
}

.brand-title {
    margin: 0.85rem 0 0.3rem;
    font-size: 1.95rem;
    line-height: 1;
}

.brand-copy,
.sidebar-footer,
.muted,
.metric-note {
    color: var(--ink-700);
}

.brand-copy,
.sidebar-footer {
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.5;
}

.sidebar-footer {
    margin-top: 1.2rem;
}

.main-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 1rem;
    row-gap: 0.55rem;
    padding: 1.4rem 1.5rem 1rem;
    background: var(--header-bg);
}

.topbar h1,
.topbar p {
    margin: 0;
}

.topbar h1:focus {
    outline: none;
}

.topbar-copy {
    display: contents;
}

.topbar-copy h1 {
    grid-column: 1 / -1;
    font-size: clamp(1.35rem, 4.2vw, 3.15rem);
    line-height: 1.02;
    letter-spacing: -0.06em;
    white-space: nowrap;
}

.topbar-copy p {
    grid-column: 1;
    grid-row: 2;
    max-width: 34rem;
    color: var(--ink-900);
    font-size: clamp(1rem, 1.45vw, 1.2rem);
    line-height: 1.35;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    color: var(--ink-700);
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    grid-column: 2;
    grid-row: 2;
}

.account-menu {
    position: relative;
}

.avatar-button {
    display: grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-weight: 800;
    letter-spacing: .04em;
    list-style: none;
    box-shadow: 0 8px 18px rgba(34, 72, 112, 0.2);
}

.avatar-button::-webkit-details-marker {
    display: none;
}

.avatar-button:focus-visible {
    outline: 3px solid rgba(34, 72, 112, 0.24);
    outline-offset: 3px;
}

.avatar-button-anonymous {
    background: rgba(34, 72, 112, 0.1);
    color: var(--accent);
    border: 1px solid rgba(34, 72, 112, 0.18);
    box-shadow: none;
}

.avatar-person-icon {
    position: relative;
    display: block;
    width: 1.35rem;
    height: 1.35rem;
}

.avatar-person-icon::before,
.avatar-person-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: currentColor;
}

.avatar-person-icon::before {
    top: .05rem;
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
}

.avatar-person-icon::after {
    bottom: .05rem;
    width: 1.15rem;
    height: .58rem;
    border-radius: .75rem .75rem .25rem .25rem;
}

.account-menu[open] .avatar-button {
    background: var(--mint);
}

.account-menu-popover {
    position: absolute;
    z-index: 20;
    top: calc(100% + .65rem);
    right: 0;
    width: min(17rem, calc(100vw - 2rem));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(31, 42, 46, 0.18);
}

.account-menu-identity {
    display: grid;
    gap: .15rem;
    padding: 1rem;
    border-bottom: 1px solid var(--line);
}

.account-menu-identity span {
    color: var(--ink-700);
    font-size: .82rem;
}

.account-menu-options {
    padding: .45rem;
}

.account-menu-options form {
    margin: 0;
}

.account-menu-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    width: 100%;
    border-radius: 12px;
    background: transparent;
    color: var(--ink-900);
    padding: .75rem .8rem;
    text-align: left;
}

.account-menu-icon {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .72;
}

.profile-panel {
    max-width: 52rem;
}

.billing-panel {
    max-width: 48rem;
}

.billing-price-card {
    display: grid;
    gap: .55rem;
    margin: 1rem 0;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(95, 158, 160, .08);
}

.billing-price-card p {
    margin: 0;
}

.billing-price {
    color: var(--ink-900);
    font-size: 2rem;
    font-weight: 800;
}

.billing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1rem;
}

.billing-actions form {
    margin: 0;
}

.profile-field-note {
    display: block;
    margin-top: .4rem;
    font-size: .85rem;
}

.profile-actions {
    margin-top: 1.25rem;
}

.danger-zone {
    border-color: rgba(170, 52, 52, .35);
}

.account-lifecycle-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
}

.account-lifecycle-actions form {
    display: grid;
    align-content: start;
    gap: .7rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
}

.danger-button {
    background: #a83232;
    color: #fff;
}

.danger-button:hover {
    background: #872626;
    color: #fff;
}

.analytics-hero { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.analytics-transaction-cards, .analytics-mobile-filters { display: none; }
.analytics-load-more { display: block; margin: 1rem auto 0; min-height: 44px; }
@media (max-width: 760px) {
    .analytics-transaction-table { display: none; }
    .analytics-mobile-filters { display: block; margin-bottom: 1rem; }
    .analytics-mobile-filters summary { cursor: pointer; padding-block: .75rem; font-weight: 700; }
    .analytics-filter-options { display: grid; gap: .75rem; padding-block: .5rem; }
    .analytics-filter-options .register-column-heading { justify-content: space-between; min-height: 44px; }
    .analytics-transaction-cards { display: grid; gap: .75rem; }
    .analytics-transaction-card { display: grid; gap: .6rem; min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow-wrap: anywhere; }
    .analytics-transaction-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1rem; }
    .analytics-transaction-heading > strong:first-child { flex: 1 1 9rem; min-width: 0; }
    .analytics-transaction-heading .amount-negative { white-space: nowrap; }
    .analytics-transaction-card time, .analytics-transaction-account { color: var(--ink-700); font-size: .9rem; }
    .analytics-transaction-comments { margin: 0; white-space: pre-wrap; font-size: .9rem; }
    .analytics-transaction-card .ghost-button { justify-self: end; min-height: 44px; }
}
.category-focus-field { position: relative; }
.category-focus-tooltip { display: none; position: absolute; bottom: calc(100% + .5rem); left: 0; z-index: 10; width: min(20rem, 100%); padding: .65rem .8rem; border-radius: .5rem; background: var(--ink-900); color: #fff; font-size: .85rem; line-height: 1.4; box-shadow: 0 4px 12px #0003; }
.category-focus-field:hover .category-focus-tooltip,
.category-focus-field:focus-within .category-focus-tooltip { display: block; }
.analytics-range { display: grid; gap: .35rem; min-width: 11rem; font-weight: 700; }
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
.analytics-grid > .panel { min-width: 0; }
.analytics-grid .panel-header > div { min-width: 0; overflow-wrap: anywhere; }
.analytics-wide { grid-column: 1 / -1; }
.cash-flow-chart { display: flex; align-items: end; gap: clamp(.5rem, 2vw, 1.5rem); min-height: 17rem; padding: 1rem .5rem 0; border-bottom: 1px solid var(--line); }
.cash-flow-month { display: grid; flex: 1; gap: .55rem; text-align: center; min-width: 0; }
.cash-flow-bars { height: 13rem; display: flex; align-items: end; justify-content: center; gap: .3rem; }
.cash-flow-bar { width: min(1.4rem, 40%); min-height: .25rem; border-radius: 7px 7px 2px 2px; }
.cash-flow-bar.income, .chart-legend i.income { background: var(--mint); }
.cash-flow-bar.spending, .chart-legend i.spending { background: var(--coral); }
.chart-legend { display: flex; justify-content: center; gap: 1.2rem; margin-top: 1rem; }
.chart-legend span { display: flex; align-items: center; gap: .4rem; }
.chart-legend i { width: .75rem; height: .75rem; border-radius: 3px; }
.analytics-list { display: grid; gap: 1rem; }
.analytics-list-item { display: grid; grid-template-columns: 1fr auto; gap: .35rem .7rem; }
.analytics-list-item > div:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; }
.analytics-track { height: .55rem; overflow: hidden; border-radius: 999px; background: rgba(34, 72, 112, .1); }
.analytics-track span { display: block; height: 100%; border-radius: inherit; }
.category-pie-layout { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 1.25rem; min-width: 0; }
.analytics-category-header { align-items: start; }
.analytics-category-limit { width: min(18rem, 100%); margin-bottom: 1rem; }
.category-count-select { display: grid; gap: .3rem; min-width: 10rem; font-weight: 700; }
.category-count-select span { font-size: .8rem; color: var(--ink-700); }
.category-pie { display: block; width: 100%; max-width: 36rem; height: auto; aspect-ratio: 1; overflow: visible; }
.category-pie-slice { cursor: pointer; stroke: #fff; stroke-width: 1.5; transition: transform .2s ease, filter .2s ease; transform-box: fill-box; transform-origin: center; }
.category-pie-slice:hover, .category-pie-slice:focus-visible { filter: brightness(1.07) drop-shadow(0 3px 4px rgba(31, 42, 46, .24)); outline: none; }
.category-pie-slice.selected { filter: drop-shadow(0 7px 6px rgba(31, 42, 46, .32)); stroke-width: 2.5; }
.category-pie-depth { filter: brightness(.58); opacity: .9; pointer-events: none; }
.category-pie-label { overflow: visible; pointer-events: none; }
.category-pie-label div { display: grid; place-content: center; height: 100%; color: #fff; font-weight: 800; line-height: 1.05; text-align: center; text-shadow: 0 1px 2px #1f2a2e, 0 0 3px #1f2a2e; white-space: nowrap; }
.category-pie-label span { display: block; }
.category-pie-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr)); align-items: start; gap: .4rem; width: 100%; min-width: 0; }
.category-pie-item strong { min-width: 0; overflow-wrap: anywhere; }
.category-pie-item { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .45rem; width: 100%; padding: .45rem .65rem; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink-900); text-align: left; box-shadow: none; }
.category-pie-item:hover, .category-pie-item.selected { border-color: rgba(34, 72, 112, .22); background: rgba(34, 72, 112, .07); box-shadow: none; transform: none; }
.table-scroll { overflow-x: auto; }

@media (max-width: 760px) {
    .analytics-hero { align-items: stretch; flex-direction: column; }
    .analytics-grid { grid-template-columns: minmax(0, 1fr); }
    .analytics-wide { grid-column: auto; }
    .cash-flow-chart { overflow-x: auto; }
    .cash-flow-month { min-width: 2.5rem; }
    .category-pie { max-width: 32rem; margin-inline: auto; }
    .analytics-grid .collapsible-panel > .panel-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }
    .analytics-grid .category-count-select { min-width: 0; width: 100%; }
    .analytics-grid .category-pie-item { min-height: 2.75rem; }
    .analytics-grid .list-row { flex-wrap: wrap; gap: .5rem 1rem; }
    .analytics-grid .list-row > div { min-width: 0; overflow-wrap: anywhere; }
}

.account-menu-item:hover {
    background: rgba(34, 72, 112, 0.08);
    box-shadow: none;
    transform: none;
}

.login-popover {
    width: min(23rem, calc(100vw - 2rem));
    overflow: visible;
}

.popover-login-form {
    display: grid;
    gap: .65rem;
    padding: 1rem;
}

.popover-login-form label {
    font-size: .88rem;
    font-weight: 700;
}

.popover-login-form input {
    padding: .75rem .85rem;
    border-radius: 13px;
}

.popover-login-form button {
    width: 100%;
    margin-top: .15rem;
}

.popover-sign-up {
    margin: 0;
    padding: 0 1rem 1rem;
    color: var(--ink-700);
    font-size: .9rem;
    text-align: center;
}

.popover-sign-up a {
    color: var(--accent);
    font-weight: 800;
}

.page-content {
    padding: 0 1.5rem 1.5rem;
}

.welcome-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
    align-items: center;
    gap: clamp(2rem, 6vw, 5rem);
    min-height: 30rem;
    padding: clamp(2rem, 6vw, 5rem);
    border-radius: 30px;
    background:
        radial-gradient(circle at 82% 16%, rgba(208, 140, 96, .22), transparent 28%),
        linear-gradient(145deg, rgba(245, 239, 228, .98), rgba(229, 239, 232, .92));
}

.welcome-hero-messaging {
    min-height: 37rem;
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 12%, rgba(208, 140, 96, .25), transparent 26%),
        radial-gradient(circle at 58% 92%, rgba(79, 131, 105, .16), transparent 31%),
        linear-gradient(145deg, rgba(247, 242, 233, .99), rgba(228, 239, 232, .95));
}

.welcome-new-badge {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .48rem .75rem;
    border: 1px solid rgba(34, 72, 112, .12);
    border-radius: 999px;
    background: rgba(255, 255, 255, .65);
    color: var(--accent);
    font-size: .82rem;
    font-weight: 800;
}

.welcome-hero-copy h1 {
    max-width: 15ch;
    margin: .7rem 0 1rem;
    font-size: clamp(2.25rem, 5vw, 4.6rem);
    line-height: .98;
    letter-spacing: -.055em;
}

.welcome-hero-copy p {
    max-width: 38rem;
    margin: 0 0 1.5rem;
    color: var(--ink-700);
    font-size: 1.08rem;
    line-height: 1.65;
}

.welcome-primary-action,
.welcome-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .9rem 1.3rem;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    font-weight: 800;
}

.welcome-action-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
}

.welcome-demo-form {
    margin: 0;
}

.welcome-demo-action {
    padding: .86rem 1.2rem;
    border: 1px solid rgba(34, 72, 112, .25);
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    color: var(--accent);
    font-weight: 800;
}

.welcome-demo-action:hover {
    background: white;
}

.demo-loading-dialog {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(17, 35, 51, .62);
    backdrop-filter: blur(7px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}

.demo-loading-dialog.is-visible {
    opacity: 1;
    visibility: visible;
}

.demo-loading-card {
    width: min(100%, 30rem);
    padding: 2.25rem 2rem;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 1.75rem;
    background: linear-gradient(145deg, #fff 0%, #f8f2e9 100%);
    box-shadow: 0 24px 70px rgba(12, 30, 46, .3);
    color: var(--ink-900);
    text-align: center;
}

.demo-loading-spinner {
    display: block;
    width: 3.25rem;
    height: 3.25rem;
    margin: 0 auto 1.25rem;
    border: .3rem solid rgba(34, 72, 112, .16);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: demo-loading-spin .8s linear infinite;
}

.demo-loading-card .eyebrow {
    display: block;
    margin-bottom: .55rem;
}

.demo-loading-card h2 {
    margin: 0;
    font-size: clamp(1.55rem, 5vw, 2rem);
}

.demo-loading-card p {
    margin: .85rem auto 0;
    color: var(--ink-700);
    line-height: 1.55;
}

.demo-loading-note {
    display: block;
    margin-top: 1rem;
    color: var(--accent);
    font-size: .86rem;
    font-weight: 800;
}

body.demo-is-loading {
    overflow: hidden;
}

.page-shell:has(.account-dialog-backdrop) {
    backdrop-filter: none;
}

@keyframes demo-loading-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .demo-loading-spinner {
        animation-duration: 1.8s;
    }
}

.demo-mode-badge {
    display: inline-flex;
    margin-top: .8rem;
    padding: .35rem .6rem;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: white;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.account-menu-demo-note {
    padding: .8rem 1rem .45rem;
    color: var(--ink-700);
    font-size: .8rem;
}

.welcome-text-link {
    color: var(--accent);
    font-weight: 800;
}

.welcome-text-link:hover {
    text-decoration: underline;
    text-underline-offset: .25rem;
}

.welcome-sign-in-hint {
    display: block;
    margin-top: 1rem;
    color: var(--ink-700);
    font-size: .9rem;
}

.welcome-snapshot {
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 26px;
    background: rgba(255, 255, 255, .78);
    box-shadow: var(--shadow);
}

.welcome-snapshot-value {
    margin: .45rem 0 1.25rem;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.04em;
}

.welcome-snapshot-row {
    display: grid;
    gap: .2rem;
    padding: .9rem 0;
    border-top: 1px solid var(--line);
}

.welcome-snapshot-row span {
    color: var(--ink-700);
    font-size: .82rem;
}

.welcome-phone-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 31rem;
}

.welcome-phone {
    position: relative;
    z-index: 1;
    width: min(100%, 23rem);
    padding: .65rem;
    border: 7px solid #263238;
    border-radius: 34px;
    background: #f7f8f8;
    box-shadow: 0 30px 70px rgba(37, 58, 72, .25);
    transform: rotate(1.5deg);
}

.welcome-phone-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    padding: .7rem .5rem .9rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.welcome-phone-top div {
    display: grid;
}

.welcome-phone-top span:not(.welcome-phone-avatar) {
    color: var(--ink-700);
    font-size: .72rem;
}

.welcome-phone-avatar {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: .72rem;
    font-weight: 800;
}

.welcome-chat {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    min-height: 20rem;
    padding: 1rem .55rem;
}

.welcome-bubble {
    max-width: 86%;
    margin: 0;
    padding: .7rem .85rem;
    border-radius: 17px;
    font-size: .86rem;
    line-height: 1.4;
}

.welcome-bubble-user {
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    background: var(--accent);
    color: white;
}

.welcome-bubble-agent {
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    background: #e5e8e9;
    color: var(--ink-900);
}

.welcome-phone-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .65rem;
    border-radius: 0 0 23px 23px;
    background: rgba(79, 131, 105, .12);
    color: #315e49;
    font-size: .74rem;
    font-weight: 800;
}

.welcome-float-card {
    position: absolute;
    z-index: 2;
    padding: .7rem .85rem;
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 15px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 14px 30px rgba(37, 58, 72, .14);
    color: var(--ink-700);
    font-size: .78rem;
}

.welcome-float-household {
    top: 13%;
    left: -5%;
}

.welcome-float-household strong {
    display: block;
    color: var(--accent);
    font-size: 1.3rem;
}

.welcome-float-secure {
    right: -7%;
    bottom: 15%;
    color: #315e49;
    font-weight: 800;
}

.welcome-proof-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding: 1.2rem clamp(1rem, 4vw, 3rem);
    border-bottom: 1px solid var(--line);
    color: var(--ink-700);
    font-size: .86rem;
    font-weight: 800;
    text-align: center;
}

.welcome-proof-strip span + span {
    border-left: 1px solid var(--line);
}

.welcome-service-status {
    padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 4vw, 3rem) 1rem;
}

.welcome-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.welcome-status-card {
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, .8);
}

.welcome-status-pill {
    display: inline-flex;
    padding: .38rem .7rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.welcome-status-pill.available {
    background: rgba(49, 94, 73, .12);
    color: #315e49;
}

.welcome-status-pill.review {
    background: rgba(180, 112, 59, .14);
    color: #8a4f26;
}

.welcome-status-pill.integration {
    background: rgba(69, 99, 128, .14);
    color: #31526f;
}

.welcome-status-pill.pending {
    background: rgba(48, 75, 101, .12);
    color: var(--navy);
}

.welcome-status-card h3 {
    margin: 1.1rem 0 .65rem;
    font-size: 1.2rem;
}

.welcome-status-card p {
    margin: 0;
    color: var(--ink-700);
    line-height: 1.6;
}

.welcome-status-card .welcome-status-note,
.welcome-status-card .welcome-status-links {
    margin-top: .85rem;
    font-size: .9rem;
}

.welcome-status-links a {
    color: var(--navy);
    font-weight: 700;
}

.welcome-assistant {
    padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 4vw, 3rem) 1rem;
}

.welcome-section-heading p {
    max-width: 42rem;
    margin: 1rem 0 0;
    color: var(--ink-700);
    line-height: 1.65;
}

.welcome-assistant-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.welcome-assistant-card {
    padding: 1.6rem;
    border-radius: 24px;
    background: var(--ink-900);
    color: white;
}

.welcome-assistant-icon {
    display: grid;
    width: 2.6rem;
    height: 2.6rem;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, .12);
    color: #f3c5a8;
    font-weight: 800;
}

.welcome-assistant-card h3 {
    margin: 1.5rem 0 .65rem;
}

.welcome-assistant-card p {
    margin: 0;
    color: rgba(255, 255, 255, .7);
    line-height: 1.6;
}

.welcome-features {
    padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 4vw, 3rem);
}

.welcome-section-heading {
    max-width: 48rem;
    margin-bottom: 2rem;
}

.welcome-section-heading h2,
.welcome-cta h2 {
    margin: .55rem 0 0;
    font-size: clamp(1.8rem, 3.4vw, 3rem);
    line-height: 1.08;
    letter-spacing: -.04em;
}

.welcome-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.welcome-feature-card {
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, .76);
}

.welcome-feature-number {
    color: var(--coral);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.welcome-feature-card h3 {
    margin: 1.25rem 0 .65rem;
    font-size: 1.2rem;
}

.welcome-feature-card p,
.welcome-cta p {
    margin: 0;
    color: var(--ink-700);
    line-height: 1.6;
}

.welcome-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    border-radius: 28px;
    background: var(--accent);
    color: white;
}

.welcome-cta p {
    margin-top: .75rem;
    color: rgba(255, 255, 255, .78);
}

.welcome-secondary-action {
    flex: 0 0 auto;
    background: white;
    color: var(--accent);
}

.dashboard-onboarding {
    display: grid;
    grid-template-columns: minmax(14rem, .7fr) minmax(0, 1.3fr);
    gap: 1.5rem;
    margin-bottom: 1.2rem;
    padding: 1.5rem;
    border: 1px solid rgba(79, 131, 105, .2);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(229, 239, 232, .94), rgba(255, 255, 255, .9));
    box-shadow: var(--shadow);
}

.dashboard-onboarding h2 {
    margin: .4rem 0 .55rem;
}

.dashboard-onboarding p {
    margin: 0;
    color: var(--ink-700);
    line-height: 1.55;
}

.dashboard-onboarding-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
}

.dashboard-onboarding-steps a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .85rem;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 255, 255, .78);
    color: var(--ink-900);
}

.dashboard-onboarding-steps a > span {
    display: grid;
    flex: 0 0 auto;
    width: 1.8rem;
    height: 1.8rem;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: .78rem;
    font-weight: 800;
}

.dashboard-onboarding-steps a.is-complete {
    color: var(--ink-700);
}

.dashboard-onboarding-steps a.is-complete > span {
    background: #4f8369;
}

.dashboard-empty-state {
    display: grid;
    gap: .5rem;
    padding: 1.15rem;
    border: 1px dashed rgba(34, 72, 112, .25);
    border-radius: 16px;
    background: rgba(245, 239, 228, .45);
}

.dashboard-empty-state span {
    color: var(--ink-700);
    line-height: 1.5;
}

.dashboard-empty-state a {
    color: var(--accent);
    font-weight: 800;
}

.hero-panel,
.panel,
.metric-card,
.category-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 35px rgba(37, 58, 72, 0.08);
}

.hero-panel {
    padding: 1.6rem;
    margin-bottom: 1.2rem;
    background:
        radial-gradient(circle at top right, rgba(208, 140, 96, 0.26), transparent 28%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(245, 239, 228, 0.98));
}

.hero-grid,
.dashboard-grid,
.split-grid,
.budget-grid,
.metric-grid,
.form-grid,
.stack,
.nav-grid {
    display: grid;
    gap: 1rem;
}

.hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.dashboard-grid {
    grid-template-columns: 1.35fr 1fr;
}

.split-grid {
    grid-template-columns: 1.2fr 0.95fr;
}

.register-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(400px, 480px);
    gap: 1.25rem;
    align-items: start;
}

.budget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.description-combobox {
    position: relative;
}

.description-suggestions {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.35rem);
    right: 0;
    left: 0;
    max-height: 18rem;
    overflow-y: auto;
    padding: 0.35rem;
    border: 1px solid rgba(31, 42, 46, 0.14);
    border-radius: 16px;
    background: white;
    box-shadow: 0 14px 34px rgba(37, 58, 72, 0.18);
}

.description-suggestion {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.description-suggestion button {
    border-radius: 12px;
    background: var(--header-bg);
    color: var(--ink-900);
    box-shadow: none;
}

.description-suggestion button:hover {
    transform: none;
    background: rgba(34, 72, 112, 0.08);
    box-shadow: none;
}

.description-suggestion-value {
    flex: 1;
    padding: 0.65rem 0.75rem;
    text-align: left;
}

.description-suggestion-delete {
    flex: 0 0 auto;
    padding: 0.55rem 0.75rem;
    color: var(--coral) !important;
    font-size: 1.2rem;
    line-height: 1;
}

.bills-panel > .panel-header {
    margin-bottom: 1.25rem;
}

.bills-panel h1 {
    margin-bottom: 0.45rem;
}

.category-card {
    min-width: 0;
}

.category-card-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.category-card-title {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    min-width: 0;
}

.category-card-title strong {
    display: block;
    min-width: 0;
    font-size: 0.94rem;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}

.category-card-header .pill {
    align-self: flex-start;
    white-space: nowrap;
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1.2rem;
}

.metric-card,
.panel,
.category-card {
    padding: 1.2rem;
}

.hero-copy {
    color: var(--ink-700);
    line-height: 1.65;
    max-width: 60ch;
}

.metric-label {
    display: block;
    color: var(--ink-700);
    font-size: 0.92rem;
    margin-bottom: 0.4rem;
}

.metric-value {
    font-size: clamp(1.45rem, 2vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.04em;
}

.panel-header,
.list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.panel-header {
    margin-bottom: 1rem;
}

.pending-payments-header {
    margin-top: 2rem;
}

.collapsible-panel.is-collapsed > .panel-header {
    margin-bottom: 0;
}

.collapsible-panel.is-collapsed > .register-header {
    margin-bottom: 0;
}

.collapse-card-button {
    flex: 0 0 auto;
    margin-left: auto;
    min-width: 7rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid rgba(34, 72, 112, 0.18);
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink-700);
    box-shadow: none;
}

.collapse-card-button:hover {
    border-color: rgba(34, 72, 112, 0.38);
    background: rgba(34, 72, 112, 0.07);
}

.collapse-card-button span {
    display: inline-block;
    width: 1rem;
    margin-right: 0.2rem;
    font-size: 1.15rem;
    line-height: 0;
}

.bank-connection-workspace {
    display: grid;
    gap: 1rem;
}

.bank-connection-status-row,
.bank-provider-status {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(34, 72, 112, 0.12);
    border-radius: 1rem;
    background: rgba(34, 72, 112, 0.035);
}

.bank-connection-status-row > div {
    flex: 1;
}

.bank-connection-status-row strong,
.bank-provider-status strong {
    display: block;
    color: var(--ink-900);
}

.bank-connection-status-row p,
.bank-provider-status p {
    margin: 0.25rem 0 0;
}

.bank-connection-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.bank-connection-actions button {
    min-height: 3rem;
    border-radius: 999px;
}

.bank-provider-status p {
    flex: 1;
}

.bank-consent-details {
    padding: 0.9rem 0;
}

.bank-consent-details summary {
    width: fit-content;
    cursor: pointer;
    color: var(--accent);
    font-weight: 700;
}

.bank-consent-details-body {
    max-width: 68rem;
    padding-top: 0.75rem;
}

.bank-consent-check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.linked-institution-list,
.linked-account-list {
    display: grid;
    gap: 1rem;
}

.linked-institution-group {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.62);
}

.linked-institution-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    background: rgba(34, 72, 112, 0.055);
}

.linked-institution-heading h3,
.linked-account-identity h4,
.linked-account-identity p {
    margin: 0;
}

.linked-account-list {
    gap: 0;
}

.linked-account-sort {
    display: grid;
    gap: 0.25rem;
    color: var(--ink-700);
    font-size: 0.75rem;
    font-weight: 700;
}

.linked-account-sort select {
    min-width: 8.5rem;
    min-height: 2.75rem;
    padding-block: 0.5rem;
}

.register-section-actions.available-accounts-actions {
    align-items: end;
}

.available-accounts-actions .collapse-card-button {
    min-height: 2.75rem;
}

.linked-account-card {
    display: grid;
    grid-template-columns: minmax(15rem, 1.35fr) minmax(15rem, 1.2fr) auto;
    align-items: end;
    gap: 1rem;
    padding: 1.15rem;
}

.linked-account-card + .linked-account-card {
    border-top: 1px solid var(--line);
}

.linked-account-identity {
    display: grid;
    justify-items: start;
    gap: 0.35rem;
}

.linked-account-identity h4 {
    font-size: 1.08rem;
}

.linked-account-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.rename-account-button {
    min-height: auto;
    padding: 0.2rem 0.55rem;
    border: 1px solid rgba(34, 72, 112, 0.2);
    border-radius: 999px;
    background: transparent;
    color: var(--accent);
    font-size: 0.78rem;
    box-shadow: none;
}

.rename-account-button:hover {
    transform: none;
    box-shadow: none;
    background: rgba(34, 72, 112, 0.07);
}

.linked-account-field {
    display: grid;
    gap: 0.4rem;
    color: var(--ink-700);
    font-size: 0.88rem;
    font-weight: 700;
}

.linked-account-field input,
.linked-account-field select {
    width: 100%;
    min-width: 0;
}

.bank-disconnect-button {
    min-height: 2.75rem;
    padding: 0.65rem 0.9rem;
    white-space: nowrap;
}

.alias-dialog {
    width: min(34rem, calc(100vw - 2rem));
}

.disconnect-dialog {
    width: min(38rem, calc(100vw - 2rem));
}

.disconnect-dialog-copy {
    display: grid;
    gap: 0.75rem;
    margin-block: 0.5rem 1.25rem;
    color: var(--ink-700);
}

.disconnect-dialog-copy p {
    margin: 0;
}

.alias-dialog > label {
    display: grid;
    gap: 0.45rem;
    font-weight: 700;
}

.alias-dialog > label input {
    width: 100%;
}

.linked-account-actions {
    display: flex;
    justify-content: flex-end;
}

.bank-disconnect-button {
    color: var(--coral);
    border-color: rgba(190, 61, 54, 0.24);
}

@media (max-width: 1050px) {
    .linked-account-card {
        grid-template-columns: minmax(12rem, 1fr) minmax(14rem, 1fr);
        align-items: start;
    }

    .linked-account-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 700px) {
    .bank-connections-page > .collapsible-panel > .panel-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .bank-connections-page > .collapsible-panel > .panel-header > .register-section-actions {
        display: contents;
    }

    .bank-connections-page > .collapsible-panel > .panel-header > .register-section-actions > :not(.collapse-card-button) {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .bank-connections-page > .collapsible-panel > .panel-header > .register-section-actions > .collapse-card-button {
        grid-column: 2;
        grid-row: 1;
        width: auto;
    }

    .bank-connection-status-row,
    .bank-provider-status {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .bank-provider-status p {
        flex-basis: 100%;
    }

    .bank-connection-actions button {
        width: 100%;
    }

    .linked-account-card {
        grid-template-columns: 1fr;
    }

    .linked-institution-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.15rem;
    }

    .linked-account-sort {
        width: 100%;
    }

    .linked-account-sort select {
        width: 100%;
    }
}

.inline-title-metrics {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.45rem;
    margin-bottom: 0.7rem;
}

.register-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.register-main-panel {
    min-width: 0;
}

.register-heading-copy {
    min-width: 0;
    max-width: 34rem;
}

.register-heading-copy .eyebrow {
    margin-bottom: 0.65rem;
}

.register-heading-copy h1 {
    margin: 0 0 0.85rem;
}

.register-heading-copy p {
    margin: 0;
    max-width: 30rem;
    line-height: 1.45;
}

.register-filter {
    min-width: 0;
}

.register-filter label {
    display: block;
    margin-bottom: 0.35rem;
}

.register-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.15rem;
    margin-bottom: 1.25rem;
}

.register-toolbar .register-filter {
    width: 100%;
}

.register-account-filter {
    max-width: 35rem;
}

.register-overview-layout {
    display: grid;
    grid-template-columns: minmax(23rem, 35rem) minmax(17rem, 20rem);
    align-items: start;
    gap: 1.15rem;
}

.register-balance-layout {
    display: block;
    width: 100%;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(245, 239, 228, 0.38);
}

.register-balance-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 23rem;
}

.register-account-balance {
    display: grid;
    grid-template-columns: 11rem auto;
    align-items: baseline;
    gap: 0.65rem;
}

.register-account-balance strong {
    font-size: 1rem;
}

.register-roundup-balance {
    grid-template-columns: 11rem auto minmax(0, 1fr);
    align-self: stretch;
    margin-top: 0.15rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--line);
}

.register-roundup-balance .metric-label {
    grid-column: 1;
    grid-row: 1;
}

.register-roundup-balance strong {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    white-space: nowrap;
}

.register-roundup-transfer {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    min-height: 2.4rem;
    padding: 0.5rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.register-calculator {
    display: flex;
    flex-direction: column;
    padding: 0.85rem;
    border: 1px solid #66839e;
    border-radius: 18px;
    background: #466887;
}

.register-calculator.expanded .metric-label {
    color: #fff;
}

.register-calculator.collapsed {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
}

.register-calculator-launch {
    width: 100%;
    min-height: 3.6rem;
    padding: 0.8rem 1.45rem;
    background: #466887;
    color: #fff;
    font-weight: 700;
}

.register-calculator-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 0.15rem;
}

.register-calculator-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: #fff;
    color: #244f76;
    font: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
}

.register-calculator-close:hover,
.register-calculator-close:focus-visible {
    border-color: #24527c;
    background: #fff;
}

.register-calculator-content {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 0.7rem;
}

.register-calculator-display {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 2.7rem;
    padding: 0.5rem 0.7rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface, #fff);
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.register-calculator-display:focus-visible {
    border-color: var(--navy);
    outline: 2px solid rgba(36, 82, 124, 0.2);
    outline-offset: 2px;
}

.register-calculator-keys {
    display: grid;
    grid-template-columns: repeat(4, minmax(2.5rem, 1fr));
    gap: 0.4rem;
}

.register-calculator-keys button {
    min-height: 2.35rem;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.register-calculator-keys button:hover,
.register-calculator-keys button:focus-visible {
    border-color: var(--navy);
    background: #fff;
}

.register-calculator-keys .calculator-function {
    background: rgba(224, 229, 232, 0.72);
}

.register-calculator-keys .calculator-operator,
.register-calculator-keys .calculator-equals {
    background: var(--navy);
    color: #fff;
}

.register-calculator-keys .calculator-operator:hover,
.register-calculator-keys .calculator-operator:focus-visible,
.register-calculator-keys .calculator-equals:hover,
.register-calculator-keys .calculator-equals:focus-visible {
    background: var(--navy-strong, #14395d);
}

.calculator-zero {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .register-overview-layout {
        grid-template-columns: minmax(0, 35rem);
    }

    .register-calculator {
        max-width: 20rem;
    }
}

@media (max-width: 780px) {
    .register-balance-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .register-balance-group {
        width: 100%;
        min-width: 0;
    }

    .register-account-balance {
        width: 100%;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .register-roundup-balance {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .register-roundup-transfer {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: start;
    }

}

.register-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.register-summary-chip {
    min-width: 0;
    padding: 0.9rem 1rem;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 239, 228, 0.76));
    border: 1px solid var(--line);
}

.register-summary-chip strong {
    display: block;
    font-size: 1rem;
}

.linked-bill-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.75rem;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(59, 122, 87, 0.25);
    border-radius: 14px;
    background: rgba(59, 122, 87, 0.08);
    color: var(--ink-900);
}

.table-shell {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 24px;
}

.register-transactions-shell {
    max-height: 37rem;
    overflow: auto;
}

.register-transactions-shell .data-table thead th {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1;
}

.register-table-section + .register-table-section {
    margin-top: 1.75rem;
}

.register-table-section {
    min-width: 0;
}

.register-search {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(34, 72, 112, 0.035);
}

.register-search + .register-table-section {
    margin-top: 2rem;
}

.register-search-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.register-search-header h2,
.register-search-header p {
    margin: 0;
}

.register-search-header h2 {
    margin-top: 0.2rem;
}

.register-search-header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.65rem;
}

.register-search-grid {
    display: grid;
    grid-template-columns: minmax(20rem, 3fr) repeat(4, minmax(8rem, 1fr));
    gap: 0.75rem;
    align-items: end;
}

.register-advanced-filters {
    display: contents;
}

.mobile-filter-toggle,
.mobile-filter-sheet-header,
.mobile-filter-done,
.register-mobile-list {
    display: none;
}

.transaction-search-combobox {
    position: relative;
}

.transaction-search-matches {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    left: 0;
    z-index: 30;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.transaction-search-match {
    display: flex;
    width: 100%;
    min-height: 0;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0.8rem;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    color: var(--ink-900);
    text-align: left;
}

.transaction-search-match + .transaction-search-match {
    border-top: 1px solid var(--line);
}

.transaction-search-match:hover,
.transaction-search-match:focus-visible {
    background: rgba(15, 118, 110, 0.07);
}

.transaction-search-match > span:first-child {
    display: grid;
    min-width: 0;
}

.transaction-search-match strong,
.transaction-search-match small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-search-match small {
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 500;
}

.register-search-grid label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.register-search-actions {
    display: flex;
    align-items: flex-end;
}

.register-search-actions button {
    width: 100%;
}

.register-grid-filters-retired {
    display: none !important;
}

.register-column-heading {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    white-space: nowrap;
}

.register-column-filter {
    position: relative;
    display: inline-grid;
    width: 1.7rem;
    height: 1.7rem;
    flex: 0 0 1.7rem;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    cursor: pointer;
}

.register-column-filter.active {
    border-color: var(--accent);
    background: rgba(34, 72, 112, 0.1);
    color: var(--accent);
}

.register-column-filter:has(select:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.button-spinner {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    flex: 0 0 0.9rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: button-spinner-turn 0.7s linear infinite;
}

@keyframes button-spinner-turn {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .button-spinner { animation-duration: 1.4s; }
}

.register-column-filter select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    opacity: 0;
}

.register-mobile-column-filters {
    display: none;
}

.register-grid-filters {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
}

.register-grid-filters > span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.register-grid-filter-button {
    flex: 0 0 auto;
    min-height: 2.15rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-700);
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.register-grid-filter-button.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.nav-shell {
    padding-top: 1.2rem;
}

.bill-entries-shell,
.creditor-register-shell {
    max-height: 24rem;
    overflow: auto;
}

.creditor-transactions-mobile {
    display: none;
}

.bill-entries-shell .data-table thead th,
.creditor-register-shell .data-table thead th {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1;
}

.nav-item-link {
    display: flex;
    flex-direction: column;
    position: relative;
    gap: 0.2rem;
    padding: 0.95rem 1rem;
    border-radius: 22px;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    border: 1px solid transparent;
    transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.nav-item-link.active {
    background: rgba(255, 255, 255, 0.14);
    color: white;
    border-color: rgba(255, 255, 255, 0.12);
}

.nav-item-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.nav-label {
    font-weight: 700;
}

.nav-mobile-icon {
    display: none;
}

.nav-copy {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.68);
}

.demo-nav-tip {
    position: absolute;
    top: 50%;
    left: calc(100% + 0.85rem);
    z-index: 20;
    width: min(20rem, calc(100vw - 3rem));
    padding: 0.9rem 1rem;
    border: 1px solid rgba(15, 118, 110, 0.2);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    color: #334155;
    font-size: 0.88rem;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    transform: translate(0.5rem, -50%);
    transition: opacity 140ms ease, transform 140ms ease;
}

.demo-nav-tip::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    border: 8px solid transparent;
    border-right-color: #ffffff;
    transform: translateY(-50%);
}

.demo-nav-tip strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #0f766e;
    font-size: 0.94rem;
}

.nav-item-link:hover .demo-nav-tip,
.nav-item-link:focus-visible .demo-nav-tip {
    opacity: 1;
    transform: translate(0, -50%);
}

.demo-page-guide {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 50;
}

.demo-page-guide-card {
    width: min(23rem, calc(100vw - 2rem));
    padding: 1.1rem 1.15rem;
    border: 1px solid rgba(15, 118, 110, 0.25);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.22);
    color: #334155;
}

.demo-page-guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.demo-page-guide-badge {
    color: #0f766e;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.demo-page-guide-close {
    display: grid;
    width: 2rem;
    height: 2rem;
    min-height: 0;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 1.3rem;
    line-height: 1;
}

.demo-page-guide-card h2 {
    margin: 0.5rem 0 0.3rem;
    color: #0f172a;
    font-size: 1.12rem;
}

.demo-page-guide-card p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.45;
}

.demo-page-guide-card ol {
    display: grid;
    gap: 0.55rem;
    margin: 0.85rem 0;
    padding-left: 1.3rem;
    font-size: 0.86rem;
    line-height: 1.42;
}

.demo-page-guide-card li::marker {
    color: #0f766e;
    font-weight: 800;
}

.demo-page-guide-hint {
    display: block;
    padding-top: 0.7rem;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.78rem;
}

.demo-page-guide-launcher {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.85rem;
    padding: 0.55rem 0.9rem 0.55rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: #0f766e;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.24);
    color: #ffffff;
    font-weight: 750;
}

.demo-page-guide-launcher span:first-child {
    display: grid;
    width: 1.7rem;
    height: 1.7rem;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.demo-guide-mobile {
    display: none;
}

.demo-mobile-guide-step,
.demo-mobile-guide-progress,
.demo-mobile-guide-actions {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .demo-nav-tip {
        transition: none;
    }
}

.list-clean {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-row {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
}

.list-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.bill-list-row {
    align-items: stretch;
}

.bill-list-button {
    display: flex;
    flex: 1 1 auto;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    text-align: left;
    box-shadow: none;
}

.bill-list-button:hover {
    background: rgba(245, 239, 228, 0.48);
    transform: none;
    box-shadow: none;
}

.bill-list-copy {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.list-clean li:last-child.bill-list-row {
    border-bottom: 0;
    padding-bottom: 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
    background: rgba(34, 72, 112, 0.08);
    color: var(--accent);
}

.pill.warn {
    background: rgba(181, 82, 57, 0.12);
    color: var(--coral);
}

.pill.good,
.amount-positive,
.message {
    color: var(--mint);
}

.pill.good {
    background: rgba(59, 122, 87, 0.14);
}

.amount-positive,
.amount-negative {
    font-weight: 700;
}

.amount-negative,
.validation-message {
    color: var(--coral);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.data-table th {
    color: var(--ink-700);
    font-weight: 600;
    font-size: 0.92rem;
}

.sort-button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 1.7rem;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    box-shadow: none;
}

.sort-button:hover {
    transform: none;
    box-shadow: none;
    color: var(--accent);
}

.sort-button.active {
    color: var(--accent);
}

.sort-indicator {
    display: inline-grid;
    width: 1rem;
    height: 1.7rem;
    place-items: center;
    font-size: 0.95rem;
    line-height: 1;
    color: currentColor;
}

.data-table tbody tr:hover {
    background: rgba(245, 239, 228, 0.4);
}

.register-table {
    width: 100%;
    min-width: 835px;
}

.register-table th:first-child,
.register-table td:first-child {
    padding-left: 1rem;
}

.register-table th:last-child,
.register-table td:last-child {
    padding-right: 1rem;
}

.register-table th:last-child {
    line-height: 1.7rem;
    text-align: center;
}

.register-date-cell {
    min-width: 118px;
    white-space: nowrap;
}

.register-description-cell {
    min-width: 220px;
}

.register-account-cell {
    min-width: 235px;
}

.register-account-cell strong {
    display: block;
}

.register-budget-cell {
    min-width: 135px;
}

.register-status-cell {
    min-width: 110px;
    white-space: nowrap;
}

.register-amount-cell {
    min-width: 120px;
    text-align: right;
    white-space: nowrap;
}

.register-actions-cell {
    min-width: 235px;
    white-space: nowrap;
}

.account-actions-cell {
    min-width: 108px;
    white-space: nowrap;
}

.account-dialog-backdrop {
    grid-template-columns: minmax(0, 1fr);
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    overflow-y: auto;
    padding: 2rem;
    background: rgba(20, 34, 45, 0.56);
    backdrop-filter: blur(4px);
}

.account-dialog {
    width: min(52rem, 100%);
    min-width: 0;
    max-width: 100%;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.3);
}

.account-dialog-header {
    align-items: flex-start;
}

.account-dialog-header h2 {
    margin-bottom: 0.35rem;
}

.transaction-dialog {
    width: min(64rem, 100%);
}

.activity-creditor-selection {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1rem;
}

.nested-dialog-backdrop { z-index: 1100; }
.creditor-picker-dialog { width: min(38rem, 100%); }

.creditor-picker-list {
    display: grid;
    gap: 0.6rem;
    max-height: 22rem;
    overflow-y: auto;
}

.creditor-picker-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    cursor: pointer;
}

.creditor-picker-option:has(input:checked) {
    border-color: var(--accent);
    background: rgba(34, 72, 112, 0.08);
}

.creditor-picker-option input { width: auto; }
.creditor-picker-option span { display: grid; gap: 0.15rem; }
.creditor-picker-option small { color: var(--ink-700); }

.creditor-picker-charges {
    display: grid;
    gap: 0.6rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.creditor-picker-charges h3 { margin: 0; }
.creditor-picker-charges .creditor-picker-option span { flex: 1; }
.creditor-picker-option input.creditor-payment-amount { width: 8rem; min-width: 0; margin-left: auto; }
.creditor-picker-option span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
    .creditor-picker-charges .creditor-picker-option { flex-wrap: wrap; }
    .creditor-picker-charges .creditor-picker-option span { flex-basis: calc(100% - 3rem); }
    .creditor-picker-option input.creditor-payment-amount { width: 100%; margin-left: 0; }
}

.register-creditor-link {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--surface-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.register-creditor-link p { margin: 0.25rem 0 0; }

.creditor-transaction-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
}

.creditor-transaction-details div { display: grid; gap: 0.2rem; }
.creditor-transaction-details .full { grid-column: 1 / -1; }
.creditor-transaction-details dt { color: var(--ink-700); font-weight: 700; }
.creditor-transaction-details dd { margin: 0; }

.bank-activity-account-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.bank-activity-overview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--header-bg);
}

.bank-activity-overview p { margin: 0.2rem 0 0; }
.bank-activity-overview .register-column-heading { gap: 0.25rem; }

.bank-activity-overview-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.bank-activity-account-group {
    margin-top: 1.25rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.bank-activity-account-heading {
    padding: 0.9rem 1rem;
    background: var(--header-bg);
}

.bank-activity-account-heading h3 { margin: 0; }
.bank-activity-account-group .table-shell { border: 0; border-radius: 0; }
.bank-activity-account-group .data-table { margin: 0; }
.bank-activity-mobile-controls { display: none; }

@media (max-width: 760px) {
    .bank-activity-overview { align-items: flex-start; flex-direction: column; }
    .bank-activity-overview-actions { justify-content: flex-start; }

    .bank-activity-account-heading {
        align-items: baseline;
        padding: 0.85rem 1rem;
    }

    .bank-activity-account-heading h3 {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .bank-activity-mobile-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        border-top: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
        background: #fff;
    }

    .bank-activity-mobile-controls .register-column-heading {
        min-width: 0;
        justify-content: space-between;
        padding: 0.45rem 0.6rem;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: var(--header-bg);
    }

    .data-table.bank-activity-table {
        display: table;
        overflow: visible;
        white-space: normal;
    }

    .bank-activity-table thead {
        display: none;
    }

    .bank-activity-table tbody,
    .bank-activity-table tr,
    .bank-activity-table td {
        display: block;
        width: 100%;
    }

    .bank-activity-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.75rem 1rem;
        padding: 1rem;
        border-bottom: 1px solid var(--line);
    }

    .bank-activity-table tr:last-child {
        border-bottom: 0;
    }

    .bank-activity-table td {
        min-width: 0;
        padding: 0;
        border: 0;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .bank-activity-table td::before {
        display: block;
        margin-bottom: 0.2rem;
        color: var(--ink-700);
        content: attr(data-label);
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .bank-activity-table td:nth-child(2) {
        grid-column: 1 / -1;
        grid-row: 1;
        font-size: 1.05rem;
    }

    .bank-activity-table td:nth-child(1) { grid-column: 1; grid-row: 2; }
    .bank-activity-table td:nth-child(4) { grid-column: 2; grid-row: 2; text-align: right; }
    .bank-activity-table td:nth-child(3) { grid-column: 1; grid-row: 3; }

    .bank-activity-table .bank-activity-row-action {
        grid-column: 2;
        grid-row: 3;
        align-self: center;
        text-align: right;
    }

    .bank-activity-table .bank-activity-row-action .ghost-button {
        min-height: 2.65rem;
    }
}

.transaction-dialog .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.register-section-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.65rem;
}

.bills-header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.account-dialog .form-actions {
    margin: 1.25rem 0 0;
    padding: 0.9rem 0 0;
}

.roundup-transfer-notice {
    width: min(34rem, 100%);
}

.roundup-transfer-notice > p {
    line-height: 1.55;
}

.roundup-transfer-notice > p strong {
    color: var(--green, #2f7d57);
}

.roundup-transfer-confirmation-actions {
    display: flex;
    gap: 0.75rem;
}

@media (max-width: 700px) {
    .collapsible-panel > .panel-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .collapsible-panel > .panel-header > .collapse-card-button {
        grid-column: 2;
        grid-row: 1;
        margin: 0;
    }

    .register-table-section {
        overflow-x: clip;
    }

    .register-activity-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.85rem;
    }

    .register-activity-header .register-section-actions {
        display: contents;
    }

    .register-activity-header .register-section-actions button {
        min-width: 0;
        min-height: 2.9rem;
        margin: 0;
        padding: 0.55rem 0.7rem;
    }

    .register-activity-header .register-section-actions > button:first-child {
        grid-row: 2;
        grid-column: 1 / -1;
        width: 100%;
    }

    .register-activity-header .register-section-actions > .collapse-card-button {
        grid-row: 1;
        grid-column: 2;
        width: auto;
        min-width: 7rem;
    }

    .register-mobile-column-filters,
    .register-column-filter-controls,
    .register-mobile-list,
    .register-mobile-card {
        min-width: 0;
        max-width: 100%;
    }

    .register-column-filter-controls > :last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .accounts-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .accounts-header > button {
        width: 100%;
        justify-self: stretch;
    }

    .primary-action-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .bills-panel > .panel-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 0.75rem;
    }

    .bills-panel > .panel-header .collapse-card-button {
        margin: 0;
    }

    .bills-panel,
    .bills-panel > div,
    .bills-panel .stack,
    .bills-panel .category-card,
    .bills-panel .scheduled-payments-mobile,
    .bills-panel .scheduled-payment-mobile-item {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .bills-panel {
        width: 100%;
        max-width: 100%;
    }

    .bills-panel .category-card {
        overflow: hidden;
        padding: 1rem;
    }

    .bills-panel .pending-payments-header {
        min-width: 0;
        margin-top: 0;
    }

    .bills-panel .pending-payments-header > div {
        min-width: 0;
        max-width: 100%;
    }

    .bills-panel .pending-payments-header p {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .page-primary-action {
        width: 100%;
        max-width: 100%;
        min-height: 3.6rem;
        padding: 0.75rem 1.2rem;
        border-radius: 999px;
        background: var(--accent);
        color: #fff;
        font-weight: 700;
    }

    .primary-action-panel,
    .primary-action-panel .panel-header,
    .primary-action-panel .table-shell {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .primary-action-panel {
        overflow: hidden;
    }

    .account-dialog-backdrop {
        align-items: end;
        padding: 0;
    }

    .account-dialog {
        width: 100%;
        max-height: 94vh;
        max-height: 94dvh;
        padding: 0 1rem max(1rem, env(safe-area-inset-bottom));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 24px 24px 0 0;
    }

    .account-dialog-header {
        position: sticky;
        top: 0;
        z-index: 2;
        margin: 0 -1rem 0.5rem;
        padding: 1rem;
        background: #fff;
    }

    .account-dialog-header .demo-page-guide-close {
        flex: 0 0 2.75rem;
        width: 2.75rem;
        height: 2.75rem;
    }

    .account-dialog .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .account-dialog .form-grid > * {
        grid-column: 1;
        min-width: 0;
    }

    .account-dialog .form-actions {
        display: grid;
        grid-template-columns: 1fr;
        margin: 1.25rem 0 0;
        padding: 0;
    }

    .account-dialog .form-actions button {
        width: 100%;
    }

    .transaction-dialog .creditor-register-shell {
        display: none;
    }

    .creditor-transactions-mobile {
        display: grid;
        gap: 0.75rem;
        width: 100%;
        min-width: 0;
    }

    #creditor-account-view .creditor-transaction-history:last-child {
        padding-bottom: max(6rem, calc(env(safe-area-inset-bottom) + 5rem));
    }

    .creditor-transaction-mobile-card {
        display: grid;
        gap: 0.8rem;
        width: 100%;
        min-width: 0;
        padding: 1rem;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 7px 18px rgba(15, 23, 42, 0.06);
    }

    .creditor-transaction-mobile-card.register-row-active {
        border-color: rgba(15, 118, 110, 0.55);
        box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
    }

    .creditor-transaction-mobile-heading,
    .creditor-transaction-mobile-meta {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.75rem;
        min-width: 0;
    }

    .creditor-transaction-mobile-heading > strong:first-child {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .creditor-transaction-mobile-heading > strong:last-child {
        white-space: nowrap;
    }

    .creditor-transaction-mobile-meta {
        color: var(--muted);
        font-size: 0.86rem;
    }

    .creditor-transaction-mobile-comments {
        margin: 0;
        color: var(--ink-700);
        font-size: 0.9rem;
        overflow-wrap: anywhere;
    }

    .creditor-transaction-mobile-footer {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding-top: 0.75rem;
        border-top: 1px solid var(--line);
    }

    .creditor-transaction-mobile-footer .muted {
        margin-right: auto;
    }

    .register-section-actions {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .register-section-actions button {
        width: 100%;
    }
}

.budget-drilldown-row {
    cursor: pointer;
}

.budget-drilldown-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.budget-category-name {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

.budget-category-chevron {
    flex: 0 0 0.8rem;
    color: var(--accent);
    font-size: 1rem;
    line-height: 1.15;
}

.budget-drilldown-row.is-expanded,
.budget-detail-row {
    background: rgba(245, 239, 228, 0.4);
}

.budget-detail-row > td {
    padding: 0 0.75rem 0.75rem;
}

.budget-transaction-list {
    border-left: 3px solid var(--accent);
    padding-left: 0.8rem;
}

.budget-transaction-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--line);
}

.budget-transaction-item > .table-action-button {
    flex: 0 0 auto;
}

.budget-transaction-item:last-child {
    border-bottom: 0;
}

.budget-transaction-item > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.6rem;
}

.scheduled-payment-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.scheduled-payments-mobile {
    display: none;
}

.creditor-accounts-mobile {
    display: none;
}

.budget-categories-mobile {
    display: none;
}

.dashboard-register-mobile {
    display: none;
}

.dashboard-pending-mobile {
    display: none;
}

.dashboard-budget-mobile {
    display: none;
}

@media (max-width: 780px) {
    .budget-categories-table {
        display: none;
    }

    .budget-categories-mobile,
    .budget-category-mobile-card {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .budget-categories-mobile {
        display: grid;
        border: 1px solid var(--line);
        border-radius: 20px;
        overflow: hidden;
    }

    .budget-category-mobile-card {
        display: grid;
        gap: 0.7rem;
        padding: 1rem;
        background: #fff;
        border-bottom: 1px solid var(--line);
    }

    .budget-category-mobile-card:last-child {
        border-bottom: 0;
    }

    .budget-category-mobile-primary,
    .budget-category-mobile-footer {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.75rem;
        min-width: 0;
    }

    .budget-category-mobile-name {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 0.6rem;
    }

    .budget-category-mobile-name strong {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .budget-category-mobile-footer button {
        grid-column: 2;
        min-width: 4.75rem;
    }

    .creditor-accounts-panel,
    .creditor-accounts-panel > div,
    .creditor-accounts-mobile,
    .creditor-account-mobile-card {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .creditor-accounts-panel {
        overflow: hidden;
    }

    .creditor-accounts-table {
        display: none;
    }

    .creditor-accounts-mobile {
        display: grid;
        border: 1px solid var(--line);
        border-radius: 20px;
        overflow: hidden;
    }

    .creditor-account-mobile-card {
        display: grid;
        gap: 0.55rem;
        padding: 1rem;
        background: #fff;
        border-bottom: 1px solid var(--line);
    }

    .creditor-account-mobile-card:last-child {
        border-bottom: 0;
    }

    .creditor-account-mobile-primary {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.75rem;
        min-width: 0;
    }

    .creditor-account-mobile-primary strong:first-child,
    .creditor-account-mobile-details {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .creditor-account-mobile-actions {
        display: flex;
        justify-content: flex-end;
        gap: 0.45rem;
        padding-top: 0.2rem;
    }

    .creditor-account-mobile-actions button {
        min-width: 4.75rem;
    }

    .dashboard-register-row {
        display: block;
        white-space: normal;
    }

    .dashboard-register-row > .dashboard-register-desktop,
    .dashboard-register-row > .amount-positive,
    .dashboard-register-row > .amount-negative {
        display: none;
    }

    .dashboard-register-mobile {
        display: grid;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        gap: 0.55rem;
    }

    .dashboard-register-mobile-primary,
    .dashboard-register-mobile-meta {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.75rem;
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .dashboard-register-mobile-primary strong:first-child,
    .dashboard-register-mobile-meta span:first-child {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .dashboard-register-mobile-primary strong:last-child,
    .dashboard-register-mobile-meta span:last-child {
        justify-self: end;
        white-space: nowrap;
    }

    .dashboard-register-mobile-meta {
        color: var(--ink-600);
        font-size: 0.9rem;
    }

    .dashboard-register-mobile-category {
        display: flex;
        justify-content: flex-start;
    }

    .scheduled-payments-table {
        display: none;
    }

    .scheduled-payments-mobile {
        display: grid;
        gap: 0.75rem;
    }

    .scheduled-payment-mobile-item {
        display: grid;
        gap: 0.6rem;
        padding: 1rem;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 7px 18px rgba(15, 23, 42, 0.06);
    }

    .scheduled-payment-mobile-footer {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.75rem;
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .scheduled-payment-mobile-creditor,
    .scheduled-payment-mobile-account {
        display: block;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .scheduled-payment-mobile-account {
        color: var(--ink-700);
        font-size: 0.9rem;
    }

    .scheduled-payment-mobile-category {
        display: flex;
        min-width: 0;
        justify-content: flex-start;
    }

    .scheduled-payment-mobile-category .register-category-pill {
        max-width: 100%;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .scheduled-payment-mobile-date-amount {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 0.55rem;
        font-size: 0.86rem;
    }

    .scheduled-payment-mobile-date-amount span,
    .scheduled-payment-mobile-date-amount strong {
        white-space: nowrap;
    }

    .scheduled-payment-mobile-footer {
        min-height: 2.6rem;
    }

    .scheduled-payment-mobile-footer .scheduled-payment-actions {
        justify-self: end;
        margin-left: auto;
        flex: 0 0 auto;
    }

    .scheduled-payment-mobile-footer .scheduled-payment-actions button {
        min-width: 4rem;
        padding-right: 0.65rem;
        padding-left: 0.65rem;
    }
}

.amount-tools-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
}

.amount-tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.statement-toggle {
    min-width: 7.5rem;
}

.statement-balance-tool {
    display: grid;
    width: min(100%, 28rem);
    gap: 0.65rem;
    margin-top: 0.75rem;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(34, 72, 112, 0.045);
}

.statement-balance-summary {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem 1rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.creditor-balance-compact {
    display: grid;
    width: min(100%, 22rem);
    gap: 0.15rem;
    margin-top: 0.85rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.65);
}

.creditor-balance-compact strong {
    font-size: 1.2rem;
}


.register-action-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.45rem;
}

.table-action-button {
    min-width: 4.8rem;
    justify-content: center;
    padding: 0.5rem 0.75rem;
}

.register-row-active {
    background: rgba(34, 72, 112, 0.08);
}

.register-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    margin-top: 0.35rem;
    font-size: 0.9rem;
}

.register-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.7rem;
}

.register-category-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.6rem;
    border-radius: 999px;
    font-size: 0.82rem;
    background: rgba(34, 72, 112, 0.08);
    color: var(--accent);
}

.register-sidebar {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.register-sidebar .panel {
    min-width: 0;
}

.register-sidebar .form-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

.register-sidebar .field-check {
    padding: 0.15rem 0;
}

.register-sidebar .form-actions {
    align-items: stretch;
}

.register-sidebar .form-actions button {
    width: 100%;
}

.register-sidebar .form-actions .message {
    margin: 0;
}

.reconcile-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin: 1rem 0;
}

.reconcile-card {
    padding: 1rem;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 239, 228, 0.68));
}

.reconcile-card .metric-value {
    display: block;
    margin-bottom: 0.4rem;
    font-size: clamp(1.2rem, 1.5vw, 1.8rem);
    line-height: 1.05;
}

.reconcile-card .muted {
    line-height: 1.3;
}

.reconcile-table {
    margin-top: 1rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    overflow: hidden;
}

.reconcile-actions {
    margin-bottom: 0.25rem;
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full {
    grid-column: 1 / -1;
}

.creditor-form-sections {
    display: grid;
    gap: 1.25rem;
}

.creditor-form-section {
    min-width: 0;
    margin: 0;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(248, 250, 251, 0.72);
}

.creditor-form-section legend {
    padding: 0 0.45rem;
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 700;
}

.creditor-form-section-intro {
    margin: 0 0 1rem;
}

.field-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0;
}

.field-check input {
    width: auto;
}

.hidden-model-field {
    display: none;
}

.color-select {
    position: relative;
}

.color-select-button,
.color-select-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
}

.color-select-button {
    justify-content: flex-start;
    height: 3.7rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    color: var(--ink-900);
    padding: 0 1rem;
    box-shadow: none;
}

.color-select-menu {
    position: absolute;
    z-index: 40;
    inset-inline: 0;
    bottom: calc(100% + 24px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.35rem;
    max-height: min(34rem, 65vh);
    overflow-y: auto;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(34, 72, 112, 0.18);
}

.color-select-option {
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ink-900);
    padding: 0.65rem 0.75rem;
    box-shadow: none;
}

.color-select-option:hover,
.color-select-option:focus {
    background: rgba(34, 72, 112, 0.08);
}

.color-square {
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    border-radius: 4px;
    border: 1px solid rgba(33, 37, 41, 0.2);
}

.future-targets-panel {
    margin-top: 1rem;
}

.future-targets-panel h3 {
    margin: 0;
    font-size: 1rem;
}

.future-targets-shell {
    margin-top: 0.85rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.warning {
    padding: 1rem;
    border-radius: 18px;
    background: rgba(208, 140, 96, 0.14);
    color: #7d5538;
}

.swatch {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    display: inline-block;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff8dd;
    border-top: 1px solid #e8cf78;
    bottom: 0;
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.12);
    display: none;
    left: 0;
    padding: 0.75rem 1rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.8rem;
    top: 0.55rem;
}

@media (max-width: 1024px) {
    .app-grid,
    .hero-grid,
    .dashboard-grid,
    .split-grid,
    .register-layout,
    .register-header,
    .metric-grid,
    .reconcile-summary,
    .budget-grid,
    .form-grid,
    .welcome-hero,
    .welcome-feature-grid,
    .welcome-assistant-grid,
    .welcome-status-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 85;
        min-height: 4.75rem;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-copy {
        display: block;
    }

    .topbar-copy p {
        margin-top: 0.55rem;
    }

    .topbar-copy,
    .topbar-copy p,
    .status-chip {
        max-width: none;
    }

    .register-summary-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .demo-nav-tip {
        top: calc(100% + 0.65rem);
        right: 0;
        left: auto;
        width: min(28rem, 100%);
        transform: translateY(-0.35rem);
    }

    .demo-nav-tip::before {
        top: auto;
        right: 1.25rem;
        bottom: 100%;
        border-right-color: transparent;
        border-bottom-color: #ffffff;
        transform: none;
    }

    .nav-item-link:hover .demo-nav-tip,
    .nav-item-link:focus-visible .demo-nav-tip {
        transform: translateY(0);
    }
}

@media (max-width: 1280px) {
    .register-heading-copy {
        max-width: none;
    }

    .register-heading-copy p {
        max-width: 38rem;
    }

    .register-toolbar {
        grid-template-columns: 1fr;
    }

    .register-search-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .register-search-keyword {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .register-mobile-column-filters {
        display: block;
        margin-bottom: 0.8rem;
    }

    .register-column-filter-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .register-column-filter-controls .register-column-filter {
        width: auto;
        height: 2.7rem;
    }

    .register-column-filter-controls .register-column-filter > span:first-child {
        display: none;
    }

    .register-column-filter-controls .register-column-filter select {
        position: static;
        padding: 0.45rem 0.6rem;
        opacity: 1;
    }
    .signup-grid {
        grid-template-columns: 1fr;
    }

    .signup-grid .full {
        grid-column: auto;
    }
    .register-summary-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 780px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .page-shell {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0;
        border-radius: 0;
        overflow-x: hidden;
        backdrop-filter: none;
    }

    .app-grid,
    .main-column,
    .page-content,
    .dashboard-grid,
    .dashboard-grid > *,
    .page-content > .stack,
    .page-content > .stack > * {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .page-content {
        overflow-x: hidden;
    }

    .page-content > .stack {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-grid .list-clean,
    .dashboard-register-row {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .dashboard-grid .bill-list-row {
        display: block;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .dashboard-grid .bill-list-row > .dashboard-pending-desktop {
        display: none;
    }

    .dashboard-pending-mobile {
        display: grid;
        gap: 0.75rem;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .dashboard-pending-mobile-details {
        display: grid;
        gap: 0.2rem;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: inherit;
        text-align: left;
        box-shadow: none;
        overflow-wrap: anywhere;
    }

    .dashboard-pending-mobile-details:hover {
        background: transparent;
        transform: none;
        box-shadow: none;
    }

    .dashboard-pending-mobile-actions {
        display: grid;
        grid-template-columns: auto;
        justify-items: start;
        justify-content: start;
        gap: 0.75rem;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .dashboard-pending-mobile-actions .amount-negative {
        white-space: nowrap;
    }

    .dashboard-pending-mobile-actions .table-action-button {
        width: auto;
        min-width: 4.8rem;
        max-width: 100%;
    }

    .dashboard-budget-desktop {
        display: none;
    }

    .dashboard-budget-mobile {
        display: grid;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        border: 1px solid var(--line);
        border-radius: 20px;
        overflow: hidden;
    }

    .dashboard-budget-mobile-card {
        min-width: 0;
        border-bottom: 1px solid var(--line);
        background: #fff;
    }

    .dashboard-budget-mobile-card:last-child {
        border-bottom: 0;
    }

    .dashboard-budget-mobile-summary {
        display: grid;
        gap: 0.9rem;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: 1rem;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: inherit;
        text-align: left;
        box-shadow: none;
    }

    .dashboard-budget-mobile-summary:hover {
        background: rgba(245, 239, 228, 0.48);
        transform: none;
        box-shadow: none;
    }

    .dashboard-budget-mobile-name {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        min-width: 0;
    }

    .dashboard-budget-mobile-name strong {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .dashboard-budget-mobile-values {
        display: grid;
        gap: 0.55rem;
        width: 100%;
        min-width: 0;
    }

    .dashboard-budget-mobile-values > span {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.75rem;
        color: var(--ink-600);
    }

    .dashboard-budget-mobile-values strong {
        color: var(--ink-900);
        white-space: nowrap;
    }

    .dashboard-budget-mobile-values .amount-positive {
        color: var(--mint);
    }

    .dashboard-budget-mobile-values .amount-negative {
        color: var(--coral);
    }

    .dashboard-budget-mobile-details {
        padding: 0 1rem 1rem;
    }

    .page-content,
    .topbar {
        padding: 1rem;
    }

    .topbar {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .topbar-copy h1 {
        margin: 0;
        font-size: 1.05rem;
        line-height: 1.2;
    }

    .topbar-copy p {
        display: none;
    }

    .topbar-actions {
        flex: 0 0 auto;
        gap: 0.45rem;
    }

    .status-chip {
        padding: 0.4rem 0.55rem;
        font-size: 0.75rem;
    }

    .status-chip > span {
        display: none;
    }

    .avatar-button {
        width: 2.75rem;
        height: 2.75rem;
    }

    .page-content {
        padding-top: 5.75rem;
        padding-bottom: 1.25rem;
    }

    .app-grid:not(.app-grid-anonymous) .page-content {
        padding-top: 14.75rem;
    }

    .site-footer {
        margin-bottom: 0;
    }

    .sidebar {
        position: fixed;
        top: 4.75rem;
        right: 0;
        bottom: auto;
        left: 0;
        z-index: 80;
        padding: 0.45rem max(0.45rem, env(safe-area-inset-right));
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        border-bottom: 1px solid rgba(255, 255, 255, 0.18);
        background: rgba(31, 42, 46, 0.97);
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
        backdrop-filter: blur(16px);
    }

    .sidebar .brand-card {
        display: none;
    }

    .nav-shell {
        padding: 0;
    }

    .nav-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0.15rem;
    }

    .nav-grid.demo-nav-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .demo-nav-grid .nav-label {
        font-size: clamp(0.56rem, 2.3vw, 0.69rem);
    }

    .nav-item-link {
        min-width: 0;
        align-items: center;
        gap: 0.15rem;
        padding: 0.45rem 0.15rem;
        border-radius: 14px;
        text-align: center;
    }

    .nav-item-link:hover {
        transform: none;
    }

    .nav-mobile-icon {
        display: grid;
        width: 1.65rem;
        height: 1.65rem;
        place-items: center;
        border-radius: 9px;
        color: rgba(255, 255, 255, 0.78);
        font-size: 1.05rem;
        font-weight: 800;
    }

    .nav-item-link.active .nav-mobile-icon {
        background: rgba(255, 255, 255, 0.14);
        color: #ffffff;
    }

    .nav-label {
        overflow: hidden;
        width: 100%;
        font-size: 0.69rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-copy,
    .demo-nav-tip {
        display: none;
    }

    .welcome-hero {
        min-height: 0;
        padding: 1.25rem;
    }

    .welcome-hero-copy h1 {
        margin-bottom: 0.75rem;
        font-size: clamp(2.05rem, 11vw, 3rem);
    }

    .welcome-hero-copy p {
        display: -webkit-box;
        overflow: hidden;
        margin-bottom: 1rem;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 4;
    }

    .welcome-action-row {
        gap: 0.65rem;
    }

    .welcome-demo-action,
    .welcome-primary-action {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .welcome-phone-stage {
        min-height: 24rem;
    }

    .welcome-float-card {
        display: none;
    }

    .hero-panel,
    .metric-card,
    .panel,
    .category-card {
        padding: 1rem;
        border-radius: 18px;
    }

    .hero-panel {
        margin-bottom: 0.85rem;
    }

    .metric-grid,
    .stack,
    .dashboard-grid,
    .budget-grid {
        gap: 0.75rem;
    }

    .form-actions {
        align-items: stretch;
    }

    .form-actions > button {
        min-height: 2.85rem;
    }

    .welcome-proof-strip {
        grid-template-columns: 1fr;
    }

    .welcome-proof-strip span + span {
        padding-top: 1rem;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .welcome-float-household {
        left: 0;
    }

    .welcome-float-secure {
        right: 0;
    }

    .welcome-cta {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-grid {
        min-height: auto;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .register-search-header {
        display: grid;
    }

    .register-search-header-actions {
        justify-self: start;
        flex-wrap: wrap;
    }

    .register-search-grid {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }

    .register-search-keyword {
        grid-column: auto;
    }

    .register-search-header > div:first-child p,
    .register-search-header-actions .collapse-card-button {
        display: none;
    }

    .register-search-header {
        grid-template-columns: 1fr auto;
        align-items: center;
        margin-bottom: 0.65rem;
    }

    .register-search-header-actions {
        justify-self: end;
    }

    .mobile-filter-toggle {
        display: inline-flex;
        min-height: 2.85rem;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.55rem 0.7rem;
        white-space: nowrap;
    }

    .register-advanced-filters {
        position: fixed;
        right: 0.5rem;
        bottom: calc(0.5rem + env(safe-area-inset-bottom));
        left: 0.5rem;
        z-index: 100;
        display: none;
        max-height: min(74vh, 38rem);
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
        overflow-y: auto;
        padding: 1rem;
        border: 1px solid var(--line);
        border-radius: 22px;
        background: #ffffff;
        box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    }

    .mobile-filters-open .register-advanced-filters {
        display: grid;
    }

    .mobile-filter-sheet-header {
        display: flex;
        grid-column: 1 / -1;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    .mobile-filter-sheet-header h3 {
        margin: 0.15rem 0 0;
    }

    .register-search-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1.4fr;
        gap: 0.55rem;
        position: sticky;
        bottom: -1rem;
        padding: 0.75rem 0 0;
        background: #ffffff;
    }

    .mobile-filter-done {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .register-desktop-table {
        display: none;
    }

    .register-mobile-list {
        display: grid;
        gap: 0.7rem;
    }

    .register-mobile-card {
        padding: 0.9rem;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: #ffffff;
        box-shadow: 0 7px 18px rgba(15, 23, 42, 0.06);
    }

    .register-mobile-card.register-row-active {
        border-color: rgba(15, 118, 110, 0.55);
        box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
    }

    .register-mobile-card-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 0.7rem;
    }

    .register-mobile-card-heading > div {
        display: grid;
        min-width: 0;
        gap: 0.15rem;
    }

    .register-mobile-card-heading > div > strong {
        overflow: hidden;
        color: var(--ink-900);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .register-mobile-card-heading > div > span,
    .register-mobile-card-details {
        color: var(--muted);
        font-size: 0.78rem;
    }

    .register-mobile-amount {
        font-size: 1rem;
        white-space: nowrap;
    }

    .register-mobile-card-details {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem 0.65rem;
        margin-top: 0.6rem;
    }

    .register-mobile-card-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.65rem;
        margin-top: 0.75rem;
        padding-top: 0.7rem;
        border-top: 1px solid var(--line);
    }

    .register-mobile-actions {
        display: flex;
        gap: 0.4rem;
    }

    .register-mobile-actions button {
        min-height: 2.75rem;
        padding: 0.5rem 0.7rem;
    }

    .demo-page-guide {
        top: calc(9rem + env(safe-area-inset-top));
        right: 0.75rem;
        bottom: auto;
        left: auto;
        z-index: 95;
    }

    .demo-page-guide-card {
        width: min(23rem, calc(100vw - 1.5rem));
        max-height: min(58vh, 28rem);
        overflow-y: auto;
    }

    .demo-guide-desktop {
        display: none;
    }

    .demo-guide-mobile {
        display: block;
        border-radius: 22px;
    }

    .demo-page-guide-launcher {
        max-width: calc(100vw - 1.5rem);
    }

    .demo-mobile-guide-step {
        display: grid;
        grid-template-columns: 2rem 1fr;
        align-items: start;
        gap: 0.7rem;
        margin-top: 0.85rem;
        padding: 0.8rem;
        border-radius: 14px;
        background: rgba(15, 118, 110, 0.07);
    }

    .demo-mobile-guide-step > span {
        display: grid;
        width: 2rem;
        height: 2rem;
        place-items: center;
        border-radius: 999px;
        background: #0f766e;
        color: #ffffff;
        font-weight: 800;
    }

    .demo-mobile-guide-step p {
        margin: 0;
    }

    .demo-mobile-guide-progress {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.35rem;
        margin-top: 0.85rem;
    }

    .demo-mobile-guide-progress span {
        height: 0.25rem;
        border-radius: 999px;
        background: #e2e8f0;
    }

    .demo-mobile-guide-progress span.active {
        background: #0f766e;
    }

    .demo-mobile-guide-actions {
        display: flex;
        justify-content: flex-end;
        gap: 0.55rem;
        margin-top: 0.9rem;
    }

    .demo-mobile-guide-actions button {
        min-height: 2.75rem;
    }
}

.void-action-anchor {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55rem;
    max-width: 100%;
}

.register-action-group:has(.void-confirmation-popover),
.register-mobile-actions:has(.void-confirmation-popover) {
    flex-wrap: wrap;
    align-items: flex-start;
}

.void-action-anchor:has(.void-confirmation-popover) {
    flex-basis: 100%;
    min-width: 0;
}

.register-mobile-card-footer:has(.void-confirmation-popover) {
    flex-wrap: wrap;
}

.register-mobile-actions:has(.void-confirmation-popover) {
    width: 100%;
    min-width: 0;
}

.void-confirmation-popover {
    display: grid;
    width: min(19rem, calc(100vw - 2rem));
    max-width: 100%;
    box-sizing: border-box;
    gap: 0.3rem;
    padding: 0.85rem;
    border: 1px solid rgba(185, 28, 28, 0.25);
    border-radius: 14px;
    background: #fff;
    color: var(--ink-900);
    box-shadow: 0 16px 42px rgba(31, 42, 46, 0.22);
    text-align: left;
    white-space: normal;
}

.void-confirmation-popover span,
.void-confirmation-popover small {
    overflow-wrap: anywhere;
}

.void-confirmation-popover small {
    color: var(--muted);
}

.void-confirmation-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-top: 0.45rem;
}

.void-confirmation-actions button {
    min-height: 2.35rem;
    padding: 0.45rem 0.65rem;
}

.sms-review-notice {
    margin: 1.5rem 0;
    padding: 1rem 1.15rem;
    border-left: 4px solid #0f766e;
    border-radius: 0 1rem 1rem 0;
    background: rgba(15, 118, 110, .07);
}

.sms-review-notice p,
.sms-evidence-step p,
.sms-live-review p {
    margin: .3rem 0 0;
}

.sms-evidence {
    display: grid;
    gap: 1.5rem;
    margin: 2.25rem 0;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
}

.sms-evidence-heading h2 {
    margin: .35rem 0 .55rem;
}

.sms-evidence-card {
    display: grid;
    grid-template-columns: minmax(12rem, .65fr) minmax(0, 1.35fr);
    gap: 1.25rem;
    align-items: start;
}

.sms-evidence-step {
    display: grid;
    grid-template-columns: 2.25rem 1fr;
    gap: .75rem;
    align-items: start;
    padding-top: .4rem;
}

.sms-evidence-step > span {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border-radius: 999px;
    background: #0f766e;
    color: white;
    font-weight: 800;
}

.sms-evidence-screen {
    padding: 1.25rem;
    border: 1px solid #ccdadd;
    border-radius: 1.15rem;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .09);
}

.sms-evidence-screen h3 {
    margin: .35rem 0 .45rem;
}

.sms-evidence-screen .sms-disclosure {
    margin-top: 1rem;
}

.sms-evidence-screen .sms-disclosure h4 {
    margin: 0 0 .45rem;
}

.sms-evidence-screen button:disabled {
    opacity: .68;
    cursor: not-allowed;
}

.sms-evidence-caption {
    display: block;
    margin-top: .75rem;
    color: var(--ink-700);
    font-size: .78rem;
    line-height: 1.45;
}

.sms-verification-example {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.sms-verification-icon {
    display: grid;
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: 999px;
    background: #dcece5;
    color: #256b4b;
    font-weight: 900;
}

.sms-live-review {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem;
    border-radius: 1rem;
    background: var(--ink-900);
    color: white;
}

.sms-live-review form {
    flex: 0 0 auto;
    margin: 0;
}

@media (max-width: 700px) {
    .sms-evidence-card {
        grid-template-columns: 1fr;
        gap: .75rem;
    }

    .sms-live-review {
        align-items: stretch;
        flex-direction: column;
    }

    .sms-live-review button {
        width: 100%;
    }
}

.sms-consent {
    margin-top: .5rem;
}

.sms-consent-label {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    font-weight: 500;
    line-height: 1.5;
}

.sms-consent-label input {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: .2rem;
}

.legal-page {
    max-width: 900px;
    margin-inline: auto;
}

.legal-page h2 {
    margin-top: 1.75rem;
    font-size: 1.25rem;
}

.legal-page p {
    line-height: 1.65;
}

.legal-page li {
    margin-bottom: .65rem;
    line-height: 1.55;
}

.sms-disclosure {
    margin-top: 1.75rem;
    padding: 1rem 1.25rem;
    border: 1px solid #ccd5d9;
    border-radius: 1rem;
    background: #f7faf8;
}

.sms-disclosure h2 {
    margin-top: 0;
}

.authorized-texters {
    display: grid;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.authorized-texter-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid #d9dfe1;
    border-radius: 1rem;
    background: #fbfcfb;
}

.invitation-result {
    margin-block: 1rem;
}

.invitation-result input {
    width: 100%;
}

@media (max-width: 700px) {
    .dashboard-onboarding {
        grid-template-columns: 1fr;
    }

    .dashboard-onboarding-steps {
        grid-template-columns: 1fr;
    }
}

/* Keep bank consent controls compact and bulk entry readable on phones. */
.bank-consent-check input[type="checkbox"] {
    flex: 0 0 auto;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0.2rem 0 0;
    padding: 0;
    accent-color: var(--accent);
}

.bulk-add-dialog > label {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
    margin-bottom: 1rem;
}

.bulk-add-dialog > .bank-consent-check {
    display: flex;
    gap: 0.75rem;
    line-height: 1.5;
}

@media (max-width: 700px) {
    .bulk-add-dialog .account-dialog-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .bulk-add-dialog .account-dialog-header > div {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .bulk-add-dialog .account-dialog-header > button {
        align-self: flex-end;
        order: -1;
        flex-shrink: 0;
    }

    .bulk-add-dialog input,
    .bulk-add-dialog select {
        min-width: 0;
        font-size: 1rem;
    }
}

/* A generous hit area keeps batch selection comfortable on touch screens. */
.bank-activity-selection {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    border-radius: 12px;
    cursor: pointer;
}

.bank-activity-selection input[type="checkbox"] {
    flex: 0 0 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
    margin: 0;
    padding: 0;
    accent-color: var(--accent);
    cursor: inherit;
}

.bank-activity-selection:hover {
    background: rgba(34, 72, 112, 0.08);
}

.bank-activity-selection:has(input:focus-visible) {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.bank-activity-selection:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.5;
}

.bank-activity-table tbody tr:has(.bank-activity-selection input:checked) {
    background: rgba(34, 72, 112, 0.07);
}

.bank-activity-table tbody tr:has(.bank-activity-selection input:checked) > .bank-activity-selection-cell {
    box-shadow: inset 3px 0 var(--accent);
}

/* Keep creditor identity and Close available while its history scrolls. */
#creditor-account-view {
    --creditor-dialog-gutter: clamp(1.25rem, 3vw, 2rem);
    padding-top: 0;
    scroll-padding-top: 10rem;
}

#creditor-account-view > .account-dialog-header {
    position: sticky;
    top: 0;
    z-index: 3;
    margin: 0 calc(-1 * var(--creditor-dialog-gutter)) 1rem;
    padding: var(--creditor-dialog-gutter);
    background: #fff;
    border-bottom: 1px solid var(--line);
}

#creditor-account-view > .account-dialog-header > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

#creditor-account-view > .account-dialog-header > button {
    flex-shrink: 0;
}

@media (max-width: 700px) {
    #creditor-account-view {
        --creditor-dialog-gutter: 1rem;
    }
}

.creditor-history-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.creditor-history-mobile-controls { display: none; }
@media (max-width: 700px) {
    .creditor-history-mobile-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
}

/* Keep the title, Close, and review queue together as one sticky section. */
.bank-activity-dialog {
    --activity-header-gutter: clamp(1.25rem, 3vw, 2rem);
    padding-top: 0;
}
.bank-activity-sticky-header {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: 0 calc(-1 * var(--activity-header-gutter));
    padding: var(--activity-header-gutter);
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.bank-activity-sticky-header > .account-dialog-header {
    position: static;
    margin: 0;
    padding: 0;
}
.bank-activity-sticky-header > .account-dialog-header > div {
    min-width: 0;
    overflow-wrap: anywhere;
}
.bank-activity-sticky-header > .account-dialog-header > button {
    flex-shrink: 0;
}
@media (max-width: 700px) {
    .bank-activity-dialog { --activity-header-gutter: 1rem; }
}

.register-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.register-pagination label { display: flex; align-items: center; gap: 0.5rem; }
.register-pagination select { width: auto; }

.analytics-account-header { margin-bottom: 0.5rem; }
.analytics-account-header p { margin-bottom: 0; }
.analytics-account-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding-block: 1rem; }
.analytics-account-details { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; overflow-wrap: anywhere; }
.analytics-account-type { color: var(--muted, #53656d); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }
.analytics-account-amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.table-mobile-controls { display: none; }
@media (max-width: 780px) {
    .table-mobile-controls { display: block; margin-bottom: 1rem; }
    .table-mobile-controls .register-column-heading { margin-top: .5rem; }
}

/* Shared compact paging and readable bank-account cards on phones. */
.pagination-navigation { display: flex; align-items: center; gap: .75rem; }
.bank-accounts-mobile { display: none; }
@media (max-width: 780px) {
    .bank-accounts-desktop { display: none; }
    .bank-accounts-mobile { display: grid; gap: .85rem; }
    .bank-account-card {
        min-width: 0;
        padding: 1rem;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: #fff;
    }
    .bank-account-card-heading { display: flex; align-items: flex-start; gap: .75rem; }
    .bank-account-card-heading h3 { flex: 1; min-width: 0; margin: 0; font-size: 1rem; line-height: 1.4; overflow-wrap: anywhere; }
    .bank-account-card-heading .pill { flex-shrink: 0; font-size: .75rem; }
    .bank-account-type { margin: .25rem 0 .5rem; color: var(--muted); font-size: .85rem; }
    .bank-account-default { display: inline-block; color: var(--accent); font-size: .75rem; font-weight: 600; }
    .bank-account-roundups { margin: .6rem 0 0; font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
    .bank-account-card-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem; border-top: 1px solid var(--line); margin-top: .85rem; padding-top: .85rem; }
    .bank-account-card-footer > div { min-width: 0; }
    .bank-account-balance-label { display: block; margin-bottom: .2rem; font-size: .75rem; color: var(--muted); }
    .bank-account-card-footer strong { display: block; font-size: 1.15rem; overflow-wrap: anywhere; }
    .bank-account-card-footer button { flex-shrink: 0; min-height: 44px; padding: .5rem 1.1rem; }
    .account-mobile-controls summary { min-height: 44px; padding: .65rem 0; color: var(--accent); font-size: .85rem; font-weight: 600; cursor: pointer; }
    .account-mobile-controls .register-column-heading { justify-content: space-between; min-height: 44px; }
    .account-mobile-controls .register-column-filter { width: 44px; height: 44px; flex-basis: 44px; }
    .register-pagination { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem .5rem; border-top: 1px solid var(--line); padding-top: .85rem; font-size: .8rem; }
    .register-pagination label { min-width: 0; gap: .4rem; white-space: nowrap; }
    .register-pagination select { min-height: 44px; max-width: 4.5rem; padding: .45rem .5rem; border-radius: 12px; }
    .pagination-range { text-align: right; color: var(--muted); white-space: nowrap; }
    .pagination-navigation { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
    .pagination-navigation button { min-width: 0; min-height: 44px; padding: .55rem .65rem; font-size: .8rem; }
    .single-page .pagination-navigation { display: none; }
}
@media (max-width: 780px) {
    .topbar-copy { flex: 1; min-width: 0; }
    .topbar-copy h1 { white-space: normal; font-size: .95rem; line-height: 1.25; }
}

/* Analytics edit links use the same pill shape and touch target as edit buttons. */
.analytics-transaction-card a.ghost-button,
.analytics-transaction-table a.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.65rem 1.2rem;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1.1;
}

/* Shared native checkbox sizing for forms, tables, consent, and demo controls. */
input[type="checkbox"] {
    width: 1.5rem;
    height: 1.5rem;
    min-width: 1.5rem;
    min-height: 1.5rem;
    flex: 0 0 auto;
    margin: .25rem;
    padding: 0;
    vertical-align: middle;
    accent-color: var(--accent);
    cursor: pointer;
}

input[type="checkbox"]:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

@media (pointer: coarse) {
    input[type="checkbox"] {
        min-width: 1.75rem;
        min-height: 1.75rem;
    }
}

.bill-overview-mobile { display: none; }
.account-dialog[aria-labelledby="open-creditors-title"] { width: min(68rem, 100%); }

@media (max-width: 640px) {
    .bill-overview-desktop { display: none; }
    .bill-overview-mobile { display: grid; gap: .75rem; min-width: 0; }
    .bill-overview-controls { border: 1px solid var(--line); border-radius: 16px; padding: .5rem .85rem; }
    .bill-overview-controls summary { min-height: 44px; align-content: center; font-weight: 600; cursor: pointer; }
    .bill-overview-control .register-column-heading { justify-content: space-between; min-height: 48px; white-space: normal; }
    .bill-overview-control .register-column-filter { width: 44px; height: 44px; flex-basis: 44px; }
    .bill-overview-control button { min-height: 44px; text-align: left; }
    .bill-overview-card { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
    .bill-overview-card h3 { margin: 0 0 .75rem; font-size: 1.05rem; line-height: 1.4; overflow-wrap: anywhere; }
    .bill-overview-card dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .75rem; margin: 0 0 1rem; }
    .bill-overview-card dl > div { min-width: 0; }
    .bill-overview-card dt { font-size: .8rem; color: var(--ink-700); }
    .bill-overview-card dd { margin: .2rem 0 0; overflow-wrap: anywhere; font-weight: 600; }
    .bill-overview-card .bill-overview-due { grid-column: 1 / -1; }
    .bill-overview-due dd { font-size: 1.25rem; color: var(--accent); }
    .bill-overview-card > button { width: 100%; min-height: 44px; }
}

.budget-category-link {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--ink, #243238);
    font: inherit;
    font-weight: 700;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: #a6b9c8;
    text-underline-offset: .2em;
    overflow-wrap: anywhere;
}
.budget-category-link:hover { color: #244f75; background: transparent; }
.budget-category-link:focus-visible { outline: 2px solid #244f75; outline-offset: 4px; }
.category-activity-tabs { display: flex; flex-wrap: wrap; gap: .6rem; }
.category-activity-tabs [aria-pressed="true"] { background: #244f75; color: white; }
.category-activity-list { margin-block: 1rem; }
.category-activity-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid #e0e5e7; }
.category-activity-item > div { display: grid; gap: .25rem; overflow-wrap: anywhere; }
@media (max-width: 640px) {
    .category-activity-item { grid-template-columns: minmax(0, 1fr) auto; gap: .65rem; }
    .category-activity-item > a { grid-column: 1 / -1; justify-self: start; }
}

/* Inline category expansion keeps the surrounding category list in place. */
.category-expand-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 1rem; width: 1rem; min-height: 1.5rem; padding: 0; background: transparent; color: var(--accent); border: 0; border-radius: 0; box-shadow: none; }
.category-expand-button:hover { background: var(--bg-cream); transform: none; box-shadow: none; }
.category-expand-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.category-expanded-row > td { white-space: normal; }
.category-activity { min-width: 0; padding: 0 0 0 .8rem; border-left: 3px solid var(--accent); }
.category-inline-transactions { min-width: 0; padding: 0 0 0 .8rem; border-left: 3px solid var(--accent); }
.category-accordion-item { min-width: 0; border: 1px solid var(--line); border-radius: .75rem; overflow: hidden; }
.category-accordion-heading { display: flex; align-items: center; gap: .65rem; padding: .7rem; }
.category-accordion-heading > strong { min-width: 0; overflow-wrap: anywhere; }
.category-summary-amount { margin-left: auto; white-space: nowrap; }
.category-pie-legend:has(.category-accordion-item) { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) {
    .category-inline-transactions { padding-left: .5rem; }
    .category-accordion-heading { flex-wrap: wrap; }
    .category-activity-item > button { grid-column: 1 / -1; justify-self: start; }
}

/* Transaction dropdowns remain tables at every viewport size. */
.category-transaction-table { width: 100%; max-width: 100%; overflow-x: auto; }
.category-transaction-table .data-table { min-width: 48rem; }
.category-expand-button > span { font-size: 1rem; line-height: 1.15; }
.category-transaction-table td:first-child, .category-transaction-table td:nth-last-child(2) { white-space: nowrap; }

.analytics-category-table { width: 100%; min-width: 0; }
.analytics-category-table > table { table-layout: fixed; }
.analytics-category-table > table > thead th:first-child { width: 70%; }
.analytics-category-table .is-expanded { background: rgba(245, 239, 228, .4); }
