:root {
    --canvas: #f7ebdd;
    --paper: #fffdf8;
    --paper-soft: #f2e3d2;
    --paper-deep: #ead4bd;
    --terracotta: #9a4f3d;
    --terracotta-dark: #743729;
    --apricot: #e7b58f;
    --rose: #c98b87;
    --sage: #8b9275;
    --kraft: #d8c09d;
    --ink: #342821;
    --ink-soft: #6f5b50;
    --line: rgba(91, 62, 48, .16);
    --line-strong: rgba(91, 62, 48, .28);
    --success: #566344;
    --danger: #a63f3f;
    --focus: #783d2f;
    --radius-sm: 10px;
    --radius: 18px;
    --radius-lg: 28px;
    --shadow-1: 0 2px 10px rgba(75, 48, 36, .07);
    --shadow-2: 0 12px 34px rgba(75, 48, 36, .11);
    --shadow-3: 0 24px 70px rgba(52, 40, 33, .22);
    --serif: "Noto Serif SC", "Songti SC", STSong, SimSun, serif;
    --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --hand: KaiTi, STKaiti, "Noto Serif SC", serif;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --header-h: 72px;
    --z-header: 50;
    --z-menu: 70;
    --z-nav: 80;
    --z-drawer: 100;
    --z-toast: 120;
    --drawer-viewport-height: 100dvh;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100dvh;
    padding-top: var(--header-h);
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 4%, rgba(231,181,143,.22), transparent 28rem),
        radial-gradient(circle at 90% 28%, rgba(139,146,117,.12), transparent 24rem),
        var(--canvas);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .22;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
}
body.drawer-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; }
img { max-width: 100%; display: block; }
svg { width: 1em; height: 1em; stroke-width: 1.8; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(154,79,61,.38); outline-offset: 3px; }
::selection { color: var(--ink); background: rgba(231,181,143,.55); }

.skip-link { position: fixed; z-index: 999; top: 8px; left: 8px; transform: translateY(-150%); padding: 10px 14px; background: var(--paper); border-radius: 8px; }
.skip-link:focus { transform: none; }
.site-header { position: fixed; z-index: var(--z-header); inset: 0 0 auto; height: var(--header-h); background: rgba(247,235,221,.9); border-bottom: 1px solid rgba(91,62,48,.1); backdrop-filter: blur(16px); }
.site-header-inner { width: min(calc(100% - 40px), 1120px); height: 100%; margin: auto; display: flex; align-items: center; gap: 28px; }
.brand { min-height: 44px; display: inline-flex; align-items: center; gap: 11px; text-decoration: none; flex: 0 0 auto; }
.brand-seal { width: 38px; height: 38px; display: grid; place-items: center; color: var(--paper); background: var(--terracotta); border-radius: 42% 58% 46% 54% / 48% 42% 58% 52%; transform: rotate(-4deg); box-shadow: var(--shadow-1); }
.brand-seal svg { width: 20px; height: 20px; }
.brand-copy { display: grid; line-height: 1.08; }
.brand-copy b { font-family: var(--serif); font-size: 18px; letter-spacing: .04em; }
.brand-copy small { margin-top: 5px; color: var(--ink-soft); font-size: 9px; letter-spacing: .18em; }
.desktop-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.desktop-nav > a, .life-menu > summary { min-height: 44px; display: inline-flex; align-items: center; gap: 5px; padding: 9px 13px; color: var(--ink-soft); border-radius: 999px; text-decoration: none; list-style: none; cursor: pointer; transition: color .2s, background .2s; }
.desktop-nav > a:hover, .desktop-nav > a.active, .life-menu > summary:hover, .life-menu > summary.active { color: var(--terracotta-dark); background: rgba(255,253,248,.72); }
.life-menu { position: relative; }
.life-menu summary::-webkit-details-marker { display: none; }
.life-menu summary svg { width: 14px; transition: transform .2s var(--ease); }
.life-menu[open] summary svg { transform: rotate(180deg); }
.life-menu-paper { position: absolute; z-index: var(--z-menu); top: calc(100% + 10px); right: 0; width: 220px; padding: 9px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-2); }
.life-menu-paper::before { content: ""; position: absolute; top: -7px; right: 28px; width: 14px; height: 14px; background: var(--paper); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.life-menu-paper a { position: relative; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; }
.life-menu-paper a:hover { background: var(--paper-soft); color: var(--terracotta-dark); }
.life-menu-paper svg { width: 18px; height: 18px; color: var(--terracotta); }
.header-more { display: none; }

.page-shell { width: min(calc(100% - 40px), 1040px); margin: 0 auto; padding: 48px 0 100px; }
.page-reveal { animation: page-in .32s var(--ease) both; }
@keyframes page-in { from { opacity: 0; } }
.page-head { position: relative; margin-bottom: 36px; }
.page-head.center { max-width: 720px; margin-inline: auto; text-align: center; }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--terracotta); font-size: 11px; font-weight: 700; letter-spacing: .19em; line-height: 1.2; }
.page-title { margin: 0; font-family: var(--serif); font-size: clamp(2rem, 4.8vw, 3.25rem); font-weight: 600; line-height: 1.22; letter-spacing: .025em; }
.page-title::after { content: ""; display: block; width: 58px; height: 5px; margin-top: 13px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='58' height='5' viewBox='0 0 58 5'%3E%3Cpath d='M1 3c13-2 39-2 56 0' fill='none' stroke='%239A4F3D' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.page-head.center .page-title::after { margin-inline: auto; }
.page-subtitle { max-width: 62ch; margin: 14px 0 0; color: var(--ink-soft); }
.hand-label { font-family: var(--hand); color: var(--terracotta-dark); letter-spacing: .04em; }
.chapter { position: relative; margin-top: 64px; }
.chapter:first-child { margin-top: 0; }
.chapter-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.chapter-heading h2 { margin: 0; font-family: var(--serif); font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 600; }
.chapter-heading a, .chapter-heading button { color: var(--terracotta-dark); }
.chapter-note { margin: 0; color: var(--ink-soft); font-size: 14px; }

.paper-sheet { position: relative; background: var(--paper); border: 1px solid rgba(91,62,48,.1); border-radius: 3px 18px 15px 5px; box-shadow: var(--shadow-2); }
.paper-sheet::after { content: ""; position: absolute; inset: 7px -5px -6px 8px; z-index: -1; background: rgba(216,192,157,.42); border-radius: inherit; transform: rotate(.45deg); }
.torn-paper { position: relative; padding: clamp(28px, 5vw, 52px); background: var(--paper); box-shadow: var(--shadow-2); clip-path: polygon(0 2%, 4% 1%, 9% 2%, 14% .5%, 20% 1.7%, 26% .6%, 31% 1.8%, 37% .8%, 43% 1.8%, 49% .5%, 55% 1.6%, 61% .7%, 67% 1.7%, 73% .5%, 79% 1.7%, 85% .7%, 91% 1.8%, 96% .5%, 100% 2%, 99% 98%, 94% 99%, 88% 98%, 82% 99.5%, 76% 98.2%, 69% 99.3%, 63% 98%, 56% 99.2%, 49% 98%, 42% 99.5%, 35% 98.2%, 28% 99.3%, 21% 98%, 14% 99.2%, 7% 98%, 1% 99%); }
.tape { position: absolute; width: 86px; height: 24px; background: rgba(231,181,143,.55); border: 1px solid rgba(154,79,61,.09); box-shadow: 0 1px 3px rgba(75,48,36,.06); transform: rotate(-4deg); }
.tape.top { top: -9px; left: 50%; margin-left: -43px; }
.stamp { display: inline-grid; place-items: center; min-width: 72px; min-height: 72px; padding: 10px; color: var(--terracotta); border: 2px solid currentColor; border-radius: 50%; font-family: var(--hand); font-size: 12px; line-height: 1.1; text-align: center; opacity: .78; transform: rotate(6deg); }
.paper-note { position: relative; padding: 20px; background: #f7d5b9; border-radius: 2px 10px 4px 8px; box-shadow: 2px 5px 16px rgba(75,48,36,.1); }
.paper-note.sage { background: #dce0ce; }
.paper-note.rose { background: #eed3d0; }
.collage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.prose-paper { max-width: 72ch; margin-inline: auto; color: var(--ink); font-size: 17px; line-height: 1.9; }
.prose-paper h1, .prose-paper h2, .prose-paper h3, .prose-paper h4 { font-family: var(--serif); line-height: 1.35; }
.prose-paper a { color: var(--terracotta-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.tape-left { top: -9px; left: 28px; }
.tape-right { top: -8px; right: 28px; transform: rotate(4deg); }
body.reveal-ready [data-reveal] { opacity: 0; transform: translateY(10px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
body.reveal-ready [data-reveal].revealed { opacity: 1; transform: none; }

.primary-action, .quiet-action, .text-action, .icon-button, .chip-action { min-height: 44px; border: 0; cursor: pointer; text-decoration: none; transition: transform .16s var(--ease), background .2s, color .2s, box-shadow .2s, opacity .2s; }
.primary-action { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 11px 18px; color: #fff; background: var(--terracotta); border-radius: 999px; font-weight: 700; box-shadow: 0 7px 18px rgba(116,55,41,.18); }
.primary-action:hover { background: var(--terracotta-dark); box-shadow: 0 10px 24px rgba(116,55,41,.22); }
.primary-action:active, .quiet-action:active, .icon-button:active { transform: scale(.97); }
.primary-action.full { width: 100%; }
.full-action { width: 100%; }
.primary-action svg, .quiet-action svg, .text-action svg { width: 19px; height: 19px; }
.quiet-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 15px; color: var(--ink); background: rgba(255,253,248,.72); border: 1px solid var(--line); border-radius: 999px; }
.quiet-action:hover { color: var(--terracotta-dark); background: var(--paper); }
.text-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 5px; color: var(--ink-soft); background: transparent; font-weight: 600; }
.text-action:hover { color: var(--terracotta-dark); }
.text-action.danger { color: var(--danger); }
.icon-button { width: 44px; height: 44px; display: inline-grid; place-items: center; flex: 0 0 auto; color: var(--ink-soft); background: transparent; border-radius: 50%; }
.icon-button:hover { color: var(--terracotta-dark); background: var(--paper-soft); }
.icon-button svg { width: 21px; height: 21px; }
.chip-action { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; color: var(--ink-soft); background: transparent; border: 1px solid var(--line); border-radius: 999px; }
.chip-action.selected { color: var(--terracotta-dark); background: rgba(231,181,143,.25); border-color: rgba(154,79,61,.3); }
button:disabled { cursor: wait; opacity: .55; }

.flash-stack { display: grid; gap: 10px; margin-bottom: 28px; }
.flash { min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 11px 15px; border-radius: 12px; background: var(--paper); box-shadow: var(--shadow-1); }
.flash svg { flex: 0 0 auto; color: var(--terracotta); }
.flash.success svg { color: var(--success); }
.flash.error { color: var(--danger); }

.drawer { position: fixed; z-index: var(--z-drawer); inset: 0 0 auto; height: 100vh; height: var(--drawer-viewport-height); display: flex; align-items: center; justify-content: center; padding: max(12px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); overflow-y: auto; overscroll-behavior: contain; }
.drawer[hidden] { display: none; }
.drawer-scrim { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(52,40,33,.52); backdrop-filter: blur(3px); cursor: pointer; animation: scrim-in .2s ease-out both; }
.drawer-paper { position: relative; width: min(100%, 620px); max-height: min(100%, 820px); margin: auto; padding: 14px 26px calc(26px + env(safe-area-inset-bottom)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: var(--paper); border-radius: 26px; box-shadow: var(--shadow-3); animation: drawer-in .28s var(--ease) both; }
.drawer-handle { width: 42px; height: 5px; margin: 0 auto 15px; background: var(--kraft); border-radius: 99px; }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.drawer-header h2 { margin: 0; font-family: var(--serif); font-size: 25px; line-height: 1.3; }
.drawer-header .eyebrow { margin-bottom: 5px; }
@keyframes scrim-in { from { opacity: 0; } }
@keyframes drawer-in { from { opacity: 0; transform: translateY(28px); } }
.more-links { display: grid; }
.more-links a { min-height: 68px; display: grid; grid-template-columns: 30px 1fr 20px; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px dashed var(--line); text-decoration: none; }
.more-links a > svg:first-child { width: 22px; height: 22px; color: var(--terracotta); }
.more-links a > svg:last-child { color: var(--ink-soft); }
.more-links span { display: grid; }
.more-links b { font-family: var(--serif); font-size: 17px; }
.more-links small { margin-top: 2px; color: var(--ink-soft); }
.drawer-logout { margin-top: 16px; }
.journal-paper { width: min(100%, 720px); }
.letter-entry { margin: 0 0 18px; padding: 22px; background: #fbf3e8; border-left: 3px solid var(--terracotta); border-radius: 4px 14px 12px 5px; }
.letter-entry.partner { background: #f1f0e4; border-color: var(--sage); }
.letter-entry p { margin: 10px 0 0; white-space: pre-wrap; line-height: 1.85; }
.writing-form label { font-family: var(--serif); font-size: 20px; }
.writing-form textarea { min-height: 280px; background: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, rgba(91,62,48,.12) 32px); border: 0; border-radius: 0; padding: 4px 2px; line-height: 32px; }
.writing-form .primary-action { width: 100%; margin-top: 14px; }
.writing-form > .text-action { width: 100%; }
.draft-recovery { margin-top: 14px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f5e7c6; border-radius: 10px; color: var(--terracotta-dark); }
.draft-recovery button { min-height: 36px; padding: 5px 9px; border: 0; border-radius: 8px; background: var(--paper); cursor: pointer; }
.editor-meta { display: flex; justify-content: space-between; gap: 14px; margin-top: 8px; color: var(--ink-soft); font-size: 13px; }

.mobile-bottom-nav { display: none; }
.toast-region { position: fixed; z-index: var(--z-toast); right: 20px; bottom: 24px; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 12px 16px; color: var(--paper); background: var(--ink); border-radius: 12px; box-shadow: var(--shadow-2); animation: toast-in .2s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Home */
.today-cover { position: relative; min-height: 180px; display: grid; align-items: end; padding: 18px 0 36px; }
.today-cover::after { content: ""; position: absolute; right: 2%; top: 10px; width: 124px; height: 124px; opacity: .35; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%238B9275' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M73 104c-2-29 3-55 22-80M82 70c14-4 23-14 27-27M78 82c-15-5-25-14-30-27M91 50c-8-4-13-11-14-20M68 63c-9-1-16-6-21-13'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat; }
.today-date { font-family: var(--hand); color: var(--terracotta); font-size: 16px; }
.today-cover h1 { max-width: 760px; margin: 8px 0 0; font-family: var(--serif); font-size: clamp(2.4rem, 7vw, 4.7rem); font-weight: 600; line-height: 1.18; }
.today-cover p { max-width: 52ch; color: var(--ink-soft); }
.question-hero { display: block; color: inherit; text-decoration: none; }
.question-hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 13px; }
.question-hero blockquote { max-width: 760px; margin: 26px auto 18px; font-family: var(--serif); font-size: clamp(1.45rem, 4vw, 2.35rem); line-height: 1.65; text-align: center; }
.question-hero footer { display: flex; justify-content: center; align-items: center; gap: 8px; color: var(--terracotta-dark); font-weight: 700; }
.signature-notes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.signature-note { min-height: 120px; display: grid; align-content: center; gap: 5px; cursor: pointer; text-align: left; border: 0; color: var(--ink); }
.signature-note:first-child { transform: rotate(-.6deg); }
.signature-note:last-child { transform: rotate(.7deg); }
.signature-note strong { font-family: var(--hand); font-size: 20px; }
.signature-note span { color: var(--ink-soft); }
.fridge-board { position: relative; min-height: 220px; padding: 32px; background: #efe7d9; border-radius: 24px; box-shadow: inset 0 0 0 1px rgba(91,62,48,.08), var(--shadow-1); }
.fridge-board::before { content: ""; position: absolute; inset: 12px; border: 1px dashed rgba(91,62,48,.12); border-radius: 17px; pointer-events: none; }
.sticky-list { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.sticky-note { min-height: 150px; display: grid; align-content: space-between; gap: 12px; padding: 22px 18px 18px; background: #f6d6ad; box-shadow: 2px 5px 14px rgba(75,48,36,.12); transform: rotate(-.7deg); }
.sticky-note:nth-child(2n) { background: #e7d5cf; transform: rotate(.8deg); }
.sticky-note:nth-child(3n) { background: #dce0ce; transform: rotate(-.2deg); }
.sticky-note::before { content: ""; position: absolute; top: 8px; left: 50%; width: 9px; height: 9px; margin-left: -4px; background: var(--terracotta); border-radius: 50%; box-shadow: 0 2px 3px rgba(0,0,0,.18); }
.sticky-note h3 { margin: 0; font-family: var(--hand); font-size: 19px; font-weight: 600; }
.sticky-note b { font-family: var(--serif); font-size: 24px; color: var(--terracotta-dark); }
.sticky-note small { color: var(--ink-soft); }
.sticky-note .note-menu { position: absolute; top: 7px; right: 7px; }
.story-thread { position: relative; display: grid; gap: 0; padding-left: 26px; }
.story-thread::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 1px; background: var(--line-strong); }
.story-entry { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; padding: 0 0 28px; }
.story-entry::before { content: ""; position: absolute; left: -25px; top: 9px; width: 11px; height: 11px; background: var(--canvas); border: 2px solid var(--terracotta); border-radius: 50%; }
.story-entry p { margin: 0; }
.story-entry time { color: var(--ink-soft); font-family: var(--hand); white-space: nowrap; }
.memory-glimpse { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 28px; padding: 28px; }
.memory-glimpse h3 { margin: 6px 0; font-family: var(--serif); font-size: 24px; }
.memory-glimpse p { margin: 0; color: var(--ink-soft); }

/* Forms */
.form-page { max-width: 820px; margin: 0 auto; }
.form-paper { padding: clamp(24px, 5vw, 52px); }
.form-section { padding: 30px 0; border-top: 1px dashed var(--line-strong); }
.form-section:first-child { padding-top: 0; border-top: 0; }
.form-section h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 23px; }
.form-section > p { margin: 0 0 22px; color: var(--ink-soft); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.field { margin-bottom: 20px; }
.field label, .writing-form label { display: block; margin-bottom: 8px; color: var(--ink); font-weight: 700; }
.field small { display: block; margin-top: 6px; color: var(--ink-soft); }
input, textarea, select { width: 100%; min-height: 48px; padding: 11px 13px; color: var(--ink); background: rgba(255,253,248,.74); border: 1px solid var(--line-strong); border-radius: 11px; }
textarea { resize: vertical; line-height: 1.75; }
input:hover, textarea:hover, select:hover { border-color: rgba(154,79,61,.42); }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(154,79,61,.18); border-color: var(--terracotta); }
input[type="file"] { padding: 10px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 26px; }
.dynamic-list { display: grid; gap: 10px; }
.dynamic-row { display: grid; grid-template-columns: 1.4fr .8fr 44px; gap: 10px; align-items: center; }

/* Questions */
.letter-page { max-width: 820px; margin: 0 auto; }
.question-letter { padding: clamp(30px, 7vw, 70px); }
.letter-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.letter-question { max-width: 680px; margin: 38px auto; font-family: var(--serif); font-size: clamp(1.55rem, 4.5vw, 2.6rem); line-height: 1.65; text-align: center; }
.envelope-status { display: flex; justify-content: center; gap: 20px; margin: 28px 0; }
.envelope-mark { min-width: 128px; display: grid; justify-items: center; gap: 6px; color: var(--ink-soft); }
.envelope-mark svg { width: 31px; height: 31px; }
.envelope-mark.ready { color: var(--success); }
.answer-letter { margin-top: 24px; padding: 24px; background: repeating-linear-gradient(to bottom, #fffaf3 0, #fffaf3 32px, rgba(91,62,48,.09) 33px); border-radius: 3px 16px 9px 5px; }
.answer-letter label { font-family: var(--hand); font-size: 19px; }
.answer-letter textarea { min-height: 180px; padding: 8px 2px; border: 0; border-radius: 0; background: transparent; line-height: 33px; }
.exchange-letters { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 34px; }
.exchange-letter { padding: 28px; background: #fbf1e3; box-shadow: var(--shadow-1); transform: rotate(-.35deg); }
.exchange-letter:nth-child(2) { background: #eff0e4; transform: rotate(.45deg); }
.exchange-letter p { white-space: pre-wrap; }
.question-menu { position: relative; }
.question-menu-panel { position: absolute; z-index: 20; top: 48px; right: 0; min-width: 190px; padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-2); }
.question-menu-panel form, .question-menu-panel button { width: 100%; }
.question-menu-panel .text-action { justify-content: flex-start; padding: 10px; }

/* Journal */
.calendar-book { padding: clamp(18px, 4vw, 38px); }
.month-turner { display: flex; align-items: center; justify-content: center; gap: 22px; margin-bottom: 25px; }
.month-turner strong { min-width: 170px; font-family: var(--serif); font-size: 21px; text-align: center; }
.calendar-legend { display: flex; justify-content: center; gap: 22px; margin-bottom: 16px; color: var(--ink-soft); font-size: 14px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.calendar-header { padding: 8px 4px; color: var(--ink-soft); font-family: var(--hand); text-align: center; }
.calendar-day { position: relative; min-height: 78px; display: grid; align-content: start; padding: 8px; color: var(--ink); background: transparent; border: 0; border-radius: 12px; cursor: pointer; transition: background .2s, transform .18s var(--ease); }
.calendar-day:hover { background: var(--paper-soft); }
.calendar-day:active { transform: scale(.96); }
.calendar-day.other-month { pointer-events: none; opacity: .25; }
.calendar-day.is-today .day-number { color: #fff; background: var(--terracotta); }
.day-number { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; }
.entry-dots { position: absolute; left: 9px; bottom: 8px; display: flex; gap: 5px; }
.dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }
.dot-me { background: var(--terracotta); }
.dot-partner { background: var(--sage); }

/* Memories */
.memory-timeline { position: relative; max-width: 860px; margin: 0 auto; }
.memory-timeline::before { content: ""; position: absolute; left: 92px; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.memory-item { position: relative; display: grid; grid-template-columns: 74px minmax(0,1fr); gap: 38px; padding-bottom: 42px; }
.memory-date { color: var(--terracotta-dark); font-family: var(--hand); text-align: right; line-height: 1.25; }
.memory-date b { display: block; font-size: 20px; }
.memory-content { position: relative; min-width: 0; padding: 4px 0 0; color: inherit; text-decoration: none; }
.memory-content::before { content: ""; position: absolute; left: -43px; top: 9px; width: 11px; height: 11px; background: var(--canvas); border: 2px solid var(--terracotta); border-radius: 50%; }
.memory-content h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 25px; }
.memory-content p { margin: 8px 0 0; color: var(--ink-soft); }
.memory-meta { display: flex; gap: 12px; color: var(--ink-soft); font-size: 13px; }
.memory-thumb { float: right; width: 116px; aspect-ratio: 4/3; margin: 0 0 10px 22px; padding: 6px; background: var(--paper); box-shadow: var(--shadow-1); transform: rotate(1deg); object-fit: cover; }
.floating-create { position: fixed; z-index: 40; right: max(24px, calc((100vw - 1040px)/2)); bottom: 28px; }
.memory-detail { max-width: 780px; margin: auto; }
.memory-detail-photo { width: min(100%, 540px); margin: 0 auto 34px; padding: 10px 10px 34px; background: var(--paper); box-shadow: var(--shadow-2); transform: rotate(-.45deg); }
.memory-detail-photo img { width: 100%; max-height: 480px; object-fit: cover; }
.memory-detail-copy { padding: clamp(24px, 5vw, 48px); }
.calendar-note, .centered-note { margin-top: 18px; text-align: center; }
.centered-note { margin-top: 24px; }
.liked-note { margin: 24px 0 0; text-align: center; }

/* Wishes */
.wish-composer { max-width: 720px; margin: 0 auto 46px; }
.wish-stream { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 24px; }
.wish-note { position: relative; min-height: 138px; display: flex; align-items: flex-start; gap: 13px; padding: 24px 50px 22px 22px; background: #f7d9ba; box-shadow: var(--shadow-1); transform: rotate(-.4deg); }
.wish-note:nth-child(2n) { background: #ead7d3; transform: rotate(.55deg); }
.wish-note.completed { background: #e1e2d6; color: var(--ink-soft); }
.wish-toggle { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; color: var(--terracotta); border: 1px solid rgba(154,79,61,.25); border-radius: 50%; background: rgba(255,253,248,.52); cursor: pointer; }
.wish-note.completed .wish-toggle { color: var(--success); }
.wish-copy { padding-top: 8px; }
.wish-copy p { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.55; }
.wish-copy small { color: var(--ink-soft); }
.wish-note .note-menu { position: absolute; top: 8px; right: 7px; }
.completed-chapter { margin-top: 56px; opacity: .88; }

/* Recipes */
.bookmark-tabs { display: flex; align-items: flex-end; gap: 6px; margin-bottom: -1px; padding-left: 20px; }
.bookmark-tab { min-height: 44px; padding: 10px 16px; color: var(--ink-soft); background: var(--paper-deep); border: 0; border-radius: 10px 10px 0 0; cursor: pointer; }
.bookmark-tab.active { color: var(--terracotta-dark); background: var(--paper); font-weight: 700; box-shadow: 0 -3px 10px rgba(75,48,36,.05); }
.recipe-index { padding: clamp(22px, 4vw, 40px); }
.recipe-index.paper-sheet::after { transform: none; }
.recipe-group + .recipe-group { margin-top: 36px; padding-top: 28px; border-top: 1px dashed var(--line-strong); }
.recipe-group h2 { margin: 0 0 14px; font-family: var(--serif); font-size: 22px; }
.recipe-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px 30px; }
.recipe-link { min-height: 66px; display: grid; grid-template-columns: 1fr 20px; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px dotted var(--line-strong); text-decoration: none; }
.recipe-link b { display: block; font-family: var(--serif); font-size: 18px; }
.recipe-link small { color: var(--ink-soft); }
.recipe-link svg { color: var(--terracotta); }
.recipe-book { max-width: 900px; margin: 0 auto; padding: clamp(26px, 6vw, 58px); }
.recipe-book-cover { text-align: center; margin-bottom: 46px; }
.recipe-book-cover h1 { margin: 8px 0; font-family: var(--serif); font-size: clamp(2.1rem, 5vw, 3.4rem); }
.recipe-photo { width: min(100%, 420px); margin: 28px auto 0; padding: 8px; background: var(--paper); box-shadow: var(--shadow-1); transform: rotate(.4deg); }
.recipe-photo img { width: 100%; max-height: 340px; object-fit: cover; }
.ingredient-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.ingredient-columns h2, .recipe-steps h2, .cooking-notes h2 { font-family: var(--serif); }
.ingredient-list { margin: 0; padding: 0; list-style: none; }
.ingredient-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dotted var(--line); }
.margin-note { padding: 18px; background: #f3e4c9; border-radius: 3px 12px 6px 8px; font-family: var(--hand); }
.margin-note time { color: var(--terracotta-dark); }
.margin-note b { margin-left: 12px; color: var(--ink-soft); font-weight: 500; }
.margin-note p { margin: 8px 0 0; white-space: pre-wrap; }
.notes-stack { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.recipe-footer { max-width: 900px; margin: 18px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.utility-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin: 28px 0 0; color: var(--ink-soft); font-size: 14px; }
.utility-links a { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; }
.empty-inline { color: var(--ink-soft); }

/* AI menu, settings, auth, utility */
.menu-editor { max-width: 800px; margin: auto; }
.menu-prompt { padding: clamp(26px, 6vw, 54px); }
.menu-result { margin-top: 38px; padding: clamp(28px, 5vw, 52px); background: repeating-linear-gradient(to bottom, #fffaf3 0, #fffaf3 34px, rgba(91,62,48,.09) 35px); }
.settings-list { max-width: 780px; margin: auto; }
.settings-group { margin-bottom: 36px; }
.settings-group h2 { margin: 0 0 12px; font-family: var(--serif); font-size: 21px; }
.setting-row { min-height: 72px; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px dashed var(--line); }
.setting-row > svg { color: var(--terracotta); }
.setting-copy { display: grid; }
.setting-copy b { font-family: var(--serif); font-size: 17px; }
.setting-copy small { color: var(--ink-soft); }
.setting-detail { padding: 20px 0; }
.setting-button { width: 100%; color: var(--ink); text-align: left; background: transparent; border: 0; cursor: pointer; }
.setting-button:hover { background: rgba(255,253,248,.55); }
.setting-row form { justify-self: end; }
.status-pill { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 5px 10px; color: var(--ink-soft); background: var(--paper-soft); border: 0; border-radius: 999px; white-space: nowrap; }
button.status-pill { min-height: 44px; cursor: pointer; }
.status-pill.success { color: var(--success); background: #e2e4d8; }
.danger-row, .danger-row > svg { color: var(--danger); }
.code-input { text-align: center; text-transform: uppercase; letter-spacing: .18em; font-family: var(--serif); font-size: 22px; }
.consent-note { display: flex; align-items: center; gap: 8px; margin-top: 20px; color: var(--ink-soft); }
.invite-code { display: inline-block; padding: 14px 20px; font-family: var(--serif); font-size: 32px; letter-spacing: .16em; background: #f4e1c6; border: 1px dashed var(--terracotta); }
.auth-shell { min-height: calc(100dvh - var(--header-h) - 120px); display: grid; place-items: center; }
.auth-cover { position: relative; width: min(100%, 480px); padding: clamp(36px, 8vw, 64px); background: var(--paper); border-radius: 8px 24px 20px 7px; box-shadow: var(--shadow-2); }
.auth-cover::before { content: ""; position: absolute; inset: 14px; border: 1px solid var(--line); border-radius: inherit; pointer-events: none; }
.auth-cover > * { position: relative; }
.auth-cover h1 { margin: 0; font-family: var(--serif); font-size: 38px; text-align: center; }
.auth-cover .auth-intro { margin: 10px 0 30px; color: var(--ink-soft); text-align: center; }
.auth-eyebrow { text-align: center; }
.auth-foot { margin: 24px 0 0; text-align: center; color: var(--ink-soft); }
.auth-foot a { min-height: 44px; display: inline-flex; align-items: center; }
.weekly-exchange { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.weekly-card { min-height: 260px; padding: 28px; background: #f8e5ce; box-shadow: var(--shadow-1); }
.weekly-card:nth-child(2) { background: #e8e6d8; }
.weekly-card h2 { font-family: var(--serif); font-size: 22px; }
.weekly-summary { margin: -18px 0 28px; text-align: center; }
.weekly-letter { font-family: var(--serif); font-size: 18px; line-height: 1.9; }
.sealed-letter { min-height: 170px; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--ink-soft); text-align: center; }
.sealed-letter svg { width: 34px; height: 34px; color: var(--sage); }
.sealed-letter p { max-width: 28ch; margin: 0; }
.match-results { display: grid; gap: 24px; margin-top: 36px; }
.match-card { padding: 24px; background: var(--paper); box-shadow: var(--shadow-1); }
.match-card h2 { margin: 0 0 16px; font-family: var(--serif); }
.letter-archive { display: grid; gap: 42px; }
.archive-item { padding: clamp(24px, 5vw, 46px); }
.archive-item header { text-align: center; }
.archive-item header time { display: block; margin-bottom: 8px; color: var(--ink-soft); font-family: var(--hand); }
.archive-item header h2 { max-width: 720px; margin: 10px auto 0; font-family: var(--serif); font-size: clamp(1.35rem,3vw,2rem); line-height: 1.6; }

.empty-story { max-width: 560px; margin: 30px auto; padding: 38px 24px; text-align: center; }
.empty-story svg { width: 34px; height: 34px; color: var(--terracotta); }
.empty-story h2 { margin: 12px 0 5px; font-family: var(--serif); font-size: 22px; }
.empty-story p { margin: 0 0 18px; color: var(--ink-soft); }
.danger-zone { margin-top: 54px; padding-top: 20px; border-top: 1px dashed rgba(166,63,63,.3); }

@media (max-width: 900px) {
    .desktop-nav { display: none; }
    .header-more { margin-left: auto; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--ink); background: transparent; cursor: pointer; }
    .sticky-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
    :root { --header-h: 60px; }
    body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
    .site-header-inner { width: calc(100% - 28px); }
    .brand-copy small { display: none; }
    .header-more { display: none; }
    .page-shell { width: min(calc(100% - 28px), 640px); padding: 34px 0 48px; }
    .page-head { margin-bottom: 28px; }
    .page-head-row { align-items: center; }
    .page-head-row { flex-wrap: wrap; }
    .page-title { font-size: clamp(1.9rem, 9vw, 2.65rem); }
    .chapter { margin-top: 48px; }
    .chapter-heading { align-items: center; }
    .collage-grid, .signature-notes, .home-two-column, .exchange-letters, .ingredient-columns, .weekly-exchange { grid-template-columns: 1fr; }
    .sticky-list, .wish-stream, .recipe-list { grid-template-columns: 1fr; }
    .signature-note { min-height: 104px; }
    .memory-glimpse { grid-template-columns: 1fr; }
    .memory-glimpse .stamp { display: none; }
    .story-entry { grid-template-columns: 1fr; gap: 3px; }
    .story-entry time { grid-row: 1; font-size: 13px; }
    .field-grid { grid-template-columns: 1fr; gap: 0; }
    .form-paper { padding: 24px 18px; }
    .form-actions { flex-direction: column-reverse; align-items: stretch; }
    .form-actions > * { width: 100%; }
    .dynamic-row { grid-template-columns: 1fr .75fr 44px; }
    .envelope-status { gap: 8px; }
    .envelope-mark { min-width: 0; flex: 1; font-size: 13px; }
    .question-letter { padding: 34px 20px; }
    .calendar-book { padding: 17px 4px; }
    .calendar-grid { gap: 1px; }
    .calendar-day { min-width: 44px; min-height: 52px; padding: 4px; }
    .day-number { width: 29px; height: 29px; font-size: 14px; }
    .calendar-header { padding: 5px 1px; font-size: 13px; }
    .entry-dots { left: 6px; bottom: 5px; }
    .memory-timeline::before { left: 13px; }
    .memory-item { grid-template-columns: 1fr; gap: 8px; padding-left: 38px; }
    .memory-date { text-align: left; }
    .memory-date b { display: inline; margin-right: 5px; }
    .memory-content::before { left: -31px; top: -23px; }
    .memory-thumb { width: 92px; margin-left: 14px; }
    .floating-create { right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); }
    .wish-stream { gap: 18px; }
    .bookmark-tabs { padding-left: 8px; overflow-x: auto; }
    .bookmark-tab { flex: 0 0 auto; }
    .recipe-index { padding: 22px 17px; }
    .recipe-book { padding: 28px 18px; }
    .notes-stack { grid-template-columns: 1fr; }
    .drawer-paper { padding-inline: 18px; }
    .toast-region { left: 14px; right: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); }
    .toast { max-width: none; }
    .mobile-bottom-nav { position: fixed; z-index: var(--z-nav); inset: auto 0 0; height: calc(66px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5,1fr); padding: 5px 8px env(safe-area-inset-bottom); background: rgba(255,253,248,.94); border-top: 1px solid var(--line); backdrop-filter: blur(16px); }
    .mobile-bottom-nav a, .mobile-bottom-nav button { min-width: 44px; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink-soft); background: transparent; border: 0; border-radius: 11px; text-decoration: none; font-size: 11px; cursor: pointer; }
    .mobile-bottom-nav a.active { color: var(--terracotta-dark); background: rgba(231,181,143,.18); }
    .mobile-bottom-nav svg { width: 21px; height: 21px; }
    .drawer-paper { width: 100%; }
}

@media (max-width: 420px) {
    .today-cover h1 { font-size: 2.5rem; }
    .sticky-note { min-height: 138px; }
    .month-turner { gap: 8px; }
    .month-turner strong { min-width: 150px; font-size: 18px; }
    .editor-meta { align-items: flex-start; flex-direction: column; gap: 2px; }
}

@media (orientation: landscape) and (max-height: 520px) {
    .drawer { align-items: flex-start; }
    .mobile-bottom-nav { height: calc(58px + env(safe-area-inset-bottom)); }
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

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