/* Chart-panel (embed=1) mode only: one slim header instead of three. The normal Advisor page is unchanged. */
html.tsa-embed .preview-header,html.tsa-embed .conversation-heading{display:none!important}
html.tsa-embed .layout{min-height:100dvh!important}
html.tsa-embed .mobile-toolbar{display:flex!important;height:46px;min-height:46px;padding:5px 10px;gap:8px}
html.tsa-embed .mobile-menu-button{width:36px;height:34px}
html.tsa-embed .tsa-embed-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}
html.tsa-embed .tsa-embed-actions button{width:36px;height:34px;padding:0;border-radius:10px;border:1px solid #55599b;background:#222956;color:#cfd6ff;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
html.tsa-embed .tsa-embed-actions button:hover{background:#2c3470}
html.tsa-embed .tsa-embed-actions svg{display:block}

/* ---- v2 (owner 2026-11-11): no sidebar, no scrollbars, speech-bubble messages, slim brand header. Embed mode only. ---- */
html.tsa-embed,html.tsa-embed *{scrollbar-width:none!important}
html.tsa-embed *::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}
html.tsa-embed .sidebar,html.tsa-embed .mobile-backdrop,html.tsa-embed .mobile-menu-button,html.tsa-embed .mobile-view-switch{display:none!important}
html.tsa-embed .mobile-toolbar{background:linear-gradient(120deg,#1a2255,#10163a)!important;border-bottom:1px solid #3a46a0!important;justify-content:space-between}
html.tsa-embed .tsa-embed-brand{display:flex;align-items:center;gap:9px;min-width:0}
html.tsa-embed .tsa-embed-brand img{width:30px;height:30px;border-radius:50%;border:2px solid #22d3ee;background:#141a3d;object-fit:cover;object-position:50% 20%}
html.tsa-embed .tsa-embed-brand strong{display:block;font:700 14px/1.1 -apple-system,Segoe UI,Roboto,Arial,sans-serif;color:#fff}
html.tsa-embed .tsa-embed-brand small{display:flex;align-items:center;gap:5px;font:500 11px/1.2 -apple-system,Segoe UI,Roboto,Arial,sans-serif;color:#9fb0ea}
html.tsa-embed .tsa-embed-brand small::before{content:"";width:7px;height:7px;border-radius:50%;background:#34d399;box-shadow:0 0 6px #34d399}
html.tsa-embed .advisor-main,html.tsa-embed .conversation-state{background:linear-gradient(180deg,#0d1230,#0a0e24)!important}
html.tsa-embed .msg .bubble{position:relative;background:linear-gradient(145deg,#222c66,#161c4a)!important;border:1px solid #4150c4!important;border-radius:4px 20px 20px 20px!important;box-shadow:0 6px 18px rgba(0,0,0,.35)}
html.tsa-embed .msg .bubble::before{content:"";position:absolute;left:-7px;top:9px;width:12px;height:12px;background:#222c66;border-left:1px solid #4150c4;border-bottom:1px solid #4150c4;transform:rotate(45deg)}
html.tsa-embed .bubble.me{background:linear-gradient(145deg,#5b3fd6,#3d4fe0)!important;border:1px solid #7b86ff!important;border-radius:20px 4px 20px 20px!important;box-shadow:0 6px 18px rgba(60,70,220,.35)}
html.tsa-embed .bubble.me::before{content:"";position:absolute;right:-7px;top:9px;width:12px;height:12px;background:#4a47dc;border-right:1px solid #7b86ff;border-top:1px solid #7b86ff;transform:rotate(45deg)}
html.tsa-embed .bubble.me{position:relative}
html.tsa-embed .msg:has(.fc) .bubble::before{display:none}
html.tsa-embed .chat-composer{border-color:#5a67d8!important;box-shadow:0 0 0 1px rgba(124,140,255,.18),0 6px 22px rgba(0,0,0,.4)!important}

/* ---- v3 (owner 2026-11-13): ONE card, no card inside the card (like the Claude app): no inner border, radius or margins; a tidy compact header. Embed mode only; the normal Advisor page is unchanged. ---- */
html.tsa-embed .advisor-main{padding:0!important;border:0!important;background:transparent!important}
html.tsa-embed #tsaChat{border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
html.tsa-embed .askbar{background:transparent!important;padding:6px 10px 10px!important}
html.tsa-embed .mobile-toolbar{height:40px!important;min-height:40px!important;padding:4px 10px!important;gap:6px!important}
html.tsa-embed .tsa-embed-actions{gap:5px}
html.tsa-embed .tsa-embed-actions button{width:30px;height:28px;border-radius:9px}
html.tsa-embed .tsa-embed-actions svg{width:15px;height:15px}
html.tsa-embed .tsa-embed-brand{gap:8px}
html.tsa-embed .tsa-embed-brand img{width:26px;height:26px;border-width:1.5px}
html.tsa-embed .tsa-embed-brand strong{font-size:13px}
html.tsa-embed .tsa-embed-brand small{font-size:10.5px}
/* the panel can be short (phone sheet): the page must fit the frame so the message box stays visible at the bottom */
html.tsa-embed .layout{height:100dvh!important;min-height:0!important;overflow:hidden!important}
html.tsa-embed .advisor-main{min-height:0!important;flex:1 1 0!important}
/* no icons inside the chat, messages use the whole width (owner 2026-11-13): no star avatar, no bubble tails, no header picture */
html.tsa-embed .msg .av{display:none!important}
html.tsa-embed .msg{display:block!important;width:100%!important}
html.tsa-embed .msg .bubble,html.tsa-embed .bubble.me{width:100%!important;max-width:none!important;margin:0!important;box-sizing:border-box}
html.tsa-embed .msg .bubble::before,html.tsa-embed .bubble.me::before{display:none!important}
html.tsa-embed .msg .bubble,html.tsa-embed .bubble.me{border-radius:14px!important}
html.tsa-embed .tsa-embed-brand img{display:none!important}


/* TSA Advisor unified widget header: same chat/suggestions/list component
   as Main Advisor, but compact toolbar for Advanced Chart iframe only. */
html.tsa-embed .mobile-toolbar {
  position:relative!important;display:flex!important;
  justify-content:space-between!important;align-items:center!important;
  isolation:isolate;padding-inline:9px!important;
}
html.tsa-embed .tsa-embed-brand {flex:0 1 auto;min-width:0;max-width:120px}
html.tsa-embed .mobile-toolbar .tsa-speaker-toggle {
  display:inline-flex!important;position:absolute!important;
  left:50%!important;top:50%!important;
  transform:translate(-50%,-50%)!important;
  margin:0!important;padding:0!important;width:32px!important;height:30px!important;
  min-width:32px!important;z-index:3;background:#222956!important;
  border:1px solid #55599b!important;border-radius:9px!important;
  font-size:17px!important;
}
html.tsa-embed .tsa-embed-actions {
  order:10;margin-left:auto;gap:5px!important;flex:0 0 auto;z-index:2;
}
html.tsa-embed .tsa-embed-action-full {margin-right:2px}
html.tsa-embed .tsa-embed-action-close {
  order:10;margin-right:0!important;min-width:30px;
  background:#251b36!important;border-color:#80506e!important;
}
html.tsa-embed .tsa-embed-actions button {min-width:30px;min-height:30px}
@media (max-width:335px) {
  html.tsa-embed .tsa-embed-brand strong {font-size:11px!important}
  html.tsa-embed .tsa-embed-brand small {font-size:9px!important}
  html.tsa-embed .tsa-embed-brand {max-width:100px}
}
/* One matte Advisor design in Main view and in Advanced Chart embed.
   Keep the single compact floating header; only replace obsolete blue styling. */
html.tsa-embed .mobile-toolbar {
  background:#0f0f0f!important;
  border-bottom:1px solid #383838!important;
}
html.tsa-embed .advisor-main,
html.tsa-embed .conversation-state,
html.tsa-embed #tsaChat,
html.tsa-embed #tsaChatApp {
  background:#0f0f0f!important;
}
html.tsa-embed #tsaChat .msg .bubble,
html.tsa-embed #tsaChat .view>.msg .bubble,
html.tsa-embed #tsaChat #msgs .bubble {
  background:#1d1d1d!important;
  border-color:#383838!important;
  border-radius:14px!important;
  box-shadow:none!important;
}
html.tsa-embed #tsaChat .bubble.me,
html.tsa-embed #tsaChat #msgs .bubble.me {
  background:#262626!important;
  border-color:#383838!important;
  box-shadow:none!important;
}
html.tsa-embed .chat-composer,
html.tsa-embed #tsaChat .chat-composer,
html.tsa-embed #tsaChat .askbar .search {
  background:#1d1d1d!important;
  border-color:#383838!important;
  box-shadow:none!important;
}
html.tsa-embed .tsa-embed-actions button,
html.tsa-embed .mobile-toolbar .tsa-speaker-toggle {
  background:#1d1d1d!important;
  border-color:#555!important;
  color:#f0f0f0!important;
}
html.tsa-embed .tsa-embed-action-close {
  background:#1d1d1d!important;
  border-color:#555!important;
}



/* ISOLATED: TSA Advisor inside the Advanced Chart only.
   Full Advisor view keeps its original centered welcome/composer design.
   Order: Welcome -> scrollable suggestions -> bottom composer. */
html.tsa-embed #tsa-advisor-standalone .advisor-main {
  display:flex!important;
  flex-direction:column!important;
  justify-content:flex-start!important;
  align-items:stretch!important;
  min-height:0!important;
  overflow:hidden!important;
  padding:0!important;
}
html.tsa-embed #tsa-advisor-standalone .advisor-main:not(.tsa-started) .welcome-state {
  position:relative!important;
  inset:auto!important;
  transform:none!important;
  order:1;
  display:block!important;
  flex:0 1 auto!important;
  width:100%!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  margin:0!important;
  padding:8px 12px 4px!important;
  scrollbar-width:thin!important;
}
html.tsa-embed #tsa-advisor-standalone .advisor-main:not(.tsa-started) .explore-stocks {
  position:relative!important;
  inset:auto!important;
  transform:none!important;
  order:2;
  display:block!important;
  flex:1 1 auto!important;
  width:100%!important;
  max-width:none!important;
  min-height:0!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  margin:0!important;
  padding:8px 12px!important;
  text-align:left!important;
  scrollbar-width:thin!important;
}
html.tsa-embed #tsa-advisor-standalone .advisor-main .composer-zone {
  position:relative!important;
  inset:auto!important;
  transform:none!important;
  order:3;
  flex:0 0 auto!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:6px 10px 10px!important;
  background:#0f0f0f!important;
  z-index:5!important;
}
html.tsa-embed #tsa-advisor-standalone .advisor-main.tsa-started .conversation-state {
  order:2;
  flex:1 1 auto!important;
  min-height:0!important;
}

/* Batch 1: touch targets INSIDE floating Chart Advisor only.
   Append after existing composer-bottom fixes; never reorder the composer. */
@media(max-width:1024px),(pointer:coarse){
 html.tsa-embed #tsa-advisor-standalone .mobile-toolbar {
  height:44px!important;min-height:44px!important;
  box-sizing:border-box!important;
 }
 html.tsa-embed #tsa-advisor-standalone :is(
   .mobile-toolbar button,.voice-button,.send-button,
   .wt-row button,.chat-composer button
 ){
  min-height:40px!important;touch-action:manipulation;
 }
 html.tsa-embed #tsa-advisor-standalone :is(
   .mobile-toolbar button,.voice-button,.send-button,.chat-composer button
 ){min-width:40px!important;}
 html.tsa-embed #tsa-advisor-standalone :is(#chatInput,#askin){
  min-height:40px!important;min-width:0;
 }
}


/* Compact embedded 'View All' and supporting controls. */
@media(max-width:1024px),(pointer:coarse){
 html.tsa-embed #tsa-advisor-standalone button:not([hidden]){
  min-height:40px!important;min-width:40px!important;touch-action:manipulation;
 }
}
