/* Shared tokens are applied after legacy styles; data-theme is retired by the runtime. */
html[data-appearance]{--ink:var(--ap-ink);--muted:var(--ap-muted);--paper:var(--ap-background);--card:var(--ap-surface);--cream:var(--ap-surface);--line:var(--ap-line);--accent:var(--ap-accent-ink);--dark:var(--ap-accent);--rose:var(--ap-accent);--rose-dark:var(--ap-accent-ink);--sage:var(--ap-accent);--white:var(--ap-surface);--focus:var(--ap-accent-ink)}
html[data-appearance] body{background:var(--ap-background);color:var(--ap-ink);font-family:var(--ap-body-font)}
html[data-appearance] :is(h1,h2,h3,.brand,.wordmark,.seal strong,.payment-order-total,.cart-total strong){font-family:var(--ap-font);text-transform:none}
html[data-appearance] :is(button,input,textarea,select,.file,.store-open){font-family:var(--ap-body-font);border-radius:var(--ap-control-radius)}
html[data-appearance] :is(button,input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]),select,.file,.store-open){min-height:44px}
html[data-appearance] :is(input,textarea,select){background:var(--ap-surface);color:var(--ap-surface-ink);border-color:var(--ap-surface-control-line)}
html[data-appearance] input::placeholder,html[data-appearance] textarea::placeholder{color:var(--ap-surface-muted);opacity:1}
html[data-appearance] :is(button,a,input,textarea,select):focus-visible{outline:3px solid var(--rose-dark,var(--ap-accent-ink));outline-offset:3px}
html[data-appearance] :is(input[type=checkbox],input[type=radio]){accent-color:var(--ap-accent-ink)}
html[data-appearance] :is(.primary,.filter.active,.catalog-filters button.active,.card-actions .select){background:var(--ap-accent);border-color:var(--ap-accent);color:var(--ap-accent-text)}
html[data-appearance] :is(.primary,.filter.active,.catalog-filters button.active,.card-actions .select):hover{background:var(--ap-accent);border-color:var(--ap-accent);color:var(--ap-accent-text);text-decoration:underline;text-underline-offset:3px}
html[data-appearance] :is(dialog,.panel,.metrics article,.product,.draft,.catalog article,.sale-card,.customer-card,.campaign-card,.instagram-card,.variant-row,.candidate,.sale-line,.dashboard-checklist>*){--ink:var(--ap-surface-ink);--muted:var(--ap-surface-muted);--line:var(--ap-surface-line);--accent:var(--ap-surface-accent);--rose-dark:var(--ap-surface-accent);background:var(--ap-surface);color:var(--ap-surface-ink);border-color:var(--ap-surface-line);border-radius:var(--ap-radius)}
html[data-appearance] dialog{box-shadow:0 24px 90px #0004}
html[data-appearance] :is(.skip:focus,.close){background:var(--ap-surface);color:var(--ap-surface-ink)}

/* Admin: changing density tightens space while controls retain a 44px target. */
html[data-appearance="admin"] :is(button,.file,.store-open){background:var(--ap-surface);color:var(--ap-surface-ink);border-color:var(--ap-surface-control-line)}
html[data-appearance="admin"] :is(button,.file,.store-open):hover{background:var(--ap-surface);border-color:var(--ap-surface-accent)}
html[data-appearance="admin"] :is(.primary,.catalog-filters button.active){background:var(--ap-accent);color:var(--ap-accent-text);border-color:var(--ap-accent)}
html[data-appearance="admin"] .nav{background:transparent;color:var(--ap-ink);border:0}
html[data-appearance="admin"] .nav.active{background:var(--ap-surface);color:var(--ap-surface-accent);box-shadow:inset 0 -3px var(--ap-accent)}
html[data-appearance="admin"] :is(.eyebrow,.brand .brand-platform,#notice){color:var(--accent)}
html[data-appearance="admin"] :is(.integration-status,.public-profile-card,.review-help,.review-complete,.checkout-customer,.integration-help,.readiness-item,.dashboard-card){--ink:var(--ap-surface-ink);--muted:var(--ap-surface-muted);--accent:var(--ap-surface-accent);--line:var(--ap-surface-line);background:var(--ap-surface);color:var(--ap-surface-ink);border-color:var(--ap-surface-line);border-radius:var(--ap-radius)}
html[data-appearance="admin"] :is(.thumb,.variant-photo-current img,.catalog img,.instagram-card img,.store-frame,.theme-preview){border-radius:var(--ap-control-radius);background:var(--ap-surface)}
html[data-appearance="admin"] :is(fieldset,.variant-editor,.theme-form fieldset){border-color:var(--line);border-radius:var(--ap-radius)}
html[data-appearance="admin"] .danger{color:#9e2017;background:#fff3f0;border-color:#b44c43}
html[data-appearance="admin"] .danger:hover{color:#7b130e;background:#ffe7e1;border-color:#9e2017}
html[data-appearance="admin"] .catalog-kind{color:var(--ap-surface-ink);background:var(--ap-surface);border:1px solid var(--ap-surface-line)}
html[data-appearance="admin"][data-density="compact"] :is(.panel,.metrics article,.product,.draft,.sale-card,.customer-card,.campaign-card){padding:12px}
html[data-appearance="admin"][data-density="compact"] :is(.metrics,.catalog){gap:10px;margin-block:20px}
html[data-appearance="admin"][data-density="compact"] form{gap:10px}
html[data-appearance="admin"][data-density="compact"] :is(button,.file,.store-open){padding-block:7px}
html[data-appearance="admin"][data-density="compact"] .section-head{margin-bottom:16px}

/* Store: all layout choices respond to the same live tokens. */
html[data-appearance="store"] .topbar{background:var(--ap-background);color:var(--ap-ink)}
html[data-appearance="store"] .wordmark{min-width:0;max-width:55%;font-size:clamp(18px,2.3vw,25px)}
html[data-appearance="store"] .wordmark>[data-appearance-brand]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html[data-appearance="store"] .thread{flex-shrink:0;color:var(--ap-accent-ink);border-color:var(--ap-accent-ink)}
html[data-appearance="store"] .hero{background:var(--ap-background);border-bottom:1px solid var(--ap-line);min-height:580px;gap:44px}
html[data-appearance="store"] .hero-copy{position:relative;z-index:1;min-width:0}
html[data-appearance="store"] .hero h1{white-space:pre-line;overflow-wrap:anywhere;letter-spacing:-.045em;font-size:clamp(44px,6.5vw,88px);line-height:1.04}
html[data-appearance="store"] .hero-art{border-radius:var(--ap-radius);background:var(--ap-surface);overflow:hidden;min-height:400px}
html[data-appearance="store"] .seal{background:var(--ap-surface);border-color:var(--ap-surface-line);box-shadow:0 25px 65px #00000015,inset 0 0 0 12px var(--ap-surface-line);color:var(--ap-surface-ink)}
html[data-appearance="store"] .seal strong{color:var(--ap-surface-accent);max-width:240px;overflow-wrap:anywhere;font-size:clamp(34px,5vw,68px)}
html[data-appearance="store"] .seal small{color:var(--ap-surface-muted)}
html[data-appearance="store"] .orbit{border-color:var(--ap-surface-accent);opacity:.3}
html[data-appearance="store"][data-appearance-preset="fashion"] .seal{border-radius:var(--ap-radius);transform:rotate(2deg)}
html[data-appearance="store"][data-appearance-preset="stationery"] .seal{border-radius:42% 58% 56% 44%}
html[data-appearance="store"][data-appearance-preset="minimal"] .orbit{display:none}
html[data-appearance="store"][data-hero="centered"] .hero{display:flex;flex-direction:column;text-align:center;min-height:0}
html[data-appearance="store"][data-hero="centered"] .hero-copy{max-width:900px}
html[data-appearance="store"][data-hero="centered"] .hero-copy>p{margin-inline:auto}
html[data-appearance="store"][data-hero="centered"] .hero-actions{justify-content:center}
html[data-appearance="store"][data-hero="centered"] .hero-art{display:none}
html[data-appearance="store"][data-hero="minimal"] .hero{display:block;min-height:0;padding-block:45px}
html[data-appearance="store"][data-hero="minimal"] .hero-copy{max-width:1000px}
html[data-appearance="store"][data-hero="minimal"] .hero h1{font-size:clamp(38px,4.8vw,64px)}
html[data-appearance="store"][data-hero="minimal"] .hero-art{display:none}
html[data-appearance="store"] .trust{background:var(--ap-surface-line)}
html[data-appearance="store"] .trust>div{background:var(--ap-surface);color:var(--ap-surface-ink)}
html[data-appearance="store"] .trust span{color:var(--ap-surface-muted)}
html[data-appearance="store"] .store-grid{grid-template-columns:repeat(var(--ap-columns),minmax(0,1fr))}
html[data-appearance="store"] .product-image{aspect-ratio:var(--ap-image-ratio);background:var(--ap-surface);border-radius:var(--ap-radius);color:var(--ap-surface-ink)}
html[data-appearance="store"] .product-image img{object-fit:var(--ap-image-fit)}
html[data-appearance="store"] .product-visual{color:var(--ap-surface-ink)}
html[data-appearance="store"] .product-visual .empty{color:var(--ap-surface-muted)}
html[data-appearance="store"] :is(.badge,.card-actions button,.filter,.variant-option,.close,.photo-hint){background:var(--ap-surface);color:var(--ap-surface-ink);border-color:var(--ap-surface-control-line);border-radius:var(--ap-control-radius)}
html[data-appearance="store"] .variant-option small{color:var(--ap-surface-muted)}
html[data-appearance="store"] .variant-option.active{border-color:var(--ap-surface-accent);box-shadow:0 0 0 2px var(--ap-surface-accent);background:var(--ap-surface)}
html[data-appearance="store"] :is(.filter.active,.card-actions .select){background:var(--ap-accent);color:var(--ap-accent-text);border-color:var(--ap-accent)}
html[data-appearance="store"] :is(.primary,.secondary,.selection-button,.club-button){border-radius:var(--ap-control-radius);min-height:44px}
html[data-appearance="store"] .secondary{color:var(--ink);border-color:var(--ink)}
html[data-appearance="store"] .secondary:hover{background:var(--ap-surface);color:var(--ap-surface-ink)}
html[data-appearance="store"] .selection-button span{background:var(--ap-accent);color:var(--ap-accent-text)}
html[data-appearance="store"][data-button-style="outline"] .primary{background:var(--ap-background);color:var(--ap-accent-ink);border-color:var(--ap-accent-ink)}
html[data-appearance="store"][data-button-style="outline"] dialog .primary{background:var(--ap-surface);color:var(--ap-surface-accent);border-color:var(--ap-surface-accent)}
html[data-appearance="store"][data-button-style="outline"] .primary:hover{background:var(--ap-accent);color:var(--ap-accent-text);border-color:var(--ap-accent)}
html[data-appearance="store"][data-card-style="bordered"] .store-card,html[data-appearance="store"][data-card-style="shadow"] .store-card{--ink:var(--ap-surface-ink);--muted:var(--ap-surface-muted);--rose-dark:var(--ap-surface-accent);background:var(--ap-surface);color:var(--ap-surface-ink);border:1px solid var(--ap-surface-line);border-radius:var(--ap-radius);padding:12px}
html[data-appearance="store"][data-card-style="shadow"] .store-card{box-shadow:0 12px 32px #00000012;border-color:transparent}
html[data-appearance="store"] .store-card :is(h3,p,small){overflow-wrap:anywhere}
html[data-appearance="store"] .story{background:var(--ap-accent);color:var(--ap-accent-text);border-radius:var(--ap-radius)}
html[data-appearance="store"] .story :is(.eyebrow,p:last-child){color:var(--ap-accent-text)}
html[data-appearance="store"] :is(.review-notice,.checkout-form,.checkout-customer,.club-benefit){background:var(--ap-surface);color:var(--ap-surface-ink);border-color:var(--ap-surface-line);border-radius:var(--ap-control-radius)}
html[data-appearance="store"] .club-benefit{color:var(--ap-surface-accent)!important}
html[data-appearance="store"] .cart-quantity :is(button,input){background:var(--ap-surface);color:var(--ap-surface-ink);border-color:var(--ap-surface-control-line)}
html[data-appearance="store"] .payment-feedback{background:var(--ap-surface);color:var(--ap-surface-ink);border-color:var(--ap-surface-control-line)}
html[data-appearance="store"] .payment-feedback[data-state="error"]{background:#fff1ec;color:#8f2819;border-color:#e6b5a8}
html[data-appearance="store"] .payment-feedback[data-state="paid"]{background:#e7f8f1;color:#126249;border-color:#b7d9cf}
html[data-appearance="store"] .payment-feedback[data-state="test"]{background:#fff2d5;color:#754c00;border-color:#e2cd98}
html[data-appearance="store"] .photo-hint{font-family:var(--ap-body-font)}
html[data-appearance="store"] .detail-photo{border-radius:0;background:var(--ap-surface)}
@media(max-width:1000px){html[data-appearance="store"] .store-grid{grid-template-columns:repeat(var(--ap-tablet-columns),minmax(0,1fr))}}
@media(max-width:850px){html[data-appearance="store"] .store-grid{grid-template-columns:repeat(2,minmax(0,1fr))}html[data-appearance="store"] .hero{min-height:0;gap:28px}html[data-appearance="store"] .hero-art{min-height:300px}}
@media(max-width:560px){html[data-appearance="store"] .store-grid{grid-template-columns:1fr}html[data-appearance="store"] .hero h1{font-size:clamp(40px,10vw,56px)}html[data-appearance="store"] .hero-art{display:none}html[data-appearance="store"] .wordmark{max-width:48%}html[data-appearance="store"] .topbar:has(#selection-open[hidden]) .wordmark{max-width:100%}html[data-appearance="store"] .hero-actions>*{max-width:100%;overflow-wrap:anywhere;text-align:center}}

html[data-appearance="admin"] :is(.candidate-source,.editor-status:not(.error),.sale-card small,.fiscal-warning){color:var(--accent)}
html[data-appearance="admin"] .dialog-actions #candidate-promote{background:var(--ap-accent);border-color:var(--ap-accent);color:var(--ap-accent-text)}
html[data-appearance] :is(input,textarea,select):focus-visible{outline-color:var(--ap-surface-accent)}
