/* ==========================================================================
   OFFER — the form is written as a letter
   ========================================================================== */

/* ---------- Hero status ---------- */
.offer-status {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    margin-top: 1.75rem;
    padding: .55rem 1.1rem .45rem;
    font-family: var(--font-ui);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--paper);
    border: 1px solid rgba(242, 209, 140, .3);
    border-radius: 999px;
    background: rgba(44, 11, 9, .45);
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #8fd07a;
    animation: statusPulse 2.4s ease-out infinite;
}
.status-dot.is-soon { background: var(--marigold); animation: none; }
.status-dot.is-closed { background: rgba(246, 238, 221, .45); animation: none; }

/* ---------- Layout ---------- */
.offer-section {
    padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(4rem, 9vw, 7rem);
}
.offer-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}
.offer-main { min-width: 0; }

/* ---------- Notices & closed ---------- */
.offer-notice {
    position: relative;
    margin-bottom: 1.75rem;
    padding: 1.1rem 1.4rem 1.1rem 4.2rem;
    background: var(--paper-2);
    border: 1px solid var(--paper-edge);
    border-radius: var(--radius);
    color: var(--ink-2);
}
.offer-notice::before {
    content: '';
    position: absolute;
    left: 1.3rem; top: 1.25rem;
    width: 34px; height: 23px;
    background: var(--marigold);
    -webkit-mask: var(--lotus) center / contain no-repeat;
    mask: var(--lotus) center / contain no-repeat;
}
.offer-notice p + p { margin-top: .3rem; }
.offer-notice strong { font-family: var(--font-display); font-weight: 600; color: var(--ink); }

.offer-closed {
    padding: clamp(2.25rem, 6vw, 4rem) clamp(1.5rem, 5vw, 3.5rem);
    text-align: center;
    background: var(--paper-hi);
    border: 1px solid var(--paper-edge);
    box-shadow: var(--shadow-paper);
}
.offer-closed .lotus-rule { max-width: 260px; margin: 0 auto 1.5rem; }
.closed-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    line-height: 1.1;
}
.offer-closed p {
    max-width: 32rem;
    margin: .9rem auto 1.9rem;
    color: var(--ink-2);
}

/* ---------- The sheet ---------- */
.letter-form { position: relative; }

.sheet {
    position: relative;
    padding: clamp(1.75rem, 5vw, 3.5rem) clamp(1.25rem, 5vw, 3.75rem) clamp(2rem, 5vw, 3rem);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .6), transparent 240px),
        var(--paper-hi);
    border-radius: 2px;
    box-shadow:
        0 0 0 1px rgba(217, 196, 157, .7),
        8px 8px 0 -1px var(--paper-2),
        8px 8px 0 0 var(--paper-edge),
        var(--shadow-lift);
}
.sheet::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(214, 162, 74, .26);
    pointer-events: none;
}

.sheet-head { text-align: center; margin-bottom: 2.25rem; }
.sheet-invocation {
    font-family: var(--font-deva);
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    line-height: 1.5;
    color: var(--kumkum);
}
.sheet-translation {
    margin-top: .2rem;
    font-style: italic;
    font-size: .98rem;
    line-height: 1.45;
    color: var(--ink-3);
}
.sheet-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem 1rem;
    margin-top: 1.4rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid var(--paper-edge);
}
.sheet-occasion {
    font-family: var(--font-ui);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.sheet-date { font-style: italic; color: var(--ink-3); }

.sheet-label,
.field-label {
    display: block;
    font-family: var(--font-ui);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-3);
    transition: color .2s ease;
}
.sheet-label { margin-bottom: .55rem; }
.field-label { margin-bottom: .35rem; }
.field:focus-within > .sheet-label,
.field:focus-within > .field-label { color: var(--kumkum); }
.optional {
    margin-left: .5rem;
    font-weight: 400;
    letter-spacing: .04em;
    text-transform: none;
}

/* Ruled writing area */
.field-letter { --rule: rgba(133, 105, 79, .26); --lh: 2.1rem; }
.field-letter:focus-within { --rule: rgba(242, 163, 58, .65); }
.field-letter.has-error { --rule: rgba(179, 38, 30, .45); }

#f-offering {
    display: block;
    width: 100%;
    min-height: calc(var(--lh) * 12);
    padding: 0 .2rem;
    font-family: var(--font-read);
    font-size: clamp(1.08rem, 1.5vw, 1.2rem);
    line-height: var(--lh);
    color: var(--ink);
    caret-color: var(--kumkum);
    background-color: transparent;
    background-image: linear-gradient(to bottom, transparent calc(var(--lh) - 1px), var(--rule) calc(var(--lh) - 1px), var(--rule) var(--lh));
    background-size: 100% var(--lh);
    background-attachment: local;
    border: 0;
    border-radius: 0;
    resize: none;
    overflow: hidden;
    transition: background-image .2s ease;
}
#f-offering:focus { outline: none; }
#f-offering::placeholder { font-style: italic; color: var(--ink-3); opacity: .8; }

.field-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .25rem 1rem;
    margin-top: .7rem;
    font-family: var(--font-ui);
    font-size: .82rem;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}
#f-offering-count.is-near { color: var(--kumkum); font-weight: 600; }
.draft-status { text-align: right; }
.draft-discard {
    font-weight: 600;
    color: var(--kumkum);
    border-bottom: 1px solid currentColor;
    line-height: 1.2;
}
.draft-discard:hover { color: var(--ink); }

/* Signature */
.sheet-sign {
    width: min(100%, 480px);
    margin: 2.75rem 0 0 auto;
    padding-top: 1.4rem;
    border-top: 1px solid var(--paper-edge);
}
.sign-label {
    display: block;
    text-align: right;
    font-style: italic;
    color: var(--ink-3);
}
.sheet input {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: .35rem .1rem .3rem;
    color: var(--ink);
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(133, 105, 79, .45);
    border-radius: 0;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.sheet input:focus {
    outline: none;
    border-bottom-color: var(--kumkum);
    box-shadow: 0 1px 0 var(--kumkum);
}
.sheet input::placeholder { color: var(--ink-3); opacity: .7; }
.field-name input {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 1.95rem);
    line-height: 1.2;
    text-align: right;
}
.field-name input::placeholder { font-family: var(--font-read); font-style: italic; font-weight: 300; }
.sign-place {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
    margin-top: 1.25rem;
}
.sign-place input { font-family: var(--font-read); font-size: 1.1rem; }

/* Place pickers — a searchable list that drops from the signature line like a slip of paper */
.cb { position: relative; }
.cb input { padding-right: 2rem; text-overflow: ellipsis; }
.cb.is-plain input { padding-right: .1rem; }
.cb.is-open input { border-bottom-color: var(--kumkum); }
.sheet input:disabled {
    color: var(--ink-3);
    border-bottom-style: dashed;
    cursor: not-allowed;
}
.sheet input:disabled::placeholder { font-style: italic; }
.cb-toggle {
    position: absolute;
    right: 0;
    bottom: 0;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 44px;
    color: var(--ink-3);
    transition: color .2s ease;
}
.cb-toggle[hidden] { display: none; }
.cb-toggle:hover { color: var(--kumkum); }
.cb-toggle svg { width: 12px; height: 12px; transition: transform .25s var(--ease-out); }
.cb.is-open .cb-toggle svg { transform: rotate(180deg); }
.cb:has(input:disabled) .cb-toggle { opacity: .4; pointer-events: none; }

.cb-pop {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    width: max(100%, 19.5rem);
    max-width: calc(100vw - 2.5rem);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .55), transparent 5rem),
        var(--paper-hi);
    border: 1px solid var(--paper-edge);
    border-top: 2px solid var(--marigold);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 2px 4px rgba(42, 25, 16, .06), 0 22px 40px -18px rgba(42, 25, 16, .45);
    transform-origin: top center;
    animation: slipIn .18s var(--ease-out);
}
.cb-pop[hidden] { display: none; }
.cb-end .cb-pop { left: auto; right: 0; }
.cb.opens-up .cb-pop {
    top: auto;
    bottom: calc(100% + 6px);
    border-top: 1px solid var(--paper-edge);
    border-bottom: 2px solid var(--marigold);
    border-radius: var(--radius) var(--radius) 0 0;
    transform-origin: bottom center;
}
.cb-list {
    max-height: 17rem;
    margin: 0;
    padding: .3rem 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: var(--paper-edge) transparent;
}
.cb-list[hidden] { display: none; }
.cb-option {
    position: relative;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem .9rem .5rem 1.25rem;
    font-family: var(--font-read);
    font-size: 1.02rem;
    line-height: 1.3;
    color: var(--ink);
    cursor: pointer;
}
.cb-option[aria-selected='true'] { background: rgba(242, 163, 58, .18); }
/* The marigold diamond that marks places elsewhere on the sheet, in kumkum for the one under the cursor */
.cb-option[aria-selected='true']::after {
    content: '';
    position: absolute;
    left: .5rem;
    top: calc(.5rem + .65em);
    width: 5px;
    height: 5px;
    background: var(--kumkum);
    transform: translateY(-50%) rotate(45deg);
}
.cb-main { min-width: 0; }
.cb-name b { font-weight: 600; color: var(--kumkum); }
.cb-option.is-current .cb-name::after {
    content: '✓';
    content: '✓' / '';
    margin-left: .45rem;
    font-family: var(--font-ui);
    font-size: .85em;
    color: var(--kumkum);
}
.cb-note {
    display: block;
    margin-top: .05rem;
    font-size: .84rem;
    font-style: italic;
    color: var(--ink-3);
}
.cb-detail {
    flex-shrink: 0;
    max-width: 48%;
    overflow: hidden;
    font-family: var(--font-ui);
    font-size: .74rem;
    letter-spacing: .05em;
    color: var(--ink-3);
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cb-option.has-divider { margin-top: .55rem; }
.cb-option.has-divider::before {
    content: '';
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: -.3rem;
    border-top: 1px solid var(--paper-edge);
}
/* "My town isn't in the list" — keep the devotee's own spelling */
.cb-option.is-typed {
    margin-top: .3rem;
    padding-top: .6rem;
    font-style: italic;
    border-top: 1px dashed var(--paper-edge);
}
.cb-option.is-typed .cb-name::before {
    content: '✎';
    content: '✎' / '';
    display: inline-block;
    margin-right: .4rem;
    font-style: normal;
    color: var(--kumkum);
}
.cb-option.is-typed .cb-note { font-style: normal; font-family: var(--font-ui); font-size: .78rem; letter-spacing: .02em; }
.cb-empty {
    margin: 0;
    padding: .85rem 1rem;
    font-style: italic;
    color: var(--ink-3);
}
.cb-empty[hidden] { display: none; }

.place-region {
    margin-top: .35rem;
    font-family: var(--font-ui);
    font-size: .76rem;
    letter-spacing: .08em;
    color: var(--ink-3);
}
.place-region::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    margin: 0 .45rem .12em 0;
    background: var(--marigold);
    transform: rotate(45deg);
}
.place-region:empty { display: none; }
.place-typed {
    margin-top: .45rem;
    font-size: .92rem;
    font-style: italic;
    line-height: 1.45;
    color: var(--ink-2);
}
.place-typed[hidden] { display: none; }
.place-relist {
    margin-left: .2rem;
    font-family: var(--font-ui);
    font-size: .82rem;
    font-style: normal;
    font-weight: 600;
    line-height: 1.2;
    color: var(--kumkum);
    border-bottom: 1px solid currentColor;
}
.place-relist[hidden] { display: none; }
.place-relist:hover { color: var(--ink); }

@keyframes slipIn {
    from { opacity: 0; transform: translateY(-4px) scaleY(.97); }
    to { opacity: 1; transform: none; }
}

.has-error input,
.sheet .has-error input { border-bottom-color: var(--kumkum); }
.field-error {
    margin-top: .4rem;
    font-family: var(--font-ui);
    font-size: .88rem;
    font-weight: 500;
    color: var(--kumkum);
}
.field-error:empty { display: none; }
.field-name .field-error { text-align: right; }
.name-hint {
    margin-top: .4rem;
    font-size: .92rem;
    line-height: 1.45;
    text-align: right;
}

/* ---------- Envelope (private details + send) ---------- */
.envelope {
    position: relative;
    display: grid;
    gap: 1.5rem;
    margin-top: 1.9rem;
    padding: calc(clamp(1.4rem, 4vw, 2rem) + 6px) clamp(1.25rem, 5vw, 2.5rem) clamp(1.4rem, 4vw, 2rem);
    background: var(--paper-2);
    border: 1px solid var(--paper-edge);
    border-radius: 2px;
    overflow: hidden;
}
/* Airmail edge — offerings travel from every corner of the world */
.envelope::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 6px;
    background: repeating-linear-gradient(135deg,
        var(--kumkum) 0 12px, transparent 12px 20px,
        var(--marigold) 20px 32px, transparent 32px 40px);
    opacity: .85;
}

.envelope input[type='email'] {
    display: block;
    width: 100%;
    max-width: 30rem;
    min-height: 48px;
    padding: .7rem .9rem .6rem;
    font-family: var(--font-ui);
    font-size: 1rem;
    color: var(--ink);
    background: var(--paper-hi);
    border: 1px solid var(--paper-edge);
    border-radius: var(--radius);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.envelope input[type='email']:focus {
    outline: none;
    border-color: var(--marigold);
    box-shadow: 0 0 0 3px rgba(242, 163, 58, .25);
}
.envelope .has-error input[type='email'] { border-color: var(--kumkum); }
.field-hint {
    margin-top: .45rem;
    font-size: .95rem;
    font-style: italic;
    color: var(--ink-3);
}

/* "Did you mean …@gmail.com?" */
.email-suggest {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .9rem;
    max-width: 30rem;
    margin-top: .65rem;
    padding: .7rem .9rem .75rem;
    background: var(--paper-hi);
    border: 1px dashed rgba(214, 162, 74, .85);
    border-radius: var(--radius);
}
.email-suggest:empty { display: none; }
.email-suggest p { flex: 1 1 100%; color: var(--ink-2); }
.email-suggest strong { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.email-suggest button {
    min-height: 36px;
    font-family: var(--font-ui);
    font-size: .86rem;
    font-weight: 600;
    line-height: 1.2;
}
.suggest-use {
    padding: .4rem .85rem .35rem;
    color: var(--paper-hi);
    background: var(--kumkum);
    border-radius: var(--radius);
    transition: background-color .2s ease;
}
.suggest-use:hover { background: var(--ink); }
.suggest-keep { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.suggest-keep:hover { color: var(--kumkum); }
.email-suggest.is-nudged {
    border-style: solid;
    border-color: var(--kumkum);
    animation: nudge .45s ease;
}
@keyframes nudge {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    60% { transform: translateX(4px); }
}

.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px; height: 1px;
    overflow: hidden;
}

.consent {
    position: relative;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: .85rem;
    align-items: start;
    max-width: 40rem;
    cursor: pointer;
    color: var(--ink-2);
    line-height: 1.5;
}
.consent input {
    position: absolute;
    left: 0; top: .15rem;
    width: 24px; height: 24px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.consent-box {
    position: relative;
    width: 24px; height: 24px;
    margin-top: .15rem;
    background: var(--paper-hi);
    border: 1.5px solid var(--ink-3);
    border-radius: 2px;
    transition: background-color .2s ease, border-color .2s ease;
    pointer-events: none;
}
.consent-box::after {
    content: '';
    position: absolute;
    left: 7px; top: 2px;
    width: 7px; height: 13px;
    border: solid var(--paper-hi);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform .25s var(--ease-out);
}
.consent input:checked + .consent-box { background: var(--kumkum); border-color: var(--kumkum); }
.consent input:checked + .consent-box::after { transform: rotate(45deg) scale(1); }
.consent input:focus-visible + .consent-box { outline: 2px solid var(--marigold); outline-offset: 3px; }
.field-consent.has-error .consent-box { border-color: var(--kumkum); }
.field-consent .field-error { padding-left: calc(24px + .85rem); }

.submit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    padding-top: .25rem;
}
.submit-row .btn.is-busy { cursor: progress; opacity: .85; }
.submit-row .btn.is-busy svg { animation: nudge 1s ease-in-out infinite; }
.form-status {
    flex: 1 1 240px;
    font-family: var(--font-ui);
    font-size: .95rem;
    color: var(--ink-2);
}
.form-status[data-kind='error'] { color: var(--kumkum); font-weight: 500; }

/* The offering is on its way: the dialog stays, with a quiet moving line above the buttons */
.confirm.is-sending { cursor: progress; }
.confirm.is-sending .confirm-foot { position: relative; }
.confirm.is-sending .confirm-foot::before {
    content: '';
    position: absolute;
    left: clamp(1.25rem, 5vw, 2.5rem);
    right: clamp(1.25rem, 5vw, 2.5rem);
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--kumkum), transparent) -40% 0 / 40% 100% no-repeat;
    animation: sendLine 1.1s linear infinite;
}
.confirm.is-sending #confirm-send svg { animation: nudge 1s ease-in-out infinite; }
.confirm.is-sending .btn[disabled] { opacity: .8; cursor: progress; }
.confirm.is-sending #confirm-edit[disabled] { opacity: .4; }

/* ---------- A flower for the garland ---------- */
.offer-done {
    position: relative;
    padding: clamp(2.25rem, 6vw, 3.75rem) clamp(1.25rem, 5vw, 3.5rem) clamp(2.5rem, 6vw, 4rem);
    text-align: center;
    color: var(--paper);
    background:
        radial-gradient(420px 300px at 50% 18%, rgba(242, 163, 58, .22), transparent 70%),
        var(--night);
    border-radius: 2px;
    box-shadow: 0 30px 70px -30px rgba(44, 11, 9, .7);
    overflow: hidden;
    scroll-margin-top: calc(var(--header-h) + 1.5rem);
}
.offer-done:focus { outline: none; }
.garland-art {
    display: block;
    width: clamp(250px, 58vw, 360px);
    height: auto;
    margin: 0 auto .5rem;
    overflow: visible;
}
.ga-f, .ga-leaf, .ga-ring, .ga-open, .ga-glow, .ga-petals ellipse {
    transform-box: fill-box;
    transform-origin: 50% 50%;
}
.ga-thread { stroke-dasharray: 1; stroke-dashoffset: 1; }
.ga-bead { opacity: 0; }
.ga-f { opacity: 0; transform: scale(0); }
.ga-leaf { opacity: 0; }
.ga-fall { transform: translateY(-62px); }
.ga-open { opacity: 0; transform: scale(.05); }
.ga-ring { transform: scale(.2) rotate(-40deg); }
.ga-glow { opacity: 0; }
.ga-petals ellipse { opacity: 0; }

.offer-done.is-offered .ga-thread { animation: threadIn 1s .1s ease-out forwards; }
.offer-done.is-offered .ga-bead { animation: fadeIn .5s .5s ease-out forwards; }
.offer-done.is-offered .ga-leaf { animation: fadeIn .6s ease-out forwards; animation-delay: calc(.6s + var(--i) * .08s); }
.offer-done.is-offered .ga-f { animation: flowerPop .65s var(--ease-out) forwards; animation-delay: calc(.35s + var(--i) * .1s); }
.offer-done.is-offered .ga-open { animation: bloomOpen .8s 1s var(--ease-out) forwards; }
.offer-done.is-offered .ga-ring-3 { animation: unfurl .9s 1s var(--ease-out) forwards; }
.offer-done.is-offered .ga-ring-2 { animation: unfurl .9s 1.12s var(--ease-out) forwards; }
.offer-done.is-offered .ga-ring-1 { animation: unfurl .9s 1.24s var(--ease-out) forwards; }
.offer-done.is-offered .ga-fall { animation: settle .8s 2s cubic-bezier(.45, 0, .2, 1) forwards; }
.offer-done.is-offered .ga-glow { animation: glowIn 1.4s 1.1s ease-out forwards, glowPulse 3.6s 2.8s ease-in-out infinite; }
.offer-done.is-offered .ga-petals ellipse { animation: petalDrift 4.2s ease-out infinite; }
.offer-done.is-offered .ga-petals ellipse:nth-child(1) { animation-delay: 2.9s; }
.offer-done.is-offered .ga-petals ellipse:nth-child(2) { animation-delay: 3.8s; }
.offer-done.is-offered .ga-petals ellipse:nth-child(3) { animation-delay: 4.7s; }

.offer-done > :not(.garland-art) { opacity: 0; }
.offer-done.is-offered > :not(.garland-art) { animation: rise .6s var(--ease-out) forwards; }
.offer-done.is-offered > .kicker { animation-delay: .3s; }
.offer-done.is-offered > .done-title { animation-delay: .4s; }
.offer-done.is-offered > .done-text { animation-delay: .5s; }
.offer-done.is-offered > .done-card { animation-name: cardIn; animation-delay: .6s; }
.offer-done.is-offered > .done-actions { animation-delay: .75s; }

.done-title {
    margin-top: .7rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.4rem, 5.5vw, 3.75rem);
    line-height: 1;
    letter-spacing: -.015em;
}
.done-title em {
    font-family: var(--font-read);
    font-style: italic;
    font-weight: 300;
    color: var(--gold-2);
}
.done-text {
    max-width: 34rem;
    margin: 1rem auto 0;
    font-size: 1.12rem;
    color: rgba(246, 238, 221, .8);
}

.done-card {
    max-width: 30rem;
    margin: 2.25rem auto 0;
    padding: 1.5rem 1.75rem 1.35rem;
    text-align: left;
    color: var(--ink);
    background: var(--paper-hi);
    border-radius: 2px;
    box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .8);
    transform: rotate(-1.4deg);
}
.done-card blockquote {
    max-height: calc(1.7em * 5);
    overflow: hidden;
    font-size: 1.04rem;
    line-height: 1.7;
    color: var(--ink-2);
    white-space: pre-line;
    overflow-wrap: anywhere;
    -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
    mask-image: linear-gradient(180deg, #000 60%, transparent);
}
.done-card figcaption {
    margin-top: .9rem;
    padding-top: .8rem;
    border-top: 1px dashed var(--paper-edge);
}
.done-card strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
}
.done-card span {
    display: block;
    margin-top: .2rem;
    font-family: var(--font-ui);
    font-size: .72rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.done-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2.5rem;
}

/* ---------- One last look (confirm before sending) ---------- */
html.confirm-open { overflow: hidden; }

.confirm {
    width: min(calc(100% - 1.5rem), 640px);
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 0;
    border: 0;
    color: var(--ink);
    background: transparent;
    overflow: visible;
}
.confirm:not([open]) { display: none; }
.confirm::backdrop {
    background: rgba(44, 11, 9, .82);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}
.confirm[open] { animation: confirmIn .5s var(--ease-out) both; }
.confirm[open]::backdrop { animation: veilIn .3s ease both; }

.confirm-paper {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .55), transparent 200px),
        var(--paper-hi);
    border-radius: 2px;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(217, 196, 157, .6);
    overflow: hidden;
}
/* The same airmail edge as the envelope it is about to leave in */
.confirm-paper::before {
    content: '';
    flex: none;
    height: 6px;
    background: repeating-linear-gradient(135deg,
        var(--kumkum) 0 12px, transparent 12px 20px,
        var(--marigold) 20px 32px, transparent 32px 40px);
    opacity: .85;
}

.confirm-head {
    flex: none;
    padding: clamp(1.3rem, 4vw, 1.9rem) clamp(1.25rem, 5vw, 2.5rem) 1.1rem;
    text-align: center;
}
.confirm-title {
    margin-top: .45rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.75rem, 4.5vw, 2.35rem);
    line-height: 1.05;
    letter-spacing: -.01em;
}
.confirm-title:focus { outline: none; }
.confirm-title em {
    font-family: var(--font-read);
    font-style: italic;
    font-weight: 300;
    color: var(--kumkum);
}
.confirm-lede {
    max-width: 30rem;
    margin: .6rem auto 0;
    font-size: 1rem;
    font-style: italic;
    line-height: 1.5;
    color: var(--ink-2);
}

.confirm-letter {
    flex: 1 1 auto;
    min-height: 7rem;
    margin: 0 clamp(.75rem, 3vw, 1.5rem);
    padding: 1.4rem clamp(1rem, 4vw, 1.75rem) 1.25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--paper);
    border: 1px solid var(--paper-edge);
    border-radius: 2px;
    box-shadow: inset 0 1px 8px rgba(42, 25, 16, .07);
}
.confirm-letter:focus { outline: none; }
.confirm-letter:focus-visible { outline: 2px solid var(--marigold); outline-offset: 2px; }
.confirm-text {
    font-size: 1.06rem;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.confirm-text::first-letter {
    float: left;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 3.3em;
    line-height: .8;
    margin: .3rem .55rem 0 0;
    color: var(--kumkum);
}
.confirm-sign {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--paper-edge);
    text-align: right;
}
.confirm-sign-label {
    display: block;
    font-style: italic;
    color: var(--ink-3);
}
.confirm-sign strong {
    display: block;
    margin-top: .15rem;
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    font-weight: 600;
    line-height: 1.15;
    overflow-wrap: anywhere;
}
.confirm-place {
    display: block;
    margin-top: .3rem;
    font-family: var(--font-ui);
    font-size: .74rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.confirm-foot {
    flex: none;
    padding: 1rem clamp(1.25rem, 5vw, 2.5rem) clamp(1.25rem, 4vw, 1.6rem);
}
.confirm-private {
    font-family: var(--font-ui);
    font-size: .9rem;
    line-height: 1.45;
    color: var(--ink-2);
    overflow-wrap: anywhere;
}
.confirm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .75rem 1rem;
    margin-top: 1rem;
}

/* ---------- Aside ---------- */
.offer-aside {
    position: sticky;
    top: calc(var(--header-h) + 1.75rem);
}
.aside-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.7rem;
    line-height: 1.1;
}
.journey {
    list-style: none;
    margin-top: 1.4rem;
}
.journey li {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 1rem;
    padding-bottom: 1.6rem;
}
.journey li:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 21.5px;
    top: 50px;
    bottom: 6px;
    width: 1px;
    background: repeating-linear-gradient(180deg, var(--paper-edge) 0 4px, transparent 4px 8px);
}
.journey-num {
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    padding-top: .2rem;
    font-family: var(--font-deva);
    font-size: 1.3rem;
    line-height: 1;
    color: var(--kumkum);
    background: var(--paper-hi);
    border: 1px solid var(--gold);
    border-radius: 50%;
}
.journey strong {
    display: block;
    padding-top: .55rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.12rem;
    line-height: 1.2;
}
.journey p {
    margin-top: .3rem;
    font-size: .98rem;
    line-height: 1.55;
    color: var(--ink-2);
}
.aside-note {
    padding: 1.2rem 1.3rem;
    background: var(--paper-2);
    border: 1px solid var(--paper-edge);
    border-radius: var(--radius);
}
.aside-note h3 {
    font-family: var(--font-ui);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--kumkum);
}
.aside-note p {
    margin-top: .4rem;
    font-size: .98rem;
    line-height: 1.55;
    color: var(--ink-2);
}

/* ---------- Keyframes ---------- */
@keyframes statusPulse { 0% { box-shadow: 0 0 0 0 rgba(143, 208, 122, .6); } 80%, 100% { box-shadow: 0 0 0 8px rgba(143, 208, 122, 0); } }
@keyframes sendLine { to { background-position: 140% 0; } }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@keyframes threadIn { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes flowerPop {
    0% { opacity: 0; transform: scale(0); }
    60% { opacity: 1; transform: scale(1.18); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes bloomOpen { to { opacity: 1; transform: scale(1); } }
@keyframes unfurl { to { transform: scale(1) rotate(0); } }
@keyframes settle { to { transform: translateY(0); } }
@keyframes glowIn { from { opacity: 0; transform: scale(.35); } to { opacity: 1; transform: scale(1); } }
@keyframes glowPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .78; transform: scale(.93); } }
@keyframes petalDrift {
    0% { opacity: 0; transform: translate(0, 0) rotate(0); }
    20% { opacity: .9; }
    100% { opacity: 0; transform: translate(10px, 40px) rotate(120deg); }
}
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) rotate(2deg); } to { opacity: 1; transform: rotate(-1.4deg); } }
@keyframes confirmIn { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes veilIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .offer-layout { grid-template-columns: 1fr; }
    .offer-aside { position: static; max-width: 640px; }
}

@media (max-width: 560px) {
    .sheet {
        box-shadow:
            0 0 0 1px rgba(217, 196, 157, .7),
            5px 5px 0 -1px var(--paper-2),
            5px 5px 0 0 var(--paper-edge),
            var(--shadow-lift);
    }
    .sheet::before { inset: 7px; }
    .sheet-meta { flex-direction: column; align-items: center; }
    .field-letter { --lh: 1.95rem; }
    #f-offering { min-height: calc(var(--lh) * 10); }
    .sheet-sign { width: 100%; }
    .sign-label,
    .field-name input,
    .field-name .field-error,
    .name-hint { text-align: left; }
    .sign-place { grid-template-columns: 1fr; }
    .cb-pop { width: 100%; max-width: none; }
    .cb-list { max-height: 14.5rem; }
    .submit-row .btn { width: 100%; }
    .done-actions .btn { width: 100%; }
    .confirm { width: calc(100% - 1rem); }
    .confirm-paper { max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem); }
    .confirm-actions { flex-direction: column-reverse; }
    .confirm-actions .btn { width: 100%; }
}

/* The garland arrives in order; without motion, show the finished state straight away */
@media (prefers-reduced-motion: reduce) {
    .offer-done *, .offer-done > * { animation-delay: 0s !important; }
    .confirm.is-sending .confirm-foot::before { background-size: 100% 100%; background-position: 0 0; animation: none; opacity: .6; }
}
