/* Shared components are unlayered; feature layouts live in rental-features.
   This intentionally avoids specificity fights and additional !important rules. */
body { background: var(--ui-canvas); background-image: var(--ui-paint-canvas); color: var(--ui-ink); font-family: var(--ui-font); }
button, input, select, textarea { font-family: inherit; }
button, summary, a, label.file-label { -webkit-tap-highlight-color: transparent; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 3px; }
:where(.precise-schedule-scroll):focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 3px; }

:where(.btn, .dw-button, .ui-button, .dw-confirm-dialog button) {
  --button-height: var(--ui-control-height);
  --button-font: var(--ui-control-font);
  --button-padding: var(--ui-control-padding);
  --button-bg: var(--ui-surface);
  --button-color: var(--ui-text-secondary);
  --button-border: var(--ui-border-strong);
  --button-hover-bg: var(--ui-surface-muted);
  --button-hover-color: var(--ui-ink);
  --button-hover-border: var(--ui-placeholder);
  --button-paint: var(--ui-paint-surface);
  --button-hover-paint: var(--ui-paint-surface-hover);
  --button-shadow: var(--ui-shadow-control);
  --button-hover-shadow: var(--ui-shadow-soft);
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  min-height: var(--button-height);
  height: auto;
  padding: var(--button-padding);
  border: 1px solid var(--button-border);
  border-radius: var(--ui-control-radius);
  background: var(--button-bg);
  background-image: var(--button-paint);
  color: var(--button-color);
  font-size: var(--button-font);
  font-weight: 600;
  line-height: 1.4;
  box-shadow: var(--button-shadow);
  transform: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .18s;
}
:where(.btn, .dw-button, .ui-button, .dw-confirm-dialog button):hover {
  background: var(--button-hover-bg);
  background-image: var(--button-hover-paint);
  color: var(--button-hover-color);
  border-color: var(--button-hover-border);
  box-shadow: var(--button-hover-shadow);
  transform: none;
}
/* Legacy success/warning button names are action aliases, NOT status colors. */
:where(.btn.primary, .btn.success, .btn.warning, .dw-button-primary, .ui-button-primary, .dw-confirm-dialog button[value="confirm"]) {
  --button-bg: var(--ui-action);
  --button-color: var(--ui-surface);
  --button-border: var(--ui-action);
  --button-hover-bg: var(--ui-action-hover);
  --button-hover-color: var(--ui-surface);
  --button-hover-border: var(--ui-action-hover);
  --button-paint: var(--ui-paint-action);
  --button-hover-paint: var(--ui-paint-action-hover);
  --button-shadow: var(--ui-shadow-action);
  --button-hover-shadow: var(--ui-shadow-action-hover);
}
:where(.btn.info, .btn.soft-info, .btn.soft-success, .btn.soft-warning, .dw-button-action, .ui-button-outline) {
  --button-bg: var(--ui-surface);
  --button-color: var(--ui-info-text);
  --button-border: var(--ui-info-border);
  --button-hover-bg: var(--ui-info-soft);
  --button-hover-color: var(--ui-info-hover);
  --button-hover-border: var(--ui-info);
  --button-hover-paint: none;
}
/* Warehouse return/inbound actions carry a semantic green, not a new theme. */
:where(.ui-button-positive) {
  --button-bg: var(--ui-surface);
  --button-color: var(--ui-success-hover);
  --button-border: var(--ui-success-border);
  --button-hover-bg: var(--ui-success-soft);
  --button-hover-color: var(--ui-success-hover);
  --button-hover-border: var(--ui-success);
  --button-hover-paint: none;
}
:where(.btn.danger, .ui-button-danger) {
  --button-bg: var(--ui-surface);
  --button-color: var(--ui-danger);
  --button-border: var(--ui-danger-border);
  --button-hover-bg: var(--ui-danger-soft);
  --button-hover-color: var(--ui-danger-hover);
  --button-hover-border: var(--ui-danger);
  --button-hover-paint: none;
}
:where(.ui-button-danger-solid) {
  --button-bg: var(--ui-danger);
  --button-color: var(--ui-surface);
  --button-border: var(--ui-danger);
  --button-hover-bg: var(--ui-danger-hover);
  --button-hover-color: var(--ui-surface);
  --button-hover-border: var(--ui-danger-hover);
  --button-paint: none;
  --button-hover-paint: none;
}
:where(.btn.small, .ui-button-compact, table .btn, .ic-actions .btn, .dw-row-actions .dw-button, .dw-secondary-actions .dw-button, .order-pagination .btn, .ux-pagination .btn) {
  --button-height: var(--ui-control-compact-height);
  --button-font: var(--ui-control-compact-font);
  --button-padding: var(--ui-control-compact-padding);
}
:where(.btn, .dw-button, .ui-button, .text-btn, .icon-btn):disabled {
  opacity: 1;
  background: var(--ui-surface-muted);
  background-image: none;
  color: var(--ui-placeholder);
  border-color: var(--ui-border);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
:where(.btn, .dw-button, .ui-button)[aria-busy="true"] { cursor: wait; }
:where(.btn, .dw-button, .ui-button) svg { width: 16px; height: 16px; flex-shrink: 0; }
:where(.ui-button) { display: inline-flex; }
:where(.btn.ghost) { --button-bg: transparent; --button-paint: none; --button-shadow: none; }
:where(.text-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--ui-control-compact-height);
  padding: 4px 6px;
  border: 0;
  border-radius: var(--ui-control-radius);
  background: transparent;
  color: var(--ui-info-text);
  font-size: var(--ui-control-compact-font);
  font-weight: 600;
  line-height: 1.4;
  box-shadow: none;
  text-decoration: none;
}
:where(.text-btn):hover { background: var(--ui-info-soft); color: var(--ui-info-hover); }
:where(.order-product-link) { appearance: none; border: 0; background: transparent; padding: 0; color: inherit; font: inherit; text-align: inherit; }
:where(.danger-text, .text-btn.danger-text) { color: var(--ui-danger); }
:where(.text-btn.danger-text):hover { background: var(--ui-danger-soft); color: var(--ui-danger-hover); }
:where(.text-btn.success-text) { color: var(--ui-success); }
:where(.text-btn.success-text):hover { background: var(--ui-success-soft); color: var(--ui-success-hover); }
:where(.text-btn.warning-text) { color: var(--ui-warning); }
:where(.text-btn.warning-text):hover { background: var(--ui-warning-soft); color: var(--ui-warning-hover); }
:where(.icon-btn, .dw-arrow) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ui-control-height);
  min-width: var(--ui-control-height);
  height: var(--ui-control-height);
  padding: 0;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-control-radius);
  background: var(--ui-surface);
  color: var(--ui-text-secondary);
  font-size: 20px;
  line-height: 1;
  background-image: var(--ui-paint-surface);
  box-shadow: var(--ui-shadow-control);
}
:where(.icon-btn):hover { background: var(--ui-surface-muted); color: var(--ui-ink); }

:where(.input, .dw-input) {
  box-sizing: border-box;
  min-height: var(--ui-control-height);
  height: auto;
  padding: 8px 12px;
  border: 1px solid var(--ui-border-strong);
  border-radius: var(--ui-control-radius);
  background: var(--ui-surface);
  color: var(--ui-ink);
  font-size: var(--ui-control-font);
  font-weight: 400;
  line-height: 1.4;
  outline: none;
  box-shadow: var(--ui-shadow-input);
  transition: border-color .15s, box-shadow .15s;
}
:where(textarea.input) { min-height: 80px; }
/* Opt-in geometry for fields with an overlaid leading icon; keep shared paint/focus. */
:where(.input.ui-input-leading-icon, .dw-input.ui-input-leading-icon) { padding-inline-start: var(--ui-input-leading-icon-space); }
:where(.input, .dw-input):focus { border-color: var(--ui-primary); box-shadow: var(--ui-focus-ring); }
:where(.input, .dw-input)::placeholder { color: var(--ui-muted); opacity: 1; }
:where(.input.readonly, .input:disabled, .dw-input:disabled) { background: var(--ui-surface-muted); color: var(--ui-muted); }
:where(.input:invalid):not(:placeholder-shown):not(:focus) { box-shadow: none; }
input[type="checkbox"], input[type="radio"], progress { accent-color: var(--ui-primary); }

/* Application shell: only style changes; the original navigation remains. */
.sidebar { background: var(--ui-surface); background-image: var(--ui-paint-sidebar); border-color: var(--ui-border); box-shadow: var(--ui-shadow-sidebar); backdrop-filter: none; -webkit-backdrop-filter: none; }
.sidebar::before { content: none; }
.sidebar-brand-mark { background: var(--ui-primary); background-image: var(--ui-paint-nav); color: var(--ui-surface); box-shadow: var(--ui-shadow-nav); border-radius: var(--ui-panel-radius); }
.sidebar-brand strong { color: var(--ui-ink); }
.sidebar-brand span, .sidebar-label { color: var(--ui-muted); }
.sidebar-rule { background: var(--ui-border); }
.nav { border-radius: var(--ui-panel-radius); color: var(--ui-text-secondary); font-weight: 600; box-shadow: none; }
.nav:hover { background: var(--ui-surface-subtle); background-image: var(--ui-paint-surface); border-color: var(--ui-border); color: var(--ui-ink); transform: none; box-shadow: var(--ui-shadow-control); }
.nav.active, .nav.active:hover { background: var(--ui-primary); background-image: var(--ui-paint-nav); border-color: transparent; color: var(--ui-surface); transform: none; box-shadow: var(--ui-shadow-nav); }
.nav-icon { background: var(--ui-surface); background-image: var(--ui-paint-surface); border-color: var(--ui-border); color: var(--ui-muted); box-shadow: var(--ui-shadow-control); }
.nav:hover .nav-icon { background: var(--ui-surface); border-color: var(--ui-border); color: var(--ui-primary); transform: none; }
.nav.active .nav-icon { background: rgb(var(--ui-surface-rgb) / .14); background-image: none; border-color: rgb(var(--ui-surface-rgb) / .3); color: var(--ui-surface); box-shadow: inset 0 1px 0 rgb(var(--ui-surface-rgb) / .15); }
.side-note { background: var(--ui-surface-subtle); border-color: var(--ui-border); color: var(--ui-muted); box-shadow: none; backdrop-filter: none; }
.side-note strong { color: var(--ui-text); }
.mobile-bottom-nav { background: var(--ui-surface); background-image: var(--ui-paint-surface); border-color: var(--ui-border); box-shadow: var(--ui-shadow-soft); }
.mobile-bottom-nav-item { color: var(--ui-muted); }
.mobile-bottom-nav-item.active { color: var(--ui-primary-text); background: var(--ui-primary-soft); box-shadow: var(--ui-shadow-selection); }
.mobile-bottom-nav-item svg { color: inherit; }
.session-toolbar { color: var(--ui-muted); }
.session-toolbar strong { color: var(--ui-text); }
:where(.session-avatar) { color: var(--ui-primary-text); background: var(--ui-primary-soft); border: 1px solid var(--ui-primary-border); border-radius: var(--ui-panel-radius); box-shadow: var(--ui-shadow-control); }
:where(.session-meta) { color: var(--ui-muted); }
:where(.session-role) { color: var(--ui-text-secondary); background: var(--ui-surface-muted); border: 1px solid var(--ui-border); border-radius: 6px; }
:where(#sidebarSessionSlot .session-toolbar) { background: var(--ui-surface); background-image: var(--ui-paint-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-panel-radius); box-shadow: var(--ui-shadow-soft); }

:where(.section-head, .analysis-hero, .schedule-hero) { background: transparent; border: 0; box-shadow: none; }
:where(.section-head h2, .dw-head h2, .analysis-hero-title h2, .schedule-hero h2) { color: var(--ui-ink); font-size: 28px; line-height: 1.3; font-weight: 750; letter-spacing: 0; }
:where(.section-head p, .dw-head p, .analysis-hero-title p, .schedule-hero p) { color: var(--ui-muted); font-size: 13px; line-height: 1.7; }
:where(.card, .stat-card, .table-wrap, .dw-workspace, .dw-metrics, .inventory-filter-shell, .ic-model, .ic-device, .aa-chart-card, .aa-kpi, .gr-panel, .dph-main, .device-profit-section, .feature-workspace, .account-profile-card, .account-system-card, .target-order-card, #inventoryStats, .analysis-kpi-card) {
  border-color: var(--ui-border);
  border-radius: var(--ui-panel-radius);
  background: var(--ui-surface);
  background-image: var(--ui-paint-surface);
  box-shadow: var(--ui-shadow);
}
:where(.card, .stat-card, .ic-model, .ic-device):hover { transform: none; }
:where(.toolbar, .order-command-bar, .order-status-tabs, .advanced-order-filters, .ac-controls) { background: var(--ui-surface); background-image: var(--ui-paint-surface); box-shadow: var(--ui-shadow-soft); }
:where(.aa-kpi, .analysis-kpi-card, .ux-task, .action-card) { box-shadow: var(--ui-shadow-soft); }
:where(.target-order-card-head) { background: transparent; border-color: var(--ui-border); box-shadow: inset 0 1px 0 rgb(var(--ui-surface-rgb) / .94); }
:where(.target-order-card-actions) { background: var(--ui-surface-subtle); background-image: var(--ui-paint-surface); border-color: var(--ui-border); }
:where(.ic-actions) { background: transparent; }
:where(.mobile-foldout > summary) { color: var(--ui-text-secondary); background: var(--ui-surface); background-image: var(--ui-paint-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-control-radius); box-shadow: var(--ui-shadow-control); font-size: var(--ui-control-compact-font); font-weight: 600; }
@media (max-width: 720px) {
  :where(#mobileDailyFilters > .mobile-foldout-body) { background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-panel-radius); box-shadow: var(--ui-shadow-float); }
}
:where(th) { background: var(--ui-surface-subtle); color: var(--ui-text-secondary); }
:where(th, td) { border-color: var(--ui-border); }
:where(.stat-card strong) { color: var(--ui-ink); }
:where(.status-pill, .aa-badge, .status-tag) { border-radius: 6px; font-size: 12px; font-weight: 600; box-shadow: inset 0 1px 0 rgb(var(--ui-surface-rgb) / .6); }
:where(.status-paid, .status-instock, .status-completed) { color: var(--ui-success-hover); background: var(--ui-success-soft); border-color: var(--ui-success-border); }
:where(.status-reserved, .status-shipped, .status-renting) { color: var(--ui-info-text); background: var(--ui-info-soft); border-color: var(--ui-info-border); }
:where(.status-pending, .status-unshipped) { color: var(--ui-warning-hover); background: var(--ui-warning-soft); border-color: var(--ui-warning-border); }
:where(.status-risk) { color: var(--ui-danger-hover); background: var(--ui-danger-soft); border-color: var(--ui-danger-border); }
:where(.customer-return-feedback > strong, .customer-return-table > strong, .customer-return-details dt) { color: var(--ui-text-secondary); font-size: 12px; font-weight: 600; }
:where(.customer-return-summary, .customer-return-table, .customer-return-details) { color: var(--ui-text); font-size: 13px; line-height: 1.6; }
:where(.customer-return-message) { color: var(--ui-warning-hover); font-size: 13px; }
:where(.order-dispatch-badge) { color: var(--ui-warning-hover); background: var(--ui-warning-soft); border: 1px solid var(--ui-warning-border); border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.4; padding: 3px 6px; white-space: normal; }
:where(.order-dispatch-badge.is-late) { color: var(--ui-danger-hover); background: var(--ui-danger-soft); border-color: var(--ui-danger-border); }
:where(.rental-card-brief) { color: var(--ui-text-secondary); font-size: 12px; line-height: 1.5; border-bottom: 1px solid var(--ui-border); }
:where(.rental-brief-identifiers, .rental-brief-extra, .rental-brief-dates dt, .rental-brief-tracking > span, .rental-brief-deposit-slot > p > span) { color: var(--ui-muted); }
:where(.rental-brief-device > strong) { color: var(--ui-text); font-size: 13px; }
:where(.order-quick-desktop .order-quick-target) { cursor: text; border-radius: 4px; }
:where(.order-quick-desktop .order-quick-target):hover { outline: 1px dashed var(--ui-info-border); background: var(--ui-info-soft); }
:where(.order-quick-desktop .order-quick-target):focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 2px; }
:where(.order-quick-desktop .order-quick-target):hover::after { content: ' ✎'; color: var(--ui-info-text); font-size: 12px; }
:where(.order-quick-desktop .order-quick-editing):hover::after { content: none; }
:where(.order-quick-inline, .order-quick-form, .order-quick-conflicts) { color: var(--ui-text); font-size: 13px; font-weight: 400; }
:where(.order-quick-preview) { border: 1px solid var(--ui-border); border-radius: var(--ui-control-radius); padding: 10px; background: var(--ui-surface-muted); color: var(--ui-text-secondary); }
:where(.order-quick-preview[data-state="error"], .order-quick-message) { color: var(--ui-warning-hover); }
:where(.order-quick-saved-status) { color: var(--ui-text-secondary); font-size: 13px; }
:where(.rental-card-detail > summary) { color: var(--ui-info-text); font-size: 13px; font-weight: 600; min-height: var(--ui-control-touch-height); border-bottom: 1px solid var(--ui-border); cursor: pointer; }
:where(.dot.green) { background: var(--ui-success); }
:where(.dot.blue) { background: var(--ui-info); }
:where(.dot.yellow) { background: var(--ui-warning); }
:where(.dot.red) { background: var(--ui-danger); }
:where(.ux-task.tone-blue strong) { color: var(--ui-info); }
:where(.analysis-view-dot) { background: var(--ui-placeholder); }
:where(.analysis-view-tab.active .analysis-view-dot) { background: var(--ui-primary); }
:where(.analysis-view-tab.active, .analysis-view-tab[aria-selected="true"], .ux-segmented button.active, .inventory-view-switch button.active, .view-switch-btn.active, .order-status-tab.active) { background: var(--ui-primary-soft); color: var(--ui-primary-text); border-color: var(--ui-primary-border); box-shadow: var(--ui-shadow-selection); }
:where(.inventory-view-switch button, .ux-segmented button, .analysis-view-tab, .order-status-tab, .view-switch-btn) { min-height: var(--ui-control-height); font-size: 13px; font-weight: 600; border-radius: var(--ui-control-radius); }
:where(.order-status-tab):hover { color: var(--ui-primary-text); background: var(--ui-primary-soft); box-shadow: none; }
:where(.order-status-tab.active strong) { color: var(--ui-primary-text); background: var(--ui-surface); }
/* Semantic counter variants retain the standard counter geometry, including when selected. */
:where(.ui-count-success) { color: var(--ui-success-hover); background: var(--ui-success-soft); box-shadow: inset 0 0 0 1px var(--ui-success-border); }
:where(.ui-count-warning) { color: var(--ui-warning-hover); background: var(--ui-warning-soft); box-shadow: inset 0 0 0 1px var(--ui-warning-border); }
:where(.ui-count-danger) { color: var(--ui-danger-hover); background: var(--ui-danger-soft); box-shadow: inset 0 0 0 1px var(--ui-danger-border); }
:where(.ic-device-heading h3 .text-btn) { font-size: 18px; color: var(--ui-ink); padding: 0; text-align: left; }
/* Existing ic-blue marks availability, not an action: preserve its business meaning. */
:where(#tab-inventory .ic-blue) { color: var(--ui-success); }
:where(.ic-stat:nth-child(3) > strong) { color: var(--ui-info); }
:where(.ic-stat:nth-child(4) > strong) { color: var(--ui-warning); }
:where(.ic-stat:nth-child(5) > strong) { color: var(--ui-danger); }
:where(.ic-stock-detail-grid [data-ic-metric="reserved"] > strong) { color: var(--ui-warning); }
:where(.ic-stock-detail-grid [data-ic-metric="maintenance"] > strong) { color: var(--ui-danger); }
:where(.ic-stock-detail-grid [data-ic-metric="value"] > strong) { color: var(--ui-ink); }
:where(.dw-status-ship) { color: var(--ui-info-text); }
:where(.dw-status.is-dispatch-pending) { color: var(--ui-warning-hover); }
:where(.dw-status.is-dispatch-late) { color: var(--ui-danger-hover); }
:where(.inventory-scan-tip, .inventory-scan-result) { border-color: var(--ui-info-border); background: var(--ui-info-soft); }
:where(.inventory-scan-tip strong, .model-autofill-hint strong) { color: var(--ui-info-text); }
:where(.model-autofill-hint) { border-color: var(--ui-info-border); background: var(--ui-info-soft); }
:where(.feature-icon-tracking) { background: var(--ui-success); }
:where(.tracking-overview [data-tracking-tone="success"] strong) { color: var(--ui-success); }
:where(.tracking-overview [data-tracking-tone="warning"] strong) { color: var(--ui-warning); }
:where(.tracking-record:hover, .tracking-record.is-selected) { border-color: var(--ui-info-border); background: var(--ui-info-soft); }
:where(.tracking-info-link, .tracking-hover-state) { --tracking-status-text: var(--ui-muted); --tracking-status-soft: var(--ui-surface-muted); --tracking-status-border: var(--ui-border); }
:where([data-tracking-tone="info"]) { --tracking-status-text: var(--ui-info-text); --tracking-status-soft: var(--ui-info-soft); --tracking-status-border: var(--ui-info-border); }
:where([data-tracking-tone="success"]) { --tracking-status-text: var(--ui-success-hover); --tracking-status-soft: var(--ui-success-soft); --tracking-status-border: var(--ui-success-border); }
:where([data-tracking-tone="warning"]) { --tracking-status-text: var(--ui-warning-hover); --tracking-status-soft: var(--ui-warning-soft); --tracking-status-border: var(--ui-warning-border); }
:where([data-tracking-tone="danger"]) { --tracking-status-text: var(--ui-danger-hover); --tracking-status-soft: var(--ui-danger-soft); --tracking-status-border: var(--ui-danger-border); }
:where(.tracking-info-link) { padding: 0; border: 0; border-radius: 4px; color: var(--tracking-status-text); background: transparent; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
:where(.tracking-number) { color: inherit; text-decoration: underline; text-decoration-color: var(--tracking-status-border); text-underline-offset: 3px; }
:where(.tracking-link-state, .tracking-hover-state) { color: var(--tracking-status-text); background: var(--tracking-status-soft); border: 1px solid var(--tracking-status-border); border-radius: 6px; padding: 1px 5px; font-size: 12px; font-style: normal; font-weight: 600; line-height: 1.4; white-space: normal; }
:where(.field-hint.optional) { color: var(--ui-info-text); background: var(--ui-info-soft); }
:where(.warehouse-scanner-dialog.scan-outbound .warehouse-progress-card) { border-color: var(--ui-info-border); background: var(--ui-info-soft); }
:where(.warehouse-scanner-dialog.scan-outbound .warehouse-progress-head strong) { color: var(--ui-info-text); }
:where(.warehouse-scanner-dialog.scan-outbound .warehouse-progress-track) { background: var(--ui-info-soft); }
:where(.warehouse-scanner-dialog.scan-outbound .warehouse-progress-track span) { background: var(--ui-info); }
:where(.warehouse-scanner-dialog.scan-outbound .warehouse-camera-frame) { border-color: var(--ui-info); }
:where(.warehouse-scanner-dialog.scan-outbound #warehouseCodeInput:focus) { border-color: var(--ui-info); box-shadow: 0 0 0 3px rgb(var(--ui-info-rgb) / .16); }

:where(.dialog, .aa-dialog, .dw-confirm-dialog, .gr-dialog) { background: var(--ui-surface); color: var(--ui-ink); border-color: var(--ui-border); border-radius: var(--ui-panel-radius); box-shadow: var(--ui-shadow-float); }
dialog::backdrop { background: rgb(var(--ui-ink-rgb) / .4); backdrop-filter: blur(2px); }
:where(.dialog-head, .dialog-head-actions, .dialog-actions, .aa-actions) { background: var(--ui-surface); border-color: var(--ui-border); }
:where(.dialog-head h2, .dialog h3, .aa-dialog h3) { color: var(--ui-ink); }
:where(.deposit-refund-dialog) .muted { font-size: var(--ui-control-compact-font); line-height: 1.6; }
:where(.order-section-tone) { background: var(--ui-surface); border-color: var(--ui-border); border-left-color: var(--ui-primary); border-radius: var(--ui-panel-radius); box-shadow: none; }
:where(.order-section-number) { background: var(--ui-primary); color: var(--ui-surface); }
:where(.form-grid label, .profit-fields label, .login-card label, .account-form label) { color: var(--ui-text-secondary); font-size: 13px; font-weight: 500; }
.login-screen { background: var(--ui-canvas); background-image: var(--ui-paint-canvas); }
.login-card { background: var(--ui-surface); border-radius: var(--ui-panel-radius); border-color: var(--ui-border); box-shadow: var(--ui-shadow); }
.login-brand .eyebrow { color: var(--ui-primary-text); }
.login-brand::before { background: var(--ui-primary); background-image: var(--ui-paint-nav); color: var(--ui-surface); box-shadow: var(--ui-shadow-nav); }
.toast { background: var(--ui-ink); color: var(--ui-surface); border-radius: var(--ui-control-radius); box-shadow: var(--ui-shadow-float); }
.ux-save-state { border-color: var(--ui-success-border); background: var(--ui-success-soft); color: var(--ui-success); box-shadow: var(--ui-shadow); }
[hidden] { display: none; }

/* Staff communication reuses the same pearl surfaces, semantics and controls. */
:where(.tc-dialog) { color: var(--ui-ink); background: var(--ui-surface); background-image: var(--ui-paint-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-panel-radius); box-shadow: var(--ui-shadow-float); }
.tc-dialog::backdrop { background: rgb(var(--ui-ink-rgb) / .18); }
:where(.tc-head, .tc-peer-head) { border-bottom: 1px solid var(--ui-border); }
:where(.tc-head h2) { font-size: 20px; }
:where(.tc-peer-head h3) { font-size: 15px; }
:where(.tc-head p, .tc-peer-head p, .tc-contact-copy small, .tc-status, .tc-message-meta, .tc-message-receipt, .tc-keyboard-hint, .tc-empty, #tcOrderCount) { font-size: 12px; color: var(--ui-muted); }
:where(.tc-people) { border-right: 1px solid var(--ui-border); background: var(--ui-surface-subtle); }
:where(.tc-contact) { color: var(--ui-ink); text-align: left; font: inherit; border: 1px solid transparent; border-radius: var(--ui-control-radius); background: transparent; cursor: pointer; }
:where(.tc-contact:hover) { background: var(--ui-surface-muted); }
:where(.tc-contact.is-selected) { background: var(--ui-primary-soft); border-color: var(--ui-primary-border); box-shadow: var(--ui-shadow-selection); }
:where(.tc-avatar, .tc-placeholder-icon) { border-radius: var(--ui-control-radius); background: var(--ui-info-soft); color: var(--ui-info-text); }
:where(.tc-count) { border-radius: 10px; font-size: 12px; line-height: 1.3; font-weight: 600; background: var(--ui-primary); color: var(--ui-surface); }
:where(.tc-launcher.nav.active .tc-count) { background: var(--ui-surface); color: var(--ui-primary-text); }
:where(.tc-message-area) { background: var(--ui-surface-subtle); }
:where(.tc-bubble) { border: 1px solid var(--ui-border); border-radius: 10px; color: var(--ui-ink); background: var(--ui-surface); box-shadow: var(--ui-shadow-soft); font-size: 14px; line-height: 1.6; }
:where(.tc-message.is-mine .tc-bubble) { background: var(--ui-action-soft); border-color: var(--ui-action-border); }
:where(.tc-order-card) { border: 1px solid var(--ui-info-border); border-radius: var(--ui-control-radius); background: var(--ui-surface); color: var(--ui-ink); font: inherit; cursor: pointer; box-shadow: var(--ui-shadow-control); }
:where(.tc-order-card:hover) { border-color: var(--ui-info); }
:where(.tc-order-kicker, .tc-order-link) { color: var(--ui-info-text); font-size: 12px; }
:where(.tc-order-card small, .tc-pick-copy small) { color: var(--ui-muted); font-size: 12px; }
:where(.tc-picker-filter-row label) { font-size: 12px; font-weight: 500; color: var(--ui-text-secondary); }
:where(.tc-composer, .tc-status) { border-top: 1px solid var(--ui-border); background: var(--ui-surface); }
:where(.tc-attachment) { background: var(--ui-info-soft); border: 1px solid var(--ui-info-border); border-radius: var(--ui-control-radius); font-size: 13px; }
:where(.tc-pending) { background: var(--ui-warning-soft); border: 1px solid var(--ui-warning-border); border-radius: var(--ui-control-radius); font-size: 12px; color: var(--ui-warning-hover); }
:where(.tc-order-picker) { background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-panel-radius); box-shadow: var(--ui-shadow-float); }
@media (max-width: 720px) { :where(.tc-dialog) { border: 0; border-radius: 0; } }

/* After-sales uses the existing pearl surface and action/status palette. */
:where(.as-toolbar label, .as-composer-fields > label, .as-composer > label) { font-size: 13px; font-weight: 500; color: var(--ui-text-secondary); }
:where(.as-ticket h3, .as-original h3) { font-size: 16px; }
:where(.as-ticket-meta, .as-message-head span, .as-message-head time, .as-compose-hint) { font-size: 12px; color: var(--ui-muted); }
:where(.as-preview, .as-device-summary) { font-size: 14px; color: var(--ui-text-secondary); line-height: 1.6; }
:where(.as-nav-count) { border-radius: 10px; font-size: 12px; line-height: 1.4; font-weight: 600; }
:where(.as-order-summary, .as-composer) { border-top: 1px solid var(--ui-border); }
:where(.order-feedback-bar) { border-top: 1px solid var(--ui-border); background: var(--ui-paint-surface); color: var(--ui-text-secondary); font-size: 12px; line-height: 1.6; }
:where(.order-feedback-bar .as-order-summary) { border-top: 0; }
:where(.as-dialog .dialog-head) { background: var(--ui-surface); border-bottom: 1px solid var(--ui-border); }
:where(.as-order-summary > strong) { font-size: 13px; color: var(--ui-text-secondary); }
:where(.as-original, .as-convert-copy) { background: var(--ui-surface-subtle); border: 1px solid var(--ui-border); border-radius: var(--ui-control-radius); }
:where(.as-message) { background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-control-radius); box-shadow: var(--ui-shadow-soft); }
:where(.as-message.is-internal) { background: var(--ui-warning-soft); border-color: var(--ui-warning-border); }
:where(.as-message.is-internal .as-message-head span) { color: var(--ui-warning-hover); }
:where(.as-original p, .as-message-text, .as-convert-copy) { font-size: 14px; line-height: 1.65; }
:where(.as-feedback-status) { font-size: 13px; color: var(--ui-text-secondary); line-height: 1.6; }
:where(.as-live-notice) { border: 1px solid var(--ui-info-border); background: var(--ui-info-soft); color: var(--ui-info-text); border-radius: var(--ui-control-radius); font-size: 13px; }
:where(.as-image) { background: var(--ui-surface-subtle); border: 1px solid var(--ui-border); border-radius: var(--ui-control-radius); }
/* Optical lift only: keep positions/dimensions and touch navigation unchanged. */
@media (hover: hover) and (pointer: fine) {
  :where(.ic-model, .ic-device, .target-order-card):hover { border-color: var(--ui-border-strong); box-shadow: var(--ui-shadow-hover); }
}
@media (min-width: 721px) {
  :where(#tab-orders > .section-head, #tab-rentPrices > .section-head, #tab-timeLog > .section-head, #tab-operationLog > .section-head, #tab-otherFeatures > .section-head) { background: var(--ui-surface); background-image: var(--ui-paint-surface); box-shadow: var(--ui-shadow-soft); }
}

@media (max-width: 720px) {
  :where(.btn, .dw-button, .ui-button, .dw-confirm-dialog button) {
    --button-height: var(--ui-control-touch-height);
    --button-padding: 8px 12px;
    --button-font: var(--ui-control-font);
  }
  :where(.text-btn, .icon-btn, .dw-arrow, .order-product-link) { min-height: var(--ui-control-touch-height); }
  :where(.tracking-info-link) { min-height: var(--ui-control-touch-height); }
  :where(.icon-btn, .dw-arrow) { width: var(--ui-control-touch-height); min-width: var(--ui-control-touch-height); height: var(--ui-control-touch-height); }
  :where(.input, .dw-input) { min-height: var(--ui-control-touch-height); font-size: 16px; }
  :where(.section-head h2, .dw-head h2, .analysis-hero-title h2, .schedule-hero h2) { font-size: 24px; }
  :where(.inventory-view-switch button, .ux-segmented button, .analysis-view-tab, .order-status-tab, .view-switch-btn) { min-height: var(--ui-control-touch-height); font-size: 13px; }
  :where(.ic-batch-toggle, .ic-spec summary, .inventory-card-more > summary, .inventory-device-more > summary, .order-card-more > summary, .dw-check, .schedule-workspace-tab) { min-height: var(--ui-control-touch-height); }
  :where(.schedule-workspace-tab) { font-size: var(--ui-control-compact-font); }
  :where(.dialog-head-actions .btn, .dialog-head-actions .icon-btn) { padding-inline: 10px; }
  .login-screen { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  :where(.btn, .dw-button, .ui-button, .input, .dw-input, .nav, .nav-icon) { transition: none; }
}
