/* Complete SOC daylight theme audit.
 * Loaded after every feature stylesheet so legacy dark-only modules cannot
 * leak pale text, dark form controls or low-contrast semantic colours into
 * the light appearance. The branded header/sidebar and the emergency alarm
 * intentionally retain their dark operational treatment.
 */

html[data-theme="light"] {
    --day-surface: #ffffff;
    --day-surface-soft: #f2f6f8;
    --day-surface-strong: #e7eef3;
    --day-border: #c4d2dc;
    --day-border-strong: #9db2c1;
    --day-text: #102536;
    --day-muted: #455f72;
    --day-accent: #5d4800;
    --day-info: #075f98;
    --day-success: #006b45;
    --day-warning: #884600;
    --day-error: #a32635;
    --day-focus: #006fa6;
}

/* Every real SOC route, including pages hidden from the public demo. */
html[data-theme="light"] :where(
    .dashboard-layout,
    .workspace-page,
    .weather-page,
    .messaging-shell,
    .medevac-page,
    .intelligence-page,
    .history-page,
    .downloads-page,
    .asset-page,
    .access-shell,
    .mqtt-admin-shell,
    .diagnostics-shell,
    .page-access-shell,
    .field-experiment-shell
) {
    color: var(--day-text);
}

html[data-theme="light"] .scc-content :where(input, select, textarea) {
    border-color: var(--day-border-strong);
    color: var(--day-text);
    background: var(--day-surface);
}

html[data-theme="light"] .scc-content :where(input, select, textarea):hover:not(:disabled) {
    border-color: #7895a8;
}

html[data-theme="light"] .scc-content :where(input, select, textarea):focus-visible {
    border-color: var(--day-focus);
    box-shadow: 0 0 0 3px rgba(0, 111, 166, .18);
}

html[data-theme="light"] .scc-content :where(input, select, textarea):disabled {
    border-color: #c9d4dc;
    color: #5d7180;
    background: #e5ebef;
    opacity: 1;
}

html[data-theme="light"] .scc-content :where(input, textarea)::placeholder {
    color: #6b7f8e;
    opacity: 1;
}

html[data-theme="light"] .scc-content :where(input[type="checkbox"], input[type="radio"]) {
    accent-color: #0876c9;
}

html[data-theme="light"] .scc-content button:disabled {
    color: #647886;
    filter: grayscale(.18);
    opacity: .62;
}

/* Access management and associations. */
html[data-theme="light"] .access-heading {
    border-bottom-color: rgba(112, 87, 0, .28);
}

html[data-theme="light"] :where(.access-card, .access-metric) {
    border-color: var(--day-border);
    color: var(--day-text);
    background: linear-gradient(155deg, #fff, #f3f7f9);
}

html[data-theme="light"] .access-card-icon {
    background: color-mix(in srgb, var(--access-section-accent, #806600) 12%, #fff);
}

html[data-theme="light"] :where(
    .access-heading p,
    .access-card-heading p,
    .access-danger-zone p,
    .access-metric span,
    .access-form label,
    .access-user-copy small,
    .access-user-meta em,
    .access-facts dt,
    .access-empty,
    .access-form small,
    .access-local-clients__heading p,
    .access-local-client__copy span,
    .access-local-client__copy small,
    .access-association span
) { color: var(--day-muted); }

html[data-theme="light"] :where(
    .access-card-heading h2,
    .access-detail-header h2,
    .access-form h3,
    .access-danger-zone h3,
    .access-local-clients__heading h3,
    .access-local-client__copy strong,
    .access-association strong
) { color: var(--day-text); }

html[data-theme="light"] :where(.access-user, .access-facts div, .access-local-client, .access-association, .access-association-form) {
    border-color: var(--day-border);
    color: var(--day-text);
    background: var(--day-surface-soft);
}

html[data-theme="light"] .access-user:hover,
html[data-theme="light"] .access-user.is-selected,
html[data-theme="light"] .access-association:hover {
    border-color: #a9913c;
    background: #fff8dc;
}

html[data-theme="light"] .access-avatar {
    border-color: #9cc5dc;
    color: var(--day-info);
    background: #e8f4fa;
}

html[data-theme="light"] .access-danger-zone {
    border-color: rgba(163, 38, 53, .3);
    background: #fff4f4;
}

html[data-theme="light"] .access-local-clients__count {
    border-color: rgba(7, 95, 152, .4);
    color: var(--day-info);
    background: #e8f4fa;
}

html[data-theme="light"] .access-status--active { color: var(--day-success); }
html[data-theme="light"] .access-status--disabled { color: var(--day-warning); }
html[data-theme="light"] .access-alert--danger { border-color: rgba(163,38,53,.35); color: var(--day-error); background: #fff0f1; }

html[data-theme="light"] .access-button--secondary { border-color: rgba(7,95,152,.4); color: var(--day-info); background: #eaf5fb; }
html[data-theme="light"] .access-button--warning { border-color: rgba(136,70,0,.4); color: var(--day-warning); background: #fff3e6; }
html[data-theme="light"] .access-button--danger { border-color: rgba(163,38,53,.4); color: var(--day-error); background: #fff0f1; }
html[data-theme="light"] .access-button--ghost { border-color: var(--day-border); color: #29465a; background: transparent; }

/* MQTT configuration: SUPERADMIN-only production page. */
html[data-theme="light"] :where(.mqtt-admin-metric, .mqtt-admin-card) {
    border-color: var(--day-border);
    color: var(--day-text);
    background: linear-gradient(155deg, #fff, #f3f7f9);
}

html[data-theme="light"] .mqtt-admin-card > header > span {
    background: color-mix(in srgb, var(--card-accent, #0876c9) 12%, #fff);
}

html[data-theme="light"] :where(
    .mqtt-admin-heading p,
    .mqtt-admin-card header p,
    .mqtt-admin-metric span,
    .mqtt-admin-field,
    .mqtt-admin-channel-status,
    .mqtt-admin-facts dt,
    .mqtt-admin-steps,
    .mqtt-admin-table th,
    .mqtt-admin-table td small,
    .mqtt-admin-empty,
    .mqtt-admin-feedback
) { color: var(--day-muted); }

html[data-theme="light"] :where(.mqtt-admin-card h2, .mqtt-admin-facts dd, .mqtt-admin-table td) { color: var(--day-text); }

html[data-theme="light"] .mqtt-admin-channel-settings {
    border-color: rgba(112, 87, 0, .32);
    background: #fff9e5;
}

html[data-theme="light"] :where(.mqtt-admin-facts div, .mqtt-admin-steps) {
    border-color: var(--day-border);
    background: var(--day-surface-soft);
}

html[data-theme="light"] :where(.mqtt-admin-facts code, .mqtt-admin-table code, .mqtt-admin-channel-status code) { color: var(--day-info); }
html[data-theme="light"] .mqtt-admin-warning { color: var(--day-warning); }
html[data-theme="light"] .mqtt-admin-state.is-online { color: var(--day-success); }
html[data-theme="light"] .mqtt-admin-state.is-offline { color: var(--day-warning); }
html[data-theme="light"] .mqtt-admin-feedback[data-kind="success"] { color: var(--day-success); }
html[data-theme="light"] .mqtt-admin-feedback[data-kind="warning"] { color: var(--day-warning); }
html[data-theme="light"] .mqtt-admin-feedback[data-kind="error"] { color: var(--day-error); }
html[data-theme="light"] .mqtt-admin-alert { border-color: rgba(163,38,53,.35); color: var(--day-error); background: #fff0f1; }

/* System diagnostics: SUPERADMIN-only production page. */
html[data-theme="light"] :where(.diagnostics-summary article, .diagnostics-card, .diagnostics-check) {
    border-color: var(--day-border);
    color: var(--day-text);
    background: var(--day-surface);
}

html[data-theme="light"] .diagnostics-check { background: var(--day-surface-soft); }

html[data-theme="light"] :where(
    .diagnostics-heading p,
    .diagnostics-card header p,
    .diagnostics-summary span,
    .diagnostics-check small,
    .diagnostics-card th,
    .diagnostics-feedback,
    .diagnostics-field-controls label,
    .diagnostics-field-result > header span
) { color: var(--day-muted); }

html[data-theme="light"] :where(.diagnostics-card h2, .diagnostics-summary strong, .diagnostics-field-result > header strong) { color: var(--day-text); }
html[data-theme="light"] .diagnostics-card code { color: var(--day-info); }
html[data-theme="light"] .diagnostics-shell .is-ok { color: var(--day-success) !important; }
html[data-theme="light"] .diagnostics-shell .is-warning { color: var(--day-warning) !important; }
html[data-theme="light"] .diagnostics-shell .is-error { color: var(--day-error) !important; }
html[data-theme="light"] .diagnostics-alert { border-color: rgba(163,38,53,.35); color: var(--day-error); background: #fff0f1; }

/* Page administration and LAB Field. */
html[data-theme="light"] :where(.page-access-heading, .field-experiment-heading) {
    border-bottom-color: var(--day-border);
}

html[data-theme="light"] :where(.page-access-notice, .page-access-card, .field-experiment-card, .field-runtime-notice) {
    border-color: var(--day-border);
    color: var(--day-text);
    background: var(--day-surface);
}

html[data-theme="light"] :where(.page-access-notice, .field-runtime-notice) { background: #fff9e5; }

html[data-theme="light"] :where(.page-access-option, .field-experiment-switch, .field-experiment-team) {
    border-color: var(--day-border);
    color: var(--day-text);
    background: var(--day-surface-soft);
}

html[data-theme="light"] .page-access-option:has(input:checked),
html[data-theme="light"] .field-experiment-switch:has(input:checked),
html[data-theme="light"] .field-experiment-team:has(input:checked) {
    border-color: #a9913c;
    color: var(--day-accent);
    background: #fff8dc;
}

html[data-theme="light"] :where(
    .page-access-heading p,
    .page-access-card p,
    .page-access-notice span,
    .page-access-option small,
    .field-experiment-heading p,
    .field-experiment-card p,
    .field-experiment-grid label small,
    .field-experiment-team-section small,
    .field-experiment-team small,
    .field-experiment-audit
) { color: var(--day-muted); }

html[data-theme="light"] .field-runtime-notice strong { color: var(--day-info); }
html[data-theme="light"] .field-experiment-actions button.secondary { border-color: rgba(7,95,152,.42); color: var(--day-info); background: #eaf5fb; }
html[data-theme="light"] :where(.page-access-feedback[data-state="success"], .field-experiment-actions p[data-state="success"]) { color: var(--day-success); }
html[data-theme="light"] :where(.page-access-feedback[data-state="error"], .page-access-alert, .field-experiment-actions p[data-state="error"], .field-experiment-alert) { color: var(--day-error); }

/* Asset catalogue, assignment and Field enrolment dialogs. */
html[data-theme="light"] :where(.device-toolbar label, .asset-assignment-controls label, .field-quick-pairing__controls label, .asset-form-grid label) { color: var(--day-muted); }
html[data-theme="light"] :where(.asset-assignment-list article, .field-quick-pairing) { border-color: var(--day-border); color: var(--day-text); background: var(--day-surface-soft); }
html[data-theme="light"] .field-quick-pairing__copy strong { color: var(--day-accent); }

html[data-theme="light"] :where(.asset-status--available, .asset-status--returned, .asset-status--online) { border-color: rgba(0,107,69,.4); color: var(--day-success); background: #e9f7f1; }
html[data-theme="light"] :where(.asset-status--assigned, .asset-status--deployed, .asset-status--operating, .asset-status--maintenance) { border-color: rgba(136,70,0,.38); color: var(--day-warning); background: #fff3e6; }
html[data-theme="light"] :where(.asset-status--unavailable, .asset-status--offline, .asset-status--retired, .asset-status--archived) { border-color: #b8c6d0; color: #435a6d; background: #edf2f5; }
html[data-theme="light"] .asset-shared { border-color: rgba(7,95,152,.36); color: var(--day-info); background: #eaf5fb; }

html[data-theme="light"] .asset-dialog header > button { border-color: var(--day-border); color: var(--day-text); background: var(--day-surface-soft); }
html[data-theme="light"] .asset-share { border-color: rgba(112,87,0,.3); background: #fff9e5; }
html[data-theme="light"] .asset-confirm-dialog p { color: var(--day-muted); }
html[data-theme="light"] .field-enrollment-code { border-color: #a9913c; color: var(--day-accent); background: #fff8dc; }
html[data-theme="light"] .field-enrollment-link { color: var(--day-info); }
html[data-theme="light"] [data-assets-feedback][data-state="success"] { color: var(--day-success); }
html[data-theme="light"] [data-assets-feedback][data-state="error"] { color: var(--day-error); }

/* Messaging. Emergency alarms stay dark/red by design. */
html[data-theme="light"] .messaging-heading { border-bottom-color: var(--day-border); }
html[data-theme="light"] .messaging-heading span { color: var(--day-accent); }
html[data-theme="light"] :where(.messaging-compose__footer small, .messaging-empty, .messaging-feedback) { color: var(--day-muted); }
html[data-theme="light"] .messaging-message header span { color: var(--day-success); }
html[data-theme="light"] .messaging-message.is-outbound header span { color: var(--day-accent); }
html[data-theme="light"] .messaging-message.is-transit header span { color: var(--day-info); }
html[data-theme="light"] .messaging-message.is-unread { border-color: #9b7b00; box-shadow: 0 0 0 2px rgba(155,123,0,.17); }
html[data-theme="light"] .messaging-feedback[data-kind="success"] { color: var(--day-success); }
html[data-theme="light"] .messaging-feedback[data-kind="warning"] { color: var(--day-warning); }
html[data-theme="light"] .messaging-feedback[data-kind="error"] { color: var(--day-error); }

/* MEDEVAC reports. */
html[data-theme="light"] .medevac-page-header { border-color: #c6b052; background: linear-gradient(135deg, #fff8dc, #fff); }
html[data-theme="light"] .medevac-toolbar { border-color: var(--day-border); background: var(--day-surface); }
html[data-theme="light"] .medevac-card > header { background: #edf3f7; }
html[data-theme="light"] .medevac-team,
html[data-theme="light"] .medevac-kicker,
html[data-theme="light"] .medevac-score > strong,
html[data-theme="light"] .medevac-march h3,
html[data-theme="light"] .medevac-status-history > strong { color: var(--day-accent) !important; }

html[data-theme="light"] :where(
    .medevac-current-operation span,
    .medevac-toolbar small,
    .medevac-finding span,
    .medevac-profile dt,
    .medevac-score small,
    .medevac-march dt,
    .medevac-empty-step,
    .medevac-notes,
    .medevac-status-history li small,
    .medevac-empty
) { color: var(--day-muted); }

html[data-theme="light"] :where(.medevac-finding div, .medevac-profile, .medevac-score, .medevac-march section, .medevac-status-panel, .medevac-status-history li) {
    border-color: var(--day-border);
    color: var(--day-text);
    background: var(--day-surface-soft);
}

html[data-theme="light"] .medevac-profile > strong { color: var(--day-info); }
html[data-theme="light"] .medevac-priority { color: var(--day-warning); background: #fff3e6; }
html[data-theme="light"] .priority-rosso .medevac-priority { color: var(--day-error); background: #fff0f1; }
html[data-theme="light"] .priority-verde .medevac-priority { color: var(--day-success); background: #e9f7f1; }
html[data-theme="light"] .medevac-status { border-color: rgba(7,95,152,.38); color: var(--day-info); background: #eaf5fb; }
html[data-theme="light"] .medevac-status.status-extracted { border-color: rgba(0,107,69,.38); color: var(--day-success); background: #e9f7f1; }
html[data-theme="light"] .medevac-status.status-handed_over { border-color: #006b45; color: #fff; background: #087a50; }
html[data-theme="light"] .medevac-status-actions button { border-color: #a9913c; color: var(--day-accent); background: #fff8dc; }
html[data-theme="light"] .medevac-status-actions button:hover { border-color: #665000; color: #14202a; background: #e6bf16; }
html[data-theme="light"] .medevac-status-complete { color: var(--day-success); }

/* Intelligence catalogue, acquisition and layer controls. */
html[data-theme="light"] :where(
    .intelligence-summary > div,
    .intelligence-filter,
    .intelligence-profile-card,
    .intelligence-profile-editor,
    .intelligence-operation-source-editor,
    .intelligence-source-card,
    .intelligence-source-card__details,
    .intelligence-acquisition-toolbar,
    .intelligence-acquisition-source,
    .intelligence-observation,
    .intelligence-map-controller article,
    .intelligence-radar-observation,
    .intelligence-monitor,
    .intelligence-snapshot-toolbar,
    .intelligence-snapshot-card,
    .intelligence-empty
) {
    border-color: var(--day-border);
    color: var(--day-text);
    background: var(--day-surface);
}

html[data-theme="light"] :where(
    .intelligence-operation-source,
    .intelligence-source-card__facts div,
    .intelligence-source-card__details > div,
    .intelligence-map-controller article,
    .intelligence-radar-observation,
    .intelligence-monitor,
    .intelligence-snapshot-card
) { background: var(--day-surface-soft); }

html[data-theme="light"] :where(
    .intelligence-summary span,
    .intelligence-operation-profile p,
    .intelligence-profile-card p,
    .intelligence-profile-card small,
    .intelligence-profile-editor header p,
    .intelligence-profile-sources small,
    .intelligence-operation-source-editor > header p,
    .intelligence-operation-source__identity small,
    .intelligence-operation-source__opacity small,
    .intelligence-source-card__provider,
    .intelligence-source-card dt,
    .intelligence-acquisition-toolbar small,
    .intelligence-observation p,
    .intelligence-observation small,
    .intelligence-radar-observation p,
    .intelligence-radar-observation small,
    .intelligence-monitor span,
    .intelligence-snapshot-toolbar span,
    .intelligence-snapshot-card p,
    .intelligence-snapshot-card small
) { color: var(--day-muted); }

html[data-theme="light"] :where(
    .intelligence-source-card h3,
    .intelligence-source-card dd,
    .intelligence-source-card__details summary,
    .intelligence-map-source-toggle strong,
    .intelligence-snapshot-toolbar strong
) { color: var(--day-text); }

html[data-theme="light"] .intelligence-filter:hover,
html[data-theme="light"] .intelligence-filter.is-active,
html[data-theme="light"] .intelligence-profile-card.is-active,
html[data-theme="light"] .intelligence-operation-source.is-active {
    border-color: #a9913c;
    color: var(--day-accent);
    background: #fff8dc;
}

html[data-theme="light"] .intelligence-status.is-degraded { color: var(--day-warning); background: #fff3e6; }
html[data-theme="light"] .intelligence-status.is-unavailable { color: var(--day-error); background: #fff0f1; }
html[data-theme="light"] :where(.intelligence-acquisition-error, .intelligence-map-empty.is-error, .intelligence-map-controller .is-error, .intelligence-empty.is-error, .intelligence-feedback.is-error) { color: var(--day-error); }
html[data-theme="light"] .intelligence-feedback { color: var(--day-success); }

/* Weather panels and charts. */
html[data-theme="light"] :where(.weather-metrics > div, .weather-temperature-chart, .weather-hour, .weather-alert-scope li, .weather-alert) {
    border-color: var(--day-border);
    color: var(--day-text);
    background: var(--day-surface-soft);
}

html[data-theme="light"] .weather-temperature-chart line { stroke: #c8d5de; }
html[data-theme="light"] .weather-alert-scope { border-color: #a9c9db; background: #edf8fd; }
html[data-theme="light"] .weather-alert-scope.is-unavailable { border-color: rgba(136,70,0,.35); background: #fff3e6; }
html[data-theme="light"] .weather-alert a { color: var(--day-info); }

/* Map editor, feature forms and sector dialog. */
html[data-theme="light"] :where(.workspace-feature-tool-group, .workspace-feature-form, .workspace-feature-selection, .workspace-feature-list-heading) {
    border-color: var(--day-border);
    color: var(--day-text);
    background: var(--day-surface-soft);
}

html[data-theme="light"] :where(.workspace-feature-categories button, .workspace-feature-selection button, .workspace-feature-actions button) {
    border-color: var(--day-border-strong);
    color: #173348;
    background: #edf3f7;
}

html[data-theme="light"] .workspace-feature-categories button:hover,
html[data-theme="light"] .workspace-feature-categories button:focus-visible,
html[data-theme="light"] .workspace-feature-categories button.is-selected {
    border-color: #806600;
    color: var(--day-accent);
    background: #fff8dc;
}

html[data-theme="light"] .workspace-feature-actions button.is-danger { border-color: rgba(163,38,53,.4); color: var(--day-error); background: #fff0f1; }
html[data-theme="light"] .workspace-feature-status[data-state="drawing"],
html[data-theme="light"] .workspace-feature-status[data-state="working"] { color: var(--day-info); }
html[data-theme="light"] .workspace-feature-status[data-state="error"] { color: var(--day-error); }

html[data-theme="light"] .workspace-sector-dialog {
    border-color: #a9913c;
    color: var(--day-text);
    background: var(--day-surface);
    box-shadow: 0 24px 70px rgba(24,54,76,.24);
}

html[data-theme="light"] .workspace-sector-dialog__heading span,
html[data-theme="light"] .workspace-sector-dialog label { color: var(--day-muted); }

/* Operation start/edit/end forms and team command dialogs. */
html[data-theme="light"] :where(.operation-dialog__context, .operation-end-dialog__message, .operation-end-dialog__notice, .operation-location-selector, .operation-location-picker-value, .operation-node-selector, .operation-test-flag) {
    border-color: var(--day-border);
    color: var(--day-text);
    background: var(--day-surface-soft);
}

html[data-theme="light"] :where(.operation-end-dialog__heading h2, .operation-end-dialog__message strong, .operation-test-flag strong, .operation-node-option strong) { color: var(--day-text); }
html[data-theme="light"] :where(.operation-end-dialog__heading small, .operation-form__hint, .operation-test-flag small, .operation-node-selector > p, .operation-node-option small, .operation-node-list__empty) { color: var(--day-muted); }
html[data-theme="light"] .operation-end-dialog__notice { border-color: rgba(136,70,0,.35); color: var(--day-warning); background: #fff3e6; }
html[data-theme="light"] .operation-end-dialog__feedback { border-color: rgba(163,38,53,.4); color: var(--day-error); background: #fff0f1; box-shadow: inset 3px 0 var(--day-error); }
html[data-theme="light"] .operation-end-dialog__icon { border-color: rgba(136,70,0,.4); color: var(--day-warning); background: #fff3e6; box-shadow: none; }
html[data-theme="light"] .operation-form__primary { background: var(--day-surface); }
html[data-theme="light"] .operation-location-selector legend,
html[data-theme="light"] .operation-location-picker-value strong { color: var(--day-info); }
html[data-theme="light"] .operation-location-picker-map { border-color: #9db9ca; background: #e6edf2; }
html[data-theme="light"] .operation-form .operation-action--start { border-color: #665000; color: #14202a; background: linear-gradient(135deg,#f2d453,#d9b400); }
html[data-theme="light"] .operation-end-dialog__confirm { border-color: #954b00; color: #fff; background: #b55b00; }

html[data-theme="light"] :where(.team-command-dialog, .team-command-feedback-dialog) {
    border-color: #a9913c;
    color: var(--day-text);
    background: var(--day-surface);
    box-shadow: 0 24px 70px rgba(24,54,76,.24);
}

html[data-theme="light"] :where(.team-command-dialog h2, .team-command-feedback-dialog h2, .team-command-dialog strong, .team-command-feedback-dialog strong) { color: var(--day-text); }

/* Dashboard metrics, resource cards and TEAM telemetry/configuration. */
html[data-theme="light"] :where(.command-header h2, .metric-value, .resource-item strong, .resource-number) { color: var(--day-text); }
html[data-theme="light"] .command-header { border-bottom-color: var(--day-border); }
html[data-theme="light"] .resource-item { border-color: var(--day-border); color: var(--day-text); background: var(--day-surface-soft); }
html[data-theme="light"] :where(.team-unit__source label, .team-unit__dog-node label) { color: var(--day-muted); }
html[data-theme="light"] :where(.team-unit__source select, .team-unit__dog-node select, .team-unit__custom-name) { border-color: var(--day-border-strong); color: var(--day-text); background: var(--day-surface); }
html[data-theme="light"] .team-telemetry-item__heading span { color: var(--day-success); }
html[data-theme="light"] .team-telemetry-item__battery { border-color: var(--day-border); background: #dfe7ec; }
html[data-theme="light"] .team-telemetry-item__battery span { background: var(--day-success); }
html[data-theme="light"] .team-telemetry-item.is-warning .team-telemetry-item__heading span { color: var(--day-warning); }
html[data-theme="light"] .team-telemetry-item.is-warning .team-telemetry-item__battery span { background: #a96300; }
html[data-theme="light"] .team-telemetry-item.is-critical .team-telemetry-item__heading span { color: var(--day-error); }
html[data-theme="light"] .team-telemetry-item.is-critical .team-telemetry-item__battery span { background: var(--day-error); }
html[data-theme="light"] .team-field-enrollment-dialog__code { border-color: #a9913c; color: var(--day-accent); background: #fff8dc; }

/* Archive state badges and cartographic item summaries. */
html[data-theme="light"] .workspace-status { border-color: var(--day-border); color: var(--day-muted); background: #edf3f7; }
html[data-theme="light"] .workspace-status.is-active { border-color: rgba(0,107,69,.38); color: var(--day-success); background: #e9f7f1; }
html[data-theme="light"] .workspace-status.is-test { border-color: rgba(136,70,0,.4); color: var(--day-warning); background: #fff3e6; }
html[data-theme="light"] .workspace-status.is-locked { border-color: rgba(163,38,53,.4); color: var(--day-error); background: #fff0f1; }
html[data-theme="light"] .workspace-test-label { color: var(--day-warning); }
html[data-theme="light"] .workspace-lock-label { color: var(--day-error); }
html[data-theme="light"] .workspace-toolbar { border-color: var(--day-border); background: var(--day-surface-soft); }
html[data-theme="light"] .workspace-toolbar label { color: var(--day-muted); }
html[data-theme="light"] .workspace-feature-card { border-color: #c8b86e; color: var(--day-text); background: linear-gradient(145deg,#fff9e5,var(--day-surface-soft)); }
html[data-theme="light"] .workspace-feature-card strong,
html[data-theme="light"] .workspace-feature-card dd { color: var(--day-text); }

/* Intelligence configuration details and observation markers. */
html[data-theme="light"] :where(.intelligence-operation-profile label, .intelligence-profile-fields label, .intelligence-source-config label) { color: var(--day-muted); }
html[data-theme="light"] :where(.intelligence-operation-profile button, .intelligence-profile-editor > button, .intelligence-source-config button, .intelligence-map-controller article > button) { border-color: #a9913c; color: var(--day-accent); background: #fff8dc; }
html[data-theme="light"] .intelligence-source-caution { border-color: rgba(136,70,0,.35); color: var(--day-warning); background: #fff3e6; }
html[data-theme="light"] .intelligence-observation__magnitude { border-color: var(--day-border); color: var(--day-text); background: #dce7ed; }
html[data-theme="light"] .intelligence-observation--hotspot .intelligence-observation__magnitude { color: #fff; background: #b63a12; }
html[data-theme="light"] .intelligence-observation--copernicus .intelligence-observation__magnitude { color: #fff; background: #08758d; }
html[data-theme="light"] .intelligence-map-legend--copernicus { border-color: #075f98; background: #19a8c6; }

/* Remaining semantic controls. */
html[data-theme="light"] .asset-dialog-feedback { color: var(--day-error); }
html[data-theme="light"] .field-experiment-badge { border-color: #a9913c; color: var(--day-accent); background: #fff8dc; }
html[data-theme="light"] .field-experiment-card.is-enabled { border-color: #a9913c; box-shadow: inset 4px 0 #9b7b00; }
html[data-theme="light"] .page-access-card__code { color: var(--day-accent); }

/* Consistent status, empty and feedback surfaces across remaining routes. */
html[data-theme="light"] :where(.workspace-feedback, .downloads-feedback, .downloads-empty, .history-empty, .mqtt-admin-empty, .diagnostics-feedback, .intelligence-empty) {
    color: var(--day-muted);
}

html[data-theme="light"] :where(.workspace-feedback.is-error, .downloads-feedback.is-error, .downloads-error, .history-feedback-error) { color: var(--day-error); }

html[data-theme="light"] :where(.history-feedback, .downloads-feedback:not(.is-error)) { color: var(--day-success); }

/* The dark-theme map frame assigns an explicit light colour to every nested
 * span.  Layer names therefore need their own colour instead of relying on
 * the label's inherited value. */
html[data-theme="light"] .workspace-map-overlay-menu__content .workspace-layer-list label > span {
    color: #173348;
    font-weight: 650;
}

@media (prefers-contrast: more) {
    html[data-theme="light"] {
        --day-border: #91a6b5;
        --day-border-strong: #718b9d;
        --day-muted: #314c60;
    }

    html[data-theme="light"] :where(.access-card, .mqtt-admin-card, .diagnostics-card, .medevac-card, .intelligence-source-card) {
        box-shadow: none;
    }
}
