/* Shared appearance controls and an explicit dark palette for all Pipefood screens. */
:root{--appearance-bg:#fff;--appearance-panel:#f6f7fa;--appearance-text:#262b35;--appearance-muted:#596272;--appearance-line:#dce1e9;--appearance-accent:#c91f37}
html[data-theme="dark"]{color-scheme:dark;--appearance-bg:#1c2029;--appearance-panel:#252b36;--appearance-text:#f0f2f6;--appearance-muted:#b4bfce;--appearance-line:#3c4554;--appearance-accent:#ff8e9d;--line:#353e4c;--muted:#b4bfce;--ink:#f0f2f6;--wine:#ff8e9d;--wine-dark:#ffb0bb}
.appearance-trigger{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;gap:10px;min-width:44px;min-height:44px;padding:10px;border:1px solid var(--appearance-line);border-radius:9px;background:var(--appearance-bg);color:var(--appearance-text);cursor:pointer;font:inherit}
.appearance-trigger svg{width:19px;height:19px;display:block;flex-shrink:0}.inbox-heading .appearance-trigger{margin-left:auto}.inbox-heading .inbox-caption{margin-left:10px}.appearance-trigger:hover{background:var(--appearance-panel)}
.appearance-dialog{position:fixed;inset:50% auto auto 50%;transform:translate(-50%,-50%);margin:0;width:min(440px,calc(100vw - 32px));height:auto;max-height:calc(100dvh - 32px);padding:0;border:1px solid var(--appearance-line);border-radius:16px;box-shadow:0 20px 90px #0006;background:var(--appearance-bg);color:var(--appearance-text);font:14px/1.6 ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;overflow:auto}
.appearance-dialog::backdrop{background:#090c1399}.appearance-header{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid var(--appearance-line)}.appearance-header h2{font-size:20px;letter-spacing:-.4px;margin:0;color:var(--appearance-text)}.appearance-close{width:44px;height:44px;border:0;border-radius:8px;background:var(--appearance-panel);color:var(--appearance-text);font:24px/1 sans-serif;cursor:pointer}
.appearance-body{padding:8px 22px 22px}.appearance-body>p{color:var(--appearance-muted);font-size:13px;margin:14px 0 18px}.appearance-body fieldset{padding:0;margin:0;border:0}.appearance-body legend{font-size:12px;font-weight:600;margin-bottom:10px}.appearance-option{display:flex;align-items:center;gap:14px;padding:14px 12px;margin-bottom:10px;border:1px solid var(--appearance-line);border-radius:10px;cursor:pointer;min-height:80px;background:var(--appearance-bg);color:var(--appearance-text)}.appearance-option:has(input:checked){border-color:var(--appearance-accent);box-shadow:0 0 0 1px var(--appearance-accent)}.appearance-option strong{display:block;font-size:14px;color:var(--appearance-text)}.appearance-option small{display:block;font-size:12px;line-height:1.5;color:var(--appearance-muted);margin-top:3px}.appearance-option input{margin-left:auto;flex-shrink:0;width:18px;height:18px;accent-color:var(--appearance-accent)}
.appearance-preview{width:48px;height:42px;border:1px solid #a6aebb;border-radius:6px;display:grid;grid-template-columns:12px 1fr;gap:4px;padding:6px;background:#f4f5f8;flex-shrink:0}.appearance-preview i{display:block;background:#cdd3df;border-radius:2px}.appearance-preview i:first-child{grid-row:span 2;background:#ed1728}.appearance-preview-dark{background:#171c25}.appearance-preview-dark i{background:#515e74}.appearance-preview-system{background:linear-gradient(90deg,#f4f5f8 50%,#171c25 50%)}.appearance-feedback{min-height:40px}.appearance-done{width:100%;min-height:44px;padding:10px 16px;background:#d92038;color:#fff;border:0;border-radius:9px;font:inherit;font-weight:600;font-size:14px;cursor:pointer}
.appearance-dialog :is(button,input):focus-visible,.appearance-trigger:focus-visible{outline:3px solid var(--appearance-accent);outline-offset:3px}

/* Surfaces: canvas, panels, controls and overlays. Branding and product images keep their colors. */
html[data-theme="dark"],html[data-theme="dark"] body{background:#13161d;color:#e6eaf1}
html[data-theme="dark"] :is(.layout main,.clients-view,.chat,.messages,.operator-exit,.menu-layout,.catalog-loading){background:#13161d!important;color:#e6eaf1}
html[data-theme="dark"] :is(.sidebar,.topbar,.overview,.inbox,.chat-header,.context,.composer,.site-header,.catalog-nav,.cart-panel,.cart-checkout,.featured-card,.product-card,.empty-search,.catalog-error,.app-dialog,.order-dialog,.clients-dialog,.dialog,.operator-menu,.emoji-picker){background:#1c2029!important;color:#e6eaf1!important;border-color:#353e4c!important}
html[data-theme="dark"] :is(.dialog-header,.dialog-footer,.drawer-header,.drawer-footer,.clients-dialog>header,.clients-dialog-body,.dialog-shell,.dialog-scroll,.drawer-body,.product-details,.notes-section,.info-body,.review-footer){background:#1c2029;color:#e6eaf1;border-color:#353e4c}
html[data-theme="dark"] :is(.column,.column-body,.clients-list-panel,.clients-temperature,.clients-metric-card,.clients-segment-card,.order-card,.bubble,.composer-box,.clients-state,.clients-empty,.operator-exit-card,.crm-customer){background:#202631!important;color:#e6eaf1!important;border-color:#3c4554!important;box-shadow:none}
html[data-theme="dark"] :is(input:not([type="radio"]):not([type="checkbox"]),select,textarea,.search,.search-box,.clients-search,.form-input,.form-select,.form-notes,.quantity,.product-quantity){background:#161b23!important;color:#eff3f9!important;border-color:#4d596b!important}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#a7b3c5!important;opacity:1}
html[data-theme="dark"] :is(.secondary,.icon-button,.filter,.clients-button,.clients-page-button,.clients-close,.mini-stepper,.quantity-stepper,.option-counter button,.context-toggle,.composer-tool,.appearance-trigger){background:#252d3a!important;color:#e4eaf3!important;border-color:#4b586d!important}
html[data-theme="dark"] :is(.primary,.clients-primary,.appearance-done,.send-icon,.mobile-cart){background:#cf263e!important;color:#fff!important;border-color:#ed5268!important}
html[data-theme="dark"] :is(.primary,.clients-primary,.appearance-done):hover{background:#b71e34!important}
html[data-theme="dark"] :is(button,input,textarea,select):disabled{opacity:.55}
html[data-theme="dark"] :is(.primary,.clients-primary):disabled{background:#3b4351!important;color:#c0c8d6!important;border-color:#4b586d!important}
html[data-theme="dark"] :is(.nav-item,.category-link,.small-link,.text-button,.clients-text-button,.clients-sort,.clients-row-open,.clients-person){color:#c9d3e2!important}
html[data-theme="dark"] :is(.nav-item.active,.nav-item:hover,.conversation.selected,.filter[aria-pressed="true"],.clients-tag-check:hover,.clients-table tr:hover){background:#39242d!important;color:#ffa7b4!important}
html[data-theme="dark"] .category-link.active{background:#b82a3e!important;color:#fff!important}
html[data-theme="dark"] .conversation{background:#1c2029;color:#e6eaf1;border-color:#353e4c}
html[data-theme="dark"] .conversation:hover{background:#252d3a}
html[data-theme="dark"] :is(.detail-customer,.drawer-client,.profile,.scenario-card,.detail-notes,.payment-details,.order-notes,.clients-profile-metrics,.clients-tag-check,.clients-rule-field,.clients-method-formula,.date-divider,.system-message,.chat-state,.header-order,.order-stage){background:#252d3a!important;color:#dbe4f1!important;border-color:#414d60!important}
html[data-theme="dark"] .message.assistant .bubble{background:#3b2531!important;border-color:#704052!important}
html[data-theme="dark"] .message.operator .bubble{background:#203b36!important;border-color:#3c6a5b!important}
html[data-theme="dark"] :is(.dialog,.app-dialog,.order-dialog,.clients-dialog)::backdrop{background:#070a11aa}

/* Text, table rules and supporting labels. */
html[data-theme="dark"] :is(h1,h2,h3,h4,.store strong,.operator-area .operator strong,.conv-line strong,.chat-client h2,.product-copy h3,.featured-copy h3,.cart-item-title,.review-item-top,.option-copy strong,.clients-person strong,.clients-cell-number,.clients-cell-date,.clients-profile strong,.clients-temperature-value strong,.clients-metric-card strong){color:#f0f3f9!important}
html[data-theme="dark"] :is(.eyebrow,.nav-caption,.store div>span,.operator small,.sidebar-bottom>p,.sidebar-bottom>p strong,.day-label,.overview-caption,.overview p,.summary-metrics>div>span,.board-toolbar>div>span,.board-date,.drag-helper,.column-total,.card-top time,.card-items,.card-footer span,.form-note,.field-label,.history,.inbox-caption,.list-caption,.preview,.conv-line time,.author,.message-meta,.composer-help,.section-label,.drawer-eyebrow,.drawer-description,.drawer-hint,.notes-label,.chat-client p,.menu-label,.store-copy p,.section-note,.price-label,.product-description,.product-copy p,.cart-item-options,.group-instructions,.option-copy small,.option-price,.review-note,.review-item p,.info-body p,.powered-by,.site-footer,.signature-line+p){color:#b4bfce!important}
html[data-theme="dark"] :is(.clients-intro p,.clients-kicker,.clients-section-heading,.clients-card-label,.clients-temperature-description,.clients-comparison,.clients-segment-heading p,.clients-segment-top>span,.clients-frequency-segment small,.clients-activity-label,.clients-list-heading p,.clients-person small,.clients-table td>small,.clients-table th,.clients-pagination,.clients-help,.clients-profile p,.clients-profile small,.clients-profile-metrics span,.clients-order-history time,.clients-rule-field small,.clients-contact-link,.clients-thermometer-labels){color:#bac5d5!important}
html[data-theme="dark"] .clients-table{background:#202631;color:#e6eaf1}
html[data-theme="dark"] .clients-table :is(th,td,tr){border-color:#3c4554!important}
html[data-theme="dark"] .clients-table thead,html[data-theme="dark"] .clients-table th{background:#191f29!important}
html[data-theme="dark"] :is(.clients-view,.clients-dialog,.bubble,.header-order,.order-card,.summary-metrics,.detail-total,.order-total) strong{color:#f0f3f9!important}
html[data-theme="dark"] :is(.bubble p,.header-order strong,.clients-segment-top strong,.clients-activity-row strong){color:#f0f3f9!important}
html[data-theme="dark"] :is(.clients-metric-card small,.clients-metric-card em,.clients-temperature-description strong,.clients-order-history strong,.empty-cart p,.store-signature p,.card-modality,.order-summary span,.list-order-badge,.clients-profile-metrics strong){color:#c2cddd!important}
html[data-theme="dark"] .card-modality{background:#30394a!important}
html[data-theme="dark"] :is(.summary-metrics>div,.card-footer,.clients-comparison,.clients-contact-link,.clients-tag-library,.clients-order-history li,.sidebar-bottom .operator){border-color:#3c4554!important}
html[data-theme="dark"] :is(.clients-list-heading,.clients-toolbar,.clients-pagination,.line-item,.detail-total,.cart-heading,.cart-item,.cart-total,.option-row,.review-item,.review-total,.order-total,.summary-item,.catalog-item){border-color:#3c4554!important}
html[data-theme="dark"] :is(.clients-mini-track,.clients-activity-track){background:#364051!important}
html[data-theme="dark"] :is(.avatar,.bubble-avatar,.customer-avatar,.clients-avatar,.exit-avatar,.help-mark,.empty-bag,.info-symbol){background:#3d2b39!important;color:#ffadbc!important}
html[data-theme="dark"] :is(.detail-price,.price-row strong,.detail-total strong,.order-total strong,.store-wordmark,.small-link,.featured-plus,.product-add){color:#ffa6b5!important}
html[data-theme="dark"] :is(.product-add,.featured-plus){background:#3a2932!important}
html[data-theme="dark"] :is(.form-error,.group-error,.order-form-error,.clients-form-error,.clients-negative){color:#ff9aa7!important}
html[data-theme="dark"] .clients-positive{color:#a0e1b5!important}
html[data-theme="dark"] :is(.clients-notice,.cart-storage-note,.group-unavailable){background:#3d321c!important;color:#f6d58e!important;border-color:#9c803e!important}
html[data-theme="dark"] :is(.toast,.toast.error){background:#2d3645!important;color:#f0f3f9!important;border-color:#6c7e99!important}
html[data-theme="dark"] :is(.whatsapp-banner){background:#20382d!important;color:#c6ebd4!important;border-color:#416b51!important}
html[data-theme="dark"] .whatsapp-banner :is(strong,small){color:#c6ebd4!important}
html[data-theme="dark"] :is(.options-group,.notes-section){border-top-color:#13161d!important}
html[data-theme="dark"] .required-badge{background:#3c3443;color:#e5d9ef}
html[data-theme="dark"] :is(.photo-badge,.mobile-count){background:#e34358;color:#fff}
html[data-theme="dark"] :is(.skeleton,.image-fallback){background:#2a3240!important;color:#b4bfce}
html[data-theme="dark"] .product-hero{background:#161b23}

/* Status colors retain their meaning, including accessible pulsing order alerts. */
html[data-theme="dark"] :is(.clients-tone-green,.status.open,.status.human_active,.card-payment.paid,.clients-temperature-badge){background:#203f32!important;color:#a7e5bd!important}
html[data-theme="dark"] .clients-tone-blue{background:#243852!important;color:#b1d3ff!important}
html[data-theme="dark"] .clients-tone-purple{background:#3b2c51!important;color:#d8bfff!important}
html[data-theme="dark"] :is(.clients-tone-amber,.status.waiting_human,.filter.waiting-pulse,.card-payment.pending){background:#49381c!important;color:#ffdc91!important}
html[data-theme="dark"] :is(.clients-tone-red,.rejected-badge,.rejection-reason,.overdue-badge){background:#4a2631!important;color:#ffadb9!important}
html[data-theme="dark"] :is(.clients-tone-slate,.status.resolved){background:#353e4c!important;color:#d4dce9!important}
html[data-theme="dark"] .column[data-stage="analysis"] .column-header{background:#3c321e!important}
html[data-theme="dark"] .column[data-stage="preparing"] .column-header{background:#3d3024!important}
html[data-theme="dark"] .column[data-stage="ready"] .column-header{background:#24364b!important}
html[data-theme="dark"] .column[data-stage="delivering"] .column-header{background:#213d32!important}
html[data-theme="dark"] .column[data-stage="completed"] .column-header{background:#343140!important}
html[data-theme="dark"] .column-label h3{color:#e7eaf1!important}
html[data-theme="dark"] .column-count{background:#151a22!important;color:#d7e0ed!important}
html[data-theme="dark"] .order-card.analysis-alert{background:#3b321d!important;border-color:#a88a3b!important;animation-name:dark-analysis-pulse}
html[data-theme="dark"] .order-card.overdue{background:#42242d!important;border-color:#b95268!important;animation-name:dark-overdue-pulse}
html[data-theme="dark"] .order-card.overdue .elapsed{background:#572a38!important;color:#ffc1cc!important}
@keyframes dark-analysis-pulse{50%{box-shadow:0 0 0 3px #f0bf4a40}}
@keyframes dark-overdue-pulse{50%{box-shadow:0 0 0 3px #ff5e7c40}}
@media(prefers-reduced-motion:reduce){html[data-theme="dark"] .order-card:is(.analysis-alert,.overdue){animation:none}}
@media(max-width:767px){.appearance-dialog{width:calc(100vw - 24px)}.appearance-header{padding:14px 16px}.appearance-body{padding:6px 16px 16px}.appearance-option{gap:10px}.appearance-option small{font-size:11px}.header-end .appearance-trigger{min-width:40px;width:40px;padding:8px}.inbox-heading .appearance-trigger{min-width:40px;width:40px;padding:8px}}
