/* =====================================================================
   Conecta Local — estilos do aplicativo
   Todas as cores ficam em variáveis (tokens) no :root. O modo escuro
   redefine só as variáveis. O banner do escritório usa as cores da
   Machado & Mallmann (bordô, vermelho, cinza, grafite).
   ===================================================================== */

:root {
  color-scheme: light;
  /* Identidade Conecta Local: azul-petróleo (oceano/litoral) + laranja pôr do sol */
  --cl-primary: #0B6B6F;
  --cl-primary-strong: #08504F;
  --cl-primary-soft: #E2F2F1;
  --cl-on-primary: #FFFFFF;
  --cl-accent: #F08A3C;
  --cl-accent-strong: #B95A12;
  --cl-accent-soft: #FDEEDF;

  --cl-bg: #F3F6F5;
  --cl-surface: #FFFFFF;
  --cl-surface-2: #F7FAF9;
  --cl-text: #15252A;
  --cl-muted: #55666B;
  --cl-border: #D7E1E0;
  --cl-shadow: 0 1px 2px rgba(10, 40, 45, .06), 0 6px 18px rgba(10, 40, 45, .08);

  --cl-success: #157F4A;
  --cl-success-soft: #E1F4EA;
  --cl-warning: #8A5A00;
  --cl-warning-soft: #FFF3D6;
  --cl-danger: #B42318;
  --cl-danger-soft: #FDE7E5;
  --cl-info-soft: #E3EEFB;
  --cl-info: #1D4F91;

  --cl-like: #168A50;
  --cl-pass: #C23B32;
  --cl-star: #E9A100;
  --cl-whatsapp: #1F9D55;

  /* Escritório Machado & Mallmann (decisão 79) */
  --mm-bordo: #5E1214;
  --mm-vermelho: #A61B21;
  --mm-cinza: #88898B;
  --mm-grafite: #2E2E2E;
  --mm-banner-bg: #5E1214;
  --mm-banner-text: #FFFFFF;

  --radius: 14px;
  --radius-sm: 10px;
  --gutter: 16px;
  --maxw: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --focus: 0 0 0 3px rgba(240, 138, 60, .55);
}

/* Modo escuro automático (sistema), a menos que o usuário tenha escolhido "claro" */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --cl-primary: #3CB7B4;
    --cl-primary-strong: #6FD3CF;
    --cl-primary-soft: #143536;
    --cl-on-primary: #06201F;
    --cl-accent: #F59E57;
    --cl-accent-strong: #F7B27A;
    --cl-accent-soft: #3A2615;
    --cl-bg: #0C1517;
    --cl-surface: #142124;
    --cl-surface-2: #182A2D;
    --cl-text: #E5EEEE;
    --cl-muted: #A1B3B5;
    --cl-border: #2A3E41;
    --cl-shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
    --cl-success: #5CCB8F;
    --cl-success-soft: #12301F;
    --cl-warning: #F2C55C;
    --cl-warning-soft: #3A2E10;
    --cl-danger: #FF8A80;
    --cl-danger-soft: #3D1614;
    --cl-info: #93BDF5;
    --cl-info-soft: #14243A;
    --cl-like: #49C584;
    --cl-pass: #FF7A70;
    --cl-star: #F5C04A;
    --mm-banner-bg: #4A0E10;
  }
}
/* Modo escuro escolhido manualmente em Configurações */
:root[data-theme="dark"] {
  color-scheme: dark;
  --cl-primary: #3CB7B4;
  --cl-primary-strong: #6FD3CF;
  --cl-primary-soft: #143536;
  --cl-on-primary: #06201F;
  --cl-accent: #F59E57;
  --cl-accent-strong: #F7B27A;
  --cl-accent-soft: #3A2615;
  --cl-bg: #0C1517;
  --cl-surface: #142124;
  --cl-surface-2: #182A2D;
  --cl-text: #E5EEEE;
  --cl-muted: #A1B3B5;
  --cl-border: #2A3E41;
  --cl-shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
  --cl-success: #5CCB8F;
  --cl-success-soft: #12301F;
  --cl-warning: #F2C55C;
  --cl-warning-soft: #3A2E10;
  --cl-danger: #FF8A80;
  --cl-danger-soft: #3D1614;
  --cl-info: #93BDF5;
  --cl-info-soft: #14243A;
  --cl-like: #49C584;
  --cl-pass: #FF7A70;
  --cl-star: #F5C04A;
  --mm-banner-bg: #4A0E10;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cl-bg);
  color: var(--cl-text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}
img, svg { max-width: 100%; }
a { color: var(--cl-primary); }
a:hover { color: var(--cl-primary-strong); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
small, .small { font-size: .875rem; }
.muted { color: var(--cl-muted); }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
button, input, select, textarea { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--cl-border); margin: 16px 0; }

/* ---------- Faixa do modo demonstração ---------- */
.demo-ribbon {
  background: repeating-linear-gradient(-45deg, #2E2E2E, #2E2E2E 10px, #3a3a3a 10px, #3a3a3a 20px);
  color: #fff; font-size: .76rem; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 3px 12px; flex-wrap: nowrap; white-space: nowrap; position: relative; z-index: 60;
}
.demo-ribbon button { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 1px 9px; cursor: pointer; font-size: .74rem; }
@media (max-width: 380px) { .demo-ribbon { gap: 6px; padding: 3px 8px; font-size: .7rem; } }
.demo-panel {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: min(340px, calc(100vw - 32px));
  background: var(--cl-surface); color: var(--cl-text); border: 1px solid var(--cl-border); border-radius: var(--radius);
  box-shadow: var(--cl-shadow); padding: 14px; z-index: 80; font-size: .9rem;
}
.demo-panel h3 { font-size: .95rem; }
.demo-panel .row { margin-bottom: 10px; }

/* ---------- Banner do escritório (faixa fixa) ---------- */
.topbar { position: sticky; top: 0; z-index: 50; }
.mm-banner {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--mm-banner-bg); color: var(--mm-banner-text);
  border: 0; border-bottom: 3px solid var(--mm-vermelho);
  padding: 6px var(--gutter); min-height: 40px; cursor: pointer; text-align: left;
  font-size: .85rem;
}
.mm-banner img { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 3px; background: #fff; padding: 1px; }
.mm-banner .mm-text { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-banner .mm-text b { font-weight: 700; }
.mm-banner .mm-cta { flex: 0 0 auto; background: #fff; color: var(--mm-bordo); border-radius: 999px; padding: 3px 10px; font-weight: 700; font-size: .78rem; white-space: nowrap; }
.mm-banner:hover .mm-cta { background: #F3E6E6; }
@media (max-width: 400px) { .mm-banner .mm-cta { display: none; } }

/* ---------- Barra do app ---------- */
.appbar {
  display: flex; align-items: center; gap: 8px; padding: 8px var(--gutter);
  background: var(--cl-surface); border-bottom: 1px solid var(--cl-border);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--cl-text); font-weight: 800; letter-spacing: -.01em; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; }
.brand span b { color: var(--cl-primary); }
.appbar .spacer { flex: 1; }
.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--cl-border);
  background: var(--cl-surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--cl-text);
}
.icon-btn:hover { background: var(--cl-surface-2); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .count {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 5px;
  background: var(--cl-pass); color: #fff; font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* ---------- Estrutura (layout) ---------- */
.layout { display: block; max-width: var(--maxw); margin: 0 auto; overflow-x: clip; }
.sidenav { display: none; }
main#view { padding: 16px var(--gutter) 24px; min-height: 60vh; outline: none; }
.with-tabs main#view { padding-bottom: 96px; }
@media (min-width: 960px) {
  .layout.has-nav { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; padding: 0 var(--gutter); }
  .layout.has-nav main#view { padding: 20px 0 32px; }
  .has-nav .sidenav { display: block; position: sticky; top: 110px; align-self: start; padding-top: 20px; }
  .with-tabs main#view { padding-bottom: 32px; }
  .tabbar { display: none !important; }
}
.sidenav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--cl-text);
  text-decoration: none; font-weight: 600; font-size: .95rem;
}
.sidenav a svg { width: 20px; height: 20px; flex: 0 0 auto; }
.sidenav a:hover { background: var(--cl-surface-2); }
.sidenav a[aria-current="page"] { background: var(--cl-primary-soft); color: var(--cl-primary-strong); }
.sidenav .sep { height: 1px; background: var(--cl-border); margin: 8px 0; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--cl-surface); border-top: 1px solid var(--cl-border); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; text-decoration: none;
  color: var(--cl-muted); font-size: .7rem; font-weight: 600; position: relative;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--cl-primary); }
.tabbar .dot { position: absolute; top: 5px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--cl-pass); }

/* ---------- Rodapé ---------- */
.site-footer { text-align: center; color: var(--cl-muted); font-size: .82rem; padding: 18px var(--gutter) 24px; border-top: 1px solid var(--cl-border); background: var(--cl-surface); }
.with-tabs .site-footer { padding-bottom: 92px; }
@media (min-width: 960px) { .with-tabs .site-footer { padding-bottom: 24px; } }
.site-footer a { color: var(--cl-muted); }
.site-footer .mm-sign { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--cl-text); }
.site-footer .mm-sign img { width: 18px; height: 18px; }

/* ---------- Botão flutuante de WhatsApp ---------- */
.fab-wa {
  position: fixed; right: 16px; bottom: 20px; z-index: 45; width: 56px; height: 56px; border-radius: 50%;
  background: var(--cl-whatsapp); color: #fff; border: 3px solid #fff; box-shadow: 0 6px 18px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.fab-wa svg { width: 28px; height: 28px; }
.with-tabs .fab-wa { bottom: 84px; }
@media (min-width: 960px) { .with-tabs .fab-wa { bottom: 24px; } }
body.route-chat .fab-wa { display: none; }

/* ---------- Componentes ---------- */
.card { background: var(--cl-surface); border: 1px solid var(--cl-border); border-radius: var(--radius); padding: 16px; box-shadow: var(--cl-shadow); }
.card + .card, .stack > * + * { margin-top: 12px; }
.card.flat { box-shadow: none; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.narrow { max-width: 520px; margin: 0 auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 999px; border: 1px solid transparent; font-weight: 700; cursor: pointer; text-decoration: none; font-size: .95rem;
  background: var(--cl-surface-2); color: var(--cl-text); border-color: var(--cl-border); text-align: center;
}
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.btn:hover { filter: brightness(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--cl-primary); color: var(--cl-on-primary); border-color: var(--cl-primary); }
.btn-primary:hover { background: var(--cl-primary-strong); color: var(--cl-on-primary); }
.btn-accent { background: var(--cl-accent); color: #2B1300; border-color: var(--cl-accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--cl-primary); }
.btn-outline { background: transparent; border-color: var(--cl-primary); color: var(--cl-primary); }
.btn-danger { background: var(--cl-danger); color: #fff; border-color: var(--cl-danger); }
.btn-wa { background: var(--cl-whatsapp); color: #fff; border-color: var(--cl-whatsapp); }
.btn-mm { background: var(--mm-bordo); color: #fff; border-color: var(--mm-bordo); }
.btn-mm:hover { background: var(--mm-vermelho); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.btn-google { background: #fff; color: #1f1f1f; border-color: #c9d1d0; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 0; color: var(--cl-primary); text-decoration: underline; cursor: pointer; font: inherit; }

/* Formulários */
.field { display: block; margin-bottom: 14px; }
.field > span, .field-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.field .hint { display: block; color: var(--cl-muted); font-size: .82rem; margin-top: 4px; font-weight: 400; }
.input, input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--cl-border);
  background: var(--cl-surface); color: var(--cl-text);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cl-primary); box-shadow: var(--focus); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--cl-primary); }
.check .t { font-size: .95rem; }
.req { color: var(--cl-danger); font-weight: 700; }
.code-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.error-text { color: var(--cl-danger); font-size: .9rem; margin-top: 6px; }

/* Interruptor (toggle) */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--cl-border); }
.switch:last-child { border-bottom: 0; }
.switch input { appearance: none; width: 48px; height: 28px; border-radius: 14px; background: var(--cl-border); position: relative; cursor: pointer; flex: 0 0 auto; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked { background: var(--cl-primary); }
.switch input:checked::after { left: 23px; }
.switch input:disabled { opacity: .6; cursor: not-allowed; }

/* Chips (categorias, filtros) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--cl-border); background: var(--cl-surface); color: var(--cl-text); font-size: .88rem; cursor: pointer; font-weight: 600;
}
.chip[aria-pressed="true"], .chip.on { background: var(--cl-primary-soft); border-color: var(--cl-primary); color: var(--cl-primary-strong); }
.chip .x { font-weight: 800; opacity: .7; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--cl-surface-2); border: 1px solid var(--cl-border); color: var(--cl-text); }
.tag.ok { background: var(--cl-success-soft); color: var(--cl-success); border-color: transparent; }
.tag.warn { background: var(--cl-warning-soft); color: var(--cl-warning); border-color: transparent; }
.tag.bad { background: var(--cl-danger-soft); color: var(--cl-danger); border-color: transparent; }
.tag.info { background: var(--cl-info-soft); color: var(--cl-info); border-color: transparent; }
.tag.accent { background: var(--cl-accent-soft); color: var(--cl-accent-strong); border-color: transparent; }
.tag.premium { background: linear-gradient(90deg, #F08A3C, #E2B13C); color: #2B1300; border-color: transparent; }

/* Avisos */
.notice { border-radius: var(--radius-sm); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: .93rem; border: 1px solid transparent; }
.notice svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; }
.notice.info { background: var(--cl-info-soft); color: var(--cl-info); }
.notice.warn { background: var(--cl-warning-soft); color: var(--cl-warning); }
.notice.bad { background: var(--cl-danger-soft); color: var(--cl-danger); }
.notice.ok { background: var(--cl-success-soft); color: var(--cl-success); }
.notice > div { min-width: 0; }
.notice p:last-child { margin-bottom: 0; }

/* Convite do escritório em momentos-chave */
.mm-invite {
  border-radius: var(--radius); padding: 14px; background: linear-gradient(135deg, var(--mm-bordo), var(--mm-vermelho)); color: #fff;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.mm-invite img { width: 40px; height: 40px; border-radius: 6px; background: #fff; padding: 2px; }
.mm-invite .txt { flex: 1 1 200px; min-width: 0; }
.mm-invite .txt strong { display: block; }
.mm-invite .btn { background: #fff; color: var(--mm-bordo); border-color: #fff; }
.mm-invite.compact { padding: 8px 10px; gap: 8px; flex-wrap: nowrap; border-radius: var(--radius-sm); }
.mm-invite.compact img { width: 28px; height: 28px; }
.mm-invite.compact .txt { font-size: .82rem; line-height: 1.3; flex: 1 1 auto; }
.mm-invite.compact .txt strong { display: none; }
.mm-invite.compact .txt span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mm-invite.compact .btn { flex: 0 0 auto; min-height: 34px; padding: 4px 10px; font-size: .78rem; }

/* Abas e segmentos */
.seg { display: inline-flex; border: 1px solid var(--cl-border); border-radius: 999px; padding: 3px; background: var(--cl-surface); gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button, .seg a { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--cl-muted); text-decoration: none; white-space: nowrap; font-size: .9rem; }
.seg [aria-pressed="true"], .seg [aria-current="page"] { background: var(--cl-primary); color: var(--cl-on-primary); }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--cl-border); margin-bottom: 14px; scrollbar-width: thin; }
.tabs button, .tabs a { border: 0; background: none; padding: 10px 12px; font-weight: 700; color: var(--cl-muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none; }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { color: var(--cl-primary); border-bottom-color: var(--cl-primary); }

/* Listas */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--cl-border); }
.list > li:last-child { border-bottom: 0; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 12px 4px; text-decoration: none; color: inherit; width: 100%; background: none; border: 0; text-align: left; cursor: pointer; }
.list-item:hover { background: var(--cl-surface-2); }
.list-item .grow { flex: 1 1 auto; min-width: 0; }
.list-item .title, .list-item .sub { display: block; }
.list-item .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .sub { color: var(--cl-muted); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cl-accent); flex: 0 0 auto; }

/* Logotipos das empresas (no gratuito, borrados) */
.logo { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; flex: 0 0 auto; background: var(--cl-surface-2); border: 1px solid var(--cl-border); display: flex; align-items: center; justify-content: center; }
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo.lg { width: 76px; height: 76px; border-radius: 16px; }
.logo.blur img { filter: blur(7px) saturate(.8); transform: scale(1.15); }
.logo .ph { font-weight: 800; color: var(--cl-muted); }

/* Estrelas */
.stars { display: inline-flex; gap: 1px; color: var(--cl-star); vertical-align: middle; }
.stars svg { width: 16px; height: 16px; }
.stars .off { color: var(--cl-border); }
.rating-line { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.star-input { display: inline-flex; gap: 2px; }
.star-input button { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--cl-border); border-radius: 6px; }
.star-input button svg { width: 30px; height: 30px; }
.star-input button.on { color: var(--cl-star); }
.crit-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--cl-border); }
.crit-row:last-child { border-bottom: 0; }
.bar { height: 8px; background: var(--cl-border); border-radius: 4px; overflow: hidden; flex: 1 1 80px; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--cl-primary); border-radius: 4px; }

/* Números (painéis) */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--cl-surface); border: 1px solid var(--cl-border); border-radius: var(--radius); padding: 12px; min-width: 0; }
.stat .k { color: var(--cl-muted); font-size: .8rem; font-weight: 600; }
.stat .v { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere; }
.stat .d { font-size: .78rem; color: var(--cl-muted); }
.meter { height: 12px; border-radius: 6px; background: var(--cl-border); overflow: hidden; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--cl-primary), var(--cl-accent)); }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--cl-border); vertical-align: top; }
.tbl th { color: var(--cl-muted); font-size: .8rem; font-weight: 700; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.hbar-row { display: grid; grid-template-columns: minmax(0, 1fr) 1.2fr auto; gap: 8px; align-items: center; font-size: .88rem; padding: 4px 0; }

/* Etapas do cadastro */
.steps { display: flex; gap: 6px; margin: 4px 0 16px; }
.steps i { flex: 1; height: 6px; border-radius: 3px; background: var(--cl-border); }
.steps i.on { background: var(--cl-primary); }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: .93rem; }
.kv dt { color: var(--cl-muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Boas-vindas ---------- */
.hero { text-align: center; padding: 16px 0 8px; }
.hero img.big { width: 88px; height: 88px; }
.hero h1 { font-size: 1.7rem; margin-top: 10px; }
.hero .lead { font-size: 1.05rem; color: var(--cl-muted); max-width: 520px; margin: 0 auto 16px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--cl-muted); font-size: .85rem; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--cl-border); }
.mm-presents { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--cl-muted); margin-top: 12px; }
.mm-presents img { width: 22px; height: 22px; }

/* ---------- Descobrir (cartões) ---------- */
.discover { max-width: 460px; margin: 0 auto; }
.discover .page-head { flex-wrap: nowrap; margin-bottom: 4px; }
.discover .page-head h1 { font-size: 1.3rem; }
@media (max-width: 400px) { .discover .seg a { padding: 6px 10px; } }
.deck { position: relative; height: clamp(320px, calc(100vh - 410px), 540px); height: clamp(320px, calc(100dvh - 410px), 540px); margin: 8px 0 14px; touch-action: pan-y; }
@media (min-width: 960px) { .deck { height: clamp(380px, calc(100vh - 300px), 540px); } }
.swipe-card {
  position: absolute; inset: 0; background: var(--cl-surface); border: 1px solid var(--cl-border); border-radius: 20px; box-shadow: var(--cl-shadow);
  overflow: hidden; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; will-change: transform;
  transition: transform .25s ease, opacity .25s ease;
}
.swipe-card.dragging { transition: none; cursor: grabbing; }
.swipe-card.behind { transform: scale(.95) translateY(12px); opacity: .7; pointer-events: none; }
.swipe-card .photo { height: 42%; min-height: 150px; background: var(--cl-surface-2); position: relative; flex: 0 0 auto; }
.swipe-card .photo img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.swipe-card .score {
  position: absolute; top: 12px; left: 12px; background: rgba(8, 40, 44, .82); color: #fff; padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: .9rem;
}
.swipe-card .kind { position: absolute; top: 12px; right: 12px; }
.swipe-card .body { padding: 14px 16px; overflow-y: auto; flex: 1 1 auto; }
.swipe-card .head { display: flex; gap: 12px; align-items: center; margin-top: -40px; position: relative; }
.swipe-card .head .logo { border: 3px solid var(--cl-surface); width: 64px; height: 64px; box-shadow: var(--cl-shadow); }
.swipe-card .head .names { padding-top: 32px; min-width: 0; }
.swipe-card h2 { font-size: 1.15rem; margin: 0; overflow-wrap: anywhere; }
.swipe-card .reasons { margin: 10px 0 6px; padding: 0; list-style: none; }
.swipe-card .reasons li { display: flex; gap: 6px; font-size: .92rem; }
.swipe-card .reasons li::before { content: "✓"; color: var(--cl-success); font-weight: 800; }
.stamp { position: absolute; top: 28px; padding: 6px 14px; border: 4px solid; border-radius: 10px; font-weight: 900; font-size: 1.6rem; letter-spacing: .05em; opacity: 0; transform: rotate(-12deg); background: rgba(255,255,255,.85); z-index: 3; pointer-events: none; }
.stamp.like { left: 18px; color: var(--cl-like); border-color: var(--cl-like); }
.stamp.pass { right: 18px; color: var(--cl-pass); border-color: var(--cl-pass); transform: rotate(12deg); }
.deck-actions { display: flex; justify-content: center; align-items: center; gap: 14px; }
.round { width: 62px; height: 62px; border-radius: 50%; border: 2px solid var(--cl-border); background: var(--cl-surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--cl-shadow); flex-direction: column; }
.round svg { width: 28px; height: 28px; }
.round.pass { color: var(--cl-pass); border-color: var(--cl-pass); }
.round.like { color: var(--cl-like); border-color: var(--cl-like); width: 70px; height: 70px; }
.round.contact { color: var(--cl-primary); border-color: var(--cl-primary); width: 54px; height: 54px; }
.round.contact svg { width: 22px; height: 22px; }
.deck-labels { display: flex; justify-content: center; gap: 14px; font-size: .75rem; color: var(--cl-muted); margin-top: 4px; }
.deck-labels span { width: 70px; text-align: center; }
.likes-left { text-align: center; font-size: .9rem; color: var(--cl-muted); margin-bottom: 4px; }

/* Lista de empresas */
.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
@media (min-width: 720px) { .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.filters .field { margin: 0; }
.filters .field > span { font-size: .8rem; }
.co-card { display: flex; gap: 12px; padding: 12px; align-items: flex-start; text-decoration: none; color: inherit; }
.co-card .grow { flex: 1 1 auto; min-width: 0; }
.co-card .title { font-weight: 800; overflow-wrap: anywhere; }
.co-card .meta { color: var(--cl-muted); font-size: .86rem; }
.co-card .pct { font-weight: 800; color: var(--cl-primary); white-space: nowrap; }

/* Mapa */
.map-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--cl-border); background: var(--cl-surface); }
.map-svg { display: block; width: 100%; height: auto; max-height: 72vh; margin: 0 auto; }
.map-svg .pin { cursor: pointer; }
.map-svg .pin:focus { outline: none; }
.map-svg .pin:focus circle.c, .map-svg .pin:hover circle.c { stroke: var(--cl-accent); stroke-width: 4; }
.map-pop { position: absolute; left: 12px; right: 12px; bottom: 12px; max-width: 420px; margin: 0 auto; }
#gmap { width: 100%; height: 70vh; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .8rem; color: var(--cl-muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 4px; }

/* Perfil de empresa */
.profile-head { display: flex; gap: 14px; align-items: center; }
.profile-head .grow { min-width: 0; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; display: block; background: var(--cl-surface-2); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 84px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--cl-border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; line-height: 1; }
.review { padding: 12px 0; border-bottom: 1px solid var(--cl-border); }
.review:last-child { border-bottom: 0; }
.review .reply { margin: 8px 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--cl-primary); background: var(--cl-surface-2); border-radius: 0 8px 8px 0; font-size: .92rem; }
.locked-box { border: 1px dashed var(--cl-border); border-radius: var(--radius-sm); padding: 14px; text-align: center; color: var(--cl-muted); background: var(--cl-surface-2); }

/* Conversas / chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 150px); height: calc(100dvh - 150px); max-width: 760px; margin: 0 auto; }
.with-tabs .chat { height: calc(100vh - 220px); height: calc(100dvh - 220px); }
@media (min-width: 960px) { .with-tabs .chat { height: calc(100vh - 170px); height: calc(100dvh - 170px); } }
.chat-head { display: flex; gap: 10px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--cl-border); }
.chat-head .grow { min-width: 0; flex: 1; }
.chat-head .title { font-weight: 800; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stage-bar { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; scrollbar-width: thin; flex: 0 0 auto; }
.stage-bar button { flex: 0 0 auto; border: 1px solid var(--cl-border); background: var(--cl-surface); color: var(--cl-muted); border-radius: 999px; padding: 6px 12px; font-size: .82rem; font-weight: 700; cursor: pointer; }
.stage-bar button[aria-pressed="true"] { background: var(--cl-primary); color: var(--cl-on-primary); border-color: var(--cl-primary); }
.stage-bar button.done { color: var(--cl-primary); border-color: var(--cl-primary); }
.messages { flex: 1 1 auto; overflow-y: auto; padding: 10px 2px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 16px; background: var(--cl-surface); border: 1px solid var(--cl-border); align-self: flex-start; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--cl-primary); color: var(--cl-on-primary); border-color: var(--cl-primary); }
.msg .time { display: block; font-size: .7rem; opacity: .75; margin-top: 2px; text-align: right; }
.msg.blocked { opacity: .7; font-style: italic; }
.msg-warn { align-self: stretch; }
.sys { align-self: center; font-size: .8rem; color: var(--cl-muted); background: var(--cl-surface-2); padding: 4px 10px; border-radius: 999px; text-align: center; }
.composer { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--cl-border); flex: 0 0 auto; }
.composer textarea { min-height: 44px; height: 44px; max-height: 120px; border-radius: 22px; padding: 10px 14px; }
.composer .btn { flex: 0 0 auto; }

/* Notificações */
.notif { display: flex; gap: 10px; padding: 12px 4px; text-decoration: none; color: inherit; align-items: flex-start; }
.notif.unread .t { font-weight: 800; }
.notif .when { color: var(--cl-muted); font-size: .78rem; }

/* Menu "Mais" */
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.menu-tile { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--radius); background: var(--cl-surface); border: 1px solid var(--cl-border); text-decoration: none; color: var(--cl-text); font-weight: 700; min-height: 92px; }
.menu-tile svg { width: 26px; height: 26px; color: var(--cl-primary); }
.menu-tile small { color: var(--cl-muted); font-weight: 500; }

/* Tutorial */
.tutorial { max-width: 460px; margin: 0 auto; text-align: center; }
.tutorial .art { width: 180px; height: 180px; margin: 10px auto 18px; border-radius: 50%; background: var(--cl-primary-soft); display: flex; align-items: center; justify-content: center; color: var(--cl-primary); }
.tutorial .art svg { width: 96px; height: 96px; }
.dots { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--cl-border); }
.dots i.on { background: var(--cl-primary); width: 26px; border-radius: 5px; }

/* Conteúdo em markdown */
.md { overflow-wrap: anywhere; }
.md h1 { font-size: 1.45rem; } .md h2 { font-size: 1.2rem; margin-top: 1.2em; } .md h3 { font-size: 1.05rem; margin-top: 1em; }
.md ul, .md ol { padding-left: 1.3em; }
.md li { margin: 4px 0; }
.md blockquote { margin: 12px 0; padding: 8px 14px; border-left: 4px solid var(--cl-accent); background: var(--cl-surface-2); border-radius: 0 8px 8px 0; }
.md code { background: var(--cl-surface-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.md table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--cl-border); padding: 6px 8px; text-align: left; }
.md li.task { list-style: none; margin-left: -1.2em; }

/* Ajuda (assistente) */
.assist { display: flex; flex-direction: column; gap: 8px; min-height: 300px; }
.assist .messages { max-height: 55vh; min-height: 200px; }

/* Avisos rápidos (toast) */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--mm-grafite); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: .93rem; pointer-events: auto; animation: tin .2s ease; }
.toast.ok { background: #126B3F; } .toast.bad { background: #9B1C1C; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Janela (dialog) */
dialog.modal { border: 0; padding: 0; border-radius: 18px; background: var(--cl-surface); color: var(--cl-text); width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog.modal::backdrop { background: rgba(5, 20, 22, .55); }
.modal-inner { padding: 18px; overflow-y: auto; max-height: calc(100vh - 32px); }
.modal-inner h2 { padding-right: 36px; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--cl-surface-2); cursor: pointer; font-size: 1.2rem; color: var(--cl-text); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.match-celebrate { text-align: center; }
.match-celebrate .pair { display: flex; justify-content: center; align-items: center; gap: 0; margin: 8px 0 12px; }
.match-celebrate .pair .logo { width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--cl-surface); box-shadow: var(--cl-shadow); }
.match-celebrate .pair .logo + .logo { margin-left: -14px; }
.match-celebrate h2 { font-size: 1.6rem; color: var(--cl-primary); padding: 0; }

/* Carregando / vazio */
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 0; color: var(--cl-muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--cl-border); border-top-color: var(--cl-primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 32px 12px; color: var(--cl-muted); }
.empty svg { width: 56px; height: 56px; color: var(--cl-primary); opacity: .8; }

/* Instalação (PWA) */
.install-hint { display: flex; gap: 10px; align-items: center; }
.install-hint img { width: 40px; height: 40px; border-radius: 10px; }

/* Painel administrativo */
.queue-item { padding: 12px 0; border-bottom: 1px solid var(--cl-border); }
.queue-item:last-child { border-bottom: 0; }
.queue-item .actions { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.admin-badge { background: var(--mm-grafite); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .topbar, .tabbar, .sidenav, .fab-wa, .site-footer, .demo-ribbon, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 0; }
}
@media (max-width: 480px) { .hide-sm { display: none; } }
