/* Shared Forge upload/settings geometry. No generation or moderation behavior. */
body[data-tool-key] .workspace {container-type:inline-size;container-name:forge-controls;}
body[data-tool-key] .workspace .source-head {display:flex;align-items:flex-start;gap:10px;min-width:0;max-width:100%;}
body[data-tool-key] .workspace .source-head>div {flex:1 1 0;min-width:0;max-width:100%;}
body[data-tool-key] .workspace .source-head strong,
body[data-tool-key] .workspace .source-head small {min-width:0;white-space:normal;overflow-wrap:anywhere;}
body[data-tool-key] .workspace .source-head .link-button {flex:0 0 auto;align-self:flex-start;}
body[data-tool-key] .workspace .upload {display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;place-items:center;min-width:0;max-width:100%;height:245px;min-height:0!important;padding:10px;}
body[data-tool-key] .workspace .upload>.sf-upload-empty,
body[data-tool-key] .workspace .upload>img {grid-area:1/1;min-width:0;max-width:100%;margin:0;}
body[data-tool-key] .workspace .upload>img {display:block;width:100%!important;height:100%!important;max-height:100%!important;object-fit:contain!important;object-position:50% 50%!important;}
body[data-tool-key] .workspace .upload>.sf-upload-empty {white-space:normal;overflow-wrap:anywhere;}
body[data-tool-key] .advanced {min-width:0;max-width:100%;}
body[data-tool-key] .advanced>summary {min-width:0;white-space:normal;overflow-wrap:anywhere;line-height:1.3;}
body[data-tool-key] .advanced>summary::before {flex-shrink:0;}
body[data-tool-key] .advanced .extra-references {min-width:0;max-width:100%;padding:0 15px;}
body[data-tool-key] .extra-references-heading,
body[data-tool-key] .extra-reference-grid {min-width:0;}
body[data-tool-key] .extra-reference-grid {grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));align-items:start;}
body[data-tool-key] .extra-reference-card {grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;align-content:start;min-width:0;max-width:100%;}
body[data-tool-key] .extra-reference-card .source-head {min-height:54px;}
body[data-tool-key] .extra-reference-card .compact-upload {height:200px;margin:0!important;}
body[data-tool-key] .advanced>label {display:grid;grid-template-columns:minmax(0,1fr);gap:6px;min-width:0;max-width:100%;margin:12px 0 0;}
body[data-tool-key] .advanced>label>span {min-width:0;overflow-wrap:anywhere;}
body[data-tool-key] .advanced>label>div {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:7px;min-width:0;max-width:100%;}
body[data-tool-key] .advanced>label input,
body[data-tool-key] .advanced>label select,
body[data-tool-key] .advanced>label textarea {width:100%;min-width:0;max-width:100%;box-sizing:border-box;min-height:44px;}
body[data-tool-key] .advanced>label button {min-width:0;max-width:100%;min-height:44px;white-space:normal;overflow-wrap:anywhere;}
@container forge-controls (max-width: 540px) {body[data-tool-key] .extra-reference-grid {grid-template-columns:minmax(0,1fr);}}
@container forge-controls (max-width: 300px) {body[data-tool-key] .advanced>label>div {grid-template-columns:minmax(0,1fr);}}

/* Preserve the native accessible file picker against Top-Down's generic input skin. */
body[data-tool-key] .workspace input.file-input {position:absolute!important;width:1px!important;height:1px!important;min-width:0!important;max-width:1px!important;padding:0!important;border:0!important;opacity:0;pointer-events:none;}
