/* Phone/tablet layer. Desktop >= 1024px keeps its reviewed layout. */
@media (max-width: 1023px) {
  :root { --mobile-gutter: max(20px,env(safe-area-inset-left),env(safe-area-inset-right)); }
  html { scroll-padding-top: 64px; }
  body { -webkit-text-size-adjust: 100%; }
  .wrap { width: calc(100% - var(--mobile-gutter) * 2) !important; max-width: 100% !important; padding-inline: 0; }
  .page :is(h1,h2,h3,p), .modal :is(h3,p) { overflow-wrap: anywhere; }
  .page img { max-width: 100%; }
  input:not([type=checkbox]):not([type=radio]), select, textarea { min-width: 0; font-size: 16px !important; }
  button, a, input, select, textarea, [role=button] { touch-action: manipulation; }
  :is(button,a,[tabindex]):focus-visible { outline: 3px solid #0058a3; outline-offset: 3px; }
  .topbar { display: none !important; }
  .header { position: relative !important; min-height: 68px !important; }
  .header .wrap { display: grid !important; grid-template-columns: minmax(0,1fr) auto !important; grid-template-rows: 52px; height: auto !important; min-height: 68px !important; gap: 0 4px !important; padding: 8px 0 !important; }
  .header.sf-search-open .wrap { grid-template-rows: 52px 48px; row-gap: 4px !important; }
  .brand { gap: 8px !important; min-width: 0; }
  .brand-logo { width: 36px !important; height: 36px !important; flex: 0 0 36px; font-size: 20px !important; }
  .brand-cn { font-size: 16px !important; letter-spacing: 0 !important; }
  .brand-en { display: none !important; }
  .user-actions { display: none !important; }
  .sf-mobile-tools { display: flex; grid-column: 2; grid-row: 1; gap: 4px; }
  .sf-mobile-tools button { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; font-size: 23px; }
  .user-actions .action-btn { display: flex !important; width: 44px; height: 44px; min-width: 44px !important; padding: 0 !important; justify-content: center; }
  .user-actions .action-btn span:not(.badge) { display: none !important; }
  .user-actions .action-btn .badge { font-size: 10px; right: 1px; top: 0; }
  .search-area { display: none; grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0; }
  .sf-search-open .search-area { display: block; }
  .sf-global-search { width: 100%; height: 46px; }
  .sf-global-search input { width: 100%; min-width: 0; padding-left: 16px; }
  .sf-global-search button { width: 48px; min-width: 48px; height: 46px; }
  .sf-nav-shell { position: sticky; top: 0; z-index: 1090; }
  .sf-nav-shell .sf-primary-nav .wrap { width: 100% !important; min-height: 48px; padding: 0 var(--mobile-gutter); gap: 24px; overflow-x: auto; overscroll-behavior-x: contain; }
  .sf-primary-nav button { min-height: 48px; font-size: 14px; }
  .page-back-bar { padding: 10px var(--mobile-gutter); margin: 0; width: 100%; }
  .page-back-button { min-height: 44px; }

  /* Touch navigation is a scrollable sheet with a persistent close action. */
  body.sf-mega-open { overflow: hidden; }
  body.sf-mega-open .sf-nav-shell { z-index: 1300; }
  .sf-mega-stack { z-index: 4; }
  .sf-mega-panel:not([hidden]) { display: block !important; position: fixed; inset: 0; height: 100vh; height: 100dvh; z-index: 1300; overflow-y: auto; overscroll-behavior: contain; animation: none; }
  .sf-mega-panel .sf-mega-inner { width: 100% !important; max-height: none; padding: 0 var(--mobile-gutter) max(28px,env(safe-area-inset-bottom)); overflow: visible; }
  .sf-mobile-menu-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; z-index: 3; min-height: 64px; margin-bottom: 20px; padding-top: env(safe-area-inset-top); background: #fff; border-bottom: 1px solid #ddd; }
  .sf-mobile-menu-head button { width: 44px; height: 44px; border: 0; background: #f5f5f5; border-radius: 50%; font-size: 24px; }
  .sf-mobile-account-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
  .sf-mobile-account-links button { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid #ddd; background: white; }
  .sf-mega-catalog, .sf-mega-service-columns, .sf-mega-inspiration, .sf-mega-business { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .sf-mega-catalog aside { border: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
  .sf-mega-catalog aside :is(h2,.sf-mega-kicker) { display: none; }
  .sf-mega-catalog aside button { width: auto; min-height: 44px; padding: 8px 12px; background: #f5f5f5; border-radius: 4px; font-size: 14px; }
  .sf-mega-catalog aside button.active { border: 0; background: #0058a3; color: white; }
  .sf-mega-catalog aside button i { display: none; }
  .sf-mega-link-columns { grid-template-columns: minmax(0,1fr); }
  .sf-mega-link-columns > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sf-mega-link-columns strong { grid-column: 1 / -1; }
  .sf-mega-link-columns button { min-height: 44px; width: 100%; text-align: left; font-size: 15px; }
  .sf-mega-section-title { align-items: flex-start; gap: 12px; }
  .sf-mega-section-title h2, .sf-mega-section-title h3 { font-size: 24px; }
  .sf-mega-section-title > button { flex-shrink: 0; min-height: 44px; }
  .sf-mega-room-grid, .sf-mega-feature-grid, .sf-mega-new-grid, .sf-mega-inspiration-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
  .sf-mega-room { grid-template-columns: minmax(0,1fr) auto; gap: 10px; }
  .sf-mega-room-art { grid-column: 1 / -1; width: 100%; height: 120px; }
  .sf-mega-product-picks { grid-template-columns: 1fr; gap: 16px; }
  .sf-mega-product-pick strong { font-size: 14px; }
  .sf-mega-service-columns > div > button:not(.sf-mega-visual-link) { min-height: 48px; }
  .sf-mega-inspiration-list button { grid-template-columns: 1fr auto; }
  .sf-mega-inspiration-list img { grid-column: 1 / -1; width: 100%; height: 110px; }
  .sf-mega-business-grid { grid-template-columns: 1fr; }
  .sf-mega-business-grid button { min-height: 110px; }
  .sf-mega-app { grid-template-columns: 80px minmax(0,1fr); gap: 16px; }
  .sf-app-mark { width: 80px; height: 80px; }
  .sf-app-mark::before { inset: 10px; }
  .sf-mega-foot { flex-wrap: wrap; }

  /* Stacked, content-sized carousel: no fixed height can clip larger text. */
  #page-home > .storefront-home { width: 100% !important; max-width: none !important; padding: 0 0 48px; }
  #page-home .storefront-home > :not(.sf-hero-carousel) { width: calc(100% - var(--mobile-gutter) * 2); margin-inline: auto; }
  #page-home .sf-hero-carousel { width: 100%; height: auto; min-height: 0; margin: 0; display: grid; grid-template-columns: 52px minmax(0,1fr) auto 52px; background: #fff; color: #111; overflow: hidden; }
  .sf-hero-track { position: static; grid-column: 1 / -1; grid-row: 1; }
  .sf-hero-slide { position: static; display: none; grid-template-columns: minmax(0,1fr); transform: none; transition: none; }
  .sf-hero-slide.active { display: grid; }
  .sf-hero-scene { grid-column: 1; grid-row: 1; margin-left: 0; height: clamp(230px,65vw,420px); }
  .sf-hero-scene > img { transform: none !important; }
  .sf-hero-slide-copy { grid-column: 1; grid-row: 2; padding: 26px var(--mobile-gutter) 28px; min-height: 0; clip-path: none; }
  .sf-hero-slide-copy h1 { font-size: clamp(26px,6.8vw,38px); line-height: 1.25; margin: 12px 0; letter-spacing: -.03em; }
  .sf-hero-slide-copy > p { max-width: 600px; font-size: 14px; line-height: 1.7; }
  .sf-hero-slide-copy .sf-actions { margin-top: 20px; gap: 10px; }
  .sf-hero-slide-copy .sf-button { width: auto; min-height: 46px; padding: 12px 18px; font-size: 14px; }
  .sf-hero-product { width: min(270px,calc(100% - 40px)); right: 20px; bottom: 16px; padding: 10px; grid-template-columns: 44px minmax(0,1fr) 16px; gap: 10px; box-shadow: none; }
  .sf-hero-product-image { width: 44px; height: 44px; }
  .sf-hero-product-image img { object-fit: contain; }
  .sf-hero-product-copy strong { font-size: 12px; }
  .sf-hero-product-copy small { display: none; }
  .sf-hero-arrow { position: static; transform: none; grid-row: 2; width: 44px; height: 44px; margin: 8px 4px; font-size: 28px; background: #111; }
  .sf-hero-arrow.prev { grid-column: 1; }
  .sf-hero-arrow.next { grid-column: 4; }
  .sf-hero-controls { position: static; grid-row: 2; grid-column: 2; justify-self: center; align-self: center; transform: none; gap: 0; }
  .sf-hero-controls button { width: 32px; height: 44px; border: 14px solid transparent; border-inline-width: 10px; background: #ddd; background-clip: content-box; }
  .sf-hero-controls button span { background: #111; animation: none !important; }
  .sf-hero-pause { display: block; grid-row: 2; grid-column: 3; position: static; align-self: center; height: 44px; padding: 0 8px; border: 0; background: #fff; font-size: 12px; }
  .sf-hero-stats { position: static; grid-column: 1 / -1; grid-row: 3; display: flex; flex-wrap: wrap; gap: 6px; padding: 14px var(--mobile-gutter); border-block: 1px solid #ddd; color: #555; background: #fff; }
  .sf-hero-stats strong { font-size: 13px; }
  .sf-hero-stats span { font-size: 11px; margin-right: 8px; }
  #page-home .sf-section, #page-home .sf-campaign { margin-top: 40px !important; }
  .sf-section-head { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 20px; }
  .sf-section-head h2 { font-family: inherit; font-size: 26px; line-height: 1.3; }
  .sf-section-head p { font-size: 14px; line-height: 1.7; }
  .sf-eyebrow { font-size: 10px; letter-spacing: .12em; }
  .sf-text-link { min-height: 44px; display: inline-flex; align-items: center; }
  .sf-room-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px 12px; margin: 0; padding: 0; overflow: visible; }
  .sf-room-art { aspect-ratio: 4 / 5; }
  .sf-room-copy strong { font-size: 16px; }
  #page-home .category-grid { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 24px 12px !important; margin: 0; padding: 0; overflow: visible; }
  #page-home .category-card { padding: 0 !important; min-height: 0 !important; background: none !important; border: 0 !important; border-radius: 0 !important; }
  #page-home .category-card-icon, #page-home .category-card::after { display: none; }
  #page-home .category-card-art { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; background: #f5f4f1; }
  .category-card-art svg { width: 90%; height: 90%; }
  #page-home .category-card-name { font-size: 16px !important; margin-top: 12px !important; }
  #page-home .category-card-desc { font-size: 12px !important; margin-top: 4px !important; }
  .sf-featured-strip, .sf-ranking-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 26px 12px; border: 0; }
  .sf-featured-product { min-width: 0; }
  .sf-featured-media, .sf-ranked-media { aspect-ratio: 1; height: auto; background: #f5f5f5; }
  .sf-featured-media > img, .sf-ranked-media > img { object-fit: contain; padding: 12px; }
  .sf-featured-media > span, .sf-rank-number { display: none; }
  .sf-featured-media > button { opacity: 1; transform: none; min-height: 44px; right: 8px; bottom: 8px; padding-inline: 12px; font-size: 12px; }
  .sf-ranked-product { display: block; padding: 0; border: 0; }
  .sf-featured-copy, .sf-ranked-copy { padding: 12px 0 0; }
  .sf-featured-copy h3, .sf-ranked-copy h3 { font-size: 14px; line-height: 1.5; min-height: 42px; }
  .sf-featured-copy strong, .sf-ranked-copy strong { font-size: 22px; }
  .sf-campaign-panel { grid-template-columns: minmax(0,1fr); }
  .sf-campaign-media { min-height: 260px; }
  .sf-campaign-copy { padding: 24px; min-height: 0; }
  .sf-campaign-copy h2 { font-size: 28px; line-height: 1.3; }
  .sf-campaign-tabs { max-width: 100%; overflow-x: auto; }
  .sf-campaign-tabs button { flex-shrink: 0; min-height: 44px; }
  .sf-service-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sf-service-card { min-width: 0; padding: 20px 12px; grid-template-columns: 1fr; }

  /* Catalogue/search/favourites share readable two-column cards. */
  .list-page, .detail-page, .taxonomy-page { padding-top: 24px !important; padding-bottom: 56px !important; }
  .list-header { margin: 0 0 24px !important; padding: 0 !important; }
  .list-title, .search-page-title, .taxonomy-title { font-size: 28px !important; line-height: 1.3; }
  .list-filters { position: static !important; padding: 12px 0 !important; box-shadow: none; }
  .filter-row { display: block; padding: 0; }
  .filter-label { display: none; }
  .filter-options { display: flex; flex-wrap: nowrap; overflow-x: auto; width: 100%; gap: 8px; padding-bottom: 6px; }
  .filter-chip { flex: 0 0 auto; min-height: 44px !important; padding: 0 16px; font-size: 13px; border: 1px solid #ddd; }
  .list-toolbar { display: flex; flex-direction: column; gap: 14px; margin: 16px 0 24px !important; }
  .sort-tabs { width: 100%; overflow-x: auto; gap: 4px; }
  .sort-tab { flex-shrink: 0; min-height: 44px; padding: 10px 12px; font-size: 13px; }
  .list-grid, .recommend-grid, .search-results-grid, .favorites-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 28px 12px !important; }
  .product-card { min-width: 0; border: 0; box-shadow: none; border-radius: 0; }
  .product-card:hover { transform: none; box-shadow: none; }
  .product-image { aspect-ratio: 1; background: #f5f5f5 !important; border-radius: 0 !important; }
  .product-image img { object-fit: contain !important; padding: 10px; }
  .product-card:hover .product-image img { transform: none; }
  .product-info { padding: 12px 0 0 !important; }
  .product-title { font-size: 14px !important; line-height: 1.5 !important; height: 42px; min-height: 42px; margin: 0; }
  .product-price-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px !important; }
  .product-price { font-size: 22px !important; color: #111 !important; }
  .product-original { font-size: 11px; }
  .product-quick { display: none !important; }
  .product-mobile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
  .product-quick-btn { min-height: 44px !important; min-width: 0 !important; font-size: 13px !important; padding: 6px !important; border: 1px solid #ddd !important; color: #111 !important; }
  .product-quick-btn.primary { color: #fff !important; }
  .product-favorite-toggle { width: 44px; height: 44px; top: 4px; right: 4px; box-shadow: none; }
  .product-compare-toggle { top: auto; bottom: 4px; right: 4px; min-height: 44px; padding: 8px; background: #fff; }
  .product-badge { top: 8px; left: 8px; max-width: calc(100% - 60px); }
  .list-pagination { flex-wrap: wrap; gap: 8px; margin-top: 32px; }
  .list-pagination button { min-width: 44px; min-height: 44px; }
  .search-page-inner { padding-inline: 0 !important; }
  .search-page-bar { display: grid !important; grid-template-columns: minmax(0,1fr) 76px !important; }
  .search-page-bar select { grid-column: 1 / -1; }

  /* Compact product detail: media first, optional information, persistent actions. */
  body.sf-product-detail .sf-primary-nav, body.sf-product-detail .site-footer,
  body.sf-product-detail #customerServiceLauncher { display: none !important; }
  body.sf-product-detail .page-back-bar { padding: 0 12px; border-top: 1px solid #eee; }
  body.sf-product-detail .page-back-button { border: 0; padding: 8px; font-size: 12px; }
  #page-detail .detail-page { width: 100% !important; padding: 0 0 calc(104px + env(safe-area-inset-bottom)) !important; }
  #page-detail .detail-breadcrumb { display: none; }
  #page-detail .detail-container { padding: 0 !important; border: 0; box-shadow: none; border-radius: 0; background: #fff; }
  #page-detail .detail-main { grid-template-columns: minmax(0,1fr); gap: 20px; }
  #page-detail .detail-gallery { grid-template-columns: minmax(0,1fr); gap: 0; padding: 0; background: #f5f5f5 !important; }
  #page-detail .gallery-main { grid-column: 1; grid-row: 1; width: 100%; height: clamp(260px,82vw,400px); aspect-ratio: auto; background: #f5f5f5; border-radius: 0; }
  #page-detail .gallery-main > img { width: 100%; height: 100%; object-fit: contain; padding: 12px 20px; }
  #page-detail .gallery-thumbs, #page-detail .gallery-share, #page-detail .gallery-overlay-top { display: none; }
  #page-detail .gallery-arrow { opacity: 1; width: 44px; height: 44px; background: rgba(255,255,255,.9); color: #111; }
  #page-detail .gallery-counter { bottom: 8px; left: auto; right: 16px; width: auto; background: #fff; color: #555; font-size: 11px; }
  .detail-mobile-media { display: flex; grid-column: 1; grid-row: 2; justify-content: center; align-items: center; gap: 10px; padding: 4px 16px 12px; }
  .detail-mobile-media button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 24px; background: transparent; color: #555; font-size: 14px; font-weight: 600; }
  .detail-mobile-media button[aria-pressed=true] { background: #111; color: #fff; }
  .detail-mobile-media .detail-mobile-model { display: flex; align-items: center; gap: 6px; background: #fff; color: #0058a3; border: 1px solid #0058a3; }
  #page-detail .detail-right { display: flex; flex-direction: column; min-width: 0; padding: 0 var(--mobile-gutter); gap: 8px; }
  #page-detail .detail-shop-row, #page-detail .detail-meta { display: none; }
  #page-detail .detail-title { margin: 0; font-family: inherit !important; font-size: 20px; font-weight: 750; line-height: 1.4; letter-spacing: 0 !important; }
  #page-detail .detail-subtitle { margin: 0; color: #666; font-size: 12px; line-height: 1.5; }
  #page-detail .price-section { display: flex; flex-direction: column-reverse; gap: 4px; padding: 4px 0 12px; margin: 0; border: 0; background: transparent; border-radius: 0; }
  #page-detail .price-main { margin: 0; gap: 2px; }
  #page-detail .price-amount { font-size: 32px; line-height: 1.1; color: #111 !important; }
  #page-detail .price-currency { font-size: 17px; color: #111; }
  #page-detail .price-label { gap: 4px; font-size: 11px; line-height: 1.5; color: #777; }
  #page-detail .price-label > :not(.price-timer) { display: none; }
  #page-detail .price-timer { color: #777; }
  #page-detail .detail-fold { display: block; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }
  #page-detail .detail-fold > summary { display: grid; grid-template-columns: auto minmax(0,1fr) 16px; gap: 10px; align-items: center; min-height: 58px; list-style: none; cursor: pointer; font-size: 14px; font-weight: 600; }
  #page-detail .detail-fold > summary::-webkit-details-marker { display: none; }
  #page-detail .detail-fold > summary small { font-size: 12px; font-weight: 400; color: #777; text-align: right; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  #page-detail .detail-fold > summary::after { content: '+'; font-size: 22px; font-weight: 400; text-align: center; }
  #page-detail .detail-fold[open] > summary::after { content: '−'; }
  #page-detail .detail-more { margin: 16px var(--mobile-gutter) 0; scroll-margin-top: 12px; }
  #page-detail .detail-options .spec-section { padding: 8px 0 16px; }
  .spec-row { gap: 10px; }
  .spec-list { flex-wrap: wrap; }
  .spec-item { min-height: 44px; font-size: 14px; }
  .spec-delivery { flex-wrap: wrap; }
  #page-detail .detail-actions { margin: 0; gap: 0; }
  #page-detail .actions-primary { display: grid; grid-template-columns: 44px 44px minmax(0,1fr) minmax(0,1fr); gap: 6px; position: fixed; inset: auto 0 0; z-index: 1090; padding: 10px max(12px,env(safe-area-inset-left)) max(10px,env(safe-area-inset-bottom)); border-top: 1px solid #eee; background: #fff; box-shadow: 0 -4px 16px #00000005; }
  #page-detail .actions-primary .action-button { min-height: 48px !important; padding: 10px 6px !important; margin: 0; border-radius: 30px; font-size: 13px !important; letter-spacing: 0; }
  #page-detail .actions-primary .action-button i { display: none; }
  #page-detail .actions-primary .cart { border: 1px solid #0058a3 !important; color: #0058a3 !important; background: #fff !important; }
  #page-detail .actions-primary .model { border: 1px solid #0058a3 !important; color: #fff !important; background: #0058a3 !important; }
  #page-detail .detail-mobile-tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; padding: 0; border: 0; background: transparent; color: #111; font-size: 10px; }
  #page-detail .detail-mobile-tool i { font-size: 21px; line-height: 1; }
  #page-detail .detail-mobile-tool.is-favorite { color: #0058a3; }
  #page-detail .actions-secondary { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  #page-detail .actions-secondary .model { display: none; }
  #page-detail .actions-secondary .scene, #page-detail .detail-mobile-share { min-height: 44px !important; padding: 8px 0 !important; border: 0; border-radius: 0; background: transparent !important; font-size: 13px !important; font-weight: 500; color: #0058a3 !important; justify-content: flex-start; }
  #page-detail .detail-mobile-share { display: flex; align-items: center; gap: 6px; padding-inline: 8px !important; }
  body.modal-open #page-detail .actions-primary, body.sf-mega-open #page-detail .actions-primary { visibility: hidden; }
  body.sf-product-detail .compare-tray { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .service-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .service-item { font-size: 12px; }
  #page-detail .detail-tabs { position: static; display: flex; overflow-x: auto; padding: 0; gap: 20px; margin-top: 0; border-radius: 0; background: #fff; box-shadow: none; }
  .detail-tab { flex: 0 0 auto; min-height: 48px; padding: 14px 0; font-size: 14px; }
  #page-detail .detail-content { padding: 16px 0; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
  .params-table { width: 100%; table-layout: fixed; }
  .params-table :is(th,td) { padding: 12px 8px; font-size: 13px; overflow-wrap: anywhere; }
  .params-highlight { grid-template-columns: repeat(2,minmax(0,1fr)); }

  /* Account, forms, service pages and shopping flows. */
  .account-dashboard-head, .account-settings-grid, .cart-layout, .shipping-grid, .assistant-shell, .message-shell { grid-template-columns: minmax(0,1fr); }
  .account-page, .cart-page, .favorites-page, .message-page, .service-page, .shipping-page, .assistant-page { padding-inline: 0 !important; }
  .auth-panel { width: 100%; padding: 24px 16px; }
  .auth-field :is(input,select,textarea), .auth-primary, .auth-secondary, .auth-link { min-height: 44px; }
  .auth-actions, .auth-row, .account-identity-actions { flex-wrap: wrap; }
  .account-identity-actions button { min-height: 44px; }
  .account-title { overflow-wrap: anywhere; }
  .account-quick-grid button { min-width: 0; }
  .account-section-heading { flex-wrap: wrap; }
  .cart-layout { gap: 20px; }
  .cart-toolbar, .cart-page-head { flex-wrap: wrap; gap: 12px; }
  .cart-group-btn, .cart-create-group, .cart-text-button, .cart-item-remove, .cart-checkout { min-height: 44px; }
  .cart-item { grid-template-columns: 24px 64px minmax(0,1fr); gap: 12px; padding: 16px 12px; }
  .cart-item-image { width: 64px; height: 64px; object-fit: contain; }
  .cart-item-title { font-size: 14px; line-height: 1.5; }
  .cart-item-bottom { flex-wrap: wrap; gap: 10px; }
  .cart-item > div:last-child { grid-column: 3; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .cart-group-select { max-width: 100%; width: 100%; min-height: 44px; }
  .cart-quantity button { width: 44px; height: 44px; }
  .cart-summary { padding: 16px; flex-direction: column; align-items: stretch; }
  .cart-summary-total { display: flex; flex-wrap: wrap; gap: 12px; width: 100%; }
  .cart-checkout { flex: 1 0 100%; }
  .service-page-head { flex-wrap: wrap; gap: 16px; }
  .service-page-title, .cart-page-title { font-size: 28px; }
  .service-card { min-width: 0; padding: 20px 16px; }
  .service-form-grid { grid-template-columns: minmax(0,1fr); }
  .message-chat-body { height: 45vh; height: 45dvh; }
  .sf-footer-inner { width: calc(100% - var(--mobile-gutter) * 2); padding: 32px 0 max(80px,env(safe-area-inset-bottom)); }
  .sf-footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px 16px; }
  .sf-footer-brand { grid-column: 1 / -1; }
  .sf-footer-grid a, .sf-footer-grid button { min-height: 44px; display: inline-flex; align-items: center; }
  .sf-footer-bottom { flex-direction: column; align-items: flex-start; overflow-wrap: anywhere; }

  /* Safe areas and dynamic viewport keep close/submit controls reachable. */
  .modal { padding: max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); }
  .modal-content { width: 100% !important; max-width: 100%; height: auto; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 16px; border-radius: 8px; overflow-y: auto; overscroll-behavior: contain; }
  .modal-header { flex: 0 0 auto; align-items: flex-start; gap: 12px; }
  .modal-header > div { min-width: 0; }
  .modal-title { font-size: 20px; }
  .close-btn { width: 44px; height: 44px; flex: 0 0 44px; }
  #modelModal .modal-content { height: calc(100vh - 24px); height: calc(100dvh - 24px); }
  .model-container { min-height: 200px; }
  #taitaoCheckout { width: calc(100% - 24px); max-height: calc(100dvh - 24px); border-radius: 8px; }
  #taitaoCheckout .co-layout { grid-template-columns: minmax(0,1fr); }
  #taitaoCheckout .co-head { position: sticky; top: 0; z-index: 2; background: #fff; padding: 16px; }
  #taitaoCheckout .co-body, #taitaoCheckout .co-panel { padding: 16px; }
  #taitaoCheckout button, #taitaoCheckout input { min-height: 44px; }
  #compareTray:not(.visible) { visibility: hidden; pointer-events: none; }
  .compare-tray { left: 12px; right: 12px; bottom: max(12px,env(safe-area-inset-bottom)); width: auto; max-width: none; padding: 10px; gap: 10px; transform: translateY(130%); }
  .compare-tray.visible { transform: translateY(0); }
  .compare-tray-items { min-width: 0; flex: 1; overflow-x: auto; }
  .compare-tray-item { flex: 0 0 56px; width: 56px; }
  .compare-tray-item span { display: none; }
  .compare-tray-remove { min-width: 44px; min-height: 44px; }
  .compare-tray-action { min-height: 44px; }
  .compare-grid { display: grid; grid-template-columns: repeat(3,minmax(210px,1fr)); overflow-x: auto; }
  .customer-service-launcher { width: 48px; height: 48px; min-height: 48px; justify-content: center; padding: 0 !important; right: 12px; bottom: max(12px,env(safe-area-inset-bottom)); }
  .customer-service-launcher span { display: none; }
  body:has(.compare-tray.visible) .customer-service-launcher { bottom: 100px; }
  .customer-service-panel { right: 12px; bottom: max(72px,calc(env(safe-area-inset-bottom) + 60px)); width: calc(100% - 24px); height: min(570px,calc(100dvh - 100px)); }
  .customer-service-head button, .customer-service-form button, .customer-service-form input, .customer-service-quick button { min-height: 44px; }
  .customer-service-bubble { font-size: 14px; }
  .ml-toolbar, .ml-filters { flex-wrap: wrap; }
  .ml-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ml-card { min-width: 0; }
  .ih-page, .ih-detail { width: calc(100% - var(--mobile-gutter) * 2) !important; }
  .ih-hero, .ih-chapter { grid-template-columns: minmax(0,1fr); }
  .ih-detail-hero { height: 340px; }
  .ih-detail-intro h1 { font-size: 30px; }
  .ih-detail-hero > div { width: 80%; padding: 16px; }
  .ih-chapter-body, .ih-chapter:nth-of-type(even) .ih-chapter-body { padding: 24px 0; order: 2; }
  .ih-chapter:nth-of-type(even) .ih-chapter-scene { order: 1; }
  .ih-chapter-scene figure { height: 320px; }
  .ih-shop-grid, .ih-more-grid { grid-template-columns: minmax(0,1fr); }
  .ih-detail-jump a, .ih-product-foot button { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (max-width: 359px) {
  :root { --mobile-gutter: max(16px,env(safe-area-inset-left),env(safe-area-inset-right)); }
  .brand-text { display: none; }
  .sf-hero-slide-copy .sf-button { padding-inline: 14px; font-size: 13px; }
  #page-detail .actions-primary { grid-template-columns: 36px 36px minmax(0,1fr) minmax(0,1fr); gap: 4px; padding-inline: 8px; }
}
@media (min-width: 600px) and (max-width: 1023px) {
  :root { --mobile-gutter: max(28px,env(safe-area-inset-left),env(safe-area-inset-right)); }
  .sf-room-grid, #page-home .category-grid, .list-grid, .recommend-grid, .search-results-grid, .favorites-grid { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
  .sf-featured-strip, .sf-ranking-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .sf-hero-slide-copy { padding: 32px var(--mobile-gutter); }
  .sf-hero-slide-copy h1 { font-size: 36px; }
}
