/* ─── Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=Great+Vibes&family=Noto+Naskh+Arabic:wght@400;500&display=swap');

/* ─── Custom properties ──────────────────────────────────── */
:root {
    --bg:           #f5efe6;
    --bg-modal:     #ede7dd;
    --green-dk:     #2d5a27;
    --green-md:     #4a7c42;
    --green-lt:     #6b9e62;
    --green-pale:   #c5d9c2;
    --border:       rgba(45, 90, 39, 0.32);
    --text:         #1a1a1a;
    --text-green:   #2d5a27;
    --red-err:      #b03030;
    --font-display: 'Cinzel', serif;
    --font-script:  'Great Vibes', cursive;
    --font-body:    'Cormorant Garamond', serif;
    --font-arabic:  'Noto Naskh Arabic', 'Georgia', serif;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 50% 50%, transparent 38%, rgba(168,132,80,0.1) 100%),
        url("data:image/svg+xml,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/></filter><rect width='200' height='200' filter='url(%23n)' opacity='0.048'/></svg>");
    background-size: cover, 200px 200px;
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

#app { width: 100%; height: 100%; }

/* ─── Petal canvas ───────────────────────────────────────── */
#petalCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    display: block;
}

/* ─── Botanical corner decorations ──────────────────────── */
.corner {
    position: fixed;
    width: 200px;
    height: 200px;
    z-index: 1;
    pointer-events: none;
}

.corner-tl { top: 0; left: 0; }
.corner-tr { top: 0; right: 0; }
.corner-bl { bottom: 0; left: 0; }
.corner-br { bottom: 0; right: 0; }

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;   /* column so margin:auto on child works safely */
    align-items: center;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.6rem, 1.6vh, 1.15rem);
    text-align: center;
    max-width: 640px;
    width: 100%;
    margin: auto 0;           /* centers when it fits; no top-clip when it doesn't */
}

/* ─── Bismillah ──────────────────────────────────────────── */
.bismillah {
    font-family: var(--font-arabic);
    font-size: clamp(1.8rem, 5vw, 2.9rem);
    color: var(--green-dk);
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.5;
    margin-bottom: 0.1rem;
}

/* ─── Invite top text ────────────────────────────────────── */
.invite-love {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: var(--green-md);
    font-weight: 300;
    letter-spacing: 0.08em;
}

.engagement-word {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 6vw, 3.2rem);
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--green-dk);
    line-height: 1.05;
    text-shadow: 0 1px 0 rgba(45, 90, 39, 0.12);
}

/* ─── Ornament ───────────────────────────────────────────── */
.ornament {
    font-size: clamp(0.65rem, 1.3vw, 0.85rem);
    letter-spacing: 0.55em;
    color: var(--green-md);
    opacity: 0.75;
}

/* ─── Names ──────────────────────────────────────────────── */
.names {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    line-height: 1;
}

.name {
    font-family: var(--font-script);
    font-size: clamp(3.2rem, 10vw, 6.8rem);
    color: var(--green-dk);
    line-height: 1.1;
    font-weight: 400;
    text-shadow: 0 1px 0 rgba(45, 90, 39, 0.1);
}

.ampersand {
    font-family: var(--font-script);
    font-size: clamp(2.4rem, 6.5vw, 5rem);
    color: var(--green-md);
    line-height: 0.9;
    font-weight: 400;
    display: block;
    text-align: center;
}

/* ─── Couple photo ───────────────────────────────────────── */
.couple-photo {
    width: clamp(140px, 26vw, 300px);
    height: clamp(140px, 26vw, 300px);
    border-radius: 50%;
    border: 2.5px solid var(--green-dk);
    object-fit: cover;
    box-shadow: 0 6px 28px rgba(45, 90, 39, 0.18);
    animation: photoPulse 4s ease-in-out infinite;
}

@keyframes photoPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 6px 28px rgba(45, 90, 39, 0.18);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 8px 36px rgba(45, 90, 39, 0.28);
    }
}

/* ─── Divider ────────────────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: min(320px, 80vw);
    margin: 0.1rem 0;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--green-md) 40%, var(--green-dk) 50%, var(--green-md) 60%, transparent);
}

.diamond {
    font-size: 0.5rem;
    color: var(--green-dk);
    transform: rotate(45deg);
    display: inline-block;
    line-height: 1;
    opacity: 0.7;
}

/* ─── Getting engaged ────────────────────────────────────── */
.getting-engaged {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(0.95rem, 2.2vw, 1.3rem);
    letter-spacing: 0.15em;
    color: var(--green-md);
    font-weight: 300;
}

/* ─── Countdown ──────────────────────────────────────────── */
.countdown {
    display: flex;
    align-items: flex-start;
    gap: clamp(0.5rem, 2vw, 1.4rem);
    margin: 0.3rem 0 0.1rem;
    background: rgba(45, 90, 39, 0.05);
    border: 1px solid var(--border);
    padding: clamp(0.6rem, 1.5vw, 1rem) clamp(1rem, 3vw, 2rem);
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 2ch;
}

.count {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 5vw, 3rem);
    font-weight: 600;
    color: var(--green-dk);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.unit-label {
    font-family: var(--font-body);
    font-size: clamp(0.48rem, 1vw, 0.62rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--green-md);
    font-weight: 400;
    white-space: nowrap;
}

.sep {
    font-family: var(--font-body);
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    color: var(--green-md);
    line-height: 1;
    margin-top: 0.2rem;
    opacity: 0.55;
}

/* ─── Date line ──────────────────────────────────────────── */
.date-line {
    font-family: var(--font-display);
    font-size: clamp(0.65rem, 1.5vw, 0.9rem);
    letter-spacing: 0.35em;
    color: var(--green-dk);
    font-weight: 400;
}

/* ─── Venue ──────────────────────────────────────────────── */
.venue {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.55rem 1.5rem;
    width: min(320px, 85vw);
}

.venue-time {
    font-family: var(--font-display);
    font-size: clamp(0.6rem, 1.3vw, 0.75rem);
    letter-spacing: 0.3em;
    color: var(--green-md);
    font-weight: 400;
}

.venue-name {
    font-family: var(--font-script);
    font-size: clamp(1.3rem, 3.5vw, 2rem);
    color: var(--green-dk);
    line-height: 1.2;
}

.venue-address {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(0.8rem, 1.8vw, 0.95rem);
    color: var(--green-md);
    font-weight: 300;
}

.maps-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.7rem;
    padding: 0.55rem 1.2rem;
    font-family: var(--font-display);
    font-size: clamp(0.65rem, 1.5vw, 0.78rem);
    letter-spacing: 0.18em;
    font-weight: 600;
    color: var(--green-dk);
    background: transparent;
    border: 1.5px solid var(--green-dk);
    border-radius: 2rem;
    text-decoration: none;
    transition: background 0.22s, color 0.22s;
}

.maps-btn:hover, .maps-btn:focus-visible {
    background: var(--green-dk);
    color: var(--bg);
}

.maps-pin {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

/* ─── RSVP button ────────────────────────────────────────── */
.rsvp-btn {
    font-family: var(--font-display);
    font-size: clamp(0.65rem, 1.3vw, 0.8rem);
    letter-spacing: 0.32em;
    font-weight: 600;
    color: var(--bg);
    background: var(--green-dk);
    border: none;
    padding: 0.85rem 3.2rem;
    cursor: pointer;
    margin-top: 0.3rem;
    transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
    box-shadow: 0 2px 16px rgba(45, 90, 39, 0.18);
}

.rsvp-btn:hover {
    background: var(--green-md);
    transform: translateY(-2px);
    box-shadow: 0 5px 22px rgba(45, 90, 39, 0.28);
}

.rsvp-btn:active { transform: translateY(0); }

.rsvp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ─── Two-button action row ──────────────────────────────── */
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 0.3rem;
}

.action-row .rsvp-btn { margin-top: 0; }

.rsvp-btn--outline {
    background: transparent;
    color: var(--green-dk);
    border: 1.5px solid var(--green-dk);
    box-shadow: none;
}

.rsvp-btn--outline:hover {
    background: rgba(45, 90, 39, 0.07);
    box-shadow: 0 3px 14px rgba(45, 90, 39, 0.14);
}

/* ─── Comments ticker ────────────────────────────────────── */
.comments-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 0.55rem 0 0.6rem;
    background: linear-gradient(transparent, rgba(245, 239, 230, 0.94) 28%);
    overflow: hidden;
    pointer-events: none;
}

.ticker-track {
    display: flex;
    width: max-content;
    animation: tickerScroll 28s linear infinite;
}

.ticker-item {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(0.75rem, 1.6vw, 0.88rem);
    color: var(--green-dk);
    opacity: 0.72;
    flex-shrink: 0;
    white-space: nowrap;
}

@keyframes tickerScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ─── Song search ────────────────────────────────────────── */
.search-input-wrap {
    position: relative;
}

.search-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    padding: 0.45rem 1.8rem 0.45rem 0;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
}

.search-input:focus { border-bottom-color: var(--green-dk); }
.search-input::placeholder { color: rgba(74, 124, 66, 0.38); }
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration { display: none; }

.search-spinner {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--green-md);
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

.search-group {
    display: flex;
    flex-direction: column;
}

.search-results {
    list-style: none;
    border: 1px solid var(--border);
    border-top: none;
    max-height: 220px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: -0.35rem;
    margin-bottom: 0.8rem;
}

@media (max-width: 600px) {
    .search-results { max-height: 190px; }
    .search-result { padding: 0.65rem 0.75rem; min-height: 52px; }
    .result-art { width: 36px; height: 36px; }
}

.search-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(45,90,39,0.12);
    user-select: none;
}

.search-result:last-child { border-bottom: none; }
.search-result:hover { background: rgba(45, 90, 39, 0.06); }

.result-art {
    width: 40px;
    height: 40px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 2px;
    opacity: 0.9;
}

.result-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    text-align: left;
    overflow: hidden;
}

.result-title {
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.result-artist {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-style: italic;
    color: var(--green-md);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selected-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--green-pale);
    background: rgba(45, 90, 39, 0.05);
    margin-bottom: 1rem;
}

.preview-art {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.preview-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    text-align: left;
    flex: 1;
    overflow: hidden;
}

.preview-title {
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--green-dk);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-artist {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-style: italic;
    color: var(--green-md);
}

.preview-clear {
    background: transparent;
    border: none;
    color: var(--green-md);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem;
    flex-shrink: 0;
    transition: color 0.2s;
}

.preview-clear:hover { color: var(--red-err); }

.no-song-error {
    color: var(--red-err);
    font-size: 0.78rem;
    font-family: var(--font-body);
    font-style: italic;
    margin-bottom: 0.6rem;
}

/* ─── Modal overlay ──────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(20, 35, 18, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ─── Modal box ──────────────────────────────────────────── */
.modal-box {
    background: var(--bg);
    border: 0.5px solid var(--green-dk);
    padding: clamp(1.6rem, 4.5vw, 2.8rem) clamp(1.4rem, 4vw, 2.4rem);
    width: min(520px, 96vw);
    max-height: 92dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 8px 50px rgba(30, 60, 25, 0.25);
    animation: slideUp 0.3s ease;
}

/* Mobile: full-screen modal anchored at the top so input stays above keyboard */
@media (max-width: 600px) {
    .modal-overlay {
        align-items: flex-start;
        padding: 0;
    }
    .modal-box {
        width: 100%;
        min-height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
        padding: 1.4rem 1.2rem 2rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-subtitle {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(0.85rem, 1.8vw, 1rem);
    color: var(--green-md);
    text-align: center;
    margin-top: -1rem;
    margin-bottom: 1.4rem;
    font-weight: 300;
}

.song-added-label {
    font-family: var(--font-script);
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    color: var(--green-dk);
    line-height: 1.2;
    margin-bottom: 0.1rem;
}

.song-added-by {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--green-md);
    margin-bottom: 0.6rem;
}

.song-added-sub {
    font-family: var(--font-display);
    font-size: clamp(0.6rem, 1.3vw, 0.75rem);
    letter-spacing: 0.2em;
    color: var(--green-md);
    margin-bottom: 1rem;
    opacity: 0.8;
}

.song-added-thanks {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    color: var(--text);
    font-style: italic;
}

.modal-title {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.6vw, 1.45rem);
    letter-spacing: 0.22em;
    color: var(--green-dk);
    text-align: center;
    font-weight: 400;
    margin-bottom: 1.6rem;
}

/* ─── Form fields ────────────────────────────────────────── */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
}

.form-field > label {
    font-family: var(--font-body);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--green-md);
    font-weight: 400;
}

.optional {
    font-style: italic;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.65;
    font-size: 0.95em;
}

.form-field input,
.form-field textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    padding: 0.45rem 0;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
}

.form-field input:focus,
.form-field textarea:focus { border-bottom-color: var(--green-dk); }

.form-field input::placeholder,
.form-field textarea::placeholder { color: rgba(74, 124, 66, 0.38); }

.form-field textarea { resize: none; }

.form-field input[type="number"]::-webkit-inner-spin-button,
.form-field input[type="number"]::-webkit-outer-spin-button { opacity: 0.4; }

/* ─── Radio group ────────────────────────────────────────── */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-top: 0.2rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    color: var(--text);
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}

.radio-label input[type="radio"] {
    accent-color: var(--green-dk);
    width: 14px;
    height: 14px;
    cursor: pointer;
    border: none;
    border-bottom: none;
    flex-shrink: 0;
}

/* ─── Validation messages ────────────────────────────────── */
.validation-message {
    color: var(--red-err);
    font-size: 0.78rem;
    font-family: var(--font-body);
    letter-spacing: 0.04em;
    font-style: italic;
}

/* ─── Submit error ───────────────────────────────────────── */
.submit-error {
    color: var(--red-err);
    font-family: var(--font-body);
    font-size: 0.88rem;
    text-align: center;
    margin-bottom: 0.6rem;
    font-style: italic;
}

.submit-btn { width: 100%; }

/* ─── Thank-you panel ────────────────────────────────────── */
.thank-you {
    text-align: center;
    padding: 0.5rem 0;
}

.ty-ornament {
    font-size: 2rem;
    color: var(--green-md);
    margin-bottom: 1rem;
    opacity: 0.75;
}

.thank-you h2 {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.6vw, 1.35rem);
    letter-spacing: 0.1em;
    color: var(--green-dk);
    font-weight: 400;
    margin-bottom: 0.9rem;
}

.thank-you p {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: var(--text);
    font-style: italic;
    line-height: 1.7;
    margin-bottom: 0.3rem;
}

/* ─── Blazor error UI ────────────────────────────────────── */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: #fff8f0;
    border: 0.5px solid var(--red-err);
    color: var(--red-err);
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 0.6rem 1.2rem;
    z-index: 9999;
    white-space: nowrap;
}

#blazor-error-ui .reload { color: var(--green-dk); margin-left: 0.5rem; }

/* ─── Loading screen ─────────────────────────────────────── */
#blazor-loading {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    gap: 1.6rem;
}

.loading-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.2rem, 3.5vw, 2rem);
    letter-spacing: 0.28em;
    color: var(--green-dk);
    font-weight: 400;
}

.loading-dots {
    display: flex;
    gap: 0.5rem;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green-md);
    animation: dotPulse 1.5s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.22s; }
.loading-dots span:nth-child(3) { animation-delay: 0.44s; }

@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0.25; transform: scale(0.75); }
    40%           { opacity: 1;    transform: scale(1.1);  }
}

/* ─── SVG calligraphic ampersand ────────────────────────── */
.amp-svg {
    height: clamp(2.6rem, 6vw, 4.8rem);
    width: auto;
    display: block;
    margin: 0 auto;
    overflow: visible;
}

/* ─── Add to Calendar button ─────────────────────────────── */
.calendar-btn {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(0.78rem, 1.6vw, 0.92rem);
    color: var(--green-md);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.1rem 0;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    transition: color 0.2s;
    letter-spacing: 0.04em;
}

.calendar-btn:hover { color: var(--green-dk); }

/* ─── Entrance animations ────────────────────────────────── */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.corner                          { animation: fadeIn 1.4s ease-out both; animation-delay: 0.2s; }
.hero-content > .bismillah       { animation: fadeSlideUp 0.8s ease-out both; animation-delay: 0.2s; }
.hero-content > .invite-love     { animation: fadeSlideUp 0.7s ease-out both; animation-delay: 0.4s; }
.hero-content > .engagement-word { animation: fadeSlideUp 0.8s ease-out both; animation-delay: 0.6s; }
.hero-content > .ornament        { animation: fadeSlideUp 0.6s ease-out both; animation-delay: 0.8s; }
.hero-content > .names           { animation: fadeSlideUp 0.9s ease-out both; animation-delay: 1.0s; }
.hero-content > .couple-photo    { animation: fadeSlideUp 0.8s ease-out both; animation-delay: 1.12s; }
.hero-content > .divider         { animation: fadeSlideUp 0.6s ease-out both; animation-delay: 1.25s; }
.hero-content > .getting-engaged { animation: fadeSlideUp 0.6s ease-out both; animation-delay: 1.4s; }
.hero-content > .countdown       { animation: fadeSlideUp 0.7s ease-out both; animation-delay: 1.6s; }
.hero-content > .date-line       { animation: fadeSlideUp 0.6s ease-out both; animation-delay: 1.8s; }
.hero-content > .venue           { animation: fadeSlideUp 0.6s ease-out both; animation-delay: 1.95s; }
.hero-content > .calendar-btn    { animation: fadeSlideUp 0.6s ease-out both; animation-delay: 2.1s; }
.hero-content > .action-row      { animation: fadeSlideUp 0.7s ease-out both; animation-delay: 2.25s; }

/* ─── Mobile tweaks ──────────────────────────────────────── */
@media (max-height: 700px) {
    .hero-content { gap: 0.45rem; }
    .countdown    { margin: 0; }
    .corner       { width: 140px; height: 140px; }
}

@media (max-width: 480px) {
    .corner { width: 130px; height: 130px; }
    .sep    { display: none; }
    .countdown { gap: 0.35rem; }
}

/* ─── Signature canvas ───────────────────────────────────── */
.sig-canvas-wrap {
    position: relative;
    border: 1px solid var(--border);
    background: rgba(245, 239, 230, 0.6);
    cursor: crosshair;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.sig-canvas {
    display: block;
    width: 100%;
    height: 150px;
    touch-action: none;
}

.sig-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(0.85rem, 2vw, 1rem);
    color: rgba(74, 124, 66, 0.22);
    letter-spacing: 0.12em;
    pointer-events: none;
    transition: opacity 0.25s;
}

.sig-canvas-wrap.has-content .sig-hint { opacity: 0; }

.sig-clear-btn {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 0.78rem;
    color: var(--green-md);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    letter-spacing: 0.06em;
    transition: color 0.2s;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    margin-bottom: 0.4rem;
    display: block;
}

.sig-clear-btn:hover { color: var(--red-err); }

.sig-result {
    display: block;
    width: min(340px, 88%);
    height: auto;
    margin: 0.8rem auto 1.2rem;
    border: 1px solid var(--border);
    background: rgba(245, 239, 230, 0.5);
}

/* ─── Envelope intro ─────────────────────────────────────── */
.env-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(245, 239, 230, 0.97);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

.env-overlay--fading {
    animation: envDissolve 0.55s ease 1.1s both;
    pointer-events: none;
}

@keyframes envDissolve {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.env-scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
    animation: fadeSlideUp 0.9s ease-out 0.15s both;
}

.env {
    width: clamp(240px, 55vw, 400px);
    height: clamp(162px, 37vw, 270px);
    position: relative;
    perspective: 1400px;
    filter: drop-shadow(0 6px 28px rgba(45, 90, 39, 0.16));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.env-overlay:not(.env-overlay--fading):hover .env {
    filter: drop-shadow(0 10px 38px rgba(45, 90, 39, 0.28));
    transform: translateY(-3px);
}

/* envelope body — rectangle with fold-line SVG */
.env-body {
    position: absolute;
    inset: 0;
    background: var(--bg);
    border: 1.5px solid var(--green-dk);
    z-index: 1;
    overflow: hidden;
}

.env-body svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* triangular flap — opens with rotateX */
.env-flap {
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 62%;
    transform-origin: top center;
    transform: rotateX(0deg);
    transition: transform 0.95s cubic-bezier(0.4, 0, 0.2, 1);
    backface-visibility: hidden;
    z-index: 2;
}

.env-flap svg {
    width: 100%;
    height: 100%;
    display: block;
}

.env--opening .env-flap {
    transform: rotateX(-180deg);
}

/* wax seal — sits at the flap/body junction */
.env-seal {
    position: absolute;
    top: 43%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(54px, 13vw, 76px);
    height: clamp(54px, 13vw, 76px);
    border-radius: 50%;
    background: var(--green-dk);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 3px 16px rgba(45, 90, 39, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: sealPulse 3.2s ease-in-out infinite;
}

.env--opening .env-seal {
    animation: none;
}

@keyframes sealPulse {
    0%, 100% { box-shadow: 0 3px 16px rgba(45, 90, 39, 0.45), inset 0 1px 0 rgba(255,255,255,0.08); }
    50%       { box-shadow: 0 5px 24px rgba(45, 90, 39, 0.62), inset 0 1px 0 rgba(255,255,255,0.08); }
}

.env-seal-text {
    font-family: var(--font-script);
    color: var(--bg);
    font-size: clamp(0.88rem, 2.1vw, 1.15rem);
    line-height: 1;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* "click to open" hint */
.env-hint {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(0.85rem, 2vw, 1rem);
    color: var(--green-md);
    letter-spacing: 0.14em;
    opacity: 0;
    animation: fadeIn 0.7s ease 1.3s both;
}

@media (max-width: 480px) {
    .env { width: 88vw; height: calc(88vw * 0.675); }
    .env-scene { gap: 1.3rem; }
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD  — private admin view at /dashboard
   ═══════════════════════════════════════════════════════════ */

/* Lock screen */
.db-lock-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--green-dk);
    margin: 0.4rem 0 0.2rem;
}
.db-lock-form {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.db-key-input {
    width: 100%;
    padding: 0.65rem 1rem;
    font-family: var(--font-body);
    font-size: 1.05rem;
    background: rgba(255,255,255,0.55);
    border: 1px solid var(--border);
    border-radius: 0.3rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.db-key-input:focus { border-color: var(--green-dk); }

/* Dashboard shell */
.db-shell {
    height: 100dvh;
    overflow: hidden;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

/* Header */
.db-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(245,239,230,0.96);
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
}
.db-back {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    color: var(--green-md);
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.db-back:hover { color: var(--green-dk); }
.db-header-center {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    justify-content: center;
}
.db-header-logo {
    font-family: var(--font-script);
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--green-dk);
    line-height: 1;
}
.db-header-sep { font-size: 0.65rem; color: var(--green-md); opacity: 0.7; }
.db-header-sub {
    font-family: var(--font-display);
    font-size: clamp(0.55rem, 1.2vw, 0.7rem);
    letter-spacing: 0.22em;
    color: var(--green-md);
    text-transform: uppercase;
}
.db-header-spacer { width: 80px; }

/* Tabs */
.db-tabs {
    flex-shrink: 0;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--bg);
    border-bottom: 2px solid var(--border);
    padding: 0 1rem;
}
.db-tabs::-webkit-scrollbar { display: none; }
.db-tab {
    flex-shrink: 0;
    padding: 0.7rem 1.2rem;
    font-family: var(--font-display);
    font-size: clamp(0.6rem, 1.3vw, 0.72rem);
    letter-spacing: 0.2em;
    font-weight: 600;
    color: var(--green-md);
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.db-tab:hover { color: var(--green-dk); }
.db-tab--active { color: var(--green-dk); border-bottom-color: var(--green-dk); }
.db-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4em;
    height: 1.4em;
    padding: 0 0.3em;
    font-size: 0.75em;
    font-family: var(--font-display);
    letter-spacing: 0;
    background: var(--green-dk);
    color: var(--bg);
    border-radius: 999px;
    line-height: 1;
}

/* Body */
.db-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem 1.5rem 4rem;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}
.db-spinner { display: flex; justify-content: center; padding: 4rem 0; }
.db-empty {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--green-md);
    text-align: center;
    padding: 3rem 0;
    opacity: 0.7;
}

/* Analytics stat cards */
.db-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.db-stat-card {
    background: rgba(255,255,255,0.55);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.2rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.db-stat-val {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 600;
    color: var(--green-dk);
    line-height: 1;
}
.db-stat-lbl {
    font-family: var(--font-display);
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    color: var(--green-md);
    text-transform: uppercase;
}

/* Analytics table */
.db-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.db-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: clamp(0.78rem, 1.3vw, 0.88rem);
    white-space: nowrap;
}
.db-table thead tr { background: var(--green-dk); color: var(--bg); }
.db-table th {
    padding: 0.65rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    font-weight: 600;
    text-align: left;
}
.db-table td { padding: 0.55rem 1rem; color: var(--text); border-bottom: 1px solid var(--border); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.db-table tbody tr:last-child td { border-bottom: none; }
.db-table tbody tr:nth-child(even) { background: rgba(45,90,39,0.04); }
.db-table tbody tr:hover { background: rgba(45,90,39,0.08); }

/* Songs */
.db-song-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.db-song-item {
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--border);
}
.db-song-item:last-child { border-bottom: none; }
.db-song-num { font-size: 1.1rem; color: var(--green-md); opacity: 0.7; flex-shrink: 0; padding-top: 0.1rem; }
.db-song-content { flex: 1; min-width: 0; }
.db-song-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.8rem; }
.db-song-title { font-family: var(--font-body); font-size: clamp(1rem, 2vw, 1.15rem); font-weight: 500; color: var(--text); }
.db-song-by { font-family: var(--font-body); font-style: italic; font-size: 0.92rem; color: var(--green-md); }
.db-song-meta { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-top: 0.25rem; }
.db-song-guest { font-family: var(--font-display); font-size: 0.65rem; letter-spacing: 0.12em; color: var(--green-dk); }
.db-song-note { font-family: var(--font-body); font-style: italic; font-size: 0.88rem; color: var(--text); opacity: 0.75; }
.db-song-date { font-family: var(--font-body); font-size: 0.8rem; color: var(--green-md); opacity: 0.6; margin-left: auto; }

/* Blessings */
.db-blessing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
}
.db-blessing-card {
    background: rgba(255,255,255,0.55);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.4rem 1.2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.db-blessing-orn { font-size: 0.85rem; color: var(--green-md); opacity: 0.6; margin: 0; }
.db-blessing-name { font-family: var(--font-display); font-size: 0.72rem; letter-spacing: 0.18em; color: var(--green-dk); font-weight: 600; margin: 0; }
.db-blessing-msg { font-family: var(--font-body); font-size: clamp(0.95rem, 1.6vw, 1.05rem); line-height: 1.55; color: var(--text); flex: 1; margin: 0; }
.db-blessing-date { font-family: var(--font-body); font-size: 0.78rem; color: var(--green-md); opacity: 0.55; margin: 0; text-align: right; }

/* Guestbook */
.db-sig-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
}
.db-sig-card { background: #fff; border: 1px solid var(--border); border-radius: 0.5rem; overflow: hidden; display: flex; flex-direction: column; }
.db-sig-img { width: 100%; height: 120px; object-fit: contain; background: #fff; border-bottom: 1px solid var(--border); padding: 0.5rem; box-sizing: border-box; }
.db-sig-img--click { cursor: zoom-in; }
.db-sig-empty-img { height: 120px; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--green-md); opacity: 0.3; border-bottom: 1px solid var(--border); }
.db-sig-name { font-family: var(--font-display); font-size: 0.68rem; letter-spacing: 0.16em; color: var(--green-dk); font-weight: 600; padding: 0.6rem 0.8rem 0.1rem; margin: 0; }
.db-sig-date { font-family: var(--font-body); font-size: 0.78rem; color: var(--green-md); opacity: 0.55; padding: 0 0.8rem 0.7rem; margin: 0; }

/* Responsive */
@media (max-width: 700px) {
    .db-header { padding: 0.65rem 1rem; }
    .db-header-spacer { display: none; }
    .db-header-center { justify-content: flex-start; }
    .db-header-logo { font-size: 1.15rem; }
    .db-body { padding: 1rem 0.85rem 3rem; }
    .db-stats { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin-bottom: 1.25rem; }
    .db-stat-card { padding: 0.9rem 0.75rem; }
    .db-stat-val { font-size: 1.6rem; }
    .db-table { font-size: 0.78rem; }
    .db-table th, .db-table td { padding: 0.45rem 0.7rem; }
    .db-blessing-grid { grid-template-columns: 1fr; }
    .db-sig-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .db-sig-img { height: 100px; }
    .db-song-date { margin-left: 0; width: 100%; }
    .db-back { font-size: 0.65rem; }
}
@media (max-width: 400px) {
    .db-header-sub { display: none; }
    .db-header-sep { display: none; }
    .db-stats { gap: 0.55rem; }
    .db-stat-card { padding: 0.75rem 0.6rem; }
    .db-tab { padding: 0.6rem 0.75rem; font-size: 0.58rem; }
    .db-sig-grid { grid-template-columns: 1fr; }
}
