:root {
  --fundo: #f4f4f1;
  --superficie: #ffffff;
  --superficie-2: #fafaf8;
  --texto: #1d1d1b;
  --suave: #5f5f59;
  --borda: #e2e2dc;
  --borda-forte: #c6c6bf;
  --trilho: #8a8a83;
  --ligado: #1c7436;
  --ligado-fundo: #e7f3eb;
  --ligado-borda: #9fcbab;
  --erro: #b3261e;
  --erro-fundo: #fbeae8;
  --aviso: #7a5200;
  --aviso-fundo: #fff4d9;
  --aviso-borda: #e8c46b;
  --destaque: #1d1d1b;
  --marcado: #eaeff7;
  --marcado-borda: #2f4a7a;
  --foco: #2f4a7a;
  --sombra: 0 8px 28px rgba(20, 20, 18, .14);
  --raio: 6px;
  --raio-p: 4px;
  --topo-altura: 52px;
  --barra-baixo: 60px;
  /* Sempre claro, mesmo com o celular no modo escuro (pedido do dono em 05/11/2026). */
  color-scheme: light only;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1 { font-size: 17px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 19px; margin: 0; letter-spacing: -.01em; }
h3 { font-size: 15px; margin: 0; }
h4 { font-size: 13px; margin: 0; }
p { margin: 0 0 10px; }
a { color: var(--marcado-borda); }
input, textarea {
  font: inherit;
  font-size: 16px; /* 16 px: o iPhone não dá zoom ao tocar no campo */
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--borda-forte);
  border-radius: var(--raio-p);
  background: var(--superficie);
  color: var(--texto);
  min-width: 0;
}
input[readonly] { background: var(--superficie-2); }
input[type="checkbox"] { min-height: 0; accent-color: var(--destaque); }
:focus-visible { outline: 2px solid var(--foco); outline-offset: 2px; }
.icone { width: 18px; height: 18px; flex: none; }
.so-leitor {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.so-celular { display: none; }

/* ---------- Topo ---------- */
.topo {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topo-altura);
  padding: 4px max(12px, env(safe-area-inset-right)) 4px max(16px, env(safe-area-inset-left));
  background: var(--superficie);
  border-bottom: 1px solid var(--borda);
}
.topo__marca { display: flex; align-items: center; gap: 8px; min-width: 0; }
.marca-icone {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--raio-p);
  background: var(--destaque);
  color: #fff;
  flex: none;
}
.marca-icone .icone { width: 16px; height: 16px; }
.topo__conta { margin-left: auto; }
.selo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--suave);
  white-space: nowrap;
}
.selo__ponto { width: 8px; height: 8px; border-radius: 2px; background: var(--trilho); flex: none; }
.selo--ok { color: var(--ligado); }
.selo--ok .selo__ponto { background: var(--ligado); }
.selo--erro { color: var(--erro); }
.selo--erro .selo__ponto { background: var(--erro); }
.conta-botao {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  max-width: 260px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--raio-p);
  background: none;
  color: var(--texto);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.conta-botao:hover, .conta-botao[aria-expanded="true"] { background: var(--fundo); border-color: var(--borda); }
.conta-botao__nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conta-botao .icone:last-child { width: 14px; height: 14px; color: var(--suave); }

/* Faixas do alto (e-mail a cadastrar, erro da nuvem) */
.faixas { max-width: 1440px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
.faixa { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--raio-p); border: 1px solid transparent; }
.faixa--erro { background: var(--erro-fundo); color: var(--erro); border-color: #f0c4be; }
.faixa--aviso {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  background: var(--aviso-fundo);
  color: var(--aviso);
  border-color: var(--aviso-borda);
}
.faixa--aviso > span { flex: 1 1 220px; }
/* Depois de .faixa (mesmo peso): nas faixas do alto, 12 px acima de cada uma e nada embaixo. */
.faixas > * { margin: 12px 0 0; }

/* ---------- Navegação: barra embaixo no celular, lateral no computador ---------- */
.corpo { max-width: 1440px; margin: 0 auto; }
.conteudo {
  min-width: 0;
  padding: 16px max(16px, env(safe-area-inset-right)) calc(var(--barra-baixo) + 28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.navegacao {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  background: var(--superficie);
  border-top: 1px solid var(--borda);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.nav-item {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--barra-baixo);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--suave);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.nav-item .icone { width: 22px; height: 22px; }
.nav-item[aria-current="page"] { color: var(--texto); font-weight: 600; }
.nav-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22%;
  right: 22%;
  height: 3px;
  background: var(--destaque);
}

@media (min-width: 900px) {
  .corpo { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
  .navegacao {
    position: sticky;
    top: var(--topo-altura);
    align-self: start;
    flex-direction: column;
    gap: 2px;
    height: calc(100vh - var(--topo-altura));
    height: calc(100dvh - var(--topo-altura));
    padding: 16px 10px 16px max(12px, env(safe-area-inset-left));
    border: 0;
    background: none;
  }
  .nav-item {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: var(--raio-p);
    font-size: 14px;
  }
  .nav-item .icone { width: 18px; height: 18px; }
  .nav-item:hover { background: var(--superficie); color: var(--texto); }
  .nav-item[aria-current="page"] { background: var(--superficie); border-color: var(--borda); box-shadow: inset 3px 0 0 var(--destaque); }
  .nav-item[aria-current="page"]::before { display: none; }
  .conteudo { padding: 20px 28px 56px 12px; }
  .faixas { padding-left: 232px; padding-right: 28px; }
}

/* ---------- Botões ---------- */
.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 7px 14px;
  border: 1px solid var(--borda-forte);
  border-radius: var(--raio-p);
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.botao:hover { border-color: var(--texto); }
.botao:disabled { opacity: .5; cursor: default; }
.botao--pequeno { min-height: 34px; padding: 4px 10px; font-size: 13px; }
.botao--icone { padding: 0 10px; }
.botao--forte { background: var(--destaque); color: #fff; border-color: var(--destaque); }
.botao--forte:hover { background: #000; border-color: #000; }
.botao--perigo { background: var(--erro); color: #fff; border-color: var(--erro); }
.botao--perigo:hover { background: #8f1d17; border-color: #8f1d17; }
.botao--perigo-texto { color: var(--erro); }
.botao--largo { width: 100%; min-height: 44px; }
.botao-mais {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--raio-p);
  background: none;
  color: var(--suave);
  cursor: pointer;
}
.botao-mais:hover, .botao-mais[aria-expanded="true"] { background: var(--fundo); border-color: var(--borda); color: var(--texto); }
.botoes { display: flex; flex-wrap: wrap; gap: 8px; }
@media (pointer: coarse) {
  .botao--pequeno { min-height: 40px; }
}

/* ---------- Cabeçalho das seções ---------- */
.cabecalho { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 40px; margin: 0 0 12px; }
.cabecalho h2 { margin-right: auto; }
.cabecalho__acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.contagem { font-weight: 400; color: var(--suave); }
.vazio { color: var(--suave); font-size: 13px; }
.ajuda { color: var(--suave); font-size: 13px; margin: 0 0 12px; }

/* ---------- Aparelhos ---------- */
.ferramentas { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.busca { position: relative; flex: 1 1 auto; max-width: 440px; display: flex; align-items: center; }
.busca > .icone { position: absolute; left: 10px; color: var(--suave); pointer-events: none; }
.busca input { width: 100%; padding-left: 34px; }
.filtro-casas .escolhas { flex-wrap: nowrap; overflow-x: auto; margin: 0 0 10px; padding-bottom: 2px; scrollbar-width: thin; }
.filtro-casas .escolha { flex: none; }
.cenas { display: flex; align-items: center; gap: 6px; overflow-x: auto; margin: 0 0 14px; padding-bottom: 2px; scrollbar-width: thin; }
.cenas__rotulo { flex: none; font-size: 12px; font-weight: 600; color: var(--suave); margin-right: 2px; }
.cena { flex: none; border-color: var(--marcado-borda); color: var(--marcado-borda); font-weight: 600; }
.cena--rodando { background: var(--marcado); }

.casa { margin: 0 0 18px; }
.casa__titulo { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--suave); }
.casa__titulo .icone { width: 16px; height: 16px; }
.grade { display: grid; align-items: start; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.ap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 6px 4px 6px 12px;
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
}
.ap--fora { background: var(--superficie-2); }
.ap__topo { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.ap__texto { flex: 1 1 auto; min-width: 0; }
.ap__nome {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.ap__estado { display: flex; align-items: baseline; gap: 6px; min-width: 0; margin-top: 1px; font-size: 12px; line-height: 1.35; color: var(--suave); }
.ap__estado .ponto { position: relative; top: -1px; }
.ap__estado-texto { min-width: 0; overflow-wrap: anywhere; }
.ap__leituras { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 0 8px 2px 0; font-size: 12px; line-height: 1.35; color: var(--suave); overflow-wrap: anywhere; }
.ap__alerta { color: var(--aviso); }
.ap__aviso { font-size: 12px; color: var(--erro); padding-right: 8px; }
.ponto { width: 8px; height: 8px; border-radius: 2px; flex: none; background: var(--trilho); }
.ponto--online { background: var(--ligado); }
.ponto--offline { background: var(--erro); }
.ap__canais { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 6px; padding: 0 8px 4px 0; }
/* Canal de aparelho com várias saídas: nome em cima, estado e interruptor embaixo. */
.ap__canais .chave {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "nome nome" "estado trilho";
  align-items: center;
  gap: 2px 8px;
  padding: 6px 8px 6px 10px;
}
.ap__canais .chave__nome { grid-area: nome; font-weight: 500; }
.ap__canais .chave__estado { grid-area: estado; min-width: 0; text-align: left; }
.ap__canais .trilho { grid-area: trilho; }

/* Interruptor (canal do aparelho e automação): trilho retangular, cantos de no máximo 4 px. */
.trilho {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex: none;
  border-radius: var(--raio-p);
  background: var(--trilho);
  transition: background-color .15s;
}
.trilho::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: #fff;
  transition: transform .15s;
}
[aria-checked="true"] > .trilho, .chave--ligada > .trilho { background: var(--ligado); }
[aria-checked="true"] > .trilho::after, .chave--ligada > .trilho::after { transform: translateX(16px); }
.chave {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 40px;
  padding: 4px 8px 4px 10px;
  border: 1px solid var(--borda);
  border-radius: var(--raio-p);
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
button.chave:hover { border-color: var(--borda-forte); }
.chave__nome { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chave__estado { min-width: 58px; font-size: 12px; font-weight: 600; color: var(--suave); text-align: right; }
.chave--ligada { background: var(--ligado-fundo); border-color: var(--ligado-borda); }
.chave--ligada .chave__estado { color: var(--ligado); }
.chave--unica { flex: none; padding-left: 8px; }
.chave--so-ver { cursor: default; }
.chave[aria-busy="true"], .interruptor[aria-busy="true"] { cursor: progress; opacity: .7; }

/* ---------- Listas em linhas (automações, pessoas, convites) ---------- */
.grupo { margin: 0 0 18px; }
.grupo__titulo { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--suave); }
.linhas {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
}
.linhas > li + li { border-top: 1px solid var(--borda); }
.auto {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  padding: 6px 4px 6px 8px;
}
.auto__texto { min-width: 0; cursor: pointer; }
.auto__nome { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auto__descricao, .auto__meta { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auto__descricao { color: var(--suave); }
.auto__meta { font-size: 12px; color: var(--suave); }
.auto__problema { font-size: 12px; color: var(--erro); overflow-wrap: anywhere; } /* o problema nunca é cortado */
.auto--desligada .auto__nome { color: var(--suave); font-weight: 500; }
.auto--aberta .auto__nome, .auto--aberta .auto__descricao, .auto--aberta .auto__meta { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.rodando { color: var(--marcado-borda); font-weight: 600; }
.interruptor {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--raio-p);
  background: none;
  cursor: pointer;
}
.interruptor:disabled { cursor: default; opacity: .6; }

.pessoa { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 8px 4px 8px 12px; }
.pessoa--inativa .pessoa__nome, .pessoa--inativa .avatar { opacity: .6; }
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--raio-p);
  background: var(--marcado);
  color: var(--marcado-borda);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}
.avatar--convite { background: var(--aviso-fundo); color: var(--aviso); }
.pessoa__texto { min-width: 0; }
.pessoa__nome { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 600; overflow-wrap: anywhere; }
.pessoa__email { font-size: 13px; overflow-wrap: anywhere; }
.pessoa__email--sem { color: var(--suave); }
.pessoa__meta { font-size: 12px; color: var(--suave); }
.etiqueta {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid var(--borda-forte);
  border-radius: var(--raio-p);
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  color: var(--suave);
}
.etiqueta--alerta { border-color: var(--erro); color: var(--erro); }

/* ---------- Histórico ---------- */
.historico { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); overflow: hidden; }
.tabela-historico { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela-historico th, .tabela-historico td { text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--borda); vertical-align: top; }
.tabela-historico th { font-size: 12px; font-weight: 600; color: var(--suave); background: var(--superficie-2); }
.tabela-historico tr:last-child td { border-bottom: 0; }
.hist-quando { width: 1%; white-space: nowrap; color: var(--suave); font-variant-numeric: tabular-nums; }
.hist-aparelho { font-weight: 600; }
.hist-por { color: var(--suave); font-size: 13px; }
.ev-ligou, .ev-apertou { color: var(--ligado); font-weight: 600; }
.ev-falha, .ev-offline { color: var(--erro); font-weight: 600; }
.ev-nota { display: block; color: var(--suave); font-size: 12px; overflow-wrap: anywhere; }
.filtro-botao { max-width: 260px; }
.filtro-botao__nome { overflow: hidden; text-overflow: ellipsis; }
.filtro-botao .icone:last-child { width: 14px; height: 14px; }

@media (max-width: 699px) {
  .tabela-historico thead { display: none; }
  .tabela-historico, .tabela-historico tbody { display: block; }
  .tabela-historico tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--borda);
  }
  .tabela-historico tr:last-child { border-bottom: 0; }
  .tabela-historico td { display: block; padding: 0; border: 0; }
  .tabela-historico tr::after { content: ""; order: 3; flex-basis: 100%; height: 0; }
  .hist-aparelho { order: 1; flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
  .hist-quando { order: 2; width: auto; font-size: 12px; }
  .hist-oque { order: 4; font-size: 13px; }
  .hist-por { order: 5; font-size: 12px; }
  .hist-por:empty { display: none; }
  .so-celular { display: inline; }
  .ev-nota { display: inline; font-size: 12px; }
  .ev-nota::before { content: " · "; }
}

/* ---------- Ajustes ---------- */
.ajustes { display: grid; gap: 16px; max-width: 880px; }
.bloco { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 14px 16px 16px; scroll-margin-top: calc(var(--topo-altura) + 12px); }
.bloco__cabecalho { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 34px; margin: 0 0 8px; }
.bloco__cabecalho h3 { margin-right: auto; font-size: 16px; }
.bloco__cabecalho h3:focus { outline: none; }
.bloco .linhas { margin: 0 -16px; border: 0; border-top: 1px solid var(--borda); border-radius: 0; background: none; }
.bloco .linhas:last-child { margin-bottom: -16px; }
.bloco .pessoa { padding-left: 16px; }
.bloco h4 { margin: 18px 0 8px; color: var(--suave); }
.dados { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0 0 14px; font-size: 14px; }
.dados dt { color: var(--suave); }
.dados dd { margin: 0; overflow-wrap: anywhere; }
.avisos { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.avisos li { padding: 6px 0; border-top: 1px solid var(--borda); }
.avisos li:first-child { border-top: 0; }
.avisos time { display: block; font-size: 12px; color: var(--suave); }

/* ---------- Menu "⋯" ---------- */
.menu {
  position: fixed;
  z-index: 50;
  min-width: 200px;
  max-width: calc(100vw - 16px);
  overflow-y: auto;
  padding: 4px;
  background: var(--superficie);
  border: 1px solid var(--borda-forte);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
}
.menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px 8px 10px;
  border: 0;
  border-radius: var(--raio-p);
  background: none;
  color: var(--texto);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.menu__item:hover, .menu__item:focus { background: var(--fundo); outline: none; }
.menu__item:focus-visible { outline: 2px solid var(--foco); outline-offset: -2px; }
.menu__item--perigo { color: var(--erro); }
.menu__marca { width: 14px; flex: none; font-weight: 700; color: var(--marcado-borda); }
.menu__item[aria-checked="true"] { font-weight: 600; }
.menu__texto { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu__titulo { padding: 6px 12px 4px; font-size: 12px; color: var(--suave); overflow-wrap: anywhere; }
.menu__separador { height: 1px; margin: 4px 0; background: var(--borda); }

/* ---------- Janela (formulários) ---------- */
.janela {
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  background: var(--superficie);
  color: var(--texto);
  box-shadow: var(--sombra);
}
.janela::backdrop { background: rgba(20, 20, 18, .45); }
.janela__miolo { display: flex; flex-direction: column; max-height: calc(100dvh - 26px); }
.janela__miolo > h2 { margin: 0; padding: 14px 16px 12px; border-bottom: 1px solid var(--borda); font-size: 17px; overflow-wrap: anywhere; }
#janela-corpo { padding: 14px 16px; overflow-y: auto; }
#janela-corpo h3 { margin: 18px 0 8px; }
.janela__miolo > .faixa { margin: 0 16px 10px; }
.janela__botoes {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--borda);
  background: var(--superficie);
}

.campo { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; font-size: 13px; font-weight: 500; color: var(--suave); }
.campo input { color: var(--texto); font-weight: 400; }
.campo__linha { display: flex; gap: 6px; }
.campo__linha > input { flex: 1 1 auto; }
.escolhas { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.escolha {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--borda-forte);
  border-radius: var(--raio-p);
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.escolha:hover { border-color: var(--texto); }
.escolha[aria-pressed="true"] { background: var(--marcado); border-color: var(--marcado-borda); color: var(--marcado-borda); font-weight: 600; }
.escolha:disabled { opacity: .45; cursor: default; }
@media (pointer: coarse) {
  .escolha { min-height: 40px; }
}
.passo {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--borda);
  border-radius: var(--raio-p);
}
.passo__miolo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.passo__miolo input[type="url"] { width: 100%; }
.passo__controles { display: flex; gap: 4px; }
.linha { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.linha input[type="number"] { width: 90px; }
.marcar { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 0; cursor: pointer; }
.marcar input { width: 18px; height: 18px; flex: none; }
.marcar__estado { margin-left: auto; font-size: 12px; color: var(--suave); }
.marcar-lista { border: 1px solid var(--borda); border-radius: var(--raio-p); padding: 2px 10px; }
.resultados { padding-left: 18px; margin: 0; }
.resultado--erro { color: var(--erro); }

/* Link de convite */
.link-campo { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; margin: 0 0 10px; }
.compartilhar { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 0 0 12px; }

/* ---------- Recado (resultado no rodapé, sem travar a tela) ---------- */
.recado {
  position: fixed;
  left: 50%;
  bottom: calc(var(--barra-baixo) + 12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  width: min(560px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  background: var(--superficie);
  color: var(--texto);
  border: 1px solid var(--marcado-borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  font-size: 14px;
}
.recado > span { flex: 1; overflow-wrap: anywhere; }
.recado--erro { border-color: var(--erro); color: var(--erro); }
@media (min-width: 900px) {
  .recado { bottom: 20px; }
}

/* ---------- Páginas de entrar e de convite ---------- */
.pagina-entrar { display: flex; min-height: 100vh; min-height: 100dvh; align-items: center; justify-content: center; padding: 16px; }
.entrar { width: 100%; max-width: 400px; }
.entrar__marca { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 16px; font-size: 17px; font-weight: 700; }
.entrar__cartao { background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); padding: 22px 20px 20px; }
.entrar h1 { font-size: 20px; }
.entrar__sub { color: var(--suave); margin: 4px 0 18px; font-size: 14px; }
.entrar .faixa { margin: 0 0 12px; }
.entrar__rodape { margin: 14px 4px 0; font-size: 13px; color: var(--suave); text-align: center; }

@media (max-width: 599px) {
  .grade { grid-template-columns: 1fr; gap: 6px; }
  .so-largo { display: none; }
  .janela { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .janela__miolo { height: 100%; max-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
  #janela-corpo { flex: 1; }
  .janela__botoes > .botao { flex: 1 1 0; }
}
@media (max-width: 479px) {
  .conta-botao__nome { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .trilho, .trilho::after { transition: none; }
}
