.publish-progress{display:flex;gap:12px;margin:2px 0 32px;width:100%}
.publish-progress>span{display:flex;flex:1;align-items:center;gap:9px;position:relative;color:var(--muted);font-size:14px;white-space:nowrap}
.publish-progress>span:not(:last-child):after{content:"";height:1px;flex:1;background:var(--border);margin-left:3px}
.publish-progress b{display:grid;place-items:center;flex:none;width:28px;height:28px;border:1px solid var(--border);border-radius:50%;font-size:12px;font-weight:500;transition:background .2s,color .2s}
.publish-progress .current{color:var(--text);font-weight:600}.publish-progress .current b{background:var(--text);border-color:var(--text);color:var(--surface)}
.publish-progress .complete{color:var(--text-secondary)}.publish-progress .complete b{background:var(--soft)}
.publish-stage{min-height:340px}.publish-panel[hidden]{display:none}.publish-step-intro{margin-bottom:26px}.publish-step-intro h2{font-size:22px;margin:0 0 8px;letter-spacing:-.025em;outline:none}.publish-step-intro p{color:var(--muted);font-size:14px;line-height:1.7;margin:0}
.publish-wizard .form-footer{border-top:1px solid var(--border);padding-top:20px;display:flex;gap:12px;align-items:center}.publish-wizard .form-footer>[hidden]{display:none}.publish-wizard .form-footer>a{margin-left:auto;font-size:13px}
.publish-background-status{padding:14px 16px;border-radius:12px;background:var(--soft);color:var(--text-secondary);font-size:14px;line-height:1.7;margin-top:24px}
.auto-preview-panel[data-state="queued"] [role="status"]:before,.auto-preview-panel[data-state="running"] [role="status"]:before,.external-cover[data-state="running"] [role="status"]:before,.external-cover[data-state="waiting"] [role="status"]:before{content:"";display:inline-block;width:7px;height:7px;margin-right:9px;border-radius:50%;background:currentColor;animation:publish-pulse 1.4s ease-in-out infinite}
@keyframes publish-pulse{50%{opacity:.3;transform:scale(.7)}}
.published-result .publish-progress{margin-bottom:28px}.published-result .auto-preview-panel p{font-size:14px}.published-result-note{font-size:14px;color:var(--muted);line-height:1.7;margin:0 0 24px}
.published-card-prompt{margin:0 0 24px;padding:24px;border:1px solid var(--border);border-radius:16px;background:var(--soft)}
.published-card-prompt h2{margin:0;font-size:22px;line-height:1.4;letter-spacing:-.02em;text-wrap:balance}
.published-card-prompt p{margin:10px 0 20px;font-size:14px;line-height:1.7;color:var(--text-secondary)}
.published-card-actions{display:flex;flex-wrap:wrap;gap:10px}.published-card-actions .button{min-height:44px}
.published-card-later{margin:0 0 24px}.published-card-prompt[hidden],.published-card-later[hidden]{display:none}
@media(max-width:540px){.published-card-prompt{padding:20px}.published-card-prompt h2{font-size:20px}.published-card-actions .button{flex:1;white-space:normal}}
@media(max-width:540px){.publish-progress{gap:8px;margin-bottom:24px}.publish-progress>span{flex-direction:column;gap:7px;font-size:12px;min-width:0;white-space:normal;text-align:center}.publish-progress>span>span{max-width:100%}.publish-progress>span:not(:last-child):after{position:absolute;left:calc(50% + 20px);right:calc(-50% + 12px);top:14px;margin:0}.publish-step-intro h2{font-size:21px}.publish-wizard .form-footer{flex-wrap:wrap}.publish-wizard .form-footer>a{width:100%;margin:0;text-align:center}.publish-stage{min-height:310px}}
@media(prefers-reduced-motion:reduce){.publish-progress b{transition:none}.auto-preview-panel [role="status"]:before,.publish-background-status:before,.external-cover [role="status"]:before{animation:none!important}}

.publish-wizard{scroll-margin-top:92px}.publish-wizard .cover-picker:not(:has(img:not([hidden]))){min-height:0;padding:12px}.publish-wizard .external-cover-image{max-height:320px;width:auto;max-width:100%;margin-inline:auto;aspect-ratio:auto;object-fit:contain}


/* Source step: folder upload, the note for a retired link draft, and the AI prompt block. */
#folder-field.is-dragging #folder-input{border-color:var(--focus);box-shadow:0 0 0 3px var(--focus-ring)}
.folder-unsupported[hidden]{display:none}.folder-unsupported{margin:6px 0 0}
.folder-result{margin-top:12px}.folder-result:empty{display:none}
.folder-status,.folder-current{margin:0;font-size:13px;line-height:1.7;color:var(--text-secondary);overflow-wrap:anywhere}
.folder-panel{padding:14px 16px;border:1px solid var(--border);border-radius:12px;background:var(--soft);font-size:13px;line-height:1.7;color:var(--text-secondary);overflow-wrap:anywhere}
.folder-panel+.folder-panel,.folder-panel+.folder-current{margin-top:10px}
.folder-panel-title{margin:0;font-size:14px;font-weight:600;color:var(--text)}.folder-panel-facts,.folder-panel-note{margin:4px 0 0}
.folder-panel ul{margin:8px 0 0;padding-left:18px}.folder-panel li{margin:5px 0}
.folder-panel.is-error{background:var(--danger-bg);border-color:transparent}.folder-panel.is-error .folder-panel-title,.folder-panel.is-error>ul{color:var(--danger)}
.folder-warnings{margin-top:12px;padding:10px 12px;border-radius:8px;background:var(--warning-bg);color:var(--warning)}.folder-warnings>p{margin:0;font-weight:600}
.folder-panel-actions{margin-top:12px}.folder-choice{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.folder-choice select{flex:1;min-width:0;min-height:36px;padding:6px 10px;border:1px solid var(--border);border-radius:8px}
.publish-prompts{margin:4px 0 24px;padding:16px;border:1px solid var(--border);border-radius:12px}.publish-prompts[hidden]{display:none}
.publish-prompts-head{display:flex;gap:14px;align-items:flex-start;justify-content:space-between}
.publish-prompts h3{margin:0;font-size:15px;line-height:1.5;color:var(--text)}.publish-prompts-head p{margin:4px 0 0;font-size:13px;line-height:1.7;color:var(--text-secondary)}
.publish-prompts-head .button{flex:none;min-height:36px;white-space:nowrap}
.publish-prompts-status{margin:8px 0 0;font-size:13px;line-height:1.6;color:var(--text-secondary)}.publish-prompts-status:empty{display:none}.publish-prompts-status.success{color:var(--success)}
.publish-prompts-text{margin-top:10px;font-size:13px;color:var(--text-secondary)}.publish-prompts-text summary{padding:6px 0;cursor:pointer}
.publish-prompts-text textarea{display:block;box-sizing:border-box;width:100%;min-height:220px;margin-top:8px;padding:12px;border:1px solid var(--border);border-radius:8px;background:var(--soft);color:var(--text);font:12px/1.75 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;resize:vertical}
@media(max-width:540px){.publish-prompts-head{flex-direction:column;align-items:stretch}.publish-prompts-head .button,.folder-panel-actions .button,.folder-choice .button{min-height:44px}.folder-choice select{flex-basis:100%;min-height:44px}}
/* The note under the category field when the selected file looks like another category. */
.category-hint{margin-top:10px;padding:12px 14px;border:1px solid var(--border,#d7dce3);border-radius:10px;background:var(--soft,#f6f7f8)}
.category-hint[hidden]{display:none}
.category-hint-text{margin:0;font-size:13px;line-height:1.6;color:var(--text,#23272d)}
.category-hint-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.category-hint-actions .button{min-height:36px;font-size:13px}
@media(pointer:coarse){.category-hint-actions .button{min-height:44px}}

/* Optional AI helpers inside the description and cover fields. Hidden unless the site has them switched on. */
.publish-ai{display:grid;gap:8px;margin-top:10px;justify-items:start}
.publish-ai[hidden],.publish-ai-result[hidden]{display:none}
.publish-ai-result{display:grid;gap:10px;width:100%;padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:var(--soft)}
.publish-ai-result p{margin:0;font-size:14px;line-height:1.6;color:var(--text);white-space:pre-wrap}
.publish-ai-result p[data-ai-questions]{font-size:12px;color:var(--text-secondary)}
.publish-ai-result img{display:block;width:100%;max-width:420px;aspect-ratio:16/10;object-fit:cover;border-radius:8px;background:var(--surface)}
.publish-ai-actions{display:flex;flex-wrap:wrap;gap:8px}
.publish-ai-status{min-height:16px;margin:0;font-size:12px;color:var(--text-secondary)}
