/* Mais Território — app do ACS (bundle offline do APK e página /acs-app).
   Identidade "Território" (out/2026, modelo da tela de login): degradê índigo → azul, ondas, adesivos
   da ACS e de saúde, fonte Inter, cartões claros de canto 18px. Mesma ideia da fundação mm-* do MedCare:
   nenhuma cor solta no componente — tudo sai dos tokens --t-*; os nomes antigos (--acs-*, --gray-*)
   apontam para eles porque o HTML/JS ainda os usa em estilos inline.
   Self-contained (sem CDN): a fonte e os adesivos ficam na raiz do bundle (o APK não cria subpastas). */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("inter.woff2") format("woff2");
}

:root {
    /* Índigo da marca (amostrado do modelo) */
    --t-900: #1f1873;
    --t-800: #2d2394;
    --t-700: #3a2fbf;
    --t-600: #4e39db;
    --t-500: #6a5cf0;
    --t-400: #8d83f5;
    --t-300: #b8b1fa;
    --t-200: #d9d5fd;
    --t-100: #ebe9fe;
    --t-50: #f5f4ff;
    --t-azul: #2e65f1;
    --t-grad-hero: linear-gradient(140deg, #2d2394 0%, #4a3fd0 55%, #3f63ea 100%);
    --t-grad-btn: linear-gradient(90deg, #4e39db 0%, #2e65f1 100%);
    --t-grad-card: linear-gradient(120deg, #3a2fbf 0%, #4e39db 55%, #3f63ea 100%);

    /* Superfícies e texto */
    --t-bg: #f4f6fd;
    --t-surface: #ffffff;
    --t-soft: #f7f8fd;
    --t-soft2: #eff1fa;
    --t-border: #e4e6f3;
    --t-border-soft: #eef0f8;
    --t-border-strong: #cfd3e6;
    --t-ink: #1c1a5e;
    --t-ink2: #2b2f45;
    --t-text: #454b68;
    --t-muted: #6b7190;
    --t-faint: #9ca1bb;

    /* Semânticas (cor · fundo suave · linha) */
    --t-red: #dc2626; --t-red-soft: #fef2f2; --t-red-line: #fecaca;
    --t-orange: #ea580c; --t-orange-soft: #fff7ed; --t-orange-line: #fed7aa;
    --t-amber: #b45309; --t-amber-soft: #fffbeb; --t-amber-line: #fde68a;
    --t-green: #059669; --t-green-soft: #ecfdf5; --t-green-line: #a7f3d0;
    --t-blue: #2563eb; --t-blue-soft: #eff6ff; --t-blue-line: #bfdbfe;

    --t-raio: 18px;
    --t-raio-sm: 12px;
    --t-shadow-sm: 0 1px 2px rgba(35, 28, 122, .06);
    --t-shadow: 0 1px 2px rgba(35, 28, 122, .05), 0 10px 28px -14px rgba(35, 28, 122, .22);
    --t-shadow-lg: 0 6px 14px -6px rgba(35, 28, 122, .18), 0 26px 50px -20px rgba(35, 28, 122, .38);
    --t-focus: 0 0 0 3px rgba(78, 57, 219, .16);
    --t-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --t-ease: cubic-bezier(.16, 1, .3, 1);

    /* Compatibilidade: nomes antigos usados em estilos inline do HTML/JS */
    --acs-900: var(--t-900);
    --acs-800: var(--t-800);
    --acs-700: var(--t-700);
    --acs-600: var(--t-600);
    --acs-500: var(--t-500);
    --acs-100: var(--t-100);
    --acs-50: var(--t-50);
    --ok: var(--t-green);
    --ok-100: #dcfce7;
    --warn: #d97706;
    --warn-100: #fef3c7;
    --err: #c42727;
    --err-100: #fee2e2;
    --info: #0369a1;
    --info-100: #e0f2fe;
    --gray-50: var(--t-soft);
    --gray-100: var(--t-soft2);
    --gray-200: var(--t-border);
    --gray-300: var(--t-border-strong);
    --gray-400: var(--t-faint);
    --gray-500: var(--t-muted);
    --gray-600: var(--t-text);
    --gray-700: #3a3f5c;
    --gray-800: var(--t-ink2);
    --radius: var(--t-raio);
    --shadow: var(--t-shadow);
    --shadow-lg: var(--t-shadow-lg);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--t-bg);
    min-height: 100vh;
    margin: 0;
    font-family: var(--t-font);
    font-size: 15px;
    color: var(--t-ink2);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font-family: var(--t-font); }
::placeholder { color: var(--t-faint); }

.ct { width: 100%; max-width: 1100px; margin-inline: auto; padding-inline: clamp(.9rem, 3.5vw, 2.5rem); }
.sec { margin-top: 1.1rem; }
.hidden { display: none !important; }
.ico-svg { width: 1em; height: 1em; flex-shrink: 0; }

/* ===== Marca (ícone da cruz + "Território" branco) ===== */
.marca { display: flex; align-items: center; gap: 9px; min-width: 0; flex-shrink: 0; }
.marca-ico {
    width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
    background: #fff; color: var(--t-600);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 14px -4px rgba(15, 10, 70, .45), inset 0 -2px 0 rgba(78, 57, 219, .12);
    transform: rotate(-4deg);
}
.marca-ico svg { width: 22px; height: 22px; }
.marca-txt { height: auto; width: min(29vw, 124px); display: block; filter: drop-shadow(0 2px 4px rgba(15, 10, 70, .25)); }
.hero .marca-ico { width: 32px; height: 32px; border-radius: 10px; }
.hero .marca-ico svg { width: 19px; height: 19px; }

/* ===== Hero (painel logado) ===== */
.hero {
    position: relative;
    background: var(--t-grad-hero);
    color: #fff;
    padding: 1.15rem 0 4.4rem;
    overflow: hidden;
}
.hero::before {
    content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
    right: -170px; top: -260px; pointer-events: none;
    background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 64%);
}
.hero-casas {
    position: absolute; right: -6px; bottom: 26px; width: 230px; height: 84px;
    color: #fff; opacity: .11; pointer-events: none;
}
.hero-onda { position: absolute; left: 0; bottom: -1px; width: 100%; height: 60px; display: block; }
.hero-onda .onda-fundo { fill: var(--t-bg); }
.hero-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: nowrap; gap: .8rem; position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.hero-user { display: flex; align-items: center; gap: .7rem; font-size: .88rem; }
.hero h2.hello { position: relative; z-index: 1; margin: 1.15rem 0 0; font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 800; letter-spacing: -.02em; }
.hero p.hello-sub { position: relative; z-index: 1; margin: .25rem 0 0; opacity: .88; font-size: .9rem; max-width: 30rem; }

/* ===== Cartões / botões / campos ===== */
.card {
    background: var(--t-surface); border-radius: var(--t-raio); box-shadow: var(--t-shadow);
    padding: 1.2rem; border: 1px solid var(--t-border);
}
.card-raised { margin-top: -2.9rem; position: relative; z-index: 2; box-shadow: var(--t-shadow-lg); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    background: var(--t-grad-btn); color: #fff; border: 0; border-radius: 999px;
    font-weight: 700; font-size: .98rem; padding: .75rem 1.5rem; cursor: pointer; min-height: 48px;
    box-shadow: 0 10px 22px -10px rgba(46, 101, 241, .65);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-ghost { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .35); color: #fff; border-radius: 999px; padding: .4rem .9rem; font-size: .82rem; cursor: pointer; min-height: 0; }
.btn-ghost:hover { background: rgba(255, 255, 255, .25); }
.btn-claro {
    background: var(--t-surface); border: 1px solid var(--t-border); color: var(--t-600);
    border-radius: 999px; padding: .42rem .9rem; font-size: .8rem; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; gap: .35rem;
}
.btn-claro:active { background: var(--t-50); }

.field { margin-bottom: .95rem; }
.field label { display: block; font-weight: 700; font-size: .72rem; margin-bottom: .32rem; color: var(--t-muted); text-transform: uppercase; letter-spacing: .06em; }
.field input, .field select {
    width: 100%; border: 1px solid var(--t-border); border-radius: 14px;
    padding: .72rem 1rem; font-size: 1rem; color: var(--t-ink2);
    background: var(--t-surface); outline: none; min-height: 48px;
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { border-color: var(--t-500); box-shadow: var(--t-focus); }
.field select {
    appearance: none; -webkit-appearance: none; padding-right: 2.2rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7190' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right .7rem center; background-size: 1.1rem;
}
.senha-wrap { position: relative; }

/* ===== Avisos ===== */
.alert {
    display: flex; align-items: flex-start; gap: .55rem; border-radius: 14px; padding: .7rem .9rem;
    font-size: .84rem; margin-bottom: .8rem; border: 1px solid transparent; line-height: 1.45;
}
.alert-erro { background: var(--t-red-soft); color: #b42318; border-color: var(--t-red-line); }
.alert-info { background: var(--t-50); color: var(--t-700); border-color: var(--t-200); }
.alert-warn { background: var(--t-amber-soft); color: #92400e; border-color: var(--t-amber-line); }
.banner-offline { background: var(--t-amber-soft); color: #92400e; border: 1px solid var(--t-amber-line); border-radius: 14px; padding: .7rem 1rem; font-size: .88rem; display: flex; align-items: center; gap: .55rem; }

/* ===== Login (modelo "Território": cabeçalho em degradê com onda, ACS que muda a cada vez) ===== */
body.modo-login { background: #fff; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body.modo-login .hero { display: none; }   /* hero é do painel; o login tem o próprio cabeçalho */
body.modo-login .rodape { display: none; }
body.modo-login main { flex: 1; display: flex; flex-direction: column; }
body.modo-login #viewLogin { flex: 1; display: flex; flex-direction: column; }

.lg-header {
    position: relative; flex-shrink: 0;
    height: min(44vh, 330px); min-height: 250px;
    background: var(--t-grad-hero);
    overflow: hidden; color: #fff;
}
.lg-luz {
    position: absolute; width: 420px; height: 420px; border-radius: 50%; left: -160px; top: -200px;
    background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 64%); pointer-events: none;
}
.lg-cena { position: absolute; inset: 0; max-width: 480px; margin: 0 auto; }
.lg-marca { position: absolute; left: 22px; top: calc(18% + env(safe-area-inset-top, 0px)); z-index: 2; }
.lg-marca .marca-ico { width: clamp(36px, 10.5vw, 46px); height: clamp(36px, 10.5vw, 46px); border-radius: 13px; }
.lg-marca .marca-ico svg { width: 58%; height: 58%; }
/* a marca ocupa a metade esquerda; o adesivo, a direita — nunca se encostam */
.lg-marca .marca-txt { height: auto; width: min(36vw, 170px); }
.lg-slogan { margin: .45rem 0 0 2px; font-size: .82rem; font-weight: 500; opacity: .92; letter-spacing: .01em; }
.lg-casas {
    position: absolute; left: 6px; bottom: 54px; width: 46%; max-width: 230px; height: auto;
    color: #fff; opacity: .16; z-index: 1; pointer-events: none;
}
.lg-pin { position: absolute; left: 41%; top: 47%; width: 24px; height: 32px; color: #9fb0ff; opacity: .9; z-index: 1; }
.lg-adesivo {
    position: absolute; right: -2px; bottom: 8px; z-index: 2;
    width: min(48vw, 250px); height: auto; max-height: 84%;
    object-fit: contain; object-position: right bottom;
    filter: drop-shadow(0 12px 18px rgba(15, 10, 70, .35));
    transform-origin: 70% 100%;
    animation: adesivoEntra .55s var(--t-ease) both;
}
@keyframes adesivoEntra {
    from { opacity: 0; transform: translateY(18px) rotate(4deg) scale(.94); }
    to { opacity: 1; transform: none; }
}
.lg-onda { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 74px; display: block; z-index: 3; }

.lg-body { max-width: 420px; width: 100%; margin: 0 auto; padding: 1.1rem 1.5rem 1.4rem; flex: 1; }
.lg-titulo { margin: 0; text-align: center; font-size: 1.42rem; font-weight: 800; color: var(--t-ink); letter-spacing: -.02em; }
.lg-sub { text-align: center; color: var(--t-muted); font-size: .9rem; margin: .3rem 0 1.1rem; }
#loginInfo, #loginErro { align-items: center; }
#loginInfo::before, #loginErro::before {
    content: ""; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%;
    background: var(--t-600) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'%3e%3ccircle cx='12' cy='8' r='3.2'/%3e%3cpath d='M5.5 19a6.5 6.5 0 0 1 13 0'/%3e%3c/svg%3e") center/14px no-repeat;
}
#loginErro::before {
    background: #dc2626 url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round'%3e%3cpath d='M12 7v6'/%3e%3cpath d='M12 17h.01'/%3e%3c/svg%3e") center/14px no-repeat;
}

.lg-field { margin-bottom: .95rem; }
.lg-field label { display: block; font-size: .82rem; font-weight: 600; color: var(--t-ink2); margin-bottom: .32rem; }
.lg-input {
    position: relative; display: flex; align-items: center;
    border: 1px solid var(--t-border); border-radius: 14px; background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.lg-input:focus-within { border-color: var(--t-500); box-shadow: var(--t-focus); }
.lg-input > svg { position: absolute; left: 14px; width: 19px; height: 19px; color: var(--t-faint); pointer-events: none; }
.lg-input:focus-within > svg { color: var(--t-600); }
.lg-input input {
    flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
    padding: .82rem .9rem .82rem 44px; font-size: 1.02rem; color: var(--t-ink2); min-height: 52px; border-radius: 14px;
}
.lg-input .lg-olho {
    flex-shrink: 0; width: 46px; height: 46px; margin-right: 3px; border: 0; background: none; cursor: pointer;
    color: var(--t-faint); display: flex; align-items: center; justify-content: center; border-radius: 12px;
}
.lg-input .lg-olho svg { width: 21px; height: 21px; }
.lg-input .lg-olho.on { color: var(--t-600); }

.lg-botao-wrap { display: flex; justify-content: center; margin-top: 1.25rem; }
.lg-botao {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    width: 74%; min-height: 52px; padding: .7rem 2.4rem;
    background: var(--t-grad-btn); color: #fff; border: 0; border-radius: 999px;
    font-size: 1.04rem; font-weight: 700; letter-spacing: .01em; cursor: pointer;
    box-shadow: 0 14px 26px -12px rgba(46, 101, 241, .75);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s;
}
.lg-botao:hover { filter: brightness(1.06); }
.lg-botao:active { transform: scale(.98); }
.lg-botao:disabled { opacity: .65; cursor: default; transform: none; }

.lg-links { display: flex; justify-content: space-between; margin-top: 1.3rem; }
.lg-links a { color: var(--t-600); font-size: .86rem; font-weight: 700; text-decoration: none; }
.lg-links a:hover { text-decoration: underline; }

.lg-ajuda { margin-top: 1rem; border-top: 1px solid var(--t-border-soft); padding-top: .9rem; display: flex; flex-direction: column; gap: .55rem; }
.login-hint { display: flex; gap: .5rem; align-items: flex-start; color: var(--t-muted); font-size: .8rem; line-height: 1.45; }
.login-hint svg { flex-shrink: 0; margin-top: .15rem; color: var(--t-600); }

@media (max-height: 760px) {
    .lg-header { min-height: 220px; }
    .lg-titulo { font-size: 1.28rem; }
    .lg-sub { margin-bottom: .8rem; }
    .lg-field { margin-bottom: .7rem; }
    .lg-input input { min-height: 48px; padding-top: .65rem; padding-bottom: .65rem; }
    .lg-botao { min-height: 48px; }
    .lg-links { margin-top: 1rem; }
}
@media (max-height: 640px) {
    .lg-header { height: 200px; min-height: 200px; }
    .lg-slogan { display: none; }
    .lg-sub { display: none; }
    .lg-casas { display: none; }
}

/* ===== Filtros / abas ===== */
.filtros { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.filtros .field { margin: 0; flex: 1 1 110px; }
.filtros .field select { min-height: 44px; padding: .5rem .8rem; font-size: .95rem; }

/* ===== Navegação inferior fixa (estilo app nativo) ===== */
.navbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: flex; background: var(--t-surface);
    border-top: 1px solid var(--t-border-soft);
    box-shadow: 0 -8px 24px -12px rgba(35, 28, 122, .28);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: .5rem 0 .55rem; background: none; border: 0; cursor: pointer;
    color: var(--t-faint); font-size: .64rem; font-weight: 600; letter-spacing: .01em;
    position: relative; min-width: 0;
}
.nav-item svg { width: 22px; height: 22px; transition: transform .2s var(--t-ease); }
.nav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding-inline: 2px; }
.nav-item.ativa { color: var(--t-600); font-weight: 800; }
.nav-item.ativa svg { transform: translateY(-1px) scale(1.06); }
.nav-item.ativa::before {
    content: ""; position: absolute; top: 0; width: 28px; height: 3px;
    border-radius: 0 0 4px 4px; background: var(--t-grad-btn);
}

/* ===== KPIs ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem; }
.kpi {
    background: var(--t-surface); border: 1px solid var(--t-border); border-radius: var(--t-raio);
    box-shadow: var(--t-shadow-sm); padding: .85rem 1rem;
}
.kpi .valor { font-size: 1.55rem; font-weight: 800; color: var(--t-ink); line-height: 1.2; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .rotulo { color: var(--t-muted); font-size: .78rem; font-weight: 600; }
.kpi .extra { font-size: .76rem; color: var(--t-muted); margin-top: .1rem; }
.kpi .extra.pos { color: var(--t-green); font-weight: 600; }
.kpi .extra.neg { color: var(--t-red); font-weight: 600; }

/* ===== Gráfico 12 meses ===== */
.grafico { display: flex; align-items: flex-end; gap: 5px; height: 170px; padding-top: 16px; }
.gcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.gbar { width: 100%; max-width: 40px; background: var(--t-200); border-radius: 7px 7px 2px 2px; min-height: 2px; }
.gbar.atual { background: linear-gradient(180deg, var(--t-500), var(--t-700)); }
.gval { font-size: .68rem; font-weight: 700; color: var(--t-text); margin-bottom: 2px; }
.gmes { font-size: .64rem; color: var(--t-faint); margin-top: 4px; white-space: nowrap; }

/* ===== Metas Brasil 360 (com o adesivo do indicador) ===== */
.meta-card {
    display: flex; align-items: center; gap: 18px;
    background: var(--t-surface); border: 1px solid var(--t-border); border-radius: var(--t-raio);
    box-shadow: var(--t-shadow-sm); padding: .85rem .95rem .85rem 12px; margin-bottom: .75rem; cursor: pointer;
    position: relative; overflow: hidden;
    transition: transform .12s, box-shadow .15s;
}
.meta-card:active { transform: scale(.99); }
.meta-card::before {
    /* Fundo do adesivo: círculo mais alto que o cartão, com a borda direita fixa a 94px — o adesivo vai de 12 a
       84px e o texto começa em 102px, então o círculo termina antes das letras em qualquer altura de cartão. */
    content: ""; position: absolute; top: -18px; bottom: -18px; right: calc(100% - 94px);
    aspect-ratio: 1; border-radius: 50%; background: var(--t-50); pointer-events: none;
}
.meta-adesivo { position: relative; width: 72px; height: 72px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 4px 6px rgba(35, 28, 122, .18)); }
.meta-corpo { position: relative; flex: 1; min-width: 0; }
.meta-topo { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.meta-cod {
    font-size: .64rem; font-weight: 800; letter-spacing: .06em; color: var(--t-600);
    background: var(--t-100); border-radius: 999px; padding: .14rem .5rem;
}
.meta-card h3 { margin: 0; font-size: .96rem; font-weight: 800; color: var(--t-ink); letter-spacing: -.01em; }
.meta-card .regra { color: var(--t-muted); font-size: .76rem; margin: .2rem 0 .55rem; line-height: 1.4; }
.meta-barra { height: 9px; border-radius: 999px; background: var(--t-soft2); overflow: hidden; margin-bottom: .4rem; }
.meta-barra > div { height: 100%; border-radius: 999px; background: var(--t-grad-btn); }
.meta-nums { display: flex; justify-content: space-between; align-items: baseline; font-size: .75rem; color: var(--t-muted); gap: .3rem; }
.meta-nums > span { white-space: nowrap; }
.meta-nums .ok { color: var(--t-green); font-weight: 800; }
.meta-nums .pend { color: var(--t-red); font-weight: 800; }
.meta-nums .pct { color: var(--t-ink); font-weight: 800; font-size: .86rem; }
.meta-seta { position: relative; flex-shrink: 0; width: 18px; height: 18px; color: var(--t-faint); }

/* ===== Pessoas (busca ativa) ===== */
.pessoa {
    background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 16px;
    box-shadow: var(--t-shadow-sm); padding: .8rem .95rem; margin-bottom: .6rem;
    position: relative; overflow: hidden;
}
.pessoa::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: transparent; }
.pessoa.pendente::before { background: var(--t-red); }
.pessoa.emdia::before { background: var(--t-green); }
.pessoa .nome { font-weight: 700; font-size: .94rem; color: var(--t-ink2); }
.pessoa .linha { display: flex; gap: .9rem; flex-wrap: wrap; color: var(--t-muted); font-size: .78rem; margin-top: .3rem; }
.pessoa .falta { margin-top: .4rem; font-size: .82rem; color: var(--t-red); font-weight: 600; }
.pessoa .falta.prazo { color: var(--warn); }
.pessoa .falta.ok { color: var(--t-green); }
.pessoa .falta.perdida { color: var(--t-muted); font-style: italic; font-weight: 500; }
.pessoa .visitas-feitas { margin-top: .35rem; font-size: .78rem; color: var(--t-green); font-weight: 600; }
.pessoa .visitas-feitas.nenhuma { color: var(--t-faint); font-weight: 500; }
.pessoa.foco { animation: pessoaFoco 1.6s ease 2; }
@keyframes pessoaFoco { 0%, 100% { box-shadow: var(--t-shadow-sm); } 40% { box-shadow: 0 0 0 3px var(--t-300); } }

.badge { display: inline-block; border-radius: 999px; font-size: .66rem; font-weight: 800; padding: .22rem .6rem; letter-spacing: .02em; white-space: nowrap; }
.badge.ok { background: var(--t-green-soft); color: #047857; }
.badge.pend { background: var(--t-red-soft); color: #b42318; }
.badge.prazo { background: var(--t-amber-soft); color: var(--t-amber); }
.badge.perdida { background: var(--t-soft2); color: var(--t-text); }

/* ===== Tabelas (cadastros / detalhe) ===== */
.tabela-wrap { overflow-x: auto; background: var(--t-surface); border: 1px solid var(--t-border); border-radius: var(--t-raio); box-shadow: var(--t-shadow-sm); }
table.tb { border-collapse: collapse; width: 100%; font-size: .86rem; }
.tb th { font-size: .66rem; text-transform: uppercase; letter-spacing: .07em; color: var(--t-faint); background: var(--t-soft); border-bottom: 1px solid var(--t-border); padding: .6rem .8rem; text-align: left; font-weight: 800; }
.tb td { padding: .52rem .8rem; border-bottom: 1px solid var(--t-border-soft); }
.tb tr:last-child td { border-bottom: 0; }
.tb td.num, .tb th.num { text-align: right; font-variant-numeric: tabular-nums; }

.secao-titulo { display: flex; align-items: center; gap: .65rem; margin: 1.25rem 0 .7rem; }
.secao-titulo .ico {
    width: 38px; height: 38px; border-radius: 12px; background: var(--t-100); color: var(--t-600);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.secao-titulo h2 { margin: 0; font-size: 1.04rem; font-weight: 800; color: var(--t-ink); letter-spacing: -.01em; }
.secao-titulo small { color: var(--t-muted); font-size: .78rem; }

.mostrar-mais { width: 100%; border: 1px dashed var(--t-border-strong); background: none; color: var(--t-600); font-weight: 700; border-radius: 14px; padding: .7rem; cursor: pointer; margin-top: .3rem; }

.loading { display: flex; align-items: center; justify-content: center; gap: .6rem; color: var(--t-muted); padding: 2rem; font-size: .9rem; }
.rodape { text-align: center; color: var(--t-faint); font-size: .76rem; padding: 1.6rem 1rem; }
.vazio-ok {
    display: flex; align-items: center; gap: .6rem; background: var(--t-green-soft); color: #065f46;
    border: 1px solid var(--t-green-line); border-radius: 14px; padding: .75rem .9rem; font-size: .86rem; font-weight: 600;
}
.vazio-ok svg { width: 20px; height: 20px; flex-shrink: 0; }

@media (max-width: 480px) {
    .kpis { grid-template-columns: repeat(2, 1fr); }
    .grafico { height: 130px; }
    .gval { font-size: .6rem; }
}

/* ===== Segmentado (sub-abas e filtros de status) ===== */
.seg { display: inline-flex; background: var(--t-soft2); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; border: 1px solid var(--t-border-soft); }
.seg-item {
    border: 0; background: none; color: var(--t-muted); font-size: .8rem; font-weight: 700;
    border-radius: 999px; padding: .44rem .9rem; cursor: pointer; white-space: nowrap;
}
.seg-item.ativa { background: var(--t-surface); color: var(--t-600); box-shadow: 0 2px 8px -2px rgba(35, 28, 122, .25); }

/* ===== Avatar por sexo ===== */
.avatar {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border: 0; cursor: pointer; padding: 0;
}
.avatar svg { width: 22px; height: 22px; }
.avatar.m { background: #dbeafe; color: #2563eb; }
.avatar.f { background: #fce7f3; color: #db2777; }
.avatar.x { background: var(--t-soft2); color: var(--t-faint); }
.avatar.mini { width: 30px; height: 30px; }
.avatar.mini svg { width: 16px; height: 16px; }

/* ===== Domicílios ===== */
.dom-card { background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 16px; box-shadow: var(--t-shadow-sm); margin-bottom: .6rem; overflow: hidden; }
.dom-cab { display: flex; gap: .7rem; align-items: center; padding: .8rem 1rem; cursor: pointer; }
.dom-ico { width: 42px; height: 42px; border-radius: 13px; background: var(--t-100); color: var(--t-600); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dom-cab .end { font-weight: 700; font-size: .92rem; color: var(--t-ink2); }
.dom-cab .sub { color: var(--t-muted); font-size: .78rem; margin-top: .15rem; }
.dom-badges { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .3rem; }
.dom-moradores { border-top: 1px solid var(--t-border-soft); padding: .6rem 1rem .8rem; }
.morador { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--t-border-soft); }
.morador:last-child { border-bottom: 0; }
.morador .nm { font-size: .88rem; font-weight: 600; }
.morador .dt { color: var(--t-muted); font-size: .75rem; }

/* ===== Visitas ===== */
.visita { background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 16px; box-shadow: var(--t-shadow-sm); margin-bottom: .6rem; overflow: hidden; }
.visita-cab { display: flex; align-items: center; gap: .7rem; padding: .75rem 1rem; cursor: pointer; }
.visita-data { flex-shrink: 0; width: 52px; text-align: center; background: var(--t-50); border: 1px solid var(--t-100); border-radius: 12px; padding: .35rem 0; }
.visita-data .d { font-size: 1.08rem; font-weight: 800; color: var(--t-700); line-height: 1.1; }
.visita-data .m { font-size: .62rem; color: var(--t-muted); text-transform: uppercase; font-weight: 700; letter-spacing: .05em; }
.visita-detalhe { border-top: 1px solid var(--t-border-soft); padding: .7rem 1rem .9rem; font-size: .85rem; }
.visita-detalhe .grupo { margin-top: .55rem; }
.visita-detalhe .grupo small { display: block; color: var(--t-faint); font-size: .66rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; margin-bottom: .25rem; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip { background: var(--t-soft2); color: var(--t-text); border-radius: 999px; font-size: .74rem; font-weight: 600; padding: .22rem .6rem; }

/* ===== Movimentações (auditoria) ===== */
.mov { display: flex; align-items: center; gap: .6rem; background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 16px; box-shadow: var(--t-shadow-sm); padding: .7rem 1rem; margin-bottom: .55rem; }
.mov.entrada { border-left: 4px solid var(--t-green); }
.mov.saida { border-left: 4px solid var(--t-red); }
.mov .nm { font-weight: 700; font-size: .9rem; }
.mov .rota { color: var(--t-muted); font-size: .78rem; margin-top: .15rem; }

/* ===== Modal (folha que sobe) ===== */
.modal-fundo {
    position: fixed; inset: 0; z-index: 100; background: rgba(20, 16, 70, .45);
    display: flex; align-items: flex-end; justify-content: center;
    animation: ynexFade .14s ease-out;
}
.modal-caixa {
    background: var(--t-surface); width: 100%; max-width: 560px; max-height: 88vh;
    border-radius: 24px 24px 0 0; display: flex; flex-direction: column;
    animation: modal-sobe .22s var(--t-ease);
    box-shadow: 0 -10px 40px -10px rgba(20, 16, 70, .35);
}
.modal-caixa::before { content: ""; width: 42px; height: 5px; border-radius: 999px; background: var(--t-border-strong); margin: .55rem auto 0; flex-shrink: 0; }
@keyframes modal-sobe { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-topo { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem 1.2rem .6rem; }
.modal-topo h3 { margin: 0; font-size: 1.04rem; font-weight: 800; color: var(--t-ink); }
.modal-topo button { background: var(--t-soft2); border: 0; border-radius: 50%; width: 34px; height: 34px; font-size: 1.2rem; color: var(--t-muted); cursor: pointer; line-height: 1; flex-shrink: 0; }
.modal-conteudo { padding: 0 1.2rem 1.3rem; overflow-y: auto; }
@media (min-width: 640px) {
    .modal-fundo { align-items: center; padding: 1rem; }
    .modal-caixa { border-radius: 24px; }
}

/* ===== Árvore genealógica ===== */
.arv-secao { margin-top: .8rem; }
.arv-secao small { display: block; color: var(--t-faint); font-size: .66rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; margin-bottom: .35rem; }
.arv-no { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; }
.arv-no .nm { font-size: .88rem; font-weight: 600; }
.arv-no .rel { color: var(--t-muted); font-size: .74rem; }
.arv-no.sem-cadastro { opacity: .55; }
.arv-central { background: var(--t-50); border: 1px solid var(--t-100); border-radius: 14px; padding: .5rem .8rem; }

/* ===== Diagnóstico de vínculo domiciliar (modal) ===== */
.diag { display: flex; flex-direction: column; gap: .65rem; word-break: break-word; }
.diag-status {
    display: flex; align-items: center; gap: .6rem;
    border-radius: 14px; padding: .75rem .9rem; font-size: .95rem;
}
.diag-status svg { flex-shrink: 0; }
.diag-status strong { display: block; font-size: .95rem; }
.diag-status small { display: block; font-size: .78rem; opacity: .85; }
.diag-status.ok { background: var(--t-green-soft); color: #065f46; }
.diag-status.warn { background: var(--t-amber-soft); color: #92400e; }
.diag-status.info { background: var(--t-blue-soft); color: #1d4ed8; }
.diag-status.erro { background: var(--t-red-soft); color: #b42318; }
.diag-row { border: 1px solid var(--t-border); border-radius: 12px; padding: .55rem .8rem; background: var(--t-soft); }
.diag-row small { display: block; color: var(--t-faint); font-size: .64rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; margin-bottom: .15rem; }
.diag-row .valor { font-size: .92rem; font-weight: 600; color: var(--t-ink2); line-height: 1.35; }
.diag-row .valor .sub { display: block; font-weight: 400; color: var(--t-muted); font-size: .8rem; margin-top: .1rem; }
.diag-orienta {
    display: flex; gap: .5rem; align-items: flex-start;
    background: var(--t-50); border: 1px solid var(--t-100); border-radius: 12px;
    padding: .65rem .8rem; color: var(--t-800); font-size: .85rem; line-height: 1.45;
}
.diag-orienta svg { flex-shrink: 0; margin-top: .1rem; }

/* ===== Gaveta lateral de filtros ===== */
.filtro-drawer { position: fixed; inset: 0; z-index: 80; background: rgba(20, 16, 70, .40); }
.filtro-painel {
    position: absolute; top: 0; right: 0; bottom: 0; width: min(300px, 84vw);
    background: var(--t-surface); padding: 1.1rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom, 0));
    box-shadow: -12px 0 32px rgba(20, 16, 70, .25);
    display: flex; flex-direction: column; gap: .2rem;
    animation: filtro-entra .2s var(--t-ease);
    overflow-y: auto;
    border-radius: 22px 0 0 22px;
}
@keyframes filtro-entra { from { transform: translateX(100%); } to { transform: none; } }
.filtro-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.filtro-topo h3 { margin: 0; font-size: 1.05rem; font-weight: 800; color: var(--t-ink); }
.filtro-topo button { background: var(--t-soft2); border: 0; border-radius: 50%; width: 34px; height: 34px; font-size: 1.2rem; color: var(--t-muted); cursor: pointer; line-height: 1; }
.filtro-nota { color: var(--t-faint); font-size: .76rem; margin-top: .4rem; }

/* ===== Mini perfil (hero) ===== */
.perfil { display: flex; align-items: center; gap: .55rem; min-width: 0; flex-shrink: 1;
    background: none; border: 0; color: inherit; cursor: pointer; padding: 0; text-align: right; }
.perfil-avatar {
    width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
    background: rgba(255, 255, 255, .18); border: 3px solid rgba(255, 255, 255, .9);
    display: flex; align-items: center; justify-content: center; color: #fff;
    overflow: hidden; position: relative;
    box-shadow: 0 8px 18px -8px rgba(15, 10, 70, .6);
}
.perfil-avatar svg { width: 27px; height: 27px; }
.perfil-txt { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; min-width: 0; }
.perfil-nome { font-weight: 800; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.perfil-equipe { font-size: .76rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.perfil-avatar img, .perfil-foto img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; position: absolute; inset: 0; }
.perfil-rank { font-size: .66rem; opacity: .95; max-width: 40vw; color: #fde68a; font-weight: 700; text-align: right; line-height: 1.35; }
@media (max-width: 380px) {
    .hero .marca-txt { width: 92px; }
    .hero .marca { gap: 7px; }
    .hero-top { gap: .5rem; }
    .perfil-nome, .perfil-equipe, .perfil-rank { max-width: 38vw; }
    .perfil-nome { font-size: .92rem; }
    .perfil-avatar { width: 46px; height: 46px; }
    .perfil-avatar svg { width: 23px; height: 23px; }
}

/* ===== Modal de perfil ===== */
.perfil-modal-topo { display: flex; align-items: center; gap: 1rem; }
.perfil-foto {
    width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0; position: relative; overflow: hidden;
    background: var(--t-100); color: var(--t-600);
    display: flex; align-items: center; justify-content: center;
}
.perfil-modal-nome { font-weight: 800; font-size: 1.05rem; line-height: 1.25; color: var(--t-ink); }

/* Linha de ações do card da pessoa */
.pessoa-acoes { display: flex; gap: .45rem; flex-wrap: wrap; justify-content: flex-end; margin-top: .55rem; padding-top: .5rem; border-top: 1px dashed var(--t-border); }

body.logado .hero-top { gap: 1rem; }

/* ===== Ranking ===== */
.rank-item { display: flex; align-items: center; gap: .7rem; background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 16px; box-shadow: var(--t-shadow-sm); padding: .65rem 1rem; margin-bottom: .5rem; }
.rank-item.eh-voce { border: 2px solid var(--t-500); background: var(--t-50); }
.rank-pos { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .95rem; background: var(--t-soft2); color: var(--t-text); }
.rank-pos.p1 { background: #fef3c7; color: #b45309; }
.rank-pos.p2 { background: #e2e8f0; color: #475569; }
.rank-pos.p3 { background: #ffedd5; color: #c2410c; }
.rank-item .nm { font-weight: 700; font-size: .92rem; }
.rank-item .sub { color: var(--t-muted); font-size: .76rem; margin-top: .1rem; }
.rank-total { text-align: right; flex-shrink: 0; }
.rank-total .v { font-weight: 800; font-size: 1.05rem; color: var(--t-700); }
.rank-total .l { color: var(--t-faint); font-size: .68rem; }

/* ===== Badge do chat ===== */
.chat-badge {
    position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px;
    border-radius: 999px; background: #ef4444; color: #fff;
    font-size: .64rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
    padding: 0 4px; box-shadow: 0 0 0 2px var(--t-700);
}

/* ===== Chat e painéis de tela cheia ===== */
.chat-panel { position: fixed; inset: 0; z-index: 90; background: var(--t-bg); display: flex; flex-direction: column; }
.chat-topo {
    display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    background: var(--t-grad-hero); color: #fff;
    padding: .95rem 1.1rem;
    border-radius: 0 0 22px 22px;
    box-shadow: 0 10px 24px -14px rgba(20, 16, 70, .55);
    position: relative; z-index: 2;
}
.chat-topo h3 { margin: 0; font-size: 1.02rem; font-weight: 800; }
.chat-topo small { opacity: .82; font-size: .74rem; }
.chat-topo button { background: rgba(255, 255, 255, .16); border: 0; border-radius: 50%; width: 36px; height: 36px; font-size: 1.25rem; color: #fff; cursor: pointer; line-height: 1; flex-shrink: 0; }
.chat-mensagens { flex: 1; overflow-y: auto; padding: 1rem .9rem; display: flex; flex-direction: column; gap: .45rem; }
.msg { max-width: 82%; border-radius: 16px; padding: .5rem .75rem; box-shadow: var(--t-shadow-sm); word-break: break-word; }
.msg .autor { font-size: .72rem; font-weight: 700; color: var(--t-600); margin-bottom: .1rem; }
.msg .txt { font-size: .92rem; line-height: 1.4; white-space: pre-wrap; }
.msg .hora { font-size: .64rem; color: var(--t-faint); text-align: right; margin-top: .15rem; }
.msg.outra { background: var(--t-surface); align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--t-border-soft); }
.msg.minha { background: var(--t-100); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg img.chat-img { max-width: 100%; border-radius: 10px; margin-top: .25rem; display: block; }
.msg .mencao { color: var(--t-600); font-weight: 700; }
.chat-dia { align-self: center; background: var(--t-border); color: var(--t-text); font-size: .68rem; font-weight: 700; border-radius: 999px; padding: .2rem .7rem; margin: .4rem 0; }
.chat-input {
    display: flex; align-items: flex-end; gap: .45rem; background: var(--t-surface);
    border-top: 1px solid var(--t-border);
    padding: .55rem .7rem calc(.55rem + env(safe-area-inset-bottom, 0));
}
.chat-input textarea {
    flex: 1; border: 1px solid var(--t-border); border-radius: 18px; resize: none;
    padding: .55rem .9rem; font-size: .95rem; font-family: inherit; outline: none;
    max-height: 110px; background: var(--t-soft);
}
.chat-input textarea:focus { border-color: var(--t-500); box-shadow: var(--t-focus); }
.chat-input button, .chat-input label {
    width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
    background: var(--t-soft2); color: var(--t-text);
}
.chat-input #chatEnviar { background: var(--t-grad-btn); color: #fff; }
.chat-input textarea { min-width: 0; }
@media (max-width: 400px) {
    .chat-input { gap: .3rem; padding-left: .5rem; padding-right: .5rem; }
    .chat-input button, .chat-input label { width: 36px; height: 36px; font-size: 1rem; }
    .chat-input textarea { padding: .5rem .75rem; font-size: .92rem; }
}
.chat-mencoes {
    position: absolute; bottom: 66px; left: .7rem; right: .7rem; z-index: 5;
    background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 14px;
    box-shadow: var(--t-shadow-lg); max-height: 200px; overflow-y: auto;
}
.chat-mencoes button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--t-border-soft); padding: .6rem .9rem; font-size: .9rem; cursor: pointer; }
.chat-mencoes button:last-child { border-bottom: 0; }
.chat-emojis {
    position: absolute; bottom: 66px; left: .7rem; right: .7rem; z-index: 5;
    background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 14px;
    box-shadow: var(--t-shadow-lg); padding: .5rem;
    display: grid; grid-template-columns: repeat(8, 1fr); gap: .2rem;
}
.chat-emojis button { background: none; border: 0; font-size: 1.35rem; padding: .3rem; cursor: pointer; border-radius: 8px; }
.chat-emojis button:active { background: var(--t-soft2); }

/* Barra de online do chat */
.chat-online {
    display: flex; align-items: center; gap: .45rem; flex-wrap: wrap;
    background: var(--t-surface); border-bottom: 1px solid var(--t-border);
    padding: .45rem .9rem; font-size: .78rem; color: var(--t-text);
}
.chat-online .ponto { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; flex-shrink: 0; }
.chat-online .on-nome { background: var(--t-soft2); border-radius: 999px; padding: .18rem .6rem; font-weight: 600; }
.chat-online .on-nome.eu { background: var(--t-100); color: var(--t-800); }
/* Mensagem de localização */
.msg .loc-btn {
    display: inline-flex; align-items: center; gap: .4rem; margin-top: .35rem;
    background: var(--t-grad-btn); color: #fff; border: 0; border-radius: 999px;
    padding: .45rem .85rem; font-size: .82rem; font-weight: 700; cursor: pointer;
}

/* Cards-resumo da aba Visitas (funcionam como filtro por período) */
.vis-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.vis-card {
    background: var(--t-surface); border: 1.5px solid var(--t-border); border-radius: 16px;
    box-shadow: var(--t-shadow-sm); padding: .6rem .5rem; text-align: center; cursor: pointer;
}
.vis-card .v { font-size: 1.28rem; font-weight: 800; color: var(--t-ink); line-height: 1.15; font-variant-numeric: tabular-nums; }
.vis-card .l { font-size: .64rem; color: var(--t-muted); font-weight: 700; }
.vis-card.ativa { border-color: var(--t-600); background: var(--t-50); }
.vis-card.meta .v { color: var(--t-red); }
@media (max-width: 400px) { .vis-cards { gap: .35rem; } .vis-card { padding: .5rem .3rem; } }

/* Avatar do ACS no mapa */
.mapa-avatar { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mapa-avatar-foto {
    width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
    background: var(--t-600); color: #fff; border: 3px solid #fff;
    box-shadow: 0 0 0 4px rgba(78, 57, 219, .25), 0 3px 10px rgba(20, 16, 70, .35);
    display: flex; align-items: center; justify-content: center;
}
.mapa-avatar-foto img { width: 100%; height: 100%; object-fit: cover; }
.mapa-avatar-foto svg { width: 22px; height: 22px; }
.mapa-avatar-nome {
    background: #fff; color: var(--t-ink2); font-size: .66rem; font-weight: 800;
    border-radius: 999px; padding: .15rem .5rem; white-space: nowrap;
    box-shadow: 0 1px 4px rgba(20, 16, 70, .25);
}

/* Cards de microárea (Território › Cadastros) */
.ma-card { background: var(--t-surface); border: 1px solid var(--t-border); border-radius: var(--t-raio); box-shadow: var(--t-shadow-sm); padding: .8rem 1rem; margin-bottom: .6rem; }
.ma-card .titulo { font-weight: 800; font-size: .95rem; color: var(--t-700); margin-bottom: .5rem; }
.ma-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.ma-grid .cel { text-align: center; background: var(--t-soft); border-radius: 12px; padding: .45rem .2rem; }
.ma-grid .cel .v { font-weight: 800; font-size: 1.05rem; color: var(--t-ink2); }
.ma-grid .cel .l { font-size: .62rem; color: var(--t-muted); }
.ma-grid .cel.alerta .v { color: var(--t-red); }
@media (max-width: 400px) { .ma-grid { grid-template-columns: repeat(2, 1fr); } }

/* Gráfico de posições do ranking */
.rank-grafico { background: var(--t-surface); border: 1px solid var(--t-border); border-radius: var(--t-raio); box-shadow: var(--t-shadow-sm); padding: .9rem 1rem .6rem; margin-bottom: .8rem; }
.rank-grafico h4 { margin: 0 0 .5rem; font-size: .88rem; color: var(--t-ink); }
.rank-legenda { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .7rem; color: var(--t-muted); margin-top: .4rem; }
.rank-legenda span { display: flex; align-items: center; gap: .3rem; }
.rank-legenda i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Resultados da busca global */
.bg-secao { padding: .8rem .9rem .2rem; color: var(--t-faint); font-size: .66rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 800; }

/* ===== Barra de ações acima do menu inferior (com a onda) ===== */
.acoes-bar {
    position: fixed; left: 0; right: 0;
    bottom: 58px; /* alinhado por JS à altura real do menu */
    z-index: 59; display: flex; background: var(--t-700);
}
.acoes-onda {
    position: absolute; top: -23px; left: 0; width: 100%; height: 24px;
    display: block; pointer-events: none;
}
.acoes-bar button {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: .4rem;
    background: none; border: 0; border-right: 1px solid rgba(255, 255, 255, .16);
    color: #fff; font-size: .78rem; font-weight: 700; padding: .65rem .2rem; cursor: pointer;
    min-width: 0; position: relative;
}
.acoes-bar button:last-child { border-right: 0; }
.acoes-bar button:active { background: rgba(255, 255, 255, .08); }
.acoes-bar button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acoes-bar .acao-ico { position: relative; display: flex; overflow: visible; flex-shrink: 0; }
.acoes-bar .chat-badge { position: absolute; top: -13px; right: -9px; overflow: visible; text-overflow: clip; }
#viewPainel { padding-bottom: 132px; }
body:not(.modo-login) .rodape { padding-bottom: 128px; }

/* ===== Fichas do e-SUS Território — controles no padrão YNEX =====
   Medidas extraídas do template do sistema (assets/css/styles.css):
   borda de campo var(--t-border), foco sem glow (borda primária 50%), raio .5rem,
   textos .8125rem, sombra rasa 0 .125rem 0 rgba(10,10,10,.04), avisos suaves
   com fundo 10% da cor. Primária mapeada para o índigo do app (--acs-600). */


/* ----- Sheet do FAB ----- */
.sheet-fundo { position: fixed; inset: 0; z-index: 80; }
.sheet-clique { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.sheet {
    position: absolute; left: 0; right: 0; bottom: 0; background: #fff;
    border-radius: 24px 24px 0 0; padding: .5rem .9rem calc(1rem + env(safe-area-inset-bottom));
    animation: sheetSobe .18s ease-out;
}
@keyframes sheetSobe { from { transform: translateY(30%); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-alca { width: 42px; height: 5px; border-radius: 999px; background: var(--t-border); margin: .35rem auto .6rem; }
.sheet-titulo { font-weight: 600; color: var(--t-ink2); margin: 0 .2rem .55rem; font-size: .9375rem; }
.sheet-item {
    display: flex; align-items: center; gap: .75rem; width: 100%;
    background: none; border: 0; border-radius: .5rem; padding: .65rem .5rem;
    cursor: pointer; text-align: left;
}
.sheet-item:active { background: rgba(78, 57, 219, .06); }
.sheet-item .ic {
    width: 46px; height: 46px; border-radius: 14px; display: flex;
    align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0;
}
.sheet-item strong { display: block; color: var(--t-ink2); font-size: .875rem; font-weight: 600; }
.sheet-item small { display: block; color: var(--t-muted); font-size: .75rem; margin-top: 1px; }

/* ----- Painel da ficha ----- */
/* Topo enxuto da ficha: sem barra roxa (o cartão do cidadão já faz o papel de
   cabeçalho) — só o botão de voltar YNEX no canto esquerdo + título discreto. */
.ficha-topo2 {
    display: flex; align-items: center; gap: .65rem;
    background: var(--t-bg); padding: .55rem .9rem .15rem;
    /* SEM env(safe-area-inset-top): no app o SafeArea nativo já desloca o WebView;
       somar o inset aqui criava uma faixa vazia (Android edge-to-edge expõe o env
       mesmo sem viewport-fit=cover em alguns WebViews). */
}
.ficha-voltar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: #fff; border: 1px solid var(--t-border); color: var(--acs-700);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 .125rem 0 rgba(10, 10, 10, .04), 0 4px 10px rgba(15, 23, 42, .08);
}
.ficha-voltar:active { background: var(--t-soft2); transform: scale(.95); }
.ficha-titulo2 { font-weight: 700; font-size: 1rem; color: var(--t-ink2); }
.ficha-body { flex: 1; overflow-y: auto; padding: .55rem .9rem 1.2rem; background: var(--t-bg); }
.ficha-footer {
    display: flex; align-items: center; gap: .6rem;
    padding: .7rem .9rem calc(.7rem + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--t-border);
}

/* Erros de validação: alerta suave com filete lateral (padrão dos avisos YNEX) */
.ficha-erros {
    background: rgba(230, 83, 60, .08); border-inline-start: .25rem solid #e6533c;
    border-bottom: 1px solid rgba(230, 83, 60, .15);
    color: #c0392b; padding: .6rem .9rem; font-size: .8125rem; max-height: 32vh; overflow-y: auto;
}
.ficha-erros strong { color: #a93226; }
.ficha-erros ul { margin: .3rem 0 0 1rem; padding: 0; }

/* Toast no padrão YNEX: cartão branco, borda leve, filete primário */
.ficha-toast {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 130px; z-index: 90;
    background: #fff; color: var(--t-ink2); border: 1px solid var(--t-border);
    border-inline-start: .25rem solid var(--acs-600);
    padding: .7rem .9rem; border-radius: .5rem; font-size: .8425rem; line-height: 1.45;
    max-width: 92vw; box-shadow: 0 .125rem 0 rgba(10, 10, 10, .04), 0 10px 24px rgba(15, 23, 42, .14);
}

/* ----- Botões (YNEX .btn: raio .5rem, primária chapada, label .8125rem 500) ----- */
.f-btn {
    flex: 1 1 50%; min-width: 0; height: 52px; /* altura TRAVADA: irmãos sempre idênticos */
    margin: 0; /* "sec" também é a classe genérica de seção do app (margin-top 1.2rem) — anula a colisão */
    box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    border: 1px solid transparent; border-radius: 14px; padding: 0 .5rem;
    font-weight: 600; font-size: .875rem; cursor: pointer; line-height: 1;
    transition: background .12s, border-color .12s, transform .08s, box-shadow .12s;
}
.f-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-btn svg { flex-shrink: 0; }
.f-btn svg:not([width]) { width: 18px; height: 18px; }
.f-btn:active { transform: scale(.97); }
.f-btn.pri {
    background: var(--t-grad-btn);
    border-color: transparent; color: #fff;
    box-shadow: 0 10px 20px -10px rgba(46, 101, 241, .7);
}
.f-btn.pri:active { filter: brightness(.95); box-shadow: 0 4px 10px -6px rgba(46, 101, 241, .6); }
.f-btn.pri:disabled { opacity: .7; }
.f-btn.sec { background: #fff; border-color: var(--t-border); color: var(--t-text); box-shadow: 0 .125rem 0 rgba(10, 10, 10, .04); }
.f-btn.sec:active { background: var(--t-soft2); }
/* Voltar compacto (só ícone) — deixa os dois botões principais do wizard iguais */
.f-btn.ic-so { flex: 0 0 52px; width: 52px; padding: 0; }
/* Spinner do estado "enviando" */
.f-spin {
    width: 17px; height: 17px; border-radius: 50%; flex-shrink: 0;
    border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff;
    animation: fspin .7s linear infinite;
}
.f-btn.sec .f-spin { border-color: rgba(83, 100, 133, .25); border-top-color: var(--t-text); }
@keyframes fspin { to { transform: rotate(360deg); } }
.f-btn.recusa { background: rgba(230, 83, 60, .1); color: #d6402b; border: 1px dashed rgba(230, 83, 60, .4); width: 100%; }
.f-btn.saida { background: rgba(217, 119, 6, .1); color: #b45309; border: 1px dashed rgba(217, 119, 6, .4); width: 100%; }

/* ----- Cartões de seção (YNEX custom-card: header com divisor) ----- */
.f-sec {
    background: #fff; border: 1px solid var(--t-border); border-radius: 16px;
    padding: .85rem .85rem .6rem; margin-bottom: .8rem;
    box-shadow: 0 .125rem 0 rgba(10, 10, 10, .04);
}
.f-sec-t {
    font-weight: 600; color: var(--t-ink2); font-size: .9375rem;
    margin: -.85rem -.85rem .7rem; padding: .7rem .85rem;
    border-bottom: 1px solid var(--t-border);
}
.f-sec-t em, .f-rotulo em { color: #e6533c; font-style: normal; }
.f-sec.f-desabilitada { opacity: .45; pointer-events: none; }

/* ----- Campos (YNEX form-control/form-select/form-label) ----- */
.f-campo { display: block; margin-bottom: .7rem; }
.f-rotulo { display: block; font-size: .8125rem; font-weight: 500; color: var(--t-text); margin-bottom: .35rem; }
.f-input {
    width: 100%; border: 1px solid var(--t-border); border-radius: 12px;
    padding: .6rem .8rem; font-size: 16px; background: #fff; color: var(--t-ink2);
    appearance: none; -webkit-appearance: none; transition: border-color .12s;
}
select.f-input {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right .6rem center; background-size: 1.1rem;
    padding-right: 2.1rem;
}
.f-input:focus { outline: none; border-color: var(--t-500); box-shadow: var(--t-focus); }
.f-input:disabled { background: var(--t-soft2); color: var(--t-muted); }
.f-input::placeholder { color: var(--t-muted); }
.f-linha2 { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

/* ----- Chips de escolha única (segmentado YNEX: outline → primária ativa) ----- */
.f-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.f-chip {
    border: 1px solid var(--t-border); background: #fff; color: var(--t-text);
    border-radius: 999px; padding: .5rem .85rem; font-size: .8125rem; font-weight: 600;
    cursor: pointer; box-shadow: 0 .125rem 0 rgba(10, 10, 10, .04); transition: all .12s;
}
.f-chip.on { background: var(--t-600); border-color: var(--t-600); color: #fff; box-shadow: 0 6px 14px -8px rgba(78, 57, 219, .8); }

/* ----- Sim/Não (grupo segmentado colado, padrão YNEX btn-group) ----- */
.f-simnao {
    display: flex; align-items: center; justify-content: space-between; gap: .6rem;
    padding: .5rem 0; border-bottom: 1px dashed var(--t-border-soft);
}
.f-simnao .q { font-size: .8425rem; color: var(--t-ink2); font-weight: 500; }
.f-simnao .b { display: inline-flex; flex-shrink: 0; }
.f-simnao .b button {
    border: 1px solid var(--t-border); background: #fff; color: var(--t-muted);
    padding: .4rem .8rem; font-size: .8125rem; font-weight: 600; cursor: pointer;
    transition: all .12s;
}
.f-simnao .b button:first-child { border-radius: .45rem 0 0 .45rem; }
.f-simnao .b button:last-child { border-radius: 0 .45rem .45rem 0; border-inline-start: 0; }
.f-simnao .b button.on.sim { background: #26bf94; border-color: #26bf94; color: #fff; }
.f-simnao .b button.on.nao { background: var(--t-muted); border-color: var(--t-muted); color: #fff; }

/* ----- Checkboxes (YNEX form-check-input) ----- */
.f-multi { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem .5rem; margin-top: .3rem; }
.f-check { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; color: var(--t-ink2); padding: .32rem 0; }
.f-check input {
    width: 18px; height: 18px; flex-shrink: 0; appearance: none; -webkit-appearance: none;
    border: 1px solid var(--t-border); border-radius: .25rem; background: #fff;
    box-shadow: 0 .125rem 0 rgba(10, 10, 10, .04); cursor: pointer; position: relative;
}
.f-check input:checked { background: var(--acs-600); border-color: var(--acs-600); }
.f-check input:checked::after {
    content: ""; position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.4' d='m5 10.5 3.5 3.5L15 7'/%3e%3c/svg%3e") center/80% no-repeat;
}
.f-check.f-off { opacity: .35; }

/* ----- Acordeões (YNEX accordion-button) ----- */
.f-acc { border-top: 1px solid var(--t-border-soft); }
.f-acc summary {
    font-weight: 500; font-size: .875rem; color: var(--t-ink2); cursor: pointer;
    padding: .65rem 0; list-style: none; display: flex; align-items: center; gap: .5rem;
}
.f-acc summary::before {
    content: ""; width: 1rem; height: 1rem; flex-shrink: 0;
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%234f46e5' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m8 6 4 4-4 4'/%3e%3c/svg%3e") center/contain no-repeat;
    transition: transform .15s;
}
.f-acc[open] summary::before { transform: rotate(90deg); }
.f-acc[open] summary { color: var(--acs-700); }
.f-acc-n { color: var(--acs-600); font-size: .74rem; }

/* ----- Auxiliares ----- */
.f-prefill {
    background: rgba(78, 57, 219, .08); border: 1px solid rgba(78, 57, 219, .12);
    border-radius: .45rem; padding: .5rem .65rem;
    font-weight: 600; color: var(--acs-700); font-size: .8425rem; margin-bottom: .6rem;
}
.f-gps { margin: .3rem 0 .4rem; }
.f-gps-chip {
    display: inline-block; background: var(--t-soft2); color: var(--t-muted); border: 1px solid var(--t-border);
    border-radius: 999px; padding: .35rem .7rem; font-size: .75rem; font-weight: 500;
}
.f-gps-chip.ok { background: rgba(38, 191, 148, .1); color: #1a9c78; border-color: rgba(38, 191, 148, .2); }
.f-passos { display: flex; align-items: center; gap: .45rem; margin: .1rem 0 .8rem; flex-wrap: wrap; }
.f-passos span {
    width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 1px solid var(--t-border);
    color: var(--t-muted); font-weight: 600; font-size: .8125rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 .125rem 0 rgba(10, 10, 10, .04);
}
.f-passos span.on { background: var(--acs-600); border-color: var(--acs-600); color: #fff; box-shadow: none; }
.f-passos span.feito { background: rgba(78, 57, 219, .1); border-color: transparent; color: var(--acs-700); }
.f-passos-t { font-weight: 600; color: var(--t-ink2); font-size: .9375rem; }
.f-grid-sn .f-campo { margin: .5rem 0; }
.f-dica { font-size: .8125rem; color: var(--t-muted); margin: 0 0 .6rem; }
.f-vazio { text-align: center; color: var(--t-muted); padding: 1.4rem .8rem; font-size: .875rem; }
.f-fam { border: 1px solid var(--t-border); border-radius: .5rem; padding: .7rem .7rem .3rem; margin-bottom: .7rem; box-shadow: 0 .125rem 0 rgba(10, 10, 10, .04); }
.f-fam-t { font-weight: 600; color: var(--acs-700); margin-bottom: .5rem; display: flex; justify-content: space-between; font-size: .875rem; }
.f-fam-rm { background: none; border: 0; color: #d6402b; font-size: .75rem; font-weight: 600; cursor: pointer; }
.f-autolista {
    border: 1px solid var(--t-border); border-radius: .45rem; margin-top: .3rem;
    max-height: 180px; overflow-y: auto; background: #fff; box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
}
.f-autolista button {
    display: block; width: 100%; text-align: left; background: none; border: 0;
    border-bottom: 1px solid var(--t-border-soft); padding: .55rem .65rem; font-size: .8125rem; cursor: pointer;
}
.f-autolista button:active { background: rgba(78, 57, 219, .06); }

/* ----- Minhas fichas (cartões YNEX com filete de status) ----- */
.fx-card {
    background: #fff; border: 1px solid var(--t-border); border-inline-start-width: .25rem;
    border-radius: .5rem; padding: .7rem .8rem; margin-bottom: .6rem;
    box-shadow: 0 .125rem 0 rgba(10, 10, 10, .04);
}
.fx-card.st-aceita { border-inline-start-color: #26bf94; }
.fx-card.st-rejeitada { border-inline-start-color: #e6533c; }
.fx-card.st-fila { border-inline-start-color: #f5b849; }
.fx-card.st-rascunho { border-inline-start-color: #cbd5e1; }
.fx-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: .2rem; }
.fx-tipo { font-weight: 600; color: var(--t-ink2); font-size: .8425rem; }
.fx-status { font-size: .7rem; font-weight: 600; border-radius: .35rem; padding: .2rem .55rem; }
.fx-status.st-aceita { background: rgba(38, 191, 148, .1); color: #1a9c78; }
.fx-status.st-rejeitada { background: rgba(230, 83, 60, .1); color: #d6402b; }
.fx-status.st-fila { background: rgba(245, 184, 73, .12); color: #ad7a13; }
.fx-status.st-rascunho { background: var(--t-soft2); color: var(--t-muted); }
.fx-quem { font-size: .875rem; font-weight: 600; color: var(--t-ink2); }
.fx-quem.sem { font-weight: 500; color: var(--t-muted); font-style: italic; }
.fx-info { font-size: .75rem; color: var(--t-muted); margin-top: 1px; }
.fx-erro {
    background: rgba(230, 83, 60, .08); color: #c0392b; border-inline-start: .2rem solid #e6533c;
    border-radius: .35rem; padding: .45rem .55rem; font-size: .74rem; margin-top: .4rem; word-break: break-word;
}
.fx-acoes { display: flex; gap: .45rem; margin-top: .55rem; flex-wrap: wrap; }
.fx-acoes button {
    border: 1px solid var(--t-border); background: #fff; color: var(--t-text);
    border-radius: .45rem; padding: .4rem .75rem; font-size: .78rem; font-weight: 600;
    cursor: pointer; box-shadow: 0 .125rem 0 rgba(10, 10, 10, .04);
}
.fx-acoes button:active { background: var(--t-soft2); }
.fx-acoes button.apagar { color: #d6402b; }

/* Botões de visita nas listas + utilitários */
.btn-visita-mini { background: var(--acs-600) !important; color: #fff !important; border-color: var(--acs-600) !important; align-self: center; flex-shrink: 0; }
.btn-visita-mini:active { background: var(--acs-700) !important; }
.arv-visitar { align-self: center; margin-left: auto; flex-shrink: 0; font-size: .72rem !important; padding: .3rem .55rem !important; }
.pessoa-acoes { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .5rem; }
.bundle-versao { opacity: .65; }

/* ----- Medições: slider + digitação com máscara (padrão YNEX) ----- */
.med-campo { padding: .5rem 0 .35rem; border-bottom: 1px dashed var(--t-border-soft); }
.med-topo { display: flex; align-items: center; gap: .5rem; }
.med-rotulo { flex: 1; font-size: .8425rem; font-weight: 500; color: var(--t-ink2); }
.med-rotulo small { color: var(--t-muted); font-weight: 400; }
.med-valor { font-size: .9375rem; font-weight: 700; color: var(--t-muted); min-width: 3.2rem; text-align: right; }
.med-valor.tem { color: var(--acs-700); }
.med-limpar {
    width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--t-border);
    background: #fff; color: #d6402b; font-size: 1rem; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.med-modo {
    width: 30px; height: 30px; border-radius: .45rem; border: 1px solid var(--t-border);
    background: #fff; color: var(--acs-600); cursor: pointer; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 .125rem 0 rgba(10, 10, 10, .04);
}
.med-modo:active { background: rgba(78, 57, 219, .08); }
.med-slider {
    width: 100%; margin: .55rem 0 .3rem; appearance: none; -webkit-appearance: none;
    height: 6px; border-radius: 999px; background: var(--t-border); outline: none;
}
.med-slider::-webkit-slider-thumb {
    appearance: none; -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%;
    background: var(--acs-600); border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .3); cursor: pointer;
}
.med-slider::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%; background: var(--acs-600);
    border: 3px solid #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .3); cursor: pointer;
}
.med-digitar { margin: .45rem 0 .3rem; max-width: 12rem; }

/* ----- Mini-mapa da localização com casinha ----- */
.gps-mapa {
    height: 170px; border-radius: .5rem; border: 1px solid var(--t-border);
    margin-top: .45rem; overflow: hidden;
}
.gps-casa {
    width: 38px; height: 38px; border-radius: 50% 50% 50% 4px; transform: rotate(0deg);
    background: var(--acs-600); border: 3px solid #fff;
    box-shadow: 0 3px 8px rgba(15, 23, 42, .35);
    display: flex; align-items: center; justify-content: center;
}

/* ----- Modal de confirmação YNEX ----- */
.ynex-modal-fundo {
    position: fixed; inset: 0; z-index: 95; background: rgba(15, 23, 42, .5);
    display: flex; align-items: center; justify-content: center; padding: 1.2rem;
    animation: ynexFade .14s ease-out;
}
@keyframes ynexFade { from { opacity: 0; } to { opacity: 1; } }
.ynex-modal {
    background: #fff; border-radius: .65rem; width: 100%; max-width: 340px;
    box-shadow: 0 .125rem 0 rgba(10, 10, 10, .04), 0 24px 56px rgba(15, 23, 42, .3);
    animation: ynexSobe .16s ease-out;
}
@keyframes ynexSobe { from { transform: translateY(14px) scale(.98); } to { transform: none; } }
.ynex-modal-cab {
    display: flex; align-items: center; gap: .6rem;
    padding: .85rem .95rem .3rem;
}
.ynex-modal-icone {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.ynex-modal-icone.pergunta { background: rgba(78, 57, 219, .1); }
.ynex-modal-icone.alerta { background: rgba(245, 184, 73, .15); }
.ynex-modal-icone.perigo { background: rgba(230, 83, 60, .1); }
.ynex-modal-titulo { font-weight: 600; font-size: .9375rem; color: var(--t-ink2); }
.ynex-modal-corpo { padding: .45rem .95rem .3rem; color: var(--t-text); font-size: .8425rem; line-height: 1.5; }
.ynex-modal-corpo .resumo {
    background: var(--t-soft2); border: 1px solid var(--t-border); border-radius: .45rem;
    padding: .5rem .6rem; margin-top: .5rem; font-size: .8125rem; color: var(--t-ink2);
}
.ynex-modal-acoes { display: flex; gap: .55rem; padding: .8rem .95rem .95rem; }
.ynex-modal-acoes .f-btn.perigo { background: #e6533c; border-color: #e6533c; color: #fff; }
.mapa-casa-confirmada { width: 30px; height: 30px; cursor: pointer; }
.territorio-sync {
    font-size: .75rem; color: var(--t-muted); background: #fff; border: 1px solid var(--t-border);
    border-radius: .45rem; padding: .4rem .65rem; margin-bottom: .6rem;
}
.territorio-sync.ok { color: #1a9c78; background: rgba(38, 191, 148, .07); border-color: rgba(38, 191, 148, .18); }

/* ----- Cartão-perfil do cidadão pré-selecionado na ficha ----- */
.pc-card {
    background: #fff; border: 1px solid var(--t-border); border-radius: .65rem;
    margin-bottom: .8rem; overflow: hidden;
    box-shadow: 0 .125rem 0 rgba(10, 10, 10, .04);
}
.pc-topo {
    background: var(--t-grad-card);
    padding: .85rem .9rem; display: flex; align-items: center; gap: .75rem;
}
.pc-avatar {
    width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
    border: 2.5px solid rgba(255, 255, 255, .85);
    display: flex; align-items: center; justify-content: center;
}
.pc-avatar svg { width: 26px; height: 26px; }
.pc-avatar.m { background: #dbeafe; color: #2563eb; }
.pc-avatar.f { background: #fce7f3; color: #db2777; }
.pc-avatar.x { background: #f1f5f9; color: #94a3b8; }
.pc-avatar.mini { width: 34px; height: 34px; border-width: 0; border: 1px solid var(--t-border); }
.pc-avatar.mini svg { width: 17px; height: 17px; }
.pc-nome-box { min-width: 0; }
.pc-nome { color: #fff; font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.pc-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.pc-chips span {
    background: rgba(255, 255, 255, .16); color: #fff; border-radius: 999px;
    font-size: .68rem; font-weight: 600; padding: .18rem .55rem;
}
.pc-docs { display: flex; gap: 1.2rem; padding: .65rem .9rem; border-bottom: 1px solid var(--t-border-soft); }
.pc-doc small { display: block; color: var(--t-muted); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.pc-doc b { color: var(--t-ink2); font-size: .875rem; }
.pc-familia { padding: .6rem .9rem .7rem; }
.pc-fam-t { font-weight: 600; font-size: .8125rem; color: var(--acs-700); margin-bottom: .35rem; }
.pc-fam-lista { display: flex; flex-direction: column; }
.pc-fam-vazio { color: var(--t-muted); font-size: .78rem; }
.pc-membro { display: flex; align-items: center; gap: .55rem; padding: .35rem 0; border-bottom: 1px dashed var(--t-border-soft); }
.pc-membro:last-child { border-bottom: 0; }
.pc-membro-tx { flex: 1; min-width: 0; }
.pc-membro-tx .nm { font-size: .8425rem; font-weight: 600; color: var(--t-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-membro-tx .rel { font-size: .72rem; color: var(--t-muted); }
.pc-linha { display: flex; gap: .55rem; align-items: flex-start; padding: .35rem 0; border-bottom: 1px dashed var(--t-border-soft); }
.pc-linha:last-child { border-bottom: 0; }
.pc-linha-ic { font-size: 1rem; line-height: 1.3; }
.pc-linha-tx small { display: block; color: var(--t-muted); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.pc-linha-tx div { color: var(--t-ink2); font-size: .8425rem; line-height: 1.4; }
.pc-tag.mudou { background: rgba(245, 184, 73, .15); color: #ad7a13; border-radius: .35rem; font-size: .68rem; font-weight: 700; padding: .1rem .4rem; }
.pc-eq { color: var(--t-muted); }
.pc-nunca { color: #d6402b; font-style: normal; font-weight: 600; }
button.pc-avatar { cursor: pointer; }
.pc-badges { padding: .55rem .9rem .6rem; border-bottom: 1px solid var(--t-border-soft); }
.pc-badges-t { font-weight: 600; font-size: .78rem; color: var(--t-text); margin-bottom: .4rem; }
.pc-badge {
    display: inline-block; border-radius: .4rem; padding: .26rem .55rem;
    font-size: .72rem; font-weight: 700; margin: 0 .3rem .3rem 0; border: 1px solid transparent;
}
.pc-badge.alto { background: rgba(230, 83, 60, .12); color: #c0392b; border-color: rgba(230, 83, 60, .2); }
.pc-badge.medio { background: rgba(245, 184, 73, .16); color: #9a6b0c; border-color: rgba(245, 184, 73, .25); }
.pc-badge.info { background: var(--t-soft2); color: var(--t-text); border-color: var(--t-border); }
.pc-badge.ok { background: rgba(38, 191, 148, .12); color: #1a9c78; border-color: rgba(38, 191, 148, .2); }
.pc-sem-doc { color: #ad7a13; font-size: .78rem !important; font-weight: 600; }

/* Indicador de conectividade (estado vem do app nativo) */
.pill-offline {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 132px; z-index: 88;
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--t-ink); color: #fff; border-radius: 999px;
    padding: .42rem .9rem; font-size: .75rem; font-weight: 700;
    box-shadow: 0 8px 20px -6px rgba(20, 16, 70, .5);
}
.pill-offline svg { width: 15px; height: 15px; }

/* ===== Perfil ACE (endemias) ===== */
/* Blocos exclusivos do universo do ACS (metas, busca ativa, série, moradores) */
.modo-ace .so-acs { display: none !important; }
.modo-ace .nav-item[data-aba="busca"],
.modo-ace .nav-item[data-aba="visitas"] { display: none; }
.modo-ace #buscaHandle { display: none; }
/* Painel de endemias só existe no modo ACE */
body:not(.modo-ace) #resumoAce { display: none; }

/* ===== Atalhos do território (ícone em chip, sem emoji) ===== */
.cta-ico {
    width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--t-100); color: var(--t-600);
}
.cta-ico svg { width: 21px; height: 21px; }
.filtros-cta {
    display: flex; align-items: center; gap: .8rem; width: 100%;
    margin-top: 1rem; padding: .95rem 1.05rem; border: 0; cursor: pointer;
    border-radius: var(--t-raio); color: #fff; text-align: left;
    background: var(--t-grad-card);
    box-shadow: 0 14px 28px -16px rgba(46, 60, 200, .8);
    position: relative; overflow: hidden;
}
.filtros-cta::after {
    content: ""; position: absolute; right: -30px; top: -40px; width: 130px; height: 130px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 65%);
}
.filtros-cta .cta-ico { background: rgba(255, 255, 255, .16); color: #fff; }
.filtros-cta strong { font-size: .98rem; }
.filtros-cta small { color: #dcd9ff; font-size: .78rem; }
.filtros-cta .fi-seta { font-size: 1.6rem; color: #dcd9ff; }
.filtros-corpo { flex: 1; overflow-y: auto; padding: 1rem; background: var(--t-bg); }
/* ===== Filtros inteligentes com adesivos (painel de ícones do modelo) =====
   Adesivo = ilustração recortada (filtro-*.png, base reta) + etiqueta em HTML que cobre a base;
   sem adesivo, círculo lilás com o ícone em SVG. Número no canto. Zerado fica apagado. */
.fi-sec-t { margin: 1.25rem .15rem .6rem; font-size: .72rem; font-weight: 800; color: var(--t-faint); text-transform: uppercase; letter-spacing: .08em; }
.fi-sec-t:first-child { margin-top: .2rem; }
.fi-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 560px) { .fi-grade { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 860px) { .fi-grade { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fi-card, .fi-mini {
    position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0;
    padding: .75rem .55rem .7rem; border: 1px solid var(--t-border-soft); border-radius: 20px; cursor: pointer;
    background: linear-gradient(180deg, #fff 0%, #f6f5ff 100%); box-shadow: var(--t-shadow-sm);
    font: inherit; color: inherit; -webkit-tap-highlight-color: transparent;
}
.fi-card:active, .fi-mini:active, .fi-destaque:active { transform: scale(.97); }
.fi-arte { height: 96px; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.fi-arte img { max-width: 86%; max-height: 100%; display: block; filter: drop-shadow(0 6px 8px rgba(60, 45, 190, .16)); }
.fi-circ {
    width: 88px; height: 88px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 38%, #efedff 0%, #d9d4fc 100%); color: var(--t-600);
    border: 5px solid #fff; box-shadow: 0 6px 12px -8px rgba(60, 45, 190, .45); margin-bottom: -6px;
}
.fi-circ svg { width: 42px; height: 42px; }
.fi-etq {
    position: relative; z-index: 1; margin-top: -13px; width: 100%; min-height: 34px;
    display: flex; align-items: center; justify-content: center; text-align: center;
    padding: .3rem .5rem; border-radius: 999px; border: 3px solid #fff;
    background: linear-gradient(135deg, #5b49e2 0%, #3d32c4 100%); color: #fff;
    font-weight: 800; font-size: .78rem; line-height: 1.12; letter-spacing: -.005em;
    box-shadow: 0 6px 12px -6px rgba(46, 35, 170, .6);
}
.fi-qtd {
    position: absolute; top: .45rem; right: .45rem; z-index: 2; min-width: 32px; height: 26px; padding: 0 .5rem;
    border-radius: 999px; background: #fff; color: var(--t-700); font-weight: 900; font-size: .86rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 1.5px var(--t-200), 0 4px 10px -6px rgba(46, 35, 170, .5);
}
.fi-card.vazio, .fi-mini.vazio { background: var(--t-soft); box-shadow: none; }
.fi-card.vazio img, .fi-card.vazio .fi-circ, .fi-mini.vazio img, .fi-mini.vazio .fi-circ { filter: grayscale(.85) opacity(.5); }
.fi-card.vazio .fi-etq, .fi-mini.vazio .fi-etq { background: #a9a5cc; box-shadow: none; }
.fi-card.vazio .fi-qtd, .fi-mini.vazio .fi-qtd { color: var(--t-faint); box-shadow: 0 0 0 1.5px var(--t-border); }

/* Destaques do mês (campanha + aniversariantes): cartão largo */
.fi-destaques { display: grid; grid-template-columns: minmax(0, 1fr); gap: .65rem; }
@media (min-width: 560px) { .fi-destaques { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fi-destaque {
    display: flex; align-items: center; gap: .75rem; text-align: left; cursor: pointer; font: inherit; color: var(--t-ink2);
    padding: .6rem .9rem .6rem .6rem; border-radius: 20px; border: 1.5px solid var(--t-200);
    background: linear-gradient(120deg, #fff 0%, #f1efff 100%); box-shadow: var(--t-shadow-sm);
}
.fi-d-arte { width: 112px; height: 82px; flex-shrink: 0; display: flex; align-items: flex-end; justify-content: center; }
.fi-d-arte img { max-width: 100%; max-height: 100%; display: block; filter: drop-shadow(0 6px 8px rgba(60, 45, 190, .16)); }
.fi-d-arte .fi-circ { width: 72px; height: 72px; margin: 0; }
.fi-d-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.fi-d-tx b { font-size: 1rem; font-weight: 800; color: var(--t-ink); }
.fi-d-tx small { font-size: .78rem; color: var(--t-muted); line-height: 1.3; }
.fi-d-n { margin-top: .25rem; font-size: .8rem; font-weight: 700; color: var(--t-600); }
.fi-d-n strong { font-size: 1.25rem; font-weight: 900; }
.fi-destaque.fi-d-rosa { border-color: #f9a8d4; background: linear-gradient(120deg, #fff 0%, #fdf2f8 100%); }
.fi-destaque.fi-d-rosa .fi-d-n { color: #be185d; }
.fi-destaque.fi-d-azul { border-color: #93c5fd; background: linear-gradient(120deg, #fff 0%, #eff6ff 100%); }
.fi-destaque.fi-d-azul .fi-d-n { color: #1d4ed8; }
.fi-destaque.vazio { opacity: .7; }

/* Lista de uma condição */
.fi-banner {
    display: flex; align-items: center; gap: .85rem; padding: .6rem 1rem .6rem .6rem; margin-bottom: .8rem;
    border-radius: 20px; background: linear-gradient(120deg, #fff 0%, #f1efff 100%); border: 1.5px solid var(--t-200);
}
.fi-banner.fi-d-rosa { border-color: #f9a8d4; background: linear-gradient(120deg, #fff 0%, #fdf2f8 100%); }
.fi-banner.fi-d-azul { border-color: #93c5fd; background: linear-gradient(120deg, #fff 0%, #eff6ff 100%); }
.fi-b-arte { width: 118px; height: 88px; flex-shrink: 0; display: flex; align-items: flex-end; justify-content: center; }
.fi-b-arte img { max-width: 100%; max-height: 100%; display: block; }
.fi-b-arte .fi-circ { width: 76px; height: 76px; margin: 0; }
.fi-b-tx { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .35rem; }
.fi-b-tx strong { font-size: 2rem; font-weight: 900; color: var(--t-700); line-height: 1; letter-spacing: -.02em; }
.fi-b-tx span { font-size: .9rem; font-weight: 700; color: var(--t-ink2); }
.fi-b-tx small { flex-basis: 100%; margin-top: .3rem; font-size: .78rem; color: var(--t-muted); line-height: 1.35; }
.fi-busca { margin-bottom: .55rem; }
.fi-ferr { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-bottom: .7rem; }
.fi-ferr select {
    min-height: 38px; border: 1px solid var(--t-border); border-radius: 12px; background: var(--t-surface);
    padding: 0 .6rem; font: inherit; font-size: .82rem; color: var(--t-ink2); max-width: 100%;
}
.fi-itens { display: flex; flex-direction: column; gap: .5rem; }
.fi-pessoa {
    display: flex; align-items: center; gap: .65rem; padding: .6rem .65rem; border-radius: 16px;
    background: var(--t-surface); border: 1px solid var(--t-border-soft); box-shadow: var(--t-shadow-sm);
    content-visibility: auto; contain-intrinsic-size: auto 76px;
}
.fi-p-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .05rem; }
.fi-p-tx b { font-size: .9rem; color: var(--t-ink); line-height: 1.25; }
.fi-p-tx small { font-size: .75rem; color: var(--t-muted); line-height: 1.3; }
.fi-p-tx .fi-p-end { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-p-niver { display: inline-block; white-space: nowrap; margin-left: .4rem; padding: .05rem .45rem; border-radius: 999px; background: #fef3c7; color: #92400e; font-weight: 700; }
.fi-p-acoes { display: flex; flex-direction: column; gap: .3rem; flex-shrink: 0; }
.fi-p-acoes .btn-claro { min-width: 72px; padding: .38rem .6rem; font-size: .76rem; }
.fi-nota { color: var(--t-faint); font-size: .74rem; margin: 1.1rem .15rem .4rem; line-height: 1.45; }

/* Atalho no Resumo: trilho de adesivos rolando de lado */
.fi-ver-todos { border: 0; background: var(--t-100); color: var(--t-700); font: inherit; font-size: .78rem; font-weight: 800; border-radius: 999px; padding: .4rem .8rem; cursor: pointer; flex-shrink: 0; }
.fi-trilho {
    display: flex; gap: .65rem; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
    scroll-padding-inline: clamp(.9rem, 3.5vw, 2.5rem);
    margin: 0 calc(-1 * clamp(.9rem, 3.5vw, 2.5rem)); padding: .1rem clamp(.9rem, 3.5vw, 2.5rem) .6rem; scrollbar-width: none;
}
.fi-trilho::-webkit-scrollbar { display: none; }
.fi-mini { flex: 0 0 132px; scroll-snap-align: start; padding: .6rem .45rem .55rem; }
.fi-mini .fi-arte { height: 80px; }
.fi-mini .fi-circ { width: 74px; height: 74px; }
.fi-mini .fi-circ svg { width: 36px; height: 36px; }
.fi-mini .fi-etq { font-size: .72rem; min-height: 30px; margin-top: -11px; }
.fi-mini .fi-qtd { min-width: 28px; height: 24px; font-size: .8rem; }
.fi-mais { justify-content: flex-end; background: linear-gradient(160deg, #efedff 0%, #e3defd 100%); }
.fi-mais-ico {
    flex: 1; display: flex; align-items: center; justify-content: center; width: 100%;
    font-size: 1.7rem; font-weight: 900; color: var(--t-600); letter-spacing: -.02em;
}

/* ===== Agrupamento do território ===== */
.grupo-cab {
    position: sticky; top: -1px; z-index: 3;
    background: var(--t-bg); padding: .55rem .2rem .35rem;
    font-weight: 800; color: var(--t-700); font-size: .86rem;
    display: flex; justify-content: space-between; align-items: baseline;
    border-bottom: 2px solid var(--t-100);
}
.grupo-cab small { color: var(--t-muted); font-weight: 600; }

/* ===== Áudio no chat ===== */
.chat-gravando {
    display: flex; align-items: center; gap: .6rem;
    padding: .6rem .9rem; background: var(--t-surface); border-top: 1px solid var(--t-border);
}
.chat-gravando .rec-dot {
    width: 12px; height: 12px; border-radius: 50%; background: #dc2626;
    animation: recPulso 1.1s ease-in-out infinite;
}
@keyframes recPulso { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.chat-gravando .rec-enviar {
    border: 0; cursor: pointer; width: 42px; height: 42px; border-radius: 50%;
    background: var(--t-grad-btn); color: #fff; display: flex; align-items: center; justify-content: center;
}
#chatRecTempo { font-weight: 800; color: var(--t-ink2); font-variant-numeric: tabular-nums; }
.msg audio.chat-audio { width: 220px; max-width: 62vw; height: 40px; margin: .15rem 0; display: block; }

/* ===== Recibos de leitura (✓ ✓✓) e chat offline ===== */
.msg .hora .ticks { font-weight: 800; letter-spacing: -2.5px; margin-left: .25rem; font-size: .8rem; }
.msg .hora .ticks.t-um { color: var(--t-faint); }
.msg .hora .ticks.t-parcial { color: var(--t-faint); }
.msg .hora .ticks.t-todos { color: #38bdf8; }
.msg.minha { cursor: pointer; }
.chat-midia-off {
    background: var(--t-soft2); color: var(--t-muted);
    border: 1px dashed var(--t-border-strong); border-radius: 10px;
    padding: .5rem .7rem; font-size: .8rem; margin: .2rem 0;
}
.chat-sem-rede .chat-input, .chat-sem-rede #chatGravando { display: none !important; }
.chat-sem-rede #chatOnline { display: none !important; }

/* ===== Cadastros em dobro (Configurações → Diagnóstico de cadastro) =====
   Lista inteira em memória, desenhada em blocos de 150 (docs/listas-grandes.md). */
.dup-busca { position: relative; }
.dup-busca input {
    width: 100%; min-height: 46px; box-sizing: border-box; background: var(--t-surface);
    padding: .5rem .8rem .5rem 2.4rem; font-size: .95rem;
    border: 1px solid var(--t-border); border-radius: 14px;
}
.dup-busca input:focus { outline: none; border-color: var(--t-500); box-shadow: var(--t-focus); }
.dup-lupa {
    position: absolute; left: .8rem; top: 50%; transform: translateY(-50%);
    color: var(--t-faint); display: flex; pointer-events: none;
}
.dup-lupa.digitando svg { display: none; }
.dup-lupa.digitando::after {
    content: ""; width: 15px; height: 15px; border-radius: 50%; box-sizing: border-box;
    border: 2px solid rgba(78, 57, 219, .2); border-top-color: var(--t-600);
    animation: fspin .7s linear infinite;
}
.dup-filtros { margin: .55rem 0 .65rem; align-items: center; }
.dup-filtros .f-chip { padding: .38rem .65rem; font-size: .78rem; }
.dup-filtros .f-chip b { font-weight: 800; margin-left: .15rem; }
.dup-filtros select {
    min-height: 32px; padding: .2rem .45rem; font-size: .78rem; color: var(--t-text);
    border: 1px solid var(--t-border); border-radius: 999px; background: var(--t-surface);
}
.dup-lista { position: relative; min-height: 80px; }
.dup-lista.busy .dup-itens, .dup-lista.busy .dup-rodape { opacity: .35; pointer-events: none; transition: opacity .15s; }
.dup-progress { height: 3px; overflow: hidden; background: rgba(78, 57, 219, .12); border-radius: 2px; margin-bottom: .5rem; }
.dup-progress::before {
    content: ""; display: block; height: 100%; width: 35%; background: var(--t-600);
    animation: dupBarra 1.1s ease-in-out infinite;
}
@keyframes dupBarra { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.dup-aviso {
    display: flex; align-items: center; gap: .65rem; margin-bottom: .6rem;
    background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 14px; padding: .7rem .8rem;
    box-shadow: var(--t-shadow-sm);
}
.dup-aviso .f-spin { border-color: rgba(78, 57, 219, .2); border-top-color: var(--t-600); }
.dup-aviso .t { font-weight: 700; font-size: .875rem; color: var(--t-ink2); }
.dup-aviso .h { font-size: .78rem; color: var(--t-muted); }
.dup-card {
    background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 18px;
    padding: .8rem .85rem .7rem; margin-bottom: .65rem; box-shadow: var(--t-shadow-sm);
    content-visibility: auto; contain-intrinsic-size: auto 320px;
}
.dup-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.dup-nome { font-weight: 800; font-size: .96rem; color: var(--t-ink); line-height: 1.25; }
.dup-sub { font-size: .78rem; color: var(--t-muted); margin-top: .1rem; }
.dup-ma {
    flex-shrink: 0; background: var(--t-100); color: var(--t-700);
    font-weight: 800; font-size: .7rem; border-radius: 999px; padding: .2rem .6rem;
}
.dup-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin: .45rem 0 .15rem; }
.dup-tag { font-size: .68rem; font-weight: 800; border-radius: 999px; padding: .14rem .55rem; }
.dup-tag.t-fichas { background: var(--t-orange-soft); color: #c2410c; }
.dup-tag.t-semficha { background: var(--t-red-soft); color: #b91c1c; }
.dup-tag.t-cpf { background: #fefce8; color: #a16207; }
.dup-tag.t-nome { background: var(--t-soft2); color: var(--t-text); }
.dup-tag.t-conferir { background: var(--t-blue-soft); color: #1d4ed8; }
.dup-reg {
    border: 1px solid var(--t-border-soft); background: var(--t-soft); border-radius: 14px;
    margin-top: .5rem; padding: .55rem .65rem; font-size: .8rem; color: var(--t-text); line-height: 1.45;
}
.dup-reg .r-tit { display: flex; align-items: center; gap: .4rem; font-weight: 800; font-size: .76rem; color: var(--t-text); }
.dup-reg .r-tit .n {
    width: 20px; height: 20px; border-radius: 50%; background: var(--t-surface); border: 1px solid var(--t-border);
    display: inline-flex; align-items: center; justify-content: center; font-size: .68rem;
}
.dup-reg.meu { background: var(--t-green-soft); border-color: var(--t-green-line); }
.dup-reg.meu .r-tit { color: #047857; }
.dup-reg .r-dado { color: var(--t-muted); }
.dup-reg .diverge { color: #b45309; font-weight: 700; }
.dup-reg-acoes { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .45rem; }
.btn-alterar {
    display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
    border: 0; border-radius: 999px; padding: .42rem .85rem; font-size: .78rem; font-weight: 800;
    background: var(--t-grad-btn); color: #fff; box-shadow: 0 8px 16px -10px rgba(46, 101, 241, .8);
}
.btn-alterar svg { width: 15px; height: 15px; }
.btn-alterar:disabled { opacity: .6; }
.dup-reg-trava { display: flex; gap: .35rem; align-items: flex-start; font-size: .74rem; color: var(--t-muted); margin-top: .4rem; }
.dup-reg-trava svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: .1rem; }
.dup-dica {
    background: var(--t-50); border-inline-start: .22rem solid var(--t-600);
    border-radius: 10px; font-size: .78rem; color: var(--t-800); padding: .5rem .6rem; margin-top: .55rem;
}
.dup-acoes { display: flex; justify-content: flex-end; margin-top: .5rem; }
.dup-acoes button, .dup-mais button {
    border: 1px solid var(--t-border); background: var(--t-surface); color: var(--t-text); cursor: pointer;
    border-radius: 999px; font-size: .78rem; font-weight: 700; padding: .45rem .85rem;
}
.dup-mais { text-align: center; margin: .2rem 0 .4rem; }
.dup-rodape { text-align: center; font-size: .76rem; color: var(--t-muted); padding: .35rem 0 .2rem; }

/* ===== Recadastro (Território → Buscar antes de cadastrar / Lista de recadastro; dobros que o ACS fez) =====
   Reaproveita os cartões dup-*; a lista inteira fica em memória e desenha em blocos de 150. */
.rec-ctas { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1rem; }
.rec-cta {
    display: flex; align-items: flex-start; gap: .6rem; padding: .8rem .8rem; border: 1px solid var(--t-border);
    border-radius: var(--t-raio); background: var(--t-surface); color: var(--t-ink2); text-align: left; cursor: pointer;
    box-shadow: var(--t-shadow-sm);
}
.rec-cta:active { transform: scale(.98); }
.rec-cta .cta-ico { width: 36px; height: 36px; border-radius: 12px; }
.rec-cta .cta-ico svg { width: 19px; height: 19px; }
.rec-cta-t { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.rec-cta-t strong { font-size: .86rem; color: var(--t-ink); line-height: 1.2; }
.rec-cta-t small { font-size: .74rem; color: var(--t-muted); line-height: 1.3; }
@media (max-width: 380px) {
    .rec-ctas { gap: .45rem; }
    .rec-cta { flex-direction: column; gap: .45rem; padding: .7rem; }
}
.rec-form { padding-bottom: .8rem; }
.rec-form .f-campo { margin-bottom: .55rem; }
.rec-nivel { flex-shrink: 0; font-size: .68rem; font-weight: 800; border-radius: 999px; padding: .2rem .6rem; white-space: nowrap; }
.rec-nivel.n-forte { background: var(--t-red-soft); color: #b91c1c; }
.rec-nivel.n-provavel { background: var(--t-orange-soft); color: #c2410c; }
.rec-nivel.n-conferir { background: var(--t-blue-soft); color: #1d4ed8; }
.rec-nivel.n-parecido { background: var(--t-soft2); color: var(--t-text); }
.rec-card.n-forte { border-color: var(--t-red-line); }
.rec-card.n-provavel { border-color: var(--t-orange-line); }
.rec-orient {
    background: var(--t-amber-soft); border-inline-start: .22rem solid #f59e0b; border-radius: 10px;
    font-size: .8rem; color: #78350f; padding: .45rem .6rem; margin: .5rem 0 .2rem; line-height: 1.45;
}
.rec-causa { font-size: .78rem; font-weight: 700; color: #b91c1c; margin: .4rem 0 .1rem; }
.rec-nada {
    display: flex; align-items: center; gap: .55rem;
    background: var(--t-green-soft); border: 1px solid var(--t-green-line); color: #065f46; border-radius: 14px;
    padding: .75rem .85rem; font-size: .84rem; line-height: 1.45; font-weight: 600;
}
.rec-nada svg { width: 20px; height: 20px; flex-shrink: 0; }
.rec-prog {
    background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 16px; padding: .75rem .85rem; margin-bottom: .6rem;
    box-shadow: var(--t-shadow-sm);
}
.rec-prog .rp-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .86rem; color: var(--t-ink2); }
.rec-prog .rp-top > b { color: var(--t-700); font-size: 1.05rem; }
.rec-prog .rp-barra { height: 8px; background: var(--t-soft2); border-radius: 999px; overflow: hidden; margin: .45rem 0 .4rem; }
.rec-prog .rp-barra span { display: block; height: 100%; background: linear-gradient(90deg, var(--t-600), #10b981); border-radius: 999px; }
.rec-prog .rp-leg { font-size: .74rem; color: var(--t-muted); line-height: 1.4; }
.rec-dom {
    font-size: .78rem; font-weight: 800; color: var(--t-700); margin: .7rem 0 .3rem; padding-left: .1rem;
    content-visibility: auto; contain-intrinsic-size: auto 20px;
}
.rec-dom small { font-weight: 500; color: var(--t-muted); }
.rec-pessoa {
    background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 14px; padding: .55rem .7rem; margin-bottom: .4rem;
    font-size: .8rem; color: var(--t-text); line-height: 1.45;
    content-visibility: auto; contain-intrinsic-size: auto 130px;
}
.rec-pessoa.ok { border-color: var(--t-green-line); }
.rec-pessoa .rp-l1 { display: flex; justify-content: space-between; align-items: flex-start; gap: .4rem; }
.rec-pessoa .rp-nome { font-weight: 700; font-size: .88rem; color: var(--t-ink2); }
.rec-pessoa .rp-resp { font-size: .64rem; font-weight: 800; color: var(--t-700); background: var(--t-100); border-radius: 999px; padding: .05rem .4rem; }
.rec-pessoa .rp-buscar {
    flex-shrink: 0; border: 1px solid var(--t-border); background: var(--t-surface); border-radius: 12px;
    min-width: 36px; min-height: 34px; cursor: pointer; color: var(--t-600);
    display: inline-flex; align-items: center; justify-content: center;
}
.rec-pessoa .rp-buscar svg { width: 17px; height: 17px; }
.rec-pessoa .rp-dado { color: var(--t-muted); }
.rec-pessoa .rp-ok { color: #047857; font-weight: 600; font-size: .76rem; margin-top: .2rem; }
.rec-fci-aviso { border-radius: 14px; padding: .6rem .75rem; margin: .1rem 0 .6rem; font-size: .8rem; line-height: 1.45; }
.rec-fci-aviso.neutro { background: var(--t-soft2); color: var(--t-text); display: flex; align-items: center; gap: .45rem; }
.rec-fci-aviso.neutro .f-spin { border-color: rgba(78, 57, 219, .2); border-top-color: var(--t-600); }
.rec-fci-aviso.ok { background: var(--t-green-soft); color: #065f46; }
.rec-fci-aviso.alerta { background: var(--t-orange-soft); color: #7c2d12; border: 1px solid var(--t-orange-line); }
.rec-fci-aviso .rf-orient { margin-top: .35rem; }

/* ===== Alerta de cadastros em dobro no Resumo (chama a atenção sem gritar) ===== */
.alerta-dobro {
    width: 100%; display: flex; align-items: center; gap: .8rem; text-align: left; cursor: pointer;
    margin: 1rem 0 0; padding: .85rem .9rem; border-radius: var(--t-raio);
    background: linear-gradient(120deg, #fff7ed 0%, #fffbeb 100%);
    border: 1.5px solid #fdba74; color: #7c2d12; font: inherit;
    position: relative; overflow: hidden;
    animation: dobroBrilho 2.6s ease-in-out infinite;
}
.alerta-dobro::after {
    /* reflexo que passa devagar — o "piscar" sutil */
    content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent);
    animation: dobroReflexo 3.8s ease-in-out infinite;
    pointer-events: none;
}
@keyframes dobroBrilho {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, .0), 0 10px 22px -16px rgba(194, 65, 12, .5); }
    50% { box-shadow: 0 0 0 5px rgba(249, 115, 22, .14), 0 10px 22px -16px rgba(194, 65, 12, .5); }
}
@keyframes dobroReflexo { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.alerta-dobro .ad-ico {
    position: relative; width: 48px; height: 48px; flex-shrink: 0; border-radius: 15px;
    background: linear-gradient(140deg, #f97316, #ea580c); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 16px -8px rgba(234, 88, 12, .8);
}
.alerta-dobro .ad-ico svg { width: 24px; height: 24px; }
.alerta-dobro .ad-ponto {
    position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%;
    background: #dc2626; border: 2px solid #fff;
    animation: dobroPonto 1.6s ease-in-out infinite;
}
@keyframes dobroPonto { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.72); opacity: .55; } }
.alerta-dobro .ad-txt { flex: 1; min-width: 0; font-size: .82rem; line-height: 1.4; }
.alerta-dobro .ad-titulo { display: block; font-size: .95rem; font-weight: 800; color: #9a3412; margin-bottom: .1rem; }
.alerta-dobro .ad-cta {
    flex-shrink: 0; align-self: center; font-size: .74rem; font-weight: 800; color: #fff;
    background: #ea580c; border-radius: 999px; padding: .38rem .7rem; white-space: nowrap;
}
@media (max-width: 420px) {
    .alerta-dobro { flex-wrap: wrap; align-items: flex-start; row-gap: .55rem; }
    .alerta-dobro .ad-txt { flex-basis: calc(100% - 62px); }
    .alerta-dobro .ad-cta { margin-left: calc(48px + .8rem); }
}
body[data-aba]:not([data-aba="resumo"]):not([data-aba="cadastros"]) #alertaRecad { display: none; }
@media (prefers-reduced-motion: reduce) {
    .alerta-dobro, .alerta-dobro::after, .alerta-dobro .ad-ponto, .pend-onda { animation: none !important; }
}

/* ===== Mapas (aba Mapa, busca ativa, domicílio) ===== */
.mapa-wrap { position: relative; border-radius: var(--t-raio); overflow: hidden; border: 1px solid var(--t-border); box-shadow: var(--t-shadow); background: var(--t-soft2); }
.mapa-ferr {
    position: absolute; left: 10px; top: 10px; right: 54px; z-index: 3;
    display: flex; gap: .35rem; flex-wrap: wrap; pointer-events: none;
}
.mapa-chip {
    pointer-events: auto; display: inline-flex; align-items: center; gap: .35rem;
    border: 1px solid var(--t-border); background: rgba(255, 255, 255, .95); color: var(--t-text);
    border-radius: 999px; padding: .38rem .7rem; font-size: .74rem; font-weight: 800; cursor: pointer;
    box-shadow: 0 4px 12px -6px rgba(20, 16, 70, .35);
}
.mapa-chip svg { width: 15px; height: 15px; }
.mapa-chip.on { background: var(--t-600); border-color: var(--t-600); color: #fff; }
.mapa-chip.pend.on { background: #dc2626; border-color: #dc2626; }
.mapa-legenda {
    display: flex; flex-wrap: wrap; gap: .35rem .9rem; align-items: center;
    font-size: .74rem; color: var(--t-muted); margin: .55rem .2rem 0;
}
.mapa-legenda span { display: inline-flex; align-items: center; gap: .35rem; }
.mapa-legenda i { display: inline-block; flex-shrink: 0; }
.mapa-legenda .lg-meu { width: 12px; height: 15px; background: var(--t-600); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--t-600); }
.mapa-legenda .lg-outro { width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; border: 1.5px solid #fff; box-shadow: 0 0 0 1px #94a3b8; }
.mapa-legenda .lg-area { width: 16px; height: 10px; border-radius: 3px; background: rgba(78, 57, 219, .16); border: 1.5px solid var(--t-600); }
.mapa-legenda .lg-pend { width: 11px; height: 11px; border-radius: 50%; background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .25); }
.mapa-legenda .lg-ubs { width: 12px; height: 12px; border-radius: 4px; background: #059669; }
.mapa-meu-btn {
    position: absolute; right: 10px; bottom: 10px; z-index: 3;
    display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
    border: 0; border-radius: 999px; padding: .5rem .85rem; font-size: .76rem; font-weight: 800;
    background: var(--t-grad-btn); color: #fff; box-shadow: 0 10px 22px -10px rgba(46, 101, 241, .9);
}
.mapa-meu-btn svg { width: 16px; height: 16px; }
.mapa-rotulo-ma {
    font-size: .64rem; font-weight: 800; color: var(--t-700); background: #fff;
    border: 1.5px solid var(--t-600); border-radius: 999px; padding: .08rem .4rem; white-space: nowrap;
    box-shadow: 0 2px 6px rgba(20, 16, 70, .25); pointer-events: none;
}
.mapa-rotulo-ma.outro { color: #64748b; border-color: #cbd5e1; font-weight: 700; }
.mapboxgl-popup-content { border-radius: 14px !important; font-family: var(--t-font); font-size: .82rem; padding: .7rem .85rem !important; box-shadow: var(--t-shadow-lg) !important; }
.popup-acoes { display: flex; gap: .35rem; margin-top: .45rem; flex-wrap: wrap; }
.popup-acoes button { border: 0; border-radius: 999px; padding: .32rem .65rem; font-size: .74rem; font-weight: 800; cursor: pointer; background: var(--t-100); color: var(--t-700); }
.popup-acoes button.pri { background: var(--t-grad-btn); color: #fff; }

/* Ponto de visita pendente (pisca de leve) */
.pend-pin { position: relative; width: 26px; height: 26px; cursor: pointer; }
.pend-onda {
    position: absolute; inset: 0; border-radius: 50%; background: rgba(220, 38, 38, .45);
    animation: pendOnda 2s ease-out infinite;
}
.pend-pin.prazo .pend-onda { background: rgba(217, 119, 6, .45); }
@keyframes pendOnda { 0% { transform: scale(.6); opacity: .9; } 80%, 100% { transform: scale(2.3); opacity: 0; } }
.pend-nucleo {
    position: absolute; inset: 4px; border-radius: 50%; background: #dc2626; border: 2px solid #fff;
    color: #fff; font-size: .58rem; font-weight: 800; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(20, 16, 70, .4);
}
.pend-pin.prazo .pend-nucleo { background: #d97706; }
.pend-pin.sel .pend-nucleo { background: var(--t-600); }

/* Mapa da busca ativa (antes da lista) */
.busca-mapa-card { margin-top: 1rem; }
.busca-mapa-cab { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.busca-mapa-cab strong { font-size: .92rem; color: var(--t-ink); }
.busca-mapa-cab small { display: block; font-size: .74rem; color: var(--t-muted); font-weight: 500; }
.busca-mapa { height: 250px; width: 100%; }
.busca-mapa-aviso { font-size: .78rem; color: var(--t-muted); padding: .7rem .2rem 0; }
.btn-recolher { border: 1px solid var(--t-border); background: var(--t-surface); color: var(--t-600); border-radius: 999px; padding: .34rem .7rem; font-size: .74rem; font-weight: 800; cursor: pointer; flex-shrink: 0; }

/* Domicílio: mapa + rota a pé */
.dom-mapa { height: 230px; border-radius: 16px; overflow: hidden; border: 1px solid var(--t-border); margin-top: .2rem; background: var(--t-soft2); }
.rota-info {
    display: flex; align-items: center; gap: .7rem; margin-top: .55rem;
    background: var(--t-50); border: 1px solid var(--t-100); border-radius: 14px; padding: .6rem .75rem;
}
.rota-info .ri-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--t-grad-btn); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rota-info .ri-ico svg { width: 21px; height: 21px; }
.rota-info .ri-tempo { font-size: 1.1rem; font-weight: 800; color: var(--t-ink); line-height: 1.1; }
.rota-info .ri-sub { font-size: .74rem; color: var(--t-muted); }
.rota-info.aviso { background: var(--t-soft2); border-color: var(--t-border); }
.rota-info.aviso .ri-ico { background: var(--t-border-strong); }
.casa-pin {
    width: 36px; height: 44px; display: flex; align-items: flex-start; justify-content: center;
    filter: drop-shadow(0 4px 6px rgba(20, 16, 70, .4));
}

/* Perto de você (aba Mapa): visitas pendentes mais próximas para bater a meta */
.perto {
    margin-top: .9rem; background: var(--t-surface); border: 1px solid var(--t-border); border-radius: var(--t-raio);
    box-shadow: var(--t-shadow-sm); overflow: hidden;
}
.perto-cab { display: flex; align-items: center; gap: .65rem; padding: .8rem .9rem .5rem; }
.perto-cab img { width: 46px; height: 46px; object-fit: contain; flex-shrink: 0; }
.perto-cab strong { display: block; font-size: .95rem; color: var(--t-ink); font-weight: 800; }
.perto-cab small { font-size: .76rem; color: var(--t-muted); }
.perto-item {
    display: flex; align-items: center; gap: .65rem; width: 100%; text-align: left; cursor: pointer;
    border: 0; border-top: 1px solid var(--t-border-soft); background: none; padding: .62rem .9rem; font: inherit;
}
.perto-item:active { background: var(--t-50); }
.perto-dist { width: 52px; flex-shrink: 0; text-align: center; }
.perto-dist b { display: block; font-size: .98rem; color: var(--t-700); font-weight: 800; line-height: 1.1; }
.perto-dist small { font-size: .62rem; color: var(--t-muted); font-weight: 700; }
.perto-txt { flex: 1; min-width: 0; }
.perto-txt .pn { font-size: .86rem; font-weight: 700; color: var(--t-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perto-txt .pe { font-size: .74rem; color: var(--t-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perto-codes { display: flex; gap: .25rem; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; max-width: 92px; }
.perto-codes span { font-size: .6rem; font-weight: 800; color: #b91c1c; background: var(--t-red-soft); border-radius: 999px; padding: .1rem .38rem; }
.perto-rodape { font-size: .72rem; color: var(--t-muted); padding: .55rem .9rem .7rem; border-top: 1px solid var(--t-border-soft); }

/* Ficha de atualização: o que o app ainda não leva */
.fci-atual-aviso {
    background: var(--t-amber-soft); border: 1px solid var(--t-amber-line); color: #78350f;
    border-radius: 14px; padding: .6rem .75rem; font-size: .8rem; line-height: 1.45; margin-bottom: .7rem;
}
.fci-atual-aviso ul { margin: .3rem 0 0 1.1rem; padding: 0; }
.fci-atual-origem {
    background: var(--t-50); border: 1px solid var(--t-100); color: var(--t-800);
    border-radius: 14px; padding: .55rem .75rem; font-size: .8rem; line-height: 1.45; margin-bottom: .7rem;
}

/* A ficha abre por cima dos painéis que a chamam (Cadastros em dobro → Alterar cadastro) */
#fichaPanel { z-index: 93; }

/* Spinner (botão Entrar e "Carregando…") — não existia e girava invisível */
.spinner {
    display: inline-block; width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
    border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff;
    animation: fspin .7s linear infinite;
}
.spinner-escuro { border-color: rgba(78, 57, 219, .18); border-top-color: var(--t-600); }
.btn-alterar .f-spin { width: 14px; height: 14px; border-width: 2px; }
.territorio-sync::before {
    content: ""; display: inline-block; width: 13px; height: 13px; margin-right: .35rem; vertical-align: -2px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M21 12a9 9 0 1 1-2.6-6.4M21 3v6h-6'/%3e%3c/svg%3e") center/contain no-repeat;
            mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M21 12a9 9 0 1 1-2.6-6.4M21 3v6h-6'/%3e%3c/svg%3e") center/contain no-repeat;
}
.territorio-sync.ok::before {
    -webkit-mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m5 12.5 4.5 4.5L19 7.5'/%3e%3c/svg%3e");
            mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='m5 12.5 4.5 4.5L19 7.5'/%3e%3c/svg%3e");
}

/* ===== Ranking (cartões por ranking, evolução, pódio e barras) =====
   Cada ranking na sua escala; você em índigo, os demais em cinza; 1º no topo. */
.rk-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.rk-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; min-width: 0; text-align: left;
    background: var(--t-surface); border: 1.5px solid var(--t-border); border-radius: 16px; padding: .65rem .7rem .6rem;
    box-shadow: var(--t-shadow-sm); cursor: pointer; font: inherit; color: inherit;
    transition: border-color .15s, box-shadow .15s, transform .1s;
}
.rk-tile:active { transform: scale(.98); }
.rk-tile.on { border-color: var(--t-600); box-shadow: 0 0 0 3px var(--t-100), var(--t-shadow-sm); }
.rk-tile-rot { font-size: .62rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--t-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rk-tile-pos { font-size: 1.6rem; font-weight: 800; color: var(--t-ink); line-height: 1.05; letter-spacing: -.02em; }
.rk-tile-pos small { font-size: .7rem; font-weight: 600; color: var(--t-muted); letter-spacing: 0; }
.rk-spark { width: 100%; height: 30px; display: block; overflow: visible; }
.rk-spark.vazio { height: 30px; }
.rk-spark polyline { fill: none; stroke: #4e39db; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rk-spark circle { fill: #4e39db; stroke: #fff; stroke-width: 2; }
.rk-spark-topo { stroke: var(--t-border); stroke-width: 1; }
.rk-delta { font-size: .64rem; font-weight: 700; color: var(--t-muted); white-space: nowrap; }
.rk-delta.sobe { color: #047857; }
.rk-delta.desce { color: #b42318; }
@media (max-width: 370px) { .rk-tile { padding: .55rem .5rem; } .rk-tile-pos { font-size: 1.35rem; } .rk-delta { font-size: .6rem; } .rk-tile-rot { letter-spacing: .02em; font-size: .58rem; } }

.rk-card {
    background: var(--t-surface); border: 1px solid var(--t-border); border-radius: var(--t-raio);
    box-shadow: var(--t-shadow-sm); padding: .85rem .9rem .7rem;
}
.rk-card-cab strong { display: block; font-size: .95rem; font-weight: 800; color: var(--t-ink); }
.rk-card-cab small { display: block; font-size: .72rem; color: var(--t-muted); margin-top: .1rem; }
.rk-vazio { font-size: .84rem; color: var(--t-muted); margin: .7rem 0 .2rem; }
.rk-evo-box { position: relative; margin-top: .4rem; }
.rk-evo { width: 100%; height: auto; display: block; overflow: visible; }
.rk-grade { stroke: var(--t-border-soft); stroke-width: 1; }
.rk-eixo { font-size: 10px; fill: var(--t-faint); font-weight: 600; font-family: var(--t-font); }
.rk-regua { fill: var(--t-soft2); }
.rk-regua.sel { fill: var(--t-100); }
.rk-linha { fill: none; stroke: #4e39db; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.rk-ponto { fill: #4e39db; stroke: #fff; stroke-width: 2; }
.rk-ponto.sel { stroke-width: 2.5; }
.rk-rotulo { font-size: 12px; font-weight: 800; fill: var(--t-ink); font-family: var(--t-font); }
.rk-mes { font-size: 10.5px; fill: var(--t-muted); font-weight: 600; font-family: var(--t-font); }
.rk-mes.sel { fill: var(--t-ink); font-weight: 800; }
.rk-alvo { fill: transparent; pointer-events: all; cursor: pointer; }
.rk-alvo.ativo { fill: rgba(78, 57, 219, .05); }
.rk-tip {
    position: absolute; top: -6px; transform: translateX(-50%); pointer-events: none; z-index: 2;
    background: var(--t-ink); color: #fff; border-radius: 10px; padding: .32rem .6rem; text-align: center;
    box-shadow: 0 8px 18px -8px rgba(20, 16, 70, .6); white-space: nowrap;
}
.rk-tip b { display: block; font-size: .86rem; font-weight: 800; }
.rk-tip span { display: block; font-size: .66rem; opacity: .8; }
.rk-evo-rodape { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .72rem; color: var(--t-muted); margin-top: .35rem; }
.rk-evo-rodape span { display: inline-flex; align-items: center; gap: .35rem; }
.rk-chave { display: inline-block; width: 14px; height: 2.5px; border-radius: 2px; background: #4e39db; }

.rk-podio { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: .45rem; margin: .2rem 0 .8rem; }
.rk-pod { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.rk-pod-topo { position: relative; margin-bottom: .35rem; }
.rk-pod-av {
    width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--t-100); color: var(--t-600); border: 3px solid #fff; box-shadow: var(--t-shadow); overflow: hidden; position: relative;
}
.rk-pod-av svg { width: 24px; height: 24px; }
.rk-pod-av.foto img { width: 100%; height: 100%; object-fit: cover; }
.rk-pod-1 .rk-pod-av { width: 64px; height: 64px; }
.rk-pod.eu .rk-pod-av { border-color: #4e39db; }
.rk-pod-med {
    position: absolute; right: -6px; bottom: -4px; min-width: 24px; height: 24px; border-radius: 999px; padding: 0 .3rem;
    display: flex; align-items: center; justify-content: center; font-size: .66rem; font-weight: 800;
    border: 2px solid #fff; box-shadow: 0 2px 6px rgba(20, 16, 70, .25);
}
.rk-pod-1 .rk-pod-med { background: #f5c13d; color: #4a3200; }
.rk-pod-2 .rk-pod-med { background: #cbd5e1; color: #1e293b; }
.rk-pod-3 .rk-pod-med { background: #e0a06b; color: #3b1d06; }
.rk-pod-nome { font-size: .74rem; font-weight: 800; color: var(--t-ink2); line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-pod-val { font-size: .68rem; color: var(--t-muted); font-weight: 600; margin-bottom: .35rem; }
.rk-pod-bloco { display: block; width: 100%; border-radius: 12px 12px 4px 4px; background: linear-gradient(180deg, var(--t-200), var(--t-100)); }
.rk-pod-1 .rk-pod-bloco { height: 70px; background: var(--t-grad-card); }
.rk-pod-2 .rk-pod-bloco { height: 50px; }
.rk-pod-3 .rk-pod-bloco { height: 36px; }

.rk-dist {
    display: flex; align-items: center; gap: .7rem; margin-bottom: .8rem;
    background: var(--t-50); border: 1px solid var(--t-100); border-radius: 16px; padding: .5rem .8rem .5rem .5rem;
}
.rk-dist img { width: 58px; height: 58px; object-fit: contain; flex-shrink: 0; }
.rk-dist p { margin: 0; font-size: .86rem; color: var(--t-ink2); line-height: 1.4; }
.rk-dist b { color: var(--t-700); }
.rk-nota { font-size: .74rem; color: var(--t-muted); margin: -.2rem 0 .8rem; line-height: 1.45; }
.rk-sub-tit { font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--t-faint); margin: .2rem .1rem .45rem; }
.rk-como { background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 16px; box-shadow: var(--t-shadow-sm); padding: .8rem 1rem; margin-bottom: .8rem; }
.rk-como summary { font-weight: 800; font-size: .95rem; color: var(--t-700); cursor: pointer; }
.rk-como-intro { font-size: .84rem; color: var(--t-ink2); line-height: 1.45; margin: .6rem 0 .5rem; }
.rk-passos { list-style: none; counter-reset: passo; margin: 0; padding: 0; }
.rk-passos li { counter-increment: passo; display: flex; gap: .65rem; align-items: flex-start; padding: .45rem 0; border-top: 1px solid var(--t-border-soft); }
.rk-passos li::before { content: counter(passo); flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--t-grad-btn); color: #fff; font-weight: 800; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.rk-passos li div { display: flex; flex-direction: column; gap: .1rem; font-size: .84rem; color: var(--t-ink2); line-height: 1.4; min-width: 0; }
.rk-passos li strong { color: var(--t-ink); }
.rk-passos li b { color: var(--t-700); }
.rk-como-nota { font-size: .74rem; color: var(--t-muted); margin: .5rem 0 0; line-height: 1.45; }
.rk-sem-eu { background: #fff8e6; border: 1px solid #f3dc9b; color: #6b4e00; border-radius: 14px; padding: .65rem .9rem; font-size: .83rem; line-height: 1.4; margin-bottom: .8rem; }
.rank-item.prop .rk-info .nm { white-space: normal; overflow: visible; }
.rk-conta-linha { font-size: .76rem; color: var(--t-ink2); margin-top: .15rem; }
.rk-conta-linha b { color: var(--t-ink); }
.rank-item.eh-voce .rk-conta-linha b { color: var(--t-700); }
.rk-info { flex: 1; min-width: 0; }
.rk-info .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-barra { height: 6px; border-radius: 999px; background: var(--t-soft2); overflow: hidden; margin-top: .4rem; }
.rk-barra span { display: block; height: 100%; border-radius: 999px; background: #c3c7dc; }
.rank-item.eh-voce .rk-barra span { background: #4e39db; }
.rk-av.foto { overflow: hidden; position: relative; }
.rk-av.foto img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.rank-item .avatar { cursor: default; }

/* ===== Conversa direta entre ACS (chat do app) ===== */
#chatPanel { z-index: 92; } /* abre por cima dos Cadastros em dobro, de onde a conversa começa */
.chat-topo .chat-conv-btn { position: relative; display: flex; align-items: center; justify-content: center; }
.chat-topo .chat-conv-btn .chat-badge { top: -4px; right: -4px; box-shadow: 0 0 0 2px #fff; }
#chatVoltarEquipe { display: flex; align-items: center; justify-content: center; }
#chatVoltarEquipe.hidden { display: none !important; }
.chat-direta .chat-online { display: none !important; }
.btn-conversar {
    display: inline-flex; align-items: center; gap: .35rem; cursor: pointer;
    border: 1.5px solid var(--t-200); border-radius: 999px; padding: .4rem .8rem; font-size: .78rem; font-weight: 800;
    background: var(--t-surface); color: var(--t-600);
}
.btn-conversar svg { width: 15px; height: 15px; }
.btn-conversar:disabled { opacity: .6; }
.btn-conversar .f-spin { width: 14px; height: 14px; border-width: 2px; border-color: rgba(78, 57, 219, .2); border-top-color: var(--t-600); }
.conv-item {
    display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left; cursor: pointer; font: inherit;
    background: none; border: 0; border-bottom: 1px solid var(--t-border-soft); padding: .7rem .2rem;
}
.conv-item:active { background: var(--t-50); }
.conv-av {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    background: var(--t-100); color: var(--t-600);
}
.conv-av svg { width: 21px; height: 21px; }
.conv-av.eq { background: var(--t-grad-btn); color: #fff; }
.conv-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-tx b { font-size: .92rem; color: var(--t-ink2); }
.conv-tx small { font-size: .74rem; color: var(--t-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-tx em { font-style: normal; font-size: .78rem; color: var(--t-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .1rem; }
.conv-n { flex-shrink: 0; min-width: 22px; height: 22px; border-radius: 999px; background: #ef4444; color: #fff; font-size: .68rem; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 .35rem; }
.conv-para { display: flex; align-items: center; gap: .65rem; background: var(--t-50); border: 1px solid var(--t-100); border-radius: 14px; padding: .6rem .7rem; }
.conv-para b { display: block; font-size: .92rem; color: var(--t-ink); }
.conv-para small { display: block; font-size: .74rem; color: var(--t-muted); }
.conv-aviso { margin-top: .55rem; background: var(--t-amber-soft); border: 1px solid var(--t-amber-line); color: #78350f; border-radius: 12px; padding: .5rem .65rem; font-size: .78rem; line-height: 1.45; }
.conv-texto { min-height: 210px; resize: vertical; font-size: .9rem; line-height: 1.45; font-family: var(--t-font); }

/* Diagnóstico: campo de busca + botão na mesma linha sem cortar */
#diagBusca { min-width: 0; }
#diagBuscarBtn { flex: 0 0 auto; }
