/* Duck-il AI Concierge widget (namespace: dia-chat) */
.dia-chat,
.dia-chat *,
.dia-chat *::before,
.dia-chat *::after {
  box-sizing: border-box;
}
.dia-chat {
  --dia-blue: #3757cf;
  --dia-navy: #14204f;
  --dia-tint: #eef2ff;
  --dia-line: #dfe4f3;
  --dia-text: #1b2140;
  --dia-sub: #5a6385;
  font-family: "Noto Sans KR", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Malgun Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--dia-text);
  letter-spacing: normal;
  text-align: left;
  word-break: keep-all;
  -webkit-text-size-adjust: 100%;
}
:where(.dia-chat) div,
:where(.dia-chat) span,
:where(.dia-chat) p,
:where(.dia-chat) ul,
:where(.dia-chat) ol,
:where(.dia-chat) li,
:where(.dia-chat) a,
:where(.dia-chat) strong,
:where(.dia-chat) h2,
:where(.dia-chat) form,
:where(.dia-chat) img {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
  background: none;
}
:where(.dia-chat) ul,
:where(.dia-chat) ol {
  list-style: none;
}
:where(.dia-chat) button {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  line-height: 1.3;
  letter-spacing: normal;
  text-transform: none;
  text-align: center;
  cursor: pointer;
  vertical-align: middle;
  overflow: visible;
  -webkit-tap-highlight-color: transparent;
}
:where(.dia-chat) textarea {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--dia-text);
  font: inherit;
  font-size: 15px;
  line-height: 22px;
  letter-spacing: normal;
  resize: none;
  box-shadow: none;
  outline: none;
}
:where(.dia-chat) svg {
  display: block;
  flex: none;
}
/* The site sets "* {outline:none !important}", so show focus with a ring instead */
.dia-chat button:focus-visible,
.dia-chat a:focus-visible {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--dia-blue) !important;
}
.dia-chat-aside button:focus-visible,
.dia-chat-aside a:focus-visible {
  box-shadow: 0 0 0 2px var(--dia-navy), 0 0 0 4px #fff !important;
}

/* ---------- Launcher ---------- */
.dia-chat-launcher {
  position: fixed;
  right: 25px;
  bottom: 25px; /* TOP 버튼이 숨겨져 있을 때는 그 자리 */
  z-index: 600;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--dia-blue), var(--dia-navy));
  box-shadow: 0 8px 22px rgba(20, 32, 79, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, bottom 0.35s ease;
}
/* TOP 버튼이 나타나면 그 위로 올라간다 */
.dia-chat.is-lifted .dia-chat-launcher { bottom: 97px; }
.dia-chat .dia-chat-launcher:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 28px rgba(20, 32, 79, 0.42);
}
.dia-chat-launcher .dia-chat-face,
.dia-chat-launcher img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.dia-chat-face {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dia-blue), var(--dia-navy));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.dia-chat-launcher .dia-chat-face {
  font-size: 15px;
  border: 2px solid #fff;
}
.dia-chat-launcher img {
  border: 2px solid #fff;
  background: #fff;
}
.dia-chat-launcher .dia-chat-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
}

.dia-chat-tip {
  position: fixed;
  right: 97px;
  bottom: 37px;
  transition: bottom 0.35s ease;
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: calc(100vw - 150px);
  padding: 4px 6px 4px 14px;
  border-radius: 999px;
  background: #fff;
  color: var(--dia-navy);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: 0 6px 20px rgba(20, 32, 79, 0.22);
  border: 1px solid var(--dia-line);
  animation: dia-chat-pop 0.4s ease both;
}
.dia-chat-tip::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -6px;
  background: #fff;
  border-top: 1px solid var(--dia-line);
  border-right: 1px solid var(--dia-line);
  transform: rotate(45deg);
}
.dia-chat-tip-text {
  white-space: nowrap;
  padding: 6px 4px 6px 0;
  cursor: pointer;
}
.dia-chat-tip-x {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--dia-sub);
}
.dia-chat .dia-chat-tip-x:hover {
  background: var(--dia-tint);
}

/* ---------- Backdrop & dialog ---------- */
.dia-chat-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 16, 40, 0.55);
  animation: dia-chat-fade 0.2s ease both;
}
.dia-chat-backdrop[hidden],
.dia-chat-tip[hidden],
.dia-chat-launcher[hidden],
.dia-chat [hidden] {
  display: none !important;
}
.dia-chat-panel {
  position: relative;
  display: flex;
  width: min(1300px, 92vw);
  height: min(720px, 90vh);
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(8, 14, 40, 0.45);
  animation: dia-chat-pop 0.28s ease both;
}

/* aside */
.dia-chat-aside {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 36px 24px 24px;
  overflow-y: auto;
  background: linear-gradient(160deg, var(--dia-blue) 0%, var(--dia-navy) 100%);
  color: #fff;
  text-align: center;
}
.dia-chat-avatar {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.85);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  flex: none;
}
.dia-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dia-chat-avatar .dia-chat-face {
  width: 100%;
  height: 100%;
  font-size: 30px;
  background: #fff;
  color: var(--dia-blue);
}
.dia-chat-brand {
  margin-top: 18px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}
.dia-chat-brandsub {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: #d5ddff;
}
.dia-chat-title {
  margin-top: 22px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: #fff;
}
.dia-chat-suggests {
  width: 100%;
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dia-chat-sug {
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  text-align: left;
  justify-content: flex-start;
  transition: background 0.15s ease;
}
.dia-chat .dia-chat-sug:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* main */
.dia-chat-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.dia-chat-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 16px 28px;
  border-bottom: 1px solid var(--dia-line);
}
.dia-chat-headtext {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--dia-navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dia-chat-clear {
  flex: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--dia-sub);
  text-decoration: underline;
}
.dia-chat .dia-chat-clear:hover {
  background: var(--dia-tint);
  color: var(--dia-navy);
}
.dia-chat-close {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--dia-navy);
}
.dia-chat .dia-chat-close:hover {
  background: var(--dia-tint);
}

.dia-chat-msgs {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #fbfcff;
}
.dia-chat-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
}
.dia-chat-row.is-user {
  justify-content: flex-end;
}
.dia-chat-mini {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--dia-blue);
}
.dia-chat-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dia-chat-mini .dia-chat-face {
  width: 100%;
  height: 100%;
  font-size: 10px;
}
.dia-chat-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: min(720px, calc(100% - 50px));
  min-width: 0;
}
.dia-chat-row.is-user .dia-chat-col {
  align-items: flex-end;
}
.dia-chat-bubble {
  padding: 12px 16px;
  border-radius: 6px 18px 18px 18px;
  background: var(--dia-tint);
  border: 1px solid #d8e0fb;
  color: var(--dia-text);
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: keep-all;
}
.dia-chat-row.is-user .dia-chat-bubble {
  border-radius: 18px 6px 18px 18px;
  background: #fff;
  border: 1px solid var(--dia-line);
  white-space: pre-wrap;
}
.dia-chat-bubble p + p,
.dia-chat-bubble p + ul,
.dia-chat-bubble p + ol,
.dia-chat-bubble ul + p,
.dia-chat-bubble ol + p {
  margin-top: 8px;
}
.dia-chat-bubble ul,
.dia-chat-bubble ol {
  margin: 6px 0 0;
  padding-left: 22px;
}
.dia-chat-bubble ul {
  list-style: disc;
}
.dia-chat-bubble ol {
  list-style: decimal;
}
.dia-chat-bubble li {
  display: list-item;
  list-style: inherit;
  padding-left: 2px;
}
.dia-chat-bubble li + li {
  margin-top: 3px;
}
.dia-chat-bubble strong {
  font-weight: 700;
  color: var(--dia-navy);
}
.dia-chat-bubble a {
  color: var(--dia-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.dia-chat-time {
  margin-top: 5px;
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--dia-sub);
}
.dia-chat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.dia-chat-link {
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--dia-blue);
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
  line-height: 1.3;
  transition: background 0.15s ease;
}
.dia-chat .dia-chat-link:hover {
  background: var(--dia-navy);
}

/* typing */
.dia-chat-typing {
  display: inline-flex;
  gap: 5px;
  padding: 6px 2px;
}
.dia-chat-typing i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dia-blue);
  opacity: 0.35;
  animation: dia-chat-bounce 1.1s infinite ease-in-out;
}
.dia-chat-typing i:nth-child(2) {
  animation-delay: 0.15s;
}
.dia-chat-typing i:nth-child(3) {
  animation-delay: 0.3s;
}

/* composer */
.dia-chat-composer {
  flex: none;
  padding: 10px 28px 0;
  background: #fff;
}
.dia-chat-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 8px 8px 20px;
  border: 1.5px solid #c5cdea;
  border-radius: 28px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dia-chat-form:focus-within {
  border-color: var(--dia-blue);
  box-shadow: 0 0 0 3px rgba(55, 87, 207, 0.18);
}
.dia-chat .dia-chat-input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 22px;
  height: 22px;
  max-height: 88px;
  margin: 9px 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 15px;
  line-height: 22px;
  overflow-y: auto;
}
.dia-chat-input::placeholder {
  color: #6b7494;
  opacity: 1;
}
.dia-chat-send {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--dia-blue);
  color: #fff;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.dia-chat .dia-chat-send:hover:not(:disabled) {
  background: var(--dia-navy);
}
.dia-chat-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.dia-chat-notice {
  padding: 8px 4px 14px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--dia-sub);
  text-align: center;
}

/* 데스크톱 말풍선도 같이 올라간다 */
.dia-chat.is-lifted .dia-chat-tip { bottom: 109px; }

/* ---------- 런처 움직임: 둥실 떠다니기 + 고개 까딱 ---------- */
.dia-chat-launcher {
  animation: dia-chat-float 3.4s ease-in-out infinite;
}
.dia-chat-launcher img,
.dia-chat-launcher .dia-chat-face {
  transform-origin: 50% 85%;
  animation: dia-chat-nod 6.8s ease-in-out infinite;
}
.dia-chat-launcher[aria-expanded="true"],
.dia-chat-launcher[aria-expanded="true"] img,
.dia-chat-launcher:hover,
.dia-chat-launcher:hover img {
  animation-play-state: paused;
}
@keyframes dia-chat-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -7px; }
}
@keyframes dia-chat-nod {
  0%, 38%, 100% { transform: rotate(0deg); }
  46% { transform: rotate(-5deg); }
  54% { transform: rotate(4deg); }
  62% { transform: rotate(-3deg); }
  70% { transform: rotate(0deg); }
}
/* ---------- Animations ---------- */
@keyframes dia-chat-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes dia-chat-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes dia-chat-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-5px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .dia-chat *,
  .dia-chat *::before,
  .dia-chat *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  .dia-chat-launcher { right: 10px; }
  .dia-chat-tip { right: 82px; }
}
@media (max-width: 1024px) {
  .dia-chat-aside { flex-basis: 240px; padding: 28px 18px 20px; }
  .dia-chat-avatar { width: 104px; height: 104px; }
  .dia-chat-brand { font-size: 19px; }
  .dia-chat-msgs { padding: 20px; }
  .dia-chat-head { padding-left: 20px; }
  .dia-chat-composer { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 768px) {
  .dia-chat-launcher { width: 56px; height: 56px; bottom: 25px; }
  .dia-chat.is-lifted .dia-chat-launcher { bottom: 85px; }
  .dia-chat-tip { bottom: 34px; right: 78px; }
  .dia-chat.is-lifted .dia-chat-tip { bottom: 94px; }
  .dia-chat-backdrop { padding: 0; align-items: stretch; }
  .dia-chat-panel {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    flex-direction: column;
    box-shadow: none;
  }
  .dia-chat-aside {
    flex: none;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas: "av brand" "chips chips";
    column-gap: 10px;
    row-gap: 8px;
    align-items: center;
    padding: 10px 12px 10px;
    text-align: left;
    overflow: visible;
  }
  .dia-chat-avatar { grid-area: av; width: 44px; height: 44px; border-width: 2px; }
  .dia-chat-avatar .dia-chat-face { font-size: 12px; }
  .dia-chat-brandwrap { grid-area: brand; min-width: 0; }
  .dia-chat-brand { margin: 0; font-size: 16px; }
  .dia-chat-brandsub { margin: 0; font-size: 11px; }
  .dia-chat-title { display: none; }
  .dia-chat-suggests {
    grid-area: chips;
    margin: 0;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .dia-chat-suggests::-webkit-scrollbar { display: none; }
  .dia-chat-sug {
    flex: none;
    width: auto;
    padding: 7px 13px;
    border-radius: 999px;
    font-size: 13px;
    white-space: nowrap;
  }
  .dia-chat-head { padding: 8px 8px 8px 14px; }
  .dia-chat-headtext { font-size: 14px; }
  .dia-chat-msgs { padding: 16px 14px; gap: 14px; }
  .dia-chat-col { max-width: calc(100% - 44px); }
  .dia-chat-bubble { font-size: 14.5px; padding: 10px 13px; }
  .dia-chat-composer { padding: 6px 14px 0; }
  .dia-chat .dia-chat-input { font-size: 16px; } /* prevents iOS zoom on focus */
  .dia-chat-notice {
    padding: 6px 4px calc(10px + env(safe-area-inset-bottom, 0px));
    font-size: 11px;
  }
}
