:root {
  --bg1: #100817;
  --bg2: #281339;
  --bg3: #4d2545;
  --text: #fff7fb;
  --muted: #d9c8d8;
  --soft: rgba(255,255,255,.12);
  --soft-2: rgba(255,255,255,.18);
  --border: rgba(255,255,255,.22);
  --accent: #ff9ec7;
  --accent2: #ffd3a6;
  --shadow: rgba(0,0,0,.35);
}
body.light {
  --bg1: #fff1f6;
  --bg2: #ffe5ef;
  --bg3: #e9efff;
  --text: #241523;
  --muted: #6d5a68;
  --soft: rgba(255,255,255,.62);
  --soft-2: rgba(255,255,255,.82);
  --border: rgba(80,35,70,.14);
  --accent: #c6477d;
  --accent2: #9f6a2b;
  --shadow: rgba(80,35,70,.13);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(255,158,199,.32), transparent 32rem),
    radial-gradient(circle at 80% 10%, rgba(255,211,166,.22), transparent 28rem),
    linear-gradient(135deg, var(--bg1), var(--bg2) 55%, var(--bg3));
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.08) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 80%, rgba(255,255,255,.08) 0 1px, transparent 1px);
  background-size: 72px 72px, 96px 96px;
  pointer-events: none;
}
.grain { position: fixed; inset: 0; opacity: .08; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E"); }
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.app, .lock-screen { position: relative; z-index: 1; }
.hidden { display: none !important; }
.glass { background: linear-gradient(135deg, var(--soft), rgba(255,255,255,.06)); border: 1px solid var(--border); box-shadow: 0 22px 70px var(--shadow); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.lock-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.lock-card { width: min(520px, 100%); padding: clamp(26px, 5vw, 46px); border-radius: 34px; text-align: center; }
.lock-icon { font-size: 54px; margin-bottom: 10px; }
h1, h2, h3 { margin: 0; line-height: 1.04; }
h1, h2 { font-family: "Playfair Display", serif; }
.lock-card h1 { font-size: clamp(38px, 8vw, 66px); }
.soft, .lead, .section-title p, .intro p, .promise p, .calm-copy p, footer, .page-card p, .memory-cover p, .mini-letter p, .dream-card p, .canvas-copy p, .note-pad p { color: var(--muted); }
.lock-card label { display: block; text-align: left; margin: 26px 0 8px; font-weight: 700; }
.password-row { display: flex; gap: 10px; }
input, textarea { border: 1px solid var(--border); color: var(--text); background: rgba(255,255,255,.1); outline: none; font: inherit; }
.password-row input { flex: 1; min-width: 0; border-radius: 999px; padding: 14px 18px; }
button, a.primary, a.secondary, .page-card { border: 0; cursor: pointer; text-decoration: none; font-weight: 800; color: var(--text); transition: transform .2s ease, background .2s ease, border-color .2s ease; }
button:hover, a.primary:hover, a.secondary:hover, .page-card:hover { transform: translateY(-2px); }
button:active, a.primary:active, a.secondary:active { transform: translateY(0); }
.primary, .lock-card button { display: inline-flex; align-items: center; justify-content: center; padding: 14px 20px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #32101f; }
.secondary, .small-btn { display: inline-flex; align-items: center; justify-content: center; padding: 13px 18px; border-radius: 999px; color: var(--text); background: rgba(255,255,255,.1); border: 1px solid var(--border); }
.wrong { color: #ffd3d3; font-weight: 700; }
.topbar { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 20; width: min(1100px, calc(100% - 28px)); border-radius: 999px; padding: 10px 12px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.topbar a, .topbar button { color: var(--text); font-size: 14px; padding: 10px 14px; border-radius: 999px; background: transparent; }
.topbar a:hover, .topbar button:hover { background: rgba(255,255,255,.12); transform: none; }
.hero { min-height: 100vh; padding: 24px; display: grid; align-items: center; }
.mini-hero { min-height: 62vh; padding: 110px 24px 50px; display: grid; align-items: center; }
.hero-content { width: min(980px, 100%); margin: 80px auto 0; text-align: center; }
.mini-hero .hero-content { margin-top: 0; }
.eyebrow, .script { color: var(--accent2); text-transform: uppercase; letter-spacing: .22em; font-size: 12px; font-weight: 900; }
.script { margin: 0 0 12px; }
.hero h1, .mini-hero h1 { font-size: clamp(48px, 10vw, 116px); letter-spacing: -.04em; }
.lead { max-width: 800px; margin: 24px auto 0; font-size: clamp(18px, 2vw, 23px); line-height: 1.7; }
.hero-actions { margin: 34px 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.time-card { display: inline-grid; grid-template-columns: 1fr auto 1fr; gap: 22px; align-items: center; padding: 18px 28px; border-radius: 28px; }
.time-card span { display: block; color: var(--muted); font-size: 13px; }
.time-card strong { font-size: 24px; }
.heart-line { color: var(--accent); font-size: 28px; }
.floating-notes span { position: absolute; border: 1px solid var(--border); background: rgba(255,255,255,.08); padding: 10px 14px; border-radius: 999px; color: var(--muted); animation: float 7s ease-in-out infinite; }
.floating-notes span:nth-child(1) { left: 7%; top: 22%; }
.floating-notes span:nth-child(2) { right: 8%; top: 25%; animation-delay: -2s; }
.floating-notes span:nth-child(3) { left: 14%; bottom: 18%; animation-delay: -3s; }
.floating-notes span:nth-child(4) { right: 12%; bottom: 22%; animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-16px); } }
.section { width: min(1120px, calc(100% - 32px)); margin: 0 auto 90px; }
.intro, .promise, .calm-section, .affirmation-card, .split-section, .memory-cover, .favorites, .canvas-section, .note-pad { border-radius: 38px; padding: clamp(28px, 5vw, 54px); }
.intro h2, .promise h2, .calm-section h2, .affirmation-card h2, .section-title h2, .split-section h2, .memory-cover h2, .favorites h2, .canvas-section h2, .note-pad h2 { font-size: clamp(34px, 6vw, 64px); }
.intro p, .promise p, .calm-copy p, .split-section p, .memory-cover p, .favorites li, .canvas-copy p { font-size: 18px; line-height: 1.8; }
.section-title { margin-bottom: 28px; text-align: center; }
.section-title p { max-width: 720px; margin: 12px auto 0; line-height: 1.7; }
.page-grid, .dream-grid, .memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.page-card, .dream-card, .memory-polaroid { border-radius: 30px; padding: 26px; min-height: 230px; display: block; }
.page-card span, .dream-card span { font-size: 38px; display: inline-block; margin-bottom: 16px; }
.page-card h3, .dream-card h3, .memory-polaroid h3 { font-size: 25px; margin-bottom: 12px; }
.page-card p, .dream-card p, .memory-polaroid p { line-height: 1.65; font-weight: 500; }
.split-section { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center; }
.mini-letter { border-radius: 28px; padding: 28px; background: rgba(255,255,255,.1); border: 1px solid var(--border); }
.mini-letter span { font-family: "Playfair Display", serif; font-size: 32px; color: var(--accent2); }
.letter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.letter-card { min-height: 220px; border-radius: 30px; padding: 24px; text-align: left; position: relative; overflow: hidden; }
.letter-card::after { content: ""; position: absolute; inset: auto -30px -50px auto; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, rgba(255,158,199,.35), transparent 70%); }
.letter-card .icon { font-size: 34px; margin-bottom: 18px; }
.letter-card h3 { font-size: 24px; margin-bottom: 12px; }
.letter-card p { color: var(--muted); line-height: 1.65; }
.letter-card button { margin-top: 16px; }
.calm-section, .canvas-section { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center; }
.calm-buttons, .canvas-tools, .note-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.canvas-tools label { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-weight: 800; }
.canvas-tools input[type="color"] { width: 48px; height: 44px; padding: 4px; border-radius: 14px; }
.canvas-tools input[type="range"] { accent-color: var(--accent); }
.breathing-wrap { display: grid; place-items: center; text-align: center; }
.breathing-circle { width: min(300px, 70vw); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(255,255,255,.2), rgba(255,158,199,.13)); border: 1px solid var(--border); box-shadow: inset 0 0 40px rgba(255,255,255,.08), 0 20px 60px var(--shadow); transition: transform 4s ease-in-out; }
.breathing-circle span { font-family: "Playfair Display", serif; font-size: 34px; }
.breathing-circle.inhale { transform: scale(1.16); }
.breathing-circle.exhale { transform: scale(.86); }
#breathingGuide { color: var(--muted); }
.affirmation-section { text-align: center; }
.affirmation-card { margin: auto; max-width: 820px; }
.affirmation-card h2 { margin-bottom: 24px; }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.memory { border-radius: 28px; padding: 24px; }
.memory span { color: var(--accent2); font-weight: 900; letter-spacing: .18em; }
.memory h3 { margin: 12px 0; font-size: 23px; }
.memory p { color: var(--muted); line-height: 1.65; }
.memory-grid { grid-template-columns: repeat(3, 1fr); }
.memory-polaroid { transform: rotate(-.4deg); }
.memory-polaroid:nth-child(even) { transform: rotate(.5deg); }
.photo-spot { height: 170px; display: grid; place-items: center; font-size: 54px; border-radius: 22px; margin-bottom: 18px; background: radial-gradient(circle, rgba(255,158,199,.24), rgba(255,255,255,.06)); border: 1px dashed var(--border); }
.favorites { display: grid; grid-template-columns: .9fr 1.1fr; gap: 28px; align-items: start; }
.love-list { margin: 0; padding-left: 22px; }
.love-list li { margin-bottom: 12px; color: var(--muted); }
.dream-grid { grid-template-columns: repeat(3, 1fr); }
.canvas-wrap { width: 100%; border-radius: 28px; padding: 12px; border: 1px solid var(--border); background: rgba(255,255,255,.08); box-shadow: inset 0 0 30px rgba(255,255,255,.05); }
#drawCanvas { width: 100%; height: auto; display: block; border-radius: 20px; background: rgba(255,255,255,.05); touch-action: none; cursor: crosshair; }
.note-pad textarea { width: 100%; min-height: 220px; resize: vertical; border-radius: 26px; padding: 20px; line-height: 1.7; margin-top: 18px; }
.promise { text-align: center; }
footer { text-align: center; padding: 30px; }
footer button { margin-top: 8px; background: transparent; color: var(--muted); text-decoration: underline; }
.letter-dialog { width: min(680px, calc(100% - 28px)); border: 1px solid var(--border); border-radius: 34px; padding: clamp(26px, 5vw, 44px); color: var(--text); background: radial-gradient(circle at top left, rgba(255,158,199,.28), transparent 22rem), linear-gradient(135deg, rgba(35,15,45,.96), rgba(35,18,38,.96)); box-shadow: 0 30px 90px rgba(0,0,0,.6); }
body.light .letter-dialog { background: linear-gradient(135deg, #fff8fb, #fff1f6); }
.letter-dialog::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(7px); }
.close { position: absolute; right: 18px; top: 14px; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.1); color: var(--text); font-size: 30px; }
.dialog-icon { font-size: 46px; }
.letter-dialog h2 { font-size: clamp(34px, 7vw, 58px); margin-bottom: 18px; }
.letter-dialog p { color: var(--muted); line-height: 1.85; font-size: 17px; }
.grounding { margin: 24px 0; padding: 18px; border-radius: 22px; background: rgba(255,255,255,.1); line-height: 1.7; }
.grounding strong { color: var(--accent2); }
.whisper { border-left: 3px solid var(--accent); padding-left: 16px; color: var(--text); font-family: "Playfair Display", serif; font-size: 24px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: rgba(20,10,25,.85); border: 1px solid var(--border); color: #fff; border-radius: 999px; padding: 13px 18px; box-shadow: 0 20px 50px rgba(0,0,0,.4); }

.confirm-dialog { border-radius: 34px; padding: 40px; max-width: 420px; text-align: center; }
.confirm-icon { font-size: 48px; margin-bottom: 16px; }
.confirm-dialog h2 { font-size: 28px; margin-bottom: 12px; }
.confirm-dialog p { color: var(--muted); line-height: 1.6; margin-bottom: 24px; }
.confirm-actions { display: flex; gap: 12px; justify-content: center; }
.confirm-actions button { min-width: 120px; }

/* Canvas update: fullscreen workspace + saved drawing cards */
.canvas-section { position: relative; }
.memory-title-input { width: 100%; border-radius: 999px; padding: 15px 18px; margin-top: 18px; }
.compact-title { margin-bottom: 20px; }
.saved-drawings-panel { border-radius: 38px; padding: clamp(24px, 4vw, 42px); }
.saved-drawing-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; align-items: stretch; }
.saved-drawing-card { border-radius: 28px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.saved-drawing-card h3, .canvas-memory-card h3 { font-size: 23px; margin: 2px 0 0; }
.saved-drawing-card p, .canvas-memory-card p { color: var(--muted); line-height: 1.6; margin: 0; white-space: pre-wrap; }
.canvas-memory-thumb { width: 100%; height: 170px; object-fit: cover; display: block; border-radius: 22px; margin-bottom: 14px; background: radial-gradient(circle, rgba(255,158,199,.24), rgba(255,255,255,.06)); border: 1px dashed var(--border); }
.saved-drawing-card .canvas-memory-thumb { height: 150px; margin-bottom: 0; }
.canvas-memory-meta { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-top: auto; opacity: .82; }
.delete-drawing-btn { margin-top: 8px; width: fit-content; }
.empty-state { grid-column: 1 / -1; color: var(--muted); text-align: center; border: 1px dashed var(--border); border-radius: 26px; padding: 28px; background: rgba(255,255,255,.06); line-height: 1.7; }
.see-more-link { width: fit-content; align-self: center; justify-self: center; }
.canvas-memories-section[hidden] { display: none !important; }

.canvas-section:fullscreen,
.canvas-section:-webkit-full-screen,
.canvas-section.canvas-pseudo-fullscreen {
  width: 100vw !important;
  max-width: none !important;
  height: 100vh;
  margin: 0 !important;
  border-radius: 0;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  background:
    radial-gradient(circle at top left, rgba(255,158,199,.28), transparent 28rem),
    linear-gradient(135deg, var(--bg1), var(--bg2) 55%, var(--bg3));
}
.canvas-section.canvas-pseudo-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 100;
}
body.canvas-fullscreen-active { overflow: hidden; }
.canvas-section:fullscreen .canvas-copy,
.canvas-section:-webkit-full-screen .canvas-copy,
.canvas-section.canvas-pseudo-fullscreen .canvas-copy {
  overflow: auto;
  padding: 6px 8px 8px;
}
.canvas-section:fullscreen .canvas-copy p:not(.script),
.canvas-section:-webkit-full-screen .canvas-copy p:not(.script),
.canvas-section.canvas-pseudo-fullscreen .canvas-copy p:not(.script) {
  font-size: 15px;
  line-height: 1.55;
}
.canvas-section:fullscreen .canvas-tools,
.canvas-section:-webkit-full-screen .canvas-tools,
.canvas-section.canvas-pseudo-fullscreen .canvas-tools {
  align-content: start;
}
.canvas-section:fullscreen .canvas-wrap,
.canvas-section:-webkit-full-screen .canvas-wrap,
.canvas-section.canvas-pseudo-fullscreen .canvas-wrap {
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.canvas-section:fullscreen #drawCanvas,
.canvas-section:-webkit-full-screen #drawCanvas,
.canvas-section.canvas-pseudo-fullscreen #drawCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 980px) { .page-grid, .letter-grid, .timeline, .memory-grid, .dream-grid, .calm-section, .canvas-section, .split-section, .favorites { grid-template-columns: 1fr; } .floating-notes { display: none; } .topbar { justify-content: flex-start; overflow-x: auto; } .hero { padding-top: 70px; } .memory-polaroid, .memory-polaroid:nth-child(even) { transform: none; } }
@media (max-width: 560px) { .password-row, .hero-actions, .time-card { display: grid; grid-template-columns: 1fr; } .heart-line { display: none; } .topbar a, .topbar button { font-size: 13px; padding: 9px 11px; white-space: nowrap; } .letter-card { min-height: 0; } .canvas-tools button, .canvas-tools label, .note-actions button { width: 100%; justify-content: center; } }

@media (max-width: 760px) {
  .canvas-section:fullscreen,
  .canvas-section:-webkit-full-screen,
  .canvas-section.canvas-pseudo-fullscreen {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 12px;
  }
  .canvas-section:fullscreen .canvas-copy h2,
  .canvas-section:-webkit-full-screen .canvas-copy h2,
  .canvas-section.canvas-pseudo-fullscreen .canvas-copy h2,
  .canvas-section:fullscreen .canvas-copy p:not(.script),
  .canvas-section:-webkit-full-screen .canvas-copy p:not(.script),
  .canvas-section.canvas-pseudo-fullscreen .canvas-copy p:not(.script) { display: none; }
  .canvas-section:fullscreen .canvas-tools,
  .canvas-section:-webkit-full-screen .canvas-tools,
  .canvas-section.canvas-pseudo-fullscreen .canvas-tools { margin-top: 0; gap: 8px; }
  .canvas-section:fullscreen .canvas-tools button,
  .canvas-section:-webkit-full-screen .canvas-tools button,
  .canvas-section.canvas-pseudo-fullscreen .canvas-tools button,
  .canvas-section:fullscreen .canvas-tools label,
  .canvas-section:-webkit-full-screen .canvas-tools label,
  .canvas-section.canvas-pseudo-fullscreen .canvas-tools label { width: auto; flex: 1 1 auto; }
}

/* Editable memory forms, notes, uploaded photos, and future goals */
.add-memory-panel, .note-memory-panel, .future-goals-panel, .saved-notes-section { border-radius: 38px; padding: clamp(24px, 4vw, 46px); }
.compact-title { margin-bottom: 18px; }
.memory-form { display: grid; gap: 16px; max-width: 820px; margin: 0 auto; }
.memory-form.single-form { max-width: none; margin: 18px 0 0; }
.memory-form label { display: grid; gap: 8px; color: var(--muted); font-weight: 850; line-height: 1.4; }
.memory-form input[type="text"], .memory-form input[type="file"], .memory-title-input, .future-goal-form input[type="text"] { width: 100%; border-radius: 20px; padding: 14px 16px; }
.memory-form textarea, .future-goal-form textarea { width: 100%; border-radius: 24px; padding: 16px; line-height: 1.65; resize: vertical; min-height: 130px; }
.upload-preview { width: min(420px, 100%); max-height: 300px; object-fit: cover; display: block; margin: 0 auto; border-radius: 24px; border: 1px dashed var(--border); background: rgba(255,255,255,.08); }
.canvas-memory-kind { width: max-content; border: 1px solid var(--border); color: var(--accent2); background: rgba(255,255,255,.08); border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 8px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.card-actions .secondary { padding: 10px 14px; font-size: 13px; }
.saved-notes-list, .future-goals-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 24px; }
.note-memory-card, .future-goal-card { border-radius: 30px; padding: 24px; display: flex; flex-direction: column; gap: 12px; min-height: 220px; }
.note-memory-card h3, .future-goal-card h3 { font-size: 24px; margin: 0; }
.note-memory-card p, .future-goal-card p { color: var(--muted); line-height: 1.65; margin: 0; white-space: pre-wrap; }
.note-memory-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; background: rgba(255,255,255,.1); border: 1px solid var(--border); font-size: 26px; }
.future-goal-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.future-goal-top span { color: var(--accent2); border: 1px solid var(--border); background: rgba(255,255,255,.08); border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.future-goal-top button { padding: 9px 12px; font-size: 12px; }
.future-goal-card.done { opacity: .72; }
.future-goal-card.done h3 { text-decoration: line-through; text-decoration-thickness: 2px; }
.memory-edit-dialog .dialog-form { margin-top: 18px; }
.memory-edit-dialog h2 { margin-bottom: 10px; }
@media (max-width: 560px) { .card-actions, .future-goal-top { align-items: stretch; flex-direction: column; } .card-actions button, .future-goal-top button { width: 100%; justify-content: center; } }

/* Fullscreen memory gallery */
.canvas-memory-thumb { cursor: zoom-in; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.canvas-memory-thumb:hover, .canvas-memory-thumb:focus { transform: translateY(-2px) scale(1.01); border-color: var(--accent); box-shadow: 0 16px 38px rgba(0,0,0,.2); outline: none; }
.memory-gallery-dialog { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; border: 0; padding: 0; color: var(--text); background: rgba(11,5,18,.94); overflow: hidden; }
body.light .memory-gallery-dialog { background: rgba(255,241,246,.96); }
.memory-gallery-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(10px); }
.memory-gallery-close { position: fixed; right: 18px; top: 18px; z-index: 3; }
.memory-gallery-shell { width: 100%; height: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 24px; }
.memory-gallery-content { width: min(1400px, 100%); height: 100%; min-height: 0; margin: 0 auto; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
#memoryGalleryImage { max-width: 100%; max-height: calc(100vh - 190px); width: auto; height: auto; justify-self: center; align-self: center; display: block; object-fit: contain; border-radius: 26px; box-shadow: 0 30px 90px rgba(0,0,0,.48); background: rgba(255,255,255,.06); }
.memory-gallery-info { width: min(900px, 100%); justify-self: center; border-radius: 28px; padding: 18px 22px; }
.memory-gallery-info h2 { font-size: clamp(28px, 5vw, 54px); margin: 8px 0; }
.memory-gallery-info p { color: var(--muted); line-height: 1.65; margin: 0 0 10px; white-space: pre-wrap; }
.memory-gallery-nav { width: 58px; height: 58px; border-radius: 999px; padding: 0; font-size: 40px; line-height: 1; }
@media (max-width: 760px) {
  .memory-gallery-shell { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; padding: 74px 12px 12px; }
  .memory-gallery-nav { position: fixed; top: 50%; transform: translateY(-50%); z-index: 2; width: 46px; height: 46px; font-size: 32px; }
  #memoryGalleryPrev { left: 12px; }
  #memoryGalleryNext { right: 12px; }
  #memoryGalleryImage { max-height: calc(100vh - 240px); border-radius: 20px; }
  .memory-gallery-info { padding: 14px 16px; border-radius: 22px; }
}
.future-goal-form { margin-top: 24px; }

.photo-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}

.photo-preview-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.05);
}

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

.photo-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(220, 53, 69, 0.9);
  color: white;
  border: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 700;
}

.photo-preview-remove:hover {
  background: rgba(220, 53, 69, 1);
}
