:root {
  /* Brand palette — Best Dad brand guidelines.
     Primary: navy + coral. Secondary: cream + indigo. Accent: amber. */
  --brand-navy: #2a2d45;
  --brand-coral: #ee614c;
  --brand-cream: #fef0d5;
  --brand-indigo: #525b9c;
  --brand-amber: #e8a33c;

  --ink: var(--brand-navy);
  /* Navy-tinted grey, darkened so body copy clears WCAG AA on cream. */
  --muted: #5a5f7a;
  --line: #e3d5b6;
  --paper: var(--brand-cream);
  --paper-2: #f8e3bd;
  --white: #fffaf0;
  --red: var(--brand-coral);
  --gold: var(--brand-amber);
  --indigo: var(--brand-indigo);
  --shadow: 0 18px 48px rgba(42, 45, 69, 0.16);
  --soft-shadow: 0 8px 24px rgba(42, 45, 69, 0.1);
  --radius: 8px;

  /* Typography. The brand's licensed faces are desktop-only, so the web build
     uses the closest openly-licensed stand-ins:
       Myriad Pro -> Source Sans 3   body and sub-headings
       Resolution -> IBM Plex Mono   headlines, caps, tight tracking
       Quittance  -> Anton           wordmark only */
  --font: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-headline: "IBM Plex Mono", "Roboto Condensed", var(--font);
  --font-title: "Anton", "Bebas Neue", var(--font);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(42, 45, 69, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(42, 45, 69, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 5vw, 56px);
  background: rgba(255, 250, 240, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  place-items: center;
  background: var(--ink);
  border-radius: 50%;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: auto;
  height: 26px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav a {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.top-nav a:hover {
  border-color: var(--line);
  color: var(--ink);
  background: var(--white);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
}

.top-nav .lang-switch a {
  min-height: 30px;
  padding: 6px 11px;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.top-nav .lang-switch a:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.top-nav .lang-switch a[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
}

main {
  min-height: calc(100vh - 71px);
}

.mission-board,
.dashboard,
.privacy-page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(30px, 6vw, 68px) 0 80px;
}

.board-head {
  width: min(780px, 100%);
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--indigo);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

/* Brand typography. Headlines are Resolution Black in caps with -50%
   tracking; sub-headings and body stay Myriad Pro. Scoped to the app shell so
   the six memory templates keep their own display faces. */
.board-head h1,
.privacy-page h1,
.home-onboarding h2,
.setup-intro h1,
.mission-aside h1,
.section-head h2,
.share-panel h2 {
  font-family: var(--font-headline);
  font-weight: 700;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.section-head h2,
.share-panel h2 {
  letter-spacing: -0.03em;
}

.board-head h1,
.privacy-page h1 {
  max-width: 760px;
  margin-bottom: 13px;
  font-size: clamp(34px, 7vw, 70px);
  line-height: 0.96;
  letter-spacing: 0;
}

.lead,
.board-head p,
.privacy-page > p + h1 + .privacy-grid p {
  color: var(--muted);
}

.lead {
  max-width: 680px;
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 1.5;
}

.safety-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 32px;
}

.safety-strip span {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.home-onboarding,
.setup-shell {
  display: grid;
  gap: 18px;
}

.home-onboarding {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin: 24px 0;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
}

.home-onboarding h2 {
  margin-bottom: 7px;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1;
}

.home-onboarding p:not(.eyebrow) {
  max-width: 680px;
  margin: 0;
  color: #d9d1bf;
  line-height: 1.45;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.home-onboarding .primary-action {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
}

.home-onboarding .secondary-action {
  border-color: rgba(255, 250, 240, 0.22);
  background: transparent;
  color: var(--white);
}

.setup-shell {
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(26px, 6vw, 60px) 0 80px;
}

.setup-intro {
  position: sticky;
  top: 98px;
  align-self: start;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.setup-intro h1 {
  margin-bottom: 12px;
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 0.95;
}

.setup-intro > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.setup-flow {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.setup-flow span {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  font-weight: 700;
}

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

.mission-card,
.memory-row {
  display: grid;
  gap: 9px;
  min-height: 162px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.84);
  box-shadow: var(--soft-shadow);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.mission-card:hover,
.memory-row:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: var(--shadow);
}

.mission-number {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.mission-number.big {
  width: 74px;
  height: 74px;
  margin-bottom: 20px;
  border-width: 3px;
  background: var(--gold);
  font-size: 24px;
}

.mission-card strong {
  align-self: end;
  font-size: 20px;
  line-height: 1.08;
}

.mission-card small,
.memory-row small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.mission-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(18px, 4vw, 42px);
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(26px, 6vw, 60px) 0 80px;
}

.mission-aside {
  position: sticky;
  top: 98px;
  align-self: start;
  min-height: 420px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
}

.mission-aside h1 {
  margin-bottom: 12px;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 0.95;
  letter-spacing: 0;
}

.mission-aside p {
  color: #d9d1bf;
  font-size: 18px;
  line-height: 1.45;
}

.privacy-note {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 250, 240, 0.22);
}

.privacy-note strong,
.privacy-note span {
  display: block;
}

.privacy-note strong {
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.privacy-note span {
  color: #d9d1bf;
  font-size: 14px;
  line-height: 1.45;
}

.memory-form {
  display: grid;
  gap: 16px;
}

.form-error {
  padding: 14px 16px;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  background: rgba(238, 97, 76, 0.1);
  color: #9c2a19;
  font-size: 14px;
  font-weight: 700;
}

.form-section {
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

.form-section.compact {
  display: grid;
  gap: 12px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.section-head > span {
  display: grid;
  flex: 0 0 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--indigo);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
}

.section-head h2 {
  margin-bottom: 2px;
  font-size: 22px;
  line-height: 1.1;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

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

label span,
.share-url span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
}

textarea {
  min-height: 106px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(82, 91, 156, 0.32);
}

.gender-choice {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.gender-choice legend {
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.gender-hint {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.gender-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gender-option {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
}

.gender-option input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--indigo);
}

.gender-option span {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.gender-option:has(input:checked) {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(82, 91, 156, 0.32);
}

.full-field {
  display: block;
  margin-top: 14px;
}

.full-field.no-top {
  margin-top: 0;
}

/* Recipients chip editor — progressive enhancement over the recipients
   textarea (static/app.js). Styled to read like the textarea it replaces. */
.chip-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  cursor: text;
}

.chip-editor:focus-within {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(82, 91, 156, 0.32);
}

.chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  max-width: 100%;
  padding: 5px 8px 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip.chip-invalid {
  border-color: var(--red);
  background: rgba(238, 97, 76, 0.14);
  color: var(--red);
}

.chip-remove {
  display: grid;
  place-items: center;
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.chip-remove:hover {
  background: rgba(42, 45, 69, 0.12);
}

.chip-entry {
  flex: 1 1 140px;
  width: auto;
  min-width: 140px;
  min-height: 28px;
  margin: 0;
  padding: 4px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
}

.chip-entry:focus {
  border: 0;
  box-shadow: none;
}

.profile-summary {
  border-color: var(--gold);
  background: var(--paper-2);
}

.saved-profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.saved-profile-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.saved-profile-grid span,
.saved-profile-grid strong {
  display: block;
}

.saved-profile-grid span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.saved-profile-grid strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.compact-link {
  width: fit-content;
  margin-top: 14px;
}

.upload-zone {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 22px;
  border: 2px dashed #c8bfae;
  border-radius: var(--radius);
  background: var(--paper-2);
  text-align: center;
  cursor: pointer;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-zone strong {
  font-size: 22px;
}

.upload-zone span {
  margin-top: 6px;
  text-transform: none;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.preview-grid figure {
  margin: 0;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

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

.preview-grid figcaption {
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.upload-notice:not(:empty) {
  margin-top: 10px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
}

/* Edit mode: existing photos with a "tick to remove" control. */
.existing-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.existing-media-item {
  position: relative;
  display: block;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
}

.existing-media-item img,
.existing-media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.existing-media-item input {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 20px;
  min-height: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  accent-color: var(--red);
}

.existing-media-item span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 5px 8px;
  background: rgba(42, 45, 69, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
}

.existing-media-item:has(input:checked) {
  outline: 3px solid var(--red);
  outline-offset: -3px;
}

.existing-media-item:has(input:checked) img,
.existing-media-item:has(input:checked) video {
  opacity: 0.45;
}

.template-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.template-option {
  position: relative;
  overflow: hidden;
  min-height: 0;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #111;
  cursor: pointer;
}

.template-option input {
  position: absolute;
  z-index: 3;
  inset: 12px 12px auto auto;
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--indigo);
}

.template-option img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.template-option:hover img {
  transform: scale(1.035);
}

.template-option span {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  width: 100%;
  margin: 0;
  padding: 38px 14px 13px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.78));
  color: #fff;
  text-transform: none;
}

.template-option strong,
.template-option small {
  display: block;
}

.template-option strong {
  margin-bottom: 5px;
  color: #fff;
  font-size: 17px;
  line-height: 1.05;
}

.template-option small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.25;
}

.template-option:has(input:checked) {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(82, 91, 156, 0.32);
}

.check-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: flex-start;
}

.check-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 1px;
  accent-color: var(--indigo);
}

.check-row span {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
}

.action-bar,
.share-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary-action {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
}

.primary-action:hover {
  background: #1f2236;
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
}

.secondary-action:hover {
  border-color: var(--ink);
}

.primary-action:disabled,
.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.secondary-action.fill {
  width: 100%;
}

.secondary-action.danger {
  color: var(--red);
  border-color: var(--red);
}

.secondary-action.danger:hover {
  color: #d64a36;
  border-color: #d64a36;
}

.memory-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(22px, 5vw, 54px) 0 80px;
}

.created-banner {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
}

.memory-card,
.share-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.memory-card {
  overflow: hidden;
  padding: clamp(18px, 4vw, 36px);
}

.memory-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.memory-card h1 {
  max-width: 760px;
  margin-bottom: 8px;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 0.9;
  letter-spacing: 0;
}

.memory-subtitle {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(17px, 2.5vw, 24px);
  line-height: 1.35;
}

.memory-hero {
  margin: 24px 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-2);
}

.memory-hero img,
.memory-hero video,
.media-grid img,
.media-grid video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.empty-proof {
  display: grid;
  height: 100%;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.empty-proof strong,
.empty-proof span {
  display: block;
}

.empty-proof strong {
  font-size: 26px;
}

.empty-proof span {
  max-width: 320px;
  color: var(--muted);
  line-height: 1.4;
}

.memory-copy {
  font-size: 20px;
  line-height: 1.45;
}

.memory-copy blockquote {
  margin: 18px 0 0;
  padding: 16px 0 16px 18px;
  border-left: 4px solid var(--gold);
  color: var(--ink);
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.2;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.media-grid img,
.media-grid video {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.share-panel {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 16px;
  padding: 20px;
}

.share-panel h2 {
  margin-bottom: 6px;
  font-size: 28px;
  line-height: 1;
}

.share-panel p {
  color: var(--muted);
  line-height: 1.45;
}

.share-url input {
  font-size: 12px;
}

.owner-tools {
  display: grid;
  gap: 8px;
}

.owner-tools form {
  margin: 0;
}

.recipient-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.recipient-list strong {
  flex-basis: 100%;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.recipient-list span {
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.fine-print {
  margin: 0;
  font-size: 12px;
}

/* Recipient (bare-chrome) view: no site header wrapped around a shared link.
   The keepsake spans the full width and a small "make yours" CTA sits below. */
body.bare-chrome main {
  min-height: 100vh;
  padding-top: clamp(16px, 4vw, 32px);
}

body.bare-chrome .memory-stage {
  grid-template-columns: minmax(0, 1fr);
}

.recipient-cta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

/* Memory artifact: Movie Poster */
.memory-stage.template-poster {
  width: min(1120px, calc(100% - 32px));
  align-items: start;
  background: transparent;
}

.template-poster .share-panel {
  border-color: rgba(246, 231, 200, 0.18);
  background: #171513;
  color: #f6e7c8;
}

.template-poster .share-panel p,
.template-poster .share-url span,
.template-poster .recipient-list span {
  color: rgba(246, 231, 200, 0.72);
}

.template-poster .share-panel .eyebrow {
  color: #f2b84b;
}

.template-poster .share-panel input {
  border-color: rgba(246, 231, 200, 0.22);
  background: #0b0a09;
  color: #f6e7c8;
}

.template-poster .share-panel .secondary-action {
  border-color: rgba(246, 231, 200, 0.24);
  background: transparent;
  color: #f6e7c8;
}

.template-poster .share-panel .primary-action {
  border-color: #f2b84b;
  background: #f2b84b;
  color: #12100f;
}

.movie-artifact {
  position: relative;
  width: min(100%, 720px);
  justify-self: center;
  overflow: hidden;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(246, 231, 200, 0.42);
  border-radius: 6px;
  background:
    radial-gradient(circle at 22% 18%, rgba(242, 184, 75, 0.18), transparent 28%),
    radial-gradient(circle at 86% 42%, rgba(217, 58, 46, 0.14), transparent 24%),
    linear-gradient(180deg, #12100f 0%, #050505 72%, #0b0908 100%);
  color: #f6e7c8;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
}

.movie-artifact::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(242, 184, 75, 0.55) 0 1px, transparent 1.5px),
    linear-gradient(120deg, transparent 0 48%, rgba(246, 231, 200, 0.06) 49%, transparent 52%);
  background-size: 39px 39px, 100% 100%;
  mix-blend-mode: screen;
  opacity: 0.42;
}

.movie-stars {
  position: relative;
  z-index: 1;
  color: #f2b84b;
  font-size: 16px;
  letter-spacing: 0.42em;
  text-align: center;
}

.movie-present {
  position: relative;
  z-index: 1;
  margin: 6px 0 14px;
  color: #f6e7c8;
  font-family: "Roboto Condensed", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-align: center;
  text-transform: uppercase;
}

.movie-media {
  position: relative;
  z-index: 1;
  overflow: hidden;
  min-height: 520px;
  aspect-ratio: 4 / 5;
  border: 1px solid rgba(246, 231, 200, 0.42);
  border-radius: 6px;
  background: #050505;
}

.movie-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.56) 100%),
    linear-gradient(180deg, rgba(5, 5, 5, 0.22) 0%, rgba(5, 5, 5, 0.05) 38%, rgba(5, 5, 5, 0.92) 100%);
}

.movie-media img,
.movie-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.08) saturate(1.04);
}

.movie-play-label {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 3;
  padding: 8px 10px;
  border: 1px solid rgba(246, 231, 200, 0.44);
  background: rgba(5, 5, 5, 0.72);
  color: #f6e7c8;
  font-family: "Roboto Condensed", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.movie-title-lockup {
  position: absolute;
  z-index: 2;
  left: clamp(16px, 5vw, 42px);
  right: clamp(16px, 5vw, 42px);
  bottom: clamp(26px, 5vw, 54px);
  text-align: center;
}

.movie-title-lockup span,
.movie-title-lockup p {
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
}

.movie-title-lockup span {
  display: block;
  color: #f2b84b;
  font-size: clamp(24px, 6vw, 46px);
  line-height: 0.92;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.6);
}

.movie-title-lockup h1 {
  margin: 0;
  color: #f6e7c8;
  font-family: "Bebas Neue", "Oswald", sans-serif;
  /* Capped so the 28 real titles (some long) don't blow past the poster and
     collide with the stamp; long single words wrap instead of overflowing. */
  font-size: clamp(38px, 9vw, 84px);
  line-height: 0.86;
  letter-spacing: 0;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.72);
}

.movie-title-lockup p {
  display: inline-block;
  max-width: 100%;
  margin: 12px auto 0;
  padding: 6px 10px;
  transform: rotate(-2deg);
  background: #f2b84b;
  color: #12100f;
  font-size: clamp(13px, 2vw, 20px);
  line-height: 1;
  letter-spacing: 0.04em;
}

.movie-stamp,
.round-stamp {
  display: grid;
  place-items: center;
  text-align: center;
  text-transform: uppercase;
}

/* Keep long localized words (e.g. SL "OPRAVLJENA") from sticking out of the
   stamp circles. em padding scales with the stamp's own font, unlike % padding
   which resolves against the parent stage. */
.movie-stamp,
.round-stamp,
.comic-proof-stamp,
.certificate-seal,
.field-stamp {
  padding: 0.4em;
  overflow-wrap: break-word;
}

.movie-stamp {
  position: absolute;
  z-index: 3;
  /* Top-left corner: keeps clear of the bottom title lockup (long titles used
     to collide with it) and of the top-right video "watch" label. */
  left: clamp(14px, 4vw, 38px);
  top: clamp(14px, 4vw, 38px);
  width: clamp(86px, 16vw, 128px);
  aspect-ratio: 1;
  transform: rotate(-12deg);
  border: 3px double #f2b84b;
  border-radius: 50%;
  color: #f2b84b;
  font-family: "Roboto Condensed", sans-serif;
  font-size: clamp(11px, 1.6vw, 17px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.04em;
  background: rgba(5, 5, 5, 0.32);
}

.movie-credits {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  border-block: 1px solid rgba(246, 231, 200, 0.2);
  background: rgba(246, 231, 200, 0.16);
}

.movie-credits div {
  min-width: 0;
  padding: 12px 10px;
  background: #0b0a09;
  text-align: center;
}

.movie-credits span,
.movie-credits strong,
.movie-billing {
  font-family: "Roboto Condensed", sans-serif;
  text-transform: uppercase;
}

.movie-credits span {
  display: block;
  margin-bottom: 4px;
  color: rgba(246, 231, 200, 0.62);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.movie-credits strong {
  display: block;
  overflow-wrap: anywhere;
  color: #f6e7c8;
  font-size: clamp(16px, 2.6vw, 24px);
  line-height: 1;
}

.movie-filmstrip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.movie-filmstrip div {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(246, 231, 200, 0.34);
  border-radius: 4px;
  background: #050505;
}

.movie-filmstrip img,
.movie-filmstrip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-billing {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  color: rgba(246, 231, 200, 0.78);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-align: center;
}

.movie-billing p {
  margin: 0;
}

.movie-note {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  margin: 18px auto 0;
  padding: 16px 18px;
  width: min(92%, 540px);
  transform: rotate(-1deg);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(63, 48, 38, 0.08) 1px, transparent 1px),
    #f6e7c8;
  background-size: 18px 18px;
  color: #12100f;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}

.movie-note p {
  margin: 0;
  font-family: "Patrick Hand", cursive;
  font-size: clamp(17px, 2.2vw, 22px);
  line-height: 1.1;
}

.movie-note span {
  color: rgba(18, 16, 15, 0.72);
  font-family: "Special Elite", monospace;
  font-size: 11px;
  text-align: right;
}

.empty-proof.dark {
  color: #f6e7c8;
}

.empty-proof.dark span {
  color: rgba(246, 231, 200, 0.72);
}

/* Memory artifact: Scrapbook */
.memory-stage.template-scrapbook {
  width: min(1200px, calc(100% - 32px));
  align-items: start;
}

.scrapbook-artifact {
  position: relative;
  width: min(100%, 860px);
  justify-self: center;
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid rgba(63, 48, 38, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 18%, rgba(207, 175, 130, 0.34), transparent 22%),
    radial-gradient(circle at 88% 82%, rgba(158, 170, 119, 0.28), transparent 20%),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(63, 48, 38, 0.055) 28px),
    #f7eedc;
  color: #3f3026;
  box-shadow: 0 24px 56px rgba(63, 48, 38, 0.2);
}

.scrapbook-artifact::before {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border: 1px dashed rgba(63, 48, 38, 0.18);
  border-radius: 6px;
}

.paper-tape,
.scrap-sticker,
.scrap-header,
.scrap-layout,
.scrap-note,
.scrap-footer {
  position: relative;
  z-index: 1;
}

.paper-tape {
  position: absolute;
  width: 150px;
  height: 32px;
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 34%),
    #e6d0a8;
  box-shadow: 0 2px 4px rgba(63, 48, 38, 0.12);
  opacity: 0.92;
}

.tape-top {
  top: 11px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  z-index: 3;
}

.scrap-sticker {
  position: absolute;
  z-index: 4;
  padding: 10px 12px;
  border-radius: 5px;
  background: #fff8ea;
  box-shadow: 0 5px 12px rgba(63, 48, 38, 0.18);
  color: #3f3026;
  font-family: "Patrick Hand", cursive;
  font-size: clamp(17px, 2vw, 25px);
  line-height: 1.05;
}

.sticker-left {
  top: 22px;
  left: clamp(12px, 2vw, 30px);
  transform: rotate(-4deg);
}

.sticker-bolt {
  top: 72px;
  right: clamp(18px, 3vw, 54px);
  transform: rotate(10deg);
  background: #d94c3d;
  color: #fff8ea;
  font-family: var(--font);
  font-weight: 900;
}

.scrap-header {
  margin: 14px auto 20px;
  width: min(86%, 620px);
  padding: 20px 18px 16px;
  transform: rotate(-1deg);
  border-radius: 4px;
  background:
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(111, 143, 163, 0.18) 32px),
    #fff8ea;
  box-shadow: 0 7px 16px rgba(63, 48, 38, 0.12);
  text-align: center;
}

.scrap-header span {
  display: block;
  margin-bottom: 4px;
  font-family: "Patrick Hand", cursive;
  font-size: clamp(24px, 4vw, 40px);
}

.scrap-header h1 {
  margin: 0;
  font-family: "Patrick Hand", cursive;
  font-size: clamp(42px, 8vw, 78px);
  line-height: 0.94;
  letter-spacing: 0;
  text-wrap: balance;
}

.scrap-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: clamp(14px, 3vw, 24px);
  align-items: start;
}

.scrap-photos {
  min-width: 0;
}

.polaroid {
  position: relative;
  margin: 0;
  padding: 12px 12px 42px;
  border-radius: 4px;
  background: #fff8ea;
  box-shadow: 0 10px 20px rgba(63, 48, 38, 0.18);
}

.polaroid img,
.polaroid video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
}

.hero-polaroid {
  transform: rotate(1deg);
}

.hero-polaroid > img,
.hero-polaroid > video,
.hero-polaroid > .empty-proof {
  aspect-ratio: 4 / 3;
}

.polaroid figcaption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  overflow: hidden;
  color: #3f3026;
  font-family: "Patrick Hand", cursive;
  font-size: clamp(16px, 2vw, 24px);
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-stamp {
  position: absolute;
  right: -13px;
  bottom: 26px;
  width: clamp(88px, 15vw, 126px);
  aspect-ratio: 1;
  transform: rotate(-7deg);
  border: 4px double #d94c3d;
  border-radius: 50%;
  background: #fff8ea;
  color: #d94c3d;
  font-family: "Roboto Condensed", sans-serif;
  font-size: clamp(11px, 1.6vw, 17px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: 0.04em;
}

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

.mini-polaroid {
  padding: 8px 8px 32px;
}

.mini-polaroid img,
.mini-polaroid video {
  aspect-ratio: 1;
}

.mini-polaroid figcaption {
  left: 8px;
  right: 8px;
  bottom: 7px;
  font-size: clamp(14px, 1.8vw, 19px);
}

.tilt-1 {
  transform: rotate(-2deg);
}

.tilt-2 {
  transform: rotate(1.5deg);
}

.tilt-3 {
  transform: rotate(-1deg);
}

.tilt-4 {
  transform: rotate(2deg);
}

.tilt-5 {
  transform: rotate(-1.5deg);
}

.scrap-meta {
  display: grid;
  gap: 14px;
  padding: 18px;
  transform: rotate(1deg);
  border-radius: 6px;
  background:
    repeating-linear-gradient(180deg, transparent 0 30px, rgba(111, 143, 163, 0.18) 31px),
    #fff8ea;
  box-shadow: 0 8px 18px rgba(63, 48, 38, 0.16);
}

.scrap-meta div {
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(63, 48, 38, 0.42);
}

.scrap-meta span,
.scrap-meta strong,
.scrap-meta p {
  display: block;
  font-family: "Patrick Hand", cursive;
}

.scrap-meta span {
  margin-bottom: 3px;
  font-size: 18px;
}

.scrap-meta strong {
  overflow-wrap: anywhere;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1;
  font-weight: 400;
}

.scrap-meta p {
  margin: 0;
  padding: 12px;
  transform: rotate(-2deg);
  background: #d9e4e8;
  color: #3f3026;
  font-size: 24px;
  line-height: 1.05;
  text-align: center;
}

.scrap-note {
  width: min(100%, 430px);
  margin: 22px 0 0 auto;
  padding: 20px 22px;
  transform: rotate(-1.5deg);
  border-radius: 5px;
  background:
    repeating-linear-gradient(180deg, transparent 0 32px, rgba(111, 143, 163, 0.2) 33px),
    #fff8ea;
  box-shadow: 0 10px 20px rgba(63, 48, 38, 0.17);
}

.scrap-note h2,
.scrap-note p {
  font-family: "Patrick Hand", cursive;
}

.scrap-note h2 {
  margin-bottom: 10px;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1;
}

.scrap-note p {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 27px);
  line-height: 1.3;
}

.scrap-footer {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr 1fr 1fr;
  gap: 1px;
  margin-top: 26px;
  overflow: hidden;
  border: 1px solid rgba(63, 48, 38, 0.18);
  border-radius: 6px;
  background: rgba(63, 48, 38, 0.18);
}

.scrap-footer div {
  min-width: 0;
  padding: 14px;
  background: rgba(255, 248, 234, 0.78);
}

.scrap-footer span,
.scrap-footer strong {
  display: block;
}

.scrap-footer span {
  margin-bottom: 6px;
  font-family: "Special Elite", monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.scrap-footer strong {
  overflow-wrap: anywhere;
  color: #3f3026;
  font-family: "Special Elite", monospace;
  font-size: 15px;
  line-height: 1.25;
}

.scrap-footer div:first-child strong {
  color: #d94c3d;
  font-size: 34px;
  line-height: 1;
}

/* Memory artifact: Field Notes */
.memory-stage.template-field-note {
  width: min(1240px, calc(100% - 32px));
  align-items: start;
  background: transparent;
}

.template-field-note .share-panel {
  border-color: rgba(31, 51, 40, 0.2);
  background: #f3e8d0;
  color: #1f3328;
}

.template-field-note .share-panel .eyebrow {
  color: #b64236;
}

.template-field-note .share-panel .primary-action {
  border-color: #1f3328;
  background: #1f3328;
  color: #fff8e8;
}

.field-artifact {
  position: relative;
  justify-self: center;
  width: min(100%, 960px);
  overflow: hidden;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid rgba(31, 51, 40, 0.26);
  border-radius: 8px;
  background-color: #f3e8d0;
  background-image:
    linear-gradient(rgba(57, 72, 50, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 72, 50, 0.07) 1px, transparent 1px),
    radial-gradient(circle at 94% 88%, rgba(184, 135, 70, 0.18), transparent 22%);
  background-size: 24px 24px, 24px 24px, auto;
  color: #1f3328;
  box-shadow: 0 24px 58px rgba(37, 37, 31, 0.24);
}

.field-artifact::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 18px;
  bottom: 18px;
  width: 18px;
  border-radius: 12px;
  background:
    radial-gradient(circle, rgba(57, 72, 50, 0.34) 0 5px, transparent 6px) 0 0 / 18px 42px;
  opacity: 0.7;
}

.field-header,
.field-layout,
.field-summary,
.field-stamp {
  position: relative;
  z-index: 1;
}

.field-header {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 150px;
  gap: 18px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(57, 72, 50, 0.25);
}

.field-label-card,
.field-filed {
  padding: 12px;
  border-radius: 4px;
  box-shadow: 0 6px 14px rgba(37, 37, 31, 0.16);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.field-label-card {
  transform: rotate(-4deg);
  background: #1f3328;
  color: #f3e8d0;
  text-transform: uppercase;
}

.field-filed {
  transform: rotate(2deg);
  background: #d5b382;
  color: #25251f;
}

.field-filed strong {
  font-weight: 700;
}

.field-kicker {
  margin: 0 0 14px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.13em;
  text-align: center;
  text-transform: uppercase;
}

.field-header h1 {
  max-width: 13ch;
  margin: 0;
  color: #1f3328;
  font-family: "Roboto Slab", serif;
  font-size: clamp(44px, 7.5vw, 84px);
  font-weight: 900;
  line-height: 0.93;
  letter-spacing: 0;
  text-transform: uppercase;
  text-wrap: balance;
}

.field-header h1 span {
  display: block;
  margin-bottom: 8px;
  color: #394832;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(17px, 2.6vw, 27px);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field-tagline {
  display: inline-block;
  margin: 16px 0 0;
  padding: 9px 14px;
  transform: rotate(-2deg);
  background: rgba(185, 155, 107, 0.42);
  color: #394832;
  font-family: "Patrick Hand", cursive;
  font-size: clamp(18px, 2.4vw, 25px);
  line-height: 1.05;
}

.field-stamp {
  position: absolute;
  top: clamp(110px, 14vw, 170px);
  right: clamp(26px, 5vw, 86px);
  display: grid;
  width: clamp(132px, 18vw, 210px);
  aspect-ratio: 1.25;
  place-items: center;
  transform: rotate(-8deg);
  border: 4px double #b64236;
  border-radius: 8px;
  color: #b64236;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(13px, 2vw, 24px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.field-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(250px, 0.82fr);
  gap: clamp(16px, 3vw, 28px);
  align-items: start;
  margin-top: 24px;
}

.field-media-zone {
  display: grid;
  gap: 18px;
}

.field-hero {
  position: relative;
  margin: 0;
  padding: 9px 9px 42px;
  border: 1px solid rgba(57, 72, 50, 0.35);
  border-radius: 6px;
  background: #fff8e8;
  box-shadow: 0 10px 24px rgba(37, 37, 31, 0.2);
}

.field-hero::before,
.field-hero::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border: 7px solid #394832;
  opacity: 0.9;
}

.field-hero::before {
  left: -7px;
  top: -7px;
  border-right: 0;
  border-bottom: 0;
}

.field-hero::after {
  right: -7px;
  bottom: 32px;
  border-left: 0;
  border-top: 0;
}

.field-hero img,
.field-hero video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 3px;
}

.field-hero figcaption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 10px;
  color: #394832;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(12px, 1.6vw, 16px);
  line-height: 1.25;
}

.field-video-label {
  position: absolute;
  top: 18px;
  left: 18px;
  padding: 7px 9px;
  border-radius: 4px;
  background: rgba(31, 51, 40, 0.88);
  color: #fff8e8;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-meta {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(57, 72, 50, 0.22);
  border-radius: 6px;
  background:
    repeating-linear-gradient(180deg, transparent 0 32px, rgba(57, 72, 50, 0.12) 33px),
    rgba(255, 248, 232, 0.68);
  box-shadow: 0 8px 20px rgba(37, 37, 31, 0.15);
}

.field-meta div {
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(57, 72, 50, 0.42);
}

.field-meta span,
.field-meta strong {
  display: block;
}

.field-meta span {
  color: #394832;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-meta strong {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: #1f3328;
  font-family: "Lora", serif;
  font-size: clamp(16px, 2vw, 23px);
  font-weight: 700;
  line-height: 1.15;
}

.field-report {
  padding: 18px;
  border: 1px solid rgba(57, 72, 50, 0.22);
  border-radius: 6px;
  background:
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(57, 72, 50, 0.13) 32px),
    rgba(255, 248, 232, 0.72);
  box-shadow: 0 8px 18px rgba(37, 37, 31, 0.14);
}

.field-report h2,
.field-evidence h2 {
  margin: 0 0 12px;
  color: #1f3328;
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(18px, 2.2vw, 24px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-report p {
  margin: 0;
  color: #1f3328;
  font-family: "Lora", serif;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.55;
}

.field-evidence {
  padding: 14px;
  border-radius: 6px;
  background: rgba(168, 183, 170, 0.32);
}

.field-evidence h2 {
  margin-bottom: 10px;
  text-align: center;
}

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

.field-evidence-grid figure {
  margin: 0;
  padding: 7px;
  border: 1px solid rgba(57, 72, 50, 0.25);
  border-radius: 5px;
  background: #fff8e8;
  box-shadow: 0 4px 10px rgba(37, 37, 31, 0.12);
}

.field-evidence-grid img,
.field-evidence-grid video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 3px;
}

.field-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid rgba(57, 72, 50, 0.22);
  border-radius: 6px;
  background: rgba(57, 72, 50, 0.2);
}

.field-summary div {
  min-width: 0;
  padding: 13px;
  background: rgba(255, 248, 232, 0.6);
}

.field-summary span,
.field-summary strong {
  display: block;
}

.field-summary span {
  margin-bottom: 5px;
  color: #394832;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.field-summary strong {
  overflow-wrap: anywhere;
  color: #1f3328;
  font-family: "Lora", serif;
  font-size: 15px;
  line-height: 1.25;
}

/* Memory artifact: Comic Proof */
.memory-stage.template-comic {
  width: min(1280px, calc(100% - 32px));
  align-items: start;
  background: transparent;
}

.template-comic .share-panel {
  border: 4px solid #111;
  background: #fff4d6;
  color: #111;
  box-shadow: 6px 6px 0 #111;
}

.template-comic .share-panel .eyebrow {
  color: #e6392e;
}

.template-comic .share-panel .primary-action {
  border: 2px solid #111;
  background: #e6392e;
  color: #fff4d6;
}

.template-comic .share-panel .secondary-action {
  border: 2px solid #111;
  background: #fff;
  color: #111;
}

.comic-artifact {
  position: relative;
  justify-self: center;
  width: min(100%, 1040px);
  padding: clamp(12px, 2vw, 22px);
  border: 4px solid #111;
  border-radius: 4px;
  background-color: #fff4d6;
  background-image: radial-gradient(circle, rgba(17, 17, 17, 0.16) 1px, transparent 1.4px);
  background-size: 8px 8px;
  color: #111;
  box-shadow: 8px 8px 0 rgba(255, 210, 63, 0.82);
}

.comic-header {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 116px;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.comic-issue,
.comic-authority,
.comic-title-block {
  border: 4px solid #111;
  border-radius: 4px;
  background: #fff;
  box-shadow: 4px 4px 0 #111;
}

.comic-issue,
.comic-authority {
  padding: 10px 8px;
  text-align: center;
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 900;
  text-transform: uppercase;
}

.comic-issue span,
.comic-issue small {
  display: block;
  font-size: 13px;
}

.comic-issue strong {
  display: block;
  color: #e6392e;
  font-family: "Bangers", system-ui;
  font-size: 48px;
  line-height: 0.88;
  text-shadow: 2px 2px 0 #111;
}

.comic-authority {
  font-size: 15px;
  line-height: 1.05;
}

.comic-title-block {
  position: relative;
  padding: 12px 18px 16px;
  background:
    linear-gradient(180deg, #2f80ed 0 34%, transparent 34%),
    #fff4d6;
  text-align: center;
}

.comic-title-block::before {
  content: "";
  position: absolute;
  inset: 34px 24px 14px;
  z-index: 0;
  background: #fff;
  clip-path: polygon(0 20%, 12% 20%, 8% 0, 25% 17%, 40% 5%, 48% 20%, 65% 2%, 72% 20%, 100% 12%, 88% 43%, 100% 65%, 76% 62%, 82% 100%, 58% 72%, 40% 95%, 36% 67%, 13% 86%, 20% 58%, 0 50%);
}

.comic-title-block p,
.comic-title-block h1 {
  position: relative;
  z-index: 1;
}

.comic-title-block p {
  display: inline-block;
  margin: 0 0 12px;
  padding: 5px 18px;
  transform: skewX(-8deg);
  background: #ffd23f;
  border: 3px solid #111;
  font-family: "Roboto Condensed", sans-serif;
  font-size: clamp(15px, 2vw, 25px);
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.comic-title-block h1 {
  margin: 0 auto;
  max-width: 12ch;
  color: #e6392e;
  font-family: "Bangers", system-ui;
  font-size: clamp(54px, 8vw, 112px);
  line-height: 0.82;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 #fff, 6px 6px 0 #111;
  text-wrap: balance;
}

.comic-title-block h1 span {
  display: block;
  margin-bottom: 4px;
  color: #111;
  font-size: clamp(25px, 3.2vw, 42px);
  text-shadow: 2px 2px 0 #fff;
}

.comic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr);
  gap: 12px;
}

.comic-panel,
.comic-stats,
.comic-chaos,
.comic-narrator,
.comic-powers {
  border: 4px solid #111;
  border-radius: 4px;
  background: #fff;
  box-shadow: 5px 5px 0 #111;
}

.comic-panel {
  position: relative;
  overflow: hidden;
  margin: 0;
}

.comic-panel::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 42%;
  height: 42%;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 210, 63, 0.5) 1.5px, transparent 1.7px);
  background-size: 8px 8px;
  opacity: 0.7;
}

.comic-panel img,
.comic-panel video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comic-hero {
  min-height: 520px;
  grid-row: span 2;
}

.comic-hero img,
.comic-hero video,
.comic-hero .empty-proof {
  aspect-ratio: 4 / 5;
}

.comic-panel figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  max-width: calc(100% - 24px);
  padding: 7px 12px;
  transform: rotate(-3deg);
  border: 4px solid #111;
  border-radius: 4px;
  background: #ffd23f;
  color: #111;
  font-family: "Bangers", system-ui;
  font-size: clamp(24px, 4vw, 48px);
  line-height: 0.9;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 #111;
}

.speech-bubble {
  position: absolute;
  z-index: 3;
  right: 16px;
  top: 44%;
  max-width: 220px;
  padding: 12px 16px;
  border: 4px solid #111;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-family: "Bangers", system-ui;
  font-size: clamp(23px, 3vw, 38px);
  line-height: 0.92;
  text-align: center;
  text-transform: uppercase;
}

.action-burst {
  position: absolute;
  z-index: 3;
  left: 18px;
  top: 18px;
  width: min(42%, 220px);
  padding: 18px 15px;
  background: #ffd23f;
  color: #111;
  clip-path: polygon(50% 0%, 59% 18%, 78% 8%, 77% 29%, 100% 34%, 81% 48%, 96% 67%, 73% 66%, 68% 91%, 50% 74%, 31% 92%, 28% 68%, 4% 68%, 18% 49%, 0 33%, 23% 29%, 21% 8%, 40% 18%);
  font-family: "Roboto Condensed", sans-serif;
  font-size: clamp(14px, 2vw, 22px);
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
}

.comic-stats,
.comic-chaos,
.comic-narrator,
.comic-powers {
  padding: 14px;
}

.comic-stats h2,
.comic-powers h2 {
  display: inline-block;
  margin: 0 0 10px;
  padding: 5px 10px;
  transform: skewX(-7deg);
  background: #e6392e;
  color: #fff;
  font-family: "Roboto Condensed", sans-serif;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.comic-stats div,
.comic-powers div {
  padding: 8px 0;
  border-bottom: 2px solid rgba(17, 17, 17, 0.2);
}

.comic-stats span,
.comic-powers span {
  display: block;
  font-family: "Roboto Condensed", sans-serif;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.comic-stats strong,
.comic-powers strong {
  display: block;
  overflow-wrap: anywhere;
  font-family: "Comic Neue", cursive;
  font-size: clamp(18px, 2.2vw, 25px);
  font-weight: 700;
  line-height: 1.05;
}

.comic-chaos {
  background: #2f80ed;
  color: #fff4d6;
}

.comic-chaos span,
.comic-chaos strong {
  display: block;
  font-family: "Bangers", system-ui;
  line-height: 0.92;
  text-transform: uppercase;
}

.comic-chaos span {
  font-size: 22px;
}

.comic-chaos strong {
  color: #e6392e;
  font-size: clamp(38px, 5vw, 60px);
  text-shadow: 3px 3px 0 #111;
}

.comic-support-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.comic-support-grid .comic-panel {
  min-height: 210px;
}

.comic-support-grid .comic-panel figcaption {
  font-size: clamp(18px, 2.5vw, 30px);
}

.comic-narrator {
  grid-column: 1;
  background: #fff4d6;
}

.comic-narrator h2 {
  margin: 0 0 10px;
  padding: 5px 10px;
  border: 3px solid #111;
  background: #ffd23f;
  font-family: "Bangers", system-ui;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 0.95;
}

.comic-narrator p {
  margin: 0;
  font-family: "Comic Neue", cursive;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 700;
  line-height: 1.35;
}

.comic-narrator > strong {
  display: inline-block;
  margin-top: 12px;
  padding: 10px;
  transform: rotate(-6deg);
  background: #fff;
  color: #e6392e;
  clip-path: polygon(50% 0%, 60% 22%, 85% 12%, 78% 38%, 100% 50%, 78% 60%, 88% 87%, 62% 77%, 50% 100%, 39% 77%, 12% 88%, 22% 61%, 0 50%, 22% 39%, 12% 12%, 40% 23%);
  font-family: "Bangers", system-ui;
  font-size: 27px;
  line-height: 0.95;
  text-align: center;
}

.comic-powers {
  grid-column: 2;
  background: #fff;
}

.comic-powers p {
  margin: 12px 0 0;
  padding: 8px;
  border: 3px solid #111;
  background: #ffd23f;
  font-family: "Bangers", system-ui;
  font-size: clamp(23px, 3vw, 40px);
  line-height: 0.9;
  text-transform: uppercase;
}

.comic-powers p strong {
  display: inline;
  color: #e6392e;
  font-family: "Bangers", system-ui;
  font-size: inherit;
  text-shadow: 2px 2px 0 #111;
}

.comic-proof-stamp {
  position: absolute;
  right: clamp(18px, 4vw, 58px);
  bottom: clamp(14px, 3vw, 28px);
  display: grid;
  width: clamp(92px, 12vw, 136px);
  aspect-ratio: 1;
  place-items: center;
  transform: rotate(-8deg);
  border: 4px double #e6392e;
  border-radius: 50%;
  background: #fff4d6;
  color: #e6392e;
  font-family: "Roboto Condensed", sans-serif;
  font-size: clamp(12px, 1.7vw, 20px);
  font-weight: 900;
  line-height: 0.9;
  text-align: center;
  text-transform: uppercase;
}

/* Memory artifact: Certificate */
.memory-stage.template-certificate {
  width: min(1240px, calc(100% - 32px));
  align-items: start;
  background: transparent;
}

.template-certificate .share-panel {
  border-color: rgba(201, 154, 46, 0.38);
  background: #fff8e8;
  color: #1f1b16;
}

.template-certificate .share-panel .eyebrow {
  color: #9f7422;
}

.template-certificate .share-panel .primary-action {
  border-color: #1f1b16;
  background: #1f1b16;
  color: #fff8e8;
}

.certificate-artifact {
  justify-self: center;
  width: min(100%, 940px);
  padding: clamp(14px, 2.4vw, 28px);
  border: 2px solid #c99a2e;
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 0%, rgba(201, 154, 46, 0.12), transparent 36%),
    #fff8e8;
  color: #1f1b16;
  box-shadow: 0 18px 42px rgba(107, 78, 46, 0.24);
}

.certificate-inner {
  position: relative;
  padding: clamp(18px, 3.2vw, 38px);
  border: 1px solid rgba(201, 154, 46, 0.72);
  border-radius: 4px;
  text-align: center;
}

.certificate-inner::before,
.certificate-inner::after {
  content: "❧";
  position: absolute;
  color: #c99a2e;
  font-size: clamp(36px, 6vw, 74px);
  line-height: 1;
}

.certificate-inner::before {
  left: 16px;
  top: 10px;
}

.certificate-inner::after {
  right: 16px;
  bottom: 10px;
  transform: rotate(180deg);
}

.certificate-header {
  margin-bottom: 18px;
}

.certificate-header p,
.certificate-header span {
  margin: 0;
  font-family: "Cinzel", serif;
  text-transform: uppercase;
}

.certificate-header p {
  font-size: clamp(17px, 2vw, 24px);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.certificate-header span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.18em;
}

.certificate-artifact h1 {
  margin: 8px auto 20px;
  font-family: "Cinzel", serif;
  font-size: clamp(40px, 8vw, 82px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.certificate-artifact h1 span {
  display: block;
  margin-top: 6px;
  color: #9f7422;
  font-size: clamp(19px, 3vw, 34px);
  letter-spacing: 0.18em;
}

.certificate-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: center;
}

.certificate-photo {
  margin: 0;
  padding: 10px;
  border: 2px solid rgba(201, 154, 46, 0.72);
  border-radius: 6px;
  background: #f7e9c8;
  box-shadow: inset 0 0 0 1px rgba(159, 116, 34, 0.28), 0 8px 22px rgba(107, 78, 46, 0.16);
}

.certificate-photo img,
.certificate-photo video,
.certificate-photo .empty-proof {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 3px;
}

.certificate-photo figcaption {
  margin-top: 8px;
  color: #6b4e2e;
  font-family: "Libre Baskerville", serif;
  font-size: 12px;
}

.certificate-copy {
  font-family: "Libre Baskerville", serif;
  font-size: clamp(14px, 1.8vw, 17px);
  line-height: 1.45;
}

.certificate-copy p {
  margin: 8px 0;
}

.certificate-small {
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.certificate-name,
.certificate-kid {
  display: block;
  color: #a83a2d;
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  line-height: 1;
}

.certificate-name {
  margin: 8px 0 12px;
  font-size: clamp(50px, 8vw, 88px);
}

.certificate-kid {
  margin: 4px 0 8px;
  font-size: clamp(34px, 5.6vw, 58px);
}

.certificate-copy h2 {
  margin: 8px 0;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(27px, 4vw, 44px);
  line-height: 1;
}

.certificate-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 24px auto 0;
  max-width: 760px;
  background: rgba(201, 154, 46, 0.38);
}

.certificate-meta div {
  padding: 12px;
  background: rgba(255, 248, 232, 0.74);
}

.certificate-meta span,
.certificate-meta strong {
  display: block;
}

.certificate-meta span {
  margin-bottom: 5px;
  color: #6b4e2e;
  font-family: "Roboto Condensed", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.certificate-meta strong {
  font-family: "Libre Baskerville", serif;
  font-size: 15px;
}

.certificate-record {
  margin: 22px auto 0;
  max-width: 760px;
  padding-top: 16px;
  border-top: 1px solid rgba(201, 154, 46, 0.6);
}

.certificate-record h2 {
  margin: 0 0 8px;
  color: #9f7422;
  font-family: "Cinzel", serif;
  font-size: 18px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.certificate-record p {
  margin: 0;
  font-family: "Libre Baskerville", serif;
  font-size: clamp(13px, 1.6vw, 16px);
  line-height: 1.55;
}

.certificate-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 22px;
  align-items: end;
  margin-top: 24px;
}

.signature-line {
  border-top: 1px solid #6b4e2e;
  padding-top: 8px;
}

.signature-line strong {
  display: block;
  color: #1f1b16;
  font-family: "Great Vibes", cursive;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  line-height: 1;
}

.signature-line span {
  display: block;
  margin-top: 5px;
  font-family: "Roboto Condensed", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.certificate-seal {
  display: grid;
  width: clamp(108px, 14vw, 142px);
  aspect-ratio: 1;
  place-items: center;
  border: 4px double #9f7422;
  border-radius: 50%;
  background:
    radial-gradient(circle, #e2bd59 0 45%, #c99a2e 46% 72%, #9f7422 73% 100%);
  color: #1f1b16;
  font-family: "Cinzel", serif;
  font-size: clamp(10px, 1.3vw, 13px);
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(107, 78, 46, 0.28);
}

/* Memory artifact: Gallery Wall */
.memory-stage.template-gallery {
  width: min(1280px, calc(100% - 32px));
  align-items: start;
  background: transparent;
}

.template-gallery .share-panel {
  border-color: #ddd3c7;
  background: #faf7f1;
  color: #22201d;
}

.template-gallery .share-panel .eyebrow {
  color: #b4865b;
}

.template-gallery .share-panel .primary-action {
  border-color: #22201d;
  background: #22201d;
  color: #faf7f1;
}

.gallery-artifact {
  justify-self: center;
  width: min(100%, 1080px);
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid #ddd3c7;
  border-radius: 6px;
  background: #faf7f1;
  color: #22201d;
  box-shadow: 0 18px 42px rgba(34, 32, 29, 0.1);
}

.gallery-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.62fr) minmax(0, 1.38fr);
  gap: clamp(20px, 4vw, 44px);
  align-items: start;
}

.gallery-copy {
  padding-top: 16px;
}

.gallery-kicker,
.gallery-copy > span {
  display: block;
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gallery-kicker {
  margin: 0 0 8px;
  color: #22201d;
}

.gallery-copy > span {
  color: #6f665e;
}

.gallery-copy h1 {
  margin: clamp(38px, 6vw, 70px) 0 18px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: 0;
  text-wrap: balance;
}

.gallery-caption {
  margin: 0 0 40px;
  max-width: 280px;
  color: #6f665e;
  font-family: "Libre Baskerville", serif;
  font-size: clamp(15px, 1.7vw, 18px);
  font-style: italic;
  line-height: 1.55;
}

.gallery-caption::before {
  content: "";
  display: block;
  width: 50px;
  height: 2px;
  margin-bottom: 18px;
  background: #b4865b;
}

.gallery-meta {
  display: grid;
  gap: 14px;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid #ddd3c7;
}

.gallery-meta div {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: baseline;
}

.gallery-meta dt {
  color: #6f665e;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--font);
  font-size: 15px;
}

.gallery-media {
  position: relative;
}

.gallery-mission-number {
  position: absolute;
  z-index: 2;
  right: -1px;
  top: -1px;
  padding: 16px 18px;
  background: #faf7f1;
  color: #6f665e;
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.gallery-mission-number strong {
  display: block;
  color: #b4865b;
  font-family: "Cormorant Garamond", serif;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 0.9;
}

.gallery-hero {
  margin: 0;
  padding: 9px;
  border: 1px solid #ddd3c7;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(34, 32, 29, 0.08);
}

.gallery-hero img,
.gallery-hero video,
.gallery-hero .empty-proof {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 3px;
}

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

.gallery-grid figure {
  margin: 0;
  padding: 6px;
  border: 1px solid #ddd3c7;
  border-radius: 6px;
  background: #fff;
}

.gallery-grid img,
.gallery-grid video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 3px;
}

.gallery-story {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  margin-top: 28px;
  padding: 22px;
  border: 1px solid #ddd3c7;
  background: rgba(255, 255, 255, 0.42);
}

.gallery-story span {
  color: rgba(180, 134, 91, 0.42);
  font-family: "Cormorant Garamond", serif;
  font-size: 64px;
  line-height: 0.8;
}

.gallery-story p {
  margin: 0;
  color: #22201d;
  font-family: "Libre Baskerville", serif;
  font-size: clamp(14px, 1.5vw, 17px);
  font-style: italic;
  line-height: 1.65;
}

.gallery-complete {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  margin-top: 22px;
  color: #22201d;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-align: center;
  text-transform: uppercase;
}

.gallery-complete span {
  height: 1px;
  background: #a89d91;
}

.template-poster .memory-card {
  background: #fff6df;
}

.template-poster .memory-card h1 {
  text-transform: uppercase;
}

.template-scrapbook .memory-hero {
  transform: rotate(-1deg);
  border: 12px solid #fffdf8;
  box-shadow: var(--soft-shadow);
}

.template-field-note .memory-card {
  background:
    repeating-linear-gradient(180deg, transparent 0, transparent 31px, rgba(25, 24, 21, 0.09) 32px),
    #fbf5e8;
}

.template-comic .memory-card {
  background:
    radial-gradient(circle at 12px 12px, rgba(25, 24, 21, 0.14) 2px, transparent 2px),
    #fff6a3;
  background-size: 20px 20px;
}

.template-comic .memory-hero {
  border-width: 4px;
  box-shadow: 8px 8px 0 var(--ink);
}

.template-certificate .memory-card {
  border: 10px double #bd8a1b;
  background: #fff9df;
}

.template-gallery .memory-card {
  background: #fbfbf8;
}

.template-gallery .memory-hero {
  border-color: var(--line);
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.dashboard-stats div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

.dashboard-stats strong,
.dashboard-stats span {
  display: block;
}

.dashboard-stats strong {
  font-size: 34px;
  line-height: 1;
}

.dashboard-stats span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.memory-row {
  grid-template-columns: 42px 1fr;
  min-height: auto;
  align-items: center;
}

.memory-row strong,
.memory-row small {
  display: block;
}

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.privacy-grid section {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--soft-shadow);
}

.privacy-grid h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.privacy-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 28px;
  border: 1px dashed #b8ad9a;
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.84);
}

.empty-state.standalone {
  width: min(620px, calc(100% - 36px));
  margin: 60px auto;
}

.empty-state strong {
  font-size: 26px;
}

.empty-state span {
  color: var(--muted);
}

@media (max-width: 920px) {
  .mission-shell,
  .memory-stage,
  .setup-shell {
    grid-template-columns: 1fr;
  }

  .mission-aside,
  .share-panel,
  .setup-intro {
    position: static;
  }

  .mission-aside {
    min-height: auto;
  }

  .template-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .movie-artifact,
  .scrapbook-artifact {
    width: 100%;
  }

  .scrap-layout {
    grid-template-columns: 1fr;
  }

  .scrap-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    transform: rotate(-0.5deg);
  }

  .scrap-note {
    width: min(100%, 560px);
    margin-left: 0;
  }

  .field-header,
  .field-layout,
  .comic-header,
  .comic-grid,
  .certificate-layout,
  .gallery-layout {
    grid-template-columns: 1fr;
  }

  .field-label-card,
  .field-filed {
    width: fit-content;
  }

  .field-kicker {
    text-align: left;
  }

  .field-stamp {
    position: relative;
    top: auto;
    right: auto;
    margin: 16px 0 0 auto;
  }

  .field-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .comic-issue,
  .comic-authority {
    width: fit-content;
  }

  .comic-grid > *,
  .comic-narrator,
  .comic-powers {
    grid-column: auto;
  }

  .comic-hero {
    min-height: auto;
    grid-row: auto;
  }

  .certificate-footer {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .signature-line {
    width: 100%;
  }

  .gallery-copy h1 {
    margin-top: 28px;
  }

  .gallery-caption {
    margin-bottom: 22px;
  }
}

@media (max-width: 640px) {
  .app-header {
    align-items: flex-start;
  }

  .top-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .field-grid,
  .template-picker,
  .dashboard-stats,
  .privacy-grid,
  .saved-profile-grid,
  .home-onboarding {
    grid-template-columns: 1fr;
  }

  .action-bar,
  .share-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .primary-action,
  .secondary-action,
  .compact-link {
    width: 100%;
  }

  .home-actions {
    justify-content: stretch;
  }

  .mission-grid {
    grid-template-columns: 1fr;
  }

  .mission-card {
    min-height: 134px;
  }

  .memory-card h1 {
    font-size: clamp(38px, 14vw, 58px);
  }

  .memory-stage {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
  }

  .movie-artifact {
    padding: 14px;
  }

  .movie-media {
    min-height: auto;
  }

  .movie-stamp {
    /* Base rule already pins it top-left; just trim the size on small screens. */
    width: clamp(72px, 22vw, 104px);
  }

  .movie-credits,
  .movie-note {
    grid-template-columns: 1fr;
  }

  .movie-credits div {
    padding: 10px;
  }

  .movie-note span {
    text-align: left;
  }

  .scrapbook-artifact {
    padding: 16px;
  }

  .scrap-sticker {
    position: relative;
    inset: auto;
    display: inline-block;
    margin-bottom: 10px;
  }

  .sticker-left,
  .sticker-bolt {
    transform: none;
  }

  .sticker-bolt {
    display: none;
  }

  .scrap-header {
    width: 100%;
    margin-top: 0;
  }

  .scrap-thumbs,
  .scrap-meta,
  .scrap-footer {
    grid-template-columns: 1fr;
  }

  .round-stamp {
    right: 10px;
    bottom: 48px;
  }

  .field-artifact {
    padding: 16px;
  }

  .field-artifact::before {
    display: none;
  }

  .field-summary,
  .field-evidence-grid {
    grid-template-columns: 1fr;
  }

  .field-stamp {
    width: min(100%, 170px);
  }

  .comic-artifact {
    padding: 10px;
  }

  .comic-title-block {
    padding: 10px 10px 14px;
  }

  .comic-title-block::before {
    inset: 36px 8px 10px;
  }

  .comic-support-grid {
    grid-template-columns: 1fr;
  }

  .comic-panel figcaption {
    position: relative;
    left: auto;
    bottom: auto;
    display: block;
    max-width: none;
    margin: 8px;
  }

  .speech-bubble,
  .action-burst {
    position: relative;
    inset: auto;
    width: auto;
    max-width: none;
    margin: 8px;
  }

  .comic-proof-stamp {
    position: relative;
    right: auto;
    bottom: auto;
    margin: 14px 0 0 auto;
  }

  .certificate-artifact {
    padding: 12px;
  }

  .certificate-inner {
    padding: 16px;
  }

  .certificate-inner::before,
  .certificate-inner::after {
    opacity: 0.35;
    font-size: 34px;
  }

  .certificate-artifact h1 {
    letter-spacing: 0.05em;
  }

  .certificate-meta,
  .gallery-meta div,
  .gallery-complete {
    grid-template-columns: 1fr;
  }

  .certificate-footer {
    gap: 16px;
  }

  .gallery-artifact {
    padding: 16px;
  }

  .gallery-mission-number {
    position: static;
    display: inline-block;
    margin-bottom: 10px;
    border: 1px solid #ddd3c7;
  }

  .gallery-story {
    grid-template-columns: 1fr;
  }

  .gallery-story span {
    font-size: 38px;
  }
}

/* Session persistence: recovery + 24h media retention */
.expired-banner {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--muted);
}

.expired-banner strong {
  color: var(--ink);
}

.retention-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.recover-prompt {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

.account-tools {
  grid-column: 1 / -1;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.account-tools h2 {
  margin: 0 0 6px;
}

.delete-all-form {
  margin-top: 12px;
}
