.rw-dialog{width:min(1420px,96vw);max-width:96vw;height:92vh;max-height:94vh;padding:20px;background:#18212c;color:#e3eaf3;border:1px solid #506174;border-radius:12px;overflow:hidden;box-sizing:border-box}.rw-dialog::backdrop{background:#0009}.rw-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:16px}.rw-dialog h2{margin:0 0 10px}.rw-dialog nav{display:flex;gap:10px;border-bottom:1px solid #3b4b60;padding-bottom:12px}.rw-dialog nav [aria-current=step]{background:#225d67;border-color:#62dcd0}.rw-status{margin:10px 0;color:#a7bdcf;min-height:20px}.rw-body{height:calc(100% - 125px);overflow:auto;padding-right:8px}.rw-dialog button,.rw-dialog input,.rw-dialog textarea,.rw-dialog select{font:inherit}.rw-dialog button{cursor:pointer;padding:8px 12px;border:1px solid #4c6176;border-radius:5px;background:#263647;color:#e6edf5}.rw-dialog button:disabled{opacity:.5;cursor:default}.rw-tools{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.rw-field{display:flex;flex-direction:column;gap:5px;margin:9px 0}.rw-field input,.rw-field textarea,.rw-dialog textarea,.rw-dialog select{background:#101923;color:#e1e9f3;border:1px solid #4c6176;border-radius:4px;padding:7px;box-sizing:border-box}.rw-source-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:18px;margin-top:12px}.rw-source canvas{width:100%;display:block;touch-action:none;cursor:crosshair;background:#0a1018}.rw-source p{font-size:12px;color:#a7bdcf}.rw-properties{padding:12px;background:#202c3a;border-radius:6px}.rw-properties button{margin:4px}.rw-coordinates{display:grid;grid-template-columns:1fr 1fr;gap:8px}.rw-coordinates input{width:100%}.rw-part-list{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0}.rw-part-list .active{border-color:#ffcf67;color:#ffcf67}.rw-thumb{width:120px;height:68px;background:repeating-conic-gradient(#202833 0 25%,#2b3543 0 50%) 0/16px 16px;object-fit:contain}.rw-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px;margin:14px 0}.rw-group{border:1px solid #40546a;border-radius:8px;padding:12px;background:#1c2937}.rw-group h3{margin:0 0 10px}.rw-group-item{display:grid;grid-template-columns:96px 1fr;gap:6px;padding:9px 0;border-top:1px solid #35485b}.rw-group-item .rw-thumb{width:96px;height:64px;grid-row:span 3}.rw-group-item small{color:#a6b5c7}.rw-review{border:1px solid #4a6177;border-radius:8px;padding:16px;margin-bottom:20px}.rw-result{display:block;width:100%;max-height:68vh;object-fit:contain;background:repeating-conic-gradient(#202833 0 25%,#2b3543 0 50%) 0/20px 20px}.rw-review-items{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px;margin:12px 0}.rw-review-item{display:grid;grid-template-columns:20px 100px 1fr;gap:5px;background:#243141;padding:8px;border-radius:5px}.rw-review-item .rw-thumb{width:100px;height:65px;grid-row:span 3}.rw-review-item small{grid-column:3;color:#a6b5c7}.rw-review-item span{grid-column:3;color:#f0c96a}.rw-review>textarea{width:100%;margin:12px 0}@media(max-width:850px){.rw-source-layout{grid-template-columns:1fr}.rw-dialog{padding:12px}.rw-dialog nav{flex-wrap:wrap}}

.ai-model-dialog [hidden]{display:none!important}
body dialog.rw-dialog .rw-source-layout{gap:2px}
body dialog.rw-dialog .rw-body .rw-groups{gap:2px}
body dialog.rw-dialog .rw-source>.rw-edit-tools{margin-bottom:2px}
body dialog.rw-dialog .rw-review{margin-bottom:2px}
body dialog.rw-dialog .rw-edit-tools{padding:3px!important;border:0!important;background:transparent!important;gap:6px!important;align-items:center!important;flex-wrap:wrap;min-height:28px}
.rw-mode-switch{display:flex;align-items:center;gap:3px;padding:2px;border:1px solid #40546a;border-radius:3px}
body dialog.rw-dialog .rw-edit-tools button{padding:0 5px;border-radius:2px;white-space:nowrap}
body dialog.rw-dialog .rw-edit-tools button[aria-pressed=true]{background:#245259;color:#b7fff3;border-color:#69bdb0}
body dialog.rw-dialog .rw-edit-tools>.rw-field{display:flex!important;flex-direction:row!important;flex:0 0 auto!important;align-items:center!important;min-width:0!important;width:auto!important;gap:5px!important;margin:0!important}
body dialog.rw-dialog .rw-edit-tools>.rw-field>span{white-space:nowrap;width:auto!important}
body dialog.rw-dialog .rw-edit-tools>.rw-field select{width:82px!important;flex:none!important}
body dialog.rw-dialog .rw-edit-tools select.rw-inline-zoom{width:70px!important;min-width:60px}
body dialog.rw-dialog .rw-edit-tools :is(button,select){margin:0!important;align-self:center!important;vertical-align:middle}
body dialog.rw-dialog .rw-edit-tools>.rw-field{height:20px!important;min-height:20px!important;padding:0!important}
body dialog.rw-dialog .rw-edit-tools>.rw-field>span{height:20px!important;line-height:20px!important;margin:0!important;align-self:center!important}
.rw-canvas-view.image-viewport{position:relative;height:55vh;max-height:55vh;min-height:240px;overflow:auto;overflow-anchor:none;touch-action:none;padding:0}
.rw-canvas-view .image-viewport-space>canvas{position:absolute;display:block;margin:0;max-width:none;max-height:none;user-select:none}
body dialog.rw-dialog .rw-properties textarea.rw-description{--property-height:60px;height:60px!important;min-height:60px!important;max-height:60px!important;line-height:18px;padding:2px 6px!important;resize:none;overflow-y:auto;box-sizing:border-box;width:100%}

.rw-pack-preview{width:100%;height:auto;max-height:220px;object-fit:contain;display:block;margin:10px 0;border:1px solid #40546a}

/* This workflow owns its header and scrolling body; preserve its padding across renders. */
body dialog.rw-dialog[open]{display:flex!important;flex-direction:column;padding:0!important;gap:0}
body dialog.rw-dialog>header{flex:0 0 auto;padding:20px 24px 14px!important;margin:0!important;min-height:58px;box-sizing:border-box}
body dialog.rw-dialog>header h2{margin:0!important;line-height:1.4}
body dialog.rw-dialog>nav{flex:0 0 auto;padding:10px 24px 14px!important;margin:0!important;gap:10px}
body dialog.rw-dialog>.rw-status{flex:0 0 auto;padding:12px 24px;margin:0!important;line-height:1.6;box-sizing:border-box}
body dialog.rw-dialog>.rw-body{flex:1 1 auto;min-height:0;height:auto!important;padding:4px 24px 24px!important;margin:0;box-sizing:border-box;overflow:auto;scrollbar-gutter:stable}
body dialog.rw-dialog .rw-tools{gap:12px;align-items:end;margin:0 0 16px}
body dialog.rw-dialog .rw-tools>.rw-field{display:flex!important;flex-direction:column;flex:1 1 190px;min-width:160px;gap:7px;margin:0}
body dialog.rw-dialog .rw-body>p{line-height:1.65;margin:12px 0}
body dialog.rw-dialog .rw-groups{gap:16px;margin:18px 0}
body dialog.rw-dialog .rw-group{padding:16px;box-sizing:border-box}
@media(max-width:700px){body dialog.rw-dialog>header{padding:16px!important}body dialog.rw-dialog>nav{padding:8px 16px 12px!important}body dialog.rw-dialog>.rw-status{padding:10px 16px}body dialog.rw-dialog>.rw-body{padding:4px 16px 18px!important}}

body dialog.rw-dialog .rw-edit-tools{position:sticky;top:0;z-index:2;padding:10px;background:#202c3a;border:1px solid #40546a;border-radius:6px;margin:0 0 10px}body dialog.rw-dialog>.rw-status{overflow-wrap:anywhere;color:#d3e4f4}
body dialog.rw-dialog>.rw-skip-incomplete{align-self:flex-start;flex:0 0 auto;margin:0 24px 10px;border-color:#dbbd6b;color:#ffe19a}
.rw-canvas-view{overflow:auto;max-height:65vh;min-height:240px;border:1px solid #43546b;overscroll-behavior:contain}.rw-canvas-view canvas{display:block;touch-action:none}.rw-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;flex:0 0 auto;padding:14px 24px;border-top:1px solid #40546a}.rw-footer span{color:#a7bdcf}body dialog.rw-dialog .rw-edit-tools{flex-wrap:wrap;align-items:end}.rw-edit-tools .rw-field{flex:0 1 130px!important;min-width:90px!important}body dialog.rw-dialog>.rw-body{padding-top:12px!important}.rw-edit-tools button{white-space:nowrap}

body dialog.rw-dialog .rw-comparison-item{display:flex;flex-direction:column;gap:8px;min-width:0;padding:12px}.rw-comparison-name{display:flex;align-items:center;gap:7px}.rw-comparison-pair{display:grid;grid-template-columns:1fr 1fr;gap:2px;width:100%}.rw-comparison-pair figure{margin:0;min-width:0}.rw-comparison-pair figcaption{font-size:11px;color:#a6bacb;margin-bottom:5px}.rw-comparison-pair .rw-thumb{width:100%!important;height:100px!important}.rw-result-placeholder{width:100%;height:100px;font-size:11px!important}.rw-comparison-item>small,.rw-comparison-item>span{grid-column:auto!important}

/* Equal-height extraction editor and visual source catalog. */
body dialog.simple-ui-extract .rw-source-layout{height:clamp(380px,65vh,720px);align-items:stretch}
body dialog.simple-ui-extract .rw-source{display:flex;flex-direction:column;min-height:0;min-width:0}
body dialog.simple-ui-extract .rw-source .rw-canvas-view{flex:1 1 0;height:auto!important;max-height:none;min-height:0}
body dialog.simple-ui-extract .rw-source>p{flex:none;margin:6px 0 0}
body dialog.simple-ui-extract .rw-properties{height:100%;min-height:0;overflow:auto;box-sizing:border-box;align-self:stretch}
body dialog.simple-ui-extract .simple-extract-parts{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:6px;align-items:stretch}
body dialog.simple-ui-extract .simple-extract-part{display:grid;grid-template-columns:18px minmax(0,1fr);align-items:start;gap:4px;padding:6px;background:#202c3a;border:1px solid #40546a;border-radius:4px;min-width:0}
body dialog.simple-ui-extract .simple-extract-part>input{margin:3px 0 0}
body dialog.simple-ui-extract .simple-extract-part-select{display:flex;flex-direction:column;align-items:stretch;gap:5px;min-width:0;width:100%;height:100%;text-align:left;white-space:normal;padding:3px!important;box-sizing:border-box}
body dialog.simple-ui-extract .simple-extract-part-name{display:block;min-height:30px;overflow-wrap:anywhere;line-height:15px}
body dialog.simple-ui-extract .simple-extract-part-select .rw-thumb{display:block;width:100%!important;height:110px!important;max-width:none;object-fit:contain}
@media(max-width:850px){body dialog.simple-ui-extract .rw-source-layout{height:auto}body dialog.simple-ui-extract .rw-source{height:60vh}body dialog.simple-ui-extract .rw-properties{height:auto;max-height:60vh}}

/* Keep extraction tools close to the dialog header; empty status must not reserve space. */
body dialog.rw-dialog.simple-ui-extract>.rw-body{padding-top:6px!important}
body dialog.rw-dialog.simple-ui-extract>.rw-body>[role="status"]:empty{display:none!important;margin:0!important;min-height:0!important}
body dialog.rw-dialog.simple-ui-extract>.rw-body>[role="status"]{margin:0 0 4px}
body dialog.rw-dialog.simple-ui-extract .rw-source-layout{margin-top:0!important}

body dialog.rw-dialog.simple-ui-extract .simple-extract-source-hint{font-size:12px;color:#a7bdcf;margin:6px 0}
body dialog.rw-dialog.simple-ui-extract .rw-source-layout>.rw-source .rw-canvas-view{margin:0;box-sizing:border-box}
