/* UNION V2 — Catalog / Inventory styling v1.2
   Deliberately scoped: nothing changes on Home, login, profile or avatar.
   Forces layout even when the standalone Vite route forgot to import site CSS. */
:root:has(.union-market){color-scheme:dark;--union-bg:#0d1117;--union-panel:#171f29;--union-panel-2:#202b36;--union-border:#354552;--union-text:#e6edf3;--union-subtle:#9aaebb;--union-blue:#169bd5}
body:has(.union-market){background:#0d1117!important;color:#e6edf3!important;font:14px/1.5 Arial,Helvetica,sans-serif!important;margin:0!important;min-width:320px}
body:has(.union-market) *,body:has(.union-market) *::before,body:has(.union-market) *::after{box-sizing:border-box}
body:has(.union-market) a{color:#81c9ed;text-decoration:none}
body:has(.union-market) a:hover{text-decoration:underline}
body:has(.union-market) button,body:has(.union-market) input{font:inherit}
body:has(.union-market) button{cursor:pointer}
body:has(.union-market) button:disabled{opacity:.45;cursor:not-allowed}
body:has(.union-market) .sr-only{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important}

/* Shell fallback: preserve UNION Project X-style topbar and left navigation. */
body:has(.union-market) .site-layout{min-height:100vh}
body:has(.union-market) .union-topbar{position:fixed;top:0;right:0;left:0;height:58px;background:#151a21;border-bottom:1px solid #30363d;z-index:30;box-shadow:0 2px 10px #0005}
body:has(.union-market) .topbar-main{display:grid;grid-template-columns:minmax(max-content,1fr) minmax(160px,480px) minmax(max-content,1fr);align-items:center;gap:14px;height:100%;padding:0 19px}
body:has(.union-market) .topbar-left{display:flex;align-items:center;gap:16px;min-width:0}
body:has(.union-market) .union-brand{display:flex;align-items:center;gap:5px;min-width:145px;color:#f1f6fa;font-size:23px;font-weight:900;letter-spacing:.5px;text-decoration:none}
body:has(.union-market) .union-brand img{width:48px;height:44px;object-fit:contain}
body:has(.union-market) .topbar-links{display:flex;align-items:center;gap:17px;white-space:nowrap}
body:has(.union-market) .topbar-links a,body:has(.union-market) .top-link-soon{font-size:15px;color:#e7edf2;padding:6px 3px}
body:has(.union-market) .top-link-soon{color:#8397a5}
body:has(.union-market) .global-search{display:flex;align-items:center;width:100%;min-width:0;height:32px;border:1px solid #4a5966;background:#0c1218;border-radius:6px;overflow:hidden;margin:0}
body:has(.union-market) .global-search button{border:0;background:transparent;color:#b5c5d1;padding:5px 9px}
body:has(.union-market) .global-search input{width:100%;min-width:0;flex:1;color:#e6edf3;background:transparent;border:0;outline:none;padding:5px 7px}
body:has(.union-market) .topbar-tools{display:flex;align-items:center;justify-self:end;gap:13px;white-space:nowrap;min-width:0}
body:has(.union-market) .account-area{display:flex;align-items:center;gap:8px;color:#eef3f8}
body:has(.union-market) .avatar-dot{width:29px;height:29px;border-radius:50%;background:#2e3e4e;display:flex;align-items:center;justify-content:center;overflow:hidden}
body:has(.union-market) .avatar-dot img{width:100%;height:100%;object-fit:cover}
body:has(.union-market) .account-name{font-weight:700;max-width:125px;overflow:hidden;text-overflow:ellipsis}
body:has(.union-market) .topbar-balance{display:flex;align-items:center;gap:5px;color:#ecf4fa;font-weight:700}
body:has(.union-market) .topbar-settings{display:flex;align-items:center;justify-content:center;width:33px;height:34px;border:0;border-radius:5px;background:transparent;color:#e6edf3}
body:has(.union-market) .topbar-settings-wrap{position:relative}
body:has(.union-market) .topbar-dropdown{position:absolute;top:41px;right:0;width:215px;display:flex;flex-direction:column;z-index:50;background:#1b2732;border:1px solid #455a6b;border-radius:6px;padding:6px;box-shadow:0 12px 30px #0009}
body:has(.union-market) .topbar-dropdown a,body:has(.union-market) .topbar-dropdown button{display:block;width:100%;text-align:left;padding:9px 10px;color:#e6edf3;background:transparent;border:0}
body:has(.union-market) .topbar-dropdown-title{padding:7px 10px;color:#95b0bf;border-bottom:1px solid #344554}
body:has(.union-market) .mobile-menu{display:none;background:transparent;border:0;color:white}
body:has(.union-market) .union-sidebar{position:fixed;top:58px;left:0;bottom:0;width:185px;padding:13px 10px;background:#161b22;border-right:1px solid #30363d;overflow-y:auto;display:flex;flex-direction:column;z-index:25}
body:has(.union-market) .sidebar-username{padding:3px 9px 12px;color:#eaf1f7;font-size:18px;font-weight:600}
body:has(.union-market) .sidebar-divider{border-top:1px solid #34434f;margin:0 5px 10px}
body:has(.union-market) .sidebar-link{display:flex;align-items:center;gap:10px;width:100%;min-height:36px;padding:8px 10px;color:#d3e0e9;border:0;background:transparent;border-radius:4px;font-size:14px;text-align:left}
body:has(.union-market) .sidebar-link svg{flex-shrink:0}
body:has(.union-market) .sidebar-link:hover,body:has(.union-market) .sidebar-link.selected{background:#263643;color:#fff;text-decoration:none}
body:has(.union-market) .sidebar-link.disabled{opacity:.45;cursor:default}
body:has(.union-market) .sidebar-bottom{margin-top:auto;padding:15px 9px 5px;color:#8196a5;font-size:11px}
body:has(.union-market) .sidebar-bottom small{color:#657d90}
body:has(.union-market) .site-content{margin-left:185px;padding-top:58px;min-height:100vh;display:flex;flex-direction:column}
body:has(.union-market) .union-container{width:100%;max-width:1390px;margin:0 auto;padding:35px 40px 70px;flex:1;min-width:0}
body:has(.union-market) .union-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:auto;padding:20px 35px;color:#7e95a5;font-size:12px;border-top:1px solid #263441}

/* Catalog / Inventory */
.union-market{width:100%;max-width:1160px;margin:0 auto;padding:0;color:#e7eff6}
.union-market h1,.union-market h2,.union-market p{margin-top:0}
.union-market-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:23px}
.union-market-heading>div{min-width:0}
.union-market-overline{color:#72c4ef;font-size:11px;font-weight:800;letter-spacing:1.55px;text-transform:uppercase;margin:0 0 9px!important}
.union-market-heading h1{color:#f3f7fb;font-size:clamp(30px,3.2vw,40px);font-weight:750;line-height:1.16;margin:0 0 9px}
.union-market-heading p:not(.union-market-overline){color:#a1b3c1;font-size:14px;max-width:650px;margin:0;line-height:1.6}
.union-market-heading>.union-btn{flex-shrink:0}
.union-market .union-btn.accent{display:inline-flex;align-items:center;justify-content:center;background:#168fc8;border:1px solid #38b0e3;border-radius:5px;padding:10px 16px;color:#fff!important;font-weight:700;font-size:13px;white-space:nowrap;text-decoration:none}
.union-market .union-btn.accent:hover{background:#27a3d8}
.union-market-switch{display:inline-flex;align-items:center;gap:5px;background:#151e27;border:1px solid #394955;padding:4px;border-radius:8px;margin:0 0 20px}
.union-market-switch>a{display:inline-flex;justify-content:center;min-width:105px;border-radius:6px;padding:9px 17px;color:#afc4d4!important;font-size:13px;font-weight:700;text-decoration:none!important}
.union-market-switch>a:hover{background:#283b49;color:#fff!important}
.union-market-switch>a[aria-current="page"]{background:#1a8fc8;color:#fff!important;box-shadow:0 2px 6px #0004}
.union-market-notice{display:block;color:#b0c3d0;background:#172530;border:1px solid #31495a;border-left:3px solid #3b9dcf;padding:13px 16px;border-radius:5px;font-size:12px;line-height:1.55;margin:0 0 23px!important}
.union-market-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 17px}
.union-market-search{display:flex;align-items:center;gap:9px;height:43px;max-width:515px;width:100%;min-width:0;padding:0 13px;background:#101820;border:1px solid #415365;border-radius:6px;color:#9ab3c2}
.union-market-search:focus-within{border-color:#43b4e7;box-shadow:0 0 0 2px #218db523}
.union-market-search input{display:block;flex:1;min-width:0;width:100%;height:100%;padding:0;border:0;background:transparent;color:#eaf2f7;outline:none;font-size:13px}
.union-market-search input::placeholder{color:#7e94a6}
.union-market-count{white-space:nowrap;color:#9fb3c1;font-size:13px}
.union-market-filters{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 25px}
.union-market-filters button{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:7px 13px;background:#1b2a36;border:1px solid #3d5160;border-radius:999px;color:#bcd0dc;font-size:12px;font-weight:650;transition:background .15s,border-color .15s}
.union-market-filters button:hover{background:#273d4e}
.union-market-filters button.active,.union-market-filters button[aria-pressed="true"]{background:#1b4b63;border-color:#53b9e3;color:white}
.union-market-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin:0 0 28px;align-items:stretch}
.union-market-card{display:flex;flex-direction:column;min-width:0;min-height:0;background:#17222d;border:1px solid #364958;border-radius:8px;overflow:hidden;transition:transform .15s,border-color .15s,box-shadow .15s}
.union-market-card:hover{transform:translateY(-3px);border-color:#56b4e0;box-shadow:0 8px 22px #0004}
.union-market-picture{position:relative;display:flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:0;width:100%;height:auto;aspect-ratio:1/1;max-height:310px;overflow:hidden;background:linear-gradient(165deg,#2a3948,#1d2834 80%);border-bottom:1px solid #354653;padding:15px}
.union-market-picture>img{display:block!important;width:90%!important;height:90%!important;max-width:200px!important;max-height:200px!important;object-fit:contain!important;object-position:center!important;flex:none!important;margin:auto!important}
.union-market-fallback{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;color:#859bad;text-align:center}
.union-market-fallback small{font-size:11px}
.union-market-worn{position:absolute;top:9px;right:9px;z-index:1;color:#e4f6ff;background:#1d7197;border:1px solid #4bb1dd;border-radius:5px;font-size:11px;font-weight:700;padding:4px 8px}
.union-market-description{display:flex;flex-direction:column;gap:0;flex:1;min-width:0;padding:14px}
.union-market-description>strong{display:block;color:#ecf4fa;font-size:14px;line-height:1.35;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:6px}
.union-market-description>span{display:block;color:#93aabb;font-size:12px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:14px}
.union-market-description>a{display:flex;align-items:center;justify-content:center;min-height:35px;margin-top:auto;padding:8px 10px;text-align:center;color:#d9effe!important;border:1px solid #426b84;background:#244154;border-radius:5px;font-size:12px;font-weight:700;text-decoration:none!important;transition:background .15s}
.union-market-description>a:hover{background:#2b5671}
.union-market-pagination{display:flex;align-items:center;justify-content:center;gap:18px;margin:26px 0}
.union-market-pagination button{padding:9px 14px;color:#d9edf9;border:1px solid #466477;background:#223748;border-radius:5px}
.union-market-pagination button:hover:not(:disabled){background:#315064}
.union-market-pagination span{color:#a7bbcb;font-size:12px}
.union-market .places-empty{padding:24px;color:#9fb3c4;background:#172530;border:1px solid #364958;border-radius:6px}

@media(max-width:1260px){body:has(.union-market) .topbar-main{grid-template-columns:minmax(max-content,1fr) minmax(150px,350px) minmax(max-content,1fr)}body:has(.union-market) .topbar-left{gap:8px}body:has(.union-market) .topbar-links{gap:7px}.union-market-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:990px){body:has(.union-market) .union-container{padding:25px 22px 55px}body:has(.union-market) .mobile-menu{display:inline-flex}body:has(.union-market) .union-sidebar{transform:translateX(-103%);transition:transform .18s}body:has(.union-market) .union-sidebar.is-open{transform:translateX(0)}body:has(.union-market) .site-content{margin-left:0}body:has(.union-market) .mobile-overlay{position:fixed;inset:58px 0 0;background:#0009;border:0;z-index:24}body:has(.union-market) .union-brand{min-width:110px}body:has(.union-market) .account-name{display:none}}
@media(max-width:810px){body:has(.union-market) .union-topbar{height:100px}body:has(.union-market) .topbar-main{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:56px 36px;grid-template-areas:'left tools' 'search search';padding:0 12px 5px;gap:3px 10px}body:has(.union-market) .topbar-left{grid-area:left}body:has(.union-market) .topbar-tools{grid-area:tools}body:has(.union-market) .global-search{grid-area:search;height:33px}body:has(.union-market) .union-sidebar{top:100px}body:has(.union-market) .site-content{padding-top:100px}body:has(.union-market) .mobile-overlay{inset:100px 0 0}.union-market-heading{align-items:flex-start}.union-market-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){body:has(.union-market) .topbar-links{display:none}body:has(.union-market) .union-brand{font-size:19px;min-width:0}body:has(.union-market) .union-brand img{width:40px;height:38px}body:has(.union-market) .topbar-tools{gap:6px}body:has(.union-market) .topbar-balance{font-size:12px}body:has(.union-market) .union-container{padding:20px 14px 45px}.union-market-heading{flex-direction:column;gap:14px}.union-market-heading h1{font-size:32px}.union-market-toolbar{flex-wrap:wrap}.union-market-count{margin-left:0}.union-market-picture{padding:8px}.union-market-description{padding:10px}}
@media(max-width:430px){.union-market-grid{gap:10px}.union-market-switch{width:100%}.union-market-switch>a{flex:1}.union-market-filters{gap:6px}.union-market-filters button{padding:6px 10px;font-size:11px}.union-market-description>a{font-size:11px}}