/* Contrast tokens for the authentication and customer file/ticket surfaces.
   Loaded only by these pages; no workflow, permission or pricing changes. */
body {
  --journey-ink: #eef1f6;
  --journey-muted: #b8c2cf;
  --journey-panel: #20252d;
  --journey-input: #14191f;
  --journey-line: #8994a3;
  --journey-positive: #6ee7b7;
  --journey-negative: #fda4af;
  --journey-warning: #fde68a;
  --journey-info: #93c5fd;
  --journey-accent: color-mix(in srgb, var(--tenant-accent) 32%, white);
  --journey-action: var(--tenant-accent);
  --text-primary: var(--journey-ink);
  --text-secondary: var(--journey-muted);
  --text-tertiary: var(--journey-muted);
  --text-dim: var(--journey-muted);
  --success: var(--journey-positive);
  --error: var(--journey-negative);
  --warning: var(--journey-warning);
}
[data-theme="light"] body {
  --journey-ink: #202936;
  --journey-muted: #4b5563;
  --journey-panel: #ffffff;
  --journey-input: #f4f6f8;
  --journey-line: #6b7280;
  --journey-positive: #065f46;
  --journey-negative: #991b1b;
  --journey-warning: #78350f;
  --journey-info: #1e40af;
  --journey-accent: color-mix(in srgb, var(--tenant-accent) 32%, black);
}
@supports (color: rgb(from white calc(255 - r) g b)) {
  body { --journey-action: color-mix(in srgb, var(--tenant-accent) 92%, rgb(from var(--tenant-accent-contrast-text) calc(255 - r) calc(255 - g) calc(255 - b))); }
}
/* Readable form surfaces in both themes, including the desktop auth layout. */
body.auth-portal .auth-card,
body :is(.wizard-modal, .pro-confirm-modal, .pro-confirm-dialog, .utc-card) {
  background: var(--journey-panel) !important;
  color: var(--journey-ink) !important;
}
body.auth-portal :is(.auth-card-title, .mobile-login-name),
body :is(.wizard-modal-title, .pro-confirm-title, .utc-title) { color: var(--journey-ink) !important; }
body.auth-portal :is(.auth-label, .auth-footer, .auth-divider, .auth-card-copy, .auth-check),
body :is(.wizard-page-head .crumb, .vehicle-dropdown label, .wizard-fact small, .wizard-summary-fact small, .wizard-chart-legend, .utc-composer-hint, .utc-details dt) {
  color: var(--journey-muted) !important; opacity: 1 !important;
}
body.auth-portal :is(.auth-input, .auth-select),
body :is(.main-content, #wizardModal, #proConfirmModal) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), textarea, select) {
  background-color: var(--journey-input) !important;
  color: var(--journey-ink) !important;
  border-color: var(--journey-line) !important;
}
body.auth-portal :is(input, textarea)::placeholder,
body .main-content :is(input, textarea)::placeholder { color: var(--journey-muted) !important; opacity: 1 !important; }
body.auth-portal :is(.auth-link, .pw-toggle),
body :is(.utc-back, .utc-message a) { color: var(--journey-accent) !important; }
body.auth-portal .auth-toggle { background: var(--journey-panel) !important; color: var(--journey-ink) !important; }
body.auth-portal .auth-message { background: var(--journey-input) !important; }
body.auth-portal :is(.auth-message.error, .field-error-text, .pw-req:not(.met) .pw-icon) { color: var(--journey-negative) !important; }
body.auth-portal :is(.auth-message.success, .pw-req.met) { color: var(--journey-positive) !important; }
body.auth-portal .pw-req { color: var(--journey-muted); }
/* Filled brand controls use the existing computed black/white contrast ink. */
body.auth-portal .auth-submit,
body :is(.wizard-btn-primary, .wizard-modal-btn, .btn-new-ticket, .btn-submit, .utc-send, .utc-closed-action, #downloadBtn),
body .filter-tab.active {
  color: var(--tenant-accent-contrast-text) !important;
  background: var(--journey-action) !important;
  filter: none !important;
}
body :is(.wizard-step-dot, .upload-zone-icon, .wizard-type-icon, .step-header-icon) {
  color: var(--tenant-accent-contrast-text) !important;
  background: var(--journey-action) !important;
}
body .wizard-step-label { color: var(--journey-muted) !important; opacity: 1 !important; }
body :is(.ss-trigger, .ss-options, .ss-search-wrap, .custom-dropdown-list, .custom-dropdown-menu) {
  background: var(--journey-panel) !important; color: var(--journey-ink) !important;
  border-color: var(--journey-line) !important;
}
body :is(.ss-display, .ss-option, .custom-dropdown-option) { color: var(--journey-ink) !important; }
body :is(.ss-display-empty, .ss-arrow, .ss-no-match) { color: var(--journey-muted) !important; opacity: 1 !important; }
/* These wrappers are disabled by their handlers; keep their labels readable. */
body .ss-container.ss-disabled { opacity: 1; }
body :is(.ss-option:hover, .ss-option.ss-selected) { background: var(--journey-input) !important; }
body .main-content option { color: var(--journey-ink); background: var(--journey-input); }
body :is(.wizard-fact small, .wizard-facts small, .wizard-vehicle-fact small, .wizard-vehicle-facts small, .volume-discount-note, .credit-balance-info) { color: var(--journey-muted) !important; }
body :is(#creditSelectionCount, #creditBalanceInfo, #dtcPriceBadge) { color: var(--journey-ink) !important; background-color: var(--journey-input) !important; }
body .volume-discount-tier:not(.is-fixed) { opacity: 1 !important; color: var(--journey-ink) !important; }
body :is(.solution-category-tab, .solution-category-count) { color: var(--journey-ink) !important; }
body :is(.solution-category-icon, .solution-category-tab svg) { color: var(--journey-info) !important; }
body :is(#wizardModalBody, #proConfirmModal dt, #proConfirmModal dd, #proConfirmModal .pro-confirm-total) { color: var(--journey-ink) !important; }
/* Closed tickets remain readable, while retaining their status and layout. */
body .ticket-status-closed { opacity: 1 !important; }
body .ticket-card :is(.badge, .cat-chip) { background: var(--journey-input) !important; }
body .ticket-card .badge { color: var(--journey-info) !important; }
body .ticket-card :is(.badge-closed) { color: var(--journey-muted) !important; }
body .ticket-card :is(.badge-pending, .badge-pending_user, .badge-pending_admin) { color: var(--journey-warning) !important; }
body :is(.up-ticket-rating, .utc-rating) { color: var(--journey-warning) !important; }
body .empty-state svg { opacity: 1 !important; color: var(--journey-muted) !important; fill: var(--journey-muted) !important; }
body :is(.utc-status, .utc-credit-badge, .utc-closed) { background: var(--journey-input) !important; color: var(--journey-info) !important; }
body .utc-credit-badge { color: var(--journey-positive) !important; }
body :is(.utc-tool, .utc-action, .btn-cancel, .btn-secondary, .filter-tab:not(.active)) { color: var(--journey-ink) !important; }
body :is(.auth-card, .main-content, #wizardModal, #proConfirmModal) :is(button, a, input, select, textarea):focus-visible {
  outline: 2px solid var(--journey-ink) !important; outline-offset: 3px !important;
}
/* Preserve distinct inactive/current/completed step states. */
body .wizard-step-dot:not(.active):not(.done) { color: var(--journey-muted) !important; background: var(--journey-input) !important; }
body .wizard-step-dot.done { color: #ffffff !important; background: #065f46 !important; }
body .wizard-step-dot.active + .wizard-step-label { color: var(--journey-accent) !important; }
body :is(.upload-zone-hint, .credit-tier-label) { color: var(--journey-muted) !important; }
body :is(.credit-tier-cell.is-active strong, .credit-tier-cell.is-active span, .credit-breakdown-line strong, .wizard-dtc-column h4, .wizard-dtc-selection-actions button, .pro-confirm-total strong, .file-drop-icon) { color: var(--journey-accent) !important; }
body .solution-icon-badge { background: var(--journey-input) !important; }
body .solution-icon svg { color: var(--journey-accent) !important; }
body .ecu-detected-icon { color: var(--journey-info) !important; }
/* The chart's existing blue/green raster labels are designed for a dark plot. */
body :is(.wizard-chart, .wizard-dyno-wrap, #wizardDynoCanvas) { background: #101820 !important; }
body .wizard-chart-title { color: #eef1f6 !important; }
body .wizard-chart-title span:last-child { color: #93c5fd !important; }
body .wizard-chart-legend { color: #b8c2cf !important; }
body .ticket-card .cat-chip { background: var(--journey-input) !important; color: var(--journey-accent) !important; }
body :is(.utc-meta, .utc-title .id) { color: var(--journey-muted) !important; }
body .utc-pill { background: var(--journey-input) !important; color: var(--journey-ink) !important; }
body .utc-star { color: var(--journey-warning) !important; }
body .utc-rate-submit { background: var(--journey-action) !important; color: var(--tenant-accent-contrast-text) !important; }
body #pcModal { background: var(--journey-panel) !important; }
body #pcModal :is(#pcModalTitle, #pcModalMsg, .pc-btn-cancel) { color: var(--journey-ink) !important; }
body #pcModal .pc-btn-ok { background: var(--journey-action) !important; color: var(--tenant-accent-contrast-text) !important; }
body #pcModalTitle svg { color: var(--journey-accent) !important; }
/* Disabled selects keep their existing disabled handler and pointer blocking.
   A dashed outline and inset surface preserve an explicit inactive appearance
   without reducing the contrast of the explanatory placeholder. */
body .ss-container.ss-disabled .ss-trigger {
  border-style: dashed !important;
  background: var(--journey-input) !important;
  cursor: not-allowed;
}
/* Balance text uses the brand as ink, rather than a low-contrast fill color. */
body #headerMasterBalance { color: var(--journey-accent) !important; }
body.autofiles-glass .upload-zone-icon { background: var(--journey-action) !important; color: var(--tenant-accent-contrast-text) !important; }
body .vehicle-dropdown label { color: var(--journey-ink) !important; }
body .wizard-chart-legend span { color: #b8c2cf !important; }
body .normal-automatik-sticky .btn-submit { background: var(--journey-action) !important; color: var(--tenant-accent-contrast-text) !important; }
body #utc .utc-file-label button { color: var(--journey-accent) !important; }
/* The shared desktop auth skin also paints the account-type choices dark. */
body.auth-portal .auth-choice { background: var(--journey-input) !important; color: var(--journey-ink) !important; }
body.auth-portal .auth-choice.is-active { background: color-mix(in srgb, var(--journey-accent) 12%, var(--journey-panel)) !important; border-color: var(--journey-accent) !important; }
body #step1 .vehicle-dropdown label { color: var(--journey-ink) !important; }
body :is(#step0, #step1, #step2, #step3) .step-header-icon { color: var(--journey-accent) !important; background: var(--journey-input) !important; }
body .solution-icon-svg [data-icon-tone="neutral"] { fill: var(--journey-ink) !important; }
body .solution-icon-svg [data-icon-tone="accent"] { fill: var(--journey-accent) !important; }
body #solutionsTotalBadge,
body #submitOrderBtn { background: var(--journey-action) !important; color: var(--tenant-accent-contrast-text) !important; }
body #utc :is(.utc-avatar, .utc-chat-icon) { background: var(--journey-action) !important; color: var(--tenant-accent-contrast-text) !important; }
body #utc .utc-chat-icon svg { stroke: var(--tenant-accent-contrast-text) !important; }
body #utc .utc-section-head svg { stroke: var(--journey-accent) !important; }
/* Beat the shared button skin's ID-level :is() specificity while keeping
   both fill and ink bound to the same tenant-derived contrast pair. */
html.user-portal body :is(.auth-submit#submitBtn, #createTicketSubmit, #submitOrderBtn, #downloadBtn, .btn-new-ticket, .btn-submit, .utc-send, .utc-closed-action, .wizard-btn-primary) {
  color: var(--tenant-accent-contrast-text) !important;
  background: var(--journey-action) !important;
  filter: none !important;
}


/* The empty native option is readable as well as actual catalog entries. */
html.user-portal body .main-content option { color: var(--journey-ink) !important; background: var(--journey-input) !important; }
/* Keep the enabled next action readable beneath the open list's shadow. */
html.user-portal body #step1NextBtn.wizard-btn {
  background: color-mix(in srgb, var(--tenant-accent) 70%, rgb(from var(--tenant-accent-contrast-text) calc(255 - r) calc(255 - g) calc(255 - b))) !important;
  color: var(--tenant-accent-contrast-text) !important;
}
