:root {
    --blush: #f9e4e7;
    --blush-deep: #f2ccd2;
    --cream: #fbf3e9;
    --ivory: #fffaf4;
    --rose: #c98a95;
    --rose-deep: #b06b78;
    --plum: #4a2f3d;
    --plum-soft: #6b4c5c;
    --gold: #c9a24b;
    --gold-soft: #e3c680;
    --ink: #4a2f3d;
    --line: rgba(74,47,61,0.10);
    --shadow-sm: 0 2px 10px rgba(176,107,120,0.10);
    --shadow-md: 0 10px 30px rgba(176,107,120,0.14), 0 2px 8px rgba(74,47,61,0.06);
    --shadow-lg: 0 20px 48px rgba(176,107,120,0.20), 0 4px 14px rgba(74,47,61,0.08);
    --shadow-glow: 0 0 0 1px rgba(201,162,75,0.25), 0 0 24px rgba(201,162,75,0.22);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 11px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

[x-cloak] { display: none !important; }

::selection { background: var(--rose); color: #fff; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Jost', sans-serif;
    font-size: 16.5px;
    background-color: var(--cream);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cpath d='M28 42c-10-7-17-13.4-17-20.4C11 15.9 15.2 12 20.2 12c3.1 0 6 1.6 7.8 4.3 1.8-2.7 4.7-4.3 7.8-4.3 5 0 9.2 3.9 9.2 9.6 0 7-7 13.4-17 20.4z' fill='%23c98a95' fill-opacity='0.30'/%3E%3Cpath d='M128 100c-7-5-11.6-9.4-11.6-14.5 0-3.6 3-6.5 6.6-6.5 2.2 0 4.3 1.1 5.4 3 1.1-1.9 3.2-3 5.4-3 3.6 0 6.6 2.9 6.6 6.5 0 5.1-4.6 9.5-11.6 14.5z' fill='%23b06b78' fill-opacity='0.22'/%3E%3C/svg%3E"),
        radial-gradient(1300px 750px at 12% -8%, rgba(249,228,231,0.9), transparent 60%),
        radial-gradient(950px 620px at 108% 8%, rgba(227,198,128,0.3), transparent 55%),
        linear-gradient(175deg, var(--ivory) 0%, var(--blush) 55%, var(--cream) 100%);
    background-position: 0 0, 0 0, 0 0, 0 0;
    background-size: 170px 170px, auto, auto, auto;
    background-repeat: repeat, no-repeat, no-repeat, no-repeat;
    background-attachment: fixed;
    color: var(--ink);
    min-height: 100vh;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Cormorant Garamond', serif;
    color: var(--plum);
    line-height: 1.2;
    letter-spacing: 0.005em;
}

h1 { font-size: clamp(2.2rem, 1.8rem + 1.6vw, 3rem); font-weight: 700; margin: 0 0 0.5rem; }
h2 {
    font-size: clamp(1.55rem, 1.35rem + 0.7vw, 1.95rem);
    font-weight: 600;
    margin: 2.75rem 0 1rem;
    position: relative;
    padding-left: 1rem;
}
h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.2em;
    bottom: 0.2em;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--rose), var(--gold));
}
h3 { font-size: 1.35rem; font-weight: 600; margin: 0 0 0.4rem; }

p { margin: 0 0 0.85rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--rose-deep); text-decoration: none; }

/* ---------- Page entrance ---------- */
.page-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2.25rem 1.5rem 4rem;
    animation: fade-in-up 0.6s var(--ease);
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .grid > * {
    animation: card-in 0.55s var(--ease) both;
}
.grid > *:nth-child(2) { animation-delay: 0.04s; }
.grid > *:nth-child(3) { animation-delay: 0.08s; }
.grid > *:nth-child(4) { animation-delay: 0.12s; }
.grid > *:nth-child(5) { animation-delay: 0.16s; }
.grid > *:nth-child(6) { animation-delay: 0.2s; }
.grid > *:nth-child(n+7) { animation-delay: 0.24s; }

@keyframes card-in {
    from { opacity: 0; transform: translateY(8px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .page-container, .card, .grid > * { animation: none !important; }
}

/* ---------- Nav ---------- */
.site-nav {
    background: rgba(255,250,244,0.82);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px) saturate(1.5);
    -webkit-backdrop-filter: blur(12px) saturate(1.5);
}

.nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
}

.brand {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    font-size: 1.55rem;
    margin-right: auto;
    color: var(--plum);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.brand-icon { width: 1.6rem; height: 1.6rem; border-radius: 50%; box-shadow: 0 2px 6px rgba(176,107,120,0.3); }

.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.35rem; font-size: 0.92rem; }
.nav-links a {
    opacity: 0.75;
    transition: opacity 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-weight: 500;
    color: var(--plum-soft);
}
.nav-links a:hover { opacity: 1; background: rgba(201,138,149,0.14); text-decoration: none; color: var(--rose-deep); }

.logout-form { margin: 0 0 0 0.25rem; display: inline-flex; }
.logout-form button {
    background: none;
    border: none;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--plum-soft);
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    opacity: 0.75;
    transition: opacity 0.18s var(--ease), background 0.18s var(--ease);
}
.logout-form button:hover { opacity: 1; background: rgba(176,107,120,0.14); color: var(--rose-deep); }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--plum);
    border-radius: 2px;
    transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

/* ---------- Cards ---------- */
.card {
    background: rgba(255,250,244,0.9);
    border: 1px solid rgba(255,255,255,0.7);
    border-radius: var(--radius-lg);
    padding: 1.7rem 1.9rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.4rem;
    transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease), border-color 0.3s var(--ease);
}

.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: rgba(201,138,149,0.4); }

.intro-card {
    background: linear-gradient(135deg, var(--ivory) 0%, var(--blush) 170%);
    border: 1px solid rgba(201,162,75,0.35);
    position: relative;
    overflow: hidden;
}
.intro-card::after {
    content: "♥";
    position: absolute;
    right: -0.6rem;
    bottom: -1.3rem;
    font-size: 8.5rem;
    color: rgba(201,162,75,0.10);
    line-height: 1;
    pointer-events: none;
}

/* ---------- Locked card: sealed envelope ---------- */
.card-locked {
    background: linear-gradient(160deg, #fffaf4 0%, var(--blush-deep) 220%);
    text-align: center;
    border: 1px solid rgba(201,162,75,0.3);
    position: relative;
    overflow: hidden;
    animation: glow-pulse 3.6s ease-in-out infinite;
}
.card-locked::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.5) 50%, transparent 60%);
    background-size: 220% 220%;
    background-position: -40% -40%;
    pointer-events: none;
    opacity: 0.7;
    animation: shimmer 5.5s ease-in-out infinite;
}
.card-locked:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(201,162,75,0.16), 0 8px 22px rgba(176,107,120,0.14); }
    50% { box-shadow: 0 0 0 1px rgba(201,162,75,0.32), 0 8px 26px rgba(201,162,75,0.22); }
}
@keyframes shimmer {
    0% { background-position: -60% -60%; }
    100% { background-position: 160% 160%; }
}

.envelope {
    width: 4.6rem;
    height: 3.4rem;
    margin: 0 auto 0.85rem;
    position: relative;
    border-radius: 6px;
    background: linear-gradient(160deg, #fff 0%, #fbeef0 100%);
    border: 1.5px solid rgba(201,162,75,0.45);
    box-shadow: 0 4px 10px rgba(176,107,120,0.18);
}
.envelope::before,
.envelope::after {
    content: "";
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    border-top: 1.7rem solid rgba(201,162,75,0.28);
}
.envelope::before { left: 0; border-right: 2.3rem solid transparent; }
.envelope::after { right: 0; border-left: 2.3rem solid transparent; }
.envelope-seal {
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, var(--gold-soft), var(--rose-deep) 75%);
    color: #fff8ee;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(74,47,61,0.35);
    z-index: 1;
}

.teaser { font-style: italic; opacity: 0.7; }

.unlock-date {
    font-size: 0.82rem;
    opacity: 0.65;
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    background: rgba(201,162,75,0.12);
    color: var(--plum-soft);
}

.empty-state { text-align: center; padding: 3rem 1.5rem; }

.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--rose-deep) 0%, var(--plum) 100%);
    color: #fffaf4;
    border: none;
    border-radius: 999px;
    padding: 0.72rem 1.8rem;
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: 0.96rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(176,107,120,0.28);
    transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease), filter 0.2s var(--ease);
}

.btn:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(176,107,120,0.34); }
.btn:active { transform: translateY(0); }

label { display: block; font-size: 0.85rem; font-weight: 600; opacity: 0.75; margin: 0 0 0.3rem; color: var(--plum-soft); }

input[type=text], input[type=password], input[type=date], textarea, select {
    width: 100%;
    padding: 0.75rem 0.95rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid rgba(176,107,120,0.22);
    background: #fffdfa;
    font-family: 'Jost', sans-serif;
    font-size: 0.98rem;
    margin-bottom: 0.9rem;
    color: var(--ink);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input[type=text]:focus, input[type=password]:focus, input[type=date]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--rose);
    box-shadow: 0 0 0 4px rgba(201,138,149,0.18);
}
input[type=file] {
    width: 100%;
    margin-bottom: 0.9rem;
    font-size: 0.9rem;
}

.messages { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.message {
    padding: 0.75rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    background: var(--blush);
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
    color: var(--plum);
}
.message.success { background: #e4f1e2; color: #2f5c33; }
.message.error { background: #f8d9dc; color: #7a2530; }

.login-wrap {
    max-width: 400px;
    margin: 6vh auto;
    text-align: center;
}
.login-wrap h1 { margin-bottom: 0.35rem; }
.login-wrap .teaser { display: block; margin-bottom: 1.75rem; }
.login-wrap .card { text-align: left; }
.login-wrap .btn { width: 100%; text-align: center; margin-top: 0.25rem; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

/* Equal-height cards with the trailing button/unlock-date pinned to the
   bottom, so cards of different content length still align symmetrically. */
.grid > .card {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.grid > .card > .btn {
    margin-top: auto;
    align-self: flex-start;
}
.grid > .card.card-locked > .unlock-date {
    margin-top: auto;
    align-self: center;
}
.grid > .card:not(.card-locked) > .unlock-date {
    margin-top: auto;
    align-self: flex-start;
}

.progress-bar-outer {
    background: rgba(176,107,120,0.14);
    border-radius: 999px;
    height: 14px;
    overflow: hidden;
    margin: 0.85rem 0;
    box-shadow: inset 0 1px 3px rgba(74,47,61,0.14);
}
.progress-bar-inner {
    background: linear-gradient(90deg, var(--rose), var(--gold));
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s var(--ease);
}

.letter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 0.6rem;
}
.letter-tile {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    background: #fffdfa;
    border: 2px solid rgba(176,107,120,0.18);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    width: 100%;
    text-decoration: none;
    transition: transform 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.letter-tile small {
    display: block;
    font-family: 'Jost', sans-serif;
    font-size: 0.72rem;
    line-height: 1;
    margin-top: 0.2rem;
}
.letter-tile-link { flex-direction: column; color: inherit; }
.letter-tile:hover { transform: translateY(-3px) scale(1.04); box-shadow: var(--shadow-md); }
.letter-tile.opened { background: linear-gradient(135deg, var(--rose), var(--rose-deep)); color: #fff; border-color: var(--rose-deep); }
.letter-tile.today {
    border-color: var(--gold);
    box-shadow: var(--shadow-glow);
    background: linear-gradient(135deg, #fffdfa 0%, #fff5d8 160%);
}
.letter-tile.locked { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.letter-tile.locked:hover { transform: none; }
.letter-tile.locked.builder-preview {
    opacity: 1;
    cursor: pointer;
    border-style: dashed;
    border-color: rgba(201,162,75,0.5);
    color: var(--gold);
}
.letter-tile.locked.builder-preview:hover { transform: translateY(-3px) scale(1.04); box-shadow: var(--shadow-md); }
.letter-tile.big { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,75,0.18); }

.letter-tile-wrap { position: relative; }
.letter-status-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    background: var(--gold);
    color: #fff;
    border: 2px solid var(--ivory);
    box-shadow: 0 2px 5px rgba(74,47,61,0.3);
    cursor: pointer;
    padding: 0;
    transition: transform 0.18s var(--ease);
}
.letter-status-badge:hover { transform: scale(1.15); }
.letter-status-badge--done { background: var(--rose-deep); cursor: default; }
.letter-status-badge--done:hover { transform: none; }
.letter-today-label {
    position: absolute;
    left: 50%;
    bottom: -0.55rem;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    color: #fff;
    background: var(--gold);
    border-radius: 999px;
    padding: 0.22rem 0.45rem;
    box-shadow: 0 2px 5px rgba(74,47,61,0.22);
}
.letter-lock-note {
    font-size: 0.68rem;
    line-height: 1.25;
    opacity: 0.65;
    text-align: center;
    margin-top: -0.25rem;
}
.letter-type-label {
    display: block;
    font-size: 0.62rem;
    line-height: 1.2;
    text-align: center;
    opacity: 0.7;
    color: var(--plum-soft);
    margin-top: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.countdown-big {
    text-align: center;
    padding: 3rem 1.5rem;
    background: linear-gradient(160deg, var(--ivory), var(--blush) 180%);
}
.countdown-big .digits {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
    font-weight: 700;
    background: linear-gradient(120deg, var(--plum), var(--rose-deep), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 0.01em;
}

.gallery-tile { padding: 0.6rem; overflow: hidden; }
.gallery-tile img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    transition: transform 0.45s var(--ease);
}
.gallery-tile:hover img { transform: scale(1.05); }
.gallery-tile p { margin-top: 0.6rem; font-size: 0.9rem; }

/* ---------- Milestone timeline ---------- */
.timeline-strip {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding: 0.5rem 0.25rem 1.75rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.timeline-card, .timeline-card-wrap {
    flex: 0 0 auto;
    width: 270px;
    scroll-snap-align: start;
}

.timeline-card {
    margin-bottom: 0;
    border-top: 4px solid var(--plum);
}

.timeline-card--past { border-top-color: #c9b3bb; }
.timeline-card--present { border-top-color: var(--rose-deep); box-shadow: var(--shadow-lg); }
.timeline-card--future { border-top-color: var(--rose); }
.timeline-card--milestone { border-top-color: var(--gold); }

.timeline-kind {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.62;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--plum-soft);
}

.timeline-card-wrap .card-locked { height: 100%; }

/* scrollbar polish for timeline */
.timeline-strip::-webkit-scrollbar { height: 8px; }
.timeline-strip::-webkit-scrollbar-track { background: transparent; }
.timeline-strip::-webkit-scrollbar-thumb { background: rgba(176,107,120,0.24); border-radius: 999px; }

/* Love wall images */
.card img[style*="max-width"] { box-shadow: var(--shadow-sm); margin-top: 0.6rem; }

/* ---------- Responsive ---------- */

/* iPad landscape / small desktop */
@media (max-width: 1024px) {
    .page-container { max-width: 100%; }
}

/* iPad portrait */
@media (max-width: 768px) {
    .nav-inner { padding: 0.75rem 1.1rem; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); }
    .timeline-card, .timeline-card-wrap { width: 230px; }
    .page-container { padding: 1.75rem 1.25rem 3.5rem; }
}

/* Mobile */
@media (max-width: 600px) {
    .countdown-big { padding: 2.25rem 1.25rem; }
    .countdown-big .digits { font-size: 1.7rem; }

    .nav-toggle { display: flex; }

    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.3rem;
        padding-top: 0.6rem;
        border-top: 1px solid var(--line);
        margin-top: 0.5rem;
    }
    .nav-links a, .logout-form { width: 100%; }
    .nav-links a { padding: 0.6rem 0.7rem; }
    .logout-form button { width: 100%; text-align: left; padding: 0.6rem 0.7rem; }
    .nav-links.nav-links--open { display: flex; }

    .page-container { padding: 1.35rem 1rem 2.75rem; }
    .card { padding: 1.3rem 1.35rem; border-radius: var(--radius-md); }
    h1 { font-size: 1.9rem; }
    h2 { margin: 2rem 0 0.85rem; }

    .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.9rem; }
    .timeline-card, .timeline-card-wrap { width: 80vw; max-width: 270px; }
    .login-wrap { margin: 3vh auto; }
}

@media (min-width: 601px) {
    .nav-links { display: flex !important; }
}

/* ---------- Builder mode ---------- */
.builder-toggle-form { margin: 0 0 0 0.25rem; display: inline-flex; }
.builder-toggle-btn {
    background: rgba(201,162,75,0.14);
    border: 1px solid rgba(201,162,75,0.4);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold);
    cursor: pointer;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.builder-toggle-btn:hover { background: rgba(201,162,75,0.24); }
.builder-toggle-btn.is-on { background: var(--gold); border-color: var(--gold); color: #fff; }

.builder-banner {
    background: linear-gradient(90deg, var(--gold-soft), var(--gold));
    color: #4a2f0d;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
}

.builder-editable {
    outline: 1.5px dashed rgba(201,162,75,0.5);
    outline-offset: 3px;
    border-radius: 6px;
    cursor: text;
    transition: background 0.2s var(--ease), outline-color 0.2s var(--ease);
}
.builder-editable:hover { background: rgba(201,162,75,0.08); }
.builder-editable:focus { outline: 2px solid var(--gold); background: rgba(201,162,75,0.12); }
.builder-editable.builder-saved { outline: 2px solid #4caf6f; background: rgba(76,175,111,0.12); }
.builder-editable.builder-error { outline: 2px solid #c94848; background: rgba(201,72,72,0.1); }

.builder-add-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold);
    border: 1.5px dashed rgba(201,162,75,0.5);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    margin: 0.5rem 0 1rem;
}
.builder-add-link:hover { background: rgba(201,162,75,0.1); text-decoration: none; }

.builder-jar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.builder-jar-table-wrap {
    overflow-x: auto;
    background: rgba(255,250,244,0.92);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255,255,255,0.7);
}
.builder-jar-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.builder-jar-table th,
.builder-jar-table td {
    border-bottom: 1px solid var(--line);
    padding: 0.55rem;
    vertical-align: top;
}
.builder-jar-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    background: var(--ivory);
    color: var(--plum-soft);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.builder-jar-table input,
.builder-jar-table select,
.builder-jar-table textarea {
    min-width: 120px;
    margin: 0;
    padding: 0.45rem 0.55rem;
    font-size: 0.84rem;
}
.builder-jar-table textarea {
    min-height: 2.4rem;
    resize: vertical;
}
.builder-jar-table .builder-jar-content {
    width: 260px;
    min-height: 9rem;
}
.builder-jar-table details summary {
    cursor: pointer;
    color: var(--rose-deep);
    font-weight: 600;
}

.builder-photo-edit {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(74,47,61,0.75);
    color: #fff;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.95rem;
}
.builder-photo-edit:hover { background: var(--gold); }

/* ---------- Landing / welcome stepper ---------- */
.landing-stepper {
    max-width: 560px;
    margin: 4vh auto 0;
}
.landing-slide {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, var(--ivory) 0%, var(--blush) 170%);
    border: 1px solid rgba(201,162,75,0.3);
}
.landing-slide h1 { margin-bottom: 1rem; }
.landing-slide[data-edit], .landing-slide .builder-editable { text-align: left; }

.landing-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.25rem 0;
}
.landing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(176,107,120,0.25);
    transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.landing-dot.is-active { background: var(--rose-deep); transform: scale(1.3); }

.landing-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

/* ---------- Birthday letter-opening reveal ---------- */
.birthday-reveal {
    max-width: 480px;
    margin: 6vh auto 0;
    text-align: center;
}

.birthday-envelope {
    display: inline-block;
    width: 9rem;
    height: 6.5rem;
    position: relative;
    border-radius: 10px;
    background: linear-gradient(160deg, #fff 0%, #fbeef0 100%);
    border: 1.5px solid rgba(201,162,75,0.5);
    box-shadow: var(--shadow-lg);
    transition: transform 0.6s var(--ease), opacity 0.6s var(--ease);
}
.birthday-envelope::before,
.birthday-envelope::after {
    content: "";
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    border-top: 3.3rem solid rgba(201,162,75,0.3);
    transition: border-color 0.5s var(--ease);
}
.birthday-envelope::before { left: 0; border-right: 4.5rem solid transparent; }
.birthday-envelope::after { right: 0; border-left: 4.5rem solid transparent; }
.birthday-envelope.is-open {
    transform: translateY(-8px) scale(0.9);
    opacity: 0;
}

.birthday-seal {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.3rem;
    animation: birthday-pulse 1.4s ease-in-out infinite;
}

@keyframes birthday-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.12); }
}

.birthday-letter {
    width: 100%;
    text-align: center;
    margin-top: -1rem;
    background: linear-gradient(135deg, var(--ivory) 0%, var(--blush) 170%);
    border: 1px solid rgba(201,162,75,0.35);
}

/* ---------- "Today's the day" chapter celebration ---------- */
.card-celebrate {
    background: linear-gradient(135deg, var(--ivory) 0%, var(--blush-deep) 200%);
    border: 1.5px solid var(--gold);
    box-shadow: var(--shadow-glow);
    animation: glow-pulse 3.6s ease-in-out infinite;
}

.celebrate-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold);
    background: rgba(201,162,75,0.14);
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    margin-bottom: 0.6rem;
}

@keyframes envelope-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.landing-tap-envelope {
    padding: 0;
    outline: none;
    font: inherit;
    cursor: pointer;
    animation: envelope-pulse 2.2s ease-in-out infinite;
}
.landing-tap-envelope:hover { transform: scale(1.08); }
.birthday-letter .btn { margin-top: 1rem; }

.landing-tap-label {
    text-align: center;
    margin: 1.25rem 0 0;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--rose-deep);
    letter-spacing: 0.02em;
}

/* ---------- Capsule creation form ---------- */
.capsule-unlock-choice {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 0 1rem;
}
.capsule-radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
}
.capsule-radio input { width: auto; margin: 0; }
.capsule-date-fields {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.capsule-date-fields input { width: auto; margin-bottom: 0; }

/* ---------- Milestones connected path ---------- */
.path {
    max-width: 640px;
    margin: 0 auto;
}

.path-point {
    display: flex;
    gap: 1.1rem;
    align-items: stretch;
}

.path-line-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
}

.path-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--plum);
    border: 3px solid var(--ivory);
    box-shadow: 0 0 0 2px rgba(74,47,61,0.18);
    margin-top: 0.4rem;
    flex-shrink: 0;
}
.path-dot--past { background: #c9b3bb; }
.path-dot--present { background: var(--rose-deep); box-shadow: 0 0 0 4px rgba(176,107,120,0.25); }
.path-dot--future { background: var(--rose); }
.path-dot--milestone { background: var(--gold); }

.path-line {
    width: 3px;
    flex: 1 1 auto;
    background: linear-gradient(180deg, rgba(176,107,120,0.35), rgba(201,162,75,0.35));
    margin: 0.15rem 0;
    border-radius: 999px;
    min-height: 2.25rem;
}

.path-card {
    flex: 1 1 auto;
    margin-bottom: 1.4rem;
    min-width: 0;
}
.path-card .card { margin-bottom: 0; }

/* ---------- Time Capsule cards ---------- */
.capsule-card {
    display: block;
    text-align: center;
    color: inherit;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.32s var(--ease), transform 0.32s var(--ease), border-color 0.32s var(--ease);
}
.capsule-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.55) 50%, transparent 60%);
    background-size: 220% 220%;
    background-position: -60% -60%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
}
.capsule-card:hover {
    text-decoration: none;
    transform: translateY(-5px) scale(1.015);
    border-color: rgba(201,162,75,0.5);
    box-shadow: var(--shadow-glow);
}
.capsule-card:hover::before {
    opacity: 1;
    animation: shimmer 1.1s ease-in-out;
}

.capsule-card-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.7rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff8ee;
    background: radial-gradient(circle at 35% 30%, var(--gold-soft), var(--rose-deep) 75%);
    box-shadow: 0 3px 8px rgba(74,47,61,0.3);
    transition: transform 0.32s var(--ease);
}
.capsule-card:hover .capsule-card-icon { transform: scale(1.12) rotate(-4deg); }
.capsule-card--opened .capsule-card-icon {
    background: radial-gradient(circle at 35% 30%, #c9dfc9, #8fae8f 75%);
}

/* ---------- Love Jar: mood picker, tutorial, diary, special day ---------- */
.btn--ghost {
    background: none;
    box-shadow: none;
    border: 1.5px solid var(--rose);
    color: var(--rose-deep);
}
.btn--ghost:hover { background: rgba(201,138,149,0.08); filter: none; box-shadow: none; }
.btn--small { padding: 0.45rem 1.1rem; font-size: 0.85rem; box-shadow: none; }

.jar-tutorial-list { margin: 0.5rem 0 1rem; padding-left: 1.2rem; }
.jar-tutorial-list li { margin-bottom: 0.4rem; }

.jar-special-day {
    background: linear-gradient(135deg, var(--ivory) 0%, #fff5d8 160%);
    border-color: rgba(201,162,75,0.45);
    text-align: center;
    box-shadow: var(--shadow-glow);
}
.jar-special-day h3 { color: var(--plum); }
.jar-special-day .btn { margin-top: 0.5rem; }

.mood-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.85rem;
    margin: 1rem 0 1.1rem;
}
.mood-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1.1rem 0.8rem;
    border-radius: var(--radius-md);
    border: 1.5px solid rgba(176,107,120,0.22);
    background: #fffdfa;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font-family: 'Jost', sans-serif;
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.mood-tile:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--rose); }
.mood-tile-icon { font-size: 1.6rem; line-height: 1; }
.mood-tile-label { font-weight: 600; color: var(--plum); }
.mood-tile-count { font-size: 0.72rem; opacity: 0.65; }
.mood-tile--empty { opacity: 0.45; cursor: not-allowed; }
.mood-tile--empty:hover { transform: none; box-shadow: var(--shadow-sm); }

.mood-tile--active { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--rose); }

.mood-result { margin-top: 0.4rem; }
.mood-result-card {
    background: linear-gradient(135deg, var(--blush) 0%, var(--ivory) 160%);
    border: 1.5px solid rgba(201,162,75,0.35);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    animation: card-in 0.4s var(--ease) both;
}
.mood-result-card--empty { background: #fffdfa; border-color: rgba(176,107,120,0.2); }
.mood-result-copy { font-style: italic; font-size: 1.05rem; color: var(--plum-soft); margin-bottom: 0.6rem; }
.mood-result-number {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--plum);
    margin-bottom: 0.85rem;
}
.mood-result-number strong { color: var(--rose-deep); }
.mood-remaining { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin-top: 0.5rem; }
.mood-remaining-chip {
    background: var(--blush);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.78rem;
    color: var(--plum-soft);
}

.jar-surprise-row { margin-top: 1rem; text-align: center; }

.diary-list { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.6rem; }
.diary-entry {
    background: #fffdfa;
    border: 1px solid rgba(176,107,120,0.14);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.1rem;
}
.diary-entry-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.3rem;
}
.diary-entry-date { font-size: 0.75rem; opacity: 0.55; flex: 1; }
.diary-heart {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: rgba(176,107,120,0.35);
    cursor: pointer;
    transition: transform 0.18s var(--ease), color 0.18s var(--ease);
}
.diary-heart:hover { transform: scale(1.2); }
.diary-heart.is-hearted { color: var(--rose-deep); }
.diary-note { font-style: italic; color: var(--plum-soft); margin: 0.2rem 0 0.4rem; }

/* Builder moods legend */
.builder-jar-toolbar p { margin-bottom: 0.6rem; }
