.rsvp-main { padding: 40px 20px 0; }
.page-intro { text-align: center; max-width: 520px; margin: 0 auto 40px; }
.page-intro h1 { margin: 15px 0 20px; }
.page-intro > p:not(.eyebrow) { color: var(--muted); font-size: 14px; }
.page-intro .deadline { margin-top: 13px; font-size: 14px; }
.form-card { max-width: 690px; margin: 0 auto; padding: 42px 44px; background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow); }
.form-card h2 { font-size: 32px; }
#gate h2 { margin: 12px 0 18px; }
#gate > p:not(.eyebrow) { color: var(--muted); font-size: 14px; max-width: 440px; }
#code-form { margin-top: 28px; }
#code-form .button { width: 100%; margin-top: 24px; }
#invitation-code { text-align: center; font-size: 26px; letter-spacing: .45em; min-height: 64px; }
.field { display: flex; flex-direction: column; min-width: 0; gap: 7px; }
label { font-size: 14px; font-weight: 500; }
input,select { width: 100%; min-height: 48px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); color: var(--blue-dark); padding: 11px 13px; line-height: 1.6; }
input::placeholder { color: var(--muted); }
input:focus,select:focus { outline: 2px solid var(--blue-light); outline-offset: 1px; }
input:user-invalid { border-color: var(--error); }
small { font-size: 14px; color: var(--muted); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 20px; margin-top: 30px; }
.form-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.form-heading h2 { margin-top: 8px; }
.form-heading .text-link { white-space: nowrap; font-size: 14px; }
.form-section-title { margin-top: 38px; font-size: 23px; }
.form-section-title + p { font-size: 14px; margin: 8px 0 12px; }
.event-fieldset { border: 0; padding: 23px 0; margin: 0; min-width: 0; border-bottom: 1px solid var(--border); }
.event-fieldset legend { font: 400 23px var(--font-heading); padding: 16px 0 0; }
.event-note { font-size: 14px; color: var(--muted); margin: -8px 0 18px; }
.radio-pills { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.radio-pills label { position: relative; cursor: pointer; }
.radio-pills input { position: absolute; opacity: 0; min-height: 0; width: 1px; height: 1px; padding: 0; }
.radio-pills span { min-height: 48px; height: 100%; border: 1px solid var(--border); border-radius: var(--radius); display: flex; justify-content: center; align-items: center; text-align: center; font-size: 14px; line-height: 1.4; padding: 10px 8px; }
.radio-pills input:checked + span { background: var(--soft-blue); border-color: var(--blue-mid); color: var(--blue-mid); }
.radio-pills input:focus-visible + span { outline: 3px solid var(--blue-light); outline-offset: 3px; }
.dynamic-input { max-height: 0; opacity: 0; overflow: hidden; visibility: hidden; transition: max-height .28s ease, opacity .2s ease, visibility .28s; }
.dynamic-input.visible { max-height: 175px; opacity: 1; visibility: visible; }
.dynamic-inner { padding: 18px 2px 3px; display: flex; flex-direction: column; gap: 7px; }
.dynamic-inner input { max-width: 115px; }
.dynamic-inner label .muted { font-weight: 400; }
#save-response { width: 100%; margin-top: 28px; }
.privacy-note { text-align: center; color: var(--muted); font-size: 14px; margin-top: 18px; line-height: 1.8; }
.notice { padding: 12px 15px; background: var(--soft-blue); border-left: 3px solid var(--blue-light); font-size: 14px; color: var(--blue-dark); margin: 0 0 22px; overflow-wrap: anywhere; }
.notice[data-kind="error"] { background: var(--error-bg); border-color: var(--error); color: var(--error); }
.notice[data-kind="warning"] { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); }
#save-message,#edit-message,#code-message { margin-top: 20px; margin-bottom: 0; }
#retry-connection { margin-bottom: 20px; }
#editing-note { margin-top: 22px; }
.success-panel { padding: 20px 0; text-align: center; }
.success-mark { display: block; color: var(--blue-light); font-size: 50px; margin-bottom: 20px; }
.success-panel h2 { margin: 15px 0 22px; }
.success-panel > p:not(.eyebrow) { color: var(--muted); font-size: 14px; max-width: 400px; margin: auto; }
.success-panel .button { margin: 28px 0 18px; }
.success-panel .text-link { display: table; margin: auto; }
.rsvp-signature { text-align: center; font: italic 27px var(--font-heading); color: var(--blue-mid); margin: 40px 0 20px; }
.lightbox { position: fixed; inset: 0; width: min(700px, calc(100% - 24px)); max-height: calc(100dvh - 40px); padding: 30px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--blue-dark); background: var(--cream-bg); overflow-y: auto; box-shadow: var(--shadow); }
.lightbox::backdrop { background: var(--overlay); backdrop-filter: blur(4px); }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.modal-header h2 { font-size: 32px; margin-top: 8px; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--border); background: transparent; color: var(--blue-mid); border-radius: 50%; font-size: 24px; flex-shrink: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; }
.tier-field { margin: 24px 0 20px; }
@media(max-width: 600px) {
 .rsvp-main { padding-top: 25px; padding-inline: 16px; }
 .form-card { padding: 28px 20px; }
 .contact-grid { grid-template-columns: 1fr; gap: 18px; }
 .form-card h2 { font-size: 27px; }
 .radio-pills { gap: 6px; }
 .radio-pills span { font-size: 14px; padding-inline: 4px; min-height: 50px; }
 .form-heading { align-items: flex-start; }
 .lightbox { padding: 22px 18px; }
 input,select { font-size: 16px; } /* Prevent iOS focus zoom. */
}

/* Shared comfortable reading/control scale on desktop and mobile. */
input,select { font-size: 16px; }
label { font-size: 16px; }
.page-intro > p:not(.eyebrow),#gate > p:not(.eyebrow),.form-section-title + p,.success-panel > p:not(.eyebrow),.notice { font-size: 16px; }
.radio-pills span { font-size: 15px; min-height: 52px; padding: 12px 10px; }
.dynamic-input.visible { max-height: 220px; }
small,.privacy-note,.event-note,.form-heading .text-link,.page-intro .deadline { font-size: 14px; }
@media (max-width: 600px) {
 .radio-pills { grid-template-columns: 1fr; gap: 10px; }
 .radio-pills span { font-size: 16px; min-height: 48px; }
 .form-heading { flex-wrap: wrap; }
 .form-card { padding-inline: 18px; }
 .modal-actions { flex-wrap: wrap; }
}

.event-fieldset > .event-location { margin: -4px 0 18px; }
