/* Shared control surfaces and text pairs, independent of the palette's hue. */
:root{--control-ink:#eef2f6;--control-surface:var(--theme-surface)}
:root[data-theme] body :is(.sort-trigger,.sale-select-trigger,.button.secondary,.bargain-button,.cart-add,.completed-trades-button,.icon-button,.segmented,.fee-presets button){background:var(--control-surface);border-color:var(--theme-border);color:var(--control-ink)}
:root[data-theme] body :is(.sort-options,.sale-select-menu,[role=listbox]){background:var(--control-surface);border-color:var(--theme-border);color:var(--control-ink)}
:root[data-theme] body :is(.sort-options [role=option],.sale-select-option,[role=listbox] [role=option],.segmented button){background:transparent;border-color:transparent;color:var(--control-ink)}
:root[data-theme] body :is(.sort-trigger,.sale-select-trigger,.button.secondary,.bargain-button,.cart-add,.completed-trades-button,.icon-button,.fee-presets button):hover{background:var(--control-surface);color:var(--control-ink);border-color:var(--theme-accent);box-shadow:inset 0 0 0 1px var(--theme-accent)}
:root[data-theme] body :is(.sort-options [role=option],.sale-select-option,[role=listbox] [role=option],.segmented button):is(:hover,.keyboard-active,[aria-selected=true],[aria-pressed=true],.active){background:var(--theme-primary);border-color:var(--theme-primary);color:var(--theme-on-primary)}
:root[data-theme] body :is(.sort-trigger,.sale-select-trigger,.sort-options [role=option],.sale-select-option,.segmented button) :is(.icon,span){color:inherit}
:root[data-theme] body :is(.button:not(.secondary):not(.bargain-button):not(.completed-trades-button),.support-launcher,.support-send,.hero-demo-buy:disabled){background:var(--theme-primary);border-color:var(--theme-primary);color:var(--theme-on-primary)}
:root[data-theme] body :is(.button:not(.secondary):not(.bargain-button):not(.completed-trades-button),.support-launcher,.support-send):hover{background:var(--theme-primary-hover);color:var(--theme-on-primary)}
:root[data-theme] body :is(.button,.support-launcher,.support-send)>.icon{color:inherit}
:root[data-theme] body :is(select,textarea,input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=hidden]):not([type=submit])){background-color:var(--control-surface);color:var(--control-ink);caret-color:var(--control-ink)}
:root[data-theme] body :is(input,textarea)::placeholder{color:var(--control-ink);opacity:1}
:root[data-theme] body select option{background:var(--control-surface);color:var(--control-ink)}
:root[data-theme] body :is(.search,.price-inputs label>div){background:var(--control-surface);border-color:var(--theme-border);color:var(--control-ink)}
:root[data-theme] body :is(.search,.price-inputs label>div)>:is(.icon,b,kbd){color:inherit}
:root[data-theme] body :is(button,.button):disabled{cursor:not-allowed}
/* Icon controls use the same readable surface colors. */
:root[data-theme] body :is(.listing-kind,.auction-duration) legend{color:var(--muted)}
:root[data-theme] body :is(.listing-kind,.auction-duration) label>span{background:var(--control-surface);border-color:var(--theme-border);color:var(--control-ink);transition:background .18s,border-color .18s,color .18s}
:root[data-theme] body :is(.listing-kind,.auction-duration) label:hover>span{border-color:var(--theme-accent)}
:root[data-theme] body :is(.listing-kind,.auction-duration) input:checked+span{background:var(--theme-primary);border-color:var(--theme-primary);color:var(--theme-on-primary)}
:root[data-theme] body :is(.listing-kind,.auction-duration) input:focus-visible+span{outline-color:var(--theme-accent)}
:root[data-theme] body :is(.sell-search,.sell-toolbar select){background:var(--control-surface);border-color:var(--theme-border);color:var(--control-ink)}
:root[data-theme] body .sell-search:focus-within{border-color:var(--theme-accent)}
:root[data-theme] body :is(.sell-assurances,.sell-assurances .icon,.auction-composer-note){color:var(--muted)}
/* The complete sale-price wrapper owns its surface and focus ring. */
:root[data-theme] body .sale-sidebar .sale-price-input input{background:transparent!important;color:var(--control-ink);border:0;outline:0!important;box-shadow:none!important;border-radius:0;padding:12px 0;min-height:0;font-size:17px;line-height:1.3}
:root[data-theme] body .sale-sidebar .sale-price-input input::placeholder{color:var(--profile-muted)}
:root[data-theme] body :is(.header-actions .header-icon,.save-button){background:var(--control-surface);color:var(--control-ink);border-color:var(--theme-border)}
:root[data-theme] body :is(.header-actions .header-icon,.save-button)>.icon{color:inherit}
:root[data-theme] body .save-button[aria-pressed=true]{background:var(--theme-primary);color:var(--theme-on-primary);border-color:var(--theme-primary)}

:root[data-theme=noir] body .header-inner :is(.brand,.main-nav a){color:#fff}
:root[data-theme=noir] body :is(.text-link,.text-button,.profile-nav a,.theme-option-label,.hero-demo-content .catalog-card-stats dt){color:var(--text)}
:root[data-theme=noir] body :is(.header-actions .header-icon,.button.secondary){background:#050505}
:root[data-theme=noir] body .marketplace-glow{box-shadow:0 0 0 1px #ffffff24,0 0 16px #ffffff12}
:root[data-theme=noir] body .main-nav .nav-active-line{background:#fff;box-shadow:0 0 4px #fff6,0 3px 9px #fff3}
:root[data-theme=noir] body .hero-links .marketplace-glow::before,:root[data-theme=noir] body .hero-links .marketplace-glow::after{background:conic-gradient(from var(--market-glow-angle),transparent 0deg 230deg,#a8a8a8 280deg,#fff 315deg,#a8a8a8 335deg,transparent 360deg)}
/* Filter chrome follows the full palette, including monochrome Noir. */
:root[data-theme] .market-page .filters,:root[data-theme] .market-page .filters:not([hidden]){background:var(--theme-surface);border-color:var(--theme-border);color:var(--control-ink);scrollbar-color:var(--theme-border) transparent}
:root[data-theme] .market-page .filters::-webkit-scrollbar-thumb{background:var(--theme-border);border-radius:10px}
:root[data-theme] .market-page .filters::-webkit-scrollbar-track{background:transparent}
:root[data-theme] .market-page .filters :is(.filter-section,.filter-reset-footer,.item-traits,.demand-filter){border-color:var(--theme-border)}
:root[data-theme] .market-page .filters :is(h3,.trait-filter,.filter-fixed-label){color:var(--control-ink)}
:root[data-theme] .market-page .filters :is(.trait-filter small,.price-inputs label>span,.price-inputs>i,.price-range-labels){color:var(--muted)}
:root[data-theme] .market-page .filters .trait-filter>.icon{color:var(--theme-accent)}
:root[data-theme] .market-page .filters .trait-filter input{background:var(--theme-header);border-color:color-mix(in srgb,var(--theme-border) 60%,var(--control-ink))}
:root[data-theme] .market-page .filters .trait-filter input:checked{background:var(--theme-primary);border-color:var(--theme-primary)}
:root[data-theme] .market-page .filters .trait-filter input:checked::after{border-color:var(--theme-on-primary)}
:root[data-theme] .market-page .filters .price-filter-heading .text-button{color:var(--muted)}
:root[data-theme] .market-page .filters .reset-all-filters{background:var(--theme-raised);color:var(--control-ink);border-color:var(--theme-border)}
:root[data-theme] .market-page .filters .reset-all-filters:hover{background:var(--theme-surface);border-color:var(--theme-accent)}
:root[data-theme] .market-page .filters :is(select,input,button):focus-visible{outline-color:var(--theme-accent)}
/* Completed trades uses the complete theme palette, not fixed blue-tinted shades. */
:root[data-theme] body .completed-trades-icon{background:var(--theme-raised);border-color:var(--theme-border);color:var(--theme-accent)}
:root[data-theme] body .completed-trades-button>.icon:last-child{color:var(--muted)}
:root[data-theme] body .completed-trades-button:hover>.icon:last-child{color:var(--theme-accent)}
:root[data-theme] body dialog.trade-proof-dialog{background:var(--theme-surface);border-color:var(--theme-border);color:var(--text)}
:root[data-theme] body .trade-proof-dialog :is(.proof-item-heading,.proof-pagination,.proof-values,.proof-footnote){border-color:var(--theme-border)}
:root[data-theme] body .trade-proof-dialog :is(.proof-item-heading>img,.proof-search,.proof-toolbar select,.proof-detail){background:var(--theme-raised);border-color:var(--theme-border);color:var(--text)}
:root[data-theme] body .trade-proof-dialog .proof-sidebar{background:transparent}
:root[data-theme] body .trade-proof-dialog .proof-image-frame{background:var(--theme-header);border-color:var(--theme-border)}
:root[data-theme] body .trade-proof-dialog :is(.proof-sync-status,.proof-item-heading span,.proof-search>.icon,.proof-toolbar>[data-proof-count],.proof-list-entry small,.proof-list-entry time,.proof-pagination,.proof-status,.proof-detail-heading time,.proof-values span,.proof-values>.icon,.proof-participants,.proof-caption>span,.proof-image-error,.proof-empty>.icon,.proof-empty p,.proof-footnote,.proof-loading){color:var(--muted)}
:root[data-theme] body .trade-proof-dialog :is(.proof-values strong,.proof-participants strong,.proof-caption p){color:var(--text)}
:root[data-theme] body .trade-proof-dialog :is(.proof-sync-status button,.proof-detail-actions button,.proof-detail-actions a,.proof-empty a){color:var(--theme-accent)}
:root[data-theme] body .trade-proof-dialog .proof-caption{border-color:var(--theme-accent)}
:root[data-theme] body .trade-proof-dialog .proof-search input{background:transparent;box-shadow:none;outline:none}
:root[data-theme] body .trade-proof-dialog .proof-search:focus-within{border-color:var(--theme-accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--theme-accent) 16%,transparent)}
:root[data-theme] body .trade-proof-dialog .proof-list-entry{background:transparent;border-color:transparent;color:var(--text)}
:root[data-theme] body .trade-proof-dialog .proof-list-entry:hover{background:var(--theme-raised)}
:root[data-theme] body .trade-proof-dialog .proof-list-entry[aria-pressed=true]{background:color-mix(in srgb,var(--theme-accent) 12%,var(--theme-surface));border-color:var(--theme-accent);box-shadow:inset 3px 0 var(--theme-accent)}
:root[data-theme] body .trade-proof-dialog .proof-list-entry>span{background:var(--theme-raised);color:var(--theme-accent)}
:root[data-theme] body .trade-proof-dialog .proof-pagination button:not(:disabled):hover{background:var(--theme-raised);border-color:var(--theme-accent)}
:root[data-theme] body .trade-proof-dialog :is(.proof-sidebar [data-proof-list],.proof-detail){scrollbar-color:var(--theme-border) transparent}
:root[data-theme] body :is(.completed-trades-button,.trade-proof-dialog button,.trade-proof-dialog select,.trade-proof-dialog a):focus-visible{outline-color:var(--theme-accent)}
:root[data-theme] body .trade-proof-dialog .proof-toolbar .proof-search{background:var(--control-surface)}
:root[data-theme] body .trade-proof-dialog .proof-values p{background:color-mix(in srgb,var(--theme-accent) 10%,var(--theme-surface));border-color:color-mix(in srgb,var(--theme-accent) 35%,var(--theme-border));color:var(--theme-accent)}


/* One continuous surface per control; focus follows its existing border. */
:root[data-theme] body :is(.market-buy-search,.item-offer-composer input,.buy-receiver-input input){outline:0!important;box-shadow:none;border-color:var(--theme-border);transition:border-color .18s,box-shadow .18s;background:var(--control-surface);color:var(--control-ink)}
:root[data-theme] body :is(.market-buy-search,.item-offer-composer input,.buy-receiver-input input):focus{outline:0!important;border-color:color-mix(in srgb,var(--theme-accent) 65%,var(--theme-border));box-shadow:0 0 0 2px color-mix(in srgb,var(--theme-accent) 9%,transparent)}
:root[data-theme] body :is(.market-buy-search,.item-offer-composer input,.buy-receiver-input input)::placeholder{color:var(--muted)}
:root[data-theme] body .order-builder{background:var(--theme-surface);border-color:var(--theme-border);box-shadow:none}
:root[data-theme] body :is(.order-search-input,.order-field-control,.order-selected){background:var(--control-surface);border-color:var(--theme-border)}
:root[data-theme] body :is(.order-search-input,.order-field-control) input{background:transparent!important;outline:0!important;box-shadow:none!important;border:0;border-radius:0;color:var(--control-ink)}
:root[data-theme] body :is(.order-search-input,.order-field-control):focus-within{border-color:color-mix(in srgb,var(--theme-accent) 65%,var(--theme-border));box-shadow:0 0 0 2px color-mix(in srgb,var(--theme-accent) 9%,transparent)}
:root[data-theme] body .order-selected{background:color-mix(in srgb,var(--theme-raised) 60%,var(--theme-surface));min-height:72px;padding:10px 12px}
:root[data-theme] body :is(.order-selected strong,.order-total strong){color:var(--control-ink)}
:root[data-theme] body :is(.order-builder label,.order-selected span,.order-currency,.order-disclosure,.order-total,.order-available){color:var(--muted)}
:root[data-theme] body .order-builder-title>.icon{color:var(--theme-accent)}
:root[data-theme] body .order-quantity-input button{color:var(--muted);background:transparent}
:root[data-theme] body .order-quantity-input button:hover{color:var(--control-ink);background:var(--theme-raised)}
:root[data-theme] body .order-total{border-color:var(--theme-border)}
:root[data-theme] body .buy-receiver-consent{box-sizing:border-box;display:flex;align-items:flex-start;gap:10px;padding:11px 12px;border:1px solid var(--theme-border);border-radius:9px;background:var(--control-surface);cursor:pointer;transition:border-color .18s,background .18s}
:root[data-theme] body .buy-receiver-consent:has(input:checked){border-color:color-mix(in srgb,var(--theme-accent) 50%,var(--theme-border));background:color-mix(in srgb,var(--theme-accent) 5%,var(--control-surface))}
:root[data-theme] body .buy-receiver-consent input{appearance:none;display:grid;place-content:center;flex:0 0 17px;box-sizing:border-box;width:17px;height:17px;min-height:0;padding:0;margin:2px 0 0;border:1px solid color-mix(in srgb,var(--muted) 60%,var(--theme-border));border-radius:5px;background:var(--theme-surface);cursor:pointer}
:root[data-theme] body .buy-receiver-consent input:checked{background:var(--theme-primary);border-color:var(--theme-primary)}
:root[data-theme] body .buy-receiver-consent input:checked::after{content:'';width:7px;height:4px;border-left:2px solid var(--theme-on-primary);border-bottom:2px solid var(--theme-on-primary);transform:translateY(-1px) rotate(-45deg)}
:root[data-theme] body .buy-receiver-consent input:focus-visible{outline:0;box-shadow:0 0 0 3px color-mix(in srgb,var(--theme-accent) 22%,transparent)}
:root[data-theme] body .buy-receiver-consent[hidden]{display:none!important}

/* Monochrome navigation chrome and readable primary badges. */
:root[data-theme=noir] body .profile-popover nav a{--menu-icon:var(--theme-accent)}
:root[data-theme] body .header-actions .cart-header>[data-cart-count]:not(:empty){background:var(--theme-primary);border-color:var(--theme-border);color:var(--theme-on-primary)}

:root[data-theme] body :is(.support-start,.support-tabs [data-support-tab-count]:not(:empty)){background:var(--theme-primary);color:var(--theme-on-primary);border-color:var(--theme-primary)}
:root[data-theme] body .support-start:hover{background:var(--theme-primary-hover)}
:root[data-theme] body .support-start :is(strong,small,.icon){color:inherit}
:root[data-theme] body .support-start small{opacity:.8}
:root[data-theme=noir] body .support-message.own p{background:var(--theme-raised);border-color:var(--theme-border);color:var(--text)}
:root[data-theme] body .home-market-toolbar>.visit-marketplace{background:var(--theme-surface);border-color:var(--theme-border);color:var(--theme-accent)}
:root[data-theme] body .home-market-toolbar>.visit-marketplace:hover{background:var(--theme-raised);border-color:var(--theme-accent)}
