/* ============================================================
   AURELIA v3.0 — CANONICAL DESIGN SYSTEM
   Identity Partners | aurelia.identitypartners.uk
   ============================================================ */

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

/* ── CSS Custom Properties — Theme System ── */
:root {
  /* Elegant / Midnight (default) */
  --hero: #0f0f1a;
  --hero2: #1a1a2e;
  --surface: #16213e;
  --surface2: #1e2a4a;
  --surface3: #243356;
  --accent: #7c6af7;
  --accent2: #a78bfa;
  --accent3: #c4b5fd;
  --text-primary: #f0f0ff;
  --text-secondary: #a0a8c8;
  --text-muted: #6070a0;
  --border: rgba(124,106,247,0.18);
  --border2: rgba(124,106,247,0.08);
  --glass: rgba(22,33,62,0.72);
  --glass2: rgba(15,15,26,0.85);
  --shadow: 0 8px 32px rgba(0,0,0,0.45);
  --shadow2: 0 2px 12px rgba(0,0,0,0.3);
  --radius: 14px;
  --radius2: 8px;
  --radius3: 20px;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
  --nav-width: 220px;
  --topbar-height: 60px;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
  --lct: 0; /* Live Cache Token — set by JS */
}

/* ── Theme Families ── */
[data-theme="elegant-dawn"] {
  --hero: #1a0a2e; --hero2: #2d1b4e; --surface: #3d2060;
  --accent: #f59e0b; --accent2: #fbbf24; --accent3: #fde68a;
  --text-primary: #fef3c7; --text-secondary: #d4b896; --text-muted: #9a7a5a;
  --border: rgba(245,158,11,0.2);
}
[data-theme="elegant-morn"] {
  --hero: #0d1b2a; --hero2: #1b2d3e; --surface: #243447;
  --accent: #38bdf8; --accent2: #7dd3fc; --accent3: #bae6fd;
  --text-primary: #e0f2fe; --text-secondary: #94b8d0; --text-muted: #5a7a90;
  --border: rgba(56,189,248,0.2);
}
[data-theme="elegant-noon"] {
  --hero: #0a1628; --hero2: #0f2040; --surface: #162a52;
  --accent: #10b981; --accent2: #34d399; --accent3: #6ee7b7;
  --text-primary: #d1fae5; --text-secondary: #86c8a8; --text-muted: #4a8a68;
  --border: rgba(16,185,129,0.2);
}
[data-theme="elegant-arvo"] {
  --hero: #1a0f0a; --hero2: #2e1b0f; --surface: #3d2510;
  --accent: #f97316; --accent2: #fb923c; --accent3: #fdba74;
  --text-primary: #fff7ed; --text-secondary: #d4a87a; --text-muted: #9a6a3a;
  --border: rgba(249,115,22,0.2);
}
[data-theme="elegant-dusk"] {
  --hero: #1a0a1a; --hero2: #2e0f2e; --surface: #3d1040;
  --accent: #ec4899; --accent2: #f472b6; --accent3: #fbcfe8;
  --text-primary: #fdf2f8; --text-secondary: #d4a0c0; --text-muted: #9a5a7a;
  --border: rgba(236,72,153,0.2);
}
[data-theme="elegant-midnight"] {
  --hero: #0f0f1a; --hero2: #1a1a2e; --surface: #16213e;
  --accent: #7c6af7; --accent2: #a78bfa; --accent3: #c4b5fd;
  --text-primary: #f0f0ff; --text-secondary: #a0a8c8; --text-muted: #6070a0;
  --border: rgba(124,106,247,0.18);
}
[data-theme="modern-midnight"] {
  --hero: #050508; --hero2: #0d0d14; --surface: #111118;
  --accent: #00d4ff; --accent2: #38e8ff; --accent3: #7ef5ff;
  --text-primary: #e8f8ff; --text-secondary: #80b8c8; --text-muted: #406878;
  --border: rgba(0,212,255,0.15);
}
[data-theme="clean-noon"] {
  --hero: #f8fafc; --hero2: #f1f5f9; --surface: #ffffff;
  --surface2: #f8fafc; --surface3: #f1f5f9;
  --accent: #6366f1; --accent2: #818cf8; --accent3: #a5b4fc;
  --text-primary: #0f172a; --text-secondary: #475569; --text-muted: #94a3b8;
  --border: rgba(99,102,241,0.15); --glass: rgba(255,255,255,0.85);
}
[data-theme="classic-morn"] {
  --hero: #1c1917; --hero2: #292524; --surface: #2c2825;
  --accent: #d97706; --accent2: #f59e0b; --accent3: #fcd34d;
  --text-primary: #fafaf9; --text-secondary: #a8a29e; --text-muted: #78716c;
  --border: rgba(217,119,6,0.2);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  background: var(--hero);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--accent2); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent3); }
button { cursor: pointer; font-family: var(--font-sans); }
input, textarea, select { font-family: var(--font-sans); }
img { max-width: 100%; }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--hero2); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── App Shell ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar Navigation ── */
.sidebar {
  width: var(--nav-width);
  background: var(--glass2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition), width var(--transition);
  overflow: hidden;
}
.sidebar.collapsed { width: 60px; }
.sidebar-logo {
  padding: 18px 16px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border2);
  min-height: var(--topbar-height);
}
.sidebar-logo .logo-mark {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(124,106,247,0.4);
}
.sidebar-logo .logo-text {
  font-family: var(--font-serif);
  font-size: 18px; font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar.collapsed .logo-text { display: none; }
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 0;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px 4px;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar.collapsed .nav-section-label { opacity: 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--border2);
  color: var(--text-primary);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(124,106,247,0.18), transparent);
  color: var(--accent2);
  border-left: 2px solid var(--accent);
}
.nav-item .nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-item .nav-label { overflow: hidden; }
.sidebar.collapsed .nav-label { display: none; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.sidebar.collapsed .nav-badge { display: none; }
.nav-sub { padding-left: 28px; }
.nav-sub .nav-item { font-size: 12.5px; padding: 7px 16px; }
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-collapse-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius2);
  padding: 6px 8px;
  font-size: 12px;
  transition: all var(--transition);
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.sidebar-collapse-btn:hover { border-color: var(--accent); color: var(--accent2); }
.sidebar.collapsed .sidebar-collapse-btn span { display: none; }

/* ── Main Content Area ── */
.main-content {
  margin-left: var(--nav-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}
.main-content.sidebar-collapsed { margin-left: 60px; }

/* ── Top Bar ── */
.topbar {
  height: var(--topbar-height);
  background: var(--glass2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius2);
  font-size: 13px;
  font-weight: 500;
  border: none;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 2px 12px rgba(124,106,247,0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124,106,247,0.5);
}
.btn-secondary {
  background: var(--surface2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface3); color: var(--text-primary); border-color: var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border2); color: var(--text-primary); }
.btn-icon {
  padding: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius2);
}
.btn-icon:hover { background: var(--surface3); color: var(--accent2); border-color: var(--accent); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ── Cards ── */
.card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
}
.card:hover {
  border-color: rgba(124,106,247,0.35);
  box-shadow: var(--shadow2);
  transform: translateY(-1px);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.card-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.card-body { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.card-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border2);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Tags / Chips ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: var(--border2);
  color: var(--accent3);
  border: 1px solid var(--border);
}
.tag-accent { background: rgba(124,106,247,0.15); border-color: rgba(124,106,247,0.3); }
.tag-green { background: rgba(16,185,129,0.12); color: #34d399; border-color: rgba(16,185,129,0.25); }
.tag-amber { background: rgba(245,158,11,0.12); color: #fbbf24; border-color: rgba(245,158,11,0.25); }
.tag-red { background: rgba(239,68,68,0.12); color: #f87171; border-color: rgba(239,68,68,0.25); }
.tag-blue { background: rgba(56,189,248,0.12); color: #7dd3fc; border-color: rgba(56,189,248,0.25); }

/* ── Inputs ── */
.input-group { display: flex; flex-direction: column; gap: 5px; }
.input-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 13.5px;
  transition: all var(--transition);
  outline: none;
  width: 100%;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,106,247,0.12); }
.input::placeholder { color: var(--text-muted); }
.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.input-row .input { flex: 1; }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.5; }
select.input { cursor: pointer; }

/* ── Chat Input Bar ── */
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius3);
  padding: 10px 14px;
  transition: border-color var(--transition);
}
.chat-input-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,106,247,0.1); }
.chat-input-bar textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  resize: none;
  max-height: 160px;
  line-height: 1.5;
  padding: 0;
}
.chat-input-bar textarea::placeholder { color: var(--text-muted); }

/* ── Model Selector ── */
.model-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.model-selector:hover { border-color: var(--accent); color: var(--accent2); }
.model-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* ── World Clock Strip ── */
.clock-strip {
  display: flex;
  gap: 12px;
  padding: 10px 20px;
  background: var(--glass2);
  border-bottom: 1px solid var(--border2);
  overflow-x: auto;
  scrollbar-width: none;
}
.clock-strip::-webkit-scrollbar { display: none; }
.clock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 72px;
}
.clock-city { font-size: 10px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }
.clock-time { font-size: 15px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.clock-date { font-size: 10px; color: var(--text-muted); }

/* ── Atmosphere Strip ── */
.atmosphere-strip {
  display: flex;
  gap: 8px;
  padding: 8px 20px;
  background: var(--glass2);
  border-bottom: 1px solid var(--border2);
  align-items: center;
}
.atm-tile {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.atm-tile:hover { border-color: var(--accent); color: var(--accent2); }
.atm-tile.active { background: rgba(124,106,247,0.15); border-color: var(--accent); color: var(--accent2); }

/* ── Feed Grid ── */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 20px;
}
.feed-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 20px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.feed-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border2);
}

/* ── Three-pane Layout ── */
.three-pane {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  height: calc(100vh - var(--topbar-height));
  overflow: hidden;
}
.pane {
  overflow-y: auto;
  border-right: 1px solid var(--border2);
}
.pane:last-child { border-right: none; }
.pane-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border2);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--glass2);
  backdrop-filter: blur(12px);
  z-index: 10;
}

/* ── Chat Messages ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.message {
  display: flex;
  gap: 10px;
  max-width: 85%;
}
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
  flex-shrink: 0;
}
.message.user .message-avatar { background: var(--surface3); }
.message-bubble {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-primary);
}
.message.user .message-bubble {
  background: linear-gradient(135deg, rgba(124,106,247,0.2), rgba(167,139,250,0.15));
  border-color: rgba(124,106,247,0.3);
}
.message-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.message-model-badge {
  background: var(--border2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--accent3);
}

/* ── Typing Indicator ── */
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 14px;
}
.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: typing-bounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Pomodoro ── */
.pomodoro-ring {
  width: 80px; height: 80px;
  position: relative;
}
.pomodoro-ring svg { transform: rotate(-90deg); }
.pomodoro-ring .ring-bg { fill: none; stroke: var(--border); stroke-width: 4; }
.pomodoro-ring .ring-progress { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.pomodoro-time {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* ── Status Indicators ── */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-online { background: #10b981; box-shadow: 0 0 6px #10b981; }
.status-busy { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.status-offline { background: var(--text-muted); }

/* ── Progress Bar ── */
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border2);
  margin: 12px 0;
}

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 40px; opacity: 0.4; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); }
.empty-state-desc { font-size: 13px; max-width: 280px; line-height: 1.5; }

/* ── Tooltip ── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface3);
  color: var(--text-primary);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  border: 1px solid var(--border);
  z-index: 999;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Notification Toast ── */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  animation: toast-in 0.3s ease;
}
.toast.success { border-left: 3px solid #10b981; }
.toast.error { border-left: 3px solid #ef4444; }
.toast.info { border-left: 3px solid var(--accent); }
@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius3);
  padding: 24px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow);
  transform: scale(0.95);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text-primary); }

/* ── Workspace Lens Panel ── */
.workspace-panel {
  width: 240px;
  background: var(--glass2);
  border-left: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
  transition: transform var(--transition);
}
.workspace-panel.hidden { transform: translateX(100%); }
.workspace-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.workspace-card:hover { border-color: var(--accent); }
.workspace-card.active { border-color: var(--accent); background: rgba(124,106,247,0.1); }
.workspace-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.workspace-stats { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Animations ── */
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slide-in-left { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 8px rgba(124,106,247,0.3); } 50% { box-shadow: 0 0 20px rgba(124,106,247,0.6); } }
.fade-in { animation: fade-in 0.3s ease forwards; }
.slide-in { animation: slide-in-left 0.3s ease forwards; }
.pulse-glow { animation: pulse-glow 2s infinite; }

/* ── Responsive — Phone Minimal ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .three-pane { grid-template-columns: 1fr; }
  .three-pane .pane:not(.pane-center) { display: none; }
  .feed-grid { grid-template-columns: 1fr; padding: 12px; }
  .topbar { padding: 0 12px; }
  .phone-hide { display: none !important; }
  .phone-show { display: flex !important; }
}
@media (min-width: 769px) {
  .phone-show { display: none !important; }
}

/* ── Utility Classes ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.w-full { width: 100%; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent2); }
.font-mono { font-family: var(--font-mono); }
.font-serif { font-family: var(--font-serif); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: 9999px; }
.border { border: 1px solid var(--border); }
.bg-surface { background: var(--surface2); }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { inset: 0; }
.z-10 { z-index: 10; }
.opacity-50 { opacity: 0.5; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }