/* Flexible localized layouts for the mobile storefront and account. */
html:not(:lang(zh)) #main .home-section-title h2,
html:not(:lang(zh)) #main .home-section-title button,
html:not(:lang(zh)) #main .trust-strip b,
html:not(:lang(zh)) #main .home-products .mini-product h3,
html:not(:lang(zh)) #main .home-products .mini-price {
  white-space:normal;
  overflow-wrap:break-word;
  word-break:normal;
}
html:not(:lang(zh)) #main .home-products .mini-product h3{height:auto;max-height:none;line-height:1.3;overflow-wrap:anywhere}
html:not(:lang(zh)) #main .home-products .mini-price{height:auto;min-height:44px;line-height:1.2}
html:not(:lang(zh)) #main .hero-cta{height:auto;min-height:44px;line-height:1.25;white-space:normal;overflow-wrap:break-word}
html:not(:lang(zh)) #main .promo-heading{height:auto;min-height:42px;align-items:center;flex-wrap:wrap}
html:not(:lang(zh)) #main .promo-heading strong,
html:not(:lang(zh)) #main .promo-heading .promo-countdown{min-width:0;white-space:normal;overflow-wrap:break-word}
html:not(:lang(zh)) #main .promo-body>div:nth-child(2){min-width:0}
html:not(:lang(zh)) #main .promo-body>div:nth-child(2)>b,
html:not(:lang(zh)) #main .promo-body .promo-offer span,
html:not(:lang(zh)) #main .promo-body small{height:auto;max-height:none;overflow:visible;white-space:normal;overflow-wrap:break-word;line-height:1.35}
html:not(:lang(zh)) #main .promo-body button{flex:0 0 auto;min-width:44px;max-width:none;height:auto;min-height:44px;padding-inline:12px;white-space:nowrap;overflow-wrap:normal;line-height:1.2}

/* Keep summary cards compact; the complete names remain in the DOM and detail pages. */
#main .home-products .mini-product h3,
html:not(:lang(zh)) #main .home-products .mini-product h3{
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;
  max-height:calc(3.9em + 8px);overflow:hidden;overflow-wrap:anywhere;
}
#main .promo-body #homeCouponTitle,
html:not(:lang(zh)) #main .promo-body #homeCouponTitle{
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;
  max-height:2.7em;overflow:hidden;overflow-wrap:anywhere;
}

/* Keep every localized category and filter visible without a horizontal control. */
#main .catalog-scroll-row{display:contents}
#main .catalog-scroll-next{display:none}
/* Chinese has four short filters; share the row so each keeps comfortable padding. */
html:lang(zh) #main .catalog-controls .order-filters button{flex:1 1 auto;padding-inline:7px}
html:not(:lang(zh)) #main .catalog-scroll-row{display:block;min-width:0}
html:not(:lang(zh)) #main .category-chips,
html:not(:lang(zh)) #main .catalog-controls .order-filters{min-width:0;gap:var(--filter-control-gap,6px);overflow:visible}
html:not(:lang(zh)) #main .category-chips{display:flex;flex-wrap:wrap;padding:0 0 7px}
html:not(:lang(zh)) #main .category-chips button{box-sizing:border-box;flex:1 1 calc((100% - 12px) / 3);min-width:0;width:auto;max-width:none;height:auto;min-height:56px;padding:6px 8px;white-space:normal;overflow-wrap:anywhere;word-break:normal;line-height:1.25}
html:not(:lang(zh)) #main .category-chips button b{max-width:100%;font-size:12px;line-height:1.25;white-space:normal;overflow-wrap:anywhere;word-break:normal}
html:not(:lang(zh)) #main .catalog-controls .order-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding-bottom:8px}
html:not(:lang(zh)) #main .catalog-controls .order-filters button{box-sizing:border-box;width:100%;min-width:0;max-width:none;height:auto;min-height:44px;padding:7px 10px;white-space:normal;overflow-wrap:anywhere;word-break:normal;line-height:1.25}
html:not(:lang(zh)) #main .catalog-controls .order-filters button span{min-width:0;white-space:normal;overflow-wrap:anywhere;word-break:normal}
html:not(:lang(zh)) #main .catalog-scroll-next{display:none}
@media(max-width:349px){
  html:lang(zh) #main .catalog-controls .order-filters{gap:3px}
  html:not(:lang(zh)) #main .catalog-controls .order-filters button{padding-inline:8px}
  html:not(:lang(zh)) #main .catalog-controls .order-filters button .ui-icon{display:none}
}
html:not(:lang(zh)) #main .catalog-grid .cardbody{min-width:0}
html:not(:lang(zh)) #main .catalog-grid .cardbody h3,
html:not(:lang(zh)) #main .catalog-grid .catalog-progress-label{height:auto;max-height:none;overflow:visible;white-space:normal;overflow-wrap:anywhere}
html:not(:lang(zh)) #main .catalog-grid .value-box{min-width:0;max-width:100%;height:auto;flex-wrap:wrap}
html:not(:lang(zh)) #main .catalog-grid .cardbody .wide{height:auto;min-height:44px;white-space:normal;overflow-wrap:break-word;line-height:1.2}
/* List cards are summaries; the complete product name remains available to search and in detail. */
#main .catalog-grid .cardbody h3,
html:not(:lang(zh)) #main .catalog-grid .cardbody h3{
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;
  max-height:3.96em;overflow:hidden;overflow-wrap:anywhere;
}
/* Only large home-card values use an approximate compact form; full values stay accessible. */
#main .home-products .mini-product .home-value.is-compact{
  font-size:clamp(11px,3.6vw,15px);letter-spacing:-.02em;white-space:nowrap;overflow-wrap:normal;
}

/* Long policy labels and backend-authored descriptions must share the available width. */
html:not(:lang(zh)) #main .product-detail-page .detail-policy dl>div{grid-template-columns:minmax(0,0.9fr) minmax(0,1.1fr)}
html:not(:lang(zh)) #main .product-detail-page .detail-policy :is(dt,dd){min-width:0;overflow-wrap:anywhere;word-break:normal}

/* Account rows retain readable labels and 44px touch targets as content grows. */
html:not(:lang(zh)) #main .account-overview .membership-card{height:auto;align-items:center}
html:not(:lang(zh)) #main .membership-card>div:nth-child(2){min-width:0}
html:not(:lang(zh)) #main .membership-card :is(strong,small){height:auto;max-height:none;overflow:visible;white-space:normal;overflow-wrap:break-word;line-height:1.3}
html:not(:lang(zh)) #main .account-overview .membership-card button{height:auto;min-height:44px;max-width:42%;white-space:normal;overflow-wrap:break-word;line-height:1.2}
html:not(:lang(zh)) #main .account-stats button{height:auto;min-height:72px}
html:not(:lang(zh)) #main .account-stats small{white-space:normal;overflow-wrap:break-word;line-height:1.25}
html:not(:lang(zh)) #main .account-menu .account-row{height:auto;min-height:52px}
html:not(:lang(zh)) #main .account-menu .account-row strong{flex:1 1 auto;min-width:0;white-space:normal;overflow-wrap:break-word}
html:not(:lang(zh)) #main .account-menu .coupon-count{flex:0 0 auto;max-width:none;white-space:nowrap;text-align:center;line-height:1.2}
html:not(:lang(zh)) #main .settings-list button{height:auto;min-height:48px;align-items:center}
html:not(:lang(zh)) #main .settings-list button>span{flex:1 1 auto;min-width:0;white-space:normal;overflow-wrap:break-word;line-height:1.3}
html:not(:lang(zh)) #main .settings-list button small{flex:0 1 auto;min-width:0;max-width:45%;white-space:normal;overflow-wrap:break-word;line-height:1.3}
html:not(:lang(zh)) #main .settings-list button b{flex:none}
html:not(:lang(zh)) #main .account-trust strong{min-width:0;white-space:normal;overflow-wrap:break-word;line-height:1.3}

/* Short navigation labels stay on one line; buttons retain full accessible names. */
html:not(:lang(zh)) .mobile-nav button span{font-size:11.5px;letter-spacing:0;line-height:1.2;white-space:nowrap;overflow-wrap:normal;word-break:normal}

/* Round identity stays legible in narrow cards and can wrap in every locale. */
.round-summary{display:block;min-width:0;color:#52705a;font-size:12px;font-weight:700;line-height:1.35;white-space:normal;overflow-wrap:anywhere}
#main .home-products .mini-product .round-summary{margin:2px 4px 3px;font-size:10px;text-align:center}
#main .catalog-grid .cardbody .round-summary{margin:0 0 6px}
#main .orders-screen .order-item-info .round-summary{margin:0 0 5px}
#main .history-card .round-summary{margin:3px 0}
#picker .flow-round{padding:7px 16px;background:#f0f7ec;border-bottom:1px solid #dce9d8}

/* Product detail: one clear purchase journey, with space for the persistent action. */
#main .detail-screen{min-width:0;background:#f7f5ef}
#main .detail-screen .detail-top{height:auto;min-height:52px;padding:4px 18px;gap:8px;background:linear-gradient(110deg,#003c24,#087942);color:#fff}
#main .detail-screen .detail-top h1{min-width:0;flex:1;margin:0;color:#fff;font-size:19px;line-height:1.25;overflow-wrap:anywhere}
#main .detail-screen .detail-top>button{color:#fff}
#main .detail-screen .detail-favorite[aria-pressed="true"] .ui-icon{fill:#ffdc65;stroke:#ffdc65}
#main .product-detail-page{display:grid;gap:12px;padding:12px 0 100px}
#main .product-detail-page .detail-visual{position:relative;min-width:0;min-height:0;aspect-ratio:1.16/1;overflow:hidden;border:1px solid #d7bd6a;border-radius:18px;background-color:#003f27;box-shadow:0 4px 14px #173e2418}
#main .product-detail-page .detail-visual>span,#main .product-detail-page .detail-visual-status{top:12px;left:12px;max-width:calc(100% - 24px);padding:6px 11px;border:1px solid #ffffff80;border-radius:8px;background:linear-gradient(#ff482e,#cc140e);box-shadow:0 2px 5px #2b120f30;color:#fff;font-size:12px;font-weight:750;line-height:1.25;overflow-wrap:anywhere}
#main .product-detail-page .detail-visual .detail-visual-price{position:absolute;inset:auto 12px 12px auto;max-width:calc(100% - 24px);padding:6px 11px;border:1px solid #ffe48c;border-radius:999px;background:#053d2deb;color:#ffe37b;font-size:13px;font-weight:800;line-height:1.25;overflow-wrap:anywhere}
#main .product-detail-page .detail-intro{min-width:0;padding:17px;border:1px solid #eadfca;border-radius:17px;background:#fffdfa;box-shadow:0 3px 12px #372d1610}
#main .product-detail-page .detail-intro h2{margin:0 0 10px;color:#14261b;font-size:21px;font-weight:800;line-height:1.3;overflow-wrap:anywhere}
#main .product-detail-page .detail-kicker{display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-wrap:wrap;margin:0 0 14px;padding:10px 12px;border:1px solid #f1d789;border-radius:12px;background:linear-gradient(110deg,#fff5cd,#ffe3a0);color:#5a4926;font-size:13px;line-height:1.3;overflow-wrap:anywhere}
#main .product-detail-page .detail-kicker :is(strong,b,.home-value){color:#c5191a;font-size:22px;line-height:1.15}
#main .product-detail-page .detail-round-card{min-width:0;padding:14px;border:1px solid #d5e7d2;border-radius:14px;background:linear-gradient(145deg,#f8fcf2,#f0f7ec)}
#main .product-detail-page .detail-round-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;margin-bottom:10px;color:#075e30;font-weight:800;line-height:1.35;overflow-wrap:anywhere}
#main .product-detail-page .detail-intro .round-summary{min-width:0;margin:0;color:#075e30;font-size:14px;font-weight:800;line-height:1.4;overflow-wrap:anywhere}
#main .product-detail-page .detail-progress-head{display:flex;align-items:baseline;justify-content:space-between;gap:6px 12px;flex-wrap:wrap;min-width:0;margin:4px 0 6px;color:#405849;font-size:13px;line-height:1.4}
#main .product-detail-page .detail-progress{min-width:0;margin:0;color:#405849;font-size:13px;font-weight:700;line-height:1.4;overflow-wrap:anywhere}
#main .product-detail-page .detail-round-card progress{display:block;width:100%;height:7px;margin:0;appearance:none;-webkit-appearance:none;border:0;border-radius:999px;background:var(--product-progress-track);overflow:hidden}
#main .product-detail-page .detail-round-card progress::-webkit-progress-bar{border-radius:999px;background:var(--product-progress-track)}
#main .product-detail-page .detail-round-card progress::-webkit-progress-value{border-radius:999px;background:var(--product-progress-fill)}
#main .product-detail-page .detail-round-card progress::-moz-progress-bar{border-radius:999px;background:var(--product-progress-fill)}
#main .product-detail-page .detail-schedule-row{min-width:0;margin-top:12px;padding-top:10px;border-top:1px solid #dcebd9}
#main .product-detail-page .detail-schedule,#main .product-detail-page .detail-result{margin:0;color:#375a43;font-size:13px;font-weight:650;line-height:1.5;overflow-wrap:anywhere}
#main .product-detail-page .detail-result{color:#b91f19;font-weight:800}
#main .product-detail-page .detail-history{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:44px;max-width:100%;margin:9px 0 0;padding:9px 11px;border:1px solid #cfe4ce;border-radius:10px;background:#fff;color:#08743a;font-size:13px;font-weight:750;line-height:1.3;text-align:left;white-space:normal;overflow-wrap:anywhere}
/* Product information uses one shared surface: tab row and selected content. */
#main .product-detail-page .detail-info-tabs{min-width:0;overflow:hidden;border:1px solid #e9e1d4;border-radius:15px;background:#fffdfa;box-shadow:0 3px 12px #372d160b}
#main .product-detail-page .detail-info-tablist{display:flex;align-items:stretch;min-width:0;padding:0 6px;border-bottom:1px solid #ece9e0;background:transparent}
#main .product-detail-page .detail-info-tab{position:relative;display:flex;flex:1 1 0;align-items:center;justify-content:center;min-width:0;min-height:48px;padding:9px 4px 11px;border:0;border-radius:0;background:transparent;color:#627365;font:inherit;font-size:13px;font-weight:700;line-height:1.3;text-align:center;white-space:normal;overflow-wrap:anywhere;cursor:pointer}
#main .product-detail-page .detail-info-tab[aria-selected="true"]{color:#086b37;background:transparent;box-shadow:none}
#main .product-detail-page .detail-info-tab[aria-selected="true"]::after{position:absolute;bottom:0;left:50%;width:30px;max-width:70%;height:3px;border-radius:3px 3px 0 0;background:#d5221d;content:'';transform:translateX(-50%)}
#main .product-detail-page .detail-info-tab:focus-visible{outline:3px solid #c99716;outline-offset:-3px;z-index:1}
#main .product-detail-page .detail-info{min-width:0;padding:16px 17px;border:0;border-radius:0;background:transparent;box-shadow:none}
#main .product-detail-page .detail-info-panel{min-width:0;color:#294638;line-height:1.65;overflow-wrap:anywhere;word-break:normal}
#main .product-detail-page .detail-info-panel[hidden]{display:none!important}
#main .product-detail-page .detail-info-panel :is(h3,p,dl){max-width:100%;overflow-wrap:anywhere}
#main .product-detail-page .detail-info h3{display:flex;align-items:center;gap:8px;margin:0 0 9px;color:#173d29;font-size:16px;font-weight:800;line-height:1.4;overflow-wrap:anywhere}
#main .product-detail-page .detail-info h3::before{display:block;flex:none;width:4px;height:16px;border-radius:3px;background:#d3221d;content:''}
#main .product-detail-page .detail-info p,#main .product-detail-page .detail-policy dd{margin:0;color:#45564a;font-size:14px;line-height:1.65;white-space:pre-line;overflow-wrap:anywhere}
/* Preserve editor-entered paragraphs and list indentation, including long text. */
#main .product-detail-page .detail-info-panel p[data-detail-field]{font-size:15px;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal}
#main .product-detail-page .detail-policy dl{margin:0}
#main .product-detail-page .detail-policy dl>div{display:grid;grid-template-columns:minmax(74px,.8fr) minmax(0,1.2fr);gap:10px;padding:10px 0;border-top:1px solid #ece9e0}
#main .product-detail-page .detail-policy dl>div:first-child{padding-top:0;border-top:0}
#main .product-detail-page .detail-policy dl>div:last-child{padding-bottom:0}
#main .product-detail-page .detail-policy :is(dt,dd){min-width:0;line-height:1.5;overflow-wrap:anywhere}
#main .product-detail-page .detail-policy dt{color:#64776a;font-size:13px}
@media(max-width:350px){#main .product-detail-page .detail-info-tab{font-size:12px;padding:8px 3px 10px}#main .product-detail-page .detail-info{padding:14px}}
#main .product-detail-page .detail-action{position:fixed;z-index:3;bottom:calc(74px + env(safe-area-inset-bottom));left:50%;width:min(100%,390px);padding:9px 14px;background:#fffdf8f5;border-top:1px solid #f0e3cb;box-shadow:0 -4px 15px #173e2414;transform:translateX(-50%)}
#main .product-detail-page .detail-action button{display:flex;align-items:center;justify-content:center;width:100%;min-height:48px;height:auto;padding:9px 14px;border:1px solid #b71811;border-radius:24px;background:linear-gradient(#ff4932,#e21a16 55%,#bd1611);box-shadow:inset 0 1px 0 #ffffff80,0 3px 8px #b2211930;color:#fff;font-size:16px;font-weight:800;line-height:1.3;text-align:center;white-space:normal;overflow-wrap:anywhere}
/* Keep an unavailable notice readable inside the fixed mobile action area. */
#main .product-detail-page .detail-action .detail-unavailable{margin:0 0 6px;padding:7px 10px;border-radius:8px;font-size:12px;line-height:1.4;white-space:normal;overflow-wrap:anywhere}
#main .product-detail-page:has(.detail-unavailable){padding-bottom:calc(160px + env(safe-area-inset-bottom))}
#main .product-detail-page .detail-action button:disabled{border-color:#c7d5c9;background:#e8efea;box-shadow:none;color:#52695a;opacity:1}
#main .product-detail-page:has(.detail-result) .detail-action button:not(:disabled){border-color:#a3cbb2;background:#e6f3e9;box-shadow:none;color:#145a35}
#main .detail-screen button:focus-visible{outline:3px solid #e6ad1c;outline-offset:2px}
@media(max-width:350px){#main .product-detail-page .detail-intro{padding:14px}#main .product-detail-page .detail-round-card{padding:12px}#main .product-detail-page .detail-intro h2{font-size:19px}}
#main .product-detail-page .detail-progress-head h3{margin:0;color:#314f39;font-size:13px;font-weight:750;line-height:1.4}
#main .product-detail-page :is(.detail-schedule,.detail-result) .ui-icon{display:inline-block;vertical-align:-3px;width:16px;height:16px;margin-right:6px;color:currentColor}

/* Uploaded product photos use only validated same-origin paths; built-in artwork remains the fallback. */
:is(.mini-art,.catalog-art,.detail-visual,.purchase-image,.order-thumb,.history-card-icon,.favorite-product-image):has(>.product-custom-image){position:relative;overflow:hidden}
.product-custom-image{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
#main .product-detail-page .detail-visual>.product-custom-image{object-fit:contain;background:#033e28}
#main .product-detail-page .detail-visual :is(.detail-visual-status,.detail-visual-price),#main .catalog-art .mini-tag{z-index:1}
.favorite-product-image{float:right;width:68px;height:68px;margin:0 0 8px 12px;border:1px solid #e5dfcf;border-radius:10px;background:#edf3e9}
.favorite-card::after{display:block;clear:both;content:''}
#main .catalog-grid .catalog-art:has(>.product-custom-image),#main :is(.mini-art,.detail-visual,.order-thumb):has(>.product-custom-image),#picker .purchase-image:has(>.product-custom-image){background-image:none;background-color:#f5f4ed}

/* Shared top-bar controls use the same touch area and icon treatment across screens. */
#main .page-top>button,#main .home-top.page-top .top-actions button{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:0;border-radius:10px;background:transparent;box-shadow:none}
#main .page-top>button .ui-icon,#main .page-top>button svg,#main .home-top.page-top .top-actions svg{width:24px;height:24px;stroke:currentColor}
#main .page-top>button:focus-visible,#main .home-top.page-top .top-actions button:focus-visible{outline:3px solid currentColor;outline-offset:-3px}

/* Draw history: each result is anchored to its own product and round. */
#main .history-screen .history-page{padding:12px 0 28px;min-width:0}
#main .history-screen .history-controls{display:grid;gap:9px;margin:0 0 10px;padding:12px;border:1px solid #e3e7d8;border-radius:15px;background:#fffdfa;box-shadow:0 3px 10px #173e2410}
#main .history-screen .history-search{display:flex;gap:7px;min-width:0}
#main .history-screen .history-search input{flex:1;min-width:0;width:100%;min-height:44px;padding:9px 12px;border:1px solid #ccdcd0;border-radius:10px;background:#fff;color:#183b30;font:inherit;font-size:14px}
#main .history-screen .history-search button{flex:0 1 auto;min-width:0;max-width:45%;min-height:44px;padding:8px 12px;border:1px solid #bbd9c3;border-radius:10px;background:#f2f8f1;color:#075c31;font-size:13px;font-weight:700;line-height:1.3;white-space:normal;overflow-wrap:anywhere}
#main .history-screen .history-search button[hidden],#main .history-screen .history-no-matches[hidden],#main .history-screen .history-card[hidden],#main .history-screen .history-numbers span[hidden]{display:none}
#main .history-screen .history-filter-tabs{display:flex;flex-wrap:wrap;gap:8px}
#main .history-screen .history-filter-tabs button{position:relative;isolation:isolate;min-width:0;max-width:100%;min-height:44px;padding:8px 12px;border:0;border-radius:999px;background:transparent;color:#315a3d;font-size:13px;font-weight:750;line-height:1.3;white-space:normal;overflow-wrap:anywhere}
#main .history-screen .history-filter-tabs button::before{content:'';position:absolute;inset:4px 0;z-index:-1;border:1px solid #d5e3d6;border-radius:999px;background:#f8fbf5}
#main .history-screen .history-filter-tabs button[aria-pressed="true"]{background:transparent;color:#fff}
#main .history-screen .history-filter-tabs button[aria-pressed="true"]::before{border-color:#067633;background:#087c39}
#main .history-screen .history-filter-disclosure{min-width:0;border-top:1px solid #e7eee4}
#main .history-screen .history-filter-disclosure>summary{display:flex;align-items:center;gap:8px;min-height:44px;list-style:none;cursor:pointer;font-size:14px;font-weight:750;line-height:1.35;overflow-wrap:anywhere}
#main .history-screen .history-filter-disclosure>summary::-webkit-details-marker{display:none}
#main .history-screen .history-filter-disclosure>summary::after{content:'⌄';margin-left:auto;flex:none;font-size:20px;line-height:1;transition:transform .15s}
#main .history-screen .history-filter-disclosure[open]>summary::after{transform:rotate(180deg)}
#main .history-screen .history-filter-disclosure>summary{color:#145b34}
#main .history-screen .history-filter-count{padding:2px 7px;border-radius:8px;background:#e7f3e5;color:#16612f;font-size:12px;font-weight:700}
#main .history-screen .history-filter-count[hidden],#main .history-screen .history-selected-product[hidden]{display:none}
#main .history-screen .history-filter-content{display:grid;gap:10px;padding:2px 0 0}
#main .history-screen .history-selected-product{color:#45634d;font-size:12px;line-height:1.4;overflow-wrap:anywhere;word-break:normal}
#main .history-screen .history-list-head{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:4px 10px;margin:0 2px 10px}
#main .history-screen .history-list-head h2{margin:0;color:#173d29;font-size:17px;font-weight:800;line-height:1.35;overflow-wrap:anywhere}
#main .history-screen .history-list-head #historyResultCount{color:#536b5a;font-size:12px;line-height:1.4}
#main .history-screen .history-filter-disclosure>summary:focus-visible{outline:3px solid #d7a51b;outline-offset:-3px}
@media(prefers-reduced-motion:reduce){#main .history-screen .history-filter-disclosure>summary::after{transition:none}}
#main .history-screen .history-filter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;min-width:0}
#main .history-screen .history-filter:has(#historyProductFilter){grid-column:1/-1;grid-row:1}
#main .history-screen .history-filter:only-child{grid-column:1/-1}
#main .history-screen .history-filter{display:grid;gap:4px;min-width:0;color:#526b5a;font-size:12px;font-weight:700;line-height:1.3;overflow-wrap:anywhere}
#main .history-screen .history-filter select{min-width:0;width:100%;min-height:44px;padding:7px 6px;border:1px solid #ccdfce;border-radius:9px;background:#fff;color:#193e2b;font:inherit;font-size:13px}
#main .history-screen #historyClearFilters{justify-self:end;max-width:100%;min-height:44px;padding:8px 12px;border:1px solid #bbd9c3;border-radius:10px;background:#f2f8f1;color:#075c31;font-size:13px;font-weight:700;line-height:1.3;white-space:normal;overflow-wrap:anywhere}
#main .history-screen #historyClearFilters[hidden]{display:none}
#main .history-screen .history-no-matches{margin:4px 0 12px;padding:12px 14px;border:1px solid #e7e6da;border-radius:13px;background:#fffdfa;color:#526b5a;font-size:12px;line-height:1.5;text-align:center;overflow-wrap:anywhere}
#main .history-screen .history-card{min-width:0;margin:0 0 10px;padding:13px;border:1px solid #eadfcb;border-radius:17px;background:#fffdfa;box-shadow:0 4px 12px #3a290c0f}
#main .history-screen .history-card-head,html:not(:lang(zh)) #main .history-screen .history-card-head{display:grid;grid-template-columns:48px minmax(0,1fr);gap:4px 10px;align-items:start;min-width:0}
#main .history-screen .history-card-icon{grid-row:1 / span 2;position:relative;display:block;width:48px;height:48px;min-width:48px;border:1px solid #e3d08b;border-radius:12px;overflow:hidden;background-color:#063d27;background-size:cover;background-position:center}
#main .history-screen .history-card-icon.art-0{background-image:url('/demo-product.jpg')}
#main .history-screen .history-card-icon.art-1{background-image:url('/catalog-accessories.jpg');background-size:200% 100%;background-position:left center}
#main .history-screen .history-card-icon.art-2{background-image:url('/catalog-accessories.jpg');background-size:200% 100%;background-position:right center}
#main .history-screen .history-card-icon:has(>.product-custom-image){background-image:none}
#main .history-screen .history-card-icon .product-custom-image{width:100%;height:100%;object-fit:cover}
#main .history-screen .history-card-head>div{min-width:0}
#main .history-screen .history-card-head h2{margin:0 0 3px;color:#172c20;font-size:15px;font-weight:800;line-height:1.35;overflow-wrap:anywhere}
#main .history-screen .history-meta{display:flex;align-items:center;flex-wrap:wrap;gap:2px 7px;min-width:0;margin-bottom:2px}
#main .history-screen .history-card-head .round-summary{display:inline-block;margin:0;color:#087341;font-size:12px;font-weight:800;line-height:1.4;overflow-wrap:anywhere}
#main .history-screen .history-card-head p{margin:0;color:#5b6d60;font-size:12px;line-height:1.4;overflow-wrap:anywhere}
#main .history-screen .history-card-head .history-published,html:not(:lang(zh)) #main .history-screen .history-card-head .history-published{padding:2px 6px;border-radius:6px;background:#e8f5e9;color:#176b39;font-size:11px;font-weight:800;line-height:1.3;overflow-wrap:anywhere}
#main .history-screen .history-divider{height:1px;margin:8px 0;background:#eee5d6}
#main .history-screen .history-result{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:0 7px;min-width:0;padding:7px 9px;border:1px solid #f1d79b;border-radius:13px;background:linear-gradient(130deg,#fffaf0,#fff1ce)}
#main .history-screen .history-number-label{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:3px 8px;margin:0 0 4px;color:#3b3829;font-size:13px;font-weight:800;line-height:1.4}
#main .history-screen .history-number-label span{color:#795727;font-size:12px;font-weight:650}
#main .history-screen .history-numbers{display:flex;flex-wrap:wrap;gap:5px;max-height:260px;padding:1px;overflow:auto;overscroll-behavior:contain}
#main .history-screen .history-numbers span{padding:4px 8px;border:1px solid #f0aaa1;border-radius:9px;background:#fff3ed;color:#c21a16;font-size:14px;font-weight:850;line-height:1.2;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#main .history-screen .history-result-body{min-width:0}
#main .history-screen .history-copy{display:grid;place-items:center;grid-column:2;grid-row:1;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:1px solid #bbd9c3;border-radius:10px;background:#f2f8f1;color:#075c31}
#main .history-screen .history-copy .ui-icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#main .history-screen .history-result-more{grid-column:1/-1;margin-top:4px;min-width:0}
#main .history-screen .history-expand{max-width:100%;min-height:44px;padding:6px 10px;border:1px solid #bbd9c3;border-radius:9px;background:#f2f8f1;color:#075c31;font-size:13px;font-weight:700;line-height:1.35;white-space:normal;overflow-wrap:anywhere}
#main .history-screen .history-copy-result{grid-column:1/-1;color:#426c4f;font-size:12px;line-height:1.4;overflow-wrap:anywhere}
#main .history-screen .history-copy-result:empty{display:none}
#main .history-screen :is(.history-search input,.history-search button,.history-filter select,.history-filter-tabs button,.history-copy,.history-expand):focus-visible{outline:3px solid #08784b;outline-offset:2px}
@media(max-width:350px){#main .history-screen .history-filter-grid{grid-template-columns:minmax(0,1fr)}#main .history-screen .history-card-head,html:not(:lang(zh)) #main .history-screen .history-card-head{grid-template-columns:48px minmax(0,1fr)}#main .history-screen .history-card-icon{width:48px;height:48px;min-width:48px}#main .history-screen .history-card{padding:12px}}

/* Draw history groups: identify a product before showing its individual rounds. */
#main .history-screen .history-top-action{color:#fff}
#main .history-screen .history-top-action svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#main .history-screen .history-product-group{min-width:0;margin:0 0 10px;border:1px solid #e7ddc9;border-radius:16px;background:#fffdfa;box-shadow:0 3px 11px #3a290c0e;overflow:hidden}
#main .history-screen .history-product-group[hidden]{display:none}
#main .history-screen .history-group-summary{display:grid;grid-template-columns:56px minmax(0,1fr) 18px;align-items:center;gap:10px;min-height:80px;padding:12px;cursor:pointer;list-style:none}
#main .history-screen .history-group-summary::-webkit-details-marker{display:none}
#main .history-screen .history-group-summary:focus-visible{outline:3px solid #08784b;outline-offset:-3px}
#main .history-screen .history-group-summary>.history-card-icon{grid-row:auto;width:56px;height:56px;min-width:56px;border-radius:11px}
#main .history-screen .history-group-info{display:grid;gap:3px;min-width:0;line-height:1.35}
#main .history-screen .history-group-info>strong{min-width:0;color:#173b2a;font-size:15px;font-weight:800;overflow-wrap:anywhere;word-break:normal}
#main .history-screen .history-group-info>small{min-width:0;color:#536b5a;font-size:12px;line-height:1.4;overflow-wrap:anywhere;word-break:normal}
#main .history-screen .history-group-count{color:#087341!important;font-weight:750}
#main .history-screen .history-group-arrow{display:grid;place-items:center;color:#357552;font-size:25px;line-height:1;transition:transform .15s}
#main .history-screen .history-product-group[open] .history-group-arrow{transform:rotate(90deg)}
#main .history-screen .history-group-periods{padding:0 12px 4px}
#main .history-screen .history-product-group .history-group-periods>.history-card{margin:0;padding:12px 0;border:0;border-top:1px solid #e8ecdf;border-radius:0;background:transparent;box-shadow:none}
#main .history-screen .history-product-group .history-group-periods .history-card-head,html:not(:lang(zh)) #main .history-screen .history-product-group .history-group-periods .history-card-head{display:block}
#main .history-screen .history-product-group .history-group-periods .history-card-head>.history-card-icon,#main .history-screen .history-product-group .history-group-periods .history-card-head h2:not(.history-prior-title){display:none}
#main .history-screen .history-product-group .history-group-periods .history-divider{margin:7px 0}

/* A separate trend page shares the same full-width header and touch targets. */
#main .history-trend-screen{min-width:0}
#main .history-trend-screen .history-trend-top{background:linear-gradient(110deg,#003c24,#087942);color:#fff}
#main .history-trend-screen .history-trend-top :is(h1,button){color:#fff}
#main .history-trend-screen .history-trend-top h1{flex:1;min-width:0;font-size:19px;line-height:1.25;text-align:center;overflow-wrap:anywhere;word-break:normal}
#main .history-trend-screen .history-trend-page{min-width:0;padding:14px 0 28px}
#main .history-trend-screen .history-trend-select{display:grid;gap:6px;min-width:0;margin:0 0 12px;color:#315a3d;font-size:13px;font-weight:750;line-height:1.35;overflow-wrap:anywhere}
#main .history-trend-screen .history-trend-select select{width:100%;min-width:0;min-height:44px;padding:9px 12px;border:1px solid #c7ddca;border-radius:10px;background:#fffdfa;color:#193e2b;font:inherit;font-size:14px}
#main .history-trend-screen .history-trend-select select:focus-visible,#main .history-trend-screen .history-trend-top button:focus-visible{outline:3px solid #e6b840;outline-offset:2px}
#main .history-trend-screen #historyTrendStandalone{min-width:0}
@media(max-width:350px){#main .history-screen .history-group-summary{grid-template-columns:50px minmax(0,1fr) 16px;padding:11px;gap:9px}#main .history-screen .history-group-summary>.history-card-icon{width:50px;height:50px;min-width:50px}}
@media(prefers-reduced-motion:reduce){#main .history-screen .history-group-arrow{transition:none}}

/* Keep long product histories easy to navigate without crowding the mobile screen. */
#main .history-screen .history-pagination{display:grid;gap:9px;min-width:0;padding:14px 0 12px;border-top:1px solid #e8ecdf}
#main .history-screen .history-pagination[hidden]{display:none}
#main .history-screen .history-pagination-info{min-width:0;color:#526b5a;font-size:13px;font-weight:700;line-height:1.4;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
#main .history-screen .history-pagination-actions{display:flex;flex-wrap:wrap;align-items:stretch;gap:8px;min-width:0}
#main .history-screen .history-page-button{flex:1 1 100px;min-width:0;min-height:44px;padding:8px 12px;border:1px solid #bcd8c1;border-radius:10px;background:#f3f8f1;color:#075c31;font:inherit;font-size:13px;font-weight:750;line-height:1.3;text-align:center;white-space:normal;overflow-wrap:anywhere}
#main .history-screen .history-page-button:disabled{border-color:#e3e8df;background:#f5f6f2;color:#7c8b7e;cursor:default}
#main .history-screen .history-page-jump{display:flex;flex:1 1 100%;align-items:center;gap:8px;min-width:0;color:#526b5a;font-size:13px;font-weight:700;line-height:1.3}
#main .history-screen .history-page-jump label{min-width:0;overflow-wrap:anywhere}
#main .history-screen .history-page-jump .history-page-input{flex:1 1 72px;min-width:55px;width:100%;min-height:44px;padding:8px;border:1px solid #cbdcce;border-radius:10px;background:#fff;color:#173b2a;font:inherit;font-size:14px;text-align:center;font-variant-numeric:tabular-nums}
#main .history-screen .history-page-jump .history-page-button{flex:0 1 auto;min-width:64px;border-color:#d8b34b;background:#fff5d7;color:#704e08}
#main .history-screen :is(.history-page-button,.history-page-input):focus-visible{outline:3px solid #08784b;outline-offset:2px}
@media(max-width:350px){#main .history-screen .history-page-jump{flex-wrap:wrap}#main .history-screen .history-page-jump .history-page-input{flex-basis:64px}}

/* One compact result row per round; long numbers and translated labels can wrap. */
#main .history-screen .history-product-group .history-group-periods>.history-card{display:grid;grid-template-columns:minmax(92px,.86fr) minmax(0,1.14fr);align-items:center;gap:8px;padding:10px 0}
#main .history-screen .history-product-group .history-group-periods .history-card-head{min-width:0}
#main .history-screen .history-product-group .history-group-periods .history-card-head .history-meta{gap:3px 5px;margin-bottom:3px}
#main .history-screen .history-product-group .history-group-periods .history-card-head .round-summary{font-size:12px;line-height:1.4}
#main .history-screen .history-product-group .history-group-periods .history-card-head p{font-size:11px;line-height:1.4}
#main .history-screen .history-product-group .history-group-periods .history-divider{display:none}
#main .history-screen .history-product-group .history-group-periods .history-result{min-width:0;padding:6px;border-radius:10px;gap:3px 5px}
#main .history-screen .history-product-group .history-group-periods .history-number-label{gap:2px 5px;margin-bottom:3px;font-size:12px;line-height:1.3;overflow-wrap:anywhere}
#main .history-screen .history-product-group .history-group-periods .history-number-label span{font-size:11px}
#main .history-screen .history-product-group .history-group-periods .history-numbers{gap:4px}
#main .history-screen .history-product-group .history-group-periods .history-numbers span{padding:3px 5px;font-size:13px}
#main .history-screen .history-product-group .history-group-periods .history-result-more{margin-top:0}
#main .history-screen .history-product-group .history-group-periods .history-expand{width:100%;min-height:44px;padding:6px;font-size:12px}
#main .history-screen .history-filter input[type="number"]{min-width:0;width:100%;min-height:44px;padding:7px 9px;border:1px solid #ccdfce;border-radius:9px;background:#fff;color:#193e2b;font:inherit;font-size:13px}
#main .history-screen .history-filter input[type="number"]:focus-visible{outline:3px solid #08784b;outline-offset:2px}
@media(max-width:350px){#main .history-screen .history-product-group .history-group-periods>.history-card{grid-template-columns:minmax(82px,.8fr) minmax(0,1.2fr);gap:7px}}

/* Async history requests should remain readable in every supported language. */
#main .history-screen :is(.history-loading,.history-error){min-width:0;max-width:100%;overflow-wrap:anywhere;word-break:normal}
#main .history-screen .history-loading{margin:8px 0;color:#526b5a;line-height:1.5}
#main .history-screen .history-error :is(h2,p){overflow-wrap:anywhere}
#main .history-screen .history-error button{max-width:100%;white-space:normal;overflow-wrap:anywhere;line-height:1.35}
#main .history-screen #historyServerRetry{max-width:100%;min-height:44px;margin:0 0 12px;padding:8px 14px;border:1px solid #a83028;border-radius:9px;background:#a83028;color:#fff;font:inherit;font-size:13px;font-weight:700;line-height:1.35;white-space:normal;overflow-wrap:anywhere}
#main .history-screen #historyServerRetry[hidden]{display:none}
#main .history-screen #historyServerRetry:focus-visible{outline:3px solid #08784b;outline-offset:2px}
/* The shared empty state uses display:flex, so explicitly honour hidden. */
#main .history-screen :is(#historyServerEmpty,#historyServerStatus,#historyServerRetry,#historyNoMatches,#historyServerGroups)[hidden]{display:none!important}

/* Consistent product sale states on home, catalog and detail. */
#main :is(.home-products,.catalog-grid,.product-detail-page) .product-status-badge[data-sale-status]{max-width:calc(100% - 12px);padding:5px 8px;border:1px solid #ffffff80;border-radius:8px;color:#fff;font-size:11px;font-weight:800;line-height:1.2;text-align:left;white-space:normal;overflow-wrap:anywhere;box-shadow:0 2px 5px #2b120f30}
#main :is(.home-products,.catalog-grid,.product-detail-page) .product-status-badge[data-sale-status="selling"]{background:linear-gradient(155deg,#d62820,#b71416)}
#main :is(.home-products,.catalog-grid,.product-detail-page) .product-status-badge[data-sale-status="drawn"]{background:#325e75}
#main :is(.home-products,.catalog-grid,.product-detail-page) .product-status-badge[data-sale-status="sold"]{background:#54635c}
#main :is(.home-products,.catalog-grid,.product-detail-page) .product-status-badge[data-sale-status="held"]{background:#83531a}
#main :is(.home-products,.catalog-grid,.product-detail-page) .product-status-badge[data-sale-status="unconfigured"]{background:#83531a}

/* Server-paged order numbers keep search and navigation outside the scroll area. */
#main .mock-order .number-extra{display:block;max-height:none;overflow:visible;margin-top:8px}
#main .mock-order .number-extra[hidden]{display:none}
#main .order-number-search{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:12px;color:#41644e}
#main .order-number-search input{min-width:0;flex:1 1 100px;min-height:38px;padding:6px 9px;border:1px solid #cbdccd;border-radius:10px;background:#fff}
#main .order-number-results{max-height:160px;overflow-y:auto;overscroll-behavior:contain;margin:6px 0}
#main :is(.order-number-pages,.order-page-controls){display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;margin:10px 0;font-size:12px}
#main :is(.order-number-pages,.order-page-controls) button{min-height:40px;padding:6px 10px;border:1px solid #cbdccd;border-radius:10px;background:#fff;color:#08612c}

/* Account: align the four counters and leave room for longer translations. */
#main .account-screen .account-stats button{align-content:start;grid-template-rows:24px 24px minmax(16px,auto)}
#main .account-screen .account-menu .account-row:not(:has(.account-points-balance,.account-language-name,.coupon-count,.unread-dot)) strong{grid-column:2 / 4}
#main .account-screen .account-menu #accountLanguage{grid-template-columns:24px minmax(0,1fr) minmax(0,120px) 10px}
#main .account-screen .account-menu .account-row{column-gap:6px}
/* Give the localized coupon count its natural width; the label can wrap at words. */
#main .account-screen .account-menu .account-row:has(.coupon-count){grid-template-columns:24px minmax(0,1fr) max-content 10px}
html #main .account-screen .account-menu .account-row .coupon-count{justify-self:end;min-width:max-content;max-width:none;white-space:nowrap;overflow-wrap:normal}
#main .account-screen .account-trust{padding-inline:30px}
#main .account-screen .account-trust .trust-shield{flex:0 0 auto}
#main .account-screen .account-trust strong{min-width:0;text-align:center}

/* The empty-state icon and its message share a central axis. */
#main .points-empty .ui-icon{display:block;margin-inline:auto}

/* Keep the language chooser close control in the top-right corner. */
dialog.language-dialog{scrollbar-width:none}
dialog.language-dialog::-webkit-scrollbar{display:none}
dialog.language-dialog .language-dialog-head{position:sticky;top:-22px;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-22px -22px 12px;padding:18px 22px 12px;background:#fffdfa;border-bottom:1px solid #e4eade}
dialog.language-dialog .language-dialog-head h2{flex:1;min-width:0;margin:0;color:#123d2b;font-size:18px;line-height:1.4;overflow-wrap:anywhere}
dialog.language-dialog .language-dialog-close{display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;min-height:36px;margin:0;padding:0;border:1px solid #d8e5d6;border-radius:9px;background:#f3f8ef;color:#164b32;font-size:24px;line-height:1}
dialog.language-dialog .language-dialog-close:focus-visible{outline:3px solid #afca69;outline-offset:2px}

/* Shared title rows for the remaining app dialogs. */
:is(.install-help-head,.app-dialog-head,.legacy-shipping-head){display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px;padding:0 0 12px;border-bottom:1px solid #e4eade}
:is(.install-help-head,.app-dialog-head,.legacy-shipping-head) h2{flex:1;min-width:0;margin:0;color:#123d2b;font-size:18px;line-height:1.4;overflow-wrap:anywhere}
:is(.install-help-head,.app-dialog-head,.legacy-shipping-head) :is(.install-help-close,.app-dialog-close,.legacy-shipping-close){display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;min-height:36px;margin:0;padding:0;border:1px solid #d8e5d6;border-radius:9px;background:#f3f8ef;color:#164b32;font-size:24px;font-weight:400;line-height:1}
:is(.install-help-head,.app-dialog-head,.legacy-shipping-head) :is(.install-help-close,.app-dialog-close,.legacy-shipping-close):focus-visible{outline:3px solid #afca69;outline-offset:2px}
