/* Tela enxuta para celular (ADR-014): o número firme à direita, a data sempre à vista, o resto no detalhe. */
:root {
  --bg: #f1f4f3; --sup: #ffffff; --sup2: #f7f9f8; --tinta: #14242a; --suave: #586a70; --linha: #e0e6e5; --linha-forte: #c7d1d0;
  --acento: #1e5868; --acento-fundo: #e3eef0;
  --subiu: #a3322a; --subiu-fundo: #f8e8e6; --desceu: #24609f; --desceu-fundo: #e5edf7;
  --atraso: #8a5a00; --atraso-fundo: #fbf0d6;
  --subiu-leve: rgba(163, 50, 42, .14); --desceu-leve: rgba(36, 96, 159, .14);
  --f-num: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --f-txt: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --raio: 14px; color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0e1719; --sup: #152125; --sup2: #1a282d; --tinta: #e3ecee; --suave: #94a7ad; --linha: #24353a; --linha-forte: #34494f;
  --acento: #7fc0cf; --acento-fundo: #193139;
  --subiu: #f2928a; --subiu-fundo: #3a201d; --desceu: #8fb8ee; --desceu-fundo: #1a2a3e;
  --subiu-leve: rgba(242, 146, 138, .20); --desceu-leve: rgba(143, 184, 238, .20); --atraso: #e8c27a; --atraso-fundo: #3a2f17; color-scheme: dark } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--tinta); font: 15px/1.4 var(--f-txt); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
.pad { padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); }
main, .topo > * { max-width: 640px; margin-left: auto; margin-right: auto; }
h1, h2 { font-family: var(--f-num); font-weight: 700; margin: 0; line-height: 1.15; }
h1 { font-size: 19px; } h2 { font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
h2 small { font: 500 12.5px var(--f-txt); color: var(--suave); }
.msg { color: var(--suave); font-size: 13px; margin: 0; }
.rotulo { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); font-weight: 600; }
.num, .preco, .grande { font-family: var(--f-num); font-variant-numeric: tabular-nums lining-nums; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.sobe { color: var(--subiu); } .desce { color: var(--desceu); }

/* Topo: título, data e três botões de contexto */
.topo { position: sticky; top: 0; z-index: 5; background: var(--sup); border-bottom: 1px solid var(--linha);
  padding-top: calc(10px + env(safe-area-inset-top, 0px)); padding-bottom: 10px; display: grid; gap: 8px; }
.topo .linha1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.contexto { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.contexto .chip { width: 100%; }
.chip { min-width: 0; border: 1px solid var(--linha-forte); background: var(--sup); border-radius: 999px;
  padding: 6px 10px; min-height: 36px; font-size: 13.5px; text-overflow: ellipsis; }
.selo { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--acento-fundo); color: var(--acento); white-space: nowrap; }
.selo.atraso { background: var(--atraso-fundo); color: var(--atraso); }

/* Barra de baixo */
.abas-baixo { position: fixed; inset: auto 0 0 0; z-index: 6; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--sup); border-top: 1px solid var(--linha); padding-bottom: env(safe-area-inset-bottom, 0px); }
.abas-baixo a { text-align: center; padding: 14px 4px; font-weight: 700; color: var(--suave); text-decoration: none; }
.abas-baixo a[aria-current="page"] { color: var(--acento); box-shadow: inset 0 3px 0 var(--acento); }

/* Ferramentas: Lista/Grade e ordem */
.ferramentas { display: flex; gap: 8px; align-items: center; margin: 12px 0 4px; }
.alternar { display: flex; border: 1px solid var(--linha-forte); border-radius: 999px; overflow: hidden; flex: none; }
.alternar button { border: 0; background: var(--sup); padding: 6px 14px; min-height: 36px; font-size: 13.5px; cursor: pointer; }
.alternar button[aria-pressed="true"] { background: var(--acento-fundo); color: var(--acento); font-weight: 700; }
.campo { width: 100%; margin-top: 12px; border: 1px solid var(--linha-forte); background: var(--sup); border-radius: 10px; padding: 9px 12px; min-height: 42px; }

/* Blocos e listas */
.bloco { margin: 14px 0; display: grid; gap: 8px; }
.cartao { background: var(--sup); border: 1px solid var(--linha); border-radius: var(--raio); overflow: hidden; }
.convite { margin: 0; padding: 14px; border: 1px dashed var(--linha-forte); border-radius: var(--raio); color: var(--suave); font-size: 13.5px; text-align: center; }
.vazio { text-align: center; color: var(--suave); padding: 24px 8px; }
.linha-prod { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; padding: 11px 12px 11px 6px;
  border-bottom: 1px solid var(--linha); cursor: pointer; }
.linha-prod:last-child { border-bottom: 0; }
.linha-prod .nome { font-weight: 600; overflow-wrap: anywhere; line-height: 1.25; }
.linha-prod .valor { display: grid; justify-items: end; gap: 2px; }
.preco { font-weight: 700; font-size: 19px; line-height: 1.05; white-space: nowrap; }
/* preço que mudou: só o fundo na cor do sentido, número na cor normal — vermelho subiu, azul desceu (laranja e verde são das planilhas, lei 14) */
.mudou .preco { border-radius: 6px; padding: 0 5px; margin-right: -5px; }
.mudou.subiu .preco { background: var(--subiu-leve); }
.mudou.desceu .preco { background: var(--desceu-leve); }
.cartao-prod.mudou .preco { justify-self: start; margin-right: 0; }
.var { font: 700 12.5px var(--f-num); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.var.sobe { background: var(--subiu-fundo); } .var.desce { background: var(--desceu-fundo); }
.estrela { border: 0; background: none; color: var(--acento); font-size: 20px; line-height: 1; padding: 6px; min-width: 36px; min-height: 36px; cursor: pointer; }
.grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cartao-prod { position: relative; background: var(--sup); border: 1px solid var(--linha); border-radius: 12px; padding: 10px 10px 10px 12px;
  display: grid; gap: 4px; align-content: start; cursor: pointer; }
.cartao-prod .nome { font-weight: 600; font-size: 13.5px; line-height: 1.25; padding-right: 26px; overflow-wrap: anywhere; }
.cartao-prod .estrela { position: absolute; top: 2px; right: 2px; }
.cartao-prod .var, .quieto { justify-self: start; }
.quieto { font-size: 12px; color: var(--suave); }
details.sessao { background: var(--sup); border: 1px solid var(--linha); border-radius: var(--raio); overflow: hidden; }
details.sessao > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.titulo-sessao { flex: 1; min-width: 0; display: grid; gap: 2px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.selo-mudou { flex: none; font: 600 12px var(--f-txt); padding: 2px 8px; border-radius: 999px; background: var(--acento-fundo); color: var(--acento); }
details.sessao > summary::-webkit-details-marker { display: none; }
details.sessao > summary small { font: 500 12.5px var(--f-txt); color: var(--suave); }
details.sessao[open] > summary { border-bottom: 1px solid var(--linha); background: var(--sup2); }
details.sessao .cartao { border: 0; border-radius: 0; }
details.sessao .grade { padding: 8px; }

/* Botões */
.btn { border: 0; border-radius: 10px; padding: 10px 14px; background: var(--acento); color: var(--sup); font-weight: 700; cursor: pointer; min-height: 42px; }
.btn.sec { background: var(--acento-fundo); color: var(--acento); }
.btn.largo { width: 100%; margin-top: 4px; }
.btn.mini { min-height: 30px; padding: 3px 10px; font-size: 12.5px; }
.voltar { border: 0; background: none; color: var(--acento); font-weight: 700; padding: 10px 0 0; cursor: pointer; }

/* Comparar e detalhe */
.rolar { overflow-x: auto; }
.grade-precos { width: 100%; border-collapse: collapse; font-size: 14px; }
.grade-precos th, .grade-precos td { padding: 9px 8px; border-bottom: 1px solid var(--linha); text-align: right; }
.grade-precos th:first-child, .grade-precos td:first-child { text-align: left; }
.grade-precos tr:last-child td { border-bottom: 0; }
.grade-precos td.escolhida { color: var(--acento); font-weight: 700; }
.titulo-prod { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.titulo-prod h2 { font-size: 19px; }
.nome-real { margin: 0; font-size: 12px; color: var(--suave); text-transform: uppercase; letter-spacing: .02em; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.destaque { padding: 14px; display: grid; gap: 6px; }
.grande { font-size: 38px; font-weight: 800; line-height: 1; }
.grafico { width: 100%; height: 60px; display: block; }
.grafico polyline { fill: none; stroke: var(--acento); stroke-width: 2; vector-effect: non-scaling-stroke; }
.fatos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; padding: 14px; margin: 0 0 14px; }
.fatos dt { font-size: 11px; text-transform: uppercase; color: var(--suave); font-weight: 600; } .fatos dd { margin: 0; font-weight: 600; }
