/* AI 도우미 창. 오른쪽 아래 아이콘과, 크롬 클로드창처럼 밀려 나오는 패널. */

.ai-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--accent, #2f6fed);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 20px rgb(0 0 0 / 22%);
}
.ai-fab:hover { filter: brightness(1.08); }
.ai-fab:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.ai-panel {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 61;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 48px));
  height: min(560px, calc(100vh - 140px));
  border: 1px solid rgb(0 0 0 / 10%);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 48px rgb(0 0 0 / 20%);
  overflow: hidden;
}
.ai-panel[hidden] { display: none; }

.ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgb(0 0 0 / 8%);
}
.ai-head small { display: block; font-size: 11px; }

.ai-close {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  padding: 0 4px;
}

.ai-log {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.ai-msg {
  max-width: 85%;
  padding: 8px 11px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}
.ai-user { align-self: flex-end; background: var(--accent, #2f6fed); color: #fff; }
.ai-bot { align-self: flex-start; background: #f1f3f5; }
.ai-error { background: #fdecea; color: #9b1c12; }

.ai-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 12px;
  border-top: 1px solid rgb(0 0 0 / 8%);
}
.ai-form textarea {
  flex: 1;
  resize: none;
  border: 1px solid rgb(0 0 0 / 15%);
  border-radius: 8px;
  padding: 8px;
  font: inherit;
  font-size: 14px;
}
.ai-form button { white-space: nowrap; }

.ai-note {
  margin: 0;
  padding: 0 14px 10px;
  font-size: 11px;
  line-height: 1.4;
}

@media (max-width: 520px) {
  .ai-panel { right: 12px; left: 12px; width: auto; bottom: 84px; }
  .ai-fab { right: 16px; bottom: 16px; }
}

/* 로그인 화면에서는 아이콘을 감춥니다. */
.ai-fab[hidden] { display: none; }
