/* ============================================================
   AURELIA v3.0 — ELEGANT LIGHT DESIGN SYSTEM
   Identity Partners | aurelia.identitypartners.uk
   Stance: Elegant · Professional · Clean · Timeless
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ── */
:root {
  /* Core palette — warm ivory + deep ink */
  --ivory:        #faf8f5;
  --ivory-2:      #f4f1ec;
  --ivory-3:      #ede9e2;
  --ivory-4:      #e4dfd6;
  --parchment:    #f0ebe2;

  --ink:          #1c1917;
  --ink-2:        #2d2926;
  --ink-3:        #44403c;
  --ink-4:        #78716c;
  --ink-5:        #a8a29e;
  --ink-6:        #d6d3d1;

  --gold:         #b5924c;
  --gold-2:       #c9a96e;
  --gold-3:       #e2c99a;
  --gold-4:       #f5e9d4;

  --sage:         #6b7c6e;
  --sage-2:       #8a9e8d;
  --sage-3:       #b8c9ba;
  --sage-4:       #e8f0e9;

  --navy:         #1e2d40;
  --navy-2:       #2c3e55;
  --navy-3:       #3d5166;

  --crimson:      #8b2635;
  --forest:       #2d5016;

  /* Semantic aliases */
  --bg:           var(--ivory);
  --bg-2:         var(--ivory-2);
  --bg-3:         var(--ivory-3);
  --surface:      #ffffff;
  --surface-2:    var(--ivory);
  --surface-3:    var(--ivory-2);

  --text-primary:   var(--ink);
  --text-secondary: var(--ink-3);
  --text-muted:     var(--ink-4);
  --text-faint:     var(--ink-5);

  --accent:       var(--gold);
  --accent-2:     var(--gold-2);
  --accent-3:     var(--gold-3);

  --border:       var(--ivory-4);
  --border-2:     var(--ivory-3);
  --border-strong: var(--ink-6);

  --shadow-sm:    0 1px 3px rgba(28,25,23,0.06), 0 1px 2px rgba(28,25,23,0.04);
  --shadow:       0 4px 16px rgba(28,25,23,0.08), 0 2px 6px rgba(28,25,23,0.05);
  --shadow-lg:    0 12px 40px rgba(28,25,23,0.12), 0 4px 12px rgba(28,25,23,0.06);
  --shadow-gold:  0 4px 20px rgba(181,146,76,0.18);

  --radius-sm:    4px;
  --radius:       8px;
  --radius-lg:    12px;
  --radius-xl:    16px;
  --radius-pill:  9999px;

  --font-serif:   'Cormorant Garamond', 'Georgia', 'Times New Roman', serif;
  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  --nav-width:    240px;
  --topbar-h:     56px;
  --transition:   0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Theme variants ── */
[data-theme="sage"] {
  --accent: var(--sage); --accent-2: var(--sage-2); --accent-3: var(--sage-3);
}
[data-theme="navy"] {
  --accent: var(--navy); --accent-2: var(--navy-2); --accent-3: var(--navy-3);
  --bg: #f5f7fa; --bg-2: #eef1f6; --bg-3: #e4e9f0;
}
[data-theme="classic"] {
  --bg: #f9f7f4; --bg-2: #f2efe9; --bg-3: #e8e4dc;
  --accent: var(--ink-2); --accent-2: var(--ink-3); --accent-3: var(--ink-5);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-2); }
button { cursor: pointer; font-family: var(--font-sans); }
input, textarea, select { font-family: var(--font-sans); }
::selection { background: var(--gold-4); color: var(--ink); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--ink-6); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-5); }

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

/* ── Sidebar ── */
.sidebar {
  width: var(--nav-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width var(--transition-slow);
  overflow: hidden;
}
.sidebar.collapsed { width: 56px; }

.sidebar-logo {
  padding: 20px 18px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-h);
}
.logo-mark {
  width: 30px; height: 30px;
  background: var(--ink);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-size: 16px; font-weight: 600; color: var(--ivory);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.logo-text {
  font-family: var(--font-serif);
  font-size: 19px; font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.sidebar.collapsed .logo-text { display: none; }

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

.nav-section-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 14px 18px 4px;
  white-space: nowrap;
}
.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  border-left: 2px solid transparent;
  position: relative;
}
.nav-item:hover { color: var(--text-primary); background: var(--bg-2); }
.nav-item.active {
  color: var(--ink);
  background: var(--bg-2);
  border-left-color: var(--accent);
  font-weight: 500;
}
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-item:hover .nav-icon { opacity: 0.9; }
.nav-label { overflow: hidden; }
.sidebar.collapsed .nav-label { display: none; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--ivory);
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--radius-pill);
  min-width: 16px;
  text-align: center;
}
.sidebar.collapsed .nav-badge { display: none; }
.nav-sub { padding-left: 16px; }
.nav-sub .nav-item { font-size: 12.5px; padding: 6px 18px; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-collapse-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-faint);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 11px;
  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(--accent); }
.sidebar.collapsed .sidebar-collapse-btn span { display: none; }

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

/* ── Top Bar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.02em;
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius);
  font-size: 12.5px;
  font-weight: 500;
  border: none;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--ink);
  color: var(--ivory);
  border: 1px solid var(--ink);
}
.btn-primary:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.btn-gold {
  background: var(--gold);
  color: var(--ivory);
  border: 1px solid var(--gold);
}
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-2); color: var(--text-primary); border-color: var(--ink-5); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-2); color: var(--text-primary); border-color: var(--ink-6); }
.btn-icon {
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
}
.btn-icon:hover { background: var(--bg-2); color: var(--text-primary); }
.btn-sm { padding: 5px 10px; font-size: 11.5px; }
.btn-lg { padding: 10px 22px; font-size: 14px; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: all var(--transition);
}
.card:hover {
  border-color: var(--ink-6);
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.card-meta { font-size: 11px; color: var(--text-faint); }
.card-body { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.card-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Tags ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 500;
  background: var(--bg-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  letter-spacing: 0.02em;
}
.tag-gold { background: var(--gold-4); color: var(--gold); border-color: var(--gold-3); }
.tag-sage { background: var(--sage-4); color: var(--sage); border-color: var(--sage-3); }
.tag-navy { background: #e8edf4; color: var(--navy); border-color: #c8d4e4; }
.tag-green { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.tag-amber { background: #fff8e1; color: #f57f17; border-color: #ffe082; }
.tag-red { background: #fce4ec; color: #c62828; border-color: #f8bbd0; }
.tag-blue { background: #e3f2fd; color: #1565c0; border-color: #bbdefb; }
.tag-ink { background: var(--bg-3); color: var(--ink); border-color: var(--ink-6); }

/* ── Inputs ── */
.input-group { display: flex; flex-direction: column; gap: 5px; }
.input-label { font-size: 11.5px; font-weight: 500; color: var(--text-secondary); letter-spacing: 0.03em; }
.input {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 13px;
  transition: all var(--transition);
  outline: none;
  width: 100%;
}
.input:focus { border-color: var(--ink-4); box-shadow: 0 0 0 3px rgba(28,25,23,0.06); }
.input::placeholder { color: var(--text-faint); }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row .input { flex: 1; }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.6; }
select.input { cursor: pointer; }

/* ── Chat Input ── */
.chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 10px 14px;
  transition: border-color var(--transition);
  box-shadow: var(--shadow-sm);
}
.chat-input-bar:focus-within { border-color: var(--ink-4); box-shadow: 0 0 0 3px rgba(28,25,23,0.06); }
.chat-input-bar textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13.5px;
  resize: none;
  max-height: 160px;
  line-height: 1.6;
  padding: 0;
}
.chat-input-bar textarea::placeholder { color: var(--text-faint); }

/* ── Model Selector ── */
.model-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.model-selector:hover { border-color: var(--ink-5); color: var(--text-primary); }
.model-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sage); }

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

/* ── Atmosphere Strip ── */
.atmosphere-strip {
  display: flex;
  gap: 6px;
  padding: 8px 20px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.atm-tile {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.atm-tile:hover { border-color: var(--ink-5); color: var(--text-primary); }
.atm-tile.active { background: var(--bg-3); border-color: var(--ink-5); color: var(--ink); }

/* ── Feed Grid ── */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 16px 24px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 8px;
}
.section-header-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header-title::before {
  content: '';
  width: 2px; height: 10px;
  background: var(--accent);
  border-radius: 1px;
}
.section-view-all { font-size: 11px; color: var(--accent); transition: color var(--transition); }
.section-view-all:hover { color: var(--accent-2); }

/* ── Feed Cards ── */
.feed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: block;
}
.feed-card:hover {
  border-color: var(--ink-6);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.feed-card-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  margin-bottom: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
}
.feed-card-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-card-preview { font-size: 12px; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 11px; color: var(--text-faint); }

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

/* ── Chat Messages ── */
.chat-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.message { display: flex; gap: 10px; max-width: 82%; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--ivory);
  flex-shrink: 0;
  font-family: var(--font-serif);
}
.message.user .message-avatar { background: var(--bg-3); color: var(--ink); }
.message-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.message.user .message-bubble {
  background: var(--ink);
  color: var(--ivory);
  border-color: var(--ink);
}
.message-meta { font-size: 10px; color: var(--text-faint); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.message-model-badge {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 1px 6px;
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Typing Indicator ── */
.typing-indicator { display: flex; gap: 4px; align-items: center; padding: 12px 16px; }
.typing-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-5); 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(-5px); opacity: 1; } }

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

/* ── Status Dots ── */
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.status-online { background: #2e7d32; }
.status-busy { background: #f57f17; }
.status-offline { background: var(--ink-6); }

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

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

/* ── Empty State ── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 48px 24px; text-align: center; color: var(--text-faint); }
.empty-state-icon { font-size: 36px; opacity: 0.35; }
.empty-state-title { font-family: var(--font-serif); font-size: 16px; font-weight: 500; color: var(--text-secondary); }
.empty-state-desc { font-size: 12.5px; max-width: 280px; line-height: 1.6; color: var(--text-faint); }

/* ── 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(--ink);
  color: var(--ivory);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--radius);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 999;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  animation: toast-in 0.25s ease;
}
.toast.success { border-left: 3px solid #2e7d32; }
.toast.error { border-left: 3px solid var(--crimson); }
.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(28,25,23,0.4);
  backdrop-filter: blur(3px);
  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(--radius-xl);
  padding: 28px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.97);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-title { font-family: var(--font-serif); font-size: 18px; font-weight: 500; color: var(--ink); }
.modal-close { background: none; border: none; color: var(--text-faint); font-size: 16px; cursor: pointer; padding: 4px; border-radius: var(--radius-sm); transition: color var(--transition); }
.modal-close:hover { color: var(--ink); }

/* ── Workspace Panel ── */
.workspace-panel { width: 220px; background: var(--surface); border-left: 1px solid var(--border); padding: 16px; overflow-y: auto; }
.workspace-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: all var(--transition); }
.workspace-card:hover { border-color: var(--ink-6); }
.workspace-card.active { border-color: var(--accent); background: var(--gold-4); }
.workspace-name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.workspace-stats { font-size: 11px; color: var(--text-faint); margin-top: 3px; }

/* ── Animations ── */
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slide-in-left { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.fade-in { animation: fade-in 0.25s ease forwards; }
.slide-in { animation: slide-in-left 0.25s ease forwards; }

/* ── Responsive ── */
@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 16px; }
  .phone-hide { display: none !important; }
  .phone-show { display: flex !important; }
}
@media (min-width: 769px) { .phone-show { display: none !important; } }

/* ── Utilities ── */
.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; }
.p-6 { padding: 24px; }
.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-faint { color: var(--text-faint); }
.text-accent { color: var(--accent); }
.text-ink { color: var(--ink); }
.font-mono { font-family: var(--font-mono); }
.font-serif { font-family: var(--font-serif); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-pill); }
.border { border: 1px solid var(--border); }
.border-strong { border: 1px solid var(--border-strong); }
.bg-surface { background: var(--surface); }
.bg-2 { background: var(--bg-2); }
.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; }
.shadow { box-shadow: var(--shadow); }
.shadow-sm { box-shadow: var(--shadow-sm); }

/* ── Decorative rule ── */
.rule {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-faint);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.rule::before, .rule::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Serif headings ── */
h1.serif, h2.serif, h3.serif {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
}

/* ── Code blocks ── */
.code-block {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  overflow-x: auto;
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ── Platform status badge ── */
.platform-tier-1 { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; border-radius: var(--radius-pill); padding: 2px 7px; font-size: 10px; font-weight: 600; }
.platform-tier-2 { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; border-radius: var(--radius-pill); padding: 2px 7px; font-size: 10px; font-weight: 600; }
.platform-tier-3 { background: var(--bg-3); color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 2px 7px; font-size: 10px; font-weight: 600; }