.demo-title { margin-top: 18px; }
.lab { padding: 20px 0 60px; }
.rag-grid { display: grid; grid-template-columns: 280px 1fr 320px; gap: 18px; align-items: stretch; }
@media (max-width: 1180px) { .rag-grid { grid-template-columns: 260px 1fr; } .hood-panel { grid-column: 1 / -1; } }
@media (max-width: 760px) { .rag-grid { grid-template-columns: minmax(0, 1fr); } }

.panel { border-radius: var(--radius-lg); border: 1px solid var(--border-strong); background: rgba(11, 15, 25, .85); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .95rem; margin-bottom: 14px; }
.panel-head svg { width: 18px; color: var(--violet); }

/* Docs */
.kb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.kb-stats div { text-align: center; padding: 8px 4px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px solid var(--border); }
.kb-stats strong { display: block; font-family: var(--font-display); font-size: 1.15rem; background: var(--grad-ai); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kb-stats span { font-size: .68rem; color: var(--muted); }
.doc-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.doc { display: flex; align-items: center; gap: 6px; padding: 10px; border-radius: 12px; background: var(--violet-soft); border: 1px solid rgba(167,139,250,.2); transition: opacity .2s, background .2s; }
.doc.uploaded { background: var(--cyan-soft); border-color: rgba(34,211,238,.25); }
.doc.off { opacity: .45; background: rgba(255,255,255,.02); }
.doc label { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: 1; min-width: 0; }
.doc input { accent-color: var(--violet); }
.doc label > svg { width: 18px; flex: 0 0 18px; color: var(--violet); }
.doc span { min-width: 0; }
.doc b { display: block; font-size: .78rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc small { font-size: .68rem; color: var(--muted); }
.doc-del { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 6px; }
.doc-del:hover { color: var(--rose); background: var(--rose-soft); }
.doc-del svg { width: 14px; height: 14px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 20px 12px; border-radius: 14px; border: 1.5px dashed rgba(167,139,250,.4); cursor: pointer; font-size: .8rem; color: var(--muted); transition: border-color .2s, background .2s; }
.dropzone svg { width: 28px; height: 28px; color: var(--violet); }
.dropzone b { color: var(--text); }
.dropzone:hover, .dropzone.over { border-color: var(--cyan); background: var(--cyan-soft); }
.upload-status { font-size: .78rem; margin: 10px 0 0; min-height: 1em; }

/* Chat */
.chat-panel { padding: 0; min-height: 620px; overflow: hidden; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.agent-id { display: flex; align-items: center; gap: 10px; }
.agent-id small { display: flex; align-items: center; gap: 6px; font-size: .72rem; color: var(--muted); }
.agent-av { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-ai); color: #0b0f19; }
.agent-av svg { width: 20px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; display: inline-block; }
.chat { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; max-height: 520px; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 16px; font-size: .92rem; line-height: 1.55; animation: fadeUp .3s var(--ease); }
.msg p { margin: 0 0 6px; color: inherit; }
.msg p:last-child { margin-bottom: 0; }
.msg .small { font-size: .82rem; color: var(--muted); }
.msg .small.ok { color: var(--green); margin-top: 8px; }
.msg.user { align-self: flex-end; background: var(--surface-3); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: linear-gradient(135deg, rgba(167,139,250,.12), rgba(34,211,238,.06)); border: 1px solid rgba(167,139,250,.22); border-bottom-left-radius: 4px; }
.cite { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 6px; font-size: .66rem; font-weight: 700; background: var(--cyan-soft); color: var(--cyan); cursor: pointer; vertical-align: super; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.src { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-family: var(--font-mono); padding: 5px 9px; border-radius: 8px; background: rgba(0,0,0,.25); border: 1px solid rgba(34,211,238,.25); color: var(--cyan); cursor: pointer; transition: background .2s; }
.src:hover { background: var(--cyan-soft); }
.src b { width: 16px; height: 16px; display: grid; place-items: center; border-radius: 4px; background: var(--cyan); color: #04202a; font-size: .64rem; }
.conf { font-size: .72rem; color: var(--dim); margin-top: 8px; }
.conf b { color: var(--green); }
.bot-actions { margin-top: 8px; }
.bot-actions .chip { cursor: pointer; }
.bot-actions .chip:hover { color: var(--text); border-color: var(--border-strong); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.suggestions { display: flex; gap: 8px; overflow-x: auto; padding: 0 18px 12px; scrollbar-width: none; }
.suggestions::-webkit-scrollbar { display: none; }
.sugg { flex: 0 0 auto; font-size: .78rem; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--border-strong); color: var(--muted); cursor: pointer; transition: .2s; }
.sugg:hover { color: var(--text); border-color: var(--violet); background: var(--violet-soft); }
.sugg.trap { border-style: dashed; border-color: rgba(251,113,133,.4); }
.sugg.trap::before { content: "🧪 "; }
.chat-input { display: flex; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); }
.chat-input .btn { padding: 10px 14px; }

/* Hood */
.pipeline { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.pipeline li { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255,255,255,.02); transition: border-color .3s, background .3s; }
.pipeline .pi { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.04); color: var(--dim); transition: .3s; }
.pipeline .pi svg { width: 16px; }
.pipeline b { display: block; font-size: .82rem; }
.pipeline small { font-size: .7rem; color: var(--muted); font-family: var(--font-mono); }
.pipeline li.active { border-color: var(--violet); background: var(--violet-soft); }
.pipeline li.active .pi { background: var(--violet); color: #0b0f19; animation: pulse 1s infinite; }
.pipeline li.done .pi { background: var(--green-soft); color: var(--green); }
.hood-sub { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); margin-bottom: 8px; }
.retrieved { display: grid; gap: 10px; max-height: 360px; overflow-y: auto; }
@media (max-width: 1180px) { .retrieved { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); max-height: none; } }
.frag { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.025); border: 1px solid var(--border); animation: fadeUp .35s var(--ease); }
.frag.pulse { animation: fragPulse 1.4s var(--ease); }
@keyframes fragPulse { 0%, 40% { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); } 100% { border-color: var(--border); box-shadow: none; } }
.frag-top { display: flex; align-items: center; gap: 8px; font-size: .72rem; }
.frag-n { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 5px; background: var(--cyan); color: #04202a; font-weight: 700; font-size: .66rem; }
.frag-src { font-family: var(--font-mono); color: var(--cyan); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frag-score { font-family: var(--font-mono); color: var(--muted); }
.frag-bar { height: 4px; border-radius: 4px; background: var(--surface-3); margin: 8px 0; overflow: hidden; }
.frag-bar i { display: block; height: 100%; background: var(--grad-ai); border-radius: 4px; transition: width .6s var(--ease); }
.frag p { font-size: .8rem; line-height: 1.5; margin: 0 0 6px; color: #c3cbe0; }
.frag mark { background: rgba(251,191,36,.25); color: var(--accent); border-radius: 3px; padding: 0 2px; }
.frag small { font-size: .68rem; color: var(--dim); }
.muted-sm { color: var(--dim); font-size: .85rem; margin: 0; }

/* Architecture */
.compare-section { padding-top: 20px; }
.arch h3 { display: flex; align-items: center; gap: 10px; }
.arch h3 svg { color: var(--violet); }
.arch-flow { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.arch-step { flex: 1 1 130px; display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--border); }
.arch-step svg { width: 22px; color: var(--cyan); margin-bottom: 4px; }
.arch-step b { font-size: .88rem; }
.arch-step small { font-size: .74rem; color: var(--muted); }
.arch-step.hl { background: var(--violet-soft); border-color: rgba(167,139,250,.35); }
.arch-step.hl svg { color: var(--violet); }
.arch-arrow { align-self: center; width: 18px; color: var(--dim); }
@media (max-width: 860px) { .arch-arrow { display: none; } }
.end-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 40px; }
.demo-notice svg { flex: 0 0 18px; width: 18px; color: var(--violet); }
