@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-0: #09090b;
  --bg-1: #0f0f12;
  --bg-2: #18181b;
  --bg-3: #1e1e23;
  --bg-4: #27272a;
  --bg-5: #3f3f46;

  --surface: rgba(255,255,255,0.03);
  --surface-hover: rgba(255,255,255,0.06);
  --surface-active: rgba(255,255,255,0.08);

  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --border-focus: rgba(99,102,241,0.5);

  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dim: rgba(99,102,241,0.15);
  --accent-glow: rgba(99,102,241,0.25);

  --green: #22c55e;
  --green-dim: rgba(34,197,94,0.12);
  --amber: #f59e0b;
  --amber-dim: rgba(245,158,11,0.12);
  --red: #ef4444;
  --red-dim: rgba(239,68,68,0.12);
  --cyan: #06b6d4;
  --cyan-dim: rgba(6,182,212,0.12);
  --purple: #a855f7;
  --purple-dim: rgba(168,85,247,0.12);

  --text-0: #fafafa;
  --text-1: #e4e4e7;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --text-4: #52525b;

  --sidebar-w: 230px;
  --topbar-h: 52px;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --blur: blur(16px);
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg-0);
  color: var(--text-1);
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* ── Layout ────────────────────────────────── */

.os-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100dvh;
}

/* ── Sidebar ───────────────────────────────── */

.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
  color: white;
  letter-spacing: -0.5px;
  box-shadow: 0 0 20px var(--accent-glow);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-0);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.logo-sub {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-xs);
  margin-left: auto;
  transition: var(--transition);
  font-size: 16px;
}
.sidebar-close:hover { color: var(--text-1); background: var(--surface-hover); }

/* Navigation */

.nav {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-section {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  margin-bottom: 1px;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-1);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent-light);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.5;
}

.nav-item:hover .nav-icon { opacity: 0.8; }
.nav-item.active .nav-icon { opacity: 1; }

/* Sidebar footer */

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.version {
  font-size: 10px;
  color: var(--text-4);
  font-family: 'JetBrains Mono', monospace;
  margin-left: auto;
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
}

/* ── Main ──────────────────────────────────── */

.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-0);
}

/* Topbar */

.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(9,9,11,0.85);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  z-index: 50;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}
.hamburger:hover { color: var(--text-1); background: var(--surface-hover); }
.hamburger svg { width: 18px; height: 18px; }

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-0);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ws-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-3);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 500;
}

.ws-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  transition: background var(--transition);
}

.ws-badge.disconnected .dot { background: var(--red); }
.ws-badge.reconnecting .dot { background: var(--amber); animation: pulse 1.5s infinite; }
.ws-badge.disconnected { border-color: var(--red-dim); }
.ws-badge.reconnecting { border-color: var(--amber-dim); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ── Content ───────────────────────────────── */

.content {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.content::-webkit-scrollbar-thumb:hover { background: var(--bg-5); }

.panel { display: none; }
.panel.active { display: block; animation: fadeIn 200ms ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ── Stats ─────────────────────────────────── */

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.stat-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-sm); }

.stat-label {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.2;
}

.stat-value.accent { color: var(--accent-light); }
.stat-value.green { color: var(--green); }
.stat-value.amber { color: var(--amber); }
.stat-value.purple { color: var(--purple); }
.stat-value.cyan { color: var(--cyan); }

/* ── Cards ─────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color var(--transition);
}

.card:hover { border-color: var(--border-hover); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Tables ────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-3);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:hover td { background: var(--surface); }
tr:last-child td { border-bottom: none; }

/* ── Buttons ───────────────────────────────── */

.btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-1);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn:hover { border-color: var(--border-hover); background: var(--surface-hover); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: white;
  font-weight: 600;
}

.btn-primary:hover { background: var(--accent-light); border-color: transparent; box-shadow: 0 0 20px var(--accent-glow); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}

.btn-ghost:hover { background: var(--surface-hover); color: var(--text-1); }

.btn-danger {
  border-color: var(--red-dim);
  color: var(--red);
}

.btn-danger:hover { background: var(--red-dim); border-color: var(--red); }

.btn-sm { padding: 5px 10px; font-size: 12px; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ── Inputs ────────────────────────────────── */

.input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-1);
  font-family: inherit;
  font-size: 13px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.input::placeholder { color: var(--text-4); }

.input-sm { padding: 6px 10px; font-size: 12px; }

.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar .input { max-width: 280px; flex: 1; }

/* ── Badges ────────────────────────────────── */

.badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge.ok { background: var(--green-dim); color: var(--green); }
.badge.off { background: var(--red-dim); color: var(--red); }
.badge.warn { background: var(--amber-dim); color: var(--amber); }
.badge.info { background: var(--cyan-dim); color: var(--cyan); }
.badge.purple { background: var(--purple-dim); color: var(--purple); }

/* ── Provider List ─────────────────────────── */

.provider-list { display: flex; flex-direction: column; gap: 4px; }

.provider-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: background var(--transition);
}

.provider-row:hover { background: var(--bg-3); }

.provider-name {
  font-weight: 500;
  color: var(--text-1);
}

.provider-model {
  font-size: 11px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}

/* ── Agent Grid ────────────────────────────── */

.agent-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.agent-card {
  text-align: center;
  padding: 20px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.agent-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.agent-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 20px;
}

.agent-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text-0);
}

.agent-role {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}

.agent-status {
  margin-top: 10px;
}

/* ── Chat ──────────────────────────────────── */

.chat-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 12px;
  height: calc(100dvh - var(--topbar-h) - 40px);
}

.chat-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-sidebar-header {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.chat-sidebar-header .input { flex: 1; }

.chat-sessions {
  flex: 1;
  overflow: auto;
  padding: 6px;
}

.chat-sessions::-webkit-scrollbar { width: 4px; }
.chat-sessions::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.session-item {
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  transition: var(--transition);
  margin-bottom: 2px;
}

.session-item:hover { background: var(--surface-hover); color: var(--text-1); }
.session-item.active { background: var(--accent-dim); color: var(--accent-light); }

.session-title { font-weight: 500; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-meta { font-size: 11px; color: var(--text-4); }

.chat-main {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
  animation: msgIn 200ms ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.msg.assistant {
  align-self: flex-start;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg-route {
  font-size: 10px;
  color: var(--text-4);
  margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 6px;
  background: var(--bg-1);
  border-radius: var(--radius-xs);
  display: inline-block;
}

.msg-time {
  font-size: 10px;
  color: var(--text-4);
  margin-top: 6px;
  opacity: 0.7;
}

/* Markdown in messages */

.msg h1, .msg h2, .msg h3 { margin: 10px 0 6px; font-weight: 600; }
.msg h1 { font-size: 16px; }
.msg h2 { font-size: 15px; }
.msg h3 { font-size: 14px; }
.msg p { margin: 4px 0; }
.msg ul, .msg ol { margin: 6px 0; padding-left: 20px; }
.msg li { margin: 2px 0; }

.msg code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.08);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--accent-light);
}

.msg pre {
  margin: 8px 0;
  padding: 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
}

.msg pre code { background: none; padding: 0; color: var(--text-1); }

.msg blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 8px 0;
  color: var(--text-2);
}

.msg strong { color: var(--text-0); font-weight: 600; }
.msg a { color: var(--accent-light); text-decoration: none; }
.msg a:hover { text-decoration: underline; }

/* Typing indicator */

.typing-indicator {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
}

.typing-indicator.visible { display: flex; }

.typing-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Approval bar */

.approval-bar {
  display: none;
  gap: 12px;
  padding: 10px 16px;
  background: var(--amber-dim);
  border-top: 1px solid rgba(245,158,11,0.2);
  align-items: center;
  justify-content: space-between;
}

.approval-bar.visible { display: flex; }

.approval-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--amber);
  font-weight: 500;
}

.approval-actions { display: flex; gap: 8px; }

/* Chat input */

.chat-input-row {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--border);
  align-items: flex-end;
}

.chat-input-wrap { flex: 1; position: relative; }

.chat-textarea {
  resize: none;
  min-height: 40px;
  max-height: 120px;
  padding-right: 12px;
  line-height: 1.4;
}

.input-hint {
  position: absolute;
  right: 12px;
  bottom: 8px;
  font-size: 10px;
  color: var(--text-4);
  pointer-events: none;
}

/* ── Empty States ──────────────────────────── */

.empty-state {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-3);
}

.empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
}

.empty-desc {
  font-size: 13px;
  color: var(--text-3);
}

/* ── Skeleton Loading ──────────────────────── */

.skeleton .skeleton-line,
.skeleton-row {
  height: 12px;
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton .skeleton-line + .skeleton-line { margin-top: 8px; }
.skeleton-row { margin-bottom: 8px; }
.w60 { width: 60%; }
.w40 { width: 40%; }

@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Toast Notifications ───────────────────── */

.toast-container {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--text-1);
  pointer-events: auto;
  animation: toastIn 200ms ease;
  max-width: 340px;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--accent); }
.toast.warning { border-left: 3px solid var(--amber); }

.toast.leaving { animation: toastOut 200ms ease forwards; }

@keyframes toastIn { from{opacity:0;transform:translateX(16px)} to{opacity:1;transform:none} }
@keyframes toastOut { to{opacity:0;transform:translateX(16px)} }

/* ── Settings ──────────────────────────────── */

.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.setting-row:last-child { border-bottom: none; }

.setting-label {
  font-size: 13px;
  color: var(--text-2);
  min-width: 80px;
  font-weight: 500;
}

.setting-value {
  font-size: 12px;
  color: var(--text-3);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.code-block {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.6;
}

.code-block pre {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-2);
}

.shortcuts-list { display: flex; flex-direction: column; gap: 6px; }

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-2);
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-3);
}

/* ── Mobile Overlay ────────────────────────── */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
  backdrop-filter: blur(4px);
}

.sidebar-overlay.visible { display: block; }

/* ── Mobile Chat Sidebar Toggle ────────────── */

.chat-sidebar-toggle {
  display: none;
  padding: 8px;
  margin-bottom: 8px;
}

/* ── Responsive ────────────────────────────── */

@media (max-width: 900px) {
  .os-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    z-index: 100;
  }

  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .hamburger { display: flex; }

  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .agent-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }

  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .chat-sidebar.mobile-visible {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 80;
    border-radius: 0;
    background: var(--bg-1);
  }
  .chat-sidebar-toggle { display: block; }

  .topbar { padding: 0 12px; }
  .content { padding: 12px; }
  .ws-badge .label { display: none; }
}

@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 22px; }
  .agent-grid { grid-template-columns: 1fr; }
  .msg { max-width: 95%; }
}

/* ── Accessibility ─────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
