.daeger-live-chat,
.daeger-live-chat * {
  box-sizing: border-box;
  letter-spacing: 0;
}

.daeger-live-chat {
  --chat-navy: #0d1b33;
  --chat-navy-soft: #172b4d;
  --chat-gold: #c28c2e;
  --chat-ink: #172033;
  --chat-muted: #697488;
  --chat-line: #dfe4eb;
  --chat-surface: #f5f7fa;
  position: fixed;
  z-index: 2147482600;
  right: 24px;
  bottom: 24px;
  color: var(--chat-ink);
  font-family: Pretendard, "Noto Sans KR", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.daeger-chat-trigger {
  position: relative;
  display: flex;
  min-width: 176px;
  min-height: 58px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 9px 14px 9px 10px;
  background: var(--chat-navy);
  box-shadow: 0 14px 34px rgba(7, 17, 34, 0.26);
  color: #fff;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.daeger-chat-trigger:hover,
.daeger-chat-trigger:focus-visible {
  background: var(--chat-navy-soft);
  box-shadow: 0 18px 40px rgba(7, 17, 34, 0.32);
  transform: translateY(-2px);
}

.daeger-chat-trigger:focus-visible,
.daeger-chat-icon-button:focus-visible,
.daeger-chat-primary:focus-visible,
.daeger-chat-secondary:focus-visible,
.daeger-chat-reply-form button:focus-visible,
.daeger-chat-conversation-status button:focus-visible {
  outline: 3px solid rgba(223, 182, 93, 0.6);
  outline-offset: 2px;
}

.daeger-chat-trigger-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 4px;
  background: var(--chat-gold);
  color: #fff;
}

.daeger-chat-trigger-icon svg {
  width: 21px;
  height: 21px;
}

.daeger-chat-trigger-copy {
  display: block;
  text-align: left;
}

.daeger-chat-trigger-copy strong,
.daeger-chat-trigger-copy small {
  display: block;
}

.daeger-chat-trigger-copy strong {
  font-size: 13px;
  font-weight: 800;
}

.daeger-chat-trigger-copy small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 600;
}

.daeger-chat-unread {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  min-width: 23px;
  height: 23px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 0 5px;
  background: #d6483b;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.daeger-chat-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  display: flex;
  width: 382px;
  max-width: calc(100vw - 48px);
  height: min(650px, calc(100vh - 118px));
  min-height: 480px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(7, 17, 34, 0.16);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(7, 17, 34, 0.3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.daeger-live-chat.is-open .daeger-chat-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.daeger-chat-header {
  display: flex;
  min-height: 74px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 3px solid var(--chat-gold);
  padding: 13px 14px 12px 16px;
  background: var(--chat-navy);
  color: #fff;
}

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

.daeger-chat-brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 4px;
  color: var(--chat-gold);
  font-family: Arial, sans-serif;
  font-size: 19px;
  font-style: italic;
  font-weight: 900;
}

.daeger-chat-brand > span:last-child {
  min-width: 0;
}

.daeger-chat-brand strong,
.daeger-chat-brand small {
  display: block;
}

.daeger-chat-brand strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daeger-chat-brand small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 600;
}

.daeger-chat-brand small i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: #5bc58b;
  box-shadow: 0 0 0 3px rgba(91, 197, 139, 0.14);
  vertical-align: 1px;
}

.daeger-chat-icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.daeger-chat-icon-button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.daeger-chat-icon-button svg {
  width: 19px;
  height: 19px;
}

.daeger-chat-view {
  min-height: 0;
  flex: 1 1 auto;
}

.daeger-chat-start {
  overflow-y: auto;
  padding: 20px 18px;
}

.daeger-chat-intro {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--chat-line);
  padding-bottom: 17px;
}

.daeger-chat-intro-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 4px;
  background: #eef2f7;
  color: var(--chat-navy);
}

.daeger-chat-intro-icon svg {
  width: 22px;
  height: 22px;
}

.daeger-chat-intro h2 {
  margin: 0;
  color: var(--chat-navy);
  font-size: 17px;
  font-weight: 800;
}

.daeger-chat-intro p {
  margin: 5px 0 0;
  color: var(--chat-muted);
  font-size: 11px;
  line-height: 1.65;
}

.daeger-chat-start-form {
  display: grid;
  gap: 13px;
  padding-top: 17px;
}

.daeger-chat-start-form label:not(.daeger-chat-consent):not(.daeger-chat-honeypot) {
  display: grid;
  gap: 6px;
}

.daeger-chat-start-form label > span {
  color: #354258;
  font-size: 11px;
  font-weight: 700;
}

.daeger-chat-start-form label > span small {
  margin-left: 3px;
  color: #8c96a6;
  font-size: 9px;
  font-weight: 600;
}

.daeger-chat-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.daeger-chat-start-form input[type="text"],
.daeger-chat-start-form textarea,
.daeger-chat-reply-form textarea {
  width: 100%;
  border: 1px solid #cfd6e0;
  border-radius: 4px;
  outline: 0;
  background: #fff;
  color: var(--chat-ink);
  font: inherit;
}

.daeger-chat-start-form input[type="text"] {
  height: 42px;
  padding: 0 11px;
  font-size: 12px;
}

.daeger-chat-start-form textarea {
  min-height: 86px;
  resize: vertical;
  padding: 10px 11px;
  font-size: 12px;
  line-height: 1.55;
}

.daeger-chat-start-form input:focus,
.daeger-chat-start-form textarea:focus,
.daeger-chat-reply-form textarea:focus {
  border-color: var(--chat-gold);
  box-shadow: 0 0 0 3px rgba(194, 140, 46, 0.12);
}

.daeger-chat-start-form input::placeholder,
.daeger-chat-start-form textarea::placeholder,
.daeger-chat-reply-form textarea::placeholder {
  color: #9aa3b1;
}

.daeger-chat-consent {
  display: grid;
  grid-template-columns: 15px 1fr;
  align-items: start;
  gap: 7px;
  cursor: pointer;
}

.daeger-chat-consent input {
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
  accent-color: var(--chat-navy);
}

.daeger-chat-consent span {
  color: var(--chat-muted) !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  line-height: 1.55;
}

.daeger-chat-consent a {
  color: var(--chat-navy);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.daeger-chat-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.daeger-chat-primary,
.daeger-chat-secondary {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 4px;
  padding: 0 15px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.daeger-chat-primary {
  width: 100%;
  border: 1px solid var(--chat-navy);
  background: var(--chat-navy);
  color: #fff;
}

.daeger-chat-primary:hover {
  background: var(--chat-navy-soft);
}

.daeger-chat-primary svg {
  width: 17px;
  height: 17px;
}

.daeger-chat-primary:disabled,
.daeger-chat-reply-form button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.daeger-chat-conversation {
  display: flex;
  min-height: 0;
  flex-direction: column;
  background: var(--chat-surface);
}

.daeger-chat-conversation[hidden] {
  display: none;
}

.daeger-chat-conversation-status {
  display: flex;
  min-height: 43px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--chat-line);
  padding: 0 14px;
  background: #fff;
}

.daeger-chat-conversation-status > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--chat-navy);
  font-size: 10px;
}

.daeger-chat-conversation-status svg {
  width: 15px;
  height: 15px;
  color: var(--chat-gold);
}

.daeger-chat-conversation-status button {
  border: 0;
  padding: 5px;
  background: transparent;
  color: var(--chat-muted);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.daeger-chat-conversation-status button:hover {
  color: var(--chat-navy);
}

.daeger-chat-messages {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 14px;
  overscroll-behavior: contain;
}

.daeger-chat-message {
  display: flex;
  margin: 0 0 13px;
  flex-direction: column;
}

.daeger-chat-message > span {
  margin: 0 0 4px 3px;
  color: #758095;
  font-size: 9px;
  font-weight: 700;
}

.daeger-chat-message > p {
  max-width: 82%;
  margin: 0;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.daeger-chat-message > time {
  margin: 4px 3px 0;
  color: #939dac;
  font-size: 8px;
}

.daeger-chat-message.is-admin {
  align-items: flex-start;
}

.daeger-chat-message.is-admin > p {
  border: 1px solid #d9dfe8;
  border-top-left-radius: 2px;
  background: #fff;
  color: var(--chat-ink);
}

.daeger-chat-message.is-visitor {
  align-items: flex-end;
}

.daeger-chat-message.is-visitor > span {
  margin-right: 3px;
}

.daeger-chat-message.is-visitor > p {
  border-top-right-radius: 2px;
  background: var(--chat-navy);
  color: #fff;
}

.daeger-chat-message.is-visitor > time {
  text-align: right;
}

.daeger-chat-message.is-system {
  align-items: center;
  margin-block: 9px 15px;
}

.daeger-chat-message.is-system > p {
  max-width: 94%;
  border-radius: 4px;
  padding: 7px 10px;
  background: #e8ecf2;
  color: #687386;
  font-size: 9px;
  text-align: center;
}

.daeger-chat-reply-form {
  display: grid;
  grid-template-columns: 1fr 42px;
  flex: 0 0 auto;
  gap: 8px;
  border-top: 1px solid var(--chat-line);
  padding: 10px;
  background: #fff;
}

.daeger-chat-reply-form textarea {
  min-height: 42px;
  max-height: 100px;
  resize: none;
  padding: 10px 11px;
  font-size: 12px;
  line-height: 1.5;
}

.daeger-chat-reply-form button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--chat-gold);
  border-radius: 4px;
  background: var(--chat-gold);
  color: #fff;
  cursor: pointer;
}

.daeger-chat-reply-form button:hover {
  background: #aa7620;
}

.daeger-chat-reply-form button svg {
  width: 18px;
  height: 18px;
}

.daeger-chat-closed {
  flex: 0 0 auto;
  border-top: 1px solid var(--chat-line);
  padding: 13px 14px;
  background: #fff;
  text-align: center;
}

.daeger-chat-closed p {
  margin: 0 0 9px;
  color: var(--chat-muted);
  font-size: 10px;
}

.daeger-chat-secondary {
  min-height: 36px;
  border: 1px solid #cbd3de;
  background: #fff;
  color: var(--chat-navy);
}

.daeger-chat-secondary:hover {
  border-color: var(--chat-navy);
}

.daeger-chat-error {
  margin: -2px 0 0;
  border-left: 3px solid #d6483b;
  padding: 7px 9px;
  background: #fff2f1;
  color: #a72f27;
  font-size: 10px;
  line-height: 1.5;
}

.daeger-chat-conversation > .daeger-chat-error {
  flex: 0 0 auto;
  margin: 0;
}

.daeger-chat-footer {
  display: flex;
  min-height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-top: 1px solid var(--chat-line);
  padding: 6px 12px;
  background: #fff;
  color: #8a94a4;
  font-size: 8px;
}

.daeger-chat-footer svg {
  width: 12px;
  height: 12px;
}

.daeger-live-chat .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Keep the existing Kakao channel visible above the live-chat entry. */
.kakao-floating,
.floating-kakao-channel {
  bottom: 94px !important;
}

@media (max-width: 680px) {
  .daeger-live-chat {
    right: 12px;
    bottom: 14px;
  }

  .daeger-chat-trigger {
    min-width: 52px;
    min-height: 52px;
    justify-content: center;
    padding: 6px;
  }

  .daeger-chat-trigger-icon {
    width: 38px;
    height: 38px;
  }

  .daeger-chat-trigger-copy {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .daeger-chat-panel {
    position: fixed;
    right: 12px;
    bottom: 76px;
    width: calc(100% - 24px);
    max-width: none;
    height: min(620px, calc(100dvh - 94px));
    min-height: 420px;
  }

  .daeger-chat-start {
    padding: 18px 15px;
  }

  .daeger-chat-form-row {
    grid-template-columns: 1fr;
  }

  .kakao-floating,
  .floating-kakao-channel {
    bottom: 76px !important;
  }
}

@media (max-height: 590px) and (min-width: 681px) {
  .daeger-chat-panel {
    height: calc(100vh - 92px);
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .daeger-chat-trigger,
  .daeger-chat-panel {
    transition: none;
  }
}
