/* ===================================================================
   Aria App v9 — Midnight Neon Dark Theme
   Complete responsive UI overhaul — mobile-first, Discord-style
   =================================================================== */

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

:root {
  /* Core palette */
  --bg-deep: #08080d;
  --bg-surface: #0f0f17;
  --bg-card: #16161f;
  --bg-hover: #1e1e2a;
  --bg-input: #12121a;
  --bg-elevated: #1a1a28;
  --border: #252535;
  --border-light: #1e1e2e;
  --border-glow: rgba(124, 58, 237, 0.25);

  /* Text */
  --text: #e4e4e7;
  --text-muted: #71717a;
  --text-dim: #52525b;
  --text-bright: #f4f4f7;

  /* Theme colors — purple default */
  --theme-primary: #a855f7;
  --theme-primary-rgb: 168, 85, 247;
  --theme-primary-glow: rgba(168, 85, 247, 0.4);
  --theme-secondary: #ec4899;
  --theme-secondary-rgb: 236, 72, 153;
  --theme-secondary-glow: rgba(236, 72, 153, 0.3);
  --theme-gradient: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
  --theme-gradient-text: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
  --theme-border: rgba(168, 85, 247, 0.3);

  /* Semantic colors */
  --cyan: #22d3ee;
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.3);
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.3);
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.3);

  /* Sizing */
  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --server-bar-w: 60px;
  --channel-list-w: 200px;
  --info-panel-w: 280px;
  --header-h: 48px;
  --bottom-nav-h: 56px;
  --touch-target: 44px;
  --pulse-speed: 2s;
}

/* Theme presets */
[data-theme="purple"] {
  --theme-primary: #a855f7;
  --theme-primary-rgb: 168, 85, 247;
  --theme-primary-glow: rgba(168, 85, 247, 0.4);
  --theme-secondary: #ec4899;
  --theme-secondary-rgb: 236, 72, 153;
  --theme-secondary-glow: rgba(236, 72, 153, 0.3);
  --theme-border: rgba(168, 85, 247, 0.3);
}
[data-theme="pink"] {
  --theme-primary: #ec4899;
  --theme-primary-rgb: 236, 72, 153;
  --theme-primary-glow: rgba(236, 72, 153, 0.4);
  --theme-secondary: #f472b6;
  --theme-secondary-rgb: 244, 114, 182;
  --theme-secondary-glow: rgba(244, 114, 182, 0.3);
  --theme-border: rgba(236, 72, 153, 0.3);
}
[data-theme="cyan"] {
  --theme-primary: #22d3ee;
  --theme-primary-rgb: 34, 211, 238;
  --theme-primary-glow: rgba(34, 211, 238, 0.4);
  --theme-secondary: #06b6d4;
  --theme-secondary-rgb: 6, 182, 212;
  --theme-secondary-glow: rgba(6, 182, 212, 0.3);
  --theme-border: rgba(34, 211, 238, 0.3);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: radial-gradient(ellipse at top, var(--bg-surface), var(--bg-deep));
}

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Scrollbar — thin, themed */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--theme-primary-rgb), 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--theme-primary); }

/* ===================================================================
   ANIMATIONS
   =================================================================== */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-in-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in-down { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }
@keyframes slide-in-right { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slide-in-left { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes slide-in-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-glow { 0%,100% { filter: drop-shadow(0 0 20px var(--theme-primary-glow)); transform: scale(1); } 50% { filter: drop-shadow(0 0 40px var(--theme-primary-glow)); transform: scale(1.05); } }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes bounce-dot { 0%,60%,100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-6px); opacity: 1; } }
@keyframes speak-wave { 0%,100% { height: 4px; opacity: 0.4; } 50% { height: 14px; opacity: 1; } }
@keyframes ring-wave { 0% { transform: scale(0.8); opacity: 0.6; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes skeleton-pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 0.8; } }

/* ===================================================================
   LOGIN SCREEN
   =================================================================== */
#login-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, var(--bg-surface), var(--bg-deep));
  backdrop-filter: blur(12px);
}
.login-container {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 24px; width: 100%; max-width: 340px;
  animation: fade-in-up 0.5s ease-out;
}
.login-logo {
  font-size: 56px; margin-bottom: 12px;
  filter: drop-shadow(0 0 30px var(--theme-primary-glow));
  animation: pulse-glow var(--pulse-speed) ease-in-out infinite;
}
.login-title {
  font-size: 32px; font-weight: 900;
  background: var(--theme-gradient-text);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; letter-spacing: 2px;
}
.login-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
.login-input {
  width: 100%; padding: 14px 18px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-input);
  color: var(--text); font-size: 16px; outline: none;
  margin-bottom: 14px; transition: all 0.2s ease;
}
.login-input:focus { border-color: var(--theme-primary); box-shadow: 0 0 20px var(--theme-primary-glow); }
.login-input::placeholder { color: var(--text-dim); }
.login-btn {
  padding: 14px 48px; border-radius: var(--radius);
  border: 1px solid var(--theme-primary);
  background: linear-gradient(135deg, rgba(var(--theme-primary-rgb),0.15), rgba(var(--theme-secondary-rgb),0.1));
  color: var(--theme-primary); font-size: 16px; font-weight: 700;
  cursor: pointer; transition: all 0.2s ease;
}
.login-btn:hover { box-shadow: 0 0 30px var(--theme-primary-glow); transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }
.login-error { color: var(--red); font-size: 12px; margin-top: 10px; min-height: 16px; text-align: center; }

/* ===================================================================
   APP LAYOUT — Discord-style 4-column grid
   =================================================================== */
#app {
  display: flex;
  height: 100vh; height: 100dvh;
  background: radial-gradient(ellipse at top, var(--bg-surface), var(--bg-deep));
}

/* ═══ Server Bar ═══ */
#server-bar {
  width: var(--server-bar-w);
  flex-shrink: 0;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 6px;
  border-right: 1px solid var(--border);
  z-index: 20;
}
.server-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
  min-width: var(--touch-target);
  min-height: var(--touch-target);
}
.server-icon:hover {
  border-radius: var(--radius);
  background: var(--bg-hover);
}
.server-icon.active {
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(var(--theme-primary-rgb),0.2), rgba(var(--theme-secondary-rgb),0.15));
  box-shadow: 0 0 12px var(--theme-primary-glow);
}
.server-icon.active::before {
  content: ""; position: absolute; left: -8px; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 32px; border-radius: 0 4px 4px 0;
  background: var(--theme-primary);
  box-shadow: 0 0 8px var(--theme-primary-glow);
}
.server-icon.home-icon svg { filter: drop-shadow(0 0 6px var(--theme-primary-glow)); }
.server-icon-emoji { font-size: 20px; }
.server-divider {
  width: 30px; height: 2px;
  background: var(--border);
  border-radius: 1px;
  margin: 4px 0;
}
.server-spacer { flex: 1; }
.server-icon.settings-icon { color: var(--text-muted); }
.server-icon.settings-icon:hover { color: var(--text); }

/* Unread badge on server icons */
.server-icon .server-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red);
  color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 8px var(--red-glow);
}
.server-icon .server-badge.hidden { display: none; }

/* ═══ Channel List ═══ */
#channel-list {
  width: var(--channel-list-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.channel-list-header {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.home-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  border: none; background: none; color: var(--text-muted);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.2s ease;
}
.home-btn:hover { background: var(--bg-hover); color: var(--text); }
.home-btn.active {
  background: linear-gradient(135deg, rgba(var(--theme-primary-rgb),0.15), rgba(var(--theme-secondary-rgb),0.08));
  color: var(--theme-primary);
}
.channel-list-scroll {
  flex: 1; overflow-y: auto; padding: 8px 0;
}
.channel-section-header {
  padding: 16px 12px 4px;
  font-size: 10px; font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  user-select: none;
}
.channel-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border: none; background: none;
  color: var(--text-muted);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  width: 100%;
  text-align: left;
  min-height: var(--touch-target);
}
.channel-item:hover { background: var(--bg-hover); color: var(--text); border-radius: var(--radius); }
.channel-item.active {
  background: rgba(var(--theme-primary-rgb), 0.12);
  color: var(--text);
  border-radius: var(--radius);
}
.channel-item.active::before {
  content: ""; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: var(--theme-primary);
  box-shadow: 0 0 6px var(--theme-primary-glow);
}
.channel-hash { color: var(--text-dim); font-weight: 400; }
.channel-item.active .channel-hash { color: var(--theme-primary); }
.channel-name { flex: 1; }
.channel-badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red);
  color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 8px var(--red-glow);
}
.channel-badge.hidden { display: none; }
.channel-list-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.connection-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-muted);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0; }
.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.connecting { background: var(--amber); animation: pulse-dot 1s ease-in-out infinite; }
.status-dot.error { background: var(--red); }

/* ═══ Main Area ═══ */
#main-area {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
  background: var(--bg-deep);
}

/* Channel Header */
#channel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: rgba(15, 15, 23, 0.8);
  backdrop-filter: blur(10px);
  flex-shrink: 0; z-index: 10;
}
.channel-header-left {
  display: flex; align-items: center; gap: 8px;
  min-width: 0; overflow: hidden;
}
.channel-header-hash { color: var(--text-dim); font-size: 20px; font-weight: 400; }
.channel-header-name { font-size: 15px; font-weight: 700; color: var(--text); }
.channel-header-desc {
  font-size: 12px; color: var(--text-muted);
  padding-left: 8px; margin-left: 4px;
  border-left: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.channel-header-right { display: flex; gap: 4px; flex-shrink: 0; }
.mobile-menu-btn { display: none; }

/* Icon buttons */
.icon-btn {
  background: none; border: none; color: var(--text-muted);
  padding: 8px; border-radius: 50%; cursor: pointer;
  transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center;
  min-width: var(--touch-target);
  min-height: var(--touch-target);
}
.icon-btn:hover { color: var(--text); background: var(--bg-hover); }
.call-btn-header { color: var(--green); }
.call-btn-header:hover { color: var(--green); background: rgba(16, 185, 129, 0.1); box-shadow: 0 0 12px var(--green-glow); }

/* ===================================================================
   CONTENT AREA / CHANNEL VIEWS
   =================================================================== */
#content-area { flex: 1; overflow: hidden; position: relative; }
.channel-view { display: none; flex: 1; flex-direction: column; overflow: hidden; height: 100%; }
.channel-view.active { display: flex; }

.channel-view-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.refresh-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease;
  min-height: var(--touch-target);
}
.refresh-btn:hover { border-color: var(--theme-primary); color: var(--text); background: var(--bg-hover); box-shadow: 0 0 12px var(--border-glow); }
.refresh-btn:active { transform: scale(0.97); }
.refresh-btn.spinning svg { animation: spin 1s linear infinite; }

/* ===================================================================
   LOADING / ERROR / EMPTY STATES
   =================================================================== */
.loading-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 16px; color: var(--text-muted); font-size: 14px;
  padding: 40px 20px;
}
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(var(--theme-primary-rgb), 0.15);
  border-top-color: var(--theme-primary);
  border-radius: 50%; animation: spin 1s linear infinite;
}
.loading-spinner.small { width: 20px; height: 20px; border-width: 2px; }

.error-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 12px; color: var(--red); font-size: 14px;
  padding: 40px 20px; text-align: center;
}
.error-state .error-icon { font-size: 48px; opacity: 0.6; }
.error-state .error-retry-btn {
  padding: 8px 24px; border-radius: var(--radius);
  border: 1px solid var(--red); background: rgba(239, 68, 68, 0.1);
  color: var(--red); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
  margin-top: 8px;
}
.error-state .error-retry-btn:hover { background: rgba(239, 68, 68, 0.2); box-shadow: 0 0 12px var(--red-glow); }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; gap: 8px; color: var(--text-muted); font-size: 14px;
  padding: 40px 20px; text-align: center; opacity: 0.6; line-height: 1.6;
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 8px; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton-line { height: 14px; margin-bottom: 8px; width: 100%; }
.skeleton-line:last-child { width: 60%; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.skeleton-card { height: 80px; border-radius: var(--radius); margin-bottom: 10px; }

/* ===================================================================
   HOME / DASHBOARD
   =================================================================== */
#home-content { flex: 1; overflow-y: auto; padding: 20px; }

.dashboard-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  max-width: 800px; margin: 0 auto;
}
.dashboard-status-card {
  grid-column: 1 / -1; padding: 20px; border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(var(--theme-primary-rgb), 0.04);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 16px;
}
.dashboard-status-avatar { width: 64px; height: 64px; flex-shrink: 0; position: relative; }
.dashboard-status-avatar svg { filter: drop-shadow(0 0 12px var(--theme-primary-glow)); }
.dashboard-status-info { flex: 1; min-width: 0; }
.dashboard-status-name {
  font-size: 20px; font-weight: 800;
  background: var(--theme-gradient-text);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dashboard-status-mood { font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.dashboard-status-energy { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.dashboard-status-energy-label { font-size: 11px; color: var(--text-muted); }
.energy-bar { width: 100px; height: 6px; border-radius: 3px; background: var(--bg-input); overflow: hidden; }
.energy-bar-fill {
  height: 100%; border-radius: 3px;
  background: var(--theme-gradient);
  transition: width 0.5s;
}
.dashboard-status-activity { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.dashboard-status-online { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--green); }

.dashboard-stat-card {
  padding: 16px; border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(22, 22, 31, 0.6);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column; gap: 6px;
  transition: all 0.2s ease;
}
.dashboard-stat-card:hover { border-color: var(--border-glow); box-shadow: 0 0 16px var(--border-glow); }
.dashboard-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.dashboard-stat-value { font-size: 22px; font-weight: 800; color: var(--theme-primary); font-family: var(--font-mono); }

.dashboard-actions-card { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }
.dashboard-action-btn {
  flex: 1; min-width: 120px;
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--theme-primary); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--touch-target);
}
.dashboard-action-btn:hover {
  border-color: var(--theme-primary); background: var(--bg-hover);
  box-shadow: 0 0 16px var(--theme-primary-glow);
}
.dashboard-action-btn:active { transform: scale(0.97); }

.dashboard-section-title {
  grid-column: 1 / -1; font-size: 14px; font-weight: 700;
  color: var(--text); text-transform: uppercase; letter-spacing: 2px;
  margin-top: 8px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.dashboard-timeline { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; }
.dashboard-timeline-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 12px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.dashboard-timeline-item:hover { border-color: var(--border-glow); }
.dashboard-timeline-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--theme-primary); flex-shrink: 0; margin-top: 5px;
  box-shadow: 0 0 6px var(--theme-primary-glow);
}
.dashboard-timeline-content { flex: 1; min-width: 0; }
.dashboard-timeline-time { font-size: 10px; color: var(--theme-primary); text-transform: uppercase; letter-spacing: 1px; }
.dashboard-timeline-text { font-size: 13px; color: var(--text); opacity: 0.85; }

.dashboard-briefing-preview {
  grid-column: 1 / -1; padding: 16px; border-radius: var(--radius);
  border: 1px solid rgba(var(--theme-secondary-rgb), 0.2);
  background: rgba(var(--theme-secondary-rgb), 0.04);
  cursor: pointer; transition: all 0.2s ease;
}
.dashboard-briefing-preview:hover { border-color: var(--theme-secondary); box-shadow: 0 0 16px var(--theme-secondary-glow); }
.dashboard-briefing-preview-title { font-size: 14px; font-weight: 700; color: var(--theme-secondary); margin-bottom: 6px; }
.dashboard-briefing-preview-text { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.dashboard-guardian-card {
  grid-column: 1 / -1; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-card);
}
.dashboard-guardian-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.dashboard-guardian-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }

/* ===================================================================
   CHAT MESSAGES
   =================================================================== */
#chat-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.message { display: flex; animation: msg-in 0.3s ease-out; transition: all 0.15s ease; }
.message.user-message { justify-content: flex-end; }
.message.aria-message { justify-content: flex-start; }

.message:hover .bubble-content { border-left: 2px solid var(--theme-primary); }

.bubble { max-width: 75%; display: flex; gap: 6px; align-items: flex-end; }
.user-message .bubble { flex-direction: row-reverse; }
.bubble-avatar { flex-shrink: 0; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; opacity: 0.8; }
.user-message .bubble-avatar { display: none; }

.bubble-content {
  padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--border);
  word-wrap: break-word; overflow-wrap: break-word;
  line-height: 1.45; font-size: 14.5px; position: relative;
  transition: all 0.15s ease;
}
.aria-message .bubble-content {
  background: var(--bg-card); border-bottom-left-radius: var(--radius-sm);
}
.user-message .bubble-content {
  background: linear-gradient(135deg, rgba(var(--theme-primary-rgb), 0.15), rgba(var(--theme-secondary-rgb), 0.08));
  border-color: rgba(var(--theme-primary-rgb), 0.2);
  border-bottom-right-radius: var(--radius-sm);
}
.bubble-content .msg-text { margin: 0; }
.aria-message .bubble-content .msg-text { color: var(--text); }
.user-message .bubble-content .msg-text { color: #f0d0f8; }

/* Markdown */
.msg-text strong { font-weight: 700; }
.msg-text em { font-style: italic; }
.msg-text del { text-decoration: line-through; opacity: 0.7; }
.msg-text a { color: var(--cyan); text-decoration: underline; text-decoration-color: rgba(34, 211, 238, 0.3); }
.msg-text a:hover { text-decoration-color: var(--cyan); }
.msg-text blockquote {
  border-left: 3px solid var(--theme-primary); padding: 6px 12px; margin: 6px 0;
  background: rgba(var(--theme-primary-rgb), 0.05); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic; color: var(--text-muted);
}
.msg-text hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.msg-text .inline-code {
  background: rgba(0,0,0,0.3); padding: 1px 6px; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: 0.9em; color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

/* Code blocks */
.code-block-wrapper { position: relative; margin: 8px 0; }
.code-block {
  background: #0d0d14; border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto; margin: 0;
}
.code-block code {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5;
  color: var(--green); white-space: pre;
}
.code-block-copy {
  position: absolute; top: 4px; right: 4px;
  padding: 3px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-hover);
  color: var(--text-muted); font-size: 11px; cursor: pointer;
  transition: all 0.2s ease;
}
.code-block-copy:hover { color: var(--theme-primary); border-color: var(--theme-primary); }
.code-block-copy.copied { color: var(--green); border-color: var(--green); }

/* Proactive messages */
.message.proactive-message .bubble-content {
  border-color: rgba(var(--theme-secondary-rgb), 0.3);
  border-left: 3px solid var(--theme-secondary);
  box-shadow: 0 0 12px var(--theme-secondary-glow);
}
.proactive-indicator { font-size: 10px; color: var(--theme-secondary); display: block; margin-top: 2px; opacity: 0.7; }

/* Media in messages */
.msg-media { display: block; margin-top: 6px; }
.msg-media img { max-width: 250px; border-radius: var(--radius); display: block; }
.msg-media video { max-width: 250px; border-radius: var(--radius); display: block; }

.msg-time { font-size: 10px; color: var(--text-dim); display: block; margin-top: 4px; opacity: 0.5; }
.user-message .msg-time { text-align: right; }

/* Reactions */
.msg-reactions { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.msg-reactions:not(:empty) { display: flex !important; }
.reaction-badge {
  font-size: 12px; padding: 2px 8px; border-radius: 12px;
  background: var(--bg-hover); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.2s ease;
  display: inline-flex; align-items: center; gap: 2px;
}
.reaction-badge:hover { background: rgba(var(--theme-primary-rgb), 0.15); border-color: var(--theme-primary); }
.reaction-badge.has-reacted { background: rgba(var(--theme-primary-rgb), 0.15); border-color: var(--theme-primary); }
.reaction-badge .reaction-count { font-size: 10px; color: var(--text-muted); margin-left: 2px; }

/* Message actions */
.message .msg-actions { position: absolute; top: -8px; right: -4px; display: none; gap: 2px; z-index: 5; }
.user-message .msg-actions { right: auto; left: -4px; }
.message:hover .msg-actions { display: flex; }
.msg-action-btn {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 50%; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 12px; color: var(--text-muted);
  transition: all 0.2s ease;
}
.msg-action-btn:hover { color: var(--theme-primary); border-color: var(--theme-primary); box-shadow: 0 0 8px var(--border-glow); }

/* Typing indicator */
#typing-indicator { display: flex; align-items: center; gap: 8px; padding: 8px 16px; }
#typing-indicator.hidden { display: none; }
.typing-avatar { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; opacity: 0.8; }
.typing-dots { display: flex; gap: 3px; align-items: center; }
.dot { width: 6px; height: 6px; background: var(--theme-primary); border-radius: 50%; animation: bounce-dot 1.4s ease-in-out infinite; }
.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
.typing-text { font-size: 11px; color: var(--text-muted); font-style: italic; }

/* Slash command palette */
#slash-cmd-palette {
  position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: var(--bg-card); border: 1px solid var(--theme-primary);
  border-radius: var(--radius); padding: 6px; min-width: 280px; max-width: 90%;
  box-shadow: 0 0 30px var(--theme-primary-glow);
  backdrop-filter: blur(10px);
  animation: pop-in 0.2s ease-out;
}
.slash-cmd-list { display: flex; flex-direction: column; gap: 2px; }
.slash-cmd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s ease;
}
.slash-cmd-item:hover, .slash-cmd-item.selected { background: rgba(var(--theme-primary-rgb), 0.15); }
.slash-cmd-item-icon { font-size: 16px; flex-shrink: 0; }
.slash-cmd-item-name { font-size: 13px; font-weight: 600; color: var(--theme-primary); }
.slash-cmd-item-desc { font-size: 11px; color: var(--text-muted); margin-left: auto; }

/* Media preview */
#media-preview { padding: 6px 16px 0; flex-shrink: 0; }
#media-preview:not(.hidden) { display: flex; align-items: center; gap: 8px; }
.media-preview-item { position: relative; display: inline-flex; align-items: center; }
.media-preview-item img, .media-preview-item video {
  width: 60px; height: 60px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--border);
}
.media-preview-remove {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--red); color: var(--red);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 12px; line-height: 1;
}
.media-preview-remove:hover { background: rgba(239, 68, 68, 0.2); }

/* Chat Input */
#chat-input-area {
  padding: 10px 12px 14px; border-top: 1px solid var(--border);
  flex-shrink: 0; background: var(--bg-surface); position: relative;
}
#chat-input-wrapper {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 4px 4px 8px;
  transition: all 0.2s ease;
}
#chat-input-wrapper:focus-within {
  border-color: var(--theme-primary);
  box-shadow: 0 0 20px var(--theme-primary-glow);
}
.attach-btn {
  background: none; border: none; color: var(--text-muted);
  padding: 6px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; flex-shrink: 0;
  min-width: var(--touch-target);
  min-height: var(--touch-target);
}
.attach-btn:hover { color: var(--theme-primary); background: var(--bg-hover); }
#chat-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 15px; font-family: var(--font); padding: 8px 0;
}
#chat-input::placeholder { color: var(--text-dim); opacity: 0.6; }
#send-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: var(--theme-gradient);
  color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  opacity: 0.4; transform: scale(0.9);
  transition: all 0.2s ease;
}
#send-btn.active { opacity: 1; transform: scale(1); }
#send-btn.active:hover { box-shadow: 0 0 20px var(--theme-primary-glow); }
#send-btn:disabled { cursor: default; }

/* ===================================================================
   THOUGHTS
   =================================================================== */
#thoughts-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }

.thought-item {
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-card);
  animation: msg-in 0.3s ease-out; position: relative;
  transition: all 0.2s ease;
}
.thought-item:hover { border-color: var(--border-glow); box-shadow: 0 0 12px var(--border-glow); }
.thought-item.organized { border-color: rgba(16, 185, 129, 0.2); }
.thought-time { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.thought-text { font-size: 14px; color: var(--text); line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.thought-date-divider {
  font-size: 11px; color: var(--theme-primary); text-transform: uppercase; letter-spacing: 2px;
  padding: 8px 0 4px; opacity: 0.5; border-top: 1px solid var(--border); margin-top: 8px;
}
.thought-date-divider:first-child { border-top: none; margin-top: 0; }
.organized-result {
  padding: 16px; border-radius: var(--radius);
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.04);
  margin-bottom: 12px; font-size: 13px; line-height: 1.6; white-space: pre-wrap;
}
.thought-actions { display: flex; gap: 6px; margin-top: 8px; opacity: 0; transition: opacity 0.2s ease; }
.thought-item:hover .thought-actions { opacity: 1; }
.thought-action-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px 10px; font-size: 11px; color: var(--text-muted);
  cursor: pointer; transition: all 0.2s ease;
  display: flex; align-items: center; gap: 4px;
}
.thought-action-btn:hover { color: var(--theme-primary); border-color: var(--theme-primary); }
.thought-action-btn.delete-btn:hover { color: var(--red); border-color: var(--red); }
.thought-edit-textarea {
  width: 100%; min-height: 60px;
  background: var(--bg-input); border: 1px solid var(--theme-primary);
  border-radius: var(--radius); padding: 10px 12px;
  color: var(--text); font-size: 14px; font-family: var(--font);
  resize: vertical; outline: none;
  box-shadow: 0 0 12px var(--theme-primary-glow);
}
.thought-edit-btns { display: flex; gap: 8px; margin-top: 6px; }
.thought-edit-btns button {
  padding: 4px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-hover);
  color: var(--text); font-size: 12px; cursor: pointer; transition: all 0.2s ease;
}
.thought-edit-btns button.save-btn { border-color: var(--theme-primary); color: var(--theme-primary); }
.thought-edit-btns button:hover { background: rgba(var(--theme-primary-rgb), 0.15); }

/* Thought processing */
#thoughts-processed-section { padding: 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; max-height: 40%; overflow-y: auto; }
.processed-card {
  border-radius: var(--radius);
  border: 1px solid rgba(var(--theme-secondary-rgb), 0.3);
  background: rgba(var(--theme-secondary-rgb), 0.06);
  padding: 16px;
}
.processed-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.processed-title { font-size: 14px; font-weight: 700; color: var(--theme-secondary); display: flex; align-items: center; gap: 6px; }
.processed-dismiss { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: var(--radius-sm); }
.processed-dismiss:hover { color: var(--red); }
.processed-summary { font-size: 13px; color: var(--text); line-height: 1.6; margin-bottom: 12px; }
.processed-section-label { font-size: 11px; font-weight: 700; color: var(--theme-primary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; margin-top: 12px; }
.processed-clarification { font-size: 13px; color: var(--text-muted); padding: 6px 10px; border-left: 2px solid var(--theme-primary); margin-bottom: 4px; }
.processed-suggestion {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: var(--radius); background: var(--bg-hover);
  border: 1px solid var(--border); margin-bottom: 6px;
}
.processed-suggestion-text { flex: 1; font-size: 13px; color: var(--text); }
.processed-suggestion-btn {
  padding: 4px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--theme-primary);
  background: rgba(var(--theme-primary-rgb), 0.15); color: var(--theme-primary);
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; flex-shrink: 0;
}
.processed-suggestion-btn:hover { background: rgba(var(--theme-primary-rgb), 0.25); box-shadow: 0 0 10px var(--theme-primary-glow); }
.processing-indicator {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid rgba(var(--theme-secondary-rgb), 0.2);
  background: rgba(var(--theme-secondary-rgb), 0.04);
}
.processing-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(var(--theme-secondary-rgb), 0.15);
  border-top-color: var(--theme-secondary); border-radius: 50%;
  animation: spin 1s linear infinite;
}
.processing-text { font-size: 13px; color: var(--theme-secondary); }

#thought-input-area { padding: 10px 12px 14px; border-top: 1px solid var(--border); flex-shrink: 0; background: var(--bg-surface); }
#thought-input-wrapper {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 8px 8px 12px;
  transition: all 0.2s ease;
}
#thought-input-wrapper:focus-within { border-color: var(--theme-primary); box-shadow: 0 0 20px var(--theme-primary-glow); }
#thought-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 14px; font-family: var(--font);
  resize: none; line-height: 1.5; max-height: 120px;
}
#thought-input::placeholder { color: var(--text-dim); opacity: 0.6; }
.organize-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; flex-shrink: 0;
  min-width: var(--touch-target);
  min-height: var(--touch-target);
}
.organize-btn:hover { color: var(--theme-primary); border-color: var(--theme-primary); }
#thought-send-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--theme-gradient);
  color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  opacity: 0.4; transition: all 0.2s ease;
}
#thought-send-btn.active { opacity: 1; }

/* ===================================================================
   BRIEFINGS
   =================================================================== */
#briefings-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.briefing-card {
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-card); overflow: hidden;
  cursor: pointer; transition: all 0.2s ease;
  animation: msg-in 0.3s ease-out;
}
.briefing-card:hover { border-color: var(--theme-primary); box-shadow: 0 0 16px var(--theme-primary-glow); }
.briefing-card-header { display: flex; gap: 12px; padding: 16px; align-items: flex-start; }
.briefing-thumb { width: 80px; height: 60px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); background: var(--bg-input); }
.briefing-thumb-placeholder {
  width: 80px; height: 60px; border-radius: var(--radius-sm); flex-shrink: 0;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(var(--theme-primary-rgb),0.1), rgba(var(--theme-secondary-rgb),0.08));
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.briefing-card-meta { flex: 1; min-width: 0; }
.briefing-card-date { font-size: 11px; color: var(--theme-primary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.briefing-card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.briefing-card-expand { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.briefing-card-body { padding: 0 16px 16px; display: none; }
.briefing-card.expanded .briefing-card-body { display: block; }
.briefing-card.expanded .briefing-card-expand { display: none; }
.briefing-text { font-size: 13px; color: var(--text); line-height: 1.6; }
.briefing-text strong { font-weight: 700; }
.briefing-text em { font-style: italic; }
.briefing-text a { color: var(--cyan); }
.briefing-text blockquote { border-left: 3px solid var(--theme-primary); padding: 6px 12px; margin: 6px 0; background: rgba(var(--theme-primary-rgb),0.05); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.briefing-text .inline-code { background: rgba(0,0,0,0.3); padding: 1px 6px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.9em; color: var(--green); }
.briefing-video { margin-top: 12px; border-radius: var(--radius); overflow: hidden; }
.briefing-video video, .briefing-video iframe { width: 100%; border-radius: var(--radius); display: block; }

/* ===================================================================
   MAIL
   =================================================================== */
#mail-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.mail-card {
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-card); overflow: hidden;
  cursor: pointer; transition: all 0.2s ease;
  animation: msg-in 0.3s ease-out;
  padding: 14px 16px;
}
.mail-card:hover { border-color: var(--border-glow); box-shadow: 0 0 12px var(--border-glow); }
.mail-card.unread {
  border-left: 3px solid var(--theme-primary);
  background: rgba(var(--theme-primary-rgb), 0.05);
}
.mail-card-header { display: flex; align-items: flex-start; gap: 10px; }
.mail-card-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--theme-primary); flex-shrink: 0; margin-top: 6px;
  box-shadow: 0 0 6px var(--theme-primary-glow);
}
.mail-card.read .mail-card-dot { display: none; }
.mail-card-meta { flex: 1; min-width: 0; }
.mail-card-sender { font-size: 14px; font-weight: 700; color: var(--text); }
.mail-card-subject { font-size: 13px; color: var(--text); margin-top: 2px; }
.mail-card-preview { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
.mail-card-date { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.mail-card-body {
  padding: 12px 0 0; display: none;
  font-size: 13px; color: var(--text); line-height: 1.6;
  border-top: 1px solid var(--border); margin-top: 10px;
}
.mail-card.expanded .mail-card-body { display: block; }
.mail-card-body iframe { width: 100%; min-height: 300px; border: none; border-radius: var(--radius); }
.mail-card-body .mail-html-content { white-space: pre-wrap; word-wrap: break-word; }

/* ===================================================================
   FINANCE
   =================================================================== */
#finance-stats-bar {
  flex-shrink: 0; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 16px; flex-wrap: wrap;
  background: var(--bg-surface);
}
.finance-stat-item { display: flex; flex-direction: column; gap: 2px; }
.finance-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.finance-stat-value { font-size: 18px; font-weight: 700; color: var(--text); font-family: var(--font-mono); }
.finance-stat-value.purple { color: var(--theme-primary); }
.finance-stat-value.green { color: var(--green); }
.finance-stat-value.red { color: var(--red); }

/* Analytics chart — pure CSS bars */
.finance-analytics { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.finance-analytics-header {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  width: 100%;
}
.finance-month-name {
  font-weight: 700; font-size: 14px; color: var(--text);
  text-transform: capitalize;
}
.finance-chart {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 0 2px;
  width: 100%;
}
.finance-empty-chart {
  font-size: 12px; color: var(--text-muted); padding: 6px 0; font-style: italic;
}
.finance-cat-row {
  display: grid;
  grid-template-columns: 110px 1fr 90px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.finance-cat-name {
  color: var(--text-muted); text-transform: capitalize;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.finance-cat-bar-track {
  height: 8px; background: var(--bg-elevated, rgba(255,255,255,0.05));
  border-radius: 4px; overflow: hidden;
}
.finance-cat-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.4s ease;
}
.finance-cat-bar-fill.debit {
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-primary-dim, var(--theme-primary)));
}
.finance-cat-bar-fill.credit {
  background: linear-gradient(90deg, var(--green), color-mix(in srgb, var(--green) 60%, transparent));
}
.finance-cat-amt {
  font-family: var(--font-mono); font-weight: 600;
  color: var(--text); text-align: right;
  white-space: nowrap;
}

#finance-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.tx-card {
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-card); padding: 14px 16px;
  transition: all 0.2s ease;
  display: flex; align-items: center; gap: 14px;
}
.tx-card:hover { border-color: var(--border-glow); box-shadow: 0 0 12px var(--border-glow); }
.tx-card.unlabeled {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.04);
}
.tx-amount {
  font-size: 20px; font-weight: 700;
  font-family: var(--font-mono); flex-shrink: 0;
  min-width: 80px; text-align: right;
}
.tx-amount.debit { color: var(--red); }
.tx-amount.credit { color: var(--green); }
.tx-info { flex: 1; min-width: 0; }
.tx-merchant { font-size: 14px; font-weight: 600; color: var(--text); }
.tx-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.tx-label {
  display: inline-block; padding: 3px 10px;
  border-radius: 12px; font-size: 11px; font-weight: 600;
  margin-top: 6px;
  background: rgba(var(--theme-primary-rgb), 0.15); border: 1px solid var(--theme-primary);
  color: var(--theme-primary);
}
.tx-label-btn {
  display: inline-block; padding: 3px 12px;
  border-radius: 12px; font-size: 11px; font-weight: 600;
  margin-top: 6px; cursor: pointer;
  background: rgba(245, 158, 11, 0.1); border: 1px solid var(--amber);
  color: var(--amber); transition: all 0.2s ease;
}
.tx-label-btn:hover { background: rgba(245, 158, 11, 0.2); box-shadow: 0 0 8px var(--amber-glow); }
.tx-label-dropdown {
  position: absolute; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 12px var(--border-glow);
  z-index: 100; min-width: 140px; overflow: hidden;
  animation: pop-in 0.15s ease-out;
}
.tx-label-dropdown-item {
  display: block; width: 100%;
  padding: 8px 14px; border: none; background: none;
  color: var(--text); font-size: 13px; text-align: left;
  cursor: pointer; transition: all 0.15s ease;
}
.tx-label-dropdown-item:hover { background: var(--bg-hover); color: var(--theme-primary); }

/* ===================================================================
   TIMELINE / ARIA DAY
   =================================================================== */
#timeline-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex; gap: 14px; position: relative;
  padding: 0 0 24px 0; animation: msg-in 0.3s ease-out;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: 15px; top: 32px; bottom: 0;
  width: 2px; background: linear-gradient(180deg, var(--theme-primary), transparent);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--theme-primary); background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; z-index: 1;
  box-shadow: 0 0 8px var(--theme-primary-glow);
}
.timeline-content { flex: 1; padding-top: 2px; }
.timeline-time { font-size: 11px; color: var(--theme-primary); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }
.timeline-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.timeline-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.timeline-mood { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: flex; align-items: center; gap: 4px; }

/* ===================================================================
   SETTINGS PAGE
   =================================================================== */
#settings-view {
  flex: 1; overflow-y: auto; padding: 20px;
  max-width: 600px; margin: 0 auto; width: 100%;
}
.settings-section {
  margin-bottom: 24px;
}
.settings-section-title {
  font-size: 12px; font-weight: 700; color: var(--theme-primary);
  text-transform: uppercase; letter-spacing: 2px;
  margin-bottom: 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.settings-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px;
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; gap: 12px;
}
.settings-row + .settings-row { border-top: 1px solid var(--border-light); }
.settings-label { font-size: 14px; color: var(--text); font-weight: 500; }
.settings-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.settings-input {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px;
  color: var(--text); font-size: 14px; outline: none;
  transition: all 0.2s ease; max-width: 200px;
}
.settings-input:focus { border-color: var(--theme-primary); box-shadow: 0 0 12px var(--theme-primary-glow); }
.settings-btn {
  padding: 8px 20px; border-radius: var(--radius-sm);
  border: 1px solid var(--theme-primary);
  background: rgba(var(--theme-primary-rgb), 0.15);
  color: var(--theme-primary); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease;
  white-space: nowrap;
}
.settings-btn:hover { background: rgba(var(--theme-primary-rgb), 0.25); box-shadow: 0 0 12px var(--theme-primary-glow); }
.settings-btn.danger { border-color: var(--red); color: var(--red); background: rgba(239, 68, 68, 0.1); }
.settings-btn.danger:hover { background: rgba(239, 68, 68, 0.2); box-shadow: 0 0 12px var(--red-glow); }
.settings-btn.success { border-color: var(--green); color: var(--green); background: rgba(16, 185, 129, 0.1); }
.settings-btn.success:hover { background: rgba(16, 185, 129, 0.2); box-shadow: 0 0 12px var(--green-glow); }

/* Theme picker */
.theme-picker { display: flex; gap: 12px; }
.theme-option {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--border); cursor: pointer;
  transition: all 0.2s ease; position: relative;
}
.theme-option:hover { transform: scale(1.1); }
.theme-option.active { border-color: var(--theme-primary); box-shadow: 0 0 12px var(--theme-primary-glow); }
.theme-option.active::after {
  content: "✓"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 700;
}
.theme-option.purple { background: linear-gradient(135deg, #a855f7, #ec4899); }
.theme-option.pink { background: linear-gradient(135deg, #ec4899, #f472b6); }
.theme-option.cyan { background: linear-gradient(135deg, #22d3ee, #06b6d4); }

/* Toggle switch */
.toggle-switch {
  position: relative; width: 44px; height: 24px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 12px; transition: all 0.3s ease;
}
.toggle-slider::before {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-muted); transition: all 0.3s ease;
}
.toggle-switch input:checked + .toggle-slider {
  background: rgba(var(--theme-primary-rgb), 0.3);
  border-color: var(--theme-primary);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--theme-primary);
  box-shadow: 0 0 6px var(--theme-primary-glow);
}

/* Connected accounts */
.connected-account {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
}
.connected-account + .connected-account { border-top: 1px solid var(--border-light); }
.connected-account-icon { font-size: 24px; width: 36px; text-align: center; }
.connected-account-name { flex: 1; font-size: 14px; color: var(--text); }
.connected-account-status { font-size: 12px; color: var(--green); display: flex; align-items: center; gap: 4px; }
.connected-account-status .status-dot { width: 6px; height: 6px; }

/* About section */
.settings-about-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  font-size: 13px;
}
.settings-about-row + .settings-about-row { border-top: 1px solid var(--border-light); }
.settings-about-label { color: var(--text-muted); }
.settings-about-value { color: var(--text); font-family: var(--font-mono); }

/* ===================================================================
   RIGHT INFO PANEL
   =================================================================== */
#info-panel-right {
  width: var(--info-panel-w); flex-shrink: 0;
  background: rgba(15, 15, 23, 0.8);
  backdrop-filter: blur(10px);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto;
  transition: width 0.2s ease, opacity 0.2s ease;
}
#info-panel-right.collapsed { width: 0; opacity: 0; overflow: hidden; border-left: none; }
.info-panel-content { padding: 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.info-panel-avatar {
  display: flex; justify-content: center; position: relative;
  margin-bottom: 4px;
}
.info-panel-avatar svg { filter: drop-shadow(0 0 20px var(--theme-primary-glow)); }
.info-panel-online-dot {
  position: absolute; bottom: 8px; right: calc(50% - 32px);
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--green); border: 3px solid var(--bg-surface);
  box-shadow: 0 0 8px var(--green);
}
.info-panel-name {
  text-align: center; font-size: 18px; font-weight: 800;
  background: var(--theme-gradient-text);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.info-panel-mood {
  text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
}
.info-panel-bars { display: flex; flex-direction: column; gap: 8px; }
.info-bar-item { display: flex; flex-direction: column; gap: 4px; }
.info-bar-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.info-bar { width: 100%; height: 6px; border-radius: 3px; background: var(--bg-input); overflow: hidden; }
.info-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.info-bar-fill.mood-fill { background: var(--theme-gradient); }
.info-bar-fill.energy-fill { background: linear-gradient(90deg, var(--cyan), var(--theme-primary)); }
.info-bar-fill.love-fill { background: linear-gradient(90deg, var(--theme-secondary), var(--red)); }
.info-panel-activity {
  font-size: 13px; color: var(--text); padding: 10px 14px;
  border-radius: var(--radius); background: var(--bg-card);
  border: 1px solid var(--border);
}
.info-panel-stats { display: flex; flex-direction: column; gap: 6px; }
.info-stat-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-muted);
}
.info-stat-row span:last-child { color: var(--text); font-family: var(--font-mono); }
.info-panel-section-title {
  font-size: 11px; font-weight: 700; color: var(--theme-primary);
  text-transform: uppercase; letter-spacing: 2px; margin-bottom: 6px;
}
.info-panel-memory-text {
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
}
.info-panel-channel-desc {
  font-size: 12px; color: var(--text-muted);
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  line-height: 1.5;
}

/* ===================================================================
   SEARCH OVERLAY
   =================================================================== */
#search-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 8, 13, 0.95);
  backdrop-filter: blur(12px);
  display: flex; flex-direction: column;
}
#search-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px; border-bottom: 1px solid var(--border);
}
#search-input {
  flex: 1; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  color: var(--text); font-size: 16px; outline: none;
  transition: all 0.2s ease;
}
#search-input:focus { border-color: var(--theme-primary); box-shadow: 0 0 20px var(--theme-primary-glow); }
#search-results { flex: 1; overflow-y: auto; padding: 16px; }
.search-hint { color: var(--text-muted); font-size: 14px; text-align: center; padding: 40px 20px; }
.search-result-item {
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 8px; border: 1px solid var(--border);
  background: var(--bg-card); transition: all 0.2s ease;
}
.search-result-item:hover { border-color: var(--border-glow); }
.search-result-item.aria { border-color: rgba(var(--theme-primary-rgb), 0.1); }
.search-result-item.user { border-color: rgba(var(--theme-secondary-rgb), 0.1); }
.search-result-role { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.search-result-item.aria .search-result-role { color: var(--theme-primary); }
.search-result-item.user .search-result-role { color: var(--theme-secondary); }
.search-result-text { font-size: 13px; color: var(--text); line-height: 1.5; opacity: 0.85; }
.search-result-time { font-size: 10px; color: var(--text-dim); margin-top: 4px; opacity: 0.5; }

/* ===================================================================
   CALL OVERLAY
   =================================================================== */
#call-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 8, 13, 0.98);
  backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in 0.3s ease-out;
}
.call-screen {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 40px; max-width: 500px; width: 100%;
}
.call-avatar { margin-bottom: 8px; filter: drop-shadow(0 0 30px var(--theme-primary-glow)); position: relative; }
.call-name {
  font-size: 28px; font-weight: 800;
  background: var(--theme-gradient-text);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.call-status { color: var(--text-muted); font-size: 14px; }
.call-timer { font-size: 20px; font-weight: 700; color: var(--theme-primary); font-family: var(--font-mono); }
.call-controls { display: flex; gap: 20px; margin-top: 24px; }
.call-control-btn {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--bg-card);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s ease;
}
.call-control-btn:hover { border-color: var(--theme-primary); background: var(--bg-hover); box-shadow: 0 0 16px var(--theme-primary-glow); }
.call-control-btn.muted { border-color: var(--red); color: var(--red); }
.end-call-btn { border-color: var(--red); background: rgba(239, 68, 68, 0.1); color: var(--red); }
.end-call-btn:hover { background: rgba(239, 68, 68, 0.2); box-shadow: 0 0 20px var(--red-glow); }

.call-unsupported { color: var(--amber); font-size: 13px; text-align: center; padding: 8px 16px; border: 1px solid rgba(245, 158, 11, 0.2); border-radius: var(--radius); background: rgba(245, 158, 11, 0.05); }
.call-text-fallback { display: flex; gap: 8px; width: 100%; max-width: 400px; margin-top: 8px; }
.call-text-fallback input { flex: 1; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; color: var(--text); font-size: 14px; outline: none; transition: all 0.2s ease; }
.call-text-fallback input:focus { border-color: var(--theme-primary); box-shadow: 0 0 12px var(--theme-primary-glow); }
.call-text-fallback button { padding: 10px 20px; border: none; border-radius: var(--radius); background: var(--theme-gradient); color: #fff; font-weight: 600; cursor: pointer; }

.call-transcript {
  max-width: 500px; width: 100%; max-height: 200px; overflow-y: auto;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card); font-size: 13px; color: var(--text);
  line-height: 1.5; margin-top: 16px;
}
.call-transcript .transcript-line { margin-bottom: 6px; }
.call-transcript .transcript-line.you { color: var(--theme-secondary); }
.call-transcript .transcript-line.aria { color: var(--theme-primary); }

/* Ringing */
.call-avatar.ringing svg { animation: ring-pulse 1.2s ease-in-out infinite; }
@keyframes ring-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px var(--theme-primary-glow)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 50px var(--theme-primary-glow)); }
}
.call-avatar.ringing::before, .call-avatar.ringing::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 120px; height: 120px; margin: -60px 0 0 -60px;
  border: 2px solid var(--theme-primary); border-radius: 50%;
  opacity: 0; pointer-events: none;
  animation: ring-wave 1.5s ease-out infinite;
}
.call-avatar.ringing::after { animation-delay: 0.75s; }
.call-avatar.speaking svg { animation: speak-pulse 0.8s ease-in-out infinite; }
@keyframes speak-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px var(--theme-secondary-glow)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 40px var(--theme-secondary-glow)); }
}

.call-ring-pending { text-align: center; margin-top: 12px; }
.call-ring-pending .ring-msg { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.call-ring-pending .ring-again-btn {
  padding: 10px 28px; border-radius: 24px; border: 1px solid var(--theme-primary);
  background: rgba(var(--theme-primary-rgb), 0.1); color: var(--theme-primary);
  font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s ease;
}
.call-ring-pending .ring-again-btn:hover { box-shadow: 0 0 30px var(--theme-primary-glow); transform: translateY(-1px); }

.call-stt-note { color: var(--amber); font-size: 12px; text-align: center; padding: 6px 14px; border: 1px solid rgba(245, 158, 11, 0.15); border-radius: var(--radius); background: rgba(245, 158, 11, 0.04); }

/* Terminal block */
.terminal-block {
  margin: 8px 0; padding: 12px 14px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5;
  background: #0d0d14; color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.2); border-radius: var(--radius-sm);
  white-space: pre-wrap; word-wrap: break-word; overflow-x: auto;
}
.terminal-block .term-prompt { color: var(--cyan); font-weight: bold; }

/* ===================================================================
   REACTION PICKER
   =================================================================== */
#reaction-picker {
  position: fixed; z-index: 50;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 24px; padding: 6px 10px;
  display: flex; gap: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 12px var(--border-glow);
  backdrop-filter: blur(10px);
  animation: pop-in 0.2s ease-out;
}
.reaction-emoji {
  background: none; border: none; font-size: 20px;
  cursor: pointer; padding: 4px 6px; border-radius: 50%;
  transition: all 0.2s ease;
}
.reaction-emoji:hover { transform: scale(1.3); background: rgba(var(--theme-primary-rgb), 0.15); }
.reaction-emoji.active { background: rgba(var(--theme-primary-rgb), 0.15); box-shadow: 0 0 8px var(--theme-primary-glow); }

/* ===================================================================
   TOAST
   =================================================================== */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--theme-primary);
  border-radius: var(--radius); padding: 12px 20px;
  color: var(--theme-primary); font-size: 14px; z-index: 1000;
  max-width: 80%; text-align: center;
  box-shadow: 0 0 30px var(--theme-primary-glow);
  backdrop-filter: blur(10px);
  animation: toast-in 0.3s ease-out;
}

/* ===================================================================
   DATE SEPARATORS / GROUPING / READ RECEIPTS
   =================================================================== */
.date-divider { display: flex; align-items: center; justify-content: center; margin: 12px 0 8px; gap: 0; }
.date-divider .date-pill {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  padding: 4px 16px; border-radius: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  text-transform: capitalize; letter-spacing: 0.5px;
}
.message.grouped { margin-top: 2px; }
.message.grouped .bubble-content { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.message.no-avatar .bubble-avatar { visibility: hidden; width: 0; overflow: hidden; }
.msg-read-receipt { font-size: 11px; color: var(--theme-primary); opacity: 0.6; margin-left: 4px; display: inline-block; }
.msg-read-receipt.read { color: var(--theme-primary); opacity: 0.7; }
.msg-unread-dot {
  display: inline-block; width: 8px; height: 8px;
  background: var(--theme-primary); border-radius: 50%;
  margin-left: 6px; box-shadow: 0 0 6px var(--theme-primary-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}
.msg-edited-label { font-size: 10px; color: var(--text-dim); opacity: 0.5; margin-left: 4px; font-style: italic; }

/* ===================================================================
   MESSAGE EDITING
   =================================================================== */
.msg-edit-area { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.msg-edit-textarea {
  width: 100%; min-width: 200px;
  background: var(--bg-input); border: 1px solid var(--theme-primary);
  border-radius: var(--radius); padding: 8px 10px;
  color: var(--text); font-size: 14px; font-family: var(--font);
  resize: none; outline: none;
  box-shadow: 0 0 12px var(--theme-primary-glow);
}
.msg-edit-btns { display: flex; gap: 8px; }
.msg-edit-btns button {
  padding: 4px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-hover);
  color: var(--text); font-size: 12px; cursor: pointer; transition: all 0.2s ease;
}
.msg-edit-btns button.save-btn { border-color: var(--theme-primary); color: var(--theme-primary); }
.msg-edit-btns button:hover { background: rgba(var(--theme-primary-rgb), 0.15); }

/* ===================================================================
   VOICE MESSAGE RECORDING / PLAYBACK
   =================================================================== */
.mic-btn {
  background: none; border: none; color: var(--text-muted);
  padding: 6px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; flex-shrink: 0;
  min-width: var(--touch-target);
  min-height: var(--touch-target);
}
.mic-btn:hover { color: var(--theme-primary); background: var(--bg-hover); }
.mic-btn.recording { color: var(--red); animation: pulse-glow 0.8s ease-in-out infinite; }
#recording-indicator {
  display: none; align-items: center; gap: 8px;
  padding: 8px 16px; background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2); border-radius: var(--radius);
  font-size: 13px; color: var(--red); margin-bottom: 6px;
}
#recording-indicator.active { display: flex; }
.recording-dot { width: 10px; height: 10px; background: var(--red); border-radius: 50%; animation: pulse-dot 0.8s ease-in-out infinite; }
#recording-timer { font-family: var(--font-mono); font-weight: 700; }

.voice-msg-player {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius);
  background: rgba(var(--theme-primary-rgb), 0.08); border: 1px solid rgba(var(--theme-primary-rgb), 0.15);
  min-width: 180px;
}
.user-message .voice-msg-player { background: rgba(var(--theme-secondary-rgb), 0.08); border-color: rgba(var(--theme-secondary-rgb), 0.15); }
.voice-msg-play-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--theme-primary); background: rgba(var(--theme-primary-rgb), 0.15);
  color: var(--theme-primary); display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: all 0.2s ease;
}
.voice-msg-play-btn:hover { background: rgba(var(--theme-primary-rgb), 0.25); }
.voice-msg-waveform { flex: 1; display: flex; align-items: center; gap: 2px; height: 24px; }
.voice-msg-waveform .wave-bar { flex: 1; background: rgba(var(--theme-primary-rgb), 0.2); border-radius: 1px; transition: background 0.2s ease; }
.voice-msg-waveform .wave-bar.played { background: var(--theme-primary); }
.voice-msg-duration { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); flex-shrink: 0; }

/* ===================================================================
   SPEAKING INDICATOR
   =================================================================== */
.call-speaking-indicator {
  display: none; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px;
  background: rgba(var(--theme-primary-rgb), 0.08); border: 1px solid var(--theme-primary);
  font-size: 12px; color: var(--theme-primary); margin-top: 4px;
}
.call-speaking-indicator.active { display: flex; }
.call-speaking-indicator .speak-wave { display: flex; gap: 2px; align-items: center; }
.call-speaking-indicator .speak-wave span {
  width: 3px; height: 12px; background: var(--theme-primary); border-radius: 2px;
  animation: speak-wave 0.6s ease-in-out infinite;
}
.call-speaking-indicator .speak-wave span:nth-child(2) { animation-delay: 0.15s; }
.call-speaking-indicator .speak-wave span:nth-child(3) { animation-delay: 0.3s; }

/* ===================================================================
   DIGITAL LIFE / NOTION PANEL
   =================================================================== */
.digital-life-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px;
}
.digital-life-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.digital-life-emoji { font-size: 28px; }
.digital-life-title { font-size: 14px; font-weight: 700; color: var(--text); flex: 1; }
.digital-life-activity {
  font-size: 13px; color: var(--text-muted); line-height: 1.5;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid var(--border-light);
}
.digital-life-meter {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
}
.digital-life-meter-label { font-size: 11px; color: var(--text-muted); min-width: 50px; }
.digital-life-meter-bar {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--bg-input); overflow: hidden;
}
.digital-life-meter-fill {
  height: 100%; border-radius: 3px;
  background: var(--theme-gradient);
  transition: width 0.5s;
}
.digital-life-meter-value { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); min-width: 30px; text-align: right; }

.notion-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  margin-bottom: 12px;
}
.notion-card-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.notion-card-icon { font-size: 20px; }
.notion-card-title { font-size: 13px; font-weight: 700; color: var(--text); flex: 1; }
.notion-watchlist-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; font-size: 13px; color: var(--text);
}
.notion-watchlist-item + .notion-watchlist-item { border-top: 1px solid var(--border-light); }
.notion-watchlist-status {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.notion-watchlist-status.watching { background: var(--cyan); }
.notion-watchlist-status.completed { background: var(--green); }
.notion-watchlist-status.planning { background: var(--amber); }
.notion-schedule-item {
  display: flex; gap: 8px; padding: 6px 0; font-size: 13px;
}
.notion-schedule-time { color: var(--theme-primary); font-family: var(--font-mono); flex-shrink: 0; min-width: 50px; }
.notion-schedule-text { color: var(--text); }
.notion-project-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
}
.notion-project-item + .notion-project-item { border-top: 1px solid var(--border-light); }
.notion-project-name { flex: 1; font-size: 13px; color: var(--text); }
.notion-project-progress { width: 80px; height: 4px; border-radius: 2px; background: var(--bg-input); overflow: hidden; }
.notion-project-progress-fill { height: 100%; border-radius: 2px; background: var(--theme-gradient); }
.notion-project-pct { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.notion-quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.notion-quick-btn {
  padding: 6px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-hover);
  color: var(--text-muted); font-size: 12px; cursor: pointer;
  transition: all 0.2s ease;
}
.notion-quick-btn:hover { border-color: var(--theme-primary); color: var(--theme-primary); }

/* ===================================================================
   RESPONSIVE — Desktop
   =================================================================== */
@media (min-width: 1024px) {
  #info-panel-right { display: flex; }
  .bubble { max-width: 65%; }
}

@media (max-width: 1023px) {
  #info-panel-right { display: none; }
  .bubble { max-width: 75%; }
}

/* ===================================================================
   RESPONSIVE — Tablet / Mobile
   =================================================================== */
@media (max-width: 767px) {
  #channel-list {
    position: fixed; left: var(--server-bar-w); top: 0; bottom: 0;
    z-index: 95; width: 220px;
    transform: translateX(-100%); transition: transform 0.2s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  #channel-list.open { transform: translateX(0); }
  #mobile-drawer-overlay:not(.hidden) { display: block; }
  .mobile-menu-btn { display: flex !important; }
  .bubble { max-width: 85%; }
  .channel-header-desc { display: none; }
}

@media (max-width: 480px) {
  :root { --server-bar-w: 50px; }
  .server-icon { width: 38px; height: 38px; }
  .server-icon-emoji { font-size: 17px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-stat-card { padding: 12px; }
  .dashboard-stat-value { font-size: 18px; }
  .bubble { max-width: 90%; }
  .msg-text { font-size: 14px; }
  .settings-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .settings-input { max-width: 100%; width: 100%; }
}
