:root {
  --tgw-navy: #0B1222;
  --tgw-navy-soft: #131D2F;
  --tgw-teal: #00D4AA;
  --tgw-teal-dark: #00B894;
  --tgw-white: #FFFFFF;
  --tgw-gray-50: #F8FAFC;
  --tgw-gray-100: #F1F5F9;
  --tgw-gray-200: #E2E8F0;
  --tgw-gray-400: #94A3B8;
  --tgw-gray-500: #64748B;
  --tgw-gray-700: #334155;
  --tgw-shadow: 0 24px 70px rgba(11, 18, 34, 0.24);
  --tgw-radius: 24px;
}

#tgw-360hr-chat-root,
#tgw-360hr-chat-root * {
  box-sizing: border-box;
}

#tgw-360hr-chat-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--tgw-gray-700);
}

.tgw-launcher {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--tgw-navy);
  background: linear-gradient(135deg, var(--tgw-teal), var(--tgw-teal-dark));
  box-shadow: 0 18px 45px rgba(0, 212, 170, 0.32), 0 8px 22px rgba(11, 18, 34, 0.20);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.tgw-launcher:hover,
.tgw-launcher:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 24px 54px rgba(0, 212, 170, 0.38), 0 10px 26px rgba(11, 18, 34, 0.24);
  outline: none;
}

.tgw-launcher svg {
  width: 29px;
  height: 29px;
}

.tgw-launcher-pulse {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #22C55E;
  border: 2px solid var(--tgw-white);
}

.tgw-panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: min(390px, calc(100vw - 28px));
  height: min(610px, calc(100vh - 112px));
  min-height: 430px;
  border-radius: var(--tgw-radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--tgw-shadow);
  border: 1px solid rgba(226, 232, 240, 0.95);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

#tgw-360hr-chat-root.tgw-open .tgw-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.tgw-header {
  position: relative;
  padding: 19px 20px 18px;
  color: var(--tgw-white);
  background:
    radial-gradient(circle at 18% 22%, rgba(0, 212, 170, 0.26), transparent 35%),
    linear-gradient(135deg, var(--tgw-navy), var(--tgw-navy-soft));
}

.tgw-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

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

.tgw-brand-mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tgw-navy);
  background: linear-gradient(135deg, var(--tgw-teal), var(--tgw-teal-dark));
  box-shadow: 0 12px 28px rgba(0, 212, 170, 0.25);
}

.tgw-brand-mark svg {
  width: 22px;
  height: 22px;
}

.tgw-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tgw-subtitle {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.35;
}

.tgw-close-panel {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--tgw-white);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition: background 160ms ease, border-color 160ms ease;
}

.tgw-close-panel:hover,
.tgw-close-panel:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  outline: none;
}

.tgw-status-line {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  font-weight: 700;
}

.tgw-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--tgw-teal);
  box-shadow: 0 0 0 4px rgba(0, 212, 170, 0.16);
}

.tgw-messages {
  background:
    radial-gradient(circle at 15% 5%, rgba(0, 212, 170, 0.10), transparent 28%),
    linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
  overflow-y: auto;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  scroll-behavior: smooth;
}

.tgw-empty-state {
  margin: auto 0;
  padding: 22px 18px;
  text-align: center;
  border: 1px solid var(--tgw-gray-200);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
}

.tgw-empty-state strong {
  display: block;
  color: var(--tgw-navy);
  font-size: 15px;
  margin-bottom: 7px;
}

.tgw-empty-state span {
  display: block;
  color: var(--tgw-gray-500);
  font-size: 13px;
  line-height: 1.45;
}

.tgw-message {
  max-width: 84%;
  display: grid;
  gap: 5px;
}

.tgw-message-bubble {
  padding: 11px 13px;
  border-radius: 17px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.tgw-message-meta {
  padding: 0 4px;
  color: var(--tgw-gray-400);
  font-size: 11px;
}

.tgw-message-visitor {
  align-self: flex-end;
}

.tgw-message-visitor .tgw-message-bubble {
  color: var(--tgw-navy);
  background: linear-gradient(135deg, var(--tgw-teal), var(--tgw-teal-dark));
  border-bottom-right-radius: 7px;
}

.tgw-message-visitor .tgw-message-meta {
  text-align: right;
}

.tgw-message-admin,
.tgw-message-system {
  align-self: flex-start;
}

.tgw-message-admin .tgw-message-bubble {
  color: var(--tgw-gray-700);
  background: var(--tgw-white);
  border: 1px solid var(--tgw-gray-200);
  border-bottom-left-radius: 7px;
}

.tgw-message-system {
  align-self: center;
  max-width: 92%;
}

.tgw-message-system .tgw-message-bubble {
  color: var(--tgw-gray-500);
  background: rgba(241, 245, 249, 0.82);
  border: 1px solid var(--tgw-gray-200);
  box-shadow: none;
  text-align: center;
  font-size: 13px;
}

.tgw-footer {
  padding: 14px 14px 13px;
  background: var(--tgw-white);
  border-top: 1px solid var(--tgw-gray-200);
}

.tgw-error {
  display: none;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  color: #7F1D1D;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  font-size: 13px;
  line-height: 1.4;
}

.tgw-error.tgw-visible {
  display: block;
}

.tgw-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  align-items: end;
}

.tgw-input {
  width: 100%;
  min-height: 46px;
  max-height: 118px;
  resize: none;
  overflow-y: auto;
  border: 1px solid var(--tgw-gray-200);
  border-radius: 16px;
  padding: 12px 13px;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--tgw-gray-700);
  background: var(--tgw-gray-50);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.tgw-input:focus {
  border-color: rgba(0, 212, 170, 0.72);
  background: var(--tgw-white);
  box-shadow: 0 0 0 4px rgba(0, 212, 170, 0.12);
}

.tgw-send {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  color: var(--tgw-navy);
  background: linear-gradient(135deg, var(--tgw-teal), var(--tgw-teal-dark));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms ease, opacity 160ms ease;
}

.tgw-send:hover,
.tgw-send:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.tgw-send:disabled {
  opacity: 0.54;
  cursor: not-allowed;
  transform: none;
}

.tgw-send svg {
  width: 20px;
  height: 20px;
}

.tgw-privacy {
  margin: 10px 2px 0;
  color: var(--tgw-gray-500);
  font-size: 11.5px;
  line-height: 1.45;
}

.tgw-actions {
  margin-top: 9px;
  display: flex;
  justify-content: flex-end;
}

.tgw-end-chat {
  border: 0;
  background: transparent;
  color: var(--tgw-gray-500);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 2px;
}

.tgw-end-chat:hover,
.tgw-end-chat:focus-visible {
  color: var(--tgw-navy);
  outline: none;
}

@media (max-width: 640px) {
  #tgw-360hr-chat-root {
    right: 16px;
    bottom: 16px;
  }

  .tgw-launcher {
    width: 58px;
    height: 58px;
  }

  .tgw-panel {
    position: fixed;
    right: 10px;
    left: 10px;
    bottom: 84px;
    width: auto;
    height: min(650px, calc(100vh - 102px));
    min-height: 390px;
    border-radius: 22px;
  }

  .tgw-header {
    padding: 17px 17px 15px;
  }

  .tgw-messages {
    padding: 15px 12px 12px;
  }

  .tgw-message {
    max-width: 88%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tgw-launcher,
  .tgw-panel,
  .tgw-send,
  .tgw-input,
  .tgw-close-panel {
    transition: none;
  }

  .tgw-messages {
    scroll-behavior: auto;
  }
}


.hr-chat-privacy-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 2px 6px;
  font-size: 11px;
  line-height: 1.35;
  color: #53627a;
}

.hr-chat-privacy-consent input {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  accent-color: #00cdb6;
  flex: 0 0 auto;
}

.hr-chat-send:disabled,
.hr-chat-send[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}


.tgw-privacy-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 2px 6px;
  font-size: 11px;
  line-height: 1.35;
  color: #53627a;
}

.tgw-privacy-consent input {
  width: 15px;
  height: 15px;
  margin-top: 1px;
  accent-color: #00cdb6;
  flex: 0 0 auto;
}

.tgw-send:disabled,
.tgw-send[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
