/* Olho Local: direção visual C (colorida, amigável, confiável). Fonte da verdade: docs/design/direcao-c.html.
   Fundo creme, azul confiança como cor da marca, laranja como cor de ação, verde e vermelho saturados para estado,
   cantos muito redondos, menu em pílula escura, ícone colorido em cada cartão. Só fonte do sistema (PWA sem rede). */
:root {
  --fundo: #FFF9F2;
  --fundo-2: #F6EEE4;
  --papel: #FFFFFF;
  --tinta: #1C2140;
  --tinta2: #5E6482;
  --tinta3: #9DA2BA;
  --linha: #EFE6DA;
  --azul: #2F5BEA;
  --azul-f: #E6ECFF;
  --laranja: #FF7A1A;
  --laranja-f: #FFEDE0;
  --verde: #1FAE6F;
  --verde-f: #E0F7EB;
  --vermelho: #E8415A;
  --vermelho-f: #FDE4E8;
  --roxo: #7B5CF5;
  --roxo-f: #EEE9FF;
  --cinza-f: #F0EEF6;
  --raio: 22px;
  --raio-m: 16px;
  --sombra: 0 6px 18px -12px rgba(28, 33, 64, .28);
  --sombra-alta: 0 16px 34px -16px rgba(28, 33, 64, .35);
  --menu-h: 66px;
  --seguro-b: env(safe-area-inset-bottom, 0px);
  --seguro-t: env(safe-area-inset-top, 0px);
  --fonte: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--fundo); color: var(--tinta); }
body {
  font: 600 15px/1.45 var(--fonte); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-width: 320px; overflow-x: hidden;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: .95rem; font-weight: 800; letter-spacing: -.005em; }
h3 { font-weight: 800; }
b, strong { font-weight: 800; }
a { color: var(--azul); font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(47, 91, 234, .35); outline-offset: 2px; }

/* ------------------------------------------------------------------ estrutura */
.app { max-width: 760px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topo {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + var(--seguro-t)) 16px 10px; background: rgba(255, 249, 242, .9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.marca { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--tinta); min-width: 0; }
.marca-logo { width: 30px; height: 30px; flex: none; }
.marca-nome { font-size: 1.12rem; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.marca-nome span { color: var(--laranja); }
.topo-dir { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topo-empresa { color: var(--tinta2); font-size: .8rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--azul-f); color: var(--azul); display: grid; place-items: center;
  font-weight: 800; font-size: .8rem; text-decoration: none; flex: none;
}
.tela { flex: 1; padding: 6px 16px calc(var(--menu-h) + var(--seguro-b) + 34px); outline: none; }
.tela.sem-menu { padding: calc(20px + var(--seguro-t)) 22px 40px; }

/* menu em pílula escura, aba ativa em laranja */
.menu {
  position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(12px + var(--seguro-b)); margin: 0 auto; max-width: 480px;
  height: var(--menu-h); display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 5px;
  background: var(--tinta); border-radius: 999px; box-shadow: 0 18px 36px -14px rgba(28, 33, 64, .55);
}
.menu a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 999px;
  text-decoration: none; color: rgba(255, 255, 255, .58); font-size: .68rem; font-weight: 800; padding: 2px; min-width: 0;
  transition: background .15s, color .15s;
}
.menu a span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.menu a.ativa { background: var(--laranja); color: #fff; }
.menu a:not(.ativa):active { background: rgba(255, 255, 255, .08); }

/* ------------------------------------------------------------------ cabeçalho de tela e blocos */
.cabeca { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; }
.cabeca .sub { margin-top: 3px; }
.sub { color: var(--tinta2); font-size: .86rem; font-weight: 600; }
.pequeno { font-size: .8rem; color: var(--tinta2); font-weight: 600; }
.bloco { margin-top: 22px; }
.bloco:first-child { margin-top: 0; }
.bloco > h2 { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bloco > h2 a { font-size: .8rem; text-decoration: none; }
.linha { display: flex; align-items: center; gap: 10px; }
.linha.espaco { justify-content: space-between; }
.grade { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grade.duas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grade > * { min-width: 0; }

.card { background: var(--papel); border-radius: var(--raio); padding: 16px; box-shadow: var(--sombra); }
.card + .card { margin-top: 10px; }
.grade > .card + .card { margin-top: 0; }

/* ícone colorido em quadradinho (cartões, eventos, regras) */
.ic { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--azul-f); color: var(--azul); }
.ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ic.azul { background: var(--azul-f); color: var(--azul); }
.ic.laranja { background: var(--laranja-f); color: var(--laranja); }
.ic.verde { background: var(--verde-f); color: var(--verde); }
.ic.vermelho { background: var(--vermelho-f); color: var(--vermelho); }
.ic.roxo { background: var(--roxo-f); color: var(--roxo); }
.ic.cinza { background: var(--cinza-f); color: var(--tinta3); }

/* ------------------------------------------------------------------ Ao vivo */
.ola { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.ola h1 { font-size: 1.6rem; }
.ola p { margin-top: 3px; font-size: .84rem; color: var(--tinta2); font-weight: 600; }
.ao-vivo-ponto { display: inline-flex; align-items: center; gap: 6px; }
.ao-vivo-ponto::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 0 rgba(31, 174, 111, .5); animation: pulsa 2s infinite; }
.ao-vivo-ponto.parado::before { background: var(--vermelho); animation: none; }
@keyframes pulsa { 0% { box-shadow: 0 0 0 0 rgba(31, 174, 111, .45); } 70% { box-shadow: 0 0 0 7px rgba(31, 174, 111, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 174, 111, 0); } }

.contadores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.contador { border-radius: 18px; padding: 13px 12px 12px; min-width: 0; }
.contador b { display: block; font-size: 1.75rem; line-height: 1; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.contador b small { font-size: .85rem; opacity: .7; font-weight: 800; letter-spacing: 0; }
.contador span { display: block; font-size: .7rem; margin-top: 7px; font-weight: 800; opacity: .92; line-height: 1.2; }
.contador.a { background: var(--azul); color: #fff; box-shadow: 0 12px 22px -14px rgba(47, 91, 234, .9); }
.contador.b { background: var(--verde-f); color: var(--verde); }
.contador.b.aviso { background: var(--laranja-f); color: #D9600B; }
.contador.c { background: var(--vermelho-f); color: var(--vermelho); }
.contador.c.calmo { background: var(--cinza-f); color: var(--tinta2); }

/* cartão de câmera */
.camera {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--papel); border: 0;
  border-radius: var(--raio); padding: 13px 14px; cursor: pointer; box-shadow: var(--sombra); color: var(--tinta);
  transition: transform .12s, box-shadow .12s;
}
.camera:active { transform: scale(.985); }
@media (hover: hover) { .camera:hover { box-shadow: var(--sombra-alta); } }
.camera .meio { flex: 1; min-width: 0; }
.camera h3 { font-size: .95rem; display: flex; align-items: center; gap: 7px; min-width: 0; }
.camera h3 .nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camera .meta { color: var(--tinta2); font-size: .78rem; margin-top: 2px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camera .meta.ruim { color: var(--vermelho); }
.camera .meta.aviso { color: #E5680F; }
.camera .meta.ok { color: var(--verde); }
.camera .meta.off { color: var(--tinta3); }
.camera .meta + .meta { margin-top: 0; font-weight: 600; color: var(--tinta3); }
.camera .n { flex: none; font-size: 1.4rem; font-weight: 800; letter-spacing: -.03em; text-align: right; line-height: 1; }
.camera .n small { display: block; font-size: .64rem; color: var(--tinta3); font-weight: 800; letter-spacing: 0; margin-top: 3px; }
.camera .n.apagado { color: var(--tinta3); }
.camera .seta { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--tinta3); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* bolinha de sinal */
.sinal { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tinta3); flex: none; }
.sinal.on { background: var(--verde); }
.sinal.off { background: var(--vermelho); }

.selo { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--cinza-f); color: var(--tinta2); white-space: nowrap; }
.selo.ok { background: var(--verde-f); color: var(--verde); }
.selo.ruim { background: var(--vermelho-f); color: var(--vermelho); }
.selo.aviso { background: var(--laranja-f); color: #D9600B; }
.selo.azul { background: var(--azul-f); color: var(--azul); }
.postos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* caixinha (mini PC) */
.caixinha { display: flex; align-items: center; gap: 12px; }
.caixinha .meio { flex: 1; min-width: 0; }
.caixinha b { display: block; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caixinha .pequeno { margin-top: 1px; }

/* ------------------------------------------------------------------ listas de alerta */
.lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.evento { display: flex; gap: 12px; align-items: center; background: var(--papel); border-radius: 18px; padding: 11px 12px; box-shadow: var(--sombra); }
.evento.novo { animation: entra .9s ease-out; }
@keyframes entra { from { background: var(--laranja-f); transform: translateY(-6px); } to { background: var(--papel); transform: none; } }
.evento .ic { width: 40px; height: 40px; border-radius: 13px; }
.evento .ic svg { width: 20px; height: 20px; }
.evento .corpo { min-width: 0; flex: 1; }
.evento .texto { font-weight: 800; font-size: .88rem; overflow-wrap: anywhere; line-height: 1.3; }
.evento .meta { color: var(--tinta2); font-size: .75rem; margin-top: 2px; font-weight: 600; overflow-wrap: anywhere; }
.evento .hora { flex: none; align-self: flex-start; font-size: .74rem; color: var(--tinta3); font-weight: 800; white-space: nowrap; margin-top: 2px; }
.lista .dia { font-size: .76rem; color: var(--tinta3); font-weight: 800; margin: 8px 2px -2px; letter-spacing: .02em; }
.lista .dia:first-child { margin-top: 0; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 16px 4px; margin: 0 -16px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; font-size: .78rem; font-weight: 800; padding: 8px 13px; border-radius: 999px; background: var(--papel); color: var(--tinta2); border: 0; cursor: pointer; box-shadow: 0 2px 8px -6px rgba(28, 33, 64, .35); min-height: 36px; }
.chip.ativa { background: var(--azul); color: #fff; }
.chip-filtros { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }

/* ------------------------------------------------------------------ formulários */
.campo { display: block; margin-top: 14px; }
.campo:first-child { margin-top: 0; }
.campo > span { display: block; font-size: .78rem; color: var(--tinta2); margin-bottom: 6px; font-weight: 800; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: 50px; padding: 11px 14px; border-radius: var(--raio-m); border: 2px solid var(--linha);
  background: var(--papel); color: var(--tinta); outline: none; appearance: none; -webkit-appearance: none; font-weight: 700;
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--tinta3); font-weight: 600; }
input[readonly] { background: var(--fundo); color: var(--tinta2); }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--tinta2) 50%), linear-gradient(135deg, var(--tinta2) 50%, transparent 50%);
  background-position: calc(100% - 21px) 22px, calc(100% - 16px) 22px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 38px;
}
input:focus, select:focus, textarea:focus { border-color: var(--azul); box-shadow: 0 0 0 4px var(--azul-f); }
input.erro, select.erro { border-color: var(--vermelho); }
.msg-erro { color: var(--vermelho); font-size: .82rem; margin-top: 6px; font-weight: 700; }
.dica { color: var(--tinta2); font-size: .8rem; margin-top: 8px; font-weight: 600; line-height: 1.45; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 10px 20px;
  border-radius: var(--raio-m); border: 2px solid var(--linha); background: var(--papel); color: var(--tinta); font-weight: 800;
  cursor: pointer; text-decoration: none; font-size: .95rem; transition: transform .1s, box-shadow .12s, background .12s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primario { background: var(--azul); border-color: var(--azul); color: #fff; box-shadow: 0 10px 20px -10px rgba(47, 91, 234, .75); }
.btn.acao { background: var(--laranja); border-color: var(--laranja); color: #fff; box-shadow: 0 10px 20px -10px rgba(255, 122, 26, .8); }
.btn.perigo { color: var(--vermelho); border-color: var(--vermelho-f); background: var(--vermelho-f); }
.btn.fino { min-height: 40px; padding: 6px 14px; font-size: .86rem; border-radius: 13px; }
.btn.cheio { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }

.interruptor { position: relative; display: inline-block; width: 50px; height: 30px; flex: none; }
.interruptor input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.interruptor i { position: absolute; inset: 0; border-radius: 999px; background: #DCD8E6; transition: background .15s; }
.interruptor i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.interruptor input:checked + i { background: var(--verde); }
.interruptor input:checked + i::after { transform: translateX(20px); }
.interruptor input:focus-visible + i { box-shadow: 0 0 0 4px var(--azul-f); }

/* regras de alerta (Configurações) */
.regra { padding: 12px 14px; }
.regra .cab { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.regra .cab .ic { width: 40px; height: 40px; border-radius: 13px; }
.regra .cab .ic svg { width: 20px; height: 20px; }
.regra .cab .meio { flex: 1; min-width: 0; }
.regra .cab b { display: block; font-size: .9rem; line-height: 1.25; }
.regra .cab small { display: block; color: var(--tinta2); font-size: .76rem; font-weight: 600; margin-top: 2px; }
.regra .params { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 2px dashed var(--linha); }
.regra .params .campo { margin-top: 0; }
.regra .params .largo { grid-column: 1 / -1; }
.regra.apagada .params { display: none; }
.lista-regras > .card + .card { margin-top: 8px; }

.nota { display: flex; gap: 10px; align-items: flex-start; font-size: .8rem; color: var(--tinta2); line-height: 1.45; font-weight: 600; background: var(--azul-f); border-radius: 14px; padding: 11px 13px; margin-top: 10px; }
.nota svg { flex: none; width: 17px; height: 17px; fill: none; stroke: var(--azul); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.nota.verde { background: var(--verde-f); }
.nota.verde svg { stroke: var(--verde); }

/* planos com preço */
.planos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plano { position: relative; display: block; cursor: pointer; }
.plano input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.plano > div {
  position: relative; border: 2px solid var(--linha); background: var(--papel); border-radius: 18px; padding: 13px 12px 12px;
  min-height: 96px; display: flex; flex-direction: column; justify-content: center; transition: border-color .12s, background .12s;
}
.plano b { font-size: 1.7rem; line-height: 1; letter-spacing: -.03em; }
.plano span { font-size: .74rem; color: var(--tinta2); font-weight: 700; margin-top: 2px; }
.plano .preco { margin-top: 8px; font-weight: 800; color: var(--tinta); font-size: .86rem; }
.plano .preco small { font-size: .7rem; color: var(--tinta2); font-weight: 700; }
.plano > div::after {
  content: ""; position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--linha); background: var(--papel);
}
.plano input:checked + div { border-color: var(--azul); background: var(--azul-f); }
.plano input:checked + div::after {
  border-color: var(--azul); background: var(--azul) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.plano input:focus-visible + div { box-shadow: 0 0 0 4px var(--azul-f); }

.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; cursor: pointer; font-size: .88rem; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--azul); }

/* ------------------------------------------------------------------ entrada (login e cadastro) */
.entrada { position: relative; max-width: 420px; margin: 0 auto; isolation: isolate; }
.bolhas { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bolhas i { position: absolute; border-radius: 50%; }
.bolhas i:nth-child(1) { width: 300px; height: 300px; background: var(--azul-f); top: -110px; right: -120px; }
.bolhas i:nth-child(2) { width: 180px; height: 180px; background: var(--laranja-f); top: 170px; left: -100px; }
.bolhas i:nth-child(3) { width: 220px; height: 220px; background: var(--verde-f); bottom: -120px; right: -60px; opacity: .7; }
.entrada .marca-grande { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 38px 0 30px; text-align: center; }
.entrada .marca-grande svg { width: 88px; height: 88px; }
.entrada .marca-grande .marca-nome { font-size: 1.9rem; }
.entrada .marca-grande p { color: var(--tinta2); font-size: .86rem; max-width: 250px; }
.entrada.compacta .marca-grande { flex-direction: row; justify-content: center; margin: 6px 0 20px; gap: 10px; }
.entrada.compacta .marca-grande svg { width: 44px; height: 44px; }
.entrada.compacta .marca-grande .marca-nome { font-size: 1.4rem; }
.entrada h1 { margin-bottom: 4px; }
.entrada .rodape { margin-top: 22px; text-align: center; color: var(--tinta2); font-size: .88rem; }
.entrada .rodape a { text-decoration: none; font-weight: 800; }
.privacidade { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: .8rem; color: var(--verde); margin-top: 16px; font-weight: 800; text-align: center; }
.privacidade svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.passos { display: flex; gap: 6px; margin: 0 0 18px; }
.passos i { flex: 1; height: 5px; border-radius: 99px; background: var(--linha); }
.passos i.feito { background: var(--azul); }

/* ------------------------------------------------------------------ avisos */
.aviso-caixa { display: flex; gap: 12px; align-items: flex-start; border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; background: var(--laranja-f); color: #8A3B05; font-size: .86rem; font-weight: 700; }
.aviso-caixa a { color: inherit; }
.aviso-caixa.info { background: var(--azul-f); color: #1E3FAE; }
.aviso-caixa.ruim { background: var(--vermelho-f); color: #A7192F; }
.avisos { position: fixed; left: 0; right: 0; bottom: calc(var(--menu-h) + var(--seguro-b) + 24px); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 50; pointer-events: none; padding: 0 16px; }
.tela.sem-menu ~ .avisos, .avisos.sem-menu { bottom: calc(20px + var(--seguro-b)); }
.toast { pointer-events: auto; background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 18px; box-shadow: 0 16px 30px -12px rgba(28, 33, 64, .6); max-width: 480px; font-size: .88rem; font-weight: 700; animation: entra-toast .22s ease-out; }
.toast.ok { background: var(--verde); }
.toast.ruim { background: var(--vermelho); }
@keyframes entra-toast { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* alerta chegando (topo da tela, como notificação) */
.alerta-topo { position: fixed; z-index: 55; left: 12px; right: 12px; top: calc(10px + var(--seguro-t)); max-width: 520px; margin: 0 auto; display: flex; gap: 12px; align-items: center; background: var(--vermelho); color: #fff; border: 0; border-radius: 20px; padding: 12px 14px; text-align: left; cursor: pointer; box-shadow: 0 16px 30px -10px rgba(232, 65, 90, .6); animation: desce .5s cubic-bezier(.2, .8, .2, 1); }
.alerta-topo.aviso { background: #F06A0C; box-shadow: 0 16px 30px -10px rgba(255, 122, 26, .6); }
.alerta-topo.roxo { background: var(--roxo); box-shadow: 0 16px 30px -10px rgba(123, 92, 245, .55); }
.alerta-topo .ic { width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, .2); color: #fff; }
.alerta-topo .ic svg { width: 20px; height: 20px; }
.alerta-topo b { display: block; font-size: .88rem; }
.alerta-topo span { display: block; font-size: .76rem; opacity: .88; font-weight: 700; }
.alerta-topo .agora { margin-left: auto; align-self: flex-start; font-size: .72rem; opacity: .85; font-weight: 800; }
@keyframes desce { from { transform: translateY(-24px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

.vazio { text-align: center; padding: 30px 18px; color: var(--tinta2); background: var(--papel); border-radius: var(--raio); border: 2px dashed var(--linha); font-size: .88rem; }
.vazio b { display: block; color: var(--tinta); font-size: 1rem; margin-bottom: 4px; }
.carregando { text-align: center; color: var(--tinta2); padding: 48px 0; font-weight: 700; }
.carregando::before { content: ""; display: block; width: 30px; height: 30px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid var(--azul-f); border-top-color: var(--azul); animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.esqueleto { height: 70px; border-radius: var(--raio); background: linear-gradient(90deg, #F7F0E7 25%, #FFFFFF 50%, #F7F0E7 75%); background-size: 200% 100%; animation: brilho 1.3s infinite; }
.esqueleto + .esqueleto { margin-top: 10px; }
.grade > .esqueleto + .esqueleto { margin-top: 0; }
@keyframes brilho { to { background-position: -200% 0; } }

/* ------------------------------------------------------------------ detalhe da câmera */
.voltar { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--azul); font-weight: 800; padding: 8px 0; cursor: pointer; min-height: 44px; font-size: .9rem; text-decoration: none; }
.voltar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.titulo-camera { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; flex-wrap: wrap; }
.titulo-camera h1 { font-size: 1.45rem; overflow-wrap: anywhere; }
.palco {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--raio); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 12.5%), repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 6.25%), #262C52;
  box-shadow: var(--sombra-alta);
}
.palco img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.palco canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.palco .legenda { position: absolute; left: 10px; right: 10px; bottom: 10px; padding: 8px 12px; font-size: .76rem; font-weight: 700; background: rgba(28, 33, 64, .78); color: #fff; border-radius: 12px; pointer-events: none; display: flex; gap: 8px; align-items: center; }
.palco .legenda svg { flex: none; width: 16px; height: 16px; fill: none; stroke: #7BE3B1; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.posto-linha { background: var(--papel); border-radius: 18px; padding: 12px; box-shadow: var(--sombra); }
.posto-linha + .posto-linha { margin-top: 8px; }
.posto-linha .nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.posto-linha .nums label span { display: block; font-size: .68rem; color: var(--tinta2); margin-bottom: 3px; font-weight: 800; }
.posto-linha .nums input { min-height: 42px; padding: 6px 6px; text-align: center; border-radius: 12px; }
.posto-linha .topo-linha { display: grid; grid-template-columns: 14px 1fr 116px auto; gap: 8px; align-items: center; }
.posto-linha .cor-posto { width: 14px; height: 14px; border-radius: 5px; background: var(--azul); }
.posto-linha .cor-posto.guarita { background: var(--laranja); }
@media (max-width: 420px) {
  .posto-linha .topo-linha { grid-template-columns: 14px 1fr 1fr; }
  .posto-linha .topo-linha .btn { grid-column: 1 / -1; }
}

/* folha (formulário de baixo para cima) */
.fundo { position: fixed; inset: 0; z-index: 60; background: rgba(28, 33, 64, .45); display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.folha { position: relative; width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--fundo); border-radius: 28px 28px 0 0; padding: 26px 18px calc(20px + var(--seguro-b)); animation: sobe .24s ease-out; }
.folha::before { content: ""; position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 42px; height: 5px; border-radius: 99px; background: var(--linha); }
@keyframes sobe { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.folha h2 { font-size: 1.25rem; margin-bottom: 14px; }
@media (min-width: 640px) { .fundo { align-items: center; } .folha { border-radius: 28px; } }
.segmento { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #F1E8DC; border-radius: 16px; padding: 4px; }
.segmento button { min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--tinta2); font-weight: 800; cursor: pointer; }
.segmento button.ativa { background: var(--papel); color: var(--tinta); box-shadow: var(--sombra); }

.token { margin-top: 8px; padding: 12px; border-radius: 14px; background: var(--fundo); border: 2px dashed var(--azul); word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; font-weight: 500; }
.sep { height: 0; border: 0; border-top: 2px dashed var(--linha); margin: 16px 0; }
.mais { display: flex; justify-content: center; margin-top: 14px; }
.rodape-app { text-align: center; margin-top: 24px; font-size: .78rem; color: var(--tinta3); font-weight: 700; }

/* ------------------------------------------------------------------ checkout e plano */
.checkout h1 { margin: 4px 0 0; }
.faixa-demo { display: block; margin: 8px 0 14px; padding: 10px 14px; border-radius: 14px; background: var(--laranja-f); color: #8A3B05; font-size: .84rem; font-weight: 700; }
.faixa-demo::before { content: ""; display: inline-block; vertical-align: middle; margin: -2px 8px 0 0; width: 8px; height: 8px; border-radius: 50%; background: var(--laranja); }
.demo-caixa { margin-top: 16px; padding: 12px 14px; border-radius: 16px; border: 2px dashed #FFC9A1; background: #FFF6EE; font-size: .84rem; color: #8A3B05; }
.resumo { margin-bottom: 16px; background: var(--tinta); color: #fff; }
.resumo .sub { color: rgba(255, 255, 255, .7); }
.resumo .valor { font-size: 1.6rem; font-weight: 800; white-space: nowrap; letter-spacing: -.02em; }
.resumo .valor span { font-size: .78rem; font-weight: 700; opacity: .7; }
.resumo .dica { color: rgba(255, 255, 255, .7); }
.metodos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metodo { position: relative; display: block; cursor: pointer; }
.metodo input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.metodo span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 50px; padding: 8px 6px; font-size: .82rem; font-weight: 800; border: 2px solid var(--linha); background: var(--papel); border-radius: 14px; line-height: 1.2; }
.metodo input:checked + span { border-color: var(--azul); background: var(--azul-f); color: var(--azul); }
.seguro { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; color: var(--tinta2); font-size: .78rem; font-weight: 700; }
.seguro svg { width: 15px; height: 15px; fill: none; stroke: var(--verde); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* faixa do modo de exemplo (?mock=1) */
.faixa-mock { position: fixed; z-index: 99; left: 50%; transform: translateX(-50%); top: calc(3px + var(--seguro-t)); pointer-events: none; background: rgba(28, 33, 64, .08); color: var(--tinta2); font-size: .62rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; letter-spacing: .02em; }

/* ------------------------------------------------------------------ desktop */
@media (min-width: 900px) {
  .app { max-width: 1080px; }
  .topo { padding: 16px 28px; }
  .tela { padding: 8px 28px calc(var(--menu-h) + 48px); }
  .ola h1, .cabeca h1 { font-size: 1.9rem; }
  .contadores { gap: 12px; }
  .contador { padding: 18px 18px 16px; border-radius: 22px; }
  .contador b { font-size: 2.3rem; }
  .contador span { font-size: .8rem; }
  .grade.tres { grid-template-columns: repeat(3, 1fr); }
  .tela-dupla { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .tela-dupla .bloco:first-child { margin-top: 0; }
  .detalhe-camera { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .detalhe-camera > .bloco { margin-top: 0; }
  .entrada { max-width: 440px; margin-top: 4vh; }
  .config-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; align-items: start; }
  .menu { bottom: 20px; }
}
@media (min-width: 640px) and (max-width: 899px) { .grade.tres { grid-template-columns: 1fr 1fr; } }
@media (max-width: 359px) {
  .contador b { font-size: 1.45rem; }
  .contador span { font-size: .64rem; }
  .menu a { font-size: .62rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* barra de uso do plano (Câmeras) */
.uso { height: 8px; border-radius: 99px; background: var(--linha); overflow: hidden; margin: -6px 0 16px; }
.uso i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--azul), #5B7FF0); }
.camera > svg:last-child { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--tinta3); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.caixinha > svg:last-child { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--tinta3); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.config-grade > div > .bloco:first-child { margin-top: 0; }
@media (max-width: 899px) { .config-grade > div + div > .bloco:first-child { margin-top: 22px; } }
.sup-item > svg:last-child { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--tinta3); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 599px) { .topo-empresa { display: none; } }
.caixinha { flex-wrap: wrap; }
.caixinha .meio { min-width: 150px; }
.caixinha > .linha { margin-left: auto; }
.tela-dupla > div > .bloco:first-child { margin-top: 22px; }
@media (min-width: 900px) { .tela-dupla > div > .bloco:first-child { margin-top: 0; } }
