:root {
    --blue: #063b7a;
    --blue-dark: #042a59;
    --green: #16c784;
    --white: #ffffff;
    --ink: #102033;
    --muted: #6d7b8f;
    --line: #dce6f2;
    --bg: #f4f8fc;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-solid: #ffffff;
    --shadow: 0 18px 42px rgba(6, 59, 122, 0.08);
    --glass: rgba(255, 255, 255, 0.72);
    --danger: #d94444;
    --warning: #c98300;
    --success: #0f9f6e;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
}

:root[data-theme="dark"] {
    --blue: #66a6ff;
    --blue-dark: #06162e;
    --green: #22d98f;
    --white: #0d1726;
    --ink: #edf6ff;
    --muted: #9fb0c7;
    --line: rgba(255, 255, 255, 0.12);
    --bg: #07111f;
    --surface: rgba(13, 23, 38, 0.82);
    --surface-solid: #0d1726;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
    --glass: rgba(13, 23, 38, 0.66);
}

select {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    font: inherit;
}

select:focus {
    outline: 3px solid rgba(22, 199, 132, 0.22);
    border-color: var(--green);
}

.btn-ghost.danger,
.danger {
    color: var(--danger);
}

.flow-panel {
    max-width: 980px;
    margin: 16px auto 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.action-card p {
    margin: 0;
}

.flow-steps {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    padding: 0;
    margin: 0 0 20px;
    list-style: none;
    counter-reset: flow;
}

.flow-steps li {
    counter-increment: flow;
    padding: 10px;
    border-radius: 8px;
    background: rgba(6, 59, 122, 0.06);
    color: var(--blue);
    font-size: 0.85rem;
    font-weight: 800;
}

.flow-steps li::before {
    content: counter(flow) ". ";
}

.split-form {
    grid-template-columns: 1fr 1fr;
    align-items: end;
}

.split-form .btn-wide,
.split-form .verified-box,
.split-form .review-box,
.split-form .check-row {
    grid-column: 1 / -1;
}

.verified-box,
.review-box {
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fbfdff;
    font-weight: 800;
}

.verified-box.success,
.review-box {
    border-color: rgba(15, 159, 110, 0.35);
    color: var(--success);
}

.verified-box.error {
    border-color: rgba(217, 68, 68, 0.28);
    color: var(--danger);
}

.review-box {
    display: grid;
    gap: 6px;
    color: var(--ink);
}

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

.beneficiary-card {
    min-height: 120px;
    display: grid;
    gap: 6px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.beneficiary-card span,
.beneficiary-card small {
    color: var(--muted);
}

.row-actions,
.admin-action-block,
.admin-action-block form,
.filter-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.filter-form {
    justify-content: stretch;
    margin-bottom: 18px;
}

.transaction-filter-form {
    align-items: end;
}

.transaction-filter-form select,
.transaction-filter-form input,
.transaction-filter-form .btn {
    min-width: 150px;
}

.filter-form input {
    flex: 2;
}

.filter-form select {
    flex: 1;
}

.admin-action-block form input {
    min-width: 180px;
}

.transaction-item.unread {
    border-color: rgba(22, 199, 132, 0.4);
    background: rgba(22, 199, 132, 0.05);
}

.mobile-footer-menu {
    position: fixed;
    left: 50%;
    bottom: 14px;
    z-index: 11;
    width: min(calc(100% - 24px), 560px);
    min-height: 68px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--glass);
    box-shadow: 0 20px 56px rgba(6, 59, 122, 0.2);
    backdrop-filter: blur(22px);
    transform: translateX(-50%);
}

.mobile-footer-menu a {
    display: grid;
    place-items: center;
    gap: 3px;
    padding: 7px 4px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.74rem;
    transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.mobile-footer-menu a.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--green), #0c65c9);
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(22, 199, 132, 0.24);
}

.tab-icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(6, 59, 122, 0.08);
    font-size: 0.72rem;
    font-weight: 900;
}

.tab-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mobile-footer-menu a.active .tab-icon {
    background: rgba(255, 255, 255, 0.2);
}

.theme-toggle {
    position: fixed;
    right: 18px;
    bottom: 94px;
    z-index: 11;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--glass);
    color: var(--ink);
    font: inherit;
    font-weight: 900;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    cursor: pointer;
}

.skeleton-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
}

.skeleton-card span,
.skeleton-card strong,
.skeleton-card small {
    display: block;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(109, 123, 143, 0.12), rgba(109, 123, 143, 0.26), rgba(109, 123, 143, 0.12));
    background-size: 220% 100%;
    animation: skeletonPulse 1s ease-in-out infinite;
}

.skeleton-card strong {
    width: 70%;
    height: 18px;
}

.skeleton-card small {
    width: 45%;
}

@keyframes skeletonPulse {
    to {
        background-position: -220% 0;
    }
}

.pwa-actions,
.notification-filters {
    max-width: 980px;
    margin: 16px auto 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.notification-filters {
    margin: 0 0 16px;
}

.notification-filters .active {
    background: var(--blue);
    color: var(--white);
}

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

.notification-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    backdrop-filter: blur(16px);
}

.notification-item.unread {
    border-color: rgba(22, 199, 132, 0.4);
    background: rgba(22, 199, 132, 0.05);
}

.notification-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(6, 59, 122, 0.08);
    color: var(--blue);
    font-weight: 900;
}

.notification-actions {
    display: flex;
    justify-content: flex-end;
}

.install-toast {
    position: fixed;
    right: 18px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    z-index: 12;
    width: min(calc(100% - 36px), 420px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(22, 199, 132, 0.28);
    border-radius: 8px;
    background: var(--glass);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    transition: opacity 220ms ease, transform 220ms ease;
}

.install-toast[hidden] {
    display: none;
}

.install-toast.is-hiding {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
}

.install-toast strong,
.install-toast span {
    display: block;
}

.install-toast span {
    color: var(--muted);
    font-size: 0.9rem;
}

.install-toast-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.install-dismiss {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(6, 59, 122, 0.06);
    color: var(--ink);
    cursor: pointer;
}

.install-dismiss svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
}

.badge-approved {
    background: rgba(15, 159, 110, 0.12);
    color: var(--success);
}

.badge-rejected {
    background: rgba(217, 68, 68, 0.1);
    color: var(--danger);
}

.mobile-home {
    max-width: 980px;
    margin: 0 auto;
}

.home-header {
    max-width: 980px;
    margin: 0 auto 22px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
}

.home-header h1 {
    margin: 0;
    font-size: 1.55rem;
    letter-spacing: 0;
    text-transform: uppercase;
}

.home-avatar {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background:
        radial-gradient(circle at 72% 78%, rgba(6, 59, 122, 0.16), transparent 18px),
        linear-gradient(135deg, rgba(22, 199, 132, 0.18), rgba(255, 255, 255, 0.82));
    box-shadow: var(--shadow);
}

.home-avatar span {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--green);
    color: #ffffff;
    font-weight: 900;
}

.home-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-icon-link {
    position: relative;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--ink);
}

.notification-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff5b78;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 900;
}

.icon-bell {
    width: 20px;
    height: 22px;
    border: 2px solid currentColor;
    border-radius: 12px 12px 8px 8px;
    position: relative;
}

.icon-bell::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 2px solid currentColor;
    background: var(--surface-solid);
}

.icon-bell::after {
    content: "";
    position: absolute;
    left: 6px;
    bottom: -7px;
    width: 7px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
}

.premium-balance-card {
    display: grid;
    gap: 18px;
    padding: 24px;
    border-radius: 26px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.26), transparent 18rem),
        linear-gradient(135deg, #08b978, #06a86f);
    color: #ffffff;
    box-shadow: 0 22px 60px rgba(6, 168, 111, 0.26);
}

.balance-card-top,
.balance-card-main,
.balance-topup-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.balance-card-top span {
    color: rgba(255, 255, 255, 0.82);
    font-weight: 800;
}

.balance-eye {
    min-height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.balance-card-main strong {
    font-size: clamp(2rem, 8vw, 3rem);
    letter-spacing: 0;
}

.balance-card-main a {
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.balance-topup-form {
    justify-content: flex-end;
}

.balance-topup-form input {
    max-width: 170px;
    min-height: 48px;
    border: 0;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.balance-topup-form input::placeholder {
    color: rgba(255, 255, 255, 0.78);
}

.balance-topup-form .btn {
    min-width: 150px;
    border-radius: 999px;
    background: #ffffff;
    color: #08a66d;
}

.home-card {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.recent-card {
    display: grid;
    gap: 16px;
}

.recent-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    color: var(--ink);
}

.recent-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    font-size: 1.4rem;
    font-weight: 900;
}

.recent-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.recent-icon.credit {
    background: rgba(22, 199, 132, 0.14);
    color: var(--success);
}

.recent-icon.debit {
    background: rgba(217, 68, 68, 0.12);
    color: var(--danger);
}

.recent-row strong,
.recent-row span {
    display: block;
}

.recent-row span,
.recent-amount span {
    color: var(--muted);
}

.recent-amount {
    text-align: right;
}

.recent-amount.credit strong {
    color: var(--success);
}

.recent-amount.debit strong {
    color: var(--danger);
}

.action-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
}

.action-strip a,
.service-grid a {
    display: grid;
    place-items: center;
    gap: 10px;
    color: var(--ink);
}

.action-strip span,
.service-grid span {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: rgba(22, 199, 132, 0.14);
    color: var(--green);
    font-weight: 900;
}

.profile-notice {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
}

.profile-notice strong,
.profile-notice span {
    display: block;
}

.profile-notice span {
    color: var(--muted);
}

.notice-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: rgba(255, 185, 70, 0.18);
    color: var(--warning);
    font-weight: 900;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px 12px;
    text-align: center;
}

.savings-challenge {
    margin-top: 16px;
    min-height: 170px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border-radius: 24px;
    background:
        radial-gradient(circle at right, rgba(22, 199, 132, 0.24), transparent 18rem),
        linear-gradient(135deg, rgba(22, 199, 132, 0.14), rgba(255, 255, 255, 0.62));
    box-shadow: var(--shadow);
}

.savings-challenge h2,
.savings-challenge p {
    margin: 0;
}

.savings-challenge p {
    color: var(--muted);
    margin-top: 8px;
}

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

.badge-active,
.badge-matured {
    background: rgba(15, 159, 110, 0.12);
    color: var(--success);
}

.badge-inactive,
.badge-withdrawn {
    background: rgba(6, 59, 122, 0.08);
    color: var(--blue);
}

.badge-low {
    background: rgba(15, 159, 110, 0.12);
    color: var(--success);
}

.badge-medium {
    background: rgba(201, 131, 0, 0.12);
    color: var(--warning);
}

.badge-high {
    background: rgba(217, 68, 68, 0.1);
    color: var(--danger);
}

.gain {
    color: var(--success);
}

.loss {
    color: var(--danger);
}

.stock-card {
    min-height: 280px;
}

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

.module-grid {
    max-width: 980px;
    margin: 16px auto 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.module-card {
    display: grid;
    gap: 8px;
    min-height: 112px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.module-card span {
    color: var(--muted);
}

.admin-columns {
    max-width: 980px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.plan-grid {
    max-width: 980px;
    margin: 16px auto 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.plan-card {
    min-height: 330px;
    display: grid;
    align-content: space-between;
    gap: 18px;
    padding: 22px;
    border: 1px solid rgba(22, 199, 132, 0.24);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(22, 199, 132, 0.08), rgba(255, 255, 255, 0)),
        var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    content-visibility: auto;
    contain-intrinsic-size: 340px;
}

.plan-card h2 {
    margin: 14px 0 8px;
}

.plan-card p {
    color: var(--muted);
    line-height: 1.6;
}

.plan-meta {
    display: grid;
    gap: 8px;
    color: var(--blue);
    font-weight: 800;
}

.countdown {
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(6, 59, 122, 0.08);
    color: var(--blue);
    font-weight: 900;
    font-size: 0.85rem;
}

.market-section {
    max-width: 980px;
    margin: 16px auto 0;
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.market-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    content-visibility: auto;
    contain-intrinsic-size: 360px;
}

.market-image {
    position: relative;
    aspect-ratio: 4 / 3;
    background: rgba(6, 59, 122, 0.08);
}

.market-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.market-placeholder {
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--blue);
    font-weight: 900;
}

.market-featured {
    position: absolute;
    top: 10px;
    left: 10px;
}

.market-body {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.market-body h2,
.market-body p {
    margin: 0;
}

.market-body p {
    color: var(--muted);
    line-height: 1.5;
}

.market-social {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.market-comment-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.service-card h2 a {
    color: inherit;
    text-decoration: none;
}

.service-heart {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(220, 38, 38, 0.18);
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: rgba(220, 38, 38, 0.08);
    color: #9f1239;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.service-heart b {
    font-size: 0.78rem;
    margin-left: 2px;
}

.service-heart.is-liked,
.service-heart:hover {
    background: #e11d48;
    color: #fff;
    transform: translateY(-1px);
}

.service-like-count {
    color: var(--muted);
    font-weight: 800;
}

.service-detail {
    max-width: 980px;
    margin: 16px auto 0;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
    gap: 18px;
}

.service-gallery,
.service-detail-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.service-gallery {
    overflow: hidden;
    display: grid;
    gap: 8px;
    padding: 8px;
}

.service-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
}

.service-detail-card {
    padding: 20px;
    display: grid;
    gap: 14px;
    align-content: start;
}

.service-detail-card h1,
.service-detail-card p {
    margin: 0;
}

.service-detail-card p {
    color: var(--muted);
    line-height: 1.65;
}

.service-social-bar {
    justify-content: flex-start;
}

.service-comment-form {
    margin-bottom: 14px;
}

@media (max-width: 760px) {
    .service-detail {
        grid-template-columns: 1fr;
    }
}

.dashboard-page:has(.admin-stat-grid) {
    max-width: none;
}

.admin-stat-grid .info-card {
    min-height: 108px;
}

.admin-columns {
    align-items: start;
}

body:has(.admin-stat-grid) .module-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

body:has(.admin-stat-grid) .module-card {
    border-left: 4px solid var(--blue);
}

.badge-rejected {
    background: rgba(217, 68, 68, 0.1);
    color: var(--danger);
}

@media (max-width: 720px) {
    .quick-beneficiaries,
    .plan-grid,
    .market-grid,
    .module-grid,
    .admin-stat-grid,
    .admin-columns,
    .flow-steps,
    .split-form {
        grid-template-columns: 1fr;
    }

    .row-actions,
    .admin-action-block,
    .admin-action-block form,
    .filter-form,
    .pwa-actions,
    .notification-filters {
        align-items: stretch;
        flex-direction: column;
        justify-content: flex-start;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--bg);
    transition: background 180ms ease, color 180ms ease;
}

.page-shell {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.page-ready body {
    animation: pageIn 220ms ease both;
}

.page-leaving body {
    opacity: 0.82;
    transition: opacity 140ms ease;
}

@keyframes pageIn {
    from {
        opacity: 0.92;
    }

    to {
        opacity: 1;
    }
}

a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 700;
}

.preloader {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    background: var(--blue-dark);
    transition: opacity 240ms ease, visibility 240ms ease;
}

.preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-ring {
    width: 64px;
    height: 64px;
    border: 5px solid rgba(255, 255, 255, 0.22);
    border-top-color: var(--green);
    border-radius: 999px;
    animation: spin 780ms linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.splash-page,
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(22, 199, 132, 0.24), transparent 28rem),
        linear-gradient(135deg, var(--blue-dark), var(--blue));
}

.splash-card,
.auth-panel {
    width: min(100%, 460px);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 34px;
    box-shadow: 0 24px 70px rgba(0, 23, 61, 0.24);
}

.splash-card {
    text-align: center;
}

.brand-mark {
    width: 72px;
    height: 72px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--green);
    color: var(--white);
    font-size: 2rem;
    font-weight: 900;
    box-shadow: 0 12px 32px rgba(22, 199, 132, 0.34);
}

.brand-mark.small {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 1.05rem;
    margin-bottom: 22px;
}

.eyebrow {
    margin: 22px 0 8px;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(1.65rem, 4vw, 2.55rem);
    line-height: 1.05;
}

.auth-panel h1 {
    font-size: 1.75rem;
}

.lead,
.muted,
.switch-text {
    color: var(--muted);
    line-height: 1.6;
}

.splash-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 28px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.btn-primary {
    background: var(--green);
    color: var(--white);
}

.btn-ghost {
    background: rgba(6, 59, 122, 0.08);
    color: var(--blue);
}

.btn-wide {
    width: 100%;
}

.btn.is-loading,
.btn:disabled {
    opacity: 0.72;
    cursor: wait;
}

.btn.is-loading::after {
    content: "";
    width: 14px;
    height: 14px;
    margin-left: 8px;
    display: inline-block;
    vertical-align: -2px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.form {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.form label {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-weight: 800;
}

.form small {
    color: var(--muted);
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    font: inherit;
}

input:focus {
    outline: 3px solid rgba(22, 199, 132, 0.22);
    border-color: var(--green);
}

.password-field {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    overflow: hidden;
}

.password-field:focus-within {
    outline: 3px solid rgba(22, 199, 132, 0.22);
    border-color: var(--green);
}

.password-field input {
    border: 0;
    border-radius: 0;
}

.password-field input:focus {
    outline: 0;
}

.password-field button {
    min-height: 48px;
    padding: 0 14px;
    border: 0;
    background: rgba(6, 59, 122, 0.08);
    color: var(--blue);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.check-row {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
}

.check-row input {
    width: 18px;
    min-height: 18px;
}

.alert {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 700;
}

.alert-error {
    background: rgba(217, 68, 68, 0.1);
    color: var(--danger);
}

.alert-success {
    background: rgba(15, 159, 110, 0.12);
    color: var(--success);
}

.alert-warning {
    background: rgba(201, 131, 0, 0.12);
    color: var(--warning);
}

.toast-container {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    left: 50%;
    z-index: 3000;
    width: min(calc(100% - 28px), 480px);
    display: grid;
    gap: 10px;
    transform: translateX(-50%);
    pointer-events: none;
}

.toast {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-solid);
    color: var(--ink);
    box-shadow: 0 18px 46px rgba(6, 59, 122, 0.18);
    font-weight: 800;
    animation: toastIn 260ms ease both;
    pointer-events: auto;
}

.toast-success {
    border-color: rgba(15, 159, 110, 0.25);
    color: var(--success);
}

.toast-error {
    border-color: rgba(217, 68, 68, 0.25);
    color: var(--danger);
}

.toast-warning {
    border-color: rgba(201, 131, 0, 0.25);
    color: var(--warning);
}

.toast.is-leaving {
    animation: toastOut 240ms ease both;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-14px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
}

.message-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(3, 12, 24, 0.48);
    backdrop-filter: blur(10px);
    animation: fadeIn 180ms ease both;
}

.message-modal-backdrop.is-leaving {
    animation: fadeOut 180ms ease both;
}

.message-modal {
    width: min(100%, 440px);
    display: grid;
    gap: 14px;
    padding: 24px;
    border-radius: 22px;
    background: var(--surface-solid);
    color: var(--ink);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
    animation: modalIn 220ms ease both;
}

.message-modal-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--blue);
    color: #ffffff;
    font-weight: 900;
}

.message-modal h2,
.message-modal p {
    margin: 0;
}

.message-modal p {
    color: var(--muted);
    line-height: 1.6;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; }
}

.dashboard-page {
    min-height: 100vh;
    padding: 24px 24px 104px;
    background:
        radial-gradient(circle at top left, rgba(22, 199, 132, 0.13), transparent 22rem),
        var(--bg);
}

.topbar {
    max-width: 980px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 950;
    padding: 10px 0;
    background:
        linear-gradient(90deg, rgba(244, 248, 252, 0.96), rgba(244, 248, 252, 0.82));
    backdrop-filter: blur(16px);
}

:root[data-theme="dark"] .topbar {
    background:
        linear-gradient(90deg, rgba(7, 17, 31, 0.96), rgba(7, 17, 31, 0.82));
}

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

.header-back-btn {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--blue);
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(6, 59, 122, 0.08);
}

.header-back-btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-hero,
.account-grid,
.wallet-balance-card,
.quick-actions,
.transaction-panel {
    max-width: 980px;
    margin: 0 auto;
}

.dashboard-hero {
    padding: 36px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(6, 59, 122, 0.95), rgba(4, 42, 89, 0.95)),
        var(--blue-dark);
    color: var(--white);
    box-shadow: var(--shadow);
}

:root[data-theme="dark"] .dashboard-hero {
    color: var(--ink);
}

.dashboard-hero .lead {
    color: rgba(255, 255, 255, 0.78);
}

.dashboard-hero.compact h1 {
    font-size: 1.75rem;
}

.wallet-balance-card {
    margin-top: 16px;
    padding: 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.wallet-balance-card span,
.action-card strong {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.wallet-balance-card strong {
    font-size: 2rem;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.action-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

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

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

.info-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.info-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.info-card strong {
    font-size: 1.25rem;
}

.info-card.highlight {
    border-color: rgba(22, 199, 132, 0.42);
    box-shadow: 0 14px 36px rgba(22, 199, 132, 0.12);
}

.transaction-panel {
    margin-top: 16px;
    padding: 22px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--white);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-head h2 {
    margin: 0;
}

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

.transaction-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    backdrop-filter: blur(16px);
    color: var(--ink);
}

.transaction-item form[data-savings-close-form],
.transaction-item form[data-savings-move-form] {
    justify-self: end;
}

.form label.checkbox-line,
.checkbox-line {
    display: flex;
    grid-template-columns: none;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(6, 59, 122, 0.05);
    font-weight: 800;
}

.checkbox-line input {
    width: 18px;
    min-height: 18px;
    height: 18px;
    padding: 0;
    accent-color: var(--blue);
}

.purchase-goods-option {
    grid-column: 1 / -1;
    width: fit-content;
    min-height: 42px;
    padding: 9px 12px;
    background: transparent;
    font-size: 0.94rem;
}

.purchase-goods-option input {
    flex: 0 0 auto;
}

.purchase-rule-box[hidden] {
    display: none;
}

.clickable-row {
    transition: transform 160ms ease, border-color 160ms ease;
}

.clickable-row:active {
    transform: scale(0.99);
}

.receipt-card {
    max-width: 640px;
    margin: 16px auto 0;
    display: grid;
    gap: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.receipt-status {
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 28px 18px;
    border-radius: 22px;
    background: rgba(6, 59, 122, 0.08);
    text-align: center;
}

.receipt-status span {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--blue);
    color: #ffffff;
    font-size: 2rem;
    font-weight: 900;
}

.receipt-status.credit span,
.receipt-status.successful span {
    background: var(--success);
}

.receipt-status.debit {
    background: rgba(217, 68, 68, 0.08);
}

.receipt-status.debit span {
    background: var(--danger);
}

.receipt-status.debit strong {
    color: var(--danger);
}

.receipt-status strong {
    font-size: clamp(1.8rem, 7vw, 2.6rem);
    overflow-wrap: anywhere;
}

.receipt-status small {
    color: var(--muted);
    font-weight: 800;
}

.receipt-details {
    display: grid;
    gap: 12px;
}

.receipt-details div {
    display: grid;
    gap: 4px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(6, 59, 122, 0.05);
}

.receipt-details span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.receipt-details strong {
    overflow-wrap: anywhere;
}

.transaction-main {
    display: grid;
    gap: 4px;
}

.transaction-meta,
.empty-state {
    color: var(--muted);
    font-size: 0.92rem;
}

.transaction-amount {
    text-align: right;
    font-weight: 900;
}

.badge {
    display: inline-flex;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 900;
}

.badge-credit,
.badge-successful {
    background: rgba(15, 159, 110, 0.12);
    color: var(--success);
}

.badge-debit,
.badge-failed {
    background: rgba(217, 68, 68, 0.1);
    color: var(--danger);
}

.badge-pending {
    background: rgba(201, 131, 0, 0.12);
    color: var(--warning);
}

@media (max-width: 720px) {
    .dashboard-page {
        padding: 16px 14px 104px;
    }

    .mobile-home {
        padding-top: 22px;
    }

    .home-header {
        margin-bottom: 20px;
    }

    .premium-balance-card {
        padding: 20px;
        border-radius: 24px;
    }

    .balance-card-main,
    .balance-topup-form {
        align-items: flex-start;
        flex-direction: column;
    }

    .balance-topup-form input,
    .balance-topup-form .btn {
        width: 100%;
        max-width: none;
    }

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

    .recent-amount {
        grid-column: 2;
        text-align: left;
    }

    .profile-notice,
    .savings-challenge {
        grid-template-columns: 1fr;
    }

    .service-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px 8px;
        padding: 16px 10px;
    }

    .service-grid span,
    .action-strip span {
        width: 58px;
        height: 58px;
    }

    .service-grid strong,
    .action-strip strong {
        font-size: 0.9rem;
    }

    .compact-stats {
        grid-template-columns: 1fr;
    }

    .account-grid.profile-grid,
    .account-grid.dashboard-cards {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(220px, 78%);
        grid-template-columns: none;
        gap: 12px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: inline mandatory;
        padding-bottom: 8px;
        scrollbar-width: none;
    }

    .account-grid.profile-grid::-webkit-scrollbar,
    .account-grid.dashboard-cards::-webkit-scrollbar {
        display: none;
    }

    .account-grid.profile-grid .info-card,
    .account-grid.dashboard-cards .info-card {
        scroll-snap-align: start;
        min-height: 128px;
    }

    .dashboard-hero {
        padding: 24px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .splash-card,
    .auth-panel {
        padding: 24px;
    }

    .splash-actions,
    .account-grid,
    .quick-actions,
    .dashboard-cards,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .topbar,
    .wallet-balance-card,
    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .transaction-item {
        grid-template-columns: 1fr;
    }

    .transaction-item form[data-savings-close-form],
    .transaction-item form[data-savings-move-form] {
        justify-self: stretch;
    }

    .transaction-item form[data-savings-close-form] .btn,
    .transaction-item form[data-savings-move-form] .btn {
        width: 100%;
    }

    .notification-item,
    .install-toast {
        grid-template-columns: 1fr;
        align-items: flex-start;
        flex-direction: column;
        right: 12px;
        bottom: calc(96px + env(safe-area-inset-bottom));
        width: min(calc(100% - 24px), 420px);
    }

    .transaction-amount {
        text-align: left;
    }
}

@media (min-width: 721px) {
    .mobile-footer-menu {
        bottom: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Professional blue wallet dashboard overrides */
.mobile-home {
    width: min(100%, 760px);
}

.premium-balance-card {
    gap: 14px;
    padding: 20px;
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.2), transparent 15rem),
        linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: #ffffff;
    box-shadow: 0 18px 44px rgba(6, 59, 122, 0.2);
}

.compact-wallet-card {
    min-height: auto;
}

.balance-card-top span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.95rem;
}

.balance-card-top svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.balance-eye {
    width: 42px;
    height: 36px;
    min-height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.eye-icon {
    position: relative;
    width: 23px;
    height: 15px;
    display: block;
    border: 2px solid #ffffff;
    border-radius: 999px / 70%;
}

.eye-icon::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    transform: translate(-50%, -50%);
}

.eye-icon::after {
    content: "";
    position: absolute;
    left: -4px;
    top: 6px;
    width: 31px;
    height: 2px;
    border-radius: 999px;
    background: #ffffff;
    transform: rotate(-35deg);
    opacity: 1;
}

.balance-eye.is-visible .eye-icon::after {
    opacity: 0;
}

.balance-card-main {
    align-items: flex-end;
}

.balance-card-main strong {
    font-size: clamp(1.9rem, 7vw, 2.55rem);
    line-height: 1;
}

.balance-card-main a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.92rem;
}

.balance-card-main a::after {
    content: none;
}

.chevron-icon {
    width: 9px;
    height: 9px;
    display: inline-block;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
}

.inline-arrow-icon {
    width: 24px;
    height: 12px;
    display: inline-block;
    position: relative;
    margin: 0 6px;
    vertical-align: -1px;
}

.inline-arrow-icon::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.inline-arrow-icon::after {
    content: "";
    position: absolute;
    right: 0;
    top: 2px;
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
}

.balance-add-money {
    width: fit-content;
    justify-self: end;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 26px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--blue-dark);
    font-weight: 900;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.home-card {
    border-color: rgba(6, 59, 122, 0.08);
    border-radius: 20px;
}

.action-strip span,
.service-grid span,
.notice-icon {
    color: var(--blue);
    background: rgba(6, 59, 122, 0.08);
}

.action-strip svg,
.service-grid svg,
.notice-icon svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.service-grid svg {
    width: 30px;
    height: 30px;
}

.recent-icon.credit {
    background: rgba(6, 59, 122, 0.08);
    color: var(--blue);
}

.savings-challenge {
    background:
        radial-gradient(circle at right, rgba(6, 59, 122, 0.12), transparent 18rem),
        linear-gradient(135deg, rgba(6, 59, 122, 0.08), rgba(255, 255, 255, 0.7));
}

.mobile-footer-menu {
    position: fixed !important;
    left: 50%;
    right: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 999;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.94);
    will-change: auto;
}

:root[data-theme="dark"] .mobile-footer-menu {
    background: rgba(13, 23, 38, 0.94);
}

.mobile-footer-menu a.active {
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    box-shadow: 0 12px 28px rgba(6, 59, 122, 0.26);
}

.theme-toggle {
    bottom: 92px;
}

@media (max-width: 720px) {
    .premium-balance-card {
        padding: 18px;
    }

    .balance-card-main {
        flex-direction: row;
        align-items: flex-end;
    }

    .balance-card-main a {
        text-align: right;
    }

    .balance-add-money {
        justify-self: end;
        min-height: 42px;
        padding: 0 22px;
    }
}

/* Overflow protection for long balances and large transaction amounts */
.premium-balance-card,
.home-card,
.recent-row,
.balance-card-main {
    max-width: 100%;
    min-width: 0;
}

.balance-card-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.balance-card-main strong {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.balance-card-main a {
    min-width: 0;
    white-space: nowrap;
}

.recent-row {
    grid-template-columns: auto minmax(0, 1fr) minmax(0, auto);
    min-width: 0;
}

.recent-row > div,
.recent-row strong,
.recent-row span,
.recent-amount {
    min-width: 0;
    max-width: 100%;
}

.recent-row strong,
.recent-row span,
.recent-amount strong {
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 720px) {
    .balance-card-main {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .balance-card-main a {
        justify-self: start;
        white-space: normal;
        text-align: left;
    }
}

@media (max-width: 420px) {
    .balance-card-main strong {
        font-size: clamp(1.35rem, 9vw, 2rem);
    }

    .recent-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .recent-amount {
        grid-column: 2;
        text-align: left;
    }
}

/* Mature reference-style transaction rows */
.recent-card {
    padding: 18px 20px;
}

.recent-row {
    grid-template-columns: 58px minmax(0, 1fr) minmax(112px, auto);
    gap: 16px;
    align-items: center;
    padding: 8px 0;
    color: var(--ink);
}

.recent-row + .recent-row {
    border-top: 1px solid rgba(6, 59, 122, 0.06);
    padding-top: 18px;
}

.recent-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    align-self: center;
}

.recent-icon svg {
    width: 25px;
    height: 25px;
    stroke-width: 3.2;
}

.recent-icon.credit {
    background: rgba(6, 59, 122, 0.08);
    color: var(--blue);
}

.recent-icon.debit {
    background: rgba(217, 68, 68, 0.1);
    color: var(--danger);
}

.recent-row strong {
    font-size: 1rem;
    line-height: 1.25;
}

.recent-row > div:not(.recent-amount) span {
    margin-top: 6px;
    font-size: 0.9rem;
}

.recent-amount {
    text-align: right;
}

.recent-amount strong {
    font-size: 1rem;
    line-height: 1.25;
}

.recent-amount span {
    width: fit-content;
    margin-top: 6px;
    margin-left: auto;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(15, 159, 110, 0.12);
    color: var(--success);
    font-size: 0.82rem;
    font-weight: 800;
}

@media (max-width: 520px) {
    .recent-card {
        padding: 16px;
    }

    .recent-row {
        grid-template-columns: 52px minmax(0, 1fr) minmax(94px, auto);
        gap: 12px;
    }

    .recent-icon {
        width: 48px;
        height: 48px;
    }

    .recent-icon svg {
        width: 23px;
        height: 23px;
    }

    .recent-row strong,
    .recent-amount strong {
        font-size: 0.94rem;
    }

    .recent-row > div:not(.recent-amount) span,
    .recent-amount span {
        font-size: 0.82rem;
    }
}

@media (max-width: 360px) {
    .recent-row {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .recent-amount {
        grid-column: 2;
        text-align: left;
    }

    .recent-amount span {
        margin-left: 0;
    }
}

/* Final mobile polish: fixed header, smaller type, aligned transactions */
:root {
    font-size: 14px;
}

.mobile-home {
    padding-top: 8px;
}

.home-header {
    position: sticky;
    top: 0;
    z-index: 950;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 8px 0;
    margin-bottom: 12px;
    background:
        linear-gradient(90deg, rgba(244, 248, 252, 0.96), rgba(244, 248, 252, 0.8));
    backdrop-filter: blur(16px);
}

.clean-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    min-width: 0;
    flex: 1 1 auto;
}

.clean-brand strong {
    font-size: 1.02rem;
    white-space: nowrap;
}

.topbar {
    min-height: 58px;
    padding: 8px 0;
    margin-bottom: 14px;
    justify-content: flex-start;
    flex-direction: row;
    flex-wrap: nowrap;
}

.topbar .brand-link {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.topbar .brand-link .brand-mark,
.clean-brand .brand-mark {
    flex: 0 0 auto;
}

.topbar .brand-link span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar.has-back {
    justify-content: space-between;
}

.topbar.has-back .brand-link {
    display: none !important;
}

.topbar.has-back .nav-actions {
    flex: 0 0 auto;
    margin-left: 0;
}

.home-header .home-header-actions,
.topbar .nav-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
    margin-left: auto;
}

.user-shell .topbar .nav-actions .btn,
.user-shell .topbar .nav-actions a:not(.header-icon-link),
.home-header-actions .home-icon-link {
    display: none !important;
}

.header-icon-link,
.header-back-btn,
.theme-toggle.in-header {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    flex: 0 0 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(6, 59, 122, 0.08);
    color: var(--ink);
    box-shadow: none;
}

@media (max-width: 520px) {
    .dashboard-page {
        padding: 8px 14px 104px;
    }

    .home-header,
    .topbar {
        width: 100%;
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        min-height: 54px;
        padding: 7px 0;
    }

    .brand-link,
    .clean-brand {
        flex: 1 1 auto;
        min-width: 0;
        margin-bottom: 0;
        gap: 8px;
    }

    .brand-link span:last-child,
    .clean-brand strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.95rem;
    }

    .brand-mark.small {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .header-icon-link,
    .header-back-btn,
    .theme-toggle.in-header {
        width: 36px;
        min-width: 36px;
        height: 36px;
        min-height: 36px;
        flex-basis: 36px;
        border-radius: 11px;
    }

    .header-icon-link svg,
    .header-back-btn svg {
        width: 17px;
        height: 17px;
    }
}

.header-icon-link svg,
.header-back-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:root[data-theme="dark"] .home-header {
    background:
        linear-gradient(90deg, rgba(7, 17, 31, 0.96), rgba(7, 17, 31, 0.8));
}

.home-header h1 {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 1.2rem;
    line-height: 1.1;
    text-transform: uppercase;
}

.home-header h1 span {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
    text-transform: none;
}

.theme-toggle {
    top: 24px;
    right: 82px;
    bottom: auto;
    width: 38px;
    min-height: 38px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 16px;
    font-size: 0;
}

.theme-toggle.in-header {
    position: static;
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    flex: 0 0 38px;
    margin: 0;
    box-shadow: none;
    background: rgba(6, 59, 122, 0.08);
}

:root[data-theme="dark"] .theme-toggle.in-header {
    background: rgba(255, 255, 255, 0.08);
}

.theme-toggle::before {
    content: "";
    width: 17px;
    height: 17px;
    display: block;
    border-radius: 50%;
    border: 2px solid currentColor;
    box-shadow: inset -6px -4px 0 currentColor;
}

:root[data-theme="dark"] .theme-toggle::before {
    box-shadow: none;
}

.recent-card {
    padding: 16px 18px;
}

.recent-row {
    grid-template-columns: 54px minmax(0, 1fr) minmax(118px, auto) !important;
    gap: 14px;
    align-items: center;
    padding: 12px 0;
}

.recent-row + .recent-row {
    padding-top: 16px;
}

.recent-icon {
    width: 48px;
    height: 48px;
    align-self: center;
    justify-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.recent-icon svg {
    width: 28px;
    height: 28px;
    display: block;
    margin: auto;
    transform: none;
}

.recent-row strong {
    font-size: 0.95rem;
}

.recent-row > div:not(.recent-amount) span {
    font-size: 0.86rem;
}

.recent-amount {
    grid-column: auto !important;
    text-align: right !important;
    align-self: center;
}

.recent-amount strong {
    font-size: 0.94rem;
}

.recent-amount span {
    margin-left: auto !important;
    font-size: 0.78rem;
}

@media (max-width: 430px) {
    .home-header h1 {
        font-size: 1.08rem;
    }

    .home-header h1 span {
        font-size: 0.86rem;
    }

    .theme-toggle.in-header {
        width: 36px;
        min-width: 36px;
        min-height: 36px;
    }

    .recent-row {
        grid-template-columns: 48px minmax(0, 1fr) minmax(96px, auto) !important;
        gap: 10px;
    }

    .recent-icon {
        width: 44px;
        height: 44px;
    }

    .recent-amount strong {
        font-size: 0.84rem;
    }

    .recent-amount span {
        padding: 2px 7px;
    }
}

/* Responsive transaction icon sizing */
.recent-card {
    --recent-icon-size: clamp(42px, 10vw, 54px);
}

.recent-row {
    grid-template-columns: var(--recent-icon-size) minmax(0, 1fr) minmax(98px, auto) !important;
    gap: clamp(10px, 3vw, 16px);
}

.recent-icon {
    width: var(--recent-icon-size) !important;
    height: var(--recent-icon-size) !important;
    min-width: var(--recent-icon-size);
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.recent-icon svg {
    width: 52% !important;
    height: 52% !important;
    max-width: 28px;
    max-height: 28px;
    min-width: 20px;
    min-height: 20px;
}

@media (max-width: 430px) {
    .recent-card {
        --recent-icon-size: 44px;
    }
}

@media (max-width: 350px) {
    .recent-row {
        grid-template-columns: var(--recent-icon-size) minmax(0, 1fr) !important;
    }

    .recent-amount {
        grid-column: 2 !important;
        text-align: left !important;
    }

    .recent-amount span {
        margin-left: 0 !important;
    }
}

/* Invite and bind-account polish */
.copy-text,
.referral-link-text {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.45;
}

.referral-link-text {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
}

.wallet-balance-card,
.wallet-balance-card > div {
    min-width: 0;
}

.wallet-balance-card .btn {
    flex: 0 0 auto;
}

.bind-account-form {
    margin-top: 18px;
}

.primary-withdrawal-account {
    width: 100%;
    min-height: auto;
    margin-bottom: 18px;
    cursor: default;
}

.modal-open {
    overflow: hidden;
}

.choice-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: end center;
    padding: 18px;
}

.choice-modal[hidden] {
    display: none;
}

.choice-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 18, 35, 0.42);
    backdrop-filter: blur(8px);
}

.choice-modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-solid);
    box-shadow: 0 24px 70px rgba(0, 23, 61, 0.22);
}

.choice-modal-card h2 {
    margin: 0 44px 8px 0;
    font-size: 1.25rem;
}

.choice-close {
    position: absolute;
    top: 16px;
    right: 16px;
}

.modal-eye {
    position: absolute;
    top: 58px;
    right: 16px;
    width: 36px;
    height: 36px;
}

.balance-choice-grid {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.balance-choice-card {
    display: grid;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(6, 59, 122, 0.05);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.balance-choice-card strong {
    font-size: 1.15rem;
}

.balance-choice-card small,
.balance-choice-card span {
    color: var(--muted);
}

/* Header lock: back pages must stay as one compact row */
.topbar.has-back {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    min-height: 48px;
}

.topbar.has-back .brand-link {
    display: none !important;
}

.topbar.has-back .header-back-btn {
    order: 1;
    margin: 0 !important;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.pagination a {
    display: grid;
    min-width: 36px;
    min-height: 36px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    text-decoration: none;
}

.pagination a.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.member-details {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.member-details summary {
    color: var(--primary);
    cursor: pointer;
    font-weight: 700;
}

.member-details .transaction-list {
    margin-top: 10px;
}

.topbar.has-back .nav-actions {
    order: 2;
    display: inline-flex !important;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    margin: 0 !important;
}

.topbar.has-back .header-icon-link,
.topbar.has-back .theme-toggle.in-header,
.topbar.has-back .header-back-btn {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    flex: 0 0 36px !important;
}
