/* Memora App — matching landing page design language */
:root {
  --bg: #F5F0E8;
  --ink: #18150F;
  --muted: #8C7B6B;
  --accent: #B8521A;
  --accent-warm: #D4894A;
  --surface: #EDE8DE;
  --border: #D9D0C3;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app-container { min-height: 100vh; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand { display: flex; align-items: center; gap: 12px; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
}
.brand-tagline {
  font-size: 13px;
  color: var(--muted);
  font-weight: 300;
  border-left: 1px solid var(--border);
  padding-left: 12px;
}

.header-nav { display: flex; gap: 24px; align-items: center; }
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-sans);
}
.nav-link:hover { color: var(--ink); }
.nav-btn { color: var(--muted); font-size: 13px; }

.header-connections {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  margin-left: 32px;
}
.conn-dot { font-size: 8px; color: var(--border); transition: color 0.3s; }
.conn-label { font-size: 12px; color: var(--muted); font-weight: 400; }

.app-main { padding: 40px 40px 80px; max-width: 860px; margin: 0 auto; }

/* Setup prompt */
.setup-prompt {
  text-align: center;
  padding: 60px 20px;
}
.orb-visual { margin-bottom: 32px; }
.memory-orb-sm {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.orb-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184,82,26,0.15) 0%, transparent 70%);
  animation: pulse 3s ease-in-out infinite;
}
.orb-core {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
  box-shadow: 0 0 20px rgba(184,82,26,0.3);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 0.3; }
}

.setup-prompt h1 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.setup-prompt p { font-size: 17px; color: var(--muted); margin-bottom: 40px; font-weight: 300; }

.setup-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #A04818; }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.status-msg { margin-top: 16px; padding: 12px 16px; border-radius: 6px; font-size: 14px; }
.status-msg.success { background: #E8F5E9; color: #2E7D32; border: 1px solid #C8E6C9; }
.status-msg.error { background: #FFEBEE; color: #C62828; border: 1px solid #FFCDD2; }

/* Timeline */
.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.timeline-header h2 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
}
.sync-icon { display: inline-block; font-size: 16px; }

.timeline-meta { font-size: 14px; color: var(--muted); margin-bottom: 24px; font-weight: 300; }

.timeline-feed { display: flex; flex-direction: column; gap: 0; }

.timeline-loading { text-align: center; color: var(--muted); padding: 40px; }

.timeline-empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.timeline-empty p { font-size: 16px; font-weight: 400; margin-bottom: 8px; }
.empty-hint { font-size: 14px; font-weight: 300; }

.month-separator {
  padding: 32px 0 16px;
  position: relative;
}
.month-separator::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
  z-index: 0;
}
.month-separator span {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
  padding: 4px 12px 4px 0;
  position: relative;
  z-index: 1;
}

.timeline-event {
  display: grid;
  grid-template-columns: 80px 1fr;
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  gap: 0;
  transition: background 0.15s;
}
.timeline-event:hover { background: rgba(184,82,26,0.03); }

.event-date-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 20px;
  padding-top: 4px;
}
.event-date { font-size: 28px; font-weight: 400; font-family: var(--font-serif); color: var(--ink); line-height: 1; }
.event-month { font-size: 12px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

.event-body { display: flex; gap: 16px; align-items: flex-start; padding-left: 20px; border-left: 2px solid var(--border); position: relative; }
.event-body::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.event-photo-wrap { flex-shrink: 0; }
.photo-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); transition: opacity 0.2s; }
.photo-thumb:hover { opacity: 0.85; }

.event-details { flex: 1; min-width: 0; }
.event-merchant { font-size: 15px; font-weight: 500; color: var(--ink); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.event-place { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.place-icon { font-size: 11px; color: var(--accent); }
.place-name { font-size: 13px; color: var(--muted); font-weight: 300; }

.event-bottom { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.event-amount { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.event-amount.expense { color: var(--ink); }
.event-amount.income { color: #2E7D32; }
.event-category { font-size: 12px; color: var(--muted); font-weight: 300; background: var(--surface); padding: 2px 8px; border-radius: 4px; }

@media (max-width: 600px) {
  .app-header { padding: 16px 20px; flex-wrap: wrap; }
  .header-connections { margin-left: 16px; }
  .app-main { padding: 20px; }
  .timeline-event { grid-template-columns: 60px 1fr; }
  .event-body { padding-left: 12px; }
  .event-date { font-size: 22px; }
  .photo-thumb { width: 52px; height: 52px; }
  .month-separator { padding: 24px 0 12px; }
}