html[data-theme=dark]{background:#0f1724;color:#e2ebf6}html[data-theme=dark] body{background:#0f1724;color:#e2ebf6}
/* Explicit dark palette. Generated from current component colors by build_dark_css.py; no image inversion. */
:root[data-theme="light"]{color-scheme:light}:root[data-theme="dark"]{color-scheme:dark}

/* app.css */
html[data-theme="dark"]{--ink:#94c1e6;--muted:#b1c2d4;--blue:#8bc3ee;--line:#35475f;--soft:#1b3241;--paper:#172437;--bg:#1c2d43}
html[data-theme="dark"] button:focus-visible,html[data-theme="dark"] a:focus-visible,html[data-theme="dark"] input:focus-visible,html[data-theme="dark"] select:focus-visible,html[data-theme="dark"] textarea:focus-visible{outline:3px solid #8ec3ec}
html[data-theme="dark"] .top{background:#172437}
html[data-theme="dark"] .badge{color:#f5ca84;background:#4c3910}
html[data-theme="dark"] .auth{background:#172437}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{border:1px solid #35475f;background:#172437}
html[data-theme="dark"] button.primary,html[data-theme="dark"] .link-button{color:#ffffff}
html[data-theme="dark"] .error{color:#e39696;background:#1c2d43}
html[data-theme="dark"] .success{color:#93e6c1;background:#1a4225}
html[data-theme="dark"] .qr{background:#172437}
html[data-theme="dark"] aside{background:#172437}
html[data-theme="dark"] .metrics section{background:#172437}
html[data-theme="dark"] article{background:#172437}
html[data-theme="dark"] .map svg circle{stroke:#ffffff}
html[data-theme="dark"] .invitation{background:#4c3710}
html[data-theme="dark"] .mode-label{background:#4c3910;border:1px solid #b4882d;color:#efc88b}
html[data-theme="dark"] .filter-panel{background:#172437}
html[data-theme="dark"] .reset,html[data-theme="dark"] .map-toolbar button,html[data-theme="dark"] .pagination button{background:#172437}
html[data-theme="dark"] .metric-grid article{border:1px solid #35475f}
html[data-theme="dark"] .analysis-grid article{border:1px solid #35475f}
html[data-theme="dark"] .blue{background:#1e638f}
html[data-theme="dark"] .pale{background:#1a3042}
html[data-theme="dark"] .trend-day:hover{background:#142e47}
html[data-theme="dark"] .rank-track{background:#1d303e}
html[data-theme="dark"] .rank-fill{background:#2d6e96}
html[data-theme="dark"] .status-chip{background:#1c2d43;color:#b1c2d4}
html[data-theme="dark"] .status-chip.recent{background:#1c4031;color:#99e1d6}
html[data-theme="dark"] .status-chip.warm{background:#11324b;color:#95c2e4}
html[data-theme="dark"] .status-chip.older{background:#4c3610;color:#e4c395}
html[data-theme="dark"] .mini-bar i{background:#367196}
html[data-theme="dark"] .customer-map{background:#192f42;border:1px solid #35475f}
html[data-theme="dark"] .map-city{fill:#9fbfdb;stroke:#9fc3db}
html[data-theme="dark"] .map-marker:focus circle{stroke:#97c4e2}
html[data-theme="dark"] .map-legend .recent{background:#1a625a}
html[data-theme="dark"] .map-legend .warm{background:#1f6192}
html[data-theme="dark"] .map-legend .older{background:#94601f}
html[data-theme="dark"] .map-legend .none{background:#122136}
html[data-theme="dark"] .detail-icon{color:#9fc3db}
html[data-theme="dark"] .detail-stats div{background:#183044}
html[data-theme="dark"] .heatmap button.hot{background:#1e648f;color:#ffffff}
html[data-theme="dark"] .heatmap button.mid{background:#153346}
html[data-theme="dark"] .empty-state{border:1px dashed #35475f}
html[data-theme="dark"] .website-link:hover,html[data-theme="dark"] .website-link:focus-visible{background:#153247}
html[data-theme="dark"] .offline-page{background:#1d2e3f}
html[data-theme="dark"] .offline-card{background:#172437;border:1px solid #35475f}
html[data-theme="dark"] .offline-card h1{color:#96c3e3}
html[data-theme="dark"] .offline-card p{color:#b1c2d4}
html[data-theme="dark"] .offline-retry{background:#1e5d8d;color:#ffffff}
html[data-theme="dark"] .language-option{background:#172437}
html[data-theme="dark"] .language-option:has(input:checked){border-color:#2d79b4;background:#153247}
html[data-theme="dark"] .success{color:#8cedc1;background:#18442e}
html[data-theme="dark"]{--btn-bg:#153247;--btn-bg-hover:#143248;--btn-line:#4079a1;--btn-ink:#8ac6ef}
html[data-theme="dark"] .module-permission:has(input:checked){background:#153247;border-color:#347bac}
html[data-theme="dark"] .ui-progress-track{background:#10354c}
html[data-theme="dark"] .ui-progress-track::after{background:#1e5d8d}
html[data-theme="dark"] .ui-progress-label{border:1px solid #35475f;background:#172437f2;box-shadow:0 4px 18px #00000014;color:#8ac6ef}
html[data-theme="dark"] .ui-spinner,html[data-theme="dark"] .inline-loading::before{border:2px solid #2d7fb4;border-top-color:#2d79b4}
html[data-theme="dark"] .ui-busy .workspace-live .live-dot{border:2px solid #2d7fb4;border-top-color:#2d79b4}
html[data-theme="dark"] .loading-card,html[data-theme="dark"] .loading-list{border:1px solid #35475f;background:#172437}
html[data-theme="dark"] .loading-card span,html[data-theme="dark"] .loading-card b,html[data-theme="dark"] .loading-row span{background:linear-gradient(90deg,#192f43 20%,#172437 45%,#192f43 70%)}
html[data-theme="dark"] .loading-line{background:linear-gradient(90deg,#173145,#143347,#173145)}
html[data-theme="dark"] .loading-row{border-bottom:1px solid #35475f}
html[data-theme="dark"] .loading-row i{background:#173145}
html[data-theme="dark"] .day-status:not([hidden]){color:#9fc2db}
html[data-theme="dark"] [data-day][aria-busy=true] .day-status::before{border:2px solid #2d7fb4;border-top-color:#2d79b4}
html[data-theme="dark"] .integration-explorer.is-fetching::before{border:3px solid #2d7fb4;border-top-color:#2d79b4}
html[data-theme="dark"] .ui-busy dialog[open]::after{background:linear-gradient(90deg,#10354c,#1e5d8d,#10354c)}
html[data-theme="dark"] .btn-secondary:hover,html[data-theme="dark"] .top .top-actions a:hover,html[data-theme="dark"] .top .top-actions button:hover,html[data-theme="dark"] main.admin>a:first-child:hover{border-color:#3b78a5}
html[data-theme="dark"] .btn-secondary:focus-visible,html[data-theme="dark"] .top .top-actions a:focus-visible,html[data-theme="dark"] .top .top-actions button:focus-visible,html[data-theme="dark"] .menu-row:focus-visible{outline:2px solid #8bc3ee}
html[data-theme="dark"] .menu-row{color:#97c4e2}
html[data-theme="dark"] .menu-row .icon{color:#8ac6ef}
html[data-theme="dark"] .menu-row::after{border-right:2px solid #35475f;border-top:2px solid #35475f}
html[data-theme="dark"] .menu-row:hover{background:#163146}
html[data-theme="dark"] .settings-page .menu-row{background:#172437}
html[data-theme="dark"] .manual-enrollment{border:1px solid var(--line,#35475f)}
html[data-theme="dark"] .person-status{background:#1e3e2c;color:#93e6c4}
html[data-theme="dark"] .person-status.is-disabled{background:#1c2d43;color:#b1c2d4}
html[data-theme="dark"] .person-facts dt{color:#b1c2d4}
html[data-theme="dark"] .admin-section{border:1px solid #35475f;background:#172437}
html[data-theme="dark"] .manager-controls{background:#172e45}
html[data-theme="dark"] .delete-account{border-color:#a93737}
html[data-theme="dark"] .delete-account>summary{color:#e09999}
html[data-theme="dark"] .danger-button{background:#84262a;color:#ffffff;border:1px solid #af3238}
html[data-theme="dark"] .danger-button:hover{background:#6e1f24}

/* commission.css */
html[data-theme="dark"] .is-waiting .map-host::after{background:linear-gradient(100deg,transparent 30%,#17243759 50%,transparent 70%)}
html[data-theme="dark"][data-theme="dark"] .is-waiting .map-host::after{background:linear-gradient(100deg,transparent 30%,#17243712 50%,transparent 70%)}
html[data-theme="dark"] .map-card{box-shadow:0 14px 36px #0000003d}
html[data-theme="dark"] .swatch.gap{border:1.5px dashed #b4742d;background:#965f2038}

/* profiles.css */
html[data-theme="dark"]{--surface:#172437;--blue-solid:#286da6;--blue-text:#8bc3ef;--blue-soft:#10314c;--green:#93e6bf;--green-text:#91e9c3;--green-soft:#16462e;--c4:#96c2e3;--c5:#b1c2d4;--orange:#f5c184;--on-orange:#102034;--shadow:0 1px 2px #0000000d,0 10px 28px #0000000f}
html[data-theme="dark"] .marketer-profile{box-shadow:0 24px 80px #00000044}
html[data-theme="dark"] .marketer-profile::backdrop{background:#0814226b}
html[data-theme="dark"] .map-legend .recent{background:#1a7d4f}
html[data-theme="dark"] .map-legend .warm{background:#965f20}
html[data-theme="dark"] .map-legend .older{background:#8d1e5f}
html[data-theme="dark"] .status-chip.warm{background:#4c3210;color:#efc88b}
html[data-theme="dark"] .status-chip.older{background:#4c1031;color:#ed8dc6}

/* dashboard_v2.css */
html[data-theme="dark"] .intelligence{--ink:#96c2e3;--surface:#172437;--soft:#1a3342;--line:#35475f;--muted:#b1c2d4;--blue-solid:#286da6}
html[data-theme="dark"] .workspace-heading p{color:#b1c2d4}
html[data-theme="dark"] .workspace-tools summary,html[data-theme="dark"] .advanced summary{border:1px solid #35475f;background:#172437}
html[data-theme="dark"] .workspace-tools[open]{background:#172437;border:1px solid #35475f}
html[data-theme="dark"] .workspace-controls{border:1px solid #35475f;background:#172437}
html[data-theme="dark"] .workspace-controls>button{background:#163046}
html[data-theme="dark"] .month-switch button{background:#153247}
html[data-theme="dark"] .month-switch input{background:#153247}
html[data-theme="dark"] .advanced>div{background:#172437;border:1px solid #487498;box-shadow:0 14px 45px #00000022}
html[data-theme="dark"] .advanced p{color:#b1c2d4}
html[data-theme="dark"] .workspace-live{color:#b1c2d4}
html[data-theme="dark"] .workspace-error{background:#4c1a10;color:#e99c91}
html[data-theme="dark"] .workspace-loading{background:linear-gradient(120deg,#1b3241,#172437,#1b3241);color:#b1c2d4}
html[data-theme="dark"] .workspace-tabs{background:#1b2f41}
html[data-theme="dark"] .workspace-tabs button{color:#b1c2d4}
html[data-theme="dark"] .workspace-tabs button[aria-selected=true]{background:#172437;color:#89c6f1;box-shadow:0 2px 5px #00000010}
html[data-theme="dark"] .headline-metrics>div{border:1px solid #35475f;background:#172437}
html[data-theme="dark"] .headline-metrics small{color:#b1c2d4}
html[data-theme="dark"] .headline-metrics strong{color:#96c3e3}
html[data-theme="dark"] .scope-note,html[data-theme="dark"] .chart-note{color:#b1c2d4}
html[data-theme="dark"] .analysis-card{background:#172437;border:1px solid #35475f}
html[data-theme="dark"] .vertical-chart{border-bottom:1px solid #35475f}
html[data-theme="dark"] .vertical-chart .bar{background:#1e5d8d}
html[data-theme="dark"] .vertical-chart .label{color:#b1c2d4}
html[data-theme="dark"] .comparison-chart i{background:#1c3140}
html[data-theme="dark"] .comparison-chart b{background:#1e5d8d}
html[data-theme="dark"] .daily-chart i{background:#286fa4}
html[data-theme="dark"] .daily-chart button:hover i,html[data-theme="dark"] .daily-chart button:focus-visible i{background:#1b5681}
html[data-theme="dark"] .field-map{border:1px solid #35475f;--ink:#97c3e3;--surface:#172437;--soft:#1a3342;--line:#35475f;--muted:#b1c2d4;--blue-solid:#286da6}
html[data-theme="dark"] .map-legend{color:#b1c2d4}
html[data-theme="dark"] .map-legend span:nth-child(1){color:#90e9c0}
html[data-theme="dark"] .map-legend span:nth-child(2){color:#f5c084}
html[data-theme="dark"] .map-legend span:nth-child(3){color:#b1c2d4}
html[data-theme="dark"] .name-button{color:#88c7f1}
html[data-theme="dark"] .attention-row{border-bottom:1px solid #35475f}
html[data-theme="dark"] .attention-row small{color:#b1c2d4}
html[data-theme="dark"] .attention-age{color:#f1c689}
html[data-theme="dark"] .workspace-definitions{color:#b1c2d4}
html[data-theme="dark"] .field-profile,html[data-theme="dark"] .field-day,html[data-theme="dark"] .field-customer{border:1px solid #35475f;color:#98c3e2;background:#1c2d43;--ink:#98c3e2;--surface:#172437;--soft:#1a3342;--line:#35475f;--muted:#b1c2d4;--blue-solid:#286da6}
html[data-theme="dark"] .field-profile::backdrop,html[data-theme="dark"] .field-day::backdrop,html[data-theme="dark"] .field-customer::backdrop{background:#0d223799}
html[data-theme="dark"] .field-profile>header,html[data-theme="dark"] .field-day>header,html[data-theme="dark"] .field-customer>header{background:#172437;border-bottom:1px solid #35475f}
html[data-theme="dark"] .field-profile header p,html[data-theme="dark"] .field-day header p{color:#b1c2d4}
html[data-theme="dark"] .field-profile header button,html[data-theme="dark"] .field-day header button,html[data-theme="dark"] .field-customer header button{background:#1a3342}
html[data-theme="dark"] .timeline-stop{border-bottom:1px solid #35475f}
html[data-theme="dark"] .timeline-stop>.stop-number{background:#153247;color:#8bc6ee}
html[data-theme="dark"] .timeline-stop small{color:#b1c2d4}
html[data-theme="dark"] .agenda-entry{border-bottom:1px solid #35475f}
html[data-theme="dark"] .agenda-entry small{color:#b1c2d4}
html[data-theme="dark"] .customer-facts>div{background:#172437;border:1px solid #35475f}
html[data-theme="dark"] .customer-facts small{color:#b1c2d4}
html[data-theme="dark"] .support-record{background:#172437;border:1px solid #35475f}
html[data-theme="dark"] .reach-ring{background:conic-gradient(#1e5d8d var(--reach),#1c3140 0)}
html[data-theme="dark"] .empty-note{color:#b1c2d4}
html[data-theme="dark"] .workspace-controls>button,html[data-theme="dark"] .card-heading>button,html[data-theme="dark"] .intelligence .pagination>button,html[data-theme="dark"] .profile-content .pagination>button,html[data-theme="dark"] .field-customer>[data-customer-body]>button{border:1px solid #35475f;background:#173245;color:#8ac6ef}
html[data-theme="dark"] .field-day .text-button{color:#8ac6ef}
html[data-theme="dark"] .month-trend>button{border:1px solid #35475f;background:#172437;color:#97c4e2}
html[data-theme="dark"] .month-trend small{color:#b1c2d4}
html[data-theme="dark"] .month-trend i{background:#193042}
html[data-theme="dark"] .month-trend b{background:#1e5d8d}
html[data-theme="dark"] .filter-context{color:#9fc1db}
html[data-theme="dark"] .scope-chip{border:1px solid #487498;background:#153247;color:#9bc1df}
html[data-theme="dark"] .scope-fixed{background:#1d2e3f;border-color:#35475f}
html[data-theme="dark"] .clear-scope{color:#8cc5ee}
html[data-theme="dark"] .clear-scope:disabled{color:#b1c2d4}
html[data-theme="dark"] .field-profile>header,html[data-theme="dark"] .field-customer>header{box-shadow:0 3px 12px #0000000c}
html[data-theme="dark"] .field-profile header .context-back,html[data-theme="dark"] .field-customer header .context-back,html[data-theme="dark"] .context-back{color:#8cc5ee}
html[data-theme="dark"] [data-panel=daily]{background:#172437;border:1px solid #35475f}
html[data-theme="dark"] .daily-heading p{color:#b1c2d4}
html[data-theme="dark"] .day-date-controls button{border:1px solid #45749b;background:#153247;color:#91c5e9}
html[data-theme="dark"] :where(.intelligence,.field-profile,.field-customer) button:focus-visible,html[data-theme="dark"] :where(.intelligence,.field-profile,.field-customer) summary:focus-visible{outline:3px solid #91c2e8}
html[data-theme="dark"] .workspace-tools[open]>a{background:#172437;border-inline:1px solid #35475f}
html[data-theme="dark"] .workspace-tools[open]{box-shadow:0 12px 35px #00000022;background:#172437}
html[data-theme="dark"] .field-profile>header .panel-context button,html[data-theme="dark"] .field-customer>header .panel-context button{color:#9bc1df}
html[data-theme="dark"] .field-profile>header .panel-context button.scope-chip,html[data-theme="dark"] .field-customer>header .panel-context button.scope-chip{background:#153247;border:1px solid #487498}
html[data-theme="dark"] .field-profile>header .panel-context .clear-scope,html[data-theme="dark"] .field-customer>header .panel-context .clear-scope{color:#8cc5ee}
html[data-theme="dark"] .field-profile>header .panel-context .clear-scope:disabled,html[data-theme="dark"] .field-customer>header .panel-context .clear-scope:disabled{color:#b1c2d4}
html[data-theme="dark"] .daily-summary{color:#9fc1db}
html[data-theme="dark"] .day-shortcut{background:#153247;color:#8dc4ec;border:1px solid #4176a0}
html[data-theme="dark"] .day-status{background:#143048;color:#9bc1df}
html[data-theme="dark"] .city-heading{color:#8cc5ee}
html[data-theme="dark"] .day-person{border-top:1px solid #35475f}
html[data-theme="dark"] .day-person-action{background:#172437;color:#96c2e3}
html[data-theme="dark"] .day-person-action:hover{background:#10304c;border-color:#3e76a3}
html[data-theme="dark"] .day-person-action:disabled{color:#b1c2d4}
html[data-theme="dark"] .person-name small{color:#b1c2d4}
html[data-theme="dark"] .person-link{color:#8cc5ee}
html[data-theme="dark"] .person-bar{background:linear-gradient(to right,#1e5d8d var(--fill),#1a3042 var(--fill))}
html[data-theme="dark"] .quiet-marketers summary{color:#9ac3df}
html[data-theme="dark"] .quiet-person{color:#8cc5ee}
html[data-theme="dark"] .new-customer-row{border-bottom:1px solid #35475f}
html[data-theme="dark"] .name-button:focus-visible{outline:3px solid #8bc3ee}
html[data-theme="dark"] .chart-note,html[data-theme="dark"] .daily-heading p,html[data-theme="dark"] .workspace-heading p{color:#b1c2d4}
html[data-theme="dark"] .day-content .map-legend span{color:#9fc1db}
@media(max-width:750px){html[data-theme="dark"] .day-content .headline-metrics small{color:#b1c2d4}}
html[data-theme="dark"] .day-options summary{border:1px solid #45749b;color:#9ac3df}
html[data-theme="dark"] .day-options>div{background:#172437;border:1px solid #45749b;box-shadow:0 12px 30px #00000022}
html[data-theme="dark"] .new-customers summary{color:#8cc5ee}
html[data-theme="dark"] .headline-metrics .text-button{color:#8cc5ee}
html[data-theme="dark"] .day-person-action:disabled .person-link{color:#b1c2d4}
html[data-theme="dark"] .day-person-action:disabled:hover{background:#172437}
html[data-theme="dark"] .activity-filter{color:#9fc1db}
html[data-theme="dark"] .activity-badge.recorded{background:#1d3f2e;color:#9cddba}
html[data-theme="dark"] .activity-badge.agenda{background:#202e3c;color:#9fc0db}
html[data-theme="dark"] .activity-source{color:#9fc1db}
html[data-theme="dark"] .activity-source summary{color:#8cc5ee}
html[data-theme="dark"] .activity-explanation{color:#b1c2d4}
html[data-theme="dark"] .activity-unlinked{color:#b1c2d4!important}
html[data-theme="dark"] .activity-row .name-button:disabled{color:#9fc1db}
html[data-theme="dark"] .day-controls>button.day-shortcut{border:1px solid #35475f;background:#153247;color:#8ac6ef}
html[data-theme="dark"] .day-date-controls>button{border:1px solid #35475f;background:#153247;color:#8ac6ef}
html[data-theme="dark"] .day-date-controls label{color:#b1c2d4}
html[data-theme="dark"] .day-options>summary{border:1px solid #35475f;background:#153247;color:#8ac6ef}
html[data-theme="dark"] .inline-link{color:#88c7f1}
html[data-theme="dark"] .timeline-stop>.stop-number{background:var(--stop-color,#153247);color:#ffffff;border:2px solid #35475f;box-shadow:0 0 0 1px #00000066}
html[data-theme="dark"] .timeline-stop>.stop-number:not([style]){color:#8bc6ee}
html[data-theme="dark"] .show-all{color:#88c7f1}
html[data-theme="dark"] .workspace-live button[data-refresh]{color:#88c7f1}
html[data-theme="dark"] .workspace-live button[data-refresh]:disabled{color:#b1c2d4}
html[data-theme="dark"] .workspace-live .queue-note{color:#f5ce84}
html[data-theme="dark"] .metric-status{color:#f5ce84;background:#4c3910}
html[data-theme="dark"] .live-dot{background:#26394f}
html[data-theme="dark"] .live-dot[data-state=fresh]{background:#1a7c4f}
html[data-theme="dark"] .live-dot[data-state=stale]{background:#89651d}
html[data-theme="dark"] [data-freshness-time]{color:#9fc1db}
html[data-theme="dark"] [data-freshness-note].is-syncing{color:#b1c2d4}
html[data-theme="dark"] [data-freshness-note].is-warning{color:#f5ce84}
html[data-theme="dark"] .tab-indicator{background:#172437;box-shadow:0 2px 5px #00000014}
html[data-theme="dark"] .delta-chip{color:#8cedc1;background:#18442e}
html[data-theme="dark"] .activity-badge.new{background:#18442e;color:#8cedc1}
html[data-theme="dark"] .skeleton span,html[data-theme="dark"] .loading-skeleton span{background:linear-gradient(90deg,#1a3042 25%,#1c2d43 50%,#1a3042 75%)}
html[data-theme="dark"] .day-person-action:not(:disabled):hover,html[data-theme="dark"] .comparison-chart button:hover{box-shadow:0 6px 16px #0000000f}
@media(max-width:750px){html[data-theme="dark"] .timeline-stop>time{color:#b1c2d4}}
html[data-theme="dark"] .advanced [data-reset]{border:1px solid #35475f;background:#153247;color:#8ac6ef}
html[data-theme="dark"] .intelligence .text-button:hover,html[data-theme="dark"] .intelligence .show-all:hover,html[data-theme="dark"] .intelligence .clear-scope:hover:not(:disabled),html[data-theme="dark"] .intelligence .workspace-live button[data-refresh]:hover:not(:disabled),html[data-theme="dark"] .intelligence .context-back:hover,html[data-theme="dark"] .field-profile header .context-back:hover,html[data-theme="dark"] .field-customer header .context-back:hover{border-color:#3b78a5}
html[data-theme="dark"] .workspace-tools[open]>a.menu-row{background:#172437}
html[data-theme="dark"] .workspace-tools[open]>a.menu-row+a.menu-row{border-top:1px solid #35475f}
html[data-theme="dark"] .quiet-marketers .menu-row{border-bottom:1px solid #35475f}
html[data-theme="dark"] .intelligence details:not(.advanced):not(.workspace-tools):not(.day-options)>summary,html[data-theme="dark"] dialog details>summary{color:#97c4e2}
html[data-theme="dark"] .intelligence details:not(.advanced):not(.workspace-tools):not(.day-options)>summary::before,html[data-theme="dark"] dialog details>summary::before{border-right:2px solid #2d7db4;border-bottom:2px solid #2d7db4}
html[data-theme="dark"] .activity-source>summary{color:#9fc1db}

/* integration.css */
html[data-theme="dark"] .integration-rail{background:#172437;border-right:1px solid #35475f}
html[data-theme="dark"] .integration-rail nav button[aria-current=true]{background:#10314b;color:#87c6f2}
html[data-theme="dark"] .integration-rail small{color:#b1c2d4}
html[data-theme="dark"] .integration-readonly{background:#1d3f2f;color:#92e8c0}
html[data-theme="dark"] .integration-catalog button{background:#172437;border:1px solid #35475f}
html[data-theme="dark"] .integration-catalog strong{color:#97c3e3}
html[data-theme="dark"] .integration-catalog small{color:#b1c2d4}
html[data-theme="dark"] .integration-catalog button:hover,html[data-theme="dark"] .integration-catalog button:focus-visible{border-color:#2d79b4;box-shadow:0 8px 22px #0000000d}
html[data-theme="dark"] .integration-toolbar{background:#172437;border:1px solid #35475f}
html[data-theme="dark"] .integration-metrics>div{background:#172437;border:1px solid #35475f}
html[data-theme="dark"] .integration-status{background:#173145}
html[data-theme="dark"] .integration-explorer article{background:#172437;border:1px solid #35475f}
html[data-theme="dark"] .integration-bars i{background:#192f42}
html[data-theme="dark"] .integration-bars b{background:#1e5d8d}
html[data-theme="dark"] .integration-map{border:1px solid #35475f;--ink:#94c3e6;--surface:#172437;--soft:#1a3342;--line:#35475f;--muted:#b1c2d4;--blue-solid:#286da6}
html[data-theme="dark"] .integration-detail{border:1px solid #35475f;color:#97c3e3}
html[data-theme="dark"] .integration-detail::backdrop{background:#0d253aa0}
html[data-theme="dark"] .integration-detail header button{background:#192f42}
html[data-theme="dark"] .integration-detail dt{color:#b1c2d4}
html[data-theme="dark"] .integration-record-button{color:#87c6f2}
html[data-theme="dark"] .integration-catalog button[data-status=denied],html[data-theme="dark"] .integration-catalog button[data-status=unavailable],html[data-theme="dark"] .integration-catalog button[data-status=error]{background:#1c2d43}
@media(max-width:750px){html[data-theme="dark"] .integration-rail{border-bottom:1px solid #35475f}}

html[data-theme=dark]{--ink:#e3ecf6;--muted:#b1c2d4;--bg:#0d1724;--surface:#172437;--paper:#172437;--soft:#1c2d43;--line:#35475f;--blue:#80bdff;--blue-solid:#286da6;--btn-bg:#1c2d43;--btn-bg-hover:#273e58;--btn-line:#354f6b;--btn-ink:#b6d9ff}
html[data-theme=dark] body{background:#0d1724;color:#e3ecf6}
html[data-theme=dark] :is(.intelligence,.integration-shell){--ink:#e3ecf6;--muted:#b1c2d4;--surface:#172437;--soft:#1c2d43;--line:#35475f;--blue-solid:#286da6}
html[data-theme=dark] :is(button.primary,.link-button,.offline-retry){background:#286da6;color:#fff}
html[data-theme=dark] .danger-button{background:#92313d;color:#fff}
html[data-theme=dark] .qr{background:#fff}
html[data-theme=dark] :is(.chart-note,.empty-note,.small,.hint){color:#b1c2d4}
html[data-theme=dark] input::placeholder{color:#9aadc3;opacity:1}
html[data-theme=dark] input[type=radio],html[data-theme=dark] input[type=checkbox]{accent-color:#80bdff}
html[data-theme=dark] :focus-visible{outline-color:#91c7ff}
html[data-theme=dark] dialog::backdrop{background:#0009}
html[data-theme=dark] .appearance-option:has(input:checked){border-color:#80bdff;background:#203951}
html[data-theme=dark] .success{color:#9ae2b4;background:#16382d}
html[data-theme=dark] .error{color:#ffb8c0;background:#3c2330}

html[data-theme=dark]{--green:#16784b;--green-text:#87dbab;--green-soft:#173d30;--blue-text:#91c7ff;--blue-soft:#1f3853;--orange:#f7ad4d;--on-orange:#102034}
html[data-theme=dark] .tab-indicator,html[data-theme=dark] .workspace-tabs:not(.has-indicator) button[aria-selected=true]{background:#29425e}

/* TCP logo accents: restrained blue, green, amber and magenta for readable data. */
.headline-metrics>div:nth-child(4n+1){--metric-ink:#216b9f;--metric-wash:#f3f8fd;--metric-edge:#c7daeb}
.headline-metrics>div:nth-child(4n+2){--metric-ink:#267459;--metric-wash:#f2f9f5;--metric-edge:#c8e0d3}
.headline-metrics>div:nth-child(4n+3){--metric-ink:#936326;--metric-wash:#fcf8ef;--metric-edge:#e5d6b8}
.headline-metrics>div:nth-child(4n+4){--metric-ink:#96527e;--metric-wash:#faf4f8;--metric-edge:#e2ccda}
.headline-metrics>div{background:var(--metric-wash);border-color:var(--metric-edge)}
.headline-metrics>div::before{content:"";position:absolute;top:0;left:18px;width:34px;height:3px;border-radius:0 0 3px 3px;background:var(--metric-ink);opacity:.7;pointer-events:none}
.headline-metrics>div>strong{color:var(--metric-ink);font-weight:700}
.person-counts>strong{color:#216b9f}.person-counts>span:nth-child(2){color:#267459}.person-counts>span:nth-child(3){color:#936326}
html[data-theme=dark] .headline-metrics>div:nth-child(4n+1){--metric-ink:#8fc5f5;--metric-wash:#192c43;--metric-edge:#36516d}
html[data-theme=dark] .headline-metrics>div:nth-child(4n+2){--metric-ink:#8bd5b0;--metric-wash:#192f32;--metric-edge:#35594e}
html[data-theme=dark] .headline-metrics>div:nth-child(4n+3){--metric-ink:#e8c17f;--metric-wash:#302c27;--metric-edge:#60523e}
html[data-theme=dark] .headline-metrics>div:nth-child(4n+4){--metric-ink:#dda7cd;--metric-wash:#302638;--metric-edge:#604561}
html[data-theme=dark] .headline-metrics>div{background:var(--metric-wash);border-color:var(--metric-edge)}
html[data-theme=dark] .headline-metrics>div>strong{color:var(--metric-ink);font-weight:700}
html[data-theme=dark] .headline-metrics>div>small:first-child{color:#e0e8f2}
html[data-theme=dark] .headline-metrics>div>small:last-of-type{color:#bac8d8}
html[data-theme=dark] .person-counts>strong{color:#8fc5f5}html[data-theme=dark] .person-counts>span:nth-child(2){color:#8bd5b0}html[data-theme=dark] .person-counts>span:nth-child(3){color:#e8c17f}
html[data-theme=dark] .daily-summary{color:#d6e1ef}
html[data-theme="dark"] .workspace-controls .advanced>summary{border:1px solid #35475f;background:#153247;color:#8ac6ef}
html[data-theme="dark"] .filter-count{background:#2d7db4;color:#fff}
html[data-theme="dark"] .seg{background:#1b2f41}
html[data-theme="dark"] .seg button{color:#b1c2d4}
html[data-theme="dark"] .seg button[aria-pressed=true]{background:#29425e;color:#89c6f1;box-shadow:none}
html[data-theme="dark"] .customers-card .pagination span{color:#b1c2d4}
@media(max-width:750px){
 html[data-theme="dark"] .workspace-tabs{background:#172437;border-top:1px solid #35475f;box-shadow:0 -4px 18px #00000040}
 html[data-theme="dark"] .workspace-tabs .tab-indicator{background:#29425e}
 html[data-theme="dark"] .workspace-controls .advanced>div{box-shadow:0 -12px 40px #00000066}
 html[data-theme="dark"] .stack-table tr{border-bottom:1px solid #35475f}
 html[data-theme="dark"] .stack-table td::before{color:#b1c2d4}
}
@media(max-width:750px){
 html[data-theme="dark"] .workspace-tabs{background:rgb(23 36 55/.68);border-top:0;box-shadow:inset 0 1px 0 rgb(255 255 255/.14),0 -.5rem 1.5rem rgb(0 0 0/.35)}
 html[data-theme="dark"] .workspace-tabs button{color:#b9cde0}
 html[data-theme="dark"] .workspace-tabs button:active{background:#243a52}
 html[data-theme="dark"] .workspace-tabs.has-indicator button[aria-selected=true],html[data-theme="dark"] .workspace-tabs button[aria-selected=true]{background:#2b4763!important;color:#dcefff;box-shadow:none!important}
}
@media(max-width:750px) and (prefers-reduced-transparency:reduce){html[data-theme="dark"] .workspace-tabs{background:#172437}}
@media(max-width:750px) and (prefers-contrast:more){html[data-theme="dark"] .workspace-tabs{background:#172437;border-top:2px solid #9ec9ea}html[data-theme="dark"] .workspace-tabs button[aria-selected=true]{border:2px solid #9ec9ea}}
@media(max-width:750px){@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){html[data-theme="dark"] .workspace-tabs{background:#172437}}}
html[data-theme="dark"] .workspace-controls .day-date-controls,html[data-theme="dark"] .workspace-controls .month-switch{background:rgb(139 195 238/.10)}
html[data-theme="dark"] .workspace-controls .nav-btn{border:0;background:transparent;color:#8ac6ef}
html[data-theme="dark"] .workspace-controls .nav-btn:hover:not(:disabled){background:rgb(139 195 238/.14)}
html[data-theme="dark"] .workspace-controls .nav-btn:active:not(:disabled){background:rgb(139 195 238/.22)}
html[data-theme="dark"] .workspace-controls select,html[data-theme="dark"] .workspace-controls input[type=search]{border:0;background-color:rgb(139 195 238/.10);color:#e3ecf6}
html[data-theme="dark"] .workspace-controls .advanced>summary{border:0;background:rgb(139 195 238/.12);color:#8ac6ef}
html[data-theme="dark"] .workspace-tools summary{border:0;background:rgb(139 195 238/.12);color:#8ac6ef}
html[data-theme="dark"] .live-status{color:#b1c2d4}
html[data-theme="dark"] .live-dot[data-state=syncing]{border-color:rgb(139 195 238/.25);border-top-color:#8ac6ef}
html[data-theme="dark"] .live-status [data-freshness-note].is-warning{color:#f0b866}
html[data-theme="dark"] .intelligence .workspace-live button.icon-btn[data-refresh],html[data-theme="dark"] .intelligence .workspace-live button.icon-btn[data-refresh]:disabled{color:#8ac6ef}
html[data-theme="dark"] .intelligence .workspace-live button.icon-btn[data-refresh]:hover:not(:disabled){background:rgb(139 195 238/.14)!important}
html[data-theme="dark"] .field-profile>header button.context-back,html[data-theme="dark"] .field-customer>header button.context-back,html[data-theme="dark"] .intelligence button.context-back{background:rgb(139 195 238/.14);color:#8ac6ef}
html[data-theme="dark"] .field-profile>header>button[data-profile-close],html[data-theme="dark"] .field-customer>header>button[data-customer-close]{background:rgb(139 195 238/.14);color:#8ac6ef}
@media(max-width:750px){
 html[data-theme="dark"] dialog .workspace-tabs{background:rgb(139 195 238/.10);border-top:0;box-shadow:none}
}
html[data-theme="dark"] .sales-counts,html[data-theme="dark"] .sl-qty,html[data-theme="dark"] .sl-amt,html[data-theme="dark"] .sg-meta,html[data-theme="dark"] .sales-row small{color:#b1c2d4}
html[data-theme="dark"] .sales-group{background:#172437;border-color:#35475f}
html[data-theme="dark"] .sales-customer,html[data-theme="dark"] .sales-row{border-color:#35475f}
html[data-theme="dark"] .sales-actions button{background:rgb(139 195 238/.14);color:#8ac6ef}
html[data-theme="dark"] .sales-actions .primary-action{background:#2d7db4;color:#fff}
html[data-theme="dark"] .account-menu>summary{color:#8ac6ef;background:rgb(139 195 238/.12)}
html[data-theme="dark"] .account-menu>summary:hover,html[data-theme="dark"] .account-menu[open]>summary{background:rgb(139 195 238/.2)}
html[data-theme="dark"] .account-panel{background:#172437;border-color:#35475f;box-shadow:0 18px 50px rgb(0 0 0/.5)}
html[data-theme="dark"] .account-panel .menu-row{color:#e3ecf6}
html[data-theme="dark"] .account-panel .menu-row .icon{color:#8ac6ef}
html[data-theme="dark"] .account-panel .menu-row:hover{background:rgb(139 195 238/.12)}
html[data-theme="dark"] .account-panel .sign-out{border-top-color:#35475f}

/* Shared controls and account navigation in every Workspace view. */
html[data-theme=dark] select,html[data-theme=dark] select option,html[data-theme=dark] select optgroup{color-scheme:dark;background-color:#243248;color:#eef3fb}
html[data-theme=light] select option,html[data-theme=light] select optgroup{color-scheme:light;background-color:#fff;color:#182835}
.account-panel{width:min(360px,calc(100vw - 24px));max-height:calc(100dvh - 100px);overflow-y:auto;overscroll-behavior:contain}
.account-panel .menu-group{padding:7px 0;border-bottom:1px solid var(--line)}
.account-panel .menu-group-label{display:block;padding:7px 14px;font-size:11px;font-weight:600;letter-spacing:.05em;color:var(--muted)}
.account-panel .menu-row{min-height:44px;padding:11px 14px;gap:12px}
.account-panel .menu-row[aria-current=page]{background:var(--soft);box-shadow:inset 3px 0 var(--blue)}
.account-panel form{margin-top:7px}
.is-daily [data-day-caption],.is-daily [data-day-summary],.is-daily [data-day-metrics]>div>small:last-of-type{display:none}
.person-name,.marketer-name{color:var(--marketer-color,var(--ink))!important}
.person-name small{color:var(--muted)}
.person-bar:before,.person-bar:after{background:var(--marketer-color,var(--blue))!important}
.person-bar{color:var(--marketer-color,var(--blue))}
.row-disclosure{border-bottom:1px solid var(--line);padding:0}
.row-disclosure>summary{display:flex;align-items:center;gap:12px;min-height:64px;padding:12px 0;list-style:none;cursor:pointer}
.row-disclosure>summary::-webkit-details-marker{display:none}
.row-disclosure>summary:after{content:'›';margin-left:auto;font-size:24px;color:var(--muted);flex:none;transition:transform .15s}
.row-disclosure[open]>summary:after{transform:rotate(90deg)}
.row-summary-text{min-width:0;flex:1;overflow-wrap:anywhere}.row-summary-text strong,.row-summary-text small{display:block}
.row-summary-text small{margin-top:4px;font-size:12px;color:var(--muted)}
.row-body{padding:0 0 16px 48px}.row-body .timeline-stop{display:block;padding:0;border:0}.row-body .activity-title{margin-bottom:6px}
.risk-mark{display:inline-grid;place-items:center;background:#bd2639;color:white;border:2px solid var(--paper,#fff);border-radius:50%;width:20px;height:20px;font-size:13px;font-weight:800;flex:none}
@media(max-width:500px){.row-body{padding-left:0}.row-disclosure>summary{gap:8px}.account-panel{right:0}.row-disclosure .attention-age{font-size:12px}}
@media(prefers-reduced-motion:reduce){.row-disclosure>summary:after{transition:none}}

.person-bar{background:linear-gradient(to right,var(--marketer-color,var(--blue)) var(--fill),var(--line) var(--fill))!important}

.person-bar{background:linear-gradient(to right,var(--marketer-color,var(--blue)) var(--fill),var(--line) var(--fill))!important}

.is-daily [data-day-metrics]>.sales-card>small:last-of-type{display:block}

.row-disclosure>summary:before{display:none!important}
.row-disclosure .stop-number{display:grid;place-items:center;width:27px;height:27px;flex:none;border-radius:50%;background:var(--stop-color,#e7f1f8);color:#fff;font-size:12px;font-weight:700;border:2px solid var(--paper,#fff);box-shadow:0 0 0 1px var(--line)}
.row-disclosure time{font-size:12px;font-weight:650;flex:none}
html[data-theme=dark] .row-disclosure .stop-number{color:#101b2b}

/* One control height, including wrappers and native field margins. */
.workspace-controls{--control-h:48px;align-items:center}
.workspace-controls .day-date-controls,.workspace-controls .month-switch{height:var(--control-h);min-height:var(--control-h);padding:0;box-sizing:border-box}
.workspace-controls .control-marketer{display:flex;align-items:center;margin:0;padding:0}
.workspace-controls .control-marketer select{margin:0;height:var(--control-h);min-height:var(--control-h);box-sizing:border-box}
.workspace-controls .advanced>summary{height:var(--control-h);min-height:var(--control-h);display:flex;align-items:center;box-sizing:border-box;padding:0 16px}
.master-list>summary{display:flex!important;align-items:center;flex-wrap:wrap;gap:8px 16px!important;min-height:48px}
.master-list>summary h3{margin:0;flex:1 1 220px;color:var(--ink)}
.master-list>summary .chart-note{margin:0;font-weight:400;white-space:nowrap}
.master-list>summary:before{display:none!important}
.master-list>summary:after{content:'›';font-size:24px;flex:none;margin-left:auto;transform:rotate(0deg)}
.master-list[open]>summary:after{transform:rotate(90deg)}
.master-list[open]>summary{margin-bottom:14px}
.pin-verification .location-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.brand-logo{position:relative;display:inline-grid;place-items:center;width:36px;min-width:36px;height:36px}
.brand-logo .logo-fallback{grid-area:1/1;font-size:12px;font-weight:800;color:var(--ink);border:1px solid var(--line);border-radius:50%;width:36px;height:36px;display:grid;place-items:center}
.brand-logo img{grid-area:1/1;z-index:1}.brand-logo img[data-failed=true]{visibility:hidden}
.startup-recovery{margin:20px;padding:16px;border:1px solid var(--line,#aaa);border-radius:12px;background:var(--paper,#fff);color:var(--ink,#182835)}

.brand-logo .logo-fallback{visibility:hidden}.brand-logo:has(img[data-failed=true]) .logo-fallback{visibility:visible}

.top .brand-logo{display:inline-grid}.location-review>.location-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
html[data-theme="dark"] button.close-btn{background:rgb(139 195 238/.14)!important;color:#8ac6ef!important}
html[data-theme="dark"] button.close-btn:hover{background:rgb(139 195 238/.22)!important}
html[data-theme="dark"] button.close-btn:active{background:rgb(139 195 238/.3)!important}
html[data-theme="dark"] button.close-btn:focus-visible{outline-color:#8ac6ef}
html[data-theme="dark"] button.close-btn{background:#20344c!important;border-color:#3a5370!important;color:#cfe6f8!important;box-shadow:0 1px 4px rgb(0 0 0/.35)!important}
html[data-theme="dark"] button.close-btn:hover{background:#28405c!important;border-color:#4d6a8c!important}
html[data-theme="dark"] button.close-btn:active{background:#2f4b6b!important}
html[data-theme="dark"] .map-stage .map-card button.close-btn{background:#1b2b40!important}
html[data-theme="dark"] .branch-chip:has(input:checked){background:#2f78ad;border-color:#5aa6dd;color:#fff}
html[data-theme="dark"] .view-as-bar{background:#5a3590}
