:root { color-scheme: light dark; --bg:#f4f6f9; --panel:#fff; --text:#131722; --muted:#6b7280; --accent:#2563eb; --bot:#eceff3; --line:#e4e7ec; --err:#b91c1c; --good:#059669; }
@media (prefers-color-scheme: dark) { :root { --bg:#0f1115; --panel:#181b21; --text:#e8eaed; --muted:#96a0ae; --bot:#262a31; --line:#2a2e36; --err:#f87171; --good:#34d399; } }
* { box-sizing: border-box; }
body { margin:0; font:15px/1.55 system-ui,-apple-system,Segoe UI,sans-serif; background:var(--bg); color:var(--text); }
a { color:var(--accent); text-decoration:none; }

.topbar { display:flex; align-items:center; justify-content:space-between; padding:14px 28px; border-bottom:1px solid var(--line); background:var(--panel); }
.brand { display:flex; align-items:center; gap:10px; font-weight:700; font-size:16px; }
.brand-mark { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:8px; background:var(--accent); color:#fff; font-size:12px; font-weight:800; }
.brand-sub { font-weight:500; color:var(--muted); margin-left:2px; }
.topbar-right { display:flex; align-items:center; gap:14px; font-size:13.5px; color:var(--muted); }
.badge { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:var(--good); background:color-mix(in srgb, var(--good) 12%, transparent); border-radius:999px; padding:4px 10px; }

.center { min-height:100vh; display:flex; align-items:center; justify-content:center; }
.card.login-card { display:grid; gap:14px; width:340px; background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:28px; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.card.login-card h1 { font-size:18px; margin:0 0 4px; }
form.card { display:grid; gap:12px; }
label { display:grid; gap:4px; font-size:13px; color:var(--muted); }
input, textarea { font:inherit; color:var(--text); background:var(--bg); border:1px solid var(--line); border-radius:9px; padding:10px 12px; width:100%; }
input:focus, textarea:focus { outline:2px solid var(--accent); outline-offset:1px; }
button { font:inherit; cursor:pointer; border-radius:9px; border:1px solid var(--accent); background:var(--accent); color:#fff; padding:10px 18px; font-weight:600; }
button:disabled { opacity:.5; cursor:default; }
.error { color:var(--err); font-size:13.5px; }

.page { max-width:1180px; margin:0 auto; padding:36px 28px 60px; }
.page-head { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:28px; flex-wrap:wrap; }
.eyebrow { font-size:12px; font-weight:700; letter-spacing:.06em; color:var(--accent); text-transform:uppercase; margin:0 0 6px; }
.page-head h1 { font-size:28px; margin:0 0 8px; }
.lede { color:var(--muted); margin:0; max-width:560px; }
.count { text-align:center; font-size:30px; font-weight:800; color:var(--accent); line-height:1; }
.count span { display:block; font-size:11px; font-weight:600; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); margin-top:6px; }

.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(250px,1fr)); gap:16px; }
.card { background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:20px; transition:box-shadow .15s, transform .15s; }
.card.agent { display:flex; flex-direction:column; gap:4px; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.card.agent:hover { box-shadow:0 6px 20px rgba(0,0,0,.08); transform:translateY(-1px); }
.avatar { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:14px; margin-bottom:10px; }
.category { font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); margin:0; }
.card.agent h2 { font-size:16px; margin:2px 0 4px; }
.card.agent .desc { color:var(--muted); font-size:13.5px; margin:0 0 14px; flex:1; }
.open { font-size:13.5px; font-weight:600; color:var(--accent); }

.chat-head { display:flex; align-items:center; gap:12px; padding:14px 28px; }
.chat-head .avatar { margin:0; width:34px; height:34px; font-size:12px; }
.log { max-width:760px; margin:0 auto; padding:20px 28px; display:flex; flex-direction:column; gap:12px; min-height:60vh; }
.hint { color:var(--muted); text-align:center; margin-top:80px; }
.msg { max-width:85%; padding:10px 14px; border-radius:14px; white-space:pre-wrap; word-wrap:break-word; }
.msg.me { align-self:flex-end; background:var(--accent); color:#fff; }
.msg.bot { align-self:flex-start; background:var(--bot); }
.msg.bot.err { color:var(--err); }
.composer { display:flex; gap:10px; max-width:760px; margin:0 auto; padding:0 28px 24px; }
.composer textarea { resize:none; max-height:140px; }
