@font-face {
  font-family: "Geist";
  src: url("/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* Tema claro único (pedido do projeto). Raios: barra de busca, chips e botões em pílula; painéis 20px;
   teclas da urna 12px (referência física, regra única). */
:root {
  --fundo: #ffffff;
  --fundo-2: #f5f6f5;
  --fundo-3: #eef0ee;
  --tinta: #0a0c0b;
  --tinta-2: #474e4a;
  --tinta-3: #6b726e;
  --linha: #ecedec;
  --linha-2: #dcdfdc;
  --verde: #0e7a45;           /* 2º turno e melhor horário (validado para daltonismo com o laranja) */
  --verde-texto: #0b6a3b;
  --verde-fundo: rgb(14 122 69 / .08);
  --laranja: #f0883e;         /* pico do 1º turno */
  --laranja-texto: #a24e15;
  --r1: #9aa29e;              /* 1º turno */
  --r1-fundo: #eceeec;
  --tecla: #2fb36a;
  --tecla-texto: #07120b;
  --sombra-barra: 0 1px 1px rgb(10 12 11 / .04), 0 10px 30px -10px rgb(10 12 11 / .16), 0 30px 60px -30px rgb(10 12 11 / .12);
  --sombra-cartao: 0 1px 1px rgb(10 12 11 / .03), 0 24px 48px -24px rgb(10 12 11 / .18);
  --mola: cubic-bezier(.34, 1.56, .64, 1);
  --suave: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fundo); color: var(--tinta);
  font: 400 16px/1.55 "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh; display: flex; flex-direction: column;
}
main { flex: 1; }
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.ic { width: 1.15em; height: 1.15em; flex-shrink: 0; }
.nw { white-space: nowrap; }
:focus-visible { outline: 2px solid var(--verde); outline-offset: 3px; border-radius: 8px; }

/* ------------------------------------------------------------ topo */
.topo { display: flex; align-items: center; justify-content: space-between; max-width: 1240px; width: 100%; margin: 0 auto; padding: 20px 20px 0; }
.marca { font-weight: 650; font-size: 19px; letter-spacing: -.04em; color: var(--tinta); text-decoration: none; }
.marca span { color: var(--r1); font-weight: 500; }
.topo-dir { display: flex; align-items: center; gap: 6px; }
.contagem { margin: 0; font-size: 13.5px; color: var(--tinta-2); background: var(--fundo-2); border-radius: 999px; padding: 6px 12px; font-variant-numeric: tabular-nums; }
.contagem strong { color: var(--tinta); font-weight: 600; }
.som { width: 34px; height: 34px; border-radius: 999px; border: 0; background: none; color: var(--tinta-3); display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s; }
.som:hover { background: var(--fundo-2); color: var(--tinta); }

/* ------------------------------------------------------------ cabeça */
.palco { max-width: 1240px; margin: 0 auto; padding: 0 20px; width: 100%; }
.cabeca { text-align: center; max-width: 860px; margin: 0 auto; padding: clamp(36px, 7vh, 72px) 0 26px; }
.onde { margin: 0 0 14px; display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; font-size: 14.5px; color: var(--tinta-2); }
.onde b { color: var(--tinta); font-weight: 600; }
.onde .sep { color: var(--linha-2); }
h1 {
  margin: 0; font-weight: 640; font-size: clamp(38px, 7.2vw, 76px); line-height: 1.02; letter-spacing: -.05em; text-wrap: balance;
}
h1 em { font-style: normal; color: var(--verde-texto); white-space: nowrap; }
.sub { margin: 16px auto 0; max-width: 54ch; font-size: clamp(16px, 2vw, 18.5px); color: var(--tinta-2); text-wrap: balance; }
.sub strong { color: var(--tinta); font-weight: 600; }
.sub .tb { color: var(--verde-texto); font-weight: 600; }

/* entrada da página: o conteúdo sobe em sequência */
@media (prefers-reduced-motion: no-preference) {
  .entra { animation: entra .9s var(--suave) both; animation-delay: calc(var(--i, 0) * 70ms); }
  .troca { animation: troca .55s var(--suave) both; }
}
@keyframes entra { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes troca { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ busca */
.busca { position: relative; max-width: 680px; margin: 0 auto; z-index: 30; }
.barra {
  display: flex; align-items: center; gap: 8px; height: 64px; padding: 0 8px 0 20px; border-radius: 999px;
  background: var(--fundo); border: 1px solid var(--linha-2); box-shadow: var(--sombra-barra);
  transition: border-color .25s, box-shadow .25s, transform .25s var(--suave);
}
.barra:focus-within { border-color: var(--tinta-3); box-shadow: 0 0 0 5px var(--fundo-3), var(--sombra-barra); }
.ic-busca { color: var(--tinta-3); width: 20px; height: 20px; }
.barra input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font-size: 17px; letter-spacing: -.01em; }
.barra input:focus { outline: none; }
.barra input::placeholder { color: var(--tinta-3); }
.contexto {
  display: inline-flex; align-items: center; gap: 6px; max-width: 42%; height: 34px; padding: 0 6px 0 12px; border-radius: 999px;
  background: var(--fundo-3); font-size: 14.5px; font-weight: 550; white-space: nowrap;
}
.contexto span { overflow: hidden; text-overflow: ellipsis; }
.contexto button { width: 24px; height: 24px; border-radius: 999px; border: 0; background: none; display: grid; place-items: center; color: var(--tinta-3); cursor: pointer; }
.contexto button:hover { background: var(--linha-2); color: var(--tinta); }
.contexto .ic { width: 14px; height: 14px; }
.perto {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 999px; border: 0;
  background: none; color: var(--tinta-2); font-size: 14.5px; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s;
}
.perto:hover { background: var(--fundo-2); color: var(--tinta); }
.perto.carregando .ic { animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
@media (max-width: 560px) { .perto span { display: none; } .perto { padding: 0 10px; } .barra { padding-left: 16px; } }

.tecla {
  height: 48px; padding: 0 20px; border: 0; border-radius: 12px; cursor: pointer; flex-shrink: 0;
  font-weight: 750; font-size: 13.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--tecla-texto); background: var(--tecla);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / .16), inset 0 1px 0 rgb(255 255 255 / .4), 0 2px 8px -2px rgb(14 122 69 / .5);
  transition: transform .1s, box-shadow .1s, opacity .25s, filter .25s;
}
.tecla:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgb(0 0 0 / .16), 0 1px 2px rgb(0 0 0 / .2); }
.tecla:disabled { opacity: .35; filter: saturate(.3); cursor: default; box-shadow: none; }
@media (max-width: 420px) { .tecla { padding: 0 14px; letter-spacing: .06em; } }

.resultados {
  position: absolute; top: calc(100% + 10px); left: 0; right: 0; max-height: min(62vh, 520px); overflow: auto; overscroll-behavior: contain;
  background: var(--fundo); border: 1px solid var(--linha-2); border-radius: 22px; box-shadow: var(--sombra-cartao); padding: 8px;
  transform-origin: top center;
}
@media (prefers-reduced-motion: no-preference) { .resultados:not([hidden]) { animation: abre .28s var(--suave); } }
@keyframes abre { from { opacity: 0; transform: translateY(-6px) scale(.985); } to { opacity: 1; transform: none; } }
.grupo { padding: 4px 0 6px; }
.grupo + .grupo { border-top: 1px solid var(--linha); }
.grupo-rot { padding: 10px 14px 4px; font-size: 12.5px; font-weight: 600; color: var(--tinta-3); letter-spacing: .02em; }
.item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 14px; cursor: pointer; }
.item[aria-selected="true"] { background: var(--fundo-2); }
.item .ic-box { width: 34px; height: 34px; border-radius: 10px; background: var(--fundo-2); display: grid; place-items: center; color: var(--tinta-2); }
.item[aria-selected="true"] .ic-box { background: var(--fundo); }
.item .t { display: block; font-weight: 560; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .d { display: block; font-size: 13.5px; color: var(--tinta-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item mark { background: none; color: var(--tinta); font-weight: 700; }
.item .d mark { color: var(--tinta-2); font-weight: 600; }
.item .x { font-size: 13px; color: var(--tinta-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vazio { padding: 18px 16px; color: var(--tinta-2); font-size: 15px; }
.vazio b { color: var(--tinta); }
.esqueleto { height: 52px; margin: 6px 4px; border-radius: 14px; background: linear-gradient(90deg, var(--fundo-2), var(--fundo-3), var(--fundo-2)); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) { .esqueleto { animation: brilho 1.2s linear infinite; } }
@keyframes brilho { to { background-position: -200% 0; } }

.dica-busca { margin: 14px 0 0; text-align: center; font-size: 14px; color: var(--tinta-3); }
.dica-busca button { border: 0; background: none; padding: 0; color: var(--tinta-2); text-decoration: underline; text-decoration-color: var(--linha-2); text-underline-offset: 3px; cursor: pointer; }
.dica-busca button:hover { color: var(--tinta); text-decoration-color: var(--tinta-3); }

/* ------------------------------------------------------------ seções do local */
.secoes { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 860px; margin: 22px auto 0; }
.secoes-rot { font-size: 14.5px; font-weight: 600; color: var(--tinta-2); }
.chips {
  display: flex; flex-wrap: nowrap; gap: 6px; max-width: min(860px, 100%); overflow-x: auto; scrollbar-width: none; padding: 2px 24px 6px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; }
.chip {
  min-width: 52px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--linha-2); background: var(--fundo);
  font-weight: 560; font-variant-numeric: tabular-nums; cursor: pointer; transition: background .2s, border-color .2s, color .2s, transform .15s var(--mola);
}
.chip:hover { border-color: var(--tinta-3); }
.chip:active { transform: scale(.94); }
.chip[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: var(--fundo); }
.chip-todas { color: var(--tinta-2); font-weight: 500; }

/* ------------------------------------------------------------ gráfico */
.palco-grafico { position: relative; margin: clamp(28px, 5vh, 48px) 0 0; }
.grafico-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 0 2px 14px; }
.legenda { display: flex; flex-wrap: wrap; gap: 6px; }
.leg {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px;
  border: 1px solid var(--linha); background: var(--fundo); font-size: 13.5px; color: var(--tinta-2); cursor: pointer; transition: opacity .2s, border-color .2s;
}
.leg:hover { border-color: var(--linha-2); }
.leg[aria-pressed="false"] { opacity: .45; }
.leg i { display: inline-block; width: 16px; height: 10px; border-radius: 3px; }
.leg-1 i { background: var(--r1-fundo); box-shadow: inset 0 2px 0 var(--r1); }
.leg-2 i { height: 3px; background: var(--verde); border-radius: 2px; }
.rotulo-grafico { margin: 0; font-size: 13.5px; color: var(--tinta-3); }

.grafico { position: relative; height: clamp(280px, 44vh, 480px); touch-action: pan-y; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.grafico:focus-visible { outline-offset: 8px; border-radius: 12px; }
.grafico svg { display: block; width: 100%; height: 100%; overflow: visible; }
.g-grade { stroke: var(--linha); stroke-width: 1; }
.g-base { stroke: var(--linha-2); stroke-width: 1; }
.g-eixo { font-size: 12px; fill: var(--tinta-3); font-variant-numeric: tabular-nums; }
.g-encerrado { fill: url(#hachura); }
.g-encerrado-rot { font-size: 11.5px; fill: var(--tinta-3); }
.g-r1-area { fill: url(#grad-r1); }
.g-r1-linha { fill: none; stroke: var(--r1); stroke-width: 1.5; }
.g-r2-area { fill: url(#grad-r2); }
.g-r2-linha { fill: none; stroke: var(--verde); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.g-melhor { fill: var(--verde-fundo); }
.g-segundo { fill: none; stroke: var(--verde); stroke-opacity: .35; stroke-width: 1.5; stroke-dasharray: 4 5; }
.g-pico { fill: var(--laranja); stroke: var(--fundo); stroke-width: 2.5; }
.g-mira { stroke: var(--tinta); stroke-width: 1; stroke-opacity: .5; }
.g-k1 { fill: var(--fundo); stroke: var(--r1); stroke-width: 2.5; }
.g-k2 { fill: var(--verde); stroke: var(--fundo); stroke-width: 3; }
.g-alca { fill: var(--tinta); }
.esconde-1 .g-r1-area, .esconde-1 .g-r1-linha, .esconde-1 .g-k1, .esconde-1 .g-pico { opacity: 0; }
.esconde-2 .g-r2-area, .esconde-2 .g-r2-linha, .esconde-2 .g-k2 { opacity: 0; }
.grafico path, .grafico circle { transition: opacity .3s; }

/* rótulos em HTML por cima do SVG: nítidos e acessíveis */
.etiqueta {
  position: absolute; top: 0; transform: translate(-50%, -130%); padding: 5px 10px; border-radius: 999px; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; pointer-events: none; transition: left .9s var(--suave), opacity .3s;
}
.etiqueta-melhor { background: var(--verde); color: #fff; }
.etiqueta-melhor::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.etiqueta-segundo { background: var(--fundo); color: var(--verde-texto); border: 1px solid rgb(14 122 69 / .3); font-weight: 550; }
.etiqueta-pico { background: none; color: var(--laranja-texto); padding: 0; transform: translate(-50%, -170%); }
.etiqueta-hora {
  background: var(--tinta); color: var(--fundo); font-variant-numeric: tabular-nums; transition: opacity .2s;
  transform: translate(-50%, 0); top: auto; bottom: -2px;
}

.fim {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0;
  font-weight: 800; font-size: clamp(90px, 18vw, 220px); letter-spacing: .02em; color: var(--tinta);
}
.fim.mostra { animation: fim 1.15s var(--suave) forwards; }
@keyframes fim {
  0% { opacity: 0; transform: scale(.8); }
  18% { opacity: 1; transform: scale(1); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.04); filter: blur(6px); }
}
@media (prefers-reduced-motion: reduce) { .fim.mostra { animation: none; } }

/* leitura do horário (régua) */
.leitura {
  display: grid; grid-template-columns: auto 1fr 1fr; align-items: center; gap: 20px 36px;
  margin-top: 18px; padding: 18px 22px; border-radius: 20px; background: var(--fundo-2);
}
.leitura-hora { display: flex; flex-direction: column; min-width: 120px; }
.leitura-hora span { font-size: 40px; font-weight: 650; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.leitura-hora small { font-size: 13.5px; color: var(--tinta-3); margin-top: 6px; }
.leitura-turno { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 6px 14px; align-items: center; }
.lt-rot { font-size: 13px; font-weight: 600; color: var(--tinta-3); grid-column: 1 / -1; }
.lt-rot-2 { color: var(--verde-texto); }
.lt-val { font-size: 14.5px; color: var(--tinta-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lt-val b { color: var(--tinta); font-weight: 650; }
.bonecos { display: flex; gap: 1px; flex-shrink: 0; }
.bonecos svg { width: 20px; height: 26px; color: var(--linha-2); transition: color .25s, transform .35s var(--mola); transition-delay: calc(var(--k) * 22ms); }
.bonecos-1 svg.on { color: var(--tinta-2); }
.bonecos-2 svg.on { color: var(--verde); }
.bonecos svg.on { transform: translateY(-2px); }
@media (max-width: 760px) {
  .leitura { grid-template-columns: 1fr; gap: 14px; padding: 16px 18px; }
  .leitura-hora { flex-direction: row; align-items: baseline; gap: 10px; }
  .leitura-hora span { font-size: 32px; }
  .leitura-turno { grid-template-columns: 1fr; }
  .bonecos svg { width: 15px; height: 21px; }
  .lt-val { white-space: normal; }
}

/* celular, no resultado: o gráfico logo depois da manchete; a busca e as seções depois da leitura */
@media (max-width: 760px) {
  body.resultado .palco { display: flex; flex-direction: column; }
  body.resultado .cabeca { order: 0; padding-bottom: 8px; }
  body.resultado .palco-grafico { order: 1; margin-top: 18px; }
  body.resultado .secoes { order: 2; }
  body.resultado .extras { order: 3; }
  body.resultado .busca { order: 4; width: 100%; margin-top: 36px; }
  .secoes { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 8px; width: 100%; min-width: 0; }
  body.resultado .palco > * { max-width: 100%; min-width: 0; }
  .secoes-rot { text-align: left; }
  .chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 2px 6px; margin: 0 -20px; padding-inline: 20px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; scroll-snap-align: start; }
  .contexto { max-width: 38%; }
  .tecla { height: 44px; padding: 0 12px; font-size: 12px; letter-spacing: .05em; }
  .tecla:disabled { display: none; }
  .barra { padding-right: 6px; }
  .contexto:not([hidden]) ~ .perto { display: none; }
  .compartilha .btn-principal { flex: 1 1 auto; }
}
.arraste { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--tinta-3); transition: opacity .4s; }
.arraste.some { opacity: 0; }

/* ------------------------------------------------------------ resultado */
.extras { max-width: 980px; margin: 40px auto 0; }
.numeros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 28px; }
.numeros > div { padding: 18px 20px; border-radius: 20px; background: var(--fundo); border: 1px solid var(--linha); }
.numeros dt { font-size: 13.5px; color: var(--tinta-3); margin-top: 8px; }
.numeros dd { margin: 0; font-size: 32px; font-weight: 650; letter-spacing: -.045em; line-height: 1.05; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
.numeros dd small { font-size: 14px; font-weight: 500; color: var(--tinta-3); letter-spacing: 0; }
.numeros .seta { color: var(--r1); font-weight: 400; }
.numeros .bom { color: var(--verde-texto); }
.numeros > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
@media (max-width: 720px) { .numeros { grid-template-columns: 1fr; } .numeros dd { font-size: 28px; } }

.compartilha { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 48px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--linha-2); background: var(--fundo); color: var(--tinta); font-weight: 580; font-size: 15px; text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: transform .15s var(--mola), border-color .2s, background .2s;
}
.btn:hover { border-color: var(--tinta-3); }
.btn:active { transform: scale(.96); }
.btn-ic { width: 48px; padding: 0; }
.btn-ic .ic { width: 20px; height: 20px; }
.btn-principal { background: var(--tinta); border-color: var(--tinta); color: var(--fundo); padding: 0 24px; }
.btn-principal:hover { border-color: var(--tinta); background: #262b28; }
.aviso { min-height: 22px; margin: 10px 0 0; text-align: center; font-size: 14px; color: var(--verde-texto); }
.nota { display: block; margin-top: 8px; font-size: 14px; color: var(--tinta-3); }

.tabela { margin-top: 18px; text-align: center; }
.tabela summary { display: inline-block; cursor: pointer; color: var(--tinta-3); font-size: 14px; padding: 6px 10px; border-radius: 999px; }
.tabela summary:hover { color: var(--tinta); background: var(--fundo-2); }
.tabela-rolagem { overflow: auto; max-height: 380px; margin-top: 10px; border: 1px solid var(--linha); border-radius: 16px; text-align: left; }
.tabela table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.tabela th, .tabela td { padding: 8px 14px; text-align: right; }
.tabela th:first-child, .tabela td:first-child { text-align: left; }
.tabela thead th { position: sticky; top: 0; background: var(--fundo); color: var(--tinta-3); font-weight: 600; border-bottom: 1px solid var(--linha); }
.tabela tbody tr:nth-child(even) { background: var(--fundo-2); }

/* ------------------------------------------------------------ método e rodapé */
.metodo { max-width: 1240px; width: 100%; margin: 96px auto 0; padding: 0 20px; }
.metodo h2 { margin: 0 0 24px; font-size: 26px; font-weight: 640; letter-spacing: -.035em; }
.metodo-grade { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
.metodo-grade p { margin: 0; padding: 22px; border-radius: 20px; background: var(--fundo-2); color: var(--tinta-2); font-size: 15px; }
.metodo-grade strong { display: block; color: var(--tinta); font-weight: 620; font-size: 16px; margin-bottom: 6px; letter-spacing: -.01em; }
@media (max-width: 860px) { .metodo-grade { grid-template-columns: 1fr; } }
.rodape { max-width: 1240px; width: 100%; margin: 0 auto; padding: 32px 20px 44px; font-size: 13px; color: var(--tinta-3); }
.rodape p { margin: 0; max-width: 72ch; }
