/* =============================================================================
   GIDE — estilo do painel
   Inspirado na sobriedade do Blender: cinzas neutros, um único azul de destaque,
   cantos de no máximo 3 px, tipografia compacta, ícones monocromáticos.
   ============================================================================= */
:root {
  --fundo: #1b1c1e;
  --area: #222326;
  --painel: #28292c;
  --cabecalho: #2f3033;
  --campo: #1a1b1d;
  --campo-borda: #3a3b3f;
  --linha: #141516;
  --linha-clara: #36373b;
  --texto: #d7d9dc;
  --texto-2: #9a9da3;
  --texto-3: #6c6f75;
  --destaque: #4a8fd6;
  --destaque-forte: #5a9be0;
  --selecao: #2f4a72;
  --selecao-fraca: #2a3442;
  --ok: #5fa86f;
  --aviso: #c9a24a;
  --erro: #cf5f5f;
  --raio: 3px;
  --raio-p: 2px;
  --fonte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --alt-barra: 34px;
  --alt-status: 22px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--fundo); color: var(--texto); font: 13px/1.45 var(--fonte);
  -webkit-font-smoothing: antialiased; overflow: hidden; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--destaque-forte); }
.ic { width: 16px; height: 16px; flex: none; fill: none; display: inline-block; vertical-align: middle; }
.ic.p { width: 14px; height: 14px; }
.ic.g { width: 22px; height: 22px; }
[hidden] { display: none !important; }
::selection { background: var(--selecao); }

/* Barras de rolagem discretas */
* { scrollbar-width: thin; scrollbar-color: #45474c transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3f4146; border: 2px solid transparent; background-clip: padding-box; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Botões e campos ---------------------------------------------- */
.bt {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 10px;
  background: #36373b; border: 1px solid #222326; border-top-color: #45464a; border-radius: var(--raio);
  cursor: pointer; white-space: nowrap; user-select: none; transition: background .12s;
}
.bt:hover { background: #404146; }
.bt:active { background: #2d2e31; }
.bt:focus-visible, .campo:focus-visible, .ic-bt:focus-visible { outline: 1px solid var(--destaque); outline-offset: 1px; }
.bt[disabled] { opacity: .45; cursor: default; pointer-events: none; }
.bt.primario { background: var(--destaque); border-color: #2e5f97; border-top-color: #6aa6e6; color: #fff; }
.bt.primario:hover { background: var(--destaque-forte); }
.bt.perigo { background: #6b2f2f; border-color: #3a1919; border-top-color: #8a4040; }
.bt.perigo:hover { background: #7d3838; }
.bt.fantasma { background: transparent; border-color: transparent; }
.bt.fantasma:hover { background: #34353a; }
.bt.grande { height: 34px; padding: 0 16px; }
.ic-bt {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; padding: 0;
  background: transparent; color: var(--texto-2); border-radius: var(--raio); cursor: pointer; flex: none;
}
.ic-bt:hover { background: #36373b; color: var(--texto); }
.ic-bt.ativo { background: var(--selecao); color: #fff; }
.campo {
  height: 28px; padding: 0 8px; width: 100%; background: var(--campo); border: 1px solid var(--campo-borda);
  border-radius: var(--raio); outline: none; min-width: 0;
}
.campo:focus { border-color: var(--destaque); }
textarea.campo { height: auto; min-height: 72px; padding: 6px 8px; resize: vertical; line-height: 1.4; }
select.campo { padding-right: 24px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%239a9da3' stroke-width='1.3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center; background-size: 14px; }
.campo.invalido { border-color: var(--erro); }
input[type=color].campo { padding: 2px; width: 40px; flex: none; cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 2px; }
.chave { position: relative; width: 32px; height: 18px; flex: none; appearance: none; background: #3a3b3f; border-radius: 3px; cursor: pointer; margin: 0; border: 1px solid #222; }
.chave::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; background: #c9ccd1; border-radius: 2px; transition: left .12s; }
.chave:checked { background: var(--destaque); }
.chave:checked::after { left: 16px; background: #fff; }
.segmentado { display: inline-flex; border: 1px solid #222326; border-radius: var(--raio); overflow: hidden; }
.segmentado button { height: 28px; padding: 0 12px; border: 0; background: #36373b; cursor: pointer; border-right: 1px solid #222326; }
.segmentado button:last-child { border-right: 0; }
.segmentado button.ativo { background: var(--destaque); color: #fff; }

/* ---------- Estrutura geral ---------------------------------------------- */
#app { display: flex; flex-direction: column; height: 100%; height: 100dvh; }
.barra {
  height: var(--alt-barra); flex: none; display: flex; align-items: center; gap: 4px; padding: 0 6px;
  background: var(--cabecalho); border-bottom: 1px solid var(--linha);
}
.marca-gide { display: flex; align-items: center; gap: 7px; padding: 0 8px 0 4px; font-weight: 600; letter-spacing: .08em; color: #e8eaed; text-decoration: none; height: 100%; }
.marca-gide img { width: 20px; height: 20px; display: block; }
.sep { width: 1px; height: 18px; background: var(--linha-clara); margin: 0 4px; flex: none; }
.nome-projeto { display: flex; align-items: center; gap: 6px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--texto); font-weight: 500; padding: 0 6px; }
.abas { display: flex; height: 100%; align-items: stretch; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.abas::-webkit-scrollbar { display: none; }
.aba {
  display: flex; align-items: center; gap: 6px; padding: 0 12px; color: var(--texto-2); text-decoration: none; white-space: nowrap;
  border-top: 2px solid transparent; border-bottom: 2px solid transparent; cursor: pointer; user-select: none;
}
.aba:hover { color: var(--texto); background: #34353a; }
.aba.ativa { color: #fff; background: var(--area); border-bottom-color: var(--destaque); }
.estado-construtor { display: flex; align-items: center; gap: 6px; color: var(--texto-2); font-size: 12px; padding: 0 8px; white-space: nowrap; }
.ponto { width: 7px; height: 7px; border-radius: 50%; background: var(--texto-3); flex: none; }
.ponto.ok { background: var(--ok); box-shadow: 0 0 6px rgba(95,168,111,.6); }
.ponto.trab { background: var(--destaque); box-shadow: 0 0 6px rgba(74,143,214,.7); animation: pulsar 1.2s infinite; }
.ponto.erro { background: var(--erro); }
@keyframes pulsar { 50% { opacity: .35; } }

#conteudo { flex: 1; min-height: 0; position: relative; background: var(--fundo); }
.status {
  height: var(--alt-status); flex: none; display: flex; align-items: center; gap: 14px; padding: 0 10px; font-size: 11.5px;
  color: var(--texto-2); background: var(--cabecalho); border-top: 1px solid var(--linha); white-space: nowrap; overflow: hidden;
}
.status .dir { margin-left: auto; }

/* Área de trabalho em painéis (estilo editor) */
.trabalho { display: grid; height: 100%; gap: 1px; background: var(--linha); }
.trabalho.c2 { grid-template-columns: 270px minmax(0, 1fr); }
.trabalho.c2d { grid-template-columns: minmax(0, 1fr) 340px; }
.trabalho.c3 { grid-template-columns: 240px minmax(0, 1fr) 360px; }
.pn { background: var(--area); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pn-cab {
  height: 30px; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 6px 0 10px; background: var(--painel);
  border-bottom: 1px solid var(--linha); font-size: 12px; color: var(--texto-2); text-transform: uppercase; letter-spacing: .06em;
}
.pn-cab .titulo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-corpo { flex: 1; min-height: 0; overflow: auto; }
.pn-corpo.pad { padding: 12px; }
.pn-fecha { display: none; }

/* Seções de propriedades */
.secao { border-bottom: 1px solid var(--linha); }
.secao > h3 {
  margin: 0; height: 28px; display: flex; align-items: center; gap: 6px; padding: 0 10px; font-size: 12px; font-weight: 600;
  background: var(--painel); color: var(--texto); cursor: default;
}
.secao .corpo { padding: 10px 12px; display: grid; gap: 8px; }
.prop { display: grid; grid-template-columns: 38% minmax(0, 1fr); align-items: center; gap: 8px; min-height: 28px; }
.prop > label { color: var(--texto-2); font-size: 12px; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.prop .linha-h { display: flex; gap: 6px; align-items: center; min-width: 0; }
.prop.topo { align-items: start; }
.prop.topo > label { padding-top: 6px; }
.ajuda { color: var(--texto-3); font-size: 11.5px; line-height: 1.4; }
.nota { padding: 8px 10px; background: #24282e; border-left: 2px solid var(--destaque); color: var(--texto-2); font-size: 12px; border-radius: var(--raio-p); }
.nota.aviso { border-left-color: var(--aviso); }
.nota.erro { border-left-color: var(--erro); }
.vazio { padding: 32px 16px; text-align: center; color: var(--texto-3); }
.vazio .ic { width: 28px; height: 28px; display: block; margin: 0 auto 10px; opacity: .6; }

/* ---------- Meus projetos ------------------------------------------------- */
.projetos { height: 100%; overflow: auto; padding: 28px clamp(14px, 4vw, 48px) 40px; }
.projetos-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.projetos-cab h1 { font-size: 20px; font-weight: 600; margin: 0 auto 0 0; letter-spacing: .01em; }
.grade-projetos { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.cartao {
  background: var(--area); border: 1px solid var(--linha-clara); border-radius: var(--raio); overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .12s;
}
.cartao:hover { border-color: #4a4c52; }
.cartao .capa { height: 118px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--linha); cursor: pointer; position: relative; }
.cartao .capa img { width: 64px; height: 64px; border-radius: 3px; box-shadow: 0 4px 18px rgba(0,0,0,.45); }
.cartao .capa .ic { width: 40px; height: 40px; color: #8a8e96; }
.cartao .info { padding: 10px 12px 6px; }
.cartao .info b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cartao .info span { color: var(--texto-3); font-size: 11.5px; }
.cartao .acoes { display: flex; gap: 2px; padding: 4px 6px 8px; align-items: center; }
.cartao .acoes .bt { height: 26px; }
.cartao .acoes .esp { flex: 1; }

/* ---------- Árvore de arquivos ------------------------------------------- */
.arvore { padding: 4px 0; user-select: none; }
.no { display: flex; align-items: center; gap: 5px; height: 24px; padding-right: 8px; cursor: pointer; white-space: nowrap; color: var(--texto); position: relative; }
.no:hover { background: #2c2e32; }
.no.sel { background: var(--selecao); color: #fff; }
.no .seta { width: 14px; height: 14px; color: var(--texto-3); flex: none; transition: transform .1s; }
.no .seta.aberta { transform: rotate(90deg); }
.no .ic { color: var(--texto-2); }
.no.pasta > .ic { color: #b9a77a; }
.no .nm { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.no .tam { color: var(--texto-3); font-size: 11px; }
.no .menu-no { opacity: 0; }
.no:hover .menu-no, .no.sel .menu-no { opacity: 1; }
.cat-modelo { color: #c38a5d !important; } .cat-som { color: #6fb39a !important; } .cat-imagem { color: #a385c9 !important; } .cat-codigo { color: #7ea7d8 !important; }

/* ---------- Editor de código --------------------------------------------- */
.guias { display: flex; height: 30px; flex: none; background: var(--painel); border-bottom: 1px solid var(--linha); overflow-x: auto; scrollbar-width: none; }
.guia { display: flex; align-items: center; gap: 6px; padding: 0 6px 0 10px; border-right: 1px solid var(--linha); color: var(--texto-2); cursor: pointer; white-space: nowrap; font-size: 12.5px; }
.guia.ativa { background: var(--area); color: var(--texto); box-shadow: inset 0 2px 0 var(--destaque); }
.guia .sujo { width: 7px; height: 7px; border-radius: 50%; background: var(--aviso); }
.guia .ic-bt { width: 20px; height: 20px; }
.editor { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #1e1f22; }
.ed-rolagem { flex: 1; min-height: 0; overflow: auto; position: relative; }
.ed-grade { display: grid; grid-template-columns: auto 1fr; min-height: 100%; min-width: max-content; }
.ed-numeros {
  position: sticky; left: 0; z-index: 2; background: #1e1f22; color: #5a5d63; text-align: right; padding: 10px 10px 40px 14px;
  font: 13px/20px var(--mono); user-select: none; border-right: 1px solid #2b2c30; white-space: pre;
}
.ed-numeros .atual { color: #c9ccd1; }
.ed-pilha { display: grid; position: relative; }
.ed-pilha > * {
  grid-area: 1 / 1; margin: 0; padding: 10px 40px 40px 12px; font: 13px/20px var(--mono); tab-size: 4; -moz-tab-size: 4;
  white-space: pre; overflow: hidden; border: 0; letter-spacing: 0; word-wrap: normal;
}
.ed-pilha pre { color: #d4d4d4; pointer-events: none; }
.ed-pilha textarea { background: transparent; color: transparent; caret-color: #e8e8e8; resize: none; outline: none; }
.ed-pilha textarea::selection { background: rgba(74,143,214,.35); color: transparent; }
/* Cores do realce (sóbrias) */
.t-com { color: #6a8a5a; font-style: italic; } .t-str { color: #c9a26b; } .t-num { color: #b5cea8; }
.t-kw { color: #d08e8e; } .t-tipo { color: #7fb7c9; } .t-fn { color: #dcc98a; } .t-ann { color: #c79bd8; }
.t-sec { color: #7ea7d8; font-weight: 600; } .t-chave { color: #9fc0e0; } .t-op { color: #9a9da3; } .t-no { color: #8fc49a; }
.t-csvh { color: #7ea7d8; font-weight: 600; } .t-sep { color: #5d6066; }
.ed-barra { height: 26px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 10px; font-size: 11.5px; color: var(--texto-2); background: var(--painel); border-top: 1px solid var(--linha); }
.ed-barra .dir { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.ed-midia { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; overflow: auto; }
.ed-midia img { max-width: 100%; max-height: 100%; image-rendering: auto; background: repeating-conic-gradient(#2a2b2e 0 25%, #232427 0 50%) 0 0/16px 16px; }

/* ---------- Editor de dados ---------------------------------------------- */
.lista-itens { padding: 4px 0; }
.item-dado { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; cursor: pointer; border-left: 2px solid transparent; }
.item-dado:hover { background: #2c2e32; }
.item-dado.sel { background: var(--selecao-fraca); border-left-color: var(--destaque); }
.item-dado .num { color: var(--texto-3); font: 11px var(--mono); width: 22px; text-align: right; }
.item-dado .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-dados { max-width: 760px; padding: 14px 16px 40px; display: grid; gap: 10px; }
.form-dados h2 { font-size: 16px; margin: 4px 0 2px; font-weight: 600; }
.cor-campo { display: flex; gap: 6px; align-items: center; }
.cor-campo .campo:not([type=color]) { width: 110px; font-family: var(--mono); }
.tabela-csv { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.tabela-csv th, .tabela-csv td { border: 1px solid var(--linha-clara); padding: 0; }
.tabela-csv th { background: var(--painel); color: var(--texto-2); font-weight: 600; height: 28px; padding: 0 8px; position: sticky; top: 0; z-index: 1; text-align: left; }
.tabela-csv td input { width: 100%; min-width: 130px; height: 28px; border: 0; background: transparent; padding: 0 8px; outline: none; }
.tabela-csv td input:focus { background: #1a2433; box-shadow: inset 0 0 0 1px var(--destaque); }
.tabela-csv td.idx { color: var(--texto-3); font: 11px var(--mono); text-align: center; width: 34px; background: var(--painel); }

/* ---------- Biblioteca ---------------------------------------------------- */
.filtros { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--linha); flex-wrap: wrap; align-items: center; }
.chip { height: 26px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--linha-clara); background: transparent; border-radius: var(--raio); cursor: pointer; color: var(--texto-2); }
.chip.ativo { background: var(--selecao); color: #fff; border-color: #3d5f90; }
.grade-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; padding: 10px; }
.asset { background: var(--painel); border: 1px solid var(--linha-clara); border-radius: var(--raio); cursor: pointer; overflow: hidden; display: flex; flex-direction: column; }
.asset:hover { border-color: #50535a; }
.asset.sel { border-color: var(--destaque); box-shadow: 0 0 0 1px var(--destaque); }
.asset .miniatura { height: 92px; display: flex; align-items: center; justify-content: center; background: #1f2023; }
.asset .miniatura img { max-width: 100%; max-height: 100%; object-fit: contain; }
.asset .miniatura .ic { width: 30px; height: 30px; }
.asset .rot { padding: 6px 8px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset .rot small { display: block; color: var(--texto-3); font-size: 11px; }
.visor { position: relative; height: 320px; background: radial-gradient(ellipse at 50% 35%, #2b2e34, #17181b 75%); border-bottom: 1px solid var(--linha); }
.visor canvas { width: 100% !important; height: 100% !important; display: block; touch-action: none; }
.visor .ferramentas { position: absolute; top: 6px; right: 6px; display: flex; gap: 2px; background: rgba(30,31,34,.85); border: 1px solid var(--linha-clara); border-radius: var(--raio); padding: 2px; }
.visor .carregando { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--texto-2); }
.estat { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12px; }
.estat dt { color: var(--texto-3); } .estat dd { margin: 0; font-family: var(--mono); }
.anims { display: flex; flex-direction: column; gap: 2px; }
.anims button { text-align: left; height: 26px; padding: 0 8px; border: 0; background: transparent; border-radius: var(--raio); cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--texto-2); }
.anims button:hover { background: #2f3035; color: var(--texto); }
.anims button.ativo { background: var(--selecao); color: #fff; }
.player { display: flex; align-items: center; gap: 10px; padding: 14px 12px; }
.player .trilha { flex: 1; height: 26px; position: relative; cursor: pointer; display: flex; align-items: center; }
.player .trilha::before { content: ""; position: absolute; left: 0; right: 0; height: 4px; background: #3a3b3f; border-radius: 2px; }
.player .trilha .progresso { position: absolute; left: 0; height: 4px; background: var(--destaque); border-radius: 2px; }
.player .tempo { font: 11.5px var(--mono); color: var(--texto-2); min-width: 86px; text-align: right; }
.onda { height: 70px; display: block; width: 100%; }

/* ---------- Abertura e marca --------------------------------------------- */
.palco { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; overflow: auto; background: #18191b; }
.aparelho { position: relative; width: min(640px, 92%); aspect-ratio: 19.5 / 9; border: 8px solid #0d0d0e; border-radius: 3px; box-shadow: 0 0 0 1px #3a3b3f, 0 18px 40px rgba(0,0,0,.5); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.aparelho.retrato { width: auto; height: min(560px, 70vh); aspect-ratio: 9 / 19.5; }
.aparelho img { position: absolute; inset: 0; margin: auto; }
.aparelho .sem-logo { color: rgba(255,255,255,.25); font-size: 12px; }
.legenda-palco { color: var(--texto-3); font-size: 12px; text-align: center; max-width: 520px; }
.icones-previa { display: flex; gap: 18px; align-items: flex-end; }
.icones-previa figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--texto-3); font-size: 11px; }
.icones-previa .ic-app { width: 64px; height: 64px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #111; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.icones-previa .ic-app img { width: 100%; height: 100%; }
.icones-previa .redondo { border-radius: 50%; }
.icones-previa .quadrado { border-radius: 3px; }

/* ---------- Exportação ---------------------------------------------------- */
.tabela { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tabela th { text-align: left; font-weight: 500; color: var(--texto-3); height: 28px; padding: 0 10px; border-bottom: 1px solid var(--linha); background: var(--painel); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tabela td { height: 34px; padding: 0 10px; border-bottom: 1px solid #2a2b2f; white-space: nowrap; }
.tabela tr.sel td { background: var(--selecao-fraca); }
.tabela tbody tr { cursor: pointer; }
.tabela tbody tr:hover td { background: #2a2c30; }
.etiqueta { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 2px; font-size: 11px; font-weight: 600; letter-spacing: .03em; background: #3a3b3f; color: var(--texto); text-transform: uppercase; }
.etiqueta.ok { background: #263f2d; color: #9fd8ac; } .etiqueta.erro { background: #4a2626; color: #f0a5a5; }
.etiqueta.na_fila { background: #3d3624; color: #e6cd8e; } .etiqueta.em_andamento { background: #223650; color: #a9cdf5; }
.etiqueta.cancelado { background: #333; color: #aaa; }
.log { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 10px 12px; background: #141517; font: 12px/1.55 var(--mono); color: #b9bcc1; white-space: pre-wrap; word-break: break-word; }
.log .l-gide { color: #8fb8e6; } .log .l-erro { color: #f08f8f; } .log .l-aviso { color: #e0c27a; } .log .l-ok { color: #9fd8ac; }
.divisao-v { display: flex; flex-direction: column; height: 100%; }
.divisao-v > .cima { flex: 0 0 42%; min-height: 0; overflow: auto; border-bottom: 1px solid var(--linha); }
.divisao-v > .baixo { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---------- Licenças ------------------------------------------------------ */
.doc { max-width: 860px; margin: 0 auto; padding: 24px clamp(14px, 3vw, 32px) 48px; }
.doc h1 { font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.doc h2 { font-size: 15px; font-weight: 600; margin: 26px 0 8px; display: flex; align-items: center; gap: 8px; }
.doc p { color: var(--texto-2); }
.doc pre { background: #141517; border: 1px solid var(--linha-clara); border-radius: var(--raio); padding: 12px 14px; font: 12px/1.55 var(--mono); color: #b9bcc1; white-space: pre-wrap; max-height: 360px; overflow: auto; }

/* ---------- Diálogos, avisos, menus -------------------------------------- */
.veu { position: fixed; inset: 0; background: rgba(8,9,10,.6); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; backdrop-filter: blur(2px); }
.dialogo { width: min(460px, 100%); background: var(--area); border: 1px solid #44464b; border-radius: var(--raio); box-shadow: 0 20px 60px rgba(0,0,0,.6); max-height: 90vh; display: flex; flex-direction: column; }
.dialogo.largo { width: min(680px, 100%); }
.dialogo header { height: 36px; display: flex; align-items: center; padding: 0 6px 0 14px; background: var(--painel); border-bottom: 1px solid var(--linha); font-weight: 600; flex: none; }
.dialogo header span { flex: 1; }
.dialogo .corpo { padding: 14px; display: grid; gap: 12px; overflow: auto; }
.dialogo footer { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--linha); flex: none; }
.dialogo label.rot { display: block; font-size: 12px; color: var(--texto-2); margin-bottom: 4px; }
.modelos-lista { display: grid; gap: 6px; }
.modelo-op { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--linha-clara); border-radius: var(--raio); cursor: pointer; align-items: flex-start; }
.modelo-op:hover { border-color: #50535a; }
.modelo-op.sel { border-color: var(--destaque); background: #1f2935; }
.modelo-op .ic { margin-top: 2px; color: var(--texto-2); }
.modelo-op b { display: block; font-weight: 600; }
.modelo-op span { color: var(--texto-3); font-size: 12px; }
#avisos { position: fixed; right: 12px; bottom: calc(var(--alt-status) + 10px); display: flex; flex-direction: column; gap: 6px; z-index: 60; max-width: min(380px, calc(100vw - 24px)); }
.aviso-t { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; background: #2d2f33; border: 1px solid #45474c; border-left: 3px solid var(--destaque); border-radius: var(--raio); box-shadow: 0 8px 24px rgba(0,0,0,.45); animation: entrar .18s ease-out; }
.aviso-t.erro { border-left-color: var(--erro); } .aviso-t.ok { border-left-color: var(--ok); }
@keyframes entrar { from { transform: translateY(6px); opacity: 0; } }
.menu-ctx { position: fixed; z-index: 70; background: #2b2c30; border: 1px solid #47494e; border-radius: var(--raio); box-shadow: 0 10px 30px rgba(0,0,0,.5); padding: 4px; min-width: 180px; }
.menu-ctx button { display: flex; width: 100%; align-items: center; gap: 8px; height: 28px; padding: 0 10px; border: 0; background: transparent; border-radius: 2px; cursor: pointer; text-align: left; }
.menu-ctx button:hover { background: var(--selecao); color: #fff; }
.menu-ctx button.perigo:hover { background: #6b2f2f; }
.menu-ctx hr { border: 0; border-top: 1px solid #3c3e42; margin: 4px 0; }
.barra-envio { height: 3px; background: #2f3033; position: relative; overflow: hidden; }
.barra-envio i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--destaque); transition: width .1s; }
.arrastar-ativo { outline: 2px dashed var(--destaque); outline-offset: -6px; }

/* ---------- Tela de entrada ---------------------------------------------- */
.entrada { height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; background:
  radial-gradient(ellipse at 50% 20%, #24272c 0%, #17181a 60%); }
.entrada form { width: min(360px, 100%); background: var(--area); border: 1px solid #3c3e43; border-radius: var(--raio); padding: 26px 24px 22px; box-shadow: 0 24px 60px rgba(0,0,0,.5); display: grid; gap: 14px; }
.entrada .topo { display: grid; justify-items: center; gap: 6px; padding-bottom: 4px; }
.entrada .topo .logo-h { width: 158px; height: auto; display: block; }
.entrada .topo .ic { width: 30px; height: 30px; color: var(--destaque); }
.entrada h1 { margin: 0; font-size: 18px; letter-spacing: .12em; }
.entrada p { margin: 0; color: var(--texto-3); font-size: 12px; }
.entrada .erro { color: #f09a9a; font-size: 12px; min-height: 16px; }

/* ---------- Celular e tablet --------------------------------------------- */
.so-movel { display: none !important; }
@media (max-width: 1100px) {
  .trabalho.c3 { grid-template-columns: 220px minmax(0, 1fr) 320px; }
}
@media (max-width: 860px) {
  :root { --alt-barra: 44px; }
  .so-movel { display: inline-flex !important; }
  .so-pc { display: none !important; }
  .barra { flex-wrap: wrap; height: auto; padding: 0 4px; }
  .barra .linha1 { display: flex; align-items: center; width: 100%; height: 44px; gap: 2px; }
  .abas { order: 3; flex-basis: 100%; height: 40px; border-top: 1px solid var(--linha); }
  .aba { padding: 0 12px; }
  .aba span { display: inline; }
  .trabalho.c2, .trabalho.c2d, .trabalho.c3 { grid-template-columns: minmax(0, 1fr); }
  /* Painéis laterais viram gavetas sobre o conteúdo */
  .pn.lateral { position: absolute; top: 0; bottom: 0; left: 0; width: min(320px, 88vw); z-index: 30; transform: translateX(-102%); transition: transform .18s ease; box-shadow: 8px 0 30px rgba(0,0,0,.5); }
  .pn.lateral.dir { left: auto; right: 0; transform: translateX(102%); box-shadow: -8px 0 30px rgba(0,0,0,.5); }
  .pn.lateral.aberto { transform: none; }
  .pn-fecha { display: inline-flex; }
  .pn-cab { height: 44px; }
  .guias { height: 38px; }
  .ic-bt, .bt { min-height: 34px; }
  .ic-bt { width: 36px; height: 36px; }
  .bt { height: 36px; }
  .campo { height: 36px; font-size: 16px; }   /* 16 px evita zoom automático no iOS */
  textarea.campo { font-size: 16px; }
  .prop { grid-template-columns: 1fr; gap: 4px; }
  .prop > label { text-align: left; }
  .no { height: 34px; }
  .item-dado { height: 40px; }
  .visor { height: 280px; }
  .status .so-pc-status { display: none; }
  .ed-pilha > *, .ed-numeros { font-size: 13px; }
  .estado-construtor span { display: none; }
  .divisao-v > .cima { flex-basis: 46%; }
}

/* Links com aparência de botão e botões dentro de cabeçalhos de painel */
a.bt { text-decoration: none; color: inherit; }
.pn-cab .bt, .pn-cab a.bt { text-transform: none; letter-spacing: normal; font-size: 12.5px; }
.pn-cab a.bt { min-width: 0; max-width: 100%; justify-content: flex-start; }
.pn-cab a.bt span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
