/* EasySwipe — segue o design "EasySwipe Design" (Claude Design): tokens, componentes e animação. */

:root {
  --es-bg: #F3F5F5;
  --es-surface: #FFFFFF;
  --es-surface-2: #EDF1F1;
  --es-ink: #14262F;
  --es-muted: #55636B;
  --es-line: #DDE3E3;
  --es-brand: #004165;
  --es-panel: #004165;
  --es-btn: #004165;
  --es-on-btn: #FFFFFF;
  --es-btn-press: #00304B;
  --es-maroon: #772432;
  --es-maroon-ink: #772432;
  --es-yellow: #F2DF74;
  --es-on-yellow: #3A300A;
  --es-green: #1E7B4F;
  --es-green-ink: #1A6B45;
  --es-gray: #A9B2B1;
  --es-gray-ink: #4A5557;
  --es-nav-bg: #FFFFFF;
  --es-overlay: rgba(0, 26, 41, .55);
  --es-info: #004165;
  --es-ok-soft: rgba(30, 123, 79, .1);

  --es-font-serif: 'Source Serif 4', Georgia, serif;
  --es-font-sans: 'Source Sans 3', system-ui, -apple-system, sans-serif;

  --es-radius-sm: 10px; --es-radius-md: 14px; --es-radius-lg: 18px;
  --es-radius-card: 28px; --es-radius-pill: 999px;
  --es-shadow-card: 0 18px 40px -18px rgba(0,40,64,.38), 0 2px 6px rgba(0,40,64,.08);
  --es-shadow-soft: 0 1px 3px rgba(0,40,64,.08);
  --es-shadow-btn: 0 12px 24px -12px rgba(0,40,64,.4);
  --es-ease-out: cubic-bezier(.2,.8,.2,1);
  --es-ease-in: cubic-bezier(.4,0,1,1);
  --es-ease-spring: cubic-bezier(.34,1.56,.64,1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --es-bg: #002236;
    --es-surface: #003652;
    --es-surface-2: #0A4463;
    --es-ink: #F2F5F6;
    --es-muted: #B4C3CC;
    --es-line: #1B506E;
    --es-brand: #A8D6F0;
    --es-panel: #004B73;
    --es-btn: #F2F5F6;
    --es-on-btn: #004165;
    --es-btn-press: #D2DCE2;
    --es-maroon-ink: #F2AFBA;
    --es-green: #23875A;
    --es-green-ink: #74D9A4;
    --es-gray-ink: #C7D0D2;
    --es-nav-bg: #002C45;
    --es-overlay: rgba(0, 12, 20, .72);
    --es-info: #0B557E;
    --es-ok-soft: rgba(116, 217, 164, .14);
    --es-shadow-card: 0 18px 40px -16px rgba(0,0,0,.65);
    --es-shadow-soft: 0 1px 2px rgba(0,0,0,.3);
    --es-shadow-btn: 0 12px 24px -12px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--es-bg); color: var(--es-ink);
  font: 400 17px/1.45 var(--es-font-sans);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--es-yellow); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Material Symbols */
.ms {
  font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal;
  line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap;
  direction: ltr; -webkit-font-smoothing: antialiased; font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 0, 'wght' 400;
}
.ms.cheio, .cheio .ms { font-variation-settings: 'FILL' 1, 'wght' 400; }

/* ---------- Estrutura ---------- */
#app {
  position: relative; max-width: 480px; margin: 0 auto;
  min-height: 100dvh; display: flex; flex-direction: column;
}
.ecra {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
  padding: calc(env(safe-area-inset-top) + 12px) 20px 20px;
}
body[data-nav] .ecra { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

.titulo-grande { margin: 0; font: 600 42px/1.05 var(--es-font-serif); }
.titulo { margin: 0; font: 600 32px/1.1 var(--es-font-serif); }
.titulo-medio { margin: 0; font: 600 28px/1.15 var(--es-font-serif); text-wrap: balance; }
.sub { margin: 0; font-size: 16px; color: var(--es-muted); }
.cabeca { display: flex; flex-direction: column; gap: 6px; }
.cabeca-ecra { padding: 0 0 12px; }
.espaco { flex: 1; }
.vazio-texto { color: var(--es-muted); text-align: center; padding: 1.5rem 0; }

/* Marca */
.marca { display: flex; align-items: center; gap: 12px; }
.marca-tile {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  background: var(--es-btn); color: var(--es-on-btn);
  display: grid; place-items: center; font: 700 22px var(--es-font-serif);
}
.marca-texto { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.marca-nome { font: 700 20px var(--es-font-serif); letter-spacing: .14em; color: var(--es-brand); }
.marca-sub { font-size: 13px; color: var(--es-muted); }

/* ---------- Botões ---------- */
.btn {
  min-height: 48px; padding: 0 20px; border-radius: var(--es-radius-md);
  border: none; font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 120ms ease-out, background-color 120ms ease-out;
}
.btn:active { transform: scale(.98); }
.btn .ms { font-size: 20px; }
.btn-principal { background: var(--es-btn); color: var(--es-on-btn); }
.btn-principal:active { background: var(--es-btn-press); }
.btn-principal:disabled { background: var(--es-surface-2); color: var(--es-muted); cursor: not-allowed; transform: none; }
.btn-secundario { background: var(--es-surface); color: var(--es-brand); border: 1.5px solid var(--es-line); }
.btn-contorno { background: transparent; color: var(--es-brand); border: 1.5px solid var(--es-line); }
.btn-contorno:active, .btn-secundario:active { background: var(--es-surface-2); }
.btn-perigo { background: var(--es-maroon); color: #FFFFFF; }
.btn-perigo-contorno { background: transparent; color: var(--es-maroon-ink); border: 1.5px solid var(--es-line); }
.btn-grande { height: 56px; border-radius: var(--es-radius-lg); font-size: 17px; }
.btn-flex { flex: 1; }
.btn-branco { height: 56px; border-radius: 18px; background: #FFFFFF; color: #004165; font-size: 17px; }
.btn-fantasma { background: transparent; color: #FFFFFF; border: 1.5px solid rgba(255,255,255,.55); }
.btn.a-carregar::before {
  content: ''; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-top-color: transparent; opacity: .8;
  animation: es-spin 800ms linear infinite;
}
.btn-icone {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  border: 1.5px solid var(--es-line); background: transparent; color: var(--es-brand);
  display: grid; place-items: center; font-size: 22px;
}
.ligacao {
  align-self: center; min-height: 44px; padding: 0 16px; border: none; background: none;
  color: var(--es-muted); font-weight: 600; font-size: 15px;
  text-decoration: underline; text-underline-offset: 3px;
}

/* Campos */
.campo {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--es-radius-md);
  border: 1.5px solid var(--es-line); background: var(--es-surface); color: var(--es-ink); font-size: 16px;
}
.campo:focus { outline: none; border-color: var(--es-brand); }
select.campo { padding-right: 8px; }
.linha { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.linha .campo { flex: 1; min-width: 0; }
.rotulo { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; color: var(--es-muted); }

/* ---------- 1. Entrada ---------- */
#ecra-entrada { gap: 20px; padding-top: calc(env(safe-area-inset-top) + 20px); }
#ecra-entrada .cabeca { margin-top: 8px; gap: 8px; }
#ecra-entrada .sub { font-size: 17px; }
.lista-nomes {
  list-style: none; margin: 0; padding: 0; flex: 1;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start;
}
.nome {
  width: 100%; height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  border-radius: 16px; border: 1px solid var(--es-line); background: var(--es-surface); color: var(--es-ink);
  font-weight: 600; font-size: 16px; text-align: left; line-height: 1.15;
  transition: transform 120ms ease-out, background-color 120ms;
}
.nome:active { transform: scale(.97); background: var(--es-surface-2); }
.nome[aria-pressed="true"] { border-color: var(--es-brand); box-shadow: inset 0 0 0 1.5px var(--es-brand); }
.iniciais {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: var(--es-surface-2); color: var(--es-brand);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}

/* ---------- 1b. PIN ---------- */
#ecra-pin { gap: 24px; padding-bottom: 32px; }
.btn-redondo-voltar {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--es-surface-2); color: var(--es-ink); display: grid; place-items: center; font-size: 24px;
}
.form-pin { flex: 1; display: flex; flex-direction: column; gap: 24px; }
.campo-pin {
  height: 76px; border-radius: var(--es-radius-lg); border: 2px solid var(--es-line);
  background: var(--es-surface); color: var(--es-ink); text-align: center;
  font: 700 34px var(--es-font-sans); letter-spacing: .6em; padding-left: .6em; width: 100%;
}
.campo-pin:focus { outline: none; border-color: var(--es-brand); }

/* ---------- 2. Swipe ---------- */
#ecra-swipe { padding-left: 0; padding-right: 0; padding-top: env(safe-area-inset-top); }
.barra-swipe { height: 60px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.barra-swipe .marca-nome { font-size: 19px; }
.barra-dir { display: flex; align-items: center; gap: 8px; }
.pastilha {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: var(--es-radius-pill); background: var(--es-surface-2); color: var(--es-ink);
  font-size: 14px; font-weight: 700; white-space: nowrap;
}
.pastilha .ms { font-size: 17px; color: var(--es-brand); }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; border: none; flex: none;
  background: var(--es-maroon); color: #FFFFFF; font-weight: 700; font-size: 14px;
}
.faixa-offline {
  margin: 0 20px 6px; padding: 10px 14px; border-radius: var(--es-radius-md); background: var(--es-surface-2);
  display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600;
}
.faixa-offline .ms { font-size: 22px; color: var(--es-maroon-ink); }
.faixa-texto { flex: 1; line-height: 1.3; }
.fila-texto { font-size: 13px; font-weight: 700; color: var(--es-muted); white-space: nowrap; }

.pilha { position: relative; flex: 1; min-height: 360px; max-height: 600px; margin: 6px 20px 14px; }

/* Cartão de função */
.cartao {
  position: absolute; inset: 0; border-radius: var(--es-radius-card);
  background: var(--es-surface); box-shadow: var(--es-shadow-card);
  overflow: hidden; display: flex; flex-direction: column;
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.cartao[data-pos="0"] { z-index: 2; cursor: grab; }
.cartao[data-pos="0"].a-arrastar { cursor: grabbing; }
.cartao[data-pos="1"] {
  z-index: 1; transform-origin: 50% 100%;
  transform: translateY(14px) scale(.94);
  transition: transform 320ms var(--es-ease-out), opacity 200ms ease-out;
}
.cartao-painel {
  position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden;
  background: var(--es-panel) center / cover no-repeat;
  display: grid; place-items: center;
}
.anel { position: absolute; width: 280px; height: 280px; border-radius: 50%; border: 1px solid rgba(242,223,116,.25); }
.disco { position: absolute; width: 190px; height: 190px; border-radius: 50%; background: rgba(255,255,255,.07); }
.cartao-icone { position: relative; font-size: 108px; color: var(--es-yellow); font-variation-settings: 'FILL' 1, 'wght' 500; }
.cartao-icone.emoji { font-family: inherit; }
.cartao-painel.com-imagem .anel, .cartao-painel.com-imagem .disco, .cartao-painel.com-imagem .cartao-icone { display: none; }
.cartao-data {
  position: absolute; top: 16px; left: 16px; display: flex; flex-direction: column; align-items: center;
  padding: 8px 12px; border-radius: 14px; background: rgba(255,255,255,.14); color: #FFFFFF;
  backdrop-filter: blur(4px);
}
.cartao-data b { font: 700 24px/1 var(--es-font-serif); }
.cartao-data span { font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.cartao-selos { position: absolute; top: 16px; right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.selo {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: var(--es-radius-pill);
  font-size: 13px; font-weight: 700;
}
.selo .ms { font-size: 16px; font-variation-settings: 'FILL' 1; }
.selo-nunca { background: var(--es-maroon); color: #FFFFFF; }
.carimbo {
  position: absolute; padding: 6px 14px; border-radius: 12px; border: 3px solid rgba(255,255,255,.9);
  font-weight: 800; font-size: 34px; letter-spacing: .06em; line-height: 1.1;
  box-shadow: 0 6px 16px rgba(0,0,0,.25); opacity: 0; pointer-events: none; white-space: nowrap;
}
.carimbo-quero { top: 86px; left: 18px; transform: rotate(-14deg); background: var(--es-green); color: #FFFFFF; }
.carimbo-passo { top: 86px; right: 18px; transform: rotate(14deg); background: var(--es-gray); color: #0B2A3A; }
.cartao-corpo { padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 6px; }
.sobre-linha { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--es-muted); }
.cartao-nome { margin: 0; font: 600 30px/1.1 var(--es-font-serif); color: var(--es-brand); text-wrap: balance; }
.cartao-desc { margin: 0; font-size: 16px; line-height: 1.4; color: var(--es-muted); text-wrap: pretty; }
.cartao-prep {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--es-line);
  font-size: 14px; font-weight: 600; color: var(--es-muted);
}
.prep-valor { display: flex; align-items: center; gap: 10px; }
.prep-valor b { color: var(--es-ink); }
.barras { display: flex; gap: 3px; }
.barras i { width: 18px; height: 8px; border-radius: 3px; background: var(--es-line); }
.barras i.on { background: var(--es-brand); }

/* Esqueleto */
.esqueleto { z-index: 3; }
.brilho {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--es-surface-2) 0, var(--es-bg) 50%, var(--es-surface-2) 100%);
  background-size: 840px 100%; animation: es-shimmer 1.4s linear infinite;
}
.brilho-painel { flex: 0 0 58%; border-radius: 0; }
.esqueleto .cartao-corpo { gap: 12px; padding-top: 20px; }

/* Pilha vazia */
.pilha-vazia {
  position: absolute; inset: 0; border-radius: var(--es-radius-card); border: 2px dashed var(--es-line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 32px; text-align: center;
}
.pilha-vazia .sub { font-size: 17px; }
.pilha-vazia .btn { margin-top: 8px; }
.circulo-icone {
  width: 96px; height: 96px; border-radius: 50%; background: var(--es-surface-2); color: var(--es-brand);
  display: grid; place-items: center; font-size: 48px;
}

/* Botões de ação redondos */
.acoes { flex: none; display: flex; justify-content: center; align-items: flex-start; gap: 56px; padding: 14px 0 8px; }
.acao-col { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--es-muted); }
.acao {
  width: 64px; height: 64px; border-radius: 50%; border: none;
  display: grid; place-items: center; font-size: 34px; box-shadow: var(--es-shadow-btn);
  font-variation-settings: 'FILL' 1; transition: transform 120ms ease-out;
}
.acao:active { transform: scale(.92); }
.acao.realce { transform: scale(1.08); }
.acao-passo { background: var(--es-surface); color: var(--es-gray-ink); border: 1px solid var(--es-line); }
.acao-quero { background: var(--es-green); color: #FFFFFF; }
.acao:disabled { background: var(--es-surface-2); color: var(--es-muted); box-shadow: none; border: none; opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- 5. As minhas ---------- */
.rolavel { flex: 1; display: flex; flex-direction: column; gap: 22px; padding-bottom: 8px; }
.grupo { display: flex; flex-direction: column; gap: 10px; }
.grupo-cabeca { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.grupo-cabeca b { font: 700 20px var(--es-font-serif); color: var(--es-brand); }
.grupo-cabeca span { font-size: 14px; color: var(--es-muted); }
.reserva {
  padding: 14px; border-radius: var(--es-radius-lg); background: var(--es-surface); box-shadow: var(--es-shadow-soft);
  border: 1.5px solid transparent; transition: border-color 150ms;
}
.reserva.a-confirmar { border-color: var(--es-maroon-ink); }
.reserva-linha { display: flex; align-items: center; gap: 12px; }
.tile {
  width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--es-panel); color: var(--es-yellow);
  display: grid; place-items: center; font-size: 24px; font-variation-settings: 'FILL' 1;
}
.tile.emoji { font-family: inherit; }
.reserva-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.reserva-info b { font-size: 17px; line-height: 1.2; }
.reserva-info .sub { font-size: 14px; }
.pastilha-sup {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: var(--es-radius-pill); background: var(--es-surface-2); color: var(--es-brand); font-size: 12px; font-weight: 700;
}
.pastilha-sup .ms { font-size: 14px; }
.btn-desistir {
  height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--es-line);
  background: transparent; color: var(--es-maroon-ink); font-weight: 700; font-size: 15px;
}
.btn-desistir:active { background: var(--es-surface-2); }
.confirmacao { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--es-line); }
.confirmacao p { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; }
.confirmacao .linha { margin: 0; flex-wrap: nowrap; }
.confirmacao .btn { flex: 1; }
.vazio-caixa { padding: 40px 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }

/* ---------- 6. Agenda ---------- */
#ecra-agenda { padding-left: 0; padding-right: 0; }
.ag-lateral { display: none; }
.ag-principal { display: flex; flex-direction: column; min-width: 0; }
.ag-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 0 20px; }
.ag-topo-acoes { display: flex; gap: 8px; align-items: center; }
.so-desktop { display: none !important; }
.segmentos { display: flex; gap: 6px; padding: 14px 20px 0; }
.segmento {
  height: 36px; padding: 0 14px; border-radius: var(--es-radius-pill); border: none;
  background: transparent; color: var(--es-muted); font-weight: 700; font-size: 14px;
}
.segmento[aria-selected="true"] { background: var(--es-surface-2); color: var(--es-brand); }
.sep { padding: 0 20px; }
.ag-chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 20px 4px; margin: 0 -20px; scrollbar-width: none; }
.chip-reuniao {
  flex: none; height: 40px; padding: 0 16px; border-radius: var(--es-radius-pill);
  border: 1.5px solid var(--es-line); background: var(--es-surface); color: var(--es-ink); font-weight: 700; font-size: 15px;
}
.chip-reuniao[aria-pressed="true"] { border-color: transparent; background: var(--es-btn); color: var(--es-on-btn); }
.chip-reuniao.passada { opacity: .6; }
.ag-acoes { display: flex; gap: 10px; padding: 10px 0 12px; }
.ag-acoes .btn { padding: 0 14px; white-space: nowrap; gap: 6px; }
#ag-linhas { display: flex; flex-direction: column; gap: 8px; }
.ag-linha {
  background: var(--es-surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--es-shadow-soft);
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 3px; align-items: center;
  grid-template-areas: "tile nome acao" "tile membro acao" "tile sup acao" "tile estado acao";
}
.ag-linha .tile { grid-area: tile; width: 40px; height: 40px; border-radius: 11px; font-size: 22px; align-self: center; }
.ag-nome { grid-area: nome; font-weight: 700; font-size: 15px; line-height: 1.2; }
.ag-membro { grid-area: membro; font-size: 15px; font-weight: 600; }
.ag-membro.vazio { font-weight: 500; font-style: italic; color: var(--es-muted); }
.ag-sup { grid-area: sup; font-size: 13px; color: var(--es-muted); }
.ag-sup::before { content: 'Suplentes: '; }
.ag-sup:empty { display: none; }
.ag-linha .estado { grid-area: estado; }
.ag-acao { grid-area: acao; display: flex; justify-content: flex-end; }
.ag-atribuir {
  height: 44px; width: 116px; border-radius: 12px; border: 1.5px solid var(--es-line);
  background: var(--es-surface); color: var(--es-brand); font-weight: 700; font-size: 14px; padding: 0 8px;
}
.btn-remover {
  width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1.5px solid var(--es-line);
  background: transparent; color: var(--es-maroon-ink); display: grid; place-items: center; font-size: 22px;
}
.btn-remover .txt { display: none; }
.estado {
  display: inline-flex; align-items: center; gap: 4px; width: fit-content; white-space: nowrap;
  padding: 2px 8px; border-radius: var(--es-radius-pill); font-size: 12px; font-weight: 700;
}
.estado .ms { font-size: 15px; font-variation-settings: 'FILL' 1; }
.estado-livre { border: 1.5px dashed var(--es-muted); color: var(--es-muted); }
.estado-vpe { border: 1.5px dashed var(--es-brand); color: var(--es-brand); }
.estado-reservada { background: var(--es-ok-soft); color: var(--es-green-ink); }
.estado-suplentes { background: var(--es-surface-2); color: var(--es-brand); }
.ag-cab { display: none; }

/* Membros e funções */
.lista-cartoes { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lista-cartoes li {
  background: var(--es-surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--es-shadow-soft);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.lista-cartoes li.inativo { opacity: .6; }
.lista-cartoes .campo { flex: 1 1 140px; width: auto; }
.lista-cartoes .campo.estreito { flex: 0 0 72px; }
.lista-cartoes .campo.medio { flex: 0 0 130px; }
.lista-cartoes .campo.inteiro { flex: 1 1 100%; }
.check { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--es-brand); }
.funcao-topo { display: flex; gap: 10px; align-items: center; flex: 1 1 100%; min-width: 0; }
.funcao-topo .tile { width: 44px; height: 44px; }
.funcao-topo .campo { flex: 1 1 0; min-width: 0; width: 0; }
.funcao-topo .mini { flex: none; }
.mini { width: 40px; height: 40px; border-radius: 10px; border: none; background: transparent; color: var(--es-muted); display: grid; place-items: center; font-size: 22px; }
.mini:hover { background: var(--es-surface-2); color: var(--es-ink); }

/* ---------- Navegação inferior ---------- */
.navegacao {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(84px + env(safe-area-inset-bottom)); padding: 6px 12px calc(22px + env(safe-area-inset-bottom));
  display: flex; justify-content: center; background: var(--es-nav-bg); border-top: 1px solid var(--es-line);
}
.nav-item {
  flex: 1; max-width: 160px; min-height: 44px; border: none; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.nav-pastilha {
  width: 56px; height: 30px; border-radius: var(--es-radius-pill); display: grid; place-items: center;
  font-size: 22px; color: var(--es-muted);
}
.nav-texto { font-size: 12px; font-weight: 600; color: var(--es-muted); }
.nav-item[aria-current="page"] .nav-pastilha { background: var(--es-surface-2); color: var(--es-brand); font-variation-settings: 'FILL' 1; }
.nav-item[aria-current="page"] .nav-texto { font-weight: 800; color: var(--es-brand); }

/* ---------- Folha inferior ---------- */
.folha-fundo {
  position: fixed; inset: 0; z-index: 40; background: var(--es-overlay);
  display: flex; align-items: flex-end; justify-content: center; animation: es-fade 200ms ease-out;
}
.folha {
  width: 100%; max-width: 480px; max-height: 92dvh; overflow: auto;
  background: var(--es-surface); border-radius: 28px 28px 0 0;
  padding: 12px 24px calc(36px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px; animation: es-sheet 320ms var(--es-ease-out);
}
.folha-pega { width: 40px; height: 5px; border-radius: 3px; background: var(--es-line); align-self: center; }
.folha-cabeca { display: flex; align-items: center; gap: 12px; }
.folha-icone {
  width: 48px; height: 48px; flex: none; border-radius: 14px; background: var(--es-maroon); color: #FFFFFF;
  display: grid; place-items: center; font-size: 26px; font-variation-settings: 'FILL' 1;
}
.folha-icone.azul { background: var(--es-panel); color: var(--es-yellow); }
.folha-corpo { display: flex; flex-direction: column; gap: 12px; }
.folha-corpo > p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--es-muted); text-wrap: pretty; }
.folha-corpo .btn { height: 52px; border-radius: 16px; font-size: 16px; }
.folha-corpo textarea.campo { min-height: 220px; padding: 12px; font: 14px/1.5 ui-monospace, Menlo, Consolas, monospace; }
.grelha { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grelha .inteiro { grid-column: 1 / -1; }
.lista-slots { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.lista-slots li { display: flex; align-items: center; gap: 10px; min-height: 44px; border-bottom: 1px solid var(--es-line); }
.lista-slots li span:nth-child(2) { flex: 1; font-weight: 600; }
.lista-slots .tile { width: 32px; height: 32px; border-radius: 9px; font-size: 18px; }
.subtitulo-folha { margin: 8px 0 0; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--es-muted); }

/* ---------- 4. Match ---------- */
.match {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  background: rgba(119, 36, 50, .97); color: #FFFFFF; animation: es-fade 200ms ease-out;
}
.match-centro {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 40px 28px 0; text-align: center;
}
.match-sobre { font-size: 13px; font-weight: 800; letter-spacing: .2em; color: var(--es-yellow); }
.match-titulo { margin: 0; font: 700 52px/1.02 var(--es-font-serif); color: #FFFFFF; animation: es-zoom 420ms var(--es-ease-spring) 120ms both; }
.match-icone {
  width: 150px; height: 150px; border-radius: 50%; background: #004165; display: grid; place-items: center;
  box-shadow: 0 0 0 8px rgba(255,255,255,.14); animation: es-zoom 420ms var(--es-ease-spring) 220ms both;
}
.match-icone .ms { font-size: 72px; color: var(--es-yellow); font-variation-settings: 'FILL' 1; }
.match-icone .ms.emoji { font-family: inherit; font-size: 64px; }
.match-textos { display: flex; flex-direction: column; gap: 8px; }
.match-funcao { font: 600 24px var(--es-font-serif); }
.match-texto { font-size: 17px; line-height: 1.45; text-wrap: pretty; }
.match-botoes {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  width: 100%; max-width: 480px; margin: 0 auto; padding: 24px 24px calc(40px + env(safe-area-inset-bottom));
}
.confetis { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confeti { position: absolute; top: 0; }

/* ---------- Aviso (toast) ---------- */
.aviso {
  position: fixed; z-index: 60; top: calc(env(safe-area-inset-top) + 16px); left: 16px; right: 16px;
  max-width: 448px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 16px;
  color: #FFFFFF; font-size: 15px; font-weight: 600; line-height: 1.3;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.45); animation: es-toast 240ms var(--es-ease-out);
  background: var(--es-info);
}
.aviso .ms { font-size: 22px; font-variation-settings: 'FILL' 1; flex: none; }
.aviso[data-tipo="success"] { background: #1E7B4F; }
.aviso[data-tipo="error"] { background: #772432; }

/* ---------- Animações ---------- */
@keyframes es-shake { 0%,100% { transform: translateX(0) } 15% { transform: translateX(-12px) rotate(-2deg) } 30% { transform: translateX(10px) rotate(2deg) } 45% { transform: translateX(-8px) rotate(-1deg) } 60% { transform: translateX(6px) } 75% { transform: translateX(-3px) } }
@keyframes es-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes es-zoom { 0% { opacity: 0; transform: scale(.7) } 60% { opacity: 1; transform: scale(1.06) } 100% { opacity: 1; transform: scale(1) } }
@keyframes es-fall { 0% { transform: translate3d(0,-40px,0) rotate(0); opacity: 1 } 80% { opacity: 1 } 100% { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); opacity: 0 } }
@keyframes es-shimmer { 0% { background-position: -420px 0 } 100% { background-position: 420px 0 } }
@keyframes es-toast { from { opacity: 0; transform: translateY(-12px) } to { opacity: 1; transform: none } }
@keyframes es-sheet { from { transform: translateY(100%) } to { transform: none } }
@keyframes es-spin { to { transform: rotate(360deg) } }
.a-tremer { animation: es-shake 420ms cubic-bezier(.36,.07,.19,.97); }

@media (prefers-reduced-motion: reduce) {
  .match-titulo, .aviso { animation: es-fade 250ms ease-out both; }
  .match-icone { animation: none; }
  .folha { animation: es-fade 200ms ease-out; }
  .brilho { animation: none; }
  .confetis { display: none; }
  .cartao[data-pos="1"] { transform: none; opacity: .6; }
  .a-tremer { animation: none; }
}

/* ---------- Desktop ---------- */
@media (min-width: 760px) {
  body { background: var(--es-surface-2); }
  #app { background: var(--es-bg); box-shadow: 0 0 0 1px var(--es-line); }
}

/* Agenda em desktop: lista de reuniões à esquerda, detalhe à direita (1280 × 800 no design). */
@media (min-width: 1024px) {
  body[data-ecra="agenda"] { background: var(--es-bg); }
  body[data-ecra="agenda"] #app { max-width: none; box-shadow: none; }
  body[data-ecra="agenda"] .navegacao { display: none; }
  body[data-ecra="agenda"] .ecra { padding-bottom: 0; }
  #ecra-agenda { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); padding: 0; flex: none; height: 100dvh; }
  #ecra-agenda .ag-cab.so-desktop { display: grid !important; }
  #ecra-agenda .so-movel { display: none !important; }
  #ecra-agenda .so-desktop { display: revert !important; }
  #ecra-agenda .btn.so-desktop { display: inline-flex !important; }
  .ag-lateral {
    display: flex; flex-direction: column; gap: 20px; min-height: 0;
    background: var(--es-surface); border-right: 1px solid var(--es-line); padding: 28px 20px;
  }
  .ag-lateral .marca-tile { width: 44px; height: 44px; border-radius: 13px; font-size: 20px; }
  .ag-lateral .marca-nome { font-size: 19px; }
  .rotulo-secao { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--es-muted); padding: 0 4px; }
  .ag-lista { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; overflow: auto; }
  .reuniao-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: none;
    text-align: left; background: transparent; color: var(--es-ink);
  }
  .reuniao-item[aria-pressed="true"] { background: var(--es-btn); color: var(--es-on-btn); }
  .reuniao-item.passada { opacity: .6; }
  .reuniao-data {
    width: 48px; height: 48px; flex: none; border-radius: 12px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; background: var(--es-surface-2);
  }
  .reuniao-item[aria-pressed="true"] .reuniao-data { background: rgba(127,127,127,.18); }
  .reuniao-data b { font: 700 20px/1 var(--es-font-serif); }
  .reuniao-data span { font-size: 11px; font-weight: 700; letter-spacing: .1em; }
  .reuniao-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .reuniao-txt b { font-size: 15px; }
  .reuniao-txt span { font-size: 13px; opacity: .8; }
  .ag-lateral-rodape { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--es-line); padding-top: 12px; }
  .ligacao-nav {
    display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border: none; border-radius: 12px;
    background: transparent; color: var(--es-muted); font-weight: 600; font-size: 15px; text-align: left;
  }
  .ligacao-nav:hover { background: var(--es-surface-2); color: var(--es-ink); }
  .ligacao-nav .ms { font-size: 20px; }

  .ag-principal { overflow: auto; min-height: 0; padding: 36px 40px; gap: 0; }
  .ag-topo { padding: 0; align-items: flex-end; }
  .ag-topo .titulo { font-size: 34px; }
  .segmentos, .sep { padding-left: 0; padding-right: 0; }
  .segmentos { padding-bottom: 20px; }
  .ag-tabela { background: var(--es-surface); border-radius: 20px; box-shadow: var(--es-shadow-soft); overflow: hidden; }
  #ag-linhas { gap: 0; }
  .ag-cab, .ag-linha {
    display: grid; column-gap: 16px; align-items: center; padding: 10px 24px;
    grid-template-columns: 36px minmax(0,1.2fr) minmax(0,1.2fr) minmax(0,1fr) 170px 150px;
  }
  .ag-cab {
    padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--es-line);
    font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--es-muted);
  }
  .ag-cab span:first-child { grid-column: 1 / 3; }
  .ag-cab .dir { text-align: right; }
  .ag-linha {
    grid-template-areas: "tile nome membro sup estado acao"; row-gap: 0;
    border-radius: 0; box-shadow: none; min-height: 58px; border-bottom: 1px solid var(--es-line);
  }
  .ag-linha:last-child { border-bottom: none; }
  .ag-linha .tile { width: 36px; height: 36px; border-radius: 10px; font-size: 20px; }
  .ag-sup::before { content: none; }
  .ag-sup:empty { display: block; }
  .ag-sup:empty::before { content: '—'; }
  .estado { padding: 5px 10px; font-size: 13px; }
  .ag-atribuir { width: 140px; height: 40px; }
  .btn-remover { width: auto; height: 40px; padding: 0 12px; border: none; display: flex; gap: 4px; font-size: 18px; }
  .btn-remover:hover { background: var(--es-surface-2); }
  .btn-remover .txt { display: inline; font: 700 14px var(--es-font-sans); }
  .aviso { left: auto; right: 24px; top: 24px; max-width: 420px; margin: 0; }
}
