* {
    box-sizing: border-box;
}

:root {
    --ink: #102033;
    --muted: #66758a;
    --line: #dfe7f1;
    --paper: #ffffff;
    --canvas: #eef3f8;
    --brand: #173f8f;
    --brand-2: #0d9488;
    --brand-3: #2f6fed;
    --danger: #c2412d;
    --radius: 14px;
    --shadow: 0 16px 40px rgba(16, 32, 51, .10);
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--canvas);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body {
    overflow-x: hidden;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

.app-shell {
    min-height: 100vh;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

body[data-route="service"] .app-shell {
    padding-bottom: 0;
}

body[data-route="login"] .app-shell {
    padding-bottom: 0;
}

.view {
    width: 100%;
    max-width: 560px;
    min-height: calc(100vh - 72px);
    margin: 0 auto;
    padding: 14px 14px 92px;
}

body[data-route="home"] .view {
    padding-bottom: 142px;
}

body[data-route="service"] .view {
    max-width: none;
    min-height: 100vh;
    padding: 0;
}

.login-page {
    min-height: calc(100vh - 92px);
    display: grid;
    align-content: end;
    gap: 18px;
    padding: 28px 4px 22px;
    position: relative;
}

.login-page::before {
    content: "";
    position: absolute;
    inset: -14px -14px auto;
    height: min(52vh, 420px);
    background: linear-gradient(145deg, rgba(23, 63, 143, .96), rgba(47, 111, 237, .90) 56%, rgba(13, 148, 136, .72));
    border-bottom: 1px solid rgba(255, 255, 255, .34);
}

.brand {
    position: relative;
    align-self: end;
    margin: 0 12px 16px;
    color: #fff;
    font-size: clamp(24px, 7vw, 34px);
    font-weight: 800;
    letter-spacing: 0;
    text-align: left;
    text-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.panel,
.hero,
.metric,
.box,
.rich-text {
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(223, 231, 241, .9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel {
    padding: 22px;
}

.login-page .panel {
    position: relative;
    margin: 0 2px;
}

.panel label {
    display: block;
    margin-bottom: 8px;
    color: #34445a;
    font-weight: 700;
}

.privacy-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin: 12px 0 0;
    color: var(--muted) !important;
    font-size: 13px;
    font-weight: 500 !important;
}

.privacy-check input {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    padding: 0;
}

.privacy-check a {
    color: var(--brand-3);
    text-decoration: none;
}

input,
textarea {
    width: 100%;
    border: 1px solid #cbd8e8;
    border-radius: 12px;
    padding: 13px 14px;
    background: #f9fbfe;
    color: var(--ink);
    outline: none;
}

input:focus,
textarea:focus {
    border-color: #4f86f7;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79, 134, 247, .14);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.primary,
.secondary {
    width: 100%;
    min-height: 46px;
    border-radius: 12px;
    margin-top: 14px;
    border: 0;
    font-weight: 800;
}

.primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-3) 62%, var(--brand-2));
    color: #fff;
    box-shadow: 0 14px 30px rgba(47, 111, 237, .22);
}

.primary:disabled {
    background: #9aa8bc;
    box-shadow: none;
}

.secondary {
    background: #fff;
    border: 1px solid #cbd8e8;
    color: #304158;
}

.hero {
    margin: -14px -14px 16px;
    padding: 28px 18px 32px;
    border: 0;
    border-radius: 0 0 24px 24px;
    background: linear-gradient(145deg, #10284d, #173f8f 62%, #0d9488);
    color: #fff;
    box-shadow: 0 20px 46px rgba(16, 40, 77, .22);
}

.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(24px, 7vw, 34px);
    letter-spacing: 0;
}

.hero p,
.muted {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.hero p {
    color: rgba(255, 255, 255, .82);
}

.quick-grid,
.list {
    display: grid;
    gap: 12px;
}

.quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-card {
    position: relative;
    display: grid;
    gap: 7px;
    min-height: 112px;
    align-content: end;
    border: 1px solid rgba(223, 231, 241, .92);
    border-radius: 16px;
    padding: 15px;
    text-align: left;
    background: linear-gradient(180deg, #fff, #f8fbff);
    box-shadow: 0 10px 26px rgba(16, 32, 51, .07);
}

.action-card::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 14px;
    width: 36px;
    height: 36px;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(47, 111, 237, .95), rgba(13, 148, 136, .88));
    box-shadow: 0 10px 20px rgba(47, 111, 237, .18);
}

.action-card strong {
    font-size: 17px;
    color: #152942;
}

.action-card span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.page-title {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 58px 1fr 58px;
    align-items: center;
    margin: -14px -14px 16px;
    min-height: 54px;
    padding: env(safe-area-inset-top) 14px 0;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(223, 231, 241, .9);
    backdrop-filter: blur(14px);
}

.page-title button {
    width: 52px;
    height: 36px;
    border: 1px solid #d7e1ee;
    border-radius: 12px;
    background: #fff;
    color: #26384f;
    white-space: nowrap;
    font-size: 14px;
}

.page-title h1 {
    margin: 0;
    text-align: center;
    font-size: 18px;
}

.info-row {
    display: grid;
    grid-template-columns: minmax(86px, auto) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #edf2f7;
}

.info-row span {
    color: var(--muted);
}

.info-row strong {
    text-align: right;
    word-break: break-all;
}

.metric {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    padding: 18px;
}

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

.metric strong {
    font-size: 34px;
}

.loan-banner {
    display: grid;
    gap: 8px;
    margin: -14px -14px 16px;
    padding: 34px 20px 56px;
    border-radius: 0 0 26px 26px;
    background: linear-gradient(145deg, #10284d, #173f8f 64%, #0d9488);
    color: #fff;
    box-shadow: 0 18px 44px rgba(16, 40, 77, .22);
}

.loan-banner span {
    font-size: 14px;
    opacity: .86;
}

.loan-banner strong {
    font-size: clamp(38px, 12vw, 58px);
}

.feature-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: -44px 0 16px;
}

.feature {
    display: grid;
    gap: 6px;
    min-height: 96px;
    align-content: center;
    border: 1px solid rgba(223, 231, 241, .9);
    border-radius: 16px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 12px 28px rgba(16, 32, 51, .08);
}

.feature strong {
    color: var(--brand);
    font-size: 18px;
}

.feature span {
    color: var(--muted);
    font-size: 13px;
}

.box,
.rich-text {
    padding: 16px;
    margin-bottom: 14px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.box h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.pay-image {
    display: block;
    max-width: 100%;
    border-radius: 14px;
    margin: 14px auto;
    border: 1px solid #e3ebf5;
}

.contract-paper {
    position: relative;
    min-height: 360px;
    overflow: hidden;
}

.contract-paper > *:not(.contract-seal) {
    position: relative;
    z-index: 1;
}

.contract-seal {
    position: absolute;
    left: 58%;
    right: auto;
    bottom: 34px;
    z-index: 2;
    width: min(48vw, 190px);
    max-width: 58%;
    height: auto;
    border: 0;
    border-radius: 0;
    opacity: .82;
    pointer-events: none;
    mix-blend-mode: multiply;
    transform: translateX(-50%) rotate(-8deg);
    filter: saturate(1.08) contrast(1.03);
}

.avatar {
    display: block;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    margin: 12px auto 20px;
    border: 3px solid #fff;
    background: #fff;
    box-shadow: var(--shadow);
}

.empty {
    min-height: calc(100vh - 72px);
    display: grid;
    align-content: center;
    gap: 10px;
    text-align: center;
    padding: 28px;
}

.service-box {
    margin: 0;
}

.service-chat {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    margin: 0;
    background: #edf4fb;
    color: var(--ink);
    overflow: hidden;
}

.service-chat-header {
    display: grid;
    grid-template-columns: 52px 1fr 72px;
    align-items: center;
    min-height: calc(52px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: linear-gradient(135deg, #10284d, #173f8f 58%, #0d9488);
    color: #fff;
    text-align: center;
    box-shadow: 0 16px 36px rgba(16, 40, 77, .22);
}

.service-chat-header button {
    width: 52px;
    height: 52px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 32px;
    line-height: 1;
}

.service-chat-header strong {
    font-size: 17px;
}

.service-live-dot {
    justify-self: center;
    position: relative;
    padding-left: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, .9);
}

.service-live-dot::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -3px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, .2);
}

.service-agent-card {
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 24px 22px 20px;
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(249,252,255,.98));
    text-align: center;
    border-bottom: 1px solid #dce7f2;
}

.service-agent-avatar {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    background: #f7fafc;
    box-shadow: 0 16px 34px rgba(47, 111, 237, .18);
}

.service-agent-card strong {
    font-size: 17px;
    color: #102033;
}

.service-agent-card span,
.service-agent-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.service-time {
    justify-self: center;
    margin: 12px 0 2px;
    color: #7d8ca1;
    font-size: 12px;
}

.service-status {
    justify-self: center;
    margin: 6px 12px 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    color: #64748b;
    font-size: 12px;
    box-shadow: 0 8px 22px rgba(16, 32, 51, .08);
}

.message-list {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 16px 14px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    align-content: start;
}

.service-chat .message-list {
    min-height: 0;
    background: linear-gradient(180deg, #edf4fb, #f6f9fc);
}

.service-welcome,
.service-connecting .message-list {
    place-content: center;
}

.service-empty-state {
    width: min(320px, calc(100vw - 36px));
    margin: auto;
    padding: 18px;
    border-radius: 18px;
    background: #fff;
    text-align: center;
    box-shadow: var(--shadow);
}

.service-empty-state strong {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
}

.chat-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.chat-row.user {
    justify-content: flex-start;
    flex-direction: row-reverse;
}

.chat-avatar {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 2px solid rgba(255, 255, 255, .92);
    box-shadow: 0 8px 18px rgba(31, 48, 80, .12);
}

.message {
    max-width: min(78%, 380px);
    padding: 10px 12px 11px;
    border-radius: 18px 18px 18px 6px;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 0 10px 22px rgba(31, 48, 80, .08);
    overflow-wrap: anywhere;
}

.message.user {
    border: 0;
    border-radius: 18px 18px 6px 18px;
    background: linear-gradient(135deg, #173f8f, #2f6fed);
    color: #fff;
    box-shadow: 0 12px 24px rgba(47, 111, 237, .2);
}

.message.failed {
    background: #fff3f1;
    border: 1px solid #ffc9c0;
    color: #9f2418;
}

.message span {
    display: block;
    margin-bottom: 3px;
    color: #64748b;
    font-size: 10px;
}

.message.user span {
    color: rgba(255, 255, 255, .78);
}

.message p {
    margin: 0;
    line-height: 1.55;
    font-size: 15px;
}

.message-image {
    display: block;
    max-width: 100%;
    border-radius: 8px;
}

.retry {
    margin-top: 8px;
    min-height: 30px;
    border: 1px solid #d84a38;
    border-radius: 999px;
    padding: 0 12px;
    background: #fff;
    color: #b83325;
}

.service-composer {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #d8e3ef;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -12px 32px rgba(31,48,80,.10);
}

.service-composer input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    border-radius: 999px;
    padding: 0 15px;
    background: #f8fbff;
    font-size: 14px;
}

.service-composer .primary,
.service-composer .icon-button {
    flex: 0 0 auto;
    height: 42px;
    min-height: 42px;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

.service-composer .primary {
    width: 54px;
    border-radius: 999px;
}

.icon-button {
    width: 42px;
    border: 1px solid #d6e2ee;
    border-radius: 14px;
    background: #fff;
    color: #1e293b;
    font-size: 16px;
    box-shadow: 0 6px 16px rgba(31, 48, 80, .06);
}

.call-button {
    width: 50px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
}

.call-status {
    display: grid;
    gap: 6px;
    margin: 12px;
    padding: 12px;
    border: 1px solid #cfe0ff;
    border-radius: 14px;
    background: #f0f6ff;
}

.call-status span {
    color: var(--muted);
    word-break: break-all;
}

.rtc-retry {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.rtc-retry .secondary {
    width: auto;
    min-height: 30px;
    margin-top: 0;
    padding: 0 12px;
    font-size: 13px;
}

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-width: 560px;
    margin: 0 auto;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid rgba(223, 231, 241, .95);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(16px);
    box-shadow: 0 -10px 30px rgba(16, 32, 51, .08);
}

body[data-route="service"] .tabbar {
    display: none;
}

body[data-route="login"] .tabbar,
body[data-route="privacy"] .tabbar,
body[data-route="notice"] .tabbar {
    display: none;
}

.tabbar button {
    height: 62px;
    border: 0;
    background: transparent;
    color: #6f7f94;
    font-size: 13px;
}

.tabbar button.active {
    color: var(--brand);
    font-weight: 800;
}

.service-fab {
    position: fixed;
    right: max(14px, calc((100vw - 560px) / 2 + 14px));
    bottom: calc(88px + env(safe-area-inset-bottom));
    z-index: 35;
    min-width: 92px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #10284d, #173f8f 58%, #0d9488);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 16px 34px rgba(23, 63, 143, .28);
}

body[data-route="service"] .service-fab {
    display: none;
}

body[data-route="login"] .service-fab {
    display: none;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(86px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    max-width: min(340px, calc(100vw - 32px));
    padding: 11px 14px;
    border-radius: 999px;
    background: rgba(16, 32, 51, .94);
    color: #fff;
    z-index: 10000;
    box-shadow: 0 12px 34px rgba(16, 32, 51, .2);
}

.version-notice {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    z-index: 60;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    max-width: 540px;
    margin: 0 auto;
    padding: 10px 12px;
    border: 1px solid #cfe0ff;
    border-radius: 14px;
    background: #f7fbff;
    color: #263343;
    box-shadow: var(--shadow);
}

.version-notice span {
    min-width: 0;
    font-size: 13px;
    line-height: 1.45;
}

.version-notice .secondary {
    width: auto;
    flex: 0 0 auto;
    min-height: 32px;
    margin-top: 0;
    padding: 0 12px;
    font-size: 13px;
}

@media (min-width: 720px) {
    .view {
        padding-left: 0;
        padding-right: 0;
    }

    .hero,
    .loan-banner,
    .page-title {
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 390px) {
    .view {
        padding-left: 10px;
        padding-right: 10px;
    }

    .quick-grid,
    .feature-grid {
        gap: 10px;
    }

    .action-card {
        min-height: 104px;
        padding: 13px;
    }

    .service-composer {
        gap: 6px;
        padding: 9px 8px;
        padding-bottom: calc(9px + env(safe-area-inset-bottom));
    }

    .service-composer input[type="text"] {
        padding: 0 12px;
    }

    .service-composer .primary {
        width: 48px;
        font-size: 13px;
    }

    .call-button {
        display: none;
    }
}

@media (max-width: 330px) {
    .service-composer .icon-button:not(.call-button) {
        display: none;
    }

    .message {
        max-width: 76%;
    }
}

/* Enterprise visual refresh */
body {
    background:
        linear-gradient(180deg, #e8eef5 0%, #f4f7fb 46%, #edf3f8 100%);
}

.view {
    padding-top: 0;
}

.login-page {
    align-content: start;
    min-height: 100svh;
    padding: 12px 14px 18px;
    gap: 0;
}

.login-page::before {
    inset: 0 0 auto;
    height: min(48vh, 390px);
    background:
        linear-gradient(138deg, rgba(7, 22, 48, .98), rgba(18, 55, 116, .96) 54%, rgba(19, 126, 122, .88));
    border-bottom: 0;
}

.login-page::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    top: 34px;
    height: 150px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 20px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .04)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .12) 0 1px, transparent 1px 42px);
    opacity: .72;
}

.login-brand {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 8px;
    margin: 58px 4px 26px;
    color: #fff;
}

.login-brand span {
    width: max-content;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    color: rgba(255, 255, 255, .84);
    font-size: 12px;
}

.login-brand strong {
    font-size: clamp(30px, 8vw, 44px);
    letter-spacing: 0;
    line-height: 1.08;
}

.login-brand p {
    margin: 0;
    color: rgba(255, 255, 255, .76);
    font-size: 14px;
}

.login-page .panel {
    border: 1px solid rgba(255, 255, 255, .86);
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 24px 64px rgba(12, 34, 64, .18);
}

.form-head {
    display: grid;
    gap: 4px;
    margin-bottom: 18px;
}

.form-head strong {
    font-size: 22px;
}

.form-head span {
    color: var(--muted);
    font-size: 13px;
}

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

.security-strip span {
    min-width: 0;
    padding: 8px 6px;
    border-radius: 10px;
    background: #f4f8fc;
    color: #45566e;
    text-align: center;
    font-size: 12px;
    white-space: nowrap;
}

.hero {
    position: relative;
    min-height: 196px;
    padding: 30px 18px 18px;
    border-radius: 0 0 28px 28px;
    background:
        linear-gradient(135deg, #071630, #143d7a 58%, #127e7a);
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 16px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .34), transparent);
}

.hero-kicker {
    margin-bottom: 16px;
    color: rgba(255, 255, 255, .62);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
}

.hero h1 {
    max-width: 72%;
    font-size: clamp(30px, 8vw, 42px);
}

.hero p {
    max-width: 72%;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 22px;
}

.hero-stats span {
    padding: 9px 7px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
    background: rgba(255, 255, 255, .09);
    color: rgba(255, 255, 255, .88);
    text-align: center;
    font-size: 12px;
    white-space: nowrap;
}

.quick-grid {
    gap: 14px;
    margin-top: 16px;
}

.action-card {
    min-height: 126px;
    border: 1px solid rgba(213, 224, 237, .95);
    border-radius: 20px;
    padding: 18px 16px 16px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,250,253,.98));
    box-shadow: 0 18px 42px rgba(20, 42, 74, .09);
    overflow: hidden;
}

.action-card::before {
    top: 16px;
    left: 16px;
    width: 42px;
    height: 42px;
    border-radius: 15px;
    background: linear-gradient(135deg, #123d7a, #2f6fed 64%, #16a095);
}

.action-card::after {
    content: "";
    position: absolute;
    right: -24px;
    top: -24px;
    width: 86px;
    height: 86px;
    border: 1px solid rgba(47, 111, 237, .10);
    border-radius: 24px;
    transform: rotate(18deg);
}

.action-card strong {
    margin-top: 48px;
    font-size: 18px;
}

.action-card span {
    font-size: 13px;
}

.metric {
    position: relative;
    padding: 22px;
    border-radius: 20px;
    background: linear-gradient(135deg, #fff, #f8fbff);
}

.metric strong {
    font-size: clamp(36px, 11vw, 52px);
    letter-spacing: 0;
}

.metric em {
    position: absolute;
    right: 18px;
    top: 18px;
    color: #8795a8;
    font-size: 12px;
    font-style: normal;
}

.info-row {
    min-height: 58px;
    margin: 0;
    padding: 14px 2px;
}

.info-row + .info-row {
    border-top: 0;
}

.box,
.rich-text {
    border-radius: 20px;
    box-shadow: 0 14px 34px rgba(20, 42, 74, .08);
}

.tabbar {
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -16px 42px rgba(20, 42, 74, .10);
}

.tabbar button {
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
}

.tabbar button::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: transparent;
}

.tabbar button.active::before {
    background: var(--brand);
}

.service-fab {
    min-width: 104px;
    height: 48px;
    background: linear-gradient(135deg, #071630, #173f8f 58%, #127e7a);
    box-shadow: 0 18px 44px rgba(18, 61, 122, .34);
}

@media (max-width: 390px) {
    .hero h1,
    .hero p {
        max-width: 100%;
    }

    .hero-stats {
        gap: 6px;
    }

    .hero-stats span {
        padding: 8px 4px;
        font-size: 11px;
    }

    .quick-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Ping An inspired financial portal refresh */
:root {
    --ink: #23262f;
    --muted: #697386;
    --line: #edf0f5;
    --paper: #ffffff;
    --canvas: #f5f6f8;
    --brand: #ee3f23;
    --brand-2: #ff7a18;
    --brand-3: #b71f16;
    --gold: #f6b343;
    --success: #14a86b;
    --radius: 12px;
    --shadow: 0 14px 34px rgba(41, 35, 28, .09);
}

html,
body {
    background:
        linear-gradient(180deg, #fff7ef 0, #f6f7fa 210px, #f4f6f9 100%);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

.view {
    max-width: 540px;
    padding: 0 14px 94px;
}

body[data-route="login"] .view {
    min-height: 100vh;
    padding-bottom: 0;
}

.panel,
.hero,
.metric,
.box,
.rich-text,
.action-card,
.feature {
    border: 1px solid rgba(232, 218, 206, .78);
    border-radius: 12px;
    background: rgba(255, 255, 255, .98);
    box-shadow: var(--shadow);
}

.login-page::before {
    height: min(34vh, 280px);
    background:
        radial-gradient(circle at 76% 18%, rgba(255, 205, 120, .42), transparent 28%),
        radial-gradient(circle at 16% 16%, rgba(255, 255, 255, .18), transparent 24%),
        linear-gradient(135deg, #b71918 0%, #ee3f23 48%, #ff8a1f 100%);
}

.login-page::after {
    display: none;
}

.login-brand {
    margin: 10px 4px 12px;
    gap: 8px;
}

.login-brand span {
    border-color: rgba(255, 255, 255, .32);
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.login-brand strong {
    max-width: 9em;
    font-weight: 900;
    text-shadow: 0 8px 28px rgba(119, 20, 16, .24);
}

.login-highlights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 4px;
}

.login-highlights div {
    display: grid;
    gap: 3px;
    min-height: 52px;
    align-content: center;
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 12px;
    background: rgba(255, 255, 255, .14);
    backdrop-filter: blur(8px);
}

.login-highlights b {
    color: #fff;
    font-size: 12px;
}

.login-highlights em {
    color: rgba(255, 255, 255, .82);
    font-size: 10px;
    font-style: normal;
    line-height: 1.35;
}

.login-page .panel {
    border-radius: 12px;
    border-color: rgba(255, 255, 255, .92);
    box-shadow: 0 24px 64px rgba(120, 44, 22, .18);
    padding: 20px;
}

.form-head strong {
    color: #27201d;
}

.form-head span,
.muted {
    color: var(--muted);
}

input,
textarea {
    border-color: #e4d6ca;
    border-radius: 8px;
    background: #fffaf6;
}

input:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(238, 63, 35, .12);
}

.primary {
    border-radius: 8px;
    background: linear-gradient(135deg, #e93020, #ff7a18);
    box-shadow: 0 14px 28px rgba(238, 63, 35, .24);
}

.secondary {
    border-color: #efd8ca;
    border-radius: 8px;
    color: #b83222;
    background: #fff;
}

.security-strip span {
    border-radius: 8px;
    background: #fff5ed;
    color: #9a4a2d;
}

.hero {
    min-height: 212px;
    margin: 0 -14px 16px;
    padding: 28px 20px 18px;
    border: 0;
    border-radius: 0 0 18px 18px;
    background:
        radial-gradient(circle at 82% 24%, rgba(255, 215, 130, .48), transparent 25%),
        linear-gradient(135deg, #b71918 0%, #e93d22 50%, #ff7d1a 100%);
    box-shadow: 0 18px 44px rgba(199, 49, 28, .24);
}

.hero::before {
    content: "";
    position: absolute;
    right: 18px;
    top: 54px;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    border: 18px solid rgba(255, 255, 255, .16);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}

.hero::after {
    display: none;
}

.hero-kicker {
    width: max-content;
    margin-bottom: 14px;
    padding: 5px 9px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;
    color: rgba(255,255,255,.88);
    background: rgba(255,255,255,.1);
}

.hero h1 {
    max-width: 74%;
    font-weight: 900;
    font-size: clamp(29px, 8vw, 42px);
}

.hero p {
    max-width: 76%;
    color: rgba(255,255,255,.86);
}

.hero-stats {
    margin-top: 20px;
}

.hero-stats span {
    border-color: rgba(255,255,255,.24);
    border-radius: 8px;
    background: rgba(255,255,255,.14);
}

.quick-grid {
    gap: 12px;
    margin-top: 14px;
}

.action-card {
    min-height: 132px;
    align-content: start;
    gap: 8px;
    padding: 16px;
    border-radius: 12px;
    background:
        linear-gradient(180deg, #ffffff, #fffaf7);
    overflow: hidden;
}

.action-card::before,
.action-card::after {
    display: none;
}

.action-card i {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(238,63,35,.12), rgba(255,122,24,.18));
    color: var(--brand);
}

.action-card i::before {
    content: "";
    width: 22px;
    height: 22px;
    background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.action-loan { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 7.5 12 3l8 4.5v9L12 21l-8-4.5v-9Zm4 2h8v2H8v-2Zm0 4h6v2H8v-2Z'/%3E%3C/svg%3E"); }
.action-repay { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5h16v14H4V5Zm3 4h10V7H7v2Zm0 4h5v-2H7v2Zm10 3 3-3-3-3v2h-5v2h5v2Z'/%3E%3C/svg%3E"); }
.action-contract { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 3h9l3 3v15H6V3Zm8 1.8V7h2.2L14 4.8ZM8 10h8V8H8v2Zm0 4h8v-2H8v2Zm0 4h5v-2H8v2Z'/%3E%3C/svg%3E"); }
.action-notice { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 18h2v-2h-2v2Zm1-16a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm-1-6h2c0-3 3-2.7 3-6 0-2-1.7-3.5-4-3.5S8 6 8 8h2c0-.9.8-1.5 2-1.5s2 .7 2 1.7c0 1.9-3 2.2-3 5.8Z'/%3E%3C/svg%3E"); }
.action-info { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0 2c-4 0-7 2-7 4.5V20h14v-1.5C19 16 16 14 12 14Z'/%3E%3C/svg%3E"); }
.action-privacy { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 5 5v6c0 4.6 3 8.9 7 10 4-1.1 7-5.4 7-10V5l-7-3Zm-1 13.5-3-3 1.4-1.4 1.6 1.6 3.6-3.6L16 10l-5 5.5Z'/%3E%3C/svg%3E"); }
.action-service { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a8 8 0 0 0-8 8v5a3 3 0 0 0 3 3h2v-7H6v-1a6 6 0 1 1 12 0v1h-3v7h2.2A5.2 5.2 0 0 1 12 22v-2a3.2 3.2 0 0 0 3.1-2.4H18a2 2 0 0 0 2-2V11a8 8 0 0 0-8-8Z'/%3E%3C/svg%3E"); }

.action-card strong {
    margin-top: 0;
    color: #2b211d;
    font-size: 18px;
}

.action-card span {
    color: #7a6255;
}

.page-title {
    min-height: 56px;
    background: rgba(255,255,255,.96);
    border-bottom-color: #f0e2d7;
}

.page-title button {
    border-color: #efd8ca;
    border-radius: 8px;
    color: #b83222;
}

.loan-banner {
    margin: 0 -14px 16px;
    padding: 34px 22px 58px;
    border-radius: 0 0 18px 18px;
    background:
        radial-gradient(circle at 80% 20%, rgba(255,222,150,.46), transparent 28%),
        linear-gradient(135deg, #b71918, #ee3f23 48%, #ff7a18);
    box-shadow: 0 18px 44px rgba(199, 49, 28, .22);
}

.loan-banner strong {
    letter-spacing: 0;
}

.loan-banner p {
    max-width: 78%;
    margin: 0;
    color: rgba(255,255,255,.84);
    line-height: 1.6;
}

.feature-grid {
    gap: 10px;
}

.feature {
    border-radius: 12px;
    background: #fff;
}

.feature strong {
    color: var(--brand);
}

.metric {
    border-radius: 12px;
    background:
        linear-gradient(135deg, #fff, #fff7ef);
}

.metric strong {
    color: var(--brand);
}

.metric em {
    color: #b98668;
}

.repay-summary {
    position: relative;
    display: grid;
    gap: 16px;
    margin-bottom: 12px;
    padding: 18px 16px 16px;
    border-radius: 18px;
    color: #fff;
    box-shadow: 0 18px 42px rgba(171, 38, 24, .18);
    overflow: hidden;
}

.repay-summary::before {
    content: "";
    position: absolute;
    inset: auto -38px -56px auto;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 64%);
}

.repay-summary::after {
    content: "";
    position: absolute;
    right: -28px;
    top: -38px;
    width: 132px;
    height: 132px;
    border: 18px solid rgba(255, 255, 255, .16);
    border-radius: 50%;
}

.repay-summary.overdue {
    background:
        linear-gradient(135deg, rgba(128, 13, 13, .96), rgba(213, 32, 25, .96) 52%, rgba(244, 102, 32, .95)),
        linear-gradient(135deg, #8f1010, #e52d21 54%, #ff7518);
}

.repay-summary.pending {
    background: linear-gradient(135deg, #d74415, #ff8a1f);
}

.repay-summary.paid {
    background: linear-gradient(135deg, #0f8b62, #20b77a);
}

.repay-summary-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.repay-status,
.repay-amount {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 4px;
}

.repay-status span,
.repay-amount span {
    color: rgba(255, 255, 255, .86);
    font-size: 13px;
    font-weight: 700;
}

.repay-status strong {
    font-size: 22px;
}

.repay-badge {
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: rgba(255, 255, 255, .20);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.repay-amount strong {
    font-size: clamp(42px, 13vw, 62px);
    line-height: 1;
    letter-spacing: 0;
}

.repay-amount em {
    color: rgba(255, 255, 255, .90);
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
}

.repay-metrics {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.repay-metrics div {
    display: grid;
    gap: 5px;
    min-height: 66px;
    align-content: center;
    padding: 9px 8px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 12px;
    background: rgba(255, 255, 255, .18);
    backdrop-filter: blur(8px);
}

.repay-metrics span {
    color: rgba(255, 255, 255, .88);
    font-size: 12px;
    font-weight: 700;
}

.repay-metrics strong {
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    word-break: break-word;
}

.repay-metrics .danger {
    border-color: rgba(255, 255, 255, .42);
    background: rgba(255, 255, 255, .24);
}

.repay-metrics .danger strong {
    color: #fff;
}

.overdue-alert {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 4px;
    padding: 12px 13px;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 14px;
    background: rgba(255, 255, 255, .18);
    backdrop-filter: blur(8px);
}

.overdue-alert strong {
    font-size: 17px;
    color: #fff;
}

.overdue-alert span {
    color: rgba(255, 255, 255, .96);
    line-height: 1.55;
    font-size: 14px;
    font-weight: 700;
}

.repay-guide {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px;
    border: 1px solid #eceef3;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
}

.repay-guide div {
    display: grid;
    justify-items: center;
    gap: 6px;
    color: #6f7785;
    font-size: 12px;
}

.repay-guide b {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ee3f23, #ff7a18);
    color: #fff;
    font-size: 13px;
}

.repay-info {
    position: relative;
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 18px;
    background:
        linear-gradient(180deg, #fff, #fffdfb);
}

.repay-info.overdue {
    padding-bottom: 22px;
}

.repay-stamp {
    position: absolute;
    right: 10px;
    bottom: 16px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 104px;
    height: 104px;
    border: 4px solid rgba(207, 22, 22, .28);
    border-radius: 50%;
    color: rgba(207, 22, 22, .32);
    font-size: 25px;
    font-weight: 900;
    letter-spacing: 0;
    transform: rotate(-16deg);
    pointer-events: none;
    mix-blend-mode: multiply;
}

.repay-stamp::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 2px solid rgba(207, 22, 22, .22);
    border-radius: 50%;
}

.repay-stamp::after {
    content: "OVERDUE";
    position: absolute;
    left: 50%;
    bottom: 19px;
    transform: translateX(-50%);
    color: rgba(207, 22, 22, .26);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
}

.repay-info.overdue .info-row {
    position: relative;
    z-index: 1;
}

.repay-info .info-row.danger span,
.repay-info .info-row.danger strong {
    color: #d71920;
    font-weight: 900;
}

.repay-info .info-row.danger strong {
    justify-self: end;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(215, 25, 32, .10);
    border: 1px solid rgba(215, 25, 32, .18);
}

/* Native finance app polish */
:root {
    --canvas: #f6f7f9;
    --shadow: 0 8px 22px rgba(31, 35, 41, .06);
}

html,
body {
    background: #f6f7f9;
}

.view {
    padding-top: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin: 0 -14px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    background: rgba(246, 247, 249, .96);
    backdrop-filter: blur(14px);
}

.app-mark {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.app-mark span {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: linear-gradient(135deg, #e93020, #ff7a18);
    box-shadow: 0 6px 12px rgba(238, 63, 35, .18);
}

.app-mark strong {
    color: #2b211d;
    font-size: 16px;
    white-space: nowrap;
}

.search-pill {
    min-width: 0;
    height: 34px;
    display: flex;
    align-items: center;
    padding: 0 12px 0 34px;
    border: 1px solid #eceef3;
    border-radius: 999px;
    background: #fff;
    color: #9aa1ad;
    font-size: 13px;
    position: relative;
}

.search-pill::before {
    content: "";
    position: absolute;
    left: 13px;
    width: 13px;
    height: 13px;
    border: 2px solid #a2a9b6;
    border-radius: 50%;
}

.search-pill::after {
    content: "";
    position: absolute;
    left: 24px;
    width: 6px;
    height: 2px;
    border-radius: 99px;
    background: #a2a9b6;
    transform: rotate(45deg);
}

.hero {
    min-height: auto;
    margin: 0 0 12px;
    padding: 18px;
    border-radius: 16px;
    background:
        linear-gradient(135deg, #2c3445 0%, #1f2635 52%, #3b2c24 100%);
    box-shadow: 0 12px 28px rgba(31, 35, 41, .12);
}

.hero::before,
.hero::after {
    display: none;
}

.hero-main {
    display: grid;
    gap: 6px;
}

.hero-kicker {
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .65);
    font-size: 12px;
}

.hero h1 {
    max-width: none;
    font-size: 32px;
    line-height: 1.15;
}

.hero p {
    max-width: none;
    color: rgba(255, 255, 255, .82);
}

.hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 18px;
}

.hero-stats span {
    padding: 8px 6px;
    border-radius: 8px;
    border-color: rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .9);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    margin: 14px 2px 10px;
}

.section-head strong {
    color: #242932;
    font-size: 17px;
}

.section-head span {
    color: #9098a6;
    font-size: 12px;
}

.quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 8px 4px;
    border: 1px solid #eceef3;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
}

.action-card {
    min-height: 94px;
    gap: 4px;
    justify-items: center;
    align-content: center;
    padding: 10px 4px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
    text-align: center;
}

.action-card i {
    width: 38px;
    height: 38px;
    margin: 0 0 5px;
    border-radius: 14px;
}

.action-card i::before {
    width: 21px;
    height: 21px;
}

.action-card strong {
    color: #242932;
    font-size: 14px;
}

.action-card span {
    max-width: 5.5em;
    color: #9098a6;
    font-size: 11px;
    line-height: 1.25;
}

.home-assurance {
    margin: 18px 0 18px;
    padding: 16px;
    border: 1px solid #eceef3;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .90)),
        radial-gradient(circle at 14% 12%, rgba(255, 91, 48, .12), transparent 28%),
        radial-gradient(circle at 100% 88%, rgba(33, 38, 52, .10), transparent 30%);
    box-shadow: 0 12px 30px rgba(31, 35, 41, .07);
}

.home-assurance-head {
    display: grid;
    gap: 5px;
    margin-bottom: 13px;
}

.home-assurance-head strong {
    color: #242932;
    font-size: 17px;
}

.home-assurance-head span {
    color: #717a89;
    font-size: 12px;
    line-height: 1.5;
}

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

.assurance-list article {
    position: relative;
    padding: 12px 12px 12px 42px;
    border: 1px solid rgba(236, 238, 243, .92);
    border-radius: 14px;
    background: rgba(255, 255, 255, .86);
}

.assurance-list article::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 15px;
    width: 14px;
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(135deg, #ff4928, #ff7a2b);
    box-shadow: 0 6px 14px rgba(255, 75, 39, .18);
}

.assurance-list article b {
    display: block;
    color: #242932;
    font-size: 14px;
}

.assurance-list article p {
    margin: 4px 0 0;
    color: #6f7785;
    font-size: 12px;
    line-height: 1.55;
}

.home-reminder {
    display: grid;
    gap: 5px;
    margin-top: 12px;
    padding: 12px 13px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 240, 233, .96), rgba(255, 255, 255, .88));
}

.home-reminder strong {
    color: #e63b22;
    font-size: 14px;
}

.home-reminder span {
    color: #70483d;
    font-size: 12px;
    line-height: 1.65;
}

.profile-notice,
.profile-grid,
.profile-tips {
    margin-bottom: 12px;
}

.profile-notice {
    padding: 14px 16px;
    border: 1px solid #eceef3;
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
}

.profile-notice strong {
    display: block;
    margin-bottom: 6px;
    color: #242932;
    font-size: 16px;
}

.profile-notice p {
    margin: 0;
    color: #6f7785;
    font-size: 13px;
    line-height: 1.7;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.profile-grid .action-card {
    justify-items: start;
    min-height: 104px;
    padding: 14px;
    border: 1px solid #eceef3;
    background: #fff;
    box-shadow: var(--shadow);
    text-align: left;
}

.profile-grid .action-card i {
    width: 36px;
    height: 36px;
}

.profile-grid .action-card strong {
    font-size: 15px;
}

.profile-grid .action-card span {
    display: block;
    max-width: none;
    font-size: 12px;
}

.profile-tips {
    display: grid;
    gap: 8px;
}

.profile-tips div {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid #f0e5dc;
    border-radius: 12px;
    background: #fffaf6;
}

.profile-tips strong {
    color: #b83222;
    font-size: 14px;
}

.profile-tips span {
    color: #7a6255;
    font-size: 12px;
    line-height: 1.55;
}

.page-title {
    background: rgba(255, 255, 255, .96);
}

.loan-banner,
.repay-summary {
    border-radius: 16px;
    margin: 0 0 12px;
}

.loan-banner {
    background: linear-gradient(135deg, #2c3445, #1f2635 58%, #4a3326);
}

.box,
.rich-text,
.metric,
.feature,
.repay-account {
    border-color: #eceef3;
    box-shadow: var(--shadow);
}

.info-row {
    min-height: 54px;
    border-bottom-color: #eef0f4;
}

.info-row span {
    color: #6f7785;
}

.info-row strong {
    color: #242932;
}

.tabbar {
    border-color: #eceef3;
    box-shadow: 0 -8px 24px rgba(31, 35, 41, .08);
}

.service-chat-header {
    background: #242932;
    box-shadow: none;
}

.service-agent-card {
    border-color: #eceef3;
}

.service-composer {
    border-color: #eceef3;
}

@media (max-width: 390px) {
    .app-topbar {
        margin-left: -10px;
        margin-right: -10px;
    }

    .quick-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .action-card span {
        display: none;
    }
}

.repay-now {
    margin: 0 0 14px;
    min-height: 50px;
    font-size: 17px;
}

.repay-account[hidden] {
    display: none !important;
}

.repay-account-tip {
    margin-bottom: 10px;
}

.voucher-box {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #f1e6dc;
}

.voucher-box h2 {
    margin-top: 0;
}

.box,
.rich-text {
    border-radius: 12px;
}

.box h2 {
    position: relative;
    padding-left: 12px;
}

.box h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: .32em;
    width: 4px;
    height: 1em;
    border-radius: 99px;
    background: linear-gradient(180deg, var(--brand), var(--brand-2));
}

.info-row {
    border-bottom-color: #f1e6dc;
}

.info-row span {
    color: #846b5e;
}

.tabbar {
    max-width: 540px;
    border-radius: 16px 16px 0 0;
    border-top-color: #f0e2d7;
}

.tabbar button {
    height: 66px;
    gap: 3px;
}

.tabbar button::before {
    width: 22px;
    height: 22px;
    border-radius: 0;
    background: #9b8a80;
    -webkit-mask: var(--tab-icon) center / contain no-repeat;
    mask: var(--tab-icon) center / contain no-repeat;
}

.tabbar button[data-route="home"] { --tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 10.5 12 3l9 7.5V21h-6v-6H9v6H3V10.5Z'/%3E%3C/svg%3E"); }
.tabbar button[data-route="loan"] { --tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 6h16v12H4V6Zm3 3v2h10V9H7Zm0 4v2h6v-2H7Z'/%3E%3C/svg%3E"); }
.tabbar button[data-route="repay"] { --tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 4h10v3h3v13H4V7h3V4Zm2 3h6V6H9v1Zm9 5-4-3v2H8v2h6v2l4-3Z'/%3E%3C/svg%3E"); }
.tabbar button[data-route="profile"] { --tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 8c.7-3.4 3.5-6 7-6s6.3 2.6 7 6H5Z'/%3E%3C/svg%3E"); }

.tabbar button.active {
    color: var(--brand);
}

.tabbar button.active::before {
    background: var(--brand);
}

.service-fab {
    height: 50px;
    min-width: 112px;
    border-radius: 999px;
    background: linear-gradient(135deg, #e93020, #ff7a18);
    box-shadow: 0 18px 44px rgba(238, 63, 35, .28);
}

body[data-route="repay"] .view {
    padding-bottom: 148px;
}

body[data-route="repay"] .service-fab {
    right: max(0px, calc((100vw - 560px) / 2));
    bottom: calc(116px + env(safe-area-inset-bottom));
    width: 42px;
    min-width: 42px;
    height: 92px;
    padding: 8px 6px;
    border-radius: 22px 0 0 22px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 12px;
    line-height: 1.1;
    box-shadow: 0 14px 28px rgba(238, 63, 35, .24);
}

.service-chat {
    background:
        linear-gradient(180deg, #fff4ec 0, #f5f6f8 210px, #f4f6f9 100%);
}

.service-chat-header {
    background: linear-gradient(135deg, #b71918, #ee3f23 50%, #ff7a18);
    box-shadow: 0 14px 34px rgba(199, 49, 28, .22);
}

.service-agent-card {
    margin: 12px 12px 0;
    border: 1px solid rgba(240, 226, 215, .96);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
}

.service-agent-avatar {
    border-color: #fff6ee;
    box-shadow: 0 14px 30px rgba(238, 63, 35, .16);
}

.service-status {
    background: #fff7ef;
    color: #9a4a2d;
}

.service-chat .message-list {
    background: transparent;
}

.message {
    border-color: #efe1d6;
    border-radius: 14px 14px 14px 4px;
}

.message.user {
    border-radius: 14px 14px 4px 14px;
    background: linear-gradient(135deg, #e93020, #ff7a18);
    box-shadow: 0 12px 24px rgba(238, 63, 35, .20);
}

.service-composer {
    border-top-color: #f0e2d7;
}

.service-composer input[type="text"] {
    border-radius: 999px;
    background: #fffaf6;
}

.service-composer .primary {
    width: 58px;
}

.icon-button {
    border-color: #efd8ca;
    border-radius: 10px;
    color: #b83222;
}

.call-button {
    color: #b83222;
}

@media (min-width: 720px) {
    html,
    body {
        background: #eef1f5;
    }

    .view {
        padding-left: 0;
        padding-right: 0;
    }
}

@media (max-width: 390px) {
    .view {
        padding-left: 10px;
        padding-right: 10px;
    }

    .hero,
    .loan-banner {
        margin-left: -10px;
        margin-right: -10px;
    }

    .hero h1,
    .hero p,
    .loan-banner p {
        max-width: 100%;
    }

    .action-card {
        min-height: 124px;
        padding: 14px;
    }

    .action-card i {
        width: 40px;
        height: 40px;
    }
}
