/* Refine the existing ivory / champagne system, without changing its layout. */
#app .mx-empty {max-width:620px;margin:3rem auto;text-align:center;padding:1rem;}
#app .mx-empty h2 {font-family:var(--serif);font-weight:400;font-size:clamp(1.8rem,4vw,2.8rem);line-height:1.15;}
#app .mx-empty p,#app .mx-preview-note {color:#62574a;line-height:1.6;}
#app .mx-preview-note {font-size:14px;max-width:65ch;}
#app .cart-summary>.text-link {margin-top:1.2rem;font-size:.85rem;}
#app .qty button:disabled {opacity:.35;cursor:default;}
#app .filter-panel output {font-variant-numeric:tabular-nums;}
#app .filter-chips {overflow-x:auto;scrollbar-width:thin;}
#app .filter-chips a {white-space:nowrap;}
#app .product-info,#app .cart-list article>div {min-width:0;}
#app .page-hero h1,#app .product-info a,#app .cart-list h3 {overflow-wrap:anywhere;}
#app .mobile-bottom [aria-current="page"] {color:#8b602e;background:#eee3d4;}
#app .mobile-bottom a {border-radius:8px;transition:background-color .18s ease,color .18s ease;}
#app :is(button,a,input,select,textarea):focus-visible {outline:2px solid #8b602e;outline-offset:3px;}
#app .cart-summary strong,#app .product-info strong {font-variant-numeric:tabular-nums;}
#app .search-examples .button {min-height:48px;}
@media(max-width:700px){
  #app :is(input,select,textarea),.layout :is(input,select,textarea){font-size:16px;}
  #app .panel-close,#app .modal-close {min-width:44px;min-height:44px;}
  #app .qty button {min-width:44px;min-height:44px;}
  #app .filter-panel {gap:1.25rem;}
  #app .catalog-controls>div {width:100%;justify-content:space-between;gap:.75rem;}
  #app .catalog-controls select {min-width:0;max-width:65%;}
  #app .cart-summary {position:static;}
}
@media(prefers-reduced-motion:reduce){#app .mobile-bottom a{transition:none;}}

/* Viewport-bounded panels: the content scrolls, not two nested whole pages. */
html body #app .cart-drawer {
  box-sizing:border-box;width:min(480px,100%)!important;height:100vh;height:100dvh;
  max-height:100dvh;inset:0 0 auto auto;
  padding:clamp(20px,3vh,32px) clamp(18px,3vw,32px) max(20px,env(safe-area-inset-bottom))!important;
  display:flex;flex-direction:column;gap:16px;overflow:hidden;
}
html body #app .cart-drawer>.panel-close {top:14px;right:14px;width:44px;height:44px;flex:none;z-index:5;}
html body #app .cart-drawer>span {padding-right:44px;font-size:12px;}
html body #app .cart-drawer>h2 {font-size:clamp(30px,4vw,46px);line-height:1.05;margin:8px 0 12px;}
html body #app .cart-drawer .empty-cart {
  min-height:0;flex:1;padding:16px 0;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:16px;overflow-y:auto;
}
html body #app .cart-drawer .empty-cart svg {width:40px;height:40px;flex:none;}
html body #app .cart-drawer .empty-cart h2 {font-size:clamp(26px,4vw,36px);line-height:1.15;margin:0;max-width:12ch;}
html body #app .cart-drawer .empty-cart p {margin:0;line-height:1.5;font-size:16px;}
html body #app .cart-drawer .empty-cart .button {margin:0;flex:none;min-height:48px;}
html body #app .cart-drawer .drawer-list {flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;margin:0;}
html body #app .cart-drawer .drawer-list article {grid-template-columns:72px minmax(0,1fr) 32px;gap:12px;}
html body #app .cart-drawer .drawer-list img {width:72px;height:96px;object-fit:contain;}
html body #app .cart-drawer .drawer-list p {overflow-wrap:anywhere;}
html body #app .cart-drawer>.drawer-total,html body #app .cart-drawer>.button {flex:none;margin:0;}
html body #app .modal-backdrop {box-sizing:border-box;height:100dvh;padding:12px;overflow:hidden;}
html body #app .modal {box-sizing:border-box;width:min(640px,100%);max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain;}
html body #app .overlay {box-sizing:border-box;max-height:100dvh;overflow-y:auto;overscroll-behavior:contain;}
html body #app .big-search {min-width:0;}
html body #app .big-search input {min-width:0;max-width:100%;}

/* Studio reflows by available width; no clipped actions or giant fixed upload box. */
html body #app .ai-studio,html body #app .ai-studio.blue {
  background:#eee4d7;color:#2b261f;padding:clamp(16px,2.5vh,28px) clamp(16px,4vw,64px) 32px!important;
}
html body #app .ai-studio>header,html body #app .studio-tabs,html body #app .studio-work {max-width:1440px;margin-inline:auto;}
html body #app .ai-studio>header {display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:8px 28px;align-items:center;}
html body #app .ai-studio>header>span {grid-column:1/-1;font-size:11px;letter-spacing:.12em;}
html body #app .ai-studio h1 {font-size:clamp(28px,3.3vw,46px)!important;line-height:1.08!important;margin:0!important;overflow-wrap:anywhere!important;}
html body #app .ai-studio h1 em,html body #app .ai-studio.blue h1 em {color:#79572e;}
html body #app .ai-studio>header p {font-size:16px;line-height:1.5;margin:0;max-width:48ch;}
html body #app .studio-tabs {display:flex;flex-wrap:wrap;gap:6px;margin-top:16px;margin-bottom:16px;}
html body #app .studio-tabs a {color:#514332;border:1px solid #b9a78f;min-height:44px;padding:10px 16px;font-size:15px;}
html body #app .studio-tabs a.active {background:#fffdf8;color:#2b261f;border-color:#8d6b42;}
html body #app .studio-work {display:grid!important;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr)!important;gap:20px;align-items:stretch;}
html body #app .studio-work>div {display:flex;flex-direction:column;gap:12px;min-width:0;}
html body #app .ai-consent {margin:0;padding:12px!important;font-size:14px;line-height:1.5;display:flex;align-items:flex-start;gap:12px;border-color:#c3b3a0;}
html body #app .ai-consent input {flex:none;margin-top:3px;width:18px;height:18px;}
html body #app .ai-consent span {min-width:0;}
html body #app .dropzone {flex:1;min-height:220px!important;height:auto!important;max-height:none!important;background:#e5d8c7;}
html body #app .dropzone>div {position:relative;inset:auto;margin:12px;padding:20px 12px;min-height:196px;gap:12px;border-color:#8b765c;}
html body #app .dropzone>img {opacity:.23;object-fit:contain!important;}
html body #app .dropzone h2 {font-size:clamp(22px,2.2vw,30px);line-height:1.2;margin:0;overflow-wrap:anywhere;}
html body #app .dropzone p {margin:0;font-size:14px;}
html body #app .dropzone svg {width:32px;height:32px;}
html body #app .dropzone span {display:inline-flex;align-items:center;min-height:44px;border-color:#79572e;}
html body #app .studio-work>aside {padding:20px!important;background:#fffaf2;min-width:0;gap:10px;}
html body #app .studio-work aside h2 {font-size:clamp(24px,2.3vw,32px);line-height:1.16;margin:0;}
html body #app .studio-work ol {margin:0;}
html body #app .studio-work li {font-size:15px;line-height:1.4;padding:9px 0;gap:14px;border-color:#ded2c3;}
html body #app .studio-work li b {color:#79572e;}
html body #app .studio-work .switch {font-size:14px;line-height:1.4;margin:0;}
html body #app .studio-work .button {min-height:46px;margin-top:auto;white-space:normal;}
html body #app .studio-work .button:disabled {background:#eee6d9;color:#71624f;border-color:#c8bba9;opacity:1;cursor:not-allowed;}
html body #app .studio-work small {font-size:13px;line-height:1.45;color:#665a4c;margin:0;}
@media(max-width:900px){
  html body #app .ai-studio>header,html body #app .studio-work {grid-template-columns:minmax(0,1fr)!important;}
  html body #app .ai-studio>header {gap:12px;}
  html body #app .ai-studio h1 {font-size:clamp(28px,6vw,40px)!important;}
  html body #app .studio-work {gap:16px;}
  html body #app .studio-work>aside {padding:18px!important;}
  html body #app .dropzone {min-height:240px!important;}
  html body #app .studio-tabs a {flex:1;text-align:center;}
}
@media(max-height:480px){
  html body #app .cart-drawer {gap:8px;padding-top:16px!important;}
  html body #app .cart-drawer>h2 {font-size:28px;margin:0;}
  html body #app .cart-drawer .empty-cart {justify-content:flex-start;gap:10px;}
  html body #app .cart-drawer .empty-cart h2 {font-size:25px;}
}
