/* Shared component states. Loaded after page and scoped styles. */
body{font-family:var(--tj-font);font-size:var(--tj-type-body);line-height:var(--tj-leading-body)}
button,input,select,textarea,dialog{font-family:var(--tj-font)}
.mud-typography,.mud-button-label,.mud-input-slot,.mud-tooltip,.mud-alert,.mud-snackbar-content{font-family:var(--tj-font)}
.tj-input,.tj-select,.tj-textarea{font-size:var(--tj-type-form);min-height:44px;border-color:var(--tj-control-border)}
.tj-btn,.tj-icon-btn,.tj-product-cart{min-height:44px;font-size:var(--tj-type-label);border-radius:var(--tj-r-sm,10px)}
.tj-icon-btn,.tj-product-fav{min-width:44px;min-height:44px}
.tj-btn-primary{background:var(--tj-brand);color:var(--tj-surface)}
.tj-btn-primary:hover:not(:disabled){background:var(--tj-brand-hover)}
.tj-btn-primary:active:not(:disabled){background:var(--tj-brand-active)}
.tj-btn-danger{background:var(--tj-color-danger);color:var(--tj-surface)}
.tj-btn:disabled,button:disabled{cursor:not-allowed}
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid var(--tj-focus);outline-offset:3px}
:where(h1,h2,h3,h4){line-height:var(--tj-leading-heading);text-wrap:pretty}
.tj-title,.tj-pdp-title{font-size:var(--tj-type-page)}
.tj-section-head .tj-title{font-size:var(--tj-type-section)}
.tj-product-title{font-size:var(--tj-type-card);line-height:1.75}
.tj-product-meta,.tj-pdp-desc,.tj-listing-price>small,.tj-hint,.tj-subtitle{font-size:var(--tj-type-help);line-height:1.9}
.tj-price{font-size:var(--tj-type-price);font-variant-numeric:tabular-nums}
.tj-product-body{gap:var(--tj-space-2);padding:var(--tj-space-4)}
.tj-product-body .tj-rating{margin-top:0}
.tj-product-body .tj-product-title{height:auto;min-height:0;margin:0}
.tj-product-body .tj-listing-price{gap:var(--tj-space-1) var(--tj-space-2)}
.tj-product-body .tj-price-row{min-height:0}
.tj-product:hover{transform:none;box-shadow:var(--tj-shadow-1)}
.tj-product:hover .tj-product-media img{transform:none}
.tj-product-media{aspect-ratio:4/3;background:var(--tj-surface)}
.tj-product-media img,.tj-gallery-main img{object-fit:contain}
.tj-product-compare{inset-inline-end:60px;inset-inline-start:auto}
.tj-product-badge{top:auto;bottom:8px;inset-inline-start:8px;inset-inline-end:auto}
button.tj-link{border:0;background:transparent;color:var(--tj-brand);min-height:44px;font:inherit}
.btn{font-family:var(--tj-font);font-size:var(--tj-type-label);min-height:44px;border-radius:var(--tj-r-sm,10px)}
.btn--primary{background:var(--tj-brand);color:var(--tj-surface)}
.btn--outline{border-color:var(--tj-border);color:var(--tj-brand)}
.finance-panel input,.finance-panel select,.wallet-panel input{font-size:var(--tj-type-form);min-height:44px}
.money-input-words{font-size:var(--tj-type-help);color:var(--tj-text-secondary)}
.tj-control-field{display:flex;flex-direction:column;gap:var(--tj-space-1);min-width:0;flex:1 1 140px;font-size:var(--tj-type-label);color:var(--tj-text-secondary)}
.tj-control-field>input,.tj-control-field>select{width:100%;min-width:0;min-height:44px;font:inherit}
.tj-control-field>span{font-weight:var(--tj-weight-strong)}
.cartline__remove{color:var(--tj-color-danger)}
.tj-stars-fg{color:var(--tj-color-warning)}
.tj-ui-icon{width:22px;height:22px;display:inline-block;vertical-align:middle;flex:none}
.tj-market-intro{gap:var(--tj-space-8);padding-block:var(--tj-space-12);border-bottom:1px solid var(--tj-border)}
.tj-market-intro h1{font-size:var(--tj-type-page);line-height:var(--tj-leading-heading)}
.tj-intro-side{border-inline-start:3px solid var(--tj-brand);padding-inline-start:var(--tj-space-6)}
.tj-modal-overlay{z-index:var(--tj-layer-dialog);padding:var(--tj-gutter);overflow-y:auto}
.tj-modal{max-height:calc(100dvh - 48px);overflow:auto;outline:none}
.tj-toast{z-index:var(--tj-layer-toast);max-width:calc(100vw - 32px)}
.alpha-notice{font-size:var(--tj-type-help);line-height:1.9;text-align:start}
.alpha-notice details{display:inline-block;margin-inline-start:var(--tj-space-3)}
.alpha-notice summary{cursor:pointer;color:var(--tj-brand);min-height:44px;display:inline-flex;align-items:center;text-decoration:underline}
.alpha-notice details[open]{display:block}
.alpha-notice details p{margin:8px 0;max-width:var(--tj-reading-width)}
.legal-layout article{max-width:var(--tj-reading-width)}
.legal-header nav,.contents,.metadata,.document-actions,.faq-hero>p{font-size:var(--tj-type-help)}
.legal-header nav a,.contents a{min-height:44px;display:inline-flex;align-items:center}
.tj-checkbox,.tj-radio{min-height:44px;align-items:center}
.tj-table td,.tj-table th{font-size:var(--tj-type-help);line-height:1.75}
:where(a,button,input,select,textarea,summary,[tabindex]){scroll-margin-block:120px 90px}
@media(max-width:600px){
 .tj-market-intro{padding-block:var(--tj-space-6)}
 .tj-intro-side{padding-inline-start:var(--tj-space-4)}

 .tj-product-cart.is-wide{white-space:normal;height:auto}
 .tj-modal-actions{flex-wrap:wrap}
}
@media(prefers-reduced-motion:reduce){
 html{scroll-behavior:auto}
 *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}
@media print{body,button,input,select,textarea{font-family:var(--tj-font)}.tj-mobile-nav,.tj-toast{display:none}}

/* Product and document layouts share the same rhythm; panels retain their table density. */
.tj-product-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:var(--tj-space-4)}
@media(max-width:600px){.tj-catalog .tj-product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}}
.tj-product-title{font-size:var(--tj-type-card)}
.tj-product-fav[aria-pressed="true"]{color:var(--tj-brand);background:var(--tj-surface-muted);border-color:var(--tj-brand)}
.tj-pdp{grid-template-columns:minmax(0,1fr) minmax(320px,400px);grid-template-areas:"info info" "gallery buy";gap:var(--tj-space-6)}
.tj-pdp-info{grid-area:info;border:0;background:transparent;padding:0}
.tj-gallery{grid-area:gallery;padding:var(--tj-space-3);border:0;background:transparent}
.tj-buybox{grid-area:buy;grid-column:auto;position:static;box-shadow:none;padding:var(--tj-space-6)}
.tj-gallery-main{width:100%;height:clamp(280px,34vw,440px);aspect-ratio:auto;max-width:100%;display:grid;place-items:center;background:var(--tj-surface);border:1px solid var(--tj-border)}
.tj-gallery-main img{min-height:0;max-height:100%;padding:var(--tj-space-3);box-sizing:border-box}
.tj-pdp--service .tj-gallery-main{background:var(--tj-surface-muted)}
.tj-pdp--service .tj-gallery-main img{padding:0;object-fit:contain}
.tj-thumbs{display:flex;gap:var(--tj-space-2);flex-wrap:wrap}
.tj-thumb{width:64px;height:64px}
.tj-product-media img{padding:var(--tj-space-2);box-sizing:border-box}
.tj-product--service .tj-product-media img{padding:0}
.tj-image-placeholder{box-sizing:border-box;border-radius:inherit}
.tj-pdp-heading{display:flex;align-items:flex-start;gap:var(--tj-space-4)}
.tj-pdp-heading h1{flex:1;min-width:0}
.tj-pdp-heading .tj-icon-btn{flex:none}
.tj-pdp-info .tj-rating{gap:var(--tj-space-2) var(--tj-space-4);flex-wrap:wrap}
.tj-pdp-store{display:inline-flex;align-items:baseline;gap:var(--tj-space-1);color:var(--tj-text-secondary)}
.tj-pdp-store strong{color:var(--tj-brand)}
.tj-buy-price{text-align:start;margin:0 0 var(--tj-space-4)}
.tj-pdp-content .tj-pdp-desc{font-size:var(--tj-type-body);max-width:var(--tj-reading-width)}
.tj-pdp-content .tj-specs{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))}
.tj-purchase-conditions{border-top:1px solid var(--tj-border);margin-top:var(--tj-space-4);padding-top:var(--tj-space-2)}
.tj-purchase-conditions h2{font-size:var(--tj-type-card);margin:var(--tj-space-2) 0;font-weight:var(--tj-weight-strong)}
.tj-store-hero{display:flex;align-items:flex-start;gap:var(--tj-space-6);padding:var(--tj-space-6);background:var(--tj-surface);border:1px solid var(--tj-border);border-radius:var(--tj-r-lg);margin-bottom:var(--tj-space-6)}
.tj-store-mark{width:80px;height:80px;flex:none;display:grid;place-items:center;background:var(--tj-surface-muted);border-radius:var(--tj-r-md);overflow:hidden;color:var(--tj-brand)}
.tj-store-mark .tj-ui-icon{width:40px;height:40px}.tj-store-mark img{width:100%;height:100%;object-fit:contain}
.tj-store-intro{min-width:0}.tj-store-intro h1{margin:var(--tj-space-1) 0 var(--tj-space-3)}
.tj-store-intro p{max-width:var(--tj-reading-width);margin-block:var(--tj-space-3)}
.tj-store-facts{display:flex;gap:var(--tj-space-4);flex-wrap:wrap;font-size:var(--tj-type-help);color:var(--tj-text-secondary)}
.tj-store-list-title{font-size:var(--tj-type-section)}
.tj-empty-icon .tj-ui-icon,.tj-seller-avatar .tj-ui-icon,.tj-member-avatar .tj-ui-icon{width:40px;height:40px}
.legal-header{padding:var(--tj-space-4) max(var(--tj-gutter),calc((100vw - 1200px)/2));gap:var(--tj-space-6);background:var(--tj-surface);border-color:var(--tj-border)}
.legal-header .brand{display:inline-flex;align-items:center;min-height:44px;flex:none}
.legal-header .brand{color:var(--tj-brand)}
.legal-header nav{gap:var(--tj-space-2) var(--tj-space-4);align-items:center}
.legal-intro,article,.contents{border-color:var(--tj-border)}
.legal-intro h1,.faq-hero h1{font-size:var(--tj-type-page)}
.document-actions button{min-height:44px;border-radius:var(--tj-r-sm);font-size:var(--tj-type-label)}
@media(max-width:800px){.tj-pdp{grid-template-columns:minmax(0,1fr);grid-template-areas:"info" "gallery" "buy"}.tj-buybox{padding:var(--tj-space-4)}.tj-gallery-main{height:auto;aspect-ratio:4/3;max-height:400px}.tj-store-hero{gap:var(--tj-space-4);padding:var(--tj-space-4)}.tj-store-mark{width:56px;height:56px}.legal-header{flex-wrap:wrap}.legal-header nav{flex:1 1 220px}}
@media print{.tj-pdp{display:block}.tj-purchase-conditions{display:block}.tj-product-fav,.tj-product-compare{display:none}}

/* Polished shared variants: compact content, explicit visual roles. */
.tj-brand-signature{display:inline-flex;align-items:center;justify-content:center;gap:var(--tj-space-2);font-size:1.5rem;font-weight:var(--tj-weight-strong);line-height:1.5;color:inherit;white-space:nowrap;padding:var(--tj-space-1)}
.tj-brand-signature img,.legal-header .tj-brand-signature img,.auth__brand .tj-brand-signature img{width:42px;height:34px;object-fit:contain;margin:0;flex:none}
.auth__brand{display:flex;justify-content:center;color:var(--tj-brand)}
.startup__card>.tj-brand-signature{color:var(--tj-brand)}
.tj-footer .tj-brand-signature img{background:var(--tj-surface);border-radius:var(--tj-r-xs);padding:var(--tj-space-1);box-sizing:content-box}
.tj-state,.tj-empty,.empty{display:flex;flex-direction:column;align-items:center;gap:var(--tj-space-3);padding:var(--tj-space-8) var(--tj-space-6);text-align:center;border:1px solid var(--tj-border);border-radius:var(--tj-r-lg);background:var(--tj-surface);min-width:0}
.tj-state--compact{padding:var(--tj-space-6) var(--tj-space-4)}
.tj-state-icon,.tj-empty-icon,.empty__icon{width:64px;height:64px;display:grid;place-items:center;flex:none;border-radius:var(--tj-r-lg);background:var(--tj-surface-muted);color:var(--tj-brand);margin:0}
.tj-state-icon .tj-ui-icon,.tj-empty-icon .tj-ui-icon,.empty__icon .tj-ui-icon{width:32px;height:32px}
.tj-state--error .tj-state-icon{color:var(--tj-color-danger);background:var(--tj-danger-surface)}
.tj-state h1,.tj-state h2,.tj-empty h1,.tj-empty h2,.tj-empty h3,.empty h1{font-size:clamp(1.125rem,2vw,1.5rem);line-height:var(--tj-leading-heading);margin:0;max-width:40ch}
.tj-state p,.tj-empty p,.empty p{font-size:var(--tj-type-help);line-height:var(--tj-leading-body);margin:0;max-width:55ch;color:var(--tj-text-secondary)}
.tj-state-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--tj-space-3);margin-top:var(--tj-space-1)}
.tj-state-actions>div{flex-wrap:wrap}
.tj-breadcrumb{padding-block:var(--tj-space-4);margin:0;color:var(--tj-text-muted);font-size:var(--tj-type-help)}
.tj-breadcrumb ol{list-style:none;display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--tj-space-2) var(--tj-space-3);margin:0;padding:0}
.tj-breadcrumb li{display:flex;align-items:baseline;gap:var(--tj-space-3);min-width:0;max-width:100%}
.tj-breadcrumb li+li::before{content:"";display:inline-block;flex:none;width:6px;height:6px;border-inline-end:1.5px solid currentColor;border-block-start:1.5px solid currentColor;transform:rotate(-45deg)}
[dir=ltr] .tj-breadcrumb li+li::before{transform:rotate(45deg)}
.tj-breadcrumb a{color:var(--tj-brand);text-decoration:underline;text-underline-offset:3px}
.tj-breadcrumb a,.tj-breadcrumb span{overflow-wrap:anywhere;min-width:0}
.tj-breadcrumb [aria-current=page]{color:var(--tj-text-secondary)}
.about-intro>p,.about-license>p,.faq-hero>p,.legal-intro>p,.faq-list p,.tj-pdp-desc{max-width:var(--tj-reading-width);line-height:var(--tj-leading-body);text-wrap:pretty}
.about-intro>p,.about-license>p{margin-block:var(--tj-space-4)}
.tj-btn,.btn{font-weight:var(--tj-weight-strong);box-shadow:none;gap:var(--tj-space-2)}
.tj-btn-primary,.btn--primary{border-color:var(--tj-brand)}
.tj-icon-btn{border-radius:var(--tj-r-sm)}
.tj-product-fav{border-radius:var(--tj-r-pill)}
.tj-icon-btn[aria-pressed=true]{background:var(--tj-surface-muted);color:var(--tj-brand);border-color:var(--tj-brand)}
@media(max-width:600px){.tj-state,.tj-empty,.empty{padding:var(--tj-space-6) var(--tj-space-4)}.tj-pdp-heading{gap:var(--tj-space-2)}.tj-product-grid{gap:var(--tj-space-4)}.tj-gallery{padding:0}.tj-brand-signature{font-size:1.25rem}}

.tj-price-main{flex-basis:100%;display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--tj-space-1) var(--tj-space-2)}
.tj-listing-price .tj-price-main .tj-price{flex-basis:auto}
.tj-price-main>small{font-size:var(--tj-type-help);color:var(--tj-text-secondary)}
.tj-listing-price--compact .tj-price-main{justify-content:space-between}
.tj-product-body .tj-product-meta{margin:0}
.tj-buy-support{display:flex;justify-content:center;padding-block:var(--tj-space-2);font-size:var(--tj-type-help);text-decoration:underline;text-underline-offset:3px;color:var(--tj-brand)}

.tj-price-discount{display:flex;flex-wrap:wrap;align-items:center;gap:var(--tj-space-2)}
.tj-price-discount:empty,.tj-price-notes:empty{display:none}
.tj-price-notes{flex-basis:100%;font-size:var(--tj-type-help);color:var(--tj-text-muted);line-height:1.8}
.tj-price-notes>small{display:block;font-size:inherit}
/* Shared row sizing uses actual peer content; no fixed title or price heights. */
@supports(grid-template-rows:subgrid){
 .tj-product-grid{row-gap:var(--tj-space-2)}
 .tj-product-grid>.tj-product{display:grid;grid-row:span 10;grid-template-rows:subgrid;row-gap:var(--tj-space-2);padding-bottom:0;margin-block-end:var(--tj-space-2)}
 .tj-product-grid>.tj-product>.tj-product-media{grid-row:1}
 .tj-product-grid>.tj-product>.tj-product-body{display:grid;grid-row:2/span 9;grid-template-rows:subgrid;row-gap:var(--tj-space-1);padding-top:var(--tj-space-2)}
 .tj-product-grid .tj-product-body>.tj-product-type{grid-row:1}
 .tj-product-grid .tj-product-body>.tj-product-title{grid-row:2}
 .tj-product-grid .tj-product-body>.tj-seller{grid-row:3}
 .tj-product-grid .tj-product-body>.tj-rating{grid-row:4}
 .tj-product-grid .tj-product-body>.tj-product-meta{grid-row:5}
 .tj-product-grid .tj-product-body>.tj-price-row{display:grid;grid-row:6/span 4;grid-template-rows:subgrid;grid-template-columns:minmax(0,1fr);justify-content:stretch;row-gap:var(--tj-space-2);margin:0;padding:0;align-items:stretch}
 .tj-product-grid .tj-price-row>div{display:grid;grid-template-columns:minmax(0,1fr);grid-row:1/span 3;grid-template-rows:subgrid}
 .tj-product-grid .tj-price-row .tj-listing-price{display:grid;grid-template-columns:minmax(0,1fr);grid-row:1/span 3;grid-template-rows:subgrid;gap:var(--tj-space-1);align-items:start}
 .tj-product-grid .tj-listing-price>.tj-price-discount{grid-row:1}
 .tj-product-grid .tj-listing-price>.tj-price-main{grid-row:2}
 .tj-product-grid .tj-listing-price>.tj-price-notes{grid-row:3}
 .tj-product-grid .tj-price-row>div>.tj-hint{grid-row:2}
 .tj-product-grid .tj-price-row>.tj-product-cart{grid-row:4;align-self:end}
}

/* Opening filters at any scroll position must reveal the controls immediately. */
.tj-filter-backdrop{display:none}
@media(max-width:800px){
 .tj-filter-backdrop{display:block;position:fixed;inset:0;background:rgba(19,34,56,.42);z-index:var(--tj-layer-dialog)}
 .tj-filter.is-open{position:fixed;inset:var(--tj-space-3);inset-block-end:max(var(--tj-space-3),env(safe-area-inset-bottom));height:auto;max-height:none;overflow-y:auto;overscroll-behavior:contain;z-index:calc(var(--tj-layer-dialog) + 1);padding:0 var(--tj-space-4) var(--tj-space-4);outline:none}
 .tj-filter.is-open .tj-filter-title{position:sticky;top:0;z-index:1;background:var(--tj-surface);padding-block:var(--tj-space-3);gap:var(--tj-space-2);margin-bottom:0}
 body:has(.tj-filter.is-open){overflow:hidden}
}

.header-cart-count{position:absolute;inset-block-start:0;inset-inline-end:0;min-width:18px;min-height:18px;padding:0 3px;box-sizing:border-box;display:grid;place-items:center;border-radius:var(--tj-r-pill);background:var(--tj-danger);color:white;font-size:12px;line-height:1.5;font-weight:700;pointer-events:none}

.product-image-picker input[type=file]{font:inherit;width:100%;min-width:0;min-height:44px}.product-image-picker input::file-selector-button{font:inherit;min-height:44px;padding:8px 12px}
.wholesale-tiers-editor{grid-column:1/-1;min-width:0;border:1px solid var(--tj-border);border-radius:var(--tj-r-control);padding:16px}.wholesale-tier-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;align-items:end;gap:8px;margin-block:12px}.wholesale-tier-row label{min-width:0;font-size:var(--tj-type-help)}.wholesale-tier-row input{width:100%;box-sizing:border-box;direction:ltr}
@media(max-width:600px){.wholesale-tier-row{grid-template-columns:1fr 1fr}.wholesale-tier-row button{min-height:44px}}

.tj-wholesale-tiers{margin-block-end:var(--tj-space-3)}
.tj-wholesale-tiers summary{cursor:pointer;min-height:44px;padding-block:var(--tj-space-2);color:var(--tj-brand);font-weight:600}
.tj-wholesale-tiers table{width:100%;border-collapse:collapse;font-size:var(--tj-text-sm,14px)}
.tj-wholesale-tiers th,.tj-wholesale-tiers td{padding:var(--tj-space-2);text-align:start;border-block-end:1px solid var(--tj-border)}
.tj-wholesale-tiers caption{text-align:start;margin-block:var(--tj-space-2)}
