/* Celavie — diary PWA */
:root {
  --bg: #0a0a0c;
  --bg-elev: #131318;
  --bg-card: #1a1a22;
  --ink: #f4f4f5;
  --ink-dim: #a1a1aa;
  --ink-mute: #6b6b75;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.16);
  --accent: oklch(78% 0.14 65);   /* warm amber-pink */
  --accent-soft: oklch(78% 0.14 65 / 0.18);
  --echo-week: oklch(82% 0.13 200);
  --echo-month: oklch(80% 0.14 145);
  --echo-3mo: oklch(82% 0.13 85);
  --echo-6mo: oklch(80% 0.16 30);
  --echo-year: oklch(75% 0.18 350);
  --mood-joy: #f5c542;
  --mood-calm: #7dd3c0;
  --mood-melancholy: #8b9dc3;
  --mood-restless: #e89cae;
  --mood-grateful: #f0a878;
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: -apple-system, 'SF Pro Text', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: #050506;
  font-family: var(--sans);
  color: var(--ink);
  min-height: 100vh;
  overflow: hidden;
}

#root { width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; }

button { background: none; border: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }

/* hide scrollbars on iOS-frame inner */
.no-scroll::-webkit-scrollbar { display: none; }
.no-scroll { scrollbar-width: none; }

/* Cards stack — vertical pager */
.feed {
  position: absolute; inset: 0;
  background: #000;
  overflow: hidden;
}

.feed-track {
  position: absolute; top: calc(56px + env(safe-area-inset-top, 0px)); left: 0; right: 0; bottom: 0;
  transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.card {
  position: absolute; left: 0; right: 0;
  height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0;
}

.card-bleed { position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.card-vignette {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 50%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
  z-index: 1;
}

.card-body {
  position: relative;
  padding: 0 84px 90px 22px;
  z-index: 2;
}

.echo-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 100px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: rgba(255,255,255,0.95);
  border: 0.5px solid rgba(255,255,255,0.2);
}
.echo-pill .dot {
  width: 6px; height: 6px; border-radius: 100px;
  background: var(--echo-color, var(--accent));
  box-shadow: 0 0 8px var(--echo-color, var(--accent));
}

.card-date {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.7);
  margin-top: 14px;
  text-transform: uppercase;
}

.card-text {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  font-weight: 400;
  color: #fff;
  margin: 14px 0 0;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-text.long { line-height: 1.55; }

.card-mood {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px;
  padding: 6px 12px 6px 8px;
  border-radius: 100px;
  background: rgba(0,0,0,0.4);
  border: 0.5px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  font-size: 12px;
  color: rgba(255,255,255,0.9);
}
.mood-dot {
  width: 14px; height: 14px; border-radius: 100px;
}

.card-tags {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 12px;
}
.card-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  border: 0.5px solid rgba(255,255,255,0.1);
  font-size: 11px; color: rgba(255,255,255,0.85);
  font-weight: 500;
}

/* Right-side TikTok-style nav rail */
.right-rail {
  position: absolute;
  right: 12px;
  bottom: 130px;
  display: flex; flex-direction: column; gap: 22px;
  z-index: 5;
  align-items: center;
}
.rail-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: #fff;
}
.rail-icon-bg {
  width: 46px; height: 46px; border-radius: 100px;
  background: rgba(0,0,0,0.35);
  border: 0.5px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: center;
  transition: transform 120ms ease, background 200ms;
}
.rail-btn:active .rail-icon-bg { transform: scale(0.9); }
.rail-btn.active .rail-icon-bg { background: var(--accent); border-color: transparent; }
.rail-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  letter-spacing: 0.02em;
}
.rail-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  font-weight: 600;
}

/* Mobile shell: content area + bottom tab bar */
#mobile-content {
  position: fixed;
  top: 0; left: 0; right: 0;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}

.btab {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  background: rgba(10,10,14,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 0.5px solid rgba(255,255,255,0.08);
  z-index: 100;
}
.btab-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  color: rgba(255,255,255,0.4);
  font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
  font-family: var(--sans);
  transition: color 150ms;
  -webkit-tap-highlight-color: transparent;
}
.btab-item.active { color: var(--accent); }
.btab-item svg { transition: transform 120ms ease; }
.btab-item:active svg { transform: scale(0.88); }

/* Sticky top bar */
.top-bar {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 20;
  height: calc(56px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; gap: 10px;
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: rgba(7,7,10,0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
}
.top-avatar-btn {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--accent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.top-date-str {
  flex: 1;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}
.top-brand {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.top-brand-logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.top-brand-text {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
@media (max-width: 360px) {
  .top-brand-text { display: none; }
}

.top-icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: none; color: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.top-icon-btn:active { opacity: 0.6; }

.top-compose-btn {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--accent);
  transition: opacity 120ms;
  -webkit-tap-highlight-color: transparent;
}
.top-compose-btn:active { opacity: 0.6; }

/* Sticky echo header (date label appearing per card) */
.sticky-date {
  position: absolute;
  top: 110px;
  left: 22px;
  z-index: 15;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 100px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(255,255,255,0.1);
  font-family: var(--mono);
  font-size: 11px;
  color: #fff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
}

/* Bottom indicator dots — count of stack */
.echo-tabs {
  position: absolute;
  bottom: 56px;
  left: 22px;
  z-index: 5;
  display: flex; gap: 6px;
  align-items: center;
}
.echo-tab {
  height: 4px;
  border-radius: 100px;
  background: rgba(255,255,255,0.25);
  transition: all 200ms;
}
.echo-tab.active {
  background: #fff;
  width: 20px;
}
.echo-tab.dim { width: 10px; }

/* Email invitation card */
.invite-card {
  background: linear-gradient(160deg, oklch(35% 0.08 65) 0%, oklch(20% 0.04 35) 100%);
}

/* Photo card placeholder */
.photo-placeholder {
  position: absolute; inset: 0;
  background:
    radial-gradient(at 30% 40%, oklch(30% 0.08 280) 0%, transparent 50%),
    radial-gradient(at 80% 70%, oklch(28% 0.1 320) 0%, transparent 50%),
    linear-gradient(180deg, #1a1a22 0%, #0e0e14 100%);
}

.photo-stripes {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.015) 0px,
    rgba(255,255,255,0.015) 1px,
    transparent 1px,
    transparent 14px
  );
}

.photo-tag {
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px dashed rgba(255,255,255,0.2);
  padding: 8px 14px;
  border-radius: 4px;
}

/* TODO card */
.todo-card {
  background: linear-gradient(180deg, #0e1418 0%, #050709 100%);
}
.todo-list {
  margin-top: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.todo-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-family: var(--sans); font-size: 15px;
  color: rgba(255,255,255,0.92);
}
.todo-check {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,0.4);
  flex-shrink: 0; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
}
.todo-check.done {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1a22;
}
.todo-item.done { color: rgba(255,255,255,0.4); text-decoration: line-through; }

/* Bottom screen container (non-feed screens) */
.screen {
  position: absolute; inset: 0;
  background: var(--bg);
  z-index: 30;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.screen-header {
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 18px 18px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 0.5px solid var(--line);
  background: var(--bg);
}
.screen-title {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em;
  flex: 1;
}
.icon-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 100px;
  background: rgba(255,255,255,0.06);
}

.screen-body { flex: 1; overflow-y: auto; padding: 16px 18px 100px; }

/* Search */
.search-input {
  width: 100%;
  height: 44px; padding: 0 14px;
  border-radius: 12px;
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  font-family: var(--sans);
  outline: 0;
}
.search-input:focus { border-color: var(--accent); }

.filter-row {
  display: flex; gap: 8px; overflow-x: auto;
  margin-top: 14px;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 100px;
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
  font-size: 12px;
  color: var(--ink-dim);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.filter-chip.active {
  background: var(--accent);
  color: #1a1a22;
  border-color: var(--accent);
  font-weight: 600;
}

/* Search result list */
.result {
  display: flex; gap: 12px;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--line);
}
.result-thumb {
  width: 56px; height: 56px;
  border-radius: 8px;
  background: linear-gradient(135deg, oklch(30% 0.06 var(--h, 65)) 0%, oklch(15% 0.04 var(--h, 65)) 100%);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.5);
  font-family: var(--mono);
  font-size: 11px;
}
.result-meta {
  flex: 1; min-width: 0;
}
.result-date {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.result-text {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Calendar */
.cal-month {
  font-size: 18px; font-weight: 600;
  margin: 18px 0 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-dow {
  font-size: 10px; color: var(--ink-mute);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 0;
}
.cal-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--ink-dim);
  position: relative;
  flex-direction: column;
  gap: 0;
}
.cal-cell-dots {
  position: absolute; bottom: 3px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 2px;
}
.cal-cell.has-entry {
  background: var(--bg-elev);
  color: var(--ink);
}
.cal-cell.intensity-1 { background: oklch(30% 0.04 65); color: var(--ink); }
.cal-cell.intensity-2 { background: oklch(45% 0.08 65); color: #1a1a22; font-weight: 600; }
.cal-cell.intensity-3 { background: var(--accent); color: #1a1a22; font-weight: 600; }
.cal-cell.today { color: var(--accent); font-weight: 600; }
.cal-cell.selected { outline: 1.5px solid var(--accent); outline-offset: 2px; }
.cal-cell.muted { color: var(--ink-mute); opacity: 0.4; }

.cal-title { display: flex; gap: 6px; align-items: baseline; }
.cal-title-btn {
  background: transparent; border: 0; padding: 2px 4px;
  font: inherit; font-size: 18px; font-weight: 600;
  color: var(--ink); cursor: pointer; border-radius: 6px;
  transition: background 0.12s ease;
}
.cal-title-btn:hover { background: var(--bg-elev); }
.cal-title-year { color: var(--ink-dim); font-weight: 500; }
.cal-title-static { font-size: 18px; font-weight: 600; color: var(--ink); padding: 2px 4px; }

.cal-nav { display: flex; gap: 8px; align-items: center; }
.cal-today-btn {
  font-family: var(--mono); font-size: 11px;
  color: var(--accent); background: transparent;
  border: 0.5px solid var(--accent);
  padding: 4px 10px; border-radius: 100px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.cal-today-btn:hover { background: var(--accent); color: #1a1a22; }
.cal-today-btn.is-today { opacity: 0.4; pointer-events: none; }

.cal-year-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 4px;
}
.cal-month-cell {
  aspect-ratio: 1.6;
  border-radius: 10px;
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
  color: var(--ink);
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.cal-month-cell:hover { border-color: var(--line-strong); }
.cal-month-cell.today { color: var(--accent); font-weight: 600; }
.cal-month-cell.selected { outline: 1.5px solid var(--accent); outline-offset: 2px; }

/* Profile */
.profile-hero {
  padding: 20px 18px 24px;
  display: flex; gap: 14px; align-items: center;
  border-bottom: 0.5px solid var(--line);
}
.avatar {
  width: 64px; height: 64px; border-radius: 100px;
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile-name { font-size: 18px; font-weight: 600; }
.profile-stat { font-size: 13px; color: var(--ink-dim); margin-top: 2px; }

.stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; padding: 16px 18px;
  border-bottom: 0.5px solid var(--line);
}
.stat {
  text-align: left;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-elev);
}
.stat-num { font-family: var(--serif); font-size: 26px; font-weight: 500; }
.stat-lbl { font-size: 11px; color: var(--ink-dim); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.04em; }

.section-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-mute);
  padding: 18px 0 8px;
}

.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--line);
}
.list-row-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-elev);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.list-row-text { flex: 1; font-size: 15px; }
.list-row-sub { font-size: 12px; color: var(--ink-dim); margin-top: 2px; }
.list-row-subtask { padding-left: 20px; border-bottom: 0.5px solid var(--line); position: relative; }
.list-row-subtask::before {
  content: '';
  position: absolute;
  left: 6px; top: 50%;
  width: 8px; height: 1px;
  background: var(--ink-mute);
  opacity: 0.4;
}
.list-row-subtask .list-row-text { font-size: 14px; color: var(--ink-dim); }
.list-row-arrow { color: var(--ink-mute); }

/* Toggle */
.toggle {
  width: 46px; height: 28px;
  border-radius: 100px;
  background: rgba(255,255,255,0.18);
  position: relative;
  transition: background 200ms;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 24px; height: 24px;
  border-radius: 100px;
  background: #fff;
  transition: transform 200ms;
}
.toggle.on::after { transform: translateX(18px); }

/* Detail screen */
.detail-hero {
  position: relative;
  height: 38vh; min-height: 260px;
  overflow: hidden;
}
.detail-meta { padding: 18px; }
.detail-text {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
}
.attachment {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
}

/* Compose / reply screen */
.compose-prompt {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink-dim);
  font-style: italic;
  padding: 16px 18px;
  border-bottom: 0.5px solid var(--line);
}
.compose-textarea {
  width: 100%;
  min-height: 240px;
  padding: 18px;
  background: transparent;
  border: 0; outline: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  resize: none;
}
.tag-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; gap: 6px; padding: 12px 14px;
  background: var(--bg);
  border-top: 0.5px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tag-bar::-webkit-scrollbar { display: none; }
.tag-btn {
  flex-shrink: 0;
  height: 36px; min-width: 36px;
  padding: 0 12px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 100px;
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
  font-size: 12px;
  color: var(--ink);
}
.tag-btn.active { background: var(--accent); color: #1a1a22; font-weight: 600; border-color: var(--accent); }
.lang-btn {
  height: 32px; min-width: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--bg-elev);
  border: 0.5px solid var(--line);
  font-size: 12px; font-family: var(--mono); font-weight: 600;
  color: var(--ink-mute);
  cursor: pointer;
}
.lang-btn.active { background: var(--accent); color: #1a1a22; border-color: var(--accent); }

/* Onboarding */
.onb-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at top, oklch(35% 0.12 30) 0%, transparent 60%),
    radial-gradient(ellipse at bottom, oklch(25% 0.1 280) 0%, transparent 60%),
    var(--bg);
}
.onb-stack {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: 80px 22px 60px;
}
.onb-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}
.onb-title {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: 14px;
  font-weight: 400;
  color: #fff;
  text-wrap: pretty;
}
.onb-body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-dim);
  margin-top: 16px;
  max-width: 320px;
}
.onb-cta {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 10px;
}
/* ── Life counter ── */
.life-counter { padding: 16px 0; }
.life-counter-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.life-counter-title {
  font-family: var(--mono); font-size: 10px; color: var(--ink-mute);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.life-counter-val {
  font-family: var(--serif); font-size: 20px; color: var(--ink);
}
.life-bar-wrap {
  height: 4px; background: var(--bg-elev);
  border-radius: 2px; margin-bottom: 14px; overflow: hidden;
}
.life-bar-fill {
  height: 100%; background: var(--accent);
  border-radius: 2px; transition: width 0.6s ease;
}
.life-grid {
  display: grid;
  grid-template-columns: repeat(52, 1fr);
  gap: 2px;
}
.life-cell {
  aspect-ratio: 1;
  border-radius: 1px;
}
/* Stage colours — future cells */
.life-cell.childhood { background: #f5c542; opacity: 0.1; }
.life-cell.youth     { background: #7dd3c0; opacity: 0.1; }
.life-cell.maturity  { background: var(--accent); opacity: 0.1; }
.life-cell.old-age   { background: #a78bfa; opacity: 0.1; }
/* Lived */
.life-cell.lived.childhood { opacity: 0.6; }
.life-cell.lived.youth     { opacity: 0.6; }
.life-cell.lived.maturity  { opacity: 0.6; }
.life-cell.lived.old-age   { opacity: 0.6; }
/* Current week */
.life-cell.current.childhood { opacity: 1; box-shadow: 0 0 4px #f5c542; }
.life-cell.current.youth     { opacity: 1; box-shadow: 0 0 4px #7dd3c0; }
.life-cell.current.maturity  { opacity: 1; box-shadow: 0 0 4px var(--accent); }
.life-cell.current.old-age   { opacity: 1; box-shadow: 0 0 4px #a78bfa; }
.life-legend {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 10px;
  font-size: 10px; font-family: var(--mono);
  color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.05em;
}
.life-legend-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 2px; margin-right: 4px; vertical-align: middle;
}
.life-stats-row {
  display: flex; gap: 16px; margin-top: 12px;
}
.life-stat-item {
  flex: 1; text-align: center;
  padding: 10px 6px;
  background: var(--bg-elev);
  border-radius: 10px;
}
.life-stat-num { font-family: var(--mono); font-size: 16px; color: var(--ink); }
.life-stat-lbl { font-family: var(--mono); font-size: 10px; color: var(--ink-mute); margin-top: 2px; }

.btn-primary {
  width: 100%;
  height: 52px;
  border-radius: 100px;
  background: var(--accent);
  color: #1a1a22;
  font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.btn-ghost {
  height: 52px;
  border-radius: 100px;
  background: transparent;
  border: 0.5px solid var(--line-strong);
  color: var(--ink);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}

.onb-dots {
  display: flex; gap: 6px; justify-content: center;
  margin-top: 22px;
}
.onb-dot {
  width: 6px; height: 6px; border-radius: 100px;
  background: rgba(255,255,255,0.25);
}
.onb-dot.active { background: #fff; width: 22px; }

/* iOS device wrapper */
.device-wrap {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #18181c;
}

/* Email preview inside invite card */
.email-frame {
  position: absolute;
  top: 130px; left: 22px; right: 22px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 0.5px solid rgba(255,255,255,0.14);
  padding: 14px;
  z-index: 2;
}
.email-from {
  font-size: 11px;
  font-family: var(--mono);
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.email-subject {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  margin-top: 4px;
  color: #fff;
}
.email-body {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255,255,255,0.78);
  border-top: 0.5px dashed rgba(255,255,255,0.15);
  padding-top: 10px;
}
.email-quote {
  font-style: italic;
  color: rgba(255,255,255,0.58);
  border-left: 2px solid var(--accent);
  padding-left: 8px;
  margin-top: 8px;
  font-size: 12px;
}

/* Mood swatches */
.profile-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 18px;
}
.profile-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 100px;
  background: var(--bg-elev); border: 0.5px solid var(--line);
  font-size: 12px; font-family: var(--mono); color: var(--ink);
}
.profile-tag-count {
  color: var(--ink-mute); font-size: 11px;
}
.hm-grid {
  display: grid;
  grid-template-columns: repeat(53, 1fr);
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 3px;
  padding: 0 18px;
  height: 88px;
}
.hm-cell {
  border-radius: 3px;
  background: var(--bg-elev);
}
.hm-cell.active { background: #7dd3c0; }
.hm-cell.empty  { background: transparent; }
.mood-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 0 18px;
  height: 96px;
}
.mood-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}
.mood-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}
.mood-bar-fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.4s ease;
}
.mood-bar-lbl {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 6px;
  text-align: center;
}
.mood-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 14px 18px;
}
.mood-swatch {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: rgba(0,0,0,0.7);
  font-weight: 600;
  text-align: center;
  padding: 6px;
}

/* Tweaks panel custom positioning */
.celavie-tweaks { font-family: var(--sans); }

/* nav fade-in */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fadeIn 220ms ease; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.slide-up { animation: slideUp 280ms cubic-bezier(0.22, 1, 0.36, 1); }

/* Visual: timestamp ribbon for each card */
.ribbon {
  position: absolute;
  top: 110px;
  right: 12px;
  z-index: 4;
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 4px;
  text-align: right;
  pointer-events: none;
}
.ribbon-day {
  font-family: var(--serif);
  font-size: 56px;
  line-height: 0.9;
  font-weight: 300;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
  letter-spacing: -0.03em;
}
.ribbon-month {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.ribbon-year {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.08em;
}
