/* H-BOT theme bridge (2026-10-19, v1): pieces that had fixed navy/indigo colours now follow the theme engine
   (hbot-theme.v1.js, --hb-* tokens). Loaded after hbot-activity-ui.css. Digit Sync stays a dark instrument
   panel under Daylight on purpose (its labels are fixed light text; its accents already follow the theme). */

/* H-BOT RUN BOT button (all themes) */
html[data-hbot-theme] #hbot-primary-run {
  background: linear-gradient(135deg, rgba(var(--hb-a-rgb), .2), rgba(var(--hb-b-rgb), .26)) !important;
  border-color: rgba(var(--hb-a-rgb), .55) !important; color: var(--hb-text) !important;
  box-shadow: 0 8px 24px rgba(var(--hb-a-rgb), .18) !important;
}
html[data-hbot-theme] #hbot-primary-run * { color: inherit !important; }
html[data-hbot-mode="light"] #hbot-primary-run { background: linear-gradient(135deg, var(--hb-a), var(--hb-b)) !important; border-color: transparent !important; color: #fff !important; }

/* phone top bar */
html[data-hbot-theme] #hbot-mobile-nav { background: var(--hb-bg) !important; border-color: var(--hb-line) !important; }
html[data-hbot-theme] #hbot-mobile-nav .hbot-mobile-menu, html[data-hbot-theme] #hbot-mobile-nav .hbot-mobile-session,
html[data-hbot-theme] #hbot-mobile-nav .hbot-mobile-signup, html[data-hbot-theme] #hbot-mobile-nav .hbot-mobile-account,
html[data-hbot-theme] #hbot-mobile-nav .hbot-mobile-transfer {
  background: var(--hb-card) !important; color: var(--hb-text) !important; border-color: var(--hb-line-2) !important;
}
html[data-hbot-theme] #hbot-mobile-nav .hbot-mobile-account select, html[data-hbot-theme] #hbot-mobile-nav .hbot-mobile-balance { color: var(--hb-text) !important; }

/* assistant chat bubbles (dashboard info panel + welcome tour) */
html[data-hbot-theme] .chat-ui__bubble {
  background: linear-gradient(135deg, rgba(var(--hb-a-rgb), .10), rgba(var(--hb-b-rgb), .14)) !important;
  border-color: var(--hb-line-2) !important; color: var(--hb-text) !important;
}
html[data-hbot-theme] .chat-ui__bubble strong, html[data-hbot-theme] .chat-ui__bubble b { color: var(--hb-a) !important; }

/* Daylight / light custom themes: native surfaces that kept dark gradients */
html[data-hbot-mode="light"] .main__run-strategy-wrapper .toolbar__section,
html[data-hbot-mode="light"] .toolbar__animation, html[data-hbot-mode="light"] .animation__container {
  background: var(--hb-card) !important; border-color: var(--hb-line-2) !important; box-shadow: var(--hb-shadow) !important;
}
html[data-hbot-mode="light"] .static-circle { background: var(--hb-line-2) !important; }
html[data-hbot-mode="light"] .db-info-panel, html[data-hbot-mode="light"] .tab__dashboard__info-panel { background: var(--hb-card) !important; }
html[data-hbot-mode="light"] .app-header__logo { background: transparent !important; }

/* motion off: the theme layer's own animations (spinners and Blockly untouched) */
html[data-hbot-motion="off"] .hbot-panel, html[data-hbot-motion="off"] .hbot-panel::before, html[data-hbot-motion="off"] .hbot-panel::after,
html[data-hbot-motion="off"] .main::before, html[data-hbot-motion="off"] .main::after, html[data-hbot-motion="off"] #hbot-primary-run,
html[data-hbot-motion="off"] .dc-tabs__item, html[data-hbot-motion="off"] .dc-tabs__item::before, html[data-hbot-motion="off"] .dc-tabs__item::after { animation: none !important; }
html[data-hbot-mode="light"] .app-header__logo, html[data-hbot-mode="light"] .app-header__logo * { color: var(--hb-text) !important; -webkit-text-fill-color: var(--hb-text) !important; }

/* 2026-10-19 phones: MAX LOSS sat on the run-status pill (live P/L) and over the Activity panel's totals.
   It now sits above the status row, and is replaced by a chip in the Activity header while that panel is open. */
@media (max-width: 767px) {
  #hbot-risk-control { bottom: 128px !important; left: 8px !important; padding: 5px 9px !important; font-size: 9.5px !important; }
  body:has(.run-panel-activity__panel) #hbot-risk-control { display: none !important; }
  /* the native onboarding chat panel overlays the top of the Dashboard on phones; the Command Center replaces it */
  body.hbot-cc-active .tab__dashboard__info-panel { display: none !important; }
}
.hbot-ml-chip { margin-right: 6px; height: 30px; padding: 0 10px; border-radius: 9px; border: 1px solid rgba(239, 68, 68, .5); background: rgba(239, 68, 68, .1); color: var(--hb-bad, #fca5a5); font: 800 11px Inter, system-ui, sans-serif; letter-spacing: .04em; cursor: pointer; }

/* 2026-10-19 (owner screenshot, Bot Builder under Daylight): the workspace toolbar strip kept a fixed dark gradient
   while its icons are dark grey, so the buttons vanished; the logo text (SVG) and DEFAULTS stayed light-on-light. */
html[data-hbot-theme] .toolbar__section { background: linear-gradient(180deg, rgba(var(--hb-d-rgb), .94), rgba(var(--hb-d-rgb), .84)) !important; border-color: var(--hb-line-2) !important; }
html[data-hbot-mode="light"] .toolbar__section { background: var(--hb-card) !important; box-shadow: var(--hb-shadow) !important; }
html[data-hbot-mode="light"] .toolbar__section .toolbar__icon svg, html[data-hbot-mode="light"] .toolbar__section .toolbar__icon svg path { fill: var(--hb-text) !important; color: var(--hb-text) !important; }
html[data-hbot-mode="light"] .toolbar__section .vertical-divider, html[data-hbot-mode="light"] .toolbar__section [class*="divider"] { background: var(--hb-line-2) !important; border-color: var(--hb-line-2) !important; }
html[data-hbot-mode="light"] .app-header svg text, html[data-hbot-mode="light"] header svg text { fill: var(--hb-text) !important; }
html[data-hbot-theme] #hbot-dbot-defaults-menu-trigger { color: var(--hb-a) !important; border-color: var(--hb-line-2) !important; background: rgba(var(--hb-a-rgb), .08) !important; -webkit-text-fill-color: var(--hb-a) !important; }
