/* Editor layout; shared invitation rendering lives in invitation-engine.css. */
html:has(.builder-page){scroll-padding-top:calc(var(--builder-header-height,82px) + 12px)}
.builder-page{max-width:1180px;margin:auto;padding:32px 28px 40px}
.builder-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:28px;margin-bottom:30px}
.builder-heading h1{font:700 clamp(26px,3vw,32px)/1.3 var(--font-display);letter-spacing:-.05em;margin:8px 0 12px;color:var(--text)}
.builder-heading p:not(.eyebrow){font-size:14px;line-height:1.7;color:var(--text-muted);max-width:510px}
.draft-tools{display:flex;flex-direction:column;align-items:flex-end;gap:8px;font-size:11px;white-space:nowrap;color:var(--text-muted)}
.draft-tools .btn-ghost{font-size:12px}
.builder-steps{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-bottom:28px;padding:7px;border:1px solid var(--border);border-radius:20px;background:var(--surface)}
.builder-step{display:flex;align-items:center;justify-content:center;gap:10px;min-height:49px;border:0;border-radius:14px;font:600 12px var(--font-body);color:var(--text-muted);background:transparent;cursor:pointer}
.builder-step-number{display:grid;place-items:center;width:25px;height:25px;border:1px solid var(--border);border-radius:50%;font-size:10px;flex-shrink:0}
.builder-step[aria-current="step"]{color:var(--primary-deep);background:var(--surface-soft)}
.builder-step[aria-current="step"] .builder-step-number{color:var(--surface);border-color:var(--primary-deep);background:var(--primary-deep)}
.builder-step.completed .builder-step-number{color:var(--primary-deep);border-color:var(--primary)}
.builder-layout{display:grid;grid-template-columns:360px minmax(0,1fr);gap:38px;align-items:start}
.builder-panel{grid-column:2;grid-row:1;min-width:0;padding:30px;border:1px solid var(--border);border-radius:30px;background:var(--surface);box-shadow:var(--shadow-card)}
.builder-section-title{font:700 23px/1.4 var(--font-display);letter-spacing:-.045em;color:var(--text);margin:0 0 8px}
.builder-section-hint{font-size:13px;line-height:1.65;color:var(--text-muted);margin:0 0 26px}
.builder-field{margin:0 0 23px;min-width:0}
.builder-field>label,.builder-field>.field-label{display:block;font-size:12px;font-weight:700;margin-bottom:9px;color:var(--text)}
.field-label.with-detail{display:flex;align-items:center;justify-content:space-between;gap:10px}
.builder-field input:not([type="checkbox"]):not([type="file"]):not([type="range"]),.builder-field textarea,.builder-field select{width:100%;min-height:47px;padding:12px 14px;border:1px solid var(--border);border-radius:12px;background:var(--bg);font:500 13px/1.55 var(--font-body);color:var(--text);box-sizing:border-box;outline-offset:3px}
.builder-field textarea{resize:vertical;min-height:94px}
.builder-field input:focus,.builder-field textarea:focus,.builder-field select:focus{border-color:var(--primary)}
.builder-field [aria-invalid="true"]{border-color:#cf4763}
.field-help{display:block;font-size:11px;line-height:1.6;color:var(--text-muted);margin-top:8px}
.field-error{display:block;font-size:11px;color:#b83d59;margin-top:8px;line-height:1.55}
html[data-theme="dark"] .field-error{color:#ff9cb4}
.field-counter{font-size:10px;color:var(--text-muted);font-weight:500}
.builder-field-row{display:grid;grid-template-columns:1fr 1fr;gap:13px}
.builder-segmented{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;padding:5px;background:var(--bg);border:1px solid var(--border);border-radius:13px}
.builder-segmented button{padding:10px 12px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--text-muted);font:600 12px/1.5 var(--font-body);cursor:pointer}
.builder-segmented button[aria-pressed="true"]{color:var(--primary-deep);background:var(--surface);border-color:var(--border);box-shadow:0 2px 7px rgba(70,31,47,.04)}
.template-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.template-choice{padding:9px;text-align:left;border:1px solid var(--border);border-radius:15px;background:var(--bg);color:var(--text);cursor:pointer;font:600 11px var(--font-body)}
.template-choice[aria-pressed="true"]{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary)}
.template-thumb{height:94px;border-radius:10px;display:grid;place-items:center;margin-bottom:9px;background:var(--thumb-bg);overflow:hidden}
.template-mini-card{width:65%;height:58px;border-radius:12px;background:var(--thumb-card);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;box-shadow:0 3px 8px rgba(0,0,0,.04)}
.template-mini-card img{height:28px;width:28px;object-fit:contain}
.template-mini-heart{font:700 24px/1 var(--font-body);color:var(--thumb-accent)}
.template-mini-card i{height:5px;width:58%;border-radius:3px;background:var(--thumb-accent)}
.template-choice small{display:block;font-size:9px;font-weight:500;color:var(--text-muted);line-height:1.5;margin-top:3px}
.palette-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.palette-choice{display:flex;align-items:center;gap:8px;min-height:41px;padding:8px 12px;border:1px solid var(--border);border-radius:11px;background:var(--bg);color:var(--text);font:600 11px var(--font-body);cursor:pointer}
.palette-choice i{flex:0 0 22px;height:22px;width:22px;border:1px solid rgba(0,0,0,.08);border-radius:50%;background:linear-gradient(135deg,var(--swatch-soft) 0 50%,var(--swatch) 50%)}
.palette-choice[aria-pressed="true"]{border-color:var(--primary)}
.shape-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.shape-choice{min-width:0;padding:10px;border:1px solid var(--border);border-radius:14px;background:var(--bg);color:var(--text);font:600 11px/1.5 var(--font-body);cursor:pointer;text-align:center}
.shape-thumb{display:grid;place-items:center;height:68px;margin-bottom:8px;border-radius:9px;background:var(--shape-back);overflow:hidden}
.shape-thumb svg{display:block;width:86px;max-width:90%;height:58px;overflow:visible}
.shape-thumb path{fill:var(--shape-paper);stroke:var(--shape-line);stroke-width:.7}
.shape-thumb-title{fill:var(--shape-accent);opacity:.8}.shape-thumb-copy{fill:var(--shape-ink);opacity:.35}
.shape-choice[aria-pressed="true"]{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary)}
.shape-choice:focus-visible,.palette-choice:focus-visible{outline:3px solid var(--primary);outline-offset:3px}
@media(hover:hover){.shape-choice:hover,.palette-choice:hover{border-color:var(--primary)}}
@media(max-width:480px){.palette-row{grid-template-columns:repeat(2,minmax(0,1fr))}.shape-grid{gap:8px}.shape-choice{padding:7px;font-size:10px}.shape-thumb{height:61px}}
.opening-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.opening-choice{min-height:72px;display:flex;justify-content:center;align-items:center;gap:12px;padding:13px 11px;border:1px solid var(--border);border-radius:20px;background:var(--bg);color:var(--text);font:800 12px/1.4 var(--font-body);cursor:pointer;text-align:center}
.opening-choice img{width:30px;height:30px;object-fit:contain}
.opening-choice[aria-pressed="true"]{background:var(--surface-soft);border-color:var(--primary)}
.editor-advanced{margin:20px 0 24px;padding:16px 18px;border:1px solid var(--border);border-radius:14px;background:var(--bg)}
.editor-advanced summary{font-size:12px;font-weight:600;cursor:pointer;color:var(--text);list-style-position:inside}
.editor-advanced[open] summary{margin-bottom:20px}
.editor-advanced .builder-field:last-child{margin-bottom:0}
.check-label{display:flex!important;align-items:flex-start;gap:10px;font-size:12px!important;font-weight:500!important;line-height:1.7;cursor:pointer}
.check-label input{width:16px;height:16px;margin-top:2px;accent-color:var(--primary-deep);flex-shrink:0}
.sticker-gallery{display:flex;flex-wrap:wrap;gap:8px}
.sticker-choice{width:52px;height:52px;display:grid;place-items:center;border:1px solid var(--border);border-radius:13px;background:var(--bg);cursor:pointer}
.sticker-choice img{height:34px;width:34px;object-fit:contain}
.sticker-choice[aria-pressed="true"]{background:var(--surface-soft);border-color:var(--primary)}
.options-list{display:flex;flex-direction:column;gap:9px}
.option-row{display:flex;gap:7px;align-items:center}
.option-row input{flex:1;min-width:0}
.option-delete{display:grid;place-items:center;width:35px;height:38px;flex-shrink:0;border:0;border-radius:9px;background:transparent;color:var(--text-muted);font:400 22px var(--font-body);cursor:pointer}
.option-delete:hover{background:var(--surface-soft)}
.option-delete:disabled{opacity:.3;cursor:default}
.option-add{width:100%;margin-top:10px;padding:11px;border:1px dashed var(--border);border-radius:11px;background:transparent;color:var(--primary-deep);font:600 12px var(--font-body);cursor:pointer}
.option-add:disabled{opacity:.4;cursor:default}
.builder-nav{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-top:28px;padding-top:23px;border-top:1px solid var(--border)}
.builder-nav .btn-primary{min-width:146px;min-height:46px;font-size:13px;text-align:center}
.builder-nav .btn-ghost{font-size:12px}
.builder-progress-caption{font-size:10px;color:var(--text-muted);margin-top:14px}
.preview-panel{--preview-border:8px;--preview-radius:42px;grid-column:1;grid-row:1;position:sticky;top:calc(var(--builder-header-height,82px) + 16px);padding:0;min-width:0}
.preview-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;max-width:380px;margin:0 auto 17px}
.preview-heading .eyebrow{font:600 23px/1.2 var(--font-note);color:var(--primary-dark)}
.preview-heading h2{font:600 14px var(--font-body);margin-top:5px;color:var(--text)}
.preview-replay{font-size:11px!important;padding:8px 0!important;white-space:nowrap}
.preview-device{container:phone-preview / inline-size;position:relative;width:min(100%,344px);height:656px;margin:auto;border:var(--preview-border) solid var(--frame);border-radius:var(--preview-radius);overflow:hidden;box-shadow:5px 8px 0 color-mix(in srgb,var(--frame) 25%,transparent);background:var(--frame)}
.preview-device-notch{position:absolute;z-index:4;top:9px;left:50%;transform:translateX(-50%);width:68px;height:10px;border-radius:12px;background:#392832;pointer-events:none}
.preview-device .builder-preview{position:absolute;top:0;left:0;width:100%;height:100%;min-height:0;border-radius:calc(var(--preview-radius) - var(--preview-border));overflow:hidden;transform-origin:top left}
.preview-note{max-width:310px;margin:17px auto 0;text-align:center;font-size:11px;line-height:1.7;color:var(--text-muted)}
.builder-view-switch{display:none}
.builder-note{padding:14px 16px;border:1px solid var(--border);border-radius:13px;background:var(--surface-soft);font-size:12px;line-height:1.7;color:var(--text-muted);margin:0 0 22px}
.builder-note strong{color:var(--text);font-weight:600}
.review-list{margin:0 0 24px}
.review-row{display:flex;gap:14px;justify-content:space-between;align-items:center;padding:13px 0;border-bottom:1px solid var(--border);font-size:12px}
.review-row dt{color:var(--text-muted)}
.review-row dd{color:var(--text);text-align:right;max-width:65%;font-weight:600;margin:0;overflow-wrap:anywhere}
.publish-error{padding:13px;border:1px solid #e291a3;border-radius:12px;font-size:12px;line-height:1.6;color:var(--text);margin:15px 0}
.published-hero{text-align:center;padding:4px 0 24px}
.published-hero img{width:72px;height:72px;object-fit:contain;margin-bottom:15px}
.published-hero h2{font:600 29px/1.2 var(--font-display);color:var(--text);margin:0 0 12px}
.published-hero p{font-size:12px;color:var(--text-muted);line-height:1.7;margin:auto;max-width:340px}
.share-link{display:flex;align-items:center;gap:8px;padding:9px;border:1px solid var(--border);border-radius:13px;background:var(--bg);margin-bottom:15px}
.share-link input{min-width:0;flex:1;background:transparent;border:0;outline:none;color:var(--text);font:500 12px var(--font-body);padding:7px}
.share-link button{min-height:37px;font-size:11px;padding:8px 12px;flex-shrink:0}
.publish-actions{display:flex;flex-direction:column;gap:10px;margin-bottom:22px}
.publish-actions a,.publish-actions button{text-align:center;min-height:43px;font-size:12px}
.builder-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);z-index:100;max-width:calc(100% - 30px);padding:13px 20px;border:1px solid var(--border);border-radius:13px;background:var(--surface);box-shadow:0 10px 35px rgba(0,0,0,.15);color:var(--text);font-size:12px;text-align:center}
.builder-dialog{max-width:390px;width:calc(100% - 36px);margin:auto;padding:26px;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:21px;box-sizing:border-box}
.builder-dialog::backdrop{background:rgba(20,14,18,.5);backdrop-filter:blur(3px)}
.builder-dialog h2{font:600 25px/1.3 var(--font-display);margin-bottom:12px}
.builder-dialog p{font-size:13px;line-height:1.7;color:var(--text-muted)}
.dialog-actions{display:flex;gap:10px;margin-top:22px}
.dialog-actions button{flex:1;font-size:12px;padding:11px}
.media-upload{display:flex;align-items:center;gap:12px;padding:14px;border:1px dashed var(--border);border-radius:13px;color:var(--text-muted);font-size:12px;line-height:1.6}
.media-upload input{max-width:100%;font-size:11px}
.media-thumb{max-width:100%;height:90px;object-fit:cover;border-radius:10px;margin-bottom:8px}
.media-item{padding:12px;border:1px solid var(--border);border-radius:13px;font-size:11px;margin-top:12px;overflow-wrap:anywhere}
.media-item button{border:0;background:transparent;color:var(--primary-deep);font:600 11px var(--font-body);cursor:pointer}
.builder-library{max-width:490px;max-height:80dvh;overflow:auto}
.library-item{display:block;padding:14px 0;border-bottom:1px solid var(--border);color:var(--text);font-size:13px;text-decoration:none;overflow-wrap:anywhere}
.library-item small{display:block;margin-top:5px;font-size:11px;color:var(--primary-deep)}
html[data-theme="dark"] .preview-device{box-shadow:0 22px 48px rgba(0,0,0,.25)}
@media(max-width:1100px){.builder-page{padding-left:24px;padding-right:24px}.builder-layout{gap:24px;grid-template-columns:344px minmax(0,1fr)}.builder-panel{padding:24px}.builder-step{gap:7px;font-size:11px}.builder-heading{align-items:flex-start}.builder-heading p:not(.eyebrow){max-width:410px}}
@media(max-width:820px){.builder-page{max-width:620px;padding:27px 16px 40px}.builder-heading{margin-bottom:23px;gap:12px}.builder-heading h1{font-size:33px}.builder-heading p:not(.eyebrow){font-size:12px}.draft-tools{padding-top:4px;font-size:9px;white-space:normal;text-align:right;min-width:91px}.draft-tools .btn-ghost{font-size:10px;padding:6px 0}.builder-steps{padding:5px;gap:3px;margin-bottom:16px;border-radius:15px}.builder-step{min-height:45px;padding:6px 3px;flex-direction:column;gap:4px;font-size:9px;border-radius:10px}.builder-step-number{width:21px;height:21px;font-size:9px}.builder-layout{display:block}.builder-panel{padding:23px 20px;border-radius:21px}.builder-section-title{font-size:27px}.builder-section-hint{font-size:12px}.builder-view-switch{display:grid;grid-template-columns:1fr 1fr;padding:4px;border:1px solid var(--border);border-radius:12px;background:var(--surface);margin-bottom:16px;position:sticky;top:var(--builder-header-height,107px);z-index:15}.builder-view-switch button{padding:10px;border:0;border-radius:8px;color:var(--text-muted);background:transparent;font:600 12px var(--font-body);cursor:pointer}.builder-view-switch button[aria-pressed="true"]{color:var(--primary-deep);background:var(--surface-soft)}.builder-page[data-view="settings"] .preview-panel{display:none}.builder-page[data-view="preview"] .builder-panel{display:none}.preview-panel{position:static;padding:5px 0}.preview-device{max-width:350px}.preview-heading{padding:0 4px;max-width:350px}.builder-nav{position:sticky;bottom:0;margin:22px -8px -9px;padding:15px 8px 9px;background:var(--surface);z-index:12;box-shadow:0 -9px 18px var(--surface)}.builder-note{font-size:11px}.template-thumb{height:83px}.builder-field{margin-bottom:21px}.opening-grid{gap:7px}.opening-choice{font-size:9px;min-height:87px}.opening-choice img{width:34px;height:34px}}
@media(max-width:380px){.builder-heading .eyebrow{font-size:8px}.builder-heading h1{font-size:29px}.builder-heading p:not(.eyebrow){font-size:11px}.builder-panel{padding:21px 15px}.builder-field-row{gap:9px}.template-grid{gap:7px}.template-choice{padding:7px}.template-thumb{height:72px}.template-choice small{font-size:8px}.builder-step{font-size:8px}.opening-choice{font-size:8px}.builder-view-switch{top:var(--builder-header-height,107px)}}
@media(max-width:820px){
  .builder-heading{display:block;margin-bottom:18px}
  .builder-heading h1{font-size:32px;margin-bottom:8px}
  .builder-heading p:not(.eyebrow){max-width:none;font-size:12px}
  .draft-tools{flex-direction:row;align-items:center;justify-content:space-between;padding-top:10px;font-size:10px;text-align:left}
  .draft-tools .btn-ghost{font-size:11px}
  .preview-panel,.builder-panel{scroll-margin-top:54px}
  .preview-device{width:100%;height:calc(clamp(540px,calc(100dvh - 202px),640px) + 2 * var(--preview-border));aspect-ratio:auto}
  .builder-section-title{font-size:22px;line-height:1.4}
  .opening-choice{font-size:12px;min-height:66px;gap:9px}
  .opening-choice img{width:28px;height:28px}
}
/* The author chooses the plan before publication; entitlements come from the server. */
.builder-plans{margin:0 0 25px}
.builder-plans h3{font:800 14px/1.5 var(--font-body);color:var(--text);margin:0 0 12px}
.builder-plan-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.builder-plan{display:flex;flex-direction:column;gap:12px;min-width:0;padding:17px;text-align:left;border:1px solid var(--border);border-radius:18px;background:var(--bg);color:var(--text);font-family:var(--font-body);cursor:pointer}
.builder-plan[aria-pressed="true"]{border-color:var(--primary);background:var(--surface-soft);box-shadow:inset 0 0 0 1px var(--primary)}
.builder-plan:disabled{cursor:default;opacity:.6}
.builder-plan-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px}
.builder-plan-heading i{display:grid;place-items:center;width:20px;height:20px;border:1px solid var(--border);border-radius:50%;font-size:11px;font-style:normal;flex-shrink:0;color:var(--text-muted)}
.builder-plan[aria-pressed="true"] .builder-plan-heading i{background:var(--primary-deep);border-color:var(--primary-deep);color:var(--bg)}
.builder-plan-price{font-size:17px;line-height:1.5;font-weight:800}
.builder-plan-price small{display:block;font-size:10px;line-height:1.5;font-weight:500;color:var(--text-muted)}
.builder-plan-detail{display:block;font-size:11px;line-height:1.7;color:var(--text-muted)}
.builder-plan-help{font-size:11px;line-height:1.7;color:var(--text-muted);margin:12px 0 0}
.builder-plan-mode{padding:12px 14px;border-radius:12px;background:var(--surface-soft);font-size:11px;line-height:1.7;color:var(--text);margin:10px 0 0}
.builder-plan-active{display:flex;align-items:center;gap:14px;margin:0 0 24px;padding:16px;border:1px solid var(--border);border-radius:16px;background:var(--surface-soft);font-size:12px;line-height:1.6}
.builder-plan-active>span{font:600 34px/1 var(--font-note);color:var(--primary-deep)}
.builder-plan-active p{font-size:11px;color:var(--text-muted);margin:3px 0 0}
.builder-answers-note p{margin:6px 0 10px}
.builder-note a{color:var(--primary-deep);font-weight:700;text-decoration:underline;text-underline-offset:4px}
.published-plan-status{padding:16px 18px;margin-bottom:20px;border:1px solid var(--border);border-radius:16px;background:var(--surface-soft);font-size:12px;line-height:1.7;color:var(--text)}
.published-plan-status p{font-size:11px;line-height:1.7;margin:7px 0 0;color:var(--text-muted)}
.published-plan-status button{margin-top:12px;max-width:100%;font-size:11px;line-height:1.5;white-space:normal}
.published-plan-status .published-checkout-error{color:var(--text);font-weight:600}
.private-link-field{margin:17px 0 6px}
.private-link-field label{display:block;font-size:11px;font-weight:700;color:var(--text);margin-bottom:8px}
.private-link-field input{width:100%;min-height:44px;padding:11px 13px;border:1px solid var(--border);border-radius:11px;background:var(--bg);color:var(--text-muted);font:500 11px/1.5 var(--font-body);box-sizing:border-box}
.builder-nav .btn-primary{max-width:78%;white-space:normal;line-height:1.5}
@media(max-width:480px){.builder-plan-options{gap:8px}.builder-plan{padding:13px 11px;gap:10px}.builder-plan-price{font-size:14px}.builder-plan-detail{font-size:10px}.builder-plan-heading{font-size:12px}.builder-nav .btn-primary{font-size:12px;min-width:0}.published-hero h2{font-size:23px;line-height:1.4}}

/* Direct access to each screen keeps previewing a personal story simple. */
.preview-screens{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;max-width:350px;margin:18px auto 0}
.preview-screens button{min-height:34px;padding:6px 5px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--text-muted);font:600 10px/1.5 var(--font-body);cursor:pointer}
.preview-screens button[aria-pressed="true"]{border-color:var(--border);background:var(--surface-soft);color:var(--primary-deep)}
.preview-screens button:disabled{opacity:.38;cursor:default}
.preview-screens button:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
@media(min-width:821px){.preview-screens{grid-template-columns:repeat(4,minmax(0,1fr));max-width:390px}}
/* A full-size phone is more useful than fitting miniature text into a laptop.
   Keep its screen navigation above it when the page needs vertical scrolling. */
@media(min-width:821px){
  .preview-panel{display:flex;flex-direction:column}
  .preview-heading{width:100%;max-width:344px;margin-bottom:12px}
  .preview-screens{order:1;width:100%;max-width:344px;margin:0 auto 8px;gap:6px}
  .preview-screens button{font-size:10px;min-height:32px;padding:6px 4px}
  .preview-device{order:2;flex-shrink:0}
  .preview-note{display:none}
}
@media(min-width:821px) and (max-height:820px){.preview-panel{position:static}}
.opening-choice{flex-direction:column;gap:9px;min-height:95px;border-radius:16px}
.opening-sample{position:relative;display:grid;place-items:center;width:58px;height:36px;color:var(--primary-deep)}
.opening-sample-env{height:32px;transform:rotate(-5deg);border-radius:3px;background:var(--surface);border:1px solid var(--border);box-shadow:3px 4px 0 var(--surface-soft)}
.opening-sample-env:before,.opening-sample-env:after{content:"";position:absolute;left:12px;right:12px;height:2px;background:var(--border);top:12px}
.opening-sample-env:after{right:23px;top:18px}
.opening-sample-scratch{border-radius:5px;background:repeating-linear-gradient(135deg,var(--surface-soft) 0 4px,var(--border) 4px 5px);border:1px solid var(--border)}
.opening-sample-scratch:after{content:"";position:absolute;width:24px;height:9px;transform:rotate(-25deg);border-radius:50%;background:var(--surface)}
.opening-sample-code{width:auto;font:700 11px/1 var(--font-body);letter-spacing:1px}
.opening-sample-direct{font:600 33px/1 var(--font-note)}
.template-choice-nocturne .template-mini-card{border-radius:50% 50% 9px 9px;box-shadow:0 0 0 1px color-mix(in srgb,var(--thumb-accent) 30%,transparent)}
.template-choice-nocturne .template-mini-heart{font-size:18px}
.template-choice-matcha .template-mini-card{transform:rotate(-4deg);border-radius:3px;box-shadow:3px 3px 0 color-mix(in srgb,var(--thumb-accent) 20%,transparent)}
.template-choice-matcha .template-mini-card i{width:45%;height:3px}
.published-handnote{display:block;font:600 35px/1.3 var(--font-note);color:var(--primary-deep);margin-bottom:16px}
.photo-crop{padding:16px;margin:0 0 18px;border:1px solid var(--border);border-radius:13px;min-width:0}
.photo-crop legend{padding:0 6px;font-size:12px;font-weight:700;color:var(--text)}
.photo-crop-layout{display:grid;grid-template-columns:104px minmax(0,1fr);align-items:center;gap:18px}
.media-crop-thumb{width:104px;height:104px;object-fit:cover;border-radius:15px}
.photo-crop-controls{display:grid;gap:8px;min-width:0}
.photo-crop-controls label{font-size:10px;line-height:1.5;color:var(--text-muted)}
.photo-crop-controls input{width:100%;height:20px;accent-color:var(--primary-deep);padding:0}
.photo-crop .btn-ghost{font-size:11px;padding:8px 0}
.media-item-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.media-item-heading span{min-width:0}
.media-item-heading button{flex-shrink:0}
.media-item audio,.media-item video{display:block;width:100%;max-width:100%;border-radius:9px}
.media-item video{max-height:230px;background:var(--surface-soft)}
@media(max-width:480px){.photo-crop-layout{grid-template-columns:88px minmax(0,1fr);gap:12px}.media-crop-thumb{width:88px;height:88px}.opening-choice{min-height:88px}.preview-screens{max-width:350px}}

.media-record-button{display:inline-flex;gap:9px;align-items:center;border:1px solid var(--border);border-radius:12px;padding:11px 15px;background:var(--surface-soft);color:var(--text);font:700 12px var(--font-body);cursor:pointer;margin-top:10px}.media-record-button span{color:var(--primary);font-size:14px}.media-position-label{display:block;color:var(--text-muted);font-size:11px;font-weight:700;margin:15px 0 6px}.media-item select{width:100%;padding:11px;border:1px solid var(--border);border-radius:10px;background:var(--bg);color:var(--text);font:500 12px var(--font-body)}.media-draft-note{border-left:2px solid var(--primary);padding:3px 0 3px 15px;margin:20px 0;color:var(--text);font-size:12px;line-height:1.7}.media-draft-note p{margin:5px 0;color:var(--text-muted)}.published-cover{margin:24px 0}.published-cover img{display:block;width:100%;max-width:510px;border-radius:17px;border:1px solid var(--border)}.published-cover figcaption{font-size:11px;color:var(--text-muted);margin:9px 0}.publish-error .btn-secondary{display:block;margin-top:13px}

.text-presets{margin-bottom:25px}.text-preset-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.text-preset-grid button{padding:16px;border:1px solid var(--border);border-radius:12px;text-align:left;background:var(--bg);color:var(--text);cursor:pointer}.text-preset-grid button:hover{border-color:var(--primary);background:var(--surface-soft)}.text-preset-grid span{display:block;font:600 18px var(--font-note);color:var(--primary-deep);margin-bottom:8px}.text-preset-grid strong{display:block;font:700 12px/1.6 var(--font-body)}.text-preset-grid small{display:block;font:400 11px/1.65 var(--font-body);color:var(--text-muted);margin-top:6px}.text-preset-dialog{width:min(530px,calc(100vw - 28px));max-height:calc(100dvh - 40px);overflow:auto}.text-preset-preview h2{font:700 21px/1.5 var(--font-display)}.text-preset-handnote{display:block;font:600 27px var(--font-note);color:var(--primary-deep);margin:26px 0 14px}.text-preset-preview h3{font:600 19px/1.5 var(--font-display);margin:10px 0}.text-preset-preview p{font-size:13px;line-height:1.8;color:var(--text-muted)}.text-preset-ending{padding:18px;margin:24px 0;background:var(--surface-soft);border-radius:13px}.text-preset-ending strong{font-size:13px}@media(max-width:480px){.text-preset-grid{grid-template-columns:1fr}.text-preset-dialog .dialog-actions{flex-wrap:wrap}.text-preset-dialog .dialog-actions button{flex:1;min-width:150px}}

/* Invitation appearance / atmosphere subnavigation. */
.style-tabs {display:flex;gap:6px;padding:5px;margin:0 0 27px;border:1px solid var(--border);border-radius:14px;background:var(--bg);}
.style-tabs button {flex:1;min-height:42px;border:0;border-radius:10px;background:transparent;color:var(--text-muted);font:700 12px var(--font-body);cursor:pointer;}
.style-tabs button[aria-pressed="true"] {background:var(--surface-soft);color:var(--primary-deep);box-shadow:0 2px 7px #00000008;}
.atmosphere-settings h3 {font:600 28px/1.2 var(--font-note);color:var(--primary-deep);margin:0 0 12px;}
.atmosphere-settings>.field-help {max-width:48ch;margin:0 0 22px;}
.atmosphere-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:26px;}
.atmosphere-choice {appearance:none;min-width:0;padding:11px 11px 15px;border:1px solid var(--border);border-radius:18px;background:var(--bg);text-align:left;color:var(--text);font-family:var(--font-body);cursor:pointer;}
.atmosphere-choice[aria-pressed="true"] {border-color:var(--primary);box-shadow:0 0 0 1px var(--primary);background:var(--surface-soft);}
.atmosphere-choice-name {display:flex;justify-content:space-between;gap:8px;margin-top:12px;font-size:12px;font-weight:800;}
.atmosphere-choice-name>span {color:var(--primary-deep);}
.atmosphere-choice small {display:block;font-size:10px;line-height:1.6;margin-top:5px;color:var(--text-muted);}
.atmosphere-sample {display:block;position:relative;height:88px;border-radius:11px;background:var(--atmosphere-bg);overflow:hidden;color:var(--atmosphere-accent);}
.atmosphere-sample i {position:absolute;left:25%;top:25%;width:16px;height:16px;animation:onlyty-atmosphere-sample 6s ease-in-out -2s infinite;}
.atmosphere-sample i:nth-child(2) {left:62%;top:58%;animation-delay:-4s;}
.atmosphere-sample i:nth-child(3) {left:78%;top:19%;width:11px;height:11px;animation-delay:-1s;}
.atmosphere-sample-flowers i {--petal:var(--atmosphere-accent);background:radial-gradient(circle at 50% 50%,var(--petal) 0 23%,transparent 24%),radial-gradient(circle at 50% 24%,var(--petal) 0 23%,transparent 24%),radial-gradient(circle at 76% 44%,var(--petal) 0 23%,transparent 24%),radial-gradient(circle at 65% 75%,var(--petal) 0 23%,transparent 24%),radial-gradient(circle at 33% 75%,var(--petal) 0 23%,transparent 24%),radial-gradient(circle at 23% 44%,var(--petal) 0 23%,transparent 24%);opacity:.7;}
.atmosphere-sample-hearts i::before {content:'♡';font:400 23px/1 Georgia,serif;}
.atmosphere-sample-stars i {width:4px;height:4px;border-radius:50%;background:currentColor;box-shadow:0 0 8px currentColor;}
.atmosphere-sample-stars i:nth-child(3) {width:46px;height:1px;background:linear-gradient(90deg,transparent,var(--atmosphere-accent));transform:rotate(30deg);}
.atmosphere-sample-fireflies i {width:5px;height:5px;border-radius:50%;background:color-mix(in srgb,var(--atmosphere-accent) 50%,#ffe9a7);box-shadow:0 0 12px 4px color-mix(in srgb,var(--atmosphere-accent) 30%,transparent);}
.atmosphere-sample-none i {display:none;}
.atmosphere-sample-none::after {content:'';position:absolute;width:42px;height:52px;left:calc(50% - 21px);top:18px;border:1px solid currentColor;border-radius:9px;opacity:.45;}
.atmosphere-settings .atmosphere-footnote {font-size:11px;margin:0;}
@keyframes onlyty-atmosphere-sample {0%,100%{translate:0 0;opacity:.45}50%{translate:3px 10px;opacity:.85}}
@media(max-width:400px) {.atmosphere-grid {gap:9px;}.atmosphere-choice {padding:9px 9px 12px;}.atmosphere-choice small {font-size:10px;}}
@media(prefers-reduced-motion:reduce) {.atmosphere-sample i {animation:none!important;}}
.atmosphere-choice:last-child {grid-column:1/-1;display:grid;grid-template-columns:76px minmax(0,1fr);column-gap:15px;align-items:center;padding:12px;}
.atmosphere-choice:last-child .atmosphere-sample {grid-row:1/3;height:58px;}
.atmosphere-choice:last-child .atmosphere-choice-name,.atmosphere-choice:last-child small {margin:0;}
.atmosphere-choice:last-child .atmosphere-sample-none::after {height:36px;width:28px;left:calc(50% - 14px);top:11px;}
.atmosphere-settings .atmosphere-group-label {margin:0 0 12px;font:700 12px var(--font-body);color:var(--text);}
.button-atmosphere-field .field-help {margin:10px 0 0;}
.button-atmosphere-field .builder-segmented button {min-height:46px;padding:8px 6px;font-size:11px;}

/* Keep the invitation's visual language; make the editor's primary path lighter. */
.builder-steps{grid-template-columns:repeat(4,minmax(0,1fr))}
.builder-section-title:focus{outline:none}
.builder-panel{scroll-margin-top:calc(var(--builder-header-height,82px) + 16px)}
.builder-ready-note{margin:0 0 24px;color:var(--text-muted);font:500 12px/1.7 var(--font-body)}
.draft-tools{position:relative;display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;justify-content:flex-end;gap:8px 12px;max-width:380px}
#draftStatus{max-width:300px;white-space:normal;line-height:1.6;text-align:right}
.draft-menu{position:relative;flex-shrink:0;z-index:20}
.draft-menu>summary{display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--text);cursor:pointer;list-style:none;font-size:20px;line-height:1}
.draft-menu>summary::-webkit-details-marker{display:none}
.draft-menu[open]{background:var(--surface);border:1px solid var(--border);border-radius:15px;padding:8px;position:absolute;right:0;top:0;box-shadow:0 10px 28px color-mix(in srgb,var(--text) 12%,transparent)}
.draft-menu[open]>summary{margin-left:auto;margin-bottom:4px}
.draft-menu .btn-ghost{display:block!important;padding:10px 12px!important;text-align:left;white-space:nowrap;width:100%}
#applyChanges{font-size:11px;min-height:36px;padding:8px 12px;white-space:normal}
#applyChanges[hidden]{display:none}
.builder-nav{position:sticky;bottom:12px;z-index:12;background:var(--surface);padding:18px 0 8px;box-shadow:0 -10px 20px var(--surface)}
.builder-nav .btn-primary{min-height:48px;max-width:82%;line-height:1.4}
.editor-advanced>summary{line-height:1.5}
.text-preset-chips,.final-token-chips{display:flex;flex-wrap:wrap;gap:7px;margin:10px 0 22px}
.text-preset-chips button,.final-token-chips button{border:1px solid var(--border);border-radius:30px;padding:8px 12px;min-height:35px;background:var(--bg);color:var(--primary-deep);font:600 11px var(--font-body);cursor:pointer}
.final-token-chips{margin-top:-10px}
.preview-toolbar{max-width:344px;width:100%;margin:0 auto 10px;display:grid;grid-template-columns:1fr auto;gap:6px 10px;align-items:center}
#previewPlanStatus{margin:0;color:var(--text-muted);font:600 10px/1.6 var(--font-body)}
.preview-plan-switch{display:flex;padding:3px;border:1px solid var(--border);border-radius:30px;background:var(--surface)}
.preview-plan-switch button{border:0;background:transparent;border-radius:25px;padding:6px 9px;color:var(--text-muted);font:600 10px var(--font-body);cursor:pointer}
.preview-plan-switch button[aria-pressed="true"]{background:var(--surface-soft);color:var(--primary-deep)}
#previewPlanHint{grid-column:1/-1;margin:0;font-size:10px;line-height:1.6}
#previewPlanHint[hidden]{display:none}
.preview-more{max-width:344px;width:100%;margin:0 auto 10px;color:var(--text-muted);font:600 10px/1.6 var(--font-body)}
.preview-more>summary{cursor:pointer;list-style-position:inside;min-height:27px;padding:4px 0}
.preview-more .preview-screens{margin:8px 0 4px;max-width:none}
.preview-more[open]{padding:0 10px 8px;border:1px solid var(--border);border-radius:12px;background:var(--surface)}
.preview-heading .preview-replay{white-space:normal;max-width:115px;text-align:right;line-height:1.5}
.review-row{display:grid;grid-template-columns:minmax(90px,.7fr) minmax(0,1.2fr) auto;gap:10px;align-items:start}
.review-row dd{max-width:none;white-space:pre-line;line-height:1.7}
.review-edit{padding:3px 0;border:0;background:none;color:var(--primary-deep);font:600 10px/1.6 var(--font-body);cursor:pointer;text-underline-offset:3px;text-decoration:underline}
.review-cover{margin:0 0 24px}
.review-cover h3,.recipient-share-section h3,.author-access-section h3{font:800 13px/1.6 var(--font-body);color:var(--text);margin:0 0 12px}
#coverPreview{border:1px solid var(--border);border-radius:16px;overflow:hidden;background:var(--bg);font:500 11px/1.7 var(--font-body);color:var(--text-muted)}
#coverPreview>p{padding:16px;margin:0}
#coverPreview>.btn-ghost{margin:0 16px 14px;font-size:11px}
#coverPreview img{display:block;width:100%;aspect-ratio:1200/630;object-fit:contain}
.messenger-cover-copy{padding:14px 16px}
.messenger-cover-copy strong{color:var(--text);font-weight:700;font-size:12px}
.messenger-cover-copy p{margin:6px 0}
.messenger-cover-copy>span{font-size:10px}
.author-access-section{padding-top:23px;border-top:1px solid var(--border);margin-top:28px}
.author-access-section>p{font:500 11px/1.7 var(--font-body);color:var(--text-muted);margin:0 0 15px}
@media(min-width:821px){.preview-toolbar{order:1}.preview-more{order:2}.preview-device{order:3}.preview-note{order:4}}
@media(max-width:820px){
 .builder-page{padding-top:18px}
 .builder-panel,.preview-panel{scroll-margin-top:calc(var(--builder-header-height,107px) + 65px)}
 .builder-heading{margin-bottom:14px}
 .builder-heading .eyebrow,.builder-heading #builderIntro{display:none}
 .builder-heading h1{font-size:25px;line-height:1.4;margin-bottom:8px}
 .draft-tools{max-width:none;justify-content:space-between;padding-top:0;gap:5px 8px}
 #draftStatus{max-width:calc(100% - 50px);text-align:left;font-size:9px}
 .builder-steps{margin-bottom:12px}
 .builder-view-switch{margin-bottom:12px}
 .builder-ready-note{font-size:11px;margin-bottom:18px}
 .builder-nav{bottom:0;margin:22px -8px -9px;padding:15px 8px 9px}
 .builder-nav .btn-primary{max-width:84%;min-width:0;font-size:12px}
 .review-row{grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:5px 10px}
 .review-edit{grid-column:2;text-align:right;justify-self:end;margin-bottom:3px}
 .preview-toolbar{max-width:350px}
}
