/* ND Bus — direção Miriti: tinta chapada e saturada sobre massa clara.
   Contorno preto só nos "brinquedos" (marcador do ônibus, bloco da linha, campo
   de busca). Uma única família tipográfica; hierarquia por peso e tamanho. */

/* Atkinson Hyperlegible Next, servida pelo próprio app (SIL OFL 1.1, ver public/fontes/OFL.txt).
   Fonte variável: um arquivo por subconjunto cobre os pesos 400, 600 e 800. */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fontes/atkinson-next-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  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: "Atkinson Hyperlegible Next";
  src: url("/fontes/atkinson-next-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --massa: #f5f6f1;
  --papel: #ffffff;
  --funda: #eceee6;
  --tinta: #17141c;
  --tinta-2: #4f4c58;
  --tinta-3: #6b6874;
  --risco: #dfe1d7;
  --anil: #2438c2;
  --anil-sobre: #ffffff;
  --anil-suave: #e7eafc;
  --amarelo: #ffc61a;
  --verde: #0b7a3b;
  --verde-suave: #e2f3e8;
  --ambar: #8a5a00;
  --ambar-suave: #fff3cc;
  --vermelho: #b3260e;
  /* fundo da faixa "apertado": âmbar próprio, nunca o amarelo da seleção */
  --ambar-faixa: #f08a00;
  --vermelho-suave: #fbe6e1;
  --contorno: #17141c;

  /* tintas das linhas: todas seguram texto branco 800 com contraste >= 4.5 */
  --l0: #d4116e; --l1: #2438c2; --l2: #077f8c; --l3: #c4500e; --l4: #1e7f2e;
  --l5: #7a2bbf; --l6: #c8201a; --l7: #8f6400; --l8: #0f5c7a; --l9: #a01550;

  --fonte: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --raio: 16px;
  --saida: cubic-bezier(0.16, 1, 0.3, 1);
  --topo-seguro: env(safe-area-inset-top, 0px);
  --base-segura: env(safe-area-inset-bottom, 0px);
  --abas-altura: calc(64px + var(--base-segura));
  --painel: 420px;
  color-scheme: light;
}

:root[data-tema="escuro"] {
  --massa: #14121a;
  --papel: #1e1b27;
  --funda: #282433;
  --tinta: #f4f2f8;
  --tinta-2: #c9c5d4;
  --tinta-3: #a09cad;
  --risco: #35303f;
  --anil: #2c41d1;
  --anil-suave: #262c57;
  --verde: #0d8a43;
  --verde-suave: #153324;
  --ambar: #ffcf4d;
  --ambar-suave: #3a2f10;
  --vermelho: #c9321a;
  --vermelho-suave: #3d1c16;
  --contorno: #0b0a0f;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--fonte);
  font-size: 16px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  color: var(--tinta);
  background: var(--massa);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: var(--amarelo); color: #17141c; }
input { caret-color: var(--anil); accent-color: var(--anil); }
:focus-visible { outline: 3px solid var(--amarelo); outline-offset: 2px; border-radius: 6px; }
.folha-corpo, .tela-corpo { scrollbar-width: thin; scrollbar-color: var(--risco) transparent; }

.pular { position: fixed; left: 8px; top: -80px; z-index: 100; background: var(--anil); color: #fff; padding: 12px 16px; border-radius: 10px; font-weight: 800; }
.pular:focus { top: 8px; }
.sem-js { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: var(--massa); z-index: 99; text-align: center; }

/* ---------- ícones ---------- */
.ico { display: inline-flex; width: 24px; height: 24px; flex: none; }
.ico svg { width: 100%; height: 100%; display: block; }
.ico.p { width: 18px; height: 18px; }
.ico.g { width: 28px; height: 28px; }

/* ---------- mapa ---------- */
#mapa { position: fixed; inset: 0; background: var(--funda); }
.maplibregl-ctrl-attrib { font-family: var(--fonte); font-size: 11px; }
.credito { position: absolute; left: 12px; bottom: 100%; margin-bottom: 8px; padding: 2px 7px; border-radius: 6px; background: var(--papel); color: var(--tinta-2); font-size: 11px; font-weight: 600; transition: opacity 0.2s; }
.folha[data-estado="cheia"] .credito { opacity: 0; pointer-events: none; }
.maplibregl-canvas { outline: none; }

.marca-eu { width: 22px; height: 22px; border-radius: 50%; background: var(--anil); border: 4px solid #fff; outline: 2px solid var(--contorno); }
.marca-eu.velha { background: var(--tinta-3); }
.marca-parada { width: 20px; height: 30px; border-radius: 6px; background: var(--amarelo); border: 2px solid var(--contorno); transform-origin: 50% 100%; animation: brotar 0.35s var(--saida); }
.marca-destino { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; background: var(--amarelo); border: 2px solid var(--contorno); transform: rotate(-45deg); }
.marca-foco { width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--amarelo); outline: 2px solid var(--contorno); outline-offset: -5px; pointer-events: none; }
@keyframes brotar { from { transform: scale(0.2); } }

/* ponteiro de borda: carrega o brinquedo e os minutos do ônibus fora do quadro */
.ponteiro { position: absolute; left: 0; top: 0; z-index: 5; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 5px; border-radius: 999px; background: var(--papel); border: 1px solid var(--tinta-3); color: var(--tinta); font-size: 13px; font-weight: 800; white-space: nowrap; }
.ponteiro .pt-seta { display: block; width: 10px; height: 10px; flex: none; transform-origin: 50% 50%; }
.ponteiro .pt-seta svg { display: block; width: 100%; height: 100%; }

/* ---------- topo: busca e atalhos ---------- */
#topo { position: fixed; z-index: 20; top: calc(var(--topo-seguro) + 10px); left: 12px; right: 12px; display: grid; gap: 10px; pointer-events: none; }
#topo > * { pointer-events: auto; }
.busca { display: flex; gap: 0; height: 58px; background: var(--papel); border: 2px solid var(--contorno); border-radius: var(--raio); padding: 6px; }
.busca-campo { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 10px; }
.busca-texto { font-size: 21px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.busca-hora { width: 44px; border-radius: 10px; background: var(--anil); color: var(--anil-sobre); display: grid; place-items: center; }
.busca-hora:active { transform: scale(0.94); }
.atalhos { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.atalhos::-webkit-scrollbar { display: none; }

.pilula { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--papel); font-size: 15px; font-weight: 600; white-space: nowrap; border: 1px solid var(--tinta-3); flex: none; }
.pilula .ico { width: 18px; height: 18px; }
.pilula.vazia { color: var(--tinta-2); }
.pilula[aria-pressed="true"] { background: var(--amarelo); color: #17141c; font-weight: 800; }
.pilula:active { transform: scale(0.96); }

/* ---------- barra de abas ---------- */
#abas { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: var(--abas-altura); padding: 8px 8px calc(8px + var(--base-segura)); background: var(--anil); display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
#abas a { display: flex; align-items: center; justify-content: center; gap: 7px; border-radius: 999px; color: #fff; font-size: 14px; font-weight: 600; min-width: 0; transition: background-color 0.2s var(--saida), color 0.2s var(--saida); }
#abas a .ico { width: 22px; height: 22px; }
#abas a[aria-current="page"] { background: var(--amarelo); color: #17141c; font-weight: 800; }
@media (max-width: 399px) { #abas a { font-size: 13px; gap: 5px; } #abas a .ico { width: 20px; height: 20px; } }

/* ---------- folha inferior ---------- */
.folha {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: var(--abas-altura);
  height: calc(100dvh - var(--abas-altura) - var(--topo-seguro) - 8px);
  background: var(--papel); border-top: 2px solid var(--contorno); border-radius: 22px 22px 0 0;
  transform: translateY(var(--y, 60%)); will-change: transform; display: flex; flex-direction: column;
  outline: none;
}
.folha.solta { transition: transform 0.42s var(--saida); }
.folha-pega { flex: none; height: 22px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.folha-pega i { width: 44px; height: 5px; border-radius: 9px; background: var(--risco); }
.folha-conteudo { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.folha-cab { flex: none; padding: 0 16px 12px; touch-action: none; }
.folha-corpo { flex: 1; min-height: 0; overflow-y: hidden; overscroll-behavior: contain; padding: 0 16px 28px; }
.folha[data-estado="cheia"] .folha-corpo { overflow-y: auto; }

.flutuantes { position: absolute; right: 12px; bottom: 100%; margin-bottom: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; transition: opacity 0.2s; }
.folha[data-estado="cheia"] .flutuantes { opacity: 0; pointer-events: none; }
.botao-mapa { min-height: 46px; padding: 0 14px; border-radius: 999px; background: var(--papel); border: 1px solid var(--tinta-3); display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.botao-mapa.redondo { width: 50px; height: 50px; padding: 0; justify-content: center; background: var(--anil); color: #fff; border: 0; }
.botao-mapa.ativo { background: var(--anil); color: #fff; }
.botao-mapa:active { transform: scale(0.94); }

/* cabeçalho de vista */
.cab { display: flex; align-items: flex-start; gap: 10px; }
.cab-texto { flex: 1; min-width: 0; }
.titulo { font-size: 22px; font-weight: 800; line-height: 1.15; text-wrap: balance; overflow-wrap: anywhere; }
.sub { font-size: 14px; color: var(--tinta-2); margin-top: 3px; }
.sub b { color: var(--tinta); font-weight: 600; }
.botao-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--funda); }
.botao-ico.liso { background: none; }
.botao-ico[aria-pressed="true"] { background: var(--amarelo); color: #17141c; }
.botao-ico:active { transform: scale(0.94); }

/* ---------- o brinquedo: bloco da linha ---------- */
.bloco { display: inline-flex; align-items: center; justify-content: center; min-width: 54px; height: 36px; padding: 0 16px 0 10px; position: relative; border: 2px solid var(--contorno); border-radius: 9px 13px 13px 9px; background: var(--cor, var(--l1)); color: #fff; font-size: 18px; font-weight: 800; line-height: 1; letter-spacing: -0.01em; flex: none; white-space: nowrap; }
.bloco::after { content: ""; position: absolute; right: 5px; top: 50%; width: 4px; height: 4px; margin-top: -9px; border-radius: 50%; background: #fff; box-shadow: 0 7px 0 #fff, 0 14px 0 #fff; }
.bloco.g { min-width: 66px; height: 46px; font-size: 24px; padding: 0 19px 0 12px; border-radius: 11px 16px 16px 11px; }
.bloco.g::after { right: 6px; margin-top: -10px; box-shadow: 0 8px 0 #fff, 0 16px 0 #fff; }
.bloco.p { min-width: 0; height: 26px; font-size: 13px; padding: 0 12px 0 7px; border-width: 1.5px; border-radius: 7px 10px 10px 7px; }
.bloco.p::after { width: 3px; height: 3px; right: 4px; margin-top: -6px; box-shadow: 0 5px 0 #fff, 0 10px 0 #fff; }
.c0 { --cor: var(--l0); } .c1 { --cor: var(--l1); } .c2 { --cor: var(--l2); } .c3 { --cor: var(--l3); } .c4 { --cor: var(--l4); }
.c5 { --cor: var(--l5); } .c6 { --cor: var(--l6); } .c7 { --cor: var(--l7); } .c8 { --cor: var(--l8); } .c9 { --cor: var(--l9); }

/* ---------- chegadas ---------- */
.destaque { border-radius: var(--raio); overflow: hidden; background: var(--funda); margin-bottom: 6px; display: block; width: 100%; }
.destaque-topo { display: flex; align-items: center; gap: 12px; padding: 12px 14px 4px; }
.destaque-topo .nome { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; line-height: 1.2; }
.nome small { display: block; font-size: 13px; font-weight: 400; color: var(--tinta-2); margin-top: 2px; }
.nome small + small { margin-top: 3px; }
.minutos { font-size: 40px; font-weight: 800; line-height: 1; white-space: nowrap; }
.minutos span { font-size: 16px; font-weight: 600; margin-left: 3px; }
/* "1 h 02" é mais largo que "12 min": encolhe para não espremer o destino. */
.minutos.longo { font-size: 28px; }

/* a corrida até a parada: você e o ônibus no mesmo trilho de contas */
.corrida { position: relative; height: 46px; margin: 0 16px; }
.corrida::before { content: ""; position: absolute; left: 2px; right: 24px; top: 21px; border-top: 4px dotted var(--tinta); opacity: 0.75; }
.corrida .onibus, .corrida .eu { position: absolute; top: 0; left: calc((100% - 46px) * var(--p, 0)); transition: left 1s linear; }
.corrida .onibus { top: 10px; width: 40px; height: 25px; border: 2px solid var(--contorno); border-radius: 7px 10px 10px 7px; background: var(--cor); margin-left: -20px; }
.corrida .onibus::after { content: ""; position: absolute; right: 4px; top: 4px; width: 3px; height: 3px; border-radius: 50%; background: #fff; box-shadow: 0 6px 0 #fff, 0 12px 0 #fff; }
.corrida .eu { top: 12px; width: 21px; height: 21px; margin-left: -10px; border-radius: 50%; background: var(--anil); border: 3px solid #fff; outline: 2px solid var(--contorno); }
.corrida .parada { position: absolute; right: 0; top: 5px; width: 22px; height: 34px; border: 2px solid var(--contorno); border-radius: 6px; background: var(--amarelo); }

.faixa { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 14px; font-size: 18px; font-weight: 800; color: #fff; background: var(--verde); }
.faixa { white-space: nowrap; flex-wrap: wrap; row-gap: 2px; transition: background-color 0.4s var(--saida); }
.faixa span { font-size: 14px; font-weight: 600; text-align: right; margin-left: auto; white-space: normal; text-wrap: balance; min-width: 0; flex: 0 1 auto; }
.faixa.apertado { background: var(--ambar-faixa); color: #17141c; }
.faixa.perdeu { background: var(--vermelho); }
.faixa.neutra { background: var(--risco); color: var(--tinta); }

.chegada { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 2px; border-bottom: 1px solid var(--risco); min-height: 60px; }
.chegada:last-child { border-bottom: 0; }
.chegada .nome { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.2; }
.chegada .min { font-size: 24px; font-weight: 800; white-space: nowrap; text-align: right; line-height: 1; }
.chegada .min span { font-size: 13px; font-weight: 600; margin-left: 2px; }
.chegada .min small { display: block; font-size: 12px; font-weight: 600; color: var(--tinta-3); margin-top: 3px; }
.veredito { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.veredito::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.veredito.folga { color: var(--verde); }
.veredito.apertado { color: var(--ambar); }
.veredito.perdeu { color: var(--vermelho); }
.veredito.sem::before { display: none; }
.veredito.sem { color: var(--tinta-2); font-weight: 400; }
.marcas { display: inline-flex; gap: 6px; vertical-align: middle; }
.marca { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--tinta-2); }
.marca .ico { width: 14px; height: 14px; }

/* ---------- blocos de conteúdo ---------- */
.secao { margin-top: 22px; }
.secao > h2 { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.lista > li + li { border-top: 1px solid var(--risco); }
.item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 9px 2px; }
.item .nome { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; line-height: 1.2; }
.item .lado { font-size: 14px; color: var(--tinta-2); white-space: nowrap; text-align: right; }
.item .ico.seta { color: var(--tinta-3); width: 18px; height: 18px; }
.item:active { background: var(--funda); }
.conta { width: 14px; height: 14px; border-radius: 50%; background: var(--papel); border: 2px solid var(--contorno); flex: none; margin: 0 5px; }

.botao { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 14px; white-space: nowrap; border-radius: 12px; background: var(--anil); color: #fff; font-size: 16px; font-weight: 800; }
.botao.secundario { background: var(--funda); color: var(--tinta); font-weight: 600; }
.botao.largo { width: 100%; }
/* Sobre um cartão já tingido, o botão secundário precisa de outro fundo para aparecer. */
.itin .botao.secundario, .nota .botao.secundario, .destaque .botao.secundario { background: var(--papel); }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.botao.perigo { background: var(--vermelho-suave); color: var(--vermelho); }
.botao:active { transform: scale(0.97); }
.botao[disabled] { opacity: 0.5; cursor: default; }
.acoes { display: flex; gap: 10px; margin-top: 14px; }
.acoes > * { flex: 1; }

.segmentos { display: flex; background: var(--funda); border-radius: 12px; padding: 4px; gap: 4px; }
.segmentos button { flex: 1; min-height: 40px; border-radius: 9px; font-size: 14px; font-weight: 600; padding: 4px 8px; text-align: center; line-height: 1.15; color: var(--tinta-2); }
.segmentos button[aria-pressed="true"] { background: var(--papel); color: var(--tinta); font-weight: 800; }

.nota { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--funda); font-size: 14px; color: var(--tinta-2); }
.nota b { color: var(--tinta); }
.nota .ico { width: 20px; height: 20px; margin-top: 1px; color: var(--tinta); }
.nota.alerta { background: var(--ambar-suave); color: var(--tinta); }
.nota.erro { background: var(--vermelho-suave); color: var(--tinta); }
.nota.erro .ico { color: var(--vermelho); }
.rodape { font-size: 12px; color: var(--tinta-3); margin-top: 16px; display: flex; align-items: center; gap: 6px; }
.rodape .pulso { width: 8px; height: 8px; border-radius: 50%; background: var(--verde); flex: none; }
.rodape.velho .pulso { background: var(--ambar); }
.rodape.parado .pulso { background: var(--vermelho); }

.vazio { padding: 22px 4px; text-align: left; }
.vazio h2 { font-size: 22px; font-weight: 800; text-wrap: balance; margin-bottom: 6px; }
.vazio p { font-size: 15px; color: var(--tinta-2); max-width: 46ch; }
.vazio .botao { margin-top: 14px; }

.osso { border-radius: 10px; background: var(--funda); animation: pulso 1.1s ease-in-out infinite alternate; }
@keyframes pulso { to { background: var(--risco); } }

/* ---------- cordão de contas (linha) ---------- */
.cordao { position: relative; padding-left: 4px; }
/* Altura fixa: a posição de cada ônibus no cordão é calculada em contas × 46px. */
.cordao li { position: relative; display: flex; align-items: center; gap: 10px; height: 46px; }
.cordao button.nome { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: stretch; }
.cordao li::before { content: ""; position: absolute; left: 11px; top: 0; bottom: 0; border-left: 4px dotted var(--cor, var(--tinta)); opacity: 0.9; }
.cordao li:first-of-type::before { top: 50%; }
.cordao li:last-of-type::before { bottom: 50%; }
.cordao .conta { position: relative; z-index: 1; margin: 0 5px; width: 16px; height: 16px; }
.cordao .nome { flex: 1; min-width: 0; font-size: 15px; line-height: 1.2; }
.cordao .quando { font-size: 14px; font-weight: 600; color: var(--tinta-2); white-space: nowrap; }
.cordao li.passou .nome { color: var(--tinta-3); }
.cordao li.passou .conta { background: var(--risco); }
.cordao li.aqui .conta { background: var(--amarelo); width: 20px; height: 20px; margin: 0 3px; }
.cordao li.aqui .nome { font-weight: 800; }
.cordao .bondinho { position: absolute; left: -4px; z-index: 2; width: 34px; height: 22px; border: 2px solid var(--contorno); border-radius: 6px 9px 9px 6px; background: var(--cor); transform: translateY(-50%) rotate(90deg); top: var(--pos, 0%); transition: top 1s linear; }
.cordao .bondinho::after { content: ""; position: absolute; right: 3px; top: 3px; width: 3px; height: 3px; border-radius: 50%; background: #fff; box-shadow: 0 5px 0 #fff, 0 10px 0 #fff; }

/* ---------- planejador ---------- */
.campos { position: relative; border: 2px solid var(--contorno); border-radius: var(--raio); background: var(--papel); }
.campo { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 6px 54px 6px 12px; }
.campo + .campo { border-top: 1px solid var(--risco); }
.campo .rotulo { font-size: 13px; color: var(--tinta-3); width: 34px; flex: none; }
.campo .valor { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.campo .valor.falta { color: var(--tinta-3); font-weight: 400; }
.trocar { position: absolute; right: 8px; top: 50%; margin-top: -20px; width: 40px; height: 40px; border-radius: 10px; background: var(--funda); display: grid; place-items: center; }
.quando { display: grid; gap: 10px; margin-top: 12px; }
.hora-linha { display: flex; gap: 10px; }
.hora-linha input, .entrada { min-height: 48px; padding: 0 12px; border: 1.5px solid var(--tinta-3); border-radius: 12px; background: var(--papel); font-size: 16px; font-weight: 600; flex: 1; min-width: 0; }
.entrada::placeholder { color: var(--tinta-3); font-weight: 400; }

.itin { display: block; width: 100%; border-radius: var(--raio); background: var(--funda); overflow: hidden; margin-top: 10px; text-align: left; }
.itin-corpo { padding: 12px 14px; display: grid; gap: 9px; }
.itin-topo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.itin-titulo { font-size: 18px; font-weight: 800; line-height: 1.2; }
.itin-hora { font-size: 22px; font-weight: 800; line-height: 1.1; }
.itin-hora small { font-size: 14px; font-weight: 600; color: var(--tinta-2); margin-left: 6px; }
.itin-dur { font-size: 16px; font-weight: 800; white-space: nowrap; }
.pernas { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 4px; }
.pernas .ape { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--tinta-2); }
.pernas .ape .ico { width: 18px; height: 18px; }
.pernas .elo { width: 14px; border-top: 3px dotted var(--tinta-3); }
.itin-info { font-size: 13px; color: var(--tinta-2); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.etiqueta { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 6px; background: var(--tinta); color: var(--papel); font-size: 12px; font-weight: 800; }

/* linha do tempo do itinerário */
.passos { position: relative; }
.passo { position: relative; display: grid; grid-template-columns: 52px 26px 1fr; gap: 0 10px; padding-bottom: 18px; }
.passo .hora { font-size: 14px; font-weight: 800; text-align: right; padding-top: 1px; }
.passo .trilho { position: relative; display: flex; justify-content: center; }
.passo .trilho::before { content: ""; position: absolute; top: 20px; bottom: -18px; border-left: 4px dotted var(--tinta-3); }
.passo.onibus .trilho::before { border-left: 0; width: 6px; border-radius: 999px; background: var(--cor); top: 18px; }
.passo:last-child .trilho::before { display: none; }
.passo .conta { margin: 2px 0 0; }
.passo .conteudo { min-width: 0; }
.passo h3 { font-size: 16px; font-weight: 800; line-height: 1.2; }
.passo .detalhe { font-size: 14px; color: var(--tinta-2); margin-top: 3px; }
.opcoes { margin-top: 10px; border-radius: 12px; background: var(--funda); overflow: hidden; }
.opcao { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 14px; width: 100%; }
.opcao + .opcao { border-top: 1px solid var(--risco); }
.opcao .h { font-weight: 800; font-size: 16px; width: 48px; flex: none; }
.opcao .quem { flex: 1; min-width: 0; color: var(--tinta-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opcao .veredito { flex: none; }
.opcao .quem .marca { vertical-align: -2px; }
.opcao.escolhida { background: var(--papel); box-shadow: inset 0 0 0 2px var(--contorno); border-radius: 12px; }

/* ---------- tela cheia (busca) ---------- */
.tela { position: fixed; inset: 0; z-index: 60; background: var(--papel); display: flex; flex-direction: column; animation: subir 0.3s var(--saida); }
@keyframes subir { from { transform: translateY(24px); opacity: 0; } }
.tela-cab { flex: none; display: flex; gap: 8px; align-items: center; padding: calc(var(--topo-seguro) + 10px) 12px 10px; border-bottom: 1px solid var(--risco); }
.tela-cab .entrada-busca { flex: 1; min-width: 0; height: 52px; border: 2px solid var(--contorno); border-radius: 16px; padding: 0 14px; font-size: 18px; font-weight: 600; background: var(--papel); }
.entrada-busca::placeholder { color: var(--tinta-3); font-weight: 400; }
.tela-corpo { flex: 1; overflow-y: auto; padding: 6px 16px calc(24px + var(--base-segura)); }
.tela-corpo h2 { font-size: 13px; font-weight: 800; color: var(--tinta-2); margin: 18px 0 2px; }
.ponto-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--funda); display: grid; place-items: center; flex: none; }
.ponto-ico .ico { width: 20px; height: 20px; }

/* ---------- avisos e viagem ---------- */
.avisos { position: fixed; z-index: 80; left: 12px; right: 12px; bottom: calc(var(--abas-altura) + 12px); display: grid; gap: 8px; pointer-events: none; justify-items: center; }
.aviso { pointer-events: auto; max-width: 440px; background: var(--tinta); color: var(--papel); padding: 12px 16px; border-radius: 12px; font-size: 15px; font-weight: 600; animation: subir 0.3s var(--saida); display: flex; gap: 12px; align-items: center; }
.aviso button { color: var(--amarelo); font-weight: 800; white-space: nowrap; }
.viagem { position: fixed; z-index: 35; left: 12px; right: 12px; top: calc(var(--topo-seguro) + 10px); background: var(--tinta); color: var(--papel); border-radius: var(--raio); padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.viagem .txt { flex: 1; min-width: 0; }
.viagem .txt b { display: block; font-size: 18px; font-weight: 800; line-height: 1.2; }
.viagem .txt span { font-size: 14px; opacity: 0.85; }
.viagem button { background: rgb(255 255 255 / 0.16); color: inherit; min-height: 40px; padding: 0 12px; border-radius: 10px; font-weight: 800; font-size: 14px; }
.viagem button.txt { background: none; padding: 0; min-height: 0; border-radius: 6px; font-weight: inherit; text-align: left; }
body.em-viagem #topo { visibility: hidden; }

/* ---------- ajustes / formulários ---------- */
.grupo { margin-top: 20px; }
.grupo > h2 { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.grupo p.ajuda { font-size: 13px; color: var(--tinta-2); margin-top: 6px; }
.dias { display: flex; gap: 6px; }
.dias button { flex: 1; min-height: 42px; border-radius: 10px; background: var(--funda); font-size: 14px; font-weight: 600; text-align: center; }
.dias button[aria-pressed="true"] { background: var(--anil); color: #fff; font-weight: 800; }
.horarios { display: flex; flex-wrap: wrap; gap: 6px; }
.horarios span { font-size: 14px; font-weight: 600; padding: 5px 9px; border-radius: 6px; background: var(--funda); }
.horarios span.proxima { background: var(--amarelo); color: #17141c; font-weight: 800; }
.horarios span.passada { color: var(--tinta-3); }

/* ---------- telas largas: painel à esquerda ---------- */
@media (min-width: 960px) {
  .folha { left: 0; right: auto; width: var(--painel); top: 0; bottom: var(--abas-altura); height: auto; transform: none !important; border-radius: 0; border-top: 0; border-right: 2px solid var(--contorno); box-shadow: none; padding-top: 86px; }
  .folha-pega { display: none; }
  .folha .folha-corpo { overflow-y: auto; }
  .flutuantes { left: 100%; right: auto; bottom: 16px; margin: 0 0 0 16px; }
  .folha[data-estado="cheia"] .flutuantes { opacity: 1; pointer-events: auto; }
  #abas { right: auto; width: var(--painel); border-right: 2px solid var(--contorno); }
  #topo { right: auto; width: calc(var(--painel) - 24px); z-index: 45; }
  .folha { padding-top: 136px; }
  /* A folha cria o bloco de referência (will-change), então o crédito se ancora
     nela e fica sobre o mapa, ao lado do botão de localização. */
  .credito { left: calc(100% + 84px); bottom: 26px; margin: 0; white-space: nowrap; }
  .folha[data-estado="cheia"] .credito { opacity: 1; pointer-events: auto; }
  .avisos { left: calc(var(--painel) + 16px); justify-items: start; bottom: 16px; }
  .viagem { left: calc(var(--painel) + 16px); right: auto; width: 420px; }
  body.em-viagem #topo { visibility: visible; }
  .tela { right: auto; width: var(--painel); border-right: 2px solid var(--contorno); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
