/* Keep the postcard central and reveal only the controls needed for each step. */
.card-builder{height:100dvh;min-height:0;display:grid;grid-template-rows:auto auto minmax(0,1fr);gap:20px;padding:22px 40px 60px;background:radial-gradient(ellipse at 50% 45%,#8050a633,transparent 52%);color:#fff7e8}
.builder-header{min-height:44px;display:flex;justify-content:space-between;align-items:center;max-width:1320px;width:100%;margin:0 auto}
.builder-header img{width:130px;display:block}.builder-home{display:grid;place-items:center;width:44px;height:44px;color:#e8cc83}.builder-home svg{width:25px;height:25px}
.builder-heading{text-align:center;margin:0 auto;max-width:700px}
.builder-heading h1{font-family:'Appetite Contrast',Georgia,serif;font-size:clamp(30px,4vw,44px);font-weight:400;line-height:1.2;letter-spacing:0;margin:0;outline:none}
#nomination-form{display:grid;grid-template-rows:minmax(0,1fr) auto;gap:20px;min-height:0;width:100%}.builder-stage{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:22px;max-width:520px;width:100%;margin:0 auto;min-height:0}
.builder-preview{min-width:0;width:100%;max-width:min(420px,44dvh)}
.builder-preview #card-preview{filter:drop-shadow(0 20px 24px #14032245)}
.builder-card.postcard{width:100%;aspect-ratio:1.45;min-height:0;padding:22px 24px;rotate:0deg;transition:background .3s}
.builder-card .postcard-copy{padding:20px 8px;max-height:65%;margin:auto 5px;overflow:hidden}
.builder-card .recipient{font-size:38px}.builder-card .message{display:block;font-size:17px;line-height:1.5;-webkit-line-clamp:unset}
.builder-card .postcard-signature{margin-top:auto;font-size:10px}.builder-card .postcard-photo{width:75px;height:85px;float:left;margin:2px 12px 8px 0;rotate:-3deg}.builder-card .with-photo{text-align:left}.builder-card .with-photo .recipient{font-size:30px}.builder-card .with-photo .message{font-size:15px}.builder-card .postcard-copy.with-photo{padding-top:10px;padding-bottom:10px}
.builder-controls{min-width:0;width:100%;max-width:420px}.builder-controls .field{position:relative;margin-bottom:14px}
.builder-controls .field label{display:block;font-size:12px;font-weight:500;color:#e7d8ef;margin-bottom:7px;line-height:1.4}
.builder-controls .field label.sr-only{position:absolute}
.builder-controls input:not([type=checkbox]):not([type=file]),.builder-controls textarea,.builder-controls select{width:100%;background:#3e235c88;color:#fff7e8;color-scheme:dark;border:1px solid #b795cd66;border-radius:9px;padding:11px 13px;font-size:14px;line-height:1.45}
.builder-controls textarea{resize:none;min-height:84px;padding-bottom:22px}.builder-controls input::placeholder,.builder-controls textarea::placeholder{color:#c7b3d4}
.builder-controls select option{background:#40235e;color:#fff7e8}
.builder-controls .hint,.builder-controls .optional{font-size:11px;line-height:1.5;color:#cdb9dc;margin:7px 0 0}.builder-controls .char-count{position:absolute;right:12px;bottom:8px;font-size:10px;pointer-events:none}
.builder-controls .checkbox{font-size:12px;line-height:1.5;gap:10px;margin:12px 0}.builder-controls .checkbox input{accent-color:#edc76b}
.builder-controls .error{font-size:12px;color:#ffe0b4;margin:12px 0 0}.builder-controls .error:empty{display:none}
.style-choices{display:flex;justify-content:center;gap:24px;padding:5px 0}
.style-choice{width:58px;height:58px;flex-shrink:0;border:1px solid #fff5;border-radius:50%;padding:0;box-shadow:inset 0 2px 3px #fff6,0 5px 12px #16082933;outline:2px solid transparent;outline-offset:6px;transition:outline-color .2s,transform .2s}
.style-choice.selected{outline-color:#f4d383}.style-choice:hover{transform:translateY(-2px)}.style-choice:focus-visible{outline:3px solid #fff;outline-offset:6px}
.style-cream{background:linear-gradient(125deg,#fff9eb,#f5e6ef)}.style-gold{background:linear-gradient(120deg,#e4b854,#f8e2a5,#d8ad4f)}.style-purple{background:linear-gradient(130deg,#462276,#72429f)}
.builder-note{text-align:center;font-size:12px;line-height:1.5;color:#cdb9dc;margin:14px 0 0}
.builder-name input#hero-name{background:#fff8ee;color:#402379;border:1px solid #ecd9b0;border-radius:10px;padding:12px 15px;font-size:16px;box-shadow:0 3px 12px #1908271a}
.builder-name input#hero-name::placeholder{color:#84718f;font-weight:400}.builder-name input#hero-name:focus-visible{outline:2px solid #f2d58b;outline-offset:3px}
.builder-name label{color:#f5eadb!important;letter-spacing:.02em}
.builder-upload{text-align:left}.builder-upload .hint:empty{display:none}.builder-upload-choice{display:flex;gap:8px}
.builder-photo-picker{display:flex;align-items:center;gap:12px;width:100%;min-height:60px;padding:9px 13px;border:1px dashed #c4a57599;border-radius:10px;background:#ffffff06;color:#f2d58b;text-align:left;transition:background .2s,border-color .2s}
.builder-photo-picker:hover,.builder-photo-picker:focus-visible{background:#ffffff0e;border-color:#f2d58b}.photo-picker-icon{display:grid;place-items:center;flex-shrink:0;width:36px;height:36px;background:#f2d58b12;border-radius:8px}.photo-picker-icon svg{width:24px;height:24px}
.photo-picker-copy{display:flex;flex-direction:column;gap:3px}.photo-picker-copy strong{font-size:13px;font-weight:600;color:#fff7e8}.photo-picker-copy>span{font-size:10px;color:#cdb9dc;line-height:1.4}.photo-picker-plus{margin-left:auto;font-size:24px;line-height:1}
.builder-photo-picker img{width:40px;height:40px;object-fit:cover;border-radius:6px;flex-shrink:0}.photo-picker-remove{width:44px;flex-shrink:0;border:1px solid #b795cd66;border-radius:10px;background:#ffffff06;font-size:24px;color:#e4cde9}
/* Reserve equal space so step controls can change while the postcard stays anchored. */
.card-builder:is([data-step="1"],[data-step="2"],[data-step="3"],[data-step="4"]) .builder-controls{min-height:170px}
.builder-navigation{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:24px;max-width:760px;width:100%;margin:0 auto}
.builder-back,.builder-next{padding:13px 22px;min-width:112px;min-height:50px;font-size:13px;letter-spacing:1.6px;gap:12px;white-space:nowrap}
.builder-back{grid-column:1;justify-self:start}.builder-next{grid-column:2;justify-self:end}
.sticker-palette{display:flex;justify-content:center;flex-wrap:wrap;gap:12px}.sticker-palette button{display:grid;place-items:center;width:52px;height:52px;padding:8px;border:1px solid #b890d26b;border-radius:50%;background:#54347788}.sticker-palette button:hover{border-color:#f2d489;background:#73499a}.sticker-palette svg{width:100%;height:100%;filter:drop-shadow(0 2px 2px #24093866)}
.card-builder[data-step="4"] .builder-card{overflow:visible}
.card-builder[data-step="4"] .builder-card::before{border-radius:inherit}
.sticker-frame{position:absolute;z-index:5;display:block;aspect-ratio:1;border:1.5px dashed #9872af;border-radius:4px;pointer-events:none}
.sticker-handle{position:absolute;display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;background:transparent;color:#402379;pointer-events:auto;touch-action:none;user-select:none;cursor:grab}
.sticker-handle span{display:grid;place-items:center;width:26px;height:26px;border:1px solid #ae89c1;border-radius:50%;background:#fff8e9;box-shadow:0 2px 5px #230d433d;font:700 21px/1 Arial,sans-serif}
.sticker-handle:hover span{background:#f5d78a}.sticker-handle:focus-visible{outline:2px solid #402379;outline-offset:-6px;border-radius:50%}.sticker-handle:active{cursor:grabbing}
.sticker-handle-remove{top:0;left:0;translate:-50% -50%;cursor:pointer}.sticker-handle-rotate{top:0;right:0;translate:50% -50%}.sticker-handle-resize{bottom:0;right:0;translate:50% 50%;cursor:nwse-resize}
.card-decorations{position:absolute;inset:0;z-index:3;pointer-events:none}.custom-sticker{position:absolute;display:block;aspect-ratio:1;padding:0;border:0;background:none;pointer-events:none;filter:drop-shadow(0 2px 2px #18072755);line-height:0}.custom-sticker svg{display:block;width:100%;height:100%}.custom-sticker:is(button){pointer-events:auto;cursor:grab;touch-action:none;user-select:none}.custom-sticker:is(button):active{cursor:grabbing}.custom-sticker:focus-visible{outline:2px solid #9c6bc4;outline-offset:6px}
.success .hero-actions{justify-content:center}.success .nomination-card-preview{margin-left:auto;margin-right:auto}.nomination-card-preview .postcard-designed,.postcard-detail.postcard-designed{aspect-ratio:1.45;min-height:0}
@media(max-width:720px){
 .card-builder{padding:18px 20px 96px;gap:16px}.builder-header img{width:100px}.builder-heading{margin:0 auto}.builder-heading h1{font-size:clamp(25px,4dvh,30px)}
 #nomination-form{gap:16px}.builder-stage{gap:20px;max-width:410px}.builder-preview{max-width:min(350px,38dvh)}.builder-card.postcard{padding:18px 19px;rotate:0deg}.builder-card .postcard-copy{padding:12px 3px;margin:auto 0}.builder-card .recipient{font-size:28px}.builder-card .message{font-size:13px;line-height:1.4}.builder-card .postcard-logo{width:62px}.builder-card .nomination-tag{font-size:7px;padding:5px 7px}.builder-card .postcard-top{min-height:27px}.builder-card .postcard-signature{font-size:8px;padding:8px 13px}.builder-card .postcard-signature span:last-child{font-size:7px}.builder-card .postcard-seal{width:23px;height:23px;top:42px;right:17px}.builder-card .postmark{right:88px;top:24px;width:30px}.builder-card .postcard-photo{width:50px;height:60px;margin:0 9px 5px 0}.builder-card .with-photo .recipient{font-size:22px}.builder-card .with-photo .message{font-size:12px}
 .builder-controls input:not([type=checkbox]):not([type=file]),.builder-controls textarea,.builder-controls select{font-size:16px}.builder-controls{max-width:380px}.style-choice{width:50px;height:50px}.style-choices{gap:24px}.builder-navigation{max-width:410px;grid-template-columns:1fr 1fr;gap:12px;margin-top:0}.builder-back,.builder-next{padding:12px 18px}.sticker-palette{gap:11px}.sticker-palette button{width:48px;height:48px}
}
@media(prefers-reduced-motion:reduce){.builder-card.postcard,.style-choice{transition:none}}

@media(max-width:720px) and (max-height:620px){.card-builder[data-step="2"] .builder-preview,.card-builder[data-step="3"] .builder-preview{display:none}.builder-preview{max-width:min(250px,30dvh)}.builder-heading h1{font-size:24px}.card-builder{gap:12px;padding-top:14px}.builder-header img{width:85px}}
@media(max-width:720px){.card-builder[data-step="3"] .builder-preview{max-width:min(350px,28dvh)}}
@media(min-width:721px) and (max-height:700px){.card-builder{gap:14px;padding-top:14px;padding-bottom:50px}.builder-stage{flex-direction:row;gap:36px;max-width:800px}.builder-preview{max-width:340px}.builder-controls{max-width:350px}.builder-heading h1{font-size:32px}
 .card-builder:is([data-step="1"],[data-step="2"],[data-step="3"],[data-step="4"]) .builder-stage{flex-direction:column;gap:22px;max-width:520px}
 .card-builder:is([data-step="1"],[data-step="2"],[data-step="3"],[data-step="4"]) .builder-preview{max-width:min(340px,calc((100dvh - 464px)*1.45))}
}
/* Scale the artwork with the preview, preserving room for the full message. */
.builder-preview{container-type:inline-size}
.builder-card.postcard{padding:5cqw 5.7cqw}
.builder-card .postcard-top{min-height:8cqw;flex-shrink:0;gap:3cqw}
.builder-card .postcard-logo{width:19cqw;padding:1.2cqw 1.7cqw}
.builder-card .nomination-tag{font-size:clamp(6px,2.1cqw,10px);padding:1.4cqw 2.4cqw}
.builder-card .postcard-copy{flex:1;min-height:0;max-height:none;margin:1cqw;padding:3cqw 1.9cqw}
.builder-card .recipient{font-size:clamp(16px,9cqw,38px);margin-bottom:2.6cqw}
.builder-card .message{font-size:clamp(9px,4cqw,17px);line-height:1.4}
.builder-card .postcard-signature{width:62cqw;flex-shrink:0;margin-top:0;min-width:38cqw;padding:2.4cqw 4.7cqw;font-size:clamp(7px,2.4cqw,10px);gap:1cqw}
.builder-card .postcard-signature span:last-child{font-size:clamp(6px,2.1cqw,9px)}
.builder-card .postcard-seal{width:7.4cqw;height:7.4cqw;top:12cqw;right:5cqw}
.builder-card .postcard-seal svg{width:5.5cqw;height:5.5cqw}
.builder-card .postmark{right:28cqw;top:7cqw;width:11cqw;height:4.5cqw}
.builder-card .card-flourish{width:6.4cqw;height:6.4cqw;left:4cqw;bottom:5cqw}
.builder-card .postcard-photo{width:18cqw;height:20cqw;margin:0 3cqw 2cqw 0;border-width:1.2cqw}
.builder-card .with-photo .recipient{font-size:clamp(16px,7.1cqw,30px)}
.builder-card .with-photo .message{font-size:clamp(9px,3.5cqw,15px)}
.builder-card .postcard-copy.with-photo{padding:2cqw 1.9cqw}

@media(max-width:720px){
 .card-builder:is([data-step="1"],[data-step="2"],[data-step="3"],[data-step="4"]) .builder-heading{min-height:64px;display:grid;align-items:center}
 .card-builder:is([data-step="1"],[data-step="2"],[data-step="3"],[data-step="4"]) .builder-preview{max-width:min(350px,28dvh)}
 .card-builder:is([data-step="1"],[data-step="2"],[data-step="3"],[data-step="4"]) .builder-stage{position:relative;top:clamp(0px,calc((100dvh - 620px)*.15),32px)}
}
@media(min-width:721px){
 .card-builder:is([data-step="1"],[data-step="2"],[data-step="3"],[data-step="4"]) .builder-stage{position:relative;top:25px}
}

.custom-sticker.invalid-placement{opacity:.4}.sticker-frame.invalid-placement{border-color:#ba4969}

.sticker-handle-resize svg{width:17px;height:17px}

.inspire-control{display:flex;justify-content:center}
.inspire-button{display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:8px 14px;border:1px solid #d8b56a66;border-radius:22px;background:#ffffff05;color:#f2d58b;font-size:13px;font-weight:500;transition:background .2s,border-color .2s}
.inspire-button:hover{background:#ffffff0d;border-color:#f2d58b}.inspire-button span{font-size:15px}
dialog.inspire-confirm{width:min(400px,calc(100% - 32px));padding:28px;border:1px solid #d8b56a66;border-radius:16px;background:#321752;color:#fff7e8}
.inspire-confirm h2{font-family:'Appetite Contrast',Georgia,serif;font-size:27px;line-height:1.2;margin:0 0 12px;letter-spacing:0}
.inspire-confirm p{font-size:14px;line-height:1.5;color:#d8c6e2;margin:0 0 24px}
.inspire-confirm-actions{display:flex;gap:12px}.inspire-confirm-actions button{flex:1;min-height:44px;padding:10px 12px;border:1px solid #b795cd66;border-radius:6px;background:transparent;color:#fff7e8;font-size:14px}
.inspire-confirm-actions [data-inspire-replace]{background:#f2d58b;color:#402379;border-color:#f2d58b}

/* A single-screen confirmation keeps the card and all actions in view. */
.success.confirmation{height:100dvh;min-height:0;max-width:620px;margin:0 auto;padding:94px 32px 92px;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:12px;text-align:center}
.confirmation-heading h1{font-family:'Appetite Contrast',Georgia,serif;font-size:clamp(30px,4vw,42px);font-weight:400;letter-spacing:0;line-height:1.12;margin:0 0 10px}
.confirmation-heading p{font-size:14px;line-height:1.4;color:#e2d8ec;margin:0}
.confirmation-preview{container-type:size;min-height:0;display:grid;place-items:center;width:100%;height:100%}
.success.confirmation .nomination-card-preview{container-type:inline-size;width:min(400px,100cqw,140cqh);max-width:none;margin:0;rotate:0deg}
.success.confirmation .builder-card{cursor:default;filter:drop-shadow(0 16px 20px #14032230)}
.confirmation-actions{display:flex;flex-direction:column;align-items:center;gap:12px}
.confirmation-share{display:flex;justify-content:center;gap:12px}
.card-action-circle{display:grid;place-items:center;width:46px;height:46px;padding:0;border:1px solid #f2d58b99;border-radius:50%;background:#fff7e8;color:#402379;transition:background .16s,transform .16s}
.card-action-circle svg{width:22px;height:22px;pointer-events:none}
.card-action-circle:hover{background:#f2d58b;transform:translateY(-2px)}.card-action-circle:active{transform:scale(.94)}
@media(prefers-reduced-motion:reduce){.card-action-circle{transition:none}.card-action-circle:hover,.card-action-circle:active{transform:none}}
.confirmation-actions .button{min-width:148px;min-height:48px;padding:12px 18px;font-size:12px;letter-spacing:1.2px}
@media(max-width:720px){
 .success.confirmation{padding:84px 20px 94px;gap:10px}
 .confirmation-heading h1{font-size:30px;margin-bottom:8px}.confirmation-heading p{font-size:13px}
 .confirmation-actions{gap:12px}.confirmation-actions .button{min-width:148px;max-width:180px;font-size:11px;letter-spacing:1px}
}
@media(max-height:600px){
 .success.confirmation{padding-top:76px;padding-bottom:72px;gap:6px}
 .confirmation-heading h1{font-size:26px;margin-bottom:5px}.confirmation-heading p{font-size:12px}
 .confirmation-actions .button{min-height:44px;padding:9px 12px}
}

/* Sender details and permissions share the final screen. */
.card-builder[data-step="5"]{grid-template-rows:auto minmax(0,1fr);padding-top:94px;padding-bottom:92px}
.card-builder[data-step="5"] .builder-header{display:none}
.card-builder[data-step="5"] .builder-stage{max-width:460px;flex-direction:column}
.card-builder[data-step="5"] .builder-controls{max-width:420px}
.builder-details .field{margin-bottom:12px}
.builder-controls .builder-details input:not([type=checkbox]),.builder-controls .builder-details select{min-height:50px;padding:12px 16px;border:1px solid #d8b87899;border-radius:13px;font-size:16px;background:#33195055}
.builder-details .checkbox{min-height:36px;align-items:center;margin:8px 0;font-size:12px;line-height:1.4}
.builder-details .checkbox input{appearance:none;padding:0;margin:0;width:18px;height:18px;border:1.5px solid #cdb9dc;border-radius:3px;background:transparent}
.builder-details .checkbox input:checked{border-color:#f1cb76;background:#f1cb76 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='m4 9 3 3 7-7' fill='none' stroke='%23402379' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px 16px no-repeat}
.builder-details .hint{font-size:10px;line-height:1.4;margin-top:10px}
.account-switch{display:block;margin:8px auto 0;min-height:36px;padding:8px 4px;border:0;background:transparent;color:var(--gold);font:inherit;font-size:13px;cursor:pointer;text-decoration:underline;text-underline-offset:4px}
.account-switch:hover{color:#fff7e8}
.account-switch:focus-visible{outline:2px solid var(--gold);outline-offset:4px;border-radius:4px}
.account-intro{text-align:center;margin:0 0 20px;font-size:16px;color:#dbc9e8}
.builder-details.account-enter{animation:account-enter .3s ease-out}
@keyframes account-enter{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.builder-details.account-enter{animation:none}}
@media(max-width:720px){
 .card-builder[data-step="5"]{padding:84px 20px 90px;gap:12px}
 .card-builder[data-step="5"] .builder-heading h1{font-size:30px}
 .card-builder[data-step="5"] #nomination-form{gap:12px}
 .builder-details .field{margin-bottom:10px}
 .builder-controls .builder-details input:not([type=checkbox]),.builder-controls .builder-details select{min-height:46px;padding:10px 14px}
 .builder-details .checkbox{margin:6px 0;min-height:36px}
 .builder-details .hint{margin-top:8px}
}
@media(max-height:620px){
 .card-builder[data-step="5"]{padding-top:76px;padding-bottom:76px;gap:10px}
 .card-builder[data-step="5"] .builder-heading h1{font-size:28px}
 .card-builder[data-step="5"] #nomination-form{gap:10px}
 .card-builder[data-step="5"] .builder-navigation .button{min-height:44px;padding:10px 14px;font-size:11px}
 .builder-details .field{margin-bottom:8px}
 .builder-controls .builder-details input:not([type=checkbox]),.builder-controls .builder-details select{min-height:44px;padding:9px 14px}
}

/* SA phone prefix shares the existing field border and focus ring. */
.builder-details .sa-phone{display:flex;align-items:center;gap:10px;height:50px;min-height:50px;padding:0 16px;border:1px solid #d8b87899;border-radius:13px;background:#33195055}
.sa-phone-flag{flex:none;width:24px;height:16px;object-fit:fill}
.sa-phone-prefix{flex:none;font-size:16px;color:#fff7e8}
.builder-controls .builder-details .sa-phone input:not([type=checkbox]){flex:1;min-width:0;width:0;height:100%;min-height:0;border:0;border-radius:0;padding:0;background:transparent;outline:none;box-shadow:none}
.builder-details .sa-phone:focus-within{outline:3px solid var(--gold);outline-offset:5px}
@media(max-width:720px){.builder-details .sa-phone{height:46px;min-height:46px;padding:0 14px}}
@media(max-height:620px){.builder-details .sa-phone{height:44px;min-height:44px;padding:0 14px}}
