* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
input, textarea, [contenteditable] {
  user-select: text;
  -webkit-user-select: text;
}
:root {
  --red: #df0000;
  --red-dark: #b00000;
  --black: #111;
  --grey-1: #666;
  --grey-2: #999;
  --grey-3: #ddd;
  --grey-4: #f5f5f5;
  --grey-5: #fafafa;
  --white: #fff;
  --font-scale: 1;
}
html[data-theme="dark"] {
  --black: #f0f0f0;
  --grey-1: #b0b0b0;
  --grey-2: #888;
  --grey-3: #3a3a3a;
  --grey-4: #222;
  --grey-5: #1a1a1a;
  --white: #121212;
}
html,
body {
  height: 100%;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--black);
  background: var(--bg-app, #e8e8e8);
}
html[data-theme="dark"] {
  --bg-app: #000;
}
body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
}

.stage {
  display: flex;
  gap: 24px;
  padding: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: center;
}
.phone {
  width: 390px;
  height: 780px;
  background: var(--white);
  border-radius: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #000;
  border-radius: 0 0 18px 18px;
  z-index: 50;
}
.view {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.view.active {
  display: flex;
}
.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px 100px;
  /* Tamanho de fonte (Meu Perfil > Tamanho da fonte): escala só o conteúdo da
     tela, não o frame do app inteiro. Zoom no .phone (frame fixo 390x780)
     fazia o "celular" simulado renderizar maior que a janela do navegador e
     cortar nas bordas — aqui o .content já tem overflow-y:auto, então o extra
     vertical apenas gera scroll, e overflow-x:hidden evita vazar na horizontal. */
  zoom: var(--font-scale);
}

/* Header */
.header {
  padding: 40px 20px 16px;
  border-bottom: 1px solid var(--grey-3);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.header .templo {
  font-size: 12px;
  color: var(--grey-1);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.header .sessao {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}
.header .sessao h1 {
  font-size: 18px;
  font-weight: 700;
}
.header .sessao .badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  background: #e6f5e9;
  color: #1a7a3a;
  font-weight: 600;
}
.header .meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--grey-1);
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--grey-3);
  background: var(--white);
}
.tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-1);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
}
.tab .count {
  display: inline-block;
  background: var(--grey-4);
  color: var(--grey-1);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
}
.tab.active .count {
  background: var(--red);
  color: var(--white);
}

/* Senha card */
.senha {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--grey-3);
  border-radius: 10px;
  margin-bottom: 8px;
  gap: 12px;
  background: var(--white);
  position: relative;
}
.senha.atendido {
  opacity: 0.45;
}
.senha.em-atendimento {
  border-color: var(--red);
  background: color-mix(in srgb, var(--red) 6%, var(--white));
}
.senha .codigo-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 58px;
}
.senha .codigo {
  font-weight: 700;
  font-size: 15px;
  color: var(--black);
  font-family: "SF Mono", Consolas, monospace;
}
.senha .codigo.pref {
  color: var(--red);
}
.senha .info {
  flex: 1;
  min-width: 0;
}
.senha .nome {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.senha .tags {
  font-size: 11px;
  color: var(--grey-1);
  margin-top: 2px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.tag.pref {
  background: var(--red);
  color: white;
}
.tag.clickable {
  cursor: pointer;
  user-select: none;
}
.tag.clickable:hover {
  background: var(--red-dark);
}
.tag.com {
  background: var(--grey-4);
  color: var(--grey-1);
}
.tag.v1 {
  background: #eaf3ff;
  color: #0a5dab;
}
.tag.v2 {
  background: #f2eaff;
  color: #5e2ba8;
}
.tag.done {
  background: #e6f5e9;
  color: #1a7a3a;
}
.tag.wait {
  background: var(--grey-4);
  color: var(--grey-1);
}
.tag.time {
  background: #fff3e0;
  color: #b05500;
  font-family: "SF Mono", Consolas, monospace;
}
.crono {
  font-size: 11px;
  color: var(--grey-1);
  font-family: "SF Mono", Consolas, monospace;
  font-weight: 600;
  margin-left: 2px;
}
.crono.live {
  color: #b05500;
}
.senha .senha-actions {
  display: flex;
  gap: 2px;
}
.senha .eye,
.senha .trash {
  color: var(--grey-2);
  padding: 6px;
  cursor: pointer;
}
.senha .eye:hover {
  color: var(--red);
}
.senha .trash:hover {
  color: var(--red);
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--grey-2);
  font-size: 13px;
}

/* Bottom bar */
.bottombar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px 20px;
  background: linear-gradient(to top, var(--white) 70%, rgba(255, 255, 255, 0));
  display: flex;
  gap: 8px;
}
.bottombar button {
  flex: 1;
}

/* ── Aviso persistente: instalar como app (PWA) ──────────────────────── */
#pwa-install-banner {
  display: none;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
#pwa-install-banner.visible {
  display: flex;
}
#pwa-install-banner .pwa-ico {
  font-size: 20px;
  flex-shrink: 0;
}
#pwa-install-banner .pwa-txt {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
#pwa-install-banner .pwa-txt b {
  display: block;
  font-size: 12.5px;
}
#pwa-install-banner .pwa-txt span {
  display: block;
  font-size: 11px;
  opacity: 0.9;
}
#pwa-install-banner .pwa-btn {
  flex-shrink: 0;
  background: #fff;
  color: var(--red-dark);
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
#pwa-install-banner .pwa-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 2px;
}

/* ── Global Bottom Nav ──────────────────────────────────────────────── */
#app-bottom-nav {
  flex-shrink: 0;
  display: none;
  border-top: 1px solid var(--grey-3);
  background: var(--white);
}
#app-bottom-nav.visible {
  display: flex;
}
.bnav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 500;
  color: var(--grey-1);
  background: none;
  border: none;
  border-radius: 0;
  padding: 8px 4px 12px;
  cursor: pointer;
  transition: color .15s;
  position: relative;
}
.bnav-btn:active { background: var(--grey-4); }
.bnav-btn.active { color: var(--red); }
.bnav-btn svg { width: 22px; height: 22px; stroke: currentColor; }
.bnav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 14px;
  height: 14px;
  line-height: 14px;
  padding: 0 3px;
  text-align: center;
  display: none;
}

/* Buttons */
button {
  font-family: inherit;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-primary {
  background: var(--red);
  color: white;
}
.btn-primary:hover {
  background: var(--red-dark);
}
.btn-primary:disabled {
  background: var(--grey-3);
  color: var(--grey-1);
  cursor: not-allowed;
}
.btn-secondary {
  background: var(--grey-4);
  color: var(--black);
}
.btn-secondary:hover {
  background: var(--grey-3);
}
.btn-ghost {
  background: transparent;
  color: var(--red);
}
.btn-danger {
  background: #b00000;
  color: white;
}

/* Modal */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
#modal-dialogo {
  z-index: 200;
}
.modal-backdrop.active {
  display: flex;
}
.modal {
  background: var(--white);
  width: 100%;
  max-height: 92%;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease-out;
}
@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
@keyframes wppPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0);
  }
}
#wpp-header-dot {
  display: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  align-self: center;
  margin-right: 2px;
  pointer-events: none;
}
#wpp-header-dot.wpp-ok {
  background: #22c55e;
  animation: wppPulse 2s ease-in-out infinite;
}
#wpp-header-dot.wpp-err {
  background: #ef4444;
  animation: none;
}
.modal h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}
.modal h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--grey-1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 20px;
}
.modal label {
  font-size: 12px;
  color: var(--grey-1);
  font-weight: 600;
}
.modal input,
.modal select,
.modal textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--grey-3);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: var(--white);
  color: var(--black);
  margin-top: 4px;
}
.modal input:focus,
.modal select:focus {
  outline: none;
  border-color: var(--red);
}
input,
select,
textarea {
  color: var(--black);
  background: var(--white);
}
input::placeholder,
textarea::placeholder {
  color: var(--grey-2);
}
html[data-theme="dark"] .chip.pref,
html[data-theme="dark"] .tag.pref {
  background: #4a1a1a;
  color: #ffb4b4;
}
html[data-theme="dark"] .senha.em_passe,
html[data-theme="dark"] .senha.em_atendimento {
  background: #2a1515;
}
html[data-theme="dark"] .tag.time {
  background: #3a2508;
  color: #ffd08c;
}
html[data-theme="dark"] .tag.v1 {
  background: #0a2040;
  color: #90c4ff;
}
html[data-theme="dark"] .tag.v2 {
  background: #220a40;
  color: #c4a0ff;
}
html[data-theme="dark"] .tag.done {
  background: #0a2a14;
  color: #7ae09a;
}
html[data-theme="dark"] .tag.com {
  background: #2a2a2a;
  color: var(--grey-1);
}
html[data-theme="dark"] .tag.wait {
  background: #2a2a2a;
  color: var(--grey-1);
}
html[data-theme="dark"] .admin-item {
  background: var(--white);
  border-color: var(--grey-3);
}
html[data-theme="dark"] .config-row {
  background: var(--white);
  border-color: var(--grey-3);
}
html[data-theme="dark"] .senha {
  background: var(--white);
}
html[data-theme="dark"] .role-pill {
  background: var(--grey-4);
  color: var(--grey-1);
}
html[data-theme="dark"] .role-pill.admin {
  background: #4a1a1a;
  color: #ffb4b4;
}
html[data-theme="dark"] select option {
  background: var(--grey-4);
  color: var(--black);
}
html[data-theme="dark"] code {
  background: #2a2a2a;
  color: #e0e0e0;
  padding: 1px 4px;
  border-radius: 3px;
}
html[data-theme="dark"] .approval-card {
  background: #2a2000;
  border-color: #6a4a00;
}
html[data-theme="dark"] .approval-card .who {
  color: #ffcf60;
}
html[data-theme="dark"] .approval-card .reason {
  background: var(--grey-4);
}
html[data-theme="dark"] .dash-pend {
  background: #2a2000;
  border-color: #6a4a00;
  color: #ffcf60;
}
html[data-theme="dark"] .senha.em-atendimento {
  background: #2a1515;
}
html[data-theme="dark"] #consulente-selecionado {
  background: #2a1515;
  border-color: var(--red);
}
html[data-theme="dark"] .avatar-lg .cam {
  background: var(--grey-4);
  border-color: var(--grey-4);
}
html[data-theme="dark"] #aviso-pendencias {
  background: #2a2000 !important;
  border-color: #6a4a00 !important;
  color: #ffcf60 !important;
}
html[data-theme="dark"] .dash-pend .cnt {
  background: #6a4a00;
}
html[data-theme="dark"] .fin-saldo-pos {
  background: #0a2a14;
}
html[data-theme="dark"] .fin-saldo-neg {
  background: #2a0a0a;
}
.field {
  display: flex;
  flex-direction: column;
  margin-top: 15px;
}
/* LGPD badge via ::before */
/* Quatro estados, quatro cores. "Aguardando" (pedido feito, sem resposta) não pode
   dividir a bolinha com "nunca pediram": são filas diferentes — uma espera a
   pessoa, a outra espera a Casa. */
.admin-item[data-lgpd="ok"]::before,
.senha[data-lgpd="ok"]::before,
.admin-item[data-lgpd="no"]::before,
.senha[data-lgpd="no"]::before,
.admin-item[data-lgpd="aguardando"]::before,
.senha[data-lgpd="aguardando"]::before,
.admin-item[data-lgpd="recusado"]::before,
.senha[data-lgpd="recusado"]::before {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  z-index: 1;
}
.admin-item[data-lgpd="ok"]::before,
.senha[data-lgpd="ok"]::before { background: #2E7D32; }
.admin-item[data-lgpd="no"]::before,
.senha[data-lgpd="no"]::before { background: #b00000; }
.admin-item[data-lgpd="aguardando"]::before,
.senha[data-lgpd="aguardando"]::before { background: #e08900; }
.admin-item[data-lgpd="recusado"]::before,
.senha[data-lgpd="recusado"]::before { background: #333; }
/* Event cards */
.ev-card {
  border: 1px solid var(--grey-3);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--white);
}
.ev-card-titulo {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.3;
}
.ev-card-data {
  font-size: 12px;
  color: var(--grey-1);
  margin-top: 2px;
}
.ev-btn-editar {
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0 2px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ev-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.ev-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}
.ev-tag-pub {
  background: #e3f2fd;
  color: #1565c0;
}
.ev-tag-fec {
  background: #ede7f6;
  color: #6a1b9a;
}
.ev-tag-sub {
  background: #e0f2f1;
  color: #00695c;
}
.ev-obs {
  font-size: 12px;
  color: var(--grey-2);
  font-style: italic;
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ev-not-ok {
  font-size: 11px;
  font-weight: 600;
  color: #2e7d32;
}
.ev-not-off {
  font-size: 11px;
  color: var(--grey-3);
}
.ev-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--grey-1);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 14px 0 8px;
}
html[data-theme="dark"] .ev-card {
  background: var(--white);
  border-color: var(--grey-3);
}
html[data-theme="dark"] .ev-tag-pub {
  background: #0a2040;
  color: #90c4ff;
}
html[data-theme="dark"] .ev-tag-fec {
  background: #220a40;
  color: #c4a0ff;
}
html[data-theme="dark"] .ev-tag-sub {
  background: #0a2a20;
  color: #80cfc4;
}
html[data-theme="dark"] .ev-not-ok {
  color: #7ae09a;
}

/* Toggle buttons */
/* Pill switch — segmented control unificado */
.pill-switch,
.toggle-group {
  display: flex;
  background: var(--grey-4);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
  margin-top: 6px;
}
.pill-switch button,
.toggle-group button {
  flex: 1;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-1);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}
.pill-switch button.active,
.toggle-group button.active {
  background: var(--red);
  color: white;
}
html[data-theme="dark"] .pill-switch,
html[data-theme="dark"] .toggle-group {
  background: var(--grey-3);
}
html[data-theme="dark"] .pill-switch button.active,
html[data-theme="dark"] .toggle-group button.active {
  background: var(--red);
  color: white;
}

/* Search result list */
.search-results {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--grey-3);
  border-radius: 8px;
  margin-top: 6px;
}
.search-results.empty {
  display: none;
}
.search-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--grey-3);
  cursor: pointer;
}
.search-item:last-child {
  border: none;
}
.search-item:hover {
  background: var(--grey-4);
}
.search-item .nome {
  font-size: 14px;
  font-weight: 500;
}
.search-item .meta {
  font-size: 12px;
  color: var(--grey-1);
  margin-top: 2px;
}

/* Ficha */
.ficha-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--grey-3);
}
.ficha-row:last-child {
  border: none;
}
.ficha-row .lbl {
  color: var(--grey-1);
  font-size: 12px;
}
.ficha-row .val {
  font-size: 14px;
  font-weight: 500;
  text-align: right;
}
/* Sanfona (accordion) */
.sanfona {
  border: 1px solid var(--grey-3);
  border-radius: 10px;
  margin-top: 10px;
  overflow: hidden;
}
.sanfona-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  cursor: pointer;
  background: var(--grey-5);
  user-select: none;
  gap: 8px;
}
.sanfona-hdr.sanfona-open {
  border-bottom: 1px solid var(--grey-3);
}
.sanfona-titulo {
  font-size: 13px;
  font-weight: 700;
  color: var(--grey-1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sanfona-arrow {
  font-size: 13px;
  color: var(--grey-1);
  display: inline-block;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.sanfona-hdr.sanfona-open .sanfona-arrow {
  transform: rotate(180deg);
}
.sanfona-body {
  display: none;
  padding: 4px 14px 14px;
  background: var(--white);
}
.sanfona-body.sanfona-open {
  display: block;
}
/* Linhas de detalhe no modal de visualização de lançamento */
._ver-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--grey-3);
}
._ver-row:last-child {
  border-bottom: none;
}
._ver-row > span:first-child {
  color: var(--grey-1);
  font-size: 13px;
  flex-shrink: 0;
  margin-right: 12px;
}
._ver-row > span:last-child {
  font-weight: 600;
  color: var(--text);
}
/* Limita histórico, anotações e msgs wpp a ~3 itens com scroll */
#ficha-historico,
#ficha-anotacoes,
#ficha-mensagens {
  max-height: 120px;
  overflow-y: auto;
}
/* Itens do histórico */
.hist-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--grey-3);
  font-size: 13px;
}
.hist-item:last-child {
  border: none;
}
.hist-item .top {
  display: flex;
  justify-content: space-between;
}
.hist-item .gira {
  font-weight: 600;
}
.hist-item .data {
  color: var(--grey-1);
  font-size: 12px;
}
.hist-item .tipo {
  font-size: 12px;
  color: var(--grey-1);
  margin-top: 2px;
}

/* Chamada */
.chamada-box {
  padding: 30px 20px;
  text-align: center;
  background: var(--red);
  color: white;
  border-radius: 14px;
}
.chamada-box .label {
  font-size: 13px;
  opacity: 0.85;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.chamada-box .codigo {
  font-size: 56px;
  font-weight: 800;
  font-family: "SF Mono", Consolas, monospace;
  margin: 12px 0 4px;
  letter-spacing: 2px;
}
.chamada-box .nome {
  font-size: 20px;
  font-weight: 500;
}
.chamada-box .sub {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 8px;
}

/* Fase switch */
.fase-switch {
  padding: 8px;
  background: var(--grey-5);
  border-bottom: 1px solid var(--grey-3);
}
.fase-switch .pill {
  display: flex;
  background: var(--white);
  border: 1px solid var(--grey-3);
  border-radius: 20px;
  overflow: hidden;
}
.fase-switch .pill.pill-full {
  width: 100%;
  border-radius: 10px;
}
.fase-switch .pill button {
  padding: 4px 12px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--grey-1);
  cursor: pointer;
}
.fase-switch .pill.pill-full button {
  flex: 1;
  padding: 8px 0;
  font-size: 14px;
}
.fase-switch .pill button.active {
  background: var(--red);
  color: white;
}

/* Login */
#view-login {
  background: var(--white);
}
.login-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
}
.login-inner img {
  width: 120px;
  height: 120px;
  margin-bottom: 16px;
  border-radius: 10px;
}
.login-inner .templo-nome {
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
  text-align: center;
  margin-bottom: 50px;
}
.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-form form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--grey-3);
  border-radius: 10px;
  font-size: 14px;
}
.login-form .btn-primary {
  width: 100%;
}
.login-form input:focus {
  outline: none;
  border-color: var(--red);
}
.login-pin-input {
  text-align: center;
  font-size: 22px !important;
  font-family: 'SF Mono', Consolas, monospace;
  font-weight: 700;
  letter-spacing: 10px !important;
  padding-left: 20px !important;
}

/* Caption / doc */
.caption {
  max-width: 320px;
  font-size: 13px;
  color: #333;
  line-height: 1.6;
}
.caption h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--red);
}
.caption ul {
  margin-left: 18px;
  margin-top: 8px;
}
.caption li {
  margin-bottom: 4px;
}
.caption code {
  background: var(--grey-4);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 12px;
}

.mini-btn {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid var(--grey-3);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  color: var(--grey-1);
}
.mini-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.passe-btn {
  font-size: 11px;
  padding: 3px 8px;
  background: #e6f5e9;
  color: #1a7a3a;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  margin-left: 6px;
}
.atender-btn {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--red);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  margin-left: 6px;
}

/* Admin */
.admin-header {
  padding: 40px 16px 12px;
  border-bottom: 1px solid var(--grey-3);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
}
.admin-header h1 {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
}
.admin-header .icon-btn {
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--grey-1);
  display: flex;
}
.admin-header .icon-btn:hover {
  color: var(--red);
}
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.admin-card {
  padding: 16px 12px;
  border: 1px solid var(--grey-3);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  background: var(--white);
  transition: all 0.15s;
  position: relative;
}
.admin-card:hover {
  border-color: var(--red);
  transform: translateY(-1px);
}
.admin-card .ico {
  font-size: 22px;
  margin-bottom: 6px;
  color: var(--red);
  display: flex;
  justify-content: center;
}
.admin-card .ttl {
  font-size: 13px;
  font-weight: 600;
}
.admin-card .sub {
  font-size: 11px;
  color: var(--grey-1);
  margin-top: 2px;
}
.admin-card .pin {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--red);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 700;
}
.admin-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--grey-3);
  border-radius: 10px;
  gap: 10px;
  background: var(--white);
  margin-bottom: 5px;
  position: relative;
}
.admin-item .info {
  flex: 1;
  min-width: 0;
}
.admin-item .info .nome {
  font-size: 14px;
  font-weight: 600;
}
.admin-item .info .meta {
  font-size: 12px;
  color: var(--grey-1);
  margin-top: 2px;
}
.admin-item .ord {
  font-size: 11px;
  color: var(--grey-2);
  width: 22px;
  text-align: center;
  font-weight: 700;
}
.admin-item .acts {
  display: flex;
  gap: 4px;
}
.admin-item .acts button {
  padding: 6px 8px;
  font-size: 11px;
  background: transparent;
  color: var(--grey-1);
  border: none;
}
.admin-item .acts button:hover {
  color: var(--red);
}
.admin-section-title {
  font-size: 11px;
  color: var(--grey-1);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 14px 0 6px;
}
/* Pontos cantados: cada linha de trabalho é uma sanfona.
   A lista inteira aberta passava de cem itens e obrigava a rolar muito para
   achar a linha do dia. Fechada, cabe tudo na tela e a contagem no cabeçalho
   diz o que tem dentro sem precisar abrir. */
.linha-sanfona {
  border: 1px solid var(--grey-3);
  border-radius: 12px;
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--white);
}
.linha-sanfona > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--grey-1);
  user-select: none;
}
.linha-sanfona > summary::-webkit-details-marker { display: none; }
.linha-sanfona > summary .conta {
  font-weight: 600;
  color: var(--grey-2);
  letter-spacing: 0;
}
.linha-sanfona > summary .seta {
  margin-left: auto;
  transition: transform .18s ease;
  color: var(--grey-2);
  flex-shrink: 0;
}
.linha-sanfona[open] > summary { border-bottom: 1px solid var(--grey-3); }
.linha-sanfona[open] > summary .seta { transform: rotate(90deg); }
.linha-sanfona .corpo { padding: 8px 10px 10px; }
/* Dentro da sanfona os itens já estão emoldurados pelo bloco. */
.linha-sanfona .corpo .admin-item { margin-bottom: 6px; }
.linha-sanfona .corpo .admin-item:last-child { margin-bottom: 0; }
.chip {
  display: inline-block;
  padding: 0px 8px;
  background: var(--grey-4);
  border-radius: 10px;
  font-size: 9px;
  color: var(--grey-1);
  margin: 2px;
}
.chip.pref {
  background: color-mix(in srgb, var(--red) 6%, var(--white));
  color: var(--red);
  border: 1px solid var(--red);
}
.config-row {
  padding: 12px 14px;
  border: 1px solid var(--grey-3);
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--white);
}
.config-row .lbl {
  font-size: 11px;
  color: var(--grey-1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}
.config-row .val {
  font-size: 14px;
  font-weight: 500;
  margin-top: 4px;
}
.config-row .ed {
  float: right;
  font-size: 11px;
  color: var(--red);
  cursor: pointer;
  font-weight: 600;
}
.approval-card {
  padding: 14px;
  border: 1px solid #f5b400;
  border-radius: 12px;
  background: #fff8e5;
  margin-bottom: 10px;
}
.approval-card .who {
  font-size: 12px;
  color: #7a5400;
  font-weight: 600;
}
.approval-card .nome {
  font-size: 15px;
  font-weight: 700;
  margin-top: 4px;
}
.approval-card .reason {
  font-size: 12px;
  color: var(--grey-1);
  margin: 6px 0;
  padding: 8px;
  background: white;
  border-radius: 6px;
}
.approval-card .acts {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.approval-card .acts button {
  flex: 1;
  padding: 8px;
  font-size: 12px;
}
.role-pill {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--grey-4);
  color: var(--grey-1);
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.role-pill.admin {
  background: var(--red);
  color: white;
}

.pwd-wrap {
  position: relative;
}
.pwd-wrap input {
  padding-right: 38px !important;
}
.pwd-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--grey-1);
  padding: 4px;
  display: flex;
}
.pwd-toggle:hover {
  color: var(--red);
}
.avatar-sm {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
}
.avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-lg .cam {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .sl {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--grey-3);
  border-radius: 22px;
  transition: 0.2s;
}
.switch .sl:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .sl {
  background: #1a7a3a;
}
.switch input:checked + .sl:before {
  transform: translateX(18px);
}

/* Dashboard */
.dash-header {
  padding: 34px 16px 10px;
  background: var(--white);
  border-bottom: 1px solid var(--grey-3);
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-header .saud {
  flex: 1;
  min-width: 0;
}
.dash-header .saud .hi {
  font-size: 12px;
  color: var(--grey-1);
}
.dash-header .saud .nome {
  font-size: 17px;
  font-weight: 700;
  color: var(--black);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-header .saud .tp {
  font-size: 11px;
  color: var(--grey-2);
  margin-top: 1px;
}
.dash-block {
  background: var(--white);
  border: 1px solid var(--grey-3);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}
.dash-block .hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.dash-block .hdr .ttl {
  font-size: 11px;
  color: var(--grey-1);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.dash-block .hdr .act {
  font-size: 11px;
  color: var(--red);
  font-weight: 600;
  cursor: pointer;
}
.dash-mes-nav {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.dash-mes-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--grey-3);
  background: var(--white);
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.dash-mes-btn:active {
  background: var(--grey-4);
}
.dash-sessao {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: white;
}
.dash-sessao .ttl {
  color: rgba(255, 255, 255, 0.75) !important;
}
.dash-sessao .hdr {
  margin-bottom: 2px;
}
.dash-sessao .dash-total {
  color: white;
  text-align: right;
}
.dash-sessao .gira {
  font-size: 18px;
  font-weight: 700;
}
.dash-sessao .sub {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}
.dash-sessao .stats {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}
.dash-sessao .stat {
  flex: 1;
}
.dash-sessao .stat .n {
  font-size: 22px;
  font-weight: 700;
}
.dash-sessao .stat .l {
  font-size: 10px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.dash-sessao .abrir {
  width: 100%;
  background: white;
  color: var(--red);
  font-weight: 700;
  padding: 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 4px;
}
.dash-sessao .entrar {
  width: 100%;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-weight: 600;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
}
.dash-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--grey-4);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.dash-item:last-child {
  border-bottom: none;
}
.dash-item .meta {
  font-size: 11px;
  color: var(--grey-1);
}
.dash-empty {
  font-size: 12px;
  color: var(--grey-1);
  text-align: center;
  padding: 10px;
}
.dash-atalhos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dash-atalho {
  padding: 12px 8px;
  border: 1px solid var(--grey-3);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  color: var(--black);
}
.dash-atalho .ico {
  font-size: 18px;
  margin-bottom: 3px;
  color: var(--red);
}
.dash-atalho:hover {
  border-color: var(--red);
}
.dash-pend {
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff4e5;
  border: 1px solid #f5b400;
  color: #7a5400;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.dash-pend:last-child {
  margin-bottom: 0;
}
.dash-pend .cnt {
  background: #f5b400;
  color: white;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
}
.fin-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
}
.fin-row.total {
  font-weight: 700;
  border-top: 1px solid var(--grey-3);
  padding-top: 8px;
  margin-top: 2px;
}
.fin-row .rec {
  color: #1a7a3a;
}
.fin-row .des {
  color: var(--red);
}

.nav-brand { display: none; }

/* ══════════════════════════════════════════════════════════════════
   DESKTOP LAYOUT  ≥ 801 px
   ══════════════════════════════════════════════════════════════════ */
@media (min-width: 801px) {

  /* ── Remove phone-frame illusion ─────────────────────────────── */
  body { align-items: stretch; }

  .stage {
    width: 100%;
    height: 100vh;
    padding: 0;
    gap: 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  .phone {
    width: 100%;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
    flex-direction: row;
  }

  .notch { display: none; }

  /* ── Banner PWA: fixo na base da área de conteúdo (não invade a sidebar) ── */
  #pwa-install-banner.visible {
    position: fixed;
    left: 220px;
    right: 0;
    bottom: 0;
    z-index: 40;
  }

  /* ── Left sidebar ─────────────────────────────────────────────── */
  #app-bottom-nav {
    order: -1;
    width: 220px;
    min-width: 220px;
    flex-shrink: 0;
    flex-direction: column;
    border-top: none;
    border-right: 1px solid var(--grey-3);
    padding: 0;
    justify-content: flex-start;
    align-items: stretch;
    overflow-y: auto;
  }

  .nav-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 20px 16px 14px;
    border-bottom: 1px solid var(--grey-3);
  }

  .nav-brand-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--red);
  }

  .nav-brand-sub {
    font-size: 10px;
    color: var(--grey-1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
  }

  .bnav-btn {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    padding: 13px 20px;
    gap: 12px;
    font-size: 13px;
    border-radius: 0;
    width: 100%;
  }

  /* Hover só em botões não-ativos */
  .bnav-btn:not(.active):hover { background: var(--grey-4); }

  /* Active: indicador visual com borda esquerda. Fundo = tom claro derivado
     da cor da marca (color-mix com o --white, que flipa no modo escuro). */
  .bnav-btn.active {
    background: color-mix(in srgb, var(--red) 8%, var(--white));
    border-left: 3px solid var(--red);
    padding-left: 17px; /* 20 - 3 para compensar a borda */
  }

  .bnav-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .bnav-badge {
    position: static;
    top: unset;
    right: unset;
    margin-left: auto;
  }

  /* Active view fills remaining width without overflow */
  .view.active { min-width: 0; }

  /* ── Fix header top padding (no notch on desktop) ─────────────── */
  .header       { padding-top: 20px; }
  .admin-header { padding-top: 16px; }
  .dash-header  { padding-top: 16px; }

  /* ── Melhor padding de conteúdo no desktop ────────────────────── */
  .content {
    padding-left: 24px;
    padding-right: 24px;
  }

  /* ── Dashboard: grid de 2 colunas ────────────────────────────── */
  #view-dashboard .content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-content: start;
    padding-bottom: 24px;
  }

  /* Alertas e gira atual: largura total */
  #dash-pendencias-wrap,
  #dash-aniversari-wrap,
  #dash-sessao-wrap {
    grid-column: 1 / -1;
  }

  /* ── Admin: grid de 4 colunas ─────────────────────────────────── */
  .admin-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Dash atalhos: 4 colunas aproveitando espaço */
  .dash-atalhos {
    grid-template-columns: repeat(4, 1fr);
  }

  /* ── Fila (view-home): max-width e painel de chamada ─────────── */
  #view-home .content {
    max-width: 760px;
  }

  /* ── Senha cards: melhor aproveitamento no desktop ────────────── */
  .senha {
    padding: 14px 16px;
  }

  /* ── Modals: centered dialog instead of bottom-sheet ──────────── */
  .modal-backdrop {
    position: fixed;
    align-items: center;
  }

  .modal {
    border-radius: 16px;
    max-width: 560px;
    width: 90%;
    animation: dtFadeIn 0.2s ease-out;
  }

  @keyframes dtFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
  }

  /* ── Login: card on grey background ──────────────────────────── */
  #view-login.active {
    background: var(--grey-4);
    justify-content: center;
    align-items: center;
  }

  .login-inner {
    flex: 0 0 auto;
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    width: 380px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .1);
  }

  /* ── Dark mode: sidebar ───────────────────────────────────────── */
  html[data-theme="dark"] .bnav-btn.active {
    background: #2a1515;
  }
}

@media (max-width: 800px) {
  .stage {
    flex-direction: column;
    padding: 0;
  }
  .phone {
    border-radius: 0;
    box-shadow: none;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
  }
  .notch {
    display: none;
  }
  .caption {
    padding: 20px;
    max-width: 100%;
  }
}

/* ── Módulo Educacional (EAD) ────────────────────────────── */
.ead-video {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.ead-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.ead-progresso-track {
  height: 8px;
  border-radius: 4px;
  background: var(--grey-3);
  overflow: hidden;
}
.ead-progresso-fill {
  height: 100%;
  width: 0%;
  background: var(--grey-2);
  transition: width .3s ease, background .3s ease;
}
.ead-opcao-selecionada {
  border-color: var(--red) !important;
  background: color-mix(in srgb, var(--red) 6%, var(--white));
}

/* ── Trunqueira: slider de nível (arrastar, passos de 5%) ──
   Slider 100% customizado (SEM <input type=range>) — controlado por
   pointerdown/move/up em JS. O <input type=range> nativo tem renderização
   inconsistente entre navegadores/dispositivos (track interno opaco escondia
   as bolinhas, e alargar o input pra alinhar as pontas quebrava o arraste em
   alguns navegadores) — em vez de empilhar hacks de CSS por cima de um
   controle nativo que a gente não controla de verdade, o polegar aqui é só
   uma div posicionada via JS (ver _trunqBindSlider em trunqueira.js).
   Camadas dentro de .trunq-range-wrap (ordem no HTML não importa mais, cada
   uma tem seu próprio z-index): fundo cinza, bolinhas, polegar. */
.trunq-range-wrap {
  position: relative;
  height: 24px;
  margin: 10px 0;
  touch-action: none; /* evita rolar a página ao arrastar no touch */
}
.trunq-range-track-bg {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  border-radius: 3px;
  background: var(--grey-3);
  z-index: 1;
}
.trunq-range-dots {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
}
.trunq-range-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--grey-2);
}
.trunq-range-thumb {
  position: absolute;
  top: 50%;
  left: 10px; /* posição inicial — _trunqPosicionarThumb ajusta via JS */
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  cursor: grab;
  z-index: 3;
}
/* ── Trunqueira: toggle "tem estoque?" ── */
.trunq-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.trunq-toggle input { opacity: 0; width: 0; height: 0; }
.trunq-toggle .track {
  position: absolute;
  inset: 0;
  background: var(--grey-3);
  border-radius: 24px;
  transition: .2s;
  cursor: pointer;
}
.trunq-toggle .track:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.trunq-toggle input:checked + .track { background: #43A047; }
.trunq-toggle input:checked + .track:before { transform: translateX(20px); }
html[data-theme="dark"] .ead-opcao-selecionada {
  background: #2a1515;
}
.ead-ranking-voce {
  border-color: var(--red) !important;
  background: color-mix(in srgb, var(--red) 6%, var(--white));
}
html[data-theme="dark"] .ead-ranking-voce {
  background: #2a1515;
}

/* ── Assinatura ────────────────────────────────────────────────────────────
   Tela de leitura: situação da casa, PIX à mão e os documentos legais.
   Usa os tokens de tema (--white/--black/--grey-*) para acompanhar claro,
   escuro e a cor de marca definida por cada casa. */
.ass-cartao{background:var(--white);border:1px solid var(--grey-3);border-radius:12px;
  padding:18px 18px;margin-bottom:14px}
.ass-selo{display:inline-block;font-size:12px;font-weight:700;letter-spacing:.4px;
  text-transform:uppercase;padding:5px 11px;border-radius:99px;margin-bottom:11px;
  background:var(--grey-4);color:var(--grey-1)}
.ass-ok    .ass-selo{background:rgba(46,125,50,.14);color:#2E7D32}
.ass-aviso .ass-selo{background:rgba(214,140,0,.16);color:#B57200}
.ass-alerta .ass-selo{background:rgba(191,54,12,.14);color:#BF360C}
.ass-ok    {border-left:4px solid #2E7D32}
.ass-aviso {border-left:4px solid #D68C00}
.ass-alerta{border-left:4px solid #BF360C}
.ass-tit{font-size:16px;font-weight:700;color:var(--black);margin-bottom:8px}
.ass-txt{font-size:15px;line-height:1.6;color:var(--grey-1);margin:0}
.ass-txt b{color:var(--black)}
.ass-valor{font-size:24px;font-weight:700;color:var(--black);margin:13px 0 0}
.ass-valor span{font-size:14px;font-weight:400;color:var(--grey-2)}
.ass-recado{margin:13px 0 0;padding:11px 13px;border-radius:8px;background:var(--grey-4);
  font-size:14px;line-height:1.55;color:var(--grey-1)}
/* O código PIX é longo e sem espaços: sem o break-all ele estoura a caixa
   no celular em vez de quebrar em várias linhas. */
.ass-pix{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;
  line-height:1.5;word-break:break-all;background:var(--grey-4);border:1px solid var(--grey-3);
  border-radius:8px;padding:11px 13px;margin:11px 0 13px;max-height:130px;overflow-y:auto;
  color:var(--grey-1);user-select:all}
.ass-cartao .btn{display:inline-block;text-align:center;text-decoration:none}
.ass-legais{display:flex;flex-wrap:wrap;gap:9px 16px;align-items:center;
  margin-top:22px;padding-top:15px;border-top:1px solid var(--grey-3);font-size:13px}
.ass-legais a{color:var(--grey-1)}
.ass-legais .ass-quando{color:var(--grey-2);margin-left:auto}

/* Divisor do painel administrativo: separa os módulos da casa do que trata da
   relação dela com quem fornece o sistema (assinatura, suporte). Ocupa a
   largura toda da grade — sem isso viraria mais um cartão numa das colunas. */
.admin-divisor {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 4px;   /* alinhado com a borda dos cartões */
}
.admin-divisor::before,
.admin-divisor::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--grey-3);
}
.admin-divisor span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--grey-2);
  white-space: nowrap;
}

/* Domínio próprio, dentro da tela de Assinatura */
.ass-passos{margin:14px 0 4px;padding:13px 15px;border-radius:8px;background:var(--grey-4);
  border:1px solid var(--grey-3)}
.ass-passos p{margin:0 0 9px;font-size:14px;line-height:1.55;color:var(--grey-1)}
.ass-passos p:last-child{margin-bottom:0}
.ass-passos b{color:var(--black)}
.ass-campo{width:100%;padding:11px 13px;border:1px solid var(--grey-3);border-radius:8px;
  font-size:15px;margin:13px 0 11px;background:var(--white);color:var(--black)}
.ass-campo:focus{outline:2px solid var(--red);outline-offset:-1px;border-color:transparent}
.ass-bom{background:rgba(46,125,50,.10);border:1px solid rgba(46,125,50,.3);color:#2E7D32;
  border-radius:8px;padding:11px 13px;font-size:14px;line-height:1.5;margin-bottom:11px}
.ass-ruim{background:rgba(191,54,12,.10);border:1px solid rgba(191,54,12,.3);color:#BF360C;
  border-radius:8px;padding:11px 13px;font-size:14px;line-height:1.5;margin-bottom:11px}
.btn-texto{display:block;width:100%;margin-top:9px;background:none;border:none;
  color:var(--grey-1);font-size:13.5px;text-decoration:underline;cursor:pointer;padding:6px}
.btn-texto:hover{color:var(--black)}

/* Exportação e encerramento, na tela de Assinatura */
.ass-botoes{display:flex;flex-wrap:wrap;gap:9px;margin-top:14px}
.ass-botoes .btn{flex:1 1 auto;min-width:150px}
.ass-mini{margin:12px 0 0;font-size:13px;line-height:1.5;color:var(--grey-2)}
/* O botão de encerrar não compete com o resto: quem procura acha, quem não
   procura não esbarra nele por engano. */
#ass-cancel-abrir{margin-top:14px;color:var(--grey-2)}
#ass-cancel-form{margin-top:6px;padding-top:14px;border-top:1px solid var(--grey-3)}
/* O pagamento automático é o caminho que queremos que a casa siga: ganha
   destaque, mas sem alarme — não é aviso de problema. */
.ass-cartao.ass-destaque{border-color:var(--red);box-shadow:0 0 0 1px var(--red) inset}

/* Sanfona da tela de Assinatura. O cabeçalho é um <button> de verdade: teclado
   e leitor de tela precisam alcançá-lo, e ele carrega o aria-expanded. */
.ass-painel{padding:0;overflow:hidden}
.ass-painel .ass-cab{display:flex;align-items:center;justify-content:space-between;
  width:100%;gap:12px;padding:16px 18px;background:none;border:none;cursor:pointer;
  text-align:left;font-family:inherit;border-radius:12px}
.ass-painel .ass-cab .ass-tit{margin:0}
.ass-painel .ass-cab:hover{background:var(--grey-4)}
.ass-painel .ass-cab:focus-visible{outline:2px solid var(--red);outline-offset:-2px}
/* Seta desenhada em CSS: sem dependência de fonte de ícone. */
.ass-seta{flex-shrink:0;width:9px;height:9px;border-right:2px solid var(--grey-2);
  border-bottom:2px solid var(--grey-2);transform:rotate(45deg) translate(-2px,-2px);
  transition:transform .18s ease}
.ass-painel.aberto .ass-seta{transform:rotate(-135deg) translate(-2px,-2px)}
.ass-painel .ass-corpo{display:none;padding:0 18px 18px}
.ass-painel.aberto .ass-corpo{display:block}
@media (prefers-reduced-motion:reduce){ .ass-seta{transition:none} }

/* Paleta de figurinhas na tela de templates. Quatro por linha: a lista passa de
   sessenta itens, e empilhada tomava a tela toda antes de o texto aparecer. */
/* flex-basis 100%: a paleta mora dentro de um contêiner flex-wrap (#tpl-vars).
   Como item flex, ela encolhia para 80px — as miniaturas ainda não carregaram e
   não empurram largura nenhuma. */
.fig-grade{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:10px;
  flex:0 0 100%;width:100%}
.fig-chip{padding:6px;background:var(--grey-4);border:1px solid var(--grey-3);
  border-radius:10px;cursor:pointer;line-height:0;aspect-ratio:1;
  transition:border-color .15s,background .15s}
.fig-chip:hover{border-color:var(--red);background:var(--white)}
.fig-chip:focus-visible{outline:2px solid var(--red);outline-offset:2px}
/* A proporção fica no botão (acima), não na imagem: <img> sem src mede 0x0, e
   um alvo de área zero nunca é considerado visível pelo IntersectionObserver —
   nenhuma miniatura chegava a ser buscada. */
.fig-chip img{width:100%;height:100%;object-fit:contain;
  /* Figurinha com fundo transparente some no cartão claro; o xadrez leve dá
     a ela um fundo sem competir com o desenho. */
  background-image:linear-gradient(45deg,#0000001a 25%,transparent 25%,transparent 75%,#0000001a 75%),
                   linear-gradient(45deg,#0000001a 25%,transparent 25%,transparent 75%,#0000001a 75%);
  background-size:12px 12px;background-position:0 0,6px 6px;border-radius:6px}
/* Cada figurinha é um item com a miniatura e dois controles por cima. */
.fig-item{position:relative}
.fig-item .fig-chip{width:100%}
.fig-acao{position:absolute;top:4px;width:24px;height:24px;padding:0;border-radius:7px;
  border:1px solid var(--grey-3);background:rgba(255,255,255,.94);cursor:pointer;
  font-size:12px;line-height:1;display:flex;align-items:center;justify-content:center;
  /* Escondidos até o toque/mouse chegar: com 29 miniaturas, dois botões em cada
     uma competiriam com a figurinha, que é o que a pessoa veio olhar. */
  opacity:0;transition:opacity .15s}
.fig-guardar,.fig-desmarcar{left:4px}
.fig-excluir{right:4px;color:#b00000}
.fig-item:hover .fig-acao,.fig-item:focus-within .fig-acao{opacity:1}
.fig-acao:hover{border-color:var(--red)}
.fig-acao:focus-visible{outline:2px solid var(--red);outline-offset:1px;opacity:1}
/* Guardada fica sempre visível: é o estado da figurinha, não um controle. */
.fig-item.guardada .fig-desmarcar{opacity:1;background:#FFF7E6;border-color:#E0B44C}
.fig-item.guardada .fig-chip{border-color:#E0B44C}
/* Sem hover (celular), os controles precisam aparecer sozinhos. */
@media (hover:none){ .fig-acao{opacity:1} }
@media (max-width:420px){ .fig-grade{grid-template-columns:repeat(3,1fr)} }

/* ── Tour guiado (tour.js) ─────────────────────────────────────────────────── */
.tour-foco { position: fixed; z-index: 9000; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--red), 0 0 0 9999px rgba(17, 17, 17, .58); transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease; }
.tour-foco.sem-alvo { box-shadow: 0 0 0 9999px rgba(17, 17, 17, .58); }
.tour-balao { position: fixed; z-index: 9001; width: min(340px, calc(100vw - 32px)); background: var(--white); color: var(--black);
  border-radius: 16px; padding: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, .28); }
.tour-balao .t-prog { font-size: 11px; font-weight: 700; color: var(--grey-2); letter-spacing: .5px; text-transform: uppercase; }
.tour-balao h3 { margin: 4px 0 6px; font-size: 16px; }
.tour-balao p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--grey-1); }
.tour-balao .t-espera { margin-top: 10px; font-size: 12.5px; font-weight: 700; color: #1A7A3A; }
.tour-balao .t-acoes { display: flex; gap: 8px; margin-top: 14px; }
.tour-balao .t-acoes button { flex: 1; padding: 10px; border-radius: 10px; border: none; font-weight: 600; font-size: 13px; cursor: pointer; }
.tour-balao .t-sair { display: block; margin: 10px auto 0; background: none; border: none; color: var(--grey-2); font-size: 12px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .tour-foco { transition: none; } }

/* ── Primeiros passos (onboarding.js) ──────────────────────────────────────── */
.onb .onb-conta { font-size: 11px; font-weight: 700; color: var(--red); }
.onb .onb-prog { height: 6px; background: var(--grey-4); border-radius: 99px; overflow: hidden; margin: 2px 0 8px; }
.onb .onb-prog i { display: block; height: 100%; background: var(--red); border-radius: 99px; transition: width .4s ease; }
.onb-item { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--grey-4); }
.onb-item:last-child { border-bottom: none; }
.onb-check { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--grey-3);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
.onb-item.feito .onb-check { background: #1A7A3A; border-color: #1A7A3A; }
.onb-item.proxima .onb-check { border-color: var(--red); }
.onb-txt { flex: 1; min-width: 0; }
.onb-txt b { display: block; font-size: 13.5px; }
.onb-txt span { display: block; font-size: 12px; color: var(--grey-1); line-height: 1.35; }
.onb-item.feito .onb-txt b { color: var(--grey-1); }
.onb-btn { flex: none; border: 1px solid var(--red); background: var(--red); color: #fff; border-radius: 99px;
  padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.onb-btn.onb-btn-leve { background: transparent; color: var(--grey-1); border-color: var(--grey-3); }
.onb-item:not(.proxima):not(.feito) .onb-btn { background: transparent; color: var(--red); }
.onb-opc summary { cursor: pointer; font-size: 11px; font-weight: 700; color: var(--grey-1); text-transform: uppercase; letter-spacing: .5px; padding: 10px 0 4px; }
.onb-rodape { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: 11.5px; color: var(--grey-2); }
.onb-rodape a { color: var(--grey-1); text-decoration: underline; cursor: pointer; }
