.tools-dialog{width:min(850px,calc(100% - 24px));max-height:calc(100dvh - 24px);border:1px solid var(--line);border-radius:22px;background:white;color:inherit;padding:0;box-shadow:0 28px 90px #24194362;overflow:auto}
.tools-dialog::backdrop{background:#24203e80;backdrop-filter:blur(3px)}
.tools-dialog .tool-shell{padding:24px clamp(17px,4vw,34px) 28px}
.tool-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px}
.tool-header h2{font-size:clamp(25px,4.5vw,38px);letter-spacing:-.045em;line-height:1.1;margin:0;outline:none}
.tool-header p{font-size:16px;margin:8px 0 0;max-width:52ch}
.tool-close{width:38px;height:38px;flex:none;font-size:20px;padding:0;color:var(--muted)}
.tool-form{display:grid;gap:12px}
.tool-form label,.tool-form legend{font-size:14px;font-weight:650}
.tool-form p{margin:0;font-size:14px}
.tool-form select,.tool-form input[type=file]{min-width:0;width:100%;border:1px solid var(--line);padding:10px;border-radius:9px;background:white;color:inherit;font:inherit}
.tool-form select{appearance:none;padding-right:32px;background:white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%235145dd' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 8px center/15px}
.tool-form fieldset{padding:0;margin:0;border:0;min-width:0}
.tool-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;align-items:center;margin-top:8px}
.tool-actions .primary{min-height:41px}
.tool-files{display:grid;gap:6px;max-height:240px;overflow:auto}
.tool-file{display:flex;align-items:center;gap:6px;background:#f7f6fb;border-radius:9px;padding:7px}
.tool-file span{min-width:0;flex:1;overflow-wrap:anywhere;font-size:14px}
.tool-file button{padding:6px 8px}
.tool-page-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(75px,1fr));gap:8px;max-height:245px;overflow:auto;padding:4px}
.tool-page{border:1px solid var(--line);border-radius:10px;padding:10px 4px;display:grid;justify-items:center;gap:6px;cursor:pointer}
.tool-page:has(:checked){background:var(--soft);border-color:#9183ed;color:#4333bb}
.tool-page input{accent-color:var(--purple)}
.tool-options{display:grid;gap:8px}
.tool-option{display:flex;align-items:flex-start;gap:8px;border:1px solid var(--line);border-radius:10px;padding:10px;cursor:pointer}
.tool-option:has(:checked){background:var(--soft);border-color:#9183ed}
.tool-option input{accent-color:var(--purple)}
.tool-option small{font-weight:400;font-size:14px}
.tool-result{padding:14px 16px;background:#f2f0ff;border-radius:12px;overflow-wrap:anywhere}
.tool-result strong{font-size:16px}
.tool-result p{font-size:14px;margin:7px 0 0}
.tool-error{font-size:14px;color:#a92b48}
#overlay.can-move{cursor:move}
