:root {
  --ink: #1f2933;
  --muted: #65727f;
  --paper: #fffaf3;
  --card: #ffffff;
  --accent: #df6c57;
  --accent-dark: #b84a39;
  --sea: #1d8f9e;
  --sand: #f2d6a2;
  --line: #e8ddd0;
  --shadow: 0 18px 50px rgba(47, 38, 28, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
button, input { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem clamp(1rem, 4vw, 4rem);
  background: rgba(255,250,243,.92);
  border-bottom: 1px solid rgba(232,221,208,.85);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.2rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  color: white;
  background: var(--accent);
}
.nav-link {
  text-decoration: none;
  font-weight: 700;
  color: var(--muted);
}

.hero {
  min-height: 68vh;
  display: grid;
  align-items: end;
  padding: clamp(2rem, 8vw, 7rem) clamp(1rem, 6vw, 6rem);
  color: white;
  background:
    linear-gradient(180deg, rgba(16,31,38,.05), rgba(16,31,38,.68)),
    url('https://images.unsplash.com/photo-1533104816931-20fa691ff6ca?auto=format&fit=crop&w=1800&q=85') center/cover;
}
.hero-inner { max-width: 850px; }
.eyebrow {
  margin: 0 0 .7rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .77rem;
  font-weight: 800;
}
h1, h2, h3 { font-family: Georgia, 'Times New Roman', serif; }
h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: .92;
}
.hero p {
  max-width: 680px;
  font-size: clamp(1rem, 2vw, 1.3rem);
  line-height: 1.6;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}
.section { padding: clamp(3rem, 7vw, 6rem) 0; }
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
.section-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.5rem); }
.section-heading p { max-width: 570px; color: var(--muted); line-height: 1.65; }

.trip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}
.trip-card {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: var(--shadow);
  text-decoration: none;
  background: #233;
}
.trip-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.trip-card:hover img { transform: scale(1.04); }
.trip-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 1.5rem;
  color: white;
  background: linear-gradient(transparent 20%, rgba(12,27,34,.82));
}
.trip-overlay h3 { margin: .4rem 0; font-size: 2.4rem; }
.trip-meta { font-size: .9rem; opacity: .88; }
.status {
  align-self: flex-start;
  padding: .4rem .65rem;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  backdrop-filter: blur(8px);
  font-size: .8rem;
  font-weight: 800;
}
.placeholder-card {
  min-height: 420px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--line);
  border-radius: 24px;
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}

.trip-hero {
  min-height: 52vh;
  display: grid;
  align-items: end;
  padding: clamp(4rem, 8vw, 7rem) clamp(1rem, 6vw, 6rem) 2.5rem;
  color: white;
  background:
    linear-gradient(180deg, rgba(16,31,38,.08), rgba(16,31,38,.76)),
    url('https://images.unsplash.com/photo-1555993539-1732b0258235?auto=format&fit=crop&w=1800&q=85') center/cover;
}
.trip-hero h1 { font-size: clamp(3.5rem, 9vw, 7.5rem); }
.route-line { font-size: 1.1rem; font-weight: 750; }
.intro-panel {
  margin-top: -1.2rem;
  position: relative;
  z-index: 2;
  padding: 1.5rem;
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow);
  line-height: 1.7;
}

.planner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
  gap: 2rem;
  align-items: start;
}
.slot { margin-bottom: 2.5rem; }
.slot-title {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1rem;
}
.slot-number {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  flex: 0 0 auto;
  border-radius: 50%;
  color: white;
  background: var(--sea);
  font-weight: 800;
}
.slot h2 { margin: 0; font-size: 1.8rem; }
.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 1rem;
}
.option-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 8px 28px rgba(47,38,28,.07);
}
.option-card[draggable="true"] { cursor: grab; }
.option-card.dragging { opacity: .45; }
.option-image { width: 100%; height: 165px; object-fit: cover; display: block; }
.option-body { padding: 1rem; }
.option-top { display: flex; justify-content: space-between; gap: 1rem; }
.option-card h3 { margin: 0 0 .35rem; font-size: 1.23rem; }
.option-summary { margin: 0; color: var(--muted); line-height: 1.5; font-size: .93rem; }

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin: .8rem 0 .1rem;
}
.duration-badge,
.suggested-time {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: .34rem .56rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 850;
}
.duration-badge { color: #145765; background: #dff3f5; }
.suggested-time { color: #76543c; background: #f7ead9; }

.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: .8rem 0; }
.tag { padding: .28rem .5rem; border-radius: 999px; background: #f5eee5; color: #655448; font-size: .75rem; font-weight: 750; }
.details {
  display: none;
  padding-top: .2rem;
  color: var(--muted);
  line-height: 1.6;
  font-size: .9rem;
}
.option-card.open .details { display: block; }
.card-actions { display: flex; gap: .55rem; margin-top: .8rem; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: .68rem .9rem;
  font-weight: 800;
  cursor: pointer;
}
.btn-primary { color: white; background: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { color: var(--ink); background: #f3eee8; }

.timeline-panel {
  position: sticky;
  top: 5.5rem;
  padding: 1.25rem;
  border-radius: 22px;
  background: #18363d;
  color: white;
  box-shadow: var(--shadow);
}
.timeline-panel h2 { margin: 0 0 .4rem; font-size: 2rem; }
.timeline-panel > p { margin-top: 0; color: rgba(255,255,255,.72); line-height: 1.5; }
.timeline-dropzone {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  padding: .8rem;
  border: 2px dashed rgba(255,255,255,.28);
  border-radius: 16px;
}
.timeline-dropzone.over { background: rgba(255,255,255,.08); }
.empty-state { margin: auto; max-width: 220px; text-align: center; color: rgba(255,255,255,.6); line-height: 1.5; }

.timeline-day-group + .timeline-day-group {
  margin-top: .9rem;
  padding-top: .9rem;
  border-top: 1px solid rgba(255,255,255,.16);
}
.timeline-day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin: .1rem .1rem .55rem;
  color: white;
}
.timeline-day-heading strong {
  font-family: Georgia, serif;
  font-size: 1.1rem;
}
.timeline-day-heading span {
  color: rgba(255,255,255,.64);
  font-size: .72rem;
  font-weight: 800;
}
.travel-gap {
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  align-items: center;
  gap: .7rem;
  min-height: 2rem;
  color: rgba(255,255,255,.67);
  font-size: .68rem;
  font-weight: 750;
  line-height: 1.35;
}
.travel-gap-line {
  justify-self: center;
  width: 2px;
  height: 1.5rem;
  background-image: linear-gradient(to bottom, rgba(255,255,255,.48) 45%, transparent 45%);
  background-size: 2px 7px;
}

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .7rem;
  align-items: center;
  padding: .8rem;
  border-radius: 13px;
  color: var(--ink);
  background: white;
  cursor: default;
}
.timeline-time { font-weight: 900; color: var(--sea); }
.timeline-name { font-weight: 800; }
.remove-btn { border: 0; background: transparent; cursor: pointer; color: #8a4b43; font-weight: 900; }
.timeline-actions { display: flex; gap: .6rem; margin-top: 1rem; }
.timeline-actions .btn { flex: 1; }
.save-note { min-height: 1.2em; margin-top: .7rem; text-align: center; font-size: .82rem; color: rgba(255,255,255,.72); }

footer { padding: 2rem 1rem 3rem; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .planner-layout { grid-template-columns: 1fr; }
  .timeline-panel { position: static; }
}
@media (max-width: 650px) {
  .option-grid { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .hero { min-height: 74vh; }
  .site-header { padding-inline: 1rem; }
}

.option-image-wrap {
  position: relative;
  overflow: hidden;
}
.option-image-wrap::after {
  content: '';
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgba(15, 31, 37, .5));
  pointer-events: none;
}
.image-label {
  position: absolute;
  right: .7rem;
  bottom: .65rem;
  z-index: 1;
  padding: .35rem .58rem;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 999px;
  color: white;
  background: rgba(18, 43, 50, .58);
  backdrop-filter: blur(8px);
  font-size: .7rem;
  font-weight: 800;
}
.option-card:hover .option-image { transform: scale(1.035); }
.option-image { transition: transform .35s ease; }

/* Chapter lifecycle: planning → locked memory book */
.chapter-status {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: 1rem;
  padding: .5rem .8rem;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 999px;
  background: rgba(21, 55, 63, .42);
  backdrop-filter: blur(10px);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .04em;
}
.chapter-status::before {
  content: '';
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #f5c76f;
  box-shadow: 0 0 0 .28rem rgba(245,199,111,.18);
}
.memory-mode .chapter-status::before { background: #9de0c7; box-shadow: 0 0 0 .28rem rgba(157,224,199,.18); }
.mode-intro { transition: background .35s ease, color .35s ease; }
.memory-mode .mode-intro { background: #e6f5f1; }

.plan-progress {
  margin: .9rem 0 1rem;
  color: rgba(255,255,255,.86);
  font-size: .82rem;
  font-weight: 800;
}
.plan-progress-track {
  display: block;
  height: .48rem;
  margin-top: .5rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.13);
}
.plan-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f3c56f, #ef8c71);
  transition: width .45s cubic-bezier(.22,1,.36,1);
}
.chosen-ribbon {
  position: absolute;
  top: .7rem;
  left: .7rem;
  z-index: 2;
  display: none;
  padding: .36rem .58rem;
  border-radius: 999px;
  color: #173b35;
  background: #b9f0d8;
  box-shadow: 0 6px 16px rgba(11,44,38,.22);
  font-size: .72rem;
  font-weight: 900;
}
.option-card.selected {
  border-color: #4ea994;
  box-shadow: 0 0 0 3px rgba(78,169,148,.14), 0 12px 32px rgba(47,38,28,.1);
}
.option-card.selected .chosen-ribbon { display: inline-flex; }
.option-card.selected .add-btn { background: #328976; }

.timeline-item {
  grid-template-columns: 1.7rem 3.2rem 1fr auto;
  padding: .65rem;
  transition: transform .2s ease, box-shadow .2s ease;
}
.timeline-item:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.timeline-order {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  color: white;
  background: var(--sea);
  font-size: .75rem;
  font-weight: 900;
}
.timeline-thumb {
  width: 3.2rem;
  height: 3.2rem;
  object-fit: cover;
  border-radius: .7rem;
}
.timeline-copy { min-width: 0; }
.timeline-copy .timeline-time,
.timeline-copy .timeline-name,
.timeline-copy small { display: block; }
.timeline-copy .timeline-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-copy small { margin-top: .12rem; color: #6c7880; }
.lock-plan-btn {
  width: 100%;
  margin-top: .75rem;
  color: #18363d;
  background: #f4cb78;
  border-radius: 14px;
}
.lock-plan-btn:hover { background: #ffd88c; }

.lock-dialog {
  width: min(470px, calc(100% - 2rem));
  padding: 0;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(20,31,34,.35);
  background: var(--paper);
}
.lock-dialog::backdrop { background: rgba(16,31,38,.6); backdrop-filter: blur(5px); }
.lock-dialog form { padding: 2rem; text-align: center; }
.lock-dialog-icon { display: block; margin-bottom: .75rem; font-size: 2.4rem; }
.lock-dialog h2 { margin: 0 0 .75rem; font-size: 2rem; }
.lock-dialog p { margin: 0; color: var(--muted); line-height: 1.65; }
.dialog-actions { display: flex; gap: .7rem; margin-top: 1.4rem; }
.dialog-actions .btn { flex: 1; }

/* Memory-book hero and averages */
.memory-book-section { padding: clamp(3rem, 7vw, 6rem) 0 0; }
.memory-book-header {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(320px, 1.6fr) minmax(150px, .7fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
  margin-bottom: clamp(3rem, 7vw, 6rem);
}
.memory-book-title { text-align: center; }
.memory-book-title h2 { margin: .2rem 0 .65rem; font-size: clamp(2.2rem, 5vw, 4.3rem); line-height: 1; }
.memory-book-title > p:not(.eyebrow) { max-width: 560px; margin: 0 auto; color: var(--muted); line-height: 1.65; }
.memory-heart {
  display: grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  margin: 0 auto .8rem;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  box-shadow: 0 12px 28px rgba(223,108,87,.28);
  animation: gentlePulse 2.5s ease-in-out infinite;
}
.memory-edit-toggle { margin-top: 1.1rem; }
.average-rating {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 205px;
  justify-content: center;
  padding: 1.2rem;
  border: 2px solid rgba(29,143,158,.18);
  border-radius: 52% 48% 48% 52% / 45% 56% 44% 55%;
  background: white;
  box-shadow: 0 18px 50px rgba(47,38,28,.1);
}
.average-rating::after {
  content: '';
  position: absolute;
  inset: .42rem;
  pointer-events: none;
  border: 2px dashed rgba(29,143,158,.15);
  border-radius: inherit;
}
.paige-average { transform: rotate(2deg); border-color: rgba(223,108,87,.2); }
.finlay-average { transform: rotate(-2deg); }
.rating-person { font-family: Georgia, serif; font-size: 1.25rem; font-weight: 800; }
.average-rating strong { margin: .15rem 0 -.1rem; font-family: Georgia, serif; font-size: 4.2rem; line-height: 1; }
.finlay-average strong { color: var(--sea); }
.paige-average strong { color: var(--accent); }
.rating-stars { color: #edb650; letter-spacing: .06em; }
.average-rating small { margin-top: .3rem; color: var(--muted); font-weight: 750; }
.memory-save-note { min-height: 1.4rem; margin: -2rem 0 2rem; text-align: center; color: var(--sea); font-size: .85rem; font-weight: 800; }

/* Cartoony dotted memory timeline */
.memory-timeline {
  position: relative;
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 1rem 0 2rem;
}
.memory-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 12px;
  transform: translateX(-50%) scaleY(0);
  transform-origin: top;
  background-image: radial-gradient(circle, #2c9aaa 0 3px, transparent 3.5px);
  background-size: 12px 22px;
  background-repeat: repeat-y;
  animation: drawDottedPath 1.6s .2s cubic-bezier(.22,1,.36,1) forwards;
}
.memory-stop {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 70px 1fr;
  align-items: center;
  min-height: 480px;
  opacity: 0;
  transform: translateY(60px) rotate(.6deg);
  transition: opacity .7s ease, transform .8s cubic-bezier(.22,1,.36,1);
}
.memory-stop.revealed { opacity: 1; transform: translateY(0) rotate(0); }
.memory-stop.left .memory-card { grid-column: 1; transform: rotate(-1.2deg); }
.memory-stop.right .memory-card { grid-column: 3; transform: rotate(1.2deg); }
.memory-stop .memory-marker { grid-column: 2; grid-row: 1; z-index: 3; justify-self: center; }
.memory-marker {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border: .4rem solid var(--paper);
  border-radius: 50%;
  color: white;
  background: var(--accent);
  box-shadow: 0 8px 22px rgba(73,52,44,.22);
  font-family: Georgia, serif;
  font-weight: 900;
  animation: markerBob 3s ease-in-out infinite;
}
.memory-stop:nth-child(even) .memory-marker { background: var(--sea); animation-delay: -.9s; }
.memory-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(123,103,82,.15);
  border-radius: 26px 26px 22px 22px;
  background: white;
  box-shadow: 0 24px 65px rgba(47,38,28,.14);
  transition: transform .3s ease, box-shadow .3s ease;
}
.memory-card:hover { box-shadow: 0 28px 75px rgba(47,38,28,.2); }
.memory-photo-wrap { position: relative; min-height: 250px; overflow: hidden; background: #dbe8e8; }
.memory-photo {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
  transition: transform .65s ease;
}
.memory-card:hover .memory-photo { transform: scale(1.035); }
.memory-photo-wrap::after {
  content: '';
  position: absolute;
  inset: 50% 0 0;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(16,31,38,.64));
}
.memory-time {
  position: absolute;
  right: .9rem;
  bottom: .85rem;
  z-index: 2;
  max-width: calc(100% - 1.8rem);
  padding: .45rem .66rem;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 999px;
  color: white;
  background: rgba(14,46,53,.56);
  backdrop-filter: blur(8px);
  font-size: .72rem;
  font-weight: 850;
}
.memory-card-body { padding: 1.25rem 1.3rem 1.35rem; }
.memory-kicker { margin: 0 0 .25rem; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; font-weight: 900; }
.memory-card h3 { margin: 0 0 .65rem; font-size: 1.8rem; }
.memory-note-display { min-height: 3em; margin: 0 0 1.15rem; color: #53616a; line-height: 1.65; white-space: pre-wrap; }
.empty-memory-note { color: #909a9e; font-style: italic; }
.memory-note-label { display: block; margin-bottom: .4rem; color: var(--muted); font-size: .78rem; font-weight: 850; }
.memory-note-input {
  width: 100%;
  resize: vertical;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fffdf9;
  line-height: 1.5;
}
.memory-note-input:focus { border-color: var(--sea); box-shadow: 0 0 0 3px rgba(29,143,158,.11); }
.photo-controls {
  position: absolute;
  left: .8rem;
  bottom: .75rem;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.memory-photo-input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.memory-upload,
.remove-photo {
  display: inline-flex;
  align-items: center;
  min-height: 2.1rem;
  padding: .42rem .65rem;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 999px;
  color: white;
  background: rgba(18,43,50,.68);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 850;
}
.remove-photo { font: inherit; font-size: .72rem; }

.couple-ratings {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .65rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
}
.person-rating > span:first-child { display: block; margin-bottom: .3rem; font-family: Georgia, serif; font-size: 1rem; font-weight: 800; }
.paige-rating { text-align: right; }
.rating-divider { color: var(--accent); font-size: 1.1rem; }
.star-input { display: flex; gap: .05rem; }
.paige-rating .star-input { justify-content: flex-end; }
.memory-star {
  padding: 0;
  border: 0;
  color: #d8d1c8;
  background: transparent;
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
  transition: transform .15s ease, color .15s ease;
}
.memory-star:hover { transform: translateY(-2px) scale(1.12); color: #edb650; }
.memory-star.selected { color: #edb650; }
.static-rating { display: flex; align-items: center; gap: .45rem; color: #8d969a; font-size: .78rem; }
.paige-rating .static-rating { justify-content: flex-end; }
.static-stars { display: inline-flex; color: #d8d1c8; letter-spacing: -.04em; }
.static-stars .filled { color: #edb650; }
.unrated { font-style: italic; }

.chapter-ending {
  position: relative;
  overflow: hidden;
  margin: clamp(3rem, 8vw, 7rem) 0 0;
  padding: clamp(3rem, 8vw, 6rem) 1.5rem;
  border-radius: 32px 32px 0 0;
  color: white;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(17,74,82,.92), rgba(36,114,119,.84)),
    url('https://images.unsplash.com/photo-1555993539-1732b0258235?auto=format&fit=crop&w=1600&q=82') center/cover;
}
.chapter-ending h2 { margin: .3rem 0 .6rem; font-size: clamp(2.2rem, 5vw, 4.4rem); }
.chapter-ending p:last-child { max-width: 620px; margin: 0 auto; color: rgba(255,255,255,.78); line-height: 1.6; }
.ending-icon { display: inline-grid; place-items: center; width: 3.6rem; height: 3.6rem; border-radius: 50%; background: rgba(255,255,255,.17); font-size: 1.5rem; animation: planeFloat 3s ease-in-out infinite; }

@keyframes drawDottedPath { to { transform: translateX(-50%) scaleY(1); } }
@keyframes markerBob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-7px) rotate(3deg); } }
@keyframes gentlePulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes planeFloat { 0%,100% { transform: translate(-5px, 2px) rotate(-9deg); } 50% { transform: translate(6px, -5px) rotate(4deg); } }

@media (max-width: 850px) {
  .memory-book-header { grid-template-columns: 1fr 1fr; }
  .memory-book-title { grid-column: 1 / -1; grid-row: 1; }
  .finlay-average { grid-column: 1; grid-row: 2; }
  .paige-average { grid-column: 2; grid-row: 2; }
  .memory-timeline::before { left: 1.7rem; }
  .memory-stop { grid-template-columns: 3.4rem 1fr; min-height: auto; margin-bottom: 2.2rem; }
  .memory-stop .memory-marker { grid-column: 1; align-self: start; margin-top: 2rem; }
  .memory-stop.left .memory-card,
  .memory-stop.right .memory-card { grid-column: 2; grid-row: 1; transform: rotate(0); }
}

@media (max-width: 560px) {
  .dialog-actions { flex-direction: column; }
  .timeline-item { grid-template-columns: 1.55rem 2.7rem 1fr auto; }
  .timeline-thumb { width: 2.7rem; height: 2.7rem; }
  .memory-book-header { gap: .8rem; }
  .average-rating { min-height: 170px; padding: .8rem; }
  .average-rating strong { font-size: 3.2rem; }
  .rating-stars { font-size: .75rem; }
  .memory-stop { grid-template-columns: 2.8rem 1fr; }
  .memory-timeline::before { left: 1.38rem; }
  .memory-marker { width: 2.8rem; height: 2.8rem; border-width: .3rem; }
  .memory-photo { height: 220px; }
  .memory-card h3 { font-size: 1.45rem; }
  .couple-ratings { gap: .35rem; }
  .memory-star { font-size: 1.18rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .memory-timeline::before { transform: translateX(-50%) scaleY(1); }
  .memory-stop { opacity: 1; transform: none; }
}
