:root {
    font-family: Inter, "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
    color: #172033;
    background: #f5f6f8;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-height: 100%; height: auto; overflow-y: auto !important; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; min-height: 100svh; height: auto; overflow-x: hidden; overflow-y: auto !important; background: #f5f6f8; }
#storefront-root { min-height: 100vh; min-height: 100svh; height: auto; overflow: visible; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
img { display: block; max-width: 100%; }

.storefront { --primary: #16a34a; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 5%, white) 0, #f5f6f8 420px); }
.glass-surface { border: 1px solid rgb(255 255 255 / .72); background: rgb(255 255 255 / .76); box-shadow: 0 14px 36px rgb(15 23 42 / .08); backdrop-filter: blur(20px) saturate(135%); }
.site-header { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr); align-items: center; gap: 28px; min-height: 72px; padding: 10px 24px; padding: 10px max(24px, calc((100vw - 1320px) / 2)); border-bottom: 1px solid rgb(255 255 255 / .7); background: rgb(255 255 255 / .72); box-shadow: 0 6px 24px rgb(15 23 42 / .06); backdrop-filter: blur(22px) saturate(145%); }
.brand { display: inline-flex; align-items: center; gap: 11px; justify-self: start; min-width: 0; border: 0; background: transparent; color: #101828; font-size: 19px; font-weight: 850; }
.brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand img, .brand-mark { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 13px; -o-object-fit: cover; object-fit: cover; }
.brand-mark { display: grid; place-items: center; color: white; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #047857)); box-shadow: 0 7px 18px color-mix(in srgb, var(--primary) 24%, transparent); }
.desktop-nav { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: #f6f7f9; }
.desktop-nav button { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 10px; padding: 9px 14px; color: #667085; background: transparent; }
.desktop-nav button.active { color: var(--primary); background: white; font-weight: 750; box-shadow: 0 3px 10px rgb(15 23 42 / .08); }
.header-account { display: flex; align-items: center; justify-self: end; gap: 7px; }
.account-button { display: flex; align-items: center; gap: 9px; height: auto; padding: 5px 9px 5px 5px; border: 1px solid #eaecf0; border-radius: 14px; color: #344054; background: white; text-align: left; }
.account-button:hover, .account-button[data-hover="true"], .account-button[data-pressed="true"], .account-button:focus-visible { color: #344054; background: white !important; transform: none !important; }
.account-summary { display: grid; gap: 1px; }
.account-button strong { max-width: 110px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account-button small { color: var(--primary); font-size: 12px; font-weight: 750; }
.mini-avatar { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; overflow: hidden; border-radius: 11px; color: white; background: white; font-weight: 800; }
.mini-avatar img { width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; }
.logout { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 11px; color: #98a2b3; background: transparent; }
.logout:hover { color: #d92d20; background: #fef3f2; }
.mobile-nav { display: none; }

.site-main { width: min(1320px, calc(100% - 40px)); min-width: 0; margin: 26px auto 42px; flex: 1; overflow: visible; }
.site-main > * { animation: storefront-view-enter .22s ease-out both; }
@keyframes storefront-view-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .site-main > * { animation: none; } }
.site-banner { width: 100%; max-height: 360px; aspect-ratio: 4 / 1; -o-object-fit: cover; object-fit: cover; border-radius: 24px; margin-bottom: 18px; box-shadow: 0 18px 50px rgb(15 23 42 / .13); }
.site-banner-link { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.site-banner-link:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 24px; }
.banner-carousel { position: relative; margin-bottom: 18px; }
.banner-carousel .site-banner { display: block; margin-bottom: 0; }
.carousel-viewport { display: grid; isolation: isolate; }
.carousel-slide { grid-area: 1 / 1; min-width: 0; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .5s ease-in-out, visibility .5s; }
.carousel-slide.active { z-index: 1; opacity: 1; visibility: visible; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .carousel-slide { transition: none; } }
.banner-carousel .carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); min-width: 36px; width: 36px; height: 36px; border-radius: 50%; color: white; background: rgb(15 23 42 / .55); }
.carousel-previous { left: 12px; }
.carousel-next { right: 12px; }
.carousel-controls { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; max-width: calc(100% - 24px); padding: 3px 8px; border-radius: 30px; color: white; background: rgb(15 23 42 / .65); }
.carousel-dots { display: flex; overflow-x: auto; min-width: 0; }
.banner-carousel .carousel-dot { flex: 0 0 24px; min-width: 24px; width: 24px; height: 28px; padding: 0; background: transparent; }
.carousel-dot span { width: 6px; height: 6px; border-radius: 9px; background: rgb(255 255 255 / .5); }
.carousel-dot.active span { width: 16px; background: white; }
.carousel-count { flex-shrink: 0; font-size: 11px; font-variant-numeric: tabular-nums; }
.banner-carousel .carousel-play { flex-shrink: 0; min-width: 28px; width: 28px; height: 28px; color: white; background: transparent; }
.banner-carousel button:focus-visible { outline: 2px solid white; outline-offset: -3px; }
.announcement { position: relative; margin: 0 0 40px; padding: 14px 18px 14px 62px; border: 1px solid color-mix(in srgb, var(--primary) 22%, white); border-radius: 14px; color: #344054; background: color-mix(in srgb, var(--primary) 6%, white); white-space: pre-wrap; }
.announcement::before { content: "公告"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); padding: 3px 6px; border-radius: 6px; color: white; background: var(--primary); font-size: 10px; font-weight: 800; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 28px 0 16px; }
.section-heading h1 { margin: 2px 0 3px; color: #101828; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.5px; }
.section-heading p { margin: 0; color: #667085; }
.eyebrow { color: var(--primary); font-size: 11px; font-weight: 850; letter-spacing: 1.7px; }
.result-count { flex: 0 0 auto; padding: 7px 11px; border: 1px solid #e4e7ec; border-radius: 999px; color: #667085; background: white; font-size: 13px; }
.product-section-heading { margin-top: 36px; }

.category-filter { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: thin; }
.category-filter button { display: grid; grid-template-columns: 54px auto; grid-template-rows: 1fr 1fr; -moz-column-gap: 11px; column-gap: 11px; align-items: center; flex: 0 0 174px; height: auto !important; min-height: 76px; padding: 10px; border: 1px solid #e4e7ec; border-radius: 17px; color: #344054; background: white; text-align: left; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.category-filter button:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 45%, white); box-shadow: 0 9px 24px rgb(15 23 42 / .08); }
.category-filter button.active { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, white); box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 12%, transparent); }
.category-filter strong { align-self: end; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-filter small { align-self: start; color: #98a2b3; }
.category-image { grid-row: 1 / 3; width: 54px; height: 54px; overflow: hidden; border: 3px solid transparent; border-radius: 14px; -o-object-fit: cover; object-fit: cover; display: grid; place-items: center; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, white); font-size: 20px; font-weight: 850; }
.category-all { color: white; background: var(--primary); }

.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
[data-list-layout="list"] .product-grid { grid-template-columns: 1fr; }
[data-list-layout="list"] .product-card { display: grid; grid-template-columns: 300px 1fr; min-height: 230px; }
[data-list-layout="list"] .product-media { height: 100%; }
[data-desktop-layout="contained"] .site-main { max-width: 1040px; }
.product-card { overflow: hidden; display: flex; flex-direction: column; min-width: 0; border: 1px solid rgb(255 255 255 / .78); border-radius: 19px; background: rgb(255 255 255 / .78); box-shadow: 0 10px 30px rgb(15 23 42 / .07); backdrop-filter: blur(16px) saturate(125%); transition: transform .2s ease, box-shadow .2s ease; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 17px 38px rgb(15 23 42 / .11); }
.product-media { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #f2f4f7; }
.product-media > img, .product-placeholder { width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; }
.product-placeholder { display: grid; place-items: center; color: var(--primary); background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 14%, white), #f8fafc); font-size: 48px; font-weight: 900; }
.sale-badge { position: absolute; top: 11px; left: 11px; padding: 5px 9px; border-radius: 999px; color: white; background: #f04438; font-size: 11px; font-weight: 800; box-shadow: 0 4px 12px rgb(240 68 56 / .25); }
.sale-badge.paused { background: #667085; box-shadow: none; }
.product-content { display: flex; flex-direction: column; flex: 1; padding: 16px; }
.product-content h3 { overflow: hidden; margin: 0; color: #101828; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.product-summary { min-height: 42px; overflow: hidden; color: #667085; font-size: 13px; line-height: 1.55; }
.product-summary p { display: -webkit-box; margin: 8px 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-meta { display: flex; gap: 8px; margin: 7px 0 14px; color: #98a2b3; font-size: 12px; }
.product-meta span + span::before { content: "·"; margin-right: 8px; }
.product-buy { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.product-buy > strong, .price { color: #e5484d; font-size: 21px; font-weight: 850; }
.product-buy > strong small { font-size: 12px; }
.primary { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 11px; padding: 10px 15px; color: white !important; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 76%, #047857)); font-weight: 750; box-shadow: 0 7px 16px color-mix(in srgb, var(--primary) 18%, transparent); }
.primary * { color: white !important; }
.full { width: 100%; }
.muted { color: #7c889c; font-size: 14px; }
.error, .global-error, .success { padding: 11px 14px; border-radius: 11px; }
.error, .global-error { color: #b42318; background: #fef3f2; }
.success { color: #067647; background: #ecfdf3; }
.global-error { position: fixed; top: 12px; left: 50%; z-index: 100; transform: translateX(-50%); }

.dialog-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgb(15 23 42 / .58); backdrop-filter: blur(4px); }
.dialog { position: relative; width: min(720px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 28px; border-radius: 22px; background: white; box-shadow: 0 30px 100px rgb(0 0 0 / .3); }
.dialog-close { position: sticky; top: -16px; float: right; z-index: 2; width: 38px; height: 38px; border: 0; border-radius: 50%; color: #667085; background: #f2f4f7; font-size: 24px; }
.storefront-dialog { border: 1px solid rgb(255 255 255 / .72); background: rgb(255 255 255 / .86); backdrop-filter: blur(24px) saturate(140%); }
.storefront-dialog form, .auth-card form, .panel form { display: grid; min-width: 0; gap: 13px; margin-top: 18px; }
.storefront-dialog [data-slot="body"], .storefront-dialog form > * { min-width: 0; max-width: 100%; overflow-x: hidden; }
.checkout-dialog { max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: hidden; background: white; }
.storefront-dialog .checkout-form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: 100%; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); margin: 0; overflow: hidden; }
.checkout-form [data-slot="body"] { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.checkout-footer { flex: 0 0 auto; overflow: visible !important; border-top: 1px solid #eaecf0; background: white; }
.storefront-dialog.checkout-dialog .checkout-submit { color: white !important; background: var(--primary, #16c566) !important; opacity: 1; }
.checkout-notifications { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.checkout-notifications.single { grid-template-columns: 1fr; }
.order-image-upload { position: relative; z-index: 60; display: grid; min-width: 0; gap: 9px; padding: 13px; border: 1px dashed #d0d5dd; border-radius: 13px; background: rgb(248 250 252 / .96); transition: border-color .15s ease, box-shadow .15s ease; }
.order-image-upload.dragging { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.order-image-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.order-image-actions button { color: var(--primary); }
.order-image-upload > small { color: #667085; line-height: 1.5; }
.order-image-drop-overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; border: 2px dashed var(--primary); border-radius: 12px; color: var(--primary); background: color-mix(in srgb, var(--primary) 11%, rgb(255 255 255 / .88)); backdrop-filter: blur(5px); font-size: 16px; font-weight: 800; pointer-events: none; }
.order-image-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.order-image-list > div { position: relative; min-width: 0; overflow: hidden; border: 1px solid #e4e7ec; border-radius: 11px; background: white; }
.order-image-list img { width: 100%; aspect-ratio: 1; -o-object-fit: cover; object-fit: cover; }
.order-image-list button { position: absolute; top: 5px; right: 5px; min-width: 28px; color: white; }
.order-image-list span { display: block; overflow: hidden; padding: 6px; color: #667085; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.order-image-list span.image-error { color: #b42318; }
.payment-dialog { max-width: 440px; text-align: center; }
.payment-dialog img { width: 260px; margin: auto; }
.qr-loading { display: grid; place-items: center; width: 260px; height: 260px; margin: auto; border-radius: 14px; background: #f2f4f7; }
.order-result-dialog { background: white; }
.order-result-header { display: flex; flex-direction: row; align-items: center; gap: 9px; }
.order-result-header h2 { margin: 0; }

.product-detail-page { display: grid; max-width: 1120px; margin: auto; gap: 18px; }
.product-detail-back { justify-self: start; color: #475467; }
.product-detail-hero { overflow: hidden; border-radius: 24px; }
.product-detail-hero-body { display: grid; grid-template-columns: minmax(320px, .9fr) minmax(0, 1.1fr); gap: 34px; padding: 28px; }
.product-detail-media { position: relative; min-width: 0; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 19px; background: #f2f4f7; }
.product-detail-media > img, .product-detail-placeholder { width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; }
.product-detail-placeholder { display: grid; place-items: center; color: var(--primary); background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 14%, white), #f8fafc); font-size: 72px; font-weight: 900; }
.product-detail-info { display: flex; min-width: 0; flex-direction: column; justify-content: center; align-items: flex-start; }
.product-detail-info h1 { margin: 7px 0 8px; color: #101828; font-size: clamp(28px, 4vw, 42px); line-height: 1.16; }
.product-detail-summary { overflow-wrap: anywhere; color: #667085; line-height: 1.7; }
.product-detail-summary p { margin: 5px 0 14px; }
.product-detail-meta, .product-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.product-detail-price { margin: 22px 0 18px; color: #e5484d; font-size: 34px; font-weight: 900; }
.product-detail-price small { font-size: 16px; }
.product-detail-actions button { min-width: 132px; }
.product-detail-info > .success, .product-detail-info > .error { width: 100%; margin: 13px 0 0; }
.product-detail-sections { display: grid; gap: 14px; }
.product-detail-section { border-radius: 18px; }
.product-detail-section [data-slot="body"] { padding: 24px 28px; overflow-wrap: anywhere; color: #475467; line-height: 1.78; }
.product-detail-section h2 { margin: 0 0 13px; color: #101828; font-size: 21px; }
.product-detail-section p:first-of-type { margin-top: 0; }
.product-detail-section p:last-child { margin-bottom: 0; }
.product-detail-state { display: grid; min-height: 52vh; place-items: center; align-content: center; gap: 12px; color: #667085; text-align: center; }
.product-detail-state h1, .product-detail-state p { margin: 0; }

.catalog-page, .orders-page, .profile-page, .balance-page { min-width: 0; overflow: visible; }
.orders-page, .profile-page { max-width: 1180px; margin: auto; }
.order-status-tabs { width: 100%; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.order-status-tabs::-webkit-scrollbar { display: none; }
.order-status-tab-list { width: -moz-max-content; width: max-content; min-width: 100%; padding: 5px; border: 1px solid #e4e7ec; border-radius: 14px; overflow: hidden; background: rgb(255 255 255 / .72); box-shadow: none; }
.order-status-tab { min-height: 38px; font-weight: 650; }
.order-status-tab[data-selected="true"], .order-status-tab[data-selected="true"] * { color: white !important; }
.order-filter { display: grid; grid-template-columns: 1.4fr repeat(2, minmax(130px, 1fr)) auto; gap: 9px; padding: 14px; border: 1px solid rgb(255 255 255 / .72); border-radius: 16px; background: rgb(255 255 255 / .72); box-shadow: 0 10px 28px rgb(15 23 42 / .06); backdrop-filter: blur(18px) saturate(130%); }
.search-field { position: relative; display: block; }
.search-field svg { position: absolute; left: 12px; top: 50%; color: #98a2b3; transform: translateY(-50%); }
.search-field input { padding-left: 39px; }
.order-list { display: grid; gap: 10px; margin-top: 16px; }
.order-row { display: grid; grid-template-columns: 44px 1fr auto 100px; align-items: center; gap: 15px; width: 100%; height: auto !important; min-height: 72px; overflow: visible; padding: 14px 16px; border: 1px solid #e4e7ec; border-radius: 15px; color: #344054; background: white; text-align: left; transition: border-color .18s ease, transform .18s ease; }
.order-row:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--primary) 40%, white); }
.order-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, white); }
.order-main { display: grid; gap: 2px; min-width: 0; }
.order-main strong, .order-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-main small { color: #98a2b3; font-size: 12px; }
.order-price { color: #e5484d; }
.status { justify-self: end; padding: 5px 9px; border-radius: 999px; color: #475467; background: #f2f4f7; font-size: 12px; font-weight: 700; }
.status-completed { color: #067647; background: #ecfdf3; }
.status-processing, .status-paid { color: #175cd3; background: #eff8ff; }
.status-failed, .status-refunded { color: #b42318; background: #fef3f2; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 22px; }
.pagination button { display: inline-flex; align-items: center; gap: 5px; padding: 8px 12px; border: 1px solid #e4e7ec; border-radius: 9px; color: #475467; background: white; }
.pagination span, .load-sentinel { color: #98a2b3; font-size: 13px; text-align: center; }
.load-sentinel { min-height: 42px; padding: 16px; }
.details { display: grid; grid-template-columns: 120px 1fr; gap: 11px 17px;  padding-bottom: 10px}
.details dt { color: #98a2b3; }
.details dd { min-width: 0; margin: 0; word-break: break-word; }
.status-message-chip { max-width: 100%; height: auto; min-width: 0; white-space: normal; }
.status-message-chip [data-slot="content"] { min-width: 0; padding-block: 4px; overflow-wrap: anywhere; white-space: pre-wrap; }
.order-detail-content { -webkit-touch-callout: default; }
.order-detail-content button, .order-detail-content button * { -webkit-user-select: none !important; -moz-user-select: none !important; user-select: none !important; cursor: pointer; }
.order-id-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-id-line button { min-width: 0; height: 28px; padding: 0 9px; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, monospace; }

.profile-hero { padding: 0; border-radius: 22px; color: white; background: linear-gradient(120deg, rgb(21 34 56 / .9), color-mix(in srgb, var(--primary) 76%, rgb(15 23 42 / .9))); box-shadow: 0 18px 45px rgb(15 23 42 / .18); backdrop-filter: blur(24px); }
.profile-hero-body { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 24px; }
.profile-hero h1 { margin: 3px 0; font-size: 28px; }
.profile-hero p { margin: 0; color: rgb(255 255 255 / .72); }
.profile-hero .eyebrow { color: rgb(255 255 255 / .65); }
.profile-avatar { position: relative; display: grid; place-items: center; width: 78px; height: 78px; border: 0; border-radius: 50%; background: transparent; font-size: 28px; font-weight: 850; }
.profile-avatar img { width: 100%; height: 100%; border-radius: 50%; -o-object-fit: cover; object-fit: cover; }
.profile-avatar button { position: absolute; right: -6px; bottom: -6px; display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid white; border-radius: 50%; color: var(--primary); background: white; }
.balance-card { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; gap: 2px 8px; min-width: 210px; height: auto; padding: 14px 17px; border: 1px solid rgb(255 255 255 / .2); border-radius: 16px; color: white; background: rgb(255 255 255 / .12); }
.balance-card svg:first-child { grid-row: 1 / 3; align-self: center; }
.balance-card svg:last-child { grid-column: 3; grid-row: 1 / 3; align-self: center; }
.balance-card span { color: rgb(255 255 255 / .7); font-size: 12px; }
.balance-card strong { font-size: 23px; }
.balance-page { max-width: 980px; margin: auto; }
.subpage-header { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.subpage-header h1 { margin: 2px 0; font-size: 28px; }
.subpage-header p { margin: 0; color: #667085; }
.balance-recharge-button { margin-left: auto; }
.balance-overview { margin-bottom: 16px; border-radius: 20px; }
.balance-overview [data-slot="body"] { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px; padding: 22px; }
.balance-overview svg { grid-row: 1 / 3; color: var(--primary); }
.balance-overview span, .balance-overview small { color: #667085; }
.balance-overview strong { grid-row: 1 / 3; font-size: 28px; color: #e5484d; }
.balance-page .ledger-panel { border-radius: 18px; }
.balance-recharge-result { align-items: center; text-align: center; }
.storefront-dialog .balance-recharge-form { gap: 0; margin: 0; }
.balance-recharge-result .price { font-size: 28px; }
.balance-recharge-result img { width: 260px; max-width: 100%; margin: auto; }
.profile-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.panel { padding: 0; border-radius: 17px; }
.panel [data-slot="body"] { padding: 21px; }
.panel.wide { grid-column: 1 / -1; }
.panel-title { display: flex; align-items: center; gap: 9px; color: var(--primary); }
.panel-title h2 { margin: 0; color: #101828; font-size: 18px; }
.panel-title p { margin: 2px 0 0; color: #98a2b3; font-size: 12px; }
.submit-code-box { display: grid; gap: 10px; margin-top: 15px; padding: 14px; border-radius: 11px; background: #f8fafc; }
.submit-code-info { display: grid; gap: 3px; }
.submit-code-info small { color: #667085; line-height: 1.45; }
.submit-code-box code { width: 100%; word-break: break-all; }
.submit-code-actions { display: flex; flex-wrap: nowrap; gap: 8px; }
.submit-code-actions button, .field-action button { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 8px; padding: 8px 10px; }
.field-action { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; }
.security-panel form + form { margin-top: 24px; padding-top: 20px; border-top: 1px solid #eaecf0; }
.security-panel h3 { display: flex; align-items: center; gap: 6px; margin: 0; }
.ledger { margin-top: 13px; }
.ledger > div { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 3px; border-bottom: 1px solid #f0f2f5; }
.ledger > div > span { display: grid; gap: 2px; }
.ledger small { color: #98a2b3; }
.ledger .expense { color: #d92d20; }
.ledger .income { color: #079455; }
.notification-panel form { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: center; }

.storefront[data-view="chat"] { height: 100vh; height: 100svh; min-height: 0; overflow: hidden; }
.storefront[data-view="chat"] .site-main { min-height: 0; overflow: hidden; }
.storefront[data-view="chat"] footer { display: none; }
.chat-panel { max-width: 900px; height: 100%; min-height: 0; margin: auto; padding: 0; border-radius: 20px; }
.chat-card-body { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; height: 100%; min-height: 0; padding: 22px; }
.chat-panel header h2 { margin-bottom: 4px; }
.chat-messages { display: flex; flex-direction: column; gap: 10px; overflow: auto; padding: 18px 0; }
.chat-message { align-self: flex-start; max-width: 78%; padding: 10px 13px; border-radius: 15px 15px 15px 4px; background: #f2f4f7; }
.chat-message.user { align-self: flex-end; border-radius: 15px 15px 4px 15px; color: white; background: var(--primary); }
.chat-message p { margin: 0 0 4px; white-space: pre-wrap; word-break: break-word; }
.chat-message small { opacity: .7; }
.chat-message-image { position: relative; display: block; height: auto; min-width: 0; min-height: 0; max-width: min(280px, 68vw); overflow: hidden; border: 0; border-radius: 10px; padding: 0; background: rgb(15 23 42 / 7%); cursor: zoom-in; }
.chat-message-image img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; -o-object-fit: contain; object-fit: contain; }
.chat-compose { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: stretch; gap: 10px; padding-top: 16px; border-top: 1px solid #f0f2f5; }
.chat-pending-images { grid-column: 1 / -1; display: flex; gap: 8px; overflow-x: auto; padding: 2px 1px; }
.chat-pending-images > div { position: relative; width: 68px; height: 68px; flex: 0 0 auto; overflow: hidden; border: 1px solid #eaecf0; border-radius: 10px; background: #f2f4f7; }
.chat-pending-images img { width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; }
.chat-pending-images button { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 20px; min-width: 20px; height: 20px; min-height: 20px; border: 0; border-radius: 50%; padding: 0; color: white; background: rgb(0 0 0 / 65%); }
.chat-compose [data-slot="input-wrapper"], .chat-compose > button { height: 52px; min-height: 52px; }
.chat-compose textarea { height: 24px !important; min-height: 24px !important; max-height: 24px !important; overflow-y: auto; resize: none !important; line-height: 24px; }
.chat-compose > button { min-width: 88px; }
.chat-compose > .chat-image-picker { width: 52px; min-width: 52px; padding: 0; }
.empty { display: grid; place-items: center; gap: 7px; padding: 52px; color: #98a2b3; text-align: center; }
footer { padding: 22px; color: #98a2b3; text-align: center; }

.auth-page, .loading-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 15% 8%, color-mix(in srgb, var(--primary, #16a34a) 17%, white), transparent 34%), #f5f6f8; }
.auth-card { width: min(440px, 100%); padding: 0; border-radius: 24px; }
.auth-card [data-slot="body"] { padding: 32px; }
.auth-card h1 { margin-bottom: 6px; text-align: center; }
.auth-logo { display: block; width: 70px; height: 70px; margin: auto; border-radius: 20px; -o-object-fit: cover; object-fit: cover; }
.auth-tabs { margin: 16px 0 8px; }
.auth-tab-list { min-height: 48px; }
.auth-tab { min-height: 40px; }
.auth-tab[data-selected="true"], .auth-tab[data-selected="true"] * { color: white !important; }
.link-button { display: block; margin: 14px auto 0; border: 0; color: var(--primary); background: transparent; }
.spinner { width: 42px; height: 42px; border: 4px solid #dce5e2; border-top-color: var(--primary, #16a34a); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@supports not (color: color-mix(in srgb, red, white)) {
    .storefront, .auth-page, .loading-page { background: #f5f6f8; }
    .brand-mark, .primary { background: var(--primary, #16a34a); box-shadow: none; }
    .announcement, .category-filter button.active, .category-image, .product-placeholder, .order-icon, .field-action button { background: #eefbf3; }
    .announcement { border-color: #bbf7d0; }
    .category-filter button:hover, .order-row:hover { border-color: #86efac; }
    .profile-hero { background: linear-gradient(120deg, #24364d, #16824c); }
}

.chat-nav-icon { position: relative; display: inline-flex; }
.chat-nav-icon b { position: absolute; top: -8px; right: -10px; min-width: 15px; padding: 1px 4px; border-radius: 999px; color: white; background: #ef4444; font-size: 9px; line-height: 13px; text-align: center; }
@supports not (backdrop-filter: blur(1px)) {
    .glass-surface, .site-header, .storefront-dialog, .order-filter, .mobile-nav { background: rgb(255 255 255 / .94); }
}

@media (max-width: 1080px) {
    .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .order-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .search-field { grid-column: span 2; }
    .notification-panel form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .notification-panel form .primary { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
    body { background: #f7f7f8; }
    .storefront { background: #f7f7f8; }
    .site-header { grid-template-columns: minmax(0, 1fr) auto; min-height: 60px; padding: 8px 13px; }
    .brand { font-size: 16px; }
    .brand img, .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
    .desktop-nav, .account-summary { display: none !important; }
    .account-button { padding: 3px; border: 0; background: transparent; }
    .mini-avatar { width: 36px; height: 36px; border-radius: 50%; }
    .storefront[data-view="profile"] .header-account .account-button { display: none !important; }
    .logout { width: 34px; height: 34px; color: #d92d20; background: #fef3f2; }
    .mobile-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr); min-height: 64px; padding: 6px 8px; padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-top: 1px solid rgb(255 255 255 / .7); background: rgb(255 255 255 / .42); box-shadow: 0 -4px 14px rgb(15 23 42 / .07); backdrop-filter: blur(36px) saturate(200%); }
    .mobile-nav button { display: grid; place-items: center; gap: 2px; height: auto !important; min-height: 52px; overflow: visible !important; border: 0; color: #98a2b3; background: transparent; font-size: 11px; transition: color .18s ease, transform .18s ease; }
    .mobile-nav button.active { color: var(--primary); font-weight: 750; }
    .mobile-nav button.active svg { transform: scale(1.06); transition: transform .18s ease; }
    .site-main { width: calc(100% - 24px); margin: 12px auto 88px; }
    .storefront[data-view="chat"] .site-main { margin-bottom: 72px; }
    .site-banner { aspect-ratio: 2.15 / 1; max-height: none; margin-bottom: 12px; border-radius: 16px; box-shadow: 0 9px 24px rgb(15 23 42 / .1); }
    .announcement { margin-bottom: 26px; padding: 12px 13px 12px 56px; border-radius: 12px; font-size: 13px; }
    .announcement::before { top: 50%; left: 10px; }
    .section-heading { margin: 20px 1px 12px; }
    .section-heading h1 { font-size: 21px; }
    .section-heading p, .eyebrow { display: none; }
    .result-count { padding: 5px 8px; font-size: 11px; }
    .category-filter { gap: 13px; margin-right: -12px; padding: 7px 12px 8px 1px; }
    .category-filter button { display: grid; grid-template-columns: 58px; grid-template-rows: 58px auto; justify-items: center; flex-basis: 68px; min-height: 0; padding: 0; border: 0; color: #475467; background: transparent; text-align: center; }
    .category-filter button:hover { transform: none; box-shadow: none; }
    .category-filter button.active { border: 0; background: transparent; box-shadow: none; }
    .category-filter button.active .category-image { border-color: #a7f3d0; border-color: color-mix(in srgb, var(--primary) 24%, white); }
    .category-filter strong { align-self: center; max-width: 68px; font-size: 12px; }
    .category-filter small { display: none; }
    .category-image { grid-row: auto; width: 58px; height: 58px; border-radius: 18px; }
    .product-section-heading { margin-top: 21px; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    [data-list-layout="list"] .product-card { display: flex; min-height: 0; }
    .storefront[data-mobile-layout="compact"] .product-grid { grid-template-columns: 1fr; }
    .storefront[data-mobile-layout="compact"] .product-card { display: grid; grid-template-columns: 104px minmax(0, 1fr); min-height: 104px; }
    .storefront[data-mobile-layout="compact"] .product-media { height: 100%; aspect-ratio: 1; }
    .storefront[data-mobile-layout="compact"] .product-summary { display: none; }
    .product-card { border-radius: 15px; box-shadow: none; }
    .product-card:hover { transform: none; }
    .product-media { aspect-ratio: 1 / 1; }
    .sale-badge { top: 7px; left: 7px; padding: 4px 7px; }
    .product-content { padding: 10px; }
    .product-content h3 { font-size: 14px; }
    .product-summary { min-height: 34px; font-size: 11px; }
    .product-summary p { margin: 5px 0; }
    .product-meta { display: none; }
    .product-buy { align-items: end; margin-top: 7px; }
    .product-buy > strong { font-size: 17px; }
    .product-buy .primary { padding: 7px 9px; border-radius: 9px; font-size: 11px; box-shadow: none; }
    .product-detail-page { gap: 12px; }
    .product-detail-back { margin-left: -8px; }
    .product-detail-hero { border-radius: 17px; box-shadow: none; }
    .product-detail-hero-body { grid-template-columns: 1fr; gap: 18px; padding: 12px; }
    .product-detail-media { aspect-ratio: 1 / 1; border-radius: 14px; }
    .product-detail-info { padding: 0 3px 5px; }
    .product-detail-info h1 { margin-top: 2px; font-size: 25px; }
    .product-detail-info .eyebrow { display: none; }
    .product-detail-price { margin: 14px 0; font-size: 28px; }
    .product-detail-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .product-detail-actions button { min-width: 0; }
    .product-detail-section { border-radius: 15px; box-shadow: none; }
    .product-detail-section [data-slot="body"] { padding: 18px 16px; }
    .product-detail-section h2 { font-size: 18px; }
    .order-image-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .checkout-dialog, .storefront-dialog .checkout-form { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
    .checkout-dialog { margin: 8px; }
    .checkout-footer { padding-bottom: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
    .checkout-footer > button { min-width: 0; flex: 1; }
    .checkout-notifications { grid-template-columns: 1fr; }
    .dialog-backdrop { align-items: end; padding: 0; }
    .dialog { width: 100%; max-height: 91vh; padding: 22px 16px 20px; padding: 22px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; }
    .dialog-close { top: -10px; }
    .orders-page .section-heading { margin-top: 5px; }
    .order-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; border-radius: 14px; box-shadow: none; }
    .search-field { grid-column: 1 / -1; }
    .order-filter .primary { grid-column: 1 / -1; }
    .order-list { margin-top: 10px; }
    .order-row { grid-template-columns: 36px 1fr auto; min-height: 72px; gap: 9px; padding: 11px; border-radius: 13px; }
    .order-icon { width: 36px; height: 36px; }
    .order-price { align-self: start; font-size: 14px; }
    .order-row .status { grid-column: 3; padding: 4px 7px; }
    .order-main small:last-child { display: none; }
    .details { grid-template-columns: 86px 1fr; font-size: 13px; }
    .profile-hero { grid-template-columns: auto 1fr; gap: 13px; padding: 17px; border-radius: 17px; padding: 0; }
    .profile-hero-body { grid-template-columns: auto 1fr; gap: 13px; padding: 17px; }
    .profile-avatar { width: 64px; height: 64px; border-radius: 50%; }
    .profile-avatar img { border-radius: 50%; }
    .profile-hero h1 { font-size: 21px; }
    .balance-card { grid-column: 1 / -1; grid-template-columns: auto 1fr auto; align-items: center; min-width: 0; padding: 11px 13px; }
    .balance-card svg:first-child, .balance-card svg:last-child { grid-row: 1 / 3; }
    .balance-card strong { font-size: 20px; }
    .subpage-header { margin-top: 4px; }
    .subpage-header h1 { font-size: 22px; }
    .subpage-header p, .subpage-header .eyebrow { display: none; }
    .balance-overview [data-slot="body"] { padding: 17px; }
    .balance-overview strong { font-size: 22px; }
    .balance-recharge-button { min-width: 0; padding: 9px 11px; }
    .profile-layout { grid-template-columns: 1fr; gap: 11px; margin-top: 12px; }
    .panel, .panel.wide { grid-column: auto; padding: 0; border-radius: 15px; box-shadow: none; }
    .panel [data-slot="body"] { padding: 16px; }
    .notification-panel form { grid-template-columns: 1fr; }
    .ledger > div { padding: 10px 1px; font-size: 13px; }
    .chat-panel { padding: 0; border-radius: 15px; box-shadow: none; }
    .chat-card-body { height: 100%; min-height: 0; padding: 14px; }
    .chat-compose { position: static; grid-template-columns: auto minmax(0, 1fr) auto; gap: 7px; padding-top: 8px; border-top: 1px solid #f0f2f5; background: white; }
    .chat-compose > button:last-child { min-width: 68px; padding-inline: 10px; }
    footer { display: none; }
    .auth-card { padding: 0; border-radius: 20px; }
    .auth-card [data-slot="body"] { padding: 25px 18px; }
}

@media (max-width: 380px) {
    .product-grid { gap: 7px; }
    .product-content { padding: 8px; }
    .product-buy .primary { padding: 6px 7px; }
}
