/* Protótipo descartável: baixa fidelidade, mobile-first. */
[v-cloak] { display: none; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1e1e1e; background: #f5f5f3; overflow-x: hidden; }
main { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); }
main.painel { padding-bottom: 40vh; }
h1 { font-size: 1.4rem; margin: 8px 0 12px; overflow-wrap: anywhere; }
h1:focus, .toast:focus { outline: none; }
h2 { font-size: 1rem; margin: 20px 0 8px; color: #555; }
p { margin: 8px 0; }
.nota { color: #666; font-size: .9rem; }
.erro { color: #b00020; font-size: .95rem; }
.erro::before { content: "⚠ "; }
.aviso, .toast, .demo { border: 1px solid #999; border-radius: 8px; padding: 10px 12px; background: #fff; }
.toast { border-color: #2b7a3d; }
.toast::before { content: "✓ "; }
.demo { font-size: .85rem; color: #444; margin-bottom: 12px; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.botao { display: block; width: 100%; min-height: 48px; margin: 16px 0 8px; padding: 10px 16px; border: 2px solid #1e1e1e; border-radius: 8px; background: #1e1e1e; color: #fff; font-weight: 600; }
.botao.secundario { background: #fff; color: #1e1e1e; }
.botao:disabled { opacity: .55; }
.link { background: none; border: 0; padding: 10px 0; min-height: 44px; color: #0b57a4; text-decoration: underline; text-align: left; }
:focus-visible { outline: 3px solid #0b57a4; outline-offset: 2px; }

label { display: block; margin: 14px 0 4px; font-weight: 600; }
input:not([type=radio]):not([type=checkbox]), select { width: 100%; min-height: 48px; padding: 8px 12px; border: 1.5px solid #555; border-radius: 8px; background: #fff; }
.campo { display: flex; align-items: center; gap: 8px; }
.campo input { flex: 1; min-width: 0; }
.campo span { width: 1.2em; }

fieldset { border: 0; padding: 0; margin: 14px 0 4px; min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 0; }
.seg legend { width: 100%; }
.seg label { flex: 1 1 0; margin: 0; padding: 12px 6px; text-align: center; border: 1.5px solid #555; background: #fff; font-weight: 500; font-size: .95rem; }
.seg label + label { border-left: 0; }
.seg label.ativo { background: #1e1e1e; color: #fff; }
.seg input { position: absolute; opacity: 0; }
.seg label:focus-within { outline: 3px solid #0b57a4; outline-offset: 2px; }
.opcoes label, .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; padding: 12px; margin: 8px 0; border: 1.5px solid #999; border-radius: 8px; background: #fff; }
.opcoes input, .check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; }
.opcoes select { margin-top: 6px; }

.cartao { border: 1.5px solid #555; border-radius: 10px; padding: 12px 14px; margin: 10px 0; background: #fff; }
.destaque { border-width: 2.5px; }
.rotulo { font-weight: 600; }
.grande { font-size: 2.1rem; font-weight: 700; line-height: 1.2; }
.linhas { margin: 8px 0; }
.linhas > div, .par { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid #ddd; }
.linhas dt { min-width: 0; }
.linhas dd { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.linhas .sub dt { padding-left: 16px; color: #555; }
.linhas .sub dd { font-weight: 400; }
.linhas .link { padding: 0; min-height: 44px; }
.par { border-bottom: 0; }
.como { padding-left: 20px; margin: 6px 0; }
.mesnav { display: flex; align-items: center; justify-content: space-between; margin: 12px 0; }
.mesnav button { min-width: 48px; min-height: 48px; border: 1.5px solid #555; border-radius: 8px; background: #fff; }
.meses, .lista { list-style: none; padding: 0; margin: 0; }
.meses button, .lista button { display: flex; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 10px 12px; margin: 6px 0; border: 1.5px solid #999; border-radius: 8px; background: #fff; text-align: left; }
.meses button.ativo { border-color: #1e1e1e; border-width: 2.5px; }
.lista button { flex-direction: column; gap: 2px; }
.vazio { text-align: center; padding: 24px 0; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; background: #fff; border-top: 1.5px solid #555; padding-bottom: env(safe-area-inset-bottom); }
.nav .marca { display: none; }
.nav button { flex: 1; min-height: 56px; border: 0; background: none; font-size: .9rem; }
.nav button[aria-current] { font-weight: 700; text-decoration: underline; }

@media (min-width: 900px) {
  .nav { top: 0; right: auto; width: 200px; flex-direction: column; border-top: 0; border-right: 1.5px solid #555; padding: 20px 12px; }
  .nav .marca { display: block; font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; }
  .nav button { flex: none; text-align: left; padding: 0 8px; }
  main { max-width: 900px; margin-left: 240px; padding: 28px 32px; }
  main.painel { max-width: 460px; margin: 0 auto; padding-bottom: 60px; }
  .colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
  .meses { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .meses button { flex-direction: column; }
}

.exemplo { border: 1px dashed #777; border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; background: #fff; }
.exemplo label { margin-top: 0; }
[aria-invalid="true"]:not(fieldset) { border-color: #b00020 !important; border-width: 2.5px !important; }

.guia { border: 2px solid #0b57a4; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; background: #eef4fb; }
.guia p { margin: 0 0 4px; }
.guia ol { padding-left: 20px; margin: 6px 0; }
.guia-acoes { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.guia .link { padding: 6px 0; }
.botao.pequeno { width: auto; min-height: 44px; margin: 0; padding: 6px 14px; flex: none; }
.folha .valor { font-weight: 600; overflow-wrap: anywhere; }
.folha .par { padding: 4px 0; }
input[readonly] { background: #eee; }
.impacto { border-left: 5px solid #2b7a3d; padding: 8px 12px; background: #fff; }
.feito { list-style: none; padding: 0; }
.feito li { padding: 5px 0; }
a.link { display: inline-block; }
a.ligacao { text-align: center; text-decoration: none; }
.guia .link:disabled { color: #888; text-decoration: none; cursor: default; }

/* Faixa de orientação curta */
.guia { padding: 6px 10px; }
.guia-linha { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.guia-linha p { margin: 0; text-align: center; font-size: .95rem; flex: 1; }
.guia-linha .link { padding: 8px 0; white-space: nowrap; }
.guia details { font-size: .9rem; }
.guia summary { padding: 8px 0; cursor: pointer; color: #0b57a4; }
.link.secundaria { color: #555; }
input.manual { margin-top: 4px; }
/* Demonstração: mês, cenário e montante principal visíveis sem deslizar no telemóvel */
.historia h1 { font-size: 1.2rem; margin: 4px 0 6px; }
.historia .seg { margin: 6px 0 4px; }
.historia .seg legend { font-size: .9rem; margin-bottom: 2px; }
.historia .seg label { padding: 9px 6px; }
.historia .mesnav { margin: 6px 0; }
.historia .mesnav button { min-height: 44px; }
.historia .demo { font-size: .78rem; padding: 6px 10px; margin-bottom: 6px; line-height: 1.3; }
.historia .cartao.destaque { margin: 6px 0; padding: 8px 14px; }
/* Demonstrações: entrada e etiquetas */
.entrada { max-width: 560px; margin: 0 auto; padding: 24px 16px; }
.escolha { display: block; width: 100%; text-align: left; padding: 16px; margin: 12px 0; border: 2px solid #1e1e1e; border-radius: 10px; background: #fff; }
.escolha strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.etiqueta { font-weight: 400; color: #555; font-size: .9rem; }
.guia-modo { margin: 4px 0; font-size: .95rem; }
@media (min-width: 900px) { main.entrada { margin: 40px auto; } }

.guia-rodape { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.guia-rodape .link { padding: 6px 0; min-height: 40px; }
.guia-sobre { font-size: .9rem; }
.conta .total dt, .conta .total dd { font-weight: 700; font-size: 1.1rem; }
.conta-frase { text-align: center; }

/* ---- Demonstrações: o guia fica fora da aplicação e distingue-se dela */
.guia-painel { background: #fff8e1; border-bottom: 3px solid #b26a00; padding: 6px 12px 4px; }
.guia-titulo { margin: 0 0 2px; font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; color: #7a4a00; font-weight: 700; }
.guia-painel .guia-linha p { font-size: .92rem; }
.guia-painel .link { color: #7a4a00; }
.guia-corpo { display: none; font-size: .9rem; padding-bottom: 8px; }
.guia-corpo.aberta { display: block; }
.guia-corpo h2 { margin: 10px 0 4px; color: #7a4a00; }
.guia-corpo .link { display: block; }
.mostrar-guia { position: fixed; top: 4px; right: 6px; z-index: 20; border: 1.5px solid #b26a00; background: #fff8e1; color: #7a4a00; border-radius: 16px; padding: 2px 12px; min-height: 32px; font-size: .8rem; }
.app-barra { background: #1e1e1e; color: #fff; font-weight: 700; padding: 4px 16px; font-size: .85rem; }
.app-moldura input[readonly] { background: #fff; }
.simulacao { max-width: 560px; margin: 12px auto; padding: 16px; border: 3px dashed #b26a00; background: #fff8e1; }
@media (min-width: 900px) {
  .app-moldura .nav { position: static; width: auto; flex-direction: row; border-right: 0; border-bottom: 1.5px solid #555; padding: 0 12px; }
  .app-moldura .nav button { flex: none; padding: 0 16px; }
  .app-moldura main { margin: 0 auto; max-width: 900px; padding: 20px 28px 40px; }
}
@media (min-width: 1100px) {
  .palco { display: grid; grid-template-columns: 340px minmax(0, 1fr); align-items: start; gap: 24px; max-width: 1320px; margin: 0 auto; padding: 20px; }
  .palco.sem-guia { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
  .guia-painel { position: sticky; top: 20px; border: 3px solid #b26a00; border-radius: 10px; padding: 12px 14px; max-height: calc(100vh - 40px); overflow: auto; }
  .guia-corpo { display: block; }
  .so-telemovel { display: none; }
  .app-moldura { border: 2px solid #1e1e1e; border-radius: 10px; overflow: hidden; min-height: 80vh; background: #f5f5f3; }
  .simulacao { grid-column: 2; margin: 0; }
  .palco.sem-guia .simulacao { grid-column: 1; }
}

.guia-curta { margin: 0; font-size: .85rem; }
.guia-curta .link { display: inline; padding: 0 0 0 4px; min-height: 0; }
@media (min-width: 1100px) { .guia-curta { display: none; } .guia-painel .guia-curta:first-of-type { display: none; } }

/* Barra da demonstração: sempre visível, com os controlos e os avisos de simulação */
.demo-barra { background: #7a4a00; color: #fff; padding: 4px 12px; font-size: .8rem; }
.demo-barra p { margin: 0; }
.demo-barra-titulo { font-weight: 700; letter-spacing: .03em; text-transform: uppercase; font-size: .7rem; }
.demo-barra-nota { font-weight: 600; }
.demo-barra-acoes { display: flex; flex-wrap: wrap; gap: 0 16px; align-items: center; }
.demo-barra .link { color: #fff; padding: 4px 0; min-height: 36px; font-size: .82rem; }
.guia-cabecalho { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.guia-cabecalho .link { padding: 2px 0; min-height: 32px; font-size: .85rem; }
@media (min-width: 1100px) {
  .demo-barra { grid-column: 1 / -1; border-radius: 8px; padding: 6px 14px; display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; }
  .guia-curta { display: none; }
}

/* A barra da demonstração fica visível ao deslizar; os campos focados não ficam por baixo dela */
.demo-barra { position: sticky; top: 0; z-index: 30; }
.historia input, .historia select, .historia h1, .historia .botao { scroll-margin-top: 110px; }
.guia-falta { margin: 0; }
.guia-falta .link { padding: 4px 0; min-height: 40px; font-weight: 700; }
@media (min-width: 1100px) { .guia-painel { top: 76px; max-height: calc(100vh - 96px); } }
