*{box-sizing:border-box}html,body{margin:0;min-height:100%;width:100%;max-width:100%;overflow-x:hidden;background:#f5f7fb;color:#111827;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}body{min-height:100dvh;min-height:var(--nova-visible-height,100dvh)}.shell{width:100%;max-width:760px;min-height:100dvh;margin:0 auto;padding:env(safe-area-inset-top) 16px calc(var(--nova-composer-space,190px) + 18px + env(safe-area-inset-bottom));position:relative}.topbar{display:flex;align-items:center;justify-content:space-between;padding:18px 2px 10px}.eyebrow{margin:0 0 3px;font-size:.68rem;font-weight:800;letter-spacing:.12em;color:#6b7280}.topbar h1{margin:0;font-size:1.65rem}.ghost{border:1px solid #d7dce4;background:#fff;border-radius:12px;padding:9px 12px;font-weight:700;color:#374151}.status-card{display:flex;gap:10px;align-items:flex-start;background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:13px 14px;box-shadow:0 4px 18px rgba(17,24,39,.04)}.status-card strong{font-size:.9rem}.status-card p{margin:3px 0 0;color:#6b7280;font-size:.78rem}.status-dot{width:9px;height:9px;border-radius:50%;background:#9ca3af;margin-top:5px;box-shadow:0 0 0 4px rgba(156,163,175,.11)}.conversation{padding:18px 0 24px;display:flex;flex-direction:column;gap:15px}.message{display:flex;gap:9px;align-items:flex-start}.message.user{justify-content:flex-end}.avatar{width:30px;height:30px;display:grid;place-items:center;border-radius:10px;background:#111827;color:#fff;font-size:.75rem;font-weight:800;flex:0 0 auto}.bubble{max-width:88%;border-radius:17px;padding:12px 14px;background:#fff;border:1px solid #e5e7eb;line-height:1.46;box-shadow:0 3px 14px rgba(17,24,39,.035)}.bubble p{margin:0;white-space:pre-wrap}.message.user .bubble{background:#111827;color:#fff;border-color:#111827}.trace{margin-top:9px;padding-top:8px;border-top:1px solid #e5e7eb;font-size:.72rem;color:#6b7280}.next-step{margin-top:9px;padding:9px 10px;border-radius:12px;background:#f3f4f6;font-size:.8rem}.composer-wrap{position:fixed;left:0;right:0;bottom:0;background:linear-gradient(to top,#f5f7fb 78%,rgba(245,247,251,0));padding:20px 16px calc(10px + env(safe-area-inset-bottom));z-index:5}.composer-wrap>*{max-width:728px;margin-left:auto;margin-right:auto}.quick-prompts{display:flex;gap:7px;overflow:auto;padding-bottom:8px}.quick-prompts button{white-space:nowrap;border:1px solid #d9dee7;background:#fff;border-radius:999px;padding:8px 10px;font-size:.75rem;font-weight:700}.composer{display:flex;align-items:flex-end;gap:8px;min-width:0;background:#fff;border:1px solid #d9dee7;border-radius:18px;padding:7px 7px 7px 12px;box-shadow:0 8px 30px rgba(17,24,39,.09)}textarea{flex:1;min-width:0;width:100%;border:0;outline:0;resize:none;font:inherit;line-height:1.4;max-height:130px;background:transparent;padding:7px 0}#sendBtn{width:38px;height:38px;border:0;border-radius:12px;background:#111827;color:#fff;font-size:1.15rem;font-weight:800}.footnote{text-align:center;color:#8a93a1;font-size:.67rem;margin-top:7px}.loading .bubble:after{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:#9ca3af;box-shadow:10px 0 #9ca3af,20px 0 #9ca3af;animation:pulse 1s infinite;margin:0 18px 3px 5px}@keyframes pulse{0%,100%{opacity:.35}50%{opacity:1}}dialog{width:min(92vw,680px);border:0;border-radius:18px;padding:18px;box-shadow:0 20px 70px rgba(0,0,0,.2)}dialog::backdrop{background:rgba(17,24,39,.45)}.dialog-head{display:flex;justify-content:space-between;align-items:center}.dialog-head h2{margin:0}.source-item{padding:12px 0;border-bottom:1px solid #e5e7eb}.source-item:last-child{border-bottom:0}.source-item strong{display:block;font-size:.88rem}.source-item span{display:block;font-size:.74rem;color:#6b7280;margin-top:3px}.token-dialog form{display:grid;gap:12px}.token-dialog h2,.token-dialog p{margin:0}.token-dialog input{padding:12px;border:1px solid #d1d5db;border-radius:12px;font:inherit}.primary{border:0;background:#111827;color:#fff;border-radius:12px;padding:12px;font-weight:800}@media(min-width:700px){.shell{padding-left:22px;padding-right:22px}.composer-wrap{padding-left:22px;padding-right:22px}}
.bubble,.bubble p,.next-step,.trace{-webkit-user-select:text;user-select:text}
body.text-selecting .composer-wrap{opacity:0;pointer-events:none;transition:opacity .12s ease}
body.text-selecting .shell{padding-bottom:calc(140px + env(safe-area-inset-bottom))}

.nova-update-notice{position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));max-width:736px;margin:auto;z-index:50;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#111827;color:#fff;border-radius:16px;padding:12px 12px 12px 14px;box-shadow:0 14px 40px rgba(17,24,39,.28)}
.nova-update-copy{display:flex;flex-direction:column;gap:2px;min-width:0}.nova-update-copy strong{font-size:.9rem}.nova-update-copy span{font-size:.76rem;color:#d1d5db}
.nova-update-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}.nova-update-primary{border:0;background:#fff;color:#111827;border-radius:10px;padding:9px 12px;font-weight:800}.nova-update-close{width:34px;height:34px;border:1px solid rgba(255,255,255,.22);background:transparent;color:#fff;border-radius:10px;font-size:1.25rem;line-height:1}
@media(max-width:430px){.nova-update-notice{align-items:flex-start}.nova-update-actions{margin-top:1px}.nova-update-copy span{max-width:180px}}

.nova-update-main{display:flex;flex-direction:column;gap:8px;min-width:0;flex:1}
.nova-update-progress-row{display:flex;align-items:center;gap:8px}
.nova-update-bar{height:7px;flex:1;background:rgba(255,255,255,.18);border-radius:999px;overflow:hidden}
.nova-update-bar-fill{height:100%;width:0;background:#fff;border-radius:999px;transition:width .25s ease}
.nova-update-percent{font-size:.72rem;font-weight:800;color:#fff;min-width:34px;text-align:right}
.nova-update-retry{border:1px solid rgba(255,255,255,.28);background:transparent;color:#fff;border-radius:10px;padding:9px 10px;font-weight:800}

/* Nova responsive conversation layout V1 — lectura más cómoda en celular y escritorio */
.message{min-width:0;width:100%}
.message.nova{justify-content:flex-start}
.message.nova .bubble{max-width:min(92%,680px)}
.message.user .bubble{max-width:min(82%,620px)}
.bubble,.bubble p,.next-step,.trace{
  min-width:0;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.trace{line-height:1.4}
.next-step{line-height:1.42}
.avatar{margin-top:1px}

@media(max-width:600px){
  .shell{
    max-width:none;
    padding-left:10px;
    padding-right:10px;
  }
  .topbar{padding-left:2px;padding-right:2px}
  .conversation{gap:12px;padding-top:14px}
  .message{gap:7px}
  .avatar{
    width:28px;
    height:28px;
    border-radius:9px;
    font-size:.72rem;
  }
  .message.nova .bubble{
    max-width:calc(100% - 35px);
    padding:11px 12px;
    border-radius:15px;
  }
  .message.user .bubble{
    max-width:88%;
    padding:10px 12px;
    border-radius:15px;
  }
  .bubble{font-size:.96rem;line-height:1.48}
  .next-step{
    margin-top:10px;
    padding:9px 10px;
    font-size:.79rem;
  }
  .trace{
    margin-top:10px;
    padding-top:8px;
    font-size:.7rem;
  }
  .composer-wrap{padding-left:10px;padding-right:10px}
  .quick-prompts{
    gap:6px;
    padding:0 0 7px;
    scrollbar-width:none;
  }
  .quick-prompts::-webkit-scrollbar{display:none}
  .quick-prompts button{
    padding:7px 10px;
    font-size:.72rem;
  }
  .composer{border-radius:16px}
  .footnote{font-size:.64rem}
}

@media(min-width:900px){
  .shell{max-width:900px}
  .composer-wrap>*{max-width:856px}
  .message.nova .bubble{max-width:74%}
  .message.user .bubble{max-width:66%}
}



/* Nova Mobile Response Viewport V1 — respuesta completa visible desde el inicio */
.message{
  scroll-margin-top:12px;
  scroll-margin-bottom:calc(var(--nova-composer-space,190px) + 12px);
}
.composer-wrap{
  max-width:100vw;
}

@media(max-width:420px){
  .shell{
    padding-left:8px;
    padding-right:8px;
  }
  .conversation{
    gap:10px;
  }
  .message{
    gap:6px;
  }
  .avatar{
    width:25px;
    height:25px;
    border-radius:8px;
    font-size:.68rem;
  }
  .message.nova .bubble{
    max-width:calc(100% - 31px);
    padding:10px 11px;
  }
  .message.user .bubble{
    max-width:94%;
    padding:9px 11px;
  }
  .bubble{
    font-size:.93rem;
    line-height:1.46;
  }
  .composer-wrap{
    padding-left:8px;
    padding-right:8px;
  }
  .quick-prompts button{
    font-size:.69rem;
    padding:7px 9px;
  }
  .footnote{
    font-size:.61rem;
  }
}

@media(max-height:620px){
  .topbar{
    padding-top:10px;
    padding-bottom:7px;
  }
  .status-card{
    padding:10px 11px;
  }
  .conversation{
    padding-top:10px;
  }
  .quick-prompts{
    padding-bottom:5px;
  }
  .footnote{
    margin-top:5px;
  }
}


/* Nova copy-on-tap V1: mobile-first, sin desplazar el scroll de la conversación. */
.nova-copy-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:9px}
.nova-copy-button{
  appearance:none;display:inline-flex;align-items:center;justify-content:center;
  min-height:36px;min-width:76px;padding:7px 11px;border-radius:10px;
  border:1px solid #cbd5e1;background:#fff;color:#1f2937;
  font:inherit;font-size:.76rem;font-weight:700;line-height:1.2;
  cursor:pointer;touch-action:manipulation
}
.nova-copy-button:focus-visible{outline:3px solid #64748b;outline-offset:2px}
.nova-copy-button:disabled{opacity:.7;cursor:default}
.nova-copy-block{max-width:100%;min-width:0;margin:10px 0;border-radius:12px;border:1px solid #dbe2ec;background:#f8fafc;overflow:hidden}
.nova-copy-block-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px;border-bottom:1px solid #e2e8f0;font-size:.78rem;font-weight:700}
.nova-copy-block pre{margin:0;padding:10px;max-width:100%;overflow-x:auto;white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal;color:#0f172a;font-size:.82rem;line-height:1.5;tab-size:2;-webkit-user-select:text;user-select:text}
.nova-copy-block code{font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace}
.nova-next-step-header{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:5px}
.nova-next-step-header strong{min-width:0}
@media(max-width:420px){
  .nova-copy-button{font-size:.73rem;min-height:38px;padding:8px 10px}
  .nova-copy-block-header{padding:7px 8px}
  .nova-copy-block pre{padding:9px 8px}
}
