.iw-result{margin:0;border:1px solid var(--ui-line);border-radius:9px;overflow:hidden;background:var(--ui-panel);min-height:170px;display:flex;flex-direction:column}
.iw-result img{display:block;width:100%;height:210px;object-fit:cover;background:#03111b}
.iw-result figcaption{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px;color:var(--ui-muted);font-size:12px}
.iw-result figcaption button,.iw-result figcaption a{border:1px solid var(--ui-border-strong);background:var(--ui-panel);color:var(--ui-text);border-radius:5px;padding:5px 8px;text-decoration:none;cursor:pointer}
.iw-status-ok{color:var(--ui-success)!important;border-color:var(--ui-success-line)!important;background:var(--ui-success-bg)!important}
.iw-provider-list i.on{background:var(--ui-success)}
.iw-field-label input[type=file]{margin-top:6px;color:var(--ui-text);font-size:11px}
.iw-field-label small{color:var(--ui-warning);font-size:10px;margin-top:7px}

/* Readable controls and uncropped result previews. */
.image-workbench-page .iw-field-label,.image-workbench-page .iw-field-label input[type=file],.image-workbench-page .iw-field-label small,.image-workbench-page .iw-notice,.image-workbench-page .iw-muted{font-size:14px;line-height:1.5}
.image-workbench-page button{min-height:36px;cursor:pointer}
.image-workbench-page button:disabled{cursor:not-allowed}
.image-workbench-page button:focus-visible,.iw-preview-modal button:focus-visible{outline:3px solid var(--ui-focus);outline-offset:3px}
.image-workbench-page .iw-field-label select{font-size:14px;min-height:38px;max-width:100%}
.image-workbench-page .iw-field-label textarea{font-size:14px;line-height:1.6;min-height:120px}
.image-workbench-page .iw-result-grid{margin-top:16px;align-items:start;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr))}
.image-workbench-page .iw-result img{height:clamp(220px,35vh,380px);object-fit:contain}
.image-workbench-page .iw-result figcaption{font-size:14px;flex-wrap:wrap;padding:10px}
.image-workbench-page .iw-result figcaption span{flex:1 1 180px;overflow-wrap:anywhere}
.image-workbench-page .iw-simple-grid{grid-template-columns:minmax(0,1.4fr) minmax(260px,.8fr);align-items:start}
.image-workbench-page .iw-simple-options .button{margin-top:12px;min-height:42px}
.image-workbench-page .iw-head small,.image-workbench-page .iw-head h2{display:none}
.image-workbench-page .iw-head{align-items:center;flex-wrap:wrap}
.image-workbench-page .iw-status-ok i{background:var(--ui-success)}
.image-workbench-page .iw-notice{color:var(--ui-warning)}
.iw-preview-modal{box-sizing:border-box;width:calc(100vw - 40px);max-width:1400px;height:calc(100dvh - 40px);max-height:calc(100dvh - 40px);padding:18px;border:1px solid var(--ui-line);border-radius:12px;background:var(--ui-panel);color:var(--ui-text);overflow:hidden}
.iw-preview-modal[open]{display:flex;flex-direction:column;gap:12px}
.iw-preview-modal::backdrop{background:var(--ui-scrim)}
.iw-preview-modal header,.iw-preview-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;flex-shrink:0}
.iw-preview-modal header{justify-content:space-between}.iw-preview-modal h2{margin:0;font-size:20px}
.iw-preview-modal button{min-height:40px;padding:8px 16px;border:1px solid var(--ui-border-strong);border-radius:6px;background:var(--ui-panel);color:var(--ui-text);cursor:pointer;font-size:14px}
.iw-preview-modal button:hover:not(:disabled),.iw-result figcaption :is(button,a):hover,.image-workbench-page .iw-material-options button:hover:not(:disabled){background:var(--ui-selected);color:var(--ui-accent)}
.iw-preview-toolbar span{color:var(--ui-muted);font-size:14px}
.iw-preview-viewport{flex:1;min-height:0;overflow:auto;background:#030f18;border-radius:6px;display:grid;place-items:center}
.iw-preview-viewport img{display:block;width:100%;height:100%;min-height:0;object-fit:contain}
.iw-preview-actual .iw-preview-viewport{display:block}.iw-preview-actual img{width:auto;height:auto;max-width:none;max-height:none;margin:auto}
.iw-preview-caption{font-size:14px;margin:0;overflow-wrap:anywhere;flex-shrink:0}
@media(max-width:1000px){.image-workbench-page .iw-simple-grid{grid-template-columns:1fr}.image-workbench-page .iw-layout{grid-template-columns:1fr}.iw-preview-modal{width:calc(100vw - 16px);height:calc(100dvh - 16px);padding:12px}}
.iw-pdf-input{margin:10px 0;min-width:0}
.iw-pdf-input input{width:100%;min-height:36px;padding:7px;background:var(--ui-panel);color:var(--ui-text);border:1px solid var(--ui-border-strong);border-radius:4px;font-size:14px}
.iw-pdf-input img{display:block;width:100%;max-height:280px;object-fit:contain;margin-top:10px;background:#fff}
.iw-pdf-input p{color:var(--ui-muted);font-size:14px}
.image-workbench-page .iw-input-panel .iw-drop,.image-workbench-page .iw-pdf-input .iw-field-label{color:var(--ui-muted)}
.image-workbench-page .iw-material-options{margin-top:12px;padding:10px;border:1px solid var(--ui-border-strong);border-radius:6px;color:var(--ui-muted);font-size:13px}
.image-workbench-page .iw-material-options summary{cursor:pointer;color:var(--ui-text);margin-bottom:10px;font-weight:600}
.image-workbench-page .iw-material-options small{display:block;margin:7px 0;line-height:1.5;color:var(--ui-muted)}
.image-workbench-page .iw-material-options button{margin:8px 0;padding:8px 12px;border:1px solid var(--ui-border-strong);border-radius:4px;background:var(--ui-panel);color:var(--ui-text)}
.image-workbench-page .iw-material-options input:not([type=checkbox]){box-sizing:border-box;width:100%;min-height:34px;padding:6px;border:1px solid var(--ui-border-strong);border-radius:4px;background:var(--ui-panel);color:var(--ui-text);font:inherit}
.image-workbench-page .iw-material-options .iw-simple-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px}
