/* UNION V2 | Home polish v1. Scoped to /home only. No scripts, PHP, or renderer changes. */
:root:has(.home-dashboard){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(.home-dashboard){background:#0d1117!important;color:#e6edf3!important;font:14px/1.5 Arial,Helvetica,sans-serif!important;margin:0!important;min-width:320px}
body:has(.home-dashboard) *,body:has(.home-dashboard) *::before,body:has(.home-dashboard) *::after{box-sizing:border-box}
body:has(.home-dashboard) a{color:#81c9ed;text-decoration:none}
body:has(.home-dashboard) a:hover{text-decoration:underline}
body:has(.home-dashboard) button,body:has(.home-dashboard) input{font:inherit}
body:has(.home-dashboard) button{cursor:pointer}
body:has(.home-dashboard) button:disabled{opacity:.45;cursor:not-allowed}
body:has(.home-dashboard) .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(.home-dashboard) .site-layout{min-height:100vh}
body:has(.home-dashboard) .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(.home-dashboard) .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(.home-dashboard) .topbar-left{display:flex;align-items:center;gap:16px;min-width:0}
body:has(.home-dashboard) .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(.home-dashboard) .union-brand img{width:48px;height:44px;object-fit:contain}
body:has(.home-dashboard) .topbar-links{display:flex;align-items:center;gap:17px;white-space:nowrap}
body:has(.home-dashboard) .topbar-links a,body:has(.home-dashboard) .top-link-soon{font-size:15px;color:#e7edf2;padding:6px 3px}
body:has(.home-dashboard) .top-link-soon{color:#8397a5}
body:has(.home-dashboard) .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(.home-dashboard) .global-search button{border:0;background:transparent;color:#b5c5d1;padding:5px 9px}
body:has(.home-dashboard) .global-search input{width:100%;min-width:0;flex:1;color:#e6edf3;background:transparent;border:0;outline:none;padding:5px 7px}
body:has(.home-dashboard) .topbar-tools{display:flex;align-items:center;justify-self:end;gap:13px;white-space:nowrap;min-width:0}
body:has(.home-dashboard) .account-area{display:flex;align-items:center;gap:8px;color:#eef3f8}
body:has(.home-dashboard) .avatar-dot{width:29px;height:29px;border-radius:50%;background:#2e3e4e;display:flex;align-items:center;justify-content:center;overflow:hidden}
body:has(.home-dashboard) .avatar-dot img{width:100%;height:100%;object-fit:cover}
body:has(.home-dashboard) .account-name{font-weight:700;max-width:125px;overflow:hidden;text-overflow:ellipsis}
body:has(.home-dashboard) .topbar-balance{display:flex;align-items:center;gap:5px;color:#ecf4fa;font-weight:700}
body:has(.home-dashboard) .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(.home-dashboard) .topbar-settings-wrap{position:relative}
body:has(.home-dashboard) .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(.home-dashboard) .topbar-dropdown a,body:has(.home-dashboard) .topbar-dropdown button{display:block;width:100%;text-align:left;padding:9px 10px;color:#e6edf3;background:transparent;border:0}
body:has(.home-dashboard) .topbar-dropdown-title{padding:7px 10px;color:#95b0bf;border-bottom:1px solid #344554}
body:has(.home-dashboard) .mobile-menu{display:none;background:transparent;border:0;color:white}
body:has(.home-dashboard) .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(.home-dashboard) .sidebar-username{padding:3px 9px 12px;color:#eaf1f7;font-size:18px;font-weight:600}
body:has(.home-dashboard) .sidebar-divider{border-top:1px solid #34434f;margin:0 5px 10px}
body:has(.home-dashboard) .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(.home-dashboard) .sidebar-link svg{flex-shrink:0}
body:has(.home-dashboard) .sidebar-link:hover,body:has(.home-dashboard) .sidebar-link.selected{background:#263643;color:#fff;text-decoration:none}
body:has(.home-dashboard) .sidebar-link.disabled{opacity:.45;cursor:default}
body:has(.home-dashboard) .sidebar-bottom{margin-top:auto;padding:15px 9px 5px;color:#8196a5;font-size:11px}
body:has(.home-dashboard) .sidebar-bottom small{color:#657d90}
body:has(.home-dashboard) .site-content{margin-left:185px;padding-top:58px;min-height:100vh;display:flex;flex-direction:column}
body:has(.home-dashboard) .union-container{width:100%;max-width:1390px;margin:0 auto;padding:35px 40px 70px;flex:1;min-width:0}
body:has(.home-dashboard) .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}


/* Home desktop layout: use the same dark components as Catalog/Inventory. */
.home-dashboard{width:100%;max-width:1160px;min-width:0;margin:0 auto;color:#edf4fa;padding:0 0 32px}
.home-dashboard h1,.home-dashboard h2,.home-dashboard h3,.home-dashboard p{margin-top:0}
.home-dashboard .home-greeting{display:flex;align-items:center;gap:28px;position:relative;overflow:hidden;isolation:isolate;min-height:205px;margin:0 0 22px;padding:32px 38px;background:linear-gradient(115deg,#1b3446 0%,#192b39 42%,#141e29 100%);border:1px solid #3b5b6e;border-radius:9px;box-shadow:0 11px 35px #0003}
.home-dashboard .home-greeting::before{content:'';position:absolute;left:0;top:0;right:0;height:3px;background:linear-gradient(90deg,#168cc2,#63c4ef 45%,transparent);z-index:1}
.home-dashboard .home-greeting::after{content:'UNION';position:absolute;right:23px;bottom:-43px;font-size:clamp(80px,10vw,160px);font-weight:900;letter-spacing:5px;color:#d2e7f9;opacity:.045;line-height:1;z-index:-1;pointer-events:none}
.home-dashboard .home-greeting h1{font-size:clamp(30px,3.5vw,42px);font-weight:800;letter-spacing:-.8px;color:#f6fbff;line-height:1.2;margin:0;overflow-wrap:anywhere}
.home-dashboard .home-avatar{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:126px;height:126px;overflow:hidden;border:3px solid #9dbacd;border-radius:50%;background:#dce5ed;color:#425666;box-shadow:0 6px 24px #0005}
.home-dashboard .home-avatar img{width:100%;height:100%;object-fit:cover;object-position:center 24%;transform:scale(1.65) translateY(12%)}
.home-dashboard .home-avatar svg{color:#5c7080}
.home-dashboard .home-launcher-panel{display:flex;align-items:center;justify-content:space-between;gap:26px;min-height:110px;margin:0 0 33px;padding:21px 25px;border:1px solid #39566a;border-left:3px solid #329fce;background:#192b39;border-radius:7px}
.home-dashboard .home-launcher-panel>div{flex:1;min-width:0}
.home-dashboard .home-launcher-panel strong{color:#eef7fc;font-size:18px;font-weight:750}
.home-dashboard .home-launcher-panel p{color:#a5bdce;font-size:13px;line-height:1.65;max-width:700px;margin:6px 0 0}
.home-dashboard .home-launcher-download{display:inline-flex;align-items:center;justify-content:center;flex-direction:column;flex-shrink:0;min-width:205px;gap:4px;padding:12px 16px;background:#168fc8;border:1px solid #4db8e8;border-radius:5px;color:white!important;text-decoration:none!important;font-size:13px;font-weight:750;line-height:1.35;transition:background .15s ease}
.home-dashboard .home-launcher-download:hover{background:#29a8dc}
.home-dashboard .home-launcher-download span{font-size:11px;font-weight:500;color:#e2f2fc}
.home-dashboard .home-places-section{margin:0 0 27px}
.home-dashboard .home-places-section>h2{font-size:27px;line-height:1.25;color:#f1f7fc;font-weight:750;letter-spacing:-.2px;margin:0 0 20px;padding-bottom:14px;border-bottom:1px solid #2c3e4d}
.home-dashboard .places-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(215px,1fr));gap:18px}
.home-dashboard .place-card{display:flex;flex-direction:column;overflow:hidden;min-width:0;border:1px solid #344a59;background:#172430;border-radius:7px;color:#eaf3fa!important;text-decoration:none!important;transition:transform .15s,border-color .15s,box-shadow .15s}
.home-dashboard .place-card:hover{border-color:#57afd8;transform:translateY(-3px);box-shadow:0 11px 20px #0004}
.home-dashboard .place-card-art{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;aspect-ratio:16 / 10;background:linear-gradient(145deg,#2c4353,#416275 48%,#1a2935)}
.home-dashboard .place-card-scene{position:relative;height:70%;width:68%;transform:perspective(300px) rotateX(13deg) rotate(-16deg)}
.home-dashboard .place-card-scene span{position:absolute;display:block;background:#547f83;box-shadow:7px 7px 0 #294c54;transform:skewY(-5deg)}
.home-dashboard .place-card-scene span:nth-child(1){width:53%;height:24%;left:10%;top:47%;background:#85a2a5}
.home-dashboard .place-card-scene span:nth-child(2){width:26%;height:30%;left:49%;top:21%;background:#8ba7b3}
.home-dashboard .place-card-scene span:nth-child(3){width:21%;height:26%;left:16%;top:20%;background:#6f949b}
.home-dashboard .place-card-era{position:absolute;right:10px;bottom:10px;background:#0b1521c9;color:#dcecf7;border-radius:4px;padding:5px 9px;font-size:11px;font-weight:750}
.home-dashboard .place-card-info{padding:15px 16px 18px;min-width:0}
.home-dashboard .place-card-info h3{margin:0 0 8px;color:#eff5fa;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.home-dashboard .place-card-meta{display:flex;gap:5px;flex-wrap:wrap;font-size:12px;color:#9fb6c7}
.home-dashboard .places-empty{padding:20px 22px;background:#172631;color:#aabfce;border:1px solid #385063;border-radius:6px;font-size:13px}
.home-dashboard .home-session-message{padding:10px 14px;color:#b7cbd8;border-left:3px solid #6baacb;background:#172530;margin:0 0 20px;font-size:13px}
/* Support quick links if the frontend branch already provides them. */
.home-dashboard .home-shortcuts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;margin:0 0 30px}
.home-dashboard .home-shortcuts a{display:flex;align-items:center;gap:13px;min-width:0;padding:15px 17px;border:1px solid #385267;background:#192935;border-radius:7px;color:#e9f4fd!important;text-decoration:none!important;transition:background .15s,border-color .15s}
.home-dashboard .home-shortcuts a:hover{background:#253e50;border-color:#53add6}
.home-dashboard .home-shortcuts svg{flex-shrink:0;color:#78c4e6}
.home-dashboard .home-shortcuts a>span:nth-child(2){flex:1;min-width:0}
.home-dashboard .home-shortcuts strong{display:block;font-size:13px}
.home-dashboard .home-shortcuts small{display:block;margin-top:4px;color:#a2b9c9;font-size:11px}
/* Navigation fallback for a standalone Vite build that omits main stylesheet. */
@media(max-width:1260px){body:has(.home-dashboard) .topbar-main{grid-template-columns:minmax(max-content,1fr) minmax(150px,350px) minmax(max-content,1fr)}body:has(.home-dashboard) .topbar-left{gap:8px}body:has(.home-dashboard) .topbar-links{gap:7px}}
@media(max-width:990px){body:has(.home-dashboard) .union-container{padding:25px 22px 55px}body:has(.home-dashboard) .mobile-menu{display:inline-flex}body:has(.home-dashboard) .union-sidebar{transform:translateX(-103%);transition:transform .18s}body:has(.home-dashboard) .union-sidebar.is-open{transform:translateX(0)}body:has(.home-dashboard) .site-content{margin-left:0}body:has(.home-dashboard) .mobile-overlay{position:fixed;inset:58px 0 0;background:#0009;border:0;z-index:24}body:has(.home-dashboard) .account-name{display:none}}
@media(max-width:810px){body:has(.home-dashboard) .union-topbar{height:100px}body:has(.home-dashboard) .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(.home-dashboard) .topbar-left{grid-area:left}body:has(.home-dashboard) .topbar-tools{grid-area:tools}body:has(.home-dashboard) .global-search{grid-area:search;height:33px}body:has(.home-dashboard) .union-sidebar{top:100px}body:has(.home-dashboard) .site-content{padding-top:100px}body:has(.home-dashboard) .mobile-overlay{inset:100px 0 0}.home-dashboard .home-shortcuts{grid-template-columns:1fr}}
@media(max-width:620px){body:has(.home-dashboard) .topbar-links{display:none}body:has(.home-dashboard) .union-brand{font-size:19px;min-width:0}body:has(.home-dashboard) .union-brand img{width:40px;height:38px}body:has(.home-dashboard) .topbar-tools{gap:6px}body:has(.home-dashboard) .union-container{padding:18px 14px 40px}.home-dashboard .home-greeting{min-height:135px;padding:22px 18px;gap:16px}.home-dashboard .home-avatar{width:84px;height:84px;border-width:2px}.home-dashboard .home-greeting h1{font-size:clamp(23px,5vw,32px)}.home-dashboard .home-launcher-panel{flex-direction:column;align-items:stretch;padding:18px;gap:15px}.home-dashboard .home-launcher-download{width:100%}.home-dashboard .places-grid{grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:12px}}
@media(max-width:400px){.home-dashboard .home-greeting{gap:12px}.home-dashboard .home-avatar{width:70px;height:70px}.home-dashboard .place-card-info{padding:12px}}
