/* Jow QR Code — mesma identidade do jownfc.com.br: fundo quase preto,
   superfícies com borda fina, texto em cinzas, botão principal em pílula,
   fonte Manrope, títulos com destaque em Instrument Serif itálica, monograma
   "J" prateado. Dourado só nos detalhes (gráficos, progresso, ícone ativo). */

@font-face { font-family: 'Manrope'; font-weight: 400; font-display: swap; src: url('fonts/manrope-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Manrope'; font-weight: 400; font-display: swap; src: url('fonts/manrope-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+1EF2-1EFF,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-weight: 500; font-display: swap; src: url('fonts/manrope-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Manrope'; font-weight: 500; font-display: swap; src: url('fonts/manrope-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+1EF2-1EFF,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-weight: 700; font-display: swap; src: url('fonts/manrope-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/instrument-serif-latin-400-italic.woff2') format('woff2'); }

/* ------------------------------------------------------------ tokens */
:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: #0d0d0d;
  --surface-2: #121212;
  --surface-3: #181818;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --line-hover: rgba(255, 255, 255, .24);
  --text: #fafafa;
  --text-2: #a7a6a6;
  --text-3: #8b8a8a;
  --ok: #86c79c; --ok-bg: rgba(134, 199, 156, .12); --ok-line: rgba(134, 199, 156, .30);
  --no: #e8908b; --no-bg: rgba(232, 144, 139, .12); --no-line: rgba(232, 144, 139, .30);
  --warn: #d8b46e; --warn-bg: rgba(216, 180, 110, .12); --warn-line: rgba(216, 180, 110, .30);
  --hover: rgba(255, 255, 255, .06);
  --active: rgba(255, 255, 255, .08);
  --primary-bg: #fafafa; --primary-hover: #ffffff; --primary-text: #050505;
  --sidebar-bg: #080808;
  --bar-bg: rgba(10, 10, 10, .86);
  --shadow: 0 24px 60px rgba(0, 0, 0, .55);
  --card-shadow: none;
  --focus: rgba(255, 255, 255, .7);
  --prata: linear-gradient(150deg, #ffffff 0%, #d6d6d6 32%, #8e8e8e 56%, #ececec 80%, #a2a2a2 100%);
  --ouro: linear-gradient(135deg, #f4e4ad 0%, #d8b45f 28%, #b8892f 55%, #e9cf88 80%, #a97b28 100%);
  --ouro-1: #f0d993; --ouro-2: #c9a24d; --ouro-3: #9c7a32;
  --ouro-barra: linear-gradient(180deg, #c9a24d 0%, #b08a3a 45%, #96752f 100%);
  --ouro-barra-forte: linear-gradient(180deg, #f0d993 0%, #d2ad57 100%);
  --trilho: rgba(255, 255, 255, .06);

  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --radius: 16px; --radius-sm: 12px; --radius-lg: 22px; --pill: 999px;
  --sidebar-w: 248px;
  --tabbar-h: 64px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f4f2; --surface: #ffffff; --surface-2: #fafaf9; --surface-3: #f2f2f0;
  --line: rgba(0, 0, 0, .08); --line-strong: rgba(0, 0, 0, .14); --line-hover: rgba(0, 0, 0, .24);
  --text: #0a0a0a; --text-2: #525252; --text-3: #6b6b6b;
  --ok: #2f7a4d; --ok-bg: rgba(47, 122, 77, .08); --ok-line: rgba(47, 122, 77, .3);
  --no: #b3453f; --no-bg: rgba(179, 69, 63, .08); --no-line: rgba(179, 69, 63, .3);
  --warn: #8a6516; --warn-bg: rgba(168, 129, 47, .1); --warn-line: rgba(168, 129, 47, .35);
  --hover: rgba(0, 0, 0, .045); --active: rgba(0, 0, 0, .06);
  --primary-bg: #0a0a0a; --primary-hover: #2a2a2a; --primary-text: #ffffff;
  --sidebar-bg: #fbfbfa; --bar-bg: rgba(250, 250, 249, .88);
  --shadow: 0 18px 50px rgba(0, 0, 0, .14);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .04);
  --focus: rgba(0, 0, 0, .6);
  --ouro-1: #c9a24d; --ouro-2: #a8812f; --ouro-3: #7d5f1f;
  --ouro-barra: linear-gradient(180deg, #b8913f 0%, #a8812f 45%, #8a6a25 100%);
  --ouro-barra-forte: linear-gradient(180deg, #d2ad57 0%, #b08a3a 100%);
  --trilho: rgba(0, 0, 0, .05);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f4f4f2; --surface: #ffffff; --surface-2: #fafaf9; --surface-3: #f2f2f0;
    --line: rgba(0, 0, 0, .08); --line-strong: rgba(0, 0, 0, .14); --line-hover: rgba(0, 0, 0, .24);
    --text: #0a0a0a; --text-2: #525252; --text-3: #6b6b6b;
    --ok: #2f7a4d; --ok-bg: rgba(47, 122, 77, .08); --ok-line: rgba(47, 122, 77, .3);
    --no: #b3453f; --no-bg: rgba(179, 69, 63, .08); --no-line: rgba(179, 69, 63, .3);
    --warn: #8a6516; --warn-bg: rgba(168, 129, 47, .1); --warn-line: rgba(168, 129, 47, .35);
    --hover: rgba(0, 0, 0, .045); --active: rgba(0, 0, 0, .06);
    --primary-bg: #0a0a0a; --primary-hover: #2a2a2a; --primary-text: #ffffff;
    --sidebar-bg: #fbfbfa; --bar-bg: rgba(250, 250, 249, .88);
    --shadow: 0 18px 50px rgba(0, 0, 0, .14);
    --card-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .04);
    --focus: rgba(0, 0, 0, .6);
    --ouro-1: #c9a24d; --ouro-2: #a8812f; --ouro-3: #7d5f1f;
    --ouro-barra: linear-gradient(180deg, #b8913f 0%, #a8812f 45%, #8a6a25 100%);
    --ouro-barra-forte: linear-gradient(180deg, #d2ad57 0%, #b08a3a 100%);
    --trilho: rgba(0, 0, 0, .05);
  }
}

/* ------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--font); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -.015em; line-height: 1.2; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); letter-spacing: .06em; }
.muted { color: var(--text-2); }
.fraco { color: var(--text-3); font-size: 13.5px; }
.destaque { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.12em; letter-spacing: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ marca */
.marca { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; }
.marca__j {
  position: relative; flex: none; width: 34px; height: 34px; border-radius: 10px;
  background: #0d0d0d; border: 1px solid rgba(255, 255, 255, .16); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.marca__j::after {
  content: ''; position: absolute; inset: 15%; background: var(--prata);
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M8.5%204.5h8.5v10.2a5.3%205.3%200%200%201-10.6%200v-1.2'%20fill='none'%20stroke='black'%20stroke-width='2.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M8.5%204.5h8.5v10.2a5.3%205.3%200%200%201-10.6%200v-1.2'%20fill='none'%20stroke='black'%20stroke-width='2.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.marca__nome { color: var(--text-2); font-size: 15.5px; }
.marca__nome strong { color: var(--text); font-weight: 500; }

/* ------------------------------------------------------------ shell */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 50;
  background: var(--sidebar-bg); border-right: 1px solid var(--line);
  padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 26px; overflow-y: auto;
}
.sidebar .marca { padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  color: var(--text-2); font-weight: 500; font-size: 14.5px;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nav a svg { color: var(--text-3); }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.ativo { background: var(--active); border-color: var(--line); color: var(--text); }
.nav a.ativo svg { color: var(--ouro-2); }
.sidebar__pe { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }

.conteudo { margin-left: var(--sidebar-w); min-height: 100vh; }
.view { width: min(100%, 1120px); padding: 30px 32px 56px; margin: 0 auto; }

.topbar {
  display: none; position: sticky; top: 0; z-index: 40;
  align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  background: var(--bar-bg); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
}
.tabbar {
  display: none; position: fixed; inset: auto 0 0 0; z-index: 40;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 6px 6px env(safe-area-inset-bottom);
  background: var(--bar-bg); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  grid-template-columns: repeat(5, 1fr);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; padding: 0; color: var(--text-3); font-size: 11px; font-weight: 500; cursor: pointer;
}
.tabbar a.ativo, .tabbar button.ativo { color: var(--text); }
.tabbar a.ativo svg, .tabbar button.ativo svg { color: var(--ouro-2); }
.tabbar .tab-ler span.bolha {
  width: 46px; height: 46px; margin-top: -14px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-bg); color: var(--primary-text); box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.tabbar .tab-ler span.bolha svg { color: var(--primary-text) !important; }

@media (max-width: 899px) {
  .sidebar { display: none; }
  .conteudo { margin-left: 0; }
  .topbar { display: flex; }
  .tabbar { display: grid; }
  .view { padding: 18px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
}

/* Menu "Mais" do celular */
.folha {
  position: fixed; inset: auto 0 0 0; z-index: 60; background: var(--surface-2);
  border-top: 1px solid var(--line-strong); border-radius: 22px 22px 0 0; box-shadow: var(--shadow);
  padding: 10px 14px calc(18px + env(safe-area-inset-bottom)); animation: subir .28s var(--ease);
}
.folha::before { content: ''; display: block; width: 38px; height: 4px; border-radius: 4px; background: var(--line-hover); margin: 0 auto 12px; }
.folha .nav a { min-height: 50px; font-size: 16px; }
.veu { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .45); animation: aparecer .2s ease; }
@keyframes subir { from { transform: translateY(30px); opacity: 0; } }
@keyframes aparecer { from { opacity: 0; } }

/* ------------------------------------------------------ cabeçalhos */
.cabeca { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.cabeca h1 { font-size: 30px; }
.cabeca p { color: var(--text-2); margin-top: 6px; }
.voltar { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 14px; margin-bottom: 10px; min-height: 32px; }
.voltar:hover { color: var(--text); }
h2.secao { font-size: 17px; margin: 30px 0 12px; }
@media (max-width: 899px) { .cabeca h1 { font-size: 26px; } }

/* ------------------------------------------------------------ cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--card-shadow); padding: 20px;
}
:not(.grade) > .card + .card { margin-top: 14px; }
.card h3 { font-size: 15.5px; margin-bottom: 12px; }
.grade { display: grid; gap: 14px; }
.grade-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grade-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grade-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 899px) {
  .grade-2, .grade-3 { grid-template-columns: 1fr; }
  .grade-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grade-4 > .card { padding: 16px 14px; }
  .grade-4 .stat__valor { font-size: 28px; }
}

/* ---------------------------------------------------------- botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: var(--pill); border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--text); font-weight: 500; font-size: 15px; cursor: pointer;
  white-space: nowrap; transition: transform .25s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--line-hover); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primario { background: var(--primary-bg); color: var(--primary-text); border-color: transparent; }
.btn--primario:hover { background: var(--primary-hover); }
.btn--perigo { color: var(--no); border-color: var(--no-line); background: var(--no-bg); }
.btn--fantasma { background: transparent; border-color: transparent; color: var(--text-2); padding: 0 12px; }
.btn--fantasma:hover { color: var(--text); background: var(--hover); }
.btn--pequeno { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn--bloco { width: 100%; }
.botoes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
@media (max-width: 559px) { .botoes > .btn { flex: 1 1 100%; } }
.icone-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--text-2); cursor: pointer;
}
.icone-btn:hover { color: var(--text); background: var(--hover); }

/* ---------------------------------------------------------- campos */
.campo { display: flex; flex-direction: column; gap: 7px; margin-top: 16px; }
.campo:first-child { margin-top: 0; }
.campo > label, .campo > .rotulo { font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.campo small { color: var(--text-3); font-size: 12.5px; }
.entrada, select.entrada, textarea.entrada {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font-size: 16px; /* 16px: o iPhone não dá zoom ao tocar */ outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.entrada:focus { border-color: var(--line-hover); box-shadow: 0 0 0 4px var(--hover); }
select.entrada { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; }
.com-botao { display: flex; gap: 8px; }
.com-botao .entrada { flex: 1; min-width: 0; }
.com-botao .btn { min-height: 48px; border-radius: var(--radius-sm); padding: 0 16px; }
.linha-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 559px) { .linha-campos { grid-template-columns: 1fr; } }

/* Escolha em "cartões" (tipo da plaquinha) */
.opcoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opcao { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface-2); cursor: pointer; }
.opcao input { position: absolute; opacity: 0; pointer-events: none; }
.opcao strong { font-weight: 500; }
.opcao span { color: var(--text-3); font-size: 13px; }
.opcao:has(input:checked) { border-color: var(--ouro-2); box-shadow: inset 0 0 0 1px var(--ouro-2); }
.opcao:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; cursor: pointer; }
.interruptor input { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; border-radius: 99px;
  background: var(--line-strong); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.interruptor input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .25s var(--ease); }
.interruptor input:checked { background: var(--ouro-2); }
.interruptor input:checked::after { transform: translateX(18px); }

/* ------------------------------------------------- chips de filtro */
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--line);
  background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { color: var(--text); border-color: var(--line-hover); }
.chip.ativo { background: var(--primary-bg); color: var(--primary-text); border-color: transparent; }
.chip .n { opacity: .7; font-variant-numeric: tabular-nums; }
.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.periodo-livre { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.periodo-livre .entrada { width: auto; min-height: 38px; padding: 6px 10px; font-size: 15px; }

/* ----------------------------------------------------------- selos */
.selo { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--pill);
  font-size: 12.5px; font-weight: 500; border: 1px solid var(--line-strong); color: var(--text-2); white-space: nowrap; }
.selo::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.selo--ativo { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.selo--pausado { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.selo--nao_ativado, .selo--desvinculado { color: var(--text-2); }

/* ------------------------------------------------- números (stats) */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat__rotulo { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13.5px; font-weight: 500; }
.stat__rotulo svg { color: var(--ouro-2); width: 18px; height: 18px; }
.stat__valor { font-size: 34px; font-weight: 500; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat__comp { font-size: 13px; color: var(--text-3); }
.stat__comp b { font-weight: 500; }
.stat__comp .sobe { color: var(--ok); }
.stat__comp .desce { color: var(--no); }
a.card.stat:hover { border-color: var(--line-hover); }
.contadores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.contador { padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--card-shadow); }
.contador b { display: block; font-size: 24px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.contador span { font-size: 12.5px; color: var(--text-2); }
a.contador:hover { border-color: var(--line-hover); }

/* -------------------------------------------------------- gráficos */
.grafico { position: relative; }
.grafico__area { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 180px; padding-top: 18px;
  border-bottom: 1px solid var(--line-strong); }
.grafico__area::before, .grafico__area::after { content: ''; position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); pointer-events: none; }
.grafico__area::before { top: 18px; }
.grafico__area::after { top: calc(18px + (100% - 18px) / 2); }
.grafico__max { position: absolute; top: 0; left: 0; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.barra { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.barra i { display: block; width: 100%; min-height: 0; border-radius: 4px 4px 0 0; background: var(--ouro-barra); transition: opacity .15s; }
.barra.zero i { height: 2px !important; background: var(--trilho); }
.barra.pico i { background: var(--ouro-barra-forte); }
.grafico__area:hover .barra i { opacity: .55; }
.grafico__area .barra:hover i, .grafico__area .barra.foco i { opacity: 1; }
.grafico__eixo { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: var(--text-3); gap: 4px; }
.grafico__eixo.todos span { flex: 1 1 0; text-align: center; }
.dica { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 10px;
  background: var(--surface-3); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: 12.5px; white-space: nowrap; }
.dica b { font-weight: 500; }
.pico-texto { margin-top: 12px; font-size: 13.5px; color: var(--text-2); }
.pico-texto b { color: var(--text); font-weight: 500; }

/* Medidores (aparelhos, ranking): uma barra dourada por linha + rótulo. */
.medidores { display: flex; flex-direction: column; gap: 14px; }
.medidor__topo { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.medidor__topo span:last-child { color: var(--text-2); font-variant-numeric: tabular-nums; }
.medidor__trilho { height: 8px; border-radius: 4px; background: var(--trilho); overflow: hidden; }
.medidor__trilho i { display: block; height: 100%; border-radius: 4px; background: var(--ouro-barra); }
a.medidor:hover .medidor__topo span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.ranking-pos { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%;
  border: 1px solid var(--line-strong); font-size: 11.5px; color: var(--text-2); }
.ranking-pos.primeiro { border-color: var(--ouro-2); color: var(--ouro-2); }

/* ---------------------------------------------------------- listas */
.lista { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); min-height: 60px;
}
.item:last-child { border-bottom: 0; }
a.item:hover { background: var(--hover); border-radius: 10px; }
.item__principal { flex: 1; min-width: 0; }
.item__titulo { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__sub { color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item__lado { text-align: right; flex: none; display: flex; align-items: center; gap: 10px; }
.item__num { font-variant-numeric: tabular-nums; font-weight: 500; }
.item .codigo { font-family: var(--mono); font-weight: 500; letter-spacing: .1em; }
.vazio { padding: 36px 16px; text-align: center; color: var(--text-2); }
.vazio svg { width: 34px; height: 34px; color: var(--ouro-2); margin-bottom: 10px; }

/* ---------------------------------------------------- avisos/toast */
.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--text); font-size: 14px; margin-top: 14px; }
.aviso svg { color: var(--warn); margin-top: 1px; }
.aviso--erro { border-color: var(--no-line); background: var(--no-bg); }
.aviso--erro svg { color: var(--no); }
.aviso--ok { border-color: var(--ok-line); background: var(--ok-bg); }
.aviso--ok svg { color: var(--ok); }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 90; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: var(--pill); background: var(--primary-bg); color: var(--primary-text);
  font-weight: 500; font-size: 14.5px; box-shadow: var(--shadow); animation: subir .3s var(--ease);
}
@media (max-width: 899px) { .toast { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); } }

/* ---------------------------------------------------------- modal */
dialog.modal {
  width: min(100% - 32px, 460px); max-height: calc(100dvh - 48px); padding: 24px; border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); box-shadow: var(--shadow);
}
dialog.modal.largo { width: min(100% - 32px, 760px); }
dialog.modal::backdrop { background: rgba(0, 0, 0, .6); }
dialog.modal h3 { font-size: 19px; margin-bottom: 8px; }
dialog.modal p { color: var(--text-2); }

/* -------------------------------------------- tela de login/entrada */
.entrada-tela { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.entrada-card { width: min(100%, 420px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px 24px; box-shadow: var(--card-shadow); }
.entrada-card h1 { font-size: 27px; margin: 24px 0 8px; }
.entrada-card > p { color: var(--text-2); margin-bottom: 22px; }

/* ------------------------------------------------ tela do código */
.codigo-topo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.codigo-grande { font-family: var(--mono); font-size: 30px; font-weight: 500; letter-spacing: .14em; }
.link-nfc { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-top: 14px; border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong); background: var(--surface-2); font-family: var(--mono); font-size: 14px; word-break: break-all; }
.link-nfc span { flex: 1; }
.dados { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; font-size: 14.5px; }
.dados dt { color: var(--text-3); }
.dados dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 559px) { .dados { grid-template-columns: 1fr; gap: 2px; } .dados dd { margin-bottom: 10px; } }

/* -------------------------------------------------------- scanner */
.camera { position: relative; width: 100%; max-width: 520px; aspect-ratio: 1; margin: 0 auto; border-radius: var(--radius-lg);
  overflow: hidden; background: #000; border: 1px solid var(--line-strong); }
.camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera__mira { position: absolute; inset: 18%; border-radius: 18px; pointer-events: none;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); border: 2px solid rgba(240, 217, 147, .9); }
.camera__vazio { position: absolute; inset: 0; display: grid; place-items: center; color: #a7a6a6; text-align: center; padding: 24px; }
.ler-acoes { max-width: 520px; margin: 16px auto 0; }

/* --------------------------------------------- editor de posição */
.editor { position: relative; width: 100%; max-width: 560px; margin: 0 auto; user-select: none; -webkit-user-select: none; touch-action: none; }
.editor img { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 0 0 1px var(--line-strong); pointer-events: none; -webkit-user-drag: none; }
.editor__caixa { position: absolute; outline: 2px dashed var(--ouro-1); outline-offset: 0; cursor: move; touch-action: none; }
.editor__caixa canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.editor__alca { position: absolute; right: -14px; bottom: -14px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--ouro-1); border: 3px solid var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: nwse-resize; touch-action: none; }
.editor__alca::after { content: ''; position: absolute; inset: -12px; } /* área de toque maior */
.editor-lado { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 899px) { .editor-lado { grid-template-columns: 1fr; } }
.cor-linha { display: flex; gap: 8px; align-items: center; }
.cor-linha input[type=color] { width: 48px; height: 48px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: none; cursor: pointer; }
.medidas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.medidas div { padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.medidas b { display: block; font-weight: 500; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.medidas span { font-size: 12px; color: var(--text-3); }

.miniatura { width: 64px; height: 64px; flex: none; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }
.previa-real { width: 100%; height: auto; display: block; border-radius: 6px; box-shadow: 0 0 0 1px var(--line-strong); }

/* ------------------------------------------------------ progresso */
.progresso { height: 10px; border-radius: 5px; background: var(--trilho); overflow: hidden; margin-top: 14px; }
.progresso i { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--ouro); transition: width .2s linear; }
.progresso-texto { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }

.carregando { display: grid; place-items: center; padding: 60px 0; color: var(--text-3); }
.carregando::before { content: ''; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--ouro-2); animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
