/* Layout de chat estilo Claude/ChatGPT. Carregado por último; só vale com body.chat-first (montado por chat.js). */
body.chat-first{--c-bg:#0a1020;--c-side:#080d19;--c-raise:#111b31;--c-line:#263754;--c-ink:#edf5ff;--c-muted:#99abc5;--c-accent:#67e8f9;--c-accent-strong:#8b5cf6;--c-glow:#22d3ee;--c-side-w:268px;--c-team-w:320px;background:radial-gradient(circle at 76% -18%,#26376a 0,transparent 34%),radial-gradient(circle at -10% 105%,#172e58 0,transparent 36%),var(--c-bg);overflow:hidden}
body.chat-first .hud-edge,body.chat-first footer,body.chat-first .conversation-pane,body.chat-first .breadcrumb>:not(strong){display:none!important}

/* Barra lateral fixa */
body.chat-first .sidebar{position:fixed;inset:0 auto 0 0;width:var(--c-side-w);transform:none;visibility:visible;background:linear-gradient(180deg,#0b1222,#070b15);backdrop-filter:blur(16px);box-shadow:16px 0 50px #0004;border-right:1px solid #213451;padding:14px 10px 0;display:flex;flex-direction:column;gap:6px;overflow:hidden;z-index:40}
body.chat-first .sidebar .brand{padding:4px 8px 10px;margin:0}
body.chat-first .side-top{display:flex;flex-direction:column;gap:6px}
body.chat-first .side-new{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border-radius:12px;border:1px solid #3f5d88;background:linear-gradient(135deg,#142442,#101a2e);color:var(--c-ink);font-weight:550;font-size:14px;text-align:left}
body.chat-first .side-new:hover{border-color:var(--c-accent);box-shadow:0 0 0 3px #67e8f91c}
body.chat-first .side-new span{color:var(--c-accent);font-size:18px;line-height:1}
body.chat-first .side-top .search-button{width:100%;margin:0;border-radius:12px;font-size:14px}
body.chat-first .side-label{margin:14px 8px 6px;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--c-muted);font-weight:600}
body.chat-first .side-convs{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;margin:0 -4px;padding:0 4px}
body.chat-first .side-convs .conversation-filter{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 8px 6px;font-size:12px;color:var(--c-muted)}
body.chat-first .side-convs .conversation-filter select{background:transparent;border:0;color:var(--c-muted);font-size:12px}
body.chat-first .side-convs .item-list{display:flex;flex-direction:column;gap:1px;padding:0;border:0;background:none}
body.chat-first .side-convs .list-item{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;padding:8px 10px;border:0;border-radius:10px;background:transparent;text-align:left;min-height:0}
body.chat-first .side-convs .list-item strong{font-size:14px;font-weight:450;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
body.chat-first .side-convs .list-item small{font-size:11px}
body.chat-first .side-convs .list-item:hover{background:#13213a}
body.chat-first .side-convs .list-item.selected{background:linear-gradient(90deg,#153153,#11223b);box-shadow:inset 2px 0 var(--c-accent)}
body.chat-first .side-convs .conversation-pages{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:6px 6px 10px;font-size:11px}
body.chat-first .side-convs .conversation-pages .button{padding:4px 8px;font-size:11px;min-height:0}
body.chat-first .side-more{border-top:1px solid #222;padding-top:4px;max-height:45vh;overflow-y:auto}
body.chat-first .side-more summary{cursor:pointer;padding:9px 10px;border-radius:10px;font-size:13px;color:var(--c-muted);list-style:none}
body.chat-first .side-more summary::-webkit-details-marker{display:none}
body.chat-first .side-more summary::after{content:"▸";float:right}
body.chat-first .side-more[open] summary::after{content:"▾"}
body.chat-first .side-more summary:hover{background:#1c1c1c;color:var(--c-ink)}
body.chat-first .side-more nav{padding:0 0 6px}
body.chat-first .side-more .nav-item{padding:7px 10px;font-size:13px;min-height:0}
body.chat-first .side-more .nav-group{margin:8px 10px 4px;font-size:10px}
body.chat-first .sidebar-bottom{margin:0 -10px;padding:8px 10px;border-top:1px solid #213451}
body.chat-first .sidebar-bottom .environment{display:none}

/* Área principal */
body.chat-first .main-shell{margin-left:var(--c-side-w);margin-right:0;width:calc(100% - var(--c-side-w));height:100dvh;padding-top:0;display:flex;flex-direction:column;transition:margin-right .2s}
body.chat-first .topbar{position:static;height:54px;flex:none;padding:0 18px;background:#0b1222b8;border-bottom:1px solid #263754;backdrop-filter:blur(12px)}
body.chat-first .breadcrumb{font-size:0}body.chat-first .breadcrumb strong{font-size:14px;font-weight:550}body.chat-first .mobile-menu{display:none!important}
body.chat-first .topbar-actions{display:flex;align-items:center;gap:10px}
body.chat-first #topbar-state{font-size:12px;color:var(--c-muted)}
body.chat-first main{flex:1;min-height:0;overflow-y:auto;max-width:none;width:100%;margin:0;padding:26px 34px}
body.chat-first.on-chat main{padding:0;overflow:hidden}
body.chat-first #workspace-notice{margin:10px auto;max-width:768px}

/* Conversa */
body.chat-first #view-conversas{height:100%}
body.chat-first #view-conversas .chat-layout{display:block;height:100%;min-height:0;border:0;border-radius:0;background:none}
body.chat-first .chat-main{height:100%;display:flex;flex-direction:column}
body.chat-first .conversation-tools{display:flex;align-items:center;gap:8px;padding:8px max(18px,calc((100% - 800px)/2));margin:0;border:0;background:none;flex:none}
body.chat-first .conversation-tools>label{flex:1;font-size:0;margin:0}
body.chat-first .conversation-tools input{width:100%;font-size:15px;font-weight:550;background:transparent;border:1px solid transparent;border-radius:8px;padding:6px 8px;color:var(--c-ink)}
body.chat-first .conversation-tools input:hover,body.chat-first .conversation-tools input:focus{border-color:var(--c-line)}
body.chat-first .conversation-tools>small{display:none}
body.chat-first .conv-menu{position:relative}
body.chat-first .conv-menu summary{list-style:none;cursor:pointer;width:34px;height:34px;display:grid;place-items:center;border-radius:10px;font-size:20px;color:var(--c-muted)}
body.chat-first .conv-menu summary::-webkit-details-marker{display:none}
body.chat-first .conv-menu summary:hover{background:var(--c-raise);color:var(--c-ink)}
body.chat-first .conv-menu .button-row{position:absolute;right:0;top:40px;z-index:30;display:flex;flex-direction:column;gap:2px;min-width:200px;padding:6px;background:#1f1f1f;border:1px solid var(--c-line);border-radius:12px;box-shadow:0 12px 40px #0008}
body.chat-first .conv-menu .button{justify-content:flex-start;width:100%;border:0;background:transparent;font-size:13px;padding:8px 10px}
body.chat-first .conv-menu .button:hover{background:var(--c-raise)}
body.chat-first .chat-messages{flex:1;min-height:0;overflow-y:auto;padding:24px max(18px,calc((100% - 800px)/2)) 28px;max-height:none;border:0;background:linear-gradient(180deg,#0b142410,#0b142200)}
body.chat-first .chat-turn{margin:0 0 30px;padding:0;border:0;background:none;display:flex;flex-direction:column;gap:16px}
body.chat-first .message.user{align-self:flex-end;margin:0;max-width:80%;padding:10px 16px;background:linear-gradient(135deg,#243f69,#1a2a4a);border:1px solid #3b5d8c;border-radius:20px 20px 6px 20px;box-shadow:0 8px 22px #0003}
body.chat-first .message.user>span{display:none}
body.chat-first .message.user p{margin:0;white-space:pre-wrap;line-height:1.6;font-size:15px}
body.chat-first .message.assistant{padding:0}
body.chat-first .message-label{margin-bottom:8px;font-size:12px}
body.chat-first .message-output{font-size:15px;line-height:1.75}
body.chat-first .message.assistant details{margin-top:8px;font-size:12px;color:var(--c-muted)}
body.chat-first .chat-messages .empty-state{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:10px;border:0;background:none}
body.chat-first .chat-messages .empty-state h2{font-size:clamp(1.5rem,2.4vw,2rem);font-weight:500;letter-spacing:-.03em}

/* Campo de mensagem */
body.chat-first form.composer{flex:none;border:0;margin:0;padding:0 max(14px,calc((100% - 800px)/2)) 10px;background:none;display:flex;flex-direction:column;gap:6px}
body.chat-first form.composer>.composer-box{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;flex-wrap:nowrap;margin:0;gap:6px;padding:12px 12px 8px 18px;background:linear-gradient(135deg,#14213a,#10192b);border:1px solid #304b72;border-radius:26px;box-shadow:0 10px 34px #0005}
body.chat-first .composer-box:focus-within{border-color:var(--c-accent);box-shadow:0 0 0 3px #67e8f91a,0 10px 34px #0005}
body.chat-first #chat-input{text-align:left;width:100%;min-height:26px;max-height:240px;padding:4px 0;margin:0;border:0;outline:none;resize:none;background:transparent;color:var(--c-ink);font-size:15px;line-height:1.55;box-shadow:none}
body.chat-first .composer-tools{display:flex;align-items:center;gap:6px;min-width:0}
body.chat-first .composer-attach{position:relative;width:34px;height:34px;min-height:0;padding:0;display:grid;place-items:center;border-radius:50%;font-size:0;border:1px solid var(--c-line);background:transparent;cursor:pointer}
body.chat-first .composer-attach::before{content:"＋";font-size:18px;color:var(--c-ink)}
body.chat-first .composer-attach:hover{background:#333}
body.chat-first #chat-form .composer-select{display:inline-flex;align-items:center;gap:0;min-width:0;margin:0;font-size:0!important;color:var(--c-muted)}
body.chat-first .composer-select select{font-size:12px;max-width:190px;min-width:0;padding:6px 8px;border-radius:999px;border:1px solid var(--c-line);background:#1a1a1a;color:var(--c-ink)}
body.chat-first .composer-right{margin-left:auto}
body.chat-first #send-message{min-height:0;white-space:nowrap;padding:8px 16px;border-radius:999px;font-size:14px}
body.chat-first #chat-files:empty,body.chat-first .composer-feedback:has(#send-state:empty):has(#cancel-route[hidden]){display:none}
body.chat-first form.composer>.composer-feedback{display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;gap:8px;margin:0;font-size:12px}
body.chat-first .composer-feedback p{font-size:12px;color:var(--c-muted)}
body.chat-first .composer-feedback .button{font-size:11px;padding:4px 8px;min-height:0}
body.chat-first #model-scope,body.chat-first #file-state:not(.changed){display:none}
body.chat-first form.composer>small,body.chat-first #file-state{display:block;text-align:center;font-size:11px;color:var(--c-muted);margin:0}
body.chat-first .attachment-composer:empty{display:none}
body.chat-first .private-files{flex:none;border:0;padding:0;margin:0 auto 10px;width:min(800px,calc(100% - 28px));font-size:12px;color:var(--c-muted)}
body.chat-first .private-files summary{text-align:center;cursor:pointer}

/* Painel secundário: equipe + escritório */
body.chat-first .team-panel{position:fixed;top:0;right:0;bottom:0;width:var(--c-team-w);z-index:45;display:flex;flex-direction:column;gap:14px;padding:14px 14px 18px;background:linear-gradient(180deg,#0b1222,#070b15);border-left:1px solid #213451;overflow-y:auto;transform:translateX(100%);visibility:hidden;transition:transform .2s,visibility .2s}
body.chat-first.team-open .team-panel{transform:none;visibility:visible}
@media(min-width:1280px){body.chat-first.team-open .main-shell{margin-right:var(--c-team-w);width:calc(100% - var(--c-side-w) - var(--c-team-w))}}
body.chat-first .team-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
body.chat-first .team-head .side-label{margin:2px 0 4px}
body.chat-first .team-head h2{font-size:16px}
body.chat-first .team-summary{font-size:13px;color:var(--c-muted)}
body.chat-first .team-panel .activity-rail{position:static;inset:auto;height:auto;width:auto;padding:0;margin:0;background:none;backdrop-filter:none;border:0;display:flex;flex-direction:column-reverse;gap:10px}
body.chat-first .team-panel .activity-head{width:100%;display:flex;flex-direction:column;gap:6px;font-size:12px}
body.chat-first .team-panel .activity-head strong{font-size:12px;font-weight:500;color:var(--c-muted)}
body.chat-first .team-panel .activity-head>*{text-align:left}body.chat-first .team-panel .activity-head details{font-size:12px;color:var(--c-muted)}
body.chat-first .team-panel .activity-agents{display:flex;flex-direction:column;gap:6px;overflow:visible}
body.chat-first .team-panel .activity-chip{display:grid;grid-template-columns:10px 1fr;grid-template-rows:auto auto;column-gap:10px;align-items:center;width:100%;min-width:0;max-width:none;padding:10px 12px;border-radius:12px;text-align:left;background:#111d32;border:1px solid #263d60}
body.chat-first .team-panel .activity-chip i{grid-row:1/3;width:9px;height:9px;border-radius:50%;background:#555}
body.chat-first .team-panel .activity-chip strong{font-size:14px}
body.chat-first .team-panel .activity-chip span{font-size:12px;color:var(--c-muted)}
body.chat-first .team-panel .activity-chip[data-state=running],body.chat-first .team-panel .activity-chip[data-state=queued],body.chat-first .team-panel .activity-chip[data-state=submitting]{border-color:#2d8aa0;background:linear-gradient(135deg,#112d42,#151e42)}
body.chat-first .team-panel .activity-chip[data-state=running] i,body.chat-first .team-panel .activity-chip[data-state=queued] i,body.chat-first .team-panel .activity-chip[data-state=submitting] i{background:var(--c-accent);box-shadow:0 0 0 4px #67e8f922;animation:chat-pulse 1.6s infinite}
body.chat-first .team-panel .activity-chip[data-state=running] span{color:#fff}
body.chat-first .team-panel .activity-chip[data-state=waiting_for_approval]{border-color:#8a8a8a;background:#1a1a1a}
body.chat-first .team-panel .activity-chip[data-state=waiting_for_approval] i{background:transparent;box-shadow:inset 0 0 0 2px #d0d0d0}
body.chat-first .team-panel .activity-chip[data-state=waiting_for_approval] span{color:#d0d0d0}
body.chat-first .team-office{margin-top:auto;padding:14px;border-radius:14px;background:linear-gradient(135deg,#151e42,#10283d);border:1px solid #314b75;font-size:13px;color:var(--c-muted)}
body.chat-first .team-office .side-label{margin:0 0 6px}
body.chat-first .team-office-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
body.chat-first .team-office-actions .button{font-size:12px;padding:7px 10px;min-height:0}
body.chat-first .team-toggle{display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border-radius:999px;border:1px solid #314b75;background:#111d32;color:var(--c-ink);font-size:13px}
body.chat-first .team-toggle[aria-expanded=true]{border-color:#555}
body.chat-first .team-dot{width:8px;height:8px;border-radius:50%;background:#555}
body.chat-first .team-toggle[data-state=working] .team-dot{background:var(--c-accent);animation:chat-pulse 1.6s infinite}
body.chat-first .team-toggle[data-state=waiting] .team-dot{background:transparent;box-shadow:inset 0 0 0 2px #d0d0d0}
@keyframes chat-pulse{50%{opacity:.35}}

/* Escritório em janela por cima, só quando pedido */
.office-overlay{position:fixed;inset:0;z-index:200;background:#000b;display:flex;align-items:center;justify-content:center;padding:3vh 3vw}
.office-overlay[hidden]{display:none}
.office-window{width:100%;height:100%;display:flex;flex-direction:column;background:#0f0f0f;border:1px solid #333;border-radius:16px;overflow:hidden}
.office-window-head{display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid #333}
.office-window-head strong{flex:1}
.office-window-body{flex:1;min-height:0}
.office-frame{width:100%;height:100%;border:0;display:block}

/* Outras telas (Tarefas, Cérebro…) continuam com o visual delas, só com respiro */
body.chat-first:not(.on-chat) main .view{max-width:1300px;margin:0 auto}

@media(max-width:900px){
  body.chat-first .main-shell{margin-left:0;width:100%}
  body.chat-first .sidebar{transform:translateX(-100%);visibility:hidden;transition:transform .2s,visibility .2s;box-shadow:20px 0 80px #0009;width:min(300px,86vw)}
  body.chat-first .sidebar.open{transform:none;visibility:visible}
  body.chat-first .mobile-menu{display:inline-flex!important}
  body.chat-first .topbar{padding:0 10px;gap:8px;padding-top:env(safe-area-inset-top);height:calc(54px + env(safe-area-inset-top))}
  body.chat-first .breadcrumb{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
  body.chat-first #topbar-state,body.chat-first #refresh{display:none}
  body.chat-first main{padding:18px 16px}
  body.chat-first .team-panel{width:min(360px,100vw);box-shadow:-20px 0 80px #0009}
  body.chat-first .message.user{max-width:88%}
  body.chat-first .composer-select select{max-width:130px}
  body.chat-first form.composer>.composer-box{padding:10px 10px 8px 14px}
  body.chat-first form.composer{padding-bottom:max(10px,env(safe-area-inset-bottom))}
  .office-overlay{padding:0}
  .office-window{border-radius:0}
}
@media(prefers-reduced-motion:reduce){body.chat-first .team-panel,body.chat-first .sidebar,body.chat-first .main-shell{transition:none}body.chat-first .team-dot,body.chat-first .activity-chip i{animation:none!important}}

/* Dentro das janelas do escritório (embed=1) a lista de conversas continua; a equipe já aparece no próprio escritório */
.embed body.chat-first .team-panel,.embed body.chat-first .team-toggle{display:none!important}
@media(min-width:901px){.embed body.chat-first .sidebar{display:flex!important}.embed body.chat-first .main-shell{margin-left:var(--c-side-w)!important;width:calc(100% - var(--c-side-w))!important}}
@media(max-width:900px){.embed body.chat-first .sidebar{display:flex!important}.embed body.chat-first #menu-toggle{display:inline-flex!important}}

/* Paleta ADAM: diferencia contexto, atividade e ações sem alterar os dados mostrados. */
body.chat-first #send-message:not(:disabled),body.chat-first .button.primary{background:linear-gradient(135deg,var(--c-accent),#a78bfa);color:#07101f;border-color:transparent;font-weight:650}
body.chat-first .brand-mark{background:linear-gradient(135deg,#22d3ee,#8b5cf6);color:#07101f;border-color:#8deaf5;box-shadow:0 0 24px #22d3ee42}
body.chat-first .message-label strong{color:var(--c-accent)}
body.chat-first .core-card,body.chat-first .quick-card{border-color:#304b72;background:linear-gradient(145deg,#14243d,#0e192d);box-shadow:0 14px 36px #0003}
body.chat-first .quick-card:hover{border-color:var(--c-accent);transform:translateY(-2px);box-shadow:0 18px 44px #0006}
body.chat-first .core-sphere{background:radial-gradient(circle at 32% 24%,#e0fbff,#22d3ee 36%,#6d4bcc 72%);color:#07101f;box-shadow:0 0 44px #22d3ee66}
body.chat-first .orbit{border-color:#4776a5!important}body.chat-first .orbit-point{background:var(--c-accent)!important;box-shadow:0 0 12px var(--c-accent)}
@media(max-width:600px){body.chat-first .conversation-tools{padding-inline:12px}body.chat-first .chat-messages{padding-inline:14px}body.chat-first form.composer{padding-inline:10px}.office-window-head{padding-inline:10px}body.chat-first .composer-tools{gap:4px}body.chat-first .composer-select select{max-width:105px}body.chat-first #send-message{padding:8px 12px}}

/* Visual HUD (29/10/2026), por cima da paleta ADAM: fundo com grade, painéis de vidro, núcleo animado,
   barra inferior no celular e botões de voz. Inspirado no J.A.R.V.I.S./OpenJarvis. */
body.chat-first{--c-bg:#060b14;--c-side:rgba(7,13,23,.86);--c-raise:rgba(16,30,48,.72);--c-line:rgba(110,190,255,.16);--c-ink:#e7f2ff;--c-muted:#8ea4bd;--c-accent:#3fd2ff;--c-accent-2:#8b7bff;--c-ok:#39e3a7;--c-warn:#ffc65c;--c-bad:#ff6b81;--c-glow:0 0 0 1px rgba(63,210,255,.35),0 0 24px rgba(63,210,255,.18);--c-dock-h:0px;--mint:#3fd2ff;--panel:rgba(13,25,41,.62);--line:rgba(110,190,255,.16);--muted:#8ea4bd;--ink:#e7f2ff;background:transparent}
body.chat-first .selected{border-color:rgba(63,210,255,.55)!important;background:rgba(63,210,255,.1)!important}
body.chat-first .side-convs .list-item.selected{border-color:transparent!important;background:linear-gradient(90deg,rgba(63,210,255,.16),rgba(63,210,255,.03))!important}
html:has(body.chat-first){background:#060b14}
body.chat-first::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background:radial-gradient(1200px 700px at 72% -10%,rgba(63,210,255,.13),transparent 60%),radial-gradient(900px 600px at -10% 110%,rgba(139,123,255,.12),transparent 60%),linear-gradient(rgba(110,190,255,.045) 1px,transparent 1px) 0 0/44px 44px,linear-gradient(90deg,rgba(110,190,255,.045) 1px,transparent 1px) 0 0/44px 44px,#060b14}
body.chat-first ::selection{background:rgba(63,210,255,.35)}
body.chat-first :focus-visible{outline:2px solid var(--c-accent);outline-offset:2px}
body.chat-first .sidebar{background:var(--c-side);border-right:1px solid var(--c-line);backdrop-filter:blur(14px)}
body.chat-first .sidebar-bottom,body.chat-first .side-more{border-color:var(--c-line)}
body.chat-first .topbar{border-bottom:1px solid var(--c-line);background:rgba(6,11,20,.55);backdrop-filter:blur(12px)}
body.chat-first .team-panel{background:var(--c-side);border-left:1px solid var(--c-line);backdrop-filter:blur(14px)}

/* Marca: reator do ADAM */
body.chat-first .brand-mark{position:relative;display:grid;place-items:center;color:#dff7ff;background:radial-gradient(circle,#123049 0,#08131f 70%);border:1px solid rgba(63,210,255,.55);box-shadow:0 0 18px rgba(63,210,255,.35),inset 0 0 12px rgba(63,210,255,.35);border-radius:50%}
body.chat-first .brand small{color:var(--c-accent);letter-spacing:.32em}

/* Navegação e listas */
body.chat-first .side-new{background:linear-gradient(135deg,rgba(63,210,255,.18),rgba(139,123,255,.16));border-color:rgba(63,210,255,.4)}
body.chat-first .side-new:hover{box-shadow:var(--c-glow)}
body.chat-first .side-convs .list-item:hover,body.chat-first .side-more summary:hover{background:rgba(63,210,255,.07)}
body.chat-first .side-convs .list-item.selected{background:linear-gradient(90deg,rgba(63,210,255,.16),rgba(63,210,255,.03));box-shadow:inset 2px 0 0 var(--c-accent)}
body.chat-first .nav-item.active{background:rgba(63,210,255,.1);box-shadow:inset 2px 0 0 var(--c-accent);color:var(--c-ink)}
body.chat-first .side-label,body.chat-first .eyebrow{color:var(--c-accent);opacity:.85}

/* Conversa */
body.chat-first .message.user{background:linear-gradient(135deg,rgba(63,210,255,.2),rgba(139,123,255,.2));border:1px solid rgba(63,210,255,.28)}
body.chat-first .message.assistant{position:relative;padding:14px 16px 12px 18px;border-radius:16px;background:rgba(13,25,41,.62);border:1px solid var(--c-line);box-shadow:0 10px 30px rgba(0,0,0,.25)}
body.chat-first .message.assistant::before{content:"";position:absolute;left:0;top:14px;bottom:14px;width:2px;border-radius:2px;background:linear-gradient(var(--c-accent),var(--c-accent-2))}
body.chat-first .message-label strong{color:var(--c-accent);letter-spacing:.06em}
body.chat-first .badge.good{color:#9ff5d3;background:rgba(57,227,167,.12);border-color:rgba(57,227,167,.35)}
body.chat-first .badge.bad{color:#ffc2cc;background:rgba(255,107,129,.12);border-color:rgba(255,107,129,.38)}
body.chat-first .badge.warning{color:#ffe0a3;background:rgba(255,198,92,.12);border-color:rgba(255,198,92,.38)}
body.chat-first .badge.neutral{color:#b9cbe0;background:rgba(110,190,255,.06);border-color:var(--c-line)}
body.chat-first .chat-messages .empty-state>span{position:relative;width:96px;height:96px;margin-bottom:26px;border-radius:50%;font-size:30px;color:#e9fbff;background:radial-gradient(circle,#1c4f6e 0,#0b1c2c 55%,#060b14 72%);border:1px solid rgba(63,210,255,.6);box-shadow:0 0 40px rgba(63,210,255,.35),inset 0 0 24px rgba(63,210,255,.45)}
body.chat-first .chat-messages .empty-state>span::before,body.chat-first .chat-messages .empty-state>span::after{content:"";position:absolute;inset:-14px;border-radius:50%;border:1px dashed rgba(63,210,255,.45);animation:hud-spin 18s linear infinite}
body.chat-first .chat-messages .empty-state>span::after{inset:-28px;border:1px solid transparent;border-top-color:rgba(139,123,255,.7);border-bottom-color:rgba(63,210,255,.5);animation-duration:7s;animation-direction:reverse}
body.chat-first .chat-messages .empty-state h2{background:linear-gradient(90deg,#e7f2ff,#9fe6ff);-webkit-background-clip:text;background-clip:text;color:transparent}
@keyframes hud-spin{to{transform:rotate(360deg)}}

/* Campo de mensagem */
body.chat-first form.composer>.composer-box{background:rgba(12,24,40,.78);border:1px solid rgba(63,210,255,.25);backdrop-filter:blur(12px);box-shadow:0 10px 40px rgba(0,0,0,.4)}
body.chat-first .composer-box:focus-within{border-color:rgba(63,210,255,.6);box-shadow:var(--c-glow),0 10px 40px rgba(0,0,0,.4)}
body.chat-first .composer-select select{background:rgba(6,11,20,.7);border-color:var(--c-line)}
body.chat-first .composer-attach:hover{background:rgba(63,210,255,.12)}
body.chat-first #send-message:not(:disabled),body.chat-first .button.primary{background:linear-gradient(135deg,#3fd2ff,#8b7bff);color:#041019;border-color:transparent;font-weight:650}
body.chat-first #send-message:not(:disabled):hover,body.chat-first .button.primary:hover{box-shadow:var(--c-glow)}

/* Voz: falar o pedido e ouvir as respostas (reconhecimento e síntese do próprio navegador) */
body.chat-first .voice-mic{width:34px;height:34px;flex:none;display:grid;place-items:center;padding:0;border-radius:50%;border:1px solid var(--c-line);background:transparent;color:var(--c-ink);cursor:pointer}
body.chat-first .voice-mic svg,body.chat-first .voice-read svg,body.chat-first .voice-auto svg{width:16px;height:16px}
body.chat-first .voice-mic:hover{background:rgba(63,210,255,.12)}
body.chat-first .voice-mic[aria-pressed=true]{color:#fff;background:rgba(255,107,129,.25);border-color:var(--c-bad);animation:hud-listen 1.2s ease-in-out infinite}
@keyframes hud-listen{50%{box-shadow:0 0 0 7px rgba(255,107,129,.18)}}
body.chat-first .voice-read{display:inline-flex;align-items:center;gap:6px;margin-top:8px;padding:4px 10px;border-radius:999px;border:1px solid var(--c-line);background:transparent;color:var(--c-muted);font-size:12px;cursor:pointer}
body.chat-first .voice-read:hover,body.chat-first .voice-read[aria-pressed=true]{color:var(--c-ink);border-color:rgba(63,210,255,.5);background:rgba(63,210,255,.08)}
body.chat-first .voice-auto{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;border:1px solid var(--c-line);background:var(--c-raise);color:var(--c-muted);font-size:12px;cursor:pointer}
body.chat-first .voice-auto[aria-pressed=true]{color:var(--c-ink);border-color:rgba(63,210,255,.55);box-shadow:var(--c-glow)}
body.chat-first .voice-state{margin:0;text-align:center;font-size:12px;color:var(--c-accent)}
body.chat-first .voice-state:empty{display:none}

/* Equipe */
body.chat-first .team-panel .activity-chip{background:rgba(13,25,41,.62);border-color:var(--c-line)}
body.chat-first .team-panel .activity-chip[data-state=running],body.chat-first .team-panel .activity-chip[data-state=queued],body.chat-first .team-panel .activity-chip[data-state=submitting]{border-color:rgba(63,210,255,.5);background:rgba(63,210,255,.08)}
body.chat-first .team-panel .activity-chip[data-state=running] i,body.chat-first .team-panel .activity-chip[data-state=queued] i,body.chat-first .team-panel .activity-chip[data-state=submitting] i{box-shadow:0 0 0 4px rgba(63,210,255,.2)}
body.chat-first .team-panel .activity-chip[data-state=waiting_for_approval]{border-color:rgba(255,198,92,.5);background:rgba(255,198,92,.07)}
body.chat-first .team-panel .activity-chip[data-state=waiting_for_approval] i{box-shadow:inset 0 0 0 2px var(--c-warn)}
body.chat-first .team-panel .activity-chip[data-state=waiting_for_approval] span{color:#ffe0a3}
body.chat-first .team-office{background:rgba(13,25,41,.62);border-color:var(--c-line)}
body.chat-first .team-toggle{background:var(--c-raise);border-color:var(--c-line)}
body.chat-first .team-toggle[data-state=waiting] .team-dot{box-shadow:inset 0 0 0 2px var(--c-warn)}

/* Central de comando e outras telas: cartões de vidro e núcleo em órbita */
body.chat-first:not(.on-chat) .core-card,body.chat-first:not(.on-chat) .quick-card,body.chat-first:not(.on-chat) .agent-card,body.chat-first:not(.on-chat) .status-strip,body.chat-first:not(.on-chat) .alert{background:rgba(13,25,41,.62);border-color:var(--c-line);backdrop-filter:blur(10px)}
body.chat-first:not(.on-chat) .quick-card:hover,body.chat-first:not(.on-chat) .agent-card:hover{border-color:rgba(63,210,255,.5);box-shadow:var(--c-glow)}
body.chat-first .core-card{background:radial-gradient(ellipse at 50% 38%,rgba(63,210,255,.16) 0,transparent 60%),rgba(9,18,31,.75)}
body.chat-first .core-sphere{background:radial-gradient(circle at 50% 50%,#bff3ff 0,#3fd2ff 18%,#0f4766 46%,#071523 74%);border-color:rgba(63,210,255,.75);box-shadow:0 0 50px rgba(63,210,255,.45),inset 0 0 22px rgba(255,255,255,.25);color:#041019;font-weight:600}
body.chat-first .core-orbit .orbit{border-color:rgba(63,210,255,.35)!important;animation:hud-spin 22s linear infinite}
body.chat-first .core-orbit .orbit.inner{border-style:dashed!important;animation-duration:12s;animation-direction:reverse}
body.chat-first .core-orbit .orbit-point{background:var(--c-accent);box-shadow:0 0 10px var(--c-accent)}
body.chat-first .page-heading h1 .title-dot{color:var(--c-accent)}
body.chat-first .square-icon{border-color:rgba(63,210,255,.35);background:rgba(63,210,255,.08)}

/* Modo Jarvis: conversa por voz em tela cheia, com o reator reagindo à voz (--lvl de 0 a 1) */
body.chat-first .jarvis-open{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;border:1px solid rgba(63,210,255,.45);background:linear-gradient(135deg,rgba(63,210,255,.18),rgba(139,123,255,.18));color:var(--c-ink);font-size:12px;font-weight:650;cursor:pointer}
body.chat-first .jarvis-open svg{width:16px;height:16px;color:var(--c-accent)}
body.chat-first .jarvis-open:hover{box-shadow:var(--c-glow)}
body.chat-first .jarvis-open.on{border-color:rgba(57,227,167,.55);background:rgba(57,227,167,.1)}
body.chat-first .jarvis-open.on svg{display:none}
body.chat-first .jarvis-open.on::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--c-ok);animation:hud-ping 1.8s ease-out infinite}
@keyframes hud-ping{to{box-shadow:0 0 0 7px rgba(57,227,167,0)}}
body.chat-first .chat-messages .empty-state>span{cursor:pointer}
body.chat-first.jarvis-on{overflow:hidden}
body.chat-first .jarvis[hidden]{display:none}
body.chat-first .jarvis{--lvl:0;--j:var(--c-accent);position:fixed;inset:0;z-index:200;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:72px 20px 64px;background:radial-gradient(760px 560px at 50% 40%,rgba(63,210,255,.14),transparent 65%),linear-gradient(rgba(110,190,255,.04) 1px,transparent 1px) 0 0/44px 44px,linear-gradient(90deg,rgba(110,190,255,.04) 1px,transparent 1px) 0 0/44px 44px,rgba(4,8,15,.985);color:var(--c-ink);text-align:center}
body.chat-first .jarvis[data-state=standby]{--j:#6d9fc4}
body.chat-first .jarvis[data-state=sending],body.chat-first .jarvis[data-state=thinking]{--j:var(--c-accent-2)}
body.chat-first .jarvis[data-state=speaking]{--j:var(--c-ok)}
body.chat-first .jarvis.jarvis-problem[data-state=speaking]{--j:var(--c-warn)}
body.chat-first .jarvis-top{position:absolute;top:calc(14px + env(safe-area-inset-top));left:20px;right:20px;display:flex;justify-content:space-between;align-items:center;font-size:11px;letter-spacing:.28em;text-transform:uppercase;color:var(--c-accent)}
body.chat-first .jarvis-x{width:40px;height:40px;border-radius:50%;border:1px solid var(--c-line);background:var(--c-raise);color:var(--c-ink);font-size:15px;cursor:pointer}
body.chat-first .jarvis-core{position:relative;flex:none;width:min(52vw,34vh,240px);aspect-ratio:1;margin:0 0 18px;padding:0;border:0;border-radius:50%;background:transparent;cursor:pointer}
body.chat-first .jarvis-core b{position:absolute;inset:22%;border-radius:50%;background:radial-gradient(circle,#f2fdff 0,var(--j) 24%,rgba(8,30,48,.92) 62%,#060b14 76%);box-shadow:0 0 calc(28px + 70px*var(--lvl)) var(--j),inset 0 0 28px rgba(255,255,255,.2);transform:scale(calc(.9 + .32*var(--lvl)));transition:transform .08s linear,box-shadow .3s,background .4s}
body.chat-first .jarvis-core i{position:absolute;inset:8%;border-radius:50%;border:1px dashed var(--j);opacity:.65;animation:hud-spin 16s linear infinite}
body.chat-first .jarvis-core i:nth-child(2){inset:0;border:2px solid transparent;border-top-color:var(--j);border-bottom-color:rgba(139,123,255,.8);opacity:.9;animation-duration:6s;animation-direction:reverse}
body.chat-first .jarvis-core i:nth-child(3){inset:-10%;border:1px solid var(--j);opacity:calc(.1 + .6*var(--lvl));transform:scale(calc(1 + .14*var(--lvl)));animation:none}
body.chat-first .jarvis[data-state=sending] .jarvis-core i,body.chat-first .jarvis[data-state=thinking] .jarvis-core i{animation-duration:1.8s}
body.chat-first .jarvis[data-state=standby] .jarvis-core b{opacity:.7}
body.chat-first .jarvis-state{margin:0;font-size:clamp(18px,4.4vw,24px);font-weight:650}
body.chat-first .jarvis-heard{margin:0;max-width:640px;min-height:1.5em;color:var(--c-accent);font-size:16px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
body.chat-first .jarvis-answer{max-width:680px;max-height:26vh;overflow:auto;padding:12px 16px;border-radius:14px;border:1px solid var(--c-line);background:rgba(13,25,41,.62);color:#c9d9ec;font-size:15px;line-height:1.55;white-space:pre-wrap;text-align:left}
body.chat-first .jarvis-answer:empty{display:none}
body.chat-first .jarvis-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
body.chat-first .jarvis-actions button{padding:8px 16px;border-radius:999px;border:1px solid var(--c-line);background:var(--c-raise);color:var(--c-ink);font:inherit;font-size:13px;cursor:pointer}
body.chat-first .jarvis-actions button:hover{border-color:rgba(63,210,255,.5)}
body.chat-first .jarvis:not([data-state=speaking]) [data-j=stop]{display:none}
body.chat-first .jarvis-hint{position:absolute;left:20px;right:20px;bottom:calc(16px + env(safe-area-inset-bottom));margin:0;font-size:12px;color:var(--c-muted)}

/* Celular: barra inferior com as telas principais */
body.chat-first .hud-dock{display:none}
@media(max-width:900px){
  body.chat-first{--c-dock-h:62px}
  body.chat-first .hud-dock{position:fixed;left:0;right:0;bottom:0;z-index:60;display:grid;grid-template-columns:repeat(5,1fr);height:calc(var(--c-dock-h) + env(safe-area-inset-bottom));padding:6px 6px env(safe-area-inset-bottom);background:rgba(6,11,20,.92);border-top:1px solid var(--c-line);backdrop-filter:blur(14px)}
  body.chat-first .hud-dock a,body.chat-first .hud-dock button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:0;border-radius:12px;background:transparent;color:var(--c-muted);font:inherit;font-size:11px;text-decoration:none;cursor:pointer;min-width:0}
  body.chat-first .hud-dock svg{width:21px;height:21px}
  body.chat-first .hud-dock [aria-current=page]{color:var(--c-accent);background:rgba(63,210,255,.08)}
  body.chat-first .hud-dock:has([data-dock-jarvis]){grid-template-columns:repeat(6,1fr)}
  body.chat-first .hud-dock [data-dock-jarvis]{color:var(--c-ink)}
  body.chat-first .hud-dock [data-dock-jarvis] svg{box-sizing:content-box;width:18px;height:18px;padding:6px;border-radius:50%;color:#041019;background:linear-gradient(135deg,#3fd2ff,#8b7bff);box-shadow:0 0 14px rgba(63,210,255,.45)}
  body.chat-first:has(.hud-dock) .topbar-actions .jarvis-open{display:none}
  body.chat-first.jarvis-on .hud-dock{display:none}
  body.chat-first .main-shell{height:calc(100dvh - var(--c-dock-h) - env(safe-area-inset-bottom))}
  body.chat-first form.composer{padding-bottom:8px}
  body.chat-first form.composer>small{display:none}
  body.chat-first.hud-typing .hud-dock{display:none}
  body.chat-first .sidebar{bottom:calc(var(--c-dock-h) + env(safe-area-inset-bottom))}
  body.chat-first.hud-typing .main-shell{height:100dvh}
  body.chat-first .composer-select select{max-width:112px}
  body.chat-first #send-message{font-size:0;width:38px;height:38px;padding:0;display:grid;place-items:center}
  body.chat-first #send-message::after{content:"↑";font-size:18px;font-weight:700}
  body.chat-first .message.assistant{padding:12px 12px 10px 14px}
  body.chat-first .chat-messages{padding-left:12px;padding-right:12px}
}
@media(max-width:420px){body.chat-first .voice-auto span{display:none}body.chat-first .team-toggle{padding:6px 10px}}
@media(prefers-reduced-motion:reduce){body.chat-first .chat-messages .empty-state>span::before,body.chat-first .chat-messages .empty-state>span::after,body.chat-first .core-orbit .orbit,body.chat-first .voice-mic,body.chat-first .jarvis-core i,body.chat-first .jarvis-open.on::before{animation:none!important}body.chat-first .jarvis-core b,body.chat-first .jarvis-core i:nth-child(3){transform:none!important}}
