/* =========================================================
   OLHO AMIGO — design tokens
   Ink badge palette pulled from the brand mark, one bold
   alert-red reserved exclusively for urgent/SOS actions.
   ========================================================= */
:root {
  --ink: #15171a;
  --ink-rgb: 21, 23, 26;
  --panel: #1c1f24;
  --panel-raised: #23272d;
  --panel-translucent: rgba(28, 31, 36, 0.92);
  --line: #2b3037;
  --paper: #eef1f3;
  --muted: #8b929b;
  --iris: #4a92ab;
  --iris-bright: #7ec3dc;
  --alert: #e14b3f;
  --alert-bright: #ff6a5c;
  --alert-dim: #3a1a17;
  --whatsapp: #25d366;
  --whatsapp-dim: #0d2e1a;

  /* cores por categoria — usadas em qualquer lugar que o ícone da
     categoria apareça (card da home, menu lateral, diretório de busca) */
  --cat-orange: #e8823c;
  --cat-orange-bright: #ff9d5c;
  --cat-green: #4caf6b;
  --cat-green-bright: #6fd18a;
  --cat-yellow: #dcb23c;
  --cat-yellow-bright: #f0cc5e;
  --cat-purple: #8a5cc7;
  --cat-purple-bright: #a67ce0;
  --cat-turmalina: #91b33c;
  --cat-turmalina-bright: #b3d666;
  --account-color: #8a5cc7;
  --account-color-bright: #a67ce0;

  --font-display: "Chakra Petch", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* ---------- modo claro ----------
   Mesma paleta, só invertida: fundo claro, texto escuro. As cores de
   destaque (--iris-bright etc.) foram feitas pra funcionar sobre fundo
   ESCURO — em texto sobre fundo branco elas ficam claras demais pra ler
   bem, então aqui cada uma ganha uma versão mais escura e saturada,
   mantendo o mesmo tom, só ajustada pra ter contraste de verdade. */
[data-theme="light"] {
  --ink: #f4f6f7;
  --ink-rgb: 244, 246, 247;
  --panel: #ffffff;
  --panel-raised: #f4f6f7;
  --panel-translucent: rgba(255, 255, 255, 0.92);
  --line: #e0e4e6;
  --paper: #15171a;
  --muted: #6e7680;
  --iris: #4a92ab;
  --iris-bright: #3f7d92;
  --alert: #e14b3f;
  --alert-bright: #de3629;
  --alert-dim: #fbe4e1;
  --whatsapp: #178540;
  --whatsapp-dim: #e3f6e9;

  --cat-orange: #e8823c;
  --cat-orange-bright: #bc5a16;
  --cat-green: #4caf6b;
  --cat-green-bright: #398451;
  --cat-yellow: #dcb23c;
  --cat-yellow-bright: #8e701a;
  --cat-purple: #8a5cc7;
  --cat-purple-bright: #7847ad;
  --cat-turmalina: #91b33c;
  --cat-turmalina-bright: #5c7526;
  --account-color: #8a5cc7;
  --account-color-bright: #7847ad;
}

* { box-sizing: border-box; }

/* Deterrent against casual copying — not real protection, see js/protect.js */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* iOS: disable image press-and-hold menu */
}
input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text; /* keep the search box usable */
}
img { -webkit-user-drag: none; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; }

img { max-width: 100%; display: block; }

::selection { background: var(--iris); color: var(--ink); }

/* focus visibility, kept even though we like clean chrome */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--iris-bright);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- layout shell ---------- */
.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: calc(80px + var(--safe-bottom));
}

.container { padding: 0 20px; }

/* ---------- skip link ---------- */
.skip-link {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 100;
  background: var(--iris);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: top 0.15s ease;
}
.skip-link:focus { top: calc(10px + var(--safe-top)); }

/* ---------- offline status banner ---------- */
.offline-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: center;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: var(--panel-raised);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.offline-banner.is-visible { opacity: 1; transform: translateY(0); }
.offline-banner__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1100;
  padding: calc(14px + var(--safe-top)) 20px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, var(--ink) 70%, rgba(var(--ink-rgb), 0.85) 100%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__left,
.topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar__right { justify-content: flex-end; }
.topbar__center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}
.topbar__center .topbar__titles { text-align: left; }

.topbar__back {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.topbar__back svg { width: 18px; height: 18px; stroke: var(--paper); }

.topbar__icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
}
.topbar__icon--small {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.topbar__titles { min-width: 0; }
.topbar__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--iris-bright);
  display: block;
  margin-bottom: 1px;
}
.topbar__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- hamburger menu trigger (topbar) ---------- */
.menu-trigger {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-trigger svg { width: 20px; height: 20px; }

.theme-toggle {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--iris-bright);
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle svg { width: 18px; height: 18px; }

.account-link {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--account-color-bright);
  display: flex;
  align-items: center;
  justify-content: center;
}
.account-link svg { width: 18px; height: 18px; }

/* ---------- app drawer (side menu) ---------- */
.app-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(10, 11, 13, 0.7);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.app-drawer.is-visible { opacity: 1; }

.app-drawer__panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: min(86vw, 340px);
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(.2,.9,.25,1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.app-drawer.is-visible .app-drawer__panel { transform: translateX(0); }

.app-drawer__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 18px 16px;
  border-bottom: 1px solid var(--line);
}
.app-drawer__logo { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; }
.app-drawer__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  margin: 0;
}
.app-drawer__subtitle {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--iris-bright);
  margin: 1px 0 0;
}
.app-drawer__close {
  margin-left: auto;
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.app-drawer__close svg { width: 14px; height: 14px; }

.app-drawer__nav { padding: 10px 10px 24px; }
.app-drawer__section {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 18px 10px 6px;
}
.app-drawer__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  border-radius: var(--radius-sm);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 500;
}
.app-drawer__link:active { background: var(--panel-raised); }
.app-drawer__link-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--panel-raised);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.app-drawer__link-icon svg { width: 15px; height: 15px; stroke: var(--iris-bright); }
.app-drawer__link-icon[data-color="red"] svg { stroke: var(--alert-bright); }
.app-drawer__link-icon[data-color="orange"] svg { stroke: var(--cat-orange-bright); }
.app-drawer__link-icon[data-color="green"] svg { stroke: var(--cat-green-bright); }
.app-drawer__link-icon[data-color="yellow"] svg { stroke: var(--cat-yellow-bright); }
.app-drawer__link-icon[data-color="purple"] svg { stroke: var(--cat-purple-bright); }
.app-drawer__link-icon[data-color="turmalina"] svg { stroke: var(--cat-turmalina-bright); }

/* ---------- state nudge / subheads inside contact lists ---------- */
.state-nudge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(74, 146, 171, 0.1);
  border: 1px solid rgba(74, 146, 171, 0.3);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 4px;
}
.state-nudge__icon svg { width: 18px; height: 18px; stroke: var(--iris-bright); }

/* Minha Cidade especificamente -- os campos de estado/cidade e o aviso
   de emergência abaixo deles ficavam encostados nas bordas da tela,
   sem margem lateral nenhuma (as duas classes são reaproveitadas em
   outras páginas, por isso o ajuste é só aqui, não nas classes base). */
#oa-city-app .profile-row {
  margin-left: 20px;
  margin-right: 20px;
}
#oa-city-app .state-nudge {
  margin-left: 20px;
  margin-right: 20px;
}
/* aviso de "instale o app" (Emergência e Ocorrências) -- mesmo alinhamento
   lateral dos itens abaixo dele, sem ficar colado na borda. */
#oa-app-nudge-mount .state-nudge {
  margin-left: 20px;
  margin-right: 20px;
}
/* mesmo destaque usado no filtro de status das ocorrências públicas --
   fundo mais escuro que o normal, com um filtro de brilho que funciona
   igual nos temas claro e escuro. */
#oa-local-estado,
#oa-local-cidade {
  filter: brightness(0.85);
}

/* busca de postos de saúde/hospitais -- mesmo destaque escurecido dos
   outros campos, com espaço antes do filtro de tipo pra não ficarem
   grudados. O filtro de tipo virou um campo de seleção comum (igual ao
   de Estado) em vez de chips -- com muitos tipos possíveis e nomes
   longos (o CNES tem bastante), os chips ficavam rolando de lado de um
   jeito que atrapalhava mais do que ajudava. */
#saude-estab-busca {
  filter: brightness(0.85);
}
#saude-estab-busca-label {
  margin-bottom: 16px;
}
#saude-estab-tipo-select {
  filter: brightness(0.85);
}
.state-nudge__dismiss {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  padding: 8px;
  flex-shrink: 0;
}
.state-nudge__text { flex: 1; font-size: 12.5px; color: var(--paper); }
.state-nudge__btn {
  flex-shrink: 0;
  background: var(--iris);
  color: var(--ink);
  border: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 999px;
}
.state-nudge__btn--alert { background: var(--alert); color: #ffffff; }
.contact-list__subhead {
  list-style: none;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 14px 2px 2px;
}
.contact-list__subhead:first-child { margin-top: 2px; }

/* ---------- filter chips (category pages with grouped items) ---------- */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 20px 14px;
}
.filter-chip {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #d5ecf5;
  color: #15171a;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}
.filter-chip[aria-pressed="true"],
.filter-chip[aria-current="page"] {
  background: var(--iris);
  border-color: var(--iris);
  color: var(--ink);
  font-weight: 600;
}
/* chip de "Hospital" na busca de saúde -- fica vermelho sempre, pra se
   destacar dos demais tipos (mais urgente), mesmo quando selecionado. */
.filter-chip--red {
  background: var(--alert);
  border-color: var(--alert);
  color: #ffffff;
}
.filter-chip--red[aria-pressed="true"] {
  background: var(--alert-bright);
  border-color: var(--alert-bright);
  color: #ffffff;
}
.admin-nav { padding-top: 14px; }
.search-box--admin { margin-top: 18px; }

/* ---------- admin: user management ---------- */
.user-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.user-row:last-child { border-bottom: none; }
.user-row__info { min-width: 0; }
.user-row__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14.5px;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.user-row__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0;
}
.user-row__status {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
}
.user-row__status--ativo { background: rgba(74, 146, 171, 0.15); color: var(--iris-bright); }
.user-row__status--bloqueado { background: rgba(225, 75, 63, 0.15); color: var(--alert-bright); }
.user-row__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.user-row__actions form { margin: 0; }

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-actions form { margin: 0; }
.detail-actions__delete { padding: 12px 18px; font-size: 13px; }
.detail-actions--spaced { margin: 10px 20px 0; }
.detail-actions--centered { justify-content: center; margin-top: 10px; }

/* ---------- minha cidade: intro + city header ---------- */
.local-intro {
  font-size: 13.5px;
  color: var(--muted);
  margin: 4px 20px 16px;
}
.local-empty {
  margin: 0 20px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.local-empty__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--paper);
  margin: 0 0 6px;
}
.local-empty__text {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 14px;
}

/* ---------- hero (home only) ---------- */
.hero {
  padding: 28px 20px 8px;
  text-align: center;
  position: relative;
}

.hero__mark {
  position: relative;
  width: 128px;
  height: 128px;
  margin: 4px auto 18px;
  border-radius: 30px;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -18px rgba(74, 146, 171, 0.55);
}
.hero__mark img { width: 100%; height: 100%; object-fit: cover; }

/* signature: a CCTV-style scan line sweeping the badge */
.hero__mark::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  top: 0;
  background: linear-gradient(90deg, transparent, var(--iris-bright), transparent);
  filter: drop-shadow(0 0 6px var(--iris-bright));
  animation: scan 3.6s ease-in-out infinite;
}
@keyframes scan {
  0%   { top: 6%; opacity: 0; }
  8%   { opacity: 1; }
  50%  { top: 92%; opacity: 1; }
  58%  { opacity: 0; }
  100% { top: 92%; opacity: 0; }
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--iris-bright);
  margin: 0 0 10px;
}
.hero__title {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 0 10px;
}
.hero__tagline {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--iris-bright);
  margin: -6px 0 12px;
}
.hero__lede {
  font-size: 15px;
  color: var(--muted);
  max-width: 40ch;
  margin: 0 auto;
}

/* ---------- section headers ---------- */
/* ---------- alertas meteorológicos (home) ---------- */
.clima-section {
  margin: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.clima-section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.clima-card {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--cat-yellow);
  border-radius: var(--radius-sm);
}
.clima-card[data-color="orange"] { border-left-color: var(--cat-orange); }
.clima-card[data-color="red"] { border-left-color: var(--alert); }
.clima-card__scope {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.clima-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.clima-card__icon svg { width: 20px; height: 20px; stroke: var(--cat-yellow-bright); }
.clima-card[data-color="orange"] .clima-card__icon svg { stroke: var(--cat-orange-bright); }
.clima-card[data-color="red"] .clima-card__icon svg { stroke: var(--alert-bright); }
.clima-card__event {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--paper);
  margin: 0;
}
.clima-card__severity {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 1px 0 0;
}
.clima-card__risk {
  font-size: 12.5px;
  color: var(--paper);
  line-height: 1.5;
  margin: 0 0 6px;
}
.clima-card__period {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  margin: 0;
}
.clima-section__attrib {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin: 2px 0 0;
}
.clima-section__attrib a { color: var(--iris-bright); }

.clima-section--nudge {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.clima-section--ok {
  padding: 16px;
  background: rgba(74, 175, 121, 0.08);
  border: 1px solid rgba(74, 175, 121, 0.3);
  border-radius: var(--radius);
}
.clima-section--ok .clima-section__title { margin: 0 0 4px; }
.clima-section--ok .clima-section__attrib { font-size: 12.5px; margin: 0; color: var(--muted); }
.clima-section--nudge .clima-section__title { margin: 0 0 4px; }
.clima-section--nudge .clima-section__attrib {
  font-size: 12.5px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 26px 20px 10px;
}
.section-head--page { padding-top: 22px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* ---------- category cards (home) ---------- */
.cat-grid {
  display: grid;
  gap: 12px;
  padding: 6px 20px 4px;
}

.cat-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px;
  overflow: hidden;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.cat-card:active { transform: scale(0.98); background: var(--panel-raised); }

/* shutter-stripe texture, echoing the eyelashes in the mark, revealed on hover/focus */
.cat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    115deg,
    var(--iris) 0px,
    var(--iris) 2px,
    transparent 2px,
    transparent 10px
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}
.cat-card:hover::before,
.cat-card:focus-visible::before { opacity: 0.06; }

.cat-card__icon {
  position: relative;
  z-index: 1;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: radial-gradient(circle at 30% 30%, var(--iris-bright), var(--iris) 70%);
}
.cat-card__icon svg { width: 24px; height: 24px; stroke: var(--ink); }
.cat-card[data-color="red"] .cat-card__icon {
  background: radial-gradient(circle at 30% 30%, var(--alert-bright), var(--alert) 70%);
}
.cat-card[data-color="orange"] .cat-card__icon {
  background: radial-gradient(circle at 30% 30%, var(--cat-orange-bright), var(--cat-orange) 70%);
}
.cat-card[data-color="green"] .cat-card__icon {
  background: radial-gradient(circle at 30% 30%, var(--cat-green-bright), var(--cat-green) 70%);
}
.cat-card[data-color="yellow"] .cat-card__icon {
  background: radial-gradient(circle at 30% 30%, var(--cat-yellow-bright), var(--cat-yellow) 70%);
}
.cat-card[data-color="purple"] .cat-card__icon {
  background: radial-gradient(circle at 30% 30%, var(--cat-purple-bright), var(--cat-purple) 70%);
}
.cat-card[data-color="turmalina"] .cat-card__icon {
  background: radial-gradient(circle at 30% 30%, var(--cat-turmalina-bright), var(--cat-turmalina) 70%);
}

.cat-card__body { position: relative; z-index: 1; min-width: 0; flex: 1; }
.cat-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16.5px;
  margin: 0 0 2px;
}
.cat-card__desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.cat-card__count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}

.cat-card__chev {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  opacity: 0.5;
}
.cat-card__chev svg { width: 18px; height: 18px; stroke: var(--paper); }

/* ---------- três ligações rápidas (topo da página de Emergência) ---------- */
.quick-call-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 0 20px 14px;
}
.quick-call {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 6px 12px;
  text-decoration: none;
}
.quick-call__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--alert-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--alert-bright);
  margin-bottom: 3px;
}
.quick-call__icon svg { width: 20px; height: 20px; stroke: var(--alert-bright); }
.quick-call__label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--paper);
  text-align: center;
  line-height: 1.2;
}
.quick-call__number {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--alert-bright);
}

/* versão compacta pro grid de duas colunas -- sem descrição nem seta,
   só ícone em cima e título embaixo, centralizado. */
.cat-card--compact {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 18px 10px;
}
.cat-card--compact .cat-card__title {
  font-size: 13.5px;
  margin: 0;
  line-height: 1.25;
}

/* ---------- grade de recursos do perfil (3 colunas) ---------- */
.cat-grid--profile {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.cat-card--profile { padding: 14px 8px; gap: 6px; }
.cat-card--profile .cat-card__title { font-size: 12px; }
.cat-card__profile-resumo {
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* cor do círculo de cada ícone da grade do perfil, pela área a que
   pertence -- mesma paleta já usada nos quadros coloridos do sistema
   (Emergência, Saúde etc.), calculada em cima das variáveis que já
   existem (não precisa duplicar uma cor "dim" nova pra cada tema). */
.cat-card--profile .cat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.cat-card--profile .cat-card__icon svg { width: 20px; height: 20px; }
.cat-card__icon[data-color="iris"] { background: color-mix(in srgb, var(--iris) 18%, transparent); color: var(--iris-bright); }
.cat-card__icon[data-color="iris"] svg { stroke: var(--iris-bright); }
.cat-card__icon[data-color="purple"] { background: color-mix(in srgb, var(--cat-purple) 18%, transparent); color: var(--cat-purple-bright); }
.cat-card__icon[data-color="purple"] svg { stroke: var(--cat-purple-bright); }
.cat-card__icon[data-color="red"] { background: var(--alert-dim); color: var(--alert-bright); }
.cat-card__icon[data-color="red"] svg { stroke: var(--alert-bright); }
.cat-card__icon[data-color="green"] { background: color-mix(in srgb, var(--cat-green) 18%, transparent); color: var(--cat-green-bright); }
.cat-card__icon[data-color="green"] svg { stroke: var(--cat-green-bright); }
.cat-card__icon[data-color="turmalina"] { background: color-mix(in srgb, var(--cat-turmalina) 18%, transparent); color: var(--cat-turmalina-bright); }
.cat-card__icon[data-color="turmalina"] svg { stroke: var(--cat-turmalina-bright); }
.cat-card__icon[data-color="yellow"] { background: color-mix(in srgb, var(--cat-yellow) 18%, transparent); color: var(--cat-yellow-bright); }
.cat-card__icon[data-color="yellow"] svg { stroke: var(--cat-yellow-bright); }
.cat-card__icon[data-color="orange"] { background: color-mix(in srgb, var(--cat-orange) 18%, transparent); color: var(--cat-orange-bright); }
.cat-card__icon[data-color="orange"] svg { stroke: var(--cat-orange-bright); }

/* separador entre "recursos do app" e "conta e sistema" na grade do perfil */
.cat-grid__separador {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.cat-grid__separador::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- contact list (category pages) ---------- */
.contact-list {
  display: grid;
  gap: 12px;
  padding: 4px 20px 8px;
}

.contact-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  border-left: 3px solid var(--iris);
  position: relative;
}
.contact-card.is-urgent { border-left-color: var(--alert); }

/* ---------- bloco compacto de prazos/datas (ex: calendário eleitoral) ---------- */
.oa-timeline-card { border-left-color: var(--cat-yellow); }
.oa-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.oa-timeline__item {
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.oa-timeline__data {
  flex-shrink: 0;
  width: 68px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--cat-yellow-bright);
}
.oa-timeline__texto {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.oa-timeline__texto strong { color: var(--paper); font-weight: 600; }
.oa-timeline__texto span { color: var(--muted); font-size: 12.5px; }

.contact-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.contact-card__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 4px;
}
.contact-card__tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--iris-bright);
  background: rgba(74, 146, 171, 0.12);
  border: 1px solid rgba(74, 146, 171, 0.3);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.contact-card.is-urgent .contact-card__tag {
  color: var(--alert-bright);
  background: rgba(225, 75, 63, 0.12);
  border-color: rgba(225, 75, 63, 0.35);
}

.contact-card__desc {
  font-size: 13.5px;
  color: var(--muted);
  margin: 6px 0 14px;
}
/* when an item has no desc, contactCard() omits the <p> entirely —
   restore a small gap so actions don't sit flush against the header row */
.contact-card__top + .contact-card__actions { margin-top: 10px; }

.contact-card__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- "isso ainda funciona?" ---------- */
.feedback-widget {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.feedback-widget__prompt {
  font-size: 11.5px;
  color: var(--muted);
}
.feedback-widget__btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.feedback-widget__result {
  font-size: 11.5px;
  color: var(--iris-bright);
}

.btn-call {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--iris);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
}
.contact-card.is-urgent .btn-call { background: var(--alert); color: #ffffff; }
.btn-call svg { width: 15px; height: 15px; }

/* versão compacta -- usada onde o botão de ligar divide a linha com
   outras ações menores (editar, remover), como na lista de contatos
   do perfil, pra manter o mesmo peso visual dos vizinhos. */
.btn-call--compact {
  font-size: 11.5px;
  padding: 6px 11px;
  gap: 5px;
}
.btn-call--compact svg { width: 13px; height: 13px; }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #d5ecf5;
  color: #15171a;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.btn-link svg { width: 12.5px; height: 12.5px; stroke: #15171a; }
.btn-link:active { background: #b9dced; border-color: #b9dced; color: #15171a; }

/* dentro do cartão "Ligar + Site + Ver no mapa" (telefone local, PM,
   hospital etc), "Site oficial" ganha destaque em amarelo e "Ver no
   mapa" em laranja claro -- classes próprias, não o .btn-link base,
   pra não afetar cartões de link único (Denúncia, Entidades etc) que
   usam a mesma classe base só pra manter o visual discreto de sempre. */
.btn-link--site {
  background: #f2dd9e;
  border-color: transparent;
  color: #3a2c05;
}
.btn-link--site svg { stroke: #3a2c05; }
.btn-link--site:active { background: #e8c34a; border-color: transparent; color: #3a2c05; }
/* estado "já visitado" nativo do navegador -- em páginas com vários
   botões de navegação (Veículos, Saúde, Denúncia etc.), assim que a
   pessoa toca um deles, ele fica destacado em azul, deixando claro
   qual já foi aberto. Padrão pra todo lugar que usa essa classe. */
.btn-link--site:visited {
  background: var(--iris);
  color: #ffffff;
}
.btn-link--site:visited svg { stroke: #ffffff; }
.btn-link--map {
  background: #f4b27a;
  border-color: transparent;
  color: #4a2a0c;
}
.btn-link--map svg { stroke: #4a2a0c; }
.btn-link--map:active { background: #eda05c; border-color: transparent; color: #4a2a0c; }

/* só o texto em vermelho, mantendo o resto do botão igual -- usado em
   ações de "desligar/desativar", no mesmo espírito do botão Remover
   mas sem mudar o formato/fundo do botão onde ele já está. */
.btn-link--danger { color: var(--alert-bright); }
.btn-link--danger svg { stroke: var(--alert-bright); }

/* mais quatro cores padronizadas pra ações específicas do link de
   emergência (perfil e dependente): copiar em azul, testar em
   vermelho claro, baixar em verde claro, gerar novo link em amarelo
   (reaproveitando --site, já usado pra essa mesma cor em outro lugar). */
.btn-link--blue {
  background: #a9d3f2;
  border-color: transparent;
  color: #0e3b5c;
}
.btn-link--blue svg { stroke: #0e3b5c; }
.btn-link--red-light {
  background: #f3b6ae;
  border-color: transparent;
  color: #5c1912;
}
.btn-link--red-light svg { stroke: #5c1912; }
.btn-link--green-light {
  background: #abe0b4;
  border-color: transparent;
  color: #103b1c;
}
.btn-link--green-light svg { stroke: #103b1c; }

/* botão sólido vermelho -- ações fortes tipo "Bloquear" no admin (fundo
   vermelho pede texto branco, diferente do --danger que é só texto). */
.btn-link--red {
  background: var(--alert);
  border-color: transparent;
  color: #ffffff;
}
.btn-link--red svg { stroke: #ffffff; }
.btn-link--red:active { background: var(--alert-bright); border-color: transparent; color: #ffffff; }

/* botão sólido laranja escuro -- usado no atalho "Minhas ocorrências",
   sempre com o mesmo tom em qualquer tema (não muda com claro/escuro). */
.btn-link--orange-dark {
  background: #b85c1a;
  border-color: transparent;
  color: #ffffff;
}
.btn-link--orange-dark svg { stroke: #ffffff; }
.btn-link--orange-dark:active { background: #9c4c14; border-color: transparent; color: #ffffff; }

.btn-link--purple-dark {
  background: #6b3fa0;
  border-color: transparent;
  color: #ffffff;
}
.btn-link--purple-dark svg { stroke: #ffffff; }
.btn-link--purple-dark:active { background: #57337f; border-color: transparent; color: #ffffff; }

/* botão que precisa chamar atenção de verdade (ex: "Criar conta" no
   login) -- vermelho-alaranjado sólido, transmite "isso é necessário",
   sem usar a mesma cor do "Bloquear" do admin (sentido diferente). */
.btn-link--convite {
  background: #c9412e;
  border-color: transparent;
  color: #ffffff;
}
.btn-link--convite svg { stroke: #ffffff; }
.btn-link--convite:active { background: #a83320; border-color: transparent; color: #ffffff; }

/* ---------- app link button (Site/Play Store/App Store) ---------- */
.btn-app {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(74, 146, 171, 0.14);
  color: var(--iris-bright);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border: 1px solid rgba(74, 146, 171, 0.35);
  border-radius: 999px;
}
.btn-app svg { width: 12.5px; height: 12.5px; stroke: var(--iris-bright); }
.btn-app:active { background: var(--iris); color: var(--ink); border-color: var(--iris); }
.btn-app:active svg { stroke: var(--ink); }

/* Play Store / App Store especificamente -- roxo claro, padronizado em
   todo o sistema. Não mexe no .btn-app base, que também é usado pra
   links de app do TSE e pros contatos da DIVISÃOWEB na página Sobre. */
.btn-app--store {
  background: #d9c9f5;
  border-color: transparent;
  color: #3d2a5c;
}
.btn-app--store svg { stroke: #3d2a5c; }
.btn-app--store:active { background: #c7b0ec; border-color: transparent; color: #3d2a5c; }

/* ---------- whatsapp button ---------- */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--whatsapp);
  color: #06180d;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  padding: 8px 13px;
  border-radius: 999px;
  border: none;
}
.btn-whatsapp svg { width: 14px; height: 14px; }
.btn-whatsapp:active { transform: scale(0.97); }

/* ---------- primary button (error/empty states) ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--iris);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  padding: 15px 28px;
  border-radius: 999px;
  border: none;
  box-shadow: 0 14px 30px -14px rgba(74, 146, 171, 0.55);
}
.btn-primary svg { width: 18px; height: 18px; }
.btn-primary:active { transform: scale(0.98); }

.error-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 10px 20px 8px;
}
.error-actions__secondary {
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- admin: login form ---------- */
.hero--compact { padding-top: 36px; padding-bottom: 8px; }
.hero__title--sm { font-size: 22px; }

/* home: some depois da primeira visita -- a marca já foi apresentada
   uma vez, o topbar já mostra "Olho Amigo", não precisa repetir a
   introdução completa toda vez que a pessoa abre o app de novo. */
/* espaço entre o cabeçalho e a primeira informação da página -- sem
   isso, o conteúdo ficava colado direto na borda do cabeçalho em
   várias páginas. */
#oa-main { padding-top: 14px; }

[data-home-visitada="true"] .hero { display: none; }
[data-home-visitada="true"] #oa-main { padding-top: 14px; }

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 8px 20px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  min-width: 0; /* lets it shrink inside a grid/flex row instead of overflowing */
}
.auth-field input {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.auth-field input:focus { border-color: var(--iris); }

/* ---------- mostrar/esconder senha ---------- */
.password-field { position: relative; }
.password-field input { padding-right: 44px; width: 100%; }
.password-field__toggle {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--muted);
}
.password-field__toggle svg { width: 18px; height: 18px; }
.password-field__toggle:active { color: var(--iris-bright); }

.auth-error {
  margin: 0;
  padding: 10px 12px;
  background: rgba(225, 75, 63, 0.12);
  border: 1px solid rgba(225, 75, 63, 0.35);
  border-radius: var(--radius-sm);
  color: var(--alert-bright);
  font-size: 13px;
}
.auth-error--standalone { margin: 0 20px 14px; }
.auth-success {
  margin: 0;
  padding: 10px 12px;
  background: rgba(74, 146, 171, 0.12);
  border: 1px solid rgba(74, 146, 171, 0.35);
  border-radius: var(--radius-sm);
  color: var(--iris-bright);
  font-size: 13px;
}
.setup-results {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}
.setup-results li { padding: 4px 0; }
.setup-results code { color: var(--paper); }
.auth-hash {
  margin: 0;
  padding: 10px 12px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11.5px;
  word-break: break-all;
  color: var(--paper);
}
.btn-primary--block { width: 100%; justify-content: center; }
/* usado quando o botão vem logo depois de um campo de formulário — dá
   um respiro visual entre os dois, e fica um pouco mais discreto que o
   tamanho padrão (que é pensado pra ser o único botão da tela). */
.btn-primary--form { margin-top: 12px; padding: 12px 24px; font-size: 14px; }

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}
.auth-switch a { color: var(--iris-bright); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- member area: profile page ---------- */
.profile-welcome {
  margin: 8px 20px 0;
  padding: 12px 14px;
  background: rgba(74, 146, 171, 0.12);
  border: 1px solid rgba(74, 146, 171, 0.35);
  border-radius: var(--radius-sm);
  color: var(--iris-bright);
  font-size: 13px;
}
.profile-identity {
  margin: 8px 20px 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.profile-identity__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  margin: 0 0 4px;
}
.profile-identity__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.profile-section {
  margin: 20px 20px 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.profile-section:last-of-type { margin-bottom: 8px; }
.profile-section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14.5px;
  margin: 0 0 4px;
}
.profile-section__title--spaced { margin-top: 6px; }

/* ---------- busca de placa (Veículos > Tabela FIPE) ---------- */
/* campo + botão lado a lado, mas SEM dividir em duas colunas iguais
   (.profile-row faria isso) -- o campo ocupa o espaço disponível e o
   botão fica do tamanho do próprio texto, alinhado pela base do campo. */
.fipe-busca-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}
.fipe-busca-row .auth-field { flex: 1; min-width: 0; }
.fipe-busca-row .btn-primary--form { width: auto; flex-shrink: 0; padding-left: 20px; padding-right: 20px; }

.profile-section__hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 14px;
}
.profile-section__hint--standalone { margin: 0 20px 14px; }
.profile-section__hint--top-spaced { margin-top: 14px; }
.profile-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
}
@media (max-width: 399px) {
  /* on very narrow phones, two fields side by side (e.g. a date picker
     plus a text field) get too cramped — stack them instead */
  .profile-row { grid-template-columns: 1fr; }
}
.profile-contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.profile-contact-list--standalone { margin-left: 20px; margin-right: 20px; }
.profile-contact-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.profile-contact-item__info { flex: 1 1 100%; min-width: 0; }
.profile-contact-item__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--paper);
  margin: 0;
}
.profile-contact-item__detail {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0;
}
.profile-contact-item__remove {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--alert-bright);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
}
.profile-contact-item__actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 100%;
}
.profile-contact-item__actions form { margin: 0; }

/* ---------- perfil: seções recolhíveis (Endereço / Redes sociais) ---------- */
.profile-collapsible__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: none;
  color: var(--paper);
  text-align: left;
  padding: 0;
}
.profile-collapsible__summary {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.profile-collapsible__chevron {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--panel-raised);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease;
}
.profile-collapsible__chevron svg { width: 13px; height: 13px; stroke: var(--muted); transform: rotate(90deg); }
.profile-collapsible[data-collapsed="true"] .profile-collapsible__chevron svg { transform: rotate(-90deg); }
.profile-collapsible__body {
  margin-top: 14px;
}
.profile-collapsible[data-collapsed="true"] .profile-collapsible__body { display: none; }
.profile-collapsible[data-collapsed="true"] .profile-collapsible__summary { color: var(--iris-bright); }
.profile-collapsible[data-collapsed="false"] .profile-collapsible__summary { display: none; }


/* ---------- perfil: campo de rede social + botão testar link ---------- */
.oa-field-with-test {
  display: flex;
  gap: 8px;
  align-items: center;
}
.oa-field-with-test input { flex: 1; min-width: 0; }
.oa-test-link {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--panel-raised);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.oa-test-link svg { width: 16px; height: 16px; stroke: var(--iris-bright); }

/* ---------- perfil: checkbox "número de emergência" ---------- */
.oa-checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  font-size: 13px;
  color: var(--paper);
}
.oa-checkbox-field input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--iris);
  flex-shrink: 0;
}
.oa-checkbox-field input[type="radio"] {
  width: 18px; height: 18px;
  accent-color: var(--iris);
  flex-shrink: 0;
}
.oa-checkbox-field--disabled { color: var(--muted); opacity: 0.7; }

/* ---------- perfil: link público de emergência ---------- */
/* ---------- cores dos quadros do perfil (mesma paleta dos ícones da home) ---------- */
.profile-section[data-color="red"] { --profile-accent: var(--alert); }
.profile-section[data-color="orange"] { --profile-accent: var(--cat-orange); }
.profile-section[data-color="yellow"] { --profile-accent: var(--cat-yellow); }
.profile-section[data-color="green"] { --profile-accent: var(--cat-green); }
.profile-section[data-color="turmalina"] { --profile-accent: var(--cat-turmalina); }
.profile-section[data-color="purple"] { --profile-accent: var(--cat-purple); }
.profile-section[data-color="iris"] { --profile-accent: var(--iris); }
.profile-section[data-color] {
  border-color: color-mix(in srgb, var(--profile-accent) 40%, transparent);
  background: color-mix(in srgb, var(--profile-accent) 12%, var(--panel));
}
.profile-section[data-color] .profile-collapsible__chevron {
  background: color-mix(in srgb, var(--profile-accent) 22%, var(--panel-raised));
}
/* botão dentro de um cartão colorido (ex: página Serviços) usa a
   mesma cor do cartão como tema, em vez do cinza padrão do .btn-link —
   e sempre com um respiro entre o texto e o botão. */
.profile-section[data-color] > .btn-link {
  margin-top: 10px;
  background: var(--profile-accent);
  border-color: transparent;
  color: #ffffff;
}
.profile-section[data-color] > .btn-link svg { stroke: #ffffff; }
.profile-section[data-color] > .btn-link:active {
  background: color-mix(in srgb, var(--profile-accent) 80%, black);
  border-color: transparent;
  color: #ffffff;
}

/* mesma ideia, pras páginas de recurso do perfil que viraram página
   própria (auth-card) -- a cor do cartão e do botão bate com a cor do
   ícone dela na grade do perfil, pra não ficar destoante como ficou
   com "Lembrete de remédio" (ícone de uma cor, página de outra). */
.auth-card[data-color="red"] { --profile-accent: var(--alert); }
.auth-card[data-color="orange"] { --profile-accent: var(--cat-orange); }
.auth-card[data-color="yellow"] { --profile-accent: var(--cat-yellow); }
.auth-card[data-color="green"] { --profile-accent: var(--cat-green); }
.auth-card[data-color="turmalina"] { --profile-accent: var(--cat-turmalina); }
.auth-card[data-color="purple"] { --profile-accent: var(--cat-purple); }
.auth-card[data-color="iris"] { --profile-accent: var(--iris); }
.auth-card[data-color] {
  border-color: color-mix(in srgb, var(--profile-accent) 40%, transparent);
  background: color-mix(in srgb, var(--profile-accent) 12%, var(--panel));
}
.auth-card[data-color] .btn-primary {
  background: var(--profile-accent);
  color: #ffffff;
}
.auth-card[data-color] .btn-primary:active {
  background: color-mix(in srgb, var(--profile-accent) 80%, black);
}

/* ---------- botão de pânico (página Emergência) ---------- */
.panic-card {
  margin: 0 20px 18px;
  padding: 18px;
  background: var(--alert-dim);
  border: 1px solid rgba(225, 75, 63, 0.35);
  border-radius: var(--radius);
  text-align: center;
}
.panic-card--prompt { text-align: left; }
.panic-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--paper);
  margin: 0 0 6px;
}
.panic-card__text {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.5;
}
.panic-btn {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 6px auto 4px;
  border-radius: 50%;
  background: var(--alert);
  border: none;
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.panic-btn__ring {
  --pct: 0;
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(var(--alert-bright) calc(var(--pct) * 1%), transparent 0);
  transition: opacity 0.15s ease;
  opacity: 0;
}
.panic-btn.is-holding .panic-btn__ring { opacity: 1; }
.panic-btn.is-holding { background: var(--alert-bright); }
.panic-btn__label { position: relative; z-index: 1; padding: 0 14px; }
.panic-status {
  font-size: 12.5px;
  color: var(--muted);
  margin: 12px 0 0;
}
.panic-status--ok { color: var(--paper); }
.panic-status--error { color: var(--alert-bright); }
.panic-contacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.panic-contacts .btn-whatsapp { justify-content: center; }

/* ---------- cheguei bem (check-in de segurança) ---------- */
.checkin-card {
  margin: 0 20px 18px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.checkin-card--active {
  border-color: rgba(74, 146, 171, 0.35);
  background: rgba(74, 146, 171, 0.08);
}
.checkin-card--overdue {
  border-color: rgba(225, 75, 63, 0.35);
  background: var(--alert-dim);
}
.checkin-durations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.checkin-duration {
  flex: 1;
  min-width: 70px;
  padding: 10px 8px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
}
.checkin-duration.is-selected {
  background: var(--iris);
  border-color: var(--iris);
  color: var(--ink);
}
.checkin-countdown {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--iris-bright);
  text-align: center;
  margin: 4px 0 16px;
}
.checkin-cancel {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 8px;
}
.checkin-disclaimer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
#loc-countdown { margin-top: 12px; }

.oa-emergency-link {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 10px;
}
.oa-emergency-link input {
  flex: 1;
  min-width: 0;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.oa-emergency-link__regen { margin: 0; }
.oa-qrcode-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
  text-align: center;
}
.oa-qrcode-box {
  background: #ffffff;
  padding: 12px;
  border-radius: var(--radius-sm);
  line-height: 0;
}

.profile-empty {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 14px;
}
.profile-empty--spaced { margin: 16px 20px 0; }

/* ---------- aparência: seletor de tema ---------- */
.theme-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.theme-option:has(input:checked) {
  border-color: var(--iris);
  background: rgba(74, 146, 171, 0.1);
}
.theme-option input[type="radio"] {
  width: 20px; height: 20px;
  accent-color: var(--iris);
  flex-shrink: 0;
}
.theme-option__swatch {
  width: 34px; height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.theme-option__swatch--light { background: #f4f6f7; }
.theme-option__swatch--dark { background: #15171a; }
.theme-option__swatch--auto {
  background: linear-gradient(135deg, #f4f6f7 50%, #15171a 50%);
}
.theme-option__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.theme-option__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--paper);
}
.theme-option__desc {
  font-size: 12px;
  color: var(--muted);
}

/* utility spacing + a real class for the estado <select>, replacing what
   would otherwise be inline styles (breaks the site's strict CSP) */
.auth-field--tight { margin-bottom: 10px; }
.auth-field--tight-lg { margin-bottom: 14px; }
.profile-row--tight { margin-bottom: 10px; }
.profile-row--tight-lg { margin-bottom: 14px; }
.notice-inline { margin: 8px 20px 0; }
.auth-select {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.auth-select--locked {
  background: var(--panel);
  color: var(--muted);
  cursor: not-allowed;
}
.auth-field__hint {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}
.auth-textarea {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  width: 100%;
  resize: vertical;
}

/* ---------- admin: stats dashboard ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 6px 20px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.stat-card__value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--iris-bright);
  line-height: 1.1;
}
.stat-card__label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.stat-table th, .stat-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}
.stat-table th {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-table td { font-family: var(--font-mono); }
.stat-section {
  margin: 22px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
}
.stat-section h2 {
  font-family: var(--font-display);
  font-size: 14px;
  margin: 0 0 12px;
}
.stat-section__hint {
  font-size: 12px;
  color: var(--muted);
  margin: -6px 0 12px;
}
.admin-topbar-actions {
  margin-left: auto;
  padding-left: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- footer ---------- */
.foot {
  margin-top: auto;
  padding: 28px 20px 20px;
  text-align: center;
}
.foot p {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}
.foot__brand {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--line);
  margin-top: 10px;
}
.foot__links { margin: 4px 0 0; }
.foot__links a {
  font-size: 11.5px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- prose (privacy/legal pages) ---------- */
.prose {
  padding: 4px 20px 8px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--paper);
}
.prose h2 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 26px 0 8px;
}
.prose h2:first-child { margin-top: 4px; }
.prose p { margin: 0 0 12px; color: var(--paper); }
.prose p.muted { color: var(--muted); font-size: 13px; }
.prose ul { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--paper); }
.prose a { color: var(--iris-bright); text-decoration: underline; text-underline-offset: 2px; }
.prose .callout {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--iris);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 4px 0 20px;
  font-size: 13.5px;
  color: var(--muted);
}

/* ---------- bottom tab bar ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1150;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  padding: 8px 10px calc(8px + var(--safe-bottom));
  background: var(--panel-translucent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  position: relative;
}
.tabbar__item svg { width: 21px; height: 21px; }
.tabbar__item span {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.tabbar__item[aria-current="page"] { color: var(--iris-bright); }
.tabbar__item[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: -1px;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--iris-bright);
}

.tabbar__item.is-sos { color: var(--alert-bright); }
.tabbar__item.is-sos[aria-current="page"]::before { background: var(--alert-bright); }
.tabbar__item.is-sos .tabbar__dot {
  position: absolute;
  top: 4px;
  right: calc(50% - 15px);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--alert-bright);
  animation: pulse-dot 1.6s ease-in-out infinite;
}
.tabbar__item.is-cidade { color: var(--iris-bright); }
.tabbar__item.is-cidade[aria-current="page"]::before { background: var(--iris-bright); }
.tabbar__item.is-conta { color: var(--account-color-bright); }
.tabbar__item.is-conta[aria-current="page"]::before { background: var(--account-color-bright); }
.tabbar__item.is-ocorrencias { color: var(--cat-orange-bright); }
.tabbar__item.is-ocorrencias[aria-current="page"]::before { background: var(--cat-orange-bright); }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ---------- install banner ---------- */
.install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(78px + var(--safe-bottom));
  z-index: 50;
  max-width: 536px;
  margin: 0 auto;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
  transform: translateY(140%);
  transition: transform 0.35s cubic-bezier(.2,.9,.25,1);
}
.install-banner.is-visible { transform: translateY(0); }

.install-banner__icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  flex-shrink: 0;
}
.install-banner__text { flex: 1; min-width: 0; }
.install-banner__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 2px;
}
.install-banner__desc {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.install-banner__actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.install-banner__go {
  background: var(--iris);
  color: var(--ink);
  border: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.install-banner__dismiss {
  background: transparent;
  color: var(--muted);
  border: none;
  font-size: 11.5px;
  padding: 4px;
}

.install-steps {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  display: none;
}
.install-steps.is-visible { display: block; }
.install-steps b { color: var(--paper); }

/* ---------- consent banner ---------- */
.consent-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(78px + var(--safe-bottom));
  z-index: 55;
  max-width: 536px;
  margin: 0 auto;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
  transform: translateY(140%);
  transition: transform 0.35s cubic-bezier(.2,.9,.25,1);
}
.consent-banner.is-visible { transform: translateY(0); }
.consent-banner__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 8px;
}
.consent-banner__desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 14px;
}
.consent-banner__desc a { color: var(--iris-bright); text-decoration: underline; text-underline-offset: 2px; }
.consent-banner__actions { display: flex; flex-direction: column; gap: 8px; }
.consent-banner__deny {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  padding: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .consent-banner { transition: none; }
}

/* ---------- convite de cadastro (não logado) ---------- */
.signup-nudge {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(78px + var(--safe-bottom));
  z-index: 55;
  max-width: 536px;
  margin: 0 auto;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
  transform: translateY(140%);
  transition: transform 0.35s cubic-bezier(.2,.9,.25,1);
}
.signup-nudge.is-visible { transform: translateY(0); }
.signup-nudge__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 8px;
}
.signup-nudge__desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 14px;
}
.signup-nudge__actions { display: flex; flex-direction: column; gap: 8px; }
.signup-nudge__dismiss {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  padding: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .signup-nudge { transition: none; }
}

/* ---------- search box (directory) ---------- */
.search-box {
  position: relative;
  margin: 4px 20px 6px;
}
.search-box svg {
  position: absolute;
  left: 15px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  stroke: var(--muted);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 13px 16px 13px 42px;
  border-radius: 999px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.search-box input::placeholder { color: var(--muted); }
.search-box input:focus {
  border-color: var(--iris);
  background: var(--panel-raised);
}

/* a versão compacta (usada hoje só na home, no grid "mais serviços")
   fica em duas colunas — cabe bem porque não tem descrição, só ícone
   e título curto. */
#oa-cat-grid-rest.cat-grid {
  grid-template-columns: 1fr 1fr;
}

@media (prefers-reduced-motion: reduce) {
  .hero__mark::after,
  .tabbar__dot { animation: none; }
  .install-banner,
  .offline-banner { transition: none; }
}
