.account-selection-page-wrapper .fi-page-content {
    width: 100%;
}

[x-cloak] {
    display: none !important;
}

.account-selection-page {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
    width: 100%;
    max-width: 72rem;
    margin-inline: auto;
    padding: 0.25rem 0 1rem;
}

/* ── Heading ── */

.account-selection-page__heading {
    text-align: center;
    margin-bottom: 0.25rem;
}

.account-selection-page__heading-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
}

.account-selection-page__mask-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.account-selection-page__mask-toggle:hover {
    color: #4f46e5;
    border-color: #c7d2fe;
    background: #eef2ff;
}

.account-selection-page__mask-toggle svg {
    width: 1.125rem;
    height: 1.125rem;
}

.dark .account-selection-page__mask-toggle {
    background: #1f2937;
    border-color: #374151;
    color: #9ca3af;
}

.dark .account-selection-page__mask-toggle:hover {
    color: #a5b4fc;
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.account-selection-page__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.375rem;
}

.dark .account-selection-page__title {
    color: #f9fafb;
}

.account-selection-page__subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
}

.dark .account-selection-page__subtitle {
    color: #9ca3af;
}

/* ── All accounts summary card ── */

.account-selection-page__summary-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-selection-page__summary-card--expanded {
    border-color: #c7d2fe;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.08);
}

.dark .account-selection-page__summary-card {
    background: #1f2937;
    border-color: #374151;
}

.dark .account-selection-page__summary-card--expanded {
    border-color: #6366f1;
}

.account-selection-page__summary-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.125rem;
    border: none;
    background: none;
    text-align: left;
    font-family: inherit;
    color: inherit;
    cursor: pointer;
}

.account-selection-page__summary-header-main {
    flex: 1;
    min-width: 0;
}

.account-selection-page__summary-badge {
    display: inline-block;
    margin-bottom: 0.375rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #4f46e5;
    background: #eef2ff;
    border-radius: 0.25rem;
}

.dark .account-selection-page__summary-badge {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.15);
}

.account-selection-page__summary-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: #111827;
}

.dark .account-selection-page__summary-title {
    color: #f9fafb;
}

.account-selection-page__summary-body {
    padding: 0 1.125rem 1.125rem;
    border-top: 1px solid #f3f4f6;
}

.dark .account-selection-page__summary-body {
    border-top-color: #374151;
}

/* ── Account list ── */

.account-selection-page__list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.account-selection-page__item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-selection-page__item--expanded {
    border-color: #c7d2fe;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.08);
}

.dark .account-selection-page__item {
    background: #1f2937;
    border-color: #374151;
}

.dark .account-selection-page__item--expanded {
    border-color: #6366f1;
}

.account-selection-page__item-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    padding: 1rem 1.125rem;
    border: none;
    background: none;
    text-align: left;
    font-family: inherit;
    color: inherit;
    cursor: pointer;
}

.account-selection-page__item-header:hover {
    background: #f9fafb;
}

.dark .account-selection-page__item-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.account-selection-page__item-icon {
    flex: 0 0 3rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: #f3f4f6;
    overflow: hidden;
}

.dark .account-selection-page__item-icon {
    background: #111827;
}

.account-selection-page__item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-selection-page__item-icon svg {
    width: 1.75rem;
    height: 1.75rem;
    color: #9ca3af;
}

.account-selection-page__item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.account-selection-page__item-name {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
}

.dark .account-selection-page__item-name {
    color: #f9fafb;
}

.account-selection-page__item-meta {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.dark .account-selection-page__item-meta {
    color: #9ca3af;
}

.account-selection-page__item-balance {
    flex-shrink: 0;
    text-align: right;
    margin-right: 0.25rem;
}

.account-selection-page__item-balance-value {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.25;
    color: #111827;
}

.dark .account-selection-page__item-balance-value {
    color: #f9fafb;
}

.account-selection-page__item-balance-label {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.625rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.dark .account-selection-page__item-balance-label {
    color: #9ca3af;
}

.account-selection-page__item-body {
    padding: 0 1.125rem 1.125rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    border-top: 1px solid #f3f4f6;
}

.dark .account-selection-page__item-body {
    border-top-color: #374151;
}

.account-selection-page__chevron {
    flex-shrink: 0;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.account-selection-page__chevron--expanded {
    transform: rotate(180deg);
}

/* ── Select button ── */

.account-selection-page__select-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.5rem;
    background: #4f46e5;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.account-selection-page__select-btn:hover:not(:disabled) {
    background: #4338ca;
}

.account-selection-page__select-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ── Stats preview (collapsed All accounts) ── */

.account-selection-stats-preview {
    margin-top: 0.625rem;
    padding-top: 0.625rem;
    border-top: 1px dashed #e5e7eb;
}

.dark .account-selection-stats-preview {
    border-top-color: #374151;
}

.account-selection-stats-preview__balance {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.account-selection-stats-preview__balance-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dark .account-selection-stats-preview__balance-label {
    color: #9ca3af;
}

.account-selection-stats-preview__balance-value {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
}

.dark .account-selection-stats-preview__balance-value {
    color: #f9fafb;
}

.account-selection-stats-preview__meta {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.dark .account-selection-stats-preview__meta {
    color: #9ca3af;
}

.account-selection-stats-preview__dot {
    margin: 0 0.25rem;
}

/* ── Segment tabs ── */

.account-selection-segment-tabs__list {
    display: flex;
    gap: 0.375rem;
    padding: 0.875rem 0 0.625rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.account-selection-segment-tabs__list::-webkit-scrollbar {
    display: none;
}

.account-selection-segment-tabs__tab {
    flex-shrink: 0;
    min-height: 2.125rem;
    padding: 0.375rem 0.875rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background: #f9fafb;
    color: #6b7280;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.account-selection-segment-tabs__tab:hover {
    border-color: #c7d2fe;
    color: #4f46e5;
}

.account-selection-segment-tabs__tab--active {
    border-color: #4f46e5;
    background: #eef2ff;
    color: #4f46e5;
}

.dark .account-selection-segment-tabs__tab {
    background: #111827;
    border-color: #374151;
    color: #9ca3af;
}

.dark .account-selection-segment-tabs__tab:hover {
    border-color: #6366f1;
    color: #a5b4fc;
}

.dark .account-selection-segment-tabs__tab--active {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.account-selection-segment-tabs__panel {
    padding-bottom: 0.125rem;
}

/* ── Stats block ── */

.account-selection-stats-block {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.account-selection-stats-block__hero {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    border: 1px solid #c7d2fe;
}

.dark .account-selection-stats-block__hero {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: #4338ca;
}

.account-selection-stats-block__hero-label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dark .account-selection-stats-block__hero-label {
    color: #9ca3af;
}

.account-selection-stats-block__hero-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.15;
    color: #111827;
}

.dark .account-selection-stats-block__hero-value {
    color: #f9fafb;
}

.account-selection-stats-block__section-label {
    margin-bottom: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dark .account-selection-stats-block__section-label {
    color: #9ca3af;
}

.account-selection-stats-block__tiles {
    display: grid;
    gap: 0.5rem;
}

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

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

.account-selection-stats-block__tile {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.account-selection-stats-block__tile--muted {
    background: #ffffff;
}

.dark .account-selection-stats-block__tile {
    background: #374151;
    border-color: #4b5563;
}

.dark .account-selection-stats-block__tile--muted {
    background: #1f2937;
}

.account-selection-stats-block__tile-label {
    font-size: 0.6875rem;
    line-height: 1.3;
    color: #6b7280;
}

.dark .account-selection-stats-block__tile-label {
    color: #9ca3af;
}

.account-selection-stats-block__tile-value {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.25;
    word-break: break-word;
    color: #111827;
}

.dark .account-selection-stats-block__tile-value {
    color: #f9fafb;
}

.account-selection-stats-block--segment .account-selection-stats-block__tile-value {
    font-size: 0.8125rem;
}

.account-selection-stats-block__value--masked {
    letter-spacing: 0.08em;
    color: #9ca3af !important;
}

.dark .account-selection-stats-block__value--masked {
    color: #6b7280 !important;
}

/* ── Footer ── */

.account-selection-page__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.account-selection-page__footer-text {
    color: inherit;
}

.dark .account-selection-page__footer {
    color: #9ca3af;
}

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

.account-selection-page__logout-link {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-size: inherit;
}

.account-selection-page__logout-link:hover {
    text-decoration: underline;
}

.dark .account-selection-page__logout-link {
    color: #a5b4fc;
}

/* ── Responsive ── */

@media (max-width: 640px) {
    .account-selection-page {
        max-width: 100%;
    }

    .account-selection-page__item-header {
        flex-wrap: wrap;
    }

    .account-selection-page__item-balance {
        order: 3;
        width: 100%;
        text-align: left;
        margin-top: 0.25rem;
        margin-right: 0;
        padding-left: calc(3rem + 0.875rem);
    }

    .account-selection-stats-block__tiles--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .account-selection-stats-block__tiles--3 .account-selection-stats-block__tile:last-child {
        grid-column: 1 / -1;
    }
}
