/* Referral program panel + ladder (2026-07-30) — lives inside the dark
   .waitlist section, styled as a light Field Manual card. Uses story.css vars. */

.referral {
    max-width: 560px;
    margin: 28px auto 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    padding: 26px 24px;
    text-align: left;
    color: var(--ink);
}

.referral__eyebrow {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rust);
    margin: 0 0 6px;
}

.referral__welcome {
    font-family: var(--serif);
    font-size: 19px;
    font-weight: 600;
    margin: 0 0 14px;
    color: var(--ink);
}

.referral__linkrow {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: stretch;
    margin-bottom: 10px;
}

.referral__link {
    flex: 1 1 220px;
    font-family: var(--sans);
    font-size: 14.5px;
    font-weight: 600;
    color: var(--green-deep);
    background: var(--paper-warm);
    border: 1px dashed var(--green);
    border-radius: 9px;
    padding: 12px 14px;
    overflow-wrap: anywhere;
    user-select: all;
}

.referral__btn {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 700;
    color: #FFFEFA;
    background: var(--green);
    border: none;
    border-radius: 9px;
    padding: 12px 18px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.referral__btn:hover { background: var(--green-deep); }
.referral__btn--ghost {
    color: var(--green-deep);
    background: transparent;
    border: 1.5px solid var(--green);
}
.referral__btn--ghost:hover { background: var(--paper-warm); }

.referral__stats {
    font-family: var(--sans);
    font-size: 14.5px;
    color: var(--ink-soft);
    margin: 12px 0 4px;
}
.referral__stats strong { color: var(--green-deep); font-size: 17px; }

.referral__nudge {
    font-family: var(--hand);
    font-size: 19px;
    color: var(--rust);
    margin: 2px 0 14px;
}

.referral__ladder {
    list-style: none;
    margin: 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--border);
    font-family: var(--sans);
    font-size: 14px;
    color: var(--ink);
}
.referral__ladder li {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 5px 0;
}
.referral__ladder .n {
    flex: 0 0 64px;
    font-weight: 800;
    color: var(--green-deep);
    letter-spacing: 0.02em;
}
.referral__fineprint {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--ink-soft);
    margin: 12px 0 0;
}

/* Pre-signup ladder preview — visible on the dark waitlist section so people
   know what referring earns BEFORE they hand over an email. */
.ladder-preview {
    max-width: 560px;
    margin: 26px auto 0;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(244, 239, 229, 0.25);
    border-radius: 14px;
    padding: 20px 24px;
    text-align: left;
}
.ladder-preview__title {
    font-family: var(--hand);
    font-size: 22px;
    color: #F4EFE5;
    margin: 0 0 10px;
}
.ladder-preview__list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: var(--sans);
    font-size: 14.5px;
    color: rgba(244, 239, 229, 0.92);
}
.ladder-preview__list li {
    display: flex;
    gap: 12px;
    align-items: baseline;
    padding: 6px 0;
    border-top: 1px solid rgba(244, 239, 229, 0.12);
}
.ladder-preview__list li:first-child { border-top: none; }
.ladder-preview__list .n {
    flex: 0 0 68px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #F4EFE5;
}
.ladder-preview__list strong { color: #FFFFFF; }
.ladder-preview__prize {
    font-family: var(--sans);
    font-size: 13.5px;
    line-height: 1.5;
    color: #F4EFE5;
    background: rgba(169, 81, 46, 0.28); /* rust wash */
    border: 1px solid rgba(169, 81, 46, 0.55);
    border-radius: 10px;
    padding: 10px 14px;
    margin: 14px 0 0;
}
.ladder-preview__prize strong { color: #FFFFFF; }
.ladder-preview__note {
    font-family: var(--sans);
    font-size: 12.5px;
    color: rgba(244, 239, 229, 0.7);
    margin: 12px 0 0;
}

/* "Already on the list?" lookup under the join form (dark section context) */
.referral-lookup {
    margin: 18px auto 0;
    max-width: 560px;
    text-align: center;
}
.referral-lookup__toggle {
    font-family: var(--sans);
    font-size: 13.5px;
    color: rgba(244, 239, 229, 0.85);
    background: none;
    border: none;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 4px 8px;
}
.referral-lookup__toggle:hover { color: #F4EFE5; }
.referral-lookup__form {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}
.referral-lookup__form[hidden] { display: none; }

@media (max-width: 560px) {
    .referral { padding: 20px 16px; }
    .referral__linkrow { flex-direction: column; }
    .referral__btn { width: 100%; }
}

/* Beverly success modal — the app's task-complete moment, on the web.
   Face + handwritten congrats + two fat steps. Nobody reads paragraphs. */
.modal__content--beverly { padding-top: 26px; }
.modal__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--paper-warm);
    box-shadow: var(--shadow-soft);
    margin: 0 auto 6px;
    display: block;
}
.modal__hand {
    font-family: var(--hand);
    font-size: 32px;
    color: var(--rust);
    margin: 0 0 16px;
    line-height: 1.1;
}
.modal__steps {
    list-style: none;
    counter-reset: step;
    margin: 0 0 22px;
    padding: 0;
    text-align: left;
}
.modal__steps li {
    counter-increment: step;
    position: relative;
    padding: 10px 0 10px 46px;
}
.modal__steps li + li { border-top: 1px solid var(--border); }
.modal__steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 12px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--green-deep);
    color: #F4EFE5;
    font-family: var(--sans);
    font-weight: 800;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal__steps strong {
    display: block;
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}
.modal__steps span {
    font-family: var(--sans);
    font-size: 13.5px;
    color: var(--ink-soft);
    line-height: 1.45;
}
@media (max-width: 420px) {
    .modal__content--beverly { padding-left: 20px; padding-right: 20px; }
    .modal__hand { font-size: 28px; }
}

/* ============================================================
   Share-at-peak-intent (2026-07-30)
   The success modal now carries the link + share action itself,
   instead of routing the user to the panel with an extra click.
   ============================================================ */
.modal__reward {
    margin: 6px 0 18px;
    font-size: 19px;
    line-height: 1.45;
    color: var(--text);
    text-align: center;
}
.modal__reward strong { color: var(--green-deep); }

.modal__link {
    display: block;
    margin: 0 auto 16px;
    padding: 12px 16px;
    max-width: 320px;
    background: var(--paper-warm, #f6efdd);
    border: 1px dashed var(--border);
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 15px;
    color: var(--green-deep);
    text-align: center;
    word-break: break-all;
}

.modal__share {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 10px;
    padding: 15px 24px;
    background: var(--primary-deep);
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 17px;
    cursor: pointer;
    transition: transform .2s ease;
}
.modal__share:hover { transform: translateY(-2px); }

.modal__copy {
    display: block;
    margin: 0 auto 16px;
    padding: 8px 18px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
}
.modal__copy:hover { background: var(--paper-warm, #f6efdd); }

.modal__note {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.modal__later {
    display: block;
    margin: 0 auto;
    padding: 6px 10px;
    background: none;
    border: none;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: underline;
    cursor: pointer;
}

/* Forward-framed progress in the panel */
.referral__progress {
    margin: 14px 0 8px;
    font-size: 17px;
    font-weight: 600;
    color: var(--green-deep);
}
.referral__bar {
    height: 8px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}
.referral__bar > span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--primary-deep);
    border-radius: 999px;
    transition: width .5s ease;
}

/* Rewards + legal tucked away so the share button is the one obvious action */
.referral__more { margin-top: 14px; }
.referral__more > summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 6px 0;
    list-style: none;
}
.referral__more > summary::-webkit-details-marker { display: none; }
.referral__more > summary::after { content: " ↓"; }
.referral__more[open] > summary::after { content: " ↑"; }
