
:root { --bg:#0b1220; --panel:#0f172a; --muted:#1f2a44; --text:#d1e5ff; --text-dim:#9fb9e6; --accent:#38bdf8; }
* { box-sizing:border-box; }
html,body { margin:0; padding:0; font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif; color:var(--text); background:var(--bg); }
.topbar { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid var(--muted); background:var(--panel); position:sticky; top:0; z-index:5; }
.brand { display:flex; gap:12px; align-items:center; }
.logo { width:44px; height:44px; border-radius:10px; background:#fff; object-fit:contain; }
.titles h1 { margin:0; font-size:18px; } .subtitle { margin:0; color:var(--text-dim); font-size:12px; }
.actions button { margin-left:8px; }
.banner { margin:12px 16px; padding:10px; border:1px solid #d97706; background:#78350f; color:#fff; border-radius:8px; }
.toolbar { display:grid; grid-template-columns:repeat(3, 200px); gap:16px; padding:16px; }
.control label { display:block; font-size:12px; color:var(--text-dim); margin-bottom:6px; }
.control select { width:100%; padding:10px; border-radius:8px; border:1px solid var(--muted); background:var(--panel); color:var(--text); }

.grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; padding:0 16px 16px; }
.card { background:var(--panel); border:1px solid var(--muted); border-radius:12px; padding:12px; }
.card.wide { grid-column:1 / span 2; }
canvas { width:100% !important; height:240px !important; }
table { width:100%; border-collapse:collapse; } th,td { text-align:left; padding:8px; border-bottom:1px solid var(--muted); }
.footer { padding:20px 16px; color:var(--text-dim); }
button { background: var(--accent); color:#082032; border:none; border-radius:8px; padding:10px 12px; font-weight:600; cursor:pointer; }
button:hover { filter:brightness(1.05); }
a { color: var(--accent); }

/* Chat at top */
.chat-top { margin: 0 16px 16px; }
.chat-body { background:#0c1526; border:1px solid var(--muted); border-radius:8px; padding:10px; height:180px; overflow:auto; margin-bottom:8px; }
.chat-input { display:grid; grid-template-columns:1fr auto; gap:8px; }
.msg { margin:6px 0; white-space:pre-wrap; }
.msg.user { color:#e5f2ff; }
.msg.assistant { color:#b8d4ff; }
.chat-status { margin-top:6px; color:var(--text-dim); font-size:12px; }
.scope { margin-bottom:8px; color:#9fb9e6; font-size:12px; }


/* Chat bubbles */
.bubble { max-width: 80%; padding: 10px 12px; border-radius: 12px; margin: 6px 0; line-height: 1.45; word-wrap: break-word; }
.bubble.user { margin-left: auto; background: #1e293b; color: #e5f2ff; border: 1px solid #334155; }
.bubble.assistant { margin-right: auto; background: #0b1220; color: #cfe0ff; border: 1px solid #1f2a44; }
