:root {
  color-scheme: light;
  --bg: #f4f3ee; --surface: #fff; --surface-2: #f8f7f3; --surface-3: #efede6; --line: #e4e1d8;
  --ink: #1b1d19; --ink-2: #545750; --ink-3: #7b7e76;
  --brand: #2d4a39; --brand-2: #3c614b; --brand-soft: #e5ece6; --accent: #a87822; --accent-soft: #f6ecd6;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111411; --surface: #1a1d1a; --surface-2: #1f231f; --surface-3: #272b27; --line: #2e332e;
    --ink: #eeeee8; --ink-2: #b7bab0; --ink-3: #8f9389;
    --brand: #4e7d61; --brand-2: #5d8f71; --brand-soft: #223027; --accent: #d4a24a; --accent-soft: #3a3020;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.banner { background: var(--accent-soft); color: var(--ink-2); font-size: 13px; padding: 8px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.top { background: var(--surface); border-bottom: 1px solid var(--line); padding: 20px 0 22px; }
.back { color: var(--ink-3); text-decoration: none; font-size: 13px; }
.back:hover { color: var(--brand); }
h1 { font-size: 24px; letter-spacing: -.01em; margin: 6px 0; }
.lead { color: var(--ink-2); margin: 0; max-width: 800px; }
h2 { font-size: 14px; margin: 0 0 10px; }
a { color: var(--brand); }
.grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; padding-top: 20px; padding-bottom: 40px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.side { display: grid; gap: 14px; }
.chat { padding: 0; display: flex; flex-direction: column; height: min(680px, calc(100vh - 140px)); min-height: 480px; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head small { display: block; color: var(--ink-3); font-size: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.mode { margin-left: auto; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.mode.ia { background: var(--brand-soft); color: var(--brand); }
.mode.demo { background: var(--accent-soft); color: var(--accent); }
.messages { list-style: none; margin: 0; padding: 16px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; white-space: pre-wrap; }
.msg.bot { background: var(--surface-3); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.user { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.msg .src { display: block; margin-top: 6px; font-size: 11.5px; color: var(--ink-3); }
.msg .tag { display: inline-block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--accent); margin-bottom: 2px; }
.typing span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--ink-3); animation: b 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes b { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.suggestions { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.suggestions button { font: inherit; font-size: 13px; white-space: nowrap; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.suggestions button:hover { border-color: var(--brand); color: var(--brand); }
.composer { display: flex; gap: 8px; padding: 12px 16px 6px; border-top: 1px solid var(--line); }
.composer input { flex: 1; min-width: 0; font: inherit; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); padding: 0 14px; outline: none; }
.composer input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.send { width: 44px; height: 44px; border-radius: 12px; border: none; background: var(--brand); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.send:disabled { opacity: .5; cursor: default; }
.fine { margin: 0; padding: 0 16px 12px; font-size: 11.5px; color: var(--ink-3); }
.steps, .plain { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.steps li, .plain li { margin-bottom: 6px; }
.toggle { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.toggle input { accent-color: var(--brand); width: 16px; height: 16px; }
.doc summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.doc-body { margin-top: 10px; max-height: 420px; overflow: auto; font-size: 13px; color: var(--ink-2); }
.doc-body h3 { font-size: 13.5px; color: var(--ink); margin: 12px 0 4px; }
.doc-body p { margin: 0 0 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } .chat { height: 70vh; } h1 { font-size: 20px; } }
