/* One shared appearance layer. Layout and chart calculations stay in each tool. */
html[data-theme="light"] {
  color-scheme:light;
  --xi-bg-0:#f1f3f4; --xi-bg-1:#ffffff; --xi-bg-2:#f4f6f7; --xi-bg-3:#e5ecef;
  --xi-line-1:#d9e0e5; --xi-line-2:#bcc8d0; --xi-line-3:#8596a4; --xi-grid:#4b65700a;
  --xi-ink-1:#202c34; --xi-ink-2:#455762; --xi-ink-3:#5c6e79; --xi-ink-4:#687b88;
  --xi-signal:#c64c1e; --xi-signal-ink:#ae3c14; --xi-signal-bed:#c64c1e0c; --xi-signal-line:#c64c1e75;
  --xi-ok:#237656; --xi-err:#bb3f37; --xi-warn:#84631e; --xi-legacy-gold:#85621e;
}
html[data-theme="light"] body:not(.xunq-portal) {
  color-scheme:light;
  --bg:#f1f3f4; --bg2:#e9eff1; --paper:#f1f3f4;
  --card:#fff; --card2:#edf2f4; --panel:#fff; --inner:#f5f7f8;
  --ink:#202c34; --ink2:#455762; --ink3:#5c6e79; --ink-dim:#455762; --ink-faint:#5c6e79; --muted:#5c6e79;
  --line:#d3dde2; --line-strong:#bcc8d0; --hair:#dbe2e6; --hair2:#bdcbd3;
  --border:#d3dde2; --text-muted:#5c6e79;
  --gold:#85621e; --gold-light:#85621e; --gold-soft:#715b31; --gold-dim:#a09275; --gold-bright:#5e4518;
  --cin:#247356; --cin-soft:#e1eee7; --green:#237656; --blue:#356d98; --red:#bb3f37; --rose:#b54757;
  --wood:#23774b; --fire:#c34235; --earth:#956117; --metal:#8b6c12; --water:#2968a6;
  --xq-state-selected:#d9ebe3; --xq-state-text:#1e4d3b; --xq-state-accent:#237656;
  --xq-state-surface:#e9efec; --xq-state-border:#95b6a5; --xq-state-focus:#23765655;
  --ky-surface:#fff; --ky-surface-raised:#edf2f4; --ky-line:#d3dde2;
  --ky-ink:#202c34; --ky-muted:#5c6e79; --ky-accent:#85621e; --ky-selected:#e8eee6;
  background-color:var(--bg); color:var(--ink);
}

/* Common masthead: the same controls and menus on every page. */
html[data-theme="light"] body .xunq-site-header {
  background:#f3f0e8!important; color:#292f2e!important;
  border-color:#48493926!important; box-shadow:0 3px 16px #0000000a!important;
}
html[data-theme="light"] body .xunq-site-header :is(.xunq-header-identity,.xunq-header-home,.xunq-tool-trigger,.xunq-header-menu) {color:#374a40!important}
html[data-theme="light"] body .xunq-site-header :is(.xunq-header-arrow,.xunq-header-tools>.privacy-note) {color:#607068!important}
html[data-theme="light"] body .xunq-site-header :is(.xunq-language-track,.theme-toggle-track) {background:#e7e8e1!important;border-color:#697c6950!important}
html[data-theme="light"] body .xunq-site-header :is(.xunq-language-label,.theme-toggle-track svg) {color:#46564b}
html[data-theme="light"] body .xunq-site-header .xunq-language-track > :is(.xunq-language-zh,.xunq-language-en) {color:#46564b}
html[data-theme="light"] body .xunq-site-header .xunq-language-toggle[aria-checked="false"] .xunq-language-zh,
html[data-theme="light"] body .xunq-site-header .xunq-language-toggle[aria-checked="true"] .xunq-language-en {color:#183a2c}
html[data-theme="light"] body .xunq-site-header :is(.xunq-account-button,.xunq-account-trigger) {background:#e5ebe4!important;border-color:#a3b4a555!important;color:#334e3e!important}
html[data-theme="light"] body .xunq-site-header :is(.xunq-account-label,.xunq-account-label b) {color:inherit!important}
html[data-theme="light"] body .xunq-site-header .xunq-header-settings,
html[data-theme="light"] body .xunq-site-header .xunq-tool-switcher {background:#fbfcf9!important;color:#293d32!important;border-color:#cbd5c9!important;box-shadow:0 12px 28px #26382a20!important}
html[data-theme="light"] body .xunq-site-header :is(.xunq-header-setting-label,.xunq-tool-link,.xunq-tool-group-title,.xunq-tool-empty,.xunq-tool-switcher a,.xunq-tool-switcher button,.xunq-header-settings .header-nav a) {color:#3e5749!important}
html[data-theme="light"] body .xunq-site-header .xunq-tool-link:hover {background:#e7eee6!important}
@media(min-width:900px) {
  html[data-theme="light"] body .xunq-site-header .xunq-header-settings {background:transparent!important;border:0!important;box-shadow:none!important}
}

/* Shared input overlays keep their own geometry. */
html[data-theme="light"] body #birthWheelDialog {
  --bw-bg:#fff;--bw-field:#f1f4f5;--bw-text:#202c34;--bw-muted:#5c6e79;--bw-gold:#85621e;--bw-line:#c9d5db;
}
html[data-theme="light"] body:not(.xunq-portal) :is(input,select,textarea) {color-scheme:light}
html[data-theme="light"] body.xunq-header-page-mingshu .saved-archive-trigger {background:#edf2f0!important;color:#243f35!important;border-color:#c6d5cd!important}
html[data-theme="light"] body.xunq-header-page-mingshu :is(.saved-archive-label,.saved-archive-chevron) {color:#566b60!important}
html[data-theme="light"] body.xunq-header-page-mingshu .saved-archive-name {color:#243f35!important}
html[data-theme="light"] body.xunq-header-page-mingshu #result > :is(.workspace-tabs,.tabs) {background:#edf3eff5!important;border-color:#c2d3c8!important;box-shadow:0 -2px 14px #233d2c10!important}
html[data-theme="light"] body.xunq-header-page-mingshu #result > :is(.workspace-tabs,.tabs) :is(.tab,.tabs-mobile-control) {color:#455f51!important}
html[data-theme="light"] body.xunq-header-page-mingshu .wx-view-switch button[aria-pressed="true"] {color:#20513d;background:#d9ebe3}
html[data-theme="light"] body .xunq-site-header .ms-chart-home {color:#3e5749!important;border-color:#bdcbc2!important}
html[data-theme="light"] body .xunq-site-header :is(.xunq-tool-group,.xunq-tool-link small,.xunq-tool-library span) {color:#5c6e63!important}

/* Six-line tool: legacy surfaces outside the token system. */
html[data-theme="light"] body.bushi-refined :is(.app,#app,#mobileNav,#mobileCastDock,.subseg,.number-preview,.case-details,.result-context,.result-calendar,.screen,.card,.sec,.coin-panel,.number-panel,.choice-sheet,.choice-sheet-panel,.choice-sheet-head) {background-color:var(--card);color:var(--ink);border-color:var(--line)}
html[data-theme="light"] body.bushi-refined :is(#mobileCastDock,#mobileNav) {background:#f5f7f8f5!important;border-color:var(--line)!important}
html[data-theme="light"] body.bushi-refined :is(.seg,.tabs,.subseg) {background:#e5ecef!important}
html[data-theme="light"] body.bushi-refined :is(.seg,.tabs,.subseg) button.on {background:#d6e8df!important;color:#234c3b!important;box-shadow:none!important}
html[data-theme="light"] body.bushi-refined :is(.btn-primary,.cta .btn-primary) {background:#d6e8df;color:#234c3b}
html[data-theme="light"] body.bushi-refined :is(.field input,.field textarea,.field>.choice-trigger,.cast-settings .cast-time-row #inpTime) {background:#f1f5f6;border-color:var(--line)}
html[data-theme="light"] body.bushi-refined .line-symbol.empty i {background:#b6c2ca}

/* Ziwei and Qimen include fixed-colour chart cells and reading panels. */
html[data-theme="light"] body:is(.xunq-header-page-ziwei,.xunq-header-page-qimen) :is(.input-panel,.input-panel form,.palace-grid,.palace,.palace-center,.palace.center,.detail-panel,.detail-card,.reading-card,.overview article,.mutation-card,.dialog-head,.empty-state,.bottom-nav,.fortune-toolbar,.center-selection) {background:var(--card);color:var(--ink);border-color:var(--line)}
html[data-theme="light"] body:is(.xunq-header-page-ziwei,.xunq-header-page-qimen) :is(.palace.is-selected,.palace.selected,.palace-row.is-selected,.bottom-nav [aria-current="page"]) {background:#e4eee6;color:#264b37;border-color:#729983}
html[data-theme="light"] body.xunq-header-page-ziwei :is(.palace.is-related,.palace-row.is-related) {background:#edf4f8;border-color:#a6bac6}
html[data-theme="light"] body:is(.xunq-header-page-ziwei,.xunq-header-page-qimen) :is(.palace-stars,.palace-row-stars,.detail-stars,.detail-key-stars,.detail-card p,.reading-card p,.detail-panel p,.overview p) {color:var(--ink)}
html[data-theme="light"] body:is(.xunq-header-page-ziwei,.xunq-header-page-qimen) :is(.palace-minors,.palace-row-minors,.palace-foot,.detail-extra,.palace-center p,.input-panel label,.palace-center .center-meta) {color:var(--muted)}
html[data-theme="light"] body:is(.xunq-header-page-qizheng,.xunq-header-page-ziwei,.xunq-header-page-qimen) :is(input,select,textarea) {background:var(--inner);color:var(--ink);border-color:var(--line)}
html[data-theme="light"] body:is(.xunq-header-page-qizheng,.xunq-header-page-ziwei,.xunq-header-page-qimen) :is(button.primary,.primary) {background:#e7d2a5;color:#3b301b;border-color:#cbb781}
html[data-theme="light"] body.xunq-header-page-qizheng .wheel-house:is(:hover,.is-selected) {fill:#deede4}
html[data-theme="light"] body.xunq-header-page-qizheng .palace-card[aria-pressed=true] {background:#deede4}
html[data-theme="light"] body.xunq-header-page-qizheng :is(.birth-toggle,.segmented) button[aria-pressed=true] {background:#d9ebe3;color:#20513d;border-color:#9fbdaf}

/* Map / 3D canvases keep their rendered colours; only surrounding UI switches. */
html[data-theme="light"] body.xunq-header-page-kanyu :is(#side,#mobileSheet,#mobileNav,#mobileCanvasToolbar,#kanyuLocalPlans,.hlPanel,.hlHead,.dtPanel,#ownerBinding) {background:#f5f7f8!important;color:#26343c!important;border-color:#ccd7dd!important}
html[data-theme="light"] body.xunq-header-page-kanyu :is(#side,#mobileSheet,#kanyuLocalPlans) :is(button,input,select,.kl-input,.kl-button,.dirVal) {background:#e8eff2!important;color:#344d58!important;border-color:#bacbd3!important}
html[data-theme="light"] body.xunq-header-page-kanyu :is(#side,#mobileSheet) :is(.stHead,.lpTitle,.scHead,.stLogic,.fjNote,.scSub,.gjEmpty,.dirRow) {color:var(--ky-muted)!important}
