.site-theme-toggle{display:grid;place-items:center;flex:0 0 42px;width:42px;height:42px;padding:8px;border:1px solid #d1d7e4;border-radius:8px;background:#fff;color:#a65b00;cursor:pointer}
.site-theme-toggle:hover{background:#fff3df}.site-theme-toggle:focus-visible{outline:2px solid #ee8024;outline-offset:2px}
html[data-theme=dark]{color-scheme:dark;--dark-bg:#000000;--dark-panel:#111111;--dark-field:#080808;--dark-border:#3d3d3d;--dark-text:#ededed;--dark-muted:#bdbdbd;background:var(--dark-bg)}
html[data-theme=dark] body{background:var(--dark-bg)!important;color:var(--dark-text)!important;--ds-border:#3d3d3d;--ds-divider:#333333;--ds-text:#ededed;--ds-muted:#bdbdbd;--ds-brand:#ededed}
html[data-theme=dark] :is(.site-nav,.tabs,main,.view,.panel,.home-card,.proposal,dialog,.tl-task-section,.tl-legacy,.lane,.laneitem,.tl-unscheduled,.profile-data,.profile-fields,.user-menu-panel,.notification-panel){background:var(--dark-panel)!important;color:var(--dark-text)!important;border-color:var(--dark-border)!important}
html[data-theme=dark] :is(h1,h2,h3,h4,label,legend,.site-nav-brand,.profile-data dd){color:var(--dark-text)!important}
html[data-theme=dark] :is(.sub,small,.site-nav-link,.profile-data dt){color:var(--dark-muted)}
html[data-theme=dark] :is(input,select,textarea,button,.system-date,.system-multi,.owners-select,.user-menu-panel a,.user-menu-panel button){background-color:var(--dark-field)!important;color:var(--dark-text)!important;border-color:var(--dark-border)!important}
html[data-theme=dark] :is(input,textarea)::placeholder{color:#a8a8a8;opacity:1}
html[data-theme=dark] :is(input,select,textarea):disabled{background:#242424!important;color:#bdbdbd!important}
html[data-theme=dark] :is(button.primary,.home-login){background:#ff8b29!important;color:#171717!important;border-color:#ff8b29!important}
html[data-theme=dark] :is(.site-nav-link.active,[aria-selected=true],button[aria-pressed=true]){background:#54371e!important;color:#ffcf9d!important}
html[data-theme=dark] :is(table,td,.table-wrap,.tablewrap,.tl-task-table-wrap,.delivery-table-wrap,.tl-label,.tl-label-head,.tl-calendar-head,.tl-day,.tl-scroll){background-color:var(--dark-panel)!important;color:var(--dark-text)!important;border-color:var(--dark-border)!important}
html[data-theme=dark] th{color:#fff!important}html[data-theme=dark] .tl-weekend{background:#242424!important}html[data-theme=dark] .tl-day.tl-today{background:#54371e!important;color:#ffcf9d!important}
html[data-theme=dark] :is(.tl-heading,.tl-editor-actions){background:var(--dark-panel)!important;border-color:var(--dark-border)!important}
html[data-theme=dark] :is(.owners-chip,.relations-badge,.phase-badge){background:#292929!important;color:#ededed!important}
html[data-theme=dark] :is(.owners-chip button,.site-theme-toggle){color:#ffd08d!important}
html[data-theme=dark] :is(.content-tooltip,.system-options,.relations-choices){background:#242424!important;color:#f5f5f5!important;border-color:#666666!important}
html[data-theme=dark] :is(.content-tooltip p,.content-tooltip span){color:inherit!important}
html[data-theme=dark] :is(.notice,.old,.evidence){background:#242424!important;color:#ededed!important;border-color:#666666!important}
html[data-theme=dark] :is(.error,[aria-invalid=true],.tl-date-error,.system-date-error){color:#ffb4b4!important;border-color:#ee9090!important}
html[data-theme=dark] :is(.tl-summary-link,.tl-summary .stat,.stat){background:#222222!important;color:#ededed!important}
html[data-theme=dark] :is(.tl-summary strong,.tl-summary span,.stat strong,.stat .n){color:inherit!important}
html[data-theme=dark] .tl-summary [data-summary-tone=completed]{border-top-color:#65c994!important;color:#98e9bb!important}
html[data-theme=dark] .tl-summary [data-summary-tone=running]{color:#b3d4ff!important}
html[data-theme=dark] .tl-summary [data-summary-tone=overdue]{color:#ffe198!important}
html[data-theme=dark] .tl-summary [data-summary-tone=cancelled]{color:#ffb4bd!important}
html[data-theme=dark] :is(.tl-label>button,.tl-unscheduled button,.backlog-open,.system-linked-code,a){color:#b5d6ff}
html[data-theme=dark] .site-page-band{background:#000000!important}
html[data-theme=dark] :is(#pageMessage,.site-header-feedback){color:#ededed!important}
@media print{html[data-theme=dark],html[data-theme=dark] body,html[data-theme=dark] :is(main,.view,.panel,table,td){background:#fff!important;color:#111!important}.site-theme-toggle{display:none!important}}

html[data-theme=dark] :is(.sub,.hint,.muted,.help,.profile-help,.notification-item small){color:var(--dark-muted)!important}
html[data-theme=dark] :is(.notification-item,.notification-toast,.notification-heading){background:#111111!important;color:#ededed!important;border-color:#3d3d3d!important}
html[data-theme=dark] .notification-item.is-unread{background:#292929!important}
html[data-theme=dark] .notification-dot{background:#ef4444!important}
html[data-theme=dark] .site-theme-toggle{background:#111111!important;color:#ffd08d!important}
html[data-theme=dark] :is(.owners-chip button,.owners-select){background:transparent!important}
html[data-theme=dark] .vi-system #summary.system-count>span{background:#292929;color:#ededed;border-color:#555555}
html[data-theme=dark] .vi-system #summary.system-count b{color:#ededed}

/* Flat black canvas; semantic light surfaces always carry dark lettering. */
html[data-theme=dark] :is(main,.view){background:#000!important}
html[data-theme=dark] .tl-summary [data-summary-tone=backlog]{background:#e8edf2!important;color:#334155!important}
html[data-theme=dark] .tl-summary [data-summary-tone=completed]{background:#ddf5e8!important;color:#12623f!important}
html[data-theme=dark] .tl-summary [data-summary-tone=running]{background:#dfeaff!important;color:#2448a5!important}
html[data-theme=dark] .tl-summary [data-summary-tone=overdue]{background:#fff0c2!important;color:#805700!important}
html[data-theme=dark] .tl-summary [data-summary-tone=cancelled]{background:#fff1f2!important;color:#9f1239!important}
html[data-theme=dark] .tl-summary [data-summary-tone] :is(strong,span,small){color:inherit!important}
html[data-theme=dark] .tl-summary [data-summary-tone] small{opacity:1}
html[data-theme=dark] :is(.kpi,.vi-system #summary.system-count>span){background:#f1f1f1!important;color:#202020!important;border-color:#c6c6c6!important}
html[data-theme=dark] :is(.kpi,.vi-system #summary.system-count>span) :is(.n,.l,b,strong,small,span){color:#202020!important}
html[data-theme=dark] :is(.project-count,.delivery-group h3 span,.pill,.tag,.badge,.system-count) :is(strong,b,small,span){color:inherit!important}
html[data-theme=dark] .project-count-blue{background:#dfeaff!important;color:#2448a5!important}
html[data-theme=dark] .project-count-amber{background:#fff0c2!important;color:#805700!important}
html[data-theme=dark] .project-count-green{background:#ddf5e8!important;color:#12623f!important}
html[data-theme=dark] .delivery-group h3 span{background:#ddf5e8!important;color:#12623f!important}
html[data-theme=dark] :is(.site-nav,.tabs,.user-menu-panel,.notification-panel){box-shadow:none}
html[data-theme=dark] th{background:#242424!important;color:#f5f5f5!important;border-color:#3d3d3d!important}
html[data-theme=dark] :is(.tl-label>button,.tl-unscheduled button,.backlog-open,.system-linked-code,a){color:#e0e0e0}

/* Keep semantic grid colours while the surrounding canvas stays black. */
html[data-theme=dark] #tlRunning{border-top-color:#2563eb!important}
html[data-theme=dark] #tlOverdue{border-top-color:#eab308!important}
html[data-theme=dark] #deliveredActivities{border-top-color:#22a06b!important}
html[data-theme=dark] #tlBacklog{border-top-color:#94a3b8!important}
html[data-theme=dark] #tlRunningTitle{color:#9fc5ff!important}
html[data-theme=dark] #tlOverdueTitle{color:#ffe08a!important}
html[data-theme=dark] #deliveredActivitiesTitle{color:#8de0ad!important}
html[data-theme=dark] #tlBacklogTitle{color:#bbcdf0!important}
html[data-theme=dark] #tlRunning th{background:#2448a5!important}
html[data-theme=dark] #tlOverdue th{background:#b42318!important}
html[data-theme=dark] #deliveredActivities th{background:#12623f!important}
html[data-theme=dark] #tlBacklog th{background:#173d75!important}
html[data-theme=dark] .tl-track .tl-bar{background:#e8edf2!important;color:#111!important;border-color:#94a3b8!important}
html[data-theme=dark] .tl-track .tl-bar.tl-running{background:#dfeaff!important;border-color:#819edc!important}
html[data-theme=dark] .tl-track .tl-bar.tl-final{background:#ddf5e8!important;border-color:#81b99b!important}
html[data-theme=dark] .tl-track .tl-bar.tl-blocked{background:#fff0c2!important;border-color:#c9a953!important}
/* Light balloons and planning cards must never inherit light text. */
html[data-theme=dark] :is(.project-count,.delivery-group h3 span,.pill,.tag,.badge,.tl-status,.phase,.kpi){color:#111!important}
html[data-theme=dark] :is(.project-count,.delivery-group h3 span,.pill,.tag,.badge,.tl-status,.phase,.kpi) :is(h3,p,li,ul,div,span,strong,b,small,.sub,.n,.l){color:#111!important}
html[data-theme=dark] .tl-summary [data-summary-tone],html[data-theme=dark] .tl-summary [data-summary-tone] :is(a,strong,span,small){color:#111!important}
html[data-theme=dark] .phase{background:#f5f5f5!important;border-color:#bdbdbd!important}
/* Buttons use neutral raised surfaces; selected tabs keep a clear orange accent. */
html[data-theme=dark] button:not(.tl-bar):not(.primary):not([data-tl-open]):not(.backlog-open){background:#242424!important;color:#f2f2f2!important;border-color:#626262!important}
html[data-theme=dark] button:not(:disabled):hover{filter:brightness(1.15)}
html[data-theme=dark] .tabs button[aria-selected=true],html[data-theme=dark] .tl-period button[aria-pressed=true]{background:#ff9b46!important;color:#111!important;border-color:#ff9b46!important;box-shadow:inset 0 -3px #e66c00}
html[data-theme=dark] .tabs button:focus-visible{outline:2px solid #ffc58c;outline-offset:2px}
html[data-theme=dark] .owners-chip button{background:transparent!important;color:#ededed!important}
/* Loading and login are part of the active theme during every page transition. */
html[data-theme=dark] :is(.screen-loading,.auth-screen){background:#000!important;color:#ededed!important}
html[data-theme=dark] :is(.screen-loading-card,.auth-card){background:#111!important;color:#ededed!important;border-color:#444!important;box-shadow:none!important}
html[data-theme=dark] .screen-loading :is(p,small){color:#ddd!important}
html[data-theme=dark] .screen-loading-spinner{border-color:#444;border-top-color:#ff8b29}
html[data-theme=dark] #appShell .tabs button[aria-selected=true],html[data-theme=dark] #tlWeek[aria-pressed=true],html[data-theme=dark] #tlMonth[aria-pressed=true]{background:#ff9b46!important;color:#111!important;border-color:#ff9b46!important}
/* Risk cards match the light planning cards; severity borders stay unchanged. */
html[data-theme=dark] .riskgrid .risk{background:#f5f5f5!important;color:#111!important}
html[data-theme=dark] .riskgrid .risk :is(h3,p,small,span,strong){color:#111!important}
/* Home titles stay readable at rest and use black on orange when highlighted. */
html[data-theme=dark] .home-card b{color:#ededed!important}
html[data-theme=dark] .home-card>span{color:#ff9b46!important}
html[data-theme=dark] .home-card:is(:hover,:focus-visible){background:#ff7700!important;border-color:#ff7700!important;color:#111!important}
html[data-theme=dark] .home-card:is(:hover,:focus-visible) :is(b,span,p){color:#111!important}
