/* Shared finishing layer: same palette, predictable focus and restrained motion. */
:root{--ease-ui:cubic-bezier(.23,1,.32,1);--motion-fast:160ms;--motion-enter:220ms}
.inline-arrow{display:inline-block;width:18px;height:18px;vertical-align:middle;flex:none}
.dialog-close{display:grid;place-items:center;padding:0;line-height:0;flex:none}
.dialog-close .ui-icon{display:block;width:22px;height:22px;margin:0}
#product-dialog .dialog-close{position:static;width:44px;height:44px;margin:0 0 16px auto}
#product-dialog .login-gate{padding-top:0}
.catalog-dialog-toolbar{position:sticky;top:0;z-index:6;display:flex;justify-content:flex-end;background:#fffdf5;padding-bottom:16px}
.catalog-dialog-toolbar .catalog-dialog-close{position:static;margin:0;width:44px;height:44px;padding:0;flex:none}
.payment-methods .payment-tile:has(input[value="crypto"]) small{display:block;font-size:10px;color:#737b68;line-height:1.3;margin-top:3px}
.theme-previews button,.theme-demo{display:inline-flex;align-items:center;justify-content:center;gap:8px}
.theme-previews button{font:inherit;color:inherit;background:#fffdf7;border:1px solid #d8ddcd;border-radius:12px;padding:12px 15px;min-height:44px;cursor:pointer}
.theme-previews .icon,.theme-demo .icon{width:18px;height:18px;flex:none}
.checkout-status{color:#b74632;font-size:13px;line-height:1.6;margin:12px 0 0;scroll-margin-block:20px}
.checkout-status:empty{display:none}
.checkout-status:focus{outline:none}
dialog.image-preview{padding:0;width:min(1060px,calc(100% - 32px));max-height:calc(100dvh - 32px);border:1px solid #d8ddcd;border-radius:22px;background:#fffdf7;color:#20251a;overflow:auto}
.image-preview header{display:flex;align-items:center;gap:16px;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #e5e7dc}
.image-preview h2{margin:0;font-size:18px;font-weight:600;line-height:1.4}
.image-preview h2{min-width:0;overflow-wrap:anywhere}
.image-preview::backdrop{background:#20251955;backdrop-filter:blur(5px)}
.image-preview button{display:grid;place-items:center;padding:0;width:44px;height:44px;border:1px solid #d8ddcd;border-radius:50%;background:transparent;color:inherit;flex:none;cursor:pointer}
.image-preview button:disabled{opacity:.35;cursor:default}
.image-preview .icon{width:22px;height:22px}
.preview-stage{position:relative;min-height:160px;display:grid;place-items:center;padding:16px;background:#f4f3eb}
.preview-stage img{display:block;width:100%;height:auto;max-height:calc(100dvh - 220px);object-fit:contain;border-radius:8px}
.preview-stage img[hidden]{display:none}
.preview-stage p{padding:24px;color:#6a725f;text-align:center}
.preview-stage p:empty{display:none}
.image-preview footer{display:flex;justify-content:center;align-items:center;gap:20px;padding:12px 20px}
.image-preview footer span{font-size:13px;font-variant-numeric:tabular-nums}
.image-preview [data-preview-prev] .icon{transform:rotate(180deg)}
html{-webkit-text-size-adjust:100%;color-scheme:light;scrollbar-gutter:stable}
body[data-scene]{padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px);padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
button,a,input,select,textarea{touch-action:manipulation}
button{ -webkit-tap-highlight-color:transparent }
:where(.primary,.secondary,.outline,.button,.preference-action,.small-button){
 -webkit-user-select:none;user-select:none;
 transition:background-color var(--motion-fast),border-color var(--motion-fast),box-shadow var(--motion-fast),transform var(--motion-fast) var(--ease-ui);
}
:where(.primary,.secondary,.outline,.button,.preference-action,.small-button):active:not(:disabled){transform:scale(.98);transition-duration:100ms}
:where(.metric strong,.live-stat strong,.stat-value,.cart-line-total,.cart-summary dd,.wallet-after,.balance-amount,.card-price,.catalog-card-bottom>strong){font-variant-numeric:tabular-nums}
:where(h1,h2,h3){text-wrap:balance}
:where(.muted,.page-heading p,.support-intro p,.preference-copy p){text-wrap:pretty}
.catalog-search-wrap:focus-within{border-color:#373c2f;box-shadow:inset 0 0 0 1px #373c2f}
.product-art img{transition:transform var(--motion-enter) var(--ease-ui)}
.product-card,.catalog-card{transition:border-color var(--motion-fast),box-shadow var(--motion-fast);transform:none!important}
@media(hover:hover) and (pointer:fine){
 .product-card:hover,.catalog-card:hover{border-color:#bfc6aa;box-shadow:0 5px 18px #2825140b}
 .product-card:hover .product-art img,.catalog-card:hover .product-art img{transform:scale(1.035)}
}
/* Crossfades can reverse immediately. No input lock or queued animations. */
.flagship-mark{visibility:visible;opacity:0;transform:translateY(5px);transition:opacity var(--motion-enter) var(--ease-ui),transform var(--motion-enter) var(--ease-ui)}
.flagship-mark.is-current{opacity:1;transform:none}
.flagship-mark.is-current img{animation:none!important}
.is-keyboard-change .flagship-mark{transition:none}
dialog{overscroll-behavior:contain}
dialog[open]{animation:dialog-arrive var(--motion-enter) var(--ease-ui) both}
dialog[open]::backdrop{animation:backdrop-arrive var(--motion-fast) ease-out both}
@keyframes dialog-arrive{from{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:none}}
@keyframes backdrop-arrive{from{opacity:0}to{opacity:1}}
.referral-share-notice{animation:notice-arrive 180ms var(--ease-ui) both}
@keyframes notice-arrive{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
/* Extra depth is reserved for dialogs, keeping normal pages calm and legible. */
html[data-surface=admin] .panel,html[data-surface=admin] .metric{box-shadow:0 2px 8px #18211103}
html[data-surface=admin] .panel-head{background:#fafbf8}
html[data-surface=admin] tbody tr{transition:background-color var(--motion-fast)}
@media(hover:hover) and (pointer:fine){html[data-surface=admin] tbody tr:hover{background:#f8faf4}}
html[data-surface=admin] .metric-value{font-variant-numeric:tabular-nums}
html[data-surface=admin] .metric strong{overflow-wrap:anywhere}
html[data-surface=admin] .period-dialog input[type=date]{width:100%;min-width:0;box-sizing:border-box}
html[data-surface=admin] .table-wrap{overscroll-behavior-x:contain}
html[data-surface=admin] #content:focus{outline:none}
@media(pointer:coarse){
 input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea{font-size:16px!important}
 .header-profile button,.header-support,.preference-switch,.scene-control,.flagship-controls .scene-control,.product-share,.card-open,.catalog-share,.catalog-card-bottom>button,.catalog-dialog-close,.share-notice-close,.close,.search-clear{min-width:44px;min-height:44px}
 .preference-action,.small-button,.text-button,.cart-quantity button,.cart-remove,.period-presets button{min-height:44px}
 .scene-dots{min-height:44px;align-items:center}
 .flagship-controls .scene-dot,.flagship-controls .scene-dot.is-current{height:44px;background:transparent}
 .flagship-controls .scene-dot:before{content:"";position:absolute;inset:19px 0;border-radius:8px;background:#b6bcae}
 .flagship-controls .scene-dot.is-current:before{background:var(--ink)}
 .flagship-controls .scene-dot:after{inset:0 -4px}
 .flagship-controls .scene-progress{top:18px;bottom:auto;height:8px}
}
@media(max-width:800px){
 .workspace main{padding-bottom:calc(40px + env(safe-area-inset-bottom,0px))}
 .sidebar{padding-top:env(safe-area-inset-top,0px)}
 .workspace,.login-page{padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}
 .login-page{padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
 dialog{max-height:calc(100dvh - 32px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))}
}
@media(max-width:380px){
 html[data-surface=admin] .period-dialog .form-grid{grid-template-columns:1fr}
 html[data-surface=admin] .report-metrics .metric strong{font-size:21px;letter-spacing:-.6px}
}
@media(prefers-reduced-motion:reduce){
 :where(.primary,.secondary,.outline,.button,.preference-action,.small-button):active:not(:disabled){transform:none}
 .product-card:hover .product-art img,.catalog-card:hover .product-art img{transform:none}
 .flagship-mark{transform:none;transition:none}
 dialog[open],dialog[open]::backdrop,.referral-share-notice{animation:none}
}
