/* SS AI Agent · historia 4a63714f-80d0-468d-9c77-a2079add912d.
   Presentación aislada: no modifica estilos de otras pantallas. */
.view[data-panel="hosting-agent"]{--agent-surface:var(--paper);--agent-soft:var(--bg);--agent-radius:22px}
.view[data-panel="hosting-agent"] .page-heading{max-width:980px;margin:0 auto 22px;gap:16px;align-items:center}
.view[data-panel="hosting-agent"] .page-heading h2{font-size:24px;letter-spacing:-.04em;margin:5px 0 8px}
.view[data-panel="hosting-agent"] .page-heading p{max-width:600px;font-size:13px;line-height:1.6}
.view[data-panel="hosting-agent"] .page-heading .kicker{font-size:10px;letter-spacing:.14em}
.view[data-panel="hosting-agent"] .page-heading>.button{background:transparent;color:var(--ink);border:1px solid var(--line);box-shadow:none;font-size:12px;padding:10px 14px;border-radius:999px;white-space:nowrap}
.hosting-agent-layout{display:grid;grid-template-columns:180px minmax(0,1fr);gap:18px 28px;align-items:start;max-width:980px;margin:0 auto}
.hosting-agent-layout>*{min-width:0}
.hosting-agent-history{padding:12px 0;min-width:0}
.hosting-agent-history-drawer>summary{cursor:pointer;color:var(--muted);font-size:12px;font-weight:600;padding:9px 8px;border-radius:9px}
.hosting-agent-history-list,.hosting-agent-history-list>div,#hosting-agent-history-list{display:grid;gap:5px;min-width:0;padding-top:12px}
#hosting-agent-history-list>p{font-size:12px;color:var(--muted);padding:0 8px;line-height:1.6}
.hosting-agent-history button{display:block;width:100%;min-width:0;max-width:100%;overflow:hidden;border:0;background:transparent;color:var(--ink);text-align:left;padding:10px;border-radius:10px;cursor:pointer;font:inherit;font-size:12px}
.hosting-agent-history button:hover,.hosting-agent-history button.active{background:var(--agent-soft)}
.hosting-agent-history button strong,.hosting-agent-history button small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}
.hosting-agent-history button small{color:var(--muted);font-size:10px;margin-top:4px}
.hosting-agent-chat{min-height:560px;min-height:min(640px,75vh);display:flex;flex-direction:column;background:var(--agent-surface);border-radius:var(--agent-radius);overflow:hidden;border:1px solid var(--line)}
.hosting-agent-status{min-height:24px;padding:14px 22px 0;color:var(--muted);font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.hosting-agent-status:empty{padding-top:0;min-height:12px}
.hosting-agent-status.error{color:#ad303e}
.hosting-agent-status.success{color:#26735e}
.hosting-agent-status.loading::before{content:"";display:inline-block;width:10px;height:10px;margin-right:8px;border:2px solid var(--line);border-top-color:var(--ink);border-radius:50%;animation:hosting-agent-spin .8s linear infinite}
@keyframes hosting-agent-spin{to{transform:rotate(360deg)}}
.hosting-agent-welcome{margin:auto;max-width:520px;padding:44px 28px;text-align:center}
.hosting-agent-welcome>span{display:grid;place-items:center;width:40px;height:40px;margin:0 auto 22px;color:var(--ink);font-size:23px}
.hosting-agent-welcome h3{font-size:clamp(23px,3vw,32px);font-weight:600;letter-spacing:-.045em;margin:0 0 14px}
.hosting-agent-welcome p{font-size:13px;color:var(--muted);line-height:1.8;max-width:380px;margin:0 auto}
.hosting-agent-chips{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:24px}
.hosting-agent-chips button{border:1px solid var(--line);background:transparent;color:var(--muted);border-radius:999px;padding:8px 12px;font:inherit;font-size:11px;cursor:pointer;min-height:34px}
.hosting-agent-chips button:hover{background:var(--agent-soft);color:var(--ink)}
.hosting-agent-messages{display:flex;flex:1;min-height:180px;max-height:55vh;flex-direction:column;gap:22px;overflow:auto;padding:26px;scrollbar-width:thin}
.hosting-agent-bubble{max-width:88%;padding:12px 16px;border-radius:20px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px}
.hosting-agent-bubble.user{align-self:flex-end;background:var(--agent-soft);color:var(--ink);border-bottom-right-radius:6px}
.hosting-agent-bubble.assistant{align-self:flex-start;background:transparent;color:var(--ink);padding-left:0;max-width:100%}
.hosting-agent-composer{margin:0 16px 16px;padding:12px 14px;background:var(--agent-soft);border:1px solid var(--line);border-radius:20px;display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px 10px}
.hosting-agent-composer>label:first-child{align-self:center;font-size:10px;color:var(--muted);letter-spacing:.04em}
.hosting-agent-composer select{min-width:0;width:100%;max-width:100%;border:0;background:transparent;color:var(--ink);font:inherit;font-size:11px;padding:7px 4px;border-radius:6px}
.hosting-agent-composer textarea{grid-column:1/-1;width:100%;min-height:72px;max-height:200px;resize:vertical;border:0;border-radius:8px;background:transparent;color:var(--ink);padding:9px 3px;font:inherit;font-size:14px;line-height:1.6}
.hosting-agent-composer textarea::placeholder{color:var(--muted);opacity:1}
.hosting-agent-composer-actions,.hosting-agent-review-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;grid-column:1/-1}
.hosting-agent-composer-actions .button{min-height:38px;border-radius:999px;font-size:12px;padding:9px 14px;box-shadow:none}
#hosting-agent-send{background:var(--ink);color:var(--paper);border:0;display:inline-flex;gap:14px;align-items:center}
#hosting-agent-send:disabled{opacity:.55;cursor:wait}
#hosting-agent-send span{font-size:18px;line-height:1}
.hosting-agent-attach.button.secondary{position:relative;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;border:0;background:transparent;color:var(--muted);box-shadow:none}
.hosting-agent-attach input{position:absolute;inset:0;opacity:0;cursor:pointer;max-width:100%}
.hosting-agent-attachment-list{display:flex;grid-column:1/-1;flex-wrap:wrap;gap:7px;min-width:0}
.hosting-agent-attachment{display:flex;gap:8px;align-items:center;border:1px solid var(--line);border-radius:999px;padding:5px 9px;font-size:11px;max-width:100%}
.hosting-agent-attachment>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hosting-agent-attachment button{border:0;background:none;color:inherit;cursor:pointer;min-width:28px;min-height:28px}
.hosting-agent-review{grid-column:2;min-width:0;padding:0 8px;color:var(--ink)}
.hosting-agent-review:not(.has-plan){display:none}
.hosting-agent-review>h3{font-size:15px;font-weight:600;margin:4px 0 14px;letter-spacing:-.02em}
#hosting-agent-plan-summary{font-size:14px;line-height:1.7;margin:0 0 18px;overflow-wrap:anywhere}
.hosting-agent-review section{padding:14px 0;border-top:1px solid var(--line)}
.hosting-agent-review h4{margin:0 0 9px;font-size:11px;font-weight:600;letter-spacing:.02em;color:var(--muted)}
.hosting-agent-review ol,.hosting-agent-review ul{margin:0;padding-left:18px;line-height:1.8;font-size:13px;overflow-wrap:anywhere}
.hosting-agent-review li+li{margin-top:6px}
.hosting-agent-usage{border-top:1px solid var(--line);padding:13px 0}
.hosting-agent-usage summary{cursor:pointer;color:var(--muted);font-size:12px}
.hosting-agent-limit{display:flex;justify-content:space-between;gap:16px;margin:10px 0;font-size:12px}
.hosting-agent-limit span{color:var(--muted)}
.hosting-agent-secure-input{display:grid;gap:8px}
.hosting-agent-secure-input label{display:grid;gap:8px;color:var(--muted);font-size:12px}
.hosting-agent-secure-input input{width:100%;min-height:44px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);padding:0 12px;font:inherit}
.hosting-agent-secure-input small{color:var(--muted);line-height:1.6}
.hosting-agent-changes{display:grid;gap:10px}
.hosting-agent-changes article{min-width:0;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.hosting-agent-changes article strong{display:block;padding:10px 12px;background:var(--agent-soft);font-size:11px;overflow-wrap:anywhere}
.hosting-agent-changes pre{max-height:280px;overflow:auto;margin:0;padding:14px;background:#10202d;color:#e4edf3;white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.6 Consolas,monospace}
#hosting-agent-readonly-notice{padding:12px 0;color:var(--muted);font-size:12px;line-height:1.6}
.hosting-agent-review-actions{justify-content:flex-end;padding:8px 0 18px}
.hosting-agent-review-actions .button{border-radius:999px;box-shadow:none;min-height:42px;font-size:12px}
.view[data-panel="hosting-agent"] :is(button,select,textarea,summary,input):focus-visible{outline:3px solid #168fe8;outline-offset:3px}
.hosting-agent-attach:focus-within{outline:3px solid #168fe8;outline-offset:3px}
@media(max-width:1000px){.hosting-agent-layout{grid-template-columns:1fr;gap:14px}.hosting-agent-review{grid-column:1}.hosting-agent-history{padding:0}.hosting-agent-history-drawer>summary{padding:8px 0}#hosting-agent-history-list{max-height:180px;overflow:auto}.hosting-agent-chat{min-height:560px}}
@media(max-width:600px){.view[data-panel="hosting-agent"] .page-heading{align-items:flex-start;flex-wrap:wrap;margin-bottom:16px}.view[data-panel="hosting-agent"] .page-heading h2{font-size:21px}.view[data-panel="hosting-agent"] .page-heading p{font-size:12px}.hosting-agent-chat{min-height:520px;border-radius:18px}.hosting-agent-welcome{padding:30px 16px}.hosting-agent-welcome h3{font-size:25px}.hosting-agent-welcome p{font-size:12px}.hosting-agent-messages{padding:18px;gap:16px}.hosting-agent-bubble{max-width:95%;font-size:13px}.hosting-agent-composer{margin:0 10px 10px;padding:10px;border-radius:18px}.hosting-agent-review{padding:0 2px}.hosting-agent-review-actions{flex-wrap:wrap}.hosting-agent-review-actions .button{flex:1}.hosting-agent-status{padding-left:16px;padding-right:16px}}
@media(prefers-reduced-motion:reduce){.hosting-agent-status.loading::before{animation:none}}
@media(forced-colors:active){.hosting-agent-chat,.hosting-agent-bubble,.hosting-agent-composer,.hosting-agent-chips button{border:1px solid CanvasText}.view[data-panel="hosting-agent"] :focus-visible{outline-color:Highlight}}


/* Ajuste solicitado: sin scroll exterior solo mientras el Agente está activo.
   Mensajes, historial y plan conservan desplazamiento propio cuando hace falta. */
html:has(.app-shell:not(.hidden) .view[data-panel="hosting-agent"]:not(.hidden)){overflow:hidden;scrollbar-gutter:auto}
body:has(.app-shell:not(.hidden) .view[data-panel="hosting-agent"]:not(.hidden)){height:100dvh;overflow:hidden}
.app-shell:has(.view[data-panel="hosting-agent"]:not(.hidden)){height:100dvh;min-height:0;overflow:hidden}
.main:has(.view[data-panel="hosting-agent"]:not(.hidden)){height:100dvh;min-height:0;display:flex;flex-direction:column;padding-bottom:16px;overflow:hidden}
.main:has(.view[data-panel="hosting-agent"]:not(.hidden))>.topbar{flex:0 0 auto;margin-bottom:14px}
.view[data-panel="hosting-agent"]:not(.hidden){display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.view[data-panel="hosting-agent"] .page-heading{width:100%;flex:0 0 auto;margin:0 auto 14px}
.view[data-panel="hosting-agent"] .hosting-agent-layout{width:100%;flex:1;min-height:0;grid-template-rows:minmax(0,1fr);gap:12px 24px;overflow:hidden}
.view[data-panel="hosting-agent"] .hosting-agent-history{grid-column:1;grid-row:1/-1;min-height:0;max-height:100%;overflow:auto}
.view[data-panel="hosting-agent"] .hosting-agent-chat{grid-column:2;grid-row:1;min-height:0;height:100%;overflow:hidden}
.view[data-panel="hosting-agent"] .hosting-agent-welcome{padding:20px;overflow:auto;min-height:0}
.view[data-panel="hosting-agent"] .hosting-agent-messages{min-height:0;max-height:none;flex:1;overflow:auto}
.view[data-panel="hosting-agent"] .hosting-agent-composer{flex:0 0 auto;margin-bottom:12px}
.view[data-panel="hosting-agent"] .hosting-agent-layout:has(.hosting-agent-review.has-plan){grid-template-rows:minmax(210px,1fr) minmax(150px,.65fr)}
.view[data-panel="hosting-agent"] .hosting-agent-review.has-plan{grid-column:2;grid-row:2;min-height:0;max-height:100%;overflow:auto;padding:8px 12px 12px;overscroll-behavior:contain;border-top:1px solid var(--line);scrollbar-width:thin}
@media(max-width:1000px){
 .view[data-panel="hosting-agent"] .hosting-agent-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}
 .view[data-panel="hosting-agent"] .hosting-agent-history{grid-column:1;grid-row:1;max-height:100px;padding:0}
 .view[data-panel="hosting-agent"] .hosting-agent-chat{grid-column:1;grid-row:2}
 .view[data-panel="hosting-agent"] .hosting-agent-layout:has(.hosting-agent-review.has-plan){grid-template-rows:auto minmax(190px,1fr) minmax(140px,.6fr)}
 .view[data-panel="hosting-agent"] .hosting-agent-review.has-plan{grid-column:1;grid-row:3}
}
@media(max-height:650px){
 .view[data-panel="hosting-agent"] .page-heading p{display:none}
 .main:has(.view[data-panel="hosting-agent"]:not(.hidden))>.topbar{min-height:70px;margin-bottom:8px}
 .view[data-panel="hosting-agent"] .hosting-agent-composer textarea{min-height:42px;max-height:100px}
 .view[data-panel="hosting-agent"] .hosting-agent-layout:has(.hosting-agent-review.has-plan){grid-template-rows:minmax(170px,1fr) minmax(100px,.6fr)}
}
@media(max-width:1000px) and (max-height:650px){.view[data-panel="hosting-agent"] .hosting-agent-layout:has(.hosting-agent-review.has-plan){grid-template-rows:auto minmax(170px,1fr) minmax(100px,.6fr)}}

.hosting-autonomy-mode{display:flex;align-items:center;gap:.5rem;font-size:.85rem}.hosting-autonomy-mode select{max-width:170px;border:1px solid #cfe1ef;border-radius:12px;padding:.5rem;background:transparent;color:inherit}.hosting-autonomy-panel{padding:.5rem 0}.hosting-autonomy-panel>select{width:100%;max-width:100%;padding:.6rem;border:1px solid #cfe1ef;border-radius:12px}.hosting-autonomy-tasks{list-style:none;margin:1rem 0;padding:0}.hosting-autonomy-tasks li{border-bottom:1px solid #dce8f1;padding:.75rem 0}.hosting-autonomy-tasks strong,.hosting-autonomy-tasks small{display:block;overflow-wrap:anywhere}.hosting-autonomy-tasks small{margin-top:.35rem;color:#58768d}.hosting-autonomy-warning{border-left:3px solid #d3a337;padding:.6rem .8rem;background:#fff9e9;border-radius:8px}#hosting-autonomy-permissions label,.hosting-autonomy-consent{display:flex;gap:.65rem;align-items:flex-start;margin:.8rem 0;font-size:.85rem}#hosting-autonomy-permissions input,.hosting-autonomy-consent input{flex:none;width:16px;height:16px;margin-top:3px}.hosting-autonomy-controls{display:flex;flex-wrap:wrap;gap:.5rem;margin:1rem 0}.hosting-autonomy-panel .button{white-space:normal}.hosting-agent-review.autonomy-active>#hosting-agent-plan,.hosting-agent-review.autonomy-active>#hosting-agent-plan-empty{display:none!important}.hosting-autonomy-warning{color:#4e3e1b}

