/* ============================================
   SYNAPSEMIND v2 — Premium Monochrome Edition
   Crafted by Team CypherSquad for NextGenHacks
   ============================================
   Design Philosophy:
   - Editorial magazine aesthetic
   - Imperfect, human-crafted feel
   - High contrast monochrome with warm paper tones
   - Thin hairline borders, no heavy shadows
   - Serif + monospace + sans-serif typography system
   ============================================ */

/* ─── CSS Custom Properties (hand-picked palette) ─── */
:root {
  /* Core monochrome with warmth */
  --void: #070707;
  --ink: #0f0f0f;
  --charcoal: #161616;
  --slate: #1e1e1e;
  --stone: #252525;
  --pewter: #333333;
  --ash: #4a4a4a;
  --mist: #6e6e6e;
  --fog: #888888;
  --silver: #aaaaaa;
  --pearl: #cccccc;
  --cloud: #e0e0e0;
  --snow: #f0f0f0;
  --paper: #f5f3ef;
  --white: #ffffff;

  /* Accent — single warm ivory for highlights */
  --accent: #d4c5a9;
  --accent-dim: #8a7d65;
  --accent-glow: rgba(212, 197, 169, 0.08);

  /* Typography */
  --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', 'Courier New', monospace;

  /* Spacing — irregular, magazine-like */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 28px;
  --space-xl: 44px;
  --space-xxl: 72px;

  /* Borders — hairline precision */
  --border-hairline: 1px solid var(--pewter);
  --border-subtle: 1px solid var(--stone);
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
}

/* ─── Global Reset ─── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--ink);
  color: var(--snow);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
  letter-spacing: -0.01em;
}

/* Subtle grain texture overlay — gives that "printed" feel */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

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

/* ─── Sidebar — Editorial Masthead Style ─── */
.sidebar {
  width: 280px;
  background: var(--void);
  border-right: var(--border-hairline);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: all 0.3s ease;
}

.sidebar-header {
  padding: 36px 28px 28px;
  border-bottom: var(--border-subtle);
}

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

.logo-mark {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--paper);
  letter-spacing: -0.02em;
  line-height: 1;
}

.logo-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--mist);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 6px;
  margin-left: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  color: var(--fog);
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0;
  background: var(--accent);
  transition: height 0.3s ease;
  border-radius: 1px;
}

.nav-item:hover {
  color: var(--pearl);
  background: var(--charcoal);
}

.nav-item:hover::before {
  height: 18px;
}

.nav-item.active {
  color: var(--paper);
  background: var(--charcoal);
}

.nav-item.active::before {
  height: 28px;
}

.nav-item i {
  font-size: 0.95rem;
  width: 20px;
  text-align: center;
  color: var(--mist);
  transition: color 0.2s ease;
}

.nav-item:hover i,
.nav-item.active i {
  color: var(--accent);
}

/* Section divider in sidebar */
.nav-section {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--ash);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 18px 18px 8px;
  border-top: var(--border-subtle);
  margin-top: 8px;
}

.sidebar-footer {
  padding: 18px 24px;
  border-top: var(--border-subtle);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--charcoal);
  border: 1px solid var(--pewter);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--silver);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 500;
  color: var(--pearl);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}

.user-status {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--ash);
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.user-status::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
}

/* ─── Main Content ─── */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 0;
  min-height: 100vh;
  background: var(--ink);
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 36px 44px 24px;
  border-bottom: var(--border-subtle);
  position: sticky;
  top: 0;
  background: var(--ink);
  z-index: 50;
  backdrop-filter: blur(8px);
}

.header-left h1 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--paper);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.date-display {
  font-family: var(--font-mono);
  color: var(--mist);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 8px;
}

/* Mood quick selector — pill style */
.mood-quick-select {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--charcoal);
  padding: 6px 14px;
  border-radius: 100px;
  border: var(--border-subtle);
}

.mood-quick-select span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--mist);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: 4px;
}

.mood-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 50%;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.mood-btn:hover {
  opacity: 1;
  transform: scale(1.15);
  background: var(--stone);
}

/* ─── Pages ─── */
.pages-container {
  position: relative;
  padding: 32px 44px 44px;
}

.page {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.page.active {
  display: block;
}

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

/* ─── Cards — Paper Editorial Style ─── */
.card {
  background: var(--charcoal);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: var(--border-subtle);
  transition: all 0.3s ease;
  position: relative;
}

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

.card::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::after {
  opacity: 0.5;
}

.card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  letter-spacing: -0.01em;
}

.card h3 i {
  color: var(--accent-dim);
  font-size: 0.9em;
}

/* ─── Section Label ─── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--mist);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  margin-bottom: 12px;
  display: block;
}

/* ─── Stats Grid — Data Terminal Style ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--charcoal);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: var(--border-subtle);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

/* Subtle corner accent on stat cards */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.stat-card:hover::before {
  opacity: 0.7;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--stone);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 14px;
  border: 1px solid var(--pewter);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--paper);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--mist);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* ─── Dashboard Grid ─── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.chart-container {
  height: 260px;
  position: relative;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ─── Tips — Editorial Pull Quote Style ─── */
.tips-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tip-item {
  background: var(--ink);
  border-left: 2px solid var(--accent);
  padding: 14px 18px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--silver);
  transition: all 0.3s ease;
  font-style: italic;
  position: relative;
}

.tip-item:hover {
  background: var(--slate);
  border-left-color: var(--paper);
  color: var(--cloud);
}

/* ─── Journal ─── */
.journal-container {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
}

.journal-input-area textarea {
  width: 100%;
  height: 220px;
  background: var(--ink);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  color: var(--pearl);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  resize: vertical;
  transition: all 0.3s ease;
  line-height: 1.7;
}

.journal-input-area textarea:focus {
  outline: none;
  border-color: var(--pewter);
  background: var(--slate);
}

.journal-input-area textarea::placeholder {
  color: var(--ash);
  font-style: italic;
}

.journal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--paper);
}

.btn-primary:hover {
  background: var(--white);
  color: var(--void);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--fog);
  border: var(--border-hairline);
}

.btn-secondary:hover {
  background: var(--stone);
  color: var(--pearl);
  border-color: var(--ash);
}

.btn-large {
  padding: 14px 28px;
  font-size: 0.85rem;
}

.btn-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-send:hover {
  background: var(--white);
  transform: scale(1.08);
}

/* ─── Journal List ─── */
.journal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 500px;
  overflow-y: auto;
}

.journal-item {
  background: var(--ink);
  border-radius: var(--radius-md);
  padding: 18px;
  border-left: 2px solid var(--pewter);
  transition: all 0.3s ease;
}

.journal-item:hover {
  background: var(--slate);
  border-left-color: var(--accent);
}

.journal-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.journal-item-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ash);
  letter-spacing: 0.05em;
}

.journal-item-sentiment {
  font-family: var(--font-mono);
  padding: 3px 10px;
  border-radius: 2px;
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sentiment-positive {
  background: rgba(212, 197, 169, 0.1);
  color: var(--accent);
  border: 1px solid rgba(212, 197, 169, 0.2);
}

.sentiment-negative {
  background: rgba(170, 170, 170, 0.05);
  color: var(--mist);
  border: 1px solid rgba(170, 170, 170, 0.1);
}

.sentiment-neutral {
  background: rgba(74, 74, 74, 0.1);
  color: var(--fog);
  border: 1px solid rgba(74, 74, 74, 0.15);
}

.journal-item-content {
  font-size: 0.85rem;
  color: var(--silver);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Chat — Typewriter Editorial Style ─── */
.chat-container {
  max-width: 760px;
  margin: 0 auto;
  background: var(--charcoal);
  border-radius: var(--radius-lg);
  border: var(--border-subtle);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 28px;
  border-bottom: var(--border-subtle);
  background: var(--ink);
}

.ai-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--stone);
  border: 1px solid var(--pewter);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1rem;
  font-family: var(--font-mono);
}

.ai-info h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--paper);
  letter-spacing: -0.01em;
}

.ai-status {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--ash);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.ai-status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: slideIn 0.35s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-message {
  align-self: flex-start;
}

.user-message {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--stone);
  border: 1px solid var(--pewter);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.user-message .message-avatar {
  background: var(--pewter);
  color: var(--snow);
  border-color: var(--ash);
}

.message-content {
  background: var(--ink);
  padding: 14px 18px;
  border-radius: 4px 12px 12px 12px;
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--silver);
  border: var(--border-subtle);
}

.user-message .message-content {
  background: var(--stone);
  color: var(--cloud);
  border-radius: 12px 4px 12px 12px;
  border-color: var(--pewter);
}

.message-time {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--ash);
  margin-top: 6px;
  display: block;
  letter-spacing: 0.05em;
}

.chat-input-area {
  padding: 18px 28px;
  border-top: var(--border-subtle);
  background: var(--ink);
}

.chat-input-wrapper {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.chat-input-wrapper input {
  flex: 1;
  background: var(--charcoal);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--pearl);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.chat-input-wrapper input:focus {
  outline: none;
  border-color: var(--pewter);
  background: var(--slate);
}

.chat-input-wrapper input::placeholder {
  color: var(--ash);
  font-style: italic;
}

.quick-replies {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-reply {
  background: var(--charcoal);
  border: var(--border-subtle);
  border-radius: 100px;
  padding: 7px 14px;
  font-size: 0.75rem;
  color: var(--mist);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
}

.quick-reply:hover {
  background: var(--stone);
  color: var(--pearl);
  border-color: var(--ash);
}

/* ─── Focus Timer ─── */
.focus-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.timer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px;
}

.timer-display {
  margin-bottom: 28px;
}

.timer-circle {
  position: relative;
  width: 240px;
  height: 240px;
}

.timer-circle svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.timer-track {
  fill: none;
  stroke: var(--stone);
  stroke-width: 2;
}

.timer-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 2.8rem;
  font-weight: 400;
  color: var(--paper);
  letter-spacing: 0.05em;
}

.timer-separator {
  animation: blink 1s infinite;
  color: var(--accent);
}

.timer-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.timer-presets {
  display: flex;
  gap: 6px;
}

.preset-btn {
  background: var(--ink);
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-size: 0.75rem;
  color: var(--mist);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.preset-btn.active,
.preset-btn:hover {
  background: var(--stone);
  color: var(--pearl);
  border-color: var(--ash);
}

/* Breathing */
.breathing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.breathing-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--stone);
  border: 2px solid var(--pewter);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  animation: breathe 8s ease-in-out infinite;
  color: var(--accent);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1rem;
  opacity: 0.9;
  letter-spacing: 0.05em;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.25); opacity: 1; }
}

.breathing-circle.paused {
  animation: none;
}

/* ─── Community ─── */
.community-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
}

.community-post-card .community-input {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.community-post-card textarea {
  width: 100%;
  height: 100px;
  background: var(--ink);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--pearl);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  resize: vertical;
  transition: all 0.2s ease;
  line-height: 1.6;
}

.community-post-card textarea:focus {
  outline: none;
  border-color: var(--pewter);
  background: var(--slate);
}

.community-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.community-post {
  background: var(--charcoal);
  border-radius: var(--radius-md);
  padding: 22px;
  border: var(--border-subtle);
  transition: all 0.3s ease;
}

.community-post:hover {
  border-color: var(--pewter);
}

.community-post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.community-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--stone);
  border: 1px solid var(--pewter);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.8rem;
}

.community-post-meta {
  display: flex;
  flex-direction: column;
}

.community-username {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--pearl);
  letter-spacing: 0.01em;
}

.community-time {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--ash);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.community-post-content {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--silver);
  margin-bottom: 14px;
}

.community-post-actions {
  display: flex;
  gap: 18px;
}

.community-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--ash);
  cursor: pointer;
  transition: all 0.2s ease;
  background: none;
  border: none;
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
}

.community-action:hover {
  color: var(--accent);
}

.community-action.liked {
  color: var(--accent);
}

/* ─── Cognitive Load ─── */
.cognitive-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

.cognitive-dashboard {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 28px;
  align-items: center;
}

.cognitive-score-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.score-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--stone);
  border: 2px solid var(--pewter);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 40px var(--accent-glow);
}

.score-value {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--paper);
  letter-spacing: -0.02em;
}

.score-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--mist);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.cognitive-factors-detailed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.factor-item {
  display: grid;
  grid-template-columns: 1fr 1fr 36px;
  align-items: center;
  gap: 10px;
}

.factor-name {
  font-size: 0.8rem;
  color: var(--mist);
  letter-spacing: 0.01em;
}

.factor-bar {
  height: 4px;
  background: var(--stone);
  border-radius: 2px;
  overflow: hidden;
}

.factor-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 1s ease;
}

.factor-fill.medium {
  background: var(--silver);
}

.factor-fill.high {
  background: var(--pearl);
}

.factor-score {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--mist);
  text-align: right;
}

.cognitive-factors {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.factor-tag {
  font-family: var(--font-mono);
  padding: 5px 12px;
  border-radius: 2px;
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid;
}

.factor-tag.low {
  background: rgba(212, 197, 169, 0.06);
  color: var(--accent-dim);
  border-color: rgba(212, 197, 169, 0.15);
}

.factor-tag.medium {
  background: rgba(170, 170, 170, 0.04);
  color: var(--mist);
  border-color: rgba(170, 170, 170, 0.1);
}

.factor-tag.high {
  background: rgba(240, 240, 240, 0.04);
  color: var(--fog);
  border-color: rgba(240, 240, 240, 0.1);
}

/* ─── Toast Notifications ─── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--charcoal);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s ease;
  min-width: 280px;
  font-size: 0.85rem;
  color: var(--silver);
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toast-success {
  border-left: 2px solid var(--accent);
}

.toast-error {
  border-left: 2px solid var(--mist);
}

.toast-info {
  border-left: 2px solid var(--pearl);
}

/* ─── Responsive ─── */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid,
  .journal-container,
  .focus-container,
  .cognitive-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 64px;
  }
  .sidebar .logo-text,
  .sidebar .logo-sub,
  .sidebar .nav-item span,
  .sidebar .nav-section,
  .sidebar .user-details {
    display: none;
  }
  .main-content {
    margin-left: 64px;
  }
  .pages-container {
    padding: 20px 16px;
  }
  .main-header {
    padding: 20px 16px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .header-left h1 {
    font-size: 1.6rem;
  }
  .mood-quick-select span {
    display: none;
  }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--ink);
}

::-webkit-scrollbar-thumb {
  background: var(--stone);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--pewter);
}

/* ─── Animations ─── */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 4px rgba(212, 197, 169, 0.05); }
  50% { box-shadow: 0 0 12px rgba(212, 197, 169, 0.15); }
}

/* ─── Recent Journal Preview ─── */
.journal-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.journal-preview-item {
  background: var(--ink);
  border-radius: var(--radius-md);
  padding: 14px;
  border-left: 2px solid var(--pewter);
  transition: all 0.3s ease;
}

.journal-preview-item:hover {
  background: var(--slate);
  border-left-color: var(--accent);
}

.journal-preview-text {
  font-size: 0.8rem;
  color: var(--silver);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

.journal-preview-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.journal-preview-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ash);
  letter-spacing: 0.05em;
}

.journal-preview-badge {
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ─── Focus History ─── */
.focus-history {
  margin-top: 16px;
}

.focus-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.focus-stat-item {
  text-align: center;
  padding: 18px;
  background: var(--ink);
  border-radius: var(--radius-md);
  border: var(--border-subtle);
}

.focus-stat-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--paper);
  letter-spacing: -0.02em;
}

.focus-stat-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--ash);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ─── NEW: Gratitude Wall ─── */
.gratitude-wall {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.gratitude-brick {
  background: var(--ink);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all 0.3s ease;
  cursor: default;
  position: relative;
}

.gratitude-brick:hover {
  background: var(--slate);
  border-color: var(--pewter);
  transform: translateY(-2px);
}

.gratitude-brick-number {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--ash);
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.gratitude-brick-text {
  font-size: 0.85rem;
  color: var(--silver);
  line-height: 1.6;
  font-style: italic;
}

.gratitude-brick-date {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--ash);
  letter-spacing: 0.05em;
  margin-top: 10px;
}

/* ─── NEW: Habit Tracker ─── */
.habit-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 16px;
}

.habit-day {
  aspect-ratio: 1;
  background: var(--ink);
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--mist);
  transition: all 0.2s ease;
  cursor: pointer;
}

.habit-day:hover {
  border-color: var(--pewter);
  color: var(--pearl);
}

.habit-day.completed {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
  font-weight: 600;
}

.habit-day.today {
  border-color: var(--pearl);
  color: var(--pearl);
}

.habit-legend {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-size: 0.7rem;
  color: var(--mist);
}

.habit-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.habit-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: var(--border-subtle);
}

.habit-legend-dot.done {
  background: var(--accent);
  border-color: var(--accent);
}

/* ─── NEW: Mood Calendar ─── */
.mood-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 16px;
}

.mood-cal-day {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--mist);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.mood-cal-day:hover {
  transform: scale(1.1);
  z-index: 2;
}

.mood-cal-day.mood-great { background: var(--accent); color: var(--ink); }
.mood-cal-day.mood-good { background: rgba(212, 197, 169, 0.4); color: var(--pearl); }
.mood-cal-day.mood-neutral { background: var(--stone); color: var(--silver); }
.mood-cal-day.mood-bad { background: var(--pewter); color: var(--pearl); }
.mood-cal-day.mood-terrible { background: var(--ash); color: var(--snow); }

.mood-cal-day.today {
  border: 1px solid var(--pearl);
}

/* ─── NEW: Soundscapes ─── */
.soundscape-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.soundscape-card {
  background: var(--ink);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.soundscape-card:hover {
  border-color: var(--pewter);
  background: var(--slate);
}

.soundscape-card.playing {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.soundscape-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  opacity: 0.7;
}

.soundscape-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--pearl);
  margin-bottom: 4px;
}

.soundscape-desc {
  font-size: 0.7rem;
  color: var(--mist);
}

.soundscape-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.5s ease;
  transform-origin: left;
}

.soundscape-card.playing .soundscape-wave {
  transform: scaleX(1);
  animation: wave-pulse 2s ease-in-out infinite;
}

@keyframes wave-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ─── NEW: Crisis Resources ─── */
.crisis-card {
  background: var(--ink);
  border: 1px solid rgba(212, 197, 169, 0.15);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 14px;
  transition: all 0.3s ease;
}

.crisis-card:hover {
  border-color: rgba(212, 197, 169, 0.3);
  background: var(--slate);
}

.crisis-card h4 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--paper);
  margin-bottom: 8px;
}

.crisis-card p {
  font-size: 0.85rem;
  color: var(--silver);
  line-height: 1.6;
  margin-bottom: 12px;
}

.crisis-number {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

/* ─── NEW: Weekly Report ─── */
.report-card {
  background: var(--charcoal);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 20px;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: var(--border-subtle);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.report-header h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--paper);
}

.report-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--mist);
  letter-spacing: 0.05em;
}

.report-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.report-stat {
  text-align: center;
  padding: 16px;
  background: var(--ink);
  border-radius: var(--radius-md);
  border: var(--border-subtle);
}

.report-stat-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--paper);
}

.report-stat-label {
  font-size: 0.7rem;
  color: var(--mist);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

.report-insight {
  background: var(--ink);
  border-left: 2px solid var(--accent);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.9rem;
  color: var(--silver);
  line-height: 1.7;
  font-style: italic;
}

/* ─── Export Button ─── */
.export-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.export-btn {
  background: var(--ink);
  border: var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--mist);
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.export-btn:hover {
  background: var(--stone);
  color: var(--pearl);
  border-color: var(--ash);
}

/* ─── Keyboard shortcut hint ─── */
.kb-hint {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--ash);
  letter-spacing: 0.05em;
  margin-left: 8px;
  opacity: 0.6;
}

/* ─── Page title area with breadcrumb feel ─── */
.page-header {
  margin-bottom: 28px;
}

.page-header h2 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--paper);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-header .page-subtitle {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ash);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 8px;
}

/* ─── Empty state ─── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ash);
}

.empty-state-icon {
  font-size: 2.5rem;
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-state-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--mist);
  font-style: italic;
}

/* ─── Divider — editorial style ─── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--pewter), transparent);
  margin: 24px 0;
  opacity: 0.5;
}

/* ─── Inline data badge ─── */
.data-badge {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--ash);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 6px;
  background: var(--ink);
  border-radius: 2px;
  border: var(--border-subtle);
}

@keyframes blink { 0% { opacity: 0.2; } 20% { opacity: 1; } 100% { opacity: 0.2; } }
.typing-dots { animation: blink 1.4s infinite both; }

