div#edit-markup-simuladorgnv .simulador-wrapper {
  max-width: 1100px;
  margin: 30px auto;
  font-family: Arial, sans-serif;
  background: #fff;
  border: 4px solid #a5c400;
  border-radius: 12px;
  overflow: hidden;
  color: #333;
  box-sizing: border-box;
}

/* cabeçalho verde */
div#edit-markup-simuladorgnv .titulo {
  background: #a5c400;
  color: #fff;
  font-size: 24px;
  text-align: center;
  padding: 10px 0;
  margin: 0;
  font-weight: bold;
  border-radius: 8px 8px 0 0;
}

/* bloco topo */
div#edit-markup-simuladorgnv .bloco-topo {
  background: #f8f9fb;
  border-bottom: 1px solid #d0e3f5;
  padding: 20px 25px;
  box-sizing: border-box;
}

div#edit-markup-simuladorgnv .bloco-topo h2 {
  color: #005fa3;
  font-weight: bold;
  margin-bottom: 10px;
  text-align: center;
}

div#edit-markup-simuladorgnv .inputs-topo {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

div#edit-markup-simuladorgnv .campo {
  flex: 1;
  min-width: 200px;
}

div#edit-markup-simuladorgnv .campo label {
  display: block;
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
  text-align: center;
}

div#edit-markup-simuladorgnv .input-grupo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

div#edit-markup-simuladorgnv [contenteditable="true"] {
  display: inline-block;
  min-width: 80px;
  padding: 6px 8px;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fff;
  text-align: center;
}

div#edit-markup-simuladorgnv .prefix {
  font-weight: bold;
}

/* bloco principal (3 colunas alinhadas lado a lado) */
div#edit-markup-simuladorgnv .bloco-principal {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  padding: 20px;
  box-sizing: border-box;
  flex-wrap: nowrap;
}

div#edit-markup-simuladorgnv .coluna {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  box-sizing: border-box;
}

div#edit-markup-simuladorgnv .coluna-esq {
  width: 38%;
  min-width: 320px;
}

div#edit-markup-simuladorgnv .coluna-centro {
  width: 32%;
  min-width: 280px;
}

div#edit-markup-simuladorgnv .coluna-dir {
  width: 30%;
  min-width: 260px;
}

div#edit-markup-simuladorgnv .coluna h2 {
  font-size: 16px;
  font-weight: bold;
  color: #005fa3;
  text-align: center;
  margin-bottom: 10px;
}

/* tabelas */
div#edit-markup-simuladorgnv table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 13px;
}

div#edit-markup-simuladorgnv th {
  background: #e9eef4;
  font-weight: bold;
  color: #333;
}

div#edit-markup-simuladorgnv th,
div#edit-markup-simuladorgnv td {
  border: 1px solid #ccc;
  padding: 6px;
}

/* box economia */
div#edit-markup-simuladorgnv .box-economia {
  margin-top: 15px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  box-sizing: border-box;
}

div#edit-markup-simuladorgnv .box-economia h3 {
  background: #e9f1f8;
  color: #005fa3;
  border: 1px solid #c8d7e1;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
}

div#edit-markup-simuladorgnv .tabela-pequena.economia {
  margin-top: 8px;
}

div#edit-markup-simuladorgnv .tabela-pequena.economia th {
  background: #f1f5f9;
  color: #005fa3;
  font-weight: bold;
  border: 1px solid #c8d7e1;
  text-align: center;
  padding: 6px;
}

div#edit-markup-simuladorgnv .tabela-pequena.economia td {
  border: 1px solid #c8d7e1;
  text-align: center;
  padding: 6px;
}

div#edit-markup-simuladorgnv .tabela-pequena.economia td:first-child {
  text-align: left;
  color: #333;
  font-weight: 500;
}

/* botão verde esquerdo */
div#edit-markup-simuladorgnv .acoes-esq {
  text-align: center;
  margin-top: 12px;
}

div#edit-markup-simuladorgnv .acoes-esq .btn-calcular {
  background: #a5c400;
  color: #fff;
  font-weight: bold;
  border-radius: 6px;
  padding: 8px 20px;
  display: inline-block;
  cursor: pointer;
  transition: background 0.3s;
}

div#edit-markup-simuladorgnv .acoes-esq .btn-calcular:hover {
  background: #94b000;
}

/* retorno central */
div#edit-markup-simuladorgnv .tabela-retorno th {
  background: #e9eef4;
  font-size: 13px;
}

div#edit-markup-simuladorgnv .tabela-retorno td {
  padding: 10px;
  font-size: 13px;
}

div#edit-markup-simuladorgnv .nota-pequena {
  font-size: 11px;
  color: #666;
  margin-top: 8px;
  line-height: 1.4em;
}

/* rendimento */
div#edit-markup-simuladorgnv .box-rendimento {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  box-sizing: border-box;
}

div#edit-markup-simuladorgnv .linha-rendimento {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 10px;
}

div#edit-markup-simuladorgnv .btn-pequeno {
  background: #a5c400;
  color: #fff;
  font-weight: bold;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.3s;
}

div#edit-markup-simuladorgnv .btn-pequeno:hover {
  background: #b83a3a;
}

div#edit-markup-simuladorgnv .barras {
  margin: 6px 0 10px 0;
}

div#edit-markup-simuladorgnv .barra-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

div#edit-markup-simuladorgnv .barra-label {
  width: 60px;
  font-weight: bold;
  font-size: 13px;
  color: #333;
}

div#edit-markup-simuladorgnv .barra {
  flex: 1;
  height: 10px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
}

div#edit-markup-simuladorgnv .barra-fill {
  height: 100%;
  width: 0%;
  background: #2f6fb3;
  transition: width .4s ease;
}

div#edit-markup-simuladorgnv .barra-val {
  width: 70px;
  text-align: right;
  font-size: 12px;
}
div#edit-markup-simuladorgnv .comparativos {
  margin-top: 12px;
  padding: 10px;
  background: #f7f9fb;
  border: 1px solid #d6e0eb;
  border-radius: 6px;
  text-align: center;
  font-size: 12px; /* junta as duas definições */
  border-top: none; /* remove redundância */
}

div#edit-markup-simuladorgnv .comparativo-boxes {
  display: flex;
  justify-content: center;
  align-items: stretch; /* garante mesma altura */
  gap: 10px;
  flex-wrap: nowrap; /* força lado a lado */
}

div#edit-markup-simuladorgnv .comp-box {
  background: #fff;
  border: 1px solid #c8d7e1;
  border-radius: 6px;
  padding: 8px 12px;
  width: 120px;
  text-align: center;
  box-sizing: border-box;
}

/* ====== AJUSTE PARA MOBILE (substituir todo o bloco existente) ====== */
@media (max-width: 768px) {
  /* ajusta borda para mobile */
  div#edit-markup-simuladorgnv .simulador-wrapper {
    border-width: 3px;
  }

  /* inputs do topo: um por linha, centralizados */
  div#edit-markup-simuladorgnv .inputs-topo {
    display: flex;
    flex-direction: column;   /* empilha */
    align-items: center;      /* centraliza horizontalmente os .campo */
    justify-content: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 12px;          /* folga interna para não encostar nas laterais */
  }

  /* cada campo ocupa a largura disponível, mas com limite para não esticar */
  div#edit-markup-simuladorgnv .campo {
    width: 100%;
    max-width: 700px; /* ajuste conforme desejar */
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center; /* centraliza label + input */
  }

  /* label centralizado */
  div#edit-markup-simuladorgnv .campo label {
    text-align: center;
    font-size: 14px;
    width: 100%;
    margin-bottom: 6px;
  }

  /* input-grupo: centraliza conteúdo (prefix + input + suffix) */
  div#edit-markup-simuladorgnv .input-grupo {
    display: flex;
    align-items: center;
    justify-content: center; /* centraliza os elementos internos */
    gap: 6px;
    width: 100%;
  }

  /* make editable spans behave like inputs e centralizados */
  div#edit-markup-simuladorgnv [contenteditable="true"] {
    width: 100%;
    max-width: 100px;
    box-sizing: border-box;
    text-align: center;
  }

  /* bloco principal vira colunas empilhadas */
  div#edit-markup-simuladorgnv .bloco-principal {
    flex-direction: column;
    gap: 18px;
  }

  div#edit-markup-simuladorgnv .coluna {
    width: 100% !important;
    min-width: unset;
    box-sizing: border-box;
  }

  div#edit-markup-simuladorgnv .coluna h2 {
    text-align: left;
    font-size: 15px;
  }

  /* tabelas e paddings menores */
  div#edit-markup-simuladorgnv table {
    font-size: 12px;
  }

  div#edit-markup-simuladorgnv th,
  div#edit-markup-simuladorgnv td {
    padding: 5px;
  }

  /* botão calcular alinhado e com largura controlada */
  div#edit-markup-simuladorgnv .acoes-esq {
    margin-top: 16px;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  div#edit-markup-simuladorgnv .acoes-esq .btn-calcula {
    width: 100%;
    max-width: 120px;
  }

  div#edit-markup-simuladorgnv .acoes-esq .btn-calcular {
    width: 100%;
    max-width: 110px;
  }

  /* barras e comparativos ajustados */
  div#edit-markup-simuladorgnv .barra-label {
    width: 50px;
    font-size: 12px;
  }

  div#edit-markup-simuladorgnv .comparativo-boxes,
  div#edit-markup-simuladorgnv .comparativos {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  div#edit-markup-simuladorgnv .comp-box {
    width: 100%;
  }
}
