/* One black/red dialog system; tool-specific editors keep their own layouts. */
:root{--ip22-dialog-bg:#111319;--ip22-dialog-panel:#171a22;--ip22-dialog-field:#0e1015;--ip22-dialog-border:#33313d;--ip22-dialog-accent:#ef485a;--ip22-dialog-text:#eeedf3;--ip22-dialog-muted:#9899a9}
html[data-theme="light"]{--ip22-dialog-bg:#fff;--ip22-dialog-panel:#f6f7fa;--ip22-dialog-field:#fff;--ip22-dialog-border:#dce0e8;--ip22-dialog-text:#242530;--ip22-dialog-muted:#6e7182}
#toolModal{z-index:90000!important}
#toolModal{padding:20px!important;background:#000b!important;backdrop-filter:blur(3px);overscroll-behavior:contain}
#toolModal .modalbox,.ip22-workbench-dialog{width:min(1120px,calc(100vw - 40px))!important;max-width:none!important;max-height:calc(100dvh - 40px)!important;padding:0!important;border:1px solid #653442!important;border-radius:16px!important;background:var(--ip22-dialog-bg)!important;color:var(--ip22-dialog-text)!important;box-shadow:0 24px 90px #0009!important;overflow:hidden!important}
#toolModal .modalbox{display:flex;flex-direction:column;min-height:0}
.ip22-tool-modal-head,.ip22-workbench-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex:0 0 auto;min-height:62px;padding:12px 18px!important;border-bottom:1px solid #332630!important;background:linear-gradient(115deg,#251923,#13141b)!important}
.ip22-tool-modal-label{display:flex;align-items:center;gap:10px;min-width:0}.ip22-tool-modal-icon{display:grid;place-items:center;width:30px;height:30px;border:1px solid #a84c5a55;border-radius:8px;background:#d7475718;color:#ee7f91;flex:none}.ip22-tool-modal-icon svg{width:18px;height:18px}
#ip22ToolModalTitle,.ip22-workbench-dialog-head h2{margin:0!important;color:var(--ip22-dialog-text)!important;font-size:18px!important;line-height:1.6;font-weight:750;overflow-wrap:anywhere}
.ip22-tool-modal-head .close,.ip22-workbench-close{position:static!important;display:grid!important;place-items:center;flex:none;width:38px!important;height:38px!important;margin:0!important;padding:0!important;border:1px solid #543342!important;border-radius:9px!important;background:#291c26!important;color:#eacdd9!important;font-size:24px!important;line-height:1;cursor:pointer}
.ip22-tool-modal-head .close:hover,.ip22-workbench-close:hover{border-color:#c46e8a!important;background:#382333!important}
#toolBody{flex:1 1 auto;min-width:0;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:20px;scrollbar-width:thin;scrollbar-color:#65505d #111319;font-size:14px;line-height:1.7}
#toolBody>.toolform{width:100%;min-width:0;max-width:100%;margin:0}.ip22-tool-source-title{display:none!important}
#toolBody .toolform p{font-size:13px;line-height:1.8;color:var(--ip22-dialog-muted)}#toolBody .toolform h4{margin:18px 0 10px;font-size:16px;line-height:1.6;color:#e5e2ed}
#toolBody input:not([type="radio"]):not([type="checkbox"]):not([type="range"]):not([type="color"]),#toolBody textarea,#toolBody select{box-sizing:border-box;min-width:0;max-width:100%;min-height:44px;border:1px solid #353641!important;border-radius:10px!important;background:var(--ip22-dialog-field)!important;color:var(--ip22-dialog-text)!important;padding:10px 12px;font:inherit;font-size:14px;line-height:1.6}
#toolBody textarea{min-height:128px;line-height:1.8!important;resize:vertical}#toolBody input[type="file"]{font-size:12px}#toolBody input[type="file"]::file-selector-button{margin-right:9px;padding:6px 10px;border:1px solid #49404d;border-radius:7px;background:#29222e;color:#e4d7df}
#toolBody input:focus,#toolBody textarea:focus,#toolBody select:focus{outline:0;border-color:#c86478!important;box-shadow:0 0 0 3px #d3576e14}
#toolBody .toolform button{min-height:38px;border-radius:9px!important;font-size:13px;line-height:1.5;padding:9px 14px}
#toolBody .toolform button:disabled{opacity:.5;cursor:not-allowed}#toolBody .upload-source-tabs button{border:1px solid #403442!important;background:#24202b!important;color:#bdb3c3!important}#toolBody .upload-source-tabs button[aria-pressed="true"]{background:#8f3245!important;border-color:#cf6279!important;color:#fff!important}
#toolBody .result,#toolBody .video-result-area,#toolBody .upload-drop{border-radius:12px!important;border-color:#333541!important;background:#14171f!important;line-height:1.8}
#toolBody img,#toolBody video,#toolBody canvas{max-width:100%}#toolBody audio{width:100%;max-width:100%}#toolBody .row,#toolBody .video-parse-input-row{min-width:0}#toolBody .row>*{min-width:0}
.ip22-workbench-frame{background:var(--ip22-dialog-bg)!important}
html.workbench-embedded{--bg:var(--ip22-dialog-bg);--panel:var(--ip22-dialog-panel);--panel2:#20232d;--line:var(--ip22-dialog-border);--red:#ef485a;--red-soft:#ef485a1f;--text:var(--ip22-dialog-text);--muted:var(--ip22-dialog-muted)}
.workbench-embedded body{background:var(--bg)!important}.workbench-embedded .page{padding:20px!important}.workbench-embedded .panel{border-radius:12px!important;box-shadow:none}.workbench-embedded .panel-heading h2{font-size:17px;line-height:1.6}.workbench-embedded .panel-intro,.workbench-embedded .source-status{font-size:13px;line-height:1.8}
.workbench-embedded input:not([type="radio"]):not([type="checkbox"]):not([type="range"]):not([type="file"]),.workbench-embedded textarea,.workbench-embedded select{min-width:0;max-width:100%;border-radius:10px!important;border-color:#353641!important;background:#0e1015!important;color:#eeedf3!important;font-size:14px;line-height:1.6}.workbench-embedded textarea{line-height:1.8}.workbench-embedded .primary-button,.workbench-embedded .outline-button{border-radius:9px;min-height:38px;font-size:13px}
@media(max-width:720px){#toolModal{padding:8px!important}#toolModal .modalbox,.ip22-workbench-dialog{width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important;border-radius:12px!important}.ip22-tool-modal-head,.ip22-workbench-dialog-head{min-height:58px;padding:10px 12px!important;gap:8px}#ip22ToolModalTitle,.ip22-workbench-dialog-head h2{font-size:16px!important}.ip22-tool-modal-head .close,.ip22-workbench-close{width:36px!important;height:36px!important}.ip22-tool-modal-icon{width:28px;height:28px}#toolBody{padding:15px}.workbench-embedded .page{padding:15px!important}}
/* Keep the site's existing light theme coherent with the same dialog system. */
html[data-theme="light"] #toolModal .modalbox,html[data-theme="light"] .ip22-workbench-dialog{background:#fff!important;border-color:#deb7c1!important;color:#242530!important}
html[data-theme="light"] .ip22-tool-modal-head,html[data-theme="light"] .ip22-workbench-dialog-head{background:linear-gradient(115deg,#fff1f3,#fff)!important;border-color:#ead8df!important}
html[data-theme="light"] #toolModal .close,html[data-theme="light"] .ip22-workbench-close{background:#f8e9ee!important;border-color:#e4c9d3!important;color:#785062!important}
html[data-theme="light"] #toolBody{scrollbar-color:#b9a4ae #fff}
html[data-theme="light"] #toolBody .toolform h4{color:#242530!important}
html[data-theme="light"] #toolBody input:not([type="radio"]):not([type="checkbox"]):not([type="range"]):not([type="color"]),html[data-theme="light"] #toolBody textarea,html[data-theme="light"] #toolBody select{border-color:#dce0e8!important}
html[data-theme="light"] #toolBody .result,html[data-theme="light"] #toolBody .video-result-area,html[data-theme="light"] #toolBody .upload-drop{background:#f6f7fa!important;border-color:#dce0e8!important;color:#424552!important}
html[data-theme="light"] #toolBody .upload-source-tabs button{background:#f3eef2!important;border-color:#e2d9e1!important;color:#6c6273!important}
html[data-theme="light"] #toolBody .upload-source-tabs button[aria-pressed="true"]{background:#8f3245!important;border-color:#cf6279!important;color:#fff!important}
html[data-theme="light"].workbench-embedded{--panel2:#f1f2f6}
html[data-theme="light"].workbench-embedded input:not([type="radio"]):not([type="checkbox"]):not([type="range"]):not([type="file"]),html[data-theme="light"].workbench-embedded textarea,html[data-theme="light"].workbench-embedded select{background:#fff!important;color:#242530!important;border-color:#dce0e8!important}
#toolBody .upload-source-tabs button[aria-pressed="true"]{outline:2px solid #ce6076;outline-offset:1px}
#toolBody input[type="range"]{accent-color:var(--ip22-dialog-accent)}
html[data-theme="light"].workbench-embedded{color-scheme:light}
html[data-theme="light"].workbench-embedded :is(.upload-box,.rail-tip,.transcript-box,.commerce-source,.tts-controls,.choice,.stage-state,.step-badge,.timeline-count,.source-reference,.export-panel .stage-panel){background:#f1f2f6;border-color:#dce0e8;color:#424552}
html[data-theme="light"].workbench-embedded :is(.field-label,.rail-heading,.transcribe-controls label,.commerce-fields>label,.oral-fields label,.commerce-source>label,.tts-controls>label,.tts-adjustments label,.toggle-row,.choice){color:#424552}
html[data-theme="light"].workbench-embedded :is(.source-status,.transcribe-status,.progress-head,.script-toolbar,.commerce-status,.tts-status,.next-step-note,.panel-intro,.soft-note){color:#6e7182}
html[data-theme="light"].workbench-embedded .step{color:#555763}html[data-theme="light"].workbench-embedded .step.active{background:#f9e6ec;border-color:#e1b4c4;color:#953149}html[data-theme="light"].workbench-embedded .step.active strong{color:#953149}html[data-theme="light"].workbench-embedded .step:hover{background:#eee9ef}
html[data-theme="light"].workbench-embedded :is(.source-tabs button.selected,.script-mode-tabs button.selected){color:#953149}
html[data-theme="light"].workbench-embedded .outline-button{background:#f3eef2;color:#6c6273;border-color:#dfd5df}
html[data-theme="light"].workbench-embedded :is(.small-button,.commerce-review-note,.asr-pending){background:#f9e6ec;color:#953149;border-color:#e1b4c4}
html[data-theme="light"].workbench-embedded .choice.selected{background:#f9e6ec;border-color:#e1b4c4}
html[data-theme="light"].workbench-embedded .tts-output strong{color:#953149}
