:root {
  --ink: #202824;
  --muted: #66736b;
  --paper: #fffaf1;
  --panel: rgba(255, 250, 241, 0.9);
  --line: rgba(32, 40, 36, 0.13);
  --green: #496f5c;
  --green-deep: #243f35;
  --amber: #c77a3b;
  --red: #9c3f3f;
  --shadow: 0 24px 70px rgba(40, 45, 38, 0.14);
  --soft-shadow: 0 14px 38px rgba(39, 44, 38, 0.12);
  --font-sans: "LXGW WenKai Screen", "Kaiti SC", "STKaiti", "KaiTi", "FangSong", "PingFang SC", "Microsoft YaHei", cursive;
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: #e8eee6;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  letter-spacing: 0;
  background:
    linear-gradient(115deg, rgba(244, 239, 222, 0.92), rgba(226, 235, 229, 0.9)),
    url("/assets/family-table.png") center / cover fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 100%);
  background-size: 42px 42px;
  mask-image: linear-gradient(140deg, black, transparent 68%);
}

body.receiver-mode {
  background:
    linear-gradient(118deg, rgba(247, 245, 238, 0.96), rgba(233, 239, 231, 0.92)),
    url("/assets/family-table.png") center / cover fixed;
}

body:not(.quick-mode) .quick-only,
.quick-mode .careful-only,
.receiver-mode .quick-only,
.receiver-mode .careful-only {
  display: none !important;
}

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

button,
select {
  cursor: pointer;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px 0 34px;
  display: grid;
  grid-template-areas:
    "nav nav"
    "writer preview";
  grid-template-columns: minmax(340px, 0.9fr) minmax(390px, 1.1fr);
  gap: 22px;
  align-items: start;
}

.site-nav {
  grid-area: nav;
  min-height: 58px;
  padding: 8px 10px 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: rgba(255, 251, 244, 0.76);
  box-shadow: 0 12px 30px rgba(39, 44, 38, 0.1);
  backdrop-filter: blur(16px);
}

.site-brand {
  display: grid;
  gap: 2px;
  color: var(--green-deep);
  text-decoration: none;
}

.site-brand span {
  font-size: 1.06rem;
  font-weight: 900;
}

.site-brand small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--green-deep);
  font-size: 0.88rem;
  font-weight: 900;
  text-decoration: none;
}

.nav-links .nav-support {
  border-color: rgba(36, 63, 53, 0.28);
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.nav-links a[aria-current="page"] {
  border-color: var(--green-deep);
  color: var(--paper);
  background: var(--green-deep);
}

.nav-links a:not([aria-current="page"]):hover,
.nav-links a:not([aria-current="page"]):focus {
  background: rgba(255, 255, 255, 0.64);
}

.workbench,
.preview-area {
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(16px);
}

.workbench {
  grid-area: writer;
  padding: 20px;
  background: rgba(255, 251, 244, 0.92);
}

.preview-area {
  grid-area: preview;
  position: sticky;
  top: 18px;
  padding: 16px;
  background: rgba(251, 248, 240, 0.82);
}

.receiver-mode .app-shell {
  width: min(760px, calc(100% - 32px));
  grid-template-areas:
    "nav"
    "preview";
  grid-template-columns: 1fr;
  align-items: center;
}

.receiver-mode .preview-area {
  position: static;
}

.masthead {
  display: grid;
  gap: 5px;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.support-link {
  flex: 0 0 auto;
  color: var(--green-deep);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
  opacity: 0.82;
}

.support-link:hover,
.support-link:focus {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.masthead-row,
.panel-title,
.preview-toolbar,
.actions,
.template-row {
  display: flex;
  gap: 10px;
}

.preview-toolbar,
.actions,
.template-row {
  flex-wrap: wrap;
}

.masthead-row,
.panel-title,
.preview-toolbar {
  align-items: center;
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 800;
}

.panel-note {
  margin-top: 6px;
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  max-width: 16em;
  font-size: clamp(1.28rem, 1.95vw, 1.88rem);
  line-height: 1.18;
  font-weight: 800;
}

h2 {
  font-size: 1.05rem;
  font-weight: 800;
}

.countdown {
  flex: 0 0 auto;
  width: 58px;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 8px;
  color: var(--paper);
  background: var(--green-deep);
}

.countdown span {
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 900;
}

.countdown small {
  margin-top: 3px;
  font-size: 0.78rem;
}

.panel-stack {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.tool-panel {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
}

.magic-panel {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(73, 111, 92, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 250, 241, 0.72)),
    rgba(255, 250, 241, 0.7);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
}

.final-panel {
  background: rgba(255, 255, 255, 0.5);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  outline: none;
}

input,
select {
  height: 41px;
  padding: 0 12px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.check-row span {
  color: inherit;
  font-size: inherit;
}

textarea {
  min-height: 136px;
  resize: vertical;
  padding: 12px;
  line-height: 1.62;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(73, 111, 92, 0.58);
  box-shadow: 0 0 0 4px rgba(73, 111, 92, 0.12);
}

.full {
  width: 100%;
}

.primary,
.secondary,
.ghost-button,
.swatch {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.primary,
.secondary,
.ghost-button {
  padding: 0 14px;
}

.primary {
  color: var(--paper);
  border-color: var(--green-deep);
  background: var(--green-deep);
}

.secondary {
  color: var(--green-deep);
  background: rgba(255, 255, 255, 0.6);
}

.secondary:disabled,
.primary:disabled {
  cursor: wait;
  opacity: 0.66;
}

.ghost-button {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
}

.suggestions {
  display: grid;
  gap: 9px;
}

.prompt-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-presets button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(73, 111, 92, 0.2);
  border-radius: 8px;
  color: var(--green-deep);
  background: rgba(255, 255, 255, 0.52);
  font-size: 0.88rem;
  font-weight: 800;
}

.prompt-presets button:hover,
.prompt-presets button:focus {
  border-color: rgba(73, 111, 92, 0.48);
  outline: none;
}

.suggestion {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(73, 111, 92, 0.22);
  border-radius: 8px;
  color: #344039;
  background: rgba(255, 250, 241, 0.78);
  line-height: 1.58;
  text-align: left;
}

.suggestion:hover,
.suggestion:focus {
  border-color: rgba(73, 111, 92, 0.58);
  box-shadow: 0 0 0 4px rgba(73, 111, 92, 0.11);
  outline: none;
}

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

.template-head {
  display: grid;
}

.swatch {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: start;
  justify-items: start;
  gap: 2px 10px;
  min-height: 64px;
  padding: 11px 12px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
  text-align: left;
}

.swatch.is-active {
  color: var(--paper);
  border-color: var(--green);
  background: var(--green);
}

.swatch-color {
  grid-row: 1 / span 2;
  width: 16px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.72);
}

.swatch > span:not(.swatch-color) {
  font-size: 0.92rem;
  line-height: 1.08;
}

.swatch > small {
  color: inherit;
  font-size: 0.76rem;
  line-height: 1.25;
  font-weight: 700;
  opacity: 0.82;
}

.swatch.is-active > small {
  opacity: 0.95;
}

.swatch-color.warm {
  background: linear-gradient(135deg, #fff0c9, #c86650);
}

.swatch-color.garden {
  background: linear-gradient(135deg, #dfe8c3, #2e6759);
}

.swatch-color.evening {
  background: linear-gradient(135deg, #f4d0b6, #304760);
}

.swatch-color.classic {
  background: linear-gradient(135deg, #f6ead2, #5d4c3e);
}

.swatch-color.letter {
  background: linear-gradient(135deg, #fff8e7, #8a775c);
}

.swatch-color.album {
  background: linear-gradient(135deg, #f3f4e5, #415f63);
}

.swatch-color.desk {
  background: linear-gradient(135deg, #fbf6ec, #5a6b63);
}

.swatch-color.journey {
  background: linear-gradient(135deg, #f3ede3, #566470);
}

.swatch-color.minimal {
  background: linear-gradient(135deg, #fbfbf7, #aeb7aa);
}

.swatch-color.postcard {
  background: linear-gradient(135deg, #f8e6ca, #3f6f83);
}

.swatch-color.newspaper {
  background: linear-gradient(135deg, #f4f0e6, #383a36);
}

.swatch-color.ticket {
  background: linear-gradient(135deg, #f2dfb9, #8a4d55);
}

.swatch-color.blueprint {
  background: linear-gradient(135deg, #dce9ef, #315f72);
}

.swatch-color.gallery {
  background: linear-gradient(135deg, #f7f1e5, #7b705e);
}

.swatch-color.collage {
  background: linear-gradient(135deg, #f8dbce, #596d84);
}

.swatch-color.cover {
  background: linear-gradient(135deg, #fff7e8, #222824);
}

.status {
  min-height: 24px;
  margin: 0;
  color: var(--green-deep);
  font-weight: 800;
}

.preview-toolbar {
  margin-bottom: 12px;
}

.receiver-toolbar {
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.receiver-status {
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.ghost-link {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green-deep);
  background: rgba(255, 255, 255, 0.55);
  font-weight: 800;
  text-decoration: none;
}

.share-result {
  display: grid;
  gap: 8px;
  padding: 15px;
  border: 1px solid rgba(73, 111, 92, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(255, 250, 241, 0.84)),
    rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.36);
}

.share-result span {
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 800;
}

.share-result a {
  width: fit-content;
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(73, 111, 92, 0.26);
  border-radius: 8px;
  color: var(--green-deep);
  background: rgba(255, 255, 255, 0.62);
  font-size: 1rem;
  font-weight: 900;
  text-decoration: none;
}

.share-result a::before {
  content: "打开 ";
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.share-result small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.upload-tile {
  flex: 1;
  min-height: 64px;
  padding: 11px 13px;
  display: grid;
  gap: 2px;
  border: 1px dashed rgba(36, 63, 53, 0.35);
  border-radius: 8px;
  color: var(--green-deep);
  background: rgba(255, 255, 255, 0.55);
}

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

.upload-tile span {
  font-weight: 900;
}

.upload-tile small {
  color: var(--muted);
}

.photo-card {
  min-height: 640px;
  padding: 16px;
  display: grid;
  grid-template-rows: minmax(300px, 1fr) auto;
  gap: 12px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  color: #24322d;
  background: #fff7e8;
  font-family: var(--font-sans);
}

.photo-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 8px;
  pointer-events: none;
}

.theme-warm {
  background: linear-gradient(145deg, #fff3dd 0%, #efc27e 54%, #c86350 100%);
}

.theme-garden {
  background: linear-gradient(145deg, #f6f0dc 0%, #8ab18f 56%, #2d6758 100%);
}

.theme-evening {
  color: #f8f2e8;
  background: linear-gradient(145deg, #f0c6aa 0%, #7389a6 52%, #2f455e 100%);
}

.theme-classic {
  background: linear-gradient(145deg, #f7ecd6 0%, #baa06f 54%, #5f4c3f 100%);
}

.theme-letter {
  background: linear-gradient(145deg, #fff9ea 0%, #dbc7a6 58%, #8a765b 100%);
}

.theme-album {
  background: linear-gradient(145deg, #f3f5e7 0%, #96a9a1 52%, #425e63 100%);
}

.theme-desk {
  color: #24322d;
  background: linear-gradient(145deg, #fbf6ec 0%, #c7b59a 52%, #5a6b63 100%);
}

.theme-journey {
  color: #f8f4eb;
  background: linear-gradient(145deg, #f3ede3 0%, #a7b5bc 52%, #566470 100%);
}

.theme-minimal {
  background: linear-gradient(145deg, #fbfbf7 0%, #dee3da 52%, #aeb7aa 100%);
}

.theme-postcard {
  color: #24322d;
  background:
    linear-gradient(145deg, #fff3de 0%, #c9d5cf 50%, #3f6f83 100%);
}

.theme-newspaper {
  color: #242622;
  background:
    linear-gradient(145deg, #f7f1e8 0%, #c7c0b1 54%, #383a36 100%);
}

.theme-ticket {
  color: #2d2624;
  background:
    linear-gradient(145deg, #fff0cf 0%, #d7a777 52%, #8a4d55 100%);
}

.theme-blueprint {
  color: #eef7f9;
  background:
    linear-gradient(145deg, #dce9ef 0%, #7399a8 50%, #315f72 100%);
}

.theme-gallery {
  color: #2a2c27;
  background:
    linear-gradient(145deg, #f8f1e4 0%, #d3c5ad 50%, #7b705e 100%);
}

.theme-collage {
  color: #242b2d;
  background:
    linear-gradient(145deg, #fff1df 0%, #e4b9a9 48%, #596d84 100%);
}

.theme-cover {
  color: #fff7ea;
  background:
    linear-gradient(145deg, #f7ead7 0%, #7a857a 48%, #222824 100%);
}

.privacy-badge {
  position: absolute;
  top: 26px;
  right: 26px;
  z-index: 3;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--paper);
  background: rgba(36, 63, 53, 0.82);
  font-size: 0.78rem;
  font-weight: 900;
}

.photo-stage {
  min-height: 320px;
  z-index: 1;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(255, 250, 241, 0.45), rgba(255, 255, 255, 0.12)),
    url("/assets/family-table.png") center / cover;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42), 0 18px 46px rgba(35, 39, 32, 0.18);
}

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

.photo-frame {
  width: 100%;
  height: 100%;
  min-height: inherit;
  overflow: hidden;
  border-radius: inherit;
}

.theme-classic .photo-stage {
  padding: 14px 14px 40px;
  background: #f8f1df;
  transform: rotate(-1.1deg);
  box-shadow: inset 0 0 0 1px rgba(100, 84, 62, 0.16), 0 18px 46px rgba(35, 39, 32, 0.15);
}

.theme-classic .photo-stage img {
  border-radius: 4px;
  filter: sepia(0.16) contrast(0.96) saturate(0.84);
}

.theme-letter .photo-stage {
  min-height: 260px;
  padding: 12px;
  background: #f7f0e1;
  transform: rotate(-0.6deg);
  box-shadow: inset 0 0 0 1px rgba(100, 84, 62, 0.18), 0 18px 46px rgba(35, 39, 32, 0.13);
}

.theme-letter .message-sheet {
  background:
    repeating-linear-gradient(0deg, rgba(100, 84, 62, 0.09) 0, rgba(100, 84, 62, 0.09) 1px, transparent 1px, transparent 30px),
    rgba(255, 250, 241, 0.9);
  border: 1px solid rgba(100, 84, 62, 0.12);
}

.theme-album {
  grid-template-rows: minmax(390px, 1fr) auto;
}

.theme-album .photo-stage {
  border: 10px solid rgba(255, 250, 241, 0.68);
  box-shadow: inset 0 0 0 1px rgba(36, 63, 53, 0.16), 0 18px 46px rgba(35, 39, 32, 0.18);
}

.theme-desk .photo-stage {
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 251, 243, 0.58), rgba(236, 227, 211, 0.44)),
    url("/assets/family-table.png") center / cover;
  box-shadow: inset 0 0 0 1px rgba(76, 69, 55, 0.12), 0 18px 46px rgba(35, 39, 32, 0.16);
}

.theme-desk .message-sheet {
  background: rgba(255, 251, 244, 0.9);
  border-left: 4px solid rgba(89, 110, 100, 0.48);
}

.theme-journey .photo-stage {
  background:
    linear-gradient(135deg, rgba(255, 251, 245, 0.32), rgba(234, 241, 247, 0.16)),
    url("/assets/family-table.png") center / cover;
  box-shadow: inset 0 0 0 1px rgba(75, 94, 111, 0.18), 0 18px 46px rgba(35, 39, 32, 0.16);
}

.theme-journey .message-sheet {
  background: rgba(33, 49, 63, 0.46);
  color: #f7f3eb;
}

.theme-minimal .photo-stage {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(240, 243, 238, 0.32)),
    url("/assets/family-table.png") center / cover;
  box-shadow: inset 0 0 0 1px rgba(70, 82, 76, 0.1), 0 16px 40px rgba(35, 39, 32, 0.14);
}

.theme-minimal .message-sheet {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(70, 82, 76, 0.1);
  box-shadow: 0 10px 26px rgba(35, 39, 32, 0.08);
}

.theme-postcard .photo-stage {
  border: 8px solid rgba(255, 248, 235, 0.7);
  border-bottom-width: 24px;
  transform: rotate(0.7deg);
}

.theme-postcard .message-sheet {
  background:
    linear-gradient(90deg, transparent 0 62%, rgba(64, 111, 131, 0.12) 62% 63%, transparent 63%),
    rgba(255, 250, 240, 0.88);
}

.theme-newspaper .photo-stage {
  filter: grayscale(0.18);
  background:
    repeating-linear-gradient(90deg, rgba(30, 32, 28, 0.04) 0, rgba(30, 32, 28, 0.04) 1px, transparent 1px, transparent 8px),
    url("/assets/family-table.png") center / cover;
}

.theme-newspaper .message-sheet {
  background:
    repeating-linear-gradient(0deg, rgba(36, 38, 34, 0.055) 0, rgba(36, 38, 34, 0.055) 1px, transparent 1px, transparent 9px),
    rgba(250, 246, 237, 0.9);
  box-shadow: 0 10px 28px rgba(20, 22, 18, 0.12);
}

.theme-ticket .photo-stage {
  border-radius: 8px 8px 24px 24px;
  box-shadow: inset 0 -18px 0 rgba(255, 246, 226, 0.22), 0 18px 46px rgba(35, 39, 32, 0.18);
}

.theme-ticket .message-sheet {
  border-top: 2px dashed rgba(138, 77, 85, 0.36);
  background: rgba(255, 246, 226, 0.88);
}

.theme-blueprint .photo-stage {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    url("/assets/family-table.png") center / cover;
  background-size: 28px 28px, 28px 28px, cover;
}

.theme-blueprint .message-sheet {
  color: #eef7f9;
  background: rgba(31, 78, 96, 0.52);
  border: 1px solid rgba(238, 247, 249, 0.22);
}

.theme-gallery .photo-stage {
  padding: 14px;
  background: rgba(255, 250, 240, 0.5);
  box-shadow: inset 0 0 0 10px rgba(255, 250, 240, 0.28), 0 18px 46px rgba(35, 39, 32, 0.16);
}

.theme-gallery .message-sheet {
  background: rgba(255, 250, 240, 0.88);
  border: 1px solid rgba(123, 112, 94, 0.18);
}

.theme-collage .photo-stage {
  overflow: visible;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.5), rgba(244, 218, 205, 0.24)),
    url("/assets/family-table.png") center / cover;
}

.photo-collage {
  position: relative;
  width: min(100%, 460px);
  height: min(100%, 360px);
  min-height: 300px;
}

.collage-frame {
  position: absolute;
  overflow: hidden;
  border: 9px solid rgba(255, 250, 240, 0.9);
  border-bottom-width: 28px;
  border-radius: 6px;
  background: #fffaf0;
  box-shadow: 0 16px 34px rgba(32, 40, 36, 0.18);
}

.collage-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame-1 {
  inset: 0 17% 18% 3%;
  transform: rotate(-4deg);
}

.frame-2 {
  inset: 12% 3% 4% 36%;
  transform: rotate(5deg);
}

.frame-3 {
  inset: 54% 42% 2% 8%;
  transform: rotate(2deg);
}

.theme-collage .message-sheet {
  background: rgba(255, 249, 239, 0.9);
  border: 1px solid rgba(89, 109, 132, 0.18);
}

.theme-cover {
  grid-template-rows: minmax(430px, 1fr) auto;
}

.theme-cover .photo-stage {
  min-height: 430px;
  box-shadow: inset 0 -120px 110px rgba(20, 25, 22, 0.32), 0 20px 48px rgba(20, 25, 22, 0.22);
}

.theme-cover .message-sheet {
  margin-top: -108px;
  color: #fff7ea;
  background: linear-gradient(0deg, rgba(24, 29, 26, 0.84), rgba(24, 29, 26, 0.36));
  box-shadow: none;
}

.theme-cover .card-title {
  max-width: 9em;
  font-size: clamp(1.7rem, 4vw, 3.1rem);
  line-height: 1.02;
}

.empty-photo {
  max-width: 300px;
  padding: 18px;
  display: grid;
  gap: 8px;
  text-align: center;
  border-radius: 8px;
  color: var(--green-deep);
  background: rgba(255, 250, 241, 0.78);
}

.empty-photo span {
  font-size: 1.15rem;
  font-weight: 900;
}

.empty-photo small {
  color: var(--muted);
  line-height: 1.5;
}

.message-sheet {
  z-index: 1;
  padding: 22px;
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.8);
  box-shadow: 0 14px 40px rgba(35, 39, 32, 0.13);
}

.theme-evening .message-sheet {
  color: #f8f2e8;
  background: rgba(31, 47, 62, 0.56);
}

.card-title {
  margin: 0 0 10px;
  font-size: clamp(1.28rem, 2.6vw, 2.08rem);
  line-height: 1.18;
  font-weight: 900;
  max-width: 12em;
}

.theme-letter .card-title,
.theme-postcard .card-title,
.theme-newspaper .card-title {
  font-family: var(--font-serif);
  font-weight: 800;
}

.card-message {
  min-height: 108px;
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.76;
  font-size: 0.98rem;
}

.card-name {
  margin: 14px 0 0;
  text-align: right;
  font-size: 0.95rem;
  font-weight: 900;
}

.contribute-mode {
  background:
    linear-gradient(120deg, rgba(250, 246, 235, 0.97), rgba(224, 235, 229, 0.92)),
    url("/assets/family-table.png") center / cover fixed;
}

.contribute-shell {
  width: min(980px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0;
  display: grid;
  grid-template-areas:
    "nav"
    "hero"
    "payments";
  align-content: center;
  gap: 22px;
}

.contribute-nav {
  grid-area: nav;
}

.contribute-hero {
  grid-area: hero;
  display: grid;
  gap: 10px;
  max-width: 620px;
}

.contribute-hero .ghost-link {
  width: fit-content;
  min-height: 38px;
}

.contribute-hero h1 {
  max-width: 14em;
}

.contribute-hero p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
  font-weight: 700;
}

.payment-grid {
  grid-area: payments;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.payment-card {
  padding: 16px;
  display: grid;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: rgba(255, 251, 244, 0.9);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(16px);
}

.payment-card-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.payment-card h2 {
  font-size: 1.18rem;
}

.payment-card p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
  font-weight: 800;
}

.payment-qr {
  padding: 12px;
  border: 1px solid rgba(73, 111, 92, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.payment-qr img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-areas:
      "nav"
      "writer"
      "preview";
    grid-template-columns: 1fr;
    width: min(100% - 22px, 660px);
    padding-top: 12px;
    gap: 14px;
  }

  .preview-area {
    position: static;
  }

  h1 {
    font-size: 1.55rem;
  }

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

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

  .photo-card {
    min-height: 560px;
    grid-template-rows: minmax(250px, 1fr) auto;
  }

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

@media (max-width: 480px) {
  .site-nav {
    padding: 10px;
    align-items: stretch;
    flex-direction: column;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-links a {
    justify-content: center;
  }

  .workbench,
  .preview-area {
    padding: 12px;
  }

  .app-shell {
    width: min(100% - 18px, 660px);
  }

  .panel-stack {
    gap: 10px;
  }

  .tool-panel,
  .magic-panel {
    padding: 12px;
  }

  .masthead-row,
  .preview-toolbar {
    align-items: stretch;
  }

  .countdown {
    width: 62px;
  }

  .actions > *,
  .preview-toolbar > *,
  .receiver-toolbar > * {
    width: 100%;
  }

  .share-result a {
    width: 100%;
    justify-content: center;
  }

  .template-row {
    display: none;
  }

  .photo-card {
    min-height: 500px;
    padding: 12px;
  }

  .photo-stage {
    min-height: 250px;
  }

  .privacy-badge {
    top: 20px;
    right: 20px;
  }

  .message-sheet {
    padding: 16px;
  }

  .receiver-toolbar {
    grid-template-columns: 1fr;
  }

  .topline,
  .payment-card-head {
    align-items: start;
    flex-direction: column;
  }

  .contribute-shell {
    width: min(100% - 18px, 660px);
    padding: 18px 0 28px;
  }
}
