/* 澜境 / Sapphire. Presentation only; activated by the existing UI theme setting. */
html[data-ui-theme="sapphire"] {
    --sapphire-paper: #f4f7fc;
    --sapphire-bg: #f4f7fc;
    --sapphire-surface: #ffffff;
    --sapphire-ink: #203650;
    --sapphire-muted: #788ba4;
    --sapphire-primary: #163d70;
    --sapphire-primary-light: #eaf1fb;
    --sapphire-accent: #9eb7d5;
    --sapphire-line: #e2e9f3;
    --sapphire-border: #e2e9f3;
    --sapphire-danger: #b05e58;
    --sapphire-radius: 18px;
    color-scheme: light;
    background: #e6edf5;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

html[data-ui-theme="sapphire"] body {
    width: 100%;
    max-width: 600px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    background: var(--sapphire-paper);
    color: var(--sapphire-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    box-shadow: 0 0 80px rgba(27, 40, 56, .06);
    -webkit-tap-highlight-color: transparent;
}

html[data-ui-theme="sapphire"] :is(button, input, select, textarea) {
    font-family: inherit;
}

html[data-ui-theme="sapphire"] :is(a, button, [role="button"], [role="checkbox"], input):focus-visible {
    outline: 2px solid var(--sapphire-accent);
    outline-offset: 4px;
}

html[data-ui-theme="sapphire"] :is(button:disabled, input:disabled) {
    opacity: .55;
    cursor: not-allowed;
}

/* A quiet masthead with fine architectural lines. */
html[data-ui-theme="sapphire"] :is(.hero, .login-hero, .profile-hero, .info-hero) {
    background: #163d70;
    background-image: radial-gradient(ellipse at 100% 0, rgba(103, 139, 183, .17), transparent 65%);
    color: #f3f6f9;
    padding: 30px 26px 36px;
    border-radius: 0 0 28px 28px;
    isolation: isolate;
}

html[data-ui-theme="sapphire"] :is(.hero, .login-hero, .profile-hero, .info-hero)::before {
    width: 280px;
    height: 280px;
    top: -72px;
    right: -126px;
    background: none;
    border: 1px solid rgba(181, 199, 220, .18);
    box-shadow: 0 0 0 32px rgba(181, 199, 220, .035), 0 0 0 64px rgba(181, 199, 220, .025);
    pointer-events: none;
    z-index: -1;
}

html[data-ui-theme="sapphire"] .hero-top {
    margin-bottom: 38px;
    gap: 20px;
}

html[data-ui-theme="sapphire"] .hero-brand {
    gap: 11px;
    min-width: 0;
}

html[data-ui-theme="sapphire"] .hero-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #dae3ee;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
    flex-shrink: 0;
}

html[data-ui-theme="sapphire"] .hero-brand-icon svg {
    color: var(--sapphire-primary);
    stroke-width: 1.7;
}

html[data-ui-theme="sapphire"] .hero-brand span {
    color: #eef2f7;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    overflow-wrap: anywhere;
}

html[data-ui-theme="sapphire"] .hero-bell {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(217, 226, 238, .2);
    border-radius: 12px;
    background: rgba(255, 255, 255, .035);
    flex-shrink: 0;
}

html[data-ui-theme="sapphire"] .hero-center {
    text-align: left;
}

html[data-ui-theme="sapphire"] .hero-label {
    color: #cbd4df;
    opacity: 1;
    font-size: 12px;
    letter-spacing: 1px;
    margin-bottom: 7px;
}

html[data-ui-theme="sapphire"] .hero-amount {
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: clamp(36px, 11.5vw, 52px);
    font-weight: 500;
    line-height: 1.22;
    letter-spacing: -1.8px;
    font-variant-numeric: tabular-nums;
    color: #ecf1f7;
    text-shadow: none;
    margin: 6px 0 13px;
    overflow-wrap: anywhere;
}

html[data-ui-theme="sapphire"] .hero-hint {
    color: #b9c5d4;
    opacity: 1;
    font-size: 12px;
    letter-spacing: .15px;
}

html[data-ui-theme="sapphire"] .hero-center .hero-name {
    font-size: 19px;
    font-weight: 500;
    letter-spacing: .5px;
    margin-bottom: 8px;
}

html[data-ui-theme="sapphire"] .hero-status {
    display: inline-flex;
    padding: 3px 10px;
    margin-bottom: 11px;
    border: 1px solid rgba(206, 218, 233, .24);
    border-radius: 6px;
    background: rgba(255, 255, 255, .055);
    color: #cfd8e2;
    font-size: 11px;
    opacity: 1;
}

html[data-ui-theme="sapphire"] .hero.is-overdue {
    background: #102b52;
    background-image: radial-gradient(ellipse at 100% 0, rgba(199, 142, 106, .18), transparent 70%);
}

html[data-ui-theme="sapphire"] .hero.is-overdue .hero-status {
    color: #eed2ce;
    border-color: rgba(203, 216, 231, .3);
}

html[data-ui-theme="sapphire"] .hero.is-overdue .hero-hint {
    color: #d9bcc1;
}

html[data-ui-theme="sapphire"] .hero.is-settled {
    background-color: #153659;
}

/* Core actions retain their original handlers and enabled/disabled states. */
html[data-ui-theme="sapphire"] :is(.repay-action, .action-area) {
    padding: 22px 20px 0;
    margin-top: 0;
    margin-bottom: 20px;
}

html[data-ui-theme="sapphire"] :is(.repay-btn, .login-btn, .clear-btn, .btn-primary) {
    min-height: 52px;
    background: var(--sapphire-primary);
    color: #f2f5f9;
    border: 1px solid var(--sapphire-primary);
    border-radius: 14px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 1px;
    box-shadow: 0 5px 12px rgba(27, 41, 58, .09);
    transition: background-color .2s, box-shadow .2s, transform .15s;
}

html[data-ui-theme="sapphire"] :is(.repay-btn.settled, .clear-btn) {
    background: #234e7d;
    border-color: #234e7d;
    box-shadow: 0 5px 12px rgba(36, 54, 77, .09);
}

/* The settled-state script writes an inline background; keep its action intact. */
html[data-ui-theme="sapphire"][data-ui-page="repayment"] #main-action[style*="background"] {
    background: #234e7d !important;
    border-color: #234e7d;
}

html[data-ui-theme="sapphire"] :is(.btn-secondary, .btn-upload-select, .btn-upload-submit, .btn-period-repay) {
    background: var(--sapphire-primary-light);
    color: var(--sapphire-primary);
    border: 1px solid #d0d8e2;
    border-radius: 11px;
    min-height: 42px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

/* Shared cards, labels, and fine dividers. */
html[data-ui-theme="sapphire"] :is(.card, .asset-card, .service-card, .settled-box) {
    margin: 20px;
    padding: 22px;
    background: var(--sapphire-surface);
    border: 1px solid var(--sapphire-line);
    border-radius: var(--sapphire-radius);
    box-shadow: 0 3px 14px rgba(30, 45, 63, .025);
}

html[data-ui-theme="sapphire"] :is(.card-title, .card-header-title, .card-title-bar, .asset-title, .service-title) {
    color: var(--sapphire-ink);
    font-size: 15px;
    font-weight: 650;
    letter-spacing: .4px;
    line-height: 1.5;
}

html[data-ui-theme="sapphire"] .card-header {
    margin-bottom: 18px;
    gap: 12px;
}

html[data-ui-theme="sapphire"] .card-link {
    color: #4c617b;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

html[data-ui-theme="sapphire"] .card-title-bar {
    margin-bottom: 17px;
}

html[data-ui-theme="sapphire"] .card-title-bar::before {
    width: 3px;
    height: 14px;
    background: var(--sapphire-accent);
    margin-right: 9px;
}

html[data-ui-theme="sapphire"] .impact-grid {
    gap: 10px;
}

html[data-ui-theme="sapphire"] .impact-item {
    padding: 12px 9px;
    gap: 9px;
    border: 1px solid #e3eaf3;
    background: #f3f6fa;
    border-radius: 13px;
    min-width: 0;
}

html[data-ui-theme="sapphire"] .impact-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
}

html[data-ui-theme="sapphire"] .impact-icon.red {
    background: #fbefec;
    color: #a56257;
}

html[data-ui-theme="sapphire"] .impact-icon.orange {
    background: #e0e8f1;
    color: #5b7595;
}

html[data-ui-theme="sapphire"] .impact-icon.blue {
    background: #e3eaf2;
    color: #4a5f78;
}

html[data-ui-theme="sapphire"] .impact-icon.yellow {
    background: #dce5ef;
    color: #546c89;
}

html[data-ui-theme="sapphire"] .impact-icon svg {
    width: 17px;
    height: 17px;
    stroke-width: 1.7;
}

html[data-ui-theme="sapphire"] .impact-name {
    color: #243f61;
    font-size: 12px;
    font-weight: 600;
}

html[data-ui-theme="sapphire"] .impact-desc {
    color: #617c9e;
    font-size: 10px;
    margin-top: 3px;
}

html[data-ui-theme="sapphire"] .coop-subtitle {
    color: var(--sapphire-muted);
    gap: 10px;
    font-size: 10px;
    flex-wrap: wrap;
    margin: 10px 0 20px;
}

html[data-ui-theme="sapphire"] .bank-grid {
    row-gap: 19px;
    column-gap: 8px;
}

html[data-ui-theme="sapphire"] .bank-logo {
    width: 46px;
    height: 46px;
    background: #fff;
    border: 1px solid #e5ecf4;
    border-radius: 13px;
    padding: 9px;
    margin-bottom: 7px;
}

html[data-ui-theme="sapphire"] .bank-name {
    font-size: 10px;
    color: #5c7695;
}

html[data-ui-theme="sapphire"] .repay-viewport {
    background: #f0f4f8;
    border: 1px solid #dfe7f1;
    padding: 7px 10px;
    border-radius: 13px;
}

html[data-ui-theme="sapphire"] .repay-row {
    gap: 3px;
    font-size: 11px;
    border-bottom: 1px solid #dfe7f1;
    font-variant-numeric: tabular-nums;
}

html[data-ui-theme="sapphire"] .repay-phone {
    color: #2c4d76;
    flex-basis: 80px;
    font-weight: 600;
}

html[data-ui-theme="sapphire"] .repay-status {
    color: #5b7595;
    flex-basis: 46px;
    font-weight: 400;
}

html[data-ui-theme="sapphire"] .repay-amount {
    color: #516884;
    flex-basis: 50px;
    font-weight: 600;
}

html[data-ui-theme="sapphire"] .repay-date {
    color: #6a84a3;
    font-size: 10px;
}

/* User dashboard shortcuts. */
html[data-ui-theme="sapphire"] .marquee {
    margin: 0 20px 20px;
    padding: 11px 14px;
    background: #dfe7f1;
    color: #536b88;
    border: 1px solid #d4dce5;
    border-radius: 12px;
    box-shadow: none;
    font-size: 12px;
}

html[data-ui-theme="sapphire"] .menu-grid {
    margin: 0 20px 20px;
    padding: 8px;
    gap: 2px;
    border: 1px solid var(--sapphire-line);
    background: #fff;
    border-radius: var(--sapphire-radius);
}

html[data-ui-theme="sapphire"] .menu-item {
    padding: 16px 4px;
    background: transparent;
    box-shadow: none;
    border-radius: 12px;
}

html[data-ui-theme="sapphire"] .menu-icon-box {
    width: 42px;
    height: 42px;
    margin-bottom: 10px;
    border-radius: 13px;
}

html[data-ui-theme="sapphire"] :is(.menu-icon-box, .service-icon):is(.blue, .indigo, .green, .pink) {
    background: #e6ecf4;
    color: #405269;
}

html[data-ui-theme="sapphire"] :is(.menu-icon-box, .service-icon).amber {
    background: #e1e8f1;
    color: #546c89;
}

html[data-ui-theme="sapphire"] .menu-icon-box.red {
    background: #fbefec;
    color: #a56257;
}

html[data-ui-theme="sapphire"] :is(.menu-icon-box, .service-icon) svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.65;
}

html[data-ui-theme="sapphire"] :is(.menu-label, .service-label) {
    color: #43556d;
    font-size: 12px;
    font-weight: 500;
}

html[data-ui-theme="sapphire"] .floating-cs-btn {
    right: max(18px, calc((100vw - 600px) / 2 + 18px));
    bottom: calc(103px + env(safe-area-inset-bottom, 0px));
    width: 50px;
    height: 56px;
    border: 1px solid rgba(197, 210, 227, .25);
    border-radius: 17px;
    background: var(--sapphire-primary);
    box-shadow: 0 5px 18px rgba(23, 35, 49, .17);
    animation: none;
}

html[data-ui-theme="sapphire"] :is(.floating-cs-badge, .nav-badge) {
    background: #b25c59;
    border: 2px solid #fff;
    min-width: 19px;
    height: 19px;
    line-height: 15px;
    font-size: 9px;
    box-shadow: none;
}

/* Login, including both existing identity and SMS branches. */
html[data-ui-theme="sapphire"] .login-hero {
    padding: 52px 30px 76px;
    text-align: left;
    border-radius: 0 0 32px 32px;
}

html[data-ui-theme="sapphire"] .login-hero::after {
    background: none;
    width: 100px;
    height: 1px;
    bottom: 37px;
    left: 30px;
    border-radius: 0;
    background: rgba(143, 170, 202, .5);
    pointer-events: none;
}

html[data-ui-theme="sapphire"] .login-hero .hero-icon {
    width: 58px;
    height: 58px;
    margin: 0 0 24px;
    border: 1px solid rgba(192, 207, 226, .35);
    border-radius: 18px;
    background: rgba(219, 228, 239, .09);
    backdrop-filter: none;
}

html[data-ui-theme="sapphire"] .login-hero .hero-icon svg {
    width: 28px;
    height: 28px;
    stroke: #c0cbd9;
    stroke-width: 1.5;
}

html[data-ui-theme="sapphire"] .login-hero .hero-name {
    font-size: 27px;
    font-weight: 550;
    letter-spacing: 2px;
    margin-bottom: 9px;
    overflow-wrap: anywhere;
}

html[data-ui-theme="sapphire"] .hero-slogan {
    color: #b2bfd0;
    opacity: 1;
    font-size: 12px;
    letter-spacing: 3px;
}

html[data-ui-theme="sapphire"] .form-card {
    margin: -24px 20px 0;
    padding: 32px 23px 27px;
    border: 1px solid #d8e1ed;
    border-radius: 22px;
    box-shadow: 0 8px 30px rgba(29, 43, 61, .045);
}

html[data-ui-theme="sapphire"] .input-group {
    height: 56px;
    margin-bottom: 18px;
    padding: 0 15px;
    border: 1px solid #d7e1ed;
    border-radius: 12px;
    background: #f2f5f9;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}

html[data-ui-theme="sapphire"] .input-group:focus-within {
    border-color: #7089a8;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(64, 97, 137, .09);
}

html[data-ui-theme="sapphire"] .input-icon {
    color: #6681a2;
    margin-right: 12px;
}

html[data-ui-theme="sapphire"] .input-icon svg {
    stroke-width: 1.6;
}

html[data-ui-theme="sapphire"] .input-group input {
    color: #213b5a;
    font-size: 15px;
    letter-spacing: .3px;
    line-height: 1.5;
}

html[data-ui-theme="sapphire"] .input-group input::placeholder {
    color: #7f96b1;
    font-size: 13px;
}

html[data-ui-theme="sapphire"] .code-row {
    gap: 9px;
    margin-bottom: 18px;
}

html[data-ui-theme="sapphire"] .code-btn {
    height: 56px;
    padding: 0 13px;
    border: 1px solid #c3cedb;
    border-radius: 12px;
    background: #e6ecf4;
    color: #2b4b73;
    font-size: 12px;
}

html[data-ui-theme="sapphire"] .code-btn:disabled {
    border-color: #ced7e1;
    color: #6d86a5;
}

html[data-ui-theme="sapphire"] .agree-row {
    margin: 23px 0 25px;
    align-items: flex-start;
    gap: 9px;
    color: #6a84a4;
    font-size: 11px;
    line-height: 1.9;
}

html[data-ui-theme="sapphire"] .agree-check {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    border: 1px solid #b0becf;
    border-radius: 5px;
    color: #fff;
    font-size: 10px;
}

html[data-ui-theme="sapphire"] .agree-check.checked {
    border-color: var(--sapphire-primary);
    background: var(--sapphire-primary);
}

html[data-ui-theme="sapphire"] .agree-row a {
    color: #475b74;
}

html[data-ui-theme="sapphire"] .login-btn {
    height: 54px;
    letter-spacing: 2px;
}

html[data-ui-theme="sapphire"] [data-identity-status]:not([hidden]) {
    border-top: 1px solid #e3eaf2;
    padding-top: 13px;
}

html[data-ui-theme="sapphire"] .footer-info {
    margin-top: 30px;
    padding-bottom: 24px;
}

html[data-ui-theme="sapphire"] .footer-info .secure {
    color: #7890ad;
    font-size: 11px;
    gap: 6px;
    letter-spacing: .5px;
}

/* Repayment summary, tabs, installments, and receipt states. */
html[data-ui-theme="sapphire"] .hero > .hero-title {
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 1px;
}

html[data-ui-theme="sapphire"] .hero-total-box {
    margin-top: 26px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    text-align: left;
}

html[data-ui-theme="sapphire"] .hero-total-label {
    color: #b0becf;
    font-size: 12px;
    letter-spacing: 1px;
}

html[data-ui-theme="sapphire"] .hero-total-amount {
    margin-top: 7px;
    color: #e8eef5;
    font-size: clamp(34px, 10.4vw, 46px);
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -1px;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

html[data-ui-theme="sapphire"] body:has(> .hero > .hero-total-box) > div[style*="padding:16px 16px 0"] {
    padding: 20px 20px 0 !important;
}

html[data-ui-theme="sapphire"] body:has(> .hero > .hero-total-box) > div[style*="padding:0 16px"] {
    padding: 0 20px !important;
}

html[data-ui-theme="sapphire"] .contract-btn {
    min-height: 82px;
    padding: 17px 19px;
    border: 1px solid var(--sapphire-line);
    border-radius: 18px;
    box-shadow: 0 3px 14px rgba(30, 45, 63, .025);
    background: #fff;
}

html[data-ui-theme="sapphire"] .contract-icon {
    width: 42px;
    height: 46px;
    border-radius: 12px;
    background: #e4ebf3;
}

html[data-ui-theme="sapphire"] .contract-icon svg {
    stroke: #57708f;
    stroke-width: 1.7;
}

html[data-ui-theme="sapphire"] .contract-text p {
    color: var(--sapphire-ink);
    font-size: 14px;
    font-weight: 600;
}

html[data-ui-theme="sapphire"] .contract-text span {
    color: #778eab;
    font-size: 11px;
}

html[data-ui-theme="sapphire"] .info-list .info-row {
    padding: 13px 0;
    border-bottom-color: #e5ebf3;
    gap: 16px;
    font-size: 13px;
    line-height: 1.6;
}

html[data-ui-theme="sapphire"] .info-label {
    color: #6681a2;
}

html[data-ui-theme="sapphire"] .info-val {
    color: #264265;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
    min-width: 0;
}

html[data-ui-theme="sapphire"] .info-val.blue {
    color: #475b74;
}

html[data-ui-theme="sapphire"] .info-val.red {
    color: var(--sapphire-danger);
}

html[data-ui-theme="sapphire"] .info-val.orange {
    color: #8d754d;
}

html[data-ui-theme="sapphire"] .total-row {
    margin-top: 7px;
    padding-top: 17px;
    border-top-color: #d4dce5;
    font-size: 14px;
    gap: 12px;
}

html[data-ui-theme="sapphire"] .tab-bar {
    padding: 5px;
    border: 1px solid #d7dee6;
    border-radius: 13px;
    background: #dde6f0;
    box-shadow: none;
}

html[data-ui-theme="sapphire"] .tab-item {
    min-height: 43px;
    border-radius: 9px;
    padding: 10px 5px;
    color: #5c7695;
    font-size: 12px;
    font-weight: 500;
}

html[data-ui-theme="sapphire"] .tab-item.active {
    background: #fff;
    color: #27466b;
    box-shadow: 0 2px 5px rgba(37, 55, 78, .06);
}

html[data-ui-theme="sapphire"] .period-card {
    margin-bottom: 14px;
    padding: 20px 20px 68px;
    border: 1px solid #d6e0ed;
    border-left: 3px solid #6580a0;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(37, 55, 78, .025);
}

html[data-ui-theme="sapphire"] .period-card.overdue {
    border-left-color: #b67d71;
}

html[data-ui-theme="sapphire"] .period-card.paid {
    padding-bottom: 19px;
    border-left-color: #5c7797;
}

html[data-ui-theme="sapphire"] .period-header {
    margin-bottom: 13px;
    padding-bottom: 13px;
    border-bottom: 1px solid #e3eaf3;
    gap: 10px;
}

html[data-ui-theme="sapphire"] .period-num {
    color: #264265;
    font-size: 14px;
    font-weight: 600;
}

html[data-ui-theme="sapphire"] .period-tag {
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 10px;
    white-space: nowrap;
    font-weight: 500;
}

html[data-ui-theme="sapphire"] .tag-waiting {
    background: #e3eaf2;
    color: #5b7595;
}

html[data-ui-theme="sapphire"] .tag-overdue {
    background: #fbefec;
    color: #a56257;
}

html[data-ui-theme="sapphire"] .tag-paid {
    background: #e3eaf3;
    color: #516885;
}

html[data-ui-theme="sapphire"] .tag-partial {
    background: #f8f4e9;
    color: #8d754d;
}

html[data-ui-theme="sapphire"] .period-row {
    gap: 12px;
    margin-bottom: 8px;
    color: #6883a3;
    font-size: 12px;
}

html[data-ui-theme="sapphire"] .period-row .val {
    color: #2b4b73;
    font-weight: 500;
    text-align: right;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

html[data-ui-theme="sapphire"] .period-action {
    bottom: 15px;
    right: 19px;
    left: 19px;
}

html[data-ui-theme="sapphire"] .btn-period-repay {
    min-height: 35px;
    padding: 7px 15px;
    border-radius: 9px;
    font-size: 11px;
}

html[data-ui-theme="sapphire"] .period-card.overdue .btn-period-repay {
    background: #fbf1ed;
    color: #a56257;
    border-color: #ecd8d2;
}

html[data-ui-theme="sapphire"] .upload-actions {
    gap: 10px;
}

html[data-ui-theme="sapphire"] .btn-upload-select {
    border-style: dashed;
    min-height: 48px;
}

html[data-ui-theme="sapphire"] .btn-upload-submit {
    background: #2b5a8d;
    border-color: #2b5a8d;
    color: #fff;
}

html[data-ui-theme="sapphire"] .progress-bar-wrap {
    background: #dde6f0;
    border-radius: 7px;
    height: 16px;
}

html[data-ui-theme="sapphire"] .progress-fill {
    background: #4a5f79;
    font-weight: 500;
    font-size: 10px;
}

html[data-ui-theme="sapphire"] .upload-result {
    color: #607b9d;
    font-size: 12px;
    overflow-wrap: anywhere;
}

html[data-ui-theme="sapphire"] .preview-box img {
    border-radius: 10px !important;
    border-color: #d6dde6 !important;
}

html[data-ui-theme="sapphire"] .settled-box {
    padding: 34px 24px;
}

html[data-ui-theme="sapphire"] .settled-icon {
    width: 70px;
    height: 70px;
    background: #e5ebf3;
    color: #4f6682;
    border: 1px solid #d2dae4;
}

html[data-ui-theme="sapphire"] .settled-icon svg {
    width: 36px;
    height: 36px;
    stroke-width: 1.5;
}

html[data-ui-theme="sapphire"] .settled-title {
    color: #42556c;
    font-size: 22px;
    font-weight: 550;
    letter-spacing: 1px;
}

html[data-ui-theme="sapphire"] .settled-desc {
    color: #6883a3;
    font-size: 12px;
    margin-bottom: 24px;
}

/* Profile and identity details. */
html[data-ui-theme="sapphire"] .profile-hero {
    padding: 42px 26px 48px;
}

html[data-ui-theme="sapphire"] .avatar {
    width: 58px;
    height: 58px;
    margin-right: 16px;
    border-radius: 18px;
    background: #d6e0ed;
    border: 1px solid rgba(228, 235, 243, .45);
}

html[data-ui-theme="sapphire"] .avatar svg {
    color: #405269;
    stroke-width: 1.6;
}

html[data-ui-theme="sapphire"] .user-name {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 1px;
    overflow-wrap: anywhere;
}

html[data-ui-theme="sapphire"] .user-phone {
    color: #aebcce;
    font-size: 12px;
    margin-top: 5px;
    letter-spacing: 1px;
}

html[data-ui-theme="sapphire"] .asset-card {
    margin-top: -22px;
    position: relative;
}

html[data-ui-theme="sapphire"] .asset-title {
    margin-bottom: 21px;
}

html[data-ui-theme="sapphire"] .asset-item {
    text-align: left;
    padding-left: 0;
    min-width: 0;
}

html[data-ui-theme="sapphire"] .asset-item:first-child {
    border-right-color: #dce5ef;
    padding-right: 15px;
}

html[data-ui-theme="sapphire"] .asset-item + .asset-item {
    padding-left: 22px;
}

html[data-ui-theme="sapphire"] .asset-value {
    color: #42546b;
    font-size: 25px;
    font-weight: 500;
    letter-spacing: -.6px;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

html[data-ui-theme="sapphire"] .asset-value.blue {
    color: #223c5c;
}

html[data-ui-theme="sapphire"] .asset-value.green {
    color: #526a87;
}

html[data-ui-theme="sapphire"] .asset-label {
    font-size: 11px;
    color: #7089a7;
    margin-top: 5px;
}

html[data-ui-theme="sapphire"] .service-grid {
    gap: 14px 9px;
}

html[data-ui-theme="sapphire"] .service-item {
    padding: 15px 0 10px;
    border-radius: 12px;
}

html[data-ui-theme="sapphire"] .service-icon {
    width: 45px;
    height: 45px;
    margin-bottom: 11px;
    border-radius: 14px;
}

html[data-ui-theme="sapphire"] .service-item[onclick="logout()"] .service-icon {
    background: #e4ebf3;
    color: #5d7898;
}

html[data-ui-theme="sapphire"] .info-hero {
    padding: 27px 26px 32px;
}

html[data-ui-theme="sapphire"] .back-btn {
    width: 35px;
    height: 35px;
    margin-bottom: 22px;
    border-radius: 11px;
    border: 1px solid rgba(215, 225, 237, .2);
    justify-content: center;
    background: rgba(255, 255, 255, .035);
}

html[data-ui-theme="sapphire"] .hero-icon-box {
    width: 48px;
    height: 52px;
    background: rgba(202, 215, 230, .12);
    border: 1px solid rgba(211, 222, 235, .18);
    border-radius: 14px;
    margin-right: 15px;
}

html[data-ui-theme="sapphire"] .hero-title {
    color: #e6ecf4;
    font-weight: 500;
    letter-spacing: 1px;
}

html[data-ui-theme="sapphire"] .hero-subtitle {
    color: #b8c5d4;
    font-size: 11px;
    letter-spacing: .5px;
    margin-top: 5px;
}

html[data-ui-theme="sapphire"] body:has(> .info-hero) .card {
    padding: 0;
    overflow: hidden;
}

html[data-ui-theme="sapphire"] body:has(> .info-hero) .card-header {
    padding: 18px 20px;
    margin: 0;
    border-bottom-color: #e3eaf3;
    gap: 9px;
}

html[data-ui-theme="sapphire"] body:has(> .info-hero) .card-header svg {
    stroke: #607b9d;
    stroke-width: 1.65;
}

html[data-ui-theme="sapphire"] body:has(> .info-hero) .info-row {
    padding: 15px 20px;
    gap: 18px;
    align-items: flex-start;
    border-bottom-color: #e7edf4;
}

html[data-ui-theme="sapphire"] body:has(> .info-hero) .info-label {
    font-size: 12px;
    flex-shrink: 0;
}

html[data-ui-theme="sapphire"] .info-value {
    color: #2d507b;
    font-size: 13px;
    font-weight: 500;
    text-align: right;
    min-width: 0;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

html[data-ui-theme="sapphire"] .cert-row {
    padding: 18px 20px;
    gap: 12px;
    border-bottom-color: #e7edf4;
}

html[data-ui-theme="sapphire"] .cert-left {
    gap: 12px;
    min-width: 0;
}

html[data-ui-theme="sapphire"] .cert-icon {
    width: 38px;
    height: 42px;
    background: #e8edf4;
    border-radius: 11px;
}

html[data-ui-theme="sapphire"] .cert-icon svg {
    stroke: #6681a2;
    stroke-width: 1.6;
}

html[data-ui-theme="sapphire"] .cert-row > svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: #576f8d;
    stroke-width: 1.7;
}

html[data-ui-theme="sapphire"] .cert-name {
    color: #2b4c74;
    font-size: 13px;
    font-weight: 550;
}

html[data-ui-theme="sapphire"] .cert-desc {
    color: #758daa;
    font-size: 10px;
    margin-top: 4px;
    line-height: 1.7;
}

html[data-ui-theme="sapphire"] .status-row {
    padding: 20px;
    gap: 9px;
    color: #536a87;
    font-size: 13px;
    font-weight: 500;
    background: #f1f5f9;
}

/* The navigation remains fixed and within the same centered app frame. */
html[data-ui-theme="sapphire"] .bottom-nav {
    width: 100%;
    max-width: 600px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    height: calc(72px + env(safe-area-inset-bottom, 0px));
    padding: 5px 14px calc(5px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #d8e1ed;
    background: rgba(249, 251, 253, .96);
    box-shadow: 0 -7px 22px rgba(37, 55, 78, .035);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

html[data-ui-theme="sapphire"] .nav-item {
    position: relative;
    gap: 3px;
    color: #7990ad;
    border-radius: 12px;
    padding: 6px 0;
    line-height: 1.5;
    transition: color .2s, background-color .2s;
}

html[data-ui-theme="sapphire"] .nav-item.active {
    color: #243f60;
    background: linear-gradient(180deg, #e3eaf3, rgba(227, 234, 243, 0));
}

html[data-ui-theme="sapphire"] .nav-item.active::before {
    content: "";
    position: absolute;
    top: -5px;
    width: 18px;
    height: 2px;
    border-radius: 3px;
    background: #617c9d;
}

html[data-ui-theme="sapphire"] .nav-item svg {
    width: 21px;
    height: 21px;
    margin-bottom: 0;
    stroke-width: 1.7;
}

html[data-ui-theme="sapphire"] .nav-label {
    font-size: 10px;
    letter-spacing: 1px;
    font-weight: 500;
}

html[data-ui-theme="sapphire"] .nav-badge {
    top: 4px;
}

html[data-ui-theme="sapphire"] .footer-safe {
    padding: 10px 20px 26px;
}

html[data-ui-theme="sapphire"] .footer-safe span {
    color: #7d94b0;
    font-size: 10px;
    letter-spacing: .4px;
    gap: 6px;
}

html[data-ui-theme="sapphire"] .version {
    color: #879cb6;
    font-size: 10px;
    letter-spacing: 2px;
    margin-top: 28px;
}

html[data-ui-theme="sapphire"] :is(.toast, .light-tip) {
    max-width: calc(100vw - 40px);
    padding: 13px 23px;
    background: rgba(27, 41, 58, .94);
    color: #eaeff5;
    border: 1px solid rgba(209, 220, 234, .15);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(21, 32, 46, .16);
    font-size: 13px;
    white-space: normal;
    text-align: center;
    line-height: 1.7;
}

/* Sapphire composition: structured navy panels and silver architectural bands. */
html[data-ui-theme="sapphire"][data-ui-page="home"] body,
html[data-ui-theme="sapphire"][data-ui-page="user"] body {
    display: flow-root;
}

html[data-ui-theme="sapphire"] :is(.hero, .login-hero, .profile-hero, .info-hero) {
    background: #102b52;
    background-image: linear-gradient(118deg, #102b52 30%, #143761 100%);
    border-bottom: 1px solid #ccdbee50;
    border-radius: 0 0 18px 18px;
}

html[data-ui-theme="sapphire"] :is(.hero, .login-hero, .profile-hero, .info-hero)::before {
    content: "";
    position: absolute;
    width: 145px;
    height: 480px;
    top: -170px;
    right: -48px;
    border: 0;
    border-left: 1px solid #b7cbe63b;
    border-right: 1px solid #b7cbe625;
    border-radius: 0;
    background: linear-gradient(90deg, #c8d9ed09, #dce7f713);
    box-shadow: -30px 0 0 #bdd1eb04, 30px 0 0 #bdd1eb03;
    transform: rotate(27deg);
    z-index: -1;
}

html[data-ui-theme="sapphire"][data-ui-page="home"] .hero,
html[data-ui-theme="sapphire"][data-ui-page="user"] .hero {
    margin: 18px 18px 0;
    padding: 26px 24px 30px;
    border: 1px solid #24466b;
    border-radius: 20px;
    box-shadow: 0 12px 28px #102b5212;
}

html[data-ui-theme="sapphire"] .hero-top {
    margin-bottom: 32px;
    padding-bottom: 18px;
    border-bottom: 1px solid #b9cde226;
}

html[data-ui-theme="sapphire"] .hero-brand-icon {
    background: #f2f6fc;
    border-radius: 10px;
}

html[data-ui-theme="sapphire"] .hero-brand span {
    font-size: 15px;
    letter-spacing: 1.2px;
}

html[data-ui-theme="sapphire"] .hero-label {
    color: #b5c9e2;
    font-size: 11px;
    letter-spacing: 1.5px;
}

html[data-ui-theme="sapphire"] .hero-amount {
    font-size: clamp(36px, 11.4vw, 52px);
    font-weight: 550;
    letter-spacing: -1.5px;
    line-height: 1.25;
}

html[data-ui-theme="sapphire"] .hero-hint {
    color: #bacbe1;
    font-size: 11px;
}

html[data-ui-theme="sapphire"] .hero-status {
    padding: 4px 10px;
    background: #d3e1f00b;
    border-color: #b3cbe347;
    color: #d8e6f5;
}

html[data-ui-theme="sapphire"] .hero.is-overdue {
    background: linear-gradient(118deg, #102b52 30%, #17385e 100%);
}

html[data-ui-theme="sapphire"] .hero.is-overdue .hero-status {
    background: #e5bdbb0c;
    color: #efd4cf;
    border-color: #e3b9b64f;
}

html[data-ui-theme="sapphire"] .hero.is-overdue .hero-hint {
    color: #bacbe1;
}

html[data-ui-theme="sapphire"] .hero.is-settled {
    background: linear-gradient(118deg, #102b52 30%, #193f63 100%);
}

html[data-ui-theme="sapphire"] :is(.repay-action, .action-area) {
    padding: 20px 18px 0;
}

html[data-ui-theme="sapphire"] :is(.repay-btn, .login-btn, .clear-btn, .btn-primary) {
    border-radius: 12px;
    background: #234f83;
    border-color: #234f83;
    box-shadow: 0 5px 12px #1c447f14, inset 0 1px 0 #ffffff14;
    font-weight: 550;
}

html[data-ui-theme="sapphire"] :is(.card, .asset-card, .service-card, .settled-box) {
    border-color: #e0e8f3;
    border-radius: 17px;
    box-shadow: 0 6px 20px #102b5205;
}

html[data-ui-theme="sapphire"] .card-title-bar::before {
    width: 3px;
    background: #6087b7;
}

html[data-ui-theme="sapphire"] .impact-item {
    background: #f7f9fc;
    border-color: #e8edf5;
    border-radius: 10px;
}

html[data-ui-theme="sapphire"] :is(.impact-icon.blue, .impact-icon.yellow) {
    background: #eaf0f8;
    color: #587ba6;
}

html[data-ui-theme="sapphire"] .impact-icon.orange {
    background: #eff2f8;
    color: #687f9c;
}

html[data-ui-theme="sapphire"] .bank-logo {
    background: #fbfcfe;
    border-color: #e7edf5;
    border-radius: 10px;
}

html[data-ui-theme="sapphire"] .repay-viewport {
    background: #f6f9fd;
    border-color: #e4ebf4;
    border-radius: 11px;
}

html[data-ui-theme="sapphire"] .repay-amount {
    color: #3a6496;
}

html[data-ui-theme="sapphire"] .marquee {
    color: #587599;
    background: #eaf1fa;
    border-color: #dce7f5;
    border-radius: 10px;
}

html[data-ui-theme="sapphire"] :is(.menu-icon-box, .service-icon):is(.blue, .indigo, .green, .pink, .amber) {
    color: #4c73a4;
    background: #edf3fb;
    border: 1px solid #e6edf8;
    border-radius: 12px;
}

html[data-ui-theme="sapphire"] .menu-grid {
    gap: 4px;
    padding: 9px;
    border-radius: 17px;
}

html[data-ui-theme="sapphire"] .floating-cs-btn {
    border: 1px solid #a1b8d654;
    border-radius: 13px;
    background: #163d70;
    box-shadow: 0 5px 18px #102b5224;
}

html[data-ui-theme="sapphire"] .login-hero {
    padding: 54px 30px 80px;
    border-radius: 0 0 18px 18px;
}

html[data-ui-theme="sapphire"] .login-hero::after {
    width: 52px;
    height: 2px;
    bottom: 40px;
    left: 30px;
    background: #9db8d9;
    border: 0;
}

html[data-ui-theme="sapphire"] .login-hero .hero-icon {
    width: 54px;
    height: 54px;
    border-radius: 13px;
    border-color: #c5d5ea50;
    background: #ffffff08;
}

html[data-ui-theme="sapphire"] .login-hero .hero-icon svg {
    stroke: #d4e1f2;
}

html[data-ui-theme="sapphire"] .login-hero .hero-name {
    color: #f8fbff;
    font-size: 28px;
    font-weight: 550;
    letter-spacing: 2px;
}

html[data-ui-theme="sapphire"] .hero-slogan {
    color: #adc3e0;
    font-size: 11px;
    letter-spacing: 4px;
}

html[data-ui-theme="sapphire"] .form-card {
    margin: -26px 20px 0;
    padding: 32px 24px 28px;
    border: 1px solid #dce5f2;
    border-radius: 18px;
    box-shadow: 0 10px 30px #153b6910;
}

html[data-ui-theme="sapphire"] .input-group {
    background: #f5f8fc;
    border-color: #dfe7f1;
    border-radius: 10px;
}

html[data-ui-theme="sapphire"] .input-group:focus-within {
    border-color: #7b9ec7;
    box-shadow: 0 0 0 3px #5b83b310;
}

html[data-ui-theme="sapphire"] .code-btn {
    background: #ecf2fa;
    border-color: #cfdded;
    color: #416b9f;
    border-radius: 10px;
}

html[data-ui-theme="sapphire"] .contract-btn {
    border-radius: 15px;
    border-color: #e0e8f3;
}

html[data-ui-theme="sapphire"] .tab-bar {
    border-radius: 11px;
    background: #e9f0f9;
    border-color: #dfe7f2;
}

html[data-ui-theme="sapphire"] .tab-item.active {
    color: #2a568b;
    border-radius: 8px;
    box-shadow: 0 2px 6px #1237680c;
}

html[data-ui-theme="sapphire"] .period-card {
    border-color: #e0e8f3;
    border-left-color: #86a7ce;
    border-radius: 14px;
}

html[data-ui-theme="sapphire"] .period-card.overdue {
    border-left-color: #bc8c84;
}

html[data-ui-theme="sapphire"] .period-card.paid {
    border-left-color: #829eb6;
}

html[data-ui-theme="sapphire"] .profile-hero {
    padding: 42px 26px 52px;
}

html[data-ui-theme="sapphire"] .avatar {
    background: #e8f0fa;
    border-radius: 15px;
    border-color: #c7d7e9;
}

html[data-ui-theme="sapphire"] .asset-card {
    margin-top: -26px;
    border-top: 2px solid #b2c9e3;
}

html[data-ui-theme="sapphire"] .asset-value,
html[data-ui-theme="sapphire"] .asset-value.blue {
    color: #294e7d;
    font-weight: 550;
}

html[data-ui-theme="sapphire"] .asset-value.green {
    color: #587ca5;
}

html[data-ui-theme="sapphire"] .service-icon {
    border-radius: 12px;
}

html[data-ui-theme="sapphire"] .info-hero {
    border-radius: 0 0 18px 18px;
}

html[data-ui-theme="sapphire"] .bottom-nav {
    border-top: 1px solid #dce5f2;
    background: #fcfdffed;
    box-shadow: 0 -5px 20px #153b6907;
}

html[data-ui-theme="sapphire"] .nav-item.active {
    color: #2b598e;
    background: #eaf1fa;
    border-radius: 10px;
}

html[data-ui-theme="sapphire"] .nav-item.active::before {
    top: -6px;
    width: 21px;
    background: #6d94c2;
}

@media (hover: hover) {
    html[data-ui-theme="sapphire"] :is(.repay-btn, .login-btn, .clear-btn, .btn-primary):not(:disabled):hover {
        background: #1b4c81;
        border-color: #1b4c81;
        box-shadow: 0 7px 18px rgba(27, 41, 58, .15);
    }
    html[data-ui-theme="sapphire"] :is(.menu-item, .service-item, .nav-item:not(.active)):hover {
        background: #ecf0f6;
        color: #264468;
    }
}

@media (min-width: 601px) {
    html[data-ui-theme="sapphire"] :is(.hero, .profile-hero, .info-hero) {
        padding-left: 34px;
        padding-right: 34px;
    }
    html[data-ui-theme="sapphire"] .hero-amount {
        font-size: 56px;
    }
    html[data-ui-theme="sapphire"] .login-hero {
        padding: 64px 44px 82px;
    }
    html[data-ui-theme="sapphire"] .login-hero::after {
        left: 44px;
    }
    html[data-ui-theme="sapphire"] .form-card {
        margin-left: 34px;
        margin-right: 34px;
        padding: 36px;
    }
}

@media (max-width: 359px) {
    html[data-ui-theme="sapphire"] :is(.card, .asset-card, .service-card) {
        margin-left: 14px;
        margin-right: 14px;
        padding: 17px;
    }
    html[data-ui-theme="sapphire"] :is(.repay-action, .action-area) {
        padding-left: 14px;
        padding-right: 14px;
    }
    html[data-ui-theme="sapphire"] .impact-item {
        gap: 6px;
        padding: 10px 6px;
    }
    html[data-ui-theme="sapphire"] .impact-icon {
        width: 27px;
        height: 30px;
    }
    html[data-ui-theme="sapphire"] .impact-name {
        font-size: 11px;
    }
    html[data-ui-theme="sapphire"] .impact-desc {
        font-size: 9px;
    }
    html[data-ui-theme="sapphire"] .repay-phone {
        flex-basis: 73px;
        font-size: 10px;
    }
    html[data-ui-theme="sapphire"] .repay-status {
        flex-basis: 40px;
        font-size: 10px;
    }
    html[data-ui-theme="sapphire"] .repay-amount {
        flex-basis: 45px;
        font-size: 10px;
    }
    html[data-ui-theme="sapphire"] .repay-date {
        font-size: 9px;
    }
    html[data-ui-theme="sapphire"] .form-card {
        margin-left: 14px;
        margin-right: 14px;
        padding: 26px 17px;
    }
    html[data-ui-theme="sapphire"] .code-btn {
        padding: 0 9px;
        font-size: 11px;
    }
    html[data-ui-theme="sapphire"] .asset-value {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html[data-ui-theme="sapphire"] *,
    html[data-ui-theme="sapphire"] *::before,
    html[data-ui-theme="sapphire"] *::after {
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    html[data-ui-theme="sapphire"] .repay-track {
        animation: none;
    }
    html[data-ui-theme="sapphire"] .repay-viewport {
        overflow-y: auto;
    }
    html[data-ui-theme="sapphire"] .marquee-inner {
        animation: none;
        white-space: normal;
    }
    html[data-ui-theme="sapphire"] .marquee-content {
        white-space: normal;
    }
}
