/* Optional, decorative motion stays behind the welcome text and inside its card. */
.welcome-card .theme-effects { display:none; position:absolute; inset:0 0 0 42%; z-index:0; overflow:hidden; pointer-events:none; contain:paint; mask-image:linear-gradient(90deg,transparent,#000 35%); }
html[data-portal-effects=on]:is([data-portal-theme=cherry-blossom],[data-portal-theme=lavender],[data-portal-theme=forest],[data-portal-theme=sunset],[data-portal-theme=ocean],[data-portal-theme=autumn],[data-portal-theme=rose-gold]) #dashboard.active .welcome-card .theme-effects { display:block; }
.theme-effects i { position:absolute; display:block; pointer-events:none; }
.theme-effects i:nth-child(1) { --x:12%; --delay:-3s; --duration:19s; }
.theme-effects i:nth-child(2) { --x:35%; --delay:-12s; --duration:23s; }
.theme-effects i:nth-child(3) { --x:54%; --delay:-7s; --duration:21s; }
.theme-effects i:nth-child(4) { --x:73%; --delay:-17s; --duration:25s; }
.theme-effects i:nth-child(5) { --x:91%; --delay:-10s; --duration:22s; }
html[data-portal-theme=cherry-blossom] .theme-effects i { left:var(--x); top:-22px; width:12px; height:18px; border-radius:80% 15% 75% 35%; background:linear-gradient(125deg,#ffe5ee,#edaccb); box-shadow:inset 1px 0 1px #fff5; animation:portal-petal-fall var(--duration) var(--delay) linear infinite; }
html[data-portal-theme=cherry-blossom] .theme-effects i:nth-child(even)::after { content:''; position:absolute; left:25px; top:-40px; width:7px; height:11px; border-radius:inherit; background:inherit; transform:rotate(60deg); opacity:.65; }
@keyframes portal-petal-fall {
  0% { transform:translate3d(0,0,0) rotate(-25deg); opacity:0; }
  15% { opacity:.46; }
  50% { transform:translate3d(25px,100px,0) rotate(70deg); opacity:.4; }
  85% { opacity:.25; }
  100% { transform:translate3d(-12px,220px,0) rotate(160deg); opacity:0; }
}
html[data-portal-theme=lavender] .theme-effects i { width:310px; height:90px; top:-35px; right:-70px; border-radius:50%; border-top:2px solid #dfc5ff85; background:linear-gradient(180deg,#c5a1ff38,transparent 65%); animation:portal-lavender-glow 16s -4s ease-in-out infinite alternate; }
html[data-portal-theme=lavender] .theme-effects i:nth-child(2) { top:16px; right:-35px; width:350px; border-color:#e5c6f775; animation-delay:-12s; animation-duration:21s; }
html[data-portal-theme=lavender] .theme-effects i:nth-child(3) { top:66px; right:-90px; width:280px; animation-delay:-7s; animation-duration:19s; }
html[data-portal-theme=lavender] .theme-effects i:nth-child(n+4) { top:28%; right:22%; width:5px; height:5px; border:0; border-radius:50%; background:#eee0ff; box-shadow:0 0 10px 3px #d8baff55; animation:portal-lavender-glint 8s -2s ease-in-out infinite alternate; }
html[data-portal-theme=lavender] .theme-effects i:nth-child(5) { top:74%; right:49%; width:3px; height:3px; animation-delay:-6s; }
@keyframes portal-lavender-glow {
  from { transform:translate3d(24px,-8px,0) rotate(-18deg) scale(.92); opacity:.45; }
  to { transform:translate3d(-30px,15px,0) rotate(8deg) scale(1.08); opacity:.8; }
}
@keyframes portal-lavender-glint {
  from { transform:translate3d(0,5px,0) scale(.7); opacity:.15; }
  to { transform:translate3d(-8px,-5px,0) scale(1); opacity:.55; }
}
html[data-portal-theme=forest] .theme-effects i { width:7px; height:7px; left:var(--x); top:55%; border-radius:50%; background:#e3f7b9; box-shadow:0 0 16px 6px #d8eeae38; animation:portal-forest-drift var(--duration) var(--delay) ease-in-out infinite; }
html[data-portal-theme=forest] .theme-effects i:nth-child(n+4) { width:15px; height:27px; top:18%; border-radius:90% 0 90% 0; background:linear-gradient(125deg,#d2e9ac99,#88b88a55); box-shadow:inset 1px 0 0 #ebffd655; animation:portal-forest-leaf 24s -7s ease-in-out infinite alternate; }
html[data-portal-theme=forest] .theme-effects i:nth-child(5) { left:48%; top:65%; width:11px; height:20px; animation-delay:-19s; animation-duration:29s; }
@keyframes portal-forest-drift {
  0%,100% { transform:translate3d(-8px,28px,0); opacity:0; }
  30% { opacity:.5; }
  65% { transform:translate3d(18px,-18px,0); opacity:.3; }
  90% { transform:translate3d(6px,-40px,0); opacity:0; }
}
@keyframes portal-forest-leaf {
  from { transform:translate3d(-12px,-8px,0) rotate(-25deg); opacity:.35; }
  to { transform:translate3d(15px,18px,0) rotate(25deg); opacity:.6; }
}
html[data-portal-theme=sunset] .theme-effects i { width:70px; height:70px; right:25px; top:72%; border-radius:50%; background:linear-gradient(180deg,#ffe0ad,#ed9678); box-shadow:0 0 30px 12px #ffc08625; animation:portal-sunset-shimmer 20s -8s ease-in-out infinite alternate; }
html[data-portal-theme=sunset] .theme-effects i:nth-child(2) { width:260px; height:260px; right:-70px; top:calc(72% - 95px); background:repeating-conic-gradient(from 20deg,#ffd3a330 0deg,transparent 9deg,transparent 28deg); mask-image:radial-gradient(circle,#000 15%,transparent 68%); box-shadow:none; animation:portal-sunset-rays 28s -10s ease-in-out infinite alternate; }
html[data-portal-theme=sunset] .theme-effects i:nth-child(3) { width:240px; height:30px; right:-35px; top:auto; bottom:8px; background:repeating-linear-gradient(180deg,transparent 0px,transparent 8px,#ffd5a955 9px,transparent 10px); box-shadow:none; animation:portal-sunset-horizon 17s -5s ease-in-out infinite alternate; }
html[data-portal-theme=sunset] .theme-effects i:nth-child(n+4) { width:150px; height:18px; right:-10px; top:20px; background:radial-gradient(ellipse,#ffcbbb65,transparent 70%); box-shadow:none; animation:portal-sunset-horizon 23s -8s ease-in-out infinite alternate; }
html[data-portal-theme=sunset] .theme-effects i:nth-child(5) { right:40px; top:80px; width:190px; animation-delay:-18s; }
@keyframes portal-sunset-shimmer {
  from { transform:translate3d(0,6px,0) scale(.94); opacity:.36; }
  to { transform:translate3d(-6px,-5px,0) scale(1); opacity:.5; }
}
@keyframes portal-sunset-rays {
  from { transform:rotate(-12deg); opacity:.45; }
  to { transform:rotate(14deg); opacity:.8; }
}
@keyframes portal-sunset-horizon {
  from { transform:translate3d(18px,0,0) scaleX(.9); opacity:.3; }
  to { transform:translate3d(-24px,3px,0) scaleX(1.05); opacity:.55; }
}
html[data-portal-theme=ocean] .theme-effects i { width:340px; height:115px; right:-100px; top:55%; border-radius:50%; border-top:2px solid #b1e8e688; background:linear-gradient(180deg,#8fdddd30,transparent 65%); animation:portal-ocean-wave var(--duration) var(--delay) ease-in-out infinite alternate; }
html[data-portal-theme=ocean] .theme-effects i:nth-child(2) { top:68%; right:-55px; width:390px; }
html[data-portal-theme=ocean] .theme-effects i:nth-child(3) { top:82%; right:-130px; }
html[data-portal-theme=ocean] .theme-effects i:nth-child(n+4) { width:5px; height:5px; top:30%; right:24%; border:1px solid #d1f7f299; background:transparent; animation:portal-lavender-glint 13s -5s ease-in-out infinite alternate; }
html[data-portal-theme=ocean] .theme-effects i:nth-child(5) { top:52%; right:52%; width:3px; height:3px; animation-delay:-10s; }
@keyframes portal-ocean-wave { from { transform:translate3d(20px,7px,0) rotate(-5deg); opacity:.4; } to { transform:translate3d(-24px,-8px,0) rotate(4deg); opacity:.75; } }
html[data-portal-theme=autumn] .theme-effects i { left:var(--x); top:-25px; width:15px; height:23px; border-radius:85% 10% 85% 10%; background:linear-gradient(135deg,#f3cc82b3,#dc9c6177); box-shadow:inset 1px 0 #ffe3ac88; animation:portal-autumn-leaf var(--duration) var(--delay) linear infinite; }
html[data-portal-theme=autumn] .theme-effects i:nth-child(even) { width:11px; height:18px; background:linear-gradient(135deg,#e6ac7faa,#be786477); }
@keyframes portal-autumn-leaf { 0% { transform:translate3d(-10px,0,0) rotate(-40deg); opacity:0; } 20% { opacity:.5; } 60% { transform:translate3d(22px,120px,0) rotate(55deg); opacity:.4; } 100% { transform:translate3d(-5px,235px,0) rotate(135deg); opacity:0; } }
html[data-portal-theme=rose-gold] .theme-effects i { width:260px; height:110px; right:-70px; top:55%; border-radius:50%; border-top:1px solid #f5d1bdaa; background:linear-gradient(180deg,#e9ba9e25,transparent 60%); animation:portal-copper-sheen var(--duration) var(--delay) ease-in-out infinite alternate; }
html[data-portal-theme=rose-gold] .theme-effects i:nth-child(2) { top:72%; right:-30px; width:300px; }
html[data-portal-theme=rose-gold] .theme-effects i:nth-child(n+3) { width:4px; height:4px; right:20%; top:24%; border:0; background:#f8d6bf; box-shadow:0 0 9px 2px #f5c8aa33; animation:portal-lavender-glint 12s var(--delay) ease-in-out infinite alternate; }
html[data-portal-theme=rose-gold] .theme-effects i:nth-child(4) { right:44%; top:66%; width:3px; height:3px; }
html[data-portal-theme=rose-gold] .theme-effects i:nth-child(5) { right:62%; top:38%; width:2px; height:2px; }
@keyframes portal-copper-sheen { from { transform:translate3d(12px,9px,0) rotate(-15deg); opacity:.3; } to { transform:translate3d(-20px,-6px,0) rotate(8deg); opacity:.65; } }
@media(prefers-reduced-motion:reduce) {
  html[data-portal-effects] #dashboard .welcome-card .theme-effects { display:none; }
  .theme-effects i { animation:none!important; }
}
html:root[data-portal-theme=ocean] {
 --bg:#eff9fa; --card:#fff; --surface-2:#dceef0; --ink:#233e48; --muted:#506974; --border:#b7d2d7;
 --navy:#183848; --navy-light:#2f6275; --teal:#236479; --teal-dark:#174e61; --teal-light:#2e7185; --teal-soft:#23647912;
}
html:root[data-portal-theme=autumn] {
 --bg:#faf5eb; --card:#fff; --surface-2:#eee3cf; --ink:#443425; --muted:#70604d; --border:#d6c5a6;
 --navy:#403024; --navy-light:#795438; --teal:#8a4e2e; --teal-dark:#6e3b20; --teal-light:#995b37; --teal-soft:#8a4e2e12;
}
html:root[data-portal-theme=rose-gold] {
 --bg:#fff5f1; --card:#fff; --surface-2:#f3e3dc; --ink:#492f2d; --muted:#785951; --border:#ddc0b5;
 --navy:#472e30; --navy-light:#805348; --teal:#94513e; --teal-dark:#763e2f; --teal-light:#a15d48; --teal-soft:#94513e12;
}
:root { --theme-heading:var(--navy); --theme-button-ink:#fff; }
html:root[data-portal-theme=cherry-blossom] {
 --bg:#fff3f7; --card:#fff; --surface-2:#f9e5ed; --ink:#462536; --muted:#755565; --border:#e4bfce;
 --navy:#492439; --navy-light:#7f3a58; --teal:#963451; --teal-dark:#76233e; --teal-light:#a63d61; --teal-soft:#96345112;
}
html:root[data-portal-theme=lavender] {
 --bg:#f5f1ff; --card:#fff; --surface-2:#eae2f8; --ink:#352746; --muted:#695579; --border:#cfc0e4;
 --navy:#352446; --navy-light:#644482; --teal:#674194; --teal-dark:#503075; --teal-light:#78509f; --teal-soft:#67419412;
}
html:root[data-portal-theme=forest] {
 --bg:#eef7f0; --card:#fff; --surface-2:#deede2; --ink:#253e2e; --muted:#526b59; --border:#b9d1c0;
 --navy:#1e392b; --navy-light:#365d46; --teal:#286247; --teal-dark:#1c4c35; --teal-light:#347454; --teal-soft:#28624712;
}
html:root[data-portal-theme=sunset] {
 --bg:#fff4e9; --card:#fff; --surface-2:#fae6d6; --ink:#4b2d25; --muted:#78594c; --border:#e0c0a9;
 --navy:#4e2c29; --navy-light:#8c4734; --teal:#a2472d; --teal-dark:#80351f; --teal-light:#ac5234; --teal-soft:#a2472d12;
}
html:root:is([data-portal-theme=cherry-blossom],[data-portal-theme=lavender],[data-portal-theme=forest],[data-portal-theme=sunset],[data-portal-theme=ocean],[data-portal-theme=autumn],[data-portal-theme=rose-gold]) {
 --portal-brand-primary:var(--teal); --portal-brand-primary-hover:var(--teal-dark); --portal-brand-header:var(--navy); --gold-deep:#795a0e;
}
html:is([data-portal-theme=cherry-blossom],[data-portal-theme=lavender],[data-portal-theme=forest],[data-portal-theme=sunset],[data-portal-theme=ocean],[data-portal-theme=autumn],[data-portal-theme=rose-gold]) .cc-month.past { opacity:1; color:var(--muted); }
html:is([data-portal-theme=cherry-blossom],[data-portal-theme=lavender],[data-portal-theme=forest],[data-portal-theme=sunset],[data-portal-theme=ocean],[data-portal-theme=autumn],[data-portal-theme=rose-gold]) #maintenance .mt-count { color:var(--muted); background:var(--surface-2); }
html:is([data-portal-theme=cherry-blossom],[data-portal-theme=lavender],[data-portal-theme=forest],[data-portal-theme=sunset],[data-portal-theme=ocean],[data-portal-theme=autumn],[data-portal-theme=rose-gold]) #faq [style*="opacity"] { opacity:1!important; }
html:is([data-portal-theme=cherry-blossom],[data-portal-theme=lavender],[data-portal-theme=forest],[data-portal-theme=sunset],[data-portal-theme=ocean],[data-portal-theme=autumn],[data-portal-theme=rose-gold]) .badge-urgent { color:#9b3025; }
html:is([data-portal-theme=cherry-blossom],[data-portal-theme=lavender],[data-portal-theme=forest],[data-portal-theme=sunset],[data-portal-theme=ocean],[data-portal-theme=autumn],[data-portal-theme=rose-gold]) :is(input,textarea)::placeholder { color:var(--muted); opacity:1; }
html:is([data-portal-theme=cherry-blossom],[data-portal-theme=lavender],[data-portal-theme=forest],[data-portal-theme=sunset],[data-portal-theme=ocean],[data-portal-theme=autumn],[data-portal-theme=rose-gold]) .welcome-card .subline { color:#fff; }
html:is([data-portal-theme=cherry-blossom],[data-portal-theme=lavender],[data-portal-theme=forest],[data-portal-theme=sunset],[data-portal-theme=ocean],[data-portal-theme=autumn],[data-portal-theme=rose-gold]) .category-button { background:var(--card)!important; color:var(--ink); border:1px solid var(--border); }
html[data-portal-theme=dark] {
 --bg:#12161d; --card:#1d242e; --surface-2:#293340; --ink:#edf2f7; --muted:#adb9c8; --border:#3c495a;
 --navy:#111c2b; --navy-light:#202e41; --theme-heading:#edf2f7;
 --portal-brand-primary:#79badc; --portal-brand-primary-hover:#a2d7f0; --portal-brand-header:#111c2b;
 --teal:#79badc; --teal-dark:#a2d7f0; --teal-light:#a2d7f0; --teal-soft:#79badc20;
 --gold:#e4c185; --gold-deep:#e4c185; --gold-soft:#e4c18518; --danger:#ff9b90; --success:#81cfb3;
 --theme-button-ink:#101b29; --shadow-sm:0 1px 2px #0003; --shadow-md:0 2px 8px #0004; --shadow-lg:0 8px 28px #0006;
}
html[data-portal-theme=navy] {
 --bg:#0b1c34; --card:#122b48; --surface-2:#1c3b5c; --ink:#edf6ff; --muted:#afc4db; --border:#365473;
 --navy:#071629; --navy-light:#153353; --theme-heading:#edf6ff;
 --portal-brand-primary:#07dec9; --portal-brand-primary-hover:#73efdf; --portal-brand-header:#071629;
 --teal:#07dec9; --teal-dark:#73efdf; --teal-light:#53d9ed; --teal-soft:#07dec91a;
 --gold:#edc988; --gold-deep:#edc988; --gold-soft:#edc98818; --danger:#ffaaa0; --success:#70e2bd;
 --theme-button-ink:#071629; --shadow-sm:0 1px 2px #0003; --shadow-md:0 2px 8px #0004; --shadow-lg:0 8px 28px #0006;
}
/* Match the experience layer's specificity without changing its stored preferences. */
html[data-experience=enabled][data-portal-theme=dark] { --portal-brand-primary:#79badc; --portal-brand-primary-hover:#a2d7f0; --portal-brand-header:#111c2b; }
html[data-experience=enabled][data-portal-theme=navy] { --portal-brand-primary:#07dec9; --portal-brand-primary-hover:#73efdf; --portal-brand-header:#071629; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) body { background:var(--bg); color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.page-header h1,.page-header p,.card-title,.stat-value,.stat-number,.stat-tile-value,.house-tile-name,.doc-name,.training-info h4,.resource-title,.sop-card-t,.news-title,.person-name,.cf-hero-name,.modal-header h2,.modal-header h3,.portal-settings-header h3,.settings-section h4,.hm-intro h3,.hm-section-heading h3,.hm-card-head h4,.hm-stat strong,.hm-med-day-title h4,.sf-record-title h4,.sf-review-heading h3,.experience-dialog h2,.experience-more-sheet h2,.experience-more-sheet .experience-menu-body h3,.account-heading h4) { color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.sidebar,.mobile-bottom-nav,.mobile-topbar,.experience-menu-search,.experience-menu-grid button,.experience-more-sheet footer button,.experience-nav-button,.experience-dialog,.experience-more-sheet,.experience-add-tool,.experience-edit-row,.theme-choice,.workspace-section-picker,.hm-card,.hm-stat,.sf-record,.settings-section,.person-card,.resource-card,.sop-card,.news-card,.training-card) { background-color:var(--card); color:var(--ink); border-color:var(--border); }
/* Dark and Navy paint the phone header in --card; the iPhone status bar follows it (portal.css, portal-theme.js). */
html:is([data-portal-theme=dark],[data-portal-theme=navy]) { --status-bar:var(--card); }
html[data-experience=enabled]:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.sidebar-brand h2,.sidebar .nav-item,.sidebar .nav-section,.experience-nav-button,.workspace-menu-launcher,.sidebar-search-input) { color:var(--ink); }
html[data-experience=enabled]:is([data-portal-theme=dark],[data-portal-theme=navy]) .sidebar .nav-item.active { color:var(--theme-button-ink); background:var(--teal); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea) { color:var(--ink); background-color:var(--card); border-color:var(--border); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) input::placeholder,
html:is([data-portal-theme=dark],[data-portal-theme=navy]) textarea::placeholder { color:var(--muted); opacity:1; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .btn-primary,
html[data-experience=enabled]:is([data-portal-theme=dark],[data-portal-theme=navy]) .btn-primary { background:var(--teal); color:var(--theme-button-ink); border-color:transparent; }
html[data-portal-theme=navy] .btn-primary,
html[data-experience=enabled][data-portal-theme=navy] .btn-primary { background:linear-gradient(105deg,#07dec9,#1c95e6); color:#071629; }
html[data-experience=enabled]:is([data-portal-theme=dark],[data-portal-theme=navy]) .btn-ghost:not(.bulk-bar .btn-ghost) { background:var(--card); color:var(--ink); border-color:var(--border); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.account-nav button,.hh-tab,.tab-btn,.rc-tab,.mt-tab,.userdetail-tab,.experience-filters button,.experience-tabs button,.sf-views button,.filter-pill):is(.active,.on,[aria-selected=true],[aria-pressed=true]) { background:var(--teal)!important; color:var(--theme-button-ink)!important; border-color:var(--teal)!important; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .account-nav button[aria-pressed=true] span { color:var(--theme-button-ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #experienceMore .experience-menu-grid button[aria-current=page] { background:var(--teal); color:var(--theme-button-ink); border-color:var(--teal); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.doc-toolbar,.users-table,.docs-table,.hm-house-details,.hm-content,.hm-med-detail,.hm-filters,.hm-section,.sf-empty,.password-help) { background-color:var(--bg); color:var(--ink); border-color:var(--border); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(th,.users-table th,.docs-table th) { background:var(--surface-2); color:var(--muted); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.userdetail-tab,.tab-btn,.rc-tab,.mt-tab,.filter-pill,.hm-record,.hm-record strong,.hm-section strong,.workspace-menu-launcher) { color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #dashboardStartForm :is(h3,h4,.sf-views [aria-pressed=true]) { color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.badge-policy,.badge-warning,.hm-warning,.state-unavailable) { color:#edcf92; background:#594322; border-color:#907245; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.badge-danger,.badge-overdue,.hm-tag-late) { color:#ffbcb1; background:#572f35; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.badge-success,.hm-tag) { color:#95edd1; background:#20463f; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.modal,.card,.training-card,.house-tile,.sf-record) { border-color:var(--border); }
/* Older screens reuse navy for text as well as branded backgrounds. Keep those
   roles separate without changing their light-mode styling or source forms. */
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.field label,.password-help strong,.notif-dropdown-header,.notif-item-title,.wn-update-head strong,.payroll-card-title,.payroll-fields dd code,.modal h3,.modal-close:hover,.training-section-header h2,.notice strong,.reg-dash-ring span,.reg-dash-pct-label,.reg-modbar-head,.news-card .news-title a,.resource-card .resource-title,.dinner-title,.dinner-meal,.fdg-title,.fdg-att-name,.sl-att-name,.readsign-sign-head,.doc-week-folder-name,.oncall-name,.coming-up-item .cu-title,.onboarding-card h1,.cal-month,.cal-daynum,.cal-list-date,.db-banner-title,.confirm-title,.faq-q,.faq-a-body h2,.faq-a-body h3,.faq-a-body h4,.search-hit .title,.sd-section-title,.sd-row-label,.sf-group,.profile-quicknav-chip,.profile-quicknav-perf-item,.profile-resume-wizard strong,.um-section-title,.bi-row-name,.templates-tile-title,.ct-template-title,.ct-template-stats strong,.ag-row-title,.ct-pd-title,.ct-pd-open-title,.automation-card-title,.toggle-switch-label,.hh-resource-group-summary,.rc-column-title,.rc-card-name,.sl-submitted-title,.sl-section-title,.iv-focus-header-title,.iv-focus-q,.ir-row-title,.ir-detail-title,.rc-review-total,.form-topbar-close,.form-topbar-h1,.form-section-title,.form-field-label,.form-submitted-title,.form-hub-section h3,.form-record-title,.tr-actions-item,.training-cat,.reg-mods-details > summary,.svy-h2,.svy-card-title,.svy-q-prompt,.svy-rate span,.svy-check,.svy-res-summary,.svy-res-prompt,.svy-res-avg,.svy-bar-lab-wide,.svy-bar-n,.svy-text,.svy-who > summary,.ar-ring span,.ar-training-title,.ar-n,.pg-group > summary,.pg-finding-type,.ha-step-title,.mr-day,.mr-owner,.mr-time,.sl-rate-title,.needs-you-title,.stat-tile b,.section-label,.mt-toolbar label,.mt-card h2,.mt-col-head,.mt-card-title) { color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is([style*="color:var(--navy"],[style*="color: var(--navy"]) { color:var(--ink)!important; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.notif-dropdown,.wn-card,.wn-update,.wn-try,.payroll-card,.aidrop-menu-panel,.cal-day,.dashboard-overdue-banner,.dashboard-review-banner,.sop-search,.toast,.faq-article,.search-hit,.sd-row,.userdetail-tab-perf-menu,.profile-quicknav-chip,.profile-quicknav-perf-menu,.bi-preview-rows,.ct-review-body,.wn-response-block,.templates-tile,.ct-template-card,.ag-row,.rv-actions-menu-items,.ct-pd-link,.ct-pd-open-card,.pd-library-table tr,.hh-resource-group,.hh-resource-group-count,.hh-resource-row,.hh-list-row,.rc-column-head,.rc-card,.rc-post-row,.sl-footer,.sl-card,.iv-focus,.iv-focus-header,.iv-focus-footer,.rc-toolbar-menu-items,.rc-bulk-row,.form-topbar,.form-footer,.form-card,.form-record-row,.tr-actions-menu,.sl-progress,.mt-toolbar,.mt-card,.mt-empty,.document-actions-panel) { background:var(--card); color:var(--ink); border-color:var(--border); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.badge-urgent,.btn-danger) { background:#71333b; color:#ffe1dc; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.role-coordinator,#dashboardAvatar) { color:var(--theme-button-ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.mt-count,.templates-tile-status-soon) { background:var(--surface-2); color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #maintenance :is(.mt-col-head,.mt-card-title,.mt-desc) { color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #maintenance .mt-count { background:var(--surface-2); color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.sa-launch,.sa-dialog,.sa-shell,.sa-body,.sa-foot,.sa-row) { background:var(--card); color:var(--ink); border-color:var(--border); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.sa-group h3,.sa-row h4) { color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.sa-meta,.sa-date,.sa-foot p) { color:var(--muted); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .sa-date.overdue { color:var(--danger); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.sa-date.today,.sa-date.soon) { color:var(--gold); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .sa-notice { background:#594322; color:#edcf92; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .sa-action { background:var(--surface-2); color:var(--ink); border-color:var(--border); }
/* Explicit IDs match legacy screen-local styles, including styles loaded later. */
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #dashboardStartForm .sf-filters :is(input,select) { color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #dashboardStartForm .sf-empty { background:var(--bg); color:var(--muted); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #dashboardActionTbody td:first-child { color:var(--ink); }
html[data-experience=enabled]:is([data-portal-theme=dark],[data-portal-theme=navy]) .mobile-topbar-title { color:var(--ink); }
html[data-experience=enabled]:is([data-portal-theme=dark],[data-portal-theme=navy]) .mobile-topbar .experience-workspace { color:var(--muted); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.cc-tile-n,.cc-month,.cc-section h3,.cc-date,.cc-select) { color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .cc-month.past { opacity:1; color:var(--muted); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #faq .active [style*="opacity"] { opacity:1!important; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #training [style*="color:#885c17"] { color:var(--gold)!important; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #documents .badge[style*="background:#e8f1f5"] { background:var(--surface-2)!important; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #auditpack .ap-tile-title,
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #hubsettings .hs-house-name,
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #auditpack .ap-big.ap-alert { color:var(--danger); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .comms-chip.active { color:var(--theme-button-ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #settingsAvatarPreview { color:var(--theme-button-ink)!important; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #experienceMore .experience-menu-grid button[aria-current=page] .experience-menu-icon { color:var(--theme-button-ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .welcome-card { background:linear-gradient(135deg,var(--navy),var(--navy-light)); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .category-button { background:var(--card)!important; color:var(--ink); border:1px solid var(--border); }
html[data-experience=enabled]:is([data-portal-theme=dark],[data-portal-theme=navy]) .sidebar .nav-group-header:hover { color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.ag-check-bar,.ag-check-head,.ag-budget-head,.ag-sched-label,.ag-sched-value,.wiz-title,.wiz-review-label,.wiz-step-title,.wiz-multi-label,.wiz-welcome-title,.wiz-welcome-value-title,.wiz-welcome-oncall-name,.wiz-pay-card-title,.wiz-pay-allow-label) { color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .wiz-header { background:var(--card); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.wiz-review-row,.wiz-multi-item,.wiz-pay-card-rights,.wiz-pay-loading-math,.wiz-pay-table th,.wiz-whs-option-letter,.wiz-whs-option-chosen,.wiz-pay-sign,.wiz-sidebar-row-current,.wiz-sidebar-row:hover,.wiz-sidebar-toggle:hover) { background:var(--card); color:var(--ink); border-color:var(--border); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(#agreementQuickBuildList,[data-ag-bind=builder-preview],[data-ag-bind=wetink-preview],.ag-builder-preview) { background:var(--card)!important; }
/* Shared menus must follow every selected palette, including lazily loaded views. */
html[data-portal-theme]:not([data-portal-theme=light]) :is(.sa-dialog,.sa-shell,.sa-body,.sa-foot,.sa-row) { background:var(--card); color:var(--ink); border-color:var(--border); }
html[data-portal-theme]:not([data-portal-theme=light]) .sa-launch { background:var(--surface-2); color:var(--ink); border-color:var(--border); border-left-color:var(--teal); }
html[data-portal-theme]:not([data-portal-theme=light]) :is(.sa-group h3,.sa-row h4,.mt-desc) { color:var(--ink); }
html[data-portal-theme]:not([data-portal-theme=light]) :is(.sa-meta,.sa-date:not(.overdue):not(.today):not(.soon),.sa-foot p) { color:var(--muted); }
html[data-portal-theme]:not([data-portal-theme=light]) :is(.sa-action,.sa-new,.mt-status-assigned) { background:var(--surface-2); color:var(--ink); border-color:var(--border); }
html[data-portal-theme]:not([data-portal-theme=light]) .sa-foot .sa-action { background:var(--teal); color:var(--theme-button-ink); border-color:var(--teal); }
html:root[data-portal-theme=navy] .sa-foot .sa-action { background:linear-gradient(105deg,#07dec9,#1c95e6); }
html[data-portal-theme]:not([data-portal-theme=light]) :is(.sa-head,.wn-hero,.tv-head,.readsign-bar,.sl-topbar,.ct-fs-header,.rp-head,.sopv-bar,.sopv-foot,.portal-file-viewer-bar) { background:linear-gradient(135deg,var(--navy),var(--navy-light)); color:#fff; border-color:var(--border); }
html[data-portal-theme]:not([data-portal-theme=light]) :is(.sa-head h2,.sa-head p,.sa-eyebrow,.wn-hero h3,.wn-hero p,.tv-head-eyebrow,.tv-step-count,.readsign-bar-title,.sl-topbar h1,.ct-fs-header h2,.rp-head-title,.sopv-bar h2,.portal-file-viewer-bar strong) { color:#fff; }
html[data-portal-theme]:not([data-portal-theme=light]) .sa-close { border-color:#ffffff66; }
html[data-portal-theme]:not([data-portal-theme=light]) :is(.sa-dialog button,.sa-launch):focus-visible { outline-color:var(--teal); }
html[data-portal-theme]:not([data-portal-theme=light]) .sa-dialog::backdrop { background:#0008; }
html[data-portal-theme]:not([data-portal-theme=light]) [data-whatsnew] { background:#0008; }
html[data-portal-theme]:not([data-portal-theme=light]) body :is(.modal-close,.experience-close,.experience-back,.form-topbar-close,.sl-close,.sl-lightbox-close,.cd-lb-close,.wiz-close,.iv-focus-close,.ct-fs-close,.rp-close,.rp-back,.sopv-x,.sopv-foot button,.readsign-bar .btn.btn-ghost,.portal-file-viewer-bar .btn,[data-svy-close],[data-rs="modalClose"],[data-rs-act="close"],[data-hg-close],.form-footer [data-form-action="close"],[data-cda-act="close"],.rs-back,.tv-close) { background:var(--surface-2); color:var(--ink); border-color:var(--border); }
html[data-portal-theme]:not([data-portal-theme=light]) body :is(.modal-close,.experience-close,.experience-back,.form-topbar-close,.sl-close,.sl-lightbox-close,.cd-lb-close,.wiz-close,.iv-focus-close,.ct-fs-close,.rp-close,.rp-back,.sopv-x,.sopv-foot button,.readsign-bar .btn.btn-ghost,.portal-file-viewer-bar .btn,[data-svy-close],[data-rs="modalClose"],[data-rs-act="close"],[data-hg-close],.form-footer [data-form-action="close"],[data-cda-act="close"],.rs-back,.tv-close):hover:not(:disabled) { background:var(--card); color:var(--ink); border-color:var(--teal); }
html[data-portal-theme]:not([data-portal-theme=light]) :is(.as-chip,.mt-tab,.wn-update,.wn-card,.wn-try,.document-actions-panel,.doc-actions-menu,.tr-actions-menu,.userdetail-tab-perf-menu,.profile-quicknav-perf-menu) { border-color:var(--border); }
html[data-portal-theme]:not([data-portal-theme=light]) .account-nav button[aria-pressed=true] span { color:inherit; }
html[data-portal-theme]:not([data-portal-theme=light]) .sd-progress-fill { background:var(--teal); }
html[data-portal-theme]:not([data-portal-theme=light]) .toggle-switch-track { background:var(--border); }
html[data-portal-theme]:not([data-portal-theme=light]) .toggle-switch input:checked + .toggle-switch-track { background:var(--teal); }
html[data-portal-theme]:not([data-portal-theme=light]) #auditpack .card[style*="linear-gradient"] { background:linear-gradient(135deg,var(--navy),var(--navy-light))!important; --gold:#f3d9b5; }
html[data-portal-theme]:not([data-portal-theme=light]) #auditpack .card[style*="linear-gradient"] [style*="color:rgba(255"] { color:#fff!important; }
html[data-portal-theme]:not([data-portal-theme=light]) #dashboard :is(.dashboard-review-banner,.dashboard-overdue-banner) .btn-ghost { background:var(--surface-2); border-color:var(--border); color:var(--ink); }
html[data-portal-theme]:not([data-portal-theme=light]) .modal a:not(.btn):not(.doc-paper a):not(.ag-render a) { color:var(--teal-dark); }
html[data-portal-theme]:not([data-portal-theme=light]) #dashboardStartForm .sf-views [aria-pressed=true] { background:var(--teal); color:var(--theme-button-ink); border-color:var(--teal); }
html[data-portal-theme]:not([data-portal-theme=light]) #assets .as-chip,
html[data-portal-theme]:not([data-portal-theme=light]) #maintenance .mt-tab { border-color:var(--border); }
html[data-portal-theme]:not([data-portal-theme=light]) #maintenance .mt-status-assigned { background:var(--surface-2); color:var(--ink); }
html[data-portal-theme]:not([data-portal-theme=light]) #maintenance .mt-desc { color:var(--ink); }
html[data-portal-theme]:not([data-portal-theme=light]) [data-whatsnew] { background:#0008!important; }
html[data-portal-theme]:not([data-portal-theme=light]) .sa-head button:focus-visible { outline-color:#fff; }
html[data-portal-theme]:not([data-portal-theme=light]) .wn-gotit { background:var(--teal); color:var(--theme-button-ink); }
html[data-portal-theme]:not([data-portal-theme=light]) .wn-chip.major { background:var(--surface-2); color:var(--ink); }
html[data-portal-theme]:not([data-portal-theme=light]) :is(.tv-slide-title,.tv-slide-content,.tv-slide-content strong) { color:var(--ink); }
html[data-portal-theme]:not([data-portal-theme=light]) :is(.tv-slide-icon,.tv-step-n,.tv-ack-check-on .tv-ack-mark) { color:var(--theme-button-ink); }
/* Populated operational views: brand backgrounds are not text colours. */
.wiz-pay-hero-rate-label { color:#f3d9b5; }
html[data-portal-theme=light] .wiz-pay-override-note { color:#526176; }
/* Detail states loaded after opening staff and participant files. */
.sd-badge.badge-na { background:var(--surface-2,#eef2f7); color:var(--ink); }
html:not([data-portal-theme=dark]):not([data-portal-theme=navy]) .sd-badge.badge-expired { color:#a32f27; }
html[data-portal-theme=light] :is(.cf-pill-sil,.ir-badge-open) { color:#795a0e; }
html[data-portal-theme=light] .cf-pill[style*="var(--gold-deep)"] { color:#795a0e!important; }
html[data-portal-theme=light] .hh-tab:not(.active) .hm-nav-count { color:var(--ink); }
html[data-portal-theme=light] .hm-eyebrow { color:var(--teal-dark)!important; }
html[data-portal-theme=light] [data-bind="userdetail.communications"] .pill { color:var(--teal-dark)!important; }
html[data-portal-theme=light] [data-bind="userdetail.communications"] .pill[style*="gold-deep"] { color:#795a0e!important; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .cd-head-h { color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .wiz-pay-card-loading { background:var(--surface-2); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.goal-row,.oo-row) { background:var(--card)!important; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .goal-row [style*="background:#eef0f4"] { background:var(--border)!important; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .rv-type-pill { color:var(--theme-button-ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .wn-sev-other { background:var(--surface-2); color:var(--ink); }
.wn-sev-pill.wn-sev-verbal { background:#526176; }
.wn-sev-pill.wn-sev-first { background:#81530d; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .wn-sev-pill.wn-sev-final { background:var(--theme-danger-bg); color:var(--theme-danger-ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #assets :is(.as-form-grid,.as-obl-edit) :is(input:not([type=checkbox]),select) { background:var(--bg); color:var(--ink); border-color:var(--border); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #assets .as-obl-edit .as-obl-name { color:var(--ink); }
@media(max-width:600px) {
 #assets :is(.as-card-actions,.as-obl-row) { flex-wrap:wrap; }
 .wiz-pay-table { min-width:0; table-layout:fixed; }
 .wiz-pay-table :is(th,td) { overflow-wrap:anywhere; }
 .wiz-pay-table .wiz-pay-num { white-space:normal; }
}
html[data-portal-theme=light] :is(.welcome-card .subline,.category-button .cat-sub,.category-button .cat-arrow) { color:#fff; opacity:1; }
html[data-portal-theme=light] .category-button.gold { background:linear-gradient(135deg,#725511,#87631b); }
html[data-portal-theme=light] .cc-month.past { opacity:1; }
html[data-portal-theme=light] #maintenance .mt-count { color:#526176; }
html[data-portal-theme=light] .cc-month small { color:#526176; }
html[data-portal-theme=light] #faq [style*="opacity:0.6"] { opacity:1!important; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) {
 --theme-info-bg:#20404d; --theme-info-ink:#b6e8fa;
 --theme-warning-bg:#594322; --theme-warning-ink:#edcf92;
 --theme-danger-bg:#572f35; --theme-danger-ink:#ffbcb1;
}
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(#assets .as-card-title,#assets .as-obl-row span:first-child,#assets .as-editor-obl-head,#propertyfleet .pf-kpi-num,#propertyfleet .pf-sec-head,#propertyfleet .pf-table td,#propertyfleet .pf-ticket,#responsecentre .rc-pb-title,#automations .au-rule-name,#hubsettings .hs-res-name,.profile-pay-summary) { color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(#propertyfleet .pf-kpi-alert) { color:var(--danger); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.badge-info,#responsecentre .rc-chip-pri,#responsecentre .rc-cat-staff_whs,#responsecentre .rc-cat-participant,#hubsettings .hs-chip--teal,.mr-owner-all) { background:var(--theme-info-bg); color:var(--theme-info-ink); border-color:var(--border); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.cc-month.hot,.mr-kind-spot,.mr-owner-pool,#responsecentre .rc-cat-other,#hubsettings .hs-chip--amber) { background:var(--theme-warning-bg); color:var(--theme-warning-ink); border-color:var(--gold); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .cc-month.bad { background:var(--theme-danger-bg); color:var(--theme-danger-ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.cc-tile-n.bad,.cc-section.bad h3) { color:var(--danger); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .cc-month:is(.hot,.bad) small { color:inherit; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .cc-month.active { background:var(--teal); color:var(--theme-button-ink); border-color:var(--teal); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(#responsecentre .rc-chip,#hubsettings .hs-chip):not(.rc-chip-pri):not(.hs-chip--teal):not(.hs-chip--amber) { background:var(--surface-2); color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.profile-quicknav-count.has-items,.recognition-avatar) { color:var(--theme-button-ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.ag-mobile-tabs button,#assets .as-chip,#maintenance .mt-tab,.comms-chip) { background:var(--card); color:var(--ink); border-color:var(--border); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(.ag-mobile-tabs button[aria-selected=true],#assets .as-chip.on,#maintenance .mt-tab.on,.comms-chip.active) { background:var(--teal); color:var(--theme-button-ink); border-color:var(--teal); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(#teamactions,#errors,#compliancecalendar) :is([style*="color:#c0392b"],[style*="color: #c0392b"],[style*="color:#9c1f1f"]) { color:var(--danger)!important; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #notifhub .pill { background:var(--surface-2)!important; color:var(--ink)!important; }
/* Roster states retain distinct fills and outlines without light-mode islands. */
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .document-actions > summary { background:var(--surface-2); color:var(--ink); border-color:var(--border); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .document-actions > summary:hover { background:var(--card); border-color:var(--teal); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .document-actions[open] > summary { background:var(--card); border-color:var(--teal); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .document-actions .document-actions-panel button { color:var(--ink)!important; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .document-actions .document-actions-panel button:hover { background:var(--surface-2)!important; }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .document-actions .document-actions-panel button[data-action=delete-doc] { color:var(--danger)!important; border-color:var(--border); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(#assets .as-obl-row,#propertyfleet .pf-table td,#propertyfleet .pf-table th,#propertyfleet .pf-ticket) { border-color:var(--border); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(#signAgreementContent,#signDocContent) .state-empty { color:#526176; }
/* Evidence, signatures, QR codes and document pages remain in their original colours. */
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #admin .templates-tile { background:var(--surface-2); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #admin .templates-tile:hover:not(:disabled) { background:var(--card); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #userDetailModal :is(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]),select,textarea) { background-color:var(--bg); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #mfaSecret { background:#fff!important; color:#10243a; }
html:not([data-portal-theme=light]) :is(.tf-doc,.ct-doc,.tc-doc,.doc-paper,.ag-render,.wn-doc,.rv-doc,.rc-receipt-pdf) { color:#1a2e4a; background:#fff; color-scheme:light; --ink:#1a2e4a; --navy:#0f1e33; --muted:#6b7280; --card:#fff; --bg:#f7f8fa; --border:#e5e7eb; --teal:#2a7d8c; }
html:not([data-portal-theme=light]) :is(.tf-doc,.ct-doc,.tc-doc,.doc-paper,.ag-render,.wn-doc,.rv-doc) :is(input,textarea,select) { background:#fff; color:#1a2e4a; }
/* House Hub sheets (.hh-sheet: medication sign-off, PRN, delay reasons, card editor - 24 makeSheet() call sites) are
   authored on a white sheet with light-theme inline colours. In Dark and Navy their labels inherited near-white --ink on
   white (about 1.1:1). Keep the sheet's tokens light so every label stays readable. Guard: tests/theme-hub-sheets.spec.js. */
html:is([data-portal-theme=dark],[data-portal-theme=navy]) .hh-sheet {
 color:#1a2e4a; color-scheme:light;
 --bg:#f7f8fa; --card:#fff; --surface-2:#eef2f7; --ink:#1a2e4a; --muted:#6b7280; --border:#e5e7eb;
 --navy:#0f1e33; --navy-light:#1a2e4a; --theme-heading:#0f1e33; --theme-button-ink:#fff;
 --portal-brand-primary:#2a7d8c; --portal-brand-primary-hover:#1f5d68; --portal-brand-header:#0f1e33;
 --teal:#2a7d8c; --teal-dark:#1f5d68; --teal-light:#3a9aad; --teal-soft:rgba(42,125,140,.10);
 --gold:#c8a96e; --gold-deep:#8b6914; --gold-soft:rgba(200,169,110,.15); --danger:#c44536; --success:#2a7d8c;
 --shadow-sm:0 1px 2px rgba(15,30,51,.06); --shadow-md:0 2px 6px rgba(15,30,51,.10); --shadow-lg:0 6px 16px rgba(15,30,51,.16);
}
/* v937: House Hub settings (v932) and Portal settings (v933-v936) drew their text in --navy, which stays dark in the
   Dark and Navy themes - unreadable on a dark card (theme-contrast.spec.js main-screen contrast). */
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(#hubsettings,#portalsettings) :is(.hs-nav button,.hs-inline-label,.hs-device,.hs-alert-title,.hs-person,.hs-tracker,.hs-lock,.hs-switch,.ps-nav button,.ps-head h2,.ps-label,.ps-num,.ps-else-title,.ps-area-name,.ps-alert-title,.ps-who legend,.ps-who-item,.toggle-switch-label) { color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #portalsettings :is(.ps-person,.ps-text-every,.ps-state,.ps-days) { color:var(--ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #portalsettings .ps-tag.ps-tag--bad { background:var(--theme-danger-bg); color:var(--theme-danger-ink); border-color:var(--danger); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) #portalsettings .ps-person { background:var(--surface-2); border-color:var(--border); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(#hubsettings,#portalsettings) :is(.hs-sec-h,.ps-sub,.ps-link,.hs-nav button:hover,.ps-nav button:hover) { color:var(--theme-info-ink); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(#hubsettings .hs-warn,#portalsettings .ps-tag) { background:var(--theme-warning-bg); color:var(--theme-warning-ink); border-color:var(--gold); }
html:is([data-portal-theme=dark],[data-portal-theme=navy]) :is(#hubsettings .hs-person,#hubsettings .hs-lock) { background:var(--surface-2); border-color:var(--border); }
@media print {
 html[data-portal-theme] { --bg:#fff; --card:#fff; --surface-2:#eef2f7; --ink:#1a2e4a; --muted:#6b7280; --border:#ddd; --teal:#2a7d8c; --theme-heading:#0f1e33; color-scheme:light!important; }
 html[data-portal-theme] body { background:#fff!important; color:#1a2e4a!important; }
}
