/* Shared Overview design language. Login and the accepted Overview are excluded. */
#app :is(.sources-ready,.crm-leads-ready) {display:none;}
#app .status-badge:has(#status-dot.idle) {display:none;}
/* One flat, role-aware sidebar shared by Overview and every other section. */
body[data-current-tab] #app .sidebar .sidebar-nav {display:flex!important;flex-direction:column;padding:22px 0 12px;gap:2px;overflow-y:auto;min-height:0;flex:1;scrollbar-width:thin;}
body[data-current-tab] #app .sidebar {width:225px;padding:0 15px 12px;gap:0;background:#03080e;border-right:1px solid #17212b;box-shadow:none;}
body[data-current-tab] #app .sidebar .sidebar-brand {height:76px;min-height:76px;padding:0 10px;gap:12px;flex-shrink:0;}
body[data-current-tab] #app .sidebar .sidebar-nav button {flex-shrink:0;min-height:36px;padding:7px 11px;border:0;border-radius:7px;background:none;color:#abb1b7;box-shadow:none;font:14px/22px -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;text-align:left;}
body[data-current-tab] #app .sidebar .sidebar-nav button.active {background:#333d2b;color:#cef48e;box-shadow:inset 3px 0 #bff65c;}
body[data-current-tab] #app .sidebar .sidebar-nav button:hover {background:#252b2f;color:#f1f3f4;}
body[data-current-tab] #app .sidebar .sidebar-nav .nav-ref-icon {width:20px;height:20px;flex-basis:20px;stroke-width:1.4;color:currentColor;}
body[data-current-tab="leads"] #app .sidebar .sidebar-nav {padding-bottom:76px;}
body[data-current-tab="settings"] #app #settings-form .section-title,body[data-current-tab="offers"] #app .offers-toolbar-title {font-size:34px;line-height:43px;font-weight:550;letter-spacing:-.6px;}
body[data-current-tab]:not([data-current-tab="leads"]) #app > .app-shell {margin-left:225px;}
body[data-current-tab]:not([data-current-tab="leads"]) #app > header {height:63px;min-height:63px;margin-left:262px;margin-right:37px;padding:0;border:0;border-bottom:1px solid #17212b;background:#02070d;box-shadow:none;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .sidebar {width:225px;padding:0 15px 15px;gap:0;background:#03080e;border-right:1px solid #17212b;box-shadow:none;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .sidebar-brand {height:76px;min-height:76px;padding:0 10px;gap:12px;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .sidebar-brand__name {font-size:20px;font-weight:650;letter-spacing:-.5px;color:#f1f3f4;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .sidebar-brand__name span {color:#b3b7ba;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .sidebar-nav {padding:22px 0 0;gap:2px;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .sidebar-nav :is(button,summary) {min-height:36px;padding:7px 11px;border:0;border-radius:7px;background:none;color:#abb1b7;box-shadow:none;font-size:14px;line-height:22px;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .sidebar-nav button.active {background:#333d2b;color:#cef48e;box-shadow:inset 3px 0 #bff65c;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .sidebar-nav :is(button,summary):hover {background:#252b2f;color:#f1f3f4;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .sidebar-nav .nav-ref-icon {width:20px;height:20px;stroke-width:1.4;color:currentColor;}
body[data-current-tab]:not([data-current-tab="leads"]) #app {
  --ref-raw-canvas:#02070d;--ref-raw-panel:#070c12;--ref-raw-line:#17212b;
  --ref-raw-ink:#f2f4f5;--ref-raw-muted:#808a95;--ref-raw-accent:#7ce30d;
  --bg:var(--ref-raw-canvas);--surface:var(--ref-raw-panel);--surface2:#101419;
  --surface-hover:#151a20;--border:var(--ref-raw-line);--border2:#2b333c;
  --text:var(--ref-raw-ink);--text2:var(--ref-raw-muted);--green:var(--ref-raw-accent);
  --ui-shadow:none;background:var(--bg);color:var(--text);
  font:14px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  font-variant-numeric:tabular-nums;
}
body[data-theme="light"][data-current-tab]:not([data-current-tab="leads"]) #app {
  --ref-raw-canvas:var(--bg);--ref-raw-panel:var(--ui-card);--ref-raw-line:var(--ui-border);
  --ref-raw-ink:var(--text);--ref-raw-muted:var(--text2);--ref-raw-accent:var(--green);
  --surface:var(--ui-card);--surface2:var(--bg2);--border2:var(--border-hi);
}
body[data-theme="light"][data-current-tab] #app :is(.sidebar,.header-account) {background:var(--ui-nav);border-color:var(--ui-border);color:var(--text);}
body[data-theme="light"][data-current-tab] #app > header {background:var(--ui-nav);border-color:var(--ui-border);color:var(--text);}
body[data-theme="light"][data-current-tab] #app .sidebar :is(.sidebar-brand__name,.sidebar-brand__name span) {color:var(--text);}
body[data-theme="light"][data-current-tab] #app .sidebar .sidebar-nav button {color:var(--text2);}
body[data-theme="light"][data-current-tab] #app .sidebar .sidebar-nav button:hover {background:var(--surface-hover);color:var(--text);}
body[data-theme="light"][data-current-tab] #app .sidebar .sidebar-nav button.active {background:var(--green-dim);color:var(--text);box-shadow:inset 3px 0 var(--green);}
body[data-current-tab]:not([data-current-tab="leads"]) #app main {background:var(--bg);padding:30px 37px 28px;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(.page-head,.offers-head,.settings-head) {margin-bottom:22px;gap:24px;min-height:69px;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(.page-title,.offers-title,.settings-title) {font-family:inherit;font-size:34px;line-height:43px;font-weight:550;letter-spacing:-.6px;color:var(--text);text-transform:none;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane .page-subtitle {font:14px/20px -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;color:var(--text2);margin-top:1px;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(.settings-card,.summary-card,.chart-card,.crm-stat-card,.network-balance-panel,.network-balance-card,.ai-agent-hero,.ai-agent-panel,.offer-card,.vacancy-card,.source-card,.messenger-card,.table-wrap,.diagnostics-card) {background:var(--surface);border:1px solid var(--border);border-radius:11px;box-shadow:none;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(.settings-card,.chart-card,.ai-agent-panel,.network-balance-panel) {padding:16px;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(h2,h3,.section-title) {font-family:inherit;color:var(--text);font-size:18px;line-height:23px;font-weight:500;letter-spacing:-.22px;text-transform:none;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(.summary-card,.crm-stat-card,.network-balance-card) .value {font:550 28px/33px -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;letter-spacing:-.4px;color:var(--text);}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(.summary-card,.crm-stat-card,.network-balance-card) .label {font-size:14px;line-height:19px;font-weight:400;color:var(--text2);text-transform:none;letter-spacing:0;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(.btn-sm,.btn-action,.btn-primary,.btn-secondary) {font:14px/20px -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;min-height:36px;padding:7px 11px;border:1px solid var(--border);border-radius:8px;background:#101419;color:var(--text);box-shadow:none;text-transform:none;letter-spacing:0;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(.btn-action.primary,.btn-primary) {background:var(--green);border-color:#caef9b;color:#101509;font-weight:550;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(.btn-sm,.btn-action,.btn-secondary):hover {background:#151a20;border-color:#2b333c;transform:none;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),select,textarea) {font:14px/20px -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;color:var(--text);background:#101419;border:1px solid #2b333c;border-radius:8px;box-shadow:none;min-height:36px;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(input,textarea)::placeholder {color:#9ca4ac;opacity:1;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(button,input,select,textarea,summary):focus-visible {outline:2px solid var(--green);outline-offset:3px;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane table {border-collapse:collapse;background:var(--surface);font:14px/20px -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane th {height:34px;padding:8px 16px;color:var(--text2);background:var(--surface);font-size:13px;line-height:18px;font-weight:400;text-transform:none;letter-spacing:0;border-color:var(--border);}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane td {padding:12px 16px;border-color:var(--border);font-size:14px;line-height:20px;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane tbody tr:hover {background:#101419;}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(.empty,.muted,.text-sm,.table-meta) {color:var(--text2);font-family:inherit;}
@media(max-width:900px){body[data-current-tab]:not([data-current-tab="leads"]) #app main{padding:22px 24px 24px}}
@media(max-width:980px){body[data-current-tab]:not([data-current-tab="leads"]) #app > .app-shell{margin-left:0}body[data-current-tab]:not([data-current-tab="leads"]) #app > header{margin-left:24px;margin-right:24px}body[data-current-tab]:not([data-current-tab="leads"]) #app .sidebar{width:225px}}
@media(max-width:600px){body[data-current-tab]:not([data-current-tab="leads"]) #app main{padding:22px 20px 24px}body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(.page-title,.offers-title,.settings-title){font-size:30px;line-height:39px}body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane .page-head{flex-wrap:wrap;gap:16px}}
/* Section-specific surfaces, including components produced by live renderers. */
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(.source-overview,.sources-summary,.sources-trend,.crm-settings-card,.funnel-flow__card,.funnel-lead-card,.msg-accounts-panel,.vacancy-invite-panel) {background:var(--surface);border:1px solid var(--border);border-radius:11px;box-shadow:none;color:var(--text);}
body[data-current-tab]:not([data-current-tab="leads"]) #app .tab-pane :is(.source-overview,.sources-summary,.sources-trend,.crm-settings-card,.msg-accounts-panel) {padding:16px;min-width:0;}
body[data-current-tab="offers"] #app #tab-offers .offers-toolbar-title {font-size:34px;line-height:43px;font-weight:550;letter-spacing:-.6px;}
body[data-current-tab="sources"] #app .source-primary-metrics strong {font:550 28px/33px -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;color:var(--text);}
body[data-current-tab="sources"] #app .source-primary-metrics :is(span,small),body[data-current-tab="sources"] #app :is(.source-overview-head p,.sources-summary p,.sources-trend p) {color:var(--text2);}
body[data-current-tab="sources"] #app .source-primary-metrics > div {border-color:var(--border);}
body[data-current-tab="sources"] #app .sources-table {overflow-x:auto;max-width:100%;}
body[data-current-tab="sources"] #app .sources-table-row {min-width:650px;border-color:var(--border);}
body[data-current-tab="crm-messengers"] #app .tab-pane {
  --msg-bg:var(--bg);--msg-panel:var(--surface);--msg-panel-2:var(--surface2);--msg-border:var(--border);
  --msg-text:var(--text);--msg-muted:var(--text2);--msg-green:var(--green);--msg-green-soft:var(--green-dim);
}
body[data-theme="light"][data-current-tab="crm-messengers"] #app .tab-pane :is(.msg-kpis article,.msg-account-head,.msg-account-row button,.msg-activity>button) {background:var(--surface2);color:var(--text);border-color:var(--border);}
body[data-theme="light"][data-current-tab="crm-messengers"] #app .tab-pane :is(.msg-account-row,.msg-bottom-grid h2,.msg-activity-row,.msg-crm li) {border-color:var(--border);color:var(--text);}

/* Remove the remaining pre-reference dashboard surfaces discovered in live audit. */
body[data-current-tab="crm-leads"] #app .crm-leads-kpis article {
  border:1px solid var(--border);border-radius:11px;background:var(--surface);background-image:none;box-shadow:none;
}
body[data-current-tab="crm-leads"] #app .crm-leads-table-shell {
  border:1px solid var(--border);border-radius:11px;background:var(--surface);box-shadow:none;
}
body[data-current-tab="crm-leads"] #app .crm-leads-table-wrap :is(table,th) {background:var(--surface);}
body[data-current-tab="crm-leads"] #app .crm-leads-table-wrap :is(th,td),
body[data-current-tab="crm-leads"] #app .crm-leads-footer {border-color:var(--border);}
body[data-current-tab="crm-leads"] #app .crm-leads-footer {background:var(--surface);color:var(--text2);}
body[data-current-tab="crm-messengers"] #app .msg-kpis article {
  border:1px solid var(--border);border-radius:11px;background:var(--surface);background-image:none;box-shadow:none;
}
body[data-current-tab="crm-messengers"] #app :is(.msg-activity,.msg-crm) {
  border-color:var(--border);border-radius:11px;background:var(--surface);box-shadow:none;
}
body[data-current-tab="crm-messengers"] #app .msg-account-head {background:var(--surface2);color:var(--text2);}
body[data-current-tab="crm-messengers"] #app :is(.msg-account-row,.msg-bottom-grid h2,.msg-activity-row,.msg-crm li) {border-color:var(--border);}

/* Messengers page: the renderer owns these components, so keep their complete
   layout here instead of relying on styles from the retired AccountManager UI. */
body[data-current-tab="crm-messengers"] #app .crm-messengers-page {max-width:1545px;margin:0 auto;}
body[data-current-tab="crm-messengers"] #app .crm-messengers-page-head {display:flex;align-items:flex-start;justify-content:space-between;}
body[data-current-tab="crm-messengers"] #app .msg-kpis {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:18px;}
body[data-current-tab="crm-messengers"] #app .msg-kpis article {display:flex;align-items:center;gap:14px;min-height:105px;padding:20px;}
body[data-current-tab="crm-messengers"] #app .msg-kpis article>svg {width:27px;height:27px;fill:none;stroke:var(--green);stroke-width:1.6;}
body[data-current-tab="crm-messengers"] #app .msg-kpis article div {display:grid;gap:2px;}
body[data-current-tab="crm-messengers"] #app .msg-kpis span,body[data-current-tab="crm-messengers"] #app .msg-kpis small {color:var(--text2);font-size:13px;}
body[data-current-tab="crm-messengers"] #app .msg-kpis strong {font-size:28px;line-height:32px;font-weight:600;color:var(--text);}
body[data-current-tab="crm-messengers"] #app .msg-accounts-panel {padding:0!important;overflow:hidden;margin-bottom:18px;}
body[data-current-tab="crm-messengers"] #app .msg-accounts-head {display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--border);}
body[data-current-tab="crm-messengers"] #app .msg-accounts-head h2 {margin:0;}
body[data-current-tab="crm-messengers"] #app .msg-accounts-head button,body[data-current-tab="crm-messengers"] #app .msg-account-row button,body[data-current-tab="crm-messengers"] #app .msg-activity>button {min-height:34px;padding:6px 11px;border:1px solid var(--border2);border-radius:7px;background:var(--surface2);color:var(--text);cursor:pointer;}
body[data-current-tab="crm-messengers"] #app .msg-accounts-head button {background:var(--green);border-color:var(--green);color:#101509;font-weight:600;}
body[data-current-tab="crm-messengers"] #app .msg-account-table {min-width:980px;}
body[data-current-tab="crm-messengers"] #app .msg-accounts-panel {overflow-x:auto;}
body[data-current-tab="crm-messengers"] #app :is(.msg-account-head,.msg-account-row) {display:grid;grid-template-columns:34px 110px minmax(145px,1.3fr) 120px minmax(165px,1.2fr) 155px 110px 140px 104px 34px;align-items:center;gap:10px;padding:10px 18px;}
body[data-current-tab="crm-messengers"] #app .msg-account-head {min-height:38px;font-size:12px;}
body[data-current-tab="crm-messengers"] #app .msg-account-row {min-height:60px;border-top:1px solid var(--border);color:var(--text);}
body[data-current-tab="crm-messengers"] #app .msg-account-login,body[data-current-tab="crm-messengers"] #app .msg-account-row time {color:var(--text2);}
body[data-current-tab="crm-messengers"] #app .msg-channel-icon {display:grid;place-items:center;width:30px;height:30px;border-radius:8px;background:#13251e;color:#60d7ff;}
body[data-current-tab="crm-messengers"] #app .msg-channel-icon svg {width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;}
body[data-current-tab="crm-messengers"] #app .msg-state-dot {display:inline-block;width:7px;height:7px;margin-right:7px;border-radius:50%;background:var(--green);box-shadow:0 0 0 3px rgba(124,227,13,.12);}
body[data-current-tab="crm-messengers"] #app .msg-state-dot.is-off {background:#f1a91b;box-shadow:none;}
body[data-current-tab="crm-messengers"] #app .msg-sync-ok {display:flex;align-items:center;gap:6px;color:#9bdc55;}
body[data-current-tab="crm-messengers"] #app .msg-sync-ok.is-off {color:#d8a43b;}
body[data-current-tab="crm-messengers"] #app .msg-sync-ok svg {width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;}
body[data-current-tab="crm-messengers"] #app .msg-row-more {padding:0!important;width:30px;}
body[data-current-tab="crm-messengers"] #app .msg-account-empty {padding:28px 18px;color:var(--text2);text-align:center;border-top:1px solid var(--border);}
body[data-current-tab="crm-messengers"] #app .msg-bottom-grid {display:grid;grid-template-columns:1fr 1fr;gap:18px;}
body[data-current-tab="crm-messengers"] #app :is(.msg-activity,.msg-crm) {min-width:0;padding:18px;border:1px solid var(--border);}
body[data-current-tab="crm-messengers"] #app .msg-bottom-grid h2 {display:flex;align-items:center;gap:8px;margin:0 0 10px;padding-bottom:13px;border-bottom:1px solid var(--border);}
body[data-current-tab="crm-messengers"] #app .msg-bottom-grid h2 svg {width:19px;height:19px;fill:none;stroke:var(--green);stroke-width:1.7;}
body[data-current-tab="crm-messengers"] #app .msg-activity-row {display:grid;grid-template-columns:34px 1fr auto;align-items:center;gap:10px;padding:11px 0;border-bottom:1px solid var(--border);}
body[data-current-tab="crm-messengers"] #app .msg-activity-row span:nth-child(2) {display:grid;}
body[data-current-tab="crm-messengers"] #app .msg-activity-row :is(small,time),body[data-current-tab="crm-messengers"] #app .msg-activity p {color:var(--text2);}
body[data-current-tab="crm-messengers"] #app .msg-activity>button {margin-top:14px;}
body[data-current-tab="crm-messengers"] #app .msg-crm ul {list-style:none;margin:0;padding:0;}
body[data-current-tab="crm-messengers"] #app .msg-crm li {display:flex;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--border);}
body[data-current-tab="crm-messengers"] #app .msg-crm li span {display:grid;}
body[data-current-tab="crm-messengers"] #app .msg-crm li small {margin-top:3px;color:var(--text2);}
body[data-current-tab="crm-messengers"] #app .msg-crm li b {color:#9bdc55;font-size:12px;white-space:nowrap;}
@media(max-width:1100px){body[data-current-tab="crm-messengers"] #app .msg-kpis{grid-template-columns:1fr}body[data-current-tab="crm-messengers"] #app .msg-bottom-grid{grid-template-columns:1fr}}

/* Automation and AI Agent pages use the same dark workspace language. */
body[data-current-tab="automation"] #app .ai-agent-page {max-width:1545px;margin:0 auto;}
body[data-current-tab="automation"] #app .ai-agent-page-head {display:flex;align-items:flex-start;justify-content:space-between;}
body[data-current-tab="automation"] #app .ai-agent-hero {padding:0;overflow:hidden;margin-bottom:18px;}
body[data-current-tab="automation"] #app .ai-agent-hero-head {display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 18px;border-bottom:1px solid var(--border);}
body[data-current-tab="automation"] #app .ai-agent-hero-head h2 {display:flex;align-items:center;gap:9px;margin:0;font-size:14px;letter-spacing:.04em;}
body[data-current-tab="automation"] #app .ai-agent-icon {display:grid;place-items:center;width:25px;height:25px;border:1px solid #40512e;border-radius:7px;background:#182410;color:var(--green);font-style:normal;}
body[data-current-tab="automation"] #app .ai-agent-state {margin:0;padding:5px 9px;border:1px solid #344226;border-radius:999px;background:#151f10;color:#9bdc55!important;font-size:12px;font-weight:500;}
body[data-current-tab="automation"] #app .ai-agent-hero-body {display:grid;grid-template-columns:minmax(240px,.8fr) minmax(520px,1.6fr);align-items:stretch;}
body[data-current-tab="automation"] #app .ai-agent-hero-body>div:first-child {padding:22px 18px;border-right:1px solid var(--border);}
body[data-current-tab="automation"] #app .ai-agent-hero-body p {margin:0 0 18px;color:var(--text2);}
body[data-current-tab="automation"] #app .ai-agent-toggle {min-height:36px;padding:7px 12px;border:1px solid var(--border2);border-radius:8px;background:var(--surface2);color:var(--text);font-weight:600;cursor:pointer;}
body[data-current-tab="automation"] #app .ai-agent-toggle.is-enabled {border-color:#426127;background:#1a2a11;color:#a7e85f;}
body[data-current-tab="automation"] #app .ai-agent-hero-metrics {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));}
body[data-current-tab="automation"] #app .ai-agent-hero-metrics>span {display:grid;align-content:center;gap:3px;min-height:125px;padding:18px;border-right:1px solid var(--border);}
body[data-current-tab="automation"] #app .ai-agent-hero-metrics>span:last-child {border-right:0;}
body[data-current-tab="automation"] #app .ai-agent-hero-metrics small,body[data-current-tab="automation"] #app .ai-agent-hero-metrics em {color:var(--text2);font-size:12px;font-style:normal;}
body[data-current-tab="automation"] #app .ai-agent-hero-metrics strong {font-size:26px;line-height:31px;font-weight:600;color:var(--text);}
body[data-current-tab="automation"] #app .ai-agent-hero-metrics strong.warn {color:#e8b32c;}
body[data-current-tab="automation"] #app .ai-agent-tables {display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:18px;}
body[data-current-tab="automation"] #app .ai-agent-panel {padding:0!important;overflow:hidden;}
body[data-current-tab="automation"] #app .ai-agent-panel>h2 {display:flex;align-items:center;gap:9px;margin:0;padding:15px 18px;border-bottom:1px solid var(--border);font-size:14px;letter-spacing:.03em;}
body[data-current-tab="automation"] #app .ai-agent-panel>h2 i {color:var(--green);font-style:normal;}
body[data-current-tab="automation"] #app .ai-agent-panel>.ai-agent-list {display:block;margin:0;min-height:145px;}
body[data-current-tab="automation"] #app .ai-agent-table-row {display:grid;grid-template-columns:minmax(160px,1fr) auto;align-items:center;gap:12px;padding:12px 18px;border-bottom:1px solid var(--border);}
body[data-current-tab="automation"] #app .ai-agent-table-row span {color:var(--text2);}
body[data-current-tab="automation"] #app .ai-agent-empty {display:grid;place-items:center;min-height:145px;padding:20px;color:var(--text2);text-align:center;}
body[data-current-tab="automation"] #app .ai-agent-panel footer {display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:51px;padding:9px 18px;border-top:1px solid var(--border);color:var(--text2);}
body[data-current-tab="automation"] #app .ai-agent-panel footer button {min-height:32px;padding:5px 10px;border:1px solid var(--border2);border-radius:7px;background:var(--surface2);color:var(--text);cursor:pointer;}
body[data-current-tab="automation"] #app .ai-agent-panel .settings-grid {display:grid;gap:13px;padding:17px 18px;}
body[data-current-tab="automation"] #app .ai-agent-panel .form-row {display:grid;gap:6px;color:var(--text2);font-size:12px;}
body[data-current-tab="automation"] #app .ai-agent-panel textarea {resize:vertical;}
body[data-current-tab="automation"] #app .ai-agent-logs-panel {margin-top:0;}
body[data-current-tab="automation"] #app .ai-agent-logs {display:grid;margin:0;min-height:92px;}
body[data-current-tab="automation"] #app .ai-agent-logs>div:not(.ai-agent-empty) {display:grid;grid-template-columns:110px 8px 1fr;align-items:center;gap:10px;padding:9px 18px;border-bottom:1px solid var(--border);}
body[data-current-tab="automation"] #app .ai-agent-logs time {color:var(--text2);font:12px/18px "DM Mono",monospace;}
body[data-current-tab="automation"] #app .ai-agent-logs i {width:7px;height:7px;border-radius:50%;background:#79838c;}
body[data-current-tab="automation"] #app .ai-agent-logs i.error {background:#ff4d57;}body[data-current-tab="automation"] #app .ai-agent-logs i.warning {background:#e8b32c;}body[data-current-tab="automation"] #app .ai-agent-logs i.info {background:var(--green);}
@media(max-width:1100px){body[data-current-tab="automation"] #app .ai-agent-hero-body{grid-template-columns:1fr}body[data-current-tab="automation"] #app .ai-agent-hero-body>div:first-child{border-right:0;border-bottom:1px solid var(--border)}body[data-current-tab="automation"] #app .ai-agent-tables{grid-template-columns:1fr}}
@media(max-width:680px){body[data-current-tab="automation"] #app .ai-agent-hero-metrics{grid-template-columns:1fr}body[data-current-tab="automation"] #app .ai-agent-hero-metrics>span{min-height:90px;border-right:0;border-bottom:1px solid var(--border)}}
/* Mailing page was migrated to semantic markup; these rules replace the
   removed legacy layout without changing its sending behaviour. */
body[data-current-tab="telethon-mailing"] #app .tg-mailing-page {max-width:1545px;margin:0 auto;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-page {--surface:#070c12;--surface2:#101419;--border:#17212b;--border2:#2b333c;--text:#f1f3f4;--text2:#808a95;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-page>.page-head {display:flex;align-items:flex-start;justify-content:space-between;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-grid {display:grid;grid-template-columns:minmax(300px,.72fr) minmax(520px,1.28fr);gap:18px;align-items:start;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-compose {padding:0!important;overflow:hidden;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-compose>h3 {margin:0;padding:15px 18px;border-bottom:1px solid var(--border);font-size:15px;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-compose>:not(h3) {margin-left:18px;margin-right:18px;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-drop {display:grid;place-items:center;gap:5px;min-height:150px;margin-top:18px;padding:22px;border:1px dashed #3c4852;border-radius:10px;background:var(--surface2);color:var(--text);text-align:center;cursor:pointer;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-drop:hover {border-color:#3b4650;background:#151a20;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-drop span {max-width:310px;color:var(--text2);font-size:12px;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-drop input {max-width:100%;margin-top:9px;color:var(--text2);}
body[data-current-tab="telethon-mailing"] #app #tg-mailing-import-state {padding:12px 0;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-preview {display:flex;flex-wrap:wrap;gap:8px;padding-bottom:18px;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-preview span {display:grid;gap:2px;padding:8px 10px;border:1px solid var(--border);border-radius:7px;background:var(--surface2);}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-preview small {color:var(--text2);}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-accounts {display:grid;gap:8px;margin-top:17px;margin-bottom:14px;padding:12px;border:1px solid var(--border);border-radius:9px;background:var(--surface2);color:var(--text2);}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-accounts label {display:grid;grid-template-columns:auto 1fr;column-gap:9px;align-items:center;padding:8px;border-radius:7px;background:var(--surface);color:var(--text);}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-accounts label input {grid-row:1/3;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-accounts label span {color:var(--text2);font-size:12px;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-compose .form-row {display:grid;gap:6px;margin-top:12px;color:var(--text2);font-size:12px;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-compose textarea {width:100%;resize:vertical;}
body[data-current-tab="telethon-mailing"] #app .tg-spintax-help {display:flex;align-items:center;gap:10px;margin-top:9px;color:var(--text2);font-size:12px;}
body[data-current-tab="telethon-mailing"] #app .tg-spintax-help code {padding:5px 7px;border:1px solid var(--border);border-radius:6px;background:#101419;color:#c7cdd2;}
body[data-current-tab="telethon-mailing"] #app .tg-spintax-preview {min-height:48px;margin-top:10px;padding:11px;border-left:3px solid #59636b;border-radius:4px;background:#0b0f13;color:var(--text2);}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-controls {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:14px;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-controls label {display:grid;gap:5px;color:var(--text2);font-size:12px;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-consent {display:flex;align-items:flex-start;gap:9px;margin-top:14px;color:var(--text);}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-consent input {margin-top:3px;accent-color:var(--green);}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-compose .actions {display:flex;gap:9px;margin-top:15px;margin-bottom:8px;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-compose .save-msg {min-height:28px;margin-bottom:14px;color:var(--text2);}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-status {margin-top:18px;padding:18px!important;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-status-head {display:flex;align-items:center;justify-content:space-between;gap:16px;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-status-head h3 {margin:0;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-status-head span {color:var(--text2);}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-progress {height:8px;margin:16px 0;border-radius:999px;background:#242b31;overflow:hidden;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-progress i {display:block;width:0;height:100%;border-radius:inherit;background:var(--green);transition:width .25s ease;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-metrics {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--border);border-radius:9px;overflow:hidden;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-metrics span {display:grid;gap:2px;padding:13px 15px;border-right:1px solid var(--border);color:var(--text2);font-size:12px;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-metrics span:last-child {border-right:0;}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-metrics strong {font-size:22px;color:var(--text);}
body[data-current-tab="telethon-mailing"] #app .tg-mailing-log {margin-top:12px;padding:10px 12px;border-radius:7px;background:var(--surface2);color:var(--text2);font:12px/18px "DM Mono",monospace;}
@media(max-width:1100px){body[data-current-tab="telethon-mailing"] #app .tg-mailing-grid{grid-template-columns:1fr}}
@media(max-width:680px){body[data-current-tab="telethon-mailing"] #app .tg-mailing-controls,body[data-current-tab="telethon-mailing"] #app .tg-mailing-metrics{grid-template-columns:1fr 1fr}body[data-current-tab="telethon-mailing"] #app .tg-spintax-help{align-items:flex-start;flex-direction:column}}
@media(max-width:600px){body[data-current-tab="sources"] #app .sources-analysis{display:grid;grid-template-columns:minmax(0,1fr)}body[data-current-tab="sources"] #app .source-primary-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}body[data-current-tab="sources"] #app .source-period-metrics{display:flex;flex-wrap:wrap;gap:16px}body[data-current-tab="sources"] #app .source-period-metrics > div{flex:1 1 40%;min-width:0}body[data-current-tab="sources"] #app .source-period-metrics > button{flex:1 1 100%;white-space:normal}body[data-current-tab="sources"] #app .sources-toolbar{flex-wrap:wrap}body[data-current-tab="offers"] #app #tab-offers .offers-toolbar-title{font-size:30px;line-height:39px}}
