/* ============================================================
   StoneRose PWA — app.css
   ============================================================ */

/* ── Fonts ────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garant:ital,wght@0,300;0,400;0,500;1,300;1,400&family=DM+Sans:wght@300;400;500&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  --bg:          #0e0c0b;
  --bg2:         #161310;
  --bg3:         #1d1916;
  --surface:     #231f1c;
  --surface2:    #2e2925;
  --surface3:    #3a342f;
  --rose:        #c4855a;
  --rose-light:  #dba07a;
  --rose-dim:    #8a5c3d;
  --rose-glow:   rgba(196,133,90,0.12);
  --cream:       #f0e6d8;
  --cream-dim:   #b5a898;
  --gold:        #d4a853;
  --text:        #ede4d8;
  --text-2:      #9a8f84;
  --text-3:      #5c534c;
  --border:      rgba(196,133,90,0.14);
  --border2:     rgba(196,133,90,0.26);
  --success:     #4caf7d;
  --danger:      #e05555;
  --serif:       'Cormorant Garant', Georgia, serif;
  --sans:        'DM Sans', system-ui, sans-serif;
  --nav-h:       68px;
  --safe-b:      env(safe-area-inset-bottom, 0px);
  --safe-t:      env(safe-area-inset-top, 0px);
  --radius:      18px;
  --radius-sm:   10px;
  --radius-xs:   6px;
  --shadow:      0 4px 20px rgba(0,0,0,0.5);
  --transition:  0.22s ease;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: var(--sans); }
img { display: block; max-width: 100%; }

/* ── App Shell ────────────────────────────────────────────── */
#app {
  width: 100%; height: 100%;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

/* ── Screens ──────────────────────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  bottom: var(--nav-h);
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
.screen.active {
  display: flex;
  animation: screenIn var(--transition) both;
}
#screen-auth { bottom: 0; }

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

/* ── Status Bar ───────────────────────────────────────────── */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-t) + 10px) 22px 4px;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}
.status-time { color: var(--cream); font-weight: 500; }
.status-icons { display: flex; gap: 5px; align-items: center; }
.status-icons svg { width: 14px; height: 14px; }

/* ── Top Bar ──────────────────────────────────────────────── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 20px 12px;
  flex-shrink: 0;
}
.top-bar-logo {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--cream);
}
.top-bar-logo span { color: var(--rose); }
.top-bar-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--cream);
  flex: 1;
  text-align: center;
}
.top-bar-spacer { width: 38px; }

/* ── Bottom Nav ───────────────────────────────────────────── */
#bottom-nav {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(22,19,16,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: var(--safe-b);
  z-index: 50;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 12px;
  transition: background var(--transition);
  position: relative;
  min-width: 52px;
}
.nav-item:active { background: var(--surface); }
.nav-item svg {
  width: 22px; height: 22px;
  stroke: var(--text-3);
  stroke-width: 1.5;
  fill: none;
  transition: stroke var(--transition);
}
.nav-label {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.04em;
  transition: color var(--transition);
}
.nav-item.active svg   { stroke: var(--rose); }
.nav-item.active .nav-label { color: var(--rose); }
.nav-badge {
  position: absolute;
  top: 4px; right: 10px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rose);
  border: 2px solid var(--bg2);
}
.nav-fab {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--rose);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(196,133,90,0.45);
  transition: all 0.18s;
  flex-shrink: 0;
}
.nav-fab:active { transform: scale(0.94); box-shadow: none; }
.nav-fab svg { width: 24px; height: 24px; stroke: var(--bg); stroke-width: 2.2; fill: none; }

/* ── Shared Components ────────────────────────────────────── */

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-sm {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.card-p { padding: 16px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; }
.btn-primary { background: var(--rose); color: var(--bg); }
.btn-primary:active { background: var(--rose-light); transform: scale(0.98); }
.btn-ghost {
  background: transparent;
  color: var(--cream-dim);
  border: 1px solid var(--border2);
}
.btn-ghost:active { background: var(--surface); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.45; pointer-events: none; }

/* Form inputs */
.input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  width: 100%;
  outline: none;
  transition: border-color var(--transition);
  appearance: none;
}
.input:focus { border-color: var(--rose-dim); }
.input::placeholder { color: var(--text-3); }
.input-label {
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}
.input-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

/* Pill filters */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  border: 1px solid var(--border2);
  color: var(--cream-dim);
  background: transparent;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  flex-shrink: 0;
}
.pill.active { background: var(--rose-dim); border-color: var(--rose); color: var(--cream); }
.pill:active  { transform: scale(0.97); }

/* Avatar */
.avatar {
  border-radius: 50%;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--rose-light);
  flex-shrink: 0;
  overflow: hidden;
}

/* Section heading row */
.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--cream);
}
.section-link {
  font-size: 11px;
  color: var(--rose);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.section-eyebrow {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rose-dim);
  margin-bottom: 4px;
}

/* Spacers */
.spacer    { height: 16px; flex-shrink: 0; }
.spacer-lg { height: 28px; flex-shrink: 0; }
.divider   { height: 1px; background: var(--border); margin: 0 20px; flex-shrink: 0; }

/* Scroll container */
.scroll-content {
  padding: 0 20px 24px;
  flex: 1;
}

/* Horizontal scroll strip */
.h-scroll {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding: 0 20px 4px;
  scrollbar-width: none;
}
.h-scroll::-webkit-scrollbar { display: none; }

/* Toast */
.toast {
  position: absolute;
  bottom: calc(var(--nav-h) + 12px);
  left: 50%; transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--cream);
  white-space: nowrap;
  z-index: 300;
  animation: toastIn 0.3s ease, toastOut 0.3s 2.5s ease forwards;
  pointer-events: none;
}
@keyframes toastIn  { from { opacity:0; transform: translateX(-50%) translateY(10px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { to   { opacity:0; transform: translateX(-50%) translateY(6px); } }

/* Loading spinner */
.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border2);
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 32px;
  text-align: center;
}
.empty-state svg { width: 48px; height: 48px; stroke: var(--text-3); fill: none; opacity: 0.5; }
.empty-state h3  { font-family: var(--serif); font-size: 1.2rem; font-weight: 400; color: var(--cream-dim); }
.empty-state p   { font-size: 13px; color: var(--text-3); line-height: 1.6; }

/* Modal / Sheet */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(14,12,11,0.82);
  z-index: 200;
  display: none;
  align-items: flex-end;
}
.overlay.open { display: flex; }
.sheet {
  width: 100%;
  background: var(--bg2);
  border-top: 1px solid var(--border2);
  border-radius: 24px 24px 0 0;
  padding: 14px 20px calc(36px + var(--safe-b));
  animation: sheetUp 0.28s ease;
  max-height: 92vh;
  overflow-y: auto;
  scrollbar-width: none;
}
.sheet::-webkit-scrollbar { display: none; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle {
  width: 40px; height: 4px;
  border-radius: 2px;
  background: var(--surface3);
  margin: 0 auto 18px;
}
.sheet-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 4px;
}
.sheet-sub { font-size: 12px; color: var(--text-2); margin-bottom: 18px; }

/* Toggle switch */
.toggle {
  width: 42px; height: 24px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle.on  { background: var(--rose); border-color: var(--rose); }
.toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 9px;
  background: var(--surface3);
  transition: left 0.2s, background 0.2s;
}
.toggle.on::after { left: 20px; background: #fff; }

/* Progress bar */
.progress { background: var(--surface); border-radius: 4px; height: 4px; overflow: hidden; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose-dim), var(--rose-light));
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* List row */
.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.list-row:last-child { border-bottom: none; }
.list-row:active { background: var(--bg3); }
.list-row-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.list-row-icon svg { width: 18px; height: 18px; stroke: var(--rose); fill: none; }
.list-row-body { flex: 1; min-width: 0; }
.list-row-title  { font-size: 13px; color: var(--cream); margin-bottom: 1px; }
.list-row-sub    { font-size: 11px; color: var(--text-2); }
.list-row-right  { font-family: var(--serif); font-size: 1rem; color: var(--rose-light); flex-shrink: 0; }
.list-row-chevron { width: 16px; height: 16px; stroke: var(--text-3); fill: none; flex-shrink: 0; }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: 0.07em;
  font-weight: 400;
  flex-shrink: 0;
}
.badge-rose    { background: rgba(196,133,90,0.18); color: var(--rose);    border: 1px solid var(--border2); }
.badge-success { background: rgba(76,175,125,0.15); color: var(--success); border: 1px solid rgba(76,175,125,0.3); }
.badge-muted   { background: var(--surface2);       color: var(--text-2);  border: 1px solid var(--border); }

/* ── Auth Screen ──────────────────────────────────────────── */
.auth-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 20%, rgba(196,133,90,0.1) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 70%, rgba(139,90,61,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.auth-rose {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  width: 260px;
  opacity: 0.14;
  pointer-events: none;
}
.auth-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 28px 40px;
  justify-content: flex-end;
}
.auth-logo {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--cream);
  margin-bottom: 4px;
  text-align: center;
}
.auth-logo span { color: var(--rose); }
.auth-tagline {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose-dim);
  text-align: center;
  margin-bottom: 40px;
}
.auth-tabs {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s;
}
.auth-tab.active { background: var(--rose); color: var(--bg); font-weight: 500; }

/* ── Home Screen ──────────────────────────────────────────── */
.home-hero-card {
  margin: 0 20px 20px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg3) 100%);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.home-hero-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--rose-dim), transparent);
}
.home-hero-rose {
  position: absolute;
  right: -15px; top: -5px;
  width: 105px;
  opacity: 0.11;
  pointer-events: none;
}
.home-stats { display: flex; gap: 20px; margin-top: 14px; }
.home-stat h4 { font-family: var(--serif); font-size: 1.5rem; font-weight: 300; color: var(--rose-light); line-height: 1; }
.home-stat p  { font-size: 10px; color: var(--text-2); margin-top: 2px; }

.memory-thumb {
  flex-shrink: 0;
  width: 88px; height: 118px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.2s;
}
.memory-thumb:active { transform: scale(0.97); }
.memory-thumb-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(14,12,11,0.9), transparent);
  padding: 7px 7px 6px;
}
.memory-thumb-label { font-size: 9px; color: var(--cream-dim); line-height: 1.3; }
.memory-thumb-add {
  flex-shrink: 0;
  width: 88px; height: 118px;
  border-radius: 12px;
  background: var(--surface);
  border: 1.5px dashed var(--border2);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.memory-thumb-add:active { border-color: var(--rose); }
.memory-thumb-add svg { width: 22px; height: 22px; stroke: var(--rose-dim); fill: none; }
.memory-thumb-add span { font-size: 10px; color: var(--text-3); }

/* ── Capture Screen ───────────────────────────────────────── */
.capture-tabs {
  display: flex;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.capture-tab {
  flex: 1;
  padding: 13px 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.capture-tab.active { color: var(--rose); border-bottom-color: var(--rose); }

.viewfinder {
  flex: 1;
  min-height: 280px;
  background: #090707;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.vf-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(196,133,90,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196,133,90,0.06) 1px, transparent 1px);
  background-size: 33.33% 33.33%;
}
.vf-corner {
  position: absolute;
  width: 28px; height: 28px;
  border-color: rgba(196,133,90,0.65);
  border-style: solid;
}
.vf-tl { top:22px; left:22px;   border-width: 2px 0 0 2px; border-radius: 4px 0 0 0; }
.vf-tr { top:22px; right:22px;  border-width: 2px 2px 0 0; border-radius: 0 4px 0 0; }
.vf-bl { bottom:22px; left:22px;  border-width: 0 0 2px 2px; border-radius: 0 0 0 4px; }
.vf-br { bottom:22px; right:22px; border-width: 0 2px 2px 0; border-radius: 0 0 4px 0; }
.vf-hint { font-size: 11px; color: rgba(240,230,216,0.45); letter-spacing: 0.1em; text-transform: uppercase; }

.shutter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px 4px;
}
.shutter {
  width: 68px; height: 68px;
  border-radius: 50%;
  border: 4px solid var(--surface2);
  outline: 3px solid var(--cream);
  background: var(--cream);
  cursor: pointer;
  transition: transform 0.12s;
  display: flex; align-items: center; justify-content: center;
}
.shutter:active { transform: scale(0.93); }
.shutter-inner {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--cream);
}
.ctrl-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.ctrl-btn:active { background: var(--surface2); }
.ctrl-btn svg { width: 20px; height: 20px; stroke: var(--cream-dim); fill: none; }

.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 0 20px;
}
.upload-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-xs);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.upload-cell-add {
  background: var(--surface);
  border: 1.5px dashed var(--border2);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
}
.upload-cell-add svg { width: 22px; height: 22px; stroke: var(--rose-dim); fill: none; }
.upload-cell-add span { font-size: 10px; color: var(--text-3); }
.upload-check {
  position: absolute;
  top: 5px; right: 5px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--rose);
  display: flex; align-items: center; justify-content: center;
}
.upload-check svg { width: 11px; height: 11px; stroke: var(--bg); fill: none; stroke-width: 2.5; }

.voice-recorder {
  margin: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 44px;
}
.wave-bar {
  width: 3px;
  border-radius: 2px;
  background: var(--rose-dim);
  transition: height 0.12s;
}
.rec-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--rose);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 0 10px rgba(196,133,90,0.12);
  transition: all 0.2s;
}
.rec-btn.recording { background: #a02828; box-shadow: 0 0 0 10px rgba(160,40,40,0.15); }
.rec-btn:active { transform: scale(0.95); }
.rec-btn svg { width: 26px; height: 26px; stroke: var(--bg); fill: none; stroke-width: 2; }
.voice-time { font-family: var(--serif); font-size: 1.8rem; font-weight: 300; color: var(--cream); }
.voice-label { font-size: 11px; color: var(--text-2); letter-spacing: 0.06em; }

/* ── Timeline Screen ──────────────────────────────────────── */
.filter-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px 14px;
  scrollbar-width: none;
  flex-shrink: 0;
}
.filter-strip::-webkit-scrollbar { display: none; }

.year-marker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px 8px;
  flex-shrink: 0;
}
.year-label { font-family: var(--serif); font-size: 1.2rem; font-weight: 300; color: var(--rose-light); flex-shrink: 0; }
.year-line  { flex: 1; height: 1px; background: var(--border); }

.mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 0 20px;
  margin-bottom: 4px;
}
.mosaic-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-xs);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: opacity 0.15s;
}
.mosaic-cell:active { opacity: 0.8; }
.mosaic-cell.wide { grid-column: span 2; aspect-ratio: 2/1; }
.mosaic-cell.tall { grid-row: span 2; }
.video-badge {
  position: absolute;
  top: 5px; left: 5px;
  background: rgba(14,12,11,0.72);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 9px;
  color: var(--cream);
  display: flex; align-items: center; gap: 3px;
}
.video-badge svg { width: 9px; height: 9px; stroke: var(--rose); fill: none; }

/* ── Tribute Screen ───────────────────────────────────────── */
.tribute-hero {
  margin: 0 20px 18px;
  background: linear-gradient(135deg, #2a1e14, #1a1208);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.tribute-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--rose-dim), var(--gold), var(--rose-dim));
}

.chapter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 20px;
  margin-bottom: 18px;
}
.chapter-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.chapter-card.selected { border-color: var(--rose); background: var(--bg3); }
.chapter-card.selected::after {
  content: '';
  position: absolute;
  top: 9px; right: 10px;
  width: 14px; height: 14px;
  background: var(--rose);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 14 14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 7l3 3 5-6' stroke='%230e0c0b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}
.chapter-card:active { transform: scale(0.97); }
.chapter-icon { font-size: 1.3rem; margin-bottom: 6px; }
.chapter-name { font-family: var(--serif); font-size: 0.95rem; font-weight: 400; color: var(--cream); margin-bottom: 2px; }
.chapter-count { font-size: 10px; color: var(--text-2); }

/* ── Circle Screen ────────────────────────────────────────── */
.circle-banner {
  margin: 0 20px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.stacked-avatars { display: flex; }
.stacked-avatars .avatar { margin-left: -10px; border: 2px solid var(--bg2); }
.stacked-avatars .avatar:first-child { margin-left: 0; }

.activity-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-text { font-size: 13px; color: var(--cream); line-height: 1.5; }
.activity-text strong { color: var(--rose); font-weight: 400; }
.activity-meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }

.invite-card {
  margin: 0 20px;
  background: var(--bg3);
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.2s;
  text-align: center;
}
.invite-card:active { border-color: var(--rose); }
.invite-card svg { width: 26px; height: 26px; stroke: var(--rose-dim); fill: none; }
.invite-card h4 { font-family: var(--serif); font-size: 1rem; font-weight: 400; color: var(--cream); }
.invite-card p  { font-size: 12px; color: var(--text-2); }

/* ── Profile Screen ───────────────────────────────────────── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:active { background: var(--bg3); }
.settings-label { font-size: 13px; color: var(--cream); }
.settings-value { font-size: 12px; color: var(--text-2); }

/* ── Media placeholders ───────────────────────────────────── */
.mc-1 { background: linear-gradient(135deg, #3e3028, #281e14); }
.mc-2 { background: linear-gradient(135deg, #2a3230, #182220); }
.mc-3 { background: linear-gradient(135deg, #30283e, #201828); }
.mc-4 { background: linear-gradient(135deg, #3a2e28, #2a1e10); }
.mc-5 { background: linear-gradient(135deg, #283238, #182228); }
.mc-6 { background: linear-gradient(135deg, #382830, #281820); }
.mc-7 { background: linear-gradient(135deg, #2e3830, #1e2820); }
.mc-8 { background: linear-gradient(135deg, #38342a, #281e0c); }
.mc-9 { background: linear-gradient(135deg, #32283e, #22182e); }

/* ── Offline banner ───────────────────────────────────────── */
.offline-banner {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 8px 20px;
  font-size: 11px;
  color: var(--text-2);
  text-align: center;
  letter-spacing: 0.06em;
  display: none;
  flex-shrink: 0;
}
.offline-banner.show { display: block; }

/* ── Desktop frame ────────────────────────────────────────── */
@media (min-width: 500px) {
  body {
    background: #050403;
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    overflow: auto;
  }
  #app {
    height: 870px;
    border-radius: 44px;
    border: 8px solid #1c1714;
    box-shadow: 0 40px 100px rgba(0,0,0,0.9), 0 0 0 1px #2a2420;
  }
}
