.tgac-widget {
  --tgac-primary: #12130f;
  --tgac-accent: #f5b73b;
  --tgac-button-text: #ffffff;
  --tgac-button-hover: #2f8f6b;
  --tgac-chat-bg: #12130f;
  --tgac-ink: #f7fafc;
  --tgac-soft: rgba(255, 255, 255, 0.78);
  position: relative;
  max-width: 430px;
  min-height: 620px;
  color: var(--tgac-ink);
  background: var(--tgac-chat-bg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tgac-floating {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99999;
  width: min(430px, calc(100vw - 28px));
  min-height: 86px;
  transition: width 220ms ease, min-height 220ms ease, transform 220ms ease, opacity 220ms ease;
}

.tgac-floating:not(.tgac-opened) {
  width: auto;
  min-height: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.tgac-floating:not(.tgac-opened) .tgac-particles,
.tgac-floating:not(.tgac-opened) .tgac-brand {
  opacity: 0;
  pointer-events: none;
}

.tgac-floating:not(.tgac-opened) .tgac-shell {
  min-height: 0;
  background: transparent;
}

.tgac-floating:not(.tgac-opened) .tgac-header {
  padding: 0;
  border-bottom: 0;
}

.tgac-floating:not(.tgac-opened) .tgac-open {
  min-width: 86px;
  min-height: 54px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

.tgac-floating .tgac-panel {
  max-height: 0;
  min-height: 0;
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  transform-origin: bottom right;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  transition: max-height 260ms ease, opacity 220ms ease, transform 260ms ease, padding 220ms ease;
  pointer-events: none;
}

.tgac-floating.tgac-opened .tgac-panel {
  max-height: 680px;
  min-height: 534px;
  opacity: 1;
  transform: translateY(0) scale(1);
  padding-top: 14px;
  padding-bottom: 14px;
  pointer-events: auto;
}

.tgac-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 22% 4%, rgba(245, 183, 59, 0.18), transparent 34%),
    radial-gradient(circle at 78% 18%, rgba(93, 214, 168, 0.12), transparent 28%),
    var(--tgac-chat-bg);
  opacity: 1;
  transition: opacity 220ms ease;
}

.tgac-particles-disabled .tgac-particles {
  display: none;
}

.tgac-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: inherit;
  background: linear-gradient(180deg, rgba(18, 19, 15, 0.38), rgba(7, 9, 7, 0.52));
  backdrop-filter: blur(0.5px);
}

.tgac-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.tgac-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tgac-brand img,
.tgac-logo-fallback {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--tgac-accent);
  color: #10131a;
  font-weight: 800;
}

.tgac-brand strong,
.tgac-brand span {
  display: block;
  overflow-wrap: anywhere;
}

.tgac-brand strong {
  font-size: 15px;
}

.tgac-brand span {
  font-size: 12px;
  color: var(--tgac-soft);
}

.tgac-open,
.tgac-input-row button,
.tgac-lead-form button,
.tgac-cta button {
  border: 0;
  border-radius: 8px;
  background: var(--tgac-accent);
  color: var(--tgac-button-text);
  font-weight: 800;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.tgac-open {
  padding: 9px 12px;
  text-transform: uppercase;
}

.tgac-open:hover,
.tgac-input-row button:hover,
.tgac-lead-form button:hover,
.tgac-cta button:hover {
  background: var(--tgac-button-hover);
  color: var(--tgac-button-text);
  transform: translateY(-1px);
}

.tgac-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  min-height: 534px;
}

.tgac-language {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tgac-language button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 7px 9px;
  min-width: 38px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--tgac-ink);
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
}

.tgac-language button.active {
  background: rgba(245, 183, 59, 0.95);
  color: var(--tgac-button-text);
}

.tgac-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 230px;
  max-height: 310px;
  overflow: auto;
  padding-right: 2px;
}

.tgac-panel.tgac-show-lead .tgac-log {
  min-height: 150px;
  max-height: 190px;
}

.tgac-msg {
  width: fit-content;
  max-width: 86%;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.tgac-bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tgac-user {
  align-self: flex-end;
  background: rgba(93, 214, 168, 0.18);
  border: 1px solid rgba(93, 214, 168, 0.34);
}

.tgac-cta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-self: flex-start;
}

.tgac-cta button {
  padding: 9px 12px;
}

.tgac-cta button:last-child,
.tgac-form-actions button:first-child {
  background: rgba(255, 255, 255, 0.14);
  color: var(--tgac-ink);
}

.tgac-booking-link,
.tgac-contact-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--tgac-accent);
  color: var(--tgac-button-text);
  font-weight: 800;
  text-decoration: none;
}

.tgac-booking-link:hover,
.tgac-contact-actions a:hover {
  background: var(--tgac-button-hover);
  color: var(--tgac-button-text);
}

.tgac-contact-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.tgac-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.tgac-input-row textarea,
.tgac-lead-form input,
.tgac-lead-form select,
.tgac-lead-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #12130f;
  padding: 10px;
  font: inherit;
}

.tgac-input-row button,
.tgac-lead-form button {
  padding: 10px 13px;
}

.tgac-lead-form {
  display: grid;
  gap: 7px;
  max-height: 260px;
  overflow: auto;
  padding: 10px 4px 2px 0;
  font-size: 13px;
}

.tgac-lead-form[hidden] {
  display: none;
}

.tgac-lead-form h3 {
  margin: 0 0 2px;
  font-size: 15px;
}

.tgac-lead-form input,
.tgac-lead-form select,
.tgac-lead-form textarea {
  min-height: 36px;
  padding: 7px 9px;
}

.tgac-lead-form textarea {
  min-height: 54px;
  resize: vertical;
}

.tgac-lead-form button {
  min-height: 36px;
  padding: 8px 10px;
}

.tgac-form-grid,
.tgac-form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tgac-admin-wrap {
  max-width: 1120px;
}

.tgac-settings-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.tgac-settings-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 8px;
}

.tgac-settings-section h2 {
  margin: 0;
}

.tgac-settings-section label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.tgac-settings-section input,
.tgac-settings-section select,
.tgac-settings-section textarea {
  width: 100%;
  max-width: 920px;
}

.tgac-logo-field {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tgac-logo-field img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #f6f7f7;
}

@media (max-width: 520px) {
  .tgac-floating {
    right: 12px;
    bottom: 12px;
    width: min(430px, calc(100vw - 24px));
  }

  .tgac-floating:not(.tgac-opened) {
    width: auto;
  }

  .tgac-input-row,
  .tgac-form-grid,
  .tgac-form-actions {
    grid-template-columns: 1fr;
  }
}
