@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    --mt-ink: #1c2b33;
    --mt-ink-soft: #3d4f5a;
    --mt-muted: #6b7c86;
    --mt-line: #e2e8eb;
    --mt-line-strong: #c9d4da;
    --mt-surface: #f6f8f9;
    --mt-surface-raised: #ffffff;
    --mt-accent: #0f6e56;
    --mt-accent-hover: #0b5844;
    --mt-debit: #a33b2b;
    --mt-credit: #0f6e56;
    --mt-sidebar-top: #1c2b33;
    --mt-sidebar-bottom: #243b44;
    --mt-font: "Source Sans 3", "Segoe UI", sans-serif;
}

html, body {
    font-family: var(--mt-font);
    color: var(--mt-ink);
    background: var(--mt-surface);
}

a, .btn-link {
    color: var(--mt-accent);
}

a:hover, .btn-link:hover {
    color: var(--mt-accent-hover);
}

.btn-primary {
    color: #fff;
    background-color: var(--mt-accent);
    border-color: var(--mt-accent);
}

.btn-primary:hover {
    background-color: var(--mt-accent-hover);
    border-color: var(--mt-accent-hover);
}

.btn-outline-primary {
    color: var(--mt-accent);
    border-color: var(--mt-accent);
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: var(--mt-accent);
    border-color: var(--mt-accent);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem rgba(15, 110, 86, 0.35);
}

.content {
    padding-top: 1.25rem;
}

.page-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.page-heading h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--mt-ink);
}

.page-heading .page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.toolbar .form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mt-muted);
    margin-bottom: 0.25rem;
    line-height: 1.2;
    min-height: 1.2em;
}

.toolbar-search {
    min-width: 16rem;
    flex: 1 1 16rem;
    max-width: 24rem;
}

.toolbar-search-btn {
    margin-top: 0.4rem;
}

.autocomplete {
    position: relative;
}

.autocomplete-menu {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    margin: 0;
    padding: 0.25rem 0;
    list-style: none;
    background: var(--mt-surface-raised);
    border: 1px solid var(--mt-line-strong);
    border-radius: 8px;
    max-height: 14rem;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    color: var(--mt-ink);
    font-size: 0.925rem;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(15, 110, 86, 0.1);
    color: var(--mt-accent);
}

.money {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    white-space: nowrap;
}

.money-debit {
    color: var(--mt-debit);
    font-weight: 600;
}

.money-credit {
    color: var(--mt-credit);
    font-weight: 600;
}

.money-negative {
    color: var(--mt-debit);
    font-weight: 600;
}

.status-pill {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--mt-surface);
    color: var(--mt-ink-soft);
    border: 1px solid var(--mt-line);
}

.status-pill.active {
    background: rgba(15, 110, 86, 0.1);
    color: var(--mt-accent);
    border-color: rgba(15, 110, 86, 0.25);
}

.status-pill.inactive {
    background: #f0f2f3;
    color: var(--mt-muted);
}

.type-pill {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.12rem 0.5rem;
    border-radius: 4px;
    background: var(--mt-surface);
    color: var(--mt-ink-soft);
    border: 1px solid var(--mt-line);
}

/* A · Dense ledger (Transactions) */
.ledger-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}

.table-ledger {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: transparent;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    font-size: 0.925rem;
}

.table-ledger .col-date {
    width: 11.5rem;
}

.table-ledger tbody .col-date {
    cursor: help;
}

.table-ledger .col-account {
    width: 10.5rem;
}

.table-ledger .col-money {
    width: 5.5rem;
}

.table-ledger .col-actions {
    /* 3 × 1.85rem icons + gaps + cell padding */
    width: 7.75rem;
}

/* Only the flexible column uses max-width:0 so fixed columns keep their width. */
.table-ledger .col-desc {
    width: auto;
    max-width: 0;
    overflow: hidden;
}

.table-ledger .col-account {
    overflow: hidden;
}

.cell-truncate {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.table-ledger thead th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mt-muted);
    border-bottom: 1px solid var(--mt-line-strong);
    padding: 0.4rem 0.65rem;
    background: transparent;
    white-space: nowrap;
}

.table-ledger tbody td {
    padding: 0.35rem 0.65rem;
    border-bottom: 1px solid var(--mt-line);
    vertical-align: middle;
    color: var(--mt-ink);
}

.table-ledger tbody tr:last-child td {
    border-bottom: none;
}

.table-ledger tbody tr:hover td {
    background: rgba(28, 43, 51, 0.035);
}

.table-ledger .month-band td {
    padding-top: 1rem;
    padding-bottom: 0.35rem;
    border-bottom: none;
    background: transparent !important;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mt-ink-soft);
}

.table-ledger .col-actions,
.table-statement .col-actions {
    text-align: right;
    white-space: nowrap;
    overflow: visible;
}

.table-ledger td.col-actions {
    padding-left: 0.35rem;
    padding-right: 0.25rem;
}

.table-ledger .col-actions .icon-action:first-child {
    margin-left: 0;
}

.row-action {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--mt-muted);
    text-decoration: none;
    background: none;
    border: none;
    padding: 0 0.35rem;
    cursor: pointer;
}

.row-action:hover {
    color: var(--mt-accent);
    text-decoration: underline;
}

.row-action.danger:hover {
    color: var(--mt-debit);
}

.icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    margin-left: 0.15rem;
    padding: 0;
    border: 1px solid var(--mt-line);
    border-radius: 6px;
    background: var(--mt-surface-raised);
    color: var(--mt-ink-soft);
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
}

.icon-action:hover {
    color: var(--mt-accent);
    border-color: rgba(15, 110, 86, 0.35);
    background: rgba(15, 110, 86, 0.06);
}

.icon-action.danger:hover {
    color: var(--mt-debit);
    border-color: rgba(163, 59, 43, 0.35);
    background: rgba(163, 59, 43, 0.06);
}

.icon-action i {
    font-size: 0.95rem;
}

.detail-panel {
    background: var(--mt-surface-raised);
    border: 1px solid var(--mt-line);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    max-width: 40rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 0.75rem 1.25rem;
    margin: 0;
}

.detail-grid dt {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mt-muted);
    padding-top: 0.15rem;
}

.detail-grid dd {
    margin: 0;
    color: var(--mt-ink);
}

/* B · Clean statement (Accounts / Statements) */
.table-panel {
    background: var(--mt-surface-raised);
    border: 1px solid var(--mt-line);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.table-statement {
    --bs-table-bg: transparent;
    margin-bottom: 0;
    width: 100%;
    font-size: 0.95rem;
}

.table-statement thead th {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mt-muted);
    background: var(--mt-surface);
    border-bottom: 1px solid var(--mt-line);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table-statement tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--mt-line);
    vertical-align: middle;
}

.table-statement tbody tr:last-child td {
    border-bottom: none;
}

.table-statement tbody tr:hover td {
    background: rgba(28, 43, 51, 0.03);
}

.table-statement .account-name {
    font-weight: 600;
    color: var(--mt-ink);
}

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    color: var(--mt-muted);
    font-size: 0.875rem;
}

.pager-sticky {
    position: sticky;
    bottom: 0;
    z-index: 4;
    margin-top: 0.5rem;
    padding: 0.75rem 0;
    background: var(--mt-surface);
    border-top: 1px solid var(--mt-line);
}

.pager .btn {
    min-width: 5.5rem;
}

.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--mt-muted);
    border: 1px dashed var(--mt-line-strong);
    border-radius: 10px;
    background: var(--mt-surface-raised);
}

.loading-state {
    color: var(--mt-muted);
    padding: 1rem 0;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(28, 43, 51, 0.45);
    backdrop-filter: blur(2px);
}

.confirm-dialog {
    width: min(100%, 26rem);
    background: var(--mt-surface-raised);
    border: 1px solid var(--mt-line);
    border-radius: 12px;
    padding: 1.35rem 1.4rem 1.2rem;
}

.confirm-title {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--mt-ink);
}

.confirm-message {
    margin: 0 0 1.25rem;
    color: var(--mt-ink-soft);
    font-size: 0.95rem;
    line-height: 1.45;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-danger {
    color: #fff;
    background-color: var(--mt-debit);
    border-color: var(--mt-debit);
}

.btn-danger:hover {
    color: #fff;
    background-color: #8a3124;
    border-color: #8a3124;
}

.account-filter {
    position: relative;
    min-width: 14rem;
    flex: 1 1 16rem;
    max-width: 32rem;
}

.account-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    min-height: 2rem;
}

.account-filter-all {
    font-size: 0.875rem;
    color: var(--mt-muted);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 12rem;
    padding: 0.2rem 0.45rem 0.2rem 0.55rem;
    border: 1px solid rgba(15, 110, 86, 0.3);
    border-radius: 999px;
    background: rgba(15, 110, 86, 0.08);
    color: var(--mt-accent);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.filter-chip span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-chip-x {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.75;
}

.filter-chip:hover {
    background: rgba(15, 110, 86, 0.14);
}

.account-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.account-filter-count {
    font-size: 0.75rem;
    color: var(--mt-muted);
}

.account-filter-clear {
    padding: 0;
    text-decoration: none;
}

.account-filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: transparent;
}

.account-filter-popover {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    left: 0;
    width: min(100%, 18rem);
    background: var(--mt-surface-raised);
    border: 1px solid var(--mt-line-strong);
    border-radius: 10px;
    padding: 0.5rem 0.35rem 0.6rem;
}

.account-filter-popover-actions {
    display: flex;
    justify-content: space-between;
    padding: 0 0.4rem 0.35rem;
    border-bottom: 1px solid var(--mt-line);
    margin-bottom: 0.35rem;
}

.account-filter-popover-actions .btn-link {
    text-decoration: none;
    padding: 0;
}

.account-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 14rem;
    overflow-y: auto;
}

.account-filter-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.55rem;
    margin: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--mt-ink);
}

.account-filter-option:hover {
    background: rgba(28, 43, 51, 0.04);
}

.account-filter-option input {
    accent-color: var(--mt-accent);
}

.account-filter-empty {
    margin: 0.5rem;
    color: var(--mt-muted);
    font-size: 0.875rem;
}

/* Home · branded welcome */
.home-hero {
    display: grid;
    gap: 2rem;
    align-items: center;
    min-height: calc(100vh - 7rem);
    padding: 0.5rem 0 2rem;
}

@media (min-width: 900px) {
    .home-hero {
        grid-template-columns: minmax(16rem, 0.95fr) minmax(18rem, 1.15fr);
        gap: 2.5rem 1.5rem;
        padding-right: 0;
    }
}

.home-hero-copy {
    max-width: 28rem;
    position: relative;
    z-index: 1;
}

.home-brand {
    margin: 0 0 0.75rem;
    font-size: clamp(2.35rem, 4.5vw, 3.25rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.05;
    color: var(--mt-ink);
}

.home-lead {
    margin: 0 0 1.25rem;
    font-size: 1.125rem;
    line-height: 1.45;
    color: var(--mt-ink-soft);
    max-width: 22rem;
}

.home-greeting {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    color: var(--mt-muted);
}

.home-last-added {
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
    color: var(--mt-ink-soft);
}

.home-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.home-hero-art {
    position: relative;
    min-width: 0;
    margin: 0 -0.5rem;
}

@media (min-width: 900px) {
    .home-hero-art {
        margin: 0 -1rem 0 0;
        justify-self: stretch;
    }
}

.home-ledger-art {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(420px, 55vh);
}

.home-art-page--back {
    animation: home-page-drift 7s ease-in-out infinite;
}

.home-art-page--mid {
    animation: home-page-drift 7s ease-in-out infinite 0.35s;
}

.home-art-page--front {
    animation: home-page-drift 7s ease-in-out infinite 0.7s;
}

.home-art-row {
    transform-origin: left center;
    animation: home-row-in 1.1s ease-out both;
}

.home-art-flow {
    stroke-dasharray: 620;
    stroke-dashoffset: 620;
    animation: home-flow-draw 1.8s ease-out 0.35s forwards;
}

.home-art-dot {
    opacity: 0;
    animation: home-dot-in 0.45s ease-out 1.9s forwards;
}

.home-art-dot--pulse {
    animation: home-dot-in 0.45s ease-out 1.9s forwards, home-pulse 2.4s ease-out 2.3s infinite;
}

@keyframes home-page-drift {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes home-row-in {
    from {
        opacity: 0;
        transform: scaleX(0.72);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

@keyframes home-flow-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes home-dot-in {
    to { opacity: 1; }
}

@keyframes home-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.18;
    }
    50% {
        transform: scale(1.55);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-art-page--back,
    .home-art-page--mid,
    .home-art-page--front,
    .home-art-row,
    .home-art-flow,
    .home-art-dot,
    .home-art-dot--pulse {
        animation: none;
    }

    .home-art-flow {
        stroke-dashoffset: 0;
    }

    .home-art-dot {
        opacity: 1;
    }
}

/* Auth shell (Razor Pages: Signed out, etc.) */
.auth-shell {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 60% at 10% 20%, rgba(15, 110, 86, 0.12), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 80%, rgba(28, 43, 51, 0.08), transparent 50%),
        var(--mt-surface);
}

.auth-shell-frame {
    display: grid;
    min-height: 100vh;
}

@media (min-width: 800px) {
    .auth-shell-frame {
        grid-template-columns: minmax(16rem, 22rem) 1fr;
    }
}

.auth-shell-brand {
    display: none;
    background: linear-gradient(180deg, var(--mt-sidebar-top) 0%, var(--mt-sidebar-bottom) 100%);
    color: #fff;
    padding: 2.5rem 2rem;
}

@media (min-width: 800px) {
    .auth-shell-brand {
        display: flex;
        align-items: flex-end;
    }
}

.auth-shell-mark {
    margin: 0 0 0.5rem;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.auth-shell-tagline {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.65);
    max-width: 14rem;
}

.auth-shell-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    gap: 2rem;
}

.auth-shell-mobile-brand {
    width: 100%;
    max-width: 26rem;
}

.auth-shell-mobile-brand .auth-shell-mark {
    color: var(--mt-ink);
}

@media (min-width: 800px) {
    .auth-shell-mobile-brand {
        display: none;
    }
}

.auth-panel {
    width: 100%;
    max-width: 26rem;
}

.auth-kicker {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mt-muted);
}

.auth-title {
    margin: 0 0 0.75rem;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--mt-ink);
}

.auth-copy {
    margin: 0 0 1.5rem;
    font-size: 1.05rem;
    line-height: 1.45;
    color: var(--mt-ink-soft);
}

.auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.datetime-24 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.datetime-24-date {
    flex: 0 1 auto;
    width: 11.5rem;
    max-width: 100%;
}

.datetime-24-time {
    flex: 0 0 auto;
    width: 5.25rem;
    font-variant-numeric: tabular-nums;
}

.ledger-tz {
    margin-top: 0.45rem;
}

.ledger-tz-select {
    margin-top: 0.4rem;
    max-width: 22rem;
}

.ledger-tz-current {
    margin-top: 0.15rem;
}

.transaction-edit-layout--with-receipt {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
    gap: 1.25rem 1.75rem;
    align-items: stretch;
}

.transaction-edit-fields {
    min-width: 0;
}

.transaction-edit-fields-last {
    margin-bottom: 0 !important;
}

.transaction-edit-receipt {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.transaction-edit-layout--with-receipt .receipt-dropzone {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
    box-sizing: border-box;
}

.transaction-edit-layout--with-receipt .receipt-dropzone-label {
    flex: 1 1 auto;
    justify-content: center;
}

.transaction-edit-actions {
    margin-top: 1.25rem;
}

@media (max-width: 768px) {
    .transaction-edit-layout--with-receipt {
        grid-template-columns: 1fr;
    }

    .transaction-edit-receipt {
        order: -1;
    }

    .transaction-edit-layout--with-receipt .receipt-dropzone {
        min-height: 12rem;
        height: auto;
    }
}

.receipt-dropzone {
    border: 1px dashed var(--mt-line-strong);
    background: var(--mt-surface-raised);
    border-radius: 0.35rem;
    padding: 1rem 1.1rem;
}

.receipt-dropzone.is-busy {
    opacity: 0.7;
    pointer-events: none;
}

.receipt-dropzone-label {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    margin: 0;
    cursor: pointer;
}

.receipt-dropzone-label input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.receipt-dropzone-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--mt-ink);
}

.receipt-dropzone-hint {
    font-size: 0.9rem;
    color: var(--mt-muted);
}

.receipt-dropzone-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--mt-line);
}

.receipt-camera-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--mt-accent);
    border-radius: 0.3rem;
    color: var(--mt-accent);
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.receipt-camera-btn:hover:not(:disabled) {
    color: #fff;
    background: var(--mt-accent);
}

.receipt-camera-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.receipt-camera-icon {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
}

.receipt-dropzone-actions-hint {
    font-size: 0.85rem;
    color: var(--mt-muted);
}

.receipt-dropzone-status {
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    color: var(--mt-accent);
}

.receipt-camera-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1070;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(28, 43, 51, 0.72);
    backdrop-filter: blur(2px);
}

.receipt-camera-dialog {
    width: min(100%, 40rem);
    background: var(--mt-surface-raised);
    border: 1px solid var(--mt-line);
    border-radius: 0.5rem;
    padding: 1rem 1.1rem 1.1rem;
}

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

.receipt-camera-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--mt-ink);
}

.receipt-camera-video-wrap {
    background: #111;
    border-radius: 0.35rem;
    overflow: hidden;
    min-height: 12rem;
}

.receipt-camera-video {
    display: block;
    width: 100%;
    max-height: min(60vh, 28rem);
    object-fit: contain;
    background: #111;
}

.receipt-camera-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.85rem;
}

.receipt-preview {
    margin-top: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.receipt-preview-thumb {
    position: relative;
    padding: 0;
    border: 1px solid var(--mt-line);
    border-radius: 0.25rem;
    background: #fff;
    cursor: zoom-in !important;
    line-height: 0;
}

.receipt-preview-thumb:disabled {
    cursor: default !important;
    opacity: 0.7;
}

.receipt-preview-thumb:focus-visible {
    outline: 2px solid var(--mt-accent);
    outline-offset: 2px;
}

.receipt-preview-thumb img {
    display: block;
    max-width: min(100%, 22rem);
    max-height: 18rem;
    width: auto;
    height: auto;
    object-fit: contain;
}

.receipt-preview-zoom {
    position: absolute;
    right: 0.4rem;
    bottom: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: rgba(28, 43, 51, 0.72);
    color: #fff;
    pointer-events: none;
}

.receipt-preview-zoom svg {
    width: 1rem;
    height: 1rem;
}

.receipt-preview-clear {
    padding-left: 0;
}

.receipt-lightbox-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(28, 43, 51, 0.72);
    backdrop-filter: blur(2px);
}

.receipt-lightbox {
    position: relative;
    max-width: min(100%, 56rem);
    max-height: calc(100vh - 2.5rem);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.receipt-lightbox-close {
    align-self: flex-end;
    background: var(--mt-surface-raised);
}

.receipt-lightbox img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 5.5rem);
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 0.35rem;
    background: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

