:root {
  color-scheme: light;
  --fundo: #f6f5f1; --papel: #fff; --tinta: #1c1f24; --suave: #666c76; --linha: #e2e0d9;
  --destaque: #1f4e79; --sobre-destaque: #fff; --perigo: #a3271f; --aviso: #8a5a00; --bom: #23683a;
  --teo: #dfe3ea; --teo-t: #2b3440; --adc: #f6c453; --adc-t: #3d2c00; --aps: #7cc4ee; --aps-t: #06324a;
  --acs: #86cf9b; --acs-t: #0c3a1c; --ct: #c9b3e6; --ct-t: #33205a; --est: #f0d9c4; --est-t: #4a2f14;
  --raio: 10px; --mola: cubic-bezier(.2, .9, .3, 1.15); --desliza: cubic-bezier(.2, .8, .2, 1);
}
/* escuro: por escolha (botão no topo) ou, sem escolha, pelo sistema */
:root[data-tema=escuro] {
  color-scheme: dark;
  --fundo: #16181c; --papel: #1f2227; --tinta: #e9e7e1; --suave: #9aa0aa; --linha: #32363d;
    --destaque: #8fc1ee; --sobre-destaque: #0d2233; --perigo: #ff9a8f; --aviso: #f0c060; --bom: #8fd6a3;
    --teo: #39404b; --teo-t: #e3e7ee; --adc: #8a6510; --adc-t: #fff1cc; --aps: #1d5f86; --aps-t: #dff2fd;
    --acs: #24683a; --acs-t: #dcf5e3; --ct: #56408a; --ct-t: #efe6ff; --est: #6b4a2b; --est-t: #fbeadb;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema=claro]) {
    color-scheme: dark;
    --fundo: #16181c; --papel: #1f2227; --tinta: #e9e7e1; --suave: #9aa0aa; --linha: #32363d;
    --destaque: #8fc1ee; --sobre-destaque: #0d2233; --perigo: #ff9a8f; --aviso: #f0c060; --bom: #8fd6a3;
    --teo: #39404b; --teo-t: #e3e7ee; --adc: #8a6510; --adc-t: #fff1cc; --aps: #1d5f86; --aps-t: #dff2fd;
    --acs: #24683a; --acs-t: #dcf5e3; --ct: #56408a; --ct-t: #efe6ff; --est: #6b4a2b; --est-t: #fbeadb;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fundo); color: var(--tinta); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 1.45rem; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--suave); margin: 0 0 .6rem; font-weight: 650; }
small { color: var(--suave); font-size: .82em; }
section { margin-top: 1.8rem; }
[hidden] { display: none !important; }

button, select, input { font: inherit; color: inherit; }
button { background: var(--papel); border: 1px solid var(--linha); border-radius: 8px; padding: .5rem .8rem; cursor: pointer; min-height: 40px; }
button { transition: transform .12s ease, background .15s, border-color .15s, opacity .15s; -webkit-tap-highlight-color: transparent; }
button:hover { border-color: var(--suave); }
button:active, .botao:active { transform: scale(.95); }
button:disabled { opacity: .3; cursor: default; }
.botao { display: inline-flex; align-items: center; background: var(--papel); border: 1px solid var(--linha); border-radius: 8px; padding: .5rem .8rem; min-height: 40px; transition: transform .12s ease; }
button.ligacao { border: 0; background: none; padding: 0; min-height: 0; text-decoration: underline; color: inherit; }
button.icone { border: 0; background: none; width: 40px; padding: 0; display: grid; place-items: center; color: var(--suave); }
button.icone:not(:disabled):hover { color: var(--tinta); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button.primario { background: var(--destaque); color: var(--sobre-destaque); border-color: var(--destaque); font-weight: 600; }
button.discreto { border-color: transparent; background: none; color: var(--suave); }
button.perigo { color: var(--perigo); border-color: transparent; background: none; }
:focus-visible { outline: 2px solid var(--destaque); outline-offset: 2px; }

/* topo e navegação */
.topo { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .5rem 1.5rem; background: var(--fundo); border-bottom: 1px solid var(--linha); }
.marca { font-weight: 750; letter-spacing: -.02em; font-size: 1.1rem; }
.nav { display: flex; gap: .25rem; flex: 1; }
.ferramentas { display: flex; margin-left: auto; }
#voltar { display: flex; align-items: center; gap: .1rem; padding: .3rem .7rem .3rem .2rem; margin-left: -.5rem; color: var(--destaque); font-weight: 600; max-width: 46vw; }
#voltar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a { padding: .45rem .9rem; border-radius: 8px; color: var(--suave); font-weight: 550; transition: background .2s, color .2s, transform .12s; }
.nav a:active { transform: scale(.95); }
.nav a.ativo { background: var(--papel); color: var(--tinta); box-shadow: 0 0 0 1px var(--linha); }
main { max-width: 760px; margin: 0 auto; padding: 1.5rem 1.5rem 6rem; }
main.v-ano { max-width: none; }
main.v-agora { max-width: 1040px; }

.titulo { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.sub { color: var(--suave); margin: .3rem 0 0; }
.vazio, .nota { color: var(--suave); }
.nota { font-size: .9rem; margin: .5rem 0; }
.fim { margin-top: 2.5rem; }
.conta { background: var(--perigo); color: var(--papel); border-radius: 99px; padding: 0 .5em; font-size: .75rem; letter-spacing: 0; margin-left: .3em; }

/* cartões */
.cartao { background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio); padding: .2rem 1rem .8rem; margin-bottom: .7rem; }
.cartao-cab { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .7rem 0 .5rem; }
.cartao-cab > span { color: var(--suave); font-size: .9rem; }
.cartao-cab strong { color: var(--tinta); }
.cartao.agora { border-color: var(--destaque); box-shadow: 0 0 0 1px var(--destaque); }
.cartao.alvo { animation: piscar 1.6s ease-out; }
@keyframes piscar { from { background: color-mix(in srgb, var(--destaque) 18%, var(--papel)); } }
.decorre { display: block; color: var(--destaque); font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
details.passadas { margin: 1.2rem 0 .7rem; }
details.passadas summary { cursor: pointer; color: var(--suave); padding: .4rem 0; }
details.passadas .cartao { opacity: .75; }

.bloco { border-top: 1px solid var(--linha); padding: .6rem 0 .1rem; }
.bloco-cab { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.sig { display: inline-block; padding: .1rem .55rem; border-radius: 6px; font-weight: 650; font-size: .86rem; background: var(--teo); color: var(--teo-t); }
.adc { background: var(--adc); color: var(--adc-t); } .aps { background: var(--aps); color: var(--aps-t); }
.acs { background: var(--acs); color: var(--acs-t); } .ct { background: var(--ct); color: var(--ct-t); }
.est { background: var(--est); color: var(--est-t); } .teo { background: var(--teo); color: var(--teo-t); }
.turma, .onde { color: var(--suave); font-size: .9rem; }
.bloco select { margin-left: auto; border: 1px solid var(--linha); border-radius: 8px; background: var(--papel); padding: .3rem .4rem; min-height: 36px; max-width: 55%; }
.fichas { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; align-items: center; }
.ficha { border-radius: 99px; padding: .25rem .8rem; min-height: 34px; text-align: left; }
.ficha i { font-style: normal; color: var(--aviso); font-size: .82em; font-weight: 600; margin-left: .2em; }
.ficha.pedido { border-style: dashed; border-color: var(--aviso); }
.falta { color: var(--perigo); font-size: .9rem; font-weight: 600; }
button.mais { border-style: dashed; color: var(--suave); border-radius: 99px; min-height: 34px; padding: .25rem .8rem; }

/* listas */
.lista, .marcos, .escolha, .mudancas { list-style: none; margin: 0; padding: 0; }
.lista { background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio); overflow: hidden; }
.lista li { display: flex; align-items: center; border-top: 1px solid var(--linha); }
.lista li:first-child { border-top: 0; }
.lista a { flex: 1; display: grid; grid-template-columns: 1fr auto; gap: .1rem .8rem; padding: .7rem 1rem; align-items: baseline; }
.lista .etiq { grid-column: 1 / -1; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--aviso); }
.pend.conflito_pessoa .etiq, .pend.conflito_espaco .etiq, .pend.sem_instrutor .etiq { color: var(--perigo); }
.lista .prazo { color: var(--suave); font-size: .86rem; white-space: nowrap; }
.lista li > button { margin-right: .7rem; }
.pessoa .quals { display: block; color: var(--suave); font-size: .84rem; }
.marcos li { border-top: 1px solid var(--linha); }
.marcos li:first-child { border-top: 0; }
.marcos a, .marcos.dias li { display: flex; gap: .8rem; padding: .55rem 0; align-items: baseline; }
.marcos.dias li { justify-content: space-between; align-items: center; }
.marcos time { color: var(--suave); min-width: 5.2rem; display: inline-block; font-variant-numeric: tabular-nums; }
.marcos.dias time { min-width: 7rem; }
.porconf { font-style: normal; color: var(--aviso); font-size: .85em; font-weight: 600; }

/* ano */
.ano-topo { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.botoes { display: flex; gap: .4rem; }
.seletor { display: inline-flex; border: 1px solid var(--linha); border-radius: 10px; padding: 2px; background: var(--papel); }
.seletor button { border: 0; min-height: 36px; padding: .3rem .85rem; background: none; border-radius: 8px; color: var(--suave); }
.seletor button.ativo { background: var(--destaque); color: var(--sobre-destaque); font-weight: 600; }
.ano-dia { margin: -.3rem 0 .8rem; min-height: 1.5em; font-size: .9rem; color: var(--suave); }
.ano-dia strong { color: var(--tinta); }
.ano-dia a { text-decoration: underline; }
.bl { position: absolute; border-radius: 5px; overflow: hidden; font-size: .78rem; font-weight: 650; display: flex; align-items: center; padding: 0 .35rem; white-space: nowrap; cursor: pointer;
  transition: opacity .18s, box-shadow .18s, filter .12s; -webkit-tap-highlight-color: transparent; }
.bl:active { filter: brightness(.88); }
.bl.curto { box-shadow: inset 0 0 0 1.5px var(--tinta); }
.bl.passado { opacity: .5; }
.bl.mini { padding: 0; min-width: 9px; }
.bl.mini span { display: none; }
.bl.pedido { background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgb(255 255 255 / .38) 5px 8px); outline: 1.5px dashed var(--aviso); outline-offset: -1.5px; }
.bl.alerta::after { content: ""; position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--perigo); box-shadow: 0 0 0 1.5px var(--papel); }
.ano.a-ver .bl:not(.no-dia), .ano.com-sel .bl:not(.sel) { opacity: .3; }
.bl.sel { z-index: 4; overflow: visible; box-shadow: 0 0 0 2px var(--tinta), 0 6px 18px rgb(0 0 0 / .3); }
.bl.sel span { overflow: hidden; }

/* a linha do dia: toca-se para selecionar, arrasta-se para ver outro dia */
.hoje { position: absolute; z-index: 6; pointer-events: none; background: var(--perigo); transition: box-shadow .2s, background .2s; }
.hoje.outro { background: var(--destaque); }
.pega { position: absolute; pointer-events: auto; border: 0; min-height: 0; background: inherit; color: var(--papel); font-size: .7rem; font-weight: 700; line-height: 1.5; padding: 0 .45rem; border-radius: 6px; white-space: nowrap;
  transition: transform .22s var(--mola), box-shadow .2s; }
.hoje.outro .pega { color: var(--sobre-destaque); }
.pega::before { content: ""; position: absolute; inset: -12px; }
.pega:active { transform: none; }
.hoje.sel { pointer-events: auto; touch-action: none; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent); color: var(--perigo); }
.hoje.sel.outro { color: var(--destaque); }
.hoje.sel::before { content: ""; position: absolute; inset: -14px; }
.hoje.sel .pega { touch-action: none; cursor: grab; box-shadow: 0 4px 14px rgb(0 0 0 / .3); }
.hoje.a-arrastar .pega { cursor: grabbing; }
.hoje-ref { position: absolute; z-index: 2; pointer-events: none; display: none; opacity: .7; }
.ano.noutro-dia .hoje-ref { display: block; }
.guia { position: absolute; z-index: 5; pointer-events: none; animation: aparece .2s ease both; }
.guia span { position: absolute; background: var(--tinta); color: var(--fundo); font-size: .68rem; font-weight: 700; line-height: 1.5; padding: 0 .4rem; border-radius: 5px; white-space: nowrap; }

.ano.hz { display: flex; background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio); overflow: hidden; }
.ano-rot { position: sticky; left: 0; z-index: 7; background: var(--papel); flex: none; border-right: 1px solid var(--linha); }
.ano-rot .g { position: absolute; left: 0; right: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: .4rem; padding: 0 .5rem 0 .8rem; font-size: .88rem; }
.ano-rot .g b { line-height: 30px; white-space: nowrap; }
.ano-rot .subs { display: flex; flex-direction: column; color: var(--suave); font-size: .78rem; min-width: 0; text-align: right; }
.ano-rot .subs span { display: flex; align-items: center; justify-content: flex-end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ano.hz:not(.cursos) .g { display: block; }
.ano.hz:not(.cursos) .g b { position: absolute; top: -20px; line-height: 18px; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--suave); }
.ano.hz:not(.cursos) .subs { color: var(--tinta); font-size: .86rem; text-align: left; }
.ano.hz:not(.cursos) .subs span { display: block; line-height: 30px; }
.ano.hz .pista { position: absolute; left: 0; right: 0; border-bottom: 1px solid color-mix(in srgb, var(--linha) 55%, transparent); }
.ano.hz .ano-tela { position: relative; flex: none; }
.ano.hz .mes { position: absolute; top: 12px; padding-left: 5px; font-size: .74rem; color: var(--suave); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.ano.hz .risco { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--linha); }
.ano.hz .hoje { top: 28px; bottom: 0; width: 2px; margin-left: -1px; }
.ano.hz .pega { top: 0; left: 5px; }
.ano.hz .hoje.ponta .pega { left: auto; right: 5px; }
.ano.hz .hoje.sel { width: 3px; margin-left: -1.5px; cursor: ew-resize; }
.ano.hz .hoje.sel .pega { transform: scale(1.18); transform-origin: left center; }
.ano.hz .hoje.sel .pega::after { content: " ↔"; }
.ano.hz .hoje-ref { top: 44px; bottom: 0; border-left: 1.5px dashed var(--perigo); }
.ano.hz .guia { top: 44px; bottom: 0; border-left: 1.5px dashed var(--tinta); }
.ano.hz .guia span { bottom: 1px; }
.ano.hz .guia.ini span, .ano.hz .guia.fim.dentro span { right: 4px; left: auto; }
.ano.hz .guia.fim span, .ano.hz .guia.ini.dentro span { left: 4px; right: auto; }
.ano.hz { overflow-x: auto; }

.ano.v { background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio); }
.ano-cab { position: sticky; top: 53px; z-index: 5; display: flex; background: var(--papel); border-bottom: 1px solid var(--linha); border-radius: var(--raio) var(--raio) 0 0; }
.ano-cab .canto { width: 46px; flex: none; }
.ano-cab .g { text-align: center; font-size: .74rem; padding: .35rem 0 .2rem; min-width: 0; overflow: hidden; }
.ano-cab .g b { display: block; white-space: nowrap; }
.ano-cab .subs { display: flex; color: var(--suave); }
.ano-cab .subs span { flex: 1; min-height: 1em; }
.ano-corpo { position: relative; }
.ano.v .sem { position: absolute; left: 0; right: 0; height: 42px; border-top: 1px solid var(--linha); font-size: .68rem; color: var(--suave); padding: 1px 0 0 5px; white-space: nowrap; }
.ano.v .sem.mes { color: var(--tinta); font-weight: 700; border-top-color: var(--suave); }
.ano-area { position: absolute; left: 46px; right: 2px; top: 0; bottom: 0; }
.ano.v .bl { align-items: flex-start; justify-content: center; padding: 3px 1px; text-align: center; }
.ano.v .bl span { position: sticky; top: 100px; }
.ano.v .hoje { left: 0; right: 0; height: 2px; margin-top: -1px; }
.ano.v .pega { right: 4px; top: 50%; margin-top: -.75em; }
.ano.v .hoje.sel { height: 3px; margin-top: -1.5px; }
.ano.v .hoje.sel .pega { transform: scale(1.25); transform-origin: right center; padding: .1rem .6rem; }
.ano.v .hoje.sel .pega::after { content: " ↕"; }
.ano.v .hoje-ref { left: 0; right: 0; border-top: 1.5px dashed var(--perigo); }
.ano.v .guia { left: 0; right: 0; border-top: 1.5px dashed var(--tinta); }
.ano.v .guia span { left: 1px; }
.ano.v .guia.ini span { bottom: 2px; }
.ano.v .guia.fim span { top: 1px; }
.ano.v:not(.cursos) .bl span { writing-mode: vertical-rl; }
.ano-rolo { overflow-x: auto; border-radius: var(--raio); }
.ano-rolo .ano.v .pega { right: auto; left: 2px; }
.ano-rolo .ano.v .hoje.sel .pega { transform-origin: left center; }
.ano-rolo .ano-cab { position: static; }
.legenda { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; margin-top: 1rem; font-size: .85rem; color: var(--suave); }
.legenda .sig { font-size: .76rem; }
.ponto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--perigo); }
.chave { margin-left: .5rem; }
.tracejado { display: inline-block; width: 16px; height: 9px; border-radius: 3px; outline: 1.5px dashed var(--aviso); outline-offset: -1.5px; vertical-align: -1px; }

/* balão de um bloco */
.balao { position: absolute; z-index: 40; width: max-content; min-width: 236px; max-width: min(340px, calc(100vw - 16px)); background: var(--papel); border: 1px solid var(--linha); border-radius: 16px; padding: .8rem .9rem .85rem;
  box-shadow: 0 14px 40px rgb(0 0 0 / .28), 0 2px 8px rgb(0 0 0 / .12); opacity: 0; transform: scale(.4); transform-origin: var(--seta, 50%) calc(100% + 9px);
  transition: opacity .16s ease, transform .26s var(--mola); }
.balao.abaixo { transform-origin: var(--seta, 50%) -9px; }
.balao.open { opacity: 1; transform: none; transition: opacity .12s ease, transform .3s var(--mola); }
.balao::after { content: ""; position: absolute; left: var(--seta, 50%); bottom: -7.5px; width: 13px; height: 13px; margin-left: -6.5px; background: var(--papel); border: solid var(--linha); border-width: 0 1px 1px 0; transform: rotate(45deg); }
.balao.abaixo::after { bottom: auto; top: -7.5px; border-width: 1px 0 0 1px; }
.bal-cab { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.bal-cab strong { font-size: 1.08rem; }
.bal-cab span:not(.sig) { color: var(--suave); font-size: .9rem; }
.bal-quem, .bal-datas, .bal-linha { margin: .45rem 0 0; font-size: .92rem; }
.bal-quem small { display: block; }
.bal-linha { color: var(--suave); margin-top: .1rem; }
.bal-acoes { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.bal-acoes button, .bal-acoes .botao { min-height: 38px; padding: .35rem .75rem; font-size: .92rem; }

/* folhas */
#folha { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.folha-fundo { position: absolute; inset: 0; background: rgb(0 0 0 / .45); animation: aparece .2s ease both; }
.folha-caixa { animation: folha-entra .3s var(--mola) both; }
#folha.troca .folha-fundo, #folha.troca .folha-caixa { animation: none; }
#folha.fecha .folha-fundo { animation: some .19s ease both; }
#folha.fecha .folha-caixa { animation: folha-sai .19s ease both; }
@keyframes aparece { from { opacity: 0; } }
@keyframes some { to { opacity: 0; } }
@keyframes folha-entra { from { opacity: 0; transform: translateY(16px) scale(.95); } }
@keyframes folha-sai { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes folha-sobe { from { transform: translateY(100%); } }
@keyframes folha-desce { to { transform: translateY(100%); } }
.folha-caixa { position: relative; background: var(--papel); border-radius: 14px; padding: 1.3rem 1.4rem; width: min(480px, 100%); max-height: 88vh; overflow-y: auto; box-shadow: 0 12px 40px rgb(0 0 0 / .3); }
.folha-caixa h2 { font-size: 1.15rem; text-transform: none; letter-spacing: 0; color: var(--tinta); margin-bottom: .3rem; }
form label, fieldset { display: block; margin-top: .9rem; font-size: .88rem; color: var(--suave); }
form input:not([type=checkbox]):not([type=radio]), form select { display: block; width: 100%; margin-top: .25rem; padding: .6rem .7rem; border: 1px solid var(--linha); border-radius: 8px; background: var(--fundo); color: var(--tinta); min-height: 44px; }
fieldset { border: 1px solid var(--linha); border-radius: 8px; padding: .2rem .8rem .7rem; }
fieldset .caixa { display: inline-flex; margin-right: 1rem; }
label.caixa { display: flex; gap: .5rem; align-items: flex-start; color: var(--tinta); font-size: .95rem; }
label.caixa input { margin-top: .25rem; width: 18px; height: 18px; flex: none; }
.par { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.acoes { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.3rem; flex-wrap: wrap; }
.acoes .perigo { margin-right: auto; }
.segmento { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: .9rem; border: 1px solid var(--linha); border-radius: 8px; overflow: hidden; }
.segmento label { margin: 0; }
.segmento input { position: absolute; opacity: 0; }
.segmento span { display: block; text-align: center; padding: .65rem; color: var(--tinta); font-size: .95rem; cursor: pointer; }
.segmento input:checked + span { background: var(--destaque); color: var(--sobre-destaque); font-weight: 600; }
.segmento input:focus-visible + span { outline: 2px solid var(--destaque); outline-offset: -3px; }
.escolha { margin-top: .6rem; }
.escolha button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: .8rem; text-align: left; margin-bottom: .35rem; }
.escolha button.menos { opacity: .62; }
.mudancas { margin: .9rem 0 .4rem; font-size: .9rem; }
.mudancas li { padding: .3rem 0; border-top: 1px solid var(--linha); }
.mudancas span { color: var(--suave); }
.atencao { color: var(--aviso); font-weight: 600; font-size: .92rem; }
.bom { color: var(--bom); font-weight: 600; font-size: .92rem; }

#aviso { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 60; background: var(--tinta); color: var(--fundo); padding: .6rem .6rem .6rem 1.1rem; border-radius: 99px; display: flex; align-items: center; gap: .8rem; box-shadow: 0 6px 20px rgb(0 0 0 / .25); max-width: calc(100vw - 2rem); min-height: 48px; animation: aviso-entra .32s var(--mola) both; }
@keyframes aviso-entra { from { opacity: 0; transform: translate(-50%, 24px) scale(.9); } }
#aviso button { background: none; border: 0; color: inherit; text-decoration: underline; min-height: 36px; padding: 0 .7rem; font-weight: 600; }

/* telemóvel */
@media (max-width: 760px) {
  .topo { padding: .5rem 1rem; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--papel); border-top: 1px solid var(--linha); padding: .3rem .5rem calc(.3rem + env(safe-area-inset-bottom)); gap: 0; }
  .nav a { flex: 1; text-align: center; padding: .7rem 0; }
  .nav a.ativo { background: none; box-shadow: none; color: var(--destaque); font-weight: 700; }
  .topo { justify-content: space-between; }
  main { padding: 1rem 1rem 7rem; }
  main.v-ano { padding-left: .5rem; padding-right: .5rem; }
  #folha { align-items: flex-end; }
  .folha-caixa { border-radius: 16px 16px 0 0; width: 100%; padding-bottom: calc(1.3rem + env(safe-area-inset-bottom)); animation: folha-sobe .32s var(--desliza) both; }
  #folha.fecha .folha-caixa { animation: folha-desce .19s ease-in both; }
  body.sub .marca { display: none; }
  .ano-topo h1 { width: 100%; }
  .nav { view-transition-name: nav; }
  #aviso { bottom: calc(4.6rem + env(safe-area-inset-bottom)); }
  .lista a { grid-template-columns: 1fr; }
  .bloco select { max-width: 60%; }
}

/* Agora: o centro num dia */
.dia-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.dia-cab h1 { font-size: 1.7rem; }
.viagem { display: block; margin: 1.1rem 0 1.4rem; }
.viagem > span:first-child { font-size: .8rem; color: var(--suave); }
.viagem input { width: 100%; margin: .35rem 0 0; accent-color: var(--destaque); height: 28px; }
.viagem-escala { display: flex; justify-content: space-between; font-size: .7rem; color: var(--suave); padding-left: calc(6.67% - 12px); }
.viagem-escala i { font-style: normal; }
.viagem-escala i:first-child { font-weight: 700; color: var(--tinta); }
.centro { display: grid; gap: .7rem; margin-bottom: .7rem; }
.centro.sims { grid-template-columns: repeat(3, 1fr); }
.centro.salas { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.mos { background: var(--papel); border: 1px solid var(--linha); border-radius: 14px; padding: .75rem .85rem .85rem; display: flex; flex-direction: column; gap: .45rem; min-height: 96px; transition: background .2s, border-color .2s; }
.mos.simulador { min-height: 168px; }
.mos-nome { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--suave); }
.mos.livre { background: none; border-style: dashed; }
.mos-livre { font-size: 1.05rem; color: var(--suave); margin-top: auto; }
.mos.simulador .mos-livre { font-size: 1.4rem; }
.mos-ate { font-size: .8rem; color: var(--suave); }
.mos.choque { border-color: var(--perigo); box-shadow: 0 0 0 1px var(--perigo); }
.mos.choque .mos-nome { color: var(--perigo); }
.mos-o:active, .percurso:active { filter: brightness(.94); }
.mos-o { transition: filter .12s; display: flex; flex-direction: column; gap: .3rem; border-radius: 10px; padding: .6rem .7rem .65rem; flex: 1; }
.mos-curso { font-size: .95rem; }
.mos.simulador .mos-curso strong { font-size: 1.25rem; display: block; }
.mos-barra { display: block; height: 5px; border-radius: 3px; background: rgb(0 0 0 / .14); overflow: hidden; margin-top: auto; }
.mos-barra i { display: block; height: 100%; background: currentColor; border-radius: 3px; transition: width .2s; }
.mos-dia { font-size: .78rem; font-weight: 600; opacity: .85; }
.mos-gente { display: flex; flex-wrap: wrap; gap: .3rem .6rem; margin-top: .15rem; font-size: .84rem; }
.mos-gente .falta { color: inherit; text-decoration: underline wavy; }
.av { display: inline-flex; align-items: center; gap: .3rem; }
.av i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: rgb(255 255 255 / .6); color: #1c1f24; font-size: .62rem; font-weight: 700; display: grid; place-items: center; }
.av.pedido i { background: none; outline: 1.5px dashed currentColor; color: inherit; }
.av.pedido { opacity: .8; }
.fora { color: var(--suave); font-size: .9rem; margin: .2rem 0 0; }
.fora a { text-decoration: underline; }
.percurso { display: block; background: var(--papel); border: 1px solid var(--linha); border-radius: 14px; padding: .8rem 1rem 1rem; margin-bottom: .6rem; }
.perc-cab { display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap; font-size: .9rem; color: var(--suave); }
.perc-cab strong { color: var(--tinta); font-size: 1.1rem; }
.perc-fim { margin-left: auto; }
.perc-linha { display: block; position: relative; height: 22px; margin-top: .7rem; }
.seg { position: absolute; top: 4px; bottom: 4px; display: flex; flex-direction: column; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1.5px var(--papel); opacity: .45; }
.seg.feito { opacity: 1; }
.seg i { flex: 1; }
.perc-aqui { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--tinta); transition: left .15s; }
.perc-aqui::before { content: ""; position: absolute; left: -4.5px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--tinta); }
@media (max-width: 760px) {
  .centro.sims { grid-template-columns: 1fr; }
  .mos.simulador { min-height: 0; }
  .centro.salas { grid-template-columns: 1fr 1fr; }
  .dia-cab h1 { font-size: 1.35rem; }
  .perc-fim { margin-left: 0; width: 100%; }
}

/* mudança de ecrã: o que sai e o que entra deslizam juntos (como no escalas-app) */
main { view-transition-name: vista; }
.topo { view-transition-name: topo; }
::view-transition-group(*) { animation-duration: .3s; animation-timing-function: var(--desliza); }
html[data-dir=frente]::view-transition-old(vista) { animation: .3s var(--desliza) both sai-esq; }
html[data-dir=frente]::view-transition-new(vista) { animation: .3s var(--desliza) both entra-dir; }
html[data-dir=tras]::view-transition-old(vista) { animation: .3s var(--desliza) both sai-dir; }
html[data-dir=tras]::view-transition-new(vista) { animation: .3s var(--desliza) both entra-esq; }
@keyframes sai-esq { to { transform: translateX(-28%); opacity: 0; } }
@keyframes entra-dir { from { transform: translateX(28%); opacity: 0; } }
@keyframes sai-dir { to { transform: translateX(28%); opacity: 0; } }
@keyframes entra-esq { from { transform: translateX(-28%); opacity: 0; } }
@media (max-width: 760px) {
  @keyframes sai-esq { to { transform: translateX(-100%); opacity: .3; } }
  @keyframes entra-dir { from { transform: translateX(100%); } }
  @keyframes sai-dir { to { transform: translateX(100%); opacity: .3; } }
  @keyframes entra-esq { from { transform: translateX(-100%); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ficha da pessoa: os períodos em faixa */
.faixa { position: relative; background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio); overflow: hidden; }
.faixa .mes { position: absolute; top: 0; bottom: 0; padding: 6px 0 0 4px; border-left: 1px solid var(--linha); font-size: .66rem; color: var(--suave); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.faixa .mes:first-child { border-left: 0; }
.faixa .mes b { color: var(--tinta); }
.faixa .hoje { top: 22px; bottom: 0; width: 2px; margin-left: -1px; }
.faixa + .nota .atencao { font-size: inherit; }
@media (max-width: 760px) { .faixa .mes { font-size: .56rem; letter-spacing: 0; padding-left: 2px; } }

/* entrada (login e convite) */
body.fora .topo, body.fora main { display: none; }
#entrada { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; }
.entrada { width: 100%; max-width: 360px; background: var(--papel); border: 1px solid var(--linha); border-radius: 16px; padding: 1.6rem 1.5rem 1.5rem; box-shadow: 0 10px 40px rgb(0 0 0 / .08); animation: entrada-sobe .32s var(--desliza) both; }
@keyframes entrada-sobe { from { opacity: 0; transform: translateY(14px); } }
.entrada h1 { font-size: 1.6rem; letter-spacing: -.02em; }
.entrada > p { margin: .4rem 0 0; color: var(--suave); font-size: .95rem; }
.entrada input { display: block; width: 100%; margin-top: .3rem; padding: .65rem .75rem; min-height: 46px; border: 1px solid var(--linha); border-radius: 8px; background: var(--fundo); color: var(--tinta); font-size: 1rem; }
.entrada input[readonly] { color: var(--suave); }
.entrada #entrada-erro { color: var(--perigo); font-weight: 550; margin-top: .9rem; }
.entrada button { width: 100%; margin-top: 1.2rem; min-height: 48px; }
.sessao { margin: 2.5rem 0 0; text-align: center; color: var(--suave); font-size: .85rem; }
.sessao button.ligacao { min-height: 32px; padding: 0 .3rem; }
