.production-plan-editor{width:100%;max-width:1080px;margin:auto;min-width:0;color:var(--ink)}
.flow-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:4px 0 24px;position:sticky;top:0;z-index:2;background:var(--surface);padding:8px 0}
.flow-steps span{padding:12px;border-bottom:3px solid var(--line);color:var(--muted);font-weight:600}
.flow-steps [aria-current=step]{border-color:var(--green);color:var(--green);background:var(--green-soft);border-radius:6px 6px 0 0}
.flow-body h3{margin:8px 0 14px;font-size:18px}.flow-body>p{line-height:1.8;margin:12px 0 20px;color:var(--muted)}
.flow-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:start}.flow-grid>*{min-width:0}
.flow-note{padding:14px 16px;margin:16px 0;background:var(--green-soft);border:1px solid var(--line);border-radius:9px;line-height:1.8;overflow-wrap:anywhere}
.flow-note p{margin:5px 0}.flow-card{padding:20px;border:1px solid var(--line);border-radius:12px;background:var(--surface);overflow-wrap:anywhere}.flow-card h4{margin:0 0 10px;font-size:15px}.flow-card>p{margin:10px 0;color:var(--muted)}
.flow-cover-thumb{width:100%;height:150px;object-fit:contain;background:var(--bg);border-radius:8px}.flow-cover-empty{height:150px;display:grid;place-items:center;background:var(--bg);border:1px dashed #b6c3b2;border-radius:8px;color:var(--muted)}
.flow-toggle{display:flex;align-items:center;gap:8px;padding:12px 0}.flow-publication{border-top:1px solid var(--line);padding:16px 0}.flow-publication textarea{min-height:70px}
.flow-footer{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-top:24px;padding:18px 0 0;border-top:1px solid var(--line);position:sticky;bottom:0;background:var(--surface)}
.production-plan-editor .flow-footer{flex-wrap:wrap;row-gap:12px}
.production-plan-editor .flow-footer>.ct-error{flex:0 0 100%;margin:0;max-height:96px;overflow:auto;overflow-wrap:anywhere}
.flow-cover-dialog{width:min(1060px,94vw);max-height:92vh;overflow:auto;margin:auto;padding:24px;border:1px solid var(--line);border-radius:16px;background:var(--surface);color:var(--ink);box-shadow:0 24px 80px #0004}.flow-cover-dialog::backdrop{background:#172b237a}
.flow-cover-dialog header,.flow-cover-dialog footer{display:flex;justify-content:space-between;align-items:center;gap:16px}.flow-cover-dialog header{margin-bottom:20px}.flow-cover-dialog footer{border-top:1px solid var(--line);margin-top:20px;padding-top:16px}.flow-cover-dialog p{line-height:1.8;margin:8px 0;overflow-wrap:anywhere}
.flow-cover-dialog button{padding:9px 14px;border:1px solid var(--line);border-radius:7px;background:var(--surface)}.flow-cover-dialog button.primary{background:var(--green);color:white}.flow-cover-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px}.flow-cover-body canvas{width:100%;height:390px;object-fit:contain;background:#eef1eb;border-radius:9px}.flow-cover-dialog [data-discard]{background:var(--orange-soft);padding:14px;border-radius:8px}
.flow-run{border-top:1px solid var(--line);padding:12px 0;min-width:0}.flow-run summary{cursor:pointer;line-height:1.8}.flow-run-variants{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}.flow-plan-actions{display:flex;gap:8px;flex-wrap:wrap}.flow-plan-list{display:grid;gap:18px}.flow-plan-title{display:flex;justify-content:space-between;gap:16px;align-items:center}.flow-plan-title h3{overflow-wrap:anywhere}.flow-plan-meta{color:var(--muted);line-height:1.8;font-size:12px;margin:10px 0}
@media(max-width:720px){.flow-grid,.flow-cover-body{grid-template-columns:1fr}.flow-steps{gap:4px}.flow-steps span{font-size:12px;padding:9px 5px}.flow-cover-dialog{padding:16px}.flow-cover-body canvas{height:260px}.flow-footer{gap:8px}.flow-plan-title{align-items:flex-start}}

.flow-cover-dialog input[type=file]{color:var(--ink);background:var(--bg)}
.flow-cover-dialog footer{position:sticky;bottom:0;background:var(--surface);z-index:2}

.flow-batch-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;max-height:380px;overflow:auto;margin:12px 0}.flow-batch-list article{min-width:0;display:grid;gap:8px;padding:12px;border:1px solid var(--border);border-radius:12px}.flow-batch-list strong{overflow-wrap:anywhere}.flow-batch-list audio{width:100%}
.flow-cover-dialog.typography-editor {width:min(1180px,96vw);padding:22px;overflow:hidden;}
.flow-cover-dialog.typography-editor[open] {display:flex;flex-direction:column;max-height:94vh;box-sizing:border-box;}
.typography-editor header,.typography-editor footer {flex-shrink:0;}
.typography-editor header h2 {margin:5px 0;font-size:23px;}
.typography-editor header p {margin:6px 0;color:var(--muted,#7a8088);}
.typo-kicker {font-size:10px;letter-spacing:2px;color:var(--green,#b7d795);}
.typography-editor .flow-cover-body {grid-template-columns:minmax(250px,.9fr) minmax(380px,1.1fr);gap:26px;max-height:calc(94vh - 190px);min-height:0;flex:1;overflow:hidden;align-items:stretch;padding:4px 4px 16px;}
.typo-title-input {flex-shrink:0;}
.typography-editor .typo-title-input textarea {height:64px;min-height:64px;resize:vertical;max-height:120px;font-size:17px;line-height:1.45;}
.typo-preview {position:static;min-width:0;min-height:0;overflow:auto;}
.typo-canvas-wrap {background:#171b20;border:1px solid #7774;border-radius:12px;padding:12px;}
.typography-editor .typo-canvas-wrap canvas {width:100%;height:min(25vh,220px);object-fit:contain;display:block;background:transparent;}
.typo-preview .typo-title {display:none;}
.typo-preview p {font-size:12px;line-height:1.6;overflow-wrap:anywhere;}
.typo-title {padding:12px;background:#8881;border-radius:8px;}
.typo-controls {min-width:0;min-height:0;overflow:auto;padding-right:6px;}
.typo-controls > fieldset {border:0;padding:0;margin:0;min-width:0;}
.typo-section-heading {display:flex;align-items:center;justify-content:space-between;gap:10px;}
.typo-section-heading h3 {margin:0 0 10px;}
.typo-section-heading small,.typo-hint {color:var(--muted,#8a9098);font-size:11px;}
.typo-presets {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-bottom:16px;}
.typography-editor .typo-presets button {padding:3px 3px 7px;border:1px solid #7775;border-radius:9px;overflow:hidden;background:#20252c;color:#eee;}
.typography-editor .typo-presets canvas {width:100%;height:45px;display:block;border-radius:6px;object-fit:contain;background:transparent;}
.typo-presets span {font-size:11px;}
.typography-editor button[aria-pressed=true] {border-color:var(--green,#b7d795);box-shadow:0 0 0 1px var(--green,#b7d795);}
.typo-tabs {display:flex;gap:5px;border-bottom:1px solid #7774;margin:18px 0 14px;padding-bottom:10px;}
.typography-editor .typo-tabs button {padding:8px 10px;font-size:12px;flex:1;white-space:nowrap;}
.typography-editor input[type=color] {height:35px;padding:3px;width:100%;}
.flow-cover-dialog.typography-editor input[type=file] {font-size:11px;max-width:100%;background:#ffffff08;color:inherit;border:1px solid #7774;border-radius:6px;padding:8px;box-sizing:border-box;}
.typography-editor .field {font-size:12px;gap:6px;margin:0 0 10px;}
.typography-editor .field input,.typography-editor .field select,.typography-editor textarea {min-width:0;width:100%;box-sizing:border-box;}
.typo-check {display:flex;align-items:center;gap:7px;font-size:12px;margin:10px 0;}
.typography-editor .typo-check input {width:15px;height:15px;accent-color:var(--green,#b7d795);}
.typo-toggle-row {display:flex;gap:14px;align-items:center;margin:8px 0;flex-wrap:wrap;}
.typo-stroke {border:1px solid #7774;border-radius:8px;margin:12px 0;padding:10px;min-width:0;}
.typo-stroke legend {font-size:12px;padding:0 5px;}
.typo-stroke .flow-grid {grid-template-columns:repeat(3,minmax(0,1fr));}
.typo-saved {border-top:1px solid #7774;margin-top:18px;padding-top:12px;}
.typo-saved summary {cursor:pointer;font-size:13px;margin-bottom:12px;}
.typography-editor [data-error] {max-height:60px;overflow:auto;font-size:12px;margin:8px 0;}
.typography-editor [data-discard] {border:1px solid #d9aa5c;padding:10px;border-radius:8px;}
.typography-editor [data-discard] p {margin:0 0 8px;}
.typography-editor footer {padding-top:12px;}
@media(max-width:780px){.typography-editor .flow-cover-body{grid-template-columns:1fr;max-height:65vh;overflow:auto;}.typo-preview{position:static;overflow:visible;}.typo-controls{overflow:visible;}.typography-editor .typo-canvas-wrap canvas{height:230px;}.typo-tabs{flex-wrap:wrap;}}

/* Cover discard uses the existing confirmation card, inside its top-layer dialog. */
.typography-editor [data-discard].modal-dismiss-overlay{position:absolute;inset:0;z-index:4;border:0;border-radius:inherit;padding:20px;background:#0009;box-sizing:border-box;}
.typography-editor [data-discard].modal-dismiss-overlay:not([hidden]){display:grid;place-items:center;}
.typography-editor [data-discard] .modal-dismiss-card{max-width:100%;max-height:100%;}

/* Preflight stays inside the existing scroll body: W = parent - 2*12px;
   actions wrap at their intrinsic width; neither header nor footer grows. */
.flow-preflight{padding:12px;border:1px solid var(--eva-line);border-radius:8px;background:var(--eva-input);min-width:0;overflow-wrap:anywhere;margin-bottom:16px}
.flow-preflight p,.flow-plan-next p{margin:0;line-height:1.6;font-size:12px}
.flow-preflight-actions,.flow-plan-next{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.flow-preflight-actions{margin-top:8px}.flow-plan-next{margin:12px 0;padding:12px;border:1px solid var(--eva-line);border-radius:8px}
.flow-plan-next p{flex:1 1 220px;min-width:0}.flow-plan-next button{max-width:100%;white-space:normal}
.task-schedules .sp-counts{grid-template-columns:repeat(auto-fit,minmax(min(100%,110px),1fr))}
