/* Shared CRM surfaces and readable theme colours. Keep print labels and the
   standalone owner console independent; no universal text-colour override. */
@media screen {
  :root[data-theme] {
    --surface: var(--bg-card);
    --surface-2: var(--bg-elevated);
    --surface-subtle: var(--surface-soft);
    --card: var(--bg-card);
    --panel: var(--bg-card);
    --bg-page: var(--bg);
    --bg-secondary: var(--bg-elevated);
    --ink: var(--text);
    --muted: var(--text-muted);
    --line: var(--border);
    --canvas: var(--bg);
    --accent: var(--lime);
    --on-primary: #fff;
    --on-accent: #171912;
    --focus-ring: var(--primary);
    --violet-text: #694995;
    --asx-inventory-v211-on-accent: var(--on-primary);
  }

  html[data-theme='light'] { --text-muted: #61655a; --text-dim: #686c61; }
  :root[data-theme='dark'] { --text-muted: #b5beaa; --text-dim: #a3ad97; --on-primary: #171912; --violet-text: #c6abea; }
  html[data-theme='ocean'] { --text-muted: #4e6568; --text-dim: #566b6e; }
  html[data-theme='forest'] { --text-muted: #57664e; --text-dim: #606c57; }
  html[data-theme='sunset'] { --text-muted: #6a594c; --text-dim: #726153; --primary: #885839; }
  html[data-theme='violet'] { --text-muted: #62536d; --text-dim: #6b5d74; }
  html[data-theme='rose'] { --text-muted: #6c5559; --text-dim: #745e61; }
  :root[data-theme]:not([data-theme='dark']) {
    --success: #416b28;
    --warning: #825517;
    --danger: #a13e37;
    --info: #3c6389;
    --pink: #a02761;
  }

  :root[data-theme] body { background-color: var(--bg); color: var(--text); }
  :root[data-theme] [hidden]:not([hidden='until-found']) { display: none !important; }
  :root[data-theme] input::placeholder,
  :root[data-theme] textarea::placeholder { color: var(--text-dim); opacity: 1; }
  :root[data-theme] select option,
  :root[data-theme] select optgroup { color: var(--text); background: var(--bg-card); }

  /* Owner-console links belong to the CRM shell; the owner page's reset does not. */
  :root[data-theme] .asx-owner-nav { border-color: var(--border); }
  :root[data-theme] .asx-owner-nav-label { color: var(--text-dim); }
  :root[data-theme] .asx-owner-console-link,
  :root[data-theme] .asx-owner-console-account {
    border-color: var(--border-light) !important;
    background: var(--primary-soft) !important;
    color: var(--text) !important;
  }
  :root[data-theme] .asx-owner-console-link:hover,
  :root[data-theme] .asx-owner-console-account:hover { background: var(--active-nav) !important; }
  :root[data-theme] .asx-support-mode-banner {
    border-color: var(--border-light); background: var(--bg-card); color: var(--text);
  }
  :root[data-theme] .asx-support-mode-banner a { background: var(--primary); color: var(--on-primary); }

  /* Charts need theme-aware labels, grids and tooltip surfaces as well as series. */
  :root[data-theme] .recharts-cartesian-axis-tick-value,
  :root[data-theme] .recharts-polar-angle-axis-tick-value,
  :root[data-theme] .recharts-polar-radius-axis-tick-value { fill: var(--text-muted); }
  :root[data-theme] .recharts-cartesian-grid line { stroke: var(--border-light); }
  :root[data-theme] .recharts-cartesian-axis-line,
  :root[data-theme] .recharts-cartesian-axis-tick-line { stroke: var(--border-light); }
  :root[data-theme] .recharts-default-tooltip {
    background: var(--bg-elevated) !important; border-color: var(--border-light) !important;
    color: var(--text) !important; border-radius: 10px;
  }
  :root[data-theme] .recharts-tooltip-label,
  :root[data-theme] .recharts-tooltip-item { color: var(--text) !important; }
  :root[data-theme] .recharts-legend-item-text { color: var(--text-muted) !important; }
  :root[data-theme] .analytics-v2-table-wrap td.positive { color: var(--success); }
  :root[data-theme] .analytics-v2-table-wrap tbody tr:first-child .analytics-v2-rank {
    color: var(--success); background: var(--success-soft);
  }

  /* Integrations, pagination and account dialogs use the same surfaces as CRM. */
  :root[data-theme] .commerce-dialog {
    background: var(--bg-elevated); color: var(--text); border-color: var(--border-light);
  }
  :root[data-theme] .commerce-card,
  :root[data-theme] .commerce-form,
  :root[data-theme] .commerce-button {
    background: var(--bg-card); color: var(--text); border-color: var(--border);
  }
  :root[data-theme] .commerce-button:hover { background: var(--bg-hover); }
  :root[data-theme] .commerce-primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
  :root[data-theme] .commerce-primary:hover { background: var(--primary-hover); }
  :root[data-theme] .commerce-muted { color: var(--text-muted); }
  :root[data-theme] .commerce-badge { background: var(--primary-soft); color: var(--text); }
  :root[data-theme] .commerce-field input { background: var(--bg-card); border-color: var(--border-light); color: var(--text); }
  :root[data-theme] .commerce-error,
  :root[data-theme] .commerce-dialog .is-error { color: var(--danger); }
  :root[data-theme] .commerce-nav-button { border-color: var(--border); }
  :root[data-theme] .commerce-button:focus-visible,
  :root[data-theme] .commerce-field input:focus-visible,
  :root[data-theme] .commerce-nav-button:focus-visible { outline-color: var(--focus-ring); }

  :root[data-theme] .asx-order-action-status-body > small.success,
  :root[data-theme] .asx-phone-state.verified { color: var(--success); }
  :root[data-theme] .asx-order-action-status-body > small.error,
  :root[data-theme] .asx-order-products-actions small.error,
  :root[data-theme] .asx-phone-message.error,
  :root[data-theme] .asx-phone-link.danger { color: var(--danger); }
  :root[data-theme] .asx-phone-state.pending { color: var(--warning); }
  :root[data-theme] .asx-np-selection > span,
  :root[data-theme] .order-detail-modal .asx-order-payment-dropzone > span,
  :root[data-theme] .order-detail-modal .asx-order-payment-control > header > div > span { color: var(--text); }
  :root[data-theme] .lp-rating-badge.is-good { color: var(--success); background: var(--success-soft); }
  :root[data-theme] .lp-rating-badge.is-medium { color: var(--warning); background: var(--warning-soft); }
  :root[data-theme] .lp-rating-badge.is-low { color: var(--danger); background: var(--danger-soft); }

  :root[data-theme] .settings-tab.active > span { color: var(--on-accent); background: var(--lime); }
  :root[data-theme] .asx-warehouse-empty-icon { color: var(--primary); }
  :root[data-theme] .analytics-v2-kpi { --kpi-accent: var(--success); --kpi-soft: var(--success-soft); }
  :root[data-theme] .analytics-v2-kpi.blue { --kpi-accent: var(--info); --kpi-soft: var(--info-soft); }
  :root[data-theme] .analytics-v2-kpi.green { --kpi-accent: var(--success); --kpi-soft: var(--success-soft); }
  :root[data-theme] .analytics-v2-kpi.violet { --kpi-accent: #694995; --kpi-soft: var(--violet-soft); }
  :root[data-theme='dark'] .analytics-v2-kpi.violet { --kpi-accent: #c6abea; }
  :root[data-theme] .analytics-v2-kpi.rose { --kpi-accent: var(--danger); --kpi-soft: var(--danger-soft); }
  :root[data-theme] .analytics-v2-kpi.amber { --kpi-accent: var(--warning); --kpi-soft: var(--warning-soft); }
  :root[data-theme] .analytics-v2-eyebrow,
  :root[data-theme] .analytics-v2-insights-title,
  :root[data-theme] .analytics-v2-funnel > footer,
  :root[data-theme] .analytics-v2-office-grid > button > footer strong,
  :root[data-theme] .analytics-v2-team-list > div > i.leader,
  :root[data-theme] .asx-manager-live-badge,
  :root[data-theme] .asx-manager-live-call time { color: var(--success); }
  :root[data-theme] .asx-manager-backlog-value { color: var(--warning); background: var(--warning-soft); }
  :root[data-theme] .analytics-delta.negative,
  :root[data-theme] .analytics-delta.down { color: var(--danger); background: var(--danger-soft); }

  /* Payment windows retain their brand marks; text and surfaces follow the CRM. */
  :root[data-theme] .asx-stripe-crm-button,
  :root[data-theme] .asx-stripe-dialog > header,
  :root[data-theme] .asx-stripe-connection-summary { background: var(--violet-soft); color: var(--text); border-color: var(--border-light); }
  :root[data-theme] .asx-stripe-crm-button > b,
  :root[data-theme] .asx-stripe-dialog > header span { color: var(--text-muted); }
  :root[data-theme] .asx-stripe-security { background: var(--surface-soft); color: var(--text); border-color: var(--border); }
  :root[data-theme] .asx-stripe-security > span { background: var(--bg-hover); }
  :root[data-theme] .asx-stripe-security small { color: var(--text-muted); }
  :root[data-theme] .asx-stripe-charge-state { background: var(--success-soft); color: var(--success); border-color: var(--success); }
  :root[data-theme] .asx-stripe-charge-state.warning { background: var(--warning-soft); color: var(--warning); border-color: var(--warning); }
  :root[data-theme] .asx-stripe-charge-state > span { background: var(--bg-card); }
  :root[data-theme] .asx-stripe-form-status.success { color: var(--success); }
  :root[data-theme] .asx-stripe-form-status.warning { color: var(--warning); }
  :root[data-theme] .asx-stripe-form-status.error { color: var(--danger); }
  :root[data-theme] .asx-stripe-form-actions button.danger,
  :root[data-theme] .asx-stripe-load-error > span { color: var(--danger); background: var(--danger-soft); border-color: var(--border-light); }
  :root[data-theme] .asx-billing-dialog-header span,
  :root[data-theme] .asx-billing-current-copy > span,
  :root[data-theme] .asx-billing-owned > header span,
  :root[data-theme] .asx-billing-addons > header span { color: var(--text-muted); }
  :root[data-theme] .asx-billing-validity b,
  :root[data-theme] .asx-billing-level-label,
  :root[data-theme] .asx-billing-owned-card > header > span,
  :root[data-theme] .asx-billing-owned-empty > span,
  :root[data-theme] .asx-billing-grant-card header > span,
  :root[data-theme] .asx-billing-addon > span,
  :root[data-theme] .asx-billing-popular,
  :root[data-theme] .asx-billing-plan-payment-kind,
  :root[data-theme] .asx-billing-plan-rule { color: var(--text); background: var(--primary-soft); }
  :root[data-theme] .asx-billing-plan li[data-plan-feature='order-bonus'],
  :root[data-theme] .asx-billing-plan li::before { color: var(--success); }
  :root[data-theme] .asx-billing-current.trial-expired,
  :root[data-theme] .asx-billing-current.past-due { background: var(--warning-soft); }
  :root[data-theme] .asx-billing-usage.warning .asx-billing-level-label,
  :root[data-theme] .asx-billing-usage.bonus .asx-billing-level-label { color: var(--warning); background: var(--warning-soft); }
  :root[data-theme] .asx-billing-usage.critical .asx-billing-level-label,
  :root[data-theme] .asx-billing-usage.blocked .asx-billing-level-label { color: var(--danger); background: var(--danger-soft); }
  :root[data-theme] .asx-billing-card-button { color: var(--text); background: var(--primary-soft); }
  :root[data-theme] .asx-billing-card-button:hover { background: var(--active-nav); }
  :root[data-theme] .asx-billing-interval button span { color: var(--text); background: var(--bg-card); }
  :root[data-theme] .asx-workspace-lock-copy > span { color: var(--danger); }
  :root[data-theme] .asx-workspace-lock-copy small { color: var(--text-muted); }
  :root[data-theme] .asx-workspace-lock-copy small b { color: var(--success); }

  /* Client ratings and the shared client directory previously used a separate
     light-only palette, including white table cells inside dark dialogs. */
  :root[data-theme] .asx-customer-rating-strip,
  :root[data-theme] .asx-customer-rating-profile > header,
  :root[data-theme] .asx-customer-rating-recommendation > div,
  :root[data-theme] .asx-customer-rating-no-history { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
  :root[data-theme] .asx-customer-rating-metrics article,
  :root[data-theme] .asx-developer-customer-summary article,
  :root[data-theme] .asx-developer-customer-filters label,
  :root[data-theme] .asx-developer-customer-filters input,
  :root[data-theme] .asx-developer-customer-filters select,
  :root[data-theme] .asx-developer-customer-table-wrap,
  :root[data-theme] .asx-developer-customer-pagination button { background: var(--bg-card); color: var(--text); border-color: var(--border); }
  :root[data-theme] .asx-customer-rating-metrics article.success,
  :root[data-theme] .asx-developer-customer-summary article.success { background: var(--success-soft); }
  :root[data-theme] .asx-customer-rating-metrics article.warning,
  :root[data-theme] .asx-developer-customer-summary article.warning { background: var(--warning-soft); }
  :root[data-theme] .asx-customer-rating-metrics article.danger,
  :root[data-theme] .asx-developer-customer-summary article.danger { background: var(--danger-soft); }
  :root[data-theme] .asx-customer-rating-strip small,
  :root[data-theme] .asx-customer-rating-strip > em,
  :root[data-theme] .asx-customer-rating-inline-metrics,
  :root[data-theme] .asx-customer-rating-profile > header p,
  :root[data-theme] .asx-customer-rating-metrics article small,
  :root[data-theme] .asx-developer-customer-summary article small,
  :root[data-theme] .asx-customer-rating-recommendation small,
  :root[data-theme] .asx-customer-rating-orders small,
  :root[data-theme] .asx-developer-customers-loading,
  :root[data-theme] .asx-developer-customer-table-wrap td > button small,
  :root[data-theme] .asx-developer-customer-table-wrap td > small,
  :root[data-theme] .asx-developer-customer-table-wrap td.empty,
  :root[data-theme] .asx-developer-customer-pagination { color: var(--text-muted); }
  :root[data-theme] .asx-customer-rating-inline-metrics b,
  :root[data-theme] .asx-customer-rating-profile > header strong,
  :root[data-theme] .asx-customer-rating-metrics article strong,
  :root[data-theme] .asx-developer-customer-summary article strong,
  :root[data-theme] .asx-customer-rating-recommendation strong,
  :root[data-theme] .asx-developer-customer-table-wrap td,
  :root[data-theme] .asx-developer-customer-table-wrap td > button { color: var(--text); border-color: var(--border); }
  :root[data-theme] .asx-customer-rating-recommendation { background: var(--border); }
  :root[data-theme] .asx-developer-customer-table-wrap th { background: var(--surface-soft); color: var(--text-muted); border-color: var(--border); }
  :root[data-theme] .asx-developer-customer-table-wrap tbody tr:hover { background: var(--bg-hover); }
  :root[data-theme] .asx-developer-customer-filters button { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
  :root[data-theme] .asx-developer-customer-table-wrap td.success { color: var(--success); }
  :root[data-theme] .asx-developer-customer-table-wrap td.warning { color: var(--warning); }
  :root[data-theme] .asx-developer-customer-table-wrap td.danger { color: var(--danger); }
  :root[data-theme] .asx-customer-rating-grade,
  :root[data-theme] .asx-customer-rating-orders em { background: var(--bg-hover); color: var(--text-muted); }
  :root[data-theme] .asx-customer-rating-grade.grade-a-plus,
  :root[data-theme] .asx-customer-rating-grade.grade-a,
  :root[data-theme] .asx-customer-rating-orders em.outcome-picked { background: var(--success-soft); color: var(--success); }
  :root[data-theme] .asx-customer-rating-grade.grade-b { background: var(--info-soft); color: var(--info); }
  :root[data-theme] .asx-customer-rating-grade.grade-c,
  :root[data-theme] .asx-customer-rating-orders em.outcome-returned { background: var(--warning-soft); color: var(--warning); }
  :root[data-theme] .asx-customer-rating-grade.grade-d,
  :root[data-theme] .asx-customer-rating-grade.error,
  :root[data-theme] .asx-customer-rating-orders em.outcome-refused { background: var(--danger-soft); color: var(--danger); }
  :root[data-theme] .asx-customer-rating-grade.grade-new { background: var(--violet-soft); color: var(--text); }

  /* Custom status colours remain in the swatch/background. Mix label ink with
     the theme text so even lime/yellow or deep violet statuses remain legible. */
  :root[data-theme] .status-badge {
    color: color-mix(in srgb, var(--status-color, var(--primary)) 30%, var(--text)) !important;
  }
  :root[data-theme] .status-badge .dot { background: var(--status-color, currentColor); }

  /* An inactive record is still readable data, not a disabled control. */
  :root[data-theme] .products-table tbody tr,
  :root[data-theme] .data-table tbody tr[style*='opacity'],
  :root[data-theme] .payment-methods-table tbody tr.is-inactive,
  :root[data-theme] .payment-methods-table tbody tr.is-inactive td,
  :root[data-theme] .reference-table tbody tr.is-inactive td,
  :root[data-theme] .payments-table tbody tr.is-inactive,
  :root[data-theme] .automation-rule.disabled,
  :root[data-theme] .api-key-row.disabled,
  :root[data-theme] .integration-card.asx-integration-disabled { opacity: 1 !important; }
  :root[data-theme] .products-table tbody tr[style*='opacity: 0.5'],
  :root[data-theme] .payment-methods-table tbody tr.is-inactive,
  :root[data-theme] .payments-table tbody tr.is-inactive { background: var(--surface-soft); }
  :root[data-theme] .payment-category-tag { color: var(--text); background: var(--bg-hover); }
  :root[data-theme] .payment-category-tag.basic { color: var(--success); background: var(--success-soft); }
  :root[data-theme] .payment-category-tag.marketplace { color: var(--text); background: var(--violet-soft); }
  :root[data-theme] .payment-category-tag.service,
  :root[data-theme] .payment-category-tag.card { color: var(--info); background: var(--info-soft); }
  :root[data-theme] .payment-category-tag.wallet { color: var(--warning); background: var(--warning-soft); }
  :root[data-theme] .payment-method-icon { color: var(--text) !important; }

  :root[data-theme] .asx-modal .asx-field label { color: var(--text-muted); }
  :root[data-theme] .asx-modal .asx-field input,
  :root[data-theme] .asx-modal .asx-field select,
  :root[data-theme] .asx-modal .asx-field textarea { background: var(--bg-card); color: var(--text); border-color: var(--border); }
  :root[data-theme] #asx-platform-root:has(.asx-account-page),
  :root[data-theme] .asx-account-page { background: var(--bg); color: var(--text); }
  :root[data-theme] .asx-account-header { background: var(--bg-elevated); border-color: var(--border); }
  :root[data-theme] .asx-account-user,
  :root[data-theme] .asx-platform-brand.dark,
  :root[data-theme] .asx-account-help strong { color: var(--text); }
  :root[data-theme] .asx-account-workspace,
  :root[data-theme] .asx-account-empty,
  :root[data-theme] .asx-account-help,
  :root[data-theme] .asx-account-logout,
  :root[data-theme] .asx-settings-card,
  :root[data-theme] .asx-workspace-trash-item,
  :root[data-theme] .asx-notification-list { background: var(--bg-card); color: var(--text); border-color: var(--border); }
  :root[data-theme] .asx-account-user:hover,
  :root[data-theme] .asx-account-user:focus-visible,
  :root[data-theme] .asx-account-settings-tabs,
  :root[data-theme] .asx-account-settings-tabs button:hover,
  :root[data-theme] .asx-account-settings-tabs button:focus-visible,
  :root[data-theme] .asx-two-factor-secret { background: var(--surface-soft); }
  :root[data-theme] .asx-account-settings-tabs button.active { background: var(--bg-card); color: var(--text); }
  :root[data-theme] .asx-account-workspace-rename,
  :root[data-theme] .asx-account-workspace-delete { background: var(--bg-card); color: var(--text-muted); }
  :root[data-theme] .asx-account-workspace-rename:hover { background: var(--bg-hover); color: var(--text); }
  :root[data-theme] .asx-account-workspace-delete:hover { background: var(--danger-soft); color: var(--danger); }
  :root[data-theme] .asx-account-user small,
  :root[data-theme] .asx-platform-brand.dark > small,
  :root[data-theme] .asx-account-hero p,
  :root[data-theme] .asx-account-workspace-copy small,
  :root[data-theme] .asx-account-workspace-copy code,
  :root[data-theme] .asx-account-workspace-open,
  :root[data-theme] .asx-account-settings-tabs button,
  :root[data-theme] .asx-settings-section-heading p,
  :root[data-theme] .asx-account-settings-content .asx-field small,
  :root[data-theme] .asx-account-settings-message,
  :root[data-theme] .asx-security-heading small,
  :root[data-theme] .asx-notification-list small,
  :root[data-theme] .asx-two-factor-secret small,
  :root[data-theme] .asx-account-empty p { color: var(--text-muted); }
  :root[data-theme] .asx-account-page .asx-eyebrow,
  :root[data-theme] .asx-settings-section-heading > span { color: var(--success); }
  :root[data-theme] .asx-account-user > .asx-account-avatar,
  :root[data-theme] .asx-security-icon { color: var(--text); background: var(--primary-soft); }
  :root[data-theme] .asx-two-factor-secret code { color: var(--text); }
  :root[data-theme] .asx-account-settings-content .asx-field input[readonly] { color: var(--text-muted); background: var(--surface-soft); }
  :root[data-theme] .asx-status-pill { color: var(--text-muted); background: var(--bg-hover); }
  :root[data-theme] .asx-status-pill.success { color: var(--success); background: var(--success-soft); }
  :root[data-theme] .asx-status-pill.pending { color: var(--warning); background: var(--warning-soft); }
  :root[data-theme] .dept-stats strong[style] { color: color-mix(in srgb, var(--dept-color, var(--primary)) 30%, var(--text)) !important; }
  :root[data-theme] .office-metrics strong[style] { color: color-mix(in srgb, var(--office-color, var(--primary)) 30%, var(--text)) !important; }
  :root[data-theme] .shipment2-actions button small { opacity: 1; }
  :root[data-theme] .asx-order-presence-slot-192.is-active,
  :root[data-theme] .asteron-sms-status-idle,
  :root[data-theme] .asx-customer-rating-inline-metrics i { color: var(--text-muted) !important; }
  :root[data-theme] .asx-order-history-toggle output { color: var(--on-accent); background: var(--lime); }
  :root[data-theme] .order-detail-modal .asx-order-payment-dropzone > i,
  :root[data-theme] .order-detail-modal .asx-order-payment-control > header > div > span { color: var(--on-accent); background: var(--lime); }
  :root[data-theme] .workflow-icon.blue { color: var(--info); }
  :root[data-theme] .workflow-icon.sand { color: var(--warning); }
  :root[data-theme] .workflow-icon.violet { color: #694995; }
  :root[data-theme='dark'] .workflow-icon.violet { color: #c6abea; }
  :root[data-theme] .asteron-mobile-nav__new > strong { color: var(--text); }
  :root[data-theme] .asx-manager-live-row.viewing .asx-manager-live-state { color: var(--violet-text); }
  :root[data-theme] .asx-manager-live-row.editing .asx-manager-live-state,
  :root[data-theme] .callcenter-kpis .info strong,
  :root[data-theme] .callcenter-dialer-label { color: var(--info); }
  :root[data-theme] .asx-manager-live-row.calling .asx-manager-live-state { color: var(--success); }
  :root[data-theme] .profile-connection-card[data-asx-provider-config='missing']::after { color: var(--warning); }
}

/* Mobile theme palette r26: retain desktop rules and channel/status identities. */
@media screen and (max-width: 900px) {
  html[data-theme] {
    --text-primary: var(--text);
    --text-secondary: var(--text-muted);
    --bg-primary: var(--bg);
    --surface-alt: var(--bg-elevated);
    --asteron-mobile-ink: var(--on-accent);
    --asteron-mobile-accent: var(--lime);
    --asteron-mobile-paper: var(--bg);
  }

  html[data-theme] .asteron-pwa-install,
  html[data-theme] .asteron-pwa-status {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--border);
  }
  html[data-theme] .asteron-pwa-install__copy span,
  html[data-theme] .asteron-pwa-install__close { color: var(--text-muted); }
  html[data-theme] .asteron-pwa-install__action {
    background: var(--primary);
    color: var(--on-primary);
  }
  html[data-theme] .asteron-pwa-status[data-tone="warning"] {
    background: var(--bg-card);
    color: var(--warning);
    border-color: var(--warning);
  }
  html[data-theme] .asteron-pwa-status[data-tone="success"] {
    background: var(--bg-card);
    color: var(--success);
    border-color: var(--success);
  }

  html[data-theme] .social-comment-subviews button.active {
    background: var(--primary-soft);
    color: var(--primary);
  }
  html[data-theme] .social-comment-client.active,
  html[data-theme] .social-reply-template-item.active {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--primary);
    box-shadow: inset 3px 0 var(--primary);
  }
  html[data-theme] .social-comment-client-avatar {
    background: var(--bg-hover);
    color: var(--text);
  }
  html[data-theme] .social-comment-private-compose blockquote { border-left-color: var(--primary); }
  html[data-theme] .social-reply-template-example small { color: var(--primary); }
  html[data-theme] .social-comment-send-status.success {
    background: var(--bg-card);
    color: var(--success);
    border-color: var(--success);
  }
  html[data-theme] .social-comment-send-error,
  html[data-theme] .social-comment-partial,
  html[data-theme] .social-reply-template-error,
  html[data-theme] .social-reply-template-pending,
  html[data-theme] .social-reply-template-delete-confirm,
  html[data-theme] .social-reply-template-hint {
    background: var(--bg-card);
    color: var(--warning);
    border-color: var(--warning);
  }

  html[data-theme] :is(.profile-settings-modal, .orders-page, .meta-simple-connect) input:is([type="checkbox"], [type="radio"]) {
    accent-color: var(--primary);
  }
  html[data-theme] :is(.profile-settings-modal, .orders-page, .meta-simple-connect, .social-comment-clients, .social-comment-subviews, .social-reply-templates-dialog, .order-conversation-card) :focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
  }
  html[data-theme] .asteron-quick-nav__link > svg.lucide,
  html[data-theme] .profile-settings-nav button > svg.lucide,
  html[data-theme] .header-actions > .icon-btn > svg.lucide,
  html[data-theme] .orders-mobile-filter-toggle > svg.lucide,
  html[data-theme] .orders-layout-edit-button > svg.lucide {
    color: inherit;
    stroke: currentColor;
    fill: none;
  }
}

.asteron-mobile-theme-tab,.asteron-mobile-theme-section{display:none}
@media(max-width:900px){.profile-settings-nav .asteron-mobile-theme-tab{display:flex;align-items:center;gap:8px;min-height:44px}.asteron-mobile-theme-section{display:block;min-width:0}.asteron-mobile-theme-section header{margin-bottom:12px}.asteron-mobile-theme-section h3{margin:0 0 6px;font-size:19px;line-height:1.3}.asteron-mobile-theme-section header p,.asteron-mobile-theme-hint{margin:0 0 12px;color:var(--text-muted);font-size:13px;line-height:1.55}.asteron-mobile-theme-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.asteron-mobile-theme-option{display:flex;align-items:center;gap:10px;min-width:0;min-height:88px;padding:12px;border:1px solid var(--border);border-radius:12px;text-align:left;background:var(--bg-card);color:var(--text);font:inherit;cursor:pointer}.asteron-mobile-theme-option.active{border-color:var(--primary);box-shadow:inset 0 0 0 1px var(--primary)}.asteron-mobile-theme-option:focus-visible{outline:2px solid var(--primary);outline-offset:2px}.asteron-mobile-theme-option:disabled{opacity:.65;cursor:default}.asteron-mobile-theme-preview{display:flex;flex:0 0 40px;height:44px;border:1px solid var(--border);border-radius:8px;overflow:hidden}.asteron-mobile-theme-preview>span{flex:1}.asteron-mobile-theme-copy{min-width:0;flex:1}.asteron-mobile-theme-copy strong{display:block;font-size:13px;line-height:1.4;overflow-wrap:anywhere}.asteron-mobile-theme-copy small{display:block;margin-top:3px;font-size:11px;line-height:1.5;color:var(--text-muted);overflow-wrap:anywhere}.asteron-mobile-theme-option>svg{flex:0 0 18px;color:var(--text)}}
@media(max-width:520px){.asteron-mobile-theme-grid{grid-template-columns:minmax(0,1fr)}.asteron-mobile-theme-option{min-height:76px}}
@media(max-width:900px){.profile-settings-modal .profile-settings-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));min-width:0}.profile-settings-modal .profile-settings-nav>button{min-width:0;min-height:44px;overflow-wrap:anywhere}.profile-settings-modal .profile-settings-nav>button>svg{flex-shrink:0}.profile-settings-modal .profile-settings-nav>button>span{min-width:0}.profile-settings-modal .profile-settings-nav>.profile-summary,.profile-settings-modal .profile-settings-nav>.profile-logout{grid-column:1 / -1;min-width:0}}
