.search-select {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
}

.search-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.search-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    width: 100%;
    padding-right: .75rem;
    text-align: left;
    cursor: pointer;
    background-image: none !important;
}

.search-select-trigger:focus-visible {
    outline: 2px solid #00AEEF;
    outline-offset: 2px;
}

.search-select-trigger[aria-invalid="true"] {
    border-color: #F43F5E;
}

.search-select-trigger:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.search-select-value {
    overflow: hidden;
    flex: 1 1 auto;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-select-value[data-placeholder="true"] {
    color: rgb(var(--ledger-muted));
}

.search-select-chevron {
    flex: none;
    color: rgb(var(--ledger-muted));
    transition: color 140ms ease, transform 140ms ease;
}

.search-select[aria-expanded="true"] .search-select-trigger {
    border-color: #00AEEF;
    box-shadow: 0 0 0 3px rgb(0 174 239 / .18);
}

.search-select[aria-expanded="true"] .search-select-chevron {
    color: #00AEEF;
    transform: rotate(180deg);
}

.search-select-trigger[data-rich-account] {
    height: auto;
    min-height: 3.5rem;
    padding-top: .375rem;
    padding-bottom: .375rem;
}

.search-select-trigger[data-rich-account] .search-select-value {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
}

.dashboard-balance-card {
    color: #fff;
}

.dashboard-balance-muted {
    color: rgb(255 255 255 / .72);
}

.dashboard-balance-toggle {
    border: 1px solid rgb(255 255 255 / .14);
    background: rgb(255 255 255 / .08);
    color: #fff;
    transition: background-color 150ms ease, border-color 150ms ease;
}

.dashboard-balance-toggle:hover {
    background: rgb(255 255 255 / .14);
    border-color: rgb(255 255 255 / .22);
}

/* Balance cards stay dark navy in both themes (see .hero-card in app.css). */

.account-mobile-actions {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    touch-action: pan-x;
}

.account-title {
    overflow-wrap: anywhere;
}

.settings-autohide-controls {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}

.splash-card {
    border: 1px solid rgb(var(--ledger-line));
    background: rgb(var(--ledger-surface));
}

@media (max-width: 639px) {
    .set-row[data-autohide-form] {
        display: grid;
        grid-template-columns: 36px minmax(0, 1fr);
        align-items: start;
        gap: 12px;
    }

    .set-row[data-autohide-form] > .set-ic {
        grid-column: 1;
        grid-row: 1 / span 2;
        margin-top: .125rem;
    }

    .set-row[data-autohide-form] > .min-w-0 {
        grid-column: 2;
        grid-row: 1;
    }

    .settings-autohide-controls {
        grid-column: 2;
        grid-row: 2;
        width: 100%;
        flex-wrap: wrap;
        margin-left: 0;
    }

    .settings-autohide-controls > .search-select,
    .settings-autohide-controls > [data-autohide-duration] {
        flex: 0 0 auto;
    }

    #pin-modal {
        inset: auto 8px max(8px, env(safe-area-inset-bottom)) 8px !important;
        width: calc(100vw - 16px) !important;
        height: auto;
        max-height: calc(100vh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        overflow-x: hidden;
        overflow-y: auto;
        border: 1px solid rgb(var(--ledger-line));
        border-radius: 24px;
        padding-top: 8px;
        padding-bottom: 8px;
        background: rgb(var(--ledger-surface));
        transform: translateY(12px);
        transition: transform .24s var(--ease-out), opacity .24s ease;
    }

    #pin-modal[data-open] {
        transform: translateY(0);
    }

    #pin-modal .modal-head {
        position: relative;
        flex: none;
        justify-content: flex-start;
        min-height: 0;
        padding: 1rem 1.25rem .75rem;
        border: 0;
        background: transparent;
    }

    #pin-modal .modal-head > div {
        flex-direction: row;
        justify-content: flex-start;
        gap: .75rem;
        padding-right: 2rem;
        text-align: left;
    }

    #pin-modal .modal-head > div > .tile {
        display: inline-flex;
        width: 3.25rem;
        height: 3.25rem;
        flex: none;
    }

    #pin-modal .modal-head h2 {
        font-size: 1.125rem;
        line-height: 1.25;
    }

    #pin-modal .modal-head p {
        margin-top: .2rem;
        font-size: .875rem;
    }

    #pin-modal .modal-head .modal-back {
        position: absolute;
        top: .75rem;
        left: .75rem;
        right: auto;
    }

    #pin-modal .modal-head [data-close] {
        position: absolute;
        top: .75rem;
        right: .75rem;
    }

    #pin-modal .modal-body {
        display: flex;
        flex: 0 1 auto;
        min-height: 0;
        align-items: stretch;
        justify-content: flex-start;
        padding: .25rem 1.25rem 1rem;
    }

    #pin-modal [data-pin-form] {
        display: flex;
        width: min(100%, 32rem);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: .625rem;
        margin: 0 auto;
    }

    #pin-modal [data-pin-form] > * {
        margin: 0;
    }

    #pin-modal [data-pin-dots] {
        gap: 1rem;
        padding: .5rem 0;
        margin-bottom: clamp(1.25rem, 4vh, 2rem);
    }

    #pin-modal [data-pin-error] {
        margin: 0;
    }

    #pin-modal .keypad {
        width: 100%;
        max-width: 32rem;
        gap: .75rem;
    }

    #pin-modal .keypad button {
        display: grid;
        width: 100%;
        min-width: 0;
        height: clamp(3.75rem, 11vh, 4.875rem);
        place-items: center;
        justify-self: center;
        padding: 0;
        border-radius: 1.125rem;
        font-size: 1.5rem;
    }

    #pin-modal .keypad button:focus-visible {
        outline: 2px solid #00AEEF;
        outline-offset: 3px;
    }

    #pin-modal .keypad button[data-key="passkey"] {
        display: flex;
        width: 100%;
        height: clamp(3.75rem, 11vh, 4.875rem);
        flex-direction: column;
        gap: .25rem;
        border-color: transparent;
        background: rgb(var(--ledger-raised));
        text-align: center;
        white-space: normal;
        font-size: .75rem !important;
    }

    #pin-modal [data-pin-form] > div:last-child {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        margin-top: .5rem;
        text-align: left;
    }
}

.pin-edit-sheet {
    width: min(440px, calc(100vw - 24px)) !important;
    height: min(86vh, 640px);
    height: min(86dvh, 640px);
    max-height: calc(100dvh - 24px);
    overflow: hidden;
}

.email-otp-sheet {
    width: min(440px, calc(100vw - 24px)) !important;
}

.modal.modal-sheet.pin-edit-sheet::before {
    display: none;
}

.pin-edit-sheet > form {
    display: flex;
    height: 100%;
    min-height: 0;
    flex-direction: column;
}

.pin-edit-sheet > form > .pin-edit-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.pin-reset-keypad-panel {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1rem;
}

.pin-edit-steps {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .25rem;
    overflow: hidden;
    border: 1px solid rgb(var(--ledger-line));
    border-radius: .875rem;
    background: rgb(var(--ledger-bg));
    padding: .25rem;
}

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

.pin-edit-steps button {
    min-width: 0;
    overflow: hidden;
    border-radius: .625rem;
    padding: .65rem .4rem;
    color: rgb(var(--ledger-muted));
    font-size: .875rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pin-edit-steps button.is-active {
    background: rgb(var(--ledger-raised));
    color: rgb(var(--ledger-ink));
    box-shadow: 0 1px 3px rgb(0 0 0 / .2);
}

.pin-edit-label {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
}

.pin-edit-dots {
    display: flex;
    min-height: 2rem;
    justify-content: center;
    gap: 1rem;
    margin: .25rem 0 1rem;
}

.pin-edit-dots span {
    width: .875rem;
    height: .875rem;
    border: 2px solid rgb(var(--ledger-line));
    border-radius: 9999px;
}

.pin-edit-dots span.is-filled {
    border-color: #00AEEF;
    background: #00AEEF;
}

.pin-edit-keypad {
    display: grid;
    width: min(100%, 30rem);
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .625rem;
    margin: auto auto .5rem;
}

.pin-edit-keypad button {
    display: grid;
    min-width: 0;
    height: clamp(3rem, 6.5vh, 3.75rem);
    place-items: center;
    border: 1px solid rgb(var(--ledger-line));
    border-radius: 1rem;
    background: rgb(var(--ledger-surface));
    color: rgb(var(--ledger-ink));
    font-size: 1.625rem;
    font-weight: 600;
}

.pin-edit-keypad button:active {
    background: rgb(var(--ledger-raised));
}

.pin-edit-keypad button:focus-visible,
.pin-edit-steps button:focus-visible {
    outline: 2px solid #00AEEF;
    outline-offset: 2px;
}

.pin-edit-foot {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    border: 0;
    padding-top: .75rem;
}

.pin-edit-sheet > form > .modal-head {
    flex: 0 0 auto;
}

.pin-edit-foot button {
    min-height: 3.75rem;
}

@media (max-width: 639px) {
    .pin-edit-sheet,
    .email-otp-sheet {
        width: min(440px, calc(100vw - 16px)) !important;
        margin-inline: auto !important;
    }

    .pin-edit-sheet {
        inset: auto 8px max(8px, env(safe-area-inset-bottom)) 8px !important;
        height: min(84vh, 640px);
        height: min(84dvh, 640px);
        max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        overflow: hidden;
        border-radius: 24px;
        padding: 8px 0;
        background: rgb(var(--ledger-surface));
    }

    .pin-edit-sheet > form {
        height: 100%;
        min-height: 0;
    }

    .pin-edit-sheet .modal-head {
        position: relative;
        flex: none;
        min-height: 4.5rem;
        padding: .75rem 1.25rem;
        border: 0;
        background: transparent;
    }

    .pin-edit-sheet .modal-head [data-close] {
        position: absolute;
        top: .75rem;
        right: .75rem;
    }

    .pin-edit-sheet > form > .pin-edit-body {
        min-height: 0;
        padding: .5rem 1.25rem .75rem;
    }

    .pin-edit-keypad {
        width: 100%;
        gap: .625rem;
    }

    .pin-edit-keypad button {
        height: clamp(3rem, 7vh, 3.75rem);
    }

    .pin-edit-foot {
        flex: none;
        padding: .75rem 1.25rem .5rem;
    }
}

@media (max-width: 639px) and (min-height: 240px) and (max-height: 520px) {
    .email-otp-sheet {
        inset: max(4px, env(safe-area-inset-top)) 8px max(4px, env(safe-area-inset-bottom)) 8px !important;
        left: 50% !important;
        right: auto !important;
        width: min(440px, calc(100vw - 16px)) !important;
        height: auto;
        max-height: none;
        padding: 2px 0;
        border-radius: 16px;
        overflow: hidden;
        transform: translateX(-50%) !important;
    }

    .email-otp-sheet::before {
        display: none;
    }

    .email-otp-sheet > form {
        display: flex;
        height: 100%;
        min-height: 0;
        flex-direction: column;
    }

    .email-otp-sheet .modal-head {
        flex: none;
        min-height: 36px;
        padding: .25rem .75rem;
    }

    .email-otp-sheet .modal-head h2 {
        font-size: 1.125rem;
        line-height: 1.25rem;
    }

    .email-otp-sheet .modal-head [data-close] {
        top: .125rem;
        right: .5rem;
    }

    .email-otp-sheet > form > .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding: .25rem .75rem;
    }

    .email-otp-sheet [data-email-change-panel] > * + * {
        margin-top: .4rem;
    }

    .email-otp-sheet [data-email-change-panel] > p {
        margin: 0;
        font-size: .75rem;
        line-height: 1.2;
    }

    .email-otp-sheet .label {
        margin-bottom: .2rem;
    }

    .email-otp-sheet .otp-row {
        gap: .3rem;
    }

    .email-otp-sheet .otp-box {
        height: 2.125rem;
        font-size: 1rem;
    }

    .email-otp-sheet .otp-paste:not([hidden]) {
        height: 1.75rem;
        margin-top: .25rem;
    }

    .email-otp-sheet > form > .modal-foot {
        flex: none;
        gap: .4rem;
        padding: .2rem .75rem .25rem;
    }

    .pin-edit-sheet {
        inset: max(4px, env(safe-area-inset-top)) 8px max(4px, env(safe-area-inset-bottom)) 8px !important;
        left: 50% !important;
        right: auto !important;
        width: min(440px, calc(100vw - 16px)) !important;
        height: auto;
        max-height: none;
        padding: 2px 0;
        border-radius: 16px;
        transform: translateX(-50%) !important;
    }

    .pin-edit-sheet::before {
        display: none;
    }

    .pin-edit-sheet .modal-head {
        min-height: 36px;
        padding: .25rem .75rem;
    }

    .pin-edit-sheet .modal-head h2 {
        font-size: 1.125rem;
        line-height: 1.25rem;
    }

    .pin-edit-sheet .modal-head [data-close] {
        top: .125rem;
        right: .5rem;
    }

    .pin-edit-sheet > form > .pin-edit-body {
        gap: .2rem;
        overflow: hidden;
        padding: 0 .75rem;
    }

    .pin-edit-steps {
        padding: .15rem;
    }

    .pin-edit-steps button {
        padding: .25rem .2rem;
        font-size: .7rem;
        line-height: 1;
    }

    .pin-edit-label {
        margin: 0;
        font-size: 1rem;
        line-height: 1.2;
    }

    .pin-edit-dots {
        min-height: 12px;
        gap: .65rem;
        margin: 0;
    }

    .pin-edit-dots span {
        width: .625rem;
        height: .625rem;
    }

    .pin-edit-keypad {
        width: 100%;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: .2rem;
        margin: 0 auto;
    }

    .pin-edit-keypad button {
        height: clamp(1.75rem, 7vh, 2.625rem);
        border-radius: .65rem;
        font-size: 1.125rem;
    }

    .pin-edit-keypad > span {
        grid-row: 3;
        grid-column: 1;
    }

    .pin-edit-keypad > button:nth-of-type(9) {
        grid-row: 3;
        grid-column: 2;
    }

    .pin-edit-keypad > button:nth-of-type(10) {
        grid-row: 3;
        grid-column: 3;
    }

    .pin-edit-keypad > button:nth-of-type(11) {
        grid-row: 3;
        grid-column: 4;
    }

    .pin-reset-keypad-panel {
        gap: .15rem;
    }

    #pin-reset-sheet [data-pin-reset-panel="otp"] > * + * {
        margin-top: .4rem;
    }

    #pin-reset-sheet [data-pin-reset-panel="otp"] > p {
        margin: 0;
        font-size: .75rem;
        line-height: 1.2;
    }

    .pin-edit-sheet .otp-row {
        gap: .3rem;
    }

    .pin-edit-sheet .otp-box {
        height: 2.125rem;
        font-size: 1rem;
    }

    .pin-edit-sheet .otp-paste:not([hidden]) {
        height: 1.75rem;
        margin-top: .25rem;
    }

    [data-pin-reset-back-otp] {
        padding: 0;
        font-size: .75rem;
        line-height: 1;
    }

    .pin-edit-sub {
        margin: 0;
        font-size: .65rem;
        line-height: 1;
        text-align: center;
    }

    #pin-reset-sheet .pin-edit-sub {
        display: none;
    }

    .pin-edit-foot {
        gap: .4rem;
        padding: .2rem .75rem .25rem;
    }

    .pin-edit-foot button {
        min-height: 2.25rem;
        padding-block: .4rem;
    }
}

.search-select-other {
    margin-top: .75rem;
}

.search-select-menu {
    position: fixed;
    z-index: 65;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
    border: 1px solid rgb(var(--ledger-line));
    border-radius: 12px;
    background: rgb(var(--ledger-raised));
    box-shadow: 0 14px 36px rgb(0 0 0 / .24), 0 2px 6px rgb(0 0 0 / .12);
    transform-origin: top center;
    animation: search-select-in 120ms cubic-bezier(.23, 1, .32, 1) both;
}

.period-choice {
    display: inline-flex;
    min-height: 2.75rem;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
    gap: .5rem;
    border: 1px solid rgb(var(--ledger-line));
    border-radius: .75rem;
    background: rgb(var(--ledger-surface));
    padding: .625rem .875rem;
    color: rgb(var(--ledger-fg));
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.period-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
    gap: .5rem;
}

.period-choice > span:nth-child(2) {
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
    white-space: normal;
    line-height: 1.25;
}

.period-control-panel {
    border: 1px solid rgb(var(--ledger-line));
    border-radius: .75rem;
    background: rgb(var(--ledger-surface));
    padding: .75rem;
}

.period-month-field {
    min-width: 9rem;
}

.period-year-field {
    min-width: 7rem;
}

.period-choice:hover {
    border-color: rgb(0 174 239 / .55);
    background: var(--ledger-tint);
}

.period-choice:focus-visible {
    outline: 2px solid #00AEEF;
    outline-offset: 2px;
}

.period-choice[aria-pressed="true"] {
    border-color: #00AEEF;
    background: rgb(0 174 239 / .12);
    color: #00AEEF;
}

.period-choice-check {
    display: inline-flex;
    align-items: center;
}

.period-choice-check[hidden],
[data-r-month-controls][hidden],
[data-r-custom-controls][hidden],
[data-account-month-controls][hidden],
[data-account-custom-controls][hidden] {
    display: none !important;
}

.period-picker {
    position: relative;
    z-index: 40;
    width: min(100%, 22rem);
}

.period-picker > summary {
    list-style: none;
}

.period-picker > summary::-webkit-details-marker {
    display: none;
}

.period-picker-trigger {
    display: flex;
    min-height: 3.75rem;
    align-items: center;
    gap: .75rem;
    border: 1.5px solid rgb(var(--ledger-line));
    border-radius: 1rem;
    background: rgb(var(--ledger-raised));
    padding: .625rem 1rem;
    color: rgb(var(--ledger-fg));
    font-size: 1.125rem;
    font-weight: 650;
    cursor: pointer;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.period-picker-trigger > svg {
    width: 1.375rem;
    height: 1.375rem;
}

.period-picker[open] .period-picker-trigger,
.period-picker-trigger:focus-visible {
    border-color: #1687ff;
    box-shadow: 0 0 0 1px #1687ff;
    outline: none;
}

.period-picker-chevron {
    transition: transform 140ms ease;
}

.period-picker[open] .period-picker-chevron {
    transform: rotate(180deg);
}

.period-picker-panel {
    position: absolute;
    top: calc(100% + .375rem);
    left: 0;
    z-index: 75;
    width: min(760px, calc(100vw - 2rem));
    overflow: hidden;
    border: 1px solid rgb(var(--ledger-line));
    border-radius: 1.125rem;
    background: rgb(var(--ledger-raised));
    box-shadow: 0 18px 48px rgb(3 12 30 / .3), 0 2px 8px rgb(3 12 30 / .14);
}

.period-picker-layout {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
}

.period-picker-shortcuts {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: .2rem;
    border-right: 1px solid rgb(var(--ledger-line));
    padding: .625rem;
}

.period-picker-option {
    display: flex;
    min-width: 0;
    min-height: 2.5rem;
    align-items: center;
    gap: .625rem;
    border: 1px solid transparent;
    border-radius: .7rem;
    padding: .5rem .625rem;
    color: rgb(var(--ledger-fg));
    font-size: .9375rem;
    font-weight: 550;
    text-align: left;
    transition: background-color 140ms ease, color 140ms ease;
}

.period-picker-option > svg {
    width: 1.25rem;
    height: 1.25rem;
}

.period-picker-check svg {
    width: 1.125rem;
    height: 1.125rem;
}

.period-picker-option > span:nth-child(2) {
    min-width: 0;
    flex: 1 1 auto;
}

.period-picker-option:hover,
.period-picker-option[aria-pressed="true"] {
    background: linear-gradient(110deg, #0879f9, #0664e9);
    color: #fff;
}

.period-picker-option:focus-visible,
.period-picker-month:focus-visible,
.period-picker-day:focus-visible,
.period-picker-nav-button:focus-visible,
.period-picker-reset:focus-visible,
.period-picker-apply:focus-visible {
    outline: 2px solid #1687ff;
    outline-offset: 2px;
}

.period-picker-custom-option {
    min-height: 3rem;
    margin-top: auto;
    border-color: rgb(var(--ledger-line));
    background: rgb(var(--ledger-surface));
}

.period-picker-check {
    display: inline-flex;
    align-items: center;
}

.period-picker-check[hidden],
.period-picker-option[hidden],
.period-picker-year-select[hidden],
.period-picker-year-nav[hidden],
.period-picker-months[hidden],
[data-picker-range-controls][hidden] {
    display: none !important;
}

.period-picker-calendar {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: .625rem;
}

.period-picker-year-select {
    display: flex;
    min-height: 3rem;
    align-items: center;
    gap: .5rem;
    border: 1px solid rgb(var(--ledger-line));
    border-radius: .75rem;
    padding: 0 .625rem;
    color: rgb(var(--ledger-fg));
}

.period-picker-year-select > svg {
    width: 1.125rem;
    height: 1.125rem;
}

.period-picker-year-select select {
    width: 100%;
    min-width: 0;
    appearance: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    outline: none;
}

.period-picker-year-nav {
    display: grid;
    grid-template-columns: 2.5rem 1fr 2.5rem;
    align-items: center;
    gap: .5rem;
    margin: .625rem 0;
    border: 1px solid rgb(var(--ledger-line));
    border-radius: .75rem;
    padding: .25rem;
    color: rgb(var(--ledger-fg));
    font-size: 1.25rem;
    font-weight: 650;
    text-align: center;
}

.period-picker-nav-button {
    display: inline-flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgb(var(--ledger-line));
    border-radius: .75rem;
    background: rgb(var(--ledger-surface));
    color: rgb(var(--ledger-fg));
}

.period-picker-nav-button:disabled {
    cursor: not-allowed;
    opacity: .4;
}

.period-picker-months {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .375rem;
}

.period-picker-month {
    min-height: 2.625rem;
    border: 1px solid rgb(var(--ledger-line));
    border-radius: .6875rem;
    background: transparent;
    color: rgb(var(--ledger-fg));
    font-size: .9375rem;
    font-weight: 550;
}

.period-picker-month:hover,
.period-picker-month[aria-pressed="true"] {
    border-color: #1687ff;
    background: linear-gradient(110deg, #1687ff, #0664e9);
    color: #fff;
}

.period-picker-custom {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: .5rem;
}

.period-picker-range-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}

.period-picker-range-summary > div {
    display: grid;
    min-width: 0;
    gap: .125rem;
    border: 1px solid rgb(var(--ledger-line));
    border-radius: .75rem;
    background: rgb(var(--ledger-surface));
    padding: .5rem .625rem;
}

.period-picker-range-summary span {
    color: rgb(var(--ledger-muted));
    font-size: .625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.period-picker-range-summary strong {
    overflow: hidden;
    color: rgb(var(--ledger-fg));
    font-size: .75rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.period-picker-calendars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}

.period-picker-calendar-month {
    min-width: 0;
}

.period-picker-calendar-selects {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    gap: .375rem;
}

.period-picker-calendar-select {
    display: flex;
    min-width: 0;
    min-height: 2.25rem;
    align-items: center;
    gap: .25rem;
    border: 1px solid rgb(var(--ledger-line));
    border-radius: .625rem;
    padding: 0 .4rem;
    color: rgb(var(--ledger-fg));
}

.period-picker-calendar-select select {
    width: 100%;
    min-width: 0;
    appearance: none;
    background: transparent;
    color: inherit;
    font-size: .75rem;
    font-weight: 600;
    outline: none;
}

.period-picker-calendar-heading {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) 2rem;
    align-items: center;
    gap: .25rem;
    margin: .375rem 0;
    color: rgb(var(--ledger-fg));
    font-size: .75rem;
    text-align: center;
}

.period-picker-calendar-heading strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.period-picker-calendar-heading .period-picker-nav-button {
    width: 2rem;
    height: 2rem;
    border-radius: .625rem;
}

.period-picker-nav-spacer {
    width: 2rem;
    height: 2rem;
}

.period-picker-weekdays,
.period-picker-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: center;
    justify-items: center;
}

.period-picker-weekdays {
    margin-bottom: .125rem;
    color: rgb(var(--ledger-muted));
    font-size: .625rem;
    font-weight: 600;
}

.period-picker-weekdays > span {
    text-align: center;
}

.period-picker-day-empty,
.period-picker-day {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 1.875rem;
    align-items: center;
    justify-content: center;
}

.period-picker-day {
    border: 1px solid transparent;
    border-radius: .5rem;
    background: transparent;
    color: rgb(var(--ledger-fg));
    font-size: .75rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.period-picker-day:hover,
.period-picker-day.is-today {
    border-color: #1687ff;
}

.period-picker-day.is-in-range {
    border-radius: 0;
    background: rgb(22 135 255 / .18);
}

.period-picker-day.is-range-start,
.period-picker-day.is-range-end {
    border-color: #1687ff;
    border-radius: .5rem;
    background: linear-gradient(110deg, #1687ff, #0664e9);
    color: #fff;
}

.period-picker-day.is-range-start.is-range-end {
    border-radius: 50%;
}

.period-picker-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: .625rem;
    margin-top: auto;
    border-top: 1px solid rgb(var(--ledger-line));
    padding-top: .75rem;
}

.period-picker-actions.is-clean {
    grid-template-columns: minmax(0, 1fr);
}

.period-picker-apply[hidden] {
    display: none !important;
}

.period-picker-reset,
.period-picker-apply {
    display: inline-flex;
    min-height: 3.25rem;
    align-items: center;
    justify-content: center;
    gap: .625rem;
    border: 1px solid rgb(var(--ledger-line));
    border-radius: .875rem;
    padding: .5rem .625rem;
    color: rgb(var(--ledger-fg));
    font-weight: 600;
}

.period-picker-reset {
    background: transparent;
    transition: border-color 140ms ease, background-color 140ms ease;
}

.period-picker-reset:hover {
    border-color: rgb(var(--ledger-line));
    background: rgb(var(--ledger-surface));
}

.period-picker-apply {
    border-color: #0879f9;
    background: linear-gradient(110deg, #1687ff, #0664e9);
    color: #fff;
}

.period-picker-reset,
.period-picker-apply {
    min-height: 2.875rem;
    font-size: .9375rem;
}

.period-picker-reset svg,
.period-picker-apply svg {
    width: 1.125rem;
    height: 1.125rem;
}

@media (max-width: 720px) {
    .period-picker {
        width: min(100%, 100%);
    }

    .period-picker-trigger {
        min-height: 3.25rem;
        gap: .875rem;
        border-radius: 1rem;
        padding: .75rem 1rem;
        font-size: 1rem;
    }

    .period-picker-trigger > svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .period-picker-panel {
        position: fixed;
        inset: max(4.5rem, env(safe-area-inset-top)) .5rem .5rem;
        width: auto;
        max-height: none;
        overflow-y: auto;
        overscroll-behavior: contain;
        box-shadow: 0 0 0 100vmax rgb(3 12 30 / .52), 0 18px 48px rgb(3 12 30 / .36);
    }

    .period-picker-layout {
        display: block;
    }

    .period-picker-shortcuts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .375rem;
        border-right: 0;
        border-bottom: 1px solid rgb(var(--ledger-line));
        padding: .625rem;
    }

    .period-picker-option {
        min-height: 2.625rem;
        gap: .5rem;
        padding: .5rem;
        font-size: .8125rem;
    }

    .period-picker-option > svg {
        width: 1.125rem;
        height: 1.125rem;
    }

    .period-picker-custom-option {
        min-height: 2.625rem;
        margin-top: 0;
    }

    .period-picker-calendar {
        padding: .625rem;
    }

    .period-picker-year-select {
        min-height: 3rem;
    }

    .period-picker-year-nav {
        grid-template-columns: 2.5rem 1fr 2.5rem;
        margin: .5rem 0;
        font-size: 1.125rem;
    }

    .period-picker-nav-button {
        width: 2.25rem;
        height: 2.25rem;
    }

    .period-picker-months {
        gap: .375rem;
    }

    .period-picker-month {
        min-height: 2.75rem;
        font-size: .9375rem;
    }

    .period-picker-calendars {
        gap: .375rem;
    }

    .period-picker-calendar-selects {
        gap: .25rem;
    }

    .period-picker-calendar-select {
        min-height: 2rem;
        gap: .125rem;
        padding: 0 .25rem;
    }

    .period-picker-calendar-select select {
        font-size: .6875rem;
    }

    .period-picker-calendar-select svg {
        width: .75rem;
        height: .75rem;
    }

    .period-picker-calendar-heading {
        grid-template-columns: 1.75rem minmax(0, 1fr) 1.75rem;
        font-size: .6875rem;
    }

    .period-picker-calendar-heading .period-picker-nav-button,
    .period-picker-nav-spacer {
        width: 1.75rem;
        height: 1.75rem;
    }

    .period-picker-day-empty,
    .period-picker-day {
        height: 1.625rem;
        font-size: .6875rem;
    }

    .period-picker-actions {
        position: sticky;
        bottom: -.625rem;
        margin: .75rem -.625rem -.625rem;
        padding: .625rem;
        background: rgb(var(--ledger-raised));
    }

    .period-picker-reset,
    .period-picker-apply {
        min-height: 3.25rem;
        font-size: .9375rem;
    }

    .period-picker-reset svg,
    .period-picker-apply svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

.search-select-search-wrap {
    flex: none;
    padding: .5rem;
    border-bottom: 1px solid rgb(var(--ledger-line));
    background: rgb(var(--ledger-raised));
}

.search-select-search {
    min-width: 0;
}

.search-select-options {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 5px;
}

.search-select-options.has-account-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: .5rem;
}

.search-select-options.has-account-options > .search-select-account-option-card {
    min-width: 0;
    margin: 0;
}

.search-select-options.has-account-options > .search-select-option:not(.search-select-option-account) {
    grid-column: 1 / -1;
}

.search-select-options.has-account-options > .search-select-empty {
    grid-column: 1 / -1;
}

.search-select-option {
    display: flex;
    width: 100%;
    min-height: 2.5rem;
    align-items: center;
    gap: .5rem;
    padding: 0 .75rem;
    border-radius: .5rem;
    color: rgb(var(--ledger-fg));
    text-align: left;
    font-size: .875rem;
    transition: background-color 120ms ease, color 120ms ease;
}

.search-select-option > span:first-child {
    overflow: hidden;
    flex: 1 1 auto;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-select-option:hover,
.search-select-option[data-active="true"],
.search-select-option[aria-selected="true"] {
    background: var(--ledger-tint);
}

.search-select-option[aria-selected="true"] {
    color: #00AEEF;
    font-weight: 600;
}

.search-select-option-account {
    position: relative;
    min-height: 0;
    padding: .5rem 2rem .5rem .5rem;
    white-space: normal;
}

.search-select-account-option-card {
    overflow: hidden;
    margin: .25rem;
    border: 1px solid rgb(var(--ledger-line));
    border-radius: .75rem;
    background: rgb(var(--ledger-surface));
}

.search-select-option-account > .search-select-account-card {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
}

.search-select-account-card {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    gap: .625rem;
}

.search-select-account-card.is-selected {
    gap: .5rem;
}

.search-select-account-card.is-selected .inst-logo {
    width: 2rem;
    height: 2rem;
}

[data-goal-account-none][aria-pressed="true"] {
    border-color: #00AEEF;
    background: rgb(0 174 239 / .08);
    color: rgb(var(--ledger-fg));
}

.search-select-account-info {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: .125rem;
}

.search-select-account-holder,
.search-select-account-institution {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.search-select-account-holder {
    color: rgb(var(--ledger-fg));
    font-weight: 650;
}

.search-select-account-institution {
    color: rgb(var(--ledger-muted));
    font-size: .75rem;
}

.search-select-account-type {
    margin-top: .125rem;
    font-size: .65rem;
    line-height: 1.2;
}

.search-select-account-selected-number {
    max-width: 100%;
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    margin-top: .125rem;
    border: 1px solid rgb(var(--ledger-line));
    border-radius: 9999px;
    background: rgb(var(--ledger-raised));
    padding: .2rem .45rem;
    overflow-wrap: anywhere;
    color: rgb(var(--ledger-muted));
    font-size: .65rem;
    font-weight: 550;
    line-height: 1.2;
}

.search-select-account-details {
    display: flex;
    flex: 1 1 100%;
    min-width: 0;
    justify-content: space-between;
    gap: .75rem;
    padding-top: .375rem;
    margin: .375rem .625rem .5rem;
    border-top: 1px solid rgb(var(--ledger-line));
}

.search-select-option-account > .search-select-account-card {
    flex-wrap: wrap;
}

.search-select-account-detail {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: .25rem;
}

.search-select-account-label {
    grid-column: 1 / -1;
    color: rgb(var(--ledger-muted));
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .06em;
    line-height: 1.2;
    text-transform: uppercase;
}

.search-select-account-value {
    overflow-wrap: anywhere;
    color: rgb(var(--ledger-fg));
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.3;
}

.search-select-account-action {
    width: 1.75rem;
    height: 1.75rem;
    flex: none;
    color: rgb(var(--ledger-muted));
}

.search-select-account-action:hover {
    color: #00AEEF;
    background: var(--ledger-tint);
}

.search-select-account-selected-balance {
    flex: none;
    max-width: 38%;
    overflow: hidden;
    color: rgb(var(--ledger-fg));
    font-size: .75rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-select-option-account > .search-select-option-check {
    position: absolute;
    top: .75rem;
    right: .625rem;
}

.search-select-option-check {
    flex: none;
    color: #00AEEF;
}

.search-select-empty {
    padding: .75rem;
    color: rgb(var(--ledger-muted));
    text-align: center;
    font-size: .875rem;
}

@media (min-width: 640px) {
    .search-select-options.has-account-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.dt-toolbar-query {
    display: grid;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    gap: .5rem;
}

.dt-toolbar-search {
    width: 100%;
    min-width: 0;
}

.dt-toolbar-filters {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}

.dt-toolbar-filters[hidden] {
    display: none;
}

.dt-toolbar-filters > .search-select,
.dt-toolbar-filters > select.select,
.dt-toolbar-filters > label {
    width: 100%;
    min-width: 0;
}

@media (min-width: 640px) {
    .dt-toolbar-query {
        display: flex;
        flex: 1 1 auto;
        align-items: center;
        width: auto;
    }

    .dt-toolbar-search {
        flex: 0 1 12rem;
        width: auto;
        min-width: 10rem;
    }

    .dt-toolbar-filters {
        display: flex;
        flex: 1 1 auto;
        align-items: center;
        width: auto;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .dt-toolbar-filters::-webkit-scrollbar {
        display: none;
    }

    .dt-toolbar-filters > .search-select,
    .dt-toolbar-filters > select.select {
        flex: 0 1 10rem;
        width: auto;
        min-width: 8rem;
        max-width: 12rem;
    }

    .dt-toolbar-filters > label {
        display: flex;
        flex: 0 0 11rem;
        align-items: center;
        gap: .375rem;
        width: 11rem;
    }

    .dt-toolbar-filters > label > span {
        flex: none;
    }

    .dt-toolbar-filters > label > input {
        flex: 1 1 auto;
        min-width: 0;
    }
}

@media (min-width: 640px) {
    .dt-toolbar-query-stacked {
        display: grid;
        flex: 1 1 auto;
        align-items: start;
        width: auto;
        grid-template-columns: minmax(0, 1fr);
    }

    .dt-toolbar-query-stacked .dt-toolbar-search {
        flex: none;
        width: min(100%, 34rem);
    }

    .dt-toolbar-filters-stacked {
        display: grid;
        flex: none;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        overflow: visible;
    }

    .dt-toolbar-filters-stacked > .search-select,
    .dt-toolbar-filters-stacked > select.select {
        grid-column: 1 / -1;
        flex: none;
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .dt-toolbar-filters-stacked > label {
        display: grid;
        flex: none;
        align-items: stretch;
        gap: .25rem;
        width: auto;
        min-width: 0;
    }

    .dt-toolbar-filters-stacked > label > span {
        flex: none;
    }

    .dt-toolbar-filters-stacked > label > input {
        width: 100%;
        min-width: 0;
    }
}

@keyframes search-select-in {
    from { opacity: 0; transform: translateY(-3px) scale(.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .search-select-menu { animation: none; }
}

.dt-filter-modal {
    display: flex;
    width: min(1080px, calc(100vw - 32px)) !important;
    max-width: min(1080px, calc(100vw - 32px));
    max-height: calc(100dvh - 40px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgb(var(--ledger-line));
    border-radius: 24px;
    padding: 0;
    background: rgb(var(--ledger-surface));
    box-shadow: 0 24px 72px rgb(0 0 0 / .32);
    color: rgb(var(--ledger-ink));
}

.dt-filter-modal[hidden] {
    display: none !important;
}

.dt-filter-head {
    flex: none;
    gap: 1.5rem;
    border-bottom: 1px solid rgb(var(--ledger-line));
    padding: 1.5rem 1.75rem;
}

.dt-filter-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 1rem;
}

.dt-filter-heading > .tile {
    flex: none;
}

.dt-filter-heading h2 {
    margin: 0;
    font-size: clamp(1.25rem, 2.4vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -.025em;
}

.dt-filter-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.5rem 1.75rem;
}

.dt-filter-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem 1.75rem;
}

.dt-filter-field {
    display: grid;
    min-width: 0;
    align-content: start;
    gap: .55rem;
}

.dt-filter-field > label,
.dt-filter-range-title {
    margin: 0;
    color: rgb(var(--ledger-ink));
    font-size: .9375rem;
    font-weight: 650;
}

.dt-filter-field > .input,
.dt-filter-field > .select,
.dt-filter-field > .search-select,
.dt-filter-field .search-select-trigger {
    width: 100%;
    min-width: 0;
    min-height: 3.25rem;
    border-radius: .875rem;
    font-size: .9375rem;
}

.dt-filter-field > .input,
.dt-filter-field > .select {
    height: 3.25rem;
}

.dt-filter-range {
    display: grid;
    grid-column: 1 / -1;
    gap: .875rem;
    border-top: 1px solid rgb(var(--ledger-line));
    padding-top: 1.25rem;
}

.dt-filter-range-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 1.75rem;
}

.dt-filter-foot {
    display: flex;
    flex: none;
    justify-content: flex-end;
    border-top: 1px solid rgb(var(--ledger-line));
    padding: 1rem 1.75rem;
}

.dt-filter-foot .btn {
    min-width: 10rem;
    min-height: 3rem;
}

@media (max-width: 767px) {
    .dt-filter-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }

    .dt-filter-range-fields {
        gap: 1rem;
    }
}

@media (max-width: 639px) {
    .dt-filter-modal.modal.modal-sheet {
        inset: 50% auto auto 50% !important;
        width: min(720px, calc(100vw - 24px)) !important;
        max-width: calc(100vw - 24px) !important;
        height: auto !important;
        max-height: calc(100dvh - 24px);
        border: 1px solid rgb(var(--ledger-line));
        border-radius: 20px;
        padding: 0;
        transform: translate(-50%, -50%) scale(.98) !important;
        transition: opacity .2s ease, transform .2s ease;
    }

    .dt-filter-modal.modal.modal-sheet[data-open] {
        transform: translate(-50%, -50%) scale(1) !important;
    }

    .dt-filter-head {
        min-height: 0;
        gap: .75rem;
        padding: 1rem;
    }

    .dt-filter-heading {
        gap: .75rem;
    }

    .dt-filter-heading > .tile {
        width: 2.75rem;
        height: 2.75rem;
    }

    .dt-filter-heading h2 {
        font-size: 1.25rem;
    }

    .dt-filter-body {
        padding: 1rem;
    }

    .dt-filter-fields {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .dt-filter-range-fields {
        gap: .75rem;
    }

    .dt-filter-foot {
        padding: .75rem 1rem;
    }

    .dt-filter-foot .btn {
        min-height: 2.875rem;
    }
}

@media (max-width: 359px) {
    .dt-filter-range-fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dt-filter-modal.modal.modal-sheet {
        transition: none;
    }
}

html[data-motion="reduce"] .dt-filter-modal.modal.modal-sheet {
    transform: translate(-50%, -50%) !important;
    transition: none;
}
