:root {
  color-scheme: dark;
  --bg: #070712;
  --panel: rgba(19, 20, 34, 0.86);
  --panel-strong: #17182a;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f8fafc;
  --muted: #a7adbd;
  --soft: #d7dbec;
  --accent: #7c5cff;
  --accent-2: #2dd4bf;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(124, 92, 255, 0.28), transparent 32rem),
    radial-gradient(circle at 82% 18%, rgba(45, 212, 191, 0.18), transparent 28rem),
    linear-gradient(135deg, #070712 0%, #10111f 52%, #090a13 100%);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { opacity: 0.62; cursor: wait; }

.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 24px 18px;
  border-right: 1px solid var(--line); background: rgba(7, 7, 18, 0.72); backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.logo { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 15px; background: linear-gradient(135deg, var(--accent), #b06cff); box-shadow: 0 16px 50px rgba(124, 92, 255, 0.34); font-weight: 850; }
.brand strong { display: block; letter-spacing: -0.03em; }
.brand span { color: var(--muted); font-size: 0.86rem; }
.nav { display: grid; gap: 8px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 16px; color: var(--muted); }
.nav a.active, .nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.075); }
.status-card { position: absolute; left: 18px; right: 18px; bottom: 22px; padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 255, 255, 0.055); }
.status-card b { display: block; margin-bottom: 4px; }
.status-card small { color: var(--muted); line-height: 1.5; }
.main { min-width: 0; padding: 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.eyebrow { color: var(--accent-2); font-size: 0.78rem; font-weight: 750; letter-spacing: 0.14em; text-transform: uppercase; }
h1 { margin: 4px 0 0; font-size: clamp(2rem, 4vw, 3.8rem); line-height: 0.95; letter-spacing: -0.065em; }
.subtitle { max-width: 720px; color: var(--muted); line-height: 1.6; }
.avatar-stack { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.055); color: var(--soft); }
.dot { width: 10px; height: 10px; border-radius: 999px; background: #22c55e; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { border: 1px solid var(--line); border-radius: 28px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.card-pad { padding: 22px; }
.card h2, .card h3 { margin: 0; letter-spacing: -0.04em; }
.card h2 { font-size: 1.35rem; }
.card h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.055); color: var(--soft); font-size: 0.9rem; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: 15px; color: white; background: linear-gradient(135deg, var(--accent), #a855f7); font-weight: 800; box-shadow: 0 16px 48px rgba(124, 92, 255, 0.28); }
.ghost { display: inline-flex; align-items: center; justify-content: center; padding: 12px 16px; border-radius: 15px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--soft); font-weight: 700; }
.chat-window { min-height: 590px; display: grid; grid-template-rows: auto 1fr auto; }
.chat-head { display: flex; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.messages { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.messages.demo { min-height: 430px; max-height: 62vh; overflow-y: auto; scroll-behavior: smooth; }
.bubble { max-width: 78%; padding: 15px 17px; border-radius: 22px; line-height: 1.5; }
.bubble.assistant { align-self: flex-start; background: rgba(255, 255, 255, 0.07); color: var(--soft); border-top-left-radius: 8px; }
.bubble.user { align-self: flex-end; background: linear-gradient(135deg, rgba(124, 92, 255, 0.92), rgba(168, 85, 247, 0.92)); color: white; border-top-right-radius: 8px; }
.composer { display: flex; gap: 12px; padding: 18px; border-top: 1px solid var(--line); }
.composer input::placeholder { color: var(--muted); }
.meta-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.meta-strip span { font-size: 0.82rem; color: var(--muted); }
.tool-pill { display: inline-flex; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(45, 212, 191, 0.09); color: var(--soft) !important; }
.error-text { color: var(--danger); font-size: 0.92rem; margin: 0; }
.composer input, .field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; background: rgba(3, 4, 12, 0.5); color: var(--text); outline: none; }
.composer input:focus, .field input:focus, .field textarea:focus, .field select:focus { border-color: rgba(124, 92, 255, 0.7); box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.14); }
.metric { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.metric:last-child { border-bottom: 0; }
.metric strong { font-size: 1.4rem; }
.memory-list { display: grid; gap: 14px; }
.memory { padding: 17px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 255, 255, 0.055); }
.memory-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.tag { color: #c4b5fd; background: rgba(124, 92, 255, 0.14); border: 1px solid rgba(124, 92, 255, 0.25); border-radius: 999px; padding: 5px 9px; font-size: 0.78rem; font-weight: 800; }
.progress { height: 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.setting-section { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; }
.field label { color: var(--soft); font-weight: 750; }
.toggle { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 16px; border-radius: 20px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.045); }
.switch { width: 48px; height: 28px; border-radius: 999px; padding: 4px; background: rgba(124, 92, 255, 0.9); flex: 0 0 auto; }
.switch::after { content: ""; display: block; width: 20px; height: 20px; margin-left: 20px; border-radius: 999px; background: #fff; }
@media (max-width: 920px) { .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .status-card { position: static; margin-top: 22px; } .grid.two, .grid.three { grid-template-columns: 1fr; } .topbar { align-items: flex-start; flex-direction: column; } }