/* Tema: segue o sistema (Automático) ou o que o usuário escolheu (data-theme="light|dark"). */
:root { --bg: #f4f6f8; --card: #fff; --ink: #14202b; --muted: #5d6b78; --line: #dbe2e8; --brand: #0b5cad; --brand-ink: #fff; --ok: #1a7f4b; --warn: #b26a00; --bad: #b3261e; --side-bg: #fff; --radius: 10px; --side-w: 248px; color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) { --bg: #0f1419; --card: #171e26; --ink: #e8eef3; --muted: #93a1ae; --line: #2a3541; --brand: #4a9eed; --brand-ink: #06121e; --ok: #4cc38a; --warn: #e0a030; --bad: #ff8a80; --side-bg: #121920; color-scheme: dark; }
}
:root[data-theme=dark] { --bg: #0f1419; --card: #171e26; --ink: #e8eef3; --muted: #93a1ae; --line: #2a3541; --brand: #4a9eed; --brand-ink: #06121e; --ok: #4cc38a; --warn: #e0a030; --bad: #ff8a80; --side-bg: #121920; color-scheme: dark; }
:root[data-theme=light] { color-scheme: light; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 1.35rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: .9rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.login { max-width: 400px; margin: 10vh auto 0; padding: 0 16px; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 12px 0 4px; }
input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]), select {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; min-height: 44px;
}
input:focus-visible, select:focus-visible, button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
button { font: inherit; min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
button.danger { color: var(--bad); }
button.small { min-height: 36px; padding: 0 10px; font-size: .88rem; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 200px; }
.error { color: var(--bad); margin: 10px 0 0; min-height: 1.2em; }
.notice { background: color-mix(in srgb, var(--warn) 14%, var(--card)); border: 1px solid var(--warn); border-radius: 8px; padding: 12px; margin-bottom: 14px; }
.notice code { font-size: 1.05rem; user-select: all; word-break: break-all; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; min-height: 36px; }
.chip input { margin: 0; }
.scale-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.scale-row .row { justify-content: space-between; }
.badge { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.bad { color: var(--bad); border-color: var(--bad); }
.badge.soon { color: var(--warn); border-color: var(--warn); }
details.card > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 8px; align-items: center; min-height: 44px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.scroll { overflow-x: auto; }
.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 8px; }
.mods > div { display: flex; justify-content: space-between; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.mods select { width: auto; min-height: 36px; }

/* ---------- estrutura com menu lateral ---------- */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.side {
  width: var(--side-w); flex: 0 0 var(--side-w); background: var(--side-bg); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  padding: 16px 12px calc(12px + env(safe-area-inset-bottom));
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo-side { border-radius: 12px; flex: none; }
.logo-top { border-radius: 7px; vertical-align: middle; margin-right: 8px; }
.logo-login-full { display: block; margin: 0 auto 6px; max-width: 100%; height: auto; border-radius: 12px; }
.logo-login { display: block; margin: 0 auto 10px; border-radius: 18px; }
.brand { font-weight: 700; font-size: 1.05rem; padding: 4px 10px 14px; line-height: 1.2; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 0 10px; min-height: 44px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: .95rem;
}
.nav a:hover { background: color-mix(in srgb, var(--brand) 9%, transparent); }
.nav a[aria-current=page] { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); font-weight: 600; }
.nav svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 4px; }
.nav-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 10px 2px; }
.spacer { flex: 1; min-height: 16px; }
.user { border-top: 1px solid var(--line); padding: 12px 6px 0; }
.user .who { font-size: .85rem; word-break: break-all; }
.user button { width: 100%; margin-top: 8px; }
.main { flex: 1; min-width: 0; }
.content { max-width: 1040px; margin: 0 auto; padding: 20px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.topbar { display: none; }
.scrim { display: none; }
.subnav { display: flex; gap: 6px; overflow-x: auto; margin: 14px 0; padding-bottom: 2px; }
.subnav a { white-space: nowrap; padding: 0 14px; min-height: 40px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; background: var(--card); }
.subnav a[aria-current=page] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }

@media (max-width: 820px) {
  .shell { display: block; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--side-bg);
    border-bottom: 1px solid var(--line); padding: 6px 12px; padding-top: calc(6px + env(safe-area-inset-top));
  }
  .topbar .title { font-weight: 700; }
  .side {
    position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: min(84vw, 300px); height: auto;
    transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 0 30px rgba(0,0,0,.35);
  }
  body.nav-open .side { transform: none; }
  body.nav-open { overflow: hidden; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.45); }
  .content { padding: 14px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* ---------- componentes das fases 2 e 3 ---------- */
a.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font: inherit; cursor: pointer; }
a.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
a.btn.small { min-height: 36px; padding: 0 10px; font-size: .88rem; }
textarea { width: 100%; padding: 11px 12px; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
textarea:focus-visible, a.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.req { color: var(--bad); }
.pad { padding: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 12px; }
.filters { margin-top: 4px; }
.list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
a.item.link { color: inherit; text-decoration: none; }
a.item.link:hover { border-color: var(--brand); }
.item .row { margin-top: 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; margin: 6px 0; }
.facts dt { font-size: .75rem; color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }
.pager { justify-content: center; margin: 10px 0; }
.seg { min-height: 40px; }
.seg[aria-pressed=true] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
nav.subnav > button.seg { white-space: nowrap; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.toolbar input[type=search] { flex: 1 1 240px; }
.seg-group { display: flex; gap: 6px; }
.only-mobile { display: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.mapwrap { display: grid; grid-template-columns: 380px 1fr; gap: 12px; height: calc(100vh - 250px); min-height: 420px; }
.mapwrap #list { overflow-y: auto; margin: 0; padding-right: 4px; }
#map { border: 1px solid var(--line); border-radius: var(--radius); min-height: 320px; z-index: 0; }
.mini { height: 200px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; z-index: 0; }
.mini.tall { height: 280px; margin: 10px 0 4px; }
.pin { background: none; border: 0; }
.count { margin-left: auto; min-width: 22px; padding: 1px 7px; text-align: center; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--bad); color: #fff; }
.count.warn { background: var(--warn); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
a.card.stat { display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); margin: 0; border-left: 5px solid var(--ok); }
a.card.stat.warn { border-left-color: var(--warn); }
a.card.stat.bad { border-left-color: var(--bad); }
a.card.stat .n { font-size: 2rem; font-weight: 700; line-height: 1; min-width: 2ch; text-align: center; }
a.modlink { text-decoration: none; color: inherit; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 160px; min-height: 40px; }
.cal { margin: 6px 0; padding: 8px 10px; border-radius: 8px; border: 1px dashed var(--line); }
.cal.ok { border-style: solid; border-color: var(--ok); }
.cal.warn { border-style: solid; border-color: var(--warn); }
.cal.bad { border-style: solid; border-color: var(--bad); }
button.x { min-height: 24px; width: 24px; padding: 0; border-radius: 50%; line-height: 1; }
.offline { background: var(--warn); color: #fff; text-align: center; padding: 6px 12px; font-size: .9rem; }
#toasts { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { padding: 12px 14px; border-radius: 8px; background: var(--ink); color: var(--bg); box-shadow: 0 4px 20px rgba(0,0,0,.35); }
.toast.bad { background: var(--bad); color: #fff; }
.actions { margin: 12px 0; }
.leaflet-container { font: inherit; }

@media (max-width: 820px) {
  .only-mobile { display: flex; }
  .mapwrap { display: block; height: auto; }
  .mapwrap #list, .mapwrap #map { display: none; }
  .mapwrap[data-view=list] #list { display: flex; }
  .mapwrap[data-view=map] #map { display: block; height: 62vh; }
  .grid { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 440px) { .grid { grid-template-columns: 1fr; } }

/* ---------- histórico ---------- */
.hist { margin-top: 8px; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; }
.hist[hidden] { display: none; }
ul.events { margin: 6px 0 0; padding-left: 18px; }
ul.events li { margin: 3px 0; }

/* ---------- seletor de tema ---------- */
.theme-seg { display: flex; gap: 4px; margin-top: 10px; }
.theme-seg button { flex: 1; min-height: 34px; padding: 0 6px; font-size: .8rem; }
.theme-seg button[aria-pressed=true] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.login-theme { position: fixed; top: 12px; right: 12px; width: 220px; }
.item.mine { border-left: 4px solid var(--ok); }

.empresa { margin: 6px 0; padding: 8px 10px; border-radius: 8px; border: 1px dashed var(--line); font-size: .9rem; }

/* ---------- Início personalizável ---------- */
.home { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; align-items: stretch; }
.home > .card { margin: 0; }
.home > .wide { grid-column: 1 / -1; }
.wlist { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wlist li { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

/* balão do WhatsApp (só na demonstração) */
#zap-bubble { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 900; display: inline-flex; align-items: center; gap: 8px; padding: 12px; border-radius: 999px; background: #25d366; color: #fff; font: 600 14px/1 system-ui, sans-serif; text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
#zap-bubble:hover, #zap-bubble:focus-visible { background: #1ebe5b; outline: 2px solid #fff; outline-offset: 2px; }
#zap-bubble span { display: none; }
@media (min-width: 700px) { #zap-bubble { padding: 12px 18px 12px 14px; } #zap-bubble span { display: inline; } }

/* ---- Consulta de cadastro (mapa do Brasil) ---- */
.rc-head { margin-bottom: 12px; }
.rc { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 800px) { .rc { grid-template-columns: 1fr; } }
.rc-uf[data-reg="Norte"], .rc-item[data-reg="Norte"], .rc-uf-big[data-reg="Norte"], .rc-reg[data-reg="Norte"], .rc-chip[data-reg="Norte"] { --h: #2e9e6b; }
.rc-uf[data-reg="Nordeste"], .rc-item[data-reg="Nordeste"], .rc-uf-big[data-reg="Nordeste"], .rc-reg[data-reg="Nordeste"], .rc-chip[data-reg="Nordeste"] { --h: #e0902f; }
.rc-uf[data-reg="Centro-Oeste"], .rc-item[data-reg="Centro-Oeste"], .rc-uf-big[data-reg="Centro-Oeste"], .rc-reg[data-reg="Centro-Oeste"], .rc-chip[data-reg="Centro-Oeste"] { --h: #c9a227; }
.rc-uf[data-reg="Sudeste"], .rc-item[data-reg="Sudeste"], .rc-uf-big[data-reg="Sudeste"], .rc-reg[data-reg="Sudeste"], .rc-chip[data-reg="Sudeste"] { --h: #3d84d6; }
.rc-uf[data-reg="Sul"], .rc-item[data-reg="Sul"], .rc-uf-big[data-reg="Sul"], .rc-reg[data-reg="Sul"], .rc-chip[data-reg="Sul"] { --h: #8e63c7; }
.rc-map-card { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--brand) 10%, var(--card)), var(--card) 70%); }
.rc-regions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.rc-chip { min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: .85rem; transition: background .2s, border-color .2s, transform .15s; }
.rc-chip[data-reg] { border-color: color-mix(in srgb, var(--h) 55%, var(--line)); }
.rc-chip:hover { transform: translateY(-1px); }
.rc-chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.rc-chip[data-reg][aria-pressed="true"] { background: var(--h); border-color: var(--h); color: #fff; }
.rc-map-wrap { position: relative; }
.rc-map { display: block; width: 100%; max-height: 74vh; height: auto; margin: 0 auto; }
.rc-uf { --h: var(--brand); fill: color-mix(in srgb, var(--h) 52%, var(--card)); stroke: var(--card); stroke-width: 1.6; stroke-linejoin: round; cursor: pointer; outline: none;
  transform-box: fill-box; transform-origin: center; transition: fill .25s, opacity .3s, transform .25s cubic-bezier(.2,.9,.3,1.3), filter .25s;
  animation: rc-pop .6s cubic-bezier(.2,.9,.3,1.2) both; animation-delay: calc(var(--i) * 28ms); }
.rc-map.ready .rc-uf { animation: none; }
.rc-uf:hover, .rc-uf:focus-visible { fill: color-mix(in srgb, var(--h) 85%, var(--card)); transform: scale(1.06); filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); }
.rc-uf:focus-visible { stroke: var(--ink); stroke-width: 2.4; }
.rc-uf.sel { fill: var(--h); stroke: var(--ink); stroke-width: 2.4; transform: scale(1.05); animation: rc-glow 1.8s ease-in-out infinite; }
.rc-uf.dim { opacity: .22; }
.rc-lbl { font: 700 15px system-ui, sans-serif; fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.45); stroke-width: 3px; pointer-events: none; transition: opacity .3s; animation: rc-fade .8s .9s both; }
.rc-map.ready .rc-lbl { animation: none; }
.rc-lbl.dim { opacity: .2; }
.rc-tip { position: absolute; left: 0; top: 0; pointer-events: none; padding: 5px 10px; border-radius: 8px; background: var(--ink); color: var(--card); font-size: .82rem; font-weight: 600; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,.25); z-index: 2; }
@keyframes rc-pop { from { opacity: 0; transform: scale(.55) translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes rc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rc-glow { 0%, 100% { filter: drop-shadow(0 0 2px color-mix(in srgb, var(--h) 70%, transparent)); } 50% { filter: drop-shadow(0 0 10px var(--h)); } }
.rc-panel { position: sticky; top: 12px; }
.rc-panel.rc-swap { animation: rc-in .35s ease both; }
@keyframes rc-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.rc-empty { text-align: left; }
.rc-pin { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, var(--card)); margin-bottom: 8px; animation: rc-bob 2.2s ease-in-out infinite; }
@keyframes rc-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.rc-sel { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.rc-sel h2 { margin: 0 0 4px; }
.rc-uf-big { --h: var(--brand); width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 16px; font: 800 1.6rem system-ui, sans-serif; color: #fff; background: linear-gradient(135deg, var(--h), color-mix(in srgb, var(--h) 60%, #000)); box-shadow: 0 6px 16px color-mix(in srgb, var(--h) 45%, transparent); }
.rc-reg { border-color: var(--h); color: var(--ink); }
a.btn.rc-open { width: 100%; margin-top: 12px; background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 700; transition: transform .15s, box-shadow .2s; }
a.btn.rc-open:hover { transform: translateY(-2px); box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 40%, transparent); }
.rc-note { margin: 10px 0 0; }
.rc-cnpj-msg { min-height: 1.2em; margin: 4px 0 0; }
.rc-cnpj-msg.ok { color: var(--ok); }
.rc-cnpj-msg.bad { color: var(--bad); }
.rc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rc-item { --h: var(--brand); display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; text-align: left; border-left: 4px solid var(--h); transition: transform .15s, background .2s, opacity .3s; animation: rc-fade .5s both; animation-delay: calc(var(--i) * 20ms); }
.rc-item b { font-size: .95rem; }
.rc-item span { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-item:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--h) 12%, var(--card)); }
.rc-item.sel { background: color-mix(in srgb, var(--h) 22%, var(--card)); border-color: var(--h); }
.rc-item.dim { opacity: .3; }
.rc-other { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.rc-link { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: transform .15s, border-color .2s; }
.rc-link:hover { transform: translateY(-2px); border-color: var(--brand); }
@media (prefers-reduced-motion: reduce) {
  .rc-uf, .rc-lbl, .rc-item, .rc-pin, .rc-panel.rc-swap, .rc-uf.sel { animation: none !important; }
  .rc-uf, .rc-chip, .rc-open, .rc-item, .rc-link { transition: none; }
}

/* ---- Mapa de balanças (Consulta Inmetro) ---- */
.im-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; min-height: 36px; }
.im-head strong { font-size: 1.1rem; }
.im-uf { fill: color-mix(in srgb, var(--h, var(--brand)) var(--p, 12%), var(--card)); transition: fill .5s, opacity .5s, transform .25s cubic-bezier(.2,.9,.3,1.3), filter .25s; }
.im-uf:hover, .im-uf:focus-visible { fill: color-mix(in srgb, var(--h, var(--brand)) calc(var(--p, 12%) + 18%), var(--card)); transform: none; filter: brightness(1.08); }
.im-uf.off { cursor: default; opacity: .55; }
.im-uf.off:hover { fill: color-mix(in srgb, var(--h, var(--brand)) var(--p, 4%), var(--card)); filter: none; }
.im-uf.dim { opacity: .3; }
.im-uf { vector-effect: non-scaling-stroke; stroke-width: 1px; }
.im-uf.focus { opacity: 1; stroke: var(--ink); stroke-width: 2px; }
.im-map.zoom .rc-lbl { opacity: 0; }
.im-pt { cursor: pointer; outline: none; transform-box: fill-box; transform-origin: center; transition: transform .2s;
  animation: im-pop .55s cubic-bezier(.2,.9,.3,1.3) both; animation-delay: calc(var(--i) * 12ms + .35s); }
.im-pt:hover, .im-pt:focus-visible, .im-pt.sel { transform: scale(1.35); }
.im-dot { fill: var(--c); stroke: var(--card); fill-opacity: .92; }
.im-pt.sel .im-dot, .im-pt:focus-visible .im-dot { stroke: var(--ink); }
.im-ring { fill: none; stroke: var(--c); stroke-width: 1.6; transform-box: fill-box; transform-origin: center; animation: im-ring 2.2s ease-out infinite; pointer-events: none; }
@keyframes im-pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
@keyframes im-ring { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(2.6); } }
.im-bar-stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--line); margin: 8px 0 10px; }
.im-bar-stack span { display: block; transition: flex .5s; }
.im-counts { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: .9rem; }
.im-counts li { display: flex; align-items: center; gap: 8px; }
.im-counts i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.im-counts b { margin-left: auto; padding-left: 8px; }
.im-h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }
.im-top { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.im-item { animation: none; }
.im-item em { font-style: normal; color: var(--bad); }
.im-note { margin-top: 10px; }
.im-legend { margin-top: 10px; }
.im-legend span { display: inline-flex; align-items: center; }
/* pontos do mapa do Brasil: um por município com balança */
.im-nac { fill: var(--c); fill-opacity: .8; stroke: var(--card); stroke-width: .5px; vector-effect: non-scaling-stroke; cursor: pointer; animation: none; }
.im-nac:hover { transform: scale(1.8); fill-opacity: 1; }
.view-toggle { display: flex; gap: 6px; margin-bottom: 10px; }
@media (prefers-reduced-motion: reduce) {
  .im-pt, .im-ring { animation: none !important; }
  .im-uf, .im-pt, .im-bar-stack span { transition: none; }
}

/* consulta de CNPJ (módulo Receita) */
.rq-form { display: flex; gap: 8px; flex-wrap: wrap; }
.rq-form input { flex: 1 1 220px; min-width: 0; }
.rq-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-top: 12px; }
.rq-head h2 { margin: 0; overflow-wrap: anywhere; }
.rq-sit[data-ok="true"] { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.rq-sit[data-ok="false"] { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.rq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 20px; margin: 8px 0; }
.rq-row { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.rq-ies, .rq-socios { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 6px; }
.rq-ies li, .rq-socios li { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); overflow-wrap: anywhere; }

/* ---- Vínculos sugeridos / posição aproximada ---- */
.legend i.approx { background: transparent; border: 2px dashed var(--muted); box-sizing: border-box; }
.vg { margin-bottom: 14px; }
.vm { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.vmem { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; color: var(--ink); font-size: .95rem; }
.vmem input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.vmem:hover { border-color: var(--brand); }
.vact { display: grid; gap: 4px; margin-top: 8px; }
.vact .row { margin-top: 8px; flex-wrap: wrap; }
.vact [hidden] { display: none !important; }
.vnote { margin: 6px 0; font-size: .9rem; }

/* ---- Etiquetas de origem do dado (Cliente Maxdata / Proprietário Inmetro / Cadastro próprio) ---- */
.origem { display: inline-block; font-size: .72rem; font-weight: 600; line-height: 1.5; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; vertical-align: baseline; }
.origem-maxdata { color: var(--brand); border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--card)); }
.origem-inmetro { color: var(--ok); border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--card)); }
.origem-proprio, .origem-local { color: var(--muted); }

.vev { margin: 6px 0; padding-left: 18px; font-size: .9rem; }
.ve { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; }
#vlres .list { margin-top: 10px; }
#tcbox summary { cursor: pointer; }
#tcbox .row { margin-top: 8px; flex-wrap: wrap; }

.vreg { margin: 10px 0; }
.vreg summary { cursor: pointer; }
.vreg form { margin-top: 8px; flex-wrap: wrap; }
.vlist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }

.rota-dlg { max-width: 420px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); padding: 16px; }
.rota-dlg::backdrop { background: rgba(0, 0, 0, .5); }
.rt-stops { margin: 8px 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.rt-stops li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rt-act { margin-left: auto; display: inline-flex; gap: 4px; }
.rota-dlg [hidden] { display: none !important; }

.seat-in { width: 5.5rem; }

/* ---------- Gerador de senha SBR140 ---------- */
.sbr { max-width: 560px; margin: 0 auto; }
.sbr-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.sbr-head > div { flex: 1 1 180px; min-width: 0; }
.sbr-head p { margin: 2px 0 0; }
.sbr-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; flex: 0 0 48px; color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); }
.sbr-pill { font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.sbr-pill::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: currentColor; }
.sbr-pill.on { color: var(--ok); border-color: var(--ok); }
.sbr-pill.off { color: var(--warn); border-color: var(--warn); }
.sbr-calc { padding: 20px; }
.sbr #sbr-a.sbr-input { font: 600 1.45rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .1em; text-align: center; min-height: 58px !important; margin-top: 6px; }
.sbr-meter { height: 4px; border-radius: 4px; background: var(--line); margin: 8px 0 4px; overflow: hidden; }
.sbr-meter i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .15s ease, background .15s ease; }
.sbr-meter i.ok { background: var(--ok); }
.sbr-lbl { display: block; font-size: .85rem; color: var(--muted); margin: 16px 0 6px; }
.sbr-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
.sbr-seg button { min-height: 50px; border: 0; background: transparent; border-radius: 10px; font-weight: 600; font-size: 1.02rem; color: var(--muted); transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.sbr-seg button[aria-checked="true"] { background: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.sbr-dica { margin: 8px 2px 0; }
.sbr-go { width: 100%; min-height: 52px; margin-top: 6px; font-size: 1.05rem; }
.sbr-result { margin-top: 18px; padding: 16px; border-radius: 14px; border: 2px solid var(--ok); background: color-mix(in srgb, var(--ok) 9%, var(--card)); }
.sbr-result.pop { animation: sbr-pop .28s ease-out; }
.sbr-b { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 14px; font: 700 clamp(1.15rem, 5.4vw, 1.8rem)/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; text-align: center; font-variant-numeric: tabular-nums; }
.sbr-b span { padding: 10px 0; border-radius: 10px; background: var(--card); border: 1px solid var(--line); user-select: all; }
.sbr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sbr-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; }
.sbr-stat strong { font-size: 1.5rem; line-height: 1.1; }
.sbr-stat span { color: var(--muted); font-size: .82rem; }
.sbr-nota { margin: 0 2px 14px; }
.sbr-hist ul { margin: 0; }
.sbr-planos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 14px 0; }
.sbr-plano { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 2px; background: var(--bg); }
.sbr-plano strong { font-size: 1.7rem; line-height: 1.1; }
.sbr-plano small { color: var(--muted); }
.sbr-plano.destaque { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, var(--card)); }
@keyframes sbr-pop { from { transform: scale(.97); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sbr-result.pop { animation: none; } .sbr-meter i, .sbr-seg button { transition: none; } }

/* Ler a Senha A pela câmera (sbr-camera.js) */
.sbr-cam-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 6px 0 2px; color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: color-mix(in srgb, var(--brand) 8%, var(--card)); font-weight: 600; }
.sbr-cam-btn svg { width: 20px; height: 20px; }
.sbr-cam { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: #000; }
.sbr-cam-area { position: relative; flex: 1; overflow: hidden; }
.sbr-cam-area video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sbr-cam-frame { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .55); border-radius: 6px; }
.sbr-cam-frame[hidden] { display: none; }
.sbr-cam-frame i { position: absolute; width: 18px; height: 18px; border: 3px solid #4cc38a; }
.sbr-cam-frame i:nth-child(1) { top: -3px; left: -3px; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.sbr-cam-frame i:nth-child(2) { top: -3px; right: -3px; border-left: 0; border-bottom: 0; border-top-right-radius: 6px; }
.sbr-cam-frame i:nth-child(3) { bottom: -3px; left: -3px; border-right: 0; border-top: 0; border-bottom-left-radius: 6px; }
.sbr-cam-frame i:nth-child(4) { bottom: -3px; right: -3px; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }
.sbr-cam-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--bg); color: var(--ink); }
.sbr-cam-dica { margin: 0; text-align: center; }
.sbr-cam-dica.erro { color: var(--bad); }
.sbr-cam-steps { display: flex; gap: 6px; }
.sbr-cam-steps span { width: 34px; height: 5px; border-radius: 3px; background: var(--line); }
.sbr-cam-steps span.ok { background: var(--ok); }
