/* Shared theme controls. Color selection is managed by @lpdsgn/astro-themes. */
body .header .theme-toggle { display:inline-grid; place-items:center; flex:none; width:34px; height:34px; padding:0; line-height:1; border:1px solid #ffffff20; border-radius:50%; background:#ffffff0a; color:#e5edf8; cursor:pointer; transition:background-color 180ms ease,border-color 180ms ease; }
body .header .theme-toggle:hover { background:#ffffff16; border-color:#ffffff45; }
.theme-toggle > span { display:none; width:17px; height:17px; }
.theme-toggle[data-mode="system"] > [data-mode-icon="system"],.theme-toggle[data-mode="dark"] > [data-mode-icon="dark"],.theme-toggle[data-mode="light"] > [data-mode-icon="light"] { display:block; }
.theme-toggle .site-icon { display:block; }
@media(max-width:640px) { body .header .theme-toggle { width:36px; height:36px; } }

/* Keep the existing dark image heroes; recolor content surfaces without filtering photography. */
html[data-theme="dark"] {
  color-scheme:dark;
  --surface:#0b1422; --surface-soft:#101d2e; --foreground:#dce6f5; --muted:#a8b6ca; --focus:#91b3ff;
  --page:#0b1422; --bg-light:#101d2e; --line:#2a3b52; --t-title:#e0e9f6; --t-body:#adbbcf; --t-muted:#8ea0ba;
  --bg-white:#0b1422; --bg-light-gray:#101d2e; --bg-light-blue:#152741; --border-color:#293e59;
  --text-title:#e0e9f6; --text-body:#acbad0; --text-aux:#93a5bf;
  --night-page:#0b1422; --night-surface:#122034; --night-raised:#172941; --night-line:#293d57;
  --night-text:#dce6f5; --night-muted:#a5b5cd; --night-link:#9fbfff;
}
html[data-theme="dark"] body { background:var(--night-page); color:var(--night-text); }
html[data-theme="dark"] body #main-content main.hv7 { --lgray:#101d2e; --ink:#e0e9f6; --sub:#a8b7ce; --line:#293d57; }
html[data-theme="dark"] body #main-content .tpc-page { --tpc-soft:#172b48; --tpc-soft-hi:#203c60; --tpc-line:#293d57; --tpc-ink:#e0e9f6; --tpc-body:#acbad0; --tpc-muted:#91a4bf; --tpc-brand:#9fbfff; }
html[data-theme="dark"] body #main-content :is(.news-page,.cases-page,.case-detail-page,.capability-detail-page,.search-page,.hv7-biz,.hv7-data,.hv7-cases,.pc-matrix,.pc-value,.pc-scene,.intro,.history,.services,.team-honors,.partners,.vc-band,.cxn-news .news,.cd-body,.cdrel) { background:var(--night-page); }
html[data-theme="dark"] body #main-content :is(.hv7-biz-card,.hv7-case,.vv-card,.nfeat,.nitem,.nske,.cscard,.cdsec,.cdmeta,.pc-card,.pc-vcard,.pc-scene-card,.cap-card,.cd-mod,.cd-rel,.svc-card,.rel-card,.pn,.vc-card,.vc-form,.cert-window) { background:var(--night-surface); border-color:var(--night-line); box-shadow:0 8px 24px #00000016; }
html[data-theme="dark"] body #main-content .tpc-module .tpc-subcard { background:var(--night-surface); border-color:var(--night-line); box-shadow:0 4px 16px #00000012; }
html[data-theme="dark"] body #main-content :is(.tpc-subcard,.pc-card,.pc-vcard,.cscard,.nitem,.cap-card,.cd-mod,.cd-rel):hover { border-color:#526f9c; }
html[data-theme="dark"] body #main-content :is(.hv7-biz-body h3,.hv7-acc-title,.hv7-acc-sub,.hv7-case-title h3,.hv7-case--small h3,.nfeat h2,.nbody h3,.news-feed-title h2,.case-list-heading h2,.cscard-body h2,.cscard-body h3,.cdsec h2,.cdmeta h2,.cdconsult h3,.cdrel-head h2,.capability-related h2,.pc-head h2,.pc-card h3,.pc-vcard h3,.pc-scene-card h3,.intro-name,.sec-head h2,.partners-head h2,.h2,.svc-card h3,.vc-head h2) { color:var(--night-text); }
html[data-theme="dark"] body #main-content :is(.hv7-biz-body p,.hv7-biz-sub,.hv7-intro-sub,.hv7-case-cols p,.nfeat-ex,.nbody > p,.cscard-body p,#cdDesc,.cdmeta dd,.cdconsult p,.pc-lead,.pc-desc,.pc-card p,.pc-vcard p,.pc-scene-card p,.pc-feats li,.intro-body p,.svc-head .lead,.svc-card p,.hist-h-body p,.hist-h-title,.team p,.vc-head p,.vc-sec-lede) { color:var(--night-muted); }
html[data-theme="dark"] body #main-content :is(.hv7-link,.hv7-acc-note,.nmore,.article-back,.cscard-foot > span:first-child,.cdrel-head > a,.detail-back,.capability-back,.pc-link) { color:var(--night-link); }
html[data-theme="dark"] body #main-content :is(.nfeat-link:hover h2,.nitem:hover h3,.cscard:hover h2,.cscard:hover h3) { color:#bad1ff; }
html[data-theme="dark"] body #main-content :is(.news-feed-heading,.nitem-foot,.cscard-foot,.article-head,.pn-nav,.cdrel,.capability-related,.capability-back) { border-color:var(--night-line); }

/* News, cases and readable article pages. */
html[data-theme="dark"] body #main-content :is(.nhero,.cshero) { background:radial-gradient(ellipse at 95% 20%,#1d3e694d,transparent 55%),#102037; border-color:var(--night-line); }
html[data-theme="dark"] body #main-content .nhero::after { opacity:.06; }
html[data-theme="dark"] body #main-content :is(.nhero h1,.cshero h1) { color:#e6eefb; }
html[data-theme="dark"] body #main-content :is(.nhero p,.cshero p,.news-breadcrumb,.resource-crumb,.news-breadcrumb [aria-current],.cases-page .resource-crumb [aria-current]) { color:#a2b7d6; }
html[data-theme="dark"] body #main-content :is(.news-eyebrow,.resource-eyebrow,.news-title-dot,.cshero h1 > span) { color:#9cbcff; }
html[data-theme="dark"] body #main-content :is(.ntabs,.chip-top,.nitem-cat,.nitem-go,.article-kicker) { background:#1a2e4b; border-color:var(--night-line); color:#a7c5ff; }
html[data-theme="dark"] body #main-content .ntab { color:#a6b8d2; }
html[data-theme="dark"] body #main-content .ntab.is-on { color:#d2e2ff; background:#2a4266; box-shadow:0 2px 8px #0000001c; }
html[data-theme="dark"] body #main-content :is(.nbody-meta time,.nfeat-foot,.ncat,#nresultCount,.case-list-heading > span,.case-index,.detail-eyebrow,.cdmeta dt,.cdshot figcaption,.cdsec-heading > span,.nfin-all,.nfin-slogan) { color:#92a6c2; }
html[data-theme="dark"] body #main-content :is(.nske-img,.nske-line,.nske-chip,.nfin-line) { background:#203650; }
html[data-theme="dark"] body #main-content .nempty { border-color:#355171; }
html[data-theme="dark"] body #main-content :is(.nloadmore,.capability-related a,.detail-consult) { background:var(--night-surface); color:#b4cefa; border-color:var(--night-line); }
html[data-theme="dark"] body #main-content .cdconsult { background:linear-gradient(135deg,#172d4b,#132339); border-color:#2e4666; }
html[data-theme="dark"] body #main-content .consult-icon { background:#223d62; color:#b7cfff; }
html[data-theme="dark"] body #main-content main.article { background:var(--night-surface); color:var(--night-text); border-color:var(--night-line); }
html[data-theme="dark"] body #main-content main.article :is(.article-head h1,.article-body h2,.article-body h3,.pn-title,.related h2) { color:var(--night-text); }
html[data-theme="dark"] body #main-content main.article :is(.article-body,.article-body p,.article-body > p:first-child) { color:#becbdd; }
html[data-theme="dark"] body #main-content main.article :is(.crumbs,.crumbs a,.crumbs .cur,.article-meta,.pn-label,.article-body figcaption) { color:#9baec8; }
html[data-theme="dark"] body #main-content main.article :is(.article-body blockquote,.pn) { background:#182b43; color:#bed0e9; border-color:#36516e; }
html[data-theme="dark"] body #main-content main.article .article-body img { border-color:var(--night-line); background:#eaf0f8; }
html[data-theme="dark"] body #main-content .related h2 { color:var(--night-text); }
html[data-theme="dark"] body #main-content .related .rel-body h3 { color:var(--night-text); }

/* Capability illustrations keep their line artwork and labels visible. */
html[data-theme="dark"] body #main-content .capability-visual { background:radial-gradient(ellipse at 20% 50%,#23477880,transparent 60%),#13243b; border-color:#2c4567; }
html[data-theme="dark"] body #main-content .capability-symbol { background:#1d3658; color:#b0ccff; border-color:#385880; box-shadow:0 20px 50px #00000020; }
html[data-theme="dark"] body #main-content .capability-visual-copy p { color:#d0e0fa; }
html[data-theme="dark"] body #main-content .capability-visual-kicker { color:#9bb7df; }
html[data-theme="dark"] body #main-content .capability-visual-copy li { background:#203954; color:#c0d3f0; border-color:#345373; }
html[data-theme="dark"] body #main-content :is(.tpc-tags a,.cd-item-tags li,.cd-chip) { color:#b3ccff; background:#1d3657; border-color:#36547c; }
html[data-theme="dark"] body #main-content :is(.cap-ph,.cd-overview-lead,.cd-back) { background:#15273e; color:#b4c7e0; border-color:var(--night-line); }
html[data-theme="dark"] body #main-content :is(.pc-tabs,.pc-fig,.pc-fig.has-img) { background:#122238; border-color:var(--night-line); }
html[data-theme="dark"] body #main-content :is(.pc-tab,.pc-tag) { color:#b6c9e5; border-color:#365171; }
html[data-theme="dark"] body #main-content .pc-tab.is-on { color:#dce9ff; background:#25466f; border-color:#4a6e9d; }
html[data-theme="dark"] body #main-content .pc-check { color:#a1c1ff; }

/* About, timeline and contact form. Logos, certificates and QR images retain their original colors. */
html[data-theme="dark"] body #main-content :is(.subnav,.vc-subnav) { background:#132238ed; border-color:var(--night-line); }
html[data-theme="dark"] body #main-content :is(.subnav-list a,.news-tab,.news-list a,.contact-heading h2) { color:#bacbe3; }
html[data-theme="dark"] body #main-content :is(.subnav-list a.active,.news-tab.active) { color:#b6d0ff; }
html[data-theme="dark"] body #main-content :is(.intro-stat .n,.intro-stat .t,.hist-h-title,.hist-h-body,.svc-card h4,.team h3,.honors h3) { color:var(--night-text); }
html[data-theme="dark"] body #main-content :is(.intro-stats,.hist-h-card,.timeline-node,.team-copy,.hon-list li) { border-color:var(--night-line); }
html[data-theme="dark"] body #main-content .hist-h-card { background:var(--night-surface); }
html[data-theme="dark"] body #main-content .timeline-node { color:#a7b9d4; background:transparent; }
html[data-theme="dark"] body #main-content .timeline-node.is-active { color:#c5d9ff; }
html[data-theme="dark"] body #main-content .intro-city { opacity:.18; }
html[data-theme="dark"] body #main-content #contact-form { background:linear-gradient(180deg,#0d1829,#101d30); }
html[data-theme="dark"] body #main-content #contact-form :is(.vc-form,.vc-side .vc-card) { background:var(--night-surface); border-color:var(--night-line); color:var(--night-text); box-shadow:0 12px 40px #00000012; }
html[data-theme="dark"] body #main-content #contact-form :is(.contact-heading h2,.vc-field label,.vc-card h4) { color:var(--night-text); }
html[data-theme="dark"] body #main-content #contact-form :is(.vc-sec-lede,.vc-form-tip,.vc-check,.vc-contact-hint) { color:var(--night-muted); }
html[data-theme="dark"] body #main-content #contact-form :is(.vc-input,.vc-select,.vc-textarea,.vc-result pre) { background:#0d192b; border-color:#354e6c; color:#d8e5f8; }
html[data-theme="dark"] body #main-content #contact-form :is(.vc-input,.vc-select,.vc-textarea):focus { border-color:#86adf7; background:#152840; box-shadow:0 0 0 3px #779ff01a; }
html[data-theme="dark"] body #main-content #contact-form :is(.vc-input,.vc-select,.vc-textarea)::placeholder { color:#8ca0bc; }
html[data-theme="dark"] body #main-content #contact-form :is(.vc-result,.vc-toggle) { background:#172b46; border-color:#365476; color:#b8cfee; }
html[data-theme="dark"] body #main-content #contact-form :is(.vc-input,.vc-select,.vc-textarea)[aria-invalid="true"] { background:#35202d; border-color:#d98c98; }
html[data-theme="dark"] body #main-content #contact-form .vc-err { color:#ffb1ba; }

/* Search dialog and standalone search. */
html[data-theme="dark"] .site-search-dialog { background:#122034; color:var(--night-text); border-color:#344b68; box-shadow:0 32px 120px #00000060; }
html[data-theme="dark"] .site-search-dialog::backdrop { background:#030a17a8; }
html[data-theme="dark"] :is(.search-dialog-heading h2,.search-intro > p,.search-status,.search-hint) { color:#a0b4d1; }
html[data-theme="dark"] :is(.search-close,.site-search-form,.search-suggestions button,.search-retry) { background:#1b2e48; border-color:#354e6f; color:#c3d7f5; }
html[data-theme="dark"] .site-search-form input { color:#e2ecfa; }
html[data-theme="dark"] .site-search-form input::placeholder { color:#9cb0cc; }
html[data-theme="dark"] :is(.search-submit,.search-hint kbd) { background:#29476d; color:#c6dcff; border-color:#426289; }
html[data-theme="dark"] :is(.search-hint,.search-results li + li) { border-color:#2c405a; }
html[data-theme="dark"] .search-results a:hover,html[data-theme="dark"] .search-results a:focus-visible { background:#1a304d; }
html[data-theme="dark"] .search-results :is(h2,h3) { color:#d6e4fa; }
html[data-theme="dark"] .search-results p { color:#a6b8d0; }
html[data-theme="dark"] .search-result-category { color:#a8c6fa; }
html[data-theme="dark"] .search-results mark { color:#d2e3ff; background:#315385; }
html[data-theme="dark"] body #main-content .search-page > .search-panel { background:var(--night-surface); border-color:var(--night-line); }
html[data-theme="dark"] body #main-content .search-page h1 { color:var(--night-text); }

/* Custom 404. */
html[data-theme="dark"] body #main-content .not-found-page { background:radial-gradient(ellipse at 10% 20%,#1d3c6560,transparent 55%),var(--night-page); color:var(--night-text); }
html[data-theme="dark"] body #main-content .not-found-copy h1,html[data-theme="dark"] body #main-content .not-found-explore-heading h2 { color:var(--night-text); }
html[data-theme="dark"] body #main-content :is(.not-found-description,.not-found-explore-heading > span) { color:var(--night-muted); }
html[data-theme="dark"] body #main-content .not-found-links > a,html[data-theme="dark"] body #main-content .not-found-secondary { color:#bed2ef; background:var(--night-surface); border-color:var(--night-line); }
html[data-theme="dark"] body #main-content .not-found-links strong { color:#c5d8f4; }
html[data-theme="dark"] body #main-content :is(.not-found-code,.coordinate-label,.not-found-eyebrow) { color:#8fafff; }
html[data-theme="dark"] body #main-content .coordinate-zero { border-color:#8fafff; }
html[data-theme="dark"] body #main-content .destination-icon { background:#213b60; color:#bed5ff; }
html[data-theme="dark"] body #main-content .not-found-explore { border-color:var(--night-line); }

/* Floating controls follow the resolved theme too. */
html[data-theme="dark"] body #backToTop { background:#172a43ed; color:#bed3ff; border-color:#405b80; box-shadow:0 5px 20px #00000038; }
html[data-theme="dark"] body #backToTop:hover { background:#25456e; border-color:#6a8abc; color:#edf4ff; }
html[data-theme="dark"] body #backToTop:focus-visible { outline-color:#a7c6ff; }
html[data-theme="dark"] body #main-content :is(.v5-scene-item,.hv7-case-cols b) { color:var(--night-text); }
html[data-theme="dark"] body #main-content :is(.v5-scene-item,.team-honors,.honors) { background:var(--night-surface); border-color:var(--night-line); }
html[data-theme="dark"] body #main-content .v5-tabs .v5-tab { color:#c1d4f1; background:#193251; border-color:#375678; }
html[data-theme="dark"] body #main-content .v5-tabs .v5-tab.is-active { color:#fff; background:#335fd5; border-color:#7297ed; }

/* Capability headings and chips are explicit: their legacy descendants use local color values. */
html[data-theme="dark"] body #main-content .tpc-module .tpc-subcard h3 { color:var(--night-text); }
html[data-theme="dark"] body #main-content .tpc-module .tpc-subcard p { color:#b2c2d8; }
html[data-theme="dark"] body #main-content .tpc-tags li { background:#1a304e; border-color:#3a577b; color:#c6dafe; }
html[data-theme="dark"] body #main-content .tpc-tags li a { color:inherit; background:transparent; }
html[data-theme="dark"] body #main-content .tpc-tags li:hover,html[data-theme="dark"] body #main-content .tpc-tags li:focus-within { background:#29496e; border-color:#6b8ab5; color:#edf4ff; }
html[data-theme="dark"] body #main-content #public-security,html[data-theme="dark"] body #main-content #data-bureau { background:transparent; }
html[data-theme="dark"] body #main-content #contact-form :is(h3,.vc-form-title,.vc-qr p,.vc-qr span) { color:var(--night-text); }
html[data-theme="dark"] body #main-content #contact-form :is(.vc-form-head,.vc-result) { border-color:var(--night-line); }
html[data-theme="dark"] body #main-content #contact-form .contact-eyebrow { color:var(--night-link); }

/* Legacy about/product descendants define their own colors and need explicit theme tokens. */
html[data-theme="dark"] body #main-content :is(.hv7-eyebrow,.news-more,.news-list a,.cd-overview-lead b,.cd-nav a.is-on) { color:var(--night-link); }
html[data-theme="dark"] body #main-content :is(.hv7-eyebrow--gray,.pc-eyebrow) { color:#a5b5cd; }
html[data-theme="dark"] body #main-content .hv7-tech .hv7-eyebrow { color:#a3c4ff; }
html[data-theme="dark"] body #main-content :is(.intro-stats .l,.team-cap b,.hon-list p,.hon-right li,.hon-right h3) { color:var(--night-text); }
html[data-theme="dark"] body #main-content .pc-tab { background:#1b304d; }
html[data-theme="dark"] body #main-content .pc-tab:hover:not(.is-on) { color:#edf4ff; background:#2b476d; }
html[data-theme="dark"] body #main-content .pc-tab.is-on { background:#25466f; }
html[data-theme="dark"] body #main-content :is(.hist-h-count b,.news-list .t,.news-list .d) { color:var(--night-link); }

/* The floating capability directory is appended to body, outside main content. */
html[data-theme="dark"] body .v5-sidenav { background:#122034f5; border-color:var(--night-line); box-shadow:0 12px 36px #00000038; color:var(--night-text); }
html[data-theme="dark"] body .v5-sidenav-heading { color:var(--night-text); border-color:var(--night-line); }
html[data-theme="dark"] body .v5-sidenav-heading span { color:var(--night-muted); }
html[data-theme="dark"] body .v5-sidenav-list::before { background:#304765; }
html[data-theme="dark"] body .v5-sidenav-link { color:var(--night-muted); }
html[data-theme="dark"] body .v5-sidenav-link::before { background:var(--night-surface); border-color:#627fa8; }
html[data-theme="dark"] body .v5-sidenav-link:hover { color:#edf4ff; background:#203956; }
html[data-theme="dark"] body .v5-sidenav-link.is-active { color:#c8ddff; background:#25466f; }
html[data-theme="dark"] body .v5-sidenav-link.is-active::before { background:#a7c6ff; border-color:#a7c6ff; box-shadow:0 0 0 3px #a7c6ff26; }
html[data-theme="dark"] body .v5-sidenav-link:focus-visible { outline-color:#a7c6ff; }

html[data-theme="dark"] body[data-nav="/base/"] .v5-sidenav { background:transparent; border:0; box-shadow:none; }
html[data-theme="dark"] body[data-nav="/base/"] .v5-sidenav-heading span { color:#8fa1ba; background:transparent; }
html[data-theme="dark"] body[data-nav="/base/"] .v5-sidenav-list::before { background:#2d4059; }
html[data-theme="dark"] body[data-nav="/base/"] .v5-sidenav-link { color:#9dacbf; }
html[data-theme="dark"] body[data-nav="/base/"] .v5-sidenav-link:is(:hover,.is-active) { color:#a9c7ff; background:transparent; box-shadow:none; }
