.tetamet-ai-widget {
  --tetamet-primary: #004494;
  --tetamet-border: #dfe6ef;
  --tetamet-surface: #ffffff;
  --tetamet-muted: #68768a;
  position: relative;
  z-index: 999999;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: #172033;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
  isolation: isolate;
  box-sizing: border-box;
}

.tetamet-ai-widget *,
.tetamet-ai-widget *::before,
.tetamet-ai-widget *::after {
  box-sizing: border-box;
}

.tetamet-ai-widget button,
.tetamet-ai-widget input,
.tetamet-ai-widget textarea,
.tetamet-ai-widget select {
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.tetamet-ai-floating {
  position: fixed !important;
  inset: auto auto 22px auto !important;
  z-index: 2147483000 !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  overflow: visible !important;
}

.tetamet-ai-floating.tetamet-ai-right { right: 22px !important; left: auto !important; }
.tetamet-ai-floating.tetamet-ai-left { left: 22px !important; right: auto !important; }

.tetamet-ai-launcher {
  appearance: none;
  min-width: 0 !important;
  min-height: 54px !important;
  height: 54px !important;
  margin: 0 !important;
  padding: 0 18px 0 15px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--tetamet-primary) !important;
  color: #fff !important;
  box-shadow: 0 12px 32px rgba(4, 27, 62, .24) !important;
  cursor: pointer;
  font-weight: 700;
  line-height: 1 !important;
}

.tetamet-ai-launcher:hover,
.tetamet-ai-launcher:focus-visible {
  filter: brightness(.94);
  transform: translateY(-1px);
}

.tetamet-ai-launcher:focus-visible,
.tetamet-ai-close:focus-visible,
.tetamet-ai-action:focus-visible,
.tetamet-ai-input-form button:focus-visible,
.tetamet-ai-submit-lead:focus-visible,
.tetamet-ai-lead-close:focus-visible {
  outline: 3px solid rgba(40, 223, 255, .55) !important;
  outline-offset: 2px;
}

.tetamet-ai-launcher > svg,
.tetamet-ai-launcher-default-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: currentColor;
}

.tetamet-ai-logo-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}

.tetamet-ai-launcher-mark {
  width: 36px !important;
  height: 36px !important;
  margin-left: -7px;
  border-radius: 50% !important;
  background: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(0, 35, 80, .08);
}

.tetamet-ai-launcher-mark .tetamet-ai-logo-image {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 3px !important;
  display: block;
  border: 0 !important;
  border-radius: 50% !important;
  object-fit: contain;
  background: #fff !important;
}

.tetamet-ai-launcher-mark .tetamet-ai-logo-fallback {
  width: 22px;
  height: 22px;
  fill: var(--tetamet-primary);
}

.tetamet-ai-logo-mark.has-logo .tetamet-ai-logo-fallback { display: none !important; }
.tetamet-ai-logo-mark.is-logo-error .tetamet-ai-logo-image { display: none !important; }
.tetamet-ai-logo-mark.is-logo-error .tetamet-ai-logo-fallback { display: grid !important; }

.tetamet-ai-panel {
  position: fixed !important;
  bottom: 20px !important;
  top: auto !important;
  width: min(390px, calc(100vw - 28px)) !important;
  height: min(600px, calc(100dvh - 40px)) !important;
  min-width: 0 !important;
  min-height: 420px !important;
  max-width: 390px !important;
  max-height: 600px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column;
  overflow: hidden !important;
  overscroll-behavior: contain;
  border: 1px solid rgba(10, 38, 74, .10) !important;
  border-radius: 18px !important;
  background: var(--tetamet-surface) !important;
  box-shadow: 0 22px 70px rgba(7, 30, 67, .28) !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.985);
  transform-origin: bottom center;
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}

.tetamet-ai-right .tetamet-ai-panel { right: 20px !important; left: auto !important; }
.tetamet-ai-left .tetamet-ai-panel { left: 20px !important; right: auto !important; }

.tetamet-ai-widget.is-open .tetamet-ai-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.tetamet-ai-widget.is-open .tetamet-ai-launcher { display: none !important; }

.tetamet-ai-inline {
  position: relative !important;
  z-index: 1;
  width: 100% !important;
  max-width: 780px !important;
  margin: 20px auto !important;
}

.tetamet-ai-inline .tetamet-ai-panel {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  max-width: none !important;
  height: min(680px, 78vh) !important;
  max-height: none !important;
  opacity: 1;
  visibility: visible;
  transform: none;
  border-radius: 14px !important;
}

.tetamet-ai-header {
  flex: 0 0 64px;
  min-width: 0;
  min-height: 64px !important;
  height: 64px;
  margin: 0 !important;
  padding: 10px 12px 10px 14px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  overflow: hidden;
  border: 0 !important;
  background: var(--tetamet-primary) !important;
  color: #fff !important;
}

.tetamet-ai-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.tetamet-ai-brand-mark {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: #fff !important;
}

.tetamet-ai-brand-mark .tetamet-ai-logo-image,
.tetamet-ai-avatar {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  margin: 0 !important;
  padding: 4px !important;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0 !important;
  border-radius: 50% !important;
  background: #fff !important;
  color: var(--tetamet-primary) !important;
  object-fit: contain;
  font-size: 20px;
  font-weight: 800;
}

.tetamet-ai-brand > div { min-width: 0; overflow: hidden; }
.tetamet-ai-brand strong,
.tetamet-ai-brand small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: inherit !important;
}
.tetamet-ai-brand strong { font-size: 14px; line-height: 1.25; }
.tetamet-ai-brand small { margin-top: 2px; font-size: 11px; line-height: 1.2; opacity: .86; }

.tetamet-ai-close,
.tetamet-ai-lead-close {
  appearance: none;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
  border: 0 !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,.12) !important;
  color: inherit !important;
  cursor: pointer;
  font-size: 22px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
}
.tetamet-ai-close:hover { background: rgba(255,255,255,.22) !important; }

.tetamet-ai-messages {
  flex: 1 1 auto;
  min-width: 0 !important;
  min-height: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 13px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: #f5f8fc !important;
  scroll-behavior: smooth;
}

.tetamet-ai-messages::-webkit-scrollbar { width: 8px; }
.tetamet-ai-messages::-webkit-scrollbar-track { background: transparent; }
.tetamet-ai-messages::-webkit-scrollbar-thumb { background: #bdc8d6; border-radius: 999px; border: 2px solid #f5f8fc; }

.tetamet-ai-message {
  width: auto !important;
  max-width: 88% !important;
  min-width: 0 !important;
  margin: 0 0 11px !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: visible !important;
}
.tetamet-ai-message-user { margin-left: auto !important; align-items: flex-end; }
.tetamet-ai-message-assistant { margin-right: auto !important; align-items: flex-start; }

.tetamet-ai-bubble {
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  overflow: visible !important;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
  border: 1px solid #e1e7ef !important;
  border-radius: 14px !important;
  background: #fff !important;
  color: #172033 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.03) !important;
  font-size: 13px;
  line-height: 1.48;
}
.tetamet-ai-message-user .tetamet-ai-bubble {
  border-color: var(--tetamet-primary) !important;
  border-bottom-right-radius: 4px !important;
  background: var(--tetamet-primary) !important;
  color: #fff !important;
}
.tetamet-ai-message-assistant .tetamet-ai-bubble { border-bottom-left-radius: 4px !important; }

.tetamet-ai-response-title {
  margin: 11px 0 5px !important;
  padding: 0 0 4px !important;
  border-bottom: 1px solid #dce6f1 !important;
  color: var(--tetamet-primary) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
}
.tetamet-ai-response-title:first-child { margin-top: 0 !important; }
.tetamet-ai-response-paragraph {
  margin: 0 0 8px !important;
  padding: 0 !important;
  color: inherit !important;
  font: inherit !important;
  line-height: 1.5 !important;
}
.tetamet-ai-response-paragraph:last-child { margin-bottom: 0 !important; }
.tetamet-ai-response-list {
  margin: 2px 0 9px 19px !important;
  padding: 0 !important;
  color: inherit !important;
  list-style-position: outside !important;
}
.tetamet-ai-response-list li {
  margin: 0 0 4px !important;
  padding: 0 0 0 2px !important;
  color: inherit !important;
  font: inherit !important;
  line-height: 1.45 !important;
}
.tetamet-ai-response-list li:last-child { margin-bottom: 0 !important; }
.tetamet-ai-bubble code {
  padding: 1px 4px !important;
  border-radius: 4px !important;
  background: #edf2f7 !important;
  color: #172033 !important;
  font-size: .92em !important;
}
.tetamet-ai-message-user .tetamet-ai-response-title { border-bottom-color: rgba(255,255,255,.3) !important; color: #fff !important; }
.tetamet-ai-message-user .tetamet-ai-bubble code { background: rgba(255,255,255,.18) !important; color: #fff !important; }

.tetamet-ai-bullet { display: block; padding-left: 2px; }

.tetamet-ai-sources {
  width: 100% !important;
  min-width: 0 !important;
  margin: 6px 0 0 !important;
  padding: 8px 10px !important;
  overflow: hidden !important;
  border-radius: 9px !important;
  background: #eaf2fb !important;
  font-size: 11px;
}
.tetamet-ai-sources strong { display: block; margin-bottom: 3px; }
.tetamet-ai-sources a {
  display: block;
  max-width: 100%;
  margin-top: 3px;
  overflow: hidden;
  color: var(--tetamet-primary) !important;
  text-decoration: none !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tetamet-ai-sources a:hover { text-decoration: underline !important; }

.tetamet-ai-typing .tetamet-ai-bubble { display: flex; align-items: center; gap: 4px; }
.tetamet-ai-typing span { width: 6px; height: 6px; border-radius: 50%; background: #8b98aa; animation: tetametBounce 1s infinite alternate; }
.tetamet-ai-typing span:nth-child(2) { animation-delay: .15s; }
.tetamet-ai-typing span:nth-child(3) { animation-delay: .3s; }
.tetamet-ai-typing em { margin-left: 5px; color: #69778a; font-size: 11px; font-style: normal; }
@keyframes tetametBounce { to { transform: translateY(-4px); opacity: .45; } }

.tetamet-ai-quick-actions {
  flex: 0 0 auto;
  min-width: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 8px 10px !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  overflow: hidden !important;
  border-top: 1px solid var(--tetamet-border) !important;
  background: #fff !important;
}

.tetamet-ai-action {
  appearance: none;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 34px !important;
  height: 34px !important;
  margin: 0 !important;
  padding: 0 8px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #aac5e1 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: var(--tetamet-primary) !important;
  cursor: pointer;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-align: center;
  text-decoration: none !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tetamet-ai-action:hover { border-color: var(--tetamet-primary) !important; background: var(--tetamet-primary) !important; color: #fff !important; }

.tetamet-ai-turnstile-wrap {
  flex: 0 0 auto;
  width: 100%;
  max-height: 86px;
  margin: 0 !important;
  padding: 7px 10px 5px !important;
  overflow: hidden !important;
  border-top: 1px solid var(--tetamet-border);
  background: #fff !important;
  text-align: center;
  opacity: 1;
  transition: max-height .2s ease, padding .2s ease, opacity .16s ease, border-color .2s ease;
}
.tetamet-ai-turnstile-wrap.is-verified {
  max-height: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-top-color: transparent;
  opacity: 0;
  pointer-events: none;
}
.tetamet-ai-turnstile-wrap small { display: block; margin: 2px 0 0; color: #6b7280; font-size: 9px; line-height: 1.1; }
.tetamet-ai-turnstile { width: 100%; max-width: 100%; min-height: 0; display: flex; justify-content: center; overflow: hidden; }
.tetamet-ai-turnstile iframe { max-width: 100% !important; }

.tetamet-ai-input-form {
  flex: 0 0 auto;
  min-width: 0 !important;
  width: 100% !important;
  min-height: 62px !important;
  margin: 0 !important;
  padding: 9px 10px !important;
  display: flex !important;
  align-items: flex-end;
  gap: 8px;
  overflow: hidden !important;
  border-top: 1px solid var(--tetamet-border) !important;
  background: #fff !important;
}

.tetamet-ai-input-form textarea {
  appearance: none;
  flex: 1 1 auto;
  min-width: 0 !important;
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 88px !important;
  margin: 0 !important;
  padding: 11px 12px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  resize: none !important;
  border: 1px solid #c8d3df !important;
  border-radius: 11px !important;
  background: #fff !important;
  color: #172033 !important;
  box-shadow: none !important;
  outline: none !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}
.tetamet-ai-input-form textarea:focus { border-color: var(--tetamet-primary) !important; box-shadow: 0 0 0 2px rgba(0, 68, 148, .14) !important; }
.tetamet-ai-input-form textarea::placeholder { color: #77859a; opacity: 1; }

.tetamet-ai-input-form button,
.tetamet-ai-submit-lead {
  appearance: none;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 11px !important;
  background: var(--tetamet-primary) !important;
  color: #fff !important;
  cursor: pointer;
  font-weight: 700 !important;
  box-shadow: none !important;
}
.tetamet-ai-input-form button {
  flex: 0 0 44px;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
}
.tetamet-ai-input-form button svg { width: 20px; height: 20px; fill: currentColor; }
.tetamet-ai-input-form button:disabled,
.tetamet-ai-submit-lead:disabled { opacity: .55; cursor: not-allowed; }

.tetamet-ai-footer {
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
  margin: 0 !important;
  padding: 0 12px 8px !important;
  overflow: hidden;
  background: #fff !important;
  color: #778397 !important;
  font-size: 9px !important;
  line-height: 1.35 !important;
  text-align: center;
}
.tetamet-ai-footer a { color: var(--tetamet-primary) !important; text-decoration: underline !important; }

.tetamet-ai-lead-form {
  position: absolute !important;
  inset: 64px 0 0 !important;
  z-index: 5;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 14px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: #fff !important;
}
.tetamet-ai-lead-form[hidden] { display: none !important; }
.tetamet-ai-form-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--tetamet-border); color: var(--tetamet-primary); font-size: 16px; }
.tetamet-ai-lead-close { background: #eef3f8 !important; color: var(--tetamet-primary) !important; }
.tetamet-ai-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 9px; }
.tetamet-ai-lead-form label { display: block; margin: 9px 0; font-size: 12px; font-weight: 600; }
.tetamet-ai-lead-form input[type="text"],
.tetamet-ai-lead-form input[type="tel"],
.tetamet-ai-lead-form input[type="email"],
.tetamet-ai-lead-form textarea {
  appearance: none;
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 38px !important;
  max-height: none !important;
  margin: 4px 0 0 !important;
  padding: 8px !important;
  border: 1px solid #c8d3df !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #172033 !important;
  box-shadow: none !important;
  font: inherit !important;
}
.tetamet-ai-lead-form textarea { min-height: 72px !important; resize: vertical !important; }
.tetamet-ai-consent { font-weight: 400 !important; line-height: 1.35; }
.tetamet-ai-consent input { vertical-align: top; margin-top: 2px; }
.tetamet-ai-consent a { color: var(--tetamet-primary) !important; }
.tetamet-ai-submit-lead { width: 100% !important; min-height: 42px !important; padding: 10px !important; }
.tetamet-ai-lead-status { margin-top: 8px; font-size: 12px; }
.tetamet-ai-lead-status.is-success { color: #16733c; }
.tetamet-ai-lead-status.is-error { color: #b42318; }

.tetamet-ai-citation { display: inline; margin-left: 1px; color: var(--tetamet-primary) !important; font-size: .78em; font-weight: 700; text-decoration: none !important; }
.tetamet-ai-citation:hover { text-decoration: underline !important; }

.tetamet-ai-hp { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.tetamet-ai-widget .screen-reader-text { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 520px) {
  .tetamet-ai-floating { left: 10px !important; right: 10px !important; bottom: max(10px, env(safe-area-inset-bottom)) !important; }
  .tetamet-ai-floating .tetamet-ai-launcher { margin-left: auto !important; }
  .tetamet-ai-panel,
  .tetamet-ai-right .tetamet-ai-panel,
  .tetamet-ai-left .tetamet-ai-panel {
    position: fixed !important;
    inset: 8px 8px max(8px, env(safe-area-inset-bottom)) 8px !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 14px !important;
  }
  .tetamet-ai-header { flex-basis: 60px; min-height: 60px !important; height: 60px; }
  .tetamet-ai-lead-form { inset: 60px 0 0 !important; }
  .tetamet-ai-form-grid { grid-template-columns: 1fr; }
  .tetamet-ai-inline .tetamet-ai-panel { height: 75vh !important; }
}

@media (max-height: 650px) and (min-width: 521px) {
  .tetamet-ai-panel { height: calc(100dvh - 24px) !important; max-height: none !important; bottom: 12px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .tetamet-ai-panel,
  .tetamet-ai-turnstile-wrap,
  .tetamet-ai-messages { transition: none !important; scroll-behavior: auto !important; }
  .tetamet-ai-typing span { animation: none !important; }
}
@media (max-width: 520px) {
  html.tetamet-ai-page-locked,
  html.tetamet-ai-page-locked body { overflow: hidden !important; overscroll-behavior: none !important; }
}
