:root {
  color-scheme: light;
  font-family:
    "Segoe UI",
    "Noto Sans KR",
    system-ui,
    -apple-system,
    sans-serif;
  background: #f3f5f4;
  color: #17201d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  background: #f3f5f4;
}

.sidebar {
  border-right: 1px solid #d8dfdc;
  background: #ffffff;
  padding: 28px;
}

.brand p,
.eyebrow {
  margin: 0 0 8px;
  color: #6a756f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  color: #17201d;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 24px;
  line-height: 1.25;
}

.source-panel {
  margin-top: 28px;
}

.source-panel h2 {
  margin-bottom: 12px;
  font-size: 15px;
}

.source-panel p {
  margin: 0;
  color: #4a5852;
  font-size: 14px;
  line-height: 1.65;
}

.document-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.document-list li {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid #dde5e2;
  border-radius: 8px;
  background: #fbfcfc;
}

.document-list strong {
  font-size: 14px;
  line-height: 1.35;
}

.document-list span {
  color: #68756f;
  font-size: 13px;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 16px;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #cbd9d3;
  border-radius: 999px;
  background: #ffffff;
  color: #245c4c;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f9d69;
}

.chat {
  min-height: 420px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid #dce4e1;
  border-radius: 8px;
  background: #ffffff;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.message.user {
  justify-content: flex-end;
}

.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1f5d54;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.bubble {
  max-width: min(780px, 88%);
  padding: 13px 15px;
  border-radius: 8px;
  line-height: 1.62;
}

.agent .bubble {
  background: #eef5f2;
  color: #18342e;
}

.user .bubble {
  background: #263d39;
  color: #ffffff;
}

.bubble p {
  margin: 0;
}

.evidence-list {
  display: grid;
  gap: 12px;
  margin: 12px 0 0;
  padding-left: 22px;
}

.evidence-list li::marker {
  font-weight: 900;
  color: #1f5d54;
}

.citation {
  display: block;
  margin-top: 6px;
  color: #587067;
  font-size: 13px;
  font-weight: 800;
}

details {
  margin-top: 12px;
}

summary {
  color: #245c4c;
  font-weight: 800;
}

.more-evidence {
  margin-top: 10px;
  color: #40524b;
  font-size: 14px;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input {
  min-width: 0;
  border: 1px solid #c8d5d0;
  border-radius: 8px;
  padding: 14px 15px;
  background: #ffffff;
  color: #17201d;
}

input:focus {
  border-color: #1f5d54;
  outline: 3px solid rgba(31, 93, 84, 0.15);
}

input:disabled {
  background: #eef2f0;
}

.composer button {
  min-width: 78px;
  border: 0;
  border-radius: 8px;
  background: #d62828;
  color: #fff;
  font-weight: 900;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-prompts button {
  border: 1px solid #d6e0dc;
  border-radius: 999px;
  padding: 9px 12px;
  background: #ffffff;
  color: #25433c;
  font-weight: 800;
}

@media (max-width: 820px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid #d8dfdc;
    padding: 20px;
  }

  .workspace {
    padding: 20px;
  }

  .topbar {
    display: grid;
  }

  .chat {
    min-height: 52vh;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .composer button {
    min-height: 46px;
  }

  .bubble {
    max-width: 92%;
  }
}
