/* TaysLink themes. Legacy light layout is retained; chat paint overrides are at the end. */
html[data-theme="light"] {
  color-scheme: light;
  --ink:#243d3a; --muted:#5d716c; --line:#d3ddd7; --border:var(--line);
  --surface:#e8eeE8; --accent:#176b58; --accent-soft:#dcece2;
  --theme-bg:#e5ebe5; --theme-panel:#f6f7f1; --theme-raised:#edf1eb;
  --theme-hover:#e0e9e1; --theme-border:var(--line); --theme-input:#fafbf7;
  --theme-chat:#efeae2; --theme-incoming:#fafbf6; --theme-outgoing:#c9e5d4;
  --theme-subtle:#637770; --theme-error:#a93747; --theme-error-bg:#f9e7e8;
  --theme-success:#216a4b; --theme-warning:#835916; --theme-read:#14699a;
  --light-shadow:0 3px 16px #243d3a08;
  color:var(--ink); background:var(--theme-bg); scrollbar-color:#a9bcb0 transparent;
}
html[data-theme="light"] ::selection { color:#143f32; background:#bcddc8; }
html[data-theme="light"] :is(body,.app-shell,.main-shell,.inbox-layout,.page-view,.reports-view) { color:var(--ink); background:var(--theme-bg); }
html[data-theme="light"] :is(h1,h2,h3,h4) { letter-spacing:-.2px; }

/* Deep green navigation anchors the lighter workspace. */
html[data-theme="light"] .navigation { background:#193e35; border-color:#21493e; padding-top:18px; }
html[data-theme="light"] .navigation .rail-bottom { background:transparent; border-color:#456458; }
html[data-theme="light"] .navigation .nav-item { color:#c1d3c8; border-radius:12px; }
html[data-theme="light"] .navigation .nav-item:hover { color:#fff; background:#2d5447; }
html[data-theme="light"] .navigation .nav-item.active { color:#173d31; background:#d3e8c6; box-shadow:0 3px 12px #0a251528; }
html[data-theme="light"] .navigation .nav-item b { color:#fff; background:#39866a; border:1px solid #193e35; }
html[data-theme="light"] .navigation .nav-divider { background:#446055; }
html[data-theme="light"] .navigation .brand.tayslink-brand { background:#edf3dd; border-radius:12px; box-shadow:0 3px 12px #09261c26; }
html[data-theme="light"] .navigation .rail-bottom :is(.icon-button,#theme-toggle) { color:#ceddd3; background:#294d41; border-color:#476858; box-shadow:none; }
html[data-theme="light"] .navigation .rail-bottom :is(.icon-button,#theme-toggle):hover { color:#fff; background:#365e4e; }
html[data-theme="light"] .navigation .user-avatar { color:#254b37; background:#d3e8c6; border-color:#b6d3af; }
html[data-theme="light"] .inbox-sidebar { background:#eaf0e7; border-color:#d1ddD2; }
html[data-theme="light"] .sidebar-heading { margin-bottom:22px; }
html[data-theme="light"] :is(.sidebar-heading h1,.list-heading h2,.chat-person h2,.customer-identity h3,.customer-details>header h3) { color:#233f34; }
html[data-theme="light"] :is(.inbox-filter,.tag-filter) { color:#52685d; border-radius:9px; }
html[data-theme="light"] :is(.inbox-filter,.tag-filter) svg { color:#617a69; }
html[data-theme="light"] :is(.inbox-filter,.tag-filter):hover { color:#254d3d; background:#dde8da; }
html[data-theme="light"] :is(.inbox-filter,.tag-filter).active { color:#194f39; background:#d1e3ce; box-shadow:inset -3px 0 #397a53; font-weight:600; }
html[data-theme="light"] :is(.inbox-filter,.tag-filter).active :is(svg,b) { color:#275f43; }
html[data-theme="light"] :is(.sidebar-section-title,.sidebar-empty,.sidebar-bottom,.inbox-filter b,.tag-filter b) { color:#607568; }
html[data-theme="light"] .sidebar-section-title { font-weight:700; font-size:11px; }

/* Compact conversation cards; the selection remains clear beside unread rows. */
html[data-theme="light"] #conversation-list-panel {
  --list-hover:#eaf0e8; --list-selected:#dceadf; --list-selected-border:#bed3c2;
  --list-control:#e8eee7; --list-owner:#e4ebe1; --list-name:#263f34; --list-preview:#627368;
  background:#f3f5ee; border-color:var(--line);
}
html[data-theme="light"] #conversation-list-panel .list-heading { min-height:74px; }
html[data-theme="light"] #conversation-list-panel .list-heading h2 { font-size:19px; }
html[data-theme="light"] #conversation-list-panel #show-filters { color:#496556; background:#e8eee4; border-color:#d3dece; border-radius:8px; }
html[data-theme="light"] #conversation-list-panel>.search-field { background:#e6ece2; border:1px solid #d9e1d4; border-radius:11px; }
html[data-theme="light"] #conversation-list-panel>.search-field:focus-within { background:#fafbf6; border-color:var(--accent); box-shadow:0 0 0 3px #176b5810; }
html[data-theme="light"] #conversation-list { padding:4px 9px; }
html[data-theme="light"] #conversation-list .conversation-row { padding:15px 11px; margin-bottom:5px; border:1px solid transparent; border-bottom-color:#dde5d9; border-radius:12px; }
html[data-theme="light"] #conversation-list .conversation-row:hover { background:var(--list-hover); border-color:#d4dfcf; }
html[data-theme="light"] #conversation-list .conversation-row.selected { background:#dceadf; border-color:#bed3c2; box-shadow:0 3px 8px #30523807; }
html[data-theme="light"] #conversation-list .conversation-row.selected:before { background:#357b54; width:3px; top:20px; bottom:20px; border-radius:3px; }
html[data-theme="light"] #conversation-list .row-top b { color:#263f34; }
html[data-theme="light"] #conversation-list :is(.row-top time,.row-bottom p,.row-labels) { color:#5e7465; }
html[data-theme="light"] #conversation-list .has-unread .row-bottom p { color:#344e40; }
html[data-theme="light"] #conversation-list .has-unread .row-top time { color:#256746; }
html[data-theme="light"] #conversation-list .unread-count { color:#fff; background:#286f52; }
html[data-theme="light"] #conversation-list .row-owner { color:#536950; background:#e5ebdf; border-radius:5px; }
html[data-theme="light"] #conversation-list-panel .list-footer { color:#647869; background:#ebf0e7; border-color:#d6e0d1; }
html[data-theme="light"] :is(.list-controls select,.list-tools,.active-filters) { background:#e7ede3; color:#51664f; border-color:var(--line); }
html[data-theme="light"] .panel-resizer { background:#d3ddd5; }
html[data-theme="light"] .panel-resizer:hover { background:#95b5a3; }

/* Conversation canvas and messages: quiet texture, stronger typography. */
html[data-theme="light"] :is(.topbar,.chat-header,.assignment-strip) { background:#f1f4ed; border-color:#d0dcd1; }
html[data-theme="light"] .chat-header { box-shadow:0 3px 14px #2c4c3707; }
html[data-theme="light"] .chat-panel { background:var(--theme-chat); }
/* Preserve the existing chat wallpaper, tint and scale in styles.css. */
html[data-theme="light"] .chat-empty { background:radial-gradient(ellipse at 50% 40%,#eff4e9 0%,#e0e8db 78%); }
html[data-theme="light"] .chat-empty h2 { color:#37553e; font-size:24px; font-weight:600; }
html[data-theme="light"] .chat-empty p { color:#61725f; }
html[data-theme="light"] .empty-chat-art { background:#f6f9ef; border-color:#cedbc4; box-shadow:0 0 0 14px #dbe6d580,0 12px 30px #2c493c10; }
html[data-theme="light"] .message-line .bubble { background:#fafbf6; border:1px solid #d6e0d1; color:#263e32; box-shadow:0 2px 4px #2b49300a; border-radius:14px 14px 14px 4px; }
html[data-theme="light"] .message-line.out .bubble { color:#204b36; background:#c9e5d4; border-color:#b7d6c0; border-radius:14px 14px 4px 14px; }
html[data-theme="light"] :is(.date-divider,.load-older,#jump-latest) { color:#516953; background:#eff4e9; border:1px solid #d3deca; border-radius:20px; box-shadow:0 2px 5px #2d4b3507; }
html[data-theme="light"] :is(.message-meta,.message-author,.automation-label,.chat-person>span,.chat-person bdi,.header-reply-window,.chat-context,.state-label) { color:#5b7060; }
html[data-theme="light"] .message-tools button { color:#516953; }
html[data-theme="light"] .message-tools button:hover { color:#1e6241; background:#f5f8ef; }
html[data-theme="light"] .composer-area { background:#e9eee5; border-color:#d1dccb; }
html[data-theme="light"] .composer { background:#fafbf6; border-color:#c9d7c4; box-shadow:0 3px 12px #2649320a; }
html[data-theme="light"] .composer:focus-within { border-color:#5d9274; box-shadow:0 0 0 3px #176b5812; }
html[data-theme="light"] .composer #message-input { color:#263e32; background:transparent; }
html[data-theme="light"] .composer #message-input::placeholder { color:#657760; }
html[data-theme="light"] .composer-actions :is(#emoji-toggle,#sticker-toggle,#quick-toggle,#template-toggle,#attach-image) { color:#587060; background:transparent; }
html[data-theme="light"] .composer-actions :is(#emoji-toggle,#sticker-toggle,#quick-toggle,#template-toggle,#attach-image):hover { color:#205c40; background:#dfebd9; }
html[data-theme="light"] .composer-actions :is(#record-audio,#send-message) { color:#fff; background:#246a4d; box-shadow:0 3px 8px #246a4d24; }
html[data-theme="light"] .composer-actions :is(#record-audio,#send-message):hover { background:#195438; }
html[data-theme="light"] :is(.message-search-bar,.permission-notice,.closed-conversation-bar,.reply-preview,.message-quote) { background:#e9f0e3; color:#4d6553; border-color:#c9d9c5; }

/* Customer information has its own slightly cooler surface. */
html[data-theme="light"] .customer-details { background:#edf2ec; border-color:#cfdcd1; }
html[data-theme="light"] .customer-details>header { background:#e5ede3; border-bottom:1px solid #d4dfd0; }
html[data-theme="light"] .customer-identity { background:#e6eee3; border-bottom:1px solid #d2decc; padding-bottom:20px; }
html[data-theme="light"] .customer-identity .big { box-shadow:0 0 0 5px #f4f7ed; }
html[data-theme="light"] .workflow-card { background:#f6f8f0; border-color:#cedcc6; border-radius:12px; }
html[data-theme="light"] .details-tabs { background:#e3ecdf; border-color:#cddbc6; }
html[data-theme="light"] .details-tabs button { color:#5d735b; }
html[data-theme="light"] .details-tabs button.active { color:#235b3b; border-color:#30734b; background:#f0f5e9; }
html[data-theme="light"] :is(.details-block,.note-form,.activity-entry) { border-color:#d2dfce; }
html[data-theme="light"] :is(.details-block h4,.details-block dt,.note-form label,.customer-details small) { color:#566d56; }
html[data-theme="light"] :is(.details-block dd,.details-block p) { color:#304c37; }
html[data-theme="light"] .customer-insight-metrics>div { background:#e0eade; border:1px solid #d1dfcb; border-radius:10px; }
html[data-theme="light"] .note-entry { background:#f3ecd6; border-color:#dfd2aa; }
html[data-theme="light"] .note-entry :is(b,p) { color:#65522e; }

/* Reusable surfaces across contacts, transfers, settings and reports. */
html[data-theme="light"] :is(.table-wrap,.settings-card,.team-stat,.report-period-form,.report-summary-card,.report-route,.report-empty) { color:var(--ink); background:var(--theme-panel); border-color:var(--line); border-radius:14px; box-shadow:var(--light-shadow); }
html[data-theme="light"] .page-heading { border-bottom:1px solid #cfdbd3; padding-bottom:24px; }
html[data-theme="light"] .page-heading h1 { font-size:27px; color:#27483e; }
html[data-theme="light"] :is(.settings-card h2,.dialog-heading h2,.report-section-heading h2,.report-route-person b,.contact-cell b,.report-staff-table .contact-cell b,.report-summary-card strong,.report-staff-table td>strong) { color:var(--ink); }
html[data-theme="light"] :is(.page-heading p,.reports-view .page-heading p,.settings-card p,.settings-card small,.report-section-heading p,.report-footnote,.report-summary-card>div>span,.report-summary-card small,.report-route-person span,.report-route-total>span,.report-route-total small,.report-period-caption,.report-period-caption small,.field-hint,.table-subline,.contact-cell small,.eyebrow) { color:var(--muted); }
html[data-theme="light"] :is(th,.report-staff-table th) { color:#4f695b; background:#e1e9df; border-color:var(--line); padding-block:15px; }
html[data-theme="light"] :is(td,.report-staff-table td) { color:#3e554b; border-color:#dce4d9; }
html[data-theme="light"] tbody tr:nth-child(even) { background:#eff3eb; }
html[data-theme="light"] tbody tr:hover { background:#e3eddf; }
html[data-theme="light"] :is(.report-card-icon,.workspace-icon,.stage-badge) { background:#d9e8d5; color:#2c6646; }
html[data-theme="light"] .report-summary-card strong { color:#2d6549; }
html[data-theme="light"] :is(.team-chip,.reply-number,.pill.subtle) { color:#546d5a; background:#e5edde; border-color:#cbdcc3; }
html[data-theme="light"] :is(.cash-status-bar,.cash-message,.cash-card,.cash-workbench,.cash-workbench-card,.cash-sound-settings,.contacts-summary,.contacts-stat) { background:var(--theme-panel); border-color:var(--line); box-shadow:var(--light-shadow); }

/* Inputs and overlays share the same material and readable focus states. */
html[data-theme="light"] :is(input,textarea,select) { color:var(--ink); background-color:var(--theme-input); border-color:#bfcfc1; border-radius:9px; caret-color:var(--accent); }
html[data-theme="light"] :is(input,textarea)::placeholder { color:#637565; opacity:1; }
html[data-theme="light"] :is(input,textarea,select):focus { border-color:var(--accent); box-shadow:0 0 0 3px #176b5814; }
html[data-theme="light"] :is(input[type="checkbox"],input[type="radio"]) { accent-color:var(--accent); }
html[data-theme="light"] :is(button,a,summary):focus-visible { outline:2px solid #277f60; outline-offset:3px; }
html[data-theme="light"] :is(.search-field,.wide) { background:#e7eee3; border-color:#d0ddca; border-radius:10px; color:var(--muted); }
html[data-theme="light"] .search-field input { background:transparent; }
html[data-theme="light"] .primary-button { color:#fff; background:#216d52; border-color:#216d52; border-radius:10px; box-shadow:0 3px 8px #216d5217; }
html[data-theme="light"] .primary-button:hover:not(:disabled) { background:#18563e; border-color:#18563e; }
html[data-theme="light"] .outline-button { color:#3f614c; background:#f2f6ec; border-color:#bfd0b9; border-radius:10px; }
html[data-theme="light"] .outline-button:hover:not(:disabled) { color:#234d34; background:#e2ecd9; border-color:#9cb591; }
html[data-theme="light"] :is(.icon-button,.text-button,.assignment-button,.handoff-button) { color:#557460; }
html[data-theme="light"] :is(.icon-button,.text-button):hover { color:#23573b; background:#deead6; }
html[data-theme="light"] :is(.workspace-menu,.quick-menu,.mobile-more-menu,.emoji-menu,.sticker-picker,dialog,.chat-header-actions.actions-open) { color:var(--ink); background:#f2f5ec; border-color:#c7d7be; box-shadow:0 22px 70px #16352930; border-radius:16px; }
html[data-theme="light"] dialog::backdrop { background:#142d2582; backdrop-filter:blur(4px); }
html[data-theme="light"] :is(.menu-action,.tenant-option,.demo-switch-option,.quick-option):hover { color:#28563b; background:#e1ebd9; }
html[data-theme="light"] :is(.tenant-option.active,.quick-option.active) { color:#28563b; background:#d7e7ce; }
html[data-theme="light"] .segmented { background:#e0e9da; border-color:#c9d9c0; padding:4px; border-radius:11px; }
html[data-theme="light"] .segmented button { color:#5b705a; border-radius:8px; }
html[data-theme="light"] .segmented button.active { color:#28563b; background:#f8faf2; box-shadow:0 2px 6px #35523512; }
html[data-theme="light"] :is(.info-note,.message-preview) { color:#436246; background:#e3eddb; border-color:#c2d6b6; }
html[data-theme="light"] :is(.form-error,.error-banner) { color:var(--theme-error); background:var(--theme-error-bg); border-color:#e5bbc0; }
html[data-theme="light"] .pill.live { background:#dceedd; color:#32633f; border-color:#b7d5b8; }

/* The shipping catalogue inherits the workspace palette without flattening metric colors. */
html[data-theme="light"] #products-view { --ink:#293f39; --muted:#60736a; --line:#ccd9cf; --accent:#286c53; --accent-soft:#dcebdd; --product-card:#f4f7ee; --product-soft:#e8eee2; --shipping-bg:#e3ebe1; --shipping-icon:#dce8d3; background:var(--shipping-bg); }
html[data-theme="light"] #products-view .products-section-nav { background:#eaf1e4; border-color:#cbdcc2; box-shadow:none; }
html[data-theme="light"] #products-view .primary-button { background:#286c53; border-color:#286c53; }
html[data-theme="light"] #products-view .primary-button:hover { background:#20543f; }
html[data-theme="light"] #products-view :is(.product-game,.product-bundle) { border-radius:16px; box-shadow:0 4px 16px #2b4a3407; }
html[data-theme="light"] #products-view .shipping-period-shortcuts { background:#edf3e6; }
html[data-theme="light"] #products-view .product-overview-grid .settings-card { border-radius:16px; }
html[data-theme="light"] .pa-dialog { --pa-bg:#e9f0e4; --pa-card:#f6f8f0; --pa-text:#283f35; --pa-muted:#59705d; --pa-line:#c7d8bf; --pa-accent:#296e4a; }

/* Desktop shipping used a fixed dark palette. Light now has a complete matching flow. */
html[data-theme="light"] dialog.desktop-shipping-dialog {
  --ds-bg:#eaf0e5; --ds-card:#f7f9f1; --ds-line:#c8d8c0; --ds-text:#2a4333;
  --ds-muted:#5e765f; --ds-blue:#326d52; --ds-green:#246b44;
  color:var(--ds-text); background:var(--ds-bg); border-color:var(--ds-line);
}
html[data-theme="light"] dialog.qr-shipping-dialog { background:var(--ds-bg); color:var(--ds-text); border-color:var(--ds-line); }
html[data-theme="light"] dialog.desktop-shipping-dialog :is(input:not([type=checkbox]),select,textarea) { color:var(--ds-text); background:#fafcf5; border-color:var(--ds-line); }
html[data-theme="light"] .desktop-shipping-dialog :is(label,small,.ds-section-label,.ds-check,.ds-edit-check,.ds-review-lookup,.ds-existing-review p,.ds-existing-review small,.ds-review-audit small) { color:#587151; }
html[data-theme="light"] .qr-order-grid>section { background:#f4f8ed; border-color:#c8d8c0; }
html[data-theme="light"] .qr-order-grid>section>header { background:#e4eddc; border-color:#c8d8c0; }
html[data-theme="light"] :is(.qr-order-grid header p,.qr-games small,.qr-pack small,.qr-jobs small,.qr-jobs>p,.qr-totals span,.qr-order-footer p,.ds-device-copy p,.ds-device-copy small) { color:#5d745c; }
html[data-theme="light"] :is(.qr-step,.qr-method-icon,.qr-methods>button:last-child .qr-method-icon,.ds-device-icon) { color:#336b47; background:#dfecd6; border-color:#bfd4b5; }
html[data-theme="light"] .qr-games button { background:#eaf2e2; color:#35513a; border-color:#cadcbe; }
html[data-theme="light"] .qr-games button[aria-pressed=true] { background:#d5e8c9; border-color:#7caa69; }
html[data-theme="light"] .qr-game-symbol { color:#3e6b45; background:#c5ddb7; }
html[data-theme="light"] .qr-categories button { color:#536c51; background:#e4ecdc; }
html[data-theme="light"] .qr-categories button[aria-pressed=true] { color:#f7fff0; background:#376d46; border-color:#376d46; }
html[data-theme="light"] .qr-shipping-dialog .qr-pack { color:#304f36; background:linear-gradient(155deg,#f8fbf2,#e6efdf); border-color:#c8d9bf; }
html[data-theme="light"] .qr-shipping-dialog .qr-pack:hover:not(:disabled) { background:#e0eed4; border-color:#86ae72; }
html[data-theme="light"] .qr-shipping-dialog .qr-pack[aria-pressed=true] { background:#d8e9ca; border-color:#66964f; box-shadow:inset 0 0 0 1px #66964f; }
html[data-theme="light"] .qr-pack strong { color:#2f6641; }
html[data-theme="light"] .qr-pack-check { color:#678260; background:#e0ebd7; }
html[data-theme="light"] .qr-pack[aria-pressed=true] .qr-pack-check { color:#fff; background:#457939; }
html[data-theme="light"] .qr-pack img { filter:drop-shadow(0 4px 6px #25441c20); }
html[data-theme="light"] :is(.qr-totals,.qr-shipping-dialog .qr-order-footer) { color:#31523b; background:#dfead6; border-color:#bfd1b3; }
html[data-theme="light"] .qr-totals .qr-profit { border-color:#bfd1b3; }
html[data-theme="light"] .qr-profit b { color:#326536; }
html[data-theme="light"] .qr-selected-receipt { background:#dcebd4; border-color:#7ea968; }
html[data-theme="light"] .qr-selected-receipt b { color:#28502c; }
html[data-theme="light"] .qr-selected-receipt small { color:#536f49; }
html[data-theme="light"] :is(.ds-device,.ds-setup,.ds-stats>div,.ds-review-summary) { background:#e1ebd9; border-color:#bfd2b5; }
html[data-theme="light"] :is(.ds-close,.ds-icon-button,.ds-soft) { color:#496344; background:#e3ecda; border-color:#bccfb0; }
html[data-theme="light"] :is(.ds-close,.ds-icon-button,.ds-soft):hover { color:#2d5030; background:#d4e4c9; }
html[data-theme="light"] .ds-primary { background:#397444; color:#fff; border-color:#397444; }
html[data-theme="light"] .ds-primary:hover { background:#2e6036; }
html[data-theme="light"] :is(.ds-eyebrow,.ds-setup ol,.ds-setup bdi,.ds-pair-result>span,.ds-pair-result small,.ds-pending-label,.ds-pending-request p,.ds-pending-request>bdi,.ds-label-hint,.ds-caption,.ds-customers bdi,.ds-selected-product small,.ds-profit>span,.ds-profit small,.ds-receipts>p,.ds-stats>div>span:last-child,.ds-job-main>p,.ds-job-meta,.ds-job-meta>bdi,.ds-job-amount>small,.ds-empty,.ds-queue-footer,.ds-chosen-customer small,.ds-chosen-customer bdi,.ds-review-title p,.ds-review-summary dt) { color:#587151; }
html[data-theme="light"] :is(.ds-card h3,.ds-pending-request b,.ds-receipts b,.ds-stats b,.ds-job-amount>b,.ds-empty h3,.ds-review-title h4,.ds-review-summary dd,.ds-pair-result .ds-pair-code) { color:#2c4d32; }
html[data-theme="light"] :is(.ds-section-icon,.ds-avatar,.ds-job-number,.ds-queue h3>span) { color:#466b48; background:#dae7d0; border-color:#bfd1b5; }
html[data-theme="light"] :is(.ds-customers button,.ds-game-options button,.ds-receipts>button) { background:#f3f7eb; color:#44623f; border-color:#c6d7bc; }
html[data-theme="light"] :is(.ds-customers button[aria-pressed=true],.ds-game-options button[aria-pressed=true],.ds-receipts>button[aria-pressed=true]) { color:#305132; background:#d5e7ca; border-color:#7fac6e; }
html[data-theme="light"] :is(.ds-pending-request,.ds-selected-product,.ds-pair-result,.ds-success-review) { color:#35533a; background:#e1edd7; border-color:#b6cfa7; }
html[data-theme="light"] :is(.ds-selected-product span:not(.ds-package-art),.ds-customer-check,.ds-customer-selected-check,.ds-review-action,.ds-review-title>svg,.ds-profit>b) { color:#326b3e; }
html[data-theme="light"] :is(.ds-setup-content,.ds-pending-request>div,.ds-job) { border-color:#c8d8be; }
html[data-theme="light"] .ds-connection { color:#5b7054; background:#dfe8d7; border-color:#b8caae; }
html[data-theme="light"] :is(.ds-connection.is-online,.ds-status-success,.ds-green,.ds-message) { color:#2e653b; background:#d8ead4; border-color:#aacb9f; }
html[data-theme="light"] :is(.ds-status-queued,.ds-blue) { color:#495994; background:#e2e7f4; border-color:#c2cbea; }
html[data-theme="light"] .ds-status-working { color:#286182; background:#d7e9ed; border-color:#abcdd4; }
html[data-theme="light"] :is(.ds-status-attention,.ds-amber,.ds-offline-note,.ds-cash-warning,.ds-job-main>.ds-job-note) { color:#79591c; background:#f1e8cd; border-color:#d6c591; }
html[data-theme="light"] .ds-status-muted { color:#606e5b; background:#e2e8dc; border-color:#c7d1be; }
html[data-theme="light"] :is(.ds-danger,.ds-status-failed,.ds-red,.ds-profit>b.ds-negative,.ds-revoke-confirm p) { color:#a13f44; }
html[data-theme="light"] :is(.ds-message.ds-error,.ds-poll-error,.ds-job:has(.ds-status-failed) .ds-job-note) { color:#a13f44; background:#f5e2df; border-color:#dfb3aa; }
/* Match the existing important error rule without affecting the dark theme. */
html[data-theme="light"] .ds-error { color:#a13f44!important; }
html[data-theme="light"] .ds-queue-footer { background:#e1ebd9; }
html[data-theme="light"] .ds-setup a { color:#336b48; }

/* Login also uses a softer, layered surface. */
html[data-theme="light"] .auth-side { background:#e8eee2; }
html[data-theme="light"] .auth-card { background:#f6f8ef; border:1px solid #d0ddc7; border-radius:24px; padding:34px; box-shadow:0 18px 60px #203e2b0d; }
html[data-theme="light"] .auth-card h2 { color:#2d4e35; }
html[data-theme="light"] :is(.auth-card>p,.auth-card label,.auth-card-eyebrow) { color:#5e765b; }

@media (max-width:720px) {
  html[data-theme="light"] #mobile-nav { background:#e8f0e0; border-color:#c7d8bb; }
  html[data-theme="light"] #mobile-nav button { color:#5a7052; }
  html[data-theme="light"] #mobile-nav button.active { color:#285f37; background:#d4e6c9; }
  html[data-theme="light"] .navigation { padding-top:0; border-color:#2c5442; }
  html[data-theme="light"] .navigation .nav-item.active { background:#d3e8c6; }
  html[data-theme="light"] .mobile-more-menu :is(.nav-item,#theme-toggle,.icon-button) { color:#4c684d; background:transparent; }
  html[data-theme="light"] .mobile-more-menu .nav-item.active { color:#255d39; background:#dcebd3; }
  html[data-theme="light"] .messages { padding:20px 14px; }
  html[data-theme="light"] .page-heading h1 { font-size:23px; }
  html[data-theme="light"] .page-heading { padding-bottom:18px; }
  html[data-theme="light"] .auth-card { padding:26px 20px; border-radius:18px; }
}
@media (prefers-reduced-motion:reduce) {
  html[data-theme="light"] :is(.conversation-row,.primary-button,.outline-button) { transition:none; }
}

/* Chat materials: paint only. Keep the existing DOM, geometry, icons and wallpaper. */
html[data-theme="dark"] {
  --chat-ui-bg:#091b20; --chat-ui-panel:#10252b; --chat-ui-raised:#19313a;
  --chat-ui-input:#142b33; --chat-ui-hover:#203c43; --chat-ui-line:#304c52;
  --chat-ui-ink:#eff7f6; --chat-ui-muted:#b1c4c6; --chat-ui-accent:#4ad9b5;
  --chat-ui-soft:#153f36; --chat-ui-selected:#123c36; --chat-ui-selected-line:#35bf9d;
  --chat-ui-incoming:#1b303b; --chat-ui-outgoing:#0e493f; --chat-ui-outgoing-line:#398371;
  --chat-ui-primary-ink:#082c23; --chat-ui-error:#ff95a1; --chat-ui-error-bg:#39262e;
  --chat-ui-error-line:#73414b; --chat-ui-warning:#e8bd74; --chat-ui-read:#71c7f2;
  --chat-ui-success:#79d9b4; --chat-ui-highlight:#c9fff31b; --chat-ui-edge-dark:#00121966;
  --chat-ui-surface:linear-gradient(155deg,#90efd412 0%,transparent 36%),linear-gradient(180deg,#163037 0%,#10252b 42%,#0f2229 100%);
  --chat-ui-control:linear-gradient(150deg,#b7edec0c,transparent 48%),linear-gradient(180deg,#203640,#152a33);
  --chat-ui-header:radial-gradient(ellipse at 25% 0%,#6edbbc13,transparent 70%),linear-gradient(180deg,#1a343b,#10272e);
  --chat-ui-selected-fill:radial-gradient(ellipse at 0% 0%,#43f0bc20,transparent 64%),linear-gradient(135deg,#195246 0%,#123d36 46%,#0e2c2b 100%);
  --chat-ui-incoming-fill:linear-gradient(150deg,#a9deed0e,transparent 55%),linear-gradient(180deg,#243d49,#192f39);
  --chat-ui-outgoing-fill:radial-gradient(ellipse at 10% 0%,#7cffe735,transparent 58%),linear-gradient(160deg,#0c6153,#073f39 58%,#075047);
  --chat-ui-bubble-glass:inset 0 1px 0 #a1ffe344,inset 1px 0 0 #65f5d51a,inset 0 -1px 2px #001e2359,0 3px 10px #00000024;
  --chat-ui-composer:radial-gradient(ellipse at 0% 0%,#51ceab10,transparent 62%),linear-gradient(180deg,#1c363f,#142c35);
  --chat-ui-primary-fill:radial-gradient(ellipse at 18% 0%,#b9ffe444,transparent 54%),linear-gradient(150deg,#1aaf86,#087c63 63%,#066451);
  --chat-ui-primary-text:#f5fffb;
  --chat-ui-action-fill:radial-gradient(ellipse at 10% 0%,#ba92ec38,transparent 65%),linear-gradient(155deg,#49365f,#342a47 65%,#2d223e);
  --chat-ui-action-ink:#d7c0f1; --chat-ui-action-line:#776090;
  --chat-ui-nav-fill:radial-gradient(ellipse at 0% 0%,#b4ffe969 0%,#41dcaa22 33%,transparent 69%),linear-gradient(145deg,#0e806b 0%,#104a43 51%,#0a332f 100%);
  --chat-ui-nav-ink:#dcfff4; --chat-ui-nav-edge:#69e4c4a6; --chat-ui-nav-sheen:#c4ffeb70;
  --chat-ui-nav-depth:#001e1d9c; --chat-ui-nav-glow:#1fd1a859;
  --chat-ui-shadow:0 3px 10px #00000024; --chat-ui-popup-shadow:0 16px 40px #00000059;
  --chat-ui-edge:inset 0 1px 0 var(--chat-ui-highlight),inset 0 -1px 0 var(--chat-ui-edge-dark);
  --chat-ui-selected-shadow:inset 0 0 0 1px #61e1ba24,inset 0 1px 0 #8dffda24,inset 0 -1px 0 #001d2073,0 3px 10px #00000026,0 0 8px -3px #20d6a94d;
  --chat-ui-focus:0 0 0 3px #4ad9b52b; --chat-ui-pressed:inset 0 2px 5px #00191673;
  --chat-ui-wallpaper-tint:#091b20bc; --chat-ui-scroll:#456268;
}
html[data-theme="light"] {
  --chat-ui-bg:#f1f8f6; --chat-ui-panel:#ffffff; --chat-ui-raised:#f6fbf9;
  --chat-ui-input:#f3f8f7; --chat-ui-hover:#e8f3ef; --chat-ui-line:#cedfd9;
  --chat-ui-ink:#182f32; --chat-ui-muted:#506c68; --chat-ui-accent:#0b7b60;
  --chat-ui-soft:#dbf3e8; --chat-ui-selected:#ddf7eb; --chat-ui-selected-line:#359c7e;
  --chat-ui-incoming:#ffffff; --chat-ui-outgoing:#d4f6e7; --chat-ui-outgoing-line:#a8d9c7;
  --chat-ui-primary-ink:#ffffff; --chat-ui-error:#b63c51; --chat-ui-error-bg:#fff0f2;
  --chat-ui-error-line:#e8b9c3; --chat-ui-warning:#916416; --chat-ui-read:#087ca9;
  --chat-ui-success:#197859; --chat-ui-highlight:#ffffffed; --chat-ui-edge-dark:#a9cdb81a;
  --chat-ui-surface:linear-gradient(150deg,#ffffff 0%,#fbfefd 44%,#f1f9f6 100%);
  --chat-ui-control:linear-gradient(180deg,#ffffffd9,#ffffff00 50%),linear-gradient(135deg,#f8fbfa,#eef6f2);
  --chat-ui-header:linear-gradient(180deg,#ffffff,#f4fbf8);
  --chat-ui-selected-fill:radial-gradient(ellipse at 0% 0%,#ffffffbd,transparent 64%),linear-gradient(135deg,#d8f7e9,#e9fcf3 55%,#d7f1e5);
  --chat-ui-incoming-fill:linear-gradient(155deg,#ffffff 0%,#ffffff 62%,#f7fbf9 100%);
  --chat-ui-outgoing-fill:linear-gradient(180deg,#ffffff8c,#ffffff00 48%),linear-gradient(130deg,#d3f8e7,#d7f8eb 55%,#c9f1e0);
  --chat-ui-bubble-glass:inset 0 1px 0 #ffffffed,inset 1px 0 0 #ffffff88,inset 0 -1px 1px #77b99c24,0 3px 10px #173f3514;
  --chat-ui-composer:linear-gradient(180deg,#ffffff,#f6fcf9);
  --chat-ui-primary-fill:radial-gradient(ellipse at 16% 0%,#adffde42,transparent 56%),linear-gradient(145deg,#0b9b73,#06815f 64%,#067055);
  --chat-ui-primary-text:#ffffff;
  --chat-ui-action-fill:linear-gradient(155deg,#fbf7ff,#e9e0f7 62%,#dccbec);
  --chat-ui-action-ink:#6a439c; --chat-ui-action-line:#bda4d7;
  --chat-ui-nav-fill:radial-gradient(ellipse at 0% 0%,#b2ffe785 0%,#6dffc324 33%,transparent 68%),linear-gradient(145deg,#07976e 0%,#078362 56%,#076b53 100%);
  --chat-ui-nav-ink:#ffffff; --chat-ui-nav-edge:#069d7470; --chat-ui-nav-sheen:#d7ffed9c;
  --chat-ui-nav-depth:#005e4366; --chat-ui-nav-glow:#15a77d38;
  --chat-ui-shadow:0 3px 10px #173f3514; --chat-ui-popup-shadow:0 16px 40px #173f3526;
  --chat-ui-edge:inset 0 1px 0 var(--chat-ui-highlight),inset 0 -1px 0 var(--chat-ui-edge-dark);
  --chat-ui-selected-shadow:inset 0 1px 0 #ffffffee,inset 0 -1px 0 #9bceb426,0 3px 10px #17604312,0 0 7px -3px #38b88f2e;
  --chat-ui-focus:0 0 0 3px #0b7b601c; --chat-ui-pressed:inset 0 2px 4px #17514020;
  --chat-ui-wallpaper-tint:#f2f9f6c4; --chat-ui-scroll:#a8c2b7;
}

/* Scope the palette to the inbox and its existing overlays, not the login or business dashboards. */
html[data-theme] :is(.navigation,#inbox-view,#workspace-menu,#mobile-more-menu,#chat-copy-menu,#conversation-context-menu,#action-dialog,#demo-dialog,#toast) {
  --ink:var(--chat-ui-ink); --muted:var(--chat-ui-muted); --line:var(--chat-ui-line); --border:var(--line);
  --surface:var(--chat-ui-raised); --accent:var(--chat-ui-accent); --accent-soft:var(--chat-ui-soft);
  --theme-bg:var(--chat-ui-bg); --theme-panel:var(--chat-ui-panel); --theme-raised:var(--chat-ui-raised);
  --theme-hover:var(--chat-ui-hover); --theme-border:var(--line); --theme-input:var(--chat-ui-input);
  --theme-chat:var(--chat-ui-bg); --theme-incoming:var(--chat-ui-incoming); --theme-outgoing:var(--chat-ui-outgoing);
  --theme-subtle:var(--muted); --theme-error:var(--chat-ui-error); --theme-error-bg:var(--chat-ui-error-bg);
  --theme-warning:var(--chat-ui-warning); --theme-success:var(--chat-ui-success); --theme-read:var(--chat-ui-read);
  color:var(--ink); scrollbar-color:var(--chat-ui-scroll) transparent;
}
html[data-theme] #inbox-view { background:var(--theme-bg); }
html[data-theme] #app :is(.navigation,.inbox-sidebar,.customer-details) {
  background:var(--chat-ui-surface); border-color:var(--line); box-shadow:var(--chat-ui-edge);
}
html[data-theme] #app .navigation .nav-divider { background:var(--line); }
html[data-theme] #app .navigation .nav-item { color:var(--muted); }
html[data-theme] #app .navigation .rail-bottom :is(.icon-button,#theme-toggle) { color:var(--muted); background:var(--chat-ui-control); border-color:var(--line); box-shadow:var(--chat-ui-edge); }
html[data-theme] #app .navigation .nav-item:not(.active):hover,
html[data-theme] #app .navigation .rail-bottom :is(.icon-button,#theme-toggle):hover { color:var(--ink); background:var(--theme-hover); border-color:var(--line); }
html[data-theme] #app .navigation .nav-item.active {
  color:var(--chat-ui-nav-ink); background:var(--chat-ui-nav-fill); border-radius:11px;
  box-shadow:inset 0 0 0 1px var(--chat-ui-nav-edge),inset 1px 1px 1px var(--chat-ui-nav-sheen),inset -1px -2px 3px var(--chat-ui-nav-depth),0 3px 7px #001c2524,0 0 8px -3px var(--chat-ui-nav-glow);
}
html[data-theme] #app .navigation .nav-item.active:hover { box-shadow:inset 0 0 0 1px var(--chat-ui-nav-sheen),inset 1px 1px 2px var(--chat-ui-nav-sheen),inset -1px -2px 3px var(--chat-ui-nav-depth),0 3px 7px #001c2524,0 0 10px -3px var(--chat-ui-nav-glow); }
html[data-theme] #app .navigation .nav-item.active:active { box-shadow:inset 0 0 0 1px var(--chat-ui-nav-edge),inset 0 2px 5px var(--chat-ui-nav-depth),0 0 6px -3px var(--chat-ui-nav-glow); }
html[data-theme] #app .navigation .nav-item b { color:var(--chat-ui-primary-ink); background:var(--accent); border-color:var(--theme-panel); }
html[data-theme] #app .navigation .user-avatar { color:var(--accent); background:var(--accent-soft); border-color:var(--line); }
html[data-theme] #app .navigation .rail-bottom { background:transparent; border-color:var(--line); }
/* Paint transitions never scale the navigation or disturb its fixed icon positions. */
html[data-theme] #app .navigation .nav-item { transition:color 180ms ease,background-color 180ms ease,box-shadow 180ms ease; }
html[data-theme] #app .navigation .nav-item:active { scale:1; }
html[data-theme] #inbox-view :is(.icon-button,.outline-button,.primary-button,.search-field,.composer,.audio-play,.audio-speed),
html[data-theme] #inbox-view #conversation-list .conversation-row { transition:color 180ms ease,background-color 180ms ease,border-color 180ms ease,box-shadow 180ms ease; }
html[data-theme] #inbox-view :is(.icon-button,.outline-button,.primary-button,.audio-play):active:not(:disabled) { box-shadow:var(--chat-ui-pressed); }
/* The logo artwork and its existing backing are deliberately untouched. */
html[data-theme] #inbox-view :is(.sidebar-heading h1,.list-heading h2,.chat-person h2,.customer-identity h3,.customer-details>header h3) { color:var(--ink); }
html[data-theme] #inbox-view :is(.sidebar-section-title,.sidebar-empty,.sidebar-bottom,.inbox-filter,.tag-filter,.inbox-filter svg,.tag-filter svg,.inbox-filter b,.tag-filter b) { color:var(--muted); }
html[data-theme] #inbox-view :is(.inbox-filter,.tag-filter):hover { background:var(--theme-hover); color:var(--ink); }
html[data-theme] #inbox-view :is(.inbox-filter,.tag-filter).active { background:var(--accent-soft); color:var(--accent); box-shadow:inset -3px 0 var(--accent); }
html[data-theme] #inbox-view :is(.inbox-filter,.tag-filter).active :is(svg,b) { color:var(--accent); }

html[data-theme] #inbox-view #conversation-list-panel {
  --list-hover:var(--theme-hover); --list-selected:var(--chat-ui-selected); --list-selected-border:var(--chat-ui-selected-line);
  --list-control:var(--theme-input); --list-owner:var(--theme-raised); --list-name:var(--ink); --list-preview:var(--muted);
  background:var(--chat-ui-surface); border-color:var(--line); box-shadow:var(--chat-ui-edge);
}
html[data-theme] #inbox-view #conversation-list .conversation-row { background:transparent; border-bottom-color:color-mix(in srgb,var(--line) 65%,transparent); }
html[data-theme] #inbox-view #conversation-list .conversation-row:hover { background:var(--list-hover); border-color:var(--line); }
html[data-theme] #inbox-view #conversation-list .conversation-row.selected {
  background:var(--chat-ui-selected-fill);
  border-color:var(--list-selected-border); box-shadow:inset 0 0 0 1px var(--list-selected-border),var(--chat-ui-selected-shadow);
}
html[data-theme] #inbox-view #conversation-list .conversation-row.selected:before { background:var(--accent); }
html[data-theme] #inbox-view #conversation-list .row-top b { color:var(--ink); }
html[data-theme] #inbox-view #conversation-list :is(.row-top time,.row-bottom p,.row-labels) { color:var(--muted); }
html[data-theme] #inbox-view #conversation-list .has-unread .row-bottom p { color:var(--theme-error); }
html[data-theme] #inbox-view #conversation-list .has-unread .row-top time { color:var(--accent); }
html[data-theme] #inbox-view #conversation-list .unread-count { color:#fff; background:#d54660; }
html[data-theme] #inbox-view #conversation-list .row-owner { color:var(--muted); background:var(--theme-raised); }
html[data-theme] #inbox-view #conversation-list-panel :is(.list-footer,.list-tools,.active-filters) { color:var(--muted); background:var(--theme-raised); border-color:var(--line); }
/* The list status footer was explicitly removed from the visible conversation UI. */
html[data-theme] #inbox-view #conversation-list-panel .list-footer { display:none; }
html[data-theme] #inbox-view .panel-resizer { background:var(--line); }
html[data-theme] #inbox-view .panel-resizer:hover { background:var(--accent); }

/* Existing input dimensions, corner shapes and focus geometry remain in their own layout rules. */
html[data-theme] :is(#inbox-view,#action-dialog,#demo-dialog) :is(input,textarea,select) {
  color:var(--ink); background-color:var(--theme-input); border-color:var(--line); caret-color:var(--accent);
}
html[data-theme] :is(#inbox-view,#action-dialog,#demo-dialog) :is(input,textarea)::placeholder { color:var(--muted); }
html[data-theme] #inbox-view :is(.search-field,.message-search-bar,.list-controls select),
html[data-theme] #inbox-view #show-filters { color:var(--muted); background:var(--chat-ui-control); border-color:var(--line); box-shadow:var(--chat-ui-edge),0 2px 6px #001c250a; }
html[data-theme] #inbox-view .search-field :is(input,svg) { color:var(--muted); background:transparent; }
html[data-theme] #inbox-view .search-field input { color:var(--ink); }
html[data-theme] :is(#inbox-view,#action-dialog,#demo-dialog) :is(input,textarea,select,.search-field):focus-within {
  border-color:var(--accent); box-shadow:var(--chat-ui-edge),var(--chat-ui-focus);
}
html[data-theme] #inbox-view .search-field:focus-within { border-color:var(--accent); box-shadow:var(--chat-ui-edge),var(--chat-ui-focus); }
html[data-theme] #inbox-view .search-field input:focus { box-shadow:none; }
html[data-theme] :is(#app,#workspace-menu,#conversation-context-menu,#chat-copy-menu,#action-dialog,#demo-dialog) :is(button,a,input,textarea,select):focus-visible { outline-color:var(--chat-ui-accent); }
html[data-theme] #inbox-view :is(.icon-button,.text-button,.assignment-button,.handoff-button) { color:var(--muted); }
html[data-theme] #inbox-view :is(.icon-button,.text-button):hover { color:var(--ink); background:var(--theme-hover); }
html[data-theme] :is(#inbox-view,#action-dialog,#demo-dialog) .outline-button { color:var(--ink); background:var(--chat-ui-control); border-color:var(--line); box-shadow:var(--chat-ui-edge),var(--chat-ui-shadow); }
html[data-theme] :is(#inbox-view,#action-dialog,#demo-dialog) .outline-button:hover:not(:disabled) { background:var(--theme-hover); border-color:var(--accent); }
html[data-theme] :is(#inbox-view,#action-dialog,#demo-dialog) .primary-button { color:var(--chat-ui-primary-text); background:var(--chat-ui-primary-fill); border-color:var(--accent); box-shadow:var(--chat-ui-edge),var(--chat-ui-shadow); }
html[data-theme] :is(#inbox-view,#action-dialog,#demo-dialog) .primary-button:hover:not(:disabled) { border-color:var(--accent); box-shadow:inset 0 1px 0 var(--chat-ui-nav-sheen),var(--chat-ui-shadow),0 0 8px -3px var(--chat-ui-nav-glow); }

/* A quiet petrol/mint canvas keeps the original pattern and its original scale. */
html[data-theme] #inbox-view .messages {
  background-color:var(--theme-chat);
  background-image:linear-gradient(var(--chat-ui-wallpaper-tint),var(--chat-ui-wallpaper-tint)),url('/chat-wallpaper.svg');
}
html[data-theme] #inbox-view .chat-empty { background:radial-gradient(ellipse at 50% 40%,var(--accent-soft),var(--theme-bg) 78%); }
html[data-theme] #inbox-view .chat-empty :is(h2,p) { color:var(--muted); }
html[data-theme] #inbox-view .empty-chat-art { background:var(--theme-panel); border-color:var(--line); box-shadow:0 0 0 14px color-mix(in srgb,var(--accent-soft) 65%,transparent),var(--chat-ui-shadow); }
html[data-theme] #inbox-view .message-line .bubble {
  color:var(--ink); background:var(--chat-ui-incoming-fill);
  border-color:var(--line); box-shadow:var(--chat-ui-edge),var(--chat-ui-shadow);
  border-radius:20px;
}
html[data-theme] #inbox-view .message-line.out .bubble {
  background:var(--chat-ui-outgoing-fill);
  border-color:var(--chat-ui-outgoing-line); border-radius:20px; box-shadow:var(--chat-ui-bubble-glass);
}
/* Compact text height; leave width fluid and preserve media player dimensions. */
html[data-theme] #inbox-view .bubble:has(> .message-body-text):not(:has(> :is(.voice-card,.image-media,.video-media,.attachment-link))) { padding-block:6px; line-height:1.45; border-radius:16px; }
html[data-theme] #inbox-view .bubble:has(> .message-body-text):not(:has(> :is(.voice-card,.image-media,.video-media,.attachment-link))) > .message-meta { margin-top:2px; line-height:12px; }
html[data-theme] #inbox-view .bubble:has(> .voice-card) { padding-block:5px; border-radius:16px; }
html[data-theme] #inbox-view .bubble:has(> .voice-card) > .message-meta { margin-top:1px; line-height:12px; }
html[data-theme] #inbox-view .voice-card .audio-seek-wrap { height:26px; }
html[data-theme] #inbox-view .voice-card .audio-time { min-height:14px; }
html[data-theme] #inbox-view :is(.date-divider,.load-older,.load-newer,#jump-latest) { color:var(--muted); background:var(--theme-panel); border-color:var(--line); box-shadow:var(--chat-ui-shadow); }
html[data-theme] #inbox-view :is(.message-meta,.message-author,.automation-label,.message-tools button,.audio-time) { color:var(--muted); }
/* Keep the real delivery state beside the local HH:mm time, inside the bubble. */
html[data-theme] #inbox-view .bubble > .message-meta { direction:ltr; justify-content:flex-start; }
html[data-theme] #inbox-view .bubble > .message-meta time { order:1; font-variant-numeric:tabular-nums; white-space:nowrap; }
html[data-theme] #inbox-view .message-meta .delivery-status { order:0; }
html[data-theme] #inbox-view .message-meta .delivery-status svg { color:inherit; }
html[data-theme] #inbox-view .message-tools button:hover { background:var(--theme-hover); color:var(--accent); }
html[data-theme] #inbox-view :is(.message-quote,.reply-preview,.attachment-preview,.attachment-audio-player,.permission-notice,.closed-conversation-bar) { color:var(--ink); background:var(--theme-raised); border-color:var(--line); }
html[data-theme] #inbox-view .audio-play { color:var(--accent); background:var(--chat-ui-control); box-shadow:inset 0 0 0 1px var(--line),var(--chat-ui-edge),var(--chat-ui-shadow); }
html[data-theme] #inbox-view .audio-play:hover { color:var(--ink); box-shadow:inset 0 0 0 1px var(--accent),var(--chat-ui-edge),var(--chat-ui-shadow); }
html[data-theme] #inbox-view .audio-wave { color:color-mix(in srgb,var(--muted) 45%,transparent); }
html[data-theme] #inbox-view .audio-wave-progress { color:var(--accent); }
html[data-theme] #inbox-view .audio-speed { color:var(--muted); background:var(--chat-ui-control); border-color:var(--line); box-shadow:var(--chat-ui-edge); }
html[data-theme] #inbox-view .audio-player.is-loading .audio-play:after { border-color:var(--line); border-top-color:var(--accent); }
html[data-theme] #inbox-view :is(.delivery-status.status-pending,.delivery-status.status-queued) { color:var(--theme-warning); }
html[data-theme] #inbox-view .delivery-status.status-read { color:var(--theme-read); }
html[data-theme] #inbox-view :is(.delivery-status.status-failed,.delivery-status.status-unknown,.message-meta.failed,.message-error,.media-error,.audio-player-error) { color:var(--theme-error); }

html[data-theme] #inbox-view .chat-panel .chat-header.chat-header-v2 {
  --header-bg:var(--theme-panel); --header-line:var(--line); --header-ink:var(--ink); --header-muted:var(--muted);
  color:var(--ink); background:var(--chat-ui-header);
  border-color:var(--line); box-shadow:var(--chat-ui-edge),0 3px 12px #0000000a;
}
html[data-theme] #inbox-view .chat-header-v2 :is(#chat-name,#reply-window) { color:var(--ink); }
html[data-theme] #inbox-view .chat-header-v2 :is(.header-reply-window,#reply-window-label) { color:var(--muted); }
html[data-theme] #inbox-view .chat-header-v2 #chat-context { border:0; padding:0; }
html[data-theme] #inbox-view .chat-header-v2 .header-reply-window { direction:ltr; min-width:138px; padding:4px 14px; gap:14px; border:1px solid color-mix(in srgb,var(--accent) 24%,var(--line)); border-radius:20px; background:var(--chat-ui-composer); box-shadow:var(--chat-ui-edge),var(--chat-ui-shadow); }
html[data-theme] #inbox-view .chat-header-v2 .header-reply-window > div { direction:rtl; }
html[data-theme] #inbox-view .chat-header-v2 #reply-window-label { line-height:12px; }
html[data-theme] #inbox-view .chat-header-v2 #reply-window { line-height:20px; letter-spacing:0; }
@media(max-width:720px) {
  html[data-theme] #inbox-view .chat-header-v2 .header-reply-window { min-width:0; padding:4px 6px; border-radius:12px; }
}
html[data-theme] #inbox-view .chat-header-v2 #reply-window.expired { color:var(--theme-warning); }
html[data-theme] #inbox-view .chat-header-v2 #chat-actions > .icon-button { background:var(--chat-ui-control); border-color:var(--line); border-radius:50%; color:var(--ink); box-shadow:var(--chat-ui-edge),var(--chat-ui-shadow); }
html[data-theme] #inbox-view .chat-header-v2 #chat-actions > .icon-button:hover { background:var(--theme-hover); border-color:var(--accent); }
html[data-theme] #inbox-view .chat-header-v2 #chat-actions > .icon-button:active:not(:disabled) { box-shadow:var(--chat-ui-pressed); }
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-more { color:var(--chat-ui-action-ink); background:var(--chat-ui-action-fill); border-color:var(--chat-ui-action-line); box-shadow:var(--chat-ui-edge),var(--chat-ui-shadow); }
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-more:is(:hover,[aria-expanded="true"]) { border-color:var(--chat-ui-action-ink); box-shadow:inset 0 1px 0 var(--chat-ui-highlight),var(--chat-ui-shadow); }
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-more:active:not(:disabled) { box-shadow:var(--chat-ui-pressed); }
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #close-conversation { color:var(--theme-error); background:var(--theme-error-bg); border-color:var(--chat-ui-error-line); }
html[data-theme] #inbox-view .composer-area { background:var(--chat-ui-surface); border-color:var(--line); }
html[data-theme] #inbox-view .composer { background:var(--chat-ui-composer); border-color:var(--line); box-shadow:var(--chat-ui-edge),var(--chat-ui-shadow); }
html[data-theme] #inbox-view .composer:focus-within { border-color:var(--accent); box-shadow:var(--chat-ui-edge),var(--chat-ui-shadow),var(--chat-ui-focus); }
html[data-theme] #inbox-view .composer #message-input { color:var(--ink); background:transparent; box-shadow:none; }
html[data-theme] #inbox-view .composer-actions :is(.icon-button,.text-button) { border-radius:999px; }
html[data-theme] #inbox-view .composer-actions :is(#emoji-toggle,#sticker-toggle,#quick-toggle,#template-toggle,#attach-image) { color:var(--muted); background:transparent; }
html[data-theme] #inbox-view .composer-actions :is(#emoji-toggle,#sticker-toggle,#quick-toggle,#template-toggle,#attach-image):hover { color:var(--accent); background:var(--theme-hover); }
html[data-theme] #inbox-view .composer-actions :is(#record-audio,#send-message) { color:var(--chat-ui-primary-text); background:var(--chat-ui-primary-fill); box-shadow:inset 0 1px 1px var(--chat-ui-nav-sheen),inset 0 -1px 2px var(--chat-ui-nav-depth),var(--chat-ui-shadow); }
html[data-theme] #inbox-view .composer-actions :is(#record-audio,#send-message):hover:not(:disabled) { box-shadow:inset 0 1px 1px var(--chat-ui-nav-sheen),var(--chat-ui-shadow),0 0 8px -3px var(--chat-ui-nav-glow); }
html[data-theme] #inbox-view .composer-actions :is(#record-audio,#send-message):active:not(:disabled) { box-shadow:inset 0 0 0 1px var(--chat-ui-nav-edge),var(--chat-ui-pressed); }
/* The legacy phone layout sets composer shadows !important; override paint only here. */
@media(max-width:720px) {
  html[data-theme] #inbox-view .composer { box-shadow:var(--chat-ui-edge),var(--chat-ui-shadow)!important; }
  html[data-theme] #inbox-view .composer:focus-within { box-shadow:var(--chat-ui-edge),var(--chat-ui-shadow),var(--chat-ui-focus)!important; }
  html[data-theme] #inbox-view .composer #message-input { box-shadow:none!important; }
}

html[data-theme] #inbox-view .customer-details :is(header,.customer-identity,.details-tabs,.customer-insight-metrics>div) { background:var(--theme-raised); border-color:var(--line); }
html[data-theme] #inbox-view .customer-details :is(.workflow-card,.details-tabs button.active) { color:var(--ink); background:var(--theme-panel); border-color:var(--line); box-shadow:var(--chat-ui-shadow); }
html[data-theme] #inbox-view .customer-details :is(.details-block,.note-form,.activity-entry) { border-color:var(--line); }
html[data-theme] #inbox-view .customer-details :is(.details-tabs button,.details-block h4,.details-block dt,.note-form label,small) { color:var(--muted); }
html[data-theme] #inbox-view .customer-details :is(.details-block dd,.details-block p) { color:var(--ink); }
html[data-theme] #inbox-view .customer-details .details-tabs button.active { color:var(--accent); border-color:var(--accent); }

/* Ordinary chat overlays only: safety, attendance and shipping dialogs keep their own semantics. */
html[data-theme] :is(#workspace-menu,#mobile-more-menu,#chat-copy-menu,#conversation-context-menu,#action-dialog,#demo-dialog),
html[data-theme] #inbox-view :is(.quick-menu,.emoji-menu,.sticker-picker,#chat-action-menu) {
  color:var(--chat-ui-ink); background:var(--chat-ui-surface);
  border-color:var(--chat-ui-line); box-shadow:var(--chat-ui-edge),var(--chat-ui-popup-shadow);
}
html[data-theme] :is(#workspace-menu,#mobile-more-menu,#conversation-context-menu,#chat-copy-menu,#action-dialog,#demo-dialog) :is(.menu-action,.tenant-option,.demo-switch-option,.assignment-option):hover,
html[data-theme] #inbox-view :is(.quick-option,.emoji-menu button,.sticker-grid button):hover { color:var(--ink); background:var(--theme-hover); }
html[data-theme] :is(#workspace-menu,#action-dialog) :is(.tenant-option.active,.assignment-option.active) { color:var(--accent); background:var(--accent-soft); }
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu :is(button,a):hover { background:var(--theme-hover); color:var(--ink); }
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu #transfer-conversation:is(:hover,:focus-visible) { background:var(--theme-hover)!important; }
html[data-theme] #inbox-view .chat-header-v2 #chat-actions #chat-action-menu .chat-action-symbol { color:var(--accent); background:var(--accent-soft); }
html[data-theme] #inbox-view #chat-action-menu :is(.chat-action-heading,small,.chat-action-arrow svg) { color:var(--muted); }
html[data-theme] #workspace-menu .account-shortcut::after { color:var(--ink); background:var(--chat-ui-control); border-color:var(--line); box-shadow:var(--chat-ui-edge),var(--chat-ui-popup-shadow); }
html[data-theme] #workspace-menu :is(.menu-user span,.menu-user small,.menu-label) { color:var(--muted); }
html[data-theme] :is(#action-dialog,#demo-dialog) :is(.dialog-heading h2,.assignment-option) { color:var(--ink); }
html[data-theme] :is(#action-dialog,#demo-dialog) :is(p,label,small,.assignment-group-label) { color:var(--muted); }
html[data-theme] #action-dialog .assignment-options { background:var(--theme-raised); border-color:var(--line); }
html[data-theme] #action-dialog :is(.info-note,.message-preview) { color:var(--ink); background:var(--accent-soft); border-color:var(--line); }
html[data-theme] :is(#inbox-view,#action-dialog,#demo-dialog) .form-error { color:var(--theme-error)!important; background:var(--theme-error-bg); border-color:var(--chat-ui-error-line); }
html[data-theme] #app .error-banner,html[data-theme] #toast.error { color:var(--chat-ui-error); background:var(--chat-ui-error-bg); border-color:var(--chat-ui-error-line); }
html[data-theme] #toast { color:var(--ink); background:var(--theme-raised); border-color:var(--line); box-shadow:var(--chat-ui-popup-shadow); }
html[data-theme] #mobile-nav { color:var(--chat-ui-muted); background:var(--chat-ui-panel); border-color:var(--chat-ui-line); }
html[data-theme] #mobile-nav button { color:var(--chat-ui-muted); }
html[data-theme] #mobile-nav button.active { color:var(--chat-ui-accent); background:var(--chat-ui-soft); }

html[data-theme] #inbox-view :is(.chat-loading,.chat-loading-label,.media-loading,.audio-player-state,.voice-label,.attachment-preview>header span,.attachment-preview>footer small,.image-caption-label) { color:var(--muted); }
html[data-theme] #inbox-view :is(.media-loading,.chat-loading-bubble,.attachment-preview>footer) { background:var(--theme-raised); border-color:var(--line); }
html[data-theme] #inbox-view .sticker-media .media-loading { background:transparent; }
html[data-theme] #inbox-view .attachment-preview>header b { color:var(--ink); }
html[data-theme] #inbox-view :is(.recording-status,.connection-banner) { color:var(--ink); background:var(--theme-raised); border-color:var(--line); }
html[data-theme] #inbox-view :is(.recording-wave,#recording-label,#recording-time,.connection-retry) { color:var(--accent); }
html[data-theme] #inbox-view :is(#stop-recording,.message-draft-status[data-state="pending"]) { color:var(--theme-error); }
html[data-theme] #inbox-view #stop-recording { background:var(--theme-error-bg); border-color:var(--chat-ui-error-line); }
html.native-android[data-theme] :is(#inbox-view,#action-dialog,#demo-dialog,#mobile-more-menu) {
  --native-bg:var(--chat-ui-bg); --native-panel:var(--chat-ui-panel); --native-soft:var(--chat-ui-raised);
  --native-line:var(--chat-ui-line); --native-ink:var(--chat-ui-ink); --native-muted:var(--chat-ui-muted);
  --native-accent:var(--chat-ui-accent); --native-active:var(--chat-ui-soft); --native-danger:var(--chat-ui-error);
}
/* A theme change is one repaint; hover/focus transitions resume afterwards. */
html.theme-changing *,html.theme-changing *::before,html.theme-changing *::after {
  transition:none!important;
}
/* Keep long desktop lists searchable and keyboard-accessible while letting the
   browser defer layout/paint for rows well outside the scrolling viewport. */
@media(min-width:941px) {
  html:not(.native-android) #conversation-list .conversation-row {
    content-visibility:auto;
    contain-intrinsic-block-size:auto 76px;
  }
  html:not(.native-android)[data-theme="light"] #conversation-list .conversation-row {
    contain-intrinsic-block-size:auto 77.5px;
  }
}
