/* Final production UX pass. Focused overrides preserve the existing KREVI8 layout and behavior. */
:root{--content-max:1480px;--touch:44px}
html{overflow-x:hidden;scroll-padding-top:24px}
body{min-width:320px;overflow-x:hidden}
img,canvas,svg{max-width:100%}
button,a,input,select,textarea{font:inherit}
button,a{touch-action:manipulation}
button:disabled,[aria-disabled="true"]{cursor:not-allowed;opacity:.52}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:3px solid #b8892d;outline-offset:3px}
.section-wrap{width:min(var(--content-max),92%)}
.header{width:min(var(--content-max),94%)}
.header nav a,.header-cart,.auth-nav,.menu-toggle{min-height:var(--touch);display:inline-flex;align-items:center}
.auth-nav svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.7}
.menu-toggle{justify-content:center}
.hero{align-items:center}
.hero-copy{min-width:0}
.hero-copy h1{overflow-wrap:anywhere}
.brand-hero{height:auto!important;min-height:0!important}
.brand-hero img{object-position:center}
.product-card,.template-card{min-width:0}
.product-icon canvas,.product-canvas,.saved-card canvas,.cart-item canvas,.order-item canvas{display:block;object-fit:contain}
.product-card:focus-visible .product-icon,.template-card:focus-visible .template-art{box-shadow:0 0 0 4px #fff,0 0 0 7px #b8892d}
.template-card .card-bottom{min-height:56px}
.empty-actions,.confirm-actions{display:flex;justify-content:center;gap:12px;flex-wrap:wrap}
.empty-cart .button{margin:4px}
.account-loading{min-height:220px;display:flex;align-items:center;justify-content:center;gap:12px;text-align:center}
.loading-mark{width:20px;height:20px;border:2px solid #d9d2c5;border-top-color:#b8892d;border-radius:50%;animation:krevi8-spin .8s linear infinite}
@keyframes krevi8-spin{to{transform:rotate(1turn)}}
.form-status:not(:empty),.studio-status:not(:empty){min-height:24px}
.form-status[role="alert"],.cart-error{color:#8c3028}
.verification-card strong{overflow-wrap:anywhere}.verification-code{font-size:1.75rem!important;letter-spacing:.35em;text-align:center;font-weight:750;font-variant-numeric:tabular-nums}.verification-card .auth-links button{min-height:44px}.email-verified-badge{display:inline-flex;align-items:center;width:max-content;margin-top:2px;padding:5px 9px;border-radius:20px;background:#f2ecdf;color:#6f531a;font-size:.72rem;font-weight:700}
.catalog-actions .button,.cart-item-actions button,.quantity-stepper button,.zoom-controls button,.layer-actions button,.shape-actions button,.text-style-actions button{min-height:var(--touch)}
.cart-item-actions{flex-wrap:wrap;gap:8px 18px}
.quantity-stepper button{min-width:var(--touch)}
.quantity-stepper input{min-height:var(--touch)}
.checkout-card input,.checkout-card select,.checkout-card textarea,.admin-dialog input,.admin-dialog select,.admin-dialog textarea,.admin-content-form input,.admin-content-form textarea,.admin-inline-form input,.admin-inline-form select{min-height:var(--touch);font-size:16px}
.shipping-choice{min-height:64px;align-items:flex-start;cursor:pointer}
.shipping-choice input{width:20px;height:20px;flex:0 0 auto}
.checkout-steps span{line-height:1.45}
.order-statuses span{border:1px solid #dfd3b9;font-weight:650;line-height:1.35}
.order-card{transition:border-color .18s,box-shadow .18s}
.order-card:hover,.order-card:focus-visible{border-color:#b8892d;box-shadow:0 8px 24px #211b1010}
.admin-rail nav button,.admin-primary,.admin-secondary,.admin-table button,.admin-template button,.admin-row button{min-height:var(--touch)}
.admin-table th{white-space:nowrap}
.admin-table-scroll{scrollbar-gutter:stable}
.admin-dialog{max-height:90dvh;overflow:auto}
.admin-order-dialog canvas{width:90px;height:auto;flex:0 0 auto;border-radius:6px;background:#f3f0e8}
#app-notice{bottom:max(20px,env(safe-area-inset-bottom));line-height:1.5}

@media(max-width:1050px){
  .header nav{max-height:calc(100dvh - 120px);overflow:auto}
  .header nav a{width:100%}
  .hero{grid-template-columns:minmax(0,1fr) minmax(0,1.08fr)}
  .hero-visual{height:auto!important}
}

@media(max-width:800px){
  .field-pair{grid-template-columns:1fr}
  .checkout-steps{overflow-x:auto;display:flex;scroll-snap-type:x proximity;padding-bottom:5px}
  .checkout-steps span{min-width:165px;scroll-snap-align:start}
  .checkout-card,.checkout-summary{padding:20px}
  .order-item{align-items:start}
  .admin-row{align-items:flex-start;flex-wrap:wrap}
}

@media(max-width:760px){
  .section-wrap,.v1-wrap{width:92%}
  .header,.workspace-active .header{width:94%;height:78px}
  .header .brand{width:116px;height:40px}
  .header .brand img{width:100%;height:100%;object-fit:cover;position:static}
  .header nav,.workspace-active .header nav{position:absolute;top:calc(100% + 1px);left:0;right:0;max-height:calc(100dvh - 100px);padding:12px;border-radius:0 0 10px 10px}
  .header nav a{padding:12px 14px}
  .header-actions{margin-left:auto}
  .hero{padding-top:34px}
  .hero h1{font-size:clamp(2.7rem,12vw,4.1rem);line-height:1.02}
  .hero-visual{aspect-ratio:16/10;height:auto!important}
  .hero .cta-row{align-items:stretch}
  .hero .cta-row .button{justify-content:center;flex:1 1 180px}
  .product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .product-icon{height:auto;aspect-ratio:1/1.08}
  .steps{grid-template-columns:repeat(3,minmax(0,1fr))}
  .steps article{min-width:0}
  .steps .coming{max-width:100%;line-height:1.35}
  .ai-art{min-height:0}
  .studio-topbar{position:sticky;top:0;z-index:12}
  .studio-top-actions{overflow-x:auto;padding-bottom:3px}
  .studio-top-actions>*{flex:0 0 auto}
  .studio-tabs{overflow-x:auto;grid-template-columns:repeat(4,minmax(82px,1fr))}
  .canvas-tools{flex-wrap:wrap}
  .canvas-tools>label{min-height:var(--touch)}
  .zoom-controls{overflow-x:auto;flex-wrap:nowrap}
  .zoom-controls button{min-width:var(--touch)}
  .my-studio-tabs{overflow-x:auto;flex-wrap:nowrap;align-items:stretch;padding-bottom:3px}
  .my-studio-tabs>*{flex:0 0 auto;min-height:var(--touch)}
  .my-studio-tabs>a{display:flex;align-items:center;margin-left:auto}
  .dashboard-welcome>.button{width:100%;justify-content:center}
  .cart-item{align-items:start}
  .cart-item-price{grid-column:1/-1!important;justify-content:space-between}
  .cart-summary{position:static}
  .auth-card{padding:24px 20px}
  .auth-links{align-items:flex-start;line-height:1.5}
  .admin-rail{overflow-x:auto}
  .admin-rail nav{display:flex;min-width:max-content;gap:5px;margin-top:14px}
  .admin-rail nav button{padding-inline:14px}
  .admin-work>header{position:sticky;top:0;z-index:4}
  .admin-body{padding-inline:5%}
}

@media(max-width:460px){
  .header-cart{font-size:0}
  .header-cart::before{content:'Cart';font-size:.78rem}
  .header-cart span{font-size:.7rem;margin-left:4px}
  .hero .cta-row{display:grid;grid-template-columns:1fr}
  .product-grid{grid-template-columns:1fr}
  .product-icon{aspect-ratio:4/3}
  .steps{gap:10px}
  .steps svg{width:54px;height:54px}
  .steps h3{font-size:.9rem}
  .template-art{height:min(360px,92vw)}
  .studio-breadcrumb{display:grid;grid-template-columns:auto 1fr}
  .studio-breadcrumb span{display:none}
  .studio-breadcrumb input{width:100%;min-width:0}
  #save-indicator{grid-column:1/-1}
  .studio-top-actions>.button{margin-left:0}
  .studio-top-actions{justify-content:flex-start}
  .studio-summary{grid-template-columns:1fr!important}
  .studio-summary>*{grid-column:1!important;grid-row:auto!important}
  .saved-card canvas{height:auto;aspect-ratio:600/640}
  .cart-item{grid-template-columns:76px minmax(0,1fr)}
  .cart-item>canvas{width:76px}
  .cart-item-actions button{min-height:var(--touch)}
  .checkout-card,.checkout-summary{padding:18px 16px}
  .confirm-actions .button,.order-success .button{width:100%;justify-content:center}
  .order-card{padding:17px}
  .order-item{grid-template-columns:64px minmax(0,1fr)}
  .order-item canvas,.order-item .cart-product-placeholder{width:64px;height:68px}
  .admin-work>header{padding-inline:14px}
  .admin-work h1{font-size:1.35rem}
  .admin-owner{max-width:42%;overflow:hidden;text-overflow:ellipsis}
  .admin-heading h2{font-size:1.45rem}
}

@media(prefers-reduced-motion:reduce){.loading-mark{animation:none;border-color:#b8892d}}
