/* Simuladores de negócios («Quanto custa abrir e que lucro dá»): formulário guiado, gráficos, esquemas do artigo e a
   barra «Descarregar / Partilhar» de cada elemento (o mesmo desenho dos elementos das notícias e dos artigos,
   _noticias/tools/lib/elementos.mjs, com o prefixo ng-). Só nas páginas destes simuladores. */
.ng, .simulator-content {
    --ng-tinta: #0a0a0a;
    --ng-texto: #26262a;
    --ng-sec: #6e6e73;
    --ng-linha: #e8e8ea;
    --ng-linha-suave: #efeff2;
    --ng-fundo-suave: #f7f7fa;
    --ng-acao: #5753E2;
    --ng-ganho: #1f8a5b;
    --ng-perda: #d6453d;
    --ng-ease: cubic-bezier(0.23, 1, 0.32, 1);
}

/* ---------------------------------------------------------------- formulário */
.ng-passo { margin: 1.5rem 0 .75rem; font-size: 1rem; font-weight: 600; letter-spacing: -0.02em; color: var(--ng-tinta); }
.ng-passo:first-child { margin-top: 0; }
.ng-passo small { display: block; margin-top: 2px; font-size: .8125rem; font-weight: 500; letter-spacing: 0; color: var(--ng-sec); }
.ng .sp-opcoes-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ng-grupos { display: grid; gap: .5rem; margin-top: .5rem; }
.ng-grupo { border: 1px solid var(--ng-linha); border-radius: 12px; background: #fff; }
.ng-grupo > summary { display: flex; align-items: center; gap: .75rem; min-height: 52px; padding: .625rem .875rem; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.ng-grupo > summary::-webkit-details-marker { display: none; }
.ng-grupo > summary:focus-visible { outline: 2px solid var(--ng-acao); outline-offset: 2px; border-radius: 12px; }
.ng-grupo-tit { flex: 1; min-width: 0; font-size: .9375rem; font-weight: 600; color: var(--ng-tinta); }
.ng-grupo-res { display: block; margin-top: 1px; font-size: .8125rem; font-weight: 500; color: var(--ng-sec); overflow-wrap: anywhere; }
.ng-grupo-alt { flex: none; font-size: .75rem; font-weight: 600; color: var(--ng-acao); }
.ng-chev { flex: none; width: 18px; height: 18px; color: var(--ng-sec); transition: transform 180ms var(--ng-ease); }
.ng-grupo[open] .ng-chev { transform: rotate(180deg); }
.ng-grupo-corpo { padding: .25rem .875rem 1rem; border-top: 1px solid var(--ng-linha-suave); }
.ng-grupo-corpo .form-grid { margin-top: .75rem; }
.ng-grupo-nota { margin: .75rem 0 0; font-size: .8125rem; line-height: 1.45; color: var(--ng-sec); }
.ng-campo-tipico { display: block; margin-top: 4px; font-size: .75rem; color: var(--ng-sec); }
.ng-repor { display: inline-flex; align-items: center; gap: .375rem; margin-top: .75rem; padding: .375rem .75rem; border: 1px solid var(--ng-linha); border-radius: 999px; background: #fff; color: var(--ng-texto); font: inherit; font-size: .8125rem; font-weight: 600; cursor: pointer; }
.ng-repor:hover { border-color: var(--ng-acao); color: var(--ng-acao); }

/* ---------------------------------------------------------------- resultado */
.ng-intervalo-txt { display: block; margin-top: 6px; font-size: .875rem; font-weight: 500; color: var(--ng-sec); }
.ng-frase { margin: 1.5rem 0 0; font-size: 1rem; line-height: 1.6; color: var(--ng-texto); text-wrap: pretty; }
.ng-graficos { margin-top: 1.5rem; }
.ng-bloco { margin: 2.25rem 0 0; }
.ng-bloco > h3 { margin: 0 0 .375rem; font-size: 1.125rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; color: var(--ng-tinta); }
.ng-bloco > p { margin: 0 0 1rem; font-size: .9375rem; line-height: 1.55; color: var(--ng-texto); text-wrap: pretty; }
.ng-el { margin: 0; scroll-margin-top: 96px; }
.ng-el svg { display: block; width: 100%; height: auto; overflow: visible; }
.ng-el figcaption { margin-top: .625rem; font-size: .8125rem; line-height: 1.5; color: var(--ng-sec); text-wrap: pretty; }
.ng-tabela-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1rem 0 0; border: 1px solid var(--ng-linha); border-radius: 12px; }
.ng-tabela { width: 100%; border-collapse: collapse; font-size: .875rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
.ng-tabela caption { caption-side: top; text-align: left; padding: .75rem .875rem .25rem; font-weight: 600; color: var(--ng-tinta); }
.ng-tabela th, .ng-tabela td { padding: .5625rem .875rem; border-bottom: 1px solid var(--ng-linha-suave); text-align: right; white-space: nowrap; }
.ng-tabela th:first-child, .ng-tabela td:first-child { text-align: left; white-space: normal; }
.ng-tabela thead th { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #2F2BB0; background: #FAF7F0; }
.ng-tabela tbody th { font-weight: 500; color: var(--ng-tinta); }
.ng-tabela tr:last-child td, .ng-tabela tr:last-child th { border-bottom: 0; }
.ng-tabela .ng-tot th, .ng-tabela .ng-tot td { font-weight: 600; color: var(--ng-tinta); background: var(--ng-fundo-suave); }
.ng-neg { color: var(--ng-perda); }
.ng-pos { color: var(--ng-ganho); }
.ng-pressupostos { margin: 1rem 0 0; padding: .875rem 1rem; border: 1px solid var(--ng-linha); border-radius: 12px; background: var(--ng-fundo-suave); font-size: .875rem; line-height: 1.55; color: var(--ng-texto); }
.ng-pressupostos ul { margin: .375rem 0 0; padding-left: 1.125rem; }
.ng-pressupostos li { margin: .25rem 0; }
.ng-alerta { margin: 1rem 0 0; padding: .75rem 1rem; border: 1px solid #f3c7c3; border-radius: 12px; background: #fdf3f2; font-size: .875rem; line-height: 1.5; color: #7a1f1a; }

/* ---------------------------------------------------------------- esquemas do artigo (duas versões) */
.ng-esq { margin: 1.75rem 0 0; }
.simulator-content .ng-acoes { margin-bottom: 1.75rem; }
.ng-esq .ng-esq-m { display: none; }
@media (max-width: 560px) {
    .ng-esq .ng-esq-d { display: none; }
    .ng-esq .ng-esq-m { display: block; }
}
.ng-esq svg { display: block; width: 100%; height: auto; }

/* ---------------------------------------------------------------- barra «Descarregar / Partilhar» */
.ng-acoes { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: .75rem; }
.ng-partilhar { display: inline-flex; }
.ng-vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.ng-btn { position: relative; display: inline-flex; align-items: center; gap: .4375rem; height: 36px; padding: 0 .875rem 0 .75rem; border: 1px solid var(--ng-linha, #e8e8ea); border-radius: 999px; background: #fff; color: var(--ng-texto, #26262a); font: inherit; font-size: .8125rem; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color 150ms ease, border-color 150ms ease, transform 150ms var(--ng-ease, ease); }
.ng-btn::after { content: ""; position: absolute; inset: -5px -2px; }
.ng-btn svg { flex: none; color: var(--ng-sec, #6e6e73); transition: color 150ms ease; }
.ng-btn:active { transform: scale(.97); }
.ng-btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.ng-btn[aria-expanded="true"], .ng-btn[aria-expanded="true"] svg { border-color: var(--ng-acao, #5753E2); color: var(--ng-acao, #5753E2); }
.ng-menu { position: absolute; z-index: 1000; container-type: inline-size; top: calc(100% + 8px); left: 0; width: 22.5rem; max-width: 100%; padding: 6px; overflow-y: auto; overscroll-behavior: contain; background: #fff; border: 1px solid var(--ng-linha, #e8e8ea); border-radius: 14px; box-shadow: 0 12px 32px rgba(10,10,10,.12), 0 2px 6px rgba(10,10,10,.06); }
.ng-menu.ng-cima { top: auto; bottom: calc(100% + 8px); }
.ng-menu[hidden] { display: none; }
.ng-redes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.ng-op { display: flex; align-items: center; gap: .6875rem; width: 100%; min-width: 0; min-height: 44px; padding: .375rem .75rem; border: 0; border-radius: 9px; background: none; color: var(--ng-tinta, #0a0a0a); font: inherit; font-size: .9375rem; font-weight: 500; line-height: 1.2; text-align: left; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ng-op > span:not(.ng-vh) { min-width: 0; overflow-wrap: break-word; }
.ng-op svg { flex: none; width: 18px; color: var(--ng-sec, #6e6e73); }
.ng-copiar { position: relative; margin-top: 7px; }
.ng-copiar::before { content: ""; position: absolute; top: -4px; left: .75rem; right: .75rem; border-top: 1px solid var(--ng-linha, #e8e8ea); }
.ng-op:active { background: var(--ng-fundo-suave, #f7f7fa); }
.ng-btn:focus-visible, .ng-op:focus-visible { outline: 2px solid var(--ng-acao, #5753E2); outline-offset: 2px; }
@container (max-width: 17.5rem) { .ng-redes { grid-template-columns: minmax(0, 1fr); } }
@media (hover: hover) and (pointer: fine) {
    .ng-btn:hover, .ng-btn:hover svg { border-color: var(--ng-acao, #5753E2); color: var(--ng-acao, #5753E2); }
    .ng-op:hover { background: var(--ng-fundo-suave, #f7f7fa); color: var(--ng-acao, #5753E2); }
    .ng-op:hover svg { color: var(--ng-acao, #5753E2); }
}
.ng-aviso { position: fixed; z-index: 2147482500; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: .625rem; width: max-content; max-width: calc(100vw - 32px); padding: .75rem 1rem .75rem .875rem; border-radius: 12px; background: #1c1c1f; color: #fff; font-family: inherit; font-size: .9375rem; font-weight: 500; line-height: 1.35; box-shadow: 0 10px 30px rgba(10,10,10,.22); transform: translate(-50%, 8px); opacity: 0; visibility: hidden; transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms; }
.ng-aviso.is-visivel { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: opacity 180ms ease, transform 180ms ease; }
.ng-aviso svg { flex: none; color: #5fd38a; }
.ng-aviso.is-erro svg { color: #ff8a80; }
.ng-aviso-txt { min-width: 0; }
.ng-aviso input { display: block; width: 100%; margin-top: .5rem; padding: .5rem .625rem; border: 1px solid #4a4a50; border-radius: 8px; background: #2a2a2e; color: #fff; font: inherit; font-size: .875rem; }
.ng-aviso button { flex: none; align-self: flex-start; min-width: 44px; min-height: 44px; margin: -.625rem -.625rem -.625rem 0; border: 0; background: none; color: #fff; font: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer; }
html[data-ng-menu] .back-to-top, html[data-ng-menu] .tst-cartao, html[data-ng-menu] .tst-festa { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }
@media (prefers-reduced-motion: reduce) { .ng-btn, .ng-aviso, .ng-aviso.is-visivel, .ng-chev { transition: none; } }
@media print { .ng-acoes, .ng-aviso { display: none !important; } }

/* ---------------------------------------------------------------- acertos com a camada partilhada das páginas */
/* as tabelas largas deslizam por dentro (a regra partilhada .simulator-content div:has(> table) tira o overflow) */
.simulator-content .ng-tabela-wrap:not(#_), .simulator-form .ng-tabela-wrap:not(#_) { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--ng-linha); border-radius: 12px; margin: 1rem 0 0; padding: 0; background: #fff; }
.ng-tabela-wrap:focus-visible { outline: 2px solid var(--ng-acao); outline-offset: 2px; }
.ng-tabela tr > :first-child { text-align: left; white-space: normal; }
.ng-tabela tr > :not(:first-child) { text-align: right; }
/* uma só seta nos grupos (a da direita) */
.ng-grupo > summary::before { display: none !important; content: none !important; }
/* campos sem unidade: borda inteira */
.simulator-form .ng-campo-sem-un { width: 100%; }
@media (pointer: coarse) {
    .ng-btn { min-height: 44px; height: auto; }
}
