:root {
  --font-size-offset: 0px;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --bg: #181818;
  --bg-2: #1a1a1a;
  --bg-3: #222;
  --bg-4: #2a2a2a;
  --border: rgba(255,255,255,0.08);
  --border-2: rgba(255,255,255,0.12);
  --text-1: #d4d4d4;
  --text-2: #9a9a9a;
  --text-3: #6b7280;
  --accent: #7eb4f5;
  --accent-2: #5a9ae8;
  --accent-dim: rgba(126,180,245,0.1);
  --success: #34d399;
  --success-dim: rgba(52,211,153,0.1);
  --warn: #fbbf24;
  --warn-dim: rgba(251,191,36,0.1);
  --danger: #ef4444;
  --danger-dim: rgba(239,68,68,0.12);
  --amber: #f59e0b;
  /* Demo artifact colors */
  --sev-high: #ef4444; --sev-high-bg: rgba(239,68,68,0.12);
  --sev-med: #f59e0b;  --sev-med-bg: rgba(245,158,11,0.12);
  --sev-low: #22c55e;  --sev-low-bg: rgba(34,197,94,0.12);
  --accent-bg: rgba(91,141,239,0.1); --accent-text: #5b8def;
  --bg-subtle: rgba(255,255,255,0.03); --bg-dim: rgba(255,255,255,0.05);
  --border-strong: #444; --radius-md: 8px;
  --sidebar-w: 160px;
  --chat-w: 400px;
  --topbar-h: 40px;
  --r: 6px;
}
html, body { margin: 0; padding: 0; width: 100%; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body); font-size: 13px; line-height: 1.5;
  background: #151515; color: var(--text-1);
  width: 100%; height: 100vh; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Light theme ──────────────────────────────── */
[data-theme="light"] {
  --bg: #f8f9fa;
  --bg-2: #ffffff;
  --bg-3: #f0f1f3;
  --bg-4: #e4e6ea;
  --border: #d8dde6;
  --border-2: #c4cbd6;
  --text-1: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --accent-dim: rgba(91,141,239,0.1);
  --warn-dim: rgba(245,158,11,0.12);
  --success-dim: rgba(34,197,94,0.1);
  --danger-dim: rgba(239,68,68,0.1);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

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

/* Tablet landscape / small laptop: sidebar + chat, no preview */
@media (min-width: 769px) and (max-width: 1024px) {
  .ws-preview { display: none !important; }
  #ws-divider-2 { display: none !important; }
  .ws-sidebar { width: 160px !important; min-width: 140px !important; }
}

/* Tablet portrait + mobile: chat only */
@media (max-width: 768px) {
  /* Hide mode-nav and its separator only — all icons stay visible */
  .topbar .full-only { display: none !important; }
  .topbar .hamburger { display: flex !important; }

  /* Chat full width (sidebar/preview hidden via JS layout state) */
  .ws-chat { width: 100% !important; min-width: 0 !important; }

  /* Topbar compact spacing */
  .topbar { padding: 0 8px; gap: 6px; }

  /* Sandwich menu full height and scrollable */
  .sandwich-menu { top: 40px; bottom: 0; overflow-y: auto; }
  .sandwich-backdrop { inset: 0; }
}

/* Small phones */
@media (max-width: 480px) {
  .topbar-logo { font-size: 12px; }
  .topbar-icon { width: 24px; height: 24px; }
  .topbar-icon svg { width: 13px; height: 13px; }

  /* Hide less-important icons on very small screens */
  .export-dropdown-wrapper,
  #theme-toggle { display: none !important; }

  /* Chat messages tighter */
  .chat-msgs { padding: 8px 10px; gap: 8px; }
  .msg-user, .msg-ai { font-size: 12px; }

  /* Input area compact */
  .chat-input-area { padding: 2px 8px 4px; }
}

/* Loading overlay for transitions */
.ws-loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 9999;
}
.ws-loading-overlay.active {
  opacity: 0.6;
  pointer-events: all;
}

/* ── Edge Handles (T-065) ────────────────────── */
.edge-handle {
  position: fixed;
  top: var(--topbar-h, 42px);
  bottom: 22px;
  width: 14px;
  z-index: 9000;
  cursor: pointer;
  display: block;
}
.edge-left { left: 0; }
.edge-right { right: 0; }
.edge-pill {
  position: absolute;
  left: 0;
  width: 5px;
  height: 52px;
  border-radius: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(91,141,239,0.3);
}
.edge-right .edge-pill { left: auto; right: 0; }
.edge-handle:hover .edge-pill { opacity: 0.7; }
.edge-handle:hover { background: linear-gradient(to right, rgba(91,141,239,0.08), transparent); }
.edge-right:hover { background: linear-gradient(to left, rgba(91,141,239,0.08), transparent); }
.edge-tooltip {
  position: absolute;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  color: var(--text-1);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.edge-left .edge-tooltip { left: 14px; }
.edge-right .edge-tooltip { right: 14px; }
.edge-handle:hover .edge-tooltip { opacity: 1; }

/* ── Layout Picker Dropdown (T-065) ─────────── */
.lp-wrap { position: relative; }
.lp-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 270px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
  padding: 5px;
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 9999;
}
.lp-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.lp-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.1s;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-1);
  text-align: left;
}
.lp-option:hover { background: var(--bg-3); }
.lp-option.active { background: rgba(91,141,239,0.12); }
.lp-option.active .lp-label { color: var(--accent); font-weight: 500; }
.lp-icon {
  width: 36px;
  height: 24px;
  flex-shrink: 0;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  display: flex;
  overflow: hidden;
  background: var(--bg);
  gap: 1px;
  padding: 2px;
  align-items: stretch;
}
.lp-icon .b { border-radius: 2px; }
.lp-icon .b-s { background: #3a3a44; width: 7px; flex-shrink: 0; }
.lp-icon .b-c { background: #2a2a38; flex: 1; }
.lp-icon .b-p { background: #3a3a44; width: 10px; flex-shrink: 0; }
.lp-label { flex: 1; }
.lp-key { color: var(--text-3); font-size: 11px; font-family: 'JetBrains Mono', monospace; }

/* ── Toast (T-065) ──────────────────────────── */
.ws-toast-box {
  position: fixed;
  bottom: 40px;
  right: 24px;
  z-index: 9999;
}
.ws-toast {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-1);
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  animation: wsToastUp 0.2s ease forwards;
  margin-top: 6px;
}
.ws-toast kbd {
  display: inline-block;
  background: var(--bg-4);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 1px 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  margin-right: 8px;
}
@keyframes wsToastUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes wsToastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(8px); } }

/* Sidebar skeleton pulse */
.ws-skeleton-pulse {
  animation: ws-pulse 1.2s ease-in-out infinite;
}
@keyframes ws-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

