@import url("https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300..800;1,6..72,300..800&family=Inter:wght@300;400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --paper: #fbf9f4;
  --paper-2: #ffffff;
  --vellum: #f5f3ee;
  --vellum-2: #f0eee9;
  --vellum-3: #e4e2dd;
  --ink: #101b37;
  --body: #1b1c19;
  --muted: #45464d;
  --line: rgba(16, 27, 55, 0.12);
  --line-strong: rgba(16, 27, 55, 0.22);
  --gold: #dc8a78;
  --gold-soft: rgba(220, 138, 120, 0.14);
  --gold-deep: #8f4b3c;
  --green: #4a6741;
  --green-soft: #caecbc;
  --rosewater: #fff0eb;
  --rosewater-ink: #9f4f42;
  --danger: #ba1a1a;
  --danger-soft: #ffdad6;
  --shadow: 0 22px 60px rgba(16, 27, 55, 0.07);
  --radius: 8px;
  font-family: "Inter", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--body);
  background:
    linear-gradient(rgba(16, 27, 55, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 27, 55, 0.014) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px, 32px 32px, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 10%, rgba(220, 138, 120, 0.09), transparent 24%),
    radial-gradient(circle at 86% 8%, rgba(74, 103, 65, 0.06), transparent 26%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4,
.brand,
.footer-brand {
  font-family: "Newsreader", Georgia, serif;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(253, 252, 251, 0.94);
  box-shadow: 0 10px 34px rgba(16, 27, 55, 0.05);
  backdrop-filter: blur(16px);
  view-transition-name: heirloom-topbar;
}

.topbar-inner {
  width: min(1280px, calc(100% - 48px));
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 26px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-logo {
  width: auto;
  height: 80px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.brand {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 29px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0;
  text-align: left;
}

.brand-lockup span,
.eyebrow,
.timeline-filter label,
.block-type,
.gallery-header span {
  color: var(--gold-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.desktop-only {
  display: flex !important;
  gap: 26px;
  justify-content: center;
  min-width: 0;
}

.mobile-only {
  display: none !important;
}

.nav-icon {
  display: none;
}

.nav button,
.icon-button,
.text-button {
  min-height: 40px;
  padding: 8px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgba(16, 27, 55, 0.58);
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 160ms ease, border-color 160ms ease;
}

.nav button:hover,
.nav button.active {
  color: var(--gold-deep);
  border-bottom-color: var(--gold);
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.topbar-search {
  width: clamp(180px, 20vw, 310px);
  position: relative;
  display: block;
}

.search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  z-index: 1;
  display: inline-flex;
  color: rgba(16, 27, 55, 0.46);
  pointer-events: none;
  transform: translateY(-50%);
}

.topbar-search input {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px 9px 38px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  outline: none;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.topbar-search input:focus {
  border-bottom-color: var(--gold);
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(220, 138, 120, 0.12);
}

.topbar-search:focus-within .search-icon {
  color: var(--gold-deep);
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.primary-button {
  background: var(--ink);
  color: #fff;
}

.primary-button:hover {
  color: #fff4cf;
  box-shadow: 0 10px 24px rgba(16, 27, 55, 0.18);
}

.secondary-button {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.secondary-button:hover {
  border-color: rgba(220, 138, 120, 0.7);
  color: var(--gold-deep);
}

.danger-button {
  border-color: rgba(186, 26, 26, 0.24);
  background: var(--danger-soft);
  color: var(--danger);
}

.archive-layout {
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  align-items: start;
  transition: grid-template-columns 200ms ease;
}

.archive-layout:has(.archive-sidebar.collapsed) {
  grid-template-columns: 64px minmax(0, 1fr);
}

.archive-sidebar {
  position: sticky;
  top: 73px;
  display: block;
  padding: 28px 0;
  border-right: 1px solid rgba(16, 27, 55, 0.07);
  background: rgba(245, 243, 238, 0.66);
  overflow-x: hidden;
}

.archive-family {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 0 24px;
  margin-bottom: 28px;
}

.archive-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-bottom: 2px solid var(--gold);
  color: var(--gold-deep);
  font-family: "Newsreader", Georgia, serif;
  font-size: 12px;
  font-weight: 700;
}

.archive-family h2 {
  max-width: 150px;
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-transform: uppercase;
}

.archive-family p {
  margin: 0;
  color: rgba(16, 27, 55, 0.46);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.archive-sidebar nav {
  display: grid;
  gap: 0;
}

.archive-sidebar nav button {
  min-height: 44px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border: 0;
  border-left: 4px solid transparent;
  background: transparent;
  color: rgba(16, 27, 55, 0.66);
  text-align: left;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
  white-space: nowrap;
}

.archive-sidebar.collapsed nav button strong {
  display: none;
}

.archive-sidebar nav button span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}

.archive-sidebar nav button strong {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.archive-sidebar nav button:hover,
.archive-sidebar nav button.active {
  border-left-color: var(--gold);
  background: rgba(255, 255, 255, 0.72);
  color: var(--gold-deep);
}

.sidebar-add {
  min-height: 50px;
  margin: 28px 20px 0;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  font-family: "Newsreader", Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.archive-canvas {
  min-width: 0;
}

.page,
.chronicle-page {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 38px 24px 0;
}

.hero,
.chronicle-hero {
  display: grid;
  gap: 10px;
  margin-bottom: 42px;
}

.chronicle-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
}

.chronicle-intro {
  display: grid;
  gap: 10px;
}

.hero {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr);
  align-items: end;
}

h1,
.chronicle-hero h1 {
  max-width: 800px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(22px, 2.7vw, 34px);
  font-style: italic;
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0;
}

.composer-page h1 {
  max-width: 620px;
}

h2 {
  color: var(--ink);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.2;
}

h3 {
  color: var(--ink);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.24;
}

.lede,
.chronicle-lede {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.chronicle-lede {
  font-family: "Inter", "Segoe UI", sans-serif;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 14px 44px rgba(16, 27, 55, 0.045);
}

.panel-pad {
  padding: 24px;
}

.dashboard,
.composer,
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.memory-record-card {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(142, 111, 75, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(250, 246, 237, 0.74)),
    var(--paper);
  box-shadow: 0 18px 52px rgba(16, 27, 55, 0.07);
}

.memory-record-header {
  display: grid;
  gap: 6px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.memory-record-header span,
.memory-record-list dt {
  color: var(--gold-deep);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.memory-record-header strong {
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
  font-size: 24px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.1;
}

.memory-record-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.memory-record-list > div {
  display: grid;
  gap: 5px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(142, 111, 75, 0.15);
}

.memory-record-list > div:last-child {
  border-bottom: 0;
}

.memory-record-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.memory-record-delete {
  width: 100%;
  justify-content: center;
}

.sidebar {
  display: grid;
  gap: 16px;
  align-content: start;
}

.composer .sidebar {
  position: sticky;
  top: 96px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field label {
  color: var(--gold-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(16, 27, 55, 0.02);
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.timeline-day-control input:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(220, 138, 120, 0.08), 0 4px 12px rgba(16, 27, 55, 0.04);
}

.field input[type="date"],
.field input[type="time"],
.timeline-day-control input {
  cursor: pointer;
  font-family: var(--font-family);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.field input[type="date"]::-webkit-calendar-picker-indicator,
.field input[type="time"]::-webkit-calendar-picker-indicator,
.timeline-day-control input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: sepia(0.4) saturate(2) hue-rotate(-20deg);
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.field input[type="date"]:hover::-webkit-calendar-picker-indicator,
.field input[type="time"]:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
}

.field textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.55;
}

.block textarea {
  width: 100%;
  min-width: min(560px, 70vw);
  min-height: 220px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--body);
  resize: vertical;
}

.block textarea:focus {
  outline: none;
}

.timeline-filter {
  width: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 0;
}

.timeline-day-field {
  min-width: 224px;
  display: grid;
  gap: 6px;
}

.timeline-filter input {
  min-height: 38px;
  padding: 8px 10px;
}

.timeline-day-control {
  display: flex;
  align-items: center;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(16, 27, 55, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.timeline-day-control:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(220, 138, 120, 0.08), 0 4px 12px rgba(16, 27, 55, 0.04);
}

.timeline-day-control input {
  border: 0 !important;
  background: transparent !important;
  height: 36px;
  padding: 0 8px !important;
  box-shadow: none !important;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  min-width: 140px;
}

.timeline-day-step {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--vellum);
  color: var(--muted);
  transition: all 0.2s ease;
}

.timeline-day-step:hover {
  background: var(--gold);
  color: #fff;
}

.timeline-day-step:hover,
.timeline-day-step:focus-visible {
  border-color: rgba(220, 138, 120, 0.7);
  color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(220, 138, 120, 0.1);
  outline: none;
}

.timeline-filter-count,
.chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(74, 103, 65, 0.13);
  color: #324e2a;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.compact-button {
  min-height: 36px;
  margin-top: 0;
  padding: 7px 12px;
}

.chronicle-timeline {
  position: relative;
  display: grid;
  gap: 36px;
  max-width: 1120px;
  margin: 0 auto;
}

.chronicle-line {
  position: absolute;
  top: 8px;
  bottom: 12px;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, transparent, var(--gold) 12%, var(--gold) 88%, transparent);
  opacity: 0.42;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  gap: 0;
  align-items: center;
  min-height: 165px;
}

.timeline-date {
  display: flex;
  justify-content: flex-end;
  padding: 8px 18px 0 0;
}

.timeline-date button {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-align: right;
}

.timeline-date button:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.54);
}

.timeline-date span {
  font-family: "Newsreader", Georgia, serif;
  font-size: 16px;
  white-space: nowrap;
}

.timeline-date small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  margin: 0 auto;
}

.timeline-dot {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 3px solid var(--gold);
  border-radius: 50%;
  background: #fff;
  color: var(--gold);
  box-shadow: 0 10px 20px rgba(143, 75, 60, 0.14);
}

.timeline-marker-date {
  max-width: 96px;
  min-height: 24px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: var(--rosewater);
  color: var(--rosewater-ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 14px;
  text-align: center;
  text-transform: uppercase;
}

.timeline-marker-date:hover {
  color: var(--ink);
}

.timeline-dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 2px;
  transform: rotate(45deg);
}

.timeline-dot.avatar-dot {
  overflow: visible;
  padding: 0;
  border-width: 2px;
  cursor: help;
  position: relative;
  line-height: 0;
}

.timeline-dot.avatar-dot::before {
  display: none;
}

.timeline-avatar-frame {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: inherit;
  overflow: hidden;
}

.timeline-avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  color: transparent;
  font-size: 0;
}

.timeline-dot.avatar-dot::after {
  content: attr(data-name);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--ink);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(16, 27, 55, 0.15);
}

.timeline-dot.avatar-dot:hover::after {
  opacity: 1;
}

.timeline-item:nth-of-type(even) .timeline-dot.avatar-dot::after,
.timeline-day-item .timeline-dot.avatar-dot::after {
  left: auto;
  right: calc(100% + 12px);
}

.timeline-panel {
  position: relative;
  min-width: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.timeline-copy-panel {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 8px;
  padding: 14px 20px 14px 0;
  text-align: right;
}

.timeline-media-panel {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  justify-content: flex-start;
  padding-left: 20px;
}

.timeline-item:nth-of-type(even) .timeline-copy-panel {
  grid-column: 3;
  justify-items: start;
  padding: 14px 0 14px 20px;
  text-align: left;
}

.timeline-item:nth-of-type(even) .timeline-media-panel {
  grid-column: 1;
  justify-content: flex-end;
  padding-right: 20px;
  padding-left: 0;
}

.timeline-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 14px;
}

.timeline-load-more span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
}

.timeline-panel:hover h3 {
  color: var(--gold-deep);
}

.timeline-content {
  position: relative;
  display: block;
  min-height: 118px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 46px rgba(16, 27, 55, 0.05);
  cursor: pointer;
  overflow: hidden;
}

.timeline-thumb,
.day-entry-media {
  position: relative;
  overflow: hidden;
  border: 8px solid #fff;
  background:
    linear-gradient(135deg, rgba(16, 27, 55, 0.08), transparent 54%),
    var(--vellum-2);
  box-shadow: 0 8px 20px rgba(16, 27, 55, 0.08);
}

.timeline-thumb {
  width: min(100%, 290px);
  aspect-ratio: 4 / 3;
  padding: 0;
  border-width: 8px;
  transform: rotate(1deg);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.timeline-item:nth-of-type(even) .timeline-thumb {
  transform: rotate(-2deg);
}

.timeline-media-panel:hover .timeline-thumb {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 0 16px 32px rgba(16, 27, 55, 0.12);
}

.timeline-thumb .media-preview,
.day-entry-media .media-preview {
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  object-fit: cover;
}

.timeline-collage {
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  background: #fff;
}

.timeline-collage .collage-cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: block;
  overflow: hidden;
  background: var(--vellum-2);
  box-shadow: 0 2px 8px rgba(16, 27, 55, 0.08);
  transform: rotate(var(--tilt));
}

.timeline-collage .collage-cell:nth-child(1) {
  transform-origin: 80% 80%;
}

.timeline-collage .collage-cell:nth-child(2) {
  transform-origin: 20% 80%;
}

.timeline-collage .collage-cell:nth-child(3) {
  transform-origin: 80% 20%;
}

.timeline-collage .collage-cell:nth-child(4) {
  transform-origin: 20% 20%;
}

.timeline-collage .collage-cell .media-preview {
  width: 100%;
  height: 100%;
  max-height: none;
  display: block;
  border-radius: 0;
  object-fit: cover;
}

.timeline-thumb:empty::before {
  content: "";
  position: absolute;
  inset: 20%;
  border: 1px solid rgba(16, 27, 55, 0.2);
  border-radius: 50%;
}

.timeline-placeholder {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 10px;
  overflow: hidden;
  border-color: rgba(54, 60, 72, 0.16);
  background:
    linear-gradient(160deg, #f5f6f8 0%, #eff1f4 52%, #f8f9fb 100%);
}

.timeline-placeholder.quote-memory-card {
  width: min(100%, 430px);
  min-height: 245px;
  aspect-ratio: auto;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px 34px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  overflow: visible;
  transform: none;
  transition: none;
}

.timeline-placeholder.quote-memory-card::before,
.timeline-placeholder.quote-memory-card::after {
  content: none;
}

.quote-memory-quote {
  position: relative;
  z-index: 1;
  max-width: 300px;
  color: #0d2238;
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 1.9vw, 28px);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.28;
  text-align: center;
}

.quote-memory-mark {
  position: absolute;
  z-index: 1;
  color: #e07861;
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 50px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  opacity: 0.78;
  pointer-events: none;
}

.quote-memory-mark-start {
  left: 18px;
  top: 40px;
}

.quote-memory-mark-end {
  right: 18px;
  bottom: 62px;
}

.timeline-item:nth-of-type(even) .timeline-placeholder.quote-memory-card,
.timeline-media-panel:hover .timeline-placeholder.quote-memory-card {
  transform: none;
  box-shadow: none;
}

.quote-memory-divider {
  position: relative;
  z-index: 1;
  width: min(92%, 330px);
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(224, 120, 97, 0.82);
}

.quote-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor 20%, currentColor 80%, transparent);
  opacity: 0.5;
}

.quote-template-classic .quote-memory-quote {
  max-width: 300px;
}

.quote-divider-art {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.72;
}

.quote-template-rosewater-1 .quote-divider-art {
  transform: rotate(-10deg);
}

.quote-template-rosewater-2 .quote-divider-art {
  transform: rotate(8deg);
}

.quote-template-rosewater-3 .quote-divider-art {
  transform: rotate(-4deg);
}

.quote-template-rosewater-4 .quote-divider-art {
  transform: rotate(11deg);
}

.quote-divider-feather {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  filter: sepia(1) saturate(1.8) hue-rotate(-15deg) brightness(0.7);
  opacity: 0.55;
}

.placeholder-initial {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(72, 79, 93, 0.2);
  color: rgba(67, 74, 87, 0.56);
  font-family: "Newsreader", Georgia, serif;
  font-size: 24px;
  font-style: italic;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(36, 43, 54, 0.08);
}

.placeholder-title {
  margin: 0;
  max-width: 88%;
  text-align: center;
  color: rgba(45, 53, 66, 0.78);
  font-family: "Newsreader", Georgia, serif;
  font-size: 13px;
  font-style: italic;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.placeholder-meta {
  margin: 0;
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(83, 92, 108, 0.42);
}

.timeline-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(130deg, rgba(255, 255, 255, 0.42), transparent 46%),
    repeating-linear-gradient(45deg, rgba(108, 117, 132, 0.025) 0 1px, transparent 1px 9px);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.timeline-placeholder::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(108, 118, 135, 0.14);
  pointer-events: none;
}

.timeline-placeholder.placeholder-1::before {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.4), transparent 46%),
    repeating-linear-gradient(-38deg, rgba(106, 116, 133, 0.03) 0 1px, transparent 1px 10px);
}

.timeline-placeholder.placeholder-2::before {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.46), transparent 48%),
    repeating-linear-gradient(0deg, rgba(112, 121, 137, 0.028) 0 1px, transparent 1px 9px);
}

.timeline-media-panel:hover .timeline-placeholder {
  transform: rotate(0deg) translateY(-2px);
}

.timeline-media-panel:hover .timeline-placeholder .placeholder-initial {
  transform: none;
  color: rgba(58, 66, 80, 0.66);
}

.image-thumb {
  cursor: zoom-in;
}

.gallery-count {
  position: absolute;
  right: 5px;
  bottom: 5px;
  background: rgba(16, 27, 55, 0.78);
  color: white;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 700;
}

.timeline-copy h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 20px;
  font-style: normal;
  font-weight: 500;
  line-height: 28px;
}

.timeline-copy p {
  max-width: 430px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.timeline-item:nth-of-type(even) .timeline-meta {
  justify-content: flex-start;
}

.timeline-meta span,
.timeline-meta button {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 0;
  background: rgba(74, 103, 65, 0.14);
  color: #324e2a;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.timeline-meta button,
.timeline-meta span:not(:first-child) {
  background: rgba(16, 27, 55, 0.06);
  color: var(--muted);
}

.chronicle-actions,
.entry-actions,
.block-actions,
.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chronicle-actions {
  justify-content: inherit;
}

.memory-action-button,
.edit-feather-button {
  width: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: #fff;
  color: var(--gold-deep);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.memory-action-button:focus,
.edit-feather-button:focus,
.timeline-panel:focus {
  outline: none;
}

.memory-action-button:focus-visible,
.edit-feather-button:focus-visible {
  outline: 2px solid rgba(159, 79, 66, 0.44);
  outline-offset: 3px;
}

.memory-action-button {
  border-color: rgba(159, 79, 66, 0.34);
  color: rgba(159, 79, 66, 0.78);
}

.edit-feather-button:hover {
  background: var(--gold);
  color: var(--ink);
}

.memory-action-button:hover,
.memory-action-button.is-favorite {
  border-color: rgba(159, 79, 66, 0.58);
  background: var(--rosewater);
  color: var(--rosewater-ink);
}

.memory-action-button.is-popping svg {
  animation: favoritePop 180ms cubic-bezier(0.2, 1.4, 0.34, 1) both;
}

.memory-action-button svg,
.edit-feather-button svg {
  pointer-events: none;
}

@keyframes favoritePop {
  0% {
    transform: scale(1);
  }

  52% {
    transform: scale(1.32) rotate(-7deg);
  }

  100% {
    transform: scale(1);
  }
}

.timeline-day-post {
  display: block;
  cursor: default;
}

.timeline-day-post:hover {
  transform: none;
}

.day-post-copy h3 {
  margin-bottom: 18px;
  font-size: clamp(26px, 3vw, 38px);
}

.day-entry-list {
  display: grid;
  gap: 18px;
}

.day-entry {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.day-entry:first-child {
  padding-top: 0;
  border-top: 0;
}

.day-entry-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.day-entry-header time {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-deep);
  font-size: 12px;
  font-weight: 800;
}

.day-entry-header h4 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 500;
}

.day-entry-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px;
}

.day-entry-text {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.day-entry-media {
  width: 100%;
  min-height: 180px;
  padding: 0;
}

.chronicle-empty,
.empty {
  padding: 44px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  text-align: center;
}

.audio-note {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 249, 244, 0.78);
  overflow: hidden;
}

.timeline-audio {
  width: min(255px, 28vw);
  min-height: 72px;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
}

.timeline-audio .audio-play-button {
  width: 46px;
  height: 46px;
}

.timeline-audio .audio-play-icon {
  border-top-width: 9px;
  border-bottom-width: 9px;
  border-left-width: 14px;
}

.timeline-audio.is-playing .audio-play-icon {
  width: 14px;
  height: 18px;
}

.timeline-audio .audio-card-head {
  gap: 6px;
}

.timeline-audio .audio-card-head span {
  font-size: 13px;
}

.timeline-audio .audio-card-head time {
  font-size: 11px;
}

.timeline-audio .audio-waveform {
  height: 28px;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.timeline-audio .audio-waveform i {
  width: 3px;
  flex: 0 0 auto;
}

.day-entry-audio {
  grid-column: 1 / -1;
  width: min(100%, 620px);
  min-height: 124px;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
}

.block-audio {
  width: 100%;
  min-width: 0;
  max-width: 680px;
  overflow: hidden;
}

.block-audio.align-left {
  align-self: flex-start;
}

.block-audio.align-right {
  align-self: flex-end;
}

.story-audio {
  width: min(100%, 620px);
  min-height: 124px;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 14px 34px rgba(16, 27, 55, 0.06);
}

.audio-play-button {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  box-shadow: 0 12px 28px rgba(16, 27, 55, 0.16);
  transition: transform 160ms ease;
}

.audio-play-button:hover {
  transform: scale(1.04);
}

.day-entry-audio .audio-play-button {
  width: 82px;
  height: 82px;
}

.story-audio .audio-play-button {
  width: 82px;
  height: 82px;
}

.audio-play-icon {
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid currentColor;
}

.audio-note.is-playing .audio-play-icon {
  width: 18px;
  height: 22px;
  margin-left: 0;
  border: 0;
  background: linear-gradient(90deg, currentColor 0 36%, transparent 36% 64%, currentColor 64% 100%);
}

.audio-card-main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  gap: 12px;
  overflow: hidden;
}

.audio-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.audio-card-head span {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-card-title {
  inline-size: 100%;
  max-inline-size: 100%;
  contain: inline-size;
}

.audio-card-head time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.audio-waveform {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.audio-waveform i {
  width: 6px;
  min-height: 8px;
  border-radius: 999px;
  background: rgba(16, 27, 55, 0.12);
}

.audio-waveform i.played,
.audio-note.is-playing .audio-waveform i.played {
  background: var(--gold);
}

.timeline-audio-source {
  display: none;
}

.block-list {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.block {
  min-width: 0;
  padding: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  outline: none;
}

.block.message-bubble:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 8px 30px rgba(16, 27, 55, 0.08);
  background: #fff;
  z-index: 2;
}

.block-actions .icon-button {
  width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  transition: all 160ms ease;
}

.block-actions .icon-button:hover {
  background: var(--vellum-2);
  border-color: var(--line);
  color: var(--gold-deep);
}

.block-actions .icon-button svg {
  width: 18px;
  height: 18px;
}

.message-bubble {
  position: relative;
  width: 100%;
  max-width: 780px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.composer-bubble:nth-child(even),
.story-bubble:nth-child(even) {
  justify-self: end;
  background: rgba(202, 236, 188, 0.26);
}

.media-bubble {
  max-width: min(520px, 100%);
}

.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 12px;
}

.media-preview {
  width: 100%;
  max-height: 420px;
  border-radius: 4px;
  background: transparent;
  object-fit: contain;
}

.add-block-grid {
  display: grid;
  gap: 10px;
}

.file-input {
  position: relative;
  overflow: hidden;
}

.file-input input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.detail-page {
  overflow-x: clip;
}

.story {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 44px 22px 60px;
  background: rgba(255, 255, 255, 0.58);
}

.story-block {
  width: 100%;
  min-width: 0;
  max-width: 680px;
  position: relative;
  opacity: 0;
  animation: revealUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.story-block:nth-child(1) { animation-delay: 0.1s; }
.story-block:nth-child(2) { animation-delay: 0.2s; }
.story-block:nth-child(3) { animation-delay: 0.3s; }
.story-block:nth-child(4) { animation-delay: 0.4s; }
.story-block:nth-child(5) { animation-delay: 0.5s; }
.story-block:nth-child(n+6) { animation-delay: 0.6s; }

.detail-image-gallery {
  max-width: 920px;
  display: grid;
  gap: 18px;
}

.detail-gallery-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 0 4px;
}

.detail-gallery-header span {
  display: block;
  margin-bottom: 4px;
  color: var(--gold-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.detail-gallery-header h3 {
  margin: 0;
  font-size: 26px;
  font-style: italic;
}

.detail-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 118px;
  grid-auto-flow: dense;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.detail-gallery-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--vellum-2);
  cursor: zoom-in;
}

.detail-gallery-tile.tile-0,
.detail-gallery-tile.tile-5 {
  grid-column: span 2;
  grid-row: span 2;
}

.detail-gallery-tile.tile-3 {
  grid-column: span 2;
}

.detail-gallery-tile .media-preview {
  width: 100%;
  height: 100%;
  max-height: none;
  display: block;
  border-radius: 0;
  object-fit: cover;
  transition: transform 260ms ease, filter 260ms ease;
}

.detail-gallery-tile:hover .media-preview {
  filter: saturate(1.06) contrast(1.02);
  transform: scale(1.035);
}

.detail-gallery-count {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  border-radius: 999px;
  background: rgba(16, 27, 55, 0.78);
  color: white;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-gallery-tile .gallery-count {
  right: auto;
  left: 10px;
  bottom: 10px;
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.block-text {
  padding: 0 24px;
}

.story-text {
  margin: 0;
  color: #2c2b28;
  font-family: "Newsreader", Georgia, serif;
  font-size: 22px;
  line-height: 1.76;
}

.story-text.lead-text::first-letter {
  float: left;
  padding: 6px 14px 0 0;
  color: var(--gold-deep);
  font-size: 76px;
  font-style: italic;
  font-weight: 300;
  line-height: 60px;
}

.block-image {
  max-width: 600px;
  margin: 12px 0;
}

.block-image.align-left {
  align-self: flex-start;
}

.block-image.align-right {
  align-self: flex-end;
}

.archival-frame {
  margin: 0;
  padding: 12px 12px 42px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: white;
  box-shadow: 0 16px 44px rgba(16, 27, 55, 0.09);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}

.archival-frame:hover {
  transform: translateY(-5px) scale(1.015);
  box-shadow: 0 20px 56px rgba(16, 27, 55, 0.13);
}

.gallery-inline {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--vellum-2);
  overflow: hidden;
  cursor: zoom-in;
}

.gallery-inline .media-preview {
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  object-fit: cover;
}

.generic-frame {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--vellum);
  box-shadow: none;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.gallery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(251, 249, 244, 0.95);
  backdrop-filter: blur(8px);
}

.gallery-panel {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.gallery-header,
.gallery-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
}

.gallery-header h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 26px;
  font-style: italic;
}

.gallery-close,
.gallery-arrow {
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--ink);
}

.gallery-close {
  width: 44px;
  height: 44px;
}

.gallery-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 100px;
  overflow: hidden;
}

.gallery-image {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 24px;
}

.gallery-image .media-preview {
  width: auto;
  height: auto;
  max-width: calc(100% * var(--zoom, 1));
  max-height: calc(100% * var(--zoom, 1));
  border-radius: 4px;
  box-shadow: 0 16px 40px rgba(16, 27, 55, 0.12);
  object-fit: contain;
  transition: max-width 180ms ease, max-height 180ms ease;
}

.gallery-image.is-transitioning {
  overflow: hidden;
}

.gallery-swap-image {
  position: absolute;
  inset: 24px;
  margin: auto;
  opacity: 0;
  transform: translateX(18px) scale(0.985);
  transition: opacity 240ms ease, transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

.gallery-swap-image.from-prev {
  transform: translateX(-18px) scale(0.985);
}

.gallery-swap-image.is-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 10;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
}

.gallery-arrow:hover,
.gallery-close:hover {
  border-color: var(--gold);
  color: var(--gold-deep);
}

.gallery-arrow.prev {
  left: 32px;
}

.gallery-arrow.next {
  right: 32px;
}

.gallery-footer span {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.gallery-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}






.export-tree {
  max-height: 320px;
  overflow: auto;
  padding: 16px;
  border-radius: var(--radius);
  background: #101b37;
  color: #f7f0d6;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.loading-state {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  max-width: 360px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  animation: toastIn 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.toast-success {
  background: #12331d;
  color: #f2fff0;
}

.toast-check {
  width: 26px;
  height: 26px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: #234a1e;
  animation: checkPop 560ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.prototype-links {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  color: var(--muted);
}

.prototype-links a {
  color: var(--gold-deep);
}

.memory-open-page {
  animation: memoryPageSettle 660ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.memory-open-page .hero {
  animation: memoryHeroSlide 720ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.memory-open-page .story,
.memory-open-page .detail-layout > aside {
  animation: memoryPanelSlide 760ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (min-width: 820px) {
  .block-image.align-left {
    transform: translateX(-4%) rotate(-1.5deg);
  }

  .block-image.align-right {
    transform: translateX(4%) rotate(2deg);
  }
}

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

@keyframes timelineGlint {
  from { transform: translateX(-120%); }
  to { transform: translateX(120%); }
}

@keyframes memoryTimelineExit {
  from { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
  to { opacity: 0.28; transform: translateX(-18vw) scale(0.96); filter: blur(8px); }
}

@keyframes memoryDetailEnter {
  from { opacity: 0.18; transform: translateX(28vw) scale(1.035); filter: blur(10px); }
  72% { opacity: 1; filter: blur(0); }
  to { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}

@keyframes memoryPageSettle {
  from { background: #fffdf8; }
  to { background: transparent; }
}

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

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

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes checkPop {
  0% {
    opacity: 0;
    transform: scale(0.48) rotate(-14deg);
  }
  62% {
    opacity: 1;
    transform: scale(1.12) rotate(3deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes saveButtonPulse {
  from {
    box-shadow: inset 0 0 0 1px rgba(220, 138, 120, 0.24), 0 -2px 14px rgba(16, 27, 55, 0);
  }
  to {
    box-shadow: inset 0 0 0 1px rgba(220, 138, 120, 0.54), 0 -2px 18px rgba(220, 138, 120, 0.28);
  }
}

@keyframes saveIconSpin {
  from {
    transform: rotate(0deg) scale(0.94);
  }
  to {
    transform: rotate(360deg) scale(1);
  }
}

@supports (view-transition-name: none) {
  html[data-transition="memory-open"]::view-transition-group(root) {
    animation-duration: 760ms;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }

  html[data-transition="memory-open"]::view-transition-old(root) {
    animation: memoryTimelineExit 540ms cubic-bezier(0.55, 0, 0.1, 1) both;
  }

  html[data-transition="memory-open"]::view-transition-new(root) {
    animation: memoryDetailEnter 760ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  html[data-transition="memory-open"]::view-transition-group(heirloom-topbar),
  html[data-transition="memory-open"]::view-transition-old(heirloom-topbar),
  html[data-transition="memory-open"]::view-transition-new(heirloom-topbar) {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-content,
  .timeline-thumb,
  .memory-open-page,
  .memory-open-page .hero,
  .memory-open-page .story,
  .memory-open-page .detail-layout > aside,
  .story-block {
    animation: none;
    transition: none;
  }

  .story-block {
    opacity: 1;
    transform: none;
  }

  .timeline-content:hover {
    transform: none;
  }

  .timeline-content:hover::after {
    animation: none;
  }
}

@media (max-width: 1024px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  .app-shell,
  .archive-layout,
  .archive-canvas {
    max-width: 100%;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }

  .topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: min(calc(100% - 24px), 1280px);
    padding: 12px 0;
  }

  .bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: calc(64px + env(safe-area-inset-bottom)) !important;
    background: var(--paper) !important;
    box-shadow: 0 -10px 40px rgba(16, 27, 55, 0.08) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    z-index: 9999 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
    transform: translateZ(0);
    contain: layout paint;
    border-top: 1px solid var(--line) !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
  }

  .bottom-nav button,
  .bottom-nav .search-button {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    height: 64px !important;
    border: 0 !important;
    border-right: 1px solid var(--line) !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    font-size: 8px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: var(--muted) !important;
    background: transparent !important;
  }

  .bottom-nav button:last-child {
    border-right: 0 !important;
  }

  .bottom-nav button:last-of-type {
    border-right: 0 !important;
  }

  .bottom-nav button.active {
    background: var(--vellum) !important;
    color: var(--gold-deep) !important;
    box-shadow: inset 0 -4px 0 var(--gold) !important;
  }

  .bottom-nav .bottom-nav-primary {
    background: var(--ink) !important;
    color: #fff !important;
  }

  .bottom-nav .bottom-nav-primary:disabled {
    opacity: 0.7;
  }

  .bottom-nav .bottom-nav-primary.is-saving {
    opacity: 1;
    animation: saveButtonPulse 760ms ease-in-out infinite alternate;
  }

  .bottom-nav .bottom-nav-primary.is-saving .nav-icon {
    animation: saveIconSpin 760ms cubic-bezier(0.45, 0, 0.25, 1) infinite;
  }

  .bottom-nav .nav-icon {
    display: flex !important;
    font-size: 18px !important;
  }

  .bottom-nav .nav-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  .bottom-nav .nav-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bottom-nav button.active .nav-icon {
    color: var(--gold) !important;
  }

  .bottom-nav .bottom-nav-primary .nav-icon {
    color: var(--gold) !important;
  }

  .bottom-nav label.file-input-btn {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    height: 64px !important;
    border: 0 !important;
    border-right: 1px solid var(--line) !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    font-size: 8px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: var(--muted) !important;
    background: transparent !important;
    cursor: pointer;
  }

  .bottom-nav label.file-input-btn input {
    display: none;
  }

  .camera-capture-sheet {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    z-index: 10000;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 -16px 48px rgba(16, 27, 55, 0.16);
  }

  .camera-capture-option {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--paper-2);
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .camera-capture-option input {
    display: none;
  }

  .topbar-search {
    display: none !important;
  }

  .archive-layout {
    display: block !important;
  }

  .archive-sidebar {
    display: none !important;
  }

  .page,
  .chronicle-page {
    width: 100% !important;
    padding: 24px 16px calc(96px + env(safe-area-inset-bottom)) !important;
  }

  /* Scrolled Mobile Topbar */
  .topbar {
    position: sticky !important;
    top: 0 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .topbar.scrolled {
    background: rgba(253, 252, 251, 0.98);
    box-shadow: 0 4px 15px rgba(16, 27, 55, 0.08);
  }

  .topbar.scrolled .topbar-inner {
    min-height: 52px;
    padding: 6px 12px;
    width: 100%;
  }

  .topbar.scrolled .brand-copy {
    opacity: 0;
    width: 0;
    overflow: hidden;
    display: none;
  }

  .topbar.scrolled .brand-logo {
    height: 42px;
  }

  .topbar.scrolled .brand-lockup {
    gap: 0;
  }

  .topbar.scrolled .header-avatar {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 760px) {
  .memory-open-page,
  .memory-open-page .hero,
  .memory-open-page .story,
  .memory-open-page .detail-layout > aside {
    animation: none;
  }

  .hero,
  .chronicle-hero,
  .dashboard,
  .composer,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .chronicle-hero {
    align-items: start;
    gap: 16px;
  }

  .timeline-filter {
    justify-content: flex-start;
  }

  .brand {
    font-size: 25px;
  }

  .brand-logo {
    width: auto;
    height: 67px;
  }

  .chronicle-timeline {
    gap: 34px;
  }

  .chronicle-line {
    left: 20px;
  }

  .timeline-item {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px 10px;
    padding-left: 0;
    min-height: 0;
  }

  .timeline-date {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding: 0 0 0 54px;
  }

  .timeline-marker {
    grid-column: 1;
    grid-row: 1;
    gap: 6px;
    align-content: start;
    margin: 8px auto 0;
  }

  .timeline-dot {
    width: 38px;
    height: 38px;
  }

  .timeline-marker-date {
    max-width: 72px;
    font-size: 9px;
    line-height: 12px;
    transform: translateX(15px);
  }

  .timeline-copy-panel,
  .timeline-item:nth-of-type(even) .timeline-copy-panel {
    grid-column: 2;
    grid-row: 2;
    justify-items: start;
    padding: 8px 0 0;
    text-align: left;
  }

  .timeline-media-panel,
  .timeline-item:nth-of-type(even) .timeline-media-panel {
    grid-column: 2;
    grid-row: 1;
    padding: 0;
  }

  .timeline-copy p {
    max-width: none;
    font-size: 16px;
    line-height: 24px;
  }

  .timeline-meta,
  .timeline-item:nth-of-type(even) .timeline-meta {
    justify-content: flex-start;
  }

  .timeline-content {
    grid-column: 2;
    grid-row: 2;
  }

  .timeline-thumb {
    width: 100%;
    max-width: 220px;
    transform: none;
  }

  .timeline-placeholder.quote-memory-card {
    max-width: 260px;
    min-height: 190px;
    gap: 14px;
    padding: 20px 28px 16px;
  }

  .quote-memory-quote {
    max-width: 188px;
    font-size: 18px;
    line-height: 1.22;
  }

  .quote-memory-mark {
    font-size: 34px;
  }

  .quote-memory-mark-start {
    left: 8px;
    top: 34px;
  }

  .quote-memory-mark-end {
    right: 8px;
    bottom: 52px;
  }

  .quote-memory-divider {
    width: 96%;
  }

  .timeline-item:nth-of-type(even) .timeline-thumb,
  .timeline-media-panel:hover .timeline-thumb {
    transform: none;
  }

  .timeline-audio,
  .day-entry-audio {
    width: 100%;
    grid-template-columns: 62px minmax(0, 1fr);
    padding: 14px;
  }

  .audio-play-button,
  .day-entry-audio .audio-play-button,
  .story-audio .audio-play-button {
    width: 60px;
    height: 60px;
  }

  .story-audio {
    max-width: 100%;
    min-width: 0;
    width: 100%;
    grid-template-columns: 62px minmax(0, 1fr);
    padding: 14px;
  }

  .audio-card-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
  }

  .audio-card-title {
    max-width: calc(100vw - 146px);
  }

  .memory-open-page .story {
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
  }

  .gallery-stage {
    padding: 0 56px;
  }

  .detail-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 120px;
  }

  .detail-gallery-tile.tile-0,
  .detail-gallery-tile.tile-5,
  .detail-gallery-tile.tile-3 {
    grid-column: span 1;
    grid-row: span 1;
  }

  .detail-gallery-tile.tile-0 {
    grid-column: span 2;
    grid-row: span 2;
  }

  .gallery-arrow {
    width: 36px;
    height: 36px;
  }

  .gallery-arrow.prev {
    left: 10px;
  }

  .gallery-arrow.next {
    right: 10px;
  }

  .gallery-header,
  .gallery-footer {
    padding: 16px;
  }

  .gallery-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .gallery-controls {
    justify-content: flex-start;
  }

  .gallery-modal {
    z-index: 10050;
    background: #050505;
  }

  .gallery-backdrop {
    background: #050505;
    backdrop-filter: none;
  }

  .gallery-panel {
    height: 100dvh;
    grid-template-rows: minmax(0, 1fr);
    color: #fff;
  }

  .gallery-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: calc(12px + env(safe-area-inset-top)) 14px 10px;
    background: transparent;
  }

  .gallery-header div,
  .gallery-footer {
    display: none;
  }

  .gallery-close {
    width: 40px;
    height: 40px;
    border: 0;
    background: rgba(0, 0, 0, 0.34);
    color: #fff;
    backdrop-filter: blur(8px);
  }

  .gallery-stage {
    grid-row: 1 / -1;
    padding: 0;
    touch-action: pan-y;
  }

  .gallery-image {
    padding: 0;
    overflow: hidden;
  }

  .gallery-swap-image {
    inset: 0;
  }

  .gallery-image .media-preview {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    object-fit: cover;
  }

  .gallery-arrow,
  .gallery-controls {
    display: none;
  }


  .mobile-search-overlay {
    position: fixed;
    inset: 0;
    background: var(--paper);
    z-index: 10000;
    padding: 24px;
    display: flex;
    flex-direction: column;
    animation: modalEnter 0.3s ease;
  }

  .mobile-search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
  }

  .mobile-search-bar input {
    flex: 1;
    height: 56px;
    padding: 0 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--vellum);
    font-size: 18px;
    color: var(--ink);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  }

  .mobile-search-results {
    display: grid;
    gap: 10px;
    overflow-y: auto;
    padding-bottom: 18px;
  }

  .mobile-search-result {
    border: 1px solid var(--line);
    background: var(--vellum);
    border-radius: 14px;
    padding: 12px 14px;
    text-align: left;
    display: grid;
    gap: 4px;
    color: var(--ink);
  }

  .mobile-search-result strong {
    font-family: "Newsreader", Georgia, serif;
    font-size: 18px;
    line-height: 1.25;
  }

  .mobile-search-result span {
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
  }

  .mobile-search-empty {
    margin: 10px 0 0;
    color: var(--muted);
    font-style: italic;
  }

  .placeholder-initial {
    width: 40px;
    height: 40px;
    font-size: 21px;
  }

  .placeholder-title {
    font-size: 12px;
  }

  .placeholder-meta {
    font-size: 8px;
  }
}

body {
  padding-bottom: 0;
}

/* Video Recorder Modal */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.video-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 27, 55, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.video-recorder-panel {
  position: relative;
  width: min(800px, 100%);
  max-height: 90vh;
  background: var(--paper);
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.25);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: modalEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.video-recorder-header {
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}

.video-recorder-header h2 {
  margin: 0;
  font-size: 24px;
  font-style: italic;
  font-weight: 800;
  color: var(--ink);
}

.camera-mode-bar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.camera-mode-bar button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 800;
}

.camera-mode-bar button.active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--ink);
}

.camera-mode-bar .camera-facing-button {
  width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.video-recorder-stage {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 50vh;
  flex-shrink: 0;
}

.video-live-preview,
.video-playback-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-live-preview.is-mirrored {
  transform: scaleX(-1);
}

.recording-indicator {
  position: absolute;
  top: 24px;
  left: 24px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  padding: 8px 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-weight: 700;
  font-family: monospace;
  font-size: 16px;
  pointer-events: none;
}

.dot {
  width: 12px;
  height: 12px;
  background: #ff4d4d;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.5);
}

.dot.blink {
  animation: pulse 1.5s infinite;
}

.dot.paused {
  background: #ffcc00;
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

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

.video-trimmer-container {
  padding: 24px 32px;
  background: var(--vellum);
  border-bottom: 1px solid var(--line);
}

.video-trimmer-container label {
  display: block;
  margin-bottom: 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-deep);
}

.video-trimmer {
  position: relative;
  height: 48px;
  background: var(--vellum-3);
  border-radius: 8px;
  margin-bottom: 12px;
}

.trim-track {
  position: absolute;
  inset: 0;
  background: rgba(16, 27, 55, 0.05);
}

.trim-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--gold-soft);
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  opacity: 0.4;
}

.trim-handle {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 20px;
  background: var(--gold);
  border: 0;
  border-radius: 4px;
  cursor: ew-resize;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.trim-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 12px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 1px;
}

.trim-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-family: monospace;
}

.video-recorder-footer {
  padding: 32px;
  display: flex;
  justify-content: center;
  background: var(--paper);
  position: sticky;
  bottom: 0;
  z-index: 10;
  border-top: 1px solid var(--line);
}

.recorder-controls {
  display: flex;
  gap: 24px;
  align-items: center;
}

.recorder-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  color: var(--ink);
  padding: 12px;
  border-radius: 12px;
  transition: all 0.2s ease;
  min-width: 80px;
}

.recorder-btn:hover {
  background: var(--vellum-2);
  transform: translateY(-2px);
}

.recorder-btn span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.record-btn {
  color: #ff4d4d;
}

.record-btn:hover {
  background: rgba(255, 77, 77, 0.05);
}

.capture-btn {
  color: var(--gold-deep);
}

.capture-btn:hover {
  background: var(--gold-soft);
}

.stop-btn {
  color: var(--ink);
}

.save-btn {
  color: var(--green);
}

.save-btn:hover {
  background: rgba(74, 103, 65, 0.05);
}

.restart-btn {
  color: var(--muted);
}

@media (max-width: 760px) {
  .video-modal,
  .audio-modal {
    align-items: stretch;
    justify-items: stretch;
    padding: 0;
  }

  .video-recorder-panel,
  .audio-recorder-panel {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
  }

  .video-recorder-header {
    padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  }

  .video-recorder-header h2 {
    font-size: 18px;
  }

  .camera-mode-bar {
    padding: 10px 14px;
  }

  .video-recorder-stage {
    aspect-ratio: 9/12;
    max-height: none;
    min-height: 0;
    flex: 1;
  }

  .audio-recorder-stage {
    height: auto;
    min-height: 0;
    flex: 1;
  }

  .video-trimmer-container {
    padding: 16px;
  }

  .video-recorder-footer {
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
    box-shadow: 0 -14px 30px rgba(16, 27, 55, 0.12);
  }

  .recorder-controls {
    width: 100%;
    gap: 10px;
    justify-content: center;
  }

  .recorder-btn {
    min-width: 64px;
    padding: 10px 8px;
  }

  .recorder-btn svg {
    width: 28px;
    height: 28px;
  }

  .save-btn {
    flex: 1;
    max-width: 180px;
    min-height: 56px;
    border-radius: 999px;
    background: var(--green);
    color: #fff;
    box-shadow: 0 12px 24px rgba(74, 103, 65, 0.28);
  }

  .save-btn:hover {
    background: var(--green);
  }
}

/* Audio Recorder Modal */
.audio-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 24px;
}

.audio-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 27, 55, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.audio-recorder-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 90vh;
  background: var(--paper);
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.25);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  animation: modalEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.audio-recorder-stage {
  position: relative;
  height: 240px;
  background: var(--vellum);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  overflow: hidden;
}

.voice-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 80px;
  width: 100%;
}

.visualizer-bar {
  width: 4px;
  height: 8px;
  background: var(--gold);
  border-radius: 999px;
  transition: height 0.05s ease, background 0.2s ease;
}

.audio-recorder-stage.is-recording .visualizer-bar {
  background: var(--gold-deep);
}

.audio-playback-preview {
  width: 80%;
  margin-top: 12px;
}

.audio-trimmer-container {
  padding: 24px 32px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}




.header-avatar {
  appearance: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  background: var(--vellum);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  padding: 0;
}

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

img[data-avatar-fallback] {
  color: transparent;
  font-size: 0;
}

.header-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(220, 138, 120, 0.2);
}

.header-user-menu {
  position: relative;
}

.header-user-menu.is-open .header-avatar {
  box-shadow: 0 0 0 3px rgba(220, 138, 120, 0.18), 0 7px 16px rgba(16, 27, 55, 0.18);
}

.avatar-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 190px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(220, 138, 120, 0.3);
  background: rgba(252, 248, 243, 0.98);
  box-shadow: 0 18px 38px rgba(16, 27, 55, 0.15);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 40;
}

.header-user-menu.is-open .avatar-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.avatar-menu button {
  border: none;
  background: transparent;
  text-align: left;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--ink);
  font-family: "Hanken Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.avatar-menu button:hover {
  background: var(--rosewater);
}

.avatar-menu-user,
.avatar-menu-email {
  margin: 0 2px;
  font-family: "Hanken Grotesk", sans-serif;
}

.avatar-menu-user {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.avatar-menu-email {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.avatar-menu-caption {
  margin: 4px 2px 1px;
  color: var(--muted);
  font-size: 12px;
  font-family: "Hanken Grotesk", sans-serif;
}

.landing-page {
  min-height: 100vh;
  background: #fbf7ef;
}

.landing-hero {
  position: relative;
  min-height: 84vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  color: #fffaf2;
  background:
    linear-gradient(90deg, rgba(16, 27, 55, 0.82) 0%, rgba(16, 27, 55, 0.62) 44%, rgba(16, 27, 55, 0.2) 100%),
    url("./heirloom2.png") center / cover no-repeat;
}

.landing-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 120px;
  pointer-events: none;
  background: linear-gradient(transparent, #fbf7ef);
}

.landing-nav {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-brand,
.landing-nav-link {
  color: #fffaf2;
  text-decoration: none;
}

.landing-auth-form {
  margin: 0;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 26px;
  font-weight: 800;
}

.landing-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.26));
}

.landing-nav-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border: 1px solid rgba(255, 250, 242, 0.44);
  border-radius: 4px;
  background: transparent;
  font-weight: 800;
}

.landing-nav-link:hover {
  background: rgba(255, 250, 242, 0.12);
}

.landing-hero-copy {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  align-self: center;
  padding: 28px 0 96px;
}

.landing-kicker {
  margin: 0 0 16px;
  color: #f5c9b9;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.landing-hero h1 {
  max-width: 680px;
  margin: 0;
  color: #fffaf2;
  font-size: clamp(58px, 10vw, 132px);
  line-height: 0.86;
}

.landing-lede {
  max-width: 560px;
  margin: 22px 0 0;
  color: rgba(255, 250, 242, 0.88);
  font-size: 22px;
  line-height: 1.35;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.landing-signup,
.landing-secondary {
  min-height: 48px;
  padding-inline: 20px;
  font-size: 14px;
}

.landing-signup {
  border: none;
  cursor: pointer;
}

.landing-auth-form button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.landing-auth-error {
  width: 100%;
  margin: 4px 0 0;
  color: #ffe1d7;
  font-size: 14px;
  font-weight: 800;
}

.landing-signup {
  background: #fffaf2;
  color: var(--ink);
}

.landing-signup:hover {
  color: var(--ink);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.landing-secondary {
  border-color: rgba(255, 250, 242, 0.44);
  background: rgba(255, 250, 242, 0.08);
  color: #fffaf2;
}

.landing-secondary:hover {
  color: #fffaf2;
  border-color: #fffaf2;
}

.landing-preview {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 72px;
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) 1.22fr;
  gap: 34px;
  align-items: start;
}

.landing-preview-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(32px, 5vw, 58px);
  line-height: 0.98;
}

.landing-memory-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.landing-memory-strip article {
  min-height: 210px;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(16, 27, 55, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 42px rgba(16, 27, 55, 0.08);
}

.landing-memory-strip span {
  color: var(--rosewater-ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.landing-memory-strip h3 {
  margin: 0;
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.landing-memory-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.invite-hero {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(16, 27, 55, 0.84) 0%, rgba(16, 27, 55, 0.66) 48%, rgba(16, 27, 55, 0.24) 100%),
    url("./heirloom2.png") center / cover no-repeat;
}

.invite-hero-copy {
  max-width: 760px;
}

.invite-summary {
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px 16px;
  margin-top: 28px;
  padding: 18px;
  border: 1px solid rgba(255, 250, 242, 0.28);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.11);
  backdrop-filter: blur(14px);
}

.invite-summary span {
  color: rgba(255, 250, 242, 0.68);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.invite-summary strong {
  min-width: 0;
  color: #fffaf2;
  overflow-wrap: anywhere;
}

.invite-accepting {
  text-align: center;
}

.invite-accepting h1 {
  margin: 0 0 12px;
}

@media (max-width: 820px) {
  .landing-hero {
    min-height: 82vh;
    background:
      linear-gradient(rgba(16, 27, 55, 0.76), rgba(16, 27, 55, 0.7)),
      url("./heirloom2.png") center / cover no-repeat;
  }

  .landing-hero-copy {
    padding-bottom: 78px;
  }

  .landing-lede {
    font-size: 18px;
  }

  .landing-preview {
    grid-template-columns: 1fr;
  }

  .landing-memory-strip {
    grid-template-columns: 1fr;
  }

  .invite-summary {
    grid-template-columns: 1fr;
  }
}


/* Header Metadata & Contributor Stack */
.header-metadata {
  display: flex;
  align-items: center;
  gap: 32px;
  margin: 0 auto;
}

.header-status {
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 16px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.contributor-stack {
  display: flex;
  align-items: center;
}

.contributor-stack img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--paper-2);
  margin-left: -10px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  object-fit: cover;
  background: var(--vellum);
}

.contributor-stack img:first-child {
  margin-left: 0;
}

.contributor-stack img:hover {
  transform: translateY(-3px) scale(1.1);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(16, 27, 55, 0.1);
}

.contributor-more {
  font-size: 10px;
  font-weight: 800;
  color: var(--gold-deep);
  background: var(--rosewater);
  border-radius: 10px;
  padding: 2px 7px;
  margin-left: 8px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid rgba(220, 138, 120, 0.2);
}

/* Lean Hero & Timeline Nav */
.chronicle-lean-hero {
  margin-bottom: 40px;
}

.day-header {
  margin-bottom: 24px;
}

.day-header h1 {
  font-family: "Newsreader", Georgia, serif;
  font-size: 32px;
  margin: 0;
  color: var(--ink);
}

.timeline-navigation {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

/* Enhanced Stats Footer */
.app-footer {
  padding: 34px 24px 26px;
  text-align: center;
  border-top: 1px solid var(--line);
  margin-top: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: var(--vellum);
  position: relative;
}

.footer-visual img {
  width: 72px;
  height: auto;
  opacity: 0.42;
  filter: sepia(0.4) contrast(0.8);
  transition: opacity 0.3s ease;
}

.footer-visual img:hover {
  opacity: 0.8;
}

.footer-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
}

.footer-stat-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-stat-item strong {
  font-size: 20px;
  color: var(--ink);
  font-family: "Newsreader", Georgia, serif;
  font-weight: 400;
}

.footer-stat-item span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}

.footer-motto {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.8;
}

@media (max-width: 760px) {
  .footer-stats {
    flex-direction: row;
    gap: 24px;
  }
  
  .app-footer {
    padding: 28px 18px calc(84px + env(safe-area-inset-bottom));
  }
}

/* Compact Picker Styles */
.compact-picker {
  margin: 8px 0;
  overflow: hidden;
  position: relative;
}

.picker-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none;
}

.picker-scroll::-webkit-scrollbar {
  display: none;
}

.picker-dot-btn {
  flex: 0 0 auto;
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 4px 14px;
  border-radius: 24px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.picker-dot-btn span {
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.picker-dot-btn strong {
  font-family: "Newsreader", Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.picker-dot-btn:hover {
  border-color: var(--gold);
  background: var(--vellum);
}

.picker-dot-btn.active {
  background: var(--rosewater);
  border-color: var(--gold);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(220, 138, 120, 0.15);
  transform: translateY(-1px);
}

.picker-dot-btn.clear {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  font-weight: 800;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Cute Footer Motto */
.footer-motto-cute {
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 22px;
  color: var(--gold-deep);
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}

/* Larger Item Titles */
.timeline-copy h3 {
  font-size: 24px !important;
  margin-bottom: 10px !important;
  letter-spacing: -0.02em !important;
  line-height: 1.2 !important;
  color: var(--ink) !important;
}

.timeline-navigation {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 24px;
}

/* Compact Timeline Nav Pill Styles */
.compact-timeline-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 0;
}

.timeline-day-pill {
  display: flex;
  align-items: center;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 40px;
  padding: 2px;
  box-shadow: 0 2px 10px rgba(16, 27, 55, 0.04);
  transition: border-color 0.2s ease;
}

.timeline-day-pill:hover {
  border-color: var(--gold);
}

.day-step {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  border: 0;
}

.day-step:hover {
  background: var(--rosewater);
  color: var(--ink);
}

.day-input-wrapper {
  position: relative;
  padding: 0 8px;
  min-width: 110px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-input-wrapper span {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  pointer-events: none;
}

.day-input-wrapper input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.nav-stats {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  opacity: 0.8;
}

.clear-day-btn {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-deep);
  background: var(--rosewater);
  border: 0;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.clear-day-btn:hover {
  background: var(--gold);
  color: #fff;
}

/* Timeline Ribbon Navigation */
.timeline-ribbon-container {
  margin: 0;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.timeline-ribbon {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  -webkit-overflow-scrolling: touch;
}

.timeline-ribbon::-webkit-scrollbar {
  height: 3px;
}

.timeline-ribbon::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.ribbon-pill {
  flex: 0 0 auto;
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}

.ribbon-pill:hover {
  border-color: var(--gold);
  background: var(--vellum);
  transform: translateY(-1px);
}

.ribbon-pill.active {
  background: var(--rosewater);
  border-color: var(--gold);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(220, 138, 120, 0.1);
  transform: translateY(-1px);
}

.ribbon-date-m {
  text-transform: uppercase;
  font-weight: 800;
  font-size: 8px;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.ribbon-date-d {
  font-family: "Newsreader", Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.ribbon-date-y {
  font-size: 8px;
  font-weight: 700;
  opacity: 0.5;
}

.ribbon-pill.clear {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  font-weight: 800;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 12px;
}


/* Refined Ribbon Pills */
.ribbon-pill {
  flex: 0 0 auto;
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.ribbon-pill:hover {
  border-color: var(--gold);
  background: var(--vellum);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 27, 55, 0.05);
}

.ribbon-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 27, 55, 0.2);
  transform: translateY(-2px);
}

.ribbon-pill.active .ribbon-date-d {
  color: #fff;
}

.ribbon-pill.active .ribbon-date-m,
.ribbon-pill.active .ribbon-date-y {
  opacity: 0.9;
}

.ribbon-pill.clear {
  background: var(--rosewater);
  color: var(--gold-deep);
  border-color: var(--gold);
  font-weight: 800;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 14px;
}

/* Clean Single Day Step Pill */
.day-step-pill {
  display: flex;
  align-items: center;
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 2px;
  border-radius: 40px;
  gap: 4px;
  width: fit-content;
  box-shadow: 0 2px 8px rgba(16, 27, 55, 0.04);
}

.step-arrow {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-arrow:hover {
  background: var(--rosewater);
  color: var(--ink);
}

.step-date {
  position: relative;
  padding: 0 12px;
  min-width: 140px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-date span {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  pointer-events: none;
}

.step-date input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.step-clear {
  background: var(--ink);
  color: #fff;
  border: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  margin-right: 6px;
  opacity: 0.8;
}

.step-clear:hover {
  opacity: 1;
  background: var(--gold-deep);
}

.step-bookmark {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  transition: background 160ms ease, color 160ms ease;
}

.step-bookmark:hover,
.step-bookmark.active {
  background: var(--rosewater);
  color: var(--gold-deep);
}

.child-list {
  display: grid;
  gap: 8px;
}

.child-list button {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-align: left;
}

.child-list button.active {
  border-color: var(--gold);
  background: var(--rosewater);
}

.child-list span {
  color: var(--muted);
  font-size: 12px;
}

.profile-layout {
  display: grid;
  gap: 24px;
}

.profile-details {
  width: min(100%, 760px);
}

.settings-form {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 14px 44px rgba(16, 27, 55, 0.045);
}

.form-group {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.form-group label {
  color: var(--gold-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-group input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(220, 138, 120, 0.08);
}

.help-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.avatar-upload-preview {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--vellum);
}

.family-access-panel {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.family-access-head,
.invite-list-head,
.invite-row,
.invite-row-actions {
  display: flex;
  align-items: center;
}

.family-access-head,
.invite-list-head,
.invite-row {
  justify-content: space-between;
  gap: 16px;
}

.family-access-head h2,
.invite-list-head h3 {
  margin: 0;
}

.role-pill,
.status-pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.role-pill {
  background: var(--ink);
  color: #fff;
}

.invite-create-form {
  margin-top: 20px;
}

.invite-url-output {
  width: 100%;
  display: block;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--vellum);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.invite-list-head {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.invite-list {
  display: grid;
  gap: 10px;
}

.invite-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.invite-row strong,
.invite-row span {
  display: block;
}

.invite-row strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.invite-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.invite-row-actions {
  flex-shrink: 0;
  justify-content: flex-end;
  gap: 8px;
}

.member-access-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.member-access-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.member-access-controls input[type="date"] {
  width: 140px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--ink);
  font: inherit;
}

.member-access-controls input[type="date"]:focus,
.member-access-controls input[type="date"]:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
  outline: none;
}

.member-access-toggle input {
  margin: 0;
}

.status-pill {
  background: var(--vellum);
  color: var(--muted);
}

.status-pending {
  background: var(--gold-soft);
  color: var(--gold-deep);
}

.status-accepted {
  background: rgba(74, 103, 65, 0.14);
  color: var(--green);
}

.status-revoked,
.status-expired {
  background: var(--danger-soft);
  color: var(--danger);
}

@media (max-width: 760px) {
  .family-access-head,
  .invite-list-head,
  .invite-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .invite-row-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Remove Structural Lines */
.timeline-navigation,
.timeline-ribbon-container,
.chronicle-lean-hero {
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
  margin-bottom: 24px !important;
}

/* Fix Date Picker Trigger */
.step-date input {
  opacity: 0;
  z-index: 2;
  cursor: pointer;
}

.step-date input::-webkit-calendar-picker-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

/* Fix Composer Sidebar Alignment */
.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  align-items: start;
}

@media (max-width: 1100px) {
  .composer {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .composer .sidebar {
    position: static;
    order: 2;
  }

  .memory-record-card {
    position: static;
    order: 2;
  }

  .block textarea {
    min-width: 100%;
    min-height: 260px;
  }
}

@media (max-width: 1024px) {
  .composer-page {
    padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important;
  }

  .composer-page .composer {
    width: 100%;
    min-width: 0;
    padding-bottom: 12px;
  }

  .composer-page .draft-status-panel {
    display: none !important;
  }

  .composer-page .panel,
  .composer-page .block-list,
  .composer-page .block,
  .composer-page .message-bubble,
  .composer-page .composer-bubble,
  .composer-page .media-bubble {
    max-width: 100%;
    min-width: 0;
  }

  .composer-page .block-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .composer-page .block-actions {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 34px 34px minmax(0, 1fr);
  }

  .composer-page .block-actions .danger-button {
    min-width: 0;
    padding-inline: 10px;
  }
}

/* Fix Sidebar Vertical Stack */
.sidebar .panel-pad:not(.desktop-only) {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 16px !important;
}

@media (max-width: 1024px) {
  .composer-page .sidebar .draft-status-panel {
    display: none !important;
  }
}

.add-block-panel {
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 16px !important;
  padding: 22px !important;
  background: #f8fafc;
}

.add-block-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  width: 100% !important;
}

.add-block-card {
  position: relative;
  min-width: 0;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 7px;
  padding: 22px 20px 18px;
  border: 1px solid rgba(118, 119, 125, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: #111318;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.035);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.add-block-card:hover {
  border-color: rgba(16, 27, 55, 0.34);
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06), 0 16px 34px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.add-block-card:active {
  transform: translateY(0) scale(0.985);
}

.add-block-card:focus-visible,
.add-block-card.file-input:focus-within {
  outline: 3px solid rgba(220, 138, 120, 0.28);
  outline-offset: 2px;
}

.add-block-card-wide {
  grid-column: 1 / -1;
  min-height: 150px;
}

.add-block-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  color: #0d1117;
  margin-bottom: auto;
}

.add-block-icon svg {
  width: 26px;
  height: 26px;
}

.add-block-title,
.add-block-subtitle {
  display: block;
  max-width: 100%;
}

.add-block-title {
  color: #111318;
  font-size: 17px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0;
}

.add-block-subtitle {
  color: rgba(25, 28, 30, 0.64);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 650;
}

.add-block-arrow {
  position: absolute;
  top: 24px;
  right: 24px;
  color: rgba(25, 28, 30, 0.5);
  font-size: 30px;
  line-height: 1;
  font-weight: 400;
}

.add-block-card-voice {
  min-height: 122px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-color: transparent;
  background: #111a2c;
  color: #fff;
}

.add-block-card-voice:hover {
  border-color: transparent;
  background: #142037;
}

.add-block-card-voice .add-block-title {
  color: #fff;
  font-size: 21px;
}

.add-block-card-voice .add-block-subtitle {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.48);
}

.voice-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.sidebar h3 {
  margin: 0 !important;
}

/* Final Fix for Date Picker Clickability */
label.step-date {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  position: relative !important;
}

label.step-date input {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  cursor: pointer !important;
  z-index: 5 !important;
  display: block !important;
}

/* Location Link */
.location-link {
  color: var(--gold-deep);
  text-decoration: underline;
  text-decoration-color: rgba(143, 75, 60, 0.3);
  text-underline-offset: 3px;
  transition: all 0.2s ease;
}

.location-link:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

/* Member Role Management */
.compact-select {
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.compact-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.compact-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Custom Confirmation Modal */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 20500;
  display: grid;
  place-items: center;
  padding: 24px;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 27, 55, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.confirm-panel {
  position: relative;
  width: min(440px, 100%);
  background: var(--paper-2);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(16, 27, 55, 0.2);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: modalEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--line);
}

.confirm-title {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 22px;
  font-style: italic;
  font-weight: 700;
  color: var(--ink);
}

.confirm-body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* Spinner & Keyframe animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Instagram-like Camera UI Overlay Styles */
.video-recorder-panel.is-camera {
  width: min(600px, 100%);
  height: 80vh;
  aspect-ratio: 9/16;
  max-height: 90vh;
  background: #000;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.video-recorder-panel.is-camera .video-recorder-stage {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1;
  max-height: none;
  aspect-ratio: auto;
  overflow: hidden;
}

.video-recorder-panel.is-camera .video-live-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: transform 0.2s ease-out;
}

/* 1. Header Overlay Styles */
.camera-header-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 20px;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
  pointer-events: auto;
}

.camera-overlay-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.camera-overlay-btn:hover {
  transform: scale(1.08);
  background: rgba(0, 0, 0, 0.65);
}

.camera-overlay-btn:active {
  transform: scale(0.95);
}

.camera-overlay-btn.torch-btn.active {
  color: #ffcc00;
  background: rgba(255, 204, 0, 0.2);
  border-color: rgba(255, 204, 0, 0.4);
  box-shadow: 0 0 15px rgba(255, 204, 0, 0.3);
}

.camera-overlay-btn svg {
  display: block;
}

/* 2. Recording Status Overlay Styles */
.video-recorder-stage .recording-indicator {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(239, 68, 68, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 8px 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-family: monospace;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* 3. Zoom Overlay Styles */
.camera-zoom-overlay {
  position: absolute;
  bottom: 125px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 10;
  width: 100%;
  padding: 0 24px;
  pointer-events: auto;
}

.zoom-pills-container {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 4px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.zoom-pill {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.zoom-pill.active {
  background: #ffffff;
  color: #000000;
  transform: scale(1.05);
  font-weight: 900;
}

.zoom-slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 220px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.zoom-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  outline: none;
  margin: 0;
}

.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s;
}

.zoom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.camera-zoom-badge {
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  font-family: monospace;
  min-width: 28px;
  text-align: right;
}

/* 4. Bottom Controls Overlay Styles */
.camera-bottom-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  z-index: 10;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, transparent 100%);
  pointer-events: auto;
}

.camera-mode-tabs {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 4px;
}

.camera-mode-tabs button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
  padding: 6px 12px;
  transition: all 0.2s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  border-bottom: 2px solid transparent;
}

.camera-mode-tabs button.active {
  color: #ffffff;
  border-bottom-color: #ffffff;
  font-weight: 900;
  transform: translateY(-1px);
}

.camera-capture-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 280px;
}

.camera-side-placeholder {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.instagram-shutter {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  background: transparent;
  padding: 5px;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  outline: none;
  flex-shrink: 0;
}

.instagram-shutter::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: all 0.25s ease;
}

.photo-shutter::after {
  background: #ffffff;
}

.photo-shutter:active {
  transform: scale(0.9);
}

.photo-shutter:active::after {
  transform: scale(0.85);
  background: rgba(255, 255, 255, 0.8);
}

.video-shutter::after {
  background: #ff3b30;
}

.video-shutter:active {
  transform: scale(0.9);
}

.video-shutter.recording {
  border-color: rgba(255, 255, 255, 0.7);
  animation: shutter-pulse 1.5s infinite ease-in-out;
}

.video-shutter.recording::after {
  border-radius: 8px;
  transform: scale(0.55);
  background: #ff3b30;
}

@keyframes shutter-pulse {
  0% { transform: scale(1); box-shadow: 0 4px 16px rgba(255, 59, 48, 0.3); }
  50% { transform: scale(1.05); box-shadow: 0 4px 24px rgba(255, 59, 48, 0.6); }
  100% { transform: scale(1); box-shadow: 0 4px 16px rgba(255, 59, 48, 0.3); }
}

/* Post capture preview panel styling overrides */
.video-recorder-panel.is-preview {
  background: var(--paper);
}

.video-recorder-panel.is-preview .video-recorder-stage.preview-stage {
  aspect-ratio: 16/9;
  max-height: 50vh;
  flex-shrink: 0;
}

@media (max-width: 760px) {
  .video-recorder-panel.is-camera {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    aspect-ratio: auto;
  }
}

/* Family Ages Tooltip Styling */
.age-display-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.family-ages-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.family-ages-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--gold-deep);
  opacity: 0.65;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  padding: 2px;
  border-radius: 4px;
}

.family-ages-trigger:hover,
.family-ages-trigger:focus-visible,
.family-ages-control.is-open .family-ages-trigger {
  opacity: 1;
  transform: scale(1.1);
  background: rgba(220, 138, 120, 0.08);
}

.family-icon {
  display: block;
}

.family-ages-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  right: -10px;
  left: auto;
  transform: translate3d(0, 8px, 0);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(220, 138, 120, 0.25);
  color: var(--ink);
  padding: 16px;
  border-radius: 16px;
  font-size: 13px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  box-shadow: 0 16px 36px -4px rgba(16, 27, 55, 0.12), 0 4px 12px -2px rgba(16, 27, 55, 0.04);
  min-width: 290px;
  pointer-events: none;
}

.family-ages-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 14px;
  left: auto;
  border-width: 6px;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.88) transparent transparent transparent;
}

.family-ages-control:hover .family-ages-tooltip,
.family-ages-trigger:focus-visible + .family-ages-tooltip,
.family-ages-control.is-open .family-ages-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
}

.tooltip-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-deep);
  margin-bottom: 4px;
}

.tooltip-header-icon {
  flex-shrink: 0;
}

.tooltip-meta {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tooltip-title {
  font-family: "Newsreader", Georgia, serif;
  font-size: 17px;
  font-style: italic;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(16, 27, 55, 0.08);
  padding-bottom: 8px;
}

.tooltip-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.tooltip-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.member-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tooltip-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(16, 27, 55, 0.1);
  background: var(--vellum);
}

.tooltip-list li .member-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
}

.tooltip-list li .member-age {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  text-align: right;
  white-space: nowrap;
}

.tooltip-list li .member-age.has-age {
  background: var(--rosewater);
  color: var(--rosewater-ink);
}

.tooltip-list li .member-age.not-born {
  background: var(--vellum);
  color: var(--muted);
  font-style: italic;
}

.tooltip-list li .member-age.no-age {
  background: transparent;
  color: rgba(16, 27, 55, 0.4);
  font-size: 11px;
  font-weight: 400;
}

@media (max-width: 768px) {
  .family-ages-tooltip {
    bottom: calc(100% + 10px);
    right: -10px;
    left: auto;
    min-width: 280px;
    max-width: 320px;
    padding: 14px;
  }
}

/* Reusable family identities and manual face tags */
.gallery-image-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

.tagged-photo-stage {
  position: relative;
  display: block;
}

.people-present {
  display: grid;
  gap: 8px;
}

.present-chip {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--rosewater);
  color: var(--rosewater-ink);
  font-size: 12px;
  font-weight: 600;
}

.memory-people-picker {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.memory-people-picker legend {
  padding: 0 7px;
  color: var(--gold-deep);
  font-size: 12px;
  font-weight: 800;
}

.people-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.people-chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.people-chip.is-selected {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold-deep);
}

.photo-tag-editor {
  display: grid;
  gap: 10px;
}

.photo-tag-editor .field {
  margin: 0;
}

.photo-tag-surface {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 1px dashed var(--gold);
  border-radius: 8px;
  background: var(--vellum);
  overflow: hidden;
  cursor: crosshair;
}

.photo-tag-surface [data-media-preview],
.photo-tag-surface .media-preview {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.face-pin {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.face-pin-dot {
  width: 22px;
  height: 22px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 2px 9px rgba(16, 27, 55, 0.32);
}

.face-pin-label {
  position: absolute;
  left: 28px;
  top: 50%;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(16, 27, 55, 0.9);
  color: white;
  font-size: 12px;
  white-space: nowrap;
  transform: translateY(-50%);
}

.family-directory-panel {
  margin-top: 24px;
}

.family-directory-list {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.family-directory-row {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
}

.family-directory-row span,
.family-directory-row small {
  color: var(--muted);
}

.form-group select,
.photo-tag-editor select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--ink);
}
.recorder-overlay {
  position: absolute;
  inset: 0;
  background: rgba(18, 18, 18, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  color: #fff;
  text-align: center;
  padding: 24px;
  border-radius: 12px;
}

.recorder-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #fff;
  border-radius: 50%;
  animation: recorder-spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

.recorder-error-icon {
  width: 56px;
  height: 56px;
  color: #ef4444;
  margin-bottom: 16px;
}

.recorder-overlay h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #fff;
}

.recorder-overlay p {
  font-size: 14px;
  color: #a3a3a3;
  margin: 0 0 20px;
  max-width: 280px;
  line-height: 1.5;
}

.recorder-retry-btn {
  background: #fff;
  color: #121212;
  border: 0;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.recorder-retry-btn:hover {
  background: #e5e5e5;
}
.mobile-login-page {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  background: #f9f9f9;
  color: #333;
}

.mobile-login-page p {
  margin-top: 16px;
  font-size: 16px;
}

.mobile-login-spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: #09f;
  animation: spin 1s linear infinite;
}
