:root{--bg:#f8fafc;--panel:#fff;--bot:#f1f5f9;--user:#2563eb;--text:#0f172a;--muted:#475569;--accent:#22c55e;--warn:#b45309;--error:#b91c1c}
.dark:root{--bg:#0f172a;--panel:#111827;--bot:#1f2937;--user:#2563eb;--text:#e5e7eb;--muted:#9ca3af;--accent:#22c55e;--warn:#f59e0b;--error:#ef4444}
html,body{height:100%}body{margin:0;background:var(--bg);color:var(--text);font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,"Helvetica Neue",Arial,sans-serif}
.chat{width:min(920px,100%);min-height:420px;background:var(--panel);border-radius:14px;box-shadow:0 10px 30px rgba(0,0,0,.35);display:flex;flex-direction:column;overflow:hidden;margin-inline:auto}
.aiact-chat{min-height:600px}.stream{flex:1;overflow:auto;padding:18px;scroll-behavior:smooth;background:linear-gradient(180deg,rgba(0,0,0,.02),rgba(0,0,0,.04));max-height:min(86vh,780px)}
.row{display:flex;margin:10px 0;gap:10px}.row.bot{justify-content:flex-start}.row.user{justify-content:flex-end}.bubble{max-width:70%;padding:10px 14px;border-radius:12px;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--text)}
.bot .bubble{background:var(--bot)}.user .bubble{background:var(--user);color:#fff}.muted{color:var(--muted);font-size:.92em}.error{color:var(--error)}.warn{color:var(--warn)}
.typing{display:inline-block;min-width:42px}.dot{width:6px;height:6px;margin:0 2px;display:inline-block;border-radius:50%;background:#9ca3af;opacity:.6;animation:bounce 1.1s infinite ease-in-out}.dot:nth-child(2){animation-delay:.15s}.dot:nth-child(3){animation-delay:.3s}@keyframes bounce{0%,80%,100%{transform:scale(0)}40%{transform:scale(1)}}
.inputbar{display:flex;gap:10px;padding:12px;background:rgba(0,0,0,.03);border-top:1px solid rgba(15,23,42,.08)}.dark .inputbar{background:rgba(0,0,0,.35);border-color:rgba(255,255,255,.05)}
.text{flex:1;background:#fff;color:var(--text);border:1px solid #e2e8f0;border-radius:10px;padding:12px 14px;outline:none}.dark .text{background:#0b1020;border-color:#2a3550}
.btn{background:var(--accent);color:#052e16;border:0;border-radius:10px;padding:12px 16px;font-weight:600;cursor:pointer}.btn[disabled]{opacity:.6;cursor:not-allowed}.toolbar{display:flex;gap:8px;align-items:center;margin-top:6px}
.choice-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:8px;margin-top:12px}.choice-option{min-width:0}.choice-btn{width:100%;padding:10px 12px;border:1px solid #cbd5e1;border-radius:9px;background:var(--panel);color:var(--text);cursor:pointer;text-align:left;line-height:1.3}.choice-btn:hover{border-color:#22c55e}.choice-btn.selected{background:#dcfce7;border-color:#16a34a;color:#14532d;box-shadow:0 0 0 2px rgba(34,197,94,.18)}.choice-btn[disabled]{cursor:default;opacity:.75}.option-help{margin:5px 3px 0;color:var(--muted);font-size:.82rem}.option-help summary{color:#2563eb;cursor:pointer}.option-help p{margin:5px 0 8px;line-height:1.4}
.choice-continue{margin-top:12px}.question-actions{display:flex;gap:8px;align-items:center}.choice-back{margin-top:12px;padding:10px 12px;border:0;background:transparent;color:var(--muted);text-decoration:underline;cursor:pointer}.question-labels{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-bottom:6px}.question-id,.multi-badge{display:inline-block;padding:2px 7px;border-radius:999px;font-size:.75rem;font-weight:700}.question-id{background:#dbeafe;color:#1e40af}.multi-badge{background:#dcfce7;color:#166534}.question-source{margin-top:10px;color:var(--muted);font-size:.78rem}.question-source a,.question-hint a{color:#2563eb;text-decoration:underline}.dark .question-source a,.dark .question-hint a{color:#93c5fd}.question-hint{margin-top:9px;padding:8px 10px;border-left:3px solid #94a3b8;color:var(--muted);font-size:.9rem}.question-hint p{margin:0 0 8px}.question-hint p:last-child{margin-bottom:0}.question-hint ul{margin:6px 0 10px;padding-left:20px}.question-hint li{margin:3px 0}
.assessment-result{min-width:min(520px,65vw)}.result-heading{margin:12px 0 5px;font-size:.8rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}.result-tag{display:inline-block;margin:2px 5px 2px 0;padding:4px 9px;border-radius:999px;background:#fef3c7;color:#92400e;font-size:.86rem;font-weight:650}.assessment-result ul{margin:5px 0 0;padding-left:20px}
.dark .choice-btn{background:#0c1224;border-color:#334155}.dark .choice-btn.selected{background:#14532d;color:#dcfce7;border-color:#22c55e}.dark .question-id{background:#1e3a8a;color:#dbeafe}.dark .multi-badge{background:#14532d;color:#dcfce7}.dark .result-tag{background:#78350f;color:#fef3c7}
@media (max-width:640px){.bubble{max-width:88%}.choice-grid{grid-template-columns:1fr}.assessment-result{min-width:0}.toolbar{align-items:stretch;flex-direction:column}}
