:root {
  color-scheme: light;
  --ink: #14231d;
  --muted: #63706a;
  --paper: #f5f4ee;
  --card: #fffefa;
  --line: #d9ddd7;
  --green: #245c48;
  --green-dark: #143e30;
  --lime: #cfe46a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Pretendard, "Noto Sans KR", system-ui, sans-serif;
  background-image: radial-gradient(circle at 12% 7%, rgba(207, 228, 106, .18), transparent 26%), linear-gradient(rgba(20,35,29,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(20,35,29,.035) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
}

button, textarea { font: inherit; }
.shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.masthead { display: flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); padding-bottom: 19px; }
.brand-mark, .avatar { display: grid; place-items: center; color: white; background: var(--green); font-family: Georgia, serif; font-weight: 700; }
.brand-mark { width: 43px; height: 43px; border-radius: 50% 50% 50% 8px; font-size: 24px; }
.eyebrow, .kicker { margin: 0; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.masthead h1 { margin: 2px 0 0; font-size: 17px; }
.status { margin-left: auto; color: var(--muted); font-size: 12px; }
.status i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #56a372; box-shadow: 0 0 0 4px rgba(86,163,114,.13); }

.intro { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: end; padding: 60px 28px 40px; }
.intro h2 { margin: 12px 0 16px; font-family: Georgia, "Noto Serif KR", serif; font-size: clamp(40px, 6vw, 68px); line-height: .98; letter-spacing: -.045em; }
.intro h2 em { color: var(--green); font-weight: 400; }
.intro-copy { max-width: 600px; margin: 0; color: var(--muted); line-height: 1.75; }
.document-card { position: relative; padding: 24px; min-height: 145px; display: flex; flex-direction: column; justify-content: flex-end; border: 1px solid var(--green); background: var(--card); box-shadow: 9px 9px 0 var(--lime); }
.document-card::before { content: "PDF"; position: absolute; right: 18px; top: 18px; color: var(--green); border: 1px solid currentColor; padding: 4px 6px; font: 700 10px system-ui; }
.document-card strong { margin: 12px 0 5px; font-size: 15px; }
.document-card span:last-child, .doc-label { color: var(--muted); font-size: 11px; }
.doc-label { letter-spacing: .14em; }

.chat { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,254,250,.92); box-shadow: 0 22px 60px rgba(20,35,29,.09); }
.messages { height: min(420px, 48vh); min-height: 290px; padding: 30px; overflow-y: auto; scroll-behavior: smooth; }
.message { display: flex; gap: 12px; margin-bottom: 22px; animation: enter .25s ease-out; }
.message.user { justify-content: flex-end; }
.avatar { flex: 0 0 34px; height: 34px; border-radius: 50% 50% 50% 7px; }
.bubble { max-width: min(700px, 82%); padding: 15px 18px 12px; border-radius: 5px 18px 18px 18px; background: #eef1ec; line-height: 1.65; white-space: pre-wrap; }
.bubble p { margin: 0; }
.user .bubble { color: white; background: var(--green); border-radius: 18px 5px 18px 18px; }
.meta { display: block; margin-top: 7px; color: #75827c; font-size: 10px; }
.user .meta { color: rgba(255,255,255,.65); text-align: right; }
.typing { display: flex; gap: 5px; padding: 7px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #819087; animation: pulse 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }.typing i:nth-child(3) { animation-delay: .3s; }

.suggestions { display: flex; gap: 8px; padding: 0 30px 18px; overflow-x: auto; }
.suggestions button { flex: 0 0 auto; border: 1px solid #cdd5cf; border-radius: 999px; padding: 9px 13px; color: var(--green-dark); background: transparent; font-size: 12px; cursor: pointer; transition: .18s; }
.suggestions button:hover { border-color: var(--green); background: #eff5e7; transform: translateY(-1px); }
.composer { display: flex; align-items: flex-end; gap: 12px; margin: 0 22px; padding: 13px 13px 13px 19px; border: 1px solid #c9d0ca; border-radius: 18px; background: white; box-shadow: 0 6px 20px rgba(20,35,29,.06); }
.composer:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(36,92,72,.1); }
textarea { width: 100%; max-height: 130px; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; line-height: 1.5; }
textarea::placeholder { color: #98a09b; }
#send { flex: 0 0 43px; height: 43px; border: 0; border-radius: 13px; color: white; background: var(--green); cursor: pointer; transition: .18s; }
#send:hover { background: var(--green-dark); transform: translateY(-1px); }
#send:disabled { opacity: .5; cursor: wait; }
#send svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notice { margin: 11px 22px 18px; color: #8a928e; text-align: center; font-size: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@keyframes pulse { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 720px) {
  .shell { width: min(100% - 20px, 1080px); padding-top: 14px; }
  .status { display: none; }
  .intro { grid-template-columns: 1fr; gap: 24px; padding: 42px 12px 34px; }
  .intro h2 { font-size: clamp(38px, 12vw, 56px); }
  .document-card { min-height: 120px; }
  .chat { border-radius: 18px; }
  .messages { height: 46vh; padding: 22px 16px; }
  .suggestions { padding: 0 16px 15px; }
  .composer { margin: 0 12px; }
  .bubble { max-width: 88%; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
