.advisor-widget {
  position: fixed;
  z-index: 35;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  color: #20251f;
  font: 14px/1.5 Manrope, sans-serif;
  width: min(410px, calc(100vw - 32px));
  pointer-events: none;
}
.advisor-widget *, .advisor-widget *::before, .advisor-widget *::after { box-sizing: border-box; }
.advisor-widget [hidden] { display: none !important; }
.advisor-widget button, .advisor-widget textarea, .advisor-widget a { font: inherit; }
.advisor-widget button { cursor: pointer; border-radius: 0; }
.advisor-widget button:focus-visible, .advisor-widget a:focus-visible, .advisor-widget textarea:focus-visible, .advisor-log:focus-visible { outline: 3px solid #5b7618; outline-offset: 3px; }
.advisor-launcher {
  display: block;
  pointer-events: auto;
  margin-left: auto;
  padding: 12px 17px;
  min-height: 54px;
  max-width: 100%;
  background: #20251f;
  color: #f7f8f2;
  border: 1px solid #20251f;
  text-align: left;
  font-weight: 700 !important;
  box-shadow: 0 6px 20px #20251f24;
}
.advisor-launcher:hover { background: #344c32; }
.advisor-launcher-note { display: block; font-size: 11px; font-weight: 400; margin-top: 2px; color: #e5eacb; }
.advisor-panel {
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  background: #f7f8f2;
  border: 1px solid #8d9684;
  margin-bottom: 10px;
  height: min(660px, calc(100dvh - 124px));
  min-height: 260px;
  box-shadow: 0 12px 38px #20251f29;
  overflow: hidden;
}
.advisor-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px 8px; background: #d5ed73; flex-shrink: 0; }
.advisor-widget .advisor-title { margin: 0; font-size: 21px; line-height: 1.2; letter-spacing: -.03em; font-weight: 700; }
.advisor-close { min-height: 44px; background: transparent; border: 0; padding: 8px 0 8px 8px; color: #20251f; font-size: 12px !important; text-decoration: underline; text-underline-offset: 3px; }
.advisor-widget .advisor-disclosure { margin: 0; padding: 0 16px 13px; background: #d5ed73; color: #34412b; font-size: 12px; flex-shrink: 0; }
.advisor-log { padding: 18px 16px 8px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 80px; scrollbar-width: thin; scrollbar-color: #7e8a75 #f7f8f2; }
.advisor-message { margin: 0 0 18px; overflow-wrap: anywhere; }
.advisor-message-user { margin-left: 24px; padding: 12px; background: #e5eacb; }
.advisor-speaker { display: block; margin-bottom: 5px; font-size: 11px; font-weight: 700; color: #4c5942; }
.advisor-widget .advisor-message-text { margin: 0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; text-wrap: pretty; }
.advisor-links { display: flex; flex-wrap: wrap; gap: 4px 15px; margin-top: 6px; }
.advisor-link { display: inline-flex; align-items: center; min-height: 44px; color: #344c32; text-decoration: underline; text-underline-offset: 4px; font-weight: 700 !important; }
.advisor-link:hover { color: #20251f; }
.advisor-prompts { display: flex; gap: 6px; padding: 6px 16px 10px; overflow-x: auto; flex-shrink: 0; scrollbar-width: thin; }
.advisor-prompt { flex: 0 0 auto; max-width: 280px; min-height: 44px; background: #eff1e9; border: 1px solid #9ca68f; color: #34412b; padding: 7px 10px; text-align: left; font-size: 12px !important; }
.advisor-prompt:hover { background: #e5eacb; border-color: #344c32; }
.advisor-form { padding: 10px 16px 0; border-top: 1px solid #d9ddd4; flex-shrink: 0; }
.advisor-label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.advisor-input-row { display: flex; gap: 8px; align-items: stretch; }
.advisor-input { width: 100%; min-width: 0; min-height: 64px; max-height: 130px; resize: vertical; padding: 9px 10px; border: 1px solid #8d9684; border-radius: 0; background: #fff; color: #20251f; caret-color: #344c32; font-size: 16px !important; line-height: 1.4 !important; }
.advisor-input::placeholder { color: #60675b; font-size: 13px; }
.advisor-submit { min-width: 64px; min-height: 44px; padding: 8px; border: 1px solid #20251f; color: #f7f8f2; background: #20251f; font-weight: 700 !important; }
.advisor-submit:hover { background: #344c32; }
.advisor-widget .advisor-privacy { margin: 8px 16px 0; color: #50594a; font-size: 11px; line-height: 1.5; flex-shrink: 0; }
.advisor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; padding: 4px 16px 9px; flex-shrink: 0; }
.advisor-widget .advisor-transfer-note { flex-basis: 100%; margin: 4px 0 0; color: #50594a; font-size: 11px; line-height: 1.5; }
.advisor-transfer, .advisor-clear { min-height: 44px; padding: 5px 0; background: transparent; border: 0; color: #344c32; text-align: left; text-decoration: underline; text-underline-offset: 4px; font-size: 12px !important; }
.advisor-transfer { font-weight: 700 !important; }
.advisor-clear { margin-left: auto; }
@media (max-width: 480px) {
  .advisor-widget { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
  .advisor-panel { height: min(660px, calc(100dvh - 108px)); margin-bottom: 8px; }
  .advisor-launcher { padding: 10px 13px; }
  .advisor-launcher-note { display: none; }
  .advisor-actions { gap: 0 8px; }
  .advisor-transfer { font-size: 11px !important; }
}
@media (max-height: 580px) {
  .advisor-panel { min-height: 0; height: calc(100dvh - 32px); margin-bottom: 0; overflow-y: auto; overscroll-behavior: contain; }
  .advisor-log { flex: 0 0 auto; max-height: 30dvh; }
  .advisor-panel:not([hidden]) + .advisor-launcher { display: none; }
  .advisor-disclosure { padding-bottom: 8px !important; }
  .advisor-header { padding-top: 4px; padding-bottom: 0; }
  .advisor-prompts { padding-top: 0; padding-bottom: 4px; }
  .advisor-privacy { display: none; }
}

/* Help stays available without covering controls in the interactive applications. */
.advisor-widget.advisor-inline{position:relative;right:auto;bottom:auto;width:100%;margin:28px 0 0;z-index:35}
.advisor-inline .advisor-launcher{margin-left:0;box-shadow:none;background:transparent;color:#20251f;border-color:#89947d}
.advisor-inline .advisor-launcher:hover{background:#e6ebdf}.advisor-inline .advisor-launcher-note{color:#49543f}
.advisor-inline .advisor-panel{position:fixed;z-index:40;right:24px;bottom:20px;width:min(410px,calc(100vw - 32px));max-height:calc(100dvh - 40px);margin:0}
@media(max-width:480px){.advisor-inline .advisor-panel{right:12px;bottom:12px;width:calc(100vw - 24px);height:calc(100dvh - 24px)}}
