/* Market ledger and world treasury: scoped, illustrated, with live data left intact. */
:root{--uc-panel:#102031;--uc-raised:#192c3d;--uc-ink:#dbe3e9;--uc-muted:#afbfcc;--uc-line:#657b8b;--uc-gold:#edc777;--uc-hover:#273c4c;--uc-wash:#112131ed}
html[data-uo-theme='night']{--uc-panel:#111316;--uc-raised:#1c2025;--uc-ink:#dddfe1;--uc-muted:#b3b9c0;--uc-line:#555c63;--uc-gold:#dec292;--uc-hover:#292e34;--uc-wash:#0b0e11ed}
html[data-uo-theme='light']{--uc-panel:#f7f6ed;--uc-raised:#e3e9e7;--uc-ink:#2c4050;--uc-muted:#506674;--uc-line:#91a5b1;--uc-gold:#725017;--uc-hover:#dde8ea;--uc-wash:#f0f2ebf5}
html #crm :is(.uo-commerce-market,.uo-commerce-world){min-width:0;color:var(--uc-ink)}
html #crm .uo-commerce-title{position:relative;display:flex;align-items:center;gap:13px;min-height:76px;margin:0 0 18px;padding:12px 24px 12px 13px;font-size:28px;line-height:1.15;color:var(--g1);background:linear-gradient(90deg,var(--uc-wash),transparent),url('/static/uo-v2-leather.webp');border:1px solid var(--uc-line);box-shadow:inset 0 0 0 3px #c8d9e315}
html #crm .uo-commerce-title::after{content:'';position:absolute;inset:0;border:18px solid transparent;border-image:var(--uo-frame-image,url('/static/uo-v2-frame.webp')) 220 / 18px / 0 stretch;pointer-events:none}
html #crm .uo-commerce-title>.uo-commerce-art{--uo-icon-size:66px;filter:drop-shadow(0 3px 3px #0005)}
html #crm .uo-commerce-world .uo-commerce-title{flex:1;margin:0;min-width:230px}
html #crm .uo-world-toolbar{gap:12px!important;align-items:stretch!important;margin-bottom:18px!important}
html #crm .uo-world-toolbar>div:last-child{align-items:center;flex-wrap:wrap}
html #crm .uo-market-filters{padding:16px;background:var(--uc-panel);border:1px solid var(--uc-line);gap:9px!important;margin-bottom:12px!important;box-shadow:inset 0 1px #adc4d225}
html #crm .uo-market-filters :is(input,select){flex:1 1 145px;width:100%;min-width:0;max-width:none!important;height:38px;font-size:13px!important;border-radius:3px}
html #crm .uo-market-filters input{flex-basis:230px}
html #crm .uo-market-filters #vend-info{flex-basis:100%;color:var(--uc-ink)!important;padding-top:4px}
html #crm .uo-market-filters>div:last-child{color:var(--uc-muted)!important;line-height:1.5}
html #crm .uo-market-actions{flex-wrap:wrap;align-items:center;gap:8px!important}
html #crm .uo-market-actions :is(button),html #crm .uo-world-toolbar .fb{position:relative;min-height:40px;padding:7px 23px!important;color:var(--uc-ink)!important;border:0!important;background:var(--uo-button-image,url('/static/uo-forged-button.webp')) center/100% 100% no-repeat!important;box-shadow:none!important;text-shadow:0 1px #0008;border-radius:0}
html[data-uo-theme='light'] #crm :is(.uo-market-actions button,.uo-world-toolbar .fb){text-shadow:0 1px #fff8}
html #crm #vend-stamp{color:var(--uc-muted)!important}
html #crm .uo-market-ledger{max-width:100%;border:1px solid var(--uc-line);border-radius:2px;background:var(--uc-panel);box-shadow:0 4px 12px #0002;scrollbar-color:var(--uc-line) var(--uc-panel)}
html #crm #vend-table{width:100%;border-collapse:collapse;margin:0;min-width:790px}
html #crm #vend-table th{background:var(--uc-raised);color:var(--uc-muted);padding:13px 12px;border-bottom:1px solid var(--uc-line);font-size:11px;letter-spacing:1px;white-space:nowrap}
html #crm #vend-table th:first-child{width:64px}
html #crm #vend-table td{padding:12px;border-bottom:1px solid color-mix(in srgb,var(--uc-line) 42%,transparent);color:var(--uc-ink);font-size:13px}
html #crm #vend-table tbody tr:nth-child(even){background:color-mix(in srgb,var(--uc-raised) 43%,transparent)}
html #crm #vend-table tbody tr:hover{background:var(--uc-hover)!important}
html #crm #vend-table tbody tr[style*='background:rgba(201'],html #crm #vend-table tbody tr[style*='background: rgba(201']{box-shadow:inset 3px 0 var(--g1)}
html #crm #vend-table td:first-child{background:transparent!important;padding:8px}
html #crm #vend-table td:first-child img{width:39px!important;height:39px!important;box-sizing:content-box;padding:4px;border:1px solid var(--uc-line);border-radius:2px;background:#090c11;mix-blend-mode:normal!important;box-shadow:inset 0 0 0 2px #95b0c219}
html #crm #vend-table td:last-child{color:var(--uc-gold)!important;white-space:nowrap}
html #crm #vend-table td:nth-child(4) a{color:#74bfdf!important}
html[data-uo-theme='light'] #crm #vend-table td:nth-child(4) a{color:#1d637f!important}
html #crm #vend-pager .fb{min-width:34px;min-height:34px;color:var(--uc-ink)!important;background:var(--uc-raised)!important;border:1px solid var(--uc-line)!important}
html #crm #vend-pager .fb[style*='var(--g1)']{box-shadow:inset 0 -3px var(--g1)}
html #crm #vend-tooltip{background:var(--uc-panel)!important;border-color:var(--uc-line)!important;backdrop-filter:none!important;border-radius:3px!important;color:var(--uc-ink)}
html #crm #vend-tooltip :is(#vt-name,#vt-qty){color:var(--uc-ink)!important}
html #crm #vend-tooltip #vt-price{color:var(--uc-gold)!important}
html #crm #vend-calc>div{background:var(--uc-panel)!important;border-color:var(--uc-line)!important;border-radius:3px!important}
html #crm #vend-calc{top:115px!important;max-height:calc(100dvh - 135px)!important}
html #crm #vend-calc>div{max-height:calc(100dvh - 135px)!important}
html #crm #vend-calc [style*='grid-template-columns:1fr 92px 140px 26px']{grid-template-columns:minmax(0,1fr) 66px minmax(66px,92px) 25px!important;gap:6px!important}
html #crm #vend-calc [style*='color:#f59e0b']{color:var(--uc-gold)!important}
html #crm .uo-economy-stats{grid-template-columns:repeat(auto-fit,minmax(230px,1fr))!important;gap:12px!important;margin-bottom:18px!important}
html #crm .uo-economy-stat{position:relative;min-width:0;min-height:116px;padding:22px 15px 18px 92px!important;border-radius:2px!important;border:1px solid var(--uc-line)!important;background:linear-gradient(100deg,var(--uc-wash),var(--uc-panel)),url('/static/uo-v2-leather.webp')!important;box-shadow:inset 0 0 0 3px #b8cbd517,0 3px 8px #0002}
html #crm .uo-economy-stat>.uo-commerce-art{position:absolute;left:10px;top:21px;--uo-icon-size:76px;filter:drop-shadow(0 3px 3px #0005)}
html #crm .uo-economy-stat>div:first-of-type{color:var(--uc-muted)!important;font-size:10px!important;line-height:1.5}
html #crm .uo-economy-stat>div:nth-of-type(2){font-family:Georgia,serif;font-size:23px!important;color:var(--g1)!important;overflow-wrap:anywhere}
html #crm .uo-economy-stat:nth-child(3)>div:nth-of-type(2){color:#ef987c!important}
html[data-uo-theme='light'] #crm .uo-economy-stat:nth-child(3)>div:nth-of-type(2){color:#91422a!important}
html #crm .uo-economy-stat:nth-child(4)>div:nth-of-type(2){font-family:inherit;font-size:15px!important;color:var(--uc-ink)!important}
html #crm .uo-economy-tabs{gap:8px!important;margin-bottom:18px!important}
html #crm .uo-economy-tabs .w-tab{display:inline-flex;align-items:center;gap:6px;padding:7px 15px!important;min-height:46px;border-radius:2px!important;color:var(--uc-ink)!important;border:1px solid var(--uc-line)!important;background:var(--uc-panel)!important;box-shadow:inset 0 1px #d7e8f220}
html #crm .uo-economy-tabs .w-tab .uo-commerce-art{--uo-icon-size:29px}
html #crm .uo-economy-tabs .w-tab[aria-pressed='true']{background:var(--uc-raised)!important;color:var(--g1)!important;box-shadow:inset 0 -3px var(--g1)}
html #crm .uo-economy-heading{margin-top:10px;padding:8px 12px!important;color:var(--uc-ink);border-left-color:var(--g1)!important}
html #crm .uo-resource-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,310px),1fr))!important;max-width:none!important;gap:8px!important}
html #crm .uo-resource-row{padding:12px!important;gap:10px!important;border-radius:2px!important;border-color:var(--uc-line)!important;background:var(--uc-panel)!important;box-shadow:inset 0 1px #aec3d219}
html #crm .uo-resource-row:hover{background:var(--uc-hover)!important}
html #crm .uo-resource-row>div>div:first-child{color:var(--uc-ink)!important}
html #crm .uo-resource-row>div>div:last-child{background:color-mix(in srgb,var(--uc-line) 25%,transparent)!important;height:5px!important}
html #crm .uo-economy-charts{grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr))!important;max-width:none!important;gap:16px!important}
html #crm .uo-chart-card{min-width:0;padding:18px!important;background:var(--uc-panel)!important;border:1px solid var(--uc-line)!important;border-radius:2px!important;box-shadow:inset 0 0 0 3px #c2d7e015}
html #crm .uo-chart-card>div:first-child{color:var(--uc-ink)!important;font-family:Georgia,serif;font-size:17px!important}
html #crm .uo-chart-card canvas{display:block;width:100%;height:auto;margin:0 auto;max-width:430px!important}
html[data-uo-theme='light'] #crm .uo-commerce-title{background:linear-gradient(100deg,#f5f5ebf9,#dde6e4f5),url('/static/uo-v2-leather.webp')}
html[data-uo-theme='light'] #crm .uo-resource-row>span:last-child{color:#355969!important}
html #crm :is(.uo-commerce-market,.uo-commerce-world) :is(button,a,input,select,[tabindex]):focus-visible{outline:2px solid var(--g1);outline-offset:3px}
@media(max-width:600px){
 html #crm .uo-commerce-title{min-height:70px;font-size:24px;padding:10px;margin-bottom:14px;gap:8px}
 html #crm .uo-commerce-title>.uo-commerce-art{--uo-icon-size:54px}
 html #crm .uo-world-toolbar{display:block!important}
 html #crm .uo-world-toolbar>div:last-child{margin-top:10px}
 html #crm .uo-market-filters{padding:12px;gap:8px!important}
 html #crm .uo-market-filters :is(input,select){flex-basis:calc(50% - 8px);max-width:calc(50% - 4px)!important;font-size:12px!important;height:40px}
 html #crm .uo-market-filters input{flex-basis:100%;max-width:100%!important}
 html #crm .uo-economy-stats{grid-template-columns:1fr!important;gap:8px!important}
 html #crm .uo-economy-stat{min-height:89px;padding:15px 12px 13px 78px!important}
 html #crm .uo-economy-stat>.uo-commerce-art{--uo-icon-size:60px;top:13px;left:9px}
 html #crm .uo-economy-stat>div:nth-of-type(2){font-size:22px!important}
 html #crm .uo-economy-tabs{display:grid!important;grid-template-columns:1fr 1fr;gap:7px!important}
 html #crm .uo-economy-tabs .w-tab{padding:6px!important;font-size:12px!important;gap:3px}
 html #crm .uo-economy-tabs .w-tab .uo-commerce-art{--uo-icon-size:27px}
 html #crm .uo-resource-row{gap:6px!important;padding:10px 8px!important}
 html #crm .uo-resource-row>span:last-child{min-width:46px!important}
 html #crm .uo-chart-card{padding:12px!important}
 html #crm #vend-calc{right:8px!important;top:110px!important;width:calc(100vw - 16px)!important}
 html #crm #vend-calc>div{padding:12px!important}
 html #crm #vend-calc [style*='grid-template-columns:1fr 92px 140px 26px']{grid-template-columns:minmax(0,1fr) 60px 24px!important}
 html #crm #vend-calc [style*='grid-template-columns:1fr 92px 140px 26px']>div:first-child{grid-column:1 / -1}
 html #crm #vend-calc [style*='grid-template-columns:1fr 92px 140px 26px']>input{grid-column:1;max-width:84px}
}
@media(prefers-reduced-motion:reduce){html #crm .uo-resource-row,html #crm .uo-resource-row *{transition:none!important}}
@media(forced-colors:active){html #crm :is(.uo-commerce-title,.uo-economy-stat,.uo-resource-row,.uo-chart-card,.uo-market-filters,.uo-market-ledger,.uo-economy-tabs .w-tab){background:Canvas!important;border-color:CanvasText!important;color:CanvasText!important}html #crm .uo-commerce-title::after{display:none}html #crm :is(.uo-market-actions button,.uo-world-toolbar .fb){background:ButtonFace!important;border:1px solid ButtonText!important;color:ButtonText!important;text-shadow:none!important}html #crm .uo-economy-tabs .w-tab[aria-pressed='true']{outline:2px solid Highlight;outline-offset:-3px}}
/* Keep the collapsed basket clear of the helper and consent banner. */
html #vc-chip{top:115px!important;bottom:auto!important;right:16px!important;max-width:calc(100vw - 32px);background:var(--uc-panel)!important;border:1px solid var(--uc-line)!important;border-radius:3px!important;color:var(--uc-ink)}
html #vc-chip .tnum{color:var(--uc-gold)!important}
@media(max-width:600px){html #vc-chip{top:110px!important;right:8px!important;max-width:calc(100vw - 16px)}}

@media(max-width:600px){html #crm #vend-tooltip{display:none!important}}

/* Market sprites keep their native palette on paper, including body-mounted cards. */
html[data-uo-theme='light'] :is(#tab-vendors,#vend-tooltip,#vend-modal,#ed-tip,.uo-item-popover) img[src*='/UOJPEG/' i]{mix-blend-mode:normal!important;background-color:#101719;border-radius:3px}
html[data-uo-theme='light'] body:has(#tab-vendors.active) #ed-tip{background:#f8f7ef!important;color:#2d4351!important;border-color:#99a8ae!important}
html[data-uo-theme='light'] body:has(#tab-vendors.active) #ed-tip :is([style*='color:#e2e8f0'],[style*='color:#cbd5e1'],[style*='color:#c8ccd0']){color:#2d4351!important}
html[data-uo-theme='light'] body:has(#tab-vendors.active) #ed-tip :is([style*='color:#5c6472'],[style*='color:#666'],[style*='color:#8b95a5']){color:#536775!important}

/* Quiet graphite, pale ink and pewter details for the night market. */
html[data-uo-theme='night'] body #crm #tab-vendors,
html[data-uo-theme='night'] body:has(#tab-vendors.active) :is(#vend-calc,#vc-chip,#vend-modal,#ed-tip,#vend-tooltip,.uo-item-popover){
 --uc-panel:#232627;--uc-raised:#2d3233;--uc-ink:#e4e7e5;--uc-muted:#b6c0bd;
 --uc-line:#616f70;--uc-gold:#d5dbd2;--uc-hover:#354042;--uc-wash:#24292beb;
 --g1:#d5dbd2;--muted:#b6c0bd;--brd:#616f7080;--card:#232627;
}
html[data-uo-theme='night'] body #crm #tab-vendors .uo-commerce-title{background:linear-gradient(100deg,#272d2ee8,#212526e8),url('/static/uo-v2-leather.webp') left top/460px 460px!important;color:#e4e7e5!important}
html[data-uo-theme='night'] body #crm #tab-vendors :is(.uo-market-ledger,.uo-market-filters){background:var(--uc-panel)!important;color:var(--uc-ink)!important}
html[data-uo-theme='night'] body #crm #tab-vendors .uo-market-filters :is(input,select){background:#1a1f20!important;color:var(--uc-ink)!important;border:1px solid var(--uc-line)!important}
html[data-uo-theme='night'] body #crm #tab-vendors input::placeholder{color:#b6c0bd!important;opacity:1}
html[data-uo-theme='night'] body #crm #tab-vendors #vend-table th{background:#2d3233!important;color:#c6cfcc!important;letter-spacing:.055em}
html[data-uo-theme='night'] body #crm #tab-vendors #vend-table td{color:#e4e7e5!important;font-size:14px;line-height:1.5;border-bottom-color:#52606066!important;text-shadow:none!important}
html[data-uo-theme='night'] body #crm #tab-vendors #vend-table td :is(a,[data-name]){color:#dce7e7!important;text-shadow:none!important}
html[data-uo-theme='night'] body #crm #tab-vendors #vend-table td:nth-child(4) a{color:#a8d1d5!important}
html[data-uo-theme='night'] body #crm #tab-vendors #vend-table td:last-child{color:#d5dbd2!important}
html[data-uo-theme='night'] body #crm #tab-vendors #vend-table tr[style*='background:rgba(201'],
html[data-uo-theme='night'] body #crm #tab-vendors #vend-table tr[style*='background: rgba(201']{background:#354042!important;box-shadow:inset 3px 0 #adc3bc!important}
/* Text is native HTML; ImageGen provides only the neutral painted button shell. */
html[data-uo-theme='night'] body #crm #tab-vendors .uo-market-actions button,
html[data-uo-theme='night'] body #crm #tab-wiki #wiki-btns :is(#we-create-btn,#we-edit-btn,#we-del-btn),
html[data-uo-theme='night'] body #crm #tab-wiki #wiki-art-content button.uo-finish-button,
html[data-uo-theme='night'] body:has(#tab-vendors.active) :is(#vend-modal,#vend-calc) button.fb{
 background:url('/static/uo-market-night-button-v1.webp') center/100% 100% no-repeat!important;
 border:0!important;border-radius:0!important;box-shadow:none!important;color:#eef1ef!important;text-shadow:0 1px 1px #000!important;
 min-height:40px;padding:10px 22px!important;font:600 13px/1.3 'Segoe UI',Arial,sans-serif!important;
}
html[data-uo-theme='night'] body #crm #tab-vendors .uo-market-actions button:hover,
html[data-uo-theme='night'] body #crm #tab-wiki #wiki-btns :is(#we-create-btn,#we-edit-btn,#we-del-btn):hover,
html[data-uo-theme='night'] body #crm #tab-wiki #wiki-art-content button.uo-finish-button:hover,
html[data-uo-theme='night'] body:has(#tab-vendors.active) :is(#vend-modal,#vend-calc) button.fb:hover{filter:brightness(1.12)}
html[data-uo-theme='night'] body #crm #tab-wiki #wiki-btns #we-del-btn{color:#e3b7b2!important}
html[data-uo-theme='night'] body #crm #tab-wiki #wiki-art-content button.uo-finish-button[style*='font-weight: 700'],
html[data-uo-theme='night'] body #crm #tab-wiki #wiki-art-content button.uo-finish-button[style*='font-weight:700']{color:#ffffff!important;filter:brightness(1.15);text-decoration:underline;text-underline-offset:4px}
html[data-uo-theme='night'] body #crm #tab-wiki #wiki-btns button:focus-visible,
html[data-uo-theme='night'] body #crm #tab-wiki #wiki-art-content button.uo-finish-button:focus-visible{outline:2px solid #b4d5d5!important;outline-offset:3px}
html[data-uo-theme='night'] body #crm #tab-vendors #vend-pager button{background:#2d3233!important;color:#e4e7e5!important;border-color:#616f70!important}
html[data-uo-theme='night'] body #crm #tab-vendors #vend-pager button[aria-current='page']{background:#43514e!important;border-color:#a5b8b1!important;box-shadow:inset 0 -2px #a5b8b1!important}
html[data-uo-theme='night'] body #crm #tab-vendors :is(button,a,input,select,[tabindex]):focus-visible{outline:2px solid #b4d5d5!important;outline-offset:3px}
html[data-uo-theme='night'] body:has(#tab-vendors.active) :is(#ed-tip,#vend-modal>div,#vend-calc>div,#vend-tooltip,.uo-item-popover){background:#232627!important;color:#e4e7e5!important;border-color:#616f70!important;backdrop-filter:none!important}
html[data-uo-theme='night'] body:has(#tab-vendors.active) :is(#ed-tip,#vend-modal,#vend-calc,#vend-tooltip,.uo-item-popover) :is([style*='color:#5c6472'],[style*='color:#5b6472'],[style*='color:#666'],[style*='color:#8b95a5'],[style*='color:#718096']){color:#b6c0bd!important}
html[data-uo-theme='night'] body:has(#tab-vendors.active) :is(#ed-tip,#vend-modal,#vend-calc,#vend-tooltip) [style*='color:#f59e0b']{color:#d5dbd2!important}
html[data-uo-theme='night'] body:has(#tab-vendors.active) #vend-calc input{background:#1a1f20!important;color:#e4e7e5!important;border-color:#616f70!important}
@media(forced-colors:active){html[data-uo-theme='night'] body #crm #tab-vendors .uo-market-actions button{background:ButtonFace!important;color:ButtonText!important;border:1px solid ButtonText!important;text-shadow:none!important}}
