/* ============================================================
   JOURNAL3 — Design System & Styles
   Anthropic-inspired, light mode, brown accent, glassmorphism
   Fonts: Playfair Display (serif) + Inter (sans) via Google Fonts
   ============================================================ */

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

/* ─── CSS Custom Properties ───────────────────────────────── */
:root {
  /* Background / Surface */
  --bg:          #FAF8F5;
  --surface:     #F4F0EA;
  --surface-2:   #EAE4DC;
  --surface-3:   #DDD6CB;

  /* Ink / Text */
  --ink:         #1A1207;
  --ink-2:       #3D2E1E;
  --ink-3:       #6B5740;
  --ink-4:       #9E8A74;

  /* Brown Accent (replaces Anthropic orange) */
  --brown:       #7C4D2D;
  --brown-light: #A06840;
  --brown-dark:  #5C3620;
  --brown-xl:    #C5956A;
  --brown-glass: rgba(124,77,45,0.07);
  --brown-glass-hover: rgba(124,77,45,0.12);
  --brown-border:rgba(124,77,45,0.18);

  /* Semantic */
  --white:   #FFFFFF;
  --error:   #C0392B;
  --success: #27AE60;
  --info:    #2980B9;

  /* Mood (1=red → 5=green) */
  --mood-1: #E74C3C;
  --mood-2: #E67E22;
  --mood-3: #F1C40F;
  --mood-4: #82C91E;
  --mood-5: #27AE60;

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:  'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;

  /* Weights */
  --w-light:    300;
  --w-regular:  400;
  --w-medium:   500;
  --w-semibold: 600;
  --w-bold:     700;

  /* Spacing (4px base) */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* Radius */
  --r-sm:   6px;
  --r-md:   12px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26,18,7,0.08);
  --shadow-md: 0 4px 16px rgba(26,18,7,0.1);
  --shadow-lg: 0 12px 40px rgba(26,18,7,0.13);
  --shadow-xl: 0 24px 72px rgba(26,18,7,0.16);

  /* Transitions */
  --t-fast: 140ms ease;
  --t-base: 240ms ease;
  --t-slow: 400ms ease;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--text-base);
  line-height: 1.6;
  min-height: 100vh;
}

img     { max-width: 100%; display: block; }
button  { cursor: pointer; font-family: var(--font-sans); border: none; background: none; }
input, textarea, select { font-family: var(--font-sans); }
a       { color: var(--brown); text-decoration: none; }

/* ═══════════════════════════════════════════════════════════
   LANDING PAGE
═══════════════════════════════════════════════════════════ */

#landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Nav ── */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-12);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,248,245,0.88);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-base);
}

.landing-nav.scrolled { border-color: var(--surface-2); }

.landing-logo {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--w-bold);
  color: var(--brown);
  letter-spacing: -0.025em;
  user-select: none;
}

.landing-logo em {
  font-style: italic;
  color: var(--brown-light);
}

/* ── Hero ── */
.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-24) var(--sp-8) var(--sp-16);
  position: relative;
  overflow: hidden;
}

.particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.landing-hero > *:not(canvas) {
  position: relative;
  z-index: 10;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: var(--w-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brown);
  background: var(--brown-glass);
  border: 1px solid var(--brown-border);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-pill);
  margin-bottom: var(--sp-8);
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 6.5vw, 5.5rem);
  font-weight: var(--w-bold);
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: var(--sp-6);
  max-width: 14ch;
}

.hero-headline em {
  font-style: italic;
  color: var(--brown);
}

.hero-body {
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  font-weight: var(--w-light);
  color: var(--ink-3);
  max-width: 460px;
  line-height: 1.75;
  margin-bottom: var(--sp-10);
}

.hero-cta-group {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--sp-16);
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--brown);
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  padding: var(--sp-3) var(--sp-8);
  border-radius: var(--r-pill);
  transition: all var(--t-base);
  box-shadow: 0 4px 20px rgba(124,77,45,0.28);
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
}

.btn-primary:hover {
  background: var(--brown-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(124,77,45,0.38);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(124,77,45,0.22);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: transparent;
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-pill);
  border: 1.5px solid var(--surface-3);
  transition: all var(--t-fast);
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--brown-border);
  color: var(--brown);
  background: var(--brown-glass);
}

/* ── Hero reviews marquee ── */
.hero-reviews {
  width: 100%;
  max-width: 920px;
  margin: var(--sp-8) auto 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.marquee-row {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: flex;
  gap: var(--sp-4);
  width: max-content;
  animation: marquee-scroll 28s linear infinite;
}

.marquee-row.reverse .marquee-track {
  animation-direction: reverse;
}

.marquee-row:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.review-card {
  width: 280px;
  flex-shrink: 0;
  background: var(--white);
  border: 1px solid var(--surface-2);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.review-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(60, 45, 30, 0.08));
}

.review-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.review-avatar {
  border-radius: 50%;
  background: var(--surface-2);
}

.review-meta {
  display: flex;
  flex-direction: column;
}

.review-name {
  font-size: var(--text-sm);
  font-weight: var(--w-semibold);
  color: var(--ink);
  line-height: 1.2;
}

.review-user {
  font-size: 11px;
  color: var(--ink-3);
}

.review-body {
  margin-top: var(--sp-2);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--ink-2);
}

/* ── Article Layout (Anthropic Style) ── */
.article-page {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.article-header {
  padding: var(--sp-20) var(--sp-6) var(--sp-12);
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.article-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: var(--w-bold);
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: var(--sp-6);
}

.article-header p {
  font-size: var(--text-lg);
  color: var(--ink-3);
  font-weight: var(--w-light);
  max-width: 540px;
  margin: 0 auto;
}

.article-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--sp-6) var(--sp-24);
}

.article-content h2 {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--w-semibold);
  color: var(--ink);
  margin-top: var(--sp-12);
  margin-bottom: var(--sp-4);
  letter-spacing: -0.015em;
}

.article-content p {
  font-size: 1.125rem;
  color: var(--ink-2);
  line-height: 1.8;
  margin-bottom: var(--sp-6);
  font-weight: 300;
}

.article-content strong {
  font-weight: var(--w-medium);
  color: var(--ink);
}

.article-divider {
  width: 40px;
  height: 2px;
  background: var(--brown);
  margin: var(--sp-12) auto;
  opacity: 0.3;
}

/* ── Landing footer ── */
.landing-footer {
  text-align: center;
  padding: var(--sp-8);
  color: var(--ink-4);
  font-size: var(--text-xs);
  border-top: 1px solid var(--surface-2);
}

/* ═══════════════════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════════════════ */

#app {
  display: none;
  min-height: 100vh;
}

#app.active { display: flex; }

/* ── Sidebar (brown glassmorphism pill) ── */
.app-sidebar {
  position: fixed;
  left: var(--sp-5);
  top: 50%;
  transform: translateY(-50%);
  z-index: 300;

  width: 62px;
  border-radius: var(--r-pill);
  padding: var(--sp-5) var(--sp-3);

  /* Brown liquid-glass effect */
  background: rgba(250,248,245,0.72);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(124,77,45,0.22);
  box-shadow:
    0 8px 40px rgba(124,77,45,0.14),
    inset 0 1px 0 rgba(255,255,255,0.7),
    inset 0 -1px 0 rgba(124,77,45,0.06);

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
}

.sidebar-logo {
  font-family: var(--font-serif);
  font-size: 0.6rem;
  font-weight: var(--w-bold);
  color: var(--brown);
  letter-spacing: -0.01em;
  text-align: center;
  margin-bottom: var(--sp-2);
  line-height: 1;
}

.sidebar-divider {
  width: 28px;
  height: 1px;
  background: var(--brown-border);
  margin: var(--sp-2) 0;
  flex-shrink: 0;
}

.sidebar-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-4);
  transition: all var(--t-fast);
  position: relative;
  cursor: pointer;
  background: transparent;
  border: none;
  flex-shrink: 0;
}

.sidebar-btn:hover {
  background: var(--brown-glass-hover);
  color: var(--brown);
}

.sidebar-btn.active {
  background: var(--brown);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(124,77,45,0.38);
}

.sidebar-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Tooltip */
.sidebar-btn::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--ink);
  color: var(--white);
  font-size: 11px;
  font-weight: var(--w-medium);
  padding: 5px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast);
  z-index: 400;
}

.sidebar-btn:hover::after { opacity: 1; }

/* ── Main content ── */
.app-main {
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-10);
  padding-left: 116px; /* Space for the fixed sidebar */
  max-width: 976px;    /* 860px content + 116px padding */
  width: 100%;
  min-height: 100vh;
}

/* ── Top bar ── */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-8);
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.app-greeting {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--w-semibold);
  color: var(--ink);
  letter-spacing: -0.02em;
}

.app-greeting span { color: var(--brown); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: var(--w-semibold);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  letter-spacing: 0.02em;
}

.network-badge.testnet {
  background: rgba(230,126,34,0.1);
  color: #c0680a;
  border: 1px solid rgba(230,126,34,0.25);
}

.network-badge.mainnet {
  background: rgba(39,174,96,0.1);
  color: #1a7a43;
  border: 1px solid rgba(39,174,96,0.25);
}

.wallet-chip {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--r-pill);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  color: var(--ink-2);
  font-weight: var(--w-medium);
}

.wallet-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(39,174,96,0.2);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   PANEL SYSTEM
═══════════════════════════════════════════════════════════ */

.panel { display: none; }

.panel.active {
  display: block;
  animation: fadeUp 0.28s ease both;
}

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

.panel-title {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: var(--w-bold);
  color: var(--ink);
  letter-spacing: -0.025em;
  margin-bottom: var(--sp-2);
}

.panel-subtitle {
  color: var(--ink-3);
  font-size: var(--text-base);
  margin-bottom: var(--sp-8);
  font-weight: var(--w-light);
}

/* ─── Today card ── */
.today-card {
  background: var(--white);
  border: 1px solid var(--surface-2);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  margin-bottom: var(--sp-8);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.today-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brown), var(--brown-xl));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.today-date-label {
  font-size: var(--text-sm);
  font-weight: var(--w-semibold);
  color: var(--ink-3);
  margin-bottom: var(--sp-2);
  letter-spacing: 0.01em;
}

.today-no-entry {
  color: var(--ink-3);
  font-size: var(--text-base);
  margin-bottom: var(--sp-6);
  font-weight: var(--w-light);
}

/* ═══════════════════════════════════════════════════════════
   WRITE FORM
═══════════════════════════════════════════════════════════ */

.write-form { display: flex; flex-direction: column; gap: var(--sp-6); }

.form-group { display: flex; flex-direction: column; gap: var(--sp-2); }

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  color: var(--ink-2);
  letter-spacing: 0.01em;
}

.form-textarea {
  width: 100%;
  min-height: 180px;
  padding: var(--sp-4) var(--sp-5);
  background: var(--white);
  border: 1.5px solid var(--surface-2);
  border-radius: var(--r-md);
  font-size: var(--text-base);
  color: var(--ink);
  line-height: 1.75;
  resize: vertical;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--brown);
  box-shadow: 0 0 0 3px rgba(124,77,45,0.1);
}

.form-textarea::placeholder { color: var(--ink-4); }

/* ── Mood Selector ── */
.mood-selector {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.mood-end-label {
  font-size: var(--text-xs);
  color: var(--ink-4);
  white-space: nowrap;
  width: 72px;
  flex-shrink: 0;
}

.mood-end-label:last-child { text-align: right; }

.mood-steps {
  display: flex;
  gap: var(--sp-2);
  flex: 1;
  justify-content: center;
}

.mood-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.mood-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all var(--t-fast);
  background: var(--surface);
  cursor: pointer;
}

.mood-btn:hover { transform: scale(1.12); border-color: currentColor; }

.mood-btn.selected {
  transform: scale(1.18);
  border-color: currentColor;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.mood-btn-label {
  font-size: 10px;
  color: var(--ink-4);
  text-align: center;
  line-height: 1.2;
}

/* ── Photo Upload ── */
.photo-drop {
  border: 2px dashed var(--surface-3);
  border-radius: var(--r-md);
  padding: var(--sp-6) var(--sp-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  transition: all var(--t-fast);
  background: var(--surface);
  text-align: center;
}

.photo-drop:hover { border-color: var(--brown); background: var(--brown-glass); }
.photo-drop.has-file { border-style: solid; border-color: var(--brown); }

.photo-drop-icon { font-size: 1.75rem; opacity: 0.45; }

.photo-drop-text {
  font-size: var(--text-sm);
  color: var(--ink-3);
}

.photo-drop-hint {
  font-size: var(--text-xs);
  color: var(--ink-4);
  margin-top: 2px;
}

.photo-preview-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--r-md);
}

/* ── Blockchain note ── */
.chain-note {
  font-size: 11px;
  color: var(--ink-4);
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
}

.chain-note-icon { flex-shrink: 0; margin-top: 1px; }

/* ── Form Actions ── */
.form-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  justify-content: flex-end;
}

/* Shared button styles (reuse across app) */
.btn-save {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--brown);
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-pill);
  transition: all var(--t-base);
  box-shadow: 0 2px 10px rgba(124,77,45,0.22);
  cursor: pointer;
  border: none;
}

.btn-save:hover {
  background: var(--brown-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124,77,45,0.3);
}

.btn-save:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: transparent;
  color: var(--ink-3);
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-ghost:hover { background: var(--surface); color: var(--ink-2); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: transparent;
  color: var(--error);
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-pill);
  border: 1.5px solid rgba(192,57,43,0.28);
  cursor: pointer;
  transition: all var(--t-fast);
}

.btn-danger:hover {
  background: rgba(192,57,43,0.06);
  border-color: var(--error);
}

/* ═══════════════════════════════════════════════════════════
   CALENDAR
═══════════════════════════════════════════════════════════ */

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}

.cal-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  color: var(--ink-3);
  cursor: pointer;
  transition: all var(--t-fast);
}

.cal-nav-btn:hover { background: var(--brown-glass); color: var(--brown); border-color: var(--brown-border); }

.cal-month-label {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--w-semibold);
  color: var(--ink);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-weekday {
  text-align: center;
  font-size: 10px;
  font-weight: var(--w-semibold);
  color: var(--ink-4);
  padding: var(--sp-2) 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cal-day {
  height: 64px;
  aspect-ratio: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 5px;
  border-radius: var(--r-md);
  cursor: pointer;
  position: relative;
  transition: all var(--t-fast);
  overflow: hidden;
}

.cal-day:not(.cal-empty):hover { background: var(--surface); }

.cal-day.cal-today {
  background: var(--brown-glass);
  font-weight: var(--w-semibold);
  color: var(--brown);
}

.cal-day.cal-today:hover { background: var(--brown-glass-hover); }

.cal-day.cal-empty { cursor: default; }

.cal-day-num {
  font-size: 13px;
  line-height: 1;
  color: var(--ink-2);
}

.cal-today .cal-day-num { color: var(--brown); }

.cal-mood-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-top: 3px;
}

.cal-day-snip {
  font-size: 9px;
  line-height: 1.25;
  color: var(--ink-3);
  width: 100%;
  padding: 3px 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════
   ALL ENTRIES VIEW
═══════════════════════════════════════════════════════════ */

.view-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--r-pill);
  padding: 3px;
  width: fit-content;
  margin-bottom: var(--sp-6);
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: var(--w-medium);
  color: var(--ink-3);
  padding: 7px var(--sp-5);
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  transition: all var(--t-fast);
  background: transparent;
}

.view-toggle-btn.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ── Entry Card ── */
.entry-card {
  background: var(--white);
  border: 1px solid var(--surface-2);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  margin-bottom: var(--sp-4);
  transition: all var(--t-base);
  position: relative;
}

.entry-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brown-border);
  transform: translateY(-2px);
}

.entry-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.entry-card-date {
  font-size: var(--text-sm);
  color: var(--ink-3);
  font-weight: var(--w-medium);
}

.entry-card-badges {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.mood-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: var(--w-semibold);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  border: 1px solid;
}

.nft-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--w-semibold);
  color: #7B61FF;
  background: rgba(123,97,255,0.08);
  border: 1px solid rgba(123,97,255,0.22);
  padding: 3px 10px;
  border-radius: var(--r-pill);
}

.entry-thumb {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--r-md);
  margin-bottom: var(--sp-4);
}

.entry-excerpt {
  color: var(--ink-2);
  font-size: var(--text-sm);
  line-height: 1.7;
  margin-bottom: var(--sp-4);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entry-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.entry-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: var(--w-medium);
  color: var(--ink-3);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--surface-2);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--t-fast);
}

.entry-action-btn:hover {
  color: var(--brown);
  border-color: var(--brown-border);
  background: var(--brown-glass);
}

.entry-action-btn.del:hover {
  color: var(--error);
  border-color: rgba(192,57,43,0.3);
  background: rgba(192,57,43,0.05);
}

/* ═══════════════════════════════════════════════════════════
   SETTINGS
═══════════════════════════════════════════════════════════ */

.settings-card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  margin-bottom: var(--sp-4);
}

.settings-card-title {
  font-size: var(--text-xs);
  font-weight: var(--w-semibold);
  color: var(--ink-3);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--surface-2);
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.settings-row:last-child { border-bottom: none; }

.settings-row-label {
  font-size: var(--text-sm);
  color: var(--ink-2);
  font-weight: var(--w-medium);
  flex-shrink: 0;
}

.settings-row-value {
  font-size: var(--text-sm);
  color: var(--ink-3);
}

.settings-input {
  padding: var(--sp-2) var(--sp-3);
  border: 1.5px solid var(--surface-3);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--white);
  transition: border-color var(--t-fast);
}

.settings-input:focus {
  outline: none;
  border-color: var(--brown);
}

.settings-row-right { display: flex; align-items: center; gap: var(--sp-2); }

.avatar-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brown), var(--brown-xl));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: var(--w-bold);
  color: var(--white);
  cursor: pointer;
  border: 2px solid var(--surface-2);
  overflow: hidden;
  transition: border-color var(--t-fast);
  flex-shrink: 0;
}

.avatar-ring:hover { border-color: var(--brown); }
.avatar-ring img { width: 100%; height: 100%; object-fit: cover; }

/* ═══════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,18,7,0.44);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  transform: scale(0.96) translateY(10px);
  transition: transform var(--t-base);
  max-height: 88vh;
  overflow-y: auto;
}

.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--w-semibold);
  color: var(--ink);
  margin-bottom: var(--sp-2);
  letter-spacing: -0.02em;
}

.modal-subtitle {
  font-size: var(--text-sm);
  color: var(--ink-3);
  margin-bottom: var(--sp-6);
  line-height: 1.65;
}

.modal-actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  margin-top: var(--sp-6);
}

/* ═══════════════════════════════════════════════════════════
   TOASTS
═══════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  background: var(--ink);
  color: var(--white);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-lg);
  animation: toastSlideIn 0.3s ease both;
  max-width: 360px;
  pointer-events: all;
  line-height: 1.5;
}

.toast.success { background: #1B5E20; }
.toast.error   { background: #7f1d1d; }
.toast.info    { background: var(--brown-dark); }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════════════════
   SPINNER / STATES
═══════════════════════════════════════════════════════════ */

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.spinner.brown {
  border-color: rgba(124,77,45,0.15);
  border-top-color: var(--brown);
}

@keyframes spin { to { transform: rotate(360deg); } }

.tx-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--brown-glass);
  border: 1px solid var(--brown-border);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  color: var(--brown-dark);
  margin-top: var(--sp-4);
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: var(--sp-16) var(--sp-8);
}

.empty-icon { font-size: 3rem; opacity: 0.35; margin-bottom: var(--sp-4); }

.empty-title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--w-semibold);
  color: var(--ink-2);
  margin-bottom: var(--sp-2);
}

.empty-text {
  font-size: var(--text-sm);
  color: var(--ink-3);
  line-height: 1.65;
  max-width: 300px;
  margin: 0 auto var(--sp-6);
}

/* ─── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,77,45,0.2); border-radius: 99px; }

/* ─── Utility ── */
.hidden { display: none !important; }
.text-brown { color: var(--brown); }
.font-serif  { font-family: var(--font-serif); }
.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.9em; }

/* ═══════════════════════════════════════════════════════════
   DASHBOARD V2
═══════════════════════════════════════════════════════════ */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--sp-8);
}
.dash-greeting {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--w-medium);
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.dash-greeting span {
  font-style: italic;
  color: var(--brown);
  font-weight: var(--w-bold);
}
.dash-date {
  font-size: var(--text-sm);
  color: var(--ink-3);
  font-weight: var(--w-medium);
  letter-spacing: 0.02em;
}
.dash-settings-btn {
  font-size: 1.25rem;
  color: var(--ink-3);
  transition: color var(--t-fast);
}
.dash-settings-btn:hover { color: var(--ink); }

.dash-week {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--sp-12);
  padding: 0 var(--sp-2);
}
.dash-week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.dash-week-name {
  font-size: 11px;
  color: var(--ink-4);
  text-transform: uppercase;
  font-weight: var(--w-medium);
}
.dash-week-num {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: var(--w-medium);
  margin-bottom: 4px;
}
.dash-week-empty {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
}
.dash-week-mood {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}
.dash-week-mood svg {
  width: 18px;
  height: 18px;
}

.dash-center-action {
  text-align: center;
  margin-bottom: var(--sp-12);
}
.dash-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: var(--w-bold);
  color: var(--ink);
  margin-bottom: var(--sp-6);
  letter-spacing: -0.02em;
}
.dash-checkin-btn {
  background: var(--ink-2);
  color: var(--white);
  font-size: var(--text-base);
  font-weight: var(--w-medium);
  padding: var(--sp-4) var(--sp-12);
  border-radius: var(--r-md);
  transition: transform var(--t-fast), background var(--t-fast);
}
.dash-checkin-btn:hover {
  transform: translateY(-2px);
  background: var(--ink);
}

.dash-for-you {
  margin-bottom: var(--sp-12);
}
.dash-for-you h3 {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--w-semibold);
  color: var(--ink);
  margin-bottom: 2px;
}
.dash-for-you-sub {
  font-size: var(--text-sm);
  color: var(--ink-3);
  margin-bottom: var(--sp-4);
}
.dash-recommendations {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  padding-bottom: var(--sp-4);
  scrollbar-width: none;
}
.dash-recommendations::-webkit-scrollbar {
  display: none;
}
.dash-rec-card {
  min-width: 140px;
  max-width: 140px;
  height: 160px;
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  flex-shrink: 0;
  transition: transform var(--t-fast);
  cursor: pointer;
}
.dash-rec-card:hover {
  transform: translateY(-4px);
}
.dash-rec-icon {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 2.5rem;
}
.dash-rec-card p {
  font-size: 13px;
  font-weight: var(--w-medium);
  color: var(--ink);
  line-height: 1.4;
}

.dash-whats-on-mind {
  margin-bottom: var(--sp-8);
}
.dash-write-btn {
  width: 100%;
  background: var(--ink-2);
  color: var(--white);
  font-size: var(--text-base);
  font-weight: var(--w-medium);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  transition: transform var(--t-fast), background var(--t-fast);
}
.dash-write-btn:hover {
  background: var(--ink);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Move sidebar to bottom */
  .app-sidebar {
    left: 50%;
    top: auto;
    bottom: var(--sp-4);
    transform: translateX(-50%);
    width: auto;
    flex-direction: row;
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-pill);
  }

  .sidebar-logo,
  .sidebar-divider { display: none; }

  .app-sidebar .sidebar-btn { margin: 0; }

  .sidebar-btn::after {
    left: 50%;
    transform: translateX(-50%);
    top: auto;
    bottom: calc(100% + 10px);
  }

  .app-main {
    margin-left: 0;
    padding: var(--sp-6) var(--sp-4);
    padding-bottom: 90px;
    max-width: 100%;
  }

  .landing-nav {
    padding: var(--sp-4) var(--sp-5);
  }

  .mood-btn { width: 42px; height: 42px; font-size: 1.25rem; }

  .hero-headline { max-width: 100%; }

  .modal { padding: var(--sp-6); }
}
