.chat-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 8px; }
.chat-engine-row { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; flex-shrink: 0; font-size: 11px; }
.chat-engine-row select { min-width: 0; flex: 1; min-height: 36px; border: 1px solid #85b3dc; border-radius: 8px; background: #fff; color: #315d89; padding: 5px 8px; font-size: 11px; }
.chat-engine-row label { color: #536d89; white-space: nowrap; }
#chat-connection { color: #597866; font-size: 11px; }
.chat-toolbar .text-button { font-size: 11px; min-height: 36px; }
.chat-history { display: flex; flex-direction: column; gap: 20px; max-height: 420px; overflow: auto; scrollbar-width: thin; padding: 4px 4px 8px; overscroll-behavior: contain; }
.chat-history:empty { display: none; }
.chat-turn { display: flex; flex-direction: column; gap: 10px; }
.chat-message { max-width: 94%; padding: 13px 15px; border-radius: 14px; overflow-wrap: anywhere; }
.from-user { align-self: flex-end; background: #e1eadb; color: #375944; border-bottom-right-radius: 4px; }
.from-nol { align-self: flex-start; background: #f7f8f1; border: 1px solid #dce5d5; border-bottom-left-radius: 4px; }
.message-author { display: block; color: #78917b; font-size: 10px; margin-bottom: 5px; }
.message-text { white-space: pre-wrap; margin: 0; line-height: 1.85; font-size: 14px; }
.message-state { margin-top: 8px; color: #7e8979; font-size: 10px; line-height: 1.7; }
.retry-chat { margin-top: 9px; }
.chat-status { font-size: 11px; color: #716d56; margin: 6px 0; line-height: 1.7; }
.chat-status:empty { display: none; }
.chat-send-actions { display: flex; gap: 6px; }
.chat-data-note { color: #819078; font-size: 10px; line-height: 1.7; margin: 8px 0 0; }
.chat-extra { margin: 10px 0 0; }
.chat-extra .text-button { font-size: 11px; }
button:disabled { cursor: default; opacity: .55; }
.has-chat>.page-lead, .has-chat>.starter-row { display: none; }
.floating-mode #page-talk { display: flex; flex-direction: column; gap: 0; overflow: hidden; padding-top: 14px; }
.floating-mode #page-talk[hidden] { display: none; }
.floating-mode #page-talk>.eyebrow, .floating-mode #page-talk>.talk-bottom { display: none; }
.floating-mode #page-talk>h1 { font-size: 22px; margin: 0 0 6px; line-height: 1.35; flex-shrink: 0; }
.floating-mode #page-talk>h1 br { display: none; }
.floating-mode #page-talk>.page-lead { font-size: 12px; margin: 2px 0 12px; }
.floating-mode #page-talk.has-chat>h1 { display: none; }
.floating-mode #page-talk>.mode-bar { margin: 0; flex-shrink: 0; }
.floating-mode .chat-toolbar { margin: 5px 0; flex-shrink: 0; }
.floating-mode .chat-history { flex: 1; min-height: 0; max-height: none; padding-right: 3px; }
.floating-mode .chat-history:empty { display: block; min-height: 10px; }
.floating-mode .chat-message { padding: 10px 12px; }
.floating-mode .message-text { font-size: 13px; }
.floating-mode .composer { margin: 7px 0 0; padding: 12px; flex-shrink: 0; }
.floating-mode .composer textarea { min-height: 66px; max-height: 100px; font-size: 15px; }
.floating-mode .composer textarea::placeholder { font-size: 13px; }
.floating-mode .composer-bottom { margin-top: 4px; }
.floating-mode .chat-status { flex-shrink: 0; max-height: 50px; overflow: auto; }
.floating-mode .chat-data-note { flex-shrink: 0; margin: 6px 0; font-size: 9px; }
.floating-mode .chat-extra { flex-shrink: 0; margin: 0 0 8px; }
.floating-mode .chat-extra .text-button { min-height: 24px; font-size: 10px; }
.floating-mode #page-talk>.starter-row { flex-shrink: 0; margin: 6px 0; }
.floating-mode #page-talk.dot-preparing { overflow-y: auto; display: block; }
.floating-mode #page-talk.dot-preparing .chat-history { max-height: 160px; }
.floating-mode .retry-chat { min-height: 40px; font-size: 11px; }
.floating-mode.keyboard-open #page-talk>h1,
.floating-mode.keyboard-open #page-talk>.page-lead,
.floating-mode.keyboard-open #page-talk>.mode-bar,
.floating-mode.keyboard-open .chat-engine-row,
.floating-mode.keyboard-open .chat-extra,
.floating-mode.keyboard-open .chat-data-note { display: none; }
.floating-mode.keyboard-open .composer { padding: 8px; }
.floating-mode.keyboard-open .composer textarea { min-height: 38px; height: 38px; }
.floating-mode.keyboard-open .chat-toolbar { margin: 0; }
.floating-mode.keyboard-open .chat-toolbar .text-button { min-height: 26px; }
.floating-mode.keyboard-open .popup-chrome { padding: 6px 0; }
.floating-mode.keyboard-open .topbar { height: 38px; }
.floating-mode.keyboard-open .nav-button { min-height: 38px; padding: 6px 0; }
.floating-mode.keyboard-open .chat-history { min-height: 30px; }
@media(max-width:600px) {
  .floating-mode:not(.native-desktop):has(#page-talk.has-chat:not([hidden])) .app-shell { height: min(740px, calc(var(--visible-height, 100dvh) - 24px)); max-height: min(740px, calc(var(--visible-height, 100dvh) - 24px)); }
  .floating-mode .composer textarea { font-size: 16px; min-height: 60px; }
  .floating-mode .message-text { font-size: 14px; }
  .floating-mode .chat-toolbar .text-button, .floating-mode .retry-chat { min-height: 44px; }
  .floating-mode .chat-extra .text-button { min-height: 32px; }
  .floating-mode #page-talk>.starter-row { display: none; }
}
@media(max-width:600px) and (min-height:461px) {
  .floating-mode:not(.keyboard-open) #page-talk.has-chat .composer textarea { height: 60px; min-height: 60px; }
}
@media(max-height:460px) {
  .floating-mode .chat-toolbar .text-button { min-height: 26px; }
  .floating-mode .popup-chrome { padding: 6px 0; }
  .floating-mode .topbar { height: 38px; }
  .floating-mode .nav-button { min-height: 38px; padding: 6px 0; }
  .chat-engine-row { margin-top: 2px; }
  .chat-engine-row select { min-height: 30px; }
  .floating-mode #page-talk>h1, .floating-mode #page-talk>.page-lead, .floating-mode #page-talk>.mode-bar, .floating-mode .chat-extra, .floating-mode .chat-data-note { display: none; }
  .floating-mode .composer { padding: 8px; }
  .floating-mode .composer textarea { min-height: 38px; height: 38px; }
  .floating-mode .chat-toolbar { margin: 0; }
}
.chat-engine-row select { min-width: 0; flex: 1; }
#setup-mobile-ai { flex-shrink: 0; border: 1px solid #3985cd; border-radius: 9px; background: #fff; color: #175690; padding: 5px 8px; font: inherit; font-size: 11px; cursor: pointer; }
#mobile-ai-dialog { width: min(500px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
#mobile-ai-dialog p, .mobile-ai-steps { font-size: 13px; line-height: 1.65; }
.mobile-ai-steps { padding-left: 22px; }
.mobile-ai-steps li { margin-bottom: 8px; }
.mobile-ai-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 12px 0; }
#mobile-ai-progress { width: 100%; accent-color: #167ccb; }
