.htw-overlay{position:fixed;inset:0;z-index:99999;background:rgb(0 0 0 / 90%);display:flex;align-items:center;justify-content:center;padding:24px;color:var(--text-primary);font-family:Inter,sans-serif}
.htw-overlay *{box-sizing:border-box}.htw-overlay [hidden]{display:none!important}
.htw-dialog{position:relative;display:flex;flex-direction:column;width:min(100%,700px);max-height:calc(100dvh - 48px);min-height:min(540px,calc(100dvh - 48px));background:var(--bg-card);border:1px solid var(--border-hover);border-radius:20px;box-shadow:0 12px 32px rgb(0 0 0 / 24%);overflow:hidden}
.htw-header{display:flex;align-items:center;gap:12px;padding:20px 24px;flex-shrink:0;border-bottom:1px solid var(--border-default)}
.htw-heading-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:color-mix(in srgb,var(--accent-neon) 12%,transparent);color:var(--accent-neon)}
.htw-heading-icon svg{width:22px;height:22px}.htw-header>.htw-icon-button{margin-left:auto}
.htw-eyebrow{font-size:13px;font-weight:700;margin:0 0 4px}.htw-header #htw-progress{font-size:12px;color:var(--text-secondary);margin:0}
.htw-progress-track{height:3px;flex-shrink:0;background:var(--bg-page)}.htw-progress-track>div{height:100%;background:var(--accent-neon);transition:width .15s ease}
.htw-main{padding:28px;flex:1;overflow:auto;min-height:0;scrollbar-width:thin;scrollbar-color:var(--accent-neon) transparent}
.htw-main h2{font-size:24px;line-height:1.25;font-weight:800;letter-spacing:-.025em;margin:0 0 10px;outline:none}
.htw-help{color:var(--text-secondary);font-size:14px;line-height:1.6;margin:0 0 22px}.htw-help:empty{display:none}
.htw-choices{display:grid;gap:12px}.htw-choice{display:flex;align-items:center;gap:16px;width:100%;text-align:left;padding:18px;border:1px solid var(--border-hover);background:var(--bg-page);color:var(--text-primary);border-radius:14px;cursor:pointer}
.htw-choice:hover{background:var(--bg-card-hover)}.htw-choice[aria-pressed=true]{border-color:var(--accent-neon);background:color-mix(in srgb,var(--accent-neon) 9%,var(--bg-page))}
.htw-choice-icon{color:var(--accent-neon);display:flex;flex-shrink:0}.htw-choice-icon svg{width:25px;height:25px}.htw-choice strong{display:block;font-size:15px;margin-bottom:5px}.htw-choice small{display:block;font-size:13px;line-height:1.5;color:var(--text-secondary)}
.htw-selected{display:flex;margin-left:auto;flex-shrink:0;color:var(--accent-neon);opacity:0}.htw-selected svg{width:18px;height:18px}.htw-choice[aria-pressed=true] .htw-selected{opacity:1}
.htw-label{display:block;font-weight:700;font-size:14px;line-height:1.5;margin:18px 0 8px}.htw-label:first-child{margin-top:0}
.htw-input,.htw-editor{display:block;width:100%;border:1px solid var(--border-hover);border-radius:12px;background:var(--bg-page);color:var(--text-primary);font:inherit;font-size:16px;line-height:1.6;padding:12px 14px;min-width:0}
.htw-input::placeholder{color:var(--text-secondary)}.htw-editor{position:relative;min-height:180px;overflow-wrap:anywhere;white-space:pre-wrap}.htw-editor[data-editor=header]{min-height:95px}
.htw-editor[data-empty=true][aria-placeholder]::before{content:attr(aria-placeholder);position:absolute;top:12px;left:14px;color:var(--text-secondary);pointer-events:none}
.htw-input:focus,.htw-editor:focus{outline:2px solid var(--accent-neon);outline-offset:2px}.htw-personal{display:inline;border-radius:5px;padding:1px 4px;color:var(--accent-neon);background:color-mix(in srgb,var(--accent-neon) 12%,transparent);white-space:normal}
.htw-count{font-size:12px;color:var(--text-secondary);text-align:right;margin:8px 0 16px;font-variant-numeric:tabular-nums}
.htw-details{margin:10px 0;border-top:1px solid var(--border-default);padding-top:10px}.htw-details summary{font-size:13px;font-weight:650;cursor:pointer;min-height:40px;align-content:center}.htw-details p{font-size:13px;color:var(--text-secondary);line-height:1.5;margin:8px 0 12px}
.htw-tools{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}.htw-button,.htw-icon-button,.htw-text-button{font:inherit;color:var(--text-primary);cursor:pointer;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;line-height:1.3}
.htw-button{padding:10px 16px;border:1px solid var(--border-hover);background:var(--bg-page);font-size:14px;font-weight:700}.htw-button svg{width:17px;height:17px;flex-shrink:0}.htw-primary{background:var(--accent-neon);color:var(--bg-page);border-color:var(--accent-neon)}
.htw-icon-button{border:0;background:transparent;width:44px;flex-shrink:0;padding:10px}.htw-icon-button svg{width:20px;height:20px}.htw-text-button{border:0;background:transparent;padding:8px 4px;color:var(--accent-neon);font-size:13px;font-weight:650}
.htw-overlay button:disabled{opacity:.55;cursor:wait}.htw-overlay button:focus-visible,.htw-details summary:focus-visible{outline:2px solid var(--accent-neon);outline-offset:3px}
.htw-footer{padding:18px 24px;display:flex;justify-content:space-between;gap:12px;border-top:1px solid var(--border-default);background:var(--bg-card);flex-shrink:0}.htw-footer #htw-next{margin-left:auto;min-width:140px}
.htw-error{margin:20px 0 0;border-left:3px solid currentColor;color:var(--color-danger,var(--text-primary));background:var(--bg-page);padding:12px 14px;font-size:14px;line-height:1.6}
.htw-file{position:absolute;width:1px;height:1px;opacity:0}.htw-upload{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:22px;border:1px dashed var(--border-hover);background:var(--bg-page);border-radius:14px;cursor:pointer}.htw-upload svg{width:32px;height:32px;color:var(--accent-neon)}.htw-upload strong{font-size:15px}.htw-upload span{font-size:12px;color:var(--text-secondary);overflow-wrap:anywhere}.htw-file:focus-visible+.htw-upload{outline:2px solid var(--accent-neon);outline-offset:3px}
.htw-image{max-height:180px;max-width:100%;object-fit:contain;display:block;margin:12px auto;border-radius:10px}.htw-range-labels{display:flex;justify-content:space-between;font-size:12px;color:var(--text-secondary)}#htw-intensity{width:100%;accent-color:var(--accent-neon);min-height:32px}
.htw-button-list>div{display:flex;align-items:center;gap:8px;border:1px solid var(--border-hover);border-radius:12px;padding:10px;margin-bottom:8px}.htw-button-list>div>span{flex:1;min-width:0;overflow-wrap:anywhere;font-size:14px}.htw-button-edit{padding:16px;border:1px solid var(--border-hover);border-radius:14px}
.htw-thumbnails{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.htw-thumbnail{border:1px solid var(--border-hover);background:var(--bg-page);border-radius:10px;overflow:hidden;color:var(--text-primary);cursor:pointer}.htw-thumbnail img{width:100%;height:80px;object-fit:cover}.htw-thumbnail span{display:block;padding:10px;font-size:12px}
.htw-review{display:grid;gap:20px}.htw-summary>div{display:grid;grid-template-columns:1fr auto;align-items:center;border-bottom:1px solid var(--border-default);padding:8px 0}.htw-summary>div>span{font-size:12px;color:var(--text-secondary)}.htw-summary>div>strong{font-size:14px;grid-column:1;overflow-wrap:anywhere}.htw-summary>div>button{grid-column:2;grid-row:1/3}.htw-summary>.htw-button{margin-top:14px}
.htw-preview{border-radius:14px;padding:16px;background:var(--bg-page);min-width:0}.htw-bubble{background:color-mix(in srgb,var(--accent-neon) 10%,var(--bg-card));border:1px solid var(--border-hover);border-radius:12px;padding:14px;font-size:14px;line-height:1.6;overflow-wrap:anywhere;min-width:0}.htw-bubble p{margin:8px 0;white-space:pre-wrap}.htw-bubble small{color:var(--text-secondary)}.htw-bubble>img{width:100%;max-height:200px;object-fit:contain;border-radius:6px;margin-bottom:8px}.htw-preview-button{border-top:1px solid var(--border-hover);padding-top:10px;margin-top:10px;text-align:center;color:var(--accent-neon)}
.htw-carousel{display:flex;overflow:auto;gap:12px;padding-top:12px;scroll-snap-type:x mandatory}.htw-carousel>.htw-bubble{flex:0 0 220px;scroll-snap-align:start}.htw-discard{position:absolute;inset:0;background:var(--bg-card);padding:32px;display:flex;flex-direction:column;justify-content:center;gap:14px}.htw-discard h3{font-size:24px;font-weight:800;outline:none}.htw-discard p{font-size:15px;color:var(--text-secondary);margin-bottom:12px}.htw-success{display:flex;align-items:center;flex-direction:column;text-align:center;gap:16px;padding:20px;font-size:14px}.htw-success svg{width:56px;height:56px;color:var(--accent-neon)}.htw-success strong{overflow-wrap:anywhere}.htw-success span{color:var(--text-secondary)}.htw-suggestion{border:1px solid var(--border-hover);border-radius:12px;padding:12px;font-size:13px;margin-top:14px}
@media(min-width:800px){.htw-reviewing .htw-dialog{width:820px}.htw-review{grid-template-columns:minmax(0,1fr) minmax(0,1.1fr)}}
@media(max-width:600px){.htw-overlay{padding:8px}.htw-dialog{width:100%;max-height:calc(100dvh - 16px);min-height:min(580px,calc(100dvh - 16px));border-radius:16px}.htw-header{padding:14px;gap:10px}.htw-heading-icon{display:none}.htw-main{padding:20px 16px}.htw-main h2{font-size:21px}.htw-help{font-size:13px;margin-bottom:18px}.htw-choice{padding:14px;gap:12px}.htw-choice strong{font-size:14px}.htw-choice small{font-size:12px}.htw-footer{padding:12px 14px max(12px,env(safe-area-inset-bottom));gap:8px}.htw-footer .htw-button{padding:12px;font-size:13px}.htw-footer #htw-next{min-width:0}.htw-editor{min-height:150px}.htw-tools .htw-button{font-size:13px}.htw-discard{padding:24px}.htw-thumbnails{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.htw-progress-track>div{transition:none}}

@media(max-width:600px) and (max-height:640px){.htw-main{padding:16px}.htw-main h2{font-size:20px;margin-bottom:8px}.htw-help{margin-bottom:14px}.htw-choice{padding:12px;gap:10px}.htw-choice strong{margin-bottom:4px}.htw-choices{gap:10px}}

/* Use the same category pills and live price table as the campaign selector. */
.htw-choice[data-choice=purpose]{display:grid;grid-template-columns:25px minmax(0,1fr) 18px;gap:8px 14px}
.htw-choice[data-choice=purpose] .htw-choice-icon{grid-column:1;grid-row:1}
.htw-choice[data-choice=purpose] .htw-choice-copy{grid-column:2;grid-row:1;min-width:0}
.htw-choice[data-choice=purpose] .htw-selected{grid-column:3;grid-row:1}
.htw-purpose-meta{grid-column:2/-1;display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;min-width:0}
.htw-purpose-meta>span:first-child{white-space:nowrap}.htw-purpose-cost{font-size:12px;color:var(--text-secondary);line-height:1.4}
@media(max-width:600px){.htw-choice[data-choice=purpose]{gap:8px 10px}.htw-purpose-meta{grid-column:1/-1;justify-content:space-between;gap:6px}.htw-purpose-cost{font-size:11px}}

/* Compact writing tools and an optional live preview on narrow screens. */
.htw-form{min-width:0}.htw-previewing .htw-dialog{width:min(1040px,100%)}
.htw-previewing .htw-main{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(240px,.8fr);gap:24px;align-items:start}
.htw-live-preview{position:sticky;top:0;min-width:0}.htw-live-preview-body{max-height:calc(100dvh - 240px);overflow:auto;scrollbar-width:thin}
.htw-preview-heading{font-size:12px;font-weight:700;color:var(--text-secondary);margin:0 0 10px}.htw-live-preview .htw-preview{padding:14px}
.htw-preview-examples-note,.htw-preview-note{font-size:11px;line-height:1.5;color:var(--text-secondary);margin:10px 0 0}
.htw-example{color:var(--wa-health-warning,var(--text-primary));background:color-mix(in srgb,var(--wa-health-warning,var(--text-primary)) 17%,transparent);border-radius:4px;padding:1px 3px;box-decoration-break:clone}
.htw-preview-image-example{display:flex;min-height:100px;align-items:center;justify-content:center;flex-direction:column;gap:10px;background:var(--bg-page);border-radius:8px;margin-bottom:10px}.htw-preview-image-example svg{width:30px;height:30px;color:var(--text-secondary)}
.htw-preview-toggle{display:none}.htw-previewing .htw-review{display:block}.htw-previewing .htw-bubble{font-size:13px}
.htw-editor-toolbar{display:grid;grid-template-columns:minmax(104px,30%) minmax(0,1fr);gap:12px;padding:10px;border:1px solid var(--border-hover);border-bottom:0;border-radius:12px 12px 0 0;background:var(--bg-page)}
.htw-editor-toolbar+.htw-editor{border-radius:0 0 12px 12px}.htw-editor-toolbar-simple{grid-template-columns:minmax(0,1fr)}
.htw-format-tools,.htw-field-tools{min-width:0}.htw-format-tools{border-right:1px solid var(--border-default);padding-right:10px}
.htw-tool-label{display:block;font-size:10px;color:var(--text-secondary);font-weight:650;margin-bottom:6px;line-height:1.3}
.htw-format-tools>div{display:flex;gap:4px}.htw-format-button{display:grid;place-items:center;flex:1;max-width:40px;min-width:26px;min-height:36px;border:1px solid transparent;border-radius:6px;color:var(--text-primary);background:transparent;cursor:pointer}
.htw-format-button svg{width:16px;height:16px}.htw-format-button:hover,.htw-format-button[aria-pressed=true]{background:color-mix(in srgb,var(--accent-neon) 12%,var(--bg-card));border-color:var(--border-hover)}
.htw-field-scroll{display:flex;gap:6px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:var(--border-hover) transparent;padding:0 1px 4px}
.htw-field-button{display:inline-flex;align-items:center;gap:4px;flex-shrink:0;white-space:nowrap;min-height:36px;padding:6px 10px;border:1px solid var(--border-hover);border-radius:7px;color:var(--text-primary);background:var(--bg-card);font-size:11px;cursor:pointer}.htw-field-button:hover{border-color:var(--accent-neon)}.htw-field-button svg{width:13px;height:13px}
.htw-editor-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:8px 0 16px;color:var(--text-secondary);font-size:12px}
.htw-editor-meta .htw-count{margin:0;white-space:nowrap;font-size:inherit;margin-left:auto}.htw-language{min-width:0;max-width:55%;width:auto;border:0;border-radius:4px;padding:4px 16px 4px 0;background:transparent;color:var(--text-secondary);font:inherit;cursor:pointer;outline-offset:2px}
.htw-language option{background:var(--bg-card);color:var(--text-primary)}.htw-language:focus-visible{outline:2px solid var(--accent-neon)}
.htw-code-language{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;color:var(--text-secondary);font-size:12px}
@media(max-width:800px){.htw-previewing .htw-main{display:block}.htw-live-preview{position:static;margin-bottom:18px}.htw-live-preview-body{display:none;max-height:40dvh;margin-top:10px}.htw-mobile-preview-open .htw-live-preview-body{display:block}.htw-preview-heading{display:none}.htw-preview-toggle{display:flex;align-items:center;gap:8px;min-height:44px;width:100%;border:1px solid var(--border-hover);border-radius:10px;padding:10px;color:var(--text-secondary);background:var(--bg-page);font-size:12px;cursor:pointer}.htw-preview-toggle svg{width:16px;height:16px;flex-shrink:0}.htw-preview-toggle svg:last-child{margin-left:auto}}
@media(max-width:600px){.htw-editor-toolbar{padding:8px;gap:8px}.htw-format-tools{padding-right:6px}.htw-editor-meta{font-size:11px;gap:6px}.htw-language{max-width:50%}.htw-field-button{min-height:40px;padding:6px 8px}.htw-format-button{min-height:40px}.htw-live-preview{margin-bottom:12px}}

.htw-purpose-notice{margin-top:18px;padding-top:12px;border-top:1px solid var(--border-default);font-size:10px;line-height:1.6;color:var(--text-secondary)}
.htw-purpose-notice p{margin:0}.htw-purpose-notice p+p{margin-top:5px}.htw-purpose-notice a{color:inherit;text-decoration:underline;text-underline-offset:2px}.htw-purpose-notice a:hover{color:var(--text-primary)}.htw-purpose-notice a:focus-visible{outline:2px solid var(--accent-neon);outline-offset:3px;border-radius:2px}

.htw-previewing .htw-form{grid-column:1;grid-row:1}.htw-previewing .htw-live-preview{grid-column:2;grid-row:1}
