:root {
  --ink: #2e2830;
  --muted: #746a74;
  --paper: #fffdf9;
  --soft-line: rgba(46, 40, 48, 0.13);
  --active-ink: #082b57;
  --glow-color: #d9e8fb;
  --shadow: 0 24px 70px rgba(53, 43, 51, 0.15);
  --journey-footer-height: 99px;
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--paper);
  scrollbar-width: none;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: linear-gradient(135deg, #fffefd, #fbf8f3 48%, #fffefd);
  overflow-x: auto;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body.admin-body {
  overflow-x: hidden;
  scrollbar-width: auto;
}

body.admin-body::-webkit-scrollbar {
  width: auto;
  height: auto;
  display: initial;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  gap: 14px;
  place-items: center;
  align-content: center;
  background: #fffdf9;
  transition: opacity 240ms ease, visibility 240ms ease;
}

body:not(.is-loading) .loading-overlay {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 52px;
  height: 52px;
  border: 2px solid rgba(46, 40, 48, 0.1);
  border-top-color: var(--active-ink);
  border-right-color: color-mix(in srgb, var(--active-ink) 48%, transparent);
  border-radius: 50%;
  box-shadow: 0 14px 38px rgba(46, 40, 48, 0.08);
  animation: spin 820ms linear infinite;
}

.loading-copy {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

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

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

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: var(--active-ink);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

button,
.ghost-button {
  gap: 14px;
  align-items: center;
  justify-content: center;
}

button i,
.ghost-button i {
  font-size: 0.92em;
  flex: 0 0 auto;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(46, 40, 48, 0.16);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-button, .ghost-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--soft-line);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ghost-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 18px;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.ghost-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(46, 40, 48, 0.16);
}

.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(46, 40, 48, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 40, 48, 0.018) 1px, transparent 1px);
  background-size: 42px 42px, 37px 37px;
}

.ambient-glow {
  position: fixed;
  width: 55vw;
  height: 55vw;
  left: 25vw;
  top: 12vh;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--glow-color) 72%, white), transparent 64%);
  filter: blur(12px);
  opacity: 0.56;
  transition: background 400ms ease;
}

.progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: 2px;
  background: transparent;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: rgba(46, 40, 48, 0.18);
}

.journey-controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 28;
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 10px 18px;
  border-top: 1px solid rgba(46, 40, 48, 0.16);
  background: rgba(239, 235, 232, 0.96);
  backdrop-filter: blur(18px);
}

.icon-button {
  flex: 0 0 126px;
  min-width: 126px;
  min-height: 78px;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(46, 40, 48, 0.12);
  color: var(--active-ink);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  transition: flex-basis 220ms ease, min-width 220ms ease, width 220ms ease, opacity 180ms ease, color 420ms ease, background-color 420ms ease, border-color 420ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.start-button {
  flex: 0 0 92px;
  min-width: 92px;
  min-height: 78px;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid rgba(46, 40, 48, 0.13);
  color: var(--active-ink);
  background: rgba(255, 255, 255, 0.82);
  transition: color 420ms ease, background-color 420ms ease, border-color 420ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.start-button[hidden] {
  display: none;
}

.icon-button i {
  width: 18px;
  text-align: center;
}

.timeline-jump {
  display: flex;
  flex: 1 1 auto;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  width: auto;
}

.timeline-arrow {
  flex: 0 0 52px;
  min-width: 52px;
  width: 52px;
  min-height: 78px;
  padding: 0;
  border: 1px solid rgba(46, 40, 48, 0.13);
  color: var(--active-ink);
  background: rgba(255, 255, 255, 0.82);
  transition: flex-basis 220ms ease, min-width 220ms ease, width 220ms ease, opacity 180ms ease, color 420ms ease, background-color 420ms ease, border-color 420ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.is-autoplaying .timeline-arrow {
  flex-basis: 0;
  min-width: 0;
  width: 0;
  overflow: hidden;
  padding: 0;
  border-width: 0;
  opacity: 0;
  pointer-events: none;
}

.timeline-arrow i {
  font-size: 1.35rem;
}

.timeline-jump-track {
  position: relative;
  display: flex;
  gap: 16px;
  width: 100%;
  min-height: 78px;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: stretch;
  padding: 2px;
  scrollbar-width: none;
}

.timeline-jump-track::-webkit-scrollbar {
  display: none;
}

.timeline-jump-group {
  flex: 0 0 auto;
  display: grid;
  align-content: start;
  gap: 6px;
}

.timeline-jump-months {
  display: grid;
  grid-template-columns: repeat(12, 82px);
  gap: 6px;
}

.timeline-jump-item {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid rgba(46, 40, 48, 0.13);
  border-radius: 999px;
  padding: 0 13px;
  color: var(--active-ink);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
  transition: color 420ms ease, background-color 420ms ease, border-color 420ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.timeline-jump-year {
  width: 100%;
  color: #fff;
  background: var(--active-ink);
}

.timeline-jump-month {
  min-height: 30px;
  padding: 0 8px;
  font-size: 0.72rem;
}

.timeline-jump-item:disabled {
  border-color: rgba(46, 40, 48, 0.08);
  color: rgba(46, 40, 48, 0.38);
  background: rgba(235, 232, 232, 0.72);
  opacity: 1;
}

.timeline-jump-year:disabled {
  color: rgba(46, 40, 48, 0.44);
  background: rgba(218, 215, 215, 0.78);
}

.journey-shell {
  position: relative;
  display: inline-flex;
  width: max-content;
  min-width: 100vw;
  min-height: calc(100vh - var(--journey-footer-height));
}

.panel {
  position: relative;
  z-index: 1;
  min-width: 100vw;
  min-height: calc(100vh - var(--journey-footer-height));
}

.opening {
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: hidden;
}

.opening-card {
  position: relative;
  z-index: 1;
  width: min(760px, 92vw);
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid rgba(46, 40, 48, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(#fff, #fff),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(46, 40, 48, 0.045) 32px);
  box-shadow: var(--shadow);
}

.photo-collage {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.photo-collage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 253, 249, 0.88) 0 20%, rgba(255, 253, 249, 0.52) 48%, rgba(255, 253, 249, 0.16) 100%);
}

.collage-photo {
  position: absolute;
  width: clamp(130px, 15vw, 270px);
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  border: 8px solid rgba(255, 255, 255, 0.86);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(53, 43, 51, 0.14);
  opacity: 0.66;
}

.collage-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.collage-photo:nth-child(10n + 1) { left: -3%; top: 4%; transform: rotate(-7deg); }
.collage-photo:nth-child(10n + 2) { left: 17%; top: -8%; transform: rotate(4deg); }
.collage-photo:nth-child(10n + 3) { right: 18%; top: -7%; transform: rotate(-4deg); }
.collage-photo:nth-child(10n + 4) { right: -3%; top: 7%; transform: rotate(7deg); }
.collage-photo:nth-child(10n + 5) { left: -4%; bottom: 7%; transform: rotate(5deg); }
.collage-photo:nth-child(10n + 6) { left: 18%; bottom: -8%; transform: rotate(-5deg); }
.collage-photo:nth-child(10n + 7) { right: 19%; bottom: -8%; transform: rotate(4deg); }
.collage-photo:nth-child(10n + 8) { right: -4%; bottom: 8%; transform: rotate(-6deg); }
.collage-photo:nth-child(10n + 9) { left: 2%; top: 39%; transform: rotate(-3deg); }
.collage-photo:nth-child(10n + 10) { right: 2%; top: 40%; transform: rotate(3deg); }

.eyebrow {
  margin: 0 0 12px;
  color: var(--active-ink);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

.opening h1 {
  color: var(--active-ink);
  font-size: clamp(3.5rem, 9vw, 8rem);
  line-height: 0.9;
}

.opening p:not(.eyebrow):not(.status) {
  margin: 24px 0 0;
  color: #504752;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.65;
}

.opening-actions, .lightbox-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.private-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}

.maree-locked .opening-actions,
.maree-locked .journey-controls {
  display: none;
}

.private-dialog {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid rgba(46, 40, 48, 0.12);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 28px 90px rgba(27, 22, 28, 0.28);
}

.private-dialog::backdrop {
  background: rgba(255, 253, 249, 0.46);
  backdrop-filter: blur(10px);
}

.private-dialog .private-form {
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0;
  padding: 32px;
}

.private-dialog h2 {
  margin: 0;
  color: var(--active-ink);
  font-size: 2.6rem;
  line-height: 1;
}

.private-dialog p {
  margin: 0;
  line-height: 1.55;
}

label {
  display: grid;
  gap: 7px;
  color: #554b56;
  font-size: 0.88rem;
  font-weight: 800;
}

input, textarea, select {
  width: 100%;
  border: 1px solid rgba(46, 40, 48, 0.16);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
}

input[type="color"] {
  height: 34px;
  min-height: 34px;
  padding: 3px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 5px;
}

input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 5px;
}

textarea {
  resize: vertical;
}

.status {
  min-height: 1.2em;
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.field-help {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
}

p.field-help {
  margin: 0;
}

.ribbon-stage {
  min-width: max-content;
  background: transparent;
  overflow: hidden;
}

.global-ribbon {
  position: absolute;
  inset: 8vh 0 auto 0;
  z-index: 0;
  width: 100%;
  height: 72vh;
  pointer-events: none;
  overflow: visible;
}

.mobile-ribbon {
  display: none;
}

.ribbon-shadow {
  fill: none;
  stroke: rgba(46, 40, 48, 0.12);
  stroke-width: 34;
  stroke-linecap: round;
  filter: url(#softShadow);
}

.ribbon-main {
  fill: none;
  stroke: url(#journeyGradient);
  stroke-width: 18;
  stroke-linecap: round;
}

.motif-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.motif {
  position: absolute;
  width: clamp(84px, 8vw, 150px);
  opacity: 0.18;
  transform: rotate(-7deg);
}

.motif:nth-child(even) {
  transform: rotate(8deg);
}

.motif svg,
.motif img {
  width: 100%;
  height: auto;
  overflow: visible;
}

.motif img {
  display: block;
}

.memory-track {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: clamp(70px, 9vw, 150px);
  min-height: calc(100vh - var(--journey-footer-height));
  padding: 12vh 28vw 10vh 12vw;
}

.memory-cluster {
  position: relative;
  flex: 0 0 min(780px, 72vw);
  min-height: 580px;
  opacity: 1;
  transform: translateY(var(--cluster-y)) scale(1);
}

.memory-cluster[data-importance="major"] {
  flex-basis: min(920px, 80vw);
}

.memory-cluster[data-importance="small"] {
  flex-basis: min(620px, 62vw);
}

.memory-cluster[data-importance="major"] .featured-memory {
  width: 78%;
  height: 430px;
  border-width: 14px;
}

.memory-cluster[data-importance="small"] .featured-memory {
  width: 62%;
  height: 310px;
}

.memory-cluster[data-importance="major"] .note-card {
  width: min(500px, 76%);
}

.memory-cluster[data-importance="major"] .note-card strong {
  font-size: clamp(2rem, 3.8vw, 3.2rem);
}

.chapter-kicker {
  position: absolute;
  left: 22px;
  top: 12px;
  z-index: 4;
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--chapter-primary);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(46, 40, 48, 0.09);
  font-family: var(--chapter-font);
  font-weight: 900;
  backdrop-filter: blur(12px);
}

.featured-memory {
  --media-rotate: -1.8deg;
  --media-enter-x: var(--featured-media-enter-x, 78px);
  --media-enter-y: var(--featured-media-enter-y, 10px);
  --media-enter-blur: var(--featured-media-enter-blur, 7px);
  position: absolute;
  left: 0;
  top: 62px;
  width: 72%;
  height: 390px;
  overflow: hidden;
  padding: 0;
  border: 12px solid rgba(255, 255, 255, 0.92);
  background: #fff;
  box-shadow: var(--shadow);
  opacity: var(--media-opacity, 0);
  transform: translate(var(--media-current-x, var(--media-enter-x)), var(--media-current-y, var(--media-enter-y))) rotate(var(--media-rotate)) scale(var(--media-current-scale, 0.975));
  filter: blur(var(--media-current-blur, var(--media-enter-blur)));
  transition: none;
  will-change: opacity, transform, filter;
}

.memory-cluster[data-media-count="2"] .featured-memory::before,
.memory-cluster[data-media-count="3"] .featured-memory::before,
.memory-cluster[data-media-count="4"] .featured-memory::before,
.memory-cluster[data-media-count="5"] .featured-memory::before,
.memory-cluster[data-media-count="6"] .featured-memory::before,
.memory-cluster[data-media-count="7"] .featured-memory::before,
.memory-cluster[data-media-count="8"] .featured-memory::before,
.memory-cluster[data-media-count="9"] .featured-memory::before,
.memory-cluster[data-media-count="10"] .featured-memory::before,
.memory-cluster[data-media-count="2"] .featured-memory::after,
.memory-cluster[data-media-count="3"] .featured-memory::after,
.memory-cluster[data-media-count="4"] .featured-memory::after,
.memory-cluster[data-media-count="5"] .featured-memory::after,
.memory-cluster[data-media-count="6"] .featured-memory::after,
.memory-cluster[data-media-count="7"] .featured-memory::after,
.memory-cluster[data-media-count="8"] .featured-memory::after,
.memory-cluster[data-media-count="9"] .featured-memory::after,
.memory-cluster[data-media-count="10"] .featured-memory::after {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border: 10px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  background: color-mix(in srgb, var(--chapter-secondary) 10%, white);
  box-shadow: 0 12px 28px rgba(53, 43, 51, 0.11);
  pointer-events: none;
}

.memory-cluster[data-media-count="2"] .featured-memory::before,
.memory-cluster[data-media-count="3"] .featured-memory::before,
.memory-cluster[data-media-count="4"] .featured-memory::before,
.memory-cluster[data-media-count="5"] .featured-memory::before,
.memory-cluster[data-media-count="6"] .featured-memory::before,
.memory-cluster[data-media-count="7"] .featured-memory::before,
.memory-cluster[data-media-count="8"] .featured-memory::before,
.memory-cluster[data-media-count="9"] .featured-memory::before,
.memory-cluster[data-media-count="10"] .featured-memory::before {
  transform: translate(16px, 14px) rotate(2.2deg);
}

.memory-cluster[data-media-count="3"] .featured-memory::after,
.memory-cluster[data-media-count="4"] .featured-memory::after,
.memory-cluster[data-media-count="5"] .featured-memory::after,
.memory-cluster[data-media-count="6"] .featured-memory::after,
.memory-cluster[data-media-count="7"] .featured-memory::after,
.memory-cluster[data-media-count="8"] .featured-memory::after,
.memory-cluster[data-media-count="9"] .featured-memory::after,
.memory-cluster[data-media-count="10"] .featured-memory::after {
  transform: translate(30px, 27px) rotate(4.4deg);
}

.featured-memory img, .featured-memory video,
.supporting-item img, .supporting-item video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.empty-featured, .empty-small, .empty-lightbox {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
  text-align: center;
  font-weight: 800;
}

.supporting-media {
  position: absolute;
  right: 0;
  top: 108px;
  display: grid;
  gap: 14px;
  width: 32%;
}

.supporting-item {
  --media-rotate: 2deg;
  --media-enter-x: var(--supporting-media-enter-x, 58px);
  --media-enter-y: var(--supporting-media-enter-y, 8px);
  --media-enter-blur: var(--supporting-media-enter-blur, 6px);
  height: 132px;
  overflow: hidden;
  padding: 0;
  border: 8px solid rgba(255, 255, 255, 0.9);
  background: #fff;
  box-shadow: 0 14px 34px rgba(53, 43, 51, 0.13);
  opacity: var(--media-opacity, 0);
  transform: translate(var(--media-current-x, var(--media-enter-x)), var(--media-current-y, var(--media-enter-y))) rotate(var(--media-rotate)) scale(var(--media-current-scale, 0.975));
  filter: blur(var(--media-current-blur, var(--media-enter-blur)));
  transition: none;
  will-change: opacity, transform, filter;
}

.supporting-item:nth-child(2) {
  --media-rotate: -2deg;
}

.media-reveal.is-visible {
  --media-opacity: 1;
  --media-current-x: 0px;
  --media-current-y: 0px;
  --media-current-scale: 1;
  --media-current-blur: 0px;
}

.note-card {
  position: absolute;
  left: 11%;
  bottom: 20px;
  width: min(430px, 70%);
  height: auto;
  min-height: 176px;
  display: grid;
  gap: 8px;
  padding: 22px;
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 244, 0.9)),
    linear-gradient(90deg, color-mix(in srgb, var(--chapter-accent) 28%, transparent), transparent 34%);
  border: 1px solid rgba(46, 40, 48, 0.1);
  box-shadow: 0 18px 44px rgba(53, 43, 51, 0.12);
  transform: rotate(1.3deg);
}

.date-label {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--chapter-primary);
  background: color-mix(in srgb, var(--chapter-accent) 18%, white);
  border: 1px solid color-mix(in srgb, var(--chapter-primary) 18%, transparent);
  font-family: var(--chapter-font);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.memory-cluster[data-importance="major"] .date-label {
  color: #fff;
  background: var(--chapter-primary);
  border-color: var(--chapter-primary);
}

.note-card strong {
  font-family: var(--chapter-font);
  color: var(--chapter-primary);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1;
}

.note-copy {
  color: #544a55;
  line-height: 1.55;
}

.closing {
  display: grid;
  place-items: center;
  padding: 32px 8vw;
  overflow: hidden;
}

.closing-card {
  position: relative;
  z-index: 1;
  width: min(760px, 92vw);
  padding: clamp(32px, 6vw, 70px);
  border: 1px solid rgba(46, 40, 48, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  opacity: 0.2;
  transform: translateY(34px);
  transition: opacity 620ms ease, transform 720ms cubic-bezier(.2,.8,.2,1);
}

.closing-card.is-visible,
.closing-card.is-arriving {
  opacity: 1;
  transform: translateY(0);
}

.closing-card h2 {
  color: var(--active-ink);
  font-size: clamp(2.6rem, 6vw, 6rem);
  line-height: 0.95;
}

.closing-card p:not(.eyebrow) {
  color: #514852;
  font-size: clamp(1.08rem, 1.8vw, 1.4rem);
  line-height: 1.65;
}

.lightbox {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 90px rgba(27, 22, 28, 0.34);
}

.lightbox::backdrop {
  background: rgba(34, 28, 35, 0.42);
  backdrop-filter: blur(12px);
}

.close-button {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 2;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
}

.lightbox {
  grid-template-columns: minmax(0, 1.3fr) minmax(310px, 0.7fr);
}

.lightbox[open] {
  display: grid;
}

.lightbox-media {
  min-height: 62vh;
  background: #f4f0ea;
}

.lightbox-media img, .lightbox-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.lightbox-copy {
  padding: 44px 28px 28px;
  overflow: auto;
}

.lightbox-copy h2 {
  color: var(--active-ink);
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.98;
}

.lightbox-copy p {
  line-height: 1.6;
}

.caption-text {
  color: var(--muted);
  font-weight: 800;
}

.admin-shell {
  width: min(1260px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

body.admin-body {
  font-weight: 400;
}

body.admin-body h1,
body.admin-body h2,
body.admin-body h3 {
  font-weight: 500;
}

body.admin-body label,
body.admin-body .importance-field {
  color: #5f5661;
  font-weight: 600;
}

body.admin-body input,
body.admin-body textarea,
body.admin-body select {
  font-weight: 500;
}

body.admin-body .status,
body.admin-body .field-help,
body.admin-body .memory-browser-summary,
body.admin-body .memory-list-main small,
body.admin-body .memory-editor-empty {
  font-weight: 500;
}

body.admin-body .memory-list-main strong,
body.admin-body .memory-list-meta,
body.admin-body .admin-tabs .nav-link,
body.admin-body .upload-drop span,
body.admin-body .importance-toggle button {
  font-weight: 600;
}

.admin-header, .toolbar, .event-admin-head, .chapter-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.chapter-admin-head {
  align-items: flex-start;
  min-height: 86px;
}

.chapter-admin-head h3 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  line-height: 1.14;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chapter-admin-head .admin-icon-button {
  margin-top: 3px;
}

.admin-header h1 {
  margin: 0;
  color: var(--active-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.96;
}

.admin-card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(46, 40, 48, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 48px rgba(53, 43, 51, 0.08);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.password-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.password-change-form {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(46, 40, 48, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.password-change-form h3 {
  margin: 0;
}

.wide {
  grid-column: 1 / -1;
}

.toolbar {
  position: sticky;
  top: 8px;
  z-index: 5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
  padding: 12px;
  border: 1px solid rgba(46, 40, 48, 0.08);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.9);
  backdrop-filter: blur(16px);
}

.admin-tabs {
  flex: 1 1 auto;
  gap: 4px;
  border-bottom: 0;
}

.admin-tabs .nav-link {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 12px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-weight: 800;
}

.admin-tabs .nav-link:hover {
  border-color: rgba(46, 40, 48, 0.1);
  color: var(--active-ink);
  box-shadow: none;
}

.admin-tabs .nav-link.active {
  border-color: rgba(46, 40, 48, 0.12);
  color: var(--active-ink);
  background: rgba(255, 255, 255, 0.86);
}

.admin-toolbar-actions {
  display: flex;
  gap: 7px;
}

.admin-icon-button {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.is-active {
  display: block;
}

.chapter-workspace,
.memory-workspace {
  margin-top: 18px;
}

.chapter-workspace .editor-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  align-items: start;
}

.asset-manager {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}

.asset-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.asset-upload-grid .upload-drop {
  margin-top: 0;
}

.asset-library {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.asset-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.asset-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(46, 40, 48, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.asset-preview-media {
  display: grid;
  place-items: center;
  min-height: 92px;
  border-radius: 8px;
  color: var(--active-ink);
  background: rgba(247, 244, 239, 0.82);
}

.asset-preview-media img {
  width: 62px;
  max-height: 72px;
}

.asset-preview strong,
.asset-list-item strong {
  font-weight: 600;
}

.asset-preview span,
.asset-list-item span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

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

.asset-list-item {
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  border: 1px solid rgba(46, 40, 48, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.native-asset-select {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.asset-select {
  position: relative;
}

.asset-select-button,
.asset-select-choice {
  width: 100%;
  min-height: 54px;
  justify-content: flex-start;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(46, 40, 48, 0.16);
  box-shadow: none;
  text-align: left;
}

.asset-select-button::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.7;
}

.asset-select-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  width: max(100%, 240px);
  display: grid;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(46, 40, 48, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 48px rgba(53, 43, 51, 0.16);
}

.asset-select-menu[hidden] {
  display: none;
}

.asset-select-group {
  padding: 8px 7px 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.asset-select-choice {
  min-height: 58px;
  margin: 1px 0;
  border-color: transparent;
  border-radius: 7px;
}

.asset-select-choice:hover,
.asset-select-choice[aria-selected="true"] {
  color: var(--active-ink);
  background: rgba(8, 43, 87, 0.07);
  box-shadow: none;
  transform: none;
}

.asset-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.asset-option-font {
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

.asset-select-button .asset-option-font {
  align-items: center;
}

.asset-select-choice .asset-option-font .asset-option-sample {
  font-size: 1.05rem;
  line-height: 1.35;
}

.asset-option-motif {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 7px;
  color: var(--active-ink);
  background: rgba(247, 244, 239, 0.9);
}

.asset-option-motif img {
  width: 26px;
  max-height: 28px;
}

.asset-option-motif + .asset-option-sample {
  min-width: 0;
}

.asset-select-motif .asset-option {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
}

.asset-option-sample {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.asset-option-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

.editor-list {
  display: grid;
  gap: 14px;
}

.memory-browser {
  padding: 14px;
}

.memory-browser-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.34fr);
  gap: 12px;
}

.memory-browser-summary,
.memory-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.memory-browser-summary {
  margin: 14px 0 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.memory-pagination button {
  min-width: 38px;
  min-height: 34px;
  padding: 0 10px;
}

.memory-list {
  display: grid;
  gap: 6px;
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}

.memory-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  gap: 14px;
  padding: 8px 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(46, 40, 48, 0.08);
  box-shadow: none;
  text-align: left;
}

.memory-list-item.is-selected {
  color: #fff;
  background: var(--active-ink);
  border-color: var(--active-ink);
}

.memory-list-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.memory-list-main strong,
.memory-list-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-list-main small,
.memory-list-meta {
  color: inherit;
  opacity: 0.72;
  font-size: 0.75rem;
  font-weight: 800;
}

.memory-list-meta {
  flex: 0 0 auto;
}

.memory-selected-editor {
  margin-top: 14px;
}

.memory-editor-empty {
  color: var(--muted);
  font-weight: 800;
}

.admin-card h2, .admin-card h3 {
  margin: 0 0 14px;
}

.media-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.media-edit {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #fffaf5;
}

.media-edit img, .media-edit video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: #efe9e2;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.check-row input {
  width: auto;
}

.importance-field {
  display: grid;
  gap: 7px;
  color: #554b56;
  font-size: 0.88rem;
  font-weight: 800;
}

.importance-toggle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(46, 40, 48, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.importance-toggle button {
  min-height: 36px;
  padding: 0 8px;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.importance-toggle button.is-active {
  color: #fff;
  background: var(--active-ink);
}

.upload-drop {
  min-height: 76px;
  display: grid;
  place-items: center;
  margin-top: 14px;
  border: 2px dashed rgba(46, 40, 48, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
}

.upload-drop input {
  display: none;
}

body.admin-body label,
body.admin-body .importance-field {
  font-weight: 600;
}

body.admin-body input,
body.admin-body textarea,
body.admin-body select,
body.admin-body .status,
body.admin-body .field-help,
body.admin-body .memory-browser-summary,
body.admin-body .memory-list-main small,
body.admin-body .memory-editor-empty {
  font-weight: 500;
}

body.admin-body .admin-tabs .nav-link,
body.admin-body .memory-list-main strong,
body.admin-body .memory-list-meta,
body.admin-body .upload-drop span,
body.admin-body .importance-toggle button {
  font-weight: 600;
}

.preview-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (min-width: 801px) {
  body:not(.admin-body) {
    overflow-y: hidden;
  }
}

@media (max-width: 800px) {
  :root {
    --journey-footer-height: 95px;
  }

  body {
    overflow-x: hidden;
  }

  .opening,
  .closing {
    padding-inline: 12px;
  }

  .opening-card,
  .closing-card {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    padding-inline: clamp(24px, 7vw, 40px);
    text-align: center;
  }

  .opening-actions {
    justify-content: center;
  }

  .journey-shell {
    display: block;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow-x: hidden;
  }

  .panel {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    min-height: calc(100svh - var(--journey-footer-height));
    overflow-x: hidden;
  }

  .ribbon-stage {
    position: relative;
    min-width: 0;
    min-height: auto;
    overflow: hidden;
    background: rgba(255, 253, 249, 0.3);
  }

  .global-ribbon {
    display: none;
  }

  .mobile-ribbon {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }

  .mobile-ribbon-shadow,
  .mobile-ribbon-main {
    fill: none;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
  }

  .mobile-ribbon-shadow {
    stroke: rgba(46, 40, 48, 0.1);
    stroke-width: 34;
  }

  .mobile-ribbon-main {
    stroke: url(#journeyGradientMobile);
    stroke-width: 18;
  }

  .motif-layer {
    opacity: 0.58;
  }

  .motif {
    width: 82px;
  }

  .memory-track {
    display: grid;
    gap: 80px;
    min-height: 0;
    padding: 12vh 20px calc(10vh + var(--journey-footer-height));
  }

  .memory-cluster {
    min-height: 620px;
    flex-basis: auto;
    width: 100%;
    transform: none;
  }

  .memory-cluster,
  .memory-cluster.is-visible,
  .memory-cluster[data-importance="major"],
  .memory-cluster[data-importance="small"] {
    flex-basis: auto;
    transform: none;
  }

  .featured-memory {
    --media-enter-x: 0;
    --media-enter-y: var(--mobile-media-enter-y, 20px);
    width: 100%;
    height: 330px;
    top: 58px;
  }

  .memory-cluster[data-importance="major"] .featured-memory,
  .memory-cluster[data-importance="small"] .featured-memory {
    width: 100%;
    height: 330px;
  }

  .supporting-media {
    position: relative;
    right: auto;
    top: 410px;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .supporting-item {
    --media-enter-x: 0;
    --media-enter-y: var(--mobile-supporting-media-enter-y, 16px);
    height: 90px;
  }

  .note-card {
    left: 6%;
    top: 350px;
    bottom: auto;
    width: 88%;
  }

  .private-form, .settings-grid, .password-settings, .editor-columns, .memory-browser-filters, .asset-manager, .asset-upload-grid, .asset-library, .lightbox[open] {
    grid-template-columns: 1fr;
  }

  .memory-selected-editor {
    position: static;
  }

  .lightbox-media {
    min-height: 42vh;
  }

  .admin-header, .toolbar, .event-admin-head, .chapter-admin-head {
    align-items: stretch;
    flex-direction: column;
  }

  .chapter-admin-head {
    min-height: 0;
  }

  .journey-controls {
    left: 0;
    right: 0;
    bottom: 0;
    gap: 8px;
    padding: 8px;
    background: rgba(239, 235, 232, 0.96);
    backdrop-filter: blur(18px);
  }

  .timeline-jump {
    min-width: 0;
    width: auto;
    flex: 1 1 auto;
  }

  .timeline-jump-track {
    width: 100%;
  }

  .journey-controls .icon-button {
    flex: 0 0 126px;
  }

  .start-button {
    flex-basis: 52px;
    min-width: 52px;
    padding: 0;
  }

  .start-button span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
