/* Light surfaces and readable ink for the chart's independently styled panels. */
body.light{color-scheme:light;--bull:#087e50;--bear:#c5314c;--btm:#007b76;--sub:#465f72;--muted:#526a7c;--bright:#172d3f}
body.light #liveTicker,body.light #signalLegend,body.light .pane,body.light #actionCard,body.light #acHeroPremium{background:#fff!important;color:#263d4d!important;border-color:#d2dde5!important;box-shadow:0 2px 10px #20364a0d!important}
body.light #hdr{box-shadow:0 1px 5px #20364a12}
body.light #ohlSymName,body.light #acHeroSymbol,body.light .ac-stat-value,body.light #acHeroScore,body.light #acHeroConf{color:#172d3f!important;text-shadow:none!important}
body.light #signalLegend li,body.light #signalLegend p,body.light #signalLegend summary,body.light #acCardHeader{color:#334e60!important;text-shadow:none}
body.light #signalLegend button{background:#eef3f6!important}
body.light .ct,body.light .tab,body.light #ltool button{color:#405d70}
body.light #ohlBigPrice,body.light #ohlChgBadge{filter:none}
body.light #actionCard [style*="color: rgb(255, 255, 255)"],body.light #actionCard [style*="color:#ffffff"],body.light #actionCard [style*="color: #ffffff"]{color:#172d3f!important}
body.light #actionCard [style*="color: rgb(0, 217, 126)"],body.light #ohlBigPrice[style*="color: rgb(0, 217, 126)"]{color:#087e50!important}
body.light #actionCard [style*="color: rgb(255, 48, 80)"]{color:#c5314c!important}
body.light input,body.light textarea,body.light select{color:var(--bright);color-scheme:light}
body.light #signalLegendClose{color:#334e60!important}

body.light #acTrendBlock{background:#f7f9fc!important;border-color:#c9d5df!important}
body.light #acTrendStage{color:#40566b!important}
body.light #acTrendMa,body.light #acTrendAlign,body.light #acTrendWyckoff,body.light #acTrendElliott,body.light #acTrendQuality{color:#40566b!important}

/* Ask Signa, both themes. #chatHistory's inline max-height of
   calc(100vh - 300px) is taller than the sidebar (100vh minus the header
   and ticker). After the first answer fills it, .panel overflow:hidden
   clips the suggestion chips. The transcript is the only scroller; the
   input and chips stay in normal flow. !important beats that inline size. */
#p-chat > .pbody{display:flex!important;flex-direction:column!important;min-height:0!important;overflow:hidden!important}
#p-chat > .pbody > *{flex:0 0 auto}
#p-chat #chatHistory{flex:1 1 auto!important;min-height:0!important;max-height:none!important;overflow-x:hidden!important;overflow-y:auto!important;overflow-anchor:none}
#p-chat .chat-quick-row,#p-chat > .pbody > div[style*="flex-wrap:wrap"]{display:flex;flex-wrap:wrap;gap:4px}
#p-chat.chat-intro-collapsed .chat-intro-extra{display:none!important}
#p-chat > .pbody > .plabel{display:flex!important;align-items:center;gap:6px;min-width:0;white-space:nowrap;overflow:hidden}
#p-chat .signa-chat-clear{margin-left:auto!important;flex:0 0 auto;background:none!important;border:0!important;color:#94a3b8!important;font-size:14px!important;line-height:1!important;padding:2px 4px!important;cursor:pointer}
#signaChipToggle{display:none;flex:0 0 auto;font-family:var(--mono,monospace);font-size:10px;line-height:1;padding:3px 6px;border-radius:4px;border:1px solid rgba(0,229,180,.35);background:transparent;color:var(--btm,#00e5b4);cursor:pointer}
#p-chat.chat-suggestions-ready #signaChipToggle{display:inline-flex!important}
#p-chat.chat-chips-collapsed > .pbody > div[style*="flex-wrap:wrap"]{display:none!important}
/* An empty transcript still has an inline min-height and margin. Drop both
   so the chips clear the footer before the first answer, not only after. */
#p-chat #chatHistory:empty{flex:0 0 auto!important;min-height:0!important;margin:0!important;padding:0!important}
/* #signa-footer is position:fixed and 24px tall across the sidebar. End the
   sidebar at the top of that bar so chips cannot slide under it. */
@media (min-width:769px){
  #sidebar{bottom:24px!important}
  #p-chat > .pbody{padding-bottom:12px!important}
}
/* Phones and coarse pointers: one scrolling chip row, no Shift+Enter hint. */
@media (max-width:768px), (pointer:coarse){
  #p-chat > .pbody > div:has(#chatInput) + div{display:none!important}
  #p-chat > .pbody > div[style*="flex-wrap:wrap"]{flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;max-width:100%;width:100%;min-width:0;-webkit-overflow-scrolling:touch}
}
@media (max-width:768px){
  /* Phones hide the sidebar. Opening Ask Signa shows a sheet. Chips sit above
     the input in normal flow so they never cover the field or ASK. */
  #sidebar:has(#p-chat.on){display:grid!important;grid-template-rows:minmax(0,1fr)!important;grid-template-columns:minmax(0,1fr) 56px!important;position:fixed!important;top:calc(var(--hdr-h) + var(--ticker-h))!important;left:0!important;right:0!important;bottom:0!important;width:auto!important;height:auto!important;overflow:hidden!important;z-index:200000!important;background:var(--bg1,#0c1218)!important}
  #p-chat.on{display:flex!important;flex-direction:column!important;min-width:0!important;min-height:0!important;max-height:100%!important;height:100%!important;overflow:hidden!important}
  #p-chat .chat-intro-extra,#p-chat > .pbody > div:has(#buddyExpandBtn){display:none!important}
  #p-chat > .pbody > .plabel,#p-chat .signa-chat-clear,#p-chat.chat-suggestions-ready #signaChipToggle{display:flex!important}
  #p-chat.chat-suggestions-ready #signaChipToggle{display:inline-flex!important}
  #p-chat > .pbody{display:flex!important;flex-direction:column!important;flex:1 1 auto!important;min-height:0!important;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important}
  #p-chat #chatHistory{flex:1 1 auto!important;min-height:0!important;max-height:none!important;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important}
  #p-chat #chatHistory:empty{flex:0 0 auto!important;min-height:0!important;margin:0!important;padding:0!important}
  #p-chat > .pbody > div[style*="flex-wrap:wrap"]{order:2;position:static;flex:0 0 auto;background:transparent}
  #p-chat > .pbody > div:has(#chatInput){order:3;flex:0 0 auto;position:relative;z-index:3}
}
