/* JRSY v31 final responsive refinements: scalable laptops/tablets/phones.
   Deliberately makes no changes to the hero MP4 or the business launch flags. */
:root { --jrsy-safe-bottom: env(safe-area-inset-bottom, 0px); }
html,body { max-width:100%; }
#storefront { min-width:0; }
#collection .luxury-white-card, #studio .grid > div, #craft .grid > div { min-width:0; }
#collection .product-card-info h3 { overflow-wrap:anywhere; }
#collection .product-photo img { object-position:center center; }
#studio #labFit, #modalBox #mFit, #modalBox #mMaterial { overflow-wrap:anywhere; word-break:normal; }
#studio .grid-cols-3 { min-width:0; }
#modalBox .table-scroll { max-width:100%; }
#modalBox .table-scroll table { width:100%; }
#checkoutModal .checkout-summary { overflow-wrap:anywhere; }
#checkoutModal .checkout-fields label, #checkoutModal .checkout-fields input { min-width:0; }
#checkoutModal button, #productModal button, #cartDrawer button { touch-action:manipulation; }
.checkout-box .primary-button:focus-visible, .checkout-box .secondary-button:focus-visible {outline:3px solid #38634d; outline-offset:3px}
#cartDrawer .cart-line { overflow-wrap:anywhere; }
/* Laptop: maintain 2-column catalogue at small laptops, use readable text and spacing. */
@media (min-width:768px) and (max-width:1199px) {
  #collection, #studio, #craft, #sizeguide, #archive { padding-left:28px !important; padding-right:28px !important; }
  #productGrid { gap:19px; }
  #productGrid .luxury-white-card { padding:17px; }
  #studio > div:first-child { gap:18px; }
  #studio > div:first-child > div:last-child { flex-wrap:wrap; justify-content:flex-start; border-radius:18px; }
  #studio #labTitle { font-size:clamp(24px,3vw,39px); min-height:0; }
  #studio .grid-cols-3 { grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; }
  #studio .grid-cols-3 > div:last-child { grid-column:1/-1; border-top:1px solid #e4e4e7; padding-top:11px; }
  #studio #labFit { font-family:Montserrat,Arial,sans-serif; font-size:14px; font-weight:650; line-height:1.5; }
  .measurement-layout { gap:24px; }
  #modalBox { width:min(100%,920px); }
}
/* Larger monitors: cards and text remain balanced rather than excessively wide. */
@media (min-width:1200px) {
  #productGrid .product-card-info h3 { font-size:clamp(16px,1.2vw,20px); }
  #productGrid .product-view { letter-spacing:.09em; }
  #studio #labFit { font-size:clamp(13px,1.15vw,18px); line-height:1.45; }
}
/* Phone: checkout, consent and modal controls must be legible and thumb-friendly. */
@media (max-width:767px) {
  body { -webkit-text-size-adjust:100%; }
  #mainNavbar .header-brand img { object-fit:contain; }
  #collection .product-photo { aspect-ratio:1/1.13; }
  #collection .product-card-info { overflow-wrap:anywhere; }
  #collection .product-card-info h3 { font-size:clamp(17px,5vw,20px); }
  #studio .grid-cols-3 > div:last-child { text-align:left; }
  #studio #labFit { font-size:13px; }
  #productModal,#checkoutModal,#policyModal { padding:8px; }
  #modalBox { max-height:calc(100dvh - 16px); width:100%; }
  #productModal .size-button { min-width:44px; min-height:44px; }
  #productModal .product-size-guide { max-width:100%; overflow:hidden; }
  #cartDrawer #drawerPanel { width:100%; max-width:420px; padding:20px 18px max(18px,var(--jrsy-safe-bottom)); }
  #cartDrawer #cartList { -webkit-overflow-scrolling:touch; }
  #cartDrawer .cart-line { grid-template-columns:62px minmax(0,1fr); }
  #cartDrawer .quantity-button { width:38px; height:38px; font-size:18px; }
  #cartDrawer #checkoutBtn { min-height:51px; }
  #checkoutModal .checkout-box, #policyModal .policy-box {max-width:100%; max-height:calc(100dvh - 16px); padding:22px 17px max(22px,var(--jrsy-safe-bottom)); border-radius:17px; }
  #checkoutModal .checkout-box h2 {font-size:clamp(24px,7vw,30px); }
  #checkoutModal .checkout-intro { font-size:13px; line-height:1.6; }
  #checkoutModal .checkout-summary { padding:13px; font-size:12px; }
  #checkoutModal .checkout-fields {grid-template-columns:minmax(0,1fr);gap:11px;}
  #checkoutModal .checkout-fields input { min-height:46px; font-size:16px; }
  #checkoutModal .checkout-consent { display:block; line-height:1.65; }
  #checkoutModal .checkout-consent input { display:inline-block; vertical-align:middle; margin:0 7px 0 0; }
  #checkoutModal .checkout-consent button { display:inline; padding:2px; }
  #checkoutModal .primary-button { min-height:50px; line-height:1.45; }
  #checkoutModal #refreshQuoteBtn { min-height:44px; }
  #policyModal .policy-box {overflow-wrap:anywhere;}
  #policyModal .policy-box h2 {font-size:26px;}
  .document-page { padding:15px 9px; }
  .document-card { padding:24px 18px; border-radius:14px; }
  .document-card h1 {font-size:clamp(24px,7vw,30px);}
  .document-card .table-scroll {max-width:100%;}
  #archive .store-faq details summary {display:list-item; padding-right:8px;}
  #sizeguide .measurement-layout { grid-template-columns:1fr; }
}
@media (max-width:360px) {
  #modalBox {padding:16px 12px;}
  #checkoutModal .checkout-box {padding-left:13px;padding-right:13px;}
  #mainNavbar > div { padding-left:7px !important; padding-right:7px !important; }
  #mainNavbar > div > div:last-child { gap:3px; }
  #mainNavbar .header-brand .brand-frame {max-width:77px;}
  #mainNavbar [data-action="open-cart"] {font-size:9px;padding:7px 6px;}
}
@media (max-height:620px) and (orientation:landscape) {
  #modalBox, .checkout-box, .policy-box { max-height:calc(100dvh - 16px); }
  .hero-container { min-height:420px; }
}

/* Informational toasts should never block Checkout, Add to Bag or navigation taps. */
#toast { pointer-events:none; }
