.polyglot-chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1500;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg,#3158bd,#5578ee 55%,#52c7b8);
  box-shadow: 0 16px 42px rgba(32,58,126,.28),inset 0 1px rgba(255,255,255,.34);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .2s ease,box-shadow .2s ease;
}
.polyglot-chat-launcher:hover { transform: translateY(-2px); box-shadow: 0 24px 58px rgba(32,58,126,.38),inset 0 1px rgba(255,255,255,.3); }
.polyglot-chat-launcher:focus-visible,.polyglot-chat-close:focus-visible,.polyglot-chat-suggestions button:focus-visible,.polyglot-chat-form input:focus-visible,.polyglot-chat-send:focus-visible,.polyglot-chat-voice:focus-visible,.polyglot-chat-read:focus-visible { outline: 3px solid rgba(82,199,184,.45); outline-offset: 3px; }
.polyglot-chat-launcher-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #3158bd;
  background: #fff;
  font-size: 15px;
  font-weight: 950;
  box-shadow: 0 8px 20px rgba(18,34,76,.18);
}
.polyglot-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 80px;
  z-index: 1501;
  width: min(288px,calc(100vw - 32px));
  max-height: min(590px,calc(100vh - 100px));
  display: grid;
  grid-template-rows: auto minmax(165px,1fr) auto auto auto;
  overflow: hidden;
  box-sizing: border-box;
  border: 2px solid #dce6fb;
  border-radius: 22px;
  color: #0a1020;
  background: rgba(250,252,255,.98);
  box-shadow: 0 24px 70px rgba(16,30,67,.24),0 0 0 1px rgba(255,255,255,.9),inset 0 1px rgba(255,255,255,.8);
  backdrop-filter: blur(22px);
  animation: polyglotChatIn .2s ease-out both;
}
.polyglot-chat-panel * { box-sizing: border-box; }
.polyglot-chat-panel > * { width: 100%; min-width: 0; }
.polyglot-chat-panel button,.polyglot-chat-panel input { max-width: 100%; }
.polyglot-chat-panel[hidden] { display: none; }
.polyglot-chat-header {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0,1fr);
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 10px 70px 10px 10px;
  color: #fff;
  background: radial-gradient(circle at 86% 10%,rgba(82,199,184,.36),transparent 34%),linear-gradient(145deg,#0a1022,#183574 72%,#1b6673);
}
.polyglot-chat-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 9px;
  background: rgba(255,255,255,.95);
}
.polyglot-chat-mark img { width: 24px; height: 24px; object-fit: contain; }
.polyglot-chat-title { min-width: 0; }
.polyglot-chat-title strong,.polyglot-chat-title small { display: block; }
.polyglot-chat-title strong { overflow: hidden; font-size: 12px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.polyglot-chat-title small { display: block; overflow: hidden; margin-top: 2px; color: #cbd8ee; font-size: 7px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.polyglot-chat-locale { position: absolute; top: 17px; right: 42px; min-width: 25px; display: grid; place-items: center; padding: 4px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: #d9fff9; background: rgba(255,255,255,.1); text-align: center; font-size: 7px; font-weight: 900; }
.polyglot-chat-close { position: absolute; top: 13px; right: 8px; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; color: #fff; background: rgba(255,255,255,.12); font: inherit; font-size: 17px; line-height: 1; cursor: pointer; transition: background .16s ease,transform .16s ease; }
.polyglot-chat-close:hover { background: rgba(255,255,255,.22); transform: rotate(4deg); }
.polyglot-chat-messages { min-height: 180px; padding: 13px 11px 7px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: radial-gradient(circle at 0 0,rgba(82,199,184,.12),transparent 34%),#f7f9fe; }
.polyglot-chat-message { width: 100%; min-width: 0; display: grid; grid-template-columns: 24px minmax(0,1fr); align-items: end; gap: 7px; margin: 0 0 10px; overflow: hidden; }
.polyglot-chat-message.user { grid-template-columns: minmax(0,1fr); justify-items: end; padding-left: 28px; }
.polyglot-chat-message-body { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; }
.polyglot-chat-message p { width: 100%; max-width: 100%; margin: 0; padding: 8px 9px; overflow: hidden; overflow-wrap: anywhere; white-space: normal; word-break: break-word; border: 1px solid rgba(65,86,132,.1); border-radius: 14px 14px 14px 4px; color: #34425a; background: #fff; box-shadow: 0 6px 18px rgba(25,40,80,.06); font-size: 11px; line-height: 1.42; }
.polyglot-chat-message.user p { border-color: transparent; border-radius: 18px 18px 5px 18px; color: #fff; background: linear-gradient(135deg,#3158bd,#5578ee); }
.polyglot-chat-avatar { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: linear-gradient(135deg,#3158bd,#52c7b8); font-size: 8px; font-weight: 950; }
.polyglot-chat-message.user .polyglot-chat-avatar { display: none; }
.polyglot-chat-read { width: 24px; height: 24px; display: grid; place-items: center; margin: 5px auto 0 2px; padding: 0; border: 1px solid rgba(49,88,189,.14); border-radius: 50%; color: #3158bd; background: #eef3ff; cursor: pointer; transition: transform .16s ease,background .16s ease; }
.polyglot-chat-read:hover { transform: translateY(-1px); background: #e5edff; }
.polyglot-chat-read svg { width: 12px; height: 12px; fill: currentColor; }
.polyglot-chat-read[aria-pressed="true"] { color: #fff; background: linear-gradient(135deg,#3158bd,#52c7b8); }
.polyglot-chat-suggestion-wrap { min-width: 0; padding: 9px 10px 10px; overflow: hidden; border-top: 1px solid rgba(65,86,132,.1); background: #fff; }
.polyglot-chat-suggestion-label { display: block; margin-bottom: 7px; color: #65738c; font-size: 7px; font-weight: 900; letter-spacing: .11em; text-align: center; text-transform: uppercase; }
.polyglot-chat-suggestions { min-width: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; overflow: hidden; }
.polyglot-chat-suggestions::-webkit-scrollbar { display: none; }
.polyglot-chat-suggestions button { width: 100%; min-width: 0; min-height: 34px; display: grid; place-items: center; padding: 5px 7px; overflow: hidden; border: 1px solid rgba(49,88,189,.13); border-radius: 12px; color: #274b9d; background: linear-gradient(145deg,#f5f8ff,#eaf0ff); box-shadow: 0 4px 12px rgba(33,62,132,.05); font: inherit; font-size: 7.5px; font-weight: 850; line-height: 1.25; text-align: center; text-overflow: ellipsis; cursor: pointer; transition: color .16s ease,background .16s ease,transform .16s ease; }
.polyglot-chat-suggestions button:hover { color: #fff; background: linear-gradient(135deg,#3158bd,#5578ee); transform: translateY(-1px); }
.polyglot-chat-form { width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 34px 62px; align-items: center; gap: 6px; padding: 9px 10px; overflow: hidden; border-top: 1px solid rgba(65,86,132,.1); background: #f9fbff; }
.polyglot-chat-form input { grid-column: auto; }
.polyglot-chat-form input { min-width: 0; height: 36px; padding: 0 10px; border: 1px solid rgba(65,86,132,.17); border-radius: 12px; color: #0a1020; background: #fff; box-shadow: inset 0 1px 2px rgba(25,40,80,.03); font: inherit; font-size: 10px; }
.polyglot-chat-voice { position: relative; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(49,88,189,.15); border-radius: 50%; color: #3158bd; background: #eef3ff; cursor: pointer; transition: color .16s ease,background .16s ease,transform .16s ease; }
.polyglot-chat-voice svg { width: 15px; height: 15px; fill: currentColor; }
.polyglot-chat-voice:hover { transform: translateY(-1px); }
.polyglot-chat-voice[aria-pressed="true"] { color: #fff; background: #e04b61; }
.polyglot-chat-voice[aria-pressed="true"]::after { content: ""; position: absolute; inset: -5px; border: 2px solid rgba(224,75,97,.32); border-radius: 19px; animation: polyglotVoicePulse 1.2s ease-out infinite; }
.polyglot-chat-voice:disabled { color: #8793a7; background: #f0f2f6; cursor: not-allowed; transform: none; }
.polyglot-chat-send { width: 100%; min-width: 0; height: 34px; display: grid; place-items: center; padding: 0 9px; border: 0; border-radius: 999px; color: #fff; background: linear-gradient(135deg,#3158bd,#5578ee 55%,#52c7b8); box-shadow: 0 7px 16px rgba(49,88,189,.2); font: inherit; font-size: 8.5px; font-weight: 900; text-align: center; cursor: pointer; transition: transform .16s ease,box-shadow .16s ease; }
.polyglot-chat-send:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(49,88,189,.25); }
.polyglot-chat-send:disabled { opacity: .6; cursor: wait; }
.polyglot-chat-privacy { width: 100%; margin: 0; padding: 0 12px 10px; overflow-wrap: anywhere; color: #738098; background: #fff; font-size: 7px; line-height: 1.35; text-align: center; }
.polyglot-chat-panel[dir="rtl"] .polyglot-chat-message.user { padding-left: 0; padding-right: 28px; }
.polyglot-chat-panel[dir="rtl"] .polyglot-chat-message p { border-radius: 18px 18px 5px 18px; }
.polyglot-chat-panel[dir="rtl"] .polyglot-chat-message.user p { border-radius: 18px 18px 18px 5px; }
@keyframes polyglotChatIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes polyglotVoicePulse { from { opacity: .75; transform: scale(.88); } to { opacity: 0; transform: scale(1.2); } }
@media (max-width:580px) {
  .polyglot-chat-launcher { right: 10px; bottom: 10px; min-height: 44px; }
  .polyglot-chat-launcher-icon { width: 32px; height: 32px; }
  .polyglot-chat-panel { right: 10px; bottom: 66px; width: min(288px,calc(100vw - 20px)); max-height: calc(100dvh - 78px); border-radius: 22px; }
  .polyglot-chat-messages { min-height: 170px; }
}
@media (max-width:290px) {
  .polyglot-chat-panel { right: 8px; width: calc(100vw - 16px); }
  .polyglot-chat-suggestions { grid-template-columns: 1fr; }
  .polyglot-chat-form { grid-template-columns: minmax(0,1fr) 32px; }
  .polyglot-chat-send { grid-column: 1/-1; }
}
@media (prefers-reduced-motion:reduce) {
  .polyglot-chat-panel { animation: none; }
  .polyglot-chat-launcher { transition: none; }
  .polyglot-chat-voice[aria-pressed="true"]::after { animation: none; }
}
