@font-face { font-family: "Source Sans Pro"; src: url("assets/fonts/SourceSansPro-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("assets/fonts/SourceSansPro-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("assets/fonts/SourceSansPro-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("assets/fonts/SourceSansPro-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --azul: #12326E; --azul-escuro: #0B2150; --azul-medio: #3B5A94; --azul-50: #EAF0F9; --azul-25: #F5F8FC;
  --linha: #D5DDEC; --texto: #1F2A44; --suave: #5A6785;
  --sol: #F7A400; --sol-claro: #FFDF00; --ok: #1d7a46;
  --raio: 14px; --sombra: 0 1px 2px rgba(18,50,110,.08), 0 4px 14px rgba(18,50,110,.06);
  --nav-h: 64px; --topo-h: 56px; --lateral: 264px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 17px; line-height: 1.5; color: var(--texto); background: var(--azul-25); }
h1, h2, h3 { color: var(--azul); line-height: 1.2; margin: 0; }
p { margin: 0 0 .75em; }
a { color: var(--azul); }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--sol); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
main:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }

/* ---------- estrutura ---------- */
#app { min-height: 100vh; min-height: 100dvh; }
.topo { position: sticky; top: 0; z-index: 20; height: var(--topo-h); background: var(--azul); color: #fff; display: flex; align-items: center; gap: 12px; padding: 0 16px; padding-top: env(safe-area-inset-top); box-sizing: content-box; }
.topo img { height: 30px; width: auto; }
.topo .titulo { font-weight: 600; font-size: 1.02rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-instalar { display: none; background: var(--sol-claro); color: var(--azul-escuro); border: 0; border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: .9rem; cursor: pointer; }
.btn-instalar.visivel { display: inline-flex; gap: 6px; align-items: center; }

.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--linha); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.nav a { flex: 1; min-height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--suave); font-size: .74rem; font-weight: 600; position: relative; }
.nav a .ic { width: 1.6em; height: 1.6em; }
.nav a[aria-current="page"] { color: var(--azul); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 34px; height: 3px; background: var(--sol); border-radius: 0 0 3px 3px; }
.nav .so-desktop, .lateral-marca { display: none; }

main { padding: 18px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 880px; margin: 0 auto; outline: none; }
.rodape { text-align: center; color: var(--suave); font-size: .85rem; padding: 8px 16px 0; }
.rodape em { display: block; }

@media (min-width: 900px) {
  body { font-size: 17.5px; }
  .topo { display: none; }
  .nav { top: 0; right: auto; bottom: 0; width: var(--lateral); flex-direction: column; justify-content: flex-start; gap: 2px; padding: 22px 14px; border-top: 0; border-right: 1px solid var(--linha); background: var(--azul); overflow-y: auto; }
  .lateral-marca { display: block; padding: 4px 8px 22px; }
  .lateral-marca img { width: 150px; }
  .nav a { flex: none; min-height: 0; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; border-radius: 10px; font-size: 1rem; color: #cdd8ee; }
  .nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
  .nav a[aria-current="page"] { background: #fff; color: var(--azul); }
  .nav a[aria-current="page"]::before { display: none; }
  .nav a .ic { width: 1.3em; height: 1.3em; }
  .nav .so-mobile { display: none; }
  .nav .so-desktop { display: flex; }
  .nav .sep { height: 1px; background: rgba(255,255,255,.15); margin: 8px 10px; }
  .nav .btn-instalar { display: none; margin: 14px 10px 0; justify-content: center; }
  .nav .btn-instalar.visivel { display: flex; }
  #app > .area { margin-left: var(--lateral); }
  main { padding: 36px 40px 60px; max-width: 960px; }
}

/* ---------- componentes ---------- */
.pagina-titulo { font-size: 1.7rem; font-weight: 700; margin-bottom: 4px; }
.pagina-sub { color: var(--suave); margin-bottom: 18px; }
.secao { margin: 26px 0 10px; font-size: 1.15rem; font-weight: 700; color: var(--azul); display: flex; align-items: center; gap: 8px; }
.secao::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--sol), transparent 60%); opacity: .5; }
.card { background: #fff; border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px 18px; box-shadow: var(--sombra); }
.card + .card { margin-top: 12px; }
.card h3 { font-size: 1.08rem; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.card p:last-child { margin-bottom: 0; }
.grade { display: grid; gap: 12px; grid-template-columns: 1fr; }
.grade .card + .card { margin-top: 0; }
@media (min-width: 640px) { .grade.dois { grid-template-columns: 1fr 1fr; } .grade.tres { grid-template-columns: repeat(3, 1fr); } }
.aviso { background: var(--azul-50); border-left: 4px solid var(--sol); border-radius: 8px; padding: 12px 14px; margin: 12px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--azul-50); color: var(--azul); border-radius: 999px; padding: 3px 11px; font-size: .86rem; font-weight: 600; }
.chip.agora { background: var(--sol); color: #2b1c00; }
.botao { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 18px; border-radius: 10px; border: 2px solid var(--azul); background: var(--azul); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; }
.botao:hover { background: var(--azul-escuro); }
.botao.sec { background: #fff; color: var(--azul); }
.botao.sec:hover { background: var(--azul-50); }
.botao.wa { background: #fff; color: var(--azul); }
.botao.peq { min-height: 38px; padding: 5px 12px; font-size: .92rem; }
.acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lista-linhas { list-style: none; margin: 0; padding: 0; }
.lista-linhas li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--linha); flex-wrap: wrap; }
.lista-linhas li:first-child { border-top: 0; }
.lista-linhas .k { color: var(--suave); font-size: .9rem; }
.lista-linhas .v { font-weight: 600; word-break: break-word; }
.sem-borda { padding: 0; overflow: hidden; }
.sem-borda .lista-linhas li { padding: 12px 18px; }
.sem-borda .lista-linhas li:first-child { border-top: 0; }

/* hero / início */
.hero { background: var(--azul); color: #fff; border-radius: 20px; padding: 24px 22px 22px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -70px; width: 230px; height: 230px; border-radius: 50%; background: radial-gradient(circle, rgba(255,223,0,.55), rgba(247,164,0,.28) 45%, rgba(235,96,18,0) 70%); filter: blur(6px); }
.hero > * { position: relative; z-index: 1; }
.hero .logo { width: 140px; margin-bottom: 16px; }
.hero h1 { color: #fff; font-size: 1.85rem; margin-bottom: 4px; }
.hero p { color: #d8e2f5; margin-bottom: 14px; }
.hero .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hero .chip { background: rgba(255,255,255,.14); color: #fff; }
.status { margin-top: 14px; border: 1px solid var(--linha); border-left: 5px solid var(--sol); background: #fff; border-radius: var(--raio); padding: 16px 18px; box-shadow: var(--sombra); }
.status .rot { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--suave); }
.status .tit { font-size: 1.2rem; font-weight: 700; color: var(--azul); margin: 2px 0 4px; }
.contagem { display: flex; gap: 10px; margin-top: 8px; }
.contagem div { background: var(--azul-50); border-radius: 12px; padding: 8px 4px; min-width: 66px; text-align: center; }
.contagem b { display: block; font-size: 1.7rem; color: var(--azul); line-height: 1.1; }
.contagem span { font-size: .78rem; color: var(--suave); }
.atalhos { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); margin-top: 14px; }
@media (min-width: 640px) { .atalhos { grid-template-columns: repeat(3, 1fr); } }
.atalho { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--azul); background: #fff; border: 1px solid var(--linha); border-radius: var(--raio); padding: 14px; font-weight: 700; box-shadow: var(--sombra); min-height: 92px; }
.atalho:hover { border-color: var(--azul); }
.atalho .ic { width: 1.7em; height: 1.7em; color: var(--azul-medio); }
.atalho small { font-weight: 400; color: var(--suave); line-height: 1.25; }

/* abas */
.abas { display: flex; background: var(--azul-50); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; }
.abas button { flex: 1; border: 0; background: transparent; padding: 10px 8px; border-radius: 9px; font-weight: 700; color: var(--azul); cursor: pointer; min-height: 44px; }
.abas button[aria-selected="true"] { background: #fff; box-shadow: var(--sombra); }
.abas button small { display: block; font-weight: 400; color: var(--suave); font-size: .78rem; }

/* programação */
.linha-tempo { list-style: none; padding: 0; margin: 0; }
.item { display: grid; grid-template-columns: 78px 1fr; gap: 12px; margin-bottom: 10px; }
.item .hora { text-align: right; font-weight: 700; color: var(--azul); font-size: .95rem; line-height: 1.25; padding-top: 14px; }
.item .hora small { display: block; font-weight: 400; color: var(--suave); }
.item .corpo { background: #fff; border: 1px solid var(--linha); border-radius: var(--raio); padding: 12px 16px; box-shadow: var(--sombra); }
.item.pausa .corpo { background: transparent; box-shadow: none; border-style: dashed; color: var(--azul); font-style: italic; padding: 9px 16px; }
.item.pausa .hora { padding-top: 10px; font-weight: 600; }
.item.onibus .corpo { background: var(--azul); color: #fff; border-color: var(--azul); font-weight: 700; display: flex; gap: 8px; align-items: center; }
.item.passou { opacity: .55; }
.item.agora .corpo { border: 2px solid var(--sol); box-shadow: 0 0 0 4px rgba(247,164,0,.18); }
.item .rotulo { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.item .rotulo .nome { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--azul-medio); }
.item h3 { font-size: 1.02rem; color: var(--texto); font-weight: 700; }
details.mais summary { cursor: pointer; color: var(--azul); font-weight: 600; font-size: .92rem; margin-top: 6px; list-style: none; display: flex; gap: 6px; align-items: center; min-height: 32px; }
details.mais summary::-webkit-details-marker { display: none; }
details.mais summary::after { content: "▾"; transition: transform .2s; }
details.mais[open] summary::after { transform: rotate(180deg); }
details.mais .conteudo { padding-top: 6px; }
.nota { font-size: .9rem; font-style: italic; background: var(--azul-25); border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.nota b { font-style: italic; }
.seu-grupo { background: var(--azul-50); border-radius: 10px; padding: 8px 12px; margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 600; color: var(--azul); }
@media (max-width: 420px) { .item { grid-template-columns: 62px 1fr; gap: 8px; } .item .hora { font-size: .86rem; } }

/* seleção de grupo */
.seletor { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seletor select { font: inherit; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--linha); background: #fff; color: var(--texto); min-height: 44px; min-width: 130px; }
.resultado-sala { font-size: 1.3rem; font-weight: 700; color: var(--azul); }
.resultado-sala small { display: block; font-size: .92rem; font-weight: 400; color: var(--suave); }

/* salas */
.busca { width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--linha); min-height: 48px; background: #fff; }
.salas { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); margin-top: 12px; }
@media (min-width: 560px) { .salas { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .salas { grid-template-columns: repeat(5, 1fr); } }
.sala { background: #fff; border: 1px solid var(--linha); border-radius: 12px; padding: 8px 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.sala b { color: var(--azul); }
.sala.meu { border: 2px solid var(--sol); background: #fff8e8; }
.sala[hidden] { display: none; }
.mapa-btn { display: block; width: 100%; padding: 0; border: 1px solid var(--linha); border-radius: var(--raio); background: #fff; cursor: zoom-in; overflow: hidden; position: relative; }
.mapa-btn img { display: block; width: 100%; height: auto; }
.mapa-btn span { position: absolute; right: 10px; bottom: 10px; background: var(--azul); color: #fff; border-radius: 999px; padding: 6px 12px; font-size: .85rem; font-weight: 700; }
dialog#mapa-dlg { border: 0; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: #fff; }
dialog#mapa-dlg::backdrop { background: rgba(11,33,80,.7); }
.dlg-barra { position: sticky; top: 0; left: 0; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--azul); color: #fff; z-index: 2; }
.dlg-rolagem { overflow: auto; height: calc(100dvh - 58px); touch-action: pan-x pan-y pinch-zoom; }
.dlg-rolagem img { width: 1000px; max-width: none; display: block; }

/* ônibus */
.proximo { display: flex; gap: 14px; align-items: center; }
.proximo .hora-grande { font-size: 2.1rem; font-weight: 700; color: var(--azul); line-height: 1; }
.tabela { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--raio); overflow: hidden; box-shadow: var(--sombra); border: 1px solid var(--linha); }
.tabela th { background: var(--azul); color: #fff; text-align: left; padding: 10px 14px; font-size: .9rem; }
.tabela td { padding: 11px 14px; border-top: 1px solid var(--linha); }
.tabela tr.prox td { background: #fff8e8; font-weight: 700; }
.tabela td.h { font-weight: 700; color: var(--azul); white-space: nowrap; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--azul-escuro); color: #fff; padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; font-weight: 600; max-width: 90vw; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 28px; left: calc(50% + var(--lateral) / 2); } }
.sim { background: var(--sol-claro); color: #2b1c00; text-align: center; font-size: .85rem; font-weight: 700; padding: 4px; }
.ios-dica { display: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .nav, .topo, .btn-instalar { display: none !important; } #app > .area { margin: 0; } }

.status .sub { margin: 0; color: var(--texto); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mapa-btn { max-width: 760px; }

details.eq { background: #fff; border: 1px solid var(--linha); border-radius: 12px; padding: 4px 16px; margin-bottom: 8px; }
details.eq.meu { border: 2px solid var(--sol); background: #fff8e8; }
details.eq summary { padding: 8px 0; min-height: 44px; font-size: 1.02rem; color: var(--azul); }
details.eq summary::after { margin-left: auto; }
.equipe .v { font-weight: 600; }
.equipe .chip { font-weight: 400; font-size: .8rem; }
