.ta-launch, .ta-panel { font-family: inherit; }
.ta-launch {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 64px; height: 64px; margin: 0; padding: 0; box-sizing: border-box;
  border: 1px solid #1c54ba; border-radius: 50%; background: #2157bf; color: white;
  font-size: 12px; font-weight: 700; line-height: 1; box-shadow: 0 5px 18px #17438b30; cursor: pointer;
}
.ta-launch svg { width: 21px; height: 21px; }
.ta-panel {
  width: min(400px, calc(100vw - 32px)); height: min(560px, calc(100dvh - 96px));
  margin: auto max(16px, env(safe-area-inset-right)) calc(76px + env(safe-area-inset-bottom)) auto;
  padding: 0; border: 1px solid #e1e7ef; border-radius: 20px; background: #f6f8fb; color: #182333;
  box-shadow: 0 18px 58px #18233329; box-sizing: border-box; overflow: hidden;
}
.ta-panel::backdrop { background: #15233830; }
.ta-panel[open] { display: flex; flex-direction: column; }
.ta-panel * { box-sizing: border-box; }
.ta-head, .ta-identity, .ta-controls, .ta-form { display: flex; align-items: center; }
.ta-head {
  position: relative; z-index: 1; flex: none; justify-content: space-between; gap: 8px;
  padding: 10px 12px 10px 15px; border-bottom: 1px solid #e7ebf1; background: white;
}
.ta-identity { gap: 9px; min-width: 0; }
.ta-avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 11px;
  background: #e9f1ff; color: #2157bf; font-size: 15px; font-weight: 700; }
.ta-head h2 { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.35; }
.ta-head .ta-mode { display: block; margin-top: 2px; color: #5b677a; font-size: 11px; line-height: 1.4; }
.ta-controls { gap: 2px; flex: none; }
.ta-panel button, .ta-panel .ta-icon { width: auto; height: auto; margin: 0; border: 0; border-radius: 9px;
  padding: 7px 9px; background: transparent; color: #475569; font: inherit; font-size: 13px; cursor: pointer; }
.ta-panel .ta-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; }
.ta-panel .ta-icon:hover { background: #f0f3f8; color: #19283f; }
.ta-icon svg { width: 20px; height: 20px; }
.ta-panel .ta-close { font-size: 24px; line-height: 1; }
.ta-panel .ta-menu > summary { list-style: none; font-size: 23px; font-weight: 700; line-height: 1; }
.ta-menu > summary::-webkit-details-marker { display: none; }
.ta-menu[open] > summary { background: #f0f3f8; }
.ta-menu-panel {
  position: absolute; top: calc(100% - 1px); right: 12px; width: min(246px, calc(100% - 24px));
  max-height: min(56dvh, 260px); overflow: auto; padding: 6px; border: 1px solid #e1e7ef;
  border-radius: 12px; background: white; box-shadow: 0 8px 24px #18233320;
}
.ta-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.ta-menu-panel button { min-height: 36px; text-align: left; color: #334155; }
.ta-menu-panel button:hover { background: #f0f3f8; }
.ta-menu-panel .ta-human { display: block; width: 100%; border-top: 1px solid #e7ebf1; border-radius: 0 0 8px 8px; color: #2157bf; }
.ta-panel :focus-visible, .ta-launch:focus-visible, .ta-receipt:focus-visible { outline: 2px solid #2157bf; outline-offset: 2px; }
.ta-panel button:disabled { opacity: .6; cursor: wait; }
.ta-panel .ta-primary { background: #2157bf; color: white; }
.ta-panel .ta-primary:hover { background: #19489f; color: white; }
.ta-output { flex: 1; overflow: auto; overscroll-behavior: contain; min-height: 0; padding: 16px 14px; }
.ta-history, .ta-quick, .ta-draft { display: flex; flex-direction: column; align-items: flex-start; }
.ta-output .ta-msg {
  width: fit-content; max-width: 88%; margin: 0 0 9px; padding: 8px 11px;
  border: 1px solid #e6eaf1; border-radius: 4px 14px 14px; background: white;
}
.ta-output .ta-msg-user { align-self: flex-end; border-color: transparent; border-radius: 14px 4px 14px 14px;
  background: #e2edff; color: #142d58; }
.ta-output .ta-msg-staff small { display: block; margin-bottom: 3px; color: #166656; font-size: 11px; font-weight: 700; }
.ta-output p { margin: 0; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.ta-output a { color: #194da8; text-underline-offset: 2px; }
.ta-output .ta-action { display: inline-block; margin-top: 6px; font-size: 13px; }
.ta-result { margin-top: 7px; padding-top: 6px; border-top: 1px solid #e7ebf1; }
.ta-result p, .ta-output .ta-typing { color: #5b677a; font-size: 12px; }
.ta-footer { flex: none; padding: 8px 12px 7px; border-top: 1px solid #e7ebf1; background: white; }
.ta-form { gap: 7px; margin: 0; }
.ta-form input {
  flex: 1; min-width: 0; width: auto; height: 40px; margin: 0; border: 1px solid #e2e8f0;
  border-radius: 12px; padding: 0 10px; background: #f6f8fb; color: #182333; font-size: 16px;
}
.ta-delivery { display: flex; align-items: center; gap: 7px; color: #5b677a; font-size: 11px; }
.ta-delivery .ta-retry { color: #2157bf; text-decoration: underline; }
.ta-notice:empty { display: none; }
.ta-notice:not(:empty) { margin: 0 0 5px; }
.ta-panel .ta-privacy { margin: 5px 2px 0; color: #5b677a; font-size: 10px; line-height: 1.45; }
.ta-receipt {
  display: block; width: 100%; margin-top: 8px; border: 1px solid #c6d8f0; border-radius: 9px;
  padding: 7px 10px; background: white; color: #194da8; font: inherit; font-size: 13px; cursor: pointer;
}
.ta-launch[hidden], .ta-panel [hidden] { display: none !important; }
@media (max-width: 540px) {
  .ta-panel { width: 100%; max-width: none; height: min(560px, 76dvh, calc(var(--ta-visible-height, 100dvh) - 8px));
    margin: auto 0 var(--ta-keyboard-inset, 0px); border-radius: 20px 20px 0 0; }
  .ta-footer { padding-bottom: calc(7px + env(safe-area-inset-bottom)); }
}
