/* Ask an agent (public/agents-out.js): the button on the analysis and question cards and the brief, and the dialog
   (agent, skill, need, the context preview, progress, the answer with System One's badges). Logical properties
   throughout, so Arabic mirrors without extra rules. */
.ao-ask-row{display:flex;margin:0 0 7px}
.ao-ask{display:inline-flex;align-items:center;gap:6px;padding:3px 9px 3px 7px;border:1px dashed rgba(167,139,250,.5);border-radius:999px;background:rgba(167,139,250,.06);color:#C4B5FD;font:600 11px/1.5 var(--font-h);letter-spacing:.02em;transition:.18s;max-width:100%}
.ao-ask span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ao-ask svg{flex:0 0 auto}
.ao-ask:hover,.ao-ask:focus-visible{border-style:solid;border-color:rgba(167,139,250,.8);background:rgba(167,139,250,.14);color:#E4DCFF}
.ao-ask.is-running{border-style:solid}
.ao-ask.is-running svg{animation:ao-pulse 1.2s ease-in-out infinite}
.btn.ao-brief{display:inline-flex;align-items:center;gap:7px;border-color:rgba(167,139,250,.55);color:#D8CCFF}
.btn.ao-brief:hover{border-color:#C4B5FD;background:rgba(167,139,250,.1)}
.btn.ao-brief span{white-space:nowrap}
.modal .row:has(> #ao-brief){flex-wrap:wrap}
@keyframes ao-pulse{50%{opacity:.35}}
html.ao-lock{overflow:hidden}
.ao-overlay{position:fixed;inset:0;z-index:99;display:flex;align-items:center;justify-content:center;padding:24px 16px;background:#02060dc4;backdrop-filter:blur(5px)}
.ao-overlay[hidden]{display:none}
.ao-dialog{position:relative;width:100%;max-width:640px;max-height:calc(100dvh - 48px);overflow:auto;overscroll-behavior:contain;padding:26px 27px 22px;border:1px solid #3b3566;border-radius:14px;background:linear-gradient(160deg,#141a2e,#0f1523 55%);color:var(--fg);box-shadow:0 30px 100px #0009}
.ao-dialog:focus{outline:none}
.ao-dialog :focus-visible{outline:2px solid #C4B5FD;outline-offset:3px}
.ao-close{position:absolute;top:12px;inset-inline-end:13px;width:30px;height:30px;font-size:23px;line-height:1;color:var(--muted)}
.ao-close:hover{color:#E4DCFF}
.ao-dialog h2{margin:0 0 4px;padding-inline-end:30px;font:600 21px/1.3 var(--font-h);overflow-wrap:anywhere}
.ao-dialog h3{margin:0 0 8px;font:600 10.5px var(--font-h);letter-spacing:.14em;text-transform:uppercase;color:#B7ABEB}
.ao-sub{margin:0 0 16px;color:var(--muted);font-size:12.5px;line-height:1.6;overflow-wrap:anywhere}
.ao-sub code{font-size:11px;color:#C4B5FD}
.ao-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:0 14px}
.ao-field{display:flex;flex-direction:column;gap:6px;margin:0 0 14px;font-size:12px;color:#c9d2e3;min-width:0}
.ao-field>span{font-weight:500}
.ao-field select,.ao-field textarea{width:100%;min-width:0;padding:10px 11px;font:12.5px var(--font-b);background:#0b1220;border:1px solid #38425c;border-radius:7px;color:var(--fg);outline:none}
.ao-field textarea{resize:vertical;min-height:54px;line-height:1.55}
.ao-field select:focus,.ao-field textarea:focus{border-color:#A78BFA}
.ao-field textarea::placeholder{color:#76839a}
.ao-host{font:10.5px monospace;color:#7d8aa3;overflow-wrap:anywhere;text-align:start}
.ao-count{align-self:flex-end;font-size:10.5px;color:#76839a}
.ao-count.is-near{color:#FCD34D}
.ao-preview{margin:4px 0 14px;padding:14px;border:1px solid #2e3a55;border-radius:10px;background:#0c1322}
.ao-muted{margin:0 0 8px;color:var(--muted);font-size:11.5px;line-height:1.6}
.ao-chips{display:flex;flex-wrap:wrap;gap:6px}
.ao-chip{display:inline-flex;align-items:center;padding:3px 8px;border:1px solid #33405c;border-radius:999px;background:#131c2f;color:#b9c6da;font:500 10.5px/1.5 var(--font-b);white-space:nowrap}
.ao-chip.is-tokens{border-color:rgba(167,139,250,.5);color:#DCD2FF}
.ao-chip.is-tokens b{font-weight:600}
.ao-chip.is-warn{border-color:rgba(245,158,11,.55);color:#FCD34D}
.ao-sections{margin:8px 0 0;padding-inline:18px;font-size:11px;line-height:1.6;color:#9fb0c6}
.ao-never{margin:10px 0 0;padding-top:9px;border-top:1px dashed #2a3550;color:#8ea0b8;font-size:11px;line-height:1.6}
.ao-exact{margin-top:10px}
.ao-exact summary,.ao-data summary,.ao-used summary{cursor:pointer;font-size:11px;color:#C4B5FD;padding:2px 0}
.ao-code{max-height:260px;overflow:auto;margin:8px 0 0;padding:12px;border:1px solid #2c3a55;border-radius:8px;background:#080e1a;color:#b9cde6;font:10.5px/1.65 monospace;white-space:pre-wrap;overflow-wrap:anywhere;text-align:left}
.ao-history{margin:0 0 12px}
.ao-history ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.ao-hist{display:flex;justify-content:space-between;align-items:center;gap:10px;width:100%;padding:8px 10px;border:1px solid #2c3750;border-radius:8px;background:#0f1728;color:#cdd6e5;font-size:11.5px;text-align:start}
.ao-hist:hover{border-color:rgba(167,139,250,.6)}
.ao-hist small{flex:0 0 auto;color:var(--muted);font-size:10.5px}
.ao-state{font-weight:600}
.ao-state.is-stored{color:#8FE3D6}.ao-state.is-quarantined,.ao-state.is-failed,.ao-state.is-timeout{color:#FCA5A5}.ao-state.is-low_credibility,.ao-state.is-off_task{color:#FCD34D}.ao-state.is-input_required{color:#C4B5FD}
.ao-note{margin:4px 0 0;color:#8f9bb2;font-size:11px;line-height:1.6}
.ao-notice{padding:12px 14px;border:1px solid #5a5737;border-radius:8px;background:#282b20;color:#d9ce99;font-size:12px;line-height:1.7}
.ao-warn{margin:0 0 12px;padding:9px 11px;border:1px solid #5d4a26;border-radius:8px;background:#2a2317;color:#e6c98a;font-size:11.5px;line-height:1.6}
.ao-link{color:#C4B5FD;font:600 11.5px var(--font-b);text-decoration:underline;text-underline-offset:2px;padding:0}
.ao-error:empty{display:none}
.ao-error:not(:empty){margin:10px 0;padding:10px 12px;border:1px solid #653849;border-radius:8px;background:#321e29;color:#f3afb5;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.ao-empty{display:flex;gap:14px;align-items:center;padding:18px;border:1px dashed #3b3f63;border-radius:12px;color:#8e89b8}
.ao-empty strong{font-size:13px;font-weight:600;color:#d7d2f3}
.ao-empty p{margin:4px 0 0;font-size:12px;line-height:1.6;color:#9aa5bb}
.ao-empty svg{width:22px;height:22px;flex:none}
.ao-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:9px;margin-top:16px;padding-top:15px;border-top:1px solid #262f45}
.ao-actions.is-inline{margin-top:10px;padding-top:0;border-top:0}
.ao-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:9px 14px;border:1px solid #394360;border-radius:8px;background:#172035;color:var(--fg);font:500 12px var(--font-b);white-space:nowrap;max-width:100%}
.ao-btn span{overflow:hidden;text-overflow:ellipsis}
.ao-btn:hover{border-color:#A78BFA;background:#1d2440}
.ao-btn:disabled{opacity:.45;cursor:not-allowed}
.ao-primary{background:#8B5CF6;border-color:#8B5CF6;color:#fff;font-weight:600}
.ao-primary:hover{background:#9D74F8;border-color:#9D74F8}
.ao-danger{color:#f4b0b8;border-color:#733b49;background:#321e29}
.ao-stages{list-style:none;margin:6px 0 10px;padding:0;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.ao-stages li{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;font-size:10.5px;line-height:1.35;color:#6f7b93}
.ao-stages i{display:block;width:100%;height:4px;border-radius:2px;background:#27304a}
.ao-stages li.is-done{color:#b9c6da}.ao-stages li.is-done i{background:#8B5CF6}
.ao-stages li.is-now{color:#E4DCFF;font-weight:600}.ao-stages li.is-now i{background:linear-gradient(90deg,#8B5CF6,#C4B5FD,#8B5CF6);background-size:200% 100%;animation:ao-slide 1.4s linear infinite}
.ao-stages li.is-error{color:#FCA5A5}.ao-stages li.is-error i{background:#b0414f}
@keyframes ao-slide{to{background-position:-200% 0}}
.ao-remote code{font:10.5px monospace;color:#b9c6da}
.ao-sent{margin:12px 0 4px}
.ao-outcome{margin:6px 0 10px;padding:11px 13px;border-radius:9px;border:1px solid #2e3a55;background:#0f1728;font-size:12.5px;line-height:1.6}
.ao-outcome strong{font-weight:600}
.ao-outcome p{margin:4px 0 0;color:#c9d2e3;font-size:12px}
.ao-outcome.is-stored{border-color:rgba(45,212,191,.45);background:rgba(45,212,191,.07);color:#B6EFE5}
.ao-outcome.is-quarantined,.ao-outcome.is-error{border-color:rgba(239,68,68,.45);background:rgba(239,68,68,.08);color:#FCA5A5}
.ao-outcome.is-off_task,.ao-outcome.is-low_credibility,.ao-outcome.is-unjudged{border-color:rgba(245,158,11,.45);background:rgba(245,158,11,.07);color:#FCD34D}
.ao-outcome.is-input{border-color:rgba(167,139,250,.5);background:rgba(167,139,250,.08);color:#DCD2FF}
.ao-said{margin:0 0 10px;padding:10px 12px;border-inline-start:3px solid rgba(167,139,250,.6);border-radius:6px;background:#0c1322;color:#d6deeb;font-size:12px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}
.ao-quote{margin:0 0 10px;color:#DCD2FF;font-size:12px}
.ao-said-line{overflow-wrap:anywhere}
.ao-said-line q{color:#e6ecf5}
.ao-said-line code{font-size:10.5px;color:#FCA5A5}
.ao-rctx-none{margin:-4px 0 12px}
.ao-badges{display:flex;flex-wrap:wrap;gap:5px;margin:0 0 10px}
.ao-badge{display:inline-flex;align-items:center;gap:5px;padding:2px 8px;border:1px solid var(--border);border-radius:999px;font:600 10.5px/1.55 var(--font-h);color:var(--muted);white-space:nowrap;max-width:100%}
.ao-badge bdi{overflow:hidden;text-overflow:ellipsis}
.ao-badge.is-ext{border-color:rgba(167,139,250,.5);color:#D5CBFF}
.ao-badge.is-ok{border-color:rgba(45,212,191,.55);color:#8FE3D6;background:rgba(45,212,191,.08)}
.ao-badge.is-sys{border-color:rgba(96,165,250,.45);color:#A9CBFF}
.ao-badge.is-low,.ao-badge.is-off,.ao-badge.is-warn{border-color:rgba(245,158,11,.55);color:#FCD34D;background:rgba(245,158,11,.08)}
.ao-badge.is-flag{border-color:rgba(239,68,68,.6);color:#FCA5A5;background:rgba(239,68,68,.12)}
.ao-badge.is-muted{border-color:#3a4458;color:#9aa4b6}
.ao-badge.is-used{border-color:var(--teal);background:var(--teal);color:#06251f}
.ao-numbers{margin-top:2px}
.ao-answer{margin:4px 0 10px;padding:14px 15px;border:1px solid #2e3a55;border-radius:10px;background:#0b1221;max-height:340px;overflow:auto}
.ao-answer.is-unused{opacity:.78;border-style:dashed}
.ao-md{font-size:12.5px;line-height:1.65;overflow-wrap:anywhere}
.ao-md>:first-child{margin-top:0}
.ao-md>:last-child{margin-bottom:0}
.ao-md a{color:#C4B5FD}
.ao-data{margin-top:10px}
.ao-withheld{margin:4px 0 10px;border:1px dashed rgba(239,68,68,.55);border-radius:10px;background:rgba(239,68,68,.06);padding:0}
.ao-withheld summary{display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px 12px;padding:11px 13px;cursor:pointer;list-style:none}
.ao-withheld summary::-webkit-details-marker{display:none}
.ao-withheld summary b{color:#FCA5A5;font:600 12.5px var(--font-h)}
.ao-withheld summary span{color:#f3b4b4;font-size:11px;text-decoration:underline;text-underline-offset:2px}
.ao-withheld>.ao-muted{padding:0 13px}
.ao-withheld-body{padding:0 13px 12px}
.ao-plain{margin:0;max-height:220px;overflow:auto;padding:10px;border-radius:7px;background:#12090d;color:#e2c7c9;font:11px/1.6 monospace;white-space:pre-wrap;overflow-wrap:anywhere;unicode-bidi:plaintext}
.ao-confirm{margin:8px 0 4px;padding:12px 14px;border:1px solid rgba(167,139,250,.5);border-radius:10px;background:rgba(139,92,246,.08)}
.ao-confirm p{margin:0;font-size:12px;line-height:1.65;color:#dcd6f5}
.ao-accepted{margin:6px 0 8px;color:#8FE3D6;font:600 12px var(--font-h)}
.ao-why{margin-top:4px}
.ao-meta{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:8px 16px;margin-top:6px;color:var(--muted);font-size:11px}
.ao-meta .ao-used{flex:1;min-width:0}
.ao-meta .ao-used .ao-chips{margin-top:8px}
@media(max-width:700px){
  .ao-overlay{padding:0;align-items:flex-end}
  .ao-dialog{max-width:none;max-height:92dvh;border-radius:14px 14px 0 0;padding:22px 16px 18px}
  .ao-dialog h2{font-size:19px}
  .ao-grid{grid-template-columns:1fr}
  .ao-stages{grid-template-columns:repeat(4,minmax(0,1fr));row-gap:10px}
  .ao-actions{justify-content:stretch}
  .ao-actions .ao-btn{flex:1 1 auto}
  .ao-chip{white-space:normal}
  .modal .row:has(> #ao-brief)>.btn{flex:1 1 auto}
  .btn.ao-brief{flex:1 1 100%;justify-content:center;order:-1}
}
@media(prefers-reduced-motion:reduce){.ao-ask.is-running svg,.ao-stages li.is-now i{animation:none}}
/* light-theme:begin — generated by tools/light-theme.mjs from the rules above; do not edit by hand (hand-tuned light rules go after the end marker) */
html[data-theme="light"] .ao-ask{border:1px dashed rgba(167,139,250,.5);background:rgba(167,139,250,.06);color:#1a007a}
html[data-theme="light"] .ao-ask:hover,html[data-theme="light"] .ao-ask:focus-visible{border-color:rgba(167,139,250,.8);background:rgba(167,139,250,.14);color:#1c007a}
html[data-theme="light"] .btn.ao-brief{border-color:rgba(167,139,250,.55);color:#1d007a}
html[data-theme="light"] .btn.ao-brief:hover{border-color:#C4B5FD;background:rgba(167,139,250,.1)}
html[data-theme="light"] .ao-overlay{background:rgba(15,23,42,.423)}
html[data-theme="light"] .ao-dialog{border:1px solid #d7d6e3;background:linear-gradient(160deg,#edeef4,#f1f3f6 55%);box-shadow:0 30px 100px rgba(15,23,42,.21)}
html[data-theme="light"] .ao-dialog :focus-visible{outline:2px solid #C4B5FD}
html[data-theme="light"] .ao-close:hover{color:#1c007a}
html[data-theme="light"] .ao-dialog h3{color:#251666}
html[data-theme="light"] .ao-sub code{color:#1a007a}
html[data-theme="light"] .ao-field{color:#262f40}
html[data-theme="light"] .ao-field select,html[data-theme="light"] .ao-field textarea{background:#f2f4f8;border:1px solid #d9dce3}
html[data-theme="light"] .ao-field select:focus,html[data-theme="light"] .ao-field textarea:focus{border-color:#A78BFA}
html[data-theme="light"] .ao-field textarea::placeholder{color:#5e6878}
html[data-theme="light"] .ao-host{color:#5c667a}
html[data-theme="light"] .ao-count{color:#5e6878}
html[data-theme="light"] .ao-count.is-near{color:#997500}
html[data-theme="light"] .ao-preview{border:1px solid #dce0e7;background:#f2f4f8}
html[data-theme="light"] .ao-chip{border:1px solid #d9dde4;background:#eceff4;color:#303c4f}
html[data-theme="light"] .ao-chip.is-tokens{border-color:rgba(167,139,250,.5);color:#1b007a}
html[data-theme="light"] .ao-chip.is-warn{border-color:rgba(245,158,11,.55);color:#997500}
html[data-theme="light"] .ao-sections{color:#455468}
html[data-theme="light"] .ao-never{border-top:1px dashed #dee1e9;color:#546479}
html[data-theme="light"] .ao-exact summary,html[data-theme="light"] .ao-data summary,html[data-theme="light"] .ao-used summary{color:#1a007a}
html[data-theme="light"] .ao-code{border:1px solid #dce0e8;background:#f5f7fa;color:#1f3a5c}
html[data-theme="light"] .ao-hist{border:1px solid #dee1e8;background:#eff1f6;color:#242d3c}
html[data-theme="light"] .ao-hist:hover{border-color:rgba(167,139,250,.6)}
html[data-theme="light"] .ao-state.is-stored{color:#1e8373}
html[data-theme="light"] .ao-state.is-quarantined,html[data-theme="light"] .ao-state.is-failed,html[data-theme="light"] .ao-state.is-timeout{color:#790101}
html[data-theme="light"] .ao-state.is-low_credibility,html[data-theme="light"] .ao-state.is-off_task{color:#997500}
html[data-theme="light"] .ao-state.is-input_required{color:#1a007a}
html[data-theme="light"] .ao-note{color:#596478}
html[data-theme="light"] .ao-notice{border:1px solid #e3e2da;background:#eff0ed;color:#716528}
html[data-theme="light"] .ao-warn{border:1px solid #e9e4da;background:#f3f1ee;color:#816018}
html[data-theme="light"] .ao-link{color:#1a007a}
html[data-theme="light"] .ao-error:not(:empty){border:1px solid #e2d6da;background:#f0eaed;color:#6d0e16}
html[data-theme="light"] .ao-empty{border:1px dashed #d6d7e1;color:#58547e}
html[data-theme="light"] .ao-empty strong{color:#231862}
html[data-theme="light"] .ao-empty p{color:#505a6d}
html[data-theme="light"] .ao-actions{border-top:1px solid #e3e5eb}
html[data-theme="light"] .ao-btn{border:1px solid #d7dae2;background:#eaecf2}
html[data-theme="light"] .ao-btn:hover{border-color:#A78BFA;background:#e5e7ef}
html[data-theme="light"] .ao-primary{background:#8B5CF6;border-color:#8B5CF6;color:#1f1f1f}
html[data-theme="light"] .ao-primary:hover{background:#9D74F8;border-color:#9D74F8}
html[data-theme="light"] .ao-danger{color:#6e0d18;border-color:#dfd0d4;background:#f0eaed}
html[data-theme="light"] .ao-stages li{color:#5f6777}
html[data-theme="light"] .ao-stages i{background:#e1e3ea}
html[data-theme="light"] .ao-stages li.is-done{color:#303c4f}
html[data-theme="light"] .ao-stages li.is-done i{background:#8B5CF6}
html[data-theme="light"] .ao-stages li.is-now{color:#1c007a}
html[data-theme="light"] .ao-stages li.is-now i{background:linear-gradient(90deg,#8B5CF6,#C4B5FD,#8B5CF6)}
html[data-theme="light"] .ao-stages li.is-error{color:#790101}
html[data-theme="light"] .ao-stages li.is-error i{background:#b0414f}
html[data-theme="light"] .ao-remote code{color:#303c4f}
html[data-theme="light"] .ao-outcome{border:1px solid #dce0e7;background:#eff1f6}
html[data-theme="light"] .ao-outcome p{color:#262f40}
html[data-theme="light"] .ao-outcome.is-stored{border-color:rgba(45,212,191,.45);background:rgba(45,212,191,.07);color:#146658}
html[data-theme="light"] .ao-outcome.is-quarantined,html[data-theme="light"] .ao-outcome.is-error{border-color:rgba(239,68,68,.45);background:rgba(239,68,68,.08);color:#790101}
html[data-theme="light"] .ao-outcome.is-off_task,html[data-theme="light"] .ao-outcome.is-low_credibility,html[data-theme="light"] .ao-outcome.is-unjudged{border-color:rgba(245,158,11,.45);background:rgba(245,158,11,.07);color:#997500}
html[data-theme="light"] .ao-outcome.is-input{border-color:rgba(167,139,250,.5);background:rgba(167,139,250,.08);color:#1b007a}
html[data-theme="light"] .ao-said{border-inline-start:3px solid rgba(167,139,250,.6);background:#f2f4f8;color:#1d2634}
html[data-theme="light"] .ao-quote{color:#1b007a}
html[data-theme="light"] .ao-said-line q{color:#223859}
html[data-theme="light"] .ao-said-line code{color:#790101}
html[data-theme="light"] .ao-badge.is-ext{border-color:rgba(167,139,250,.5);color:#18007a}
html[data-theme="light"] .ao-badge.is-ok{border-color:rgba(45,212,191,.55);color:#1e8373;background:rgba(45,212,191,.08)}
html[data-theme="light"] .ao-badge.is-sys{border-color:rgba(96,165,250,.45);color:#00307a}
html[data-theme="light"] .ao-badge.is-low,html[data-theme="light"] .ao-badge.is-off,html[data-theme="light"] .ao-badge.is-warn{border-color:rgba(245,158,11,.55);color:#997500;background:rgba(245,158,11,.08)}
html[data-theme="light"] .ao-badge.is-flag{border-color:rgba(239,68,68,.6);color:#790101;background:rgba(239,68,68,.12)}
html[data-theme="light"] .ao-badge.is-muted{border-color:#dadde2;color:#555e6e}
html[data-theme="light"] .ao-badge.is-used{color:#06251f}
html[data-theme="light"] .ao-answer{border:1px solid #dce0e7;background:#f2f4f8}
html[data-theme="light"] .ao-md a{color:#1a007a}
html[data-theme="light"] .ao-withheld{border:1px dashed rgba(239,68,68,.55);background:rgba(239,68,68,.06)}
html[data-theme="light"] .ao-withheld summary b{color:#790101}
html[data-theme="light"] .ao-withheld summary span{color:#6c0f0f}
html[data-theme="light"] .ao-plain{background:#faf7f8;color:#422729}
html[data-theme="light"] .ao-confirm{border:1px solid rgba(167,139,250,.5);background:rgba(139,92,246,.08)}
html[data-theme="light"] .ao-confirm p{color:#251664}
html[data-theme="light"] .ao-accepted{color:#1e8373}
/* light-theme:end */
