/* Appearance tokens only: layout, tenant scope and mail rendering are unchanged. */
:root {
  --theme-color-scheme: dark;
  --theme-control-bg: #131e2b;
  --theme-control-text: #dce3ef;
  --theme-control-border: #3a4a60;
  --theme-focus: #8fa3ff;
}
html[data-theme="light"] {
  color-scheme: light;
  --theme-color-scheme: light;
  --theme-scrollbar-thumb: #b4bfce;
  --theme-control-bg: #ffffff;
  --theme-control-text: #334155;
  --theme-control-border: #c4cfdf;
  --theme-focus: #3454ce;
  --theme-text: #27364c;
  --theme-muted: #536278;
  --theme-overlay-rgb: 23, 36, 59;
  --theme-surface: #ffffff;
  --wts-adaptive-background: #f5f7fb;
  --wts-adaptive-backgroundScreen: #f5f7fb;
  --wts-adaptive-backgroundLevel01: #ffffff;
  --wts-adaptive-floatBackground: #ffffff;
  --wts-adaptive-tableBackground: #ffffff;
  --wts-adaptive-hairlineBorder: #d7deea;
  --wts-adaptive-grey50: #f0f3f8;
  --wts-adaptive-grey100: #edf1f7;
  --wts-adaptive-grey200: #e1e7f0;
  --wts-adaptive-grey300: #b8c4d5;
  --wts-adaptive-grey500: #627187;
  --wts-adaptive-grey600: #536278;
  --wts-adaptive-grey700: #3a4b63;
  --wts-adaptive-grey800: #27364c;
  --wts-adaptive-grey900: #17243b;
  --wts-adaptive-blue50: #eaf0ff;
  --wts-adaptive-blue500: #315acb;
  --wts-adaptive-blue600: #2346ae;
  --wts-adaptive-blue700: #2346ae;
  --wts-adaptive-green50: #e5f4ed;
  --wts-adaptive-green700: #137448;
  --wts-adaptive-red50: #fcebea;
  --wts-adaptive-red500: #bc343e;
  --wts-adaptive-red700: #bc343e;
  --wts-adaptive-orange50: #fff2da;
  --wts-adaptive-orange500: #925a0b;
  --wts-adaptive-orange700: #925a0b;
  --wts-adaptive-teal50: #e1f2f3;
  --wts-adaptive-teal500: #086e79;
  --wts-adaptive-purple50: #efeafa;
  --wts-adaptive-purple500: #6c45af;
  --page: #f5f7fb;
  --surface: #f5f7fb;
  --surface-raised: #ffffff;
  --surface-elevated: #ffffff;
  --ink: #17243b;
  --text: #27364c;
  --muted: #536278;
  --subtle: #627187;
  --line: #d7deea;
  --line-strong: #b8c4d5;
  --brand: #315acb;
  --brand-dark: #2346ae;
  --blue: #315acb;
  --green: #137448;
  --red: #bc343e;
  --orange: #925a0b;
  --category-own: #315acb;
  --category-affiliates: #137448;
  --category-competitors: #bc343e;
  --category-industry: #925a0b;
  --sentiment-positive: #137448;
  --sentiment-neutral: #536278;
  --sentiment-negative: #bc343e;
  --customer-panel: #ffffff;
  --customer-card: #f0f3f8;
  --customer-track: #e1e7f0;
  --control-bg: #edf1f7;
  --control-bg-hover: #e1e7f0;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --shadow-soft: 0 12px 36px rgba(33, 50, 78, .10);
  --shadow-panel: 0 1px 3px rgba(33, 50, 78, .08);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
html[data-theme="light"] body.customer-active {
  --cw-page: #f5f7fb;
  --cw-lnb: #edf1f7;
  --cw-surface: #ffffff;
  --cw-surface-2: #f0f3f9;
  --cw-surface-3: #e7edf6;
  --cw-line: #d7deea;
  --cw-line-strong: #b8c4d5;
  --cw-text: #17243b;
  --cw-text-soft: #34465e;
  --cw-muted: #536278;
  --cw-faint: #627187;
  --cw-article-title: #17243b;
  --cw-blue: #3454ce;
  --cw-blue-strong: #2947b3;
  --cw-blue-text: #2947b3;
  --cw-blue-soft: #e7edff;
  --cw-blue-soft-hover: #dbe4ff;
  --cw-blue-border: #91a5e9;
  --cw-brick: #bc343e;
  --cw-brick-strong: #a32832;
  --cw-brick-soft: #fcebea;
  --cw-sage: #137448;
  --cw-sage-strong: #0b653c;
  --cw-sage-soft: #e5f4ed;
  --cw-neutral-evidence: #536278;
  --cw-neutral-evidence-strong: #40516a;
  --cw-neutral-evidence-soft: #edf1f7;
  --cw-data-blue: #315acb;
  --cw-data-green: #168754;
  --cw-data-red: #cf3648;
  --cw-data-amber: #ad6b00;
  --cw-data-neutral: #536278;
  --cw-amber: #925a0b;
  --cw-amber-soft: #fff2da;
  --cw-green: #137448;
  --cw-red: #bc343e;
  --customer-track: #e1e7f0;
}
/* Explicit overrides for older, non-tokenized controls and SVG charts. */
html[data-theme="light"] body.operator-active {
  --op-bg:#f5f7fb; --op-surface:#ffffff; --op-surface-2:#f0f3f9;
  --op-surface-3:#e7edf6; --op-field:#f0f3f9; --op-line:#d7deea; --op-line-2:#b8c4d5;
  --op-ink:#17243b; --op-muted:#536278; --op-sub:#627187;
  --op-primary:#6940c4; --op-primary-hover:#5532a7; --op-primary-soft:#eee7fc;
  --op-success:#137448; --op-warn:#925a0b; --op-danger:#bc343e; --op-blue:#315acb; --op-cyan:#086e79;
  --op-shadow:0 12px 36px rgba(33,50,78,.10);
}
html[data-theme="light"] body.operator-active .brand::after { color:#6940c4; }
html[data-theme="light"] #operatorView.operator-open-design button.primary { color:#ffffff; }
html[data-theme="light"] #operatorView.operator-open-design .apm-map-pane {
  background:linear-gradient(#dce3ee 1px,transparent 1px),linear-gradient(90deg,#dce3ee 1px,transparent 1px),#f5f7fb;
  background-size:32px 32px;
}
html[data-theme="light"] #operatorView.operator-open-design .apm-pane-head { background:#f0f3f9; }
html[data-theme="light"] #operatorView.operator-open-design .apm-state-cell.is-pending b { color:#925a0b; }
html[data-theme="light"] #operatorView.operator-open-design .apm-state-cell.is-processing b { color:#315acb; }
html[data-theme="light"] #operatorView.operator-open-design .apm-state-cell.is-completed b { color:#137448; }
html[data-theme="light"] #operatorView.operator-open-design .apm-state-cell.is-failed b { color:#bc343e; }
html[data-theme="light"] #operatorView.operator-open-design .apm-live-state.is-live { color:#137448; }
html[data-theme="light"] body.operator-active .app-header { box-shadow:0 1px 0 var(--op-line); }
html[data-theme="light"] body :is(input,select,textarea) { color-scheme: light; }
html[data-theme="light"] .clipwire-wordmark { filter: brightness(0) saturate(100%); }
html[data-theme="light"] body.customer-active .page-title-bar { background: var(--cw-page); }
html[data-theme="light"] body :is(.app-header,.auth-main,.auth-shell,.auth-copy) { background: var(--page); color: var(--text); }
html[data-theme="light"] body :is(.auth-main .panel,.auth-main .panel-body) { background: var(--surface-raised); color: var(--text); }
html[data-theme="light"] body .auth-copy :is(h1,p) { color: var(--text); }
html[data-theme="light"] body .admin-mail-note { background: #eaf0ff; border-color: #b3c2e9; }
html[data-theme="light"] body .admin-mail-card { --bg:#f5f7fb; --panel:#ffffff; }
html[data-theme="light"] body .admin-mail-card button.primary { background:#3454ce; color:#fff; }
html[data-theme="light"] body .line-axis-label { fill:var(--muted); }
html[data-theme="light"] body .line-grid { stroke:var(--line); }
html[data-theme="light"] body .line-tooltip-box { fill:var(--surface-raised); stroke:var(--line-strong); }
html[data-theme="light"] body :is(.line-tooltip-title,.line-tooltip-label,.line-tooltip-value) { fill:var(--ink); }
html[data-theme="light"] body .line-hover-guide { stroke:var(--muted); }
html[data-theme="light"] body :is(.nav-scrim,.modal-backdrop) { background:rgba(24,37,59,.32); }
html[data-theme="light"] body :is(input,textarea)::placeholder { color:#627187; opacity:1; }
html[data-theme="light"] body .auth-main input { background:#edf1f7; color:var(--ink); }
html[data-theme="light"] body .auth-main button.primary { background:#3454ce; color:#fff; }
html[data-theme="light"] body .auth-field-label { color:var(--muted); }
/* The preview document and word-cloud image keep their own print/media colors. */
.theme-toggle.theme-toggle {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:44px; min-width:44px; padding:0 12px; flex:0 0 auto;
  border:1px solid var(--theme-control-border); border-radius:8px;
  background:var(--theme-control-bg); color:var(--theme-control-text);
  font-family:inherit; font-size:12px; font-weight:600; line-height:1.4;
  cursor:pointer; white-space:nowrap; box-shadow:none;
}
.theme-toggle.theme-toggle:hover { background:var(--theme-control-bg); border-color:var(--theme-focus); color:var(--theme-control-text); }
.theme-toggle.theme-toggle:focus-visible { outline:2px solid var(--theme-focus); outline-offset:3px; }
.theme-symbol { font:22px/1 sans-serif; width:22px; text-align:center; }
.theme-symbol[hidden] { display:none; }
.auth-copy .theme-toggle { margin-bottom:24px; justify-self:center; width:auto; }
body.customer-active .side-footer .theme-toggle { width:100%; margin-bottom:12px; color:var(--theme-control-text); background:var(--theme-control-bg); }
@media(min-width:721px) and (max-width:1100px) {
  body.customer-active .side-footer .theme-toggle { padding:0; }
  body.customer-active .side-footer .theme-label { display:none; }
}
@media(max-width:720px) {
  .app-header > .brand { flex-shrink:0; }
  .header-actions .theme-toggle { padding:0 8px; }
  .header-actions .theme-toggle .theme-label { display:none; }
  .header-actions .tenant-label { max-width:100px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .nav-actions .theme-toggle { padding:0 8px; }
  .nav-actions .theme-toggle .theme-label { display:none; }
}
@media(max-width:480px) {
  .site-shell .brand-word-stack { display:none; }
  .site-shell .brand-link { min-width:34px; }
}

/* Public landing: preserve the layout, artwork and default dark palette. */
html[data-theme="light"][data-theme-surface="public"] {
  --cw-bg:#f5f7fb; --cw-bg-soft:#eef2f8; --cw-bg-muted:#e7edf5; --cw-bg-deep:#edf1f7;
  --cw-surface:#ffffff; --cw-surface-raised:#f0f3f9; --cw-surface-strong:#e7edf6; --cw-surface-muted:#e1e8f1;
  --cw-bg-black-start:#f5f7fb; --cw-bg-black-end:#edf1f7;
  --cw-border:#d7deea; --cw-border-strong:#b8c4d5;
  --cw-text-primary:#17243b; --cw-text-secondary:#34465e; --cw-text-muted:#536278;
  --cw-accent-primary:#087d70; --cw-accent-primary-strong:#066357; --cw-accent-primary-soft:#087d70;
  --cw-accent-primary-pale:#17695f; --cw-focus:#3454ce; --cw-shadow:rgba(33,50,78,.08);
  --cw-section-band-logo:#eef2f8; --cw-section-band-clarity:#f5f7fb; --cw-section-band-faq:#eef2f8;
  --cw-section-band-promo:#e9f4f0; --cw-section-band-border:#d7deea;
}
html[data-theme="light"] .site-shell :is(.nav-shell,.contact-form-shell,.contact-select-layer) { background:#ffffff; color:#17243b; border-color:#d7deea; }
html[data-theme="light"] .site-shell .brand-word-default { opacity:0; }
html[data-theme="light"] .site-shell .brand-word-inverse { opacity:1; }
html[data-theme="light"] .site-shell .hero::before { background:radial-gradient(ellipse at 50% 75%,#d5f2ec,transparent 60%),linear-gradient(#f5f7fb,#eef2f8); }
html[data-theme="light"] .site-shell :is(.hero h1,.section-heading h2) { color:#17243b; -webkit-text-fill-color:currentColor; }
html[data-theme="light"] .site-shell .hero h1 span { -webkit-text-fill-color:currentColor; color:#087d70; }
html[data-theme="light"] .site-shell .clarity-grid article { background:#ffffff; border-color:#d7deea; box-shadow:0 8px 24px rgba(33,50,78,.06); }
html[data-theme="light"] .site-shell .clarity-grid article::before { opacity:.12; }
html[data-theme="light"] .site-shell .partner-logo-item { background:#172033; border-radius:8px; }
html[data-theme="light"] .site-shell .button-primary { background:#087d70; color:#ffffff; }
html[data-theme="light"] .site-shell .hero-art {
  --cw-surface:#111827; --cw-surface-raised:#172033; --cw-surface-strong:#1a2438;
  --cw-text-primary:#f8fafc; --cw-text-secondary:#cbd5e1; --cw-text-muted:#94a3b8;
  --cw-accent-primary:#23d5ba; --cw-accent-primary-soft:#7ff5e4;
}
html[data-theme="light"] .site-shell .product-section { --product-background:#f5f7fb; --product-orb-background:#f5f7fb; }
html[data-theme="light"] .site-shell .product-webgl-bg canvas { opacity:.12; }
html[data-theme="light"] .site-shell .product-flow article { background:#ffffff; border-color:#c4cfdf; }
html[data-theme="light"] .site-shell .product-flow :is(.flow-index,.flow-icon) { color:#34465e; }
html[data-theme="light"] .site-shell .logo-chip-section::before { background:linear-gradient(#f5f7fb,#eee8fc); }
html[data-theme="light"] .site-shell .logo-chip-section::after { opacity:.06; }
html[data-theme="light"] .site-shell .team-modal-panel { background:#f5f7fb; }
html[data-theme="light"] .site-shell :is(.team-modal-close,.team-modal-cta) { color:#ffffff; }
html[data-theme="light"] .site-shell .primary-nav[data-open="true"] { background:#ffffff; color:#17243b; }
html[data-theme="light"] .site-shell .footer-brand img { filter:brightness(0); }
html[data-theme="light"] .site-shell :is(.footer-brand p,.footer-nav a,.footer-link-button,.footer-meta,.footer-legal,.footer-bottom) { color:#536278; }
html[data-theme="light"] .site-shell :is(.footer-info,.footer-info a,.footer-policy-copy,.footer-policy-copy p) { color:#536278; }
html[data-theme="light"] .site-shell :is(.logo-chip,.faq-item,.footer-policy-panel,.footer-policy-header) { background:#ffffff; border-color:#d7deea; }
html[data-theme="light"] .site-shell :is(.logo-chip .flow-icon,.faq-item summary,.footer-policy-close) { color:#34465e; }
html[data-theme="light"] .site-shell .footer-policy-brand img { filter:brightness(0); }
html[data-theme="light"] .site-shell .promo-section::before { background:linear-gradient(#edf5f1,#f5f7fb); }
html[data-theme="light"] body ::-webkit-scrollbar-track { background:#edf1f7; }
html[data-theme="light"] body ::-webkit-scrollbar-thumb { background:var(--theme-scrollbar-thumb); border-radius:6px; }
html[data-theme="light"][data-theme-surface="public"] body { background:var(--cw-bg); }
html[data-theme="light"][data-theme-surface="public"] .page > .header .brand-word { filter:brightness(0); }
html[data-theme="light"][data-theme-surface="public"] .page :is(p,.footer) { color:#536278; }
html[data-theme="light"][data-theme-surface="public"] .page .eyebrow { color:#087d70; }
html[data-theme="light"][data-theme-surface="public"] .page .button-primary { color:#ffffff; background:#087d70; }
.page > .header .theme-toggle { order:1; }
