/* Phone layouts share the same pages, forms and permissions as desktop. */
.mobile-menu-toggle,.mobile-admin-nav{display:none}
.mobile-drawer{position:fixed;inset:0 auto 0 0;margin:0;width:min(310px,86vw);height:100dvh;max-height:100dvh;max-width:86vw;border:0;border-radius:0 22px 22px 0;padding:0;background:#fff;color:#172033;box-shadow:12px 0 60px #17203326;overflow:auto}
.mobile-drawer::backdrop{background:#152a4266;backdrop-filter:blur(2px)}
.mobile-drawer-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:20px 18px;border-bottom:1px solid #e3eaee}
.mobile-drawer-heading strong{font-size:17px}
.mobile-drawer-close{width:44px;height:44px;flex:none;background:#f2f6f7;border-radius:12px;font-size:26px;color:#5b6c7c}
.mobile-drawer-links{padding:14px 12px calc(24px + env(safe-area-inset-bottom));display:grid;gap:7px}
.mobile-drawer-links a{display:flex;align-items:center;gap:12px;padding:14px 16px;min-height:52px;border-radius:12px;color:#536779;font-size:15px}
.mobile-drawer-links a svg{width:22px;height:22px;flex:none}
.mobile-drawer-links a:hover,.mobile-drawer-links a[aria-current=page]{background:#e7f6f1;color:#087f75;font-weight:700}
.mobile-drawer-open{overflow:hidden}
@media(max-width:760px){
  html{scroll-padding-top:80px;-webkit-text-size-adjust:100%}
  body{padding-bottom:calc(76px + env(safe-area-inset-bottom));font-size:14px;line-height:1.65}
  *,*::before,*::after{box-sizing:border-box}
  [hidden]{display:none!important}
  .shop-shell,.shell{width:calc(100% - 28px)}
  .shop-shell,.admin-main,.account-main,.order-main{padding-top:20px;padding-bottom:28px}
  main>h1,.shop-heading h1,.admin-main h1,.account-main h1,.order-main h1{font-size:25px;line-height:1.35;letter-spacing:-.03em}
  p{overflow-wrap:anywhere}
  input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px;min-height:46px;min-width:0}
  button,a,input,select,textarea{-webkit-tap-highlight-color:transparent;touch-action:manipulation}
  .primary-button,.secondary-button,.buy-button,.filter{min-height:44px;display:inline-flex;align-items:center;justify-content:center;font-size:14px}
  .shop-header{min-height:64px;height:auto;padding:10px 14px;gap:8px;background:#fff;box-shadow:0 2px 14px #17203306}
  .shop-header .brand{font-size:18px;flex:1;min-width:0;gap:9px}
  .shop-header .brand-icon{width:34px;height:34px;border-radius:10px}
  .brand small{font-size:9px;letter-spacing:.14em}
  .shop-header .account-link{min-height:42px;display:flex;align-items:center;padding:8px 10px;font-size:12px;white-space:nowrap}
  .mobile-menu-toggle{display:flex;align-items:center;justify-content:center;gap:5px;border:1px solid #dce7e8;border-radius:10px;background:#fff;color:#34505a;min-height:42px;padding:8px 10px;font-size:12px}
  .mobile-menu-toggle svg{width:17px;height:17px}
  .mobile-enhanced .shop-header .mobile-original-nav{display:none}
  .shop-header .reference-top-nav a{min-height:46px;justify-content:flex-start;padding:10px 12px;font-size:13px;background:#f3f7f8;border-radius:10px}
  .shop-header .reference-top-nav a svg{width:19px;height:19px;flex:none}
  .shop-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:start;margin-bottom:16px}
  .shop-heading .eyebrow{display:none}
  .shop-heading h1{font-size:23px;margin:0 0 8px}
  .shop-heading p{font-size:12px;margin:0}
  .shop-heading .secondary-button{min-height:40px;font-size:12px;padding:8px 10px}
  .shop-banner{padding:12px 14px;gap:6px 12px;font-size:12px;margin-bottom:16px;border-radius:12px}
  .shop-banner>span:first-child{font-weight:700}
  .shop-banner #store-status{margin-left:auto}
  .shop-banner a{min-height:32px;display:flex;align-items:center}
  .catalog-layout{display:grid;grid-template-columns:100px minmax(0,1fr);gap:10px;align-items:start}
  .catalog-layout>section{min-width:0;width:100%}
  .category-panel{position:sticky;top:165px;width:100%;padding:8px 5px;margin:0;border-radius:12px;max-height:calc(100dvh - 245px);overflow-y:auto;scrollbar-width:thin}
  .category-panel>h2{display:block;font-size:14px;margin:3px 4px 10px;line-height:1.4}
  .category-panel .filters{display:flex;flex-direction:column;flex-wrap:nowrap;overflow:visible;gap:5px}
  .category-panel .filter{width:100%;flex:none;min-height:52px;padding:8px 4px;gap:5px;font-size:11px;justify-content:flex-start;border-radius:8px;text-align:left}
  .category-icon{width:20px;height:22px}
  .category-icon svg,.category-icon .brand-logo,.category-icon .chatgpt-logo{width:20px;height:20px}
  .category-name{white-space:normal;line-height:1.35;overflow-wrap:anywhere}
  .category-total{display:none}
  .catalog-toolbar{display:flex;flex-direction:column;gap:12px;margin-bottom:14px}
  .catalog-toolbar>div{display:flex;align-items:center;gap:8px;order:1}
  .catalog-toolbar .eyebrow{display:none}
  .catalog-toolbar h2{margin:0;font-size:20px}
  .catalog-toolbar h2 small{margin-left:6px;font-size:12px}
  .search{order:2;max-width:none;border-radius:12px;box-shadow:0 3px 10px #17203303}
  .search input{padding:13px 14px;min-height:48px}
  .lottery-catalog-banner{margin-bottom:14px;padding:12px 14px;gap:10px;border-radius:12px}
  .lottery-catalog-banner strong{font-size:14px}
  .lottery-catalog-banner small{font-size:11px;line-height:1.5}
  .lottery-catalog-banner>span:last-child{font-size:12px}
  .product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .product-card{padding:14px 12px;min-height:0;border-radius:14px;display:flex;flex-direction:column;box-shadow:0 4px 18px #17203305}
  .product-image{width:46px;height:46px;border-radius:12px;margin-bottom:12px}
  .product-image .brand-logo,.product-image .chatgpt-logo{width:32px;height:32px}
  .product-content{display:flex;flex-direction:column;flex:1;min-width:0;padding:0}
  .product-labels{font-size:10px;gap:4px;flex-wrap:wrap;justify-content:flex-start}
  .product-content h3{font-size:14px;line-height:1.5;min-height:0;margin:9px 0;overflow-wrap:anywhere}
  .product-content p{font-size:12px;min-height:0;margin:0 0 12px;line-height:1.6}
  .product-bottom{margin-top:auto;display:flex;align-items:stretch;flex-direction:column;gap:9px;padding-top:5px}
  .product-bottom .price{font-size:23px;line-height:1.2}
  .product-bottom .buy-button{width:100%;font-size:13px;min-height:40px}
  .product-detail-link{font-size:12px;min-height:36px;display:flex;align-items:center;margin:6px 0 -4px;color:#526979}
  .mobile-nav{height:calc(64px + env(safe-area-inset-bottom));padding:5px 8px calc(5px + env(safe-area-inset-bottom));gap:2px;background:#fffffffa;backdrop-filter:blur(16px);box-shadow:0 -4px 20px #17203306;z-index:30}
  .mobile-nav a{min-width:0;flex:1;min-height:52px;padding:5px 2px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border-radius:10px;font-size:11px;color:#6a7888;line-height:1.4}
  .mobile-nav svg{width:21px;height:21px}
  .mobile-nav a[aria-current=page]{color:#087f75;background:#eaf7f4;font-weight:700}
  .support-launcher{right:14px;bottom:calc(82px + env(safe-area-inset-bottom));width:48px;height:48px;padding:0;justify-content:center;border-radius:16px}
  .support-launcher>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .panel,.admin-card,.order-panel{border-radius:14px;padding:18px 16px;margin:0 0 16px;min-width:0}
  .panel h2,.admin-card h2,.order-panel h2{font-size:20px;margin:0 0 14px}
  .detail-layout{gap:12px;margin:14px 0}
  .detail-art{min-height:112px;border-radius:14px;font-size:60px}
  .detail-art .brand-logo,.detail-art .chatgpt-logo{height:66px;width:66px}
  .detail-layout h1{font-size:24px}
  #product-order-form .primary-button{width:100%;min-height:48px}
  .back-link{display:inline-flex;align-items:center;min-height:40px;font-size:13px}
  .checkout-dialog,.promotion-dialog{width:calc(100% - 20px);max-height:calc(100dvh - 24px);overflow-y:auto;padding:20px 18px;border-radius:18px}
  .dialog-close,.support-close{min-width:44px;min-height:44px}
  .checkout-dialog h2{font-size:22px}
  .checkout-dialog fieldset{gap:8px}
  .checkout-dialog fieldset label{min-height:44px;padding:8px 12px;border:1px solid #dce7e8;border-radius:9px;margin:4px 0}
  .shop-footer{padding:24px 16px 40px;line-height:1.8;font-size:12px}
  .shop-footer>a{display:inline-flex;min-height:38px;align-items:center;margin:0 4px}
  .shop-footer small{display:block;font-size:11px}
  .lottery-page .shop-heading{display:flex;flex-wrap:wrap}
  .lottery-prize-grid,.lottery-page .lottery-prize-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .lottery-prize{padding:16px 10px;min-height:160px}
  .lottery-prize strong{font-size:14px}
  .lottery-prize small,.prize-probability{font-size:12px}
  .lottery-guide{font-size:12px}
  .lottery-action button{width:100%;min-width:0;min-height:48px}
  .lottery-live-counts span{font-size:12px}
  .lottery-editor-fields,.lottery-control-grid,.payment-config-grid{grid-template-columns:1fr;gap:12px}
  .lottery-editor-fields label:nth-child(2){grid-column:auto}
  .lottery-prize-editor{padding:14px}
  .lottery-editor-actions{width:100%;display:grid;grid-template-columns:1fr 1fr 1.3fr}
  .lottery-editor-actions button{min-height:42px;font-size:12px}
  .lottery-save-bar{bottom:calc(76px + env(safe-area-inset-bottom));padding:12px}
  .lottery-admin-page .admin-shortcuts a{display:none}
  .admin-card form{gap:12px}
  .admin-card form label{margin:6px 0;font-size:14px;min-width:0}
  .admin-card form .primary-button,.admin-form-actions>button,.support-admin-actions>button{width:100%;min-height:46px}
  .admin-form-actions,.support-admin-actions{display:grid;grid-template-columns:1fr;gap:10px}
  .admin-hint{font-size:13px;line-height:1.7}
  .inventory-summary{gap:8px;margin:16px 0}
  .inventory-stat{padding:12px 8px;border-radius:10px;min-width:0}
  .inventory-stat span{font-size:11px}
  .inventory-stat strong{font-size:21px}
  .inventory-toolbar{display:grid;grid-template-columns:1fr;gap:10px;margin:16px 0}
  .inventory-toolbar label{min-width:0;margin:0;font-size:13px}
  .inventory-list{max-height:none;overflow:visible;display:grid;gap:12px}
  .inventory-list .inventory-product-row{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding:15px;border:1px solid #dfe8eb;border-radius:12px;background:#fbfcfd}
  .inventory-list strong{white-space:normal;overflow-wrap:anywhere;font-size:14px;line-height:1.6}
  .inventory-product-description small,.inventory-product-counts small{font-size:12px}
  .inventory-product-counts{flex-direction:row;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:6px}
  .inventory-product-counts .inventory-out-of-stock{color:#b83232}
  .inventory-row-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;grid-column:auto}
  .inventory-row-actions .secondary-button,.inventory-import-link{min-height:44px;display:flex;align-items:center;justify-content:center;font-size:13px;padding:8px;border-radius:9px}
  .inventory-import-link{background:#e7f5f1;border:1px solid #c1e3d9;color:#087f75;font-weight:650}
  .inventory-detail-heading{align-items:flex-start;flex-direction:column}
  .inventory-detail-heading h3{overflow-wrap:anywhere;margin:0}
  .inventory-detail-panel{padding:12px;scroll-margin-top:80px}
  .inventory-card-heading{flex-wrap:wrap}
  .inventory-card-row{padding:12px}
  .inventory-pagination{gap:8px;flex-wrap:wrap}
  .inventory-pagination span{font-size:12px;order:-1;width:100%;text-align:center}
  .inventory-pagination button{flex:1;min-height:44px;font-size:13px}
  .lottery-switch input,.payment-toggle input,.inventory-card-select input,.inventory-select-all input{flex:none;min-width:20px;width:20px!important;height:20px}
  .affiliate-level-row{grid-template-columns:1fr;padding:14px}
  .affiliate-level-row label:last-child{grid-column:auto}
  .admin-title-row{gap:10px;flex-wrap:wrap}
  .admin-shortcuts{gap:8px}
  .admin-shortcuts a{min-height:44px;display:flex;align-items:center;justify-content:center;font-size:13px;flex:1 0 42%}
  .mobile-admin .shop-header .reference-top-nav,.mobile-admin .mobile-nav{display:none!important}
  .mobile-admin{padding-bottom:0}
  .mobile-admin>.header,.mobile-admin>.footer{display:none}
  .mobile-admin .admin-main>.order-intro{font-size:12px;margin-bottom:18px}
  .mobile-admin #admin-content>.admin-shortcuts{display:none}
  .mobile-admin-nav{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:16px 0;background:#fff;border:1px solid #dce7e8;border-radius:14px;padding:12px}
  .mobile-admin-nav strong{font-size:15px}
  .mobile-admin-nav button{font-size:12px;padding:8px 10px}
  .mobile-admin [data-admin-group]:not(.mobile-panel-active){display:none!important}
  .mobile-admin #admin-content>.admin-actions{margin:0 0 16px;font-size:12px;order:-1}
  .mobile-admin #admin-content{display:flex;flex-direction:column}
  .mobile-admin #admin-content>.mobile-admin-nav{order:-2}
  .mobile-admin #admin-content>.admin-card{scroll-margin-top:80px}
  .mobile-admin .lottery-save-bar{bottom:12px}
}
@media(max-width:359px){
  .shop-shell,.shell{width:calc(100% - 20px)}
  .shop-header{padding:10px;gap:6px}
  .shop-header .brand{font-size:16px;gap:6px}
  .shop-header .brand-icon{width:29px;height:29px}
  .shop-header .account-link,.mobile-menu-toggle{font-size:11px;padding:7px}
  .shop-heading{grid-template-columns:1fr}
  .shop-heading .secondary-button{justify-self:start}
  .catalog-layout{grid-template-columns:82px minmax(0,1fr);gap:8px}
  .category-panel .filter{font-size:10px;gap:4px}
  .product-card{padding:12px 10px}
  .product-content h3{font-size:13px}
  .panel,.admin-card,.order-panel{padding:16px 12px}
  .lottery-live-counts span{font-size:11px}
}

/* Keep the storefront's desktop arrangement visible on phones. */
@media(max-width:760px){
  .mobile-storefront .shop-header{padding-bottom:6px}
  .mobile-storefront .shop-header .reference-top-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));order:3;flex:none;width:100%;gap:4px;padding:7px 0 0;overflow:visible}
  .mobile-storefront .reference-top-nav a{min-height:40px;padding:6px 3px;gap:4px;font-size:11px;justify-content:center;border-radius:8px;background:transparent}
  .mobile-storefront .reference-top-nav a svg{width:15px;height:15px}
  .mobile-storefront .reference-top-nav .nav-promo{background:linear-gradient(110deg,#ffdf9f,#ffbdd7)}
  .mobile-storefront .reference-top-nav .nav-new{background:linear-gradient(110deg,#ffedcd,#ffddec)}
  .mobile-storefront .reference-top-nav a[href="/"]{background:#e5f5f4}
  .mobile-storefront .shop-shell{padding-top:18px}
  .catalog-layout .product-grid{gap:8px}
  .catalog-layout .product-card{padding:12px 9px;border-radius:12px}
  .catalog-layout .product-image{width:40px;height:40px;margin-bottom:10px}
  .catalog-layout .product-image .brand-logo,.catalog-layout .product-image .chatgpt-logo{width:29px;height:29px}
  .catalog-layout .product-content h3{font-size:12px;line-height:1.55;margin:8px 0}
  .catalog-layout .product-content p{font-size:11px;line-height:1.6;margin-bottom:10px}
  .catalog-layout .product-labels{font-size:9px}
  .catalog-layout .product-bottom .price{font-size:21px}
  .catalog-layout .buy-button{font-size:11px;padding:8px 4px}
  .catalog-layout .product-detail-link{font-size:11px;min-height:40px}
  .catalog-layout .lottery-catalog-banner{padding:12px 10px;gap:8px;flex-wrap:wrap}
  .catalog-layout .lottery-catalog-banner>div{flex:1;min-width:0}
  .catalog-layout .lottery-catalog-banner strong{font-size:13px}
  .catalog-layout .lottery-catalog-banner small{font-size:11px}
  .catalog-layout .lottery-catalog-banner>span:last-child{margin-left:auto;font-size:11px}
  .catalog-layout .lottery-gift{font-size:24px}
  .catalog-toolbar h2{font-size:18px}
  .catalog-toolbar h2 small{font-size:11px}
  .catalog-toolbar .search input{font-size:16px;padding:10px;min-height:44px}
  .mobile-storefront section[id],.mobile-storefront div[id]{scroll-margin-top:170px}
}
@media(max-width:359px){
  .mobile-storefront .reference-top-nav a{font-size:10px;gap:3px}
  .catalog-layout .product-grid{grid-template-columns:minmax(0,1fr)}
  .catalog-layout .product-content h3{font-size:14px}
  .catalog-layout .product-labels{font-size:10px}
  .catalog-layout .product-content p{font-size:12px}
}
