:root {
  color-scheme: light;
  --green: #1b7b5a;
  --green-dark: #0d3b2c;
  --green-soft: #f4f8f5;
  --page: #fafaf8;
  --card: #ffffff;
  --line: #dfe9e3;
  --text: #24332d;
  --muted: #64748b;
  --orange-bg: #fff7ed;
  --orange-line: #fed7aa;
  --orange-text: #9a3412;
  font-family: "Nunito Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--page); color: var(--text); }
button, textarea { font: inherit; }
button { cursor: pointer; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 270px; padding: 32px 24px;
  background: #fff; border-right: 1px solid var(--line); overflow-y: auto; z-index: 20;
}
.sidebar-logo { display: block; width: 190px; max-width: 100%; margin: 0 auto 12px; mix-blend-mode: multiply; }
.sidebar-subtitle { margin: 0; text-align: center; color: var(--muted); font-size: .87rem; line-height: 1.45; }
.divider { height: 1px; background: #e8eeea; margin: 22px 0; }
.section-label { color: #81908a; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.muted, .small-text { color: var(--muted); font-size: .82rem; line-height: 1.5; }
details summary { color: var(--green); cursor: pointer; font-size: .82rem; font-weight: 700; }
.document-list { display: grid; gap: 7px; margin: 12px 0 18px; color: var(--muted); font-size: .75rem; }
.secondary-button { width: 100%; margin-top: 22px; padding: 10px 14px; background: #fff; color: var(--green-dark); border: 1px solid var(--line); border-radius: 9px; font-weight: 700; }
.secondary-button:hover { border-color: var(--green); }

.main-column { width: min(760px, calc(100% - 310px)); margin-left: max(290px, calc((100% - 760px + 270px) / 2)); padding: 34px 18px 130px; }
.language-row { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: .82rem; margin-bottom: 12px; }
.switch { position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #ccd8d1; border-radius: 999px; transition: .2s; }
.slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.hero-logo { display: block; width: 190px; max-width: 48%; margin: 4px auto 12px; mix-blend-mode: multiply; }
.hero-card { padding: 22px 26px; text-align: center; background: #fff; border: 1px solid #e6eee9; border-radius: 16px; box-shadow: 0 6px 18px rgba(13,59,44,.05); }
.hero-card h1 { margin: 0 0 8px; color: var(--green-dark); font-size: clamp(1.55rem, 4vw, 1.82rem); line-height: 1.25; }
.hero-card p { margin: 0; color: #52615b; line-height: 1.6; }
.stats { display: flex; max-width: 410px; margin: 14px auto 18px; background: var(--green-soft); border: 1px solid var(--line); border-radius: 12px; }
.stat { flex: 1; display: grid; place-items: center; padding: 13px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat strong { color: var(--green); font-size: 1.4rem; }
.stat span { color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.notice { padding: 13px 16px; background: var(--orange-bg); border: 1px solid var(--orange-line); border-radius: 9px; color: var(--orange-text); text-align: center; font-size: .83rem; line-height: 1.55; }
.privacy-note { margin: 10px auto 24px; color: var(--muted); text-align: center; font-size: .76rem; line-height: 1.45; }
.suggested-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.suggestion { padding: 12px 14px; background: #fff; border: 1px solid #e2e8e4; border-radius: 10px; color: #35443e; text-align: left; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.suggestion:hover { border-color: var(--green); color: var(--green); transform: translateY(-1px); }

.conversation { display: grid; gap: 18px; }
.message { display: grid; grid-template-columns: 34px 1fr; gap: 11px; padding-bottom: 18px; border-bottom: 1px solid #edf2ef; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; background: #697a73; font-size: .72rem; font-weight: 800; }
.message.assistant .avatar { background: var(--green); }
.message-content { min-width: 0; line-height: 1.62; }
.message-content p { margin: 3px 0 10px; }
.message-content ul { margin: 5px 0 10px; padding-left: 20px; }
.citations { display: grid; gap: 7px; margin-top: 11px; }
.citation { padding: 10px 12px; background: #fff; border: 1px solid #e2e8e4; border-left: 3px solid var(--green); border-radius: 7px; }
.citation strong { display: block; color: var(--green); font-size: .78rem; }
.citation span { display: block; margin-top: 3px; color: #56655f; font-size: .77rem; line-height: 1.45; }
.loading-dots::after { content: ""; animation: dots 1.2s steps(4,end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%,100% { content: "..."; } }

.question-form { position: fixed; left: calc(270px + (100vw - 270px - min(760px, calc(100vw - 310px))) / 2); bottom: 28px; width: min(760px, calc(100vw - 310px)); display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 10px; background: rgba(255,255,255,.96); border: 1px solid #d7e4db; border-radius: 13px; box-shadow: 0 8px 26px rgba(13,59,44,.12); backdrop-filter: blur(8px); z-index: 10; }
.question-form textarea { width: 100%; min-height: 44px; max-height: 130px; resize: none; padding: 11px 12px; border: 0; outline: 0; color: var(--text); background: transparent; line-height: 1.4; }
.question-form button { align-self: end; min-width: 76px; height: 42px; border: 0; border-radius: 9px; background: var(--green); color: #fff; font-weight: 800; }
.question-form button:disabled { opacity: .55; cursor: wait; }
.request-status { position: fixed; bottom: 5px; left: 270px; right: 0; margin: 0; text-align: center; color: var(--muted); font-size: .7rem; }
.menu-button { display: none; }
.overlay { display: none; }
.overlay[hidden] { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .menu-button { display: block; position: fixed; top: 12px; left: 12px; z-index: 31; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--green-dark); font-weight: 700; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 8px 0 30px rgba(0,0,0,.12); }
  .sidebar.open { transform: translateX(0); }
  .overlay { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(13,30,23,.32); }
  .main-column { width: 100%; margin: 0; padding: 56px 14px 128px; }
  .question-form { left: 12px; right: 12px; bottom: 24px; width: auto; }
  .request-status { left: 0; }
}

@media (max-width: 560px) {
  .suggested-grid { grid-template-columns: 1fr; }
  .hero-card { padding: 19px 16px; }
  .question-form button { min-width: 64px; }
}
