/* Machine Studio: galeria de workflows e tela em nós (entrada → processamento → resultado).
   Tudo escopado em .ms-pagina (criado por machine-studio-view.mjs). Autossuficiente: não depende de .cartao.
   Usa os tokens de tema do app (claro e escuro). Arquivo externo porque a política do site não aceita <style> inline. */

.ms-pagina { max-width: 1120px; margin: 0 auto; padding: 22px 20px 60px; display: grid; gap: 18px; align-content: start; }
.ms-pagina * { box-sizing: border-box; }

/* cabeçalho */
.ms-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ms-cab h1 { margin: 2px 0 4px; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.6px; line-height: 1.1; }
.ms-sub { margin: 0; color: var(--texto-2); font-size: 14px; max-width: 60ch; }
.ms-aviso { margin: 0; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--linha-forte); background: var(--superficie-2); color: var(--texto-2); font-size: 14px; line-height: 1.5; }
.ms-aviso.ruim { border-color: color-mix(in srgb, var(--erro) 55%, transparent); color: var(--texto); }

/* ícones, linhas e estados */
.ms-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ms-ico { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; background: var(--marca-suave); color: var(--marca-clara); }
.ms-ico svg { width: 20px; height: 20px; }
.ms-ico-sm { width: 34px; height: 34px; border-radius: 10px; }
.ms-status { display: flex; align-items: center; gap: 8px; min-height: 18px; color: var(--texto-3); font-size: 12.5px; }
.ms-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--marca); animation: msPulso 1s infinite; }
@keyframes msPulso { 0%, 100% { opacity: .35 } 50% { opacity: 1 } }
.ms-ok { color: var(--ok); font-weight: 700 }
.ms-no-erro { color: var(--erro); }

/* galeria */
.ms-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); align-items: start; }
.ms-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; border: 1px solid var(--linha); background: var(--vidro, var(--superficie)); box-shadow: var(--sombra, none); }
.ms-card-capa { position: relative; display: block; width: 100%; padding: 18px; border: 0; border-bottom: 1px solid var(--linha); background: var(--superficie-2); cursor: pointer; transition: background .15s; }
.ms-card-capa:hover { background: color-mix(in srgb, var(--marca) 10%, var(--superficie-2)); }
.ms-mini-grafo { display: block; width: 100%; height: auto; }
.ms-mini-grafo rect { fill: var(--superficie); stroke: var(--linha-forte); stroke-width: 3; }
.ms-mini-grafo path { fill: none; stroke: var(--marca); stroke-width: 5; opacity: .7; }
.ms-nos { position: absolute; left: 14px; top: 12px; padding: 3px 10px; border-radius: 99px; background: #000a; color: #fff; font-size: 11px; font-weight: 700; }
.ms-card-rodando { position: absolute; right: 14px; top: 12px; display: flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: #000a; color: #fff; font-size: 11px; font-weight: 700; }
.ms-card-info { display: grid; gap: 10px; padding: 18px 20px 20px; }
.ms-card h3 { margin: 0; font-size: 17px; letter-spacing: -.3px; }
.ms-desc { margin: 0; color: var(--texto-2); font-size: 13.5px; line-height: 1.45; }

/* Canvas imersivo: geometria e superfícies da referência Motion Clone. */
.ms-imersivo { position:fixed; inset:0; z-index:900; overflow:hidden; cursor:default; touch-action:none; user-select:none; color:#e6e6e6; color-scheme:dark; font-family:Arial,Helvetica,sans-serif; background:#000 radial-gradient(circle,#ffffff13 .7px,transparent .9px) 0 0/12px 12px; }
.ms-imersivo *, .ms-imersivo *::before, .ms-imersivo *::after { box-sizing:border-box; }
.ms-imersivo button,.ms-imersivo a,.ms-imersivo input,.ms-imersivo select { font-family:inherit; }
.ms-imersivo button:focus-visible,.ms-imersivo a:focus-visible,.ms-imersivo label:focus-within { outline:2px solid #db20bd; outline-offset:4px; }
.ms-imersivo.arrastando,.ms-modo-mover { cursor:grab; }
.ms-imersivo.arrastando { cursor:grabbing; }
.ms-mundo { position:absolute; left:0; top:0; transform-origin:0 0; will-change:transform; }
.ms-palco { position:relative; }
.ms-grupo { position:absolute; inset:0; border:1px solid #9c168b; border-radius:20px; background:#300023a6; }
.ms-grupo.oliva { border-color:#626c20; background:#26300090; }
.ms-grupo.petroleo { border-color:#1e7880; background:#002a3090; }
.ms-grupo-rotulo { position:absolute; left:0; top:-48px; white-space:nowrap; border-radius:30px; padding:10px 22px; color:#e6d4e1; background:#470039; font-size:16px; font-weight:700; line-height:1.2; }
.ms-grupo.oliva .ms-grupo-rotulo { background:#3a4315; }
.ms-grupo.petroleo .ms-grupo-rotulo { background:#0a4249; }
.ms-linhas { position:absolute; inset:0; pointer-events:none; overflow:visible; }
.ms-linhas path { fill:none; stroke:#71a5a0; stroke-width:2; opacity:.85; }
.ms-linhas path:nth-child(2) { stroke:#ba8fae; }
.ms-linhas path.ativa { stroke:#f0bb66; stroke-dasharray:12 10; animation:msFluxo 1s linear infinite; }
@keyframes msFluxo { to { stroke-dashoffset:-22; } }
.ms-no { position:absolute; display:flex; flex-direction:column; overflow:hidden; border-radius:14px; background:#121212; border:1px solid #ffffff21; cursor:default; }
.ms-no-palco { position:relative; flex:1; min-height:0; background:#121212; }
.ms-no-midia { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; background:#121212; }
.ms-no video { touch-action:auto; }
.ms-no-legenda { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 12px; background:#121212; color:#ddd; font-size:13px; font-weight:600; }
.ms-no-legenda>span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ms-no-legenda small { display:block; margin-top:3px; color:#a5a5a5; font:600 11px ui-monospace,monospace; }
.ms-trocar { display:grid; place-items:center; position:relative; flex:0 0 auto; width:32px; height:32px; border:0; border-radius:8px; color:#c4c4c4; background:transparent; text-decoration:none; cursor:pointer; }
.ms-trocar svg { width:18px; height:18px; }
.ms-trocar:hover { background:#ffffff15; color:white; }
.ms-trocar input,.ms-vazio input,.ms-opcoes-upload input { position:absolute; width:1px; height:1px; opacity:0; overflow:hidden; }
.ms-no-in[data-ms-drop$=":video"] { padding:12px 10px 10px; }
.ms-no-in[data-ms-drop$=":video"]::before { content:'Vídeo'; color:#ddd; font-size:14px; padding:0 4px 18px; }
.ms-no-in[data-ms-drop$=":video"] .ms-no-palco { border-radius:14px; overflow:hidden; }
.ms-no-in[data-ms-drop$=":video"] .ms-no-legenda { position:absolute; right:16px; top:5px; padding:0; }
.ms-no-in[data-ms-drop$=":video"] .ms-no-legenda>span { display:none; }
.ms-no-in[data-ms-drop$=":video"] .ms-trocar { width:30px; height:30px; }
.ms-no-out { border-radius:24px; border-color:#ffffff12; }
.ms-result-actions { position:absolute; top:10px; right:10px; left:10px; display:flex; justify-content:space-between; align-items:center; opacity:0; transition:opacity .15s; pointer-events:none; }
.ms-result-actions span { padding:6px 10px; border-radius:10px; background:#000a; font-size:14px; }
.ms-result-actions a { pointer-events:auto; background:#0009; }
.ms-no-out:hover .ms-result-actions,.ms-no-out:focus-within .ms-result-actions { opacity:1; }
.ms-vazio { position:absolute; inset:16px; display:grid; place-content:center; justify-items:center; gap:14px; padding:20px; border:2px dashed #ffffff26; border-radius:14px; color:#aaa; text-align:center; cursor:pointer; }
.ms-vazio b { color:#ddd; font-size:22px; }
.ms-vazio small { font-size:18px; }
.ms-vazio .ms-ico { width:64px; height:64px; color:#c6b4c2; background:#ffffff09; }
.ms-vazio:hover { border-color:#b62a9e; }
.ms-vazio-saida { cursor:default; border-style:solid; border-color:#ffffff0a; }
.ms-vazio-saida.gerando { animation:msBrilho 1.4s infinite; }
@keyframes msBrilho { 50% { background:#ffffff0a; } }
.ms-pilula,.ms-dock,.ms-minimapa,.ms-zoom,.ms-grupo-tools { z-index:5; cursor:default; border:1px solid #ffffff1f; background:linear-gradient(180deg,#181818f5,#090909f5); box-shadow:inset 0 1px 0 #ffffff0c,0 8px 24px #0004; color:#ddd; }
.ms-pilula { position:absolute; top:22px; min-height:70px; display:flex; align-items:center; gap:12px; padding:8px 10px; border-radius:42px; font-size:16px; }
.ms-p-esq { left:100px; padding-right:26px; gap:4px; }
.ms-p-esq b { margin-left:17px; font-size:16px; font-weight:700; letter-spacing:-.5px; white-space:nowrap; }
.ms-p-esq i { width:1px; height:28px; margin-left:6px; background:#ffffff12; }
.ms-p-dir { right:32px; gap:14px; }
.ms-p-status { display:flex; align-items:center; gap:8px; color:#aaa; font-size:14px; max-width:230px; }
.ms-orbe { display:grid; place-items:center; width:50px; height:50px; padding:0; border:0; border-radius:16px; background:linear-gradient(145deg,#303030,#1a1a1a); cursor:pointer; }
.ms-orbe span { width:29px; height:29px; border-radius:50%; background:radial-gradient(circle at 36% 25%,#e5e5e5,#9d9fa4 24%,#585b64 55%,#b9bac0 88%,#383b42); box-shadow:inset 0 1px 4px #fff8,0 1px 3px #000; }
.ms-chevron { font-size:18px; color:#999; }
.ms-p-btn { position:relative; display:grid; place-items:center; flex:0 0 auto; width:40px; min-width:0; height:40px; padding:0; border:0; border-radius:12px; color:inherit; background:transparent; font-size:20px; line-height:1; cursor:pointer; }
.ms-p-btn svg { width:21px; height:21px; }
.ms-p-btn:hover,.ms-p-btn[aria-pressed="true"] { background:#ffffff10; color:#f4f4f4; }
.ms-p-btn:disabled { opacity:.3; cursor:not-allowed; }
.ms-avatar,.ms-rail-avatar { display:grid; place-items:center; flex:0 0 auto; width:40px; height:40px; border-radius:50%; color:white; background:radial-gradient(circle at 32% 24%,#d7d7df,#87858d 55%,#424149); font-size:16px; box-shadow:inset 0 1px 3px #fff3; }
.ms-link { display:flex; align-items:center; justify-content:center; gap:9px; min-height:48px; padding:0 17px; border:0; border-radius:30px; background:#242424; color:#eee; font-size:16px; font-weight:600; cursor:pointer; }
.ms-link:hover { background:#303030; }
.ms-link svg { width:18px; height:18px; }
.ms-rail { position:absolute; inset:0 auto 0 0; z-index:6; display:flex; flex-direction:column; align-items:center; gap:13px; width:70px; border-right:1px solid #ffffff12; background:#020202; padding:0 12px 20px; }
.ms-rail .ms-p-btn { color:#888; }
.ms-rail-logo { width:69px; min-height:80px; display:grid; place-items:center; border:0; border-bottom:1px solid #ffffff12; background:none; margin-bottom:6px; cursor:pointer; }
.ms-rail-logo img { width:32px; height:32px; }
.ms-rail i { width:28px; height:1px; background:#ffffff15; margin:4px 0; }
.ms-rail-avatar { margin-top:auto; width:34px; height:34px; background:radial-gradient(circle at 30% 20%,#b52ee1,#650797 62%,#190222); }
.ms-dock { position:absolute; left:100px; top:clamp(110px,24vh,240px); display:flex; flex-direction:column; align-items:center; gap:8px; padding:18px 10px 10px; border-radius:48px; }
.ms-dock .ms-p-btn { width:50px; height:50px; color:#a2a2a2; border-radius:20px; }
.ms-dock .ms-p-btn svg { width:23px; height:23px; }
.ms-dock .ms-p-btn[aria-pressed="true"] { background:#242424; color:#eee; }
.ms-dock i { width:42px; height:1px; background:#ffffff12; margin:1px 0; }
.ms-dock .ms-avatar { margin-top:6px; }
.ms-baixo { position:absolute; left:100px; bottom:20px; z-index:5; display:grid; gap:10px; cursor:default; }
.ms-minimapa { display:block; position:relative; width:290px; height:168px; padding:16px; border-radius:20px; }
.ms-minimapa::after { content:''; position:absolute; inset:16px; border:2px solid #ffffff10; pointer-events:none; }
.ms-minimapa-svg { display:block; width:100%; height:100%; }
.ms-minimapa-svg path { display:none; }
.ms-minimapa-svg rect { fill:#636873; stroke:none; }
.ms-minimapa-svg rect:first-of-type { fill:#246de7; }
.ms-minimapa-svg rect:last-of-type { fill:#1ab35a; }
.ms-zoom { display:flex; align-items:center; gap:1px; width:max-content; padding:4px; border-radius:26px; }
.ms-zoom .ms-p-btn { width:34px; height:34px; border-radius:50%; color:#888; }
.ms-zoom .ms-p-btn:first-child { background:#232323; color:#ddd; }
.ms-zoom .ms-p-btn svg { width:16px; height:16px; }
.ms-zoom-pct { min-width:54px; padding:0; border:0; color:#aaa; background:transparent; font-size:13px; font-variant-numeric:tabular-nums; cursor:pointer; }
.ms-sem-mapa .ms-minimapa { display:none; }
.ms-grupo-tools { position:absolute; left:50%; top:-82px; transform:translateX(-50%); display:flex; align-items:center; gap:4px; padding:6px 10px; border-radius:15px; }
.ms-grupo-tools .ms-p-btn { width:38px; height:38px; border-radius:8px; color:#888; }
.ms-cor-grupo { width:20px; height:20px; margin:0 8px; border-radius:50%; background:#ee04c4; }
.ms-gaveta { position:absolute; z-index:9; right:24px; top:108px; bottom:24px; width:min(410px,calc(100% - 100px)); overflow:auto; padding:24px; border-radius:20px; background:#141414f5; border:1px solid #ffffff25; color:#ddd; cursor:default; user-select:text; backdrop-filter:blur(20px); }
.ms-gaveta-fechar,.ms-opcoes>.ms-p-btn { position:absolute; right:8px; top:8px; }
.ms-gaveta .ms-config { border:0; padding:0; background:transparent; }
.ms-opcoes { display:flex; flex-direction:column; gap:16px; }
.ms-opcoes h2 { margin:0; font-size:24px; }
.ms-opcoes h3 { margin:12px 0 0; font-size:16px; }
.ms-opcoes p { margin:0; color:#aaa; line-height:1.6; font-size:14px; }
.ms-opcoes-label { color:#bbb; font-size:14px; }
.ms-opcoes-upload { position:relative; display:flex; align-items:center; gap:10px; min-height:44px; padding:12px; border:1px solid #ffffff20; border-radius:12px; font-size:14px; cursor:pointer; }
.ms-res { width:100%; padding:12px; border-radius:10px; border:1px solid #ffffff25; background:#202020; color:#eee; font:inherit; }
.ms-chip { padding:10px; border-radius:10px; background:#ffffff08; font-size:14px; }
.ms-play { display:flex; align-items:center; justify-content:center; gap:10px; padding:13px 18px; border:0; border-radius:12px; background:#a31b8b; color:#fff; font-size:15px; font-weight:600; cursor:pointer; }
.ms-play:disabled { opacity:.5; cursor:not-allowed; }
.ms-canvas-marca { position:absolute; right:28px; bottom:24px; display:grid; place-items:center; width:42px; height:48px; color:#888; font:18px ui-monospace,monospace; border:1px solid #ffffff18; border-radius:12px; transform:rotate(-12deg); pointer-events:none; }
/* O canvas mantém a paleta preta mesmo quando o painel usa o tema claro. */
:root[data-theme="light"] .ms-imersivo { background-color:#000; color:#ddd; }
@media (max-height:850px) and (min-width:701px) { .ms-dock { top:150px; gap:2px; padding-top:12px; } .ms-dock .ms-p-btn { width:44px; height:44px; } .ms-minimapa { width:230px; height:135px; } .ms-baixo { bottom:14px; } }
@media (max-height:650px) and (min-width:701px) { .ms-minimapa { display:none; } .ms-dock { top:115px; } .ms-dock .ms-p-btn { height:34px; } }
@media (max-width:1000px) { .ms-p-status { max-width:140px; font-size:12px; } .ms-p-dir { right:16px; gap:8px; } }
@media (max-width:700px) { .ms-rail { width:54px; padding-inline:7px; gap:10px; } .ms-rail-logo { width:53px; min-height:66px; } .ms-rail .ms-p-btn { width:32px; height:32px; } .ms-pilula { top:12px; min-height:48px; padding:5px; gap:4px; } .ms-p-esq { left:66px; padding-right:12px; } .ms-p-esq b { margin-left:5px; font-size:12px; letter-spacing:0; } .ms-orbe { width:34px; height:34px; border-radius:10px; } .ms-orbe span { width:24px; height:24px; } .ms-p-esq>.ms-p-btn { width:22px; height:30px; } .ms-p-esq i { height:20px; margin:0; } .ms-p-dir { top:70px; right:12px; min-height:38px; } .ms-p-dir .ms-avatar,.ms-p-dir .ms-p-status { display:none; } .ms-link { min-height:32px; padding:0 10px; font-size:12px; } .ms-p-dir>.ms-p-btn { width:30px; height:30px; } .ms-dock { left:66px; top:76px; padding:7px; border-radius:25px; gap:4px; } .ms-dock .ms-p-btn { width:30px; height:32px; border-radius:12px; } .ms-dock .ms-p-btn svg { width:19px; height:19px; } .ms-dock .ms-p-btn:nth-child(3),.ms-dock .ms-p-btn:nth-child(4),.ms-dock .ms-avatar { display:none; } .ms-dock i { width:24px; } .ms-baixo { left:66px; bottom:max(14px,env(safe-area-inset-bottom)); gap:7px; } .ms-minimapa { width:150px; height:90px; padding:8px; border-radius:14px; } .ms-minimapa::after { inset:8px; } .ms-zoom { gap:0; padding:3px; } .ms-zoom .ms-p-btn { width:28px; height:30px; } .ms-zoom-pct { min-width:42px; font-size:12px; } .ms-gaveta { top:116px; right:12px; bottom:12px; width:calc(100% - 78px); padding:20px; } .ms-canvas-marca { right:14px; bottom:20px; width:28px; height:32px; font-size:12px; } }
@media (prefers-reduced-motion:reduce) { .ms-imersivo * { animation:none!important; transition:none!important; } }


/* configuração do administrador */
.ms-config { padding: 20px; border-radius: 20px; border: 1px solid var(--linha); background: var(--vidro, var(--superficie)); }
.ms-config h3 { margin: 0; }
.ms-config label { display: block; margin: 14px 0 5px; color: var(--texto-3); font-size: 12.5px; }
.ms-badge { padding: 3px 10px; border-radius: 99px; border: 1px solid currentColor; font-size: 11.5px; }
.ms-no.ms-no-erro-x { color: var(--erro); }
.ms-passo { margin-top: 16px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--linha); background: var(--superficie-2); color: var(--texto-2); font-size: 13.5px; line-height: 1.7; }
.ms-passo b { color: var(--texto); }
.ms-passo code { padding: 1px 6px; border-radius: 6px; background: var(--superficie); border: 1px solid var(--linha); font-size: 12.5px; }

