/* =========================================================
   Mestre da Amizade Fest — UI
   Tema escuro · paleta do logo (rosa, amarelo, ciano, marinho)
   ========================================================= */
/* Transição entre telas: só fora do iPhone/iPad. No Safari do iOS cada transição
   captura a página inteira (e as camadas dela) — pesado em memória gráfica. */
@supports not (-webkit-touch-callout: none) {
  @view-transition { navigation: auto; }
}

/* ÚNICO lugar com as cores da interface. JS (confete, gráficos,
   anel) lê estas variáveis. Fora daqui só theme-color/manifest,
   que não aceitam CSS. */
:root {
  /* Marca — extraídas de assets/abertura/logo.webp */
  --pink: #FF009F;          /* arco rosa do logo (principal) */
  --pink-rgb: 255 0 159;
  --pink-2: #FF5CBE;        /* rosa claro (gradientes) */
  --yellow: #FECE00;        /* amarelo do personagem (destaque) */
  --yellow-rgb: 254 206 0;
  --yellow-2: #FFE14D;
  --cyan: #10C2E3;          /* ciano das fitas/confete (secundária) */
  --cyan-rgb: 16 194 227;
  --cyan-2: #0089C6;
  --orange: #E25907;        /* laranja do logo (só confete/gráficos) */
  --navy: #0A2230;          /* marinho do banner (apoio) */
  --navy-rgb: 10 34 48;
  --on-pink: #14020C;       /* texto sobre rosa  (5,6:1) */
  --on-yellow: #1A1400;     /* texto sobre amarelo (12:1) */
  --on-cyan: #031418;

  /* Superfícies */
  --bg: #07080B;
  --bg-rgb: 7 8 11;
  --bg-2: #0D1016;
  --bg2-rgb: 13 16 22;
  --bg-3: #141922;
  --glass: rgba(255, 255, 255, .045);
  --glass-2: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --text: #F2EEF3;
  --muted: #B1ABB8;
  --dim: #8A8494;

  /* Estados */
  --ok: #3BE39A;
  --ok-rgb: 59 227 154;
  --ok-2: #2BD4C4;
  --warn: var(--yellow);
  --danger: #FF6A5C;
  --danger-rgb: 255 106 92;
  --info: var(--cyan);
  --ok-tint: #C3F7DE;
  --warn-tint: #FFEBA0;
  --danger-tint: #FFC4BD;
  --info-tint: #C2F1FA;
  --tribute-tint: #F3E6D3;

  /* Gradientes */
  --grad: linear-gradient(110deg, var(--pink) 0%, var(--pink-2) 30%, var(--yellow-2) 68%, var(--yellow) 100%);
  --grad-btn: linear-gradient(135deg, var(--pink-2) 0%, var(--pink) 100%);
  --grad-yellow: linear-gradient(135deg, var(--yellow-2) 0%, var(--yellow) 100%);
  --grad-cyan: linear-gradient(135deg, var(--ok), var(--cyan));
  --grad-border: linear-gradient(135deg, rgb(var(--pink-rgb) / .6), rgba(255,255,255,.07) 38%, rgba(255,255,255,.04) 62%, rgb(var(--cyan-rgb) / .5));

  /* Confete (app.js lê --confete-1..6) */
  --confete-1: var(--pink);
  --confete-2: var(--yellow);
  --confete-3: var(--cyan);
  --confete-4: var(--orange);
  --confete-5: #FFFFFF;
  --confete-6: var(--pink-2);

  /* Abertura: centro do fundo radial (o resto é --bg) */
  --abertura-centro: #1A1A20;
  --r: 22px;
  --r-sm: 14px;
  --font-title: 'Space Grotesk', 'Sora', system-ui, sans-serif;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--pink); }
h1, h2, h3, h4 { font-family: var(--font-title); letter-spacing: -.01em; margin: 0; line-height: 1.15; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { background: rgb(var(--pink-rgb) / .35); }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--pink); color: var(--on-pink); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 8px; }

/* ---------- Fundo animado ---------- */
.aurora {
  position: fixed; inset: -25%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(38% 32% at 18% 12%, rgb(var(--pink-rgb) / .17), transparent 70%),
    radial-gradient(34% 30% at 88% 88%, rgb(var(--yellow-rgb) / .10), transparent 70%),
    radial-gradient(26% 22% at 82% 18%, rgb(var(--navy-rgb) / .55), transparent 70%),
    radial-gradient(30% 26% at 10% 85%, rgb(var(--cyan-rgb) / .08), transparent 70%);
  animation: drift 26s ease-in-out infinite alternate;
  will-change: transform;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
          mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(3%, -2%, 0) rotate(4deg) scale(1.05); }
  100% { transform: translate3d(-3%, 2%, 0) rotate(-3deg) scale(1); }
}

/* ---------- Logo (imagem do adesivo) ---------- */
.logo { display: block; height: auto; max-width: none; filter: drop-shadow(0 4px 14px rgb(var(--pink-rgb) / .28)); }
.logo-sm { width: 48px; }
.logo-md { width: 120px; }
.logo-lg {
  width: min(250px, 64vw);
  filter: drop-shadow(0 12px 40px rgb(var(--pink-rgb) / .38)) drop-shadow(0 0 24px rgb(var(--yellow-rgb) / .16));
  animation: logoFloat 6s ease-in-out infinite;
}
@keyframes logoFloat { 50% { transform: translateY(-6px) rotate(-1.5deg); } }
@keyframes shimmer { to { background-position: 200% 0; } }

/* ---------- Estrutura participante ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: linear-gradient(180deg, rgb(var(--bg-rgb) / .92), rgb(var(--bg-rgb) / .6));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-brand { text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.topbar-me { text-decoration: none; border-radius: 50%; }

.page {
  max-width: 560px; margin: 0 auto;
  padding: 18px 16px 32px;
  display: flex; flex-direction: column; gap: 16px;
  animation: pageIn .45s var(--ease) both;
}
.has-tabbar .page { padding-bottom: calc(104px + var(--safe-b)); }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Skeleton na troca de tela */
.page-skeleton { display: none; max-width: 560px; margin: 0 auto; padding: 18px 16px; flex-direction: column; gap: 16px; }
body.leaving .page { display: none; }
body.leaving .page-skeleton { display: flex; }

.skel, .skel-txt {
  background: linear-gradient(90deg, rgba(255,255,255,.05) 25%, rgba(255,255,255,.11) 37%, rgba(255,255,255,.05) 63%);
  background-size: 400% 100%;
  animation: skel 1.3s ease infinite;
  border-radius: 14px;
}
.skel-txt { color: transparent !important; -webkit-text-fill-color: transparent; border-radius: 8px; }
.skel-title { height: 34px; width: 60%; }
.skel-card { height: 160px; border-radius: var(--r); }
.skel-card.short { height: 96px; }
.skel-line { height: 16px; }
.skel-line.w60 { width: 60%; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 6px 8px calc(6px + var(--safe-b));
  background: rgb(var(--bg-rgb) / .78);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  border-top: 1px solid var(--line);
}
.tabbar::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgb(var(--pink-rgb) / .55), rgb(var(--yellow-rgb) / .4), rgb(var(--cyan-rgb) / .4), transparent);
}
.tabbar-in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.tab {
  min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--dim); text-decoration: none; font-size: 11px; font-weight: 600; letter-spacing: .01em;
  border-radius: 16px; position: relative; transition: color .2s, background .2s;
}
.tab .ic { width: 23px; height: 23px; transition: transform .25s var(--ease); }
.tab:active .ic { transform: scale(.88); }
.tab.is-active { color: var(--pink); }
.tab.is-active .ic { filter: drop-shadow(0 0 8px rgb(var(--pink-rgb) / .6)); }
.tab.is-active::before {
  content: ""; position: absolute; top: 2px; width: 28px; height: 3px; border-radius: 3px;
  background: var(--pink); box-shadow: 0 0 12px var(--pink);
}
.tab-ic { position: relative; display: inline-flex; }
.tab-dot {
  position: absolute; top: -2px; right: -5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--yellow); box-shadow: 0 0 0 2px var(--bg), 0 0 10px var(--yellow);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.25); opacity: .75; } }

/* ---------- Ícones ---------- */
.ic { width: 20px; height: 20px; display: inline-block; vertical-align: middle; flex: none; stroke-width: 2; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 28px; height: 28px; }
.ic-xl { width: 44px; height: 44px; color: var(--pink); }

/* ---------- Tipografia ---------- */
.eyebrow { font: 600 12px/1.2 var(--font-title); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.h1 { font-size: 28px; font-weight: 700; }
.h2 { font-size: 20px; font-weight: 700; }
.h3 { font-size: 16px; font-weight: 600; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.grad-txt {
  background: var(--grad); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 8s linear infinite;
}
.num { font-family: var(--font-title); font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Cards glass ---------- */
.card {
  position: relative; border-radius: var(--r); padding: 18px;
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02) 60%);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.05);
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--grad-border);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.card-glow::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; z-index: -1; pointer-events: none;
  background: var(--grad); background-size: 300% 100%; filter: blur(22px); opacity: .22;
  animation: shimmer 10s linear infinite;
}
.card-title { display: flex; align-items: center; gap: 8px; font: 600 15px/1.2 var(--font-title); margin-bottom: 14px; }
.card-title .ic { color: var(--pink); }
.card-sub { background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; }
.card-link { text-decoration: none; color: inherit; display: block; transition: transform .2s var(--ease); }
.card-link:active { transform: scale(.985); }

/* ---------- Hero / contagem ---------- */
.hero { padding: 6px 2px 2px; }
.hero h1 { font-size: 30px; font-weight: 700; margin: 6px 0 10px; }
/* "Fala, Fulano 👋" (tela inicial): legível, abaixo do nome do evento na hierarquia.
   18 px em 360 · 21 px em 390 · 22 px em 430+; nome comprido quebra a linha sem estourar. */
.saudacao {
  margin: 0; font: 600 clamp(18px, 5.4vw, 22px)/1.25 var(--font-title); letter-spacing: .01em;
  color: var(--muted); overflow-wrap: anywhere;
}
.saudacao + h1 { margin-top: 6px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 14px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta .ic { width: 16px; height: 16px; color: var(--yellow); }

.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cd-unit {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 4px 10px; border-radius: 16px;
  background: rgb(var(--navy-rgb) / .38); border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.cd-unit::after {
  content: ""; position: absolute; left: 10%; right: 10%; bottom: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--pink), transparent); opacity: .7;
}
.cd-unit:nth-child(n+3)::after { background: linear-gradient(90deg, transparent, var(--yellow), transparent); }
.cd-num {
  font: 700 34px/1 var(--font-title); font-variant-numeric: tabular-nums; min-width: 2ch; text-align: center;
  background: linear-gradient(180deg, #fff 10%, var(--pink-2) 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cd-unit:nth-child(n+3) .cd-num { background-image: linear-gradient(180deg, #fff 10%, var(--yellow) 120%); }
.cd-num.tick { animation: tick .35s var(--ease); }
@keyframes tick { from { transform: translateY(-30%); opacity: .2; } to { transform: none; opacity: 1; } }
.cd-txt { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.cd-done { text-align: center; font: 700 26px/1.2 var(--font-title); padding: 8px 0; }

/* ---------- Status pessoal ---------- */
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.status-box { padding: 12px; border-radius: 14px; background: rgb(var(--navy-rgb) / .38); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.status-box .lbl { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.cta {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px;
  border-radius: 16px; text-decoration: none; color: var(--text);
  background: linear-gradient(120deg, rgb(var(--yellow-rgb) / .18), rgb(var(--yellow-rgb) / .08));
  border: 1px solid rgb(var(--yellow-rgb) / .4);
}
.cta.ok { background: linear-gradient(120deg, rgb(var(--ok-rgb) / .15), rgb(var(--cyan-rgb) / .06)); border-color: rgb(var(--ok-rgb) / .4); }
.cta.info { background: linear-gradient(120deg, rgb(var(--cyan-rgb) / .14), rgb(var(--navy-rgb) / .3)); border-color: rgb(var(--cyan-rgb) / .38); }
.cta-ic {
  width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--grad-yellow); color: var(--on-yellow); box-shadow: 0 0 18px rgb(var(--yellow-rgb) / .45);
}
.cta.ok .cta-ic { background: var(--grad-cyan); color: var(--on-cyan); box-shadow: 0 0 18px rgb(var(--ok-rgb) / .4); }
.cta.info .cta-ic { background: var(--cyan); color: var(--on-cyan); box-shadow: 0 0 18px rgb(var(--cyan-rgb) / .4); }
.cta strong { display: block; font-family: var(--font-title); font-size: 16px; }
.cta small { color: var(--muted); font-size: 13px; }

/* ---------- Seletor de presença ---------- */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button {
  min-height: 64px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted);
  transition: transform .15s var(--ease), border-color .2s, background .2s, color .2s, box-shadow .2s;
}
.seg button .ic { width: 22px; height: 22px; }
.seg button:active { transform: scale(.95); }
.seg button.sel-confirmado { color: var(--on-cyan); background: var(--grad-cyan); border-color: transparent; box-shadow: 0 0 22px rgb(var(--ok-rgb) / .35); }
.seg button.sel-talvez { color: var(--on-yellow); background: var(--grad-yellow); border-color: transparent; box-shadow: 0 0 22px rgb(var(--yellow-rgb) / .35); }
.seg button.sel-nao_vai { color: #fff; background: rgb(var(--danger-rgb) / .22); border-color: rgb(var(--danger-rgb) / .65); }
.seg button:disabled { cursor: not-allowed; opacity: .6; }
.lock-note { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--yellow); margin-top: 10px; }

/* ---------- Anel de progresso ---------- */
.ring-wrap { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 11; }
.ring .bar { fill: none; stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset 1.6s var(--ease); filter: drop-shadow(0 0 6px rgb(var(--pink-rgb) / .45)); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center .num { font-size: 30px; font-weight: 700; }
.ring-center small { font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.ring-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kv .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.kv .v { font: 700 20px/1.2 var(--font-title); font-variant-numeric: tabular-nums; }
.kv .v.cyan { color: var(--pink); }
.kv .v.orange { color: var(--yellow); }

.bar-h { height: 10px; border-radius: 10px; background: rgba(255,255,255,.07); overflow: hidden; }
.bar-h > span { display: block; height: 100%; border-radius: inherit; background: var(--grad); background-size: 200% 100%; width: 0; transition: width 1.4s var(--ease); animation: shimmer 6s linear infinite; }
.bar-h.orange > span { background: var(--grad-yellow); }

/* ---------- Avatares ---------- */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  font: 700 14px/1 var(--font-title); letter-spacing: .02em; color: var(--on-pink);
  box-shadow: 0 0 0 2px var(--bg);
}
.avatar.av-0 { background: var(--grad-btn); }
.avatar.av-1 { background: var(--grad-yellow); color: var(--on-yellow); }
.avatar.av-2 { background: linear-gradient(135deg, var(--cyan), var(--yellow-2)); color: var(--on-cyan); }
.avatar.av-3 { background: linear-gradient(135deg, var(--pink-2), var(--yellow)); }
.avatar-sm { width: 34px; height: 34px; font-size: 12px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatars { display: flex; flex-wrap: wrap; gap: 10px; }
.avatar-item { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 58px; text-align: center; animation: pop .4s var(--ease) both; }
.avatar-item span.n { font-size: 11px; color: var(--muted); width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -10px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* Foto de perfil (mesmo círculo das iniciais, com aro rosa) */
.avatar-xl { width: 96px; height: 96px; font-size: 32px; }
img.avatar-foto {
  display: block; object-fit: cover; background: var(--bg-3); color: transparent;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px rgb(var(--pink-rgb) / .7), 0 0 16px -2px rgb(var(--pink-rgb) / .45);
}
.avatar-stack img.avatar-foto { box-shadow: 0 0 0 2px var(--bg); }
.avatar-inline { display: inline-grid; vertical-align: middle; width: 26px; height: 26px; font-size: 10px; margin-right: 4px; }
img.avatar-inline { display: inline-block; }
.perfil-foto {
  position: relative; flex: none; padding: 0; border: 0; background: none; color: inherit;
  border-radius: 50%; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.perfil-foto:focus-visible, .topbar-me:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.perfil-foto-ic {
  position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--pink); color: var(--on-pink);
  box-shadow: 0 0 0 3px var(--bg-2);
}
.perfil-acoes { margin-top: 14px; }
html.fc-aberto, html.fc-aberto body { overflow: hidden; }

/* Menu de opções da foto (folha que sobe de baixo) */
.fs { position: fixed; inset: 0; z-index: 300; display: flex; align-items: flex-end; justify-content: center; }
.fs-fundo { position: absolute; inset: 0; background: rgb(var(--bg-rgb) / .72); animation: fsFade .2s ease both; }
.fs-box {
  position: relative; width: 100%; max-width: 440px; margin: 0 12px calc(12px + var(--safe-b));
  padding: 10px; border-radius: 22px; background: var(--bg-2); border: 1px solid var(--line-2);
  box-shadow: 0 -10px 40px -10px rgba(0,0,0,.7), 0 0 30px -8px rgb(var(--pink-rgb) / .25);
  display: flex; flex-direction: column; gap: 4px; animation: fsUp .26s var(--ease) both;
}
.fs-tit { text-align: center; font-size: 13px; color: var(--muted); padding: 8px 10px 6px; }
.fs-op {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 0 14px;
  border: 0; border-radius: 14px; background: transparent; color: var(--text); font: 600 15px/1.2 inherit;
  text-align: left; text-decoration: none; cursor: pointer;
}
.fs-op .ic { color: var(--pink-2); }
.fs-op:hover, .fs-op:focus-visible { background: var(--glass-2); outline: none; }
.fs-op.perigo, .fs-op.perigo .ic { color: var(--danger); }
.fs-op.cancelar { justify-content: center; color: var(--muted); border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; margin-top: 4px; }
.fs-op.cancelar .ic { display: none; }
.fs.sai .fs-box { transform: translateY(20px); opacity: 0; transition: .2s ease; }
.fs.sai .fs-fundo { opacity: 0; transition: .2s ease; }
@keyframes fsUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fsFade { from { opacity: 0; } to { opacity: 1; } }

/* Recorte da foto */
.fc {
  position: fixed; inset: 0; z-index: 310; display: flex; align-items: center; justify-content: center;
  padding: calc(12px + var(--safe-t)) 16px calc(12px + var(--safe-b)); background: var(--bg);
  animation: fsFade .2s ease both;
}
.fc-box { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.fc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fc-top strong { font: 700 17px/1.2 var(--font-title); }
.fc-area {
  position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden;
  background: var(--bg-3); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.fc-area:active { cursor: grabbing; }
.fc-area:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.fc-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fc-mascara {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 9999px rgb(var(--bg-rgb) / .62), inset 0 0 0 2px rgb(var(--pink-rgb) / .9), 0 0 24px rgb(var(--pink-rgb) / .35);
}
.fc-carregando { position: absolute; left: 50%; top: 50%; margin: -12px 0 0 -12px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--pink); border-right-color: transparent; animation: spin .7s linear infinite; }
.fc.pronto .fc-carregando { display: none; }
.fc-dica { text-align: center; font-size: 13px; color: var(--muted); margin: 0; }
.fc-zoom-row { display: flex; align-items: center; gap: 10px; }
.fc-zoom { flex: 1; accent-color: var(--pink); min-height: 44px; }
.fc-prog { height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.fc-prog > span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s ease; }
.fc.enviando .fc-area { pointer-events: none; opacity: .85; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  background: rgba(255,255,255,.06); border: 1px solid var(--line-2); color: var(--muted);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge-ok { color: var(--ok); background: rgb(var(--ok-rgb) / .1); border-color: rgb(var(--ok-rgb) / .35); }
.badge-warn { color: var(--warn); background: rgb(var(--yellow-rgb) / .1); border-color: rgb(var(--yellow-rgb) / .35); }
.badge-danger { color: var(--danger); background: rgb(var(--danger-rgb) / .1); border-color: rgb(var(--danger-rgb) / .38); }
.badge-info { color: var(--cyan); background: rgb(var(--cyan-rgb) / .08); border-color: rgb(var(--cyan-rgb) / .35); }
.badge-muted .dot { box-shadow: none; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px; border-radius: 14px; border: 1px solid transparent;
  font: 600 15px/1.2 var(--font); text-decoration: none; cursor: pointer; user-select: none;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s;
  color: var(--text); background: var(--glass-2);
}
.btn:active { transform: scale(.97); }
.btn:disabled, .btn.is-loading { opacity: .6; cursor: progress; }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 16px; border-radius: 16px; }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 14px; border-radius: 12px; }
.btn-primary { background: var(--grad-btn); color: var(--on-pink); box-shadow: 0 6px 24px -6px rgb(var(--pink-rgb) / .55), inset 0 1px 0 rgba(255,255,255,.4); }
.btn-primary:hover { box-shadow: 0 8px 30px -6px rgb(var(--pink-rgb) / .75), inset 0 1px 0 rgba(255,255,255,.4); }
.btn-orange { background: var(--grad-yellow); color: var(--on-yellow); box-shadow: 0 6px 24px -6px rgb(var(--yellow-rgb) / .6), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-ghost { background: rgba(255,255,255,.05); border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(255,255,255,.09); }
.btn-ok { background: linear-gradient(135deg, var(--ok), var(--ok-2)); color: var(--on-pink); box-shadow: 0 6px 22px -8px rgb(var(--ok-rgb) / .6); }
.btn-danger { background: rgb(var(--danger-rgb) / .14); border-color: rgb(var(--danger-rgb) / .5); color: var(--danger-tint); }
.btn-icon { width: 44px; min-height: 44px; padding: 0; border-radius: 12px; }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.copied { background: var(--grad-cyan); color: var(--on-cyan); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; }
.link { color: var(--pink); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 14px;
  background: rgba(0,0,0,.3); border: 1px solid var(--line-2); color: var(--text);
  transition: border-color .2s, box-shadow .2s; font-size: 16px;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 38px; }
.select option { background: var(--bg-2); color: var(--text); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgb(var(--pink-rgb) / .18), 0 0 18px rgb(var(--pink-rgb) / .15); }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input-xl { min-height: 62px; font: 600 22px/1 var(--font-title); letter-spacing: .04em; text-align: center; }
.form-grid { display: grid; gap: 14px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .input, .form-grid .select { min-width: 0; max-width: 100%; }
.span-2 { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--pink); }
.hint { font-size: 12px; color: var(--dim); }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; font-size: 14px; border: 1px solid; align-items: flex-start; }
.alert .ic { margin-top: 1px; }
.alert-danger { background: rgb(var(--danger-rgb) / .1); border-color: rgb(var(--danger-rgb) / .4); color: var(--danger-tint); }
.alert-warn { background: rgb(var(--yellow-rgb) / .08); border-color: rgb(var(--yellow-rgb) / .35); color: var(--warn-tint); }
.alert-info { background: rgb(var(--cyan-rgb) / .07); border-color: rgb(var(--cyan-rgb) / .32); color: var(--info-tint); }
.alert-ok { background: rgb(var(--ok-rgb) / .08); border-color: rgb(var(--ok-rgb) / .35); color: var(--ok-tint); }

/* Upload */
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: 140px; padding: 18px; border-radius: 18px; cursor: pointer;
  border: 1.5px dashed rgb(var(--pink-rgb) / .45); background: rgb(var(--pink-rgb) / .04); transition: background .2s, border-color .2s;
}
.drop:hover, .drop.has-file { background: rgb(var(--pink-rgb) / .08); border-color: var(--pink); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .ic { width: 32px; height: 32px; color: var(--pink); }
.drop-name { font-weight: 600; word-break: break-all; }

/* ---------- Pix ---------- */
.pix-box { display: flex; flex-direction: column; gap: 12px; }
.pix-key {
  font: 600 17px/1.35 var(--font-title); word-break: break-all; padding: 14px; border-radius: 14px;
  background: rgba(0,0,0,.35); border: 1px solid rgb(var(--pink-rgb) / .3); color: var(--pink-2); text-align: center;
  box-shadow: inset 0 0 22px rgb(var(--pink-rgb) / .08);
}
.valor-cota { font: 700 44px/1 var(--font-title); letter-spacing: -.02em; }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 10px; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.steps li::before {
  content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font: 700 13px/1 var(--font-title); color: var(--on-pink); background: var(--grad-btn);
}

/* ---------- Listas ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { font-size: 13px; color: var(--muted); }
.li-badges { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats.cols-2 { grid-template-columns: repeat(2, 1fr); }
.stat { padding: 14px 10px; border-radius: 16px; background: rgb(var(--navy-rgb) / .38); border: 1px solid var(--line); text-align: center; }
.stat .num { font-size: 28px; font-weight: 700; display: block; line-height: 1.1; }
.stat .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.stat.ok .num { color: var(--ok); }
.stat.cyan .num { color: var(--pink); }
.stat.orange .num { color: var(--yellow); }
.stat.danger .num { color: var(--danger); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(255,255,255,.04); color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.is-active { color: var(--on-pink); background: var(--pink); border-color: var(--pink); box-shadow: 0 0 16px rgb(var(--pink-rgb) / .4); }
.chip .count { font-size: 11px; opacity: .8; }

/* Compras */
.cat-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.cat-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: rgb(var(--yellow-rgb) / .13); color: var(--yellow); border: 1px solid rgb(var(--yellow-rgb) / .3); }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item.done .li-title { text-decoration: line-through; text-decoration-color: rgb(var(--ok-rgb) / .6); color: var(--muted); }
.item-check { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center; border: 1.5px solid var(--line-2); }
.item.done .item-check { background: var(--ok); border-color: var(--ok); color: var(--on-cyan); box-shadow: 0 0 12px rgb(var(--ok-rgb) / .5); }
.item-actions { display: flex; gap: 6px; }

/* Contratações */
.vendor { display: flex; gap: 14px; }
.vendor-ic { width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center; background: rgb(var(--cyan-rgb) / .1); color: var(--cyan); border: 1px solid rgb(var(--cyan-rgb) / .3); }

/* Homenagem — discreta */
.tribute {
  border-radius: var(--r); padding: 26px 20px; text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.08);
}
.tribute-photo { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; margin: 0 auto 16px; filter: grayscale(.35); border: 2px solid rgb(var(--yellow-rgb) / .35); box-shadow: 0 0 30px rgb(var(--yellow-rgb) / .12); }
.tribute h2 { font-size: 20px; font-weight: 600; color: var(--tribute-tint); margin-bottom: 10px; }
.tribute p { color: var(--muted); font-size: 15px; line-height: 1.65; }
.tribute .candle { color: var(--yellow); opacity: .8; margin-bottom: 8px; }

/* Empty */
.empty-state { text-align: center; padding: 34px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; left: 0; right: 0; top: calc(12px + var(--safe-t)); z-index: 200; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px;
}
.toast {
  pointer-events: auto; max-width: 440px; width: 100%; display: flex; gap: 10px; align-items: center;
  padding: 13px 16px; border-radius: 16px; font-weight: 500; font-size: 14px;
  background: rgb(var(--bg2-rgb) / .92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgb(var(--pink-rgb) / .45); box-shadow: 0 12px 36px -10px rgba(0,0,0,.7), 0 0 20px rgb(var(--pink-rgb) / .18);
  animation: toastIn .4s var(--ease) both;
}
.toast .ic { color: var(--pink); }
.toast.error { border-color: rgb(var(--danger-rgb) / .6); box-shadow: 0 12px 36px -10px rgba(0,0,0,.7), 0 0 20px rgb(var(--danger-rgb) / .18); }
.toast.error .ic { color: var(--danger); }
.toast.warn { border-color: rgb(var(--yellow-rgb) / .55); }
.toast.warn .ic { color: var(--warn); }
.toast.out { animation: toastOut .3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }

/* ---------- Login ---------- */
.login-wrap { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 32px 20px calc(32px + var(--safe-b)); max-width: 440px; margin: 0 auto; }
.login-wrap .page { padding: 0; }
.login-hero { display: flex; justify-content: center; }
.tagline { text-align: center; color: var(--muted); font-size: 15px; }
.foot-link { text-align: center; font-size: 13px; }
.foot-link a { color: var(--dim); text-decoration: none; }

/* ---------- Tabelas (admin) ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table tfoot td { font-weight: 700; border-top: 1px solid var(--line-2); }

/* ---------- Admin ---------- */
.admin-top {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: rgb(var(--bg-rgb) / .85); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.admin-top-r { display: flex; gap: 8px; }
.admin-top-r form { margin: 0; }
.admin-tag { font: 700 10px/1 var(--font-title); letter-spacing: .2em; padding: 5px 8px; border-radius: 8px; color: var(--yellow); border: 1px solid rgb(var(--yellow-rgb) / .45); background: rgb(var(--yellow-rgb) / .1); }
.admin-shell { display: block; }
.admin-nav {
  display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none;
  border-bottom: 1px solid var(--line); background: rgb(var(--bg-rgb) / .55);
  position: sticky; top: calc(61px + var(--safe-t)); z-index: 30; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.admin-nav::-webkit-scrollbar { display: none; }
.admin-link {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 14px; border-radius: 12px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; border: 1px solid transparent;
}
.admin-link:hover { background: rgba(255,255,255,.05); }
.admin-link.is-active { color: var(--pink); background: rgb(var(--pink-rgb) / .08); border-color: rgb(var(--pink-rgb) / .3); }
.pill-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--on-yellow); background: var(--yellow); box-shadow: 0 0 10px rgb(var(--yellow-rgb) / .6); }
.admin-main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 60px; display: flex; flex-direction: column; gap: 16px; animation: pageIn .4s var(--ease) both; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid-2 { display: grid; gap: 16px; }
.grid-3 { display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { padding: 16px; border-radius: 18px; background: rgb(var(--navy-rgb) / .38); border: 1px solid var(--line); }
.kpi .lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 6px; }
.kpi .lbl .ic { width: 15px; height: 15px; }
.kpi .val { font: 700 26px/1.2 var(--font-title); margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi.ok .val { color: var(--ok); } .kpi.cyan .val { color: var(--pink); } .kpi.orange .val { color: var(--yellow); } .kpi.danger .val { color: var(--danger); }
.chart-box { position: relative; height: 240px; }
.adm-item { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.adm-item:last-child { border-bottom: 0; }
.adm-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.adm-actions form { margin: 0; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form .input { min-height: 44px; flex: 1; min-width: 140px; }
.thumb { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line-2); background: #000; }
.thumb-pdf { width: 84px; height: 84px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line-2); background: rgb(var(--danger-rgb) / .08); color: var(--danger); text-decoration: none; font-weight: 700; font-size: 12px; }
details.more summary { cursor: pointer; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
.wa-text { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 13px; min-height: 260px; }
.hide-sm { display: none; }

@media (min-width: 640px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: inline; }
}
@media (min-width: 960px) {
  .admin-shell { display: grid; grid-template-columns: 230px 1fr; }
  .admin-nav {
    flex-direction: column; overflow: visible; border-bottom: 0; border-right: 1px solid var(--line);
    min-height: calc(100dvh - 61px); top: 61px; align-self: start; padding: 16px 12px; background: transparent;
  }
  .admin-main { padding: 26px 28px 60px; width: 100%; }
  .kpis { grid-template-columns: repeat(6, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 380px) {
  .cd-num { font-size: 28px; }
  .hero h1 { font-size: 26px; }
  .ring { width: 116px; height: 116px; }
  .form-grid.cols-2 { grid-template-columns: 1fr; }
}

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .aurora { animation: none; }
  @view-transition { navigation: none; }
}

/* =========================================================
   Abertura (splash) — controlada por assets/js/abertura.js
   ========================================================= */
html.ab-on, html.ab-on body { overflow: hidden; }
.abertura {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: radial-gradient(70% 55% at 50% 45%, var(--abertura-centro) 0%, var(--bg) 70%);
  overflow: hidden;
  transition: opacity .55s var(--ease), visibility .55s;
}
.abertura.sai { opacity: 0; visibility: hidden; pointer-events: none; }
/* Animação completa (porta de mestre-piece.jsx). Mundo 1080×1080 escalado via JS;
   coordenadas internas em px do original. Só transform/opacity mudam por quadro. */
.ab-anim { display: block; }
.ab-anim > .ab-mundo, .ab-anim .ab-mundo * { position: absolute; }
.ab-mundo { left: 0; top: 0; width: 1080px; height: 1080px; transform-origin: 0 0; }
.ab-fundo {
  left: -2000px; top: -2000px; width: 5080px; height: 5080px;
  background: radial-gradient(756px 702px at 2540px 2454px, var(--abertura-centro), var(--bg));
}
.ab-raios {
  left: 2540px; top: 2454px; width: 4000px; height: 4000px; margin: -2000px 0 0 -2000px; /* centro = (540, 454) do palco */
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,.018) 0deg 10deg, transparent 10deg 20deg);
  will-change: transform;
}
/* vinheta do original + fade para --bg fora do quadrado (telas altas) */
.ab-vinheta { inset: 0; background: radial-gradient(810px 756px at 2540px 2486px, transparent 55%, rgba(0,0,0,.35) 100%, rgb(var(--bg-rgb) / .9) 135%); }
.ab-cam { left: 0; top: 0; width: 1080px; height: 1080px; transform-origin: 540px 420px; will-change: transform; }
.ab-glow { left: 120px; top: -40px; width: 840px; height: 840px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgb(var(--pink-rgb) / .38), transparent 65%); }
.ab-chao { left: 240px; top: 862px; width: 600px; height: 56px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0,0,0,.75), transparent 70%); }
.ab-conf { pointer-events: none; }
.ab-box { left: 80px; top: 85px; width: 920px; height: 920px; perspective: 1600px; }
.ab-adesivo { inset: 0; transform-origin: 50% 86%; will-change: transform; }
.ab-640 { left: 0; top: 0; width: 640px; height: 640px; transform: scale(1.4375); transform-origin: 0 0; }
.ab-img { max-width: none; }
.ab-props { left: -41.6px; top: -41.6px; width: 723.2px; height: 723.2px; }
.ab-pivo { width: 0; height: 0; }
.ab-cap, .ab-punho { background: linear-gradient(90deg, #ffd51c 0%, #ffd51c 46%, #f7a400 76%, #ea7d00 100%); border: 4.5px solid #0d0d10; box-sizing: border-box; }
.ab-alca { left: -16px; top: -38px; width: 34px; height: 44px; border-radius: 15px; border: 6px solid #0d0d10; box-sizing: border-box; }
.ab-copo { left: 10px; top: -50px; width: 58px; height: 76px; border-radius: 6px 6px 13px 13px; border: 4.5px solid #0d0d10; box-sizing: border-box; overflow: hidden;
  background: linear-gradient(90deg, #ffd040, #f9a50c 58%, #e27a00); }
.ab-bolha { border-radius: 50%; background: rgba(255,246,200,.9); }
.ab-reflexo { left: 6px; top: 12px; width: 8px; height: 44px; border-radius: 4px; background: rgba(255,255,255,.6); }
.ab-espuma { left: 4px; top: -70px; width: 70px; height: 30px; transform-origin: 50% 100%; }
.ab-esp { border-radius: 50%; background: #fff; border: 4.5px solid #0d0d10; box-sizing: border-box; }
.ab-esp-fundo { left: 4px; top: 16px; width: 62px; height: 16px; background: #fff; }
.ab-esp-pinga { left: 8px; top: 20px; width: 10px; height: 22px; border-radius: 5px; background: #fff; border: 4px solid #0d0d10; border-top: 0; box-sizing: border-box; }
.ab-gota { border-radius: 50%; background: #fff; border: 3px solid #0d0d10; box-sizing: border-box; opacity: 0; }
.ab-punho { left: -21px; top: -21px; width: 42px; height: 42px; border-radius: 50%; }
.ab-dedo { border-top: 3px solid #0d0d10; border-radius: 2px; }
.ab-cabeca { left: 0; top: 0; width: 640px; height: 640px; transform-origin: 320px 300px; will-change: transform; }
.ab-olho { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: #fdfefe; }
.ab-pupila { left: 10.8px; top: 12.8px; width: 12.4px; height: 12.4px; border-radius: 50%; background: #0c0c10; }
.ab-palpebra { left: 0; top: 0; width: 100%; height: 104%; background: #fbd400; border-bottom: 3px solid #111; transform-origin: 50% 0; transform: scaleY(0); }
.ab-brilho { left: 0; top: 0; width: 640px; height: 640px; overflow: hidden; visibility: hidden;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.ab-faixa { top: -20%; height: 140%; left: -14%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); }
.ab-faixa2 { left: -6%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); }
.ab-pular {
  position: absolute; top: calc(14px + var(--safe-t)); right: 14px;
  min-height: 48px; min-width: 48px; padding: 10px 18px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 14px/1 var(--font); letter-spacing: .02em; color: var(--text);
  background: rgb(var(--bg-rgb) / .55); border: 1px solid rgba(255,255,255,.2);
  z-index: 2; cursor: pointer; opacity: .78; transition: opacity .2s, background .2s;
}
.ab-pular:hover, .ab-pular:focus-visible { opacity: 1; background: rgba(255,255,255,.14); }
.ab-logo { width: min(240px, 62vw); height: auto; }
/* Enquanto as camadas carregam (até 6 s): logo pulsando de leve */
.ab-espera { animation: abPulsa 1.3s ease-in-out infinite; }
@keyframes abPulsa { 0%, 100% { transform: scale(.94); opacity: .7; } 50% { transform: scale(1); opacity: 1; } }
.ab-curta .ab-logo { animation: abEntra 1.1s cubic-bezier(.2, 1.4, .3, 1) both, abBrilho 1.1s ease-out .35s both; }
.ab-curta::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: min(420px, 110vw); height: min(420px, 110vw); border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgb(var(--pink-rgb) / .45), rgb(var(--yellow-rgb) / .12) 55%, transparent 75%);
  animation: abHalo 1.4s ease-out both;
}
@keyframes abEntra {
  0%   { transform: scale(.55) rotate(-8deg); opacity: 0; }
  60%  { transform: scale(1.06) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes abBrilho {
  0%   { filter: brightness(1) drop-shadow(0 0 0 rgb(var(--pink-rgb) / 0)); }
  40%  { filter: brightness(1.45) drop-shadow(0 0 34px rgb(var(--yellow-rgb) / .7)); }
  100% { filter: brightness(1) drop-shadow(0 12px 36px rgb(var(--pink-rgb) / .45)); }
}
@keyframes abHalo { from { transform: scale(.3); opacity: 0; } 50% { opacity: 1; } to { transform: scale(1); opacity: .55; } }
/* Entrada do app depois da abertura */
html.ab-entrando .page, html.ab-entrando .login-wrap { animation: abApp .6s var(--ease) both; }
@keyframes abApp { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .abertura { transition: opacity .2s; }
  .ab-curta .ab-logo, .ab-curta::after { animation: none; }
}

/* ---------- Rateio (v1.4.0) ---------- */
.estimativa { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; color: var(--muted); line-height: 1.45; }
.estimativa strong { color: var(--text); }
.estimativa .ic { flex: none; margin-top: 2px; color: var(--yellow); }
.selo-isento {
  display: inline-block; vertical-align: middle; margin-left: 4px; padding: 1px 7px; border-radius: 999px;
  font: 600 10.5px/1.5 var(--font-title); letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line-2); background: transparent;
}
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
.lista-simples { margin: 6px 0 0; padding-left: 18px; }
.lista-simples li { margin: 2px 0; }
.input-info { display: flex; align-items: center; color: var(--text); background: transparent; border-style: dashed; }
.hist-pag { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.hist-pag > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.hist-pag > summary::-webkit-details-marker { display: none; }
.hist-linha { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.hist-linha form { display: inline; }


/* =========================================================
   Modo leve — iPhone/iPad (Safari), economia de dados ou menos movimento.
   A classe .leve é posta no <html> por um script no <head> (includes/layout.php).
   Objetivo: poucas camadas de composição e nada repintando sem parar.
   O visual no computador não muda.
   ========================================================= */
/* Fundo: mesmos gradientes, do tamanho da tela, parado (antes: 150% da tela, animado, will-change) */
.leve .aurora { position: absolute; inset: 0 0 auto 0; height: 100vh; animation: none; will-change: auto; transform: none; }
.leve body::before { -webkit-mask-image: none; mask-image: none; position: absolute; height: 100vh; opacity: .55; }
/* Vidro (backdrop-filter) → fundo sólido semitransparente de aparência parecida.
   Só a barra inferior mantém o desfoque (1 elemento por tela). */
.leve .card {
  -webkit-backdrop-filter: none; backdrop-filter: none;
  background: linear-gradient(160deg, #17181d, #0d0e12 60%);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.06), inset 0 1px 0 rgba(255,255,255,.05);
}
/* Borda em degradê com máscara (uma superfície extra por card) → borda simples */
.leve .card::before { display: none; }
.leve .card-glow {
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.6), 0 0 26px -8px rgb(var(--pink-rgb) / .32),
              inset 0 0 0 1px rgb(var(--pink-rgb) / .22), inset 0 1px 0 rgba(255,255,255,.05);
}
/* Brilho do card: era um degradê com blur(22px) animado sem parar → sem filtro, sem animação */
.leve .card-glow::after { display: none; }
.leve .topbar, .leve .admin-top { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgb(var(--bg-rgb) / .96); }
.leve .admin-nav { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgb(var(--bg-rgb) / .97); }
.leve .toast { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgb(var(--bg2-rgb) / .98); }
.leve .tabbar { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); background: rgb(var(--bg-rgb) / .86); }
/* Nada de animação infinita (cada uma repinta a cada quadro) */
.leve .grad-txt, .leve .bar-h > span, .leve .tab-dot, .leve .logo-lg, .leve .skel, .leve .skel-txt { animation: none; }
.leve .page { animation-duration: .25s; }
/* Página guardada no histórico (bfcache): some do layout → camadas liberadas; volta no pageshow */
html.em-cache { background: var(--bg); }
html.em-cache body { display: none !important; }

/* Mesmo sem JS: o essencial do modo leve no Safari do iOS */
@supports (-webkit-touch-callout: none) {
  .card, .topbar, .toast, .admin-top, .admin-nav { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .card { background: linear-gradient(160deg, #17181d, #0d0e12 60%); }
  .aurora { inset: 0; animation: none; will-change: auto; }
  .card-glow::after { display: none; }
}


/* =========================================================
   Boas-vindas depois do login: pedir a foto de perfil (v1.4.3)
   Mesmo visual das folhas (.fs); sem backdrop-filter (ok no modo leve do iPhone).
   ========================================================= */
.bv {
  position: fixed; inset: 0; z-index: 290; display: flex; align-items: center; justify-content: center;
  padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b));
}
.bv[hidden] { display: none; }
.bv-fundo { position: absolute; inset: 0; background: rgb(var(--bg-rgb) / .78); animation: fsFade .25s ease both; }
.bv-box {
  position: relative; width: 100%; max-width: 380px; padding: 28px 22px 20px; border-radius: 24px; text-align: center;
  background: linear-gradient(160deg, #1a1b21, var(--bg-2) 70%); border: 1px solid var(--line-2);
  box-shadow: 0 24px 60px -18px rgba(0,0,0,.8), 0 0 40px -12px rgb(var(--pink-rgb) / .35);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  animation: bvEntra .38s var(--ease) both;
}
.bv-avatar { position: relative; margin-bottom: 4px; }
.bv-tit { margin: 0; font: 700 22px/1.25 var(--font-title); overflow-wrap: anywhere; }
.bv-txt { margin: 0 0 6px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.bv-acoes { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.bv.sai .bv-box { opacity: 0; transform: translateY(12px) scale(.97); transition: opacity .2s ease, transform .2s ease; }
.bv.sai .bv-fundo { opacity: 0; transition: opacity .2s ease; }
html.bv-aberto, html.bv-aberto body { overflow: hidden; }
@keyframes bvEntra { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
