/*
 * OnlyDrive LIGHT 2026 — Enterprise semantic compatibility layer
 * Loaded last on authenticated product pages. Every rule is light-scoped so
 * the established dark visual system remains byte-for-byte and behaviorally
 * unchanged.
 */

html[data-theme-mode="light"],
html[data-theme="light"] {
  --bg: var(--od-bg-primary);
  --bg0: var(--od-bg-primary);
  --bg1: var(--od-bg-secondary);
  --panel: var(--od-surface-1);
  --panel2: var(--od-surface-2);
  --card: var(--od-surface-1);
  --card2: var(--od-surface-2);
  --line: var(--od-border-subtle);
  --border: var(--od-border-subtle);
  --border2: var(--od-border-default);
  --text: var(--od-text-primary);
  --muted: var(--od-text-secondary);
  --muted2: var(--od-text-muted);
  --blue: var(--od-accent-strong);
  --cyan: var(--od-accent);
  --green: var(--od-success);
  --amber: var(--od-warning);
  --red: var(--od-danger);
  --danger: var(--od-danger);
  --success: var(--od-success);
  --shadow: var(--od-shadow-md);
  --shadow-soft: var(--od-shadow-sm);

  --admin-canvas: var(--od-bg-primary);
  --admin-surface-data: var(--od-surface-1);
  --admin-surface-raised: var(--od-surface-2);
  --admin-surface-floating: var(--od-surface-overlay);
  --admin-border: var(--od-border-subtle);
  --admin-border-active: var(--od-accent);
  --admin-text-primary: var(--od-text-primary);
  --admin-text-secondary: var(--od-text-secondary);
  --admin-text-muted: var(--od-text-muted);
  --admin-accent: var(--od-accent);
  --admin-live: var(--od-accent);
  --admin-warning: var(--od-warning);
  --admin-danger: var(--od-danger);
  --admin-success: var(--od-success);
  --radius-control: var(--od-radius-md);
  --radius-ticket: var(--od-radius-lg);
  --radius-sheet: var(--od-radius-xl);
  --shadow-ticket: var(--od-shadow-sm);
  --shadow-floating: var(--od-shadow-lg);

  --od-admin-text: var(--od-text-primary);
  --od-admin-muted: var(--od-text-secondary);
  --od-admin-dim: var(--od-text-muted);
  --od-admin-border: var(--od-border-subtle);
  --od-admin-border-strong: var(--od-border-default);
  --od-admin-surface-0: var(--od-surface-1);
  --od-admin-surface-1: var(--od-surface-2);
  --od-admin-surface-2: var(--od-bg-tertiary);
  --od-admin-hero: var(--od-surface-1);
  --od-admin-header-bg: var(--od-surface-2);
  --od-admin-footer-bg: var(--od-surface-2);
  --od-admin-shadow: var(--od-shadow-lg);
  --od-admin-soft-shadow: var(--od-shadow-sm);
  --od-admin-chip-bg: var(--od-bg-tertiary);
  --od-admin-chip-text: var(--od-text-primary);
  --od-admin-table-hover: var(--od-surface-hover);
  --odx-bg-0: var(--od-surface-1);
  --odx-bg-1: var(--od-surface-2);
  --odx-bg-2: var(--od-bg-tertiary);
  --odx-line: var(--od-border-subtle);
  --odx-line-strong: var(--od-border-default);
  --odx-text: var(--od-text-primary);
  --odx-muted: var(--od-text-secondary);
  --odx-muted-2: var(--od-text-muted);
  --odx-glow: transparent;
}

html[data-theme-mode="light"] body,
html[data-theme="light"] body {
  color: var(--od-text-primary) !important;
  background: var(--od-bg-primary) !important;
  background-image: none !important;
}

html[data-theme-mode="light"] body::before,
html[data-theme-mode="light"] body::after,
html[data-theme="light"] body::before,
html[data-theme="light"] body::after {
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] :is(.ops-atmosphere, .cx-atmosphere),
html[data-theme="light"] :is(.ops-atmosphere, .cx-atmosphere) {
  display: none !important;
}

html[data-theme-mode="light"] body.od-theme-apple :is(button, a, input, select, textarea, .card, .panel, .tab),
html[data-theme="light"] body.od-theme-apple :is(button, a, input, select, textarea, .card, .panel, .tab) {
  transition-duration: var(--od-duration-fast);
  transition-property: background-color, border-color, box-shadow, color, opacity, transform;
  transition-timing-function: var(--od-ease);
}

html[data-theme-mode="light"] :is(h1, h2, h3, h4, h5, h6, strong, b, .title, .card-title, .value),
html[data-theme="light"] :is(h1, h2, h3, h4, h5, h6, strong, b, .title, .card-title, .value) {
  color: var(--od-text-primary);
}

html[data-theme-mode="light"] :is(.sub, .subtitle, .muted, .mini, .hint, .card-sub),
html[data-theme="light"] :is(.sub, .subtitle, .muted, .mini, .hint, .card-sub) {
  color: var(--od-text-secondary);
}

/* Shared product chrome */
html[data-theme-mode="light"] body.od-platform :is(.topbar, .customer-topbar, .top),
html[data-theme="light"] body.od-platform :is(.topbar, .customer-topbar, .top) {
  border-color: var(--od-border-subtle) !important;
  background: color-mix(in srgb, var(--od-bg-navigation) 92%, transparent) !important;
  box-shadow: var(--od-shadow-xs) !important;
}

html[data-theme-mode="light"] :is(.card, .panel, .modal, .inv-modal, .receipt, .form-card),
html[data-theme="light"] :is(.card, .panel, .modal, .inv-modal, .receipt, .form-card) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-1) !important;
  background-image: none !important;
  box-shadow: var(--od-shadow-sm) !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] :is(.card-head, .panel-head, .modal-head, .inv-head),
html[data-theme="light"] :is(.card-head, .panel-head, .modal-head, .inv-head) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-2) !important;
  background-image: none !important;
}

html[data-theme-mode="light"] :is(.modal-foot, .wizard-footer),
html[data-theme="light"] :is(.modal-foot, .wizard-footer) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-2) !important;
  background-image: none !important;
}

html[data-theme-mode="light"] :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
html[data-theme="light"] :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  border-color: var(--od-border-default) !important;
  background: var(--od-surface-1) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] :is(input, textarea)::placeholder,
html[data-theme="light"] :is(input, textarea)::placeholder {
  color: var(--od-text-muted) !important;
  opacity: 1;
}

html[data-theme-mode="light"] :is(input, select, textarea):focus,
html[data-theme-mode="light"] :is(input, select, textarea):focus-visible,
html[data-theme="light"] :is(input, select, textarea):focus,
html[data-theme="light"] :is(input, select, textarea):focus-visible {
  border-color: var(--od-accent) !important;
  box-shadow: var(--od-focus-ring) !important;
  outline: 0 !important;
}

html[data-theme-mode="light"] :is(.btn, button:not(.tab):not(.mc-primary-button):not(.osButton--primary)),
html[data-theme="light"] :is(.btn, button:not(.tab):not(.mc-primary-button):not(.osButton--primary)) {
  border-color: var(--od-border-default) !important;
  background: var(--od-surface-1) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] :is(.btn, button):not(:disabled):hover,
html[data-theme="light"] :is(.btn, button):not(:disabled):hover {
  border-color: var(--od-border-strong) !important;
  background: var(--od-surface-hover) !important;
  box-shadow: none !important;
  filter: none !important;
}

html[data-theme-mode="light"] :is(.btn.primary, .btn-green, button.primary, button.is-primary, .osButton--primary, .mc-primary-button),
html[data-theme="light"] :is(.btn.primary, .btn-green, button.primary, button.is-primary, .osButton--primary, .mc-primary-button) {
  border-color: var(--od-accent) !important;
  background: var(--od-accent) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--od-text-inverse) !important;
}

html[data-theme-mode="light"] :is(.btn.primary, .btn-green, button.primary, button.is-primary, .osButton--primary, .mc-primary-button):not(:disabled):hover,
html[data-theme="light"] :is(.btn.primary, .btn-green, button.primary, button.is-primary, .osButton--primary, .mc-primary-button):not(:disabled):hover {
  border-color: var(--od-accent-hover) !important;
  background: var(--od-accent-hover) !important;
}

html[data-theme-mode="light"] :is(button, .btn):disabled,
html[data-theme="light"] :is(button, .btn):disabled {
  border-color: var(--od-border-subtle) !important;
  color: var(--od-text-disabled) !important;
  opacity: .72;
}

html[data-theme-mode="light"] :is(.tabs, .regionTabs, .driverControlBar, .od-tab-dropdown-wrap),
html[data-theme="light"] :is(.tabs, .regionTabs, .driverControlBar, .od-tab-dropdown-wrap) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-bg-tertiary) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] :is(.tab, .rtab):not(.active),
html[data-theme="light"] :is(.tab, .rtab):not(.active) {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--od-text-secondary) !important;
}

html[data-theme-mode="light"] :is(.tab, .rtab).active,
html[data-theme="light"] :is(.tab, .rtab).active {
  border-color: var(--od-accent-border) !important;
  background: var(--od-surface-selected) !important;
  box-shadow: none !important;
  color: var(--od-accent-hover) !important;
}

html[data-theme-mode="light"] :is(table, .tableWrap, .table-wrap, .responsive-table),
html[data-theme="light"] :is(table, .tableWrap, .table-wrap, .responsive-table) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-1) !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] th,
html[data-theme="light"] th {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-bg-tertiary) !important;
  color: var(--od-text-secondary) !important;
}

html[data-theme-mode="light"] td,
html[data-theme="light"] td {
  border-color: var(--od-border-subtle) !important;
  background: transparent !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] tbody tr:hover,
html[data-theme="light"] tbody tr:hover {
  background: var(--od-surface-hover) !important;
}

html[data-theme-mode="light"] :is(.pill, .badge, .statusBadge, .od-pill, .mon-chip, .od-meta-chip),
html[data-theme="light"] :is(.pill, .badge, .statusBadge, .od-pill, .mon-chip, .od-meta-chip) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-bg-tertiary) !important;
  color: var(--od-text-secondary) !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] :is(.notice, .toast, .od-toast, .dropdown, [role="listbox"], [role="menu"]),
html[data-theme="light"] :is(.notice, .toast, .od-toast, .dropdown, [role="listbox"], [role="menu"]) {
  border-color: var(--od-border-default) !important;
  background: var(--od-surface-overlay) !important;
  background-image: none !important;
  box-shadow: var(--od-shadow-md) !important;
  color: var(--od-text-primary) !important;
}

/* Admin shell */
html[data-theme-mode="light"] body.od-admin-app,
html[data-theme="light"] body.od-admin-app {
  background: var(--od-bg-primary) !important;
  background-image: none !important;
}

html[data-theme-mode="light"] body.od-admin-app .admin-sections-navigation,
html[data-theme="light"] body.od-admin-app .admin-sections-navigation {
  border-right-color: var(--od-border-subtle) !important;
  background: var(--od-bg-navigation) !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] body.od-admin-app .admin-header,
html[data-theme="light"] body.od-admin-app .admin-header {
  border-bottom-color: var(--od-border-subtle) !important;
  background: color-mix(in srgb, var(--od-bg-secondary) 94%, transparent) !important;
  box-shadow: var(--od-shadow-xs) !important;
}

html[data-theme-mode="light"] body.od-admin-app :is(.od-nav-label, .od-sidebar-wordmark small, .od-admin-profile-text small),
html[data-theme="light"] body.od-admin-app :is(.od-nav-label, .od-sidebar-wordmark small, .od-admin-profile-text small) {
  color: var(--od-text-muted) !important;
}

html[data-theme-mode="light"] body.od-admin-app :is(.admin-sections-tabs .tab, .od-sidebar-link),
html[data-theme="light"] body.od-admin-app :is(.admin-sections-tabs .tab, .od-sidebar-link) {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--od-text-secondary) !important;
}

html[data-theme-mode="light"] body.od-admin-app :is(.admin-sections-tabs .tab, .od-sidebar-link):hover,
html[data-theme="light"] body.od-admin-app :is(.admin-sections-tabs .tab, .od-sidebar-link):hover {
  background: var(--od-surface-hover) !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] body.od-admin-app :is(.admin-sections-tabs .tab.active, .od-sidebar-link.active),
html[data-theme="light"] body.od-admin-app :is(.admin-sections-tabs .tab.active, .od-sidebar-link.active) {
  border-color: var(--od-accent-border) !important;
  background: var(--od-surface-selected) !important;
  color: var(--od-accent-hover) !important;
}

html[data-theme-mode="light"] body.od-admin-app :is(.od-sidebar-mark, .od-admin-avatar),
html[data-theme="light"] body.od-admin-app :is(.od-sidebar-mark, .od-admin-avatar) {
  border-color: var(--od-accent-border) !important;
  background: var(--od-accent-soft) !important;
  color: var(--od-accent-hover) !important;
}

html[data-theme-mode="light"] body.od-admin-app .od-sidebar-footer,
html[data-theme="light"] body.od-admin-app .od-sidebar-footer {
  border-color: var(--od-border-subtle) !important;
}

html[data-theme-mode="light"] body.od-admin-app .admin-workspace > .section,
html[data-theme="light"] body.od-admin-app .admin-workspace > .section {
  background: var(--od-bg-secondary);
}

html[data-theme-mode="light"] body.od-admin-app :is(.filters, .toolbar, .od-comm-filters),
html[data-theme="light"] body.od-admin-app :is(.filters, .toolbar, .od-comm-filters) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-bg-tertiary) !important;
}

html[data-theme-mode="light"] body.od-admin-app :is(.dashRegionTop, .admin-filter-row, .poHeroOrbPill, .ioOrbitalPill),
html[data-theme="light"] body.od-admin-app :is(.dashRegionTop, .admin-filter-row, .poHeroOrbPill, .ioOrbitalPill) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-bg-tertiary) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--od-text-secondary) !important;
}

html[data-theme-mode="light"] body.od-admin-app .od-customer-card,
html[data-theme="light"] body.od-admin-app .od-customer-card {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-1) !important;
  background-image: none !important;
  box-shadow: var(--od-shadow-sm) !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] body.od-admin-app .od-customer-card__metrics > div,
html[data-theme="light"] body.od-admin-app .od-customer-card__metrics > div {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-2) !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] body.od-admin-app #section-map :is(.pc-map-header, .pc-map-header > *, .pc-map-health, .mapToolbar, .pc-map-dock, .pc-map-popover, .pc-map-popover > *, .mapPanel, .mapContextPanel, .mapLegendPanel, .mapRouteLedger),
html[data-theme="light"] body.od-admin-app #section-map :is(.pc-map-header, .pc-map-header > *, .pc-map-health, .mapToolbar, .pc-map-dock, .pc-map-popover, .pc-map-popover > *, .mapPanel, .mapContextPanel, .mapLegendPanel, .mapRouteLedger) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-overlay) !important;
  background-image: none !important;
  box-shadow: var(--od-shadow-sm) !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] body.od-admin-app #section-map .pc-map-context-chips > span,
html[data-theme="light"] body.od-admin-app #section-map .pc-map-context-chips > span {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-2) !important;
  color: var(--od-text-secondary) !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] body.od-admin-app #section-map .mapRouteLedger .card-head,
html[data-theme="light"] body.od-admin-app #section-map .mapRouteLedger .card-head {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-2) !important;
}

/* Admin native modules */
html[data-theme-mode="light"] :is(.od-hero-bar, .mon-shell, .od-reset-card, .od-panel, .mon-panel, .mon-card, .mon-pulse-card, .mon-live-card, .mon-status-card, .mon-details, .od-kpi-card, .mon-kpi-card, .od-stat-card, .od-lead-card, .od-comm-panel, .od-inv-nativeCard, .od-profile-panel, .od-orders-lane, .od-order-panel),
html[data-theme="light"] :is(.od-hero-bar, .mon-shell, .od-reset-card, .od-panel, .mon-panel, .mon-card, .mon-pulse-card, .mon-live-card, .mon-status-card, .mon-details, .od-kpi-card, .mon-kpi-card, .od-stat-card, .od-lead-card, .od-comm-panel, .od-inv-nativeCard, .od-profile-panel, .od-orders-lane, .od-order-panel) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-1) !important;
  background-image: none !important;
  box-shadow: var(--od-shadow-sm) !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] :is(.mon-block, .mon-error-block, .mon-user-row, .mon-metric-row, .mon-feed-item, .od-inline-check, .od-copy-block, .od-empty, .od-comm-preview, .od-comm-historyItem),
html[data-theme="light"] :is(.mon-block, .mon-error-block, .mon-user-row, .mon-metric-row, .mon-feed-item, .od-inline-check, .od-copy-block, .od-empty, .od-comm-preview, .od-comm-historyItem) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-2) !important;
  color: var(--od-text-secondary) !important;
}

html[data-theme-mode="light"] :is(.od-hero-sub, .mon-sub, .od-muted, .mon-muted, .od-detail-sub, .od-lead-meta, .od-lead-line, .od-timeline-meta, .od-kpi-sub, .mon-kpi-sub, .mon-status-detail, .mon-user-time),
html[data-theme="light"] :is(.od-hero-sub, .mon-sub, .od-muted, .mon-muted, .od-detail-sub, .od-lead-meta, .od-lead-line, .od-timeline-meta, .od-kpi-sub, .mon-kpi-sub, .mon-status-detail, .mon-user-time) {
  color: var(--od-text-secondary) !important;
}

html[data-theme-mode="light"] .mon-track,
html[data-theme="light"] .mon-track,
html[data-theme-mode="light"] .mon-pulse-ring::before,
html[data-theme="light"] .mon-pulse-ring::before {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-bg-tertiary) !important;
}

/* Orders mission desk and inline inspector — critical LIGHT leak fix */
html[data-theme-mode="light"] :is(.mc-priority-rail, .mc-search, .mc-combobox-button, .mc-control-button, .mc-sort, .mc-region-popover, .mc-assignment-search),
html[data-theme="light"] :is(.mc-priority-rail, .mc-search, .mc-combobox-button, .mc-control-button, .mc-sort, .mc-region-popover, .mc-assignment-search) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-bg-tertiary) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] .mc-priority-rail button.is-active,
html[data-theme="light"] .mc-priority-rail button.is-active {
  border-color: var(--od-accent-border) !important;
  background: var(--od-surface-selected) !important;
  color: var(--od-accent-hover) !important;
}

html[data-theme-mode="light"] :is(.mc-order-row, .mc-mission-ticket, .mc-ticket-skeleton, .mc-empty),
html[data-theme="light"] :is(.mc-order-row, .mc-mission-ticket, .mc-ticket-skeleton, .mc-empty) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-1) !important;
  background-image: none !important;
  box-shadow: var(--od-shadow-xs) !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] :is(.mc-order-row:hover, .mc-order-row.is-selected, .mc-mission-ticket:hover, .mc-mission-ticket.is-selected),
html[data-theme="light"] :is(.mc-order-row:hover, .mc-order-row.is-selected, .mc-mission-ticket:hover, .mc-mission-ticket.is-selected) {
  border-color: color-mix(in srgb, var(--ticket-accent) 42%, var(--od-border-default)) !important;
  background: var(--od-surface-hover) !important;
  box-shadow: var(--od-shadow-sm) !important;
}

html[data-theme-mode="light"] :is(.mc-route-signature, .mc-order-menu, .mc-region-popover > label, .mc-assignment-list [role="option"]),
html[data-theme="light"] :is(.mc-route-signature, .mc-order-menu, .mc-region-popover > label, .mc-assignment-list [role="option"]) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-2) !important;
  color: var(--od-text-secondary) !important;
  box-shadow: var(--od-shadow-md) !important;
}

html[data-theme-mode="light"] :is(.mc-drawer, .mc-assignment-panel, .mc-context-sheet),
html[data-theme="light"] :is(.mc-drawer, .mc-assignment-panel, .mc-context-sheet) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-overlay) !important;
  color: var(--od-text-primary) !important;
  box-shadow: var(--od-shadow-lg) !important;
}

html[data-theme-mode="light"] :is(.mc-drawer, .mc-assignment-panel, .mc-context-sheet) > :is(header, footer),
html[data-theme="light"] :is(.mc-drawer, .mc-assignment-panel, .mc-context-sheet) > :is(header, footer) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-2) !important;
}

html[data-theme-mode="light"] :is(.od-order-drawer, .od-order-confirm),
html[data-theme="light"] :is(.od-order-drawer, .od-order-confirm) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-1) !important;
  background-image: none !important;
  box-shadow: var(--od-shadow-lg) !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] .od-order-drawer > :is(header, footer),
html[data-theme="light"] .od-order-drawer > :is(header, footer) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-2) !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] :is(.od-order-body, .od-order-content),
html[data-theme="light"] :is(.od-order-body, .od-order-content) {
  background: var(--od-surface-1) !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] :is(.od-order-section, .od-order-metric, .od-order-route-node, .od-order-data > div),
html[data-theme="light"] :is(.od-order-section, .od-order-metric, .od-order-route-node, .od-order-data > div) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-2) !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] .od-order-field :is(input, select, textarea),
html[data-theme-mode="light"] .od-order-inline-status select,
html[data-theme="light"] .od-order-field :is(input, select, textarea),
html[data-theme="light"] .od-order-inline-status select {
  border-color: var(--od-border-default) !important;
  background: var(--od-surface-1) !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] :is(.od-order-suggestions, .od-order-map-state),
html[data-theme="light"] :is(.od-order-suggestions, .od-order-map-state) {
  border-color: var(--od-border-default) !important;
  background: var(--od-surface-overlay) !important;
  color: var(--od-text-secondary) !important;
  box-shadow: var(--od-shadow-md) !important;
}

html[data-theme-mode="light"] .od-order-history article::before,
html[data-theme="light"] .od-order-history article::before {
  background: var(--od-surface-1) !important;
}

/* Driver command centre */
html[data-theme-mode="light"] body.od-driver-operations,
html[data-theme="light"] body.od-driver-operations {
  --driver-canvas-0: var(--od-bg-primary);
  --driver-canvas-1: var(--od-bg-secondary);
  --driver-canvas-2: var(--od-bg-tertiary);
  --driver-surface-1: var(--od-surface-1);
  --driver-surface-2: var(--od-surface-2);
  --driver-surface-3: var(--od-bg-tertiary);
  --driver-surface-solid: var(--od-surface-1);
  --driver-text-primary: var(--od-text-primary);
  --driver-text-secondary: var(--od-text-secondary);
  --driver-text-muted: var(--od-text-muted);
  --driver-cyan: var(--od-accent);
  --driver-cyan-strong: var(--od-accent-hover);
  --driver-blue: var(--od-info);
  --driver-success: var(--od-success);
  --driver-warning: var(--od-warning);
  --driver-danger: var(--od-danger);
  --driver-info: var(--od-info);
  --driver-border-soft: var(--od-border-subtle);
  --driver-border: var(--od-border-default);
  --driver-border-active: var(--od-accent);
  --driver-shadow: var(--od-shadow-md);
  --mission-label-bg: var(--od-surface-overlay);
  --mission-label-border: var(--od-border-default);
  --mission-label-text: var(--od-text-primary);
  color-scheme: light;
  background: var(--od-bg-primary) !important;
}

html[data-theme-mode="light"] body.od-driver-operations::before,
html[data-theme="light"] body.od-driver-operations::before {
  display: none !important;
}

html[data-theme-mode="light"] body.od-driver-operations #odThemeToggle,
html[data-theme="light"] body.od-driver-operations #odThemeToggle {
  display: inline-flex !important;
}

html[data-theme-mode="light"] body.od-driver-operations :is(.driverControlBar, .driverStatusStrip, .missionPrimary, .missionLane, .activeMissionCard, .availableMission, .scheduledMissionRow, .completedMissionRow, .dashRecentRow, .timeboardFocus, .weekRail, .dayTimeline, .earningsFlow, .payoutLedger, .payoutPeriod, .identityHero, .identityCard, .profilePerformance, .documentCard, .driverDrawer__panel),
html[data-theme="light"] body.od-driver-operations :is(.driverControlBar, .driverStatusStrip, .missionPrimary, .missionLane, .activeMissionCard, .availableMission, .scheduledMissionRow, .completedMissionRow, .dashRecentRow, .timeboardFocus, .weekRail, .dayTimeline, .earningsFlow, .payoutLedger, .payoutPeriod, .identityHero, .identityCard, .profilePerformance, .documentCard, .driverDrawer__panel) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-1) !important;
  background-image: none !important;
  box-shadow: var(--od-shadow-sm) !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] body.od-driver-operations :is(.missionFlowfield, .missionFlowfield__stage, .missionFlowfield__visual, .flowfieldAmbient, .drawerRoute, .drawerFacts, .drawerNote, .drawerMoneySummary, .calendarFilter, .orderCounts, .ordersFilterPanel, .payoutDetailRow, .documentRows),
html[data-theme="light"] body.od-driver-operations :is(.missionFlowfield, .missionFlowfield__stage, .missionFlowfield__visual, .flowfieldAmbient, .drawerRoute, .drawerFacts, .drawerNote, .drawerMoneySummary, .calendarFilter, .orderCounts, .ordersFilterPanel, .payoutDetailRow, .documentRows) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-2) !important;
  background-image: none !important;
  color: var(--od-text-secondary) !important;
}

html[data-theme-mode="light"] body.od-driver-operations :is(.osButton--secondary, .iconAction),
html[data-theme="light"] body.od-driver-operations :is(.osButton--secondary, .iconAction) {
  border-color: var(--od-border-default) !important;
  background: var(--od-surface-1) !important;
  color: var(--od-text-primary) !important;
}

/* Customer workspace and order workflow */
html[data-theme-mode="light"] body.od-customer.od-platform,
html[data-theme="light"] body.od-customer.od-platform {
  background: var(--od-bg-primary) !important;
  background-image: none !important;
}

html[data-theme-mode="light"] body.od-customer :is(.customer-hero, .hero-panel, .hero-side, .customer-quick-card, .customer-secondary-card, .cx-section-card, .cx-profile-shell, .cx-order-row, .cx-invoice-item, .cx-request-item, .cx-active-order-card, .cx-profile-stage, .cx-orders-archive-card, .cx-invoice-library, .cx-invoice-fiscal__panel),
html[data-theme="light"] body.od-customer :is(.customer-hero, .hero-panel, .hero-side, .customer-quick-card, .customer-secondary-card, .cx-section-card, .cx-profile-shell, .cx-order-row, .cx-invoice-item, .cx-request-item, .cx-active-order-card, .cx-profile-stage, .cx-orders-archive-card, .cx-invoice-library, .cx-invoice-fiscal__panel) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-1) !important;
  background-image: none !important;
  box-shadow: var(--od-shadow-sm) !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] body.od-customer :is(.customer-hero, .hero-panel, .hero-side, .customer-quick-card, .customer-secondary-card)::before,
html[data-theme-mode="light"] body.od-customer :is(.customer-hero, .hero-panel, .hero-side, .customer-quick-card, .customer-secondary-card)::after,
html[data-theme="light"] body.od-customer :is(.customer-hero, .hero-panel, .hero-side, .customer-quick-card, .customer-secondary-card)::before,
html[data-theme="light"] body.od-customer :is(.customer-hero, .hero-panel, .hero-side, .customer-quick-card, .customer-secondary-card)::after {
  display: none !important;
  background: none !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] body.od-customer :is(.hero-stat, .stats-mini, .kpi, .price),
html[data-theme="light"] body.od-customer :is(.hero-stat, .stats-mini, .kpi, .price) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-2) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] body.od-customer :is(.hero-stat, .stats-mini, .kpi, .price)::before,
html[data-theme-mode="light"] body.od-customer :is(.hero-stat, .stats-mini, .kpi, .price)::after,
html[data-theme="light"] body.od-customer :is(.hero-stat, .stats-mini, .kpi, .price)::before,
html[data-theme="light"] body.od-customer :is(.hero-stat, .stats-mini, .kpi, .price)::after {
  display: none !important;
  background: none !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] body.od-customer :is(.cx-filter-panel, .cx-activity-row, .cx-detail-row, .cx-preview-block, .cx-address-card, .cx-note-chip, .cx-return-toggle, .cx-route-map-preview, .address-card, .choice-btn, .note-chip, .check-row, .return-toggle, .return-different, .section),
html[data-theme="light"] body.od-customer :is(.cx-filter-panel, .cx-activity-row, .cx-detail-row, .cx-preview-block, .cx-address-card, .cx-note-chip, .cx-return-toggle, .cx-route-map-preview, .address-card, .choice-btn, .note-chip, .check-row, .return-toggle, .return-different, .section) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-2) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--od-text-secondary) !important;
}

html[data-theme-mode="light"] body.od-customer :is(.cx-order-drawer, .cx-order-detail, .cx-active-orders-modal, .command-modal-card, .cx-return-modal-card),
html[data-theme="light"] body.od-customer :is(.cx-order-drawer, .cx-order-detail, .cx-active-orders-modal, .command-modal-card, .cx-return-modal-card) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-overlay) !important;
  background-image: none !important;
  box-shadow: var(--od-shadow-lg) !important;
  color: var(--od-text-primary) !important;
}

/* Access and standalone forms */
html[data-theme-mode="light"] body.od-login .visual,
html[data-theme="light"] body.od-login .visual {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-bg-navigation) !important;
  background-image: none !important;
}

html[data-theme-mode="light"] body.od-login :is(.login-shell, .feature, .route-strip),
html[data-theme="light"] body.od-login :is(.login-shell, .feature, .route-strip),
html[data-theme-mode="light"] body.od-auth > .card,
html[data-theme="light"] body.od-auth > .card,
html[data-theme-mode="light"] body.od-admin-standalone :is(.card, .form-card),
html[data-theme="light"] body.od-admin-standalone :is(.card, .form-card) {
  border-color: var(--od-border-subtle) !important;
  background: var(--od-surface-1) !important;
  background-image: none !important;
  box-shadow: var(--od-shadow-md) !important;
  color: var(--od-text-primary) !important;
}

html[data-theme-mode="light"] .od-theme-toggle,
html[data-theme="light"] .od-theme-toggle {
  min-height: 2.25rem;
  border: 1px solid var(--od-border-default) !important;
  border-radius: var(--od-radius-md) !important;
  background: var(--od-surface-1) !important;
  box-shadow: var(--od-shadow-xs) !important;
  color: var(--od-text-primary) !important;
}

/* Responsive density: no horizontal page overflow at supported widths. */
@media (max-width: 1180px) {
  html[data-theme-mode="light"] .mc-order-inspector-host,
  html[data-theme="light"] .mc-order-inspector-host { position: static; height: min(760px, 80dvh); }
}

@media (max-width: 760px) {
  html[data-theme-mode="light"] body.od-admin-app .admin-workspace > .section,
  html[data-theme="light"] body.od-admin-app .admin-workspace > .section { padding: var(--od-space-4); }

  html[data-theme-mode="light"] :is(.card, .panel, .modal, .od-order-section),
  html[data-theme="light"] :is(.card, .panel, .modal, .od-order-section) { border-radius: var(--od-radius-lg) !important; }

  html[data-theme-mode="light"] :is(.mc-command-strip, .mc-mission-header, .od-page-header),
  html[data-theme="light"] :is(.mc-command-strip, .mc-mission-header, .od-page-header) { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme-mode="light"] *,
  html[data-theme-mode="light"] *::before,
  html[data-theme-mode="light"] *::after,
  html[data-theme="light"] *,
  html[data-theme="light"] *::before,
  html[data-theme="light"] *::after { transition-duration: .01ms !important; }
}
