/* Fixed geometry in both languages; does not alter existing page dimensions. */
.xunq-language-host{display:inline-flex;align-items:center;flex:0 0 80px;min-width:80px;width:80px;height:36px}
.xunq-language-toggle{box-sizing:border-box!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 80px!important;gap:2px!important;width:80px!important;min-width:80px!important;max-width:80px!important;height:36px!important;min-height:36px!important;max-height:36px!important;padding:3px!important;margin:0!important;border:1px solid #8b815f!important;border-radius:9px!important;background:#151b22!important;color:#f0eadb!important;box-shadow:0 2px 10px #0003;font:600 12px/1 sans-serif!important;letter-spacing:0!important;white-space:nowrap!important;isolation:isolate}
.xunq-language-topbar{position:sticky;top:0;z-index:1000;display:flex;align-items:center;justify-content:flex-end;min-height:48px;padding:6px 12px;background:#151b22}
.xunq-language-toggle button{box-sizing:border-box!important;display:flex!important;align-items:center!important;justify-content:center!important;position:static!important;flex:0 0 35px!important;width:35px!important;min-width:35px!important;max-width:35px!important;height:28px!important;min-height:28px!important;max-height:28px!important;margin:0!important;padding:0!important;border:0!important;border-radius:5px!important;background:transparent!important;color:#d4d1c9!important;font:600 12px/1 sans-serif!important;letter-spacing:0!important;text-indent:0!important;box-shadow:none!important;cursor:pointer;touch-action:manipulation}
.xunq-language-toggle button[aria-pressed="true"]{background:#e5ca82!important;color:#171b22!important}
.xunq-language-toggle button:focus-visible{outline:2px solid #fff!important;outline-offset:1px!important}
html[data-xunq-lang="en"] :where(button,select,.nav-item,.nav-btn,.tab-btn,.xunq-account-button){letter-spacing:0}
html[data-xunq-lang="en"] .xunq-account-button{font-size:12px}
html[data-xunq-lang="en"] :where(.xunq-account-title,.xunq-account-primary,.xunq-account-secondary){letter-spacing:0}
html[data-xunq-lang="en"] .xunq-account-title{font-size:18px}
html[data-xunq-lang="en"] :where(.xunq-account-primary,.xunq-account-secondary){font-size:13px}
@media(max-width:640px){html[data-xunq-lang="en"] .xunq-account-button{font-size:11px}}

/* Keep the chart action's geometry stable when changing language. */
@media(min-width:761px){body:has(#birthForm) #calculate{width:180px;min-width:180px;max-width:180px;flex:0 0 180px}}
body:has(#birthForm) .hero-tags span{white-space:nowrap}
@media(max-width:760px){body:has(#birthForm) .hero>div>p:not(.eyebrow){min-height:45.6px}body:has(#birthForm) .convention p{min-height:72px}}
@media(max-width:350px){body:has(#birthForm) #birthDateHint{min-height:38.5px}body:has(#birthForm) .convention p{min-height:108px}}
@media(max-width:350px){body:has(#scrQi) .yao-row{height:62px;min-height:62px}}

/* Reserve a header cell for language controls, clear of form and canvas tools. */
.i18n-placement-header{display:grid!important;grid-template-columns:minmax(0,1fr) 80px 200px;align-items:center;gap:12px!important}
.i18n-placement-header>[data-i18n-host]{justify-self:end}
.i18n-placement-header>:is([data-auth-account-host],#memberAccountHost){min-width:0;width:200px;justify-content:flex-end}
.i18n-placement-header .xunq-account-button{max-width:100%!important}
.i18n-placement-home-glyph{display:none}
.topbar.i18n-placement-atlas{display:grid;grid-template-columns:176px 80px minmax(0,1fr) auto}
.i18n-placement-atlas>[data-i18n-host]{justify-self:end}
.i18n-placement-atlas>nav{justify-self:center;min-width:0}
@media(max-width:640px){
 .i18n-placement-header{grid-template-columns:32px 80px minmax(0,1fr);gap:8px!important}
 .i18n-placement-header>:is([data-auth-account-host],#memberAccountHost){width:100%}
 .i18n-placement-header>a{display:flex;align-items:center;justify-content:center;width:32px;min-height:44px}
 .i18n-placement-home-glyph{display:block;font-size:21px;line-height:1}
 .i18n-placement-home-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}
@media(max-width:1100px){
 .topbar.i18n-placement-atlas{grid-template-columns:minmax(0,1fr) 80px;grid-template-rows:40px 44px 44px;gap:8px 12px;height:170px;min-height:170px}
 .i18n-placement-atlas>.brand{grid-column:1;grid-row:1;min-width:0}
 .i18n-placement-atlas>[data-i18n-host]{grid-column:2;grid-row:1}
 .topbar.i18n-placement-atlas>.top-meta{grid-column:1/-1;grid-row:2;justify-self:end;margin:0;max-width:100%}
 .i18n-placement-atlas>nav{grid-column:1/-1;grid-row:3;width:100%;height:44px}
 .i18n-placement-atlas>nav .mode{min-width:0;padding-inline:12px;font-size:12px;white-space:nowrap}
}

/* Language preference belongs to the masthead, alongside account and theme. */
.xunq-portal .site-header .header-actions>[data-i18n-host]{flex-shrink:0}
@media(min-width:761px){
 .xunq-portal .site-header #memberAccountHost{width:180px;flex:0 0 180px}
 body.xunq-portal .site-header .xunq-account-button{width:100%;max-width:100%}
 .xunq-portal .site-header .account-credit{width:94px;flex:0 0 94px}
}
@media(max-width:1100px){
 .xunq-portal .site-header .header-nav{display:none}
 .xunq-portal .site-header .header-actions{margin-left:auto}
 .xunq-portal .site-header .menu-toggle{display:inline-grid}
 .xunq-portal .mobile-nav{top:90px;max-height:calc(100dvh - 90px)}
}
@media(max-width:760px){
 .xunq-portal .site-header .brand-copy{display:none}
 .xunq-portal .site-header .brand{flex:0 0 32px}
 .xunq-portal .site-header .header-actions{gap:6px;min-width:0}
 .xunq-portal .site-header #memberAccountHost{min-width:0;width:110px}
 body.xunq-portal .site-header .xunq-account-button{width:100%;max-width:110px}
 .xunq-portal .mobile-nav{top:80px;max-height:calc(100dvh - 80px)}
}
@media(max-width:380px){
 .xunq-portal .site-header{gap:6px;padding-inline:12px}
 .xunq-portal .site-header .header-actions{gap:4px}
 .xunq-portal .site-header #memberAccountHost{width:84px}
 body.xunq-portal .site-header .xunq-account-button{max-width:84px;padding-inline:6px}
}

/* Language controls share the top navigation with the account entry. */
#topbar .spatial-language-host { margin-left:auto; }
#topbar #memberAccountHost { margin-left:0; }
#topbar .xunq-account-button { min-height:36px; max-height:36px; }
#topbar .title { margin:0; }

#xqMobileHeader {
  position:fixed; inset:0 0 auto 336px; z-index:120; display:flex;
  box-sizing:border-box; height:58px; align-items:center; gap:10px;
  padding:0 14px 0 10px; background:#111c24;
  border-bottom:1px solid #2b3941; color:#f1eee5;
}
#xqMobileHeader > a {
  display:flex; align-items:center; justify-content:center;
  width:32px; height:44px; flex:none; color:#c4cdd2;
  text-decoration:none; font-size:24px;
}
#xqMobileHeader .spatial-brand { min-width:0; }
#xqMobileHeader strong { display:block; font-size:17px; font-weight:600; letter-spacing:.12em; white-space:nowrap; }
#xqMobileHeader small { display:block; font-size:9px; letter-spacing:.15em; color:#94a6ae; margin-top:3px; white-space:nowrap; }
#xqMobileHeader .spatial-language-host { margin-left:auto; }
#xqMobileHeader #memberAccountHost { position:static; max-width:246px; min-width:0; }
#xqMobileHeader .xunq-account-button { min-height:36px; max-height:36px; }

@media (min-width:901px) {
  body:not(.xq-mobile) #app { top:58px; }
  body:not(.xq-mobile) #luopanBox { top:72px; }
  body:not(.xq-mobile) #skyBox { top:448px; }
  body:not(.xq-mobile) #modeBar { top:66px; }
  body:not(.xq-mobile) #extPanel { top:110px; max-height:calc(100% - 122px); }
}

@media (max-width:680px) {
  #topbar { gap:6px; }
  #topbar .back { display:flex; align-items:center; justify-content:center; box-sizing:border-box; width:28px; height:36px; padding:0; }
  #topbar .topnav-home-label { display:none; }
  #topbar .title { font-size:14px; letter-spacing:0; }
  #topbar #memberAccountHost { flex:1 1 auto; min-width:0; }
  #topbar #memberAccountHost .xunq-account-button { box-sizing:border-box; max-width:100%; min-width:0; padding:6px 8px; font-size:11px; gap:5px; }
  #topbar .xunq-account-dot { display:none; }
  #topbar .xunq-account-credit { display:none; }
}

@media (max-width:900px), (max-width:1100px) and (max-height:600px) and (pointer:coarse) {
  #xqMobileHeader { inset:0 0 auto; height:var(--xq-top); gap:6px; padding:env(safe-area-inset-top,0px) 8px 0; }
  #xqMobileHeader > a { width:28px; height:44px; }
  #xqMobileHeader .spatial-brand { flex:0 0 auto; }
  #xqMobileHeader strong { font-size:15px; letter-spacing:0; }
  #xqMobileHeader small { display:none; }
  #xqMobileHeader #memberAccountHost { flex:0 1 auto; max-width:180px; }
  #xqMobileHeader .xunq-account-button { box-sizing:border-box; min-width:0; max-width:100%; padding:6px 8px; font-size:11px; gap:5px; }
  #xqMobileHeader .xunq-account-dot { display:none; }
  #xqMobileHeader .xunq-account-credit { display:none; }
}

/* Language switches belong to each chart's top navigation. */
.back-bar.ms-site-bar{grid-template-columns:auto minmax(0,1fr) 80px 244px;align-items:center;gap:12px}
.ms-site-bar>[data-i18n-host]{justify-self:end}
.ms-site-bar>.ms-site-account-actions{display:flex;width:244px;max-width:100%}
.ms-site-account-actions>#memberAccountHost{width:100%;max-width:100%}
.ms-site-account-actions #memberAccountHost .xunq-account-button{width:100%}
.site-header.xunq-chart-topnav{display:grid;grid-template-columns:minmax(0,1fr) 80px 310px;height:auto;min-height:78px;gap:12px}
.xunq-chart-topnav>[data-i18n-host]{justify-self:end}
.xunq-chart-topnav .header-actions{display:grid;grid-template-columns:100px minmax(0,1fr);justify-self:end;width:310px;max-width:100%}
.xunq-chart-topnav #recordsOpen{width:100px;min-height:44px}
.xunq-chart-topnav .header-actions [data-auth-account-host]{width:100%;max-width:none;min-width:0}
.xunq-chart-topnav .header-actions .xunq-account-button{width:100%}
.top.xunq-share-topnav{display:grid;grid-template-columns:auto minmax(0,1fr) 80px;gap:16px}
.xunq-share-topnav .edition{text-align:center;min-width:0}
.xunq-share-topnav>[data-i18n-host]{justify-self:end}
@media(max-width:760px){
 .back-bar.ms-site-bar{grid-template-columns:minmax(0,1fr) 80px;gap:8px 12px}
 .ms-site-bar>.privacy-note{display:none}
 .ms-site-bar>.ms-site-account-actions{grid-column:1/-1;justify-self:end;max-width:100%}
 .ms-site-account-actions #memberAccountHost{flex:0 1 auto}
 .site-header.xunq-chart-topnav{grid-template-columns:minmax(0,1fr) 80px;gap:8px 12px;min-height:110px}
 .xunq-chart-topnav>.header-actions{grid-column:1/-1;min-width:0}
}
@media(max-width:600px){
 .top.xunq-share-topnav{grid-template-columns:minmax(0,1fr) 80px;gap:8px 12px}
 .xunq-share-topnav>.brand{grid-column:1;grid-row:1;min-width:0}
 .xunq-share-topnav>[data-i18n-host]{grid-column:2;grid-row:1}
 .xunq-share-topnav>.edition{grid-column:1/-1;grid-row:2;min-height:18px;text-align:left}
}

/* Language controls occupy real top-navigation cells on every core page. */
.xunq-topnav-simple{display:grid!important;grid-template-columns:minmax(0,1fr) 80px minmax(0,300px);align-items:center;gap:16px}
.xunq-topnav-simple>[data-i18n-host]{justify-self:end}
.xunq-topnav-simple>:last-child{min-width:0;justify-self:end;justify-content:flex-end}
.xunq-topnav-simple .xunq-account-button{max-width:100%!important}
.xunq-topnav-simple>.account-tools{width:100%}
.xunq-topnav-simple>.account-tools>a{flex:0 0 auto}
.xunq-topnav-simple>.account-tools>[data-auth-account-host]{min-width:0}
.library-page .xunq-topnav-library{display:grid;grid-template-columns:minmax(120px,1fr) auto 80px 200px auto;align-items:center;gap:14px}
.library-page .xunq-topnav-library>[data-auth-account-host]{width:200px;max-width:200px;margin:0;justify-content:flex-end}
.library-page .xunq-topnav-library .xunq-account-button{max-width:100%!important}
.library-page .xunq-topnav-library>#admin-button{width:80px}
.xunq-topnav-graph.atlas-header{display:grid;grid-template-columns:180px minmax(0,1fr) 80px auto;gap:20px}
.xunq-topnav-graph>.header-end{min-width:0;margin:0}
.xunq-topnav-graph>.site-nav{min-width:0}
#top.xunq-topnav-galaxy>[data-i18n-host]{flex:0 0 80px}
#top.xunq-topnav-galaxy>a{width:82px;text-align:center}
@media(min-width:1001px){
 .xunq-topnav-graph.atlas-header{grid-template-columns:180px minmax(0,1fr) 80px 340px}
 .xunq-topnav-graph>.header-end [data-auth-account-host]{min-width:0;flex:1}
 .xunq-topnav-graph>.header-end .xunq-account-button{max-width:100%!important}
 .xunq-topnav-graph>.header-end #admin-button{flex:0 0 100px;font-size:11px;padding-inline:8px}
}
@media(max-width:1000px){
 .library-page .xunq-topnav-library{grid-template-columns:minmax(120px,1fr) auto 80px 160px auto;gap:10px}
 .library-page .xunq-topnav-library>[data-auth-account-host]{width:160px;max-width:160px}
 .xunq-topnav-graph.atlas-header{grid-template-columns:155px minmax(0,1fr) 80px auto;gap:12px}
}
@media(max-width:720px){
 .xunq-topnav-simple{grid-template-columns:minmax(0,1fr) 80px;grid-template-rows:44px 44px;gap:8px 12px;min-height:112px;padding-top:8px;padding-bottom:8px}
 .xunq-topnav-simple>:first-child{grid-column:1;grid-row:1;min-width:0}
 .xunq-topnav-simple>[data-i18n-host]{grid-column:2;grid-row:1}
 .xunq-topnav-simple>:last-child{grid-column:1/-1;grid-row:2;width:100%;max-width:100%}
 .xunq-topnav-simple .xunq-account-button{max-width:min(246px,100%)!important}
 .library-page .xunq-topnav-library{grid-template-columns:minmax(0,1fr) 80px;grid-template-rows:40px 44px 44px;gap:4px 10px;min-height:152px;padding-top:8px;padding-bottom:8px}
 .xunq-topnav-library>.brand{grid-column:1;grid-row:1}
 .xunq-topnav-library>[data-i18n-host]{grid-column:2;grid-row:1;justify-self:end}
 .library-page .xunq-topnav-library>[data-auth-account-host]{grid-column:1/-1;grid-row:2;width:100%;max-width:100%;justify-self:end}
 .library-page .xunq-topnav-library>.site-nav{grid-column:1;grid-row:3;width:100%;gap:6px;min-width:0;flex:none}
 .library-page .xunq-topnav-library>.site-nav a{padding-inline:4px;font-size:12px;white-space:nowrap}
 .library-page .xunq-topnav-library>#admin-button{grid-column:2;grid-row:3;padding-inline:5px;min-width:0;width:80px;font-size:11px}
 .graph-page{--header:160px}
 .xunq-topnav-graph.atlas-header{grid-template-columns:minmax(0,1fr) 80px;grid-template-rows:44px 44px 44px;padding:8px 12px;gap:4px 10px;height:var(--header)}
 .xunq-topnav-graph>.brand{grid-column:1;grid-row:1}
 .xunq-topnav-graph>[data-i18n-host]{grid-column:2;grid-row:1;justify-self:end}
 .xunq-topnav-graph>.header-end{grid-column:1/-1;grid-row:2;display:flex;justify-content:space-between;width:100%;height:44px;gap:8px}
 .xunq-topnav-graph>.header-end [data-auth-account-host]{min-width:0;max-width:calc(100% - 90px)}
 .xunq-topnav-graph>.header-end .xunq-account-button{max-width:100%!important}
 .xunq-topnav-graph>.header-end #admin-button{position:static;flex:0 0 auto;min-height:36px;font-size:11px}
 .xunq-topnav-graph>.site-nav{grid-column:1/-1;grid-row:3;height:44px;width:100%;gap:16px}
 .xunq-topnav-graph>.site-nav a{font-size:11px;white-space:nowrap}
 #top.xunq-topnav-galaxy{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:40px 40px 44px;gap:8px}
 #top.xunq-topnav-galaxy>[data-i18n-host]{grid-column:2;grid-row:1;justify-self:end}
 #top.xunq-topnav-galaxy>.galaxy-account{grid-column:2;grid-row:3;width:100%}
 #top.xunq-topnav-galaxy>#count{grid-column:1;grid-row:3;text-align:left;margin:0}
}
