:root {
  --vermelho: #CF2030;
  --vermelho-escuro: #A8172A;
  --cinza: #6b6b6b;
  --cinza-claro: #f2f2f2;
  --borda: #dedede;
  --texto: #1f1f1f;
  --fundo: #ffffff;
  --verde: #1f8a4c;
  --raio: 12px;
  --sombra: 0 1px 3px rgba(0, 0, 0, .08), 0 4px 14px rgba(0, 0, 0, .04);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  color: var(--texto); background: var(--cinza-claro); font-size: 16px; line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--vermelho); }
img { max-width: 100%; }

/* topo */
.topo {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--fundo); border-bottom: 1px solid var(--borda);
}
/* o título (com a data da reunião) não encolhe; quem cede espaço é o status */
.topo h1 { font-size: 18px; margin: 0; flex: 1 0 auto; max-width: calc(100% - 48px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topo .logo { height: 26px; }
/* alvo de toque de 44px; as margens negativas mantêm a altura do topo */
.topo .voltar {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: -7px -10px;
  font-size: 30px; line-height: 1; text-decoration: none; color: var(--cinza);
}
.status-salvo { flex: 0 1 auto; min-width: 0; font-size: 13px; color: var(--cinza); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-salvo[data-status="salvo"] { color: var(--verde); }
.status-salvo[data-status="erro"], .status-salvo[data-status="offline"] { color: #b26b00; }

.conteudo { max-width: 760px; margin: 0 auto; padding: 16px; padding-bottom: 120px; }
.cartao { background: var(--fundo); border-radius: var(--raio); box-shadow: var(--sombra); padding: 16px; margin-bottom: 16px; }
.cartao h2 { margin: 0 0 8px; font-size: 18px; }
.cartao.destaque { border: 2px solid var(--vermelho); }
.ajuda { color: var(--cinza); font-size: 14px; margin: 0 0 12px; }
.aviso { background: #fff5e0; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.linha { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.linha input { flex: 1; min-width: 160px; }

/* botões */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer;
  background: var(--vermelho); color: #fff; font: inherit; font-weight: 600; text-decoration: none;
  padding: 12px 18px; border-radius: 10px; min-height: 44px;
}
.botao:active { background: var(--vermelho-escuro); }
.botao:disabled { opacity: .6; cursor: progress; }
.botao.secundario { background: #fff; color: var(--vermelho); border: 1.5px solid var(--vermelho); }
.botao.grande { width: 100%; font-size: 17px; padding: 14px; }
.botao input[type=file] { display: none; }
.link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  background: none; border: 0; color: var(--vermelho); font: inherit; cursor: pointer; padding: 6px 0; text-decoration: underline;
}
.link.perigo { color: #9a1b1b; font-size: 14px; }
.atalhos { display: grid; gap: 10px; }

/* listas */
.lista-reunioes { list-style: none; margin: 0; padding: 0; }
.lista-reunioes li { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--borda); }
.lista-reunioes li > a:first-child { flex: 1; display: flex; flex-direction: column; padding: 12px 0; text-decoration: none; color: inherit; }
.lista-reunioes small, .lista-membros small { color: var(--cinza); }
.mini { font-size: 13px; }
.lista-reunioes .mini { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; margin-right: -12px; }
.lista-membros { padding-left: 24px; margin: 0 0 12px; }
.lista-membros li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--borda); }
.lista-membros li.inativo { opacity: .5; }
.lista-membros li a { flex: 1; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.ordem { display: flex; gap: 4px; }
.ordem button { width: 44px; height: 44px; border: 1px solid var(--borda); background: #fff; border-radius: 8px; font-size: 16px; }

/* seções da reunião */
.secao { background: var(--fundo); border-radius: var(--raio); box-shadow: var(--sombra); margin-bottom: 12px; overflow: hidden; }
.secao summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; font-weight: 600; }
.secao summary::-webkit-details-marker { display: none; }
.secao summary::after { content: '›'; transform: rotate(90deg); color: var(--cinza); font-size: 22px; transition: transform .15s; }
.secao[open] summary::after { transform: rotate(-90deg); }
.titulo-secao { flex: 1; }
.progresso { font-size: 13px; color: var(--cinza); font-weight: 400; }
.progresso.completo { color: var(--verde); }
.progresso.completo::before { content: '✓ '; }
.corpo-secao { padding: 0 16px 16px; }
.acoes-reuniao { display: grid; gap: 12px; margin-top: 20px; }

/* campos */
.campo { display: block; margin: 12px 0; }
.rotulo { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.rotulo small { display: block; font-weight: 400; color: var(--cinza); }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=month], input[type=password], select, textarea {
  width: 100%; font: inherit; padding: 11px 12px; border: 1.5px solid var(--borda); border-radius: 10px; background: #fff; color: var(--texto);
  min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--vermelho); }
textarea { resize: vertical; }
.contador { display: block; text-align: right; color: var(--cinza); }
.contador.excedeu { color: var(--vermelho); font-weight: 600; }
.com-afixo { display: flex; align-items: center; gap: 6px; }
.prefixo, .sufixo { color: var(--cinza); }
.opcoes { display: flex; flex-wrap: wrap; gap: 6px; }
.opcoes button, .chip {
  font: inherit; font-size: 14px; border: 1.5px solid var(--borda); background: #fff; border-radius: 999px; padding: 8px 14px; cursor: pointer; min-height: 40px;
}
.opcoes button.ativo, .chip.ativo { background: var(--vermelho); border-color: var(--vermelho); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.selo { display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; font-size: 12px; padding: 6px 10px; text-align: left; }
.chip.selo img { width: 22px; height: 22px; object-fit: contain; }
.chip.selo.ativo { background: #fdeaec; color: var(--texto); }
.selos-membro { border-top: 1px solid var(--borda); padding: 4px 0; }
.selos-membro summary { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; }
.selos-membro summary::-webkit-details-marker { display: none; }
.selos-membro summary strong { flex: 1; }
.selos-membro summary::after { content: '›'; color: var(--cinza); font-size: 20px; transition: transform .15s; }
.selos-membro[open] summary::after { transform: rotate(90deg); }
.selos-membro .chips { padding: 4px 0 10px; }
.icones-selos { display: inline-flex; flex-wrap: wrap; gap: 3px; justify-content: flex-end; max-width: 55%; }
.icones-selos img { width: 20px; height: 20px; object-fit: contain; }
.icones-selos small { color: var(--cinza); }
.sugestao { margin-top: 6px; font: inherit; font-size: 13px; background: #fdeaec; border: 0; border-radius: 8px; padding: 6px 10px; color: var(--vermelho-escuro); cursor: pointer; }

.liga { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 15px; }
.liga input { position: absolute; opacity: 0; width: 0; height: 0; }
.interruptor { flex: none; width: 46px; height: 28px; border-radius: 999px; background: #c9c9c9; position: relative; transition: background .15s; }
.interruptor::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.liga input:checked + .interruptor { background: var(--vermelho); }
.liga input:checked + .interruptor::after { left: 21px; }

.arquivos { display: grid; gap: 8px; margin-bottom: 8px; }
.arquivo { display: flex; align-items: center; gap: 10px; border: 1px solid var(--borda); border-radius: 10px; padding: 6px; }
.arquivo img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--cinza-claro); }
.icone-arq { font-size: 30px; width: 56px; text-align: center; }
.nome-arq { flex: 1; display: flex; flex-direction: column; font-size: 14px; word-break: break-all; }
.estado-arq { color: var(--cinza); }
.remover { border: 0; background: none; color: #9a1b1b; font: inherit; font-size: 14px; cursor: pointer; padding: 8px; min-width: 44px; min-height: 44px; }

.lista { display: grid; gap: 10px; }
.item-lista { border: 1px solid var(--borda); border-radius: 10px; padding: 4px 12px 8px; }
.cab-item { display: flex; justify-content: space-between; align-items: center; padding-top: 6px; }

/* abas: quebram em linhas para todas ficarem à vista (no celular, sem rolar de lado) */
.abas { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 16px; background: #fff; border-bottom: 1px solid var(--borda); position: sticky; top: 53px; z-index: 9; }
.abas a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; text-decoration: none; color: var(--cinza); padding: 0 12px; border-radius: 999px; font-size: 14px; }
.abas a.ativa { background: var(--vermelho); color: #fff; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
/* muitos avisos no "PPT pronto" (celular pequeno): a caixa rola e o "Baixar" continua alcançável */
.caixa-modal { background: #fff; border-radius: var(--raio); padding: 20px; width: 100%; max-width: 440px; max-height: 100%; overflow-y: auto; display: grid; gap: 12px; }
.caixa-modal h2 { margin: 0; }
progress { width: 100%; height: 12px; accent-color: var(--vermelho); }

/* entrar */
.pagina-entrar { background: #fff; }
.entrar { max-width: 360px; margin: 12vh auto 0; padding: 16px; text-align: center; }
.logo-entrar { width: 140px; }
.entrar h1 { font-weight: 300; color: var(--cinza); margin: 8px 0 24px; }
.entrar h1 strong { color: var(--texto); }
.entrar .campo { text-align: left; }
.erro { color: var(--vermelho); }
.carregando { text-align: center; color: var(--cinza); margin-top: 30vh; }

/* convite */
.convite-previa { width: 100%; border-radius: 10px; box-shadow: var(--sombra); background: #fff; }

@media (min-width: 720px) {
  .atalhos { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  /* abas em duas linhas não ficam presas no topo (ocupariam muito da tela) */
  .abas { position: static; }
  /* status em até duas linhas menores, sem tirar espaço da data no título */
  .status-salvo { font-size: 12px; line-height: 1.2; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
}

/* virada do mês */
.marca-mensal { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #fdecee; color: var(--vermelho-escuro); font-size: 11px; font-weight: 600; vertical-align: middle; }
.ajuda.mensal { background: #fdf6f6; border-left: 3px solid var(--vermelho); padding: 8px 10px; border-radius: 6px; }
.chips.situacao { margin-top: 12px; }
.chips.situacao .chip { cursor: default; }

/* avisos de salvamento e sessão */
.aviso-cartao { background: #fff5e0; border: 1px solid #f1d59a; }
.aviso-cartao p { margin: 0 0 8px; }
.aviso-cartao p:last-child { margin-bottom: 0; }
.aviso ul { margin: 6px 0 0; padding-left: 18px; }
.faixa-sessao { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #1f1f1f; color: #fff; padding: 12px 14px; border-radius: var(--raio); box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.faixa-sessao span { flex: 1 1 200px; font-size: 14px; }
.faixa-sessao .botao { min-height: 44px; }
.lista-herdada { margin: 4px 0 10px; padding-left: 18px; color: var(--cinza); font-size: 14px; }
.rodape { text-align: center; margin: 8px 0 24px; }

/* rodapé discreto e política de privacidade */
.creditos { text-align: center; font-size: 11px; color: var(--cinza); padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); }
.creditos a { color: inherit; }
.politica h2 { font-size: 16px; margin: 20px 0 6px; }
.politica p, .politica li { font-size: 15px; line-height: 1.5; }
.politica ul { padding-left: 20px; }
