﻿:root {
  --bg: #f2f4f7;
  --card: #ffffff;
  --text: #1f1d1a;
  --muted: #6f6a60;
  --accent: #0ea5e9;
  --border: #e6dfd0;
  --font:16px;
}

* { box-sizing: border-box; margin:0;padding:0;}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  background: #fff;
  /* background: linear-gradient(180deg,rgba(255, 255, 255, 1) 0%, rgba(233, 236, 245, 1) 100%); */
  color: var(--text);
  font-size: var(--font);
}

.app {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 30px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app__header {
  margin-bottom: 0;
}

.app__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 28px;
  margin: 0;
  /* flex-direction: row-reverse; */
  justify-content: space-between;
  word-break: keep-all;
}



.app__header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--font);
}

.chat {
  flex: 1;
  min-height: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  align-items: flex-start;
  height: 70vh;
  max-height: 70vh;
}

.message {
  padding: 10px 12px;
  border-radius: 12px;
  max-width: 85%;
  line-height: 1.5;
  position: relative;
}

.message--bot {
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  padding-left: 48px;
}

.message--user {
  background: #f1f5f9;
  border: 1px solid #d6e0ea;
  margin-left: auto;
}



.message--bot::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff url('/assets/images/avatar.jpg') center center no-repeat;
  border: 1px solid #bae6fd;
}

.message--loading {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.message--loading span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0ea5e9;
  animation: loading-bounce 0.85s infinite ease-in-out;
}

.message--loading span:nth-child(2) {
  animation-delay: 0.15s;
}

.message--loading span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes loading-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.6; }
  40% { transform: translateY(-6px); opacity: 1; }
}

.loading-dots {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0ea5e9;
  animation: loading-bounce 0.85s infinite ease-in-out;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.actions[hidden] {
  display: none;
}

.input {
  display: grid;
  gap: 12px;
}

.input__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.input__row input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: var(--font);
}

.input__meta {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.panel {
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.panel h2 {
  margin: 0 0 12px 0;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field input,
.field textarea {
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: var(--font);
}

.note {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 29, 26, 0.45);
  backdrop-filter: blur(8px);
}

.modal__content {
  position: relative;
  z-index: 1;
  width: min(720px, 92vw);
  height: 95vh;
  overflow: auto;
  background: var(--card);
  border-radius: 2px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  padding: 34px;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal__close {
  border: 1px solid var(--border);
  background: transparent;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.app__btn {display: flex; gap:12px; align-items: center;}

.btn {
  border: none;
  background: #1f1d1a;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--font);
  text-decoration: none;
}
.send-btn {
  background: #0ea5e9; 
} 

.btn img {
  height: 20px;
  margin-right: 8px;
  vertical-align: -4px;
}

.btn:hover {
  background: #1f1d1a;
}

.btn:disabled {
  background: #c7c1b6;
  color: #ffffff;
  cursor: not-allowed;
  opacity: 0.85;
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn--ghost:hover {
  background: transparent;
  border: 1px solid #1f1d1a;
}

@media (max-width: 720px) {
  html,body{ font-size:14px;}
  :root {
    --font:14px;
  }
  .app { margin: 0; padding: 16px; }
  .app__logo img {
    width: 200px;
  }
  .app__header p {
    font-size: 14px;
  }
  body {
    font-size: 14px;
  }
}
