/* Same red/gold QDND surfaces, with a bounded editor and persistent controls. */
.auto-dialog{width:min(1120px,calc(100vw - 24px));max-width:1120px;max-height:calc(100dvh - 24px);padding:0;overflow:hidden;color:var(--text,#20354a)}
.auto-dialog[open]{display:flex;flex-direction:column}.auto-dialog>.dialog-header,.auto-dialog>.dialog-actions,.auto-dialog>.auto-message{flex:none;margin:0;padding:14px 20px;background:#fff}
.auto-dialog>.dialog-header{border-bottom:1px solid var(--border,#ead4d9)}.auto-dialog>.dialog-actions{border-top:1px solid var(--border,#ead4d9);gap:8px;flex-wrap:wrap}.auto-dialog>.auto-message:empty{display:none}
.auto-editor-body{overflow:auto;min-height:0;padding:0 20px 18px;overscroll-behavior:contain}.auto-script-tools,.auto-sequence-tools,.auto-transfer,.auto-step-heading{display:flex;align-items:end;gap:8px;flex-wrap:wrap;margin:14px 0}
.auto-field{display:flex;flex-direction:column;gap:6px;font:500 .74rem/1.6 Inter,Arial,sans-serif;min-width:0}.auto-field input,.auto-field select,.auto-field textarea,.auto-step-editor>select,.auto-sequence-tools>select{box-sizing:border-box;border:1px solid var(--border,#d8bbc4);border-radius:5px;padding:9px 10px;color:inherit;background:#fff;min-width:0;max-width:100%;font:400 .76rem/1.5 Inter,Arial,sans-serif}.auto-field input[type=checkbox]{align-self:start;width:20px;height:20px;accent-color:#b91c36}
.auto-script-tools>.auto-field{flex:1 1 210px}.auto-setup{border:1px solid var(--border,#ead4d9);border-radius:7px;background:#fffafb;padding:12px}.auto-setup>summary{font-weight:600;color:#9a243c;cursor:pointer}.auto-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0}.auto-settings{grid-template-columns:repeat(3,minmax(0,1fr))}
.auto-editor-layout{display:grid;grid-template-columns:minmax(200px,.8fr) minmax(0,2fr);gap:18px;align-items:start}.auto-step-list{display:grid;gap:8px;position:sticky;top:0;max-height:440px;overflow:auto;overscroll-behavior:contain}.auto-step-row{display:flex;align-items:stretch;border:1px solid var(--border,#ead4d9);border-radius:6px;background:#fff}.auto-step-row.active{border-color:#b91c36;background:#fff5f5}.auto-step-row>button:first-child{border:0;text-align:left;flex:1;min-width:0;overflow-wrap:anywhere;padding:10px;background:transparent;color:#7b2336}.auto-step-row small{display:block;color:#69798e;font:.65rem/1.6 Inter,Arial,sans-serif;margin-top:4px}.auto-step-row>.button{padding:6px;min-width:28px;border:0;background:transparent}.auto-step-editor{min-width:0}.auto-step-editor>select{width:100%;margin:8px 0}.auto-step-heading h3{flex:1;margin:0;font-size:.92rem}.auto-action{border:1px solid var(--border,#ead4d9);border-radius:6px;padding:12px;margin:12px 0;background:#fff}.auto-action legend{color:#9a243c;font-weight:600;padding:0 6px}.auto-action-list>button{margin-top:6px}.auto-field textarea{width:100%;resize:vertical}.auto-message{color:#a1263d;font-size:.76rem;overflow-wrap:anywhere}
.auto-step-row>button:first-child{display:block}.auto-player{position:fixed;inset:0;pointer-events:none;z-index:65}.auto-player>*{pointer-events:auto}.auto-bar{position:fixed;bottom:12px;left:50%;transform:translateX(-50%);width:min(1100px,calc(100vw - 24px));box-sizing:border-box;display:flex;align-items:center;gap:16px;padding:12px 16px;border:1px solid #ca9d62;border-bottom:4px solid #dba729;border-radius:8px;background:#fffaf7;box-shadow:0 4px 24px #52132530;color:#6f2133;z-index:100}
.auto-now{flex:1;min-width:150px}.auto-now strong{display:block;font:.78rem/1.6 Inter,Arial,sans-serif}.auto-now p{margin:4px 0;font:.66rem/1.6 Inter,Arial,sans-serif}.auto-now progress{width:100%;height:5px;accent-color:#a32237;display:block}.auto-play-controls{display:flex;align-items:center;flex-wrap:wrap;gap:5px}.auto-play-controls>.button{font-size:.68rem;padding:8px 10px}
.auto-contents{position:fixed;right:18px;top:90px;width:min(390px,calc(100vw - 36px));max-height:calc(100dvh - 240px);overflow:auto;overscroll-behavior:contain;box-sizing:border-box;border:1px solid var(--border,#d8bbc4);border-top:4px solid #9d2138;border-radius:8px;padding:16px;background:#fff;box-shadow:0 4px 24px #52132520;z-index:99}.auto-contents:has(>.auto-text:empty):has(>.auto-image:empty):has(>.auto-sound:empty):has(>.auto-notice:empty){display:none}
.auto-text h3{font:700 .95rem/1.6 Merriweather,Georgia,serif;color:#92253a;margin:0 0 10px}.auto-text p{font:.8rem/1.8 Inter,Arial,sans-serif;white-space:pre-wrap;overflow-wrap:anywhere;text-align:justify;margin:7px 0}.auto-text .auto-fact{font-size:.73rem;color:#586a7c}.auto-image figure{margin:12px 0}.auto-image img{display:block;width:100%;max-height:340px;object-fit:contain;background:#fff9ed}.auto-image figcaption,.auto-media-caption{font:.68rem/1.7 Inter,Arial,sans-serif;color:#718096;margin:7px 0;overflow-wrap:anywhere}.auto-sound audio,.auto-sound video{width:100%;max-height:300px}.auto-sound iframe{width:100%;aspect-ratio:16/9;border:0}.auto-notice{font:.73rem/1.7 Inter,Arial,sans-serif;color:#9f293f;overflow-wrap:anywhere;margin:8px 0}.auto-notice:empty{display:none}.auto-notice>.button{display:block;margin-top:8px}
.timeline-card.is-auto-current{outline:3px solid #dfa729;outline-offset:4px}.mindmap-node.is-auto-current>rect{stroke:#d99f22!important;stroke-width:4!important}
@media(max-width:740px){.auto-editor-layout{grid-template-columns:minmax(0,1fr)}.auto-step-list{position:static;max-height:180px}.auto-settings{grid-template-columns:repeat(2,minmax(0,1fr))}.auto-editor-body{padding:0 12px 12px}.auto-dialog>.dialog-header,.auto-dialog>.dialog-actions,.auto-dialog>.auto-message{padding:12px}.auto-bar{flex-wrap:wrap;gap:8px;bottom:6px;padding:10px}.auto-now{flex-basis:100%}.auto-play-controls{width:100%;justify-content:center}.auto-contents{top:80px;right:8px;width:min(350px,calc(100vw - 16px));max-height:calc(100dvh - 280px)}.auto-sequence-tools select{max-width:100%}}
@media(max-width:420px){.auto-form-grid{grid-template-columns:minmax(0,1fr)}.auto-play-controls>.button{font-size:.65rem;min-height:36px;padding:6px}.auto-script-tools>.auto-field{flex-basis:100%}}
@media(prefers-reduced-motion:reduce){.auto-player *{scroll-behavior:auto!important;transition:none!important}}
@media print{[data-autoplay],.auto-dialog,.auto-player{display:none!important}}
