.agent-tools, .agent-tools * { box-sizing:border-box; }
.agent-tools { width:min(760px,calc(100vw - 28px)); max-height:90vh; margin:auto; padding:0; border:1px solid #cbd5e1; border-radius:16px; color:#172b35; background:#fff; box-shadow:0 20px 80px #0005; font:14px/1.5 Arial,sans-serif; }
.agent-tools::backdrop { background:#101e29b8; }
.agent-tools header { display:flex; justify-content:space-between; align-items:start; gap:14px; padding:20px 22px 14px; background:#f3f7f8; border-bottom:1px solid #d9e3e7; }
.agent-tools h2 { margin:0; font-size:21px; line-height:1.3; }
.agent-tools p { margin:6px 0; }
.agent-tools .at-body { padding:18px 22px 22px; }
.agent-tools label { display:block; font-weight:600; margin-bottom:12px; }
.agent-tools input, .agent-tools select { display:block; width:100%; min-height:42px; padding:10px; margin-top:5px; border:1px solid #a7bbc4; border-radius:8px; background:#fff; color:#172b35; font:inherit; }
.agent-tools button { font:inherit; font-weight:700; min-height:40px; padding:8px 14px; border:1px solid #a7bbc4; border-radius:8px; background:#f3f7f8; color:#172b35; cursor:pointer; }
.agent-tools button:disabled { opacity:.55; cursor:default; }
.agent-tools[aria-busy="true"] button:disabled { cursor:wait; }
.agent-tools [hidden], #agent-controls button[hidden] { display:none !important; }
.agent-tools .at-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 16px; }
.agent-tools .at-hint { font-size:13px; color:#506973; }
.agent-tools .at-status { white-space:pre-line; min-height:23px; margin:10px 0; }
.agent-tools .at-error { color:#a62233; }
.agent-tools .at-success { color:#096947; }
.agent-tools .at-feedback { position:sticky; bottom:0; background:#fff; border-top:1px solid #d9e3e7; margin-top:16px; padding:6px 0 14px; }
.agent-tools .at-feedback .at-success { padding:10px 12px; background:#e5f6ee; border:1px solid #75b699; border-radius:8px; font-weight:600; }
.agent-tools .at-feedback footer { margin-top:8px; }
.agent-tools .at-results { max-height:42vh; overflow:auto; border-top:1px solid #d9e3e7; margin-top:12px; }
.agent-tools .at-product { display:flex; gap:16px; justify-content:space-between; align-items:center; padding:13px 0; border-bottom:1px solid #d9e3e7; }
.agent-tools .at-product div { min-width:0; overflow-wrap:anywhere; }
.agent-tools .at-product small { display:block; color:#647d86; }
.agent-tools .at-product button { flex-shrink:0; min-width:126px; }
.agent-tools button.at-enabled { background:#e5f6ee; border-color:#75b699; color:#126940; }
.agent-tools button.at-disabled { background:#fcecee; border-color:#d7a1a7; color:#a32536; }
.agent-tools .at-pending { font-size:12px; color:#8c5b08; font-weight:700; }
.agent-tools footer { display:flex; gap:12px; flex-wrap:wrap; justify-content:space-between; align-items:center; margin-top:18px; }
.agent-tools button.at-primary { background:#008873; border-color:#008873; color:#fff; }
.agent-tools .at-note { padding:10px 12px; background:#fff5dd; border:1px solid #e8c979; border-radius:8px; color:#715214; }
.agent-tools .at-office-select { margin-bottom:16px; }
.agent-tools .at-check { display:flex; gap:9px; align-items:center; font-weight:500; }
.agent-tools .at-check input { width:18px; min-height:18px; margin:0; accent-color:#008873; }
.agent-tools fieldset { border:1px solid #a7bbc4; border-radius:8px; padding:12px; margin:14px 0; min-width:0; }
.agent-tools legend { font-weight:700; padding:0 5px; }
.agent-tools .at-destinations { padding:0; margin:12px 0 0; list-style:none; }
.agent-tools .at-destinations li { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:7px 0; border-top:1px solid #d9e3e7; }
.agent-tools .at-destinations button { min-height:32px; padding:4px 9px; }
.agent-tools .at-destinations span { overflow-wrap:anywhere; }
.agent-tools :focus-visible { outline:3px solid #2f8bc4; outline-offset:2px; }
body.dark-mode .agent-tools { background:#18282f; color:#e8f0f4; border-color:#46616b; }
body.dark-mode .agent-tools header, body.dark-mode .agent-tools button { background:#223841; color:#e8f0f4; border-color:#46616b; }
body.dark-mode .agent-tools input, body.dark-mode .agent-tools select { background:#11232b; color:#e8f0f4; border-color:#46616b; }
body.dark-mode .agent-tools .at-hint, body.dark-mode .agent-tools small { color:#acc0c8; }
body.dark-mode .agent-tools button.at-enabled { background:#173f32; color:#a3edc5; }
body.dark-mode .agent-tools button.at-disabled { background:#4a2830; color:#ffc1c7; }
body.dark-mode .agent-tools button.at-primary { background:#008873; color:white; }
body.dark-mode .agent-tools .at-error { color:#ffb1bb; }
body.dark-mode .agent-tools .at-success { color:#8ee4ba; }
body.dark-mode .agent-tools .at-feedback { background:#18282f; border-color:#46616b; }
body.dark-mode .agent-tools .at-feedback .at-success { background:#173f32; border-color:#46616b; }
body.dark-mode .agent-tools .at-pending { color:#f3d290; }
@media(max-width:540px) {
 .agent-tools .at-grid { grid-template-columns:1fr; }
 .agent-tools header, .agent-tools .at-body { padding:16px; }
 .agent-tools h2 { font-size:19px; }
 .agent-tools .at-product { gap:10px; }
 .agent-tools .at-product button { min-width:116px; padding:8px; }
}
