.zt-ai-root,
.zt-ai-root * {
  box-sizing: border-box;
}

.zt-ai-root {
  --zt-ai-orange: #ff7a00;
  --zt-ai-orange-dark: #e56e00;
  --zt-ai-ink: #171717;
  --zt-ai-muted: #737373;
  --zt-ai-border: #ececec;
  --zt-ai-surface: #ffffff;
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 2147482000;
  font-family: "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--zt-ai-ink);
}

.zt-ai-launcher {
  position: relative;
  width: 68px;
  min-width: 68px;
  height: 68px;
  padding: 7px;
  border: 3px solid #fff;
  border-radius: 21px;
  background: linear-gradient(145deg, #ff941f, var(--zt-ai-orange));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  cursor: pointer;
  overflow: visible;
  box-shadow: 0 15px 34px rgba(229, 110, 0, 0.38), 0 4px 10px rgba(0, 0, 0, 0.16);
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.zt-ai-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 48px rgba(229, 110, 0, 0.38);
}

.zt-ai-launcher:focus-visible,
.zt-ai-close:focus-visible,
.zt-ai-send:focus-visible,
.zt-ai-chip:focus-visible,
.zt-ai-support-link:focus-visible,
.zt-ai-source-link:focus-visible {
  outline: 3px solid rgba(255, 122, 0, 0.3);
  outline-offset: 2px;
}

.zt-ai-launcher.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.96);
}

.zt-ai-launcher-logo,
.zt-ai-brand-logo {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
  background: #fff;
}

.zt-ai-launcher-logo {
  width: 100%;
  height: 100%;
  padding: 3px;
  border-radius: 15px;
}

.zt-ai-launcher-label {
  position: absolute;
  right: -5px;
  bottom: -7px;
  min-width: 45px;
  padding: 4px 7px;
  border: 2px solid #fff;
  border-radius: 8px;
  background: #202020;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.24);
}

.zt-ai-brand-logo {
  width: 48px;
  height: 48px;
  padding: 4px;
  border-radius: 15px;
}

.zt-ai-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(404px, calc(100vw - 24px));
  height: min(680px, calc(100dvh - 28px));
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 25px;
  background: var(--zt-ai-surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.zt-ai-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.zt-ai-header {
  min-height: 76px;
  padding: 14px 14px 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #ff8a1f, var(--zt-ai-orange));
  color: #fff;
}

.zt-ai-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.zt-ai-brand-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.zt-ai-brand-text strong {
  font-size: 16px;
  line-height: 1.25;
}

.zt-ai-brand-text span {
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.86;
  white-space: nowrap;
}

.zt-ai-close {
  width: 39px;
  height: 39px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: inherit;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.zt-ai-messages {
  min-height: 0;
  padding: 18px 15px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fafafa;
  scrollbar-width: thin;
  scrollbar-color: #d7d7d7 transparent;
}

.zt-ai-message-row {
  display: flex;
  margin-bottom: 12px;
}

.zt-ai-message-row.is-user {
  justify-content: flex-end;
}

.zt-ai-message {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 17px;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.zt-ai-message.is-assistant {
  border: 1px solid var(--zt-ai-border);
  border-top-left-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.zt-ai-message.is-user {
  border-top-right-radius: 6px;
  background: var(--zt-ai-orange);
  color: #fff;
}

.zt-ai-message-text {
  white-space: pre-wrap;
}

.zt-ai-answer-notice {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #ffd0d0;
  color: #c90000;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.55;
}

.zt-ai-answer-notice p {
  margin: 0;
}

.zt-ai-answer-notice p + p {
  margin-top: 6px;
}

.zt-ai-sources {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--zt-ai-border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.zt-ai-sources-title {
  width: 100%;
  color: var(--zt-ai-muted);
  font-size: 10px;
  font-weight: 800;
}

.zt-ai-source-link {
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff3e8;
  color: #b95700;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zt-ai-support {
  margin-top: 11px;
  padding: 11px;
  border: 1px solid #ffd8b3;
  border-radius: 13px;
  background: #fff8f1;
}

.zt-ai-support p {
  margin: 0 0 9px;
  color: #6a3a0e;
  font-size: 11px;
  line-height: 1.55;
}

.zt-ai-support-link {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--zt-ai-orange);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.zt-ai-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: auto;
  padding: 14px 16px;
}

.zt-ai-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a3a3a3;
  animation: zt-ai-bounce 1.1s infinite ease-in-out;
}

.zt-ai-typing span:nth-child(2) { animation-delay: 0.12s; }
.zt-ai-typing span:nth-child(3) { animation-delay: 0.24s; }

@keyframes zt-ai-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.zt-ai-quick {
  padding: 10px 13px;
  border-top: 1px solid var(--zt-ai-border);
  display: flex;
  gap: 7px;
  overflow-x: auto;
  background: #fff;
  scrollbar-width: none;
}

.zt-ai-quick::-webkit-scrollbar { display: none; }
.zt-ai-quick.is-disabled { opacity: 0.55; pointer-events: none; }

.zt-ai-chip {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #ffd3ab;
  border-radius: 999px;
  background: #fff8f1;
  color: #a94f00;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.zt-ai-form {
  padding: 11px 13px 12px;
  border-top: 1px solid var(--zt-ai-border);
  background: #fff;
}

.zt-ai-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 7px 7px 7px 12px;
  border: 1px solid #dedede;
  border-radius: 16px;
  background: #fafafa;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.zt-ai-input-wrap:focus-within {
  border-color: var(--zt-ai-orange);
  box-shadow: 0 0 0 2px rgba(255, 122, 0, 0.14);
}

.zt-ai-root .zt-ai-input,
.zt-ai-root .zt-ai-input:focus,
.zt-ai-root .zt-ai-input:focus-visible {
  width: 100%;
  min-height: 39px;
  max-height: 120px;
  padding: 9px 0 7px;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  appearance: none;
  resize: none;
  background: transparent !important;
  color: var(--zt-ai-ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.zt-ai-input::placeholder { color: #a3a3a3; }

.zt-ai-send {
  min-width: 58px;
  height: 39px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: var(--zt-ai-orange);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.zt-ai-send:hover { background: var(--zt-ai-orange-dark); }
.zt-ai-send:disabled { opacity: 0.5; cursor: wait; }

.zt-ai-privacy {
  margin: 7px 2px 0;
  color: #8b8b8b;
  font-size: 9px;
  line-height: 1.4;
}

@media (max-width: 520px) {
  .zt-ai-root {
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .zt-ai-panel {
    position: fixed;
    inset: 8px;
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 22px;
  }

  .zt-ai-launcher {
    min-width: 62px;
    width: 62px;
    height: 62px;
    padding: 6px;
    border-radius: 19px;
  }

  .zt-ai-launcher-logo {
    width: 100%;
    height: 100%;
  }

  .zt-ai-launcher-label {
    right: -3px;
    bottom: -6px;
  }

  .zt-ai-brand-text span {
    max-width: 235px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zt-ai-launcher,
  .zt-ai-panel,
  .zt-ai-typing span {
    transition: none;
    animation: none;
  }
}

/* ZULTALK AI HIDE LAUNCHER WHILE PANEL OPEN V7 */
.zt-ai-launcher.is-hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
/* ZULTALK AI HIDE LAUNCHER WHILE PANEL OPEN V7 END */
