/* Histórias: gráficos por passos (site + apresentação). Elementos com data-p aparecem quando ganham .on */
.hs, .hs-painel { --hs-ink: var(--navy); --hs-ink-2: var(--ink-2); --hs-ink-3: #9AA0AC; --hs-ok: #DCE3EC; --hs-rur: #1C7A55;
  --ease: cubic-bezier(.16, 1, .3, 1); position: relative; font-family: var(--f-body); }
.hs-svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--f-body); -webkit-tap-highlight-color: transparent; }
.hs [data-p] { opacity: 0; transition: opacity .5s var(--ease); }
.hs [data-p].on { opacity: 1; }
.hs.sem-anim *, .hs.sem-anim *::before { transition: none !important; }
.hs svg text { font-size: 12px; fill: var(--ink-2); }
.hs .hs-tick { font-size: 11px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.hs .hs-tick.cur { fill: var(--navy); font-weight: 700; }
.hs .hs-sem { font-style: italic; font-size: 10px; }
.hs .hs-grid { stroke: var(--rule); stroke-width: 1; }
.hs .hs-grid.fraca { stroke: #EFF1F4; }
.hs-nota { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 0; line-height: 1.5; }

/* períodos, governos, marcos */
.hs .hs-per path { fill: none; stroke: var(--ink-3); stroke-width: 1.2; }
.hs .hs-per-t { font-size: 10.5px; fill: var(--ink-2); font-weight: 500; font-style: italic; }
.hs .hs-per { cursor: help; }
/* governos: cor do partido na faixa e, muito clara, no fundo do gráfico */
.hs .hs-gov.ps rect { fill: #F6D3E2; } .hs .hs-gov.psd rect { fill: #FBDDBE; }
.hs .hs-gov.ps rect.fundo { fill: #FCF1F6; } .hs .hs-gov.psd rect.fundo { fill: #FEF5EB; }
.hs .hs-gov-t { font-size: 10.5px; font-weight: 600; fill: #3A2A33; }
.hs .hs-gov:hover rect:not(.fundo) { filter: brightness(.95); }
.hs .hs-marco line { stroke: var(--navy); stroke-width: 1; stroke-dasharray: 2 3; opacity: .45; }
.hs .hs-marco circle { fill: var(--navy); stroke: #fff; stroke-width: 1.5; }
.hs .hs-marco circle.num { fill: var(--navy); stroke: none; }
.hs .hs-marco-n { font-size: 11px !important; font-weight: 700; fill: #fff; pointer-events: none; }
.hs .hs-marco-t { font-size: 11.5px; fill: var(--navy); font-weight: 600; }
.hs .hs-marco { cursor: help; outline: none; }
.hs .hs-marco circle.hit { fill: transparent; stroke: none; }
.hs .hs-foco { fill: color-mix(in srgb, var(--navy) 8%, transparent); }

/* linhas que se desenham */
.hs .hs-ln { opacity: 1; }
.hs .hs-ln .hs-trilho { fill: none; stroke: var(--cor); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset var(--dur, 1.2s) var(--ease); }
.hs .hs-ln.forte .hs-trilho { stroke-width: 3.4; }
.hs .hs-ln.on .hs-trilho { stroke-dashoffset: 0; }
.hs .hs-ln .hs-tra { fill: none; stroke: #fff; stroke-width: 2.6; stroke-dasharray: 3 4; opacity: 0; transition: opacity .3s var(--dur); }
.hs .hs-ln.on .hs-tra { opacity: 1; }
.hs .hs-ln .hs-pt { fill: var(--cor); stroke: #fff; stroke-width: 1.5; opacity: 0; transition: opacity .25s var(--ease) var(--d, 0s); }
.hs .hs-ln .hs-pt.pdf { fill: #fff; stroke: var(--cor); stroke-width: 1.8; }
.hs .hs-ln.on .hs-pt { opacity: 1; }
.hs .hs-anot { font-size: 11.5px !important; font-weight: 700; fill: var(--navy) !important; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: #fff; stroke-width: 3.5px; stroke-linejoin: round; }
.hs .hs-fim-t { font-size: 12px; fill: var(--ink); }
.hs .hs-fim-t .v { font-weight: 700; fill: var(--cor); font-variant-numeric: tabular-nums; }
.hs .hs-fim-t .ed { fill: var(--ink-3); font-size: 10.5px; }
.hs .hs-cruz-alvo { fill: transparent; cursor: crosshair; touch-action: pan-y; }
.hs .hs-cruz { stroke: var(--navy); stroke-width: 1; opacity: 0; pointer-events: none; }
.hs .hs-cruz.on { opacity: .5; }

/* legenda HTML (ecrãs estreitos) */
.hs-leg { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); margin: 0 0 10px; line-height: 1.35; }
.hs-leg span { display: inline-flex; align-items: center; gap: 6px; }
.hs-leg i { width: 14px; height: 3px; border-radius: 2px; background: var(--cor, var(--ink-3)); display: inline-block; }
.hs-leg.sq i, .hs-leg i.sq { width: 11px; height: 11px; border-radius: 2px; }
.hs-leg i.dot { width: 11px; height: 11px; border-radius: 50%; }
.hs-leg i.dot.o { background: #fff; border: 2px solid #7D8696; }
.hs-leg-b { gap: 0 4px; margin-left: -8px; }
.hs-leg-b button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 3px; background: none; color: var(--ink-2);
  font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hs-leg-b button[aria-pressed="true"] { background: #EEF1F5; color: var(--ink); font-weight: 600; }
.hs-leg-b button i { width: 16px; height: 4px; }
/* satisfação no telemóvel: no último passo só a reforma e a ULS a cor; um toque na legenda destaca outra linha */
.hs.sat-estreito[data-passo="7"]:not(.com-foco) .hs-ln:not([data-l="reforma"]):not([data-l="ars"]),
.hs.sat-estreito[data-passo="7"]:not(.com-foco) .hs-leg-b button:not([data-lf="reforma"]):not([data-lf="ars"]),
.hs.com-foco .hs-ln:not(.foco), .hs.com-foco .hs-leg-b button:not([aria-pressed="true"]) { --cor: #C9CED6 !important; }
.hs.com-foco .hs-ln.foco .hs-trilho { stroke-width: 3.6; }
.hs .hs-ln .hs-trilho { transition-property: stroke-dashoffset, opacity, stroke; }
.hs .hs-ln .hs-pt { transition: opacity .25s var(--ease) var(--d, 0s), fill .3s, stroke .3s; }

/* painel/tooltip */
.hs-painel { position: fixed; z-index: 9999; pointer-events: none; max-width: 300px; background: #fff; color: var(--ink); border: 1px solid var(--rule);
  border-radius: 4px; box-shadow: 0 6px 18px rgba(15, 23, 42, .12); padding: 9px 12px; font: 12.5px/1.45 var(--f-body); }
.hs-painel[hidden] { display: none; }
.hs-painel ul { list-style: none; margin: 6px 0 4px; padding: 0; }
.hs-painel li { display: grid; grid-template-columns: 14px 1fr auto; gap: 6px; align-items: center; }
.hs-painel li i { width: 10px; height: 3px; background: var(--cor); border-radius: 2px; }
.hs-painel li b { font-variant-numeric: tabular-nums; color: var(--navy); }
.hs-painel small { color: var(--ink-3); display: block; }

/* B1: barras + grelha do top 5 por edição (duas camadas que trocam) */
.hs-necessidades .hs-alvo, .hs.hs-necessidades { display: grid; }
.hs.hs-necessidades { grid-template-columns: minmax(0, 1fr); }
.hs.hs-necessidades > .hs-camada { grid-area: 1 / 1; min-width: 0; transition: opacity .6s var(--ease); }
.hs.hs-necessidades[data-passo="2"] .hs-c-barras, .hs.hs-necessidades[data-passo="3"] .hs-c-barras { opacity: 0; pointer-events: none; }
.hs.hs-necessidades .hs-c-bump:not(.on) { pointer-events: none; }
/* grelha do top 5: caixas com a cor do tema (fundo claro + filete), texto escuro; o mesmo problema destaca-se em todas as edições */
.hs-grelha { display: grid; gap: 4px; align-items: stretch; }
.hs-grelha.colunas { grid-template-columns: 34px repeat(var(--n), minmax(0, 1fr)); }
.hs-grelha.linhas { grid-template-columns: 33px repeat(5, minmax(0, 1fr)); gap: 2px; }
.hs-grelha.linhas .gr-cx { padding: 4px 2px 4px 4px; letter-spacing: -.01em; }
.hs-grelha .gr-cab, .hs-grelha .gr-rk { font: 600 12px/1.2 var(--f-head); color: var(--ink-3); font-variant-numeric: tabular-nums; display: flex; align-items: center; justify-content: center; }
.hs-grelha .gr-cab { padding: 2px 0 4px; }
.hs-grelha.colunas .gr-rk { justify-content: flex-end; padding-right: 4px; }
.hs-grelha.linhas .gr-rk { justify-content: flex-start; }
.hs-grelha .cur:is(.gr-cab, .gr-rk) { color: var(--navy); background: color-mix(in srgb, var(--realce) 22%, transparent); border-radius: 3px; }
.hs-grelha .gr-cx { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 2px; min-width: 0; padding: 5px 5px 5px 7px;
  background: color-mix(in srgb, var(--cor) 15%, #fff); border-left: 3px solid var(--cor); border-radius: 2px; cursor: pointer;
  font-size: 12px; line-height: 1.2; color: var(--ink); hyphens: manual; -webkit-hyphens: manual; overflow-wrap: normal; transition: opacity .3s, background-color .3s; }
.hs-grelha .gr-cx.cur { background: color-mix(in srgb, var(--cor) 26%, #fff); font-weight: 600; }
.hs-grelha .gr-v { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 400; }
.hs-grelha .gr-cx.sel { background: color-mix(in srgb, var(--cor) 38%, #fff); box-shadow: inset 0 0 0 1.5px var(--cor); }
.hs-grelha.com-sel .gr-cx:not(.sel) { opacity: .28; }
.hs[data-passo="3"] .hs-grelha:not(.com-sel) .gr-cx:not(.inf) { opacity: .28; }
.hs[data-passo="3"] .hs-grelha:not(.com-sel) .gr-cx.inf { background: color-mix(in srgb, var(--cor) 32%, #fff); }
.hs-c-bump .gr-leg { margin-bottom: 8px; }
@media (max-width: 639px) { .hs-grelha .gr-v { font-size: 12px; } }
.hs-pres .hs-grelha { gap: 6px; } .hs-pres .hs-grelha.colunas { grid-template-columns: 52px repeat(var(--n), minmax(0, 1fr)); }
.hs-pres .hs-grelha .gr-cab, .hs-pres .hs-grelha .gr-rk { font-size: 20px; }
.hs-pres .hs-grelha .gr-cx { font-size: 17px; padding: 5px 7px 5px 9px; border-left-width: 5px; }
.hs-pres .hs-grelha .gr-v { font-size: 15px; }
.hs .hs-bar rect { fill: #C4CCD8; transition: fill .4s var(--ease); }
.hs .hs-bar .hs-bar-l { font-size: 12.5px; fill: var(--ink); }
.hs .hs-bar .hs-bar-l .rk { fill: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.hs .hs-bar .hs-bar-v { font-size: 11.5px; font-weight: 600; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.hs[data-passo="1"] .hs-bar.top rect, .hs .hs-bar.foco rect { fill: var(--navy); }
.hs[data-passo="1"] .hs-bar:not(.top) { opacity: .55; }
.hs .hs-bar { cursor: pointer; outline: none; transition: opacity .4s; }
.hs .hs-bar:focus-visible .hs-bar-l { text-decoration: underline; }

/* falhas: colunas empilhadas */
.hs-grade { display: grid; gap: 28px; margin-top: 8px; }
.hs-grade.dois { grid-template-columns: 1fr 1fr; }
.hs-fig { margin: 0; }
.hs-fig figcaption { font: 600 14px/1.35 var(--f-head); color: var(--navy); margin-bottom: 8px; }
.hs .hs-col { transform-box: fill-box; }
.hs .hs-col rect { transform-origin: bottom; transform-box: fill-box; transform: scaleY(0); transition: transform .7s var(--ease) var(--d, 0s); stroke: #fff; stroke-width: .6; }
.hs .hs-fig.on .hs-col rect { transform: scaleY(1); }
.hs .hs-col.cur rect { stroke: var(--navy); stroke-width: 1.2; }
.hs[data-passo="1"] .hs-col:not(.cur), .hs[data-passo="3"] .hs-fig.agora ~ * .hs-col:not(.cur) { opacity: .45; }
.hs[data-passo="3"] .hs-fig[data-p="2"] .hs-col:not(.cur) { opacity: .45; }

/* ULS: dot plot */
.hs .hs-nac line { stroke: var(--navy); stroke-width: 1.5; stroke-dasharray: 4 3; }
.hs .hs-nac-t { font-size: 11.5px; font-weight: 700; fill: var(--navy); paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.hs .hs-ud { opacity: 0; transition: opacity .4s var(--ease) var(--d, 0s); }
.hs .hs-ud.on { opacity: 1; }
.hs .hs-ud .hit { fill: transparent; }
.hs .hs-ud:hover .hit { fill: color-mix(in srgb, var(--navy) 5%, transparent); }
.hs .hs-ud-l { font-size: 12px; fill: var(--ink); }
.hs .hs-ud-pt { fill: var(--navy); stroke: #fff; stroke-width: 1.5; }
.hs .hs-ud-v { font-size: 11px; font-weight: 600; fill: var(--ink-2); font-variant-numeric: tabular-nums; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.hs .hs-ud-v .n { font-weight: 400; fill: var(--ink-3); }
.hs .hs-ud .hs-ud-v:not(.on) { opacity: 0; }
.hs[data-passo="2"] .hs-ud:not(.ext) .hs-ud-v { opacity: 0; }
.hs[data-passo="2"] .hs-ud:not(.ext) { opacity: .5; }
.hs .hs-ud.ext.bom .hs-ud-pt { fill: var(--up); } .hs .hs-ud.ext.mau .hs-ud-pt { fill: var(--down); }
.hs .hs-ud.ext .hs-ud-l { font-weight: 600; }
.hs .hs-ud.fraca { opacity: .62; } .hs .hs-ud.fraca .rk { fill: #9A6700; }
.hs .hs-sep-p { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 4 4; }
.hs .hs-ant line { stroke: #B9C1CE; stroke-width: 1.5; } .hs .hs-ant circle { fill: #fff; stroke: #7D8696; stroke-width: 1.5; }

/* densidade */
.hs-dens-topo { margin-bottom: 22px; }
.hs-waffle { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.hs-waffle svg { width: auto; max-width: 180px; }
.hs-waffle rect { fill: #E2E7EE; }
.hs-waffle rect.rur { fill: var(--hs-rur); transform-box: fill-box; transform-origin: center; transform: scale(.2); transition: transform .5s var(--ease) var(--d, 0s); }
.hs-waffle.on rect.rur { transform: scale(1); }
.hs-waffle p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.hs-num { display: block; font: 700 40px/1 var(--f-head); color: var(--hs-rur); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.hs .hs-db { opacity: 0; transition: opacity .45s var(--ease) var(--d, 0s); }
.hs .on .hs-db { opacity: 1; }
.hs .hs-db line { stroke: #C9CED8; stroke-width: 2; }
.hs .hs-db.sobe line { stroke: color-mix(in srgb, var(--up) 40%, transparent); }
.hs .hs-db circle.o { fill: #fff; stroke: var(--hs-ink-3); stroke-width: 2; }
.hs .hs-db circle.r { fill: var(--hs-rur); stroke: #fff; stroke-width: 1.5; }
.hs .hs-db.desce line { stroke: color-mix(in srgb, var(--down) 40%, transparent); }
.hs .hs-db-l { font-size: 12.5px; fill: var(--ink); } .hs .hs-db-l .esc { fill: var(--ink-3); font-size: 11px; }
/* variações: o par sobe/desce do site (--up azul / --down vermelho); o verde identifica só as USF rurais */
.hs .hs-db-v { font-size: 11.5px; font-weight: 700; fill: var(--up); font-variant-numeric: tabular-nums; }
.hs .hs-db.desce .hs-db-v { fill: var(--down); }
.hs .hs-db-v .pp { font-weight: 500; font-size: .9em; }
.hs-hbar { display: grid; grid-template-columns: 1fr minmax(70px, 34%) 42px; gap: 8px 12px; align-items: center; font-size: 13px; }
.hs-hbar .b { height: 12px; background: #EEF1F5; border-radius: 2px; overflow: hidden; }
.hs-hbar .b i { display: block; height: 100%; background: var(--hs-rur); border-radius: 2px; }
.hs-hbar .v { text-align: right; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }

/* controlos da cena (site) */
.hs-ctrl { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; flex-wrap: wrap; }
.hs-b { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--rule); background: #fff; border-radius: 50%; cursor: pointer; color: var(--navy); }
.hs-b svg, .hs-play svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hs-b:hover:not(:disabled) { border-color: var(--navy); }
.hs-b:disabled { opacity: .35; cursor: default; }
.hs-pontos { display: flex; gap: 0; }
.hs-pontos button { width: 30px; height: 44px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; padding: 0; }
.hs-pontos i { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #74747F; transition: background .3s, border-color .3s, transform .3s var(--ease); }
.hs-pontos button.feito i { border-color: var(--navy); }
.hs-pontos button[aria-current="step"] i { background: var(--navy); border-color: var(--navy); transform: scale(1.3); }
.hs-play { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--navy); color: var(--navy);
  background: #fff; border-radius: 3px; font: 700 12.5px/1 var(--f-head); text-transform: uppercase; letter-spacing: .4px; cursor: pointer; }
.hs-play svg { fill: currentColor; stroke: none; width: 16px; height: 16px; }
.hs-play:hover, .hs-play.a-correr { background: var(--navy); color: #fff; }
.hs-texto { font-size: 15.5px; line-height: 1.6; color: var(--ink); margin: 10px 0 0; min-height: 4.8em; }
.hs-texto b { color: var(--navy); font-variant-numeric: tabular-nums; }
.hs-alvo, .cena { min-width: 0; }
.hs-chips { display: flex; max-width: 100%; mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 24px; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px; scrollbar-width: thin; }
.hs-chips button { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid #9AA0AC; background: #fff; color: var(--ink);
  font: 500 13px/1 var(--f-body); cursor: pointer; white-space: nowrap; }
.hs-chips button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.hs-chips button small { font-size: 12px; color: var(--ink-3); margin-left: 2px; }
.hs-chips button[aria-pressed="true"] small { color: rgba(255, 255, 255, .82); }
.hs-chips button:hover:not([aria-pressed="true"]) { border-color: var(--navy); }
@media (max-width: 759px) { .hs-chips button { min-height: 44px; } }

/* palco da apresentação: tipografia maior */
.hs-pres svg text { font-size: 21px; }
.hs-pres .hs-tick { font-size: 21px; }
.hs-pres .hs-gov-t, .hs-pres .hs-per-t { font-size: 19px; } .hs-pres .hs-marco-t { font-size: 17px; }
.hs-marcos-l { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 12.5px; line-height: 1.35; color: var(--ink-2); opacity: 0; transition: opacity .4s; }
.hs-marcos-l.on { opacity: 1; }
.hs-marcos-l b { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 4px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 10.5px; }
.hs-marcos-l small { color: var(--ink-3); }
.hs-pres .hs-fim-t { font-size: 23px; } .hs-pres .hs-fim-t .ed { font-size: 17px; }
.hs-pres .hs-anot { font-size: 23px !important; }
.hs-pres .hs-bar .hs-bar-l { font-size: 24px; } .hs-pres .hs-bar .hs-bar-v { font-size: 22px; }
.hs-pres .hs-ud-l { font-size: 19px; } .hs-pres .hs-ud-v { font-size: 18px; } .hs-pres .hs-nac-t { font-size: 20px; }
.hs-pres .hs-db-l { font-size: 19px; } .hs-pres .hs-db-l .esc { font-size: 15px; } .hs-pres .hs-db-v { font-size: 18px; }
.hs-pres .hs-nota { font-size: 18px; }
.hs-pres .hs-fig figcaption { font-size: 27px; margin-bottom: 12px; }
.hs-pres .hs-leg { font-size: 22px; gap: 8px 26px; }
.hs-pres .hs-leg.sq i { width: 16px; height: 16px; }
.hs-pres .hs-hbar { font-size: 22px; gap: 12px 18px; } .hs-pres .hs-hbar .b { height: 22px; }
.hs-pres .hs-waffle svg { max-width: 200px; } .hs-pres .hs-waffle p { font-size: 28px; max-width: 26em; } .hs-pres .hs-num { font-size: 72px; }
.hs-pres .hs-grade { gap: 48px; }
@media (prefers-reduced-motion: reduce) { .hs *, .hs [data-p] { transition: none !important; } }

.hs-dens-pres { display: grid; grid-template-columns: 560px 1060px; gap: 80px; align-items: start; }
.hs-dens-pres .hs-waffle { grid-template-columns: 200px 1fr; gap: 28px; margin-bottom: 34px; align-items: start; }
.hs-dens-pres .hs-waffle p { font-size: 22px !important; }
.hs-pres .hs-waffle p { font-size: 25px; }
@media (max-width: 480px) { .hs-ctrl { gap: 4px; } .hs-play { margin-left: 0; width: 100%; justify-content: center; order: 3; } .hs-pontos { flex: 1; justify-content: center; } }
.hs .hs-gov { cursor: help; }
.hs-dens-pres .hs-nota { max-width: 900px; font-size: 15px; }

.hs .hs-quebra line { stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; }
.hs .hs-quebra { pointer-events: all; }
.hs .hs-ud-l .rk { fill: var(--ink-3); font-weight: 500; font-size: .85em; font-variant-numeric: tabular-nums; }

/* corrida das prioridades */
.cr-palco { position: relative; z-index: 0; margin-top: 6px; overflow: hidden; }   /* contexto próprio: as filas (z 90–100) não passam por cima do cabeçalho */
.cr-eixo { position: absolute; left: var(--cr-lbl, 40%); right: 64px; top: 0; height: 22px; border-bottom: 1px solid var(--rule); }
.cr-eixo span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--ink-3); }
.cr-l { z-index: 1; position: absolute; left: 0; right: 0; top: 0; height: 36px; display: grid; grid-template-columns: var(--cr-lbl, 40%) 1fr 64px; align-items: center; will-change: transform, opacity; }
.cr-n { font-size: 13.5px; line-height: 1.2; color: var(--ink); text-align: right; padding-right: 12px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cr-l.top .cr-n { font-weight: 600; }
.cr-b { height: 26px; position: relative; }
.cr-b i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--cor); border-radius: 0 3px 3px 0; opacity: .78; }
.cr-l.top .cr-b i { opacity: 1; }
.cr-v { padding-left: 8px; font-weight: 700; font-size: 13px; color: var(--navy); font-variant-numeric: tabular-nums; }
.cr-ano { z-index: 0; position: absolute; right: 70px; bottom: 6px; font: 700 64px/1 var(--f-head); color: color-mix(in srgb, var(--navy) 16%, transparent); letter-spacing: -.03em; font-variant-numeric: tabular-nums; pointer-events: none; }
.cr-tempo { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.cr-play { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; display: grid; place-items: center; cursor: pointer; }
.cr-play svg { width: 20px; height: 20px; fill: currentColor; }
.cr-trilho { position: relative; flex: 1; height: 44px; margin: 0 16px; }
.cr-trilho::before { content: ''; position: absolute; left: 0; right: 0; top: 10px; height: 4px; background: #E5E7EA; border-radius: 2px; }
.cr-prog { position: absolute; left: 0; top: 10px; height: 4px; background: var(--navy); border-radius: 2px; }
.cr-ed { position: absolute; top: 0; transform: translateX(-50%); border: 0; background: none; padding: 20px 2px 0; font: 500 11px/1 var(--f-body); color: var(--ink-3); cursor: pointer; min-width: 30px; }
.cr-ed::before { content: ''; position: absolute; left: 50%; top: 8px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #fff; border: 2px solid #C4CCD8; }
.cr-ed.on { color: var(--navy); font-weight: 700; } .cr-ed.on::before { border-color: var(--navy); background: var(--navy); }
.cr-quebra { position: absolute; top: 2px; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: -2px; }
.cr.estreito { --cr-lbl: 46%; } .cr.estreito .cr-n { font-size: 12px; }
/* telemóvel: o ano sai da zona das barras (fica por cima, à direita) e o trilho só rotula uma edição em cada duas */
.cr.estreito .cr-ano { position: static; display: block; text-align: right; font-size: 30px; color: color-mix(in srgb, var(--navy) 55%, transparent); margin: 2px 0 -4px; }
.cr.estreito .cr-ed { font-size: 12px; }
.cr .cr-ed:not(.lb) { color: transparent; }
.cr.estreito .cr-trilho { margin: 0 12px 0 8px; }
/* durante a troca de posições os valores escondem-se (as linhas cruzam-se) */
.cr.movendo .cr-v { opacity: 0; }
.cr-v { transition: opacity .15s; }
.cr.pres { --cr-lbl: 34%; }
.cr.pres .cr-l { height: 48px; grid-template-columns: var(--cr-lbl) 1fr 90px; }
.cr.pres .cr-n { font-size: 24px; } .cr.pres .cr-v { font-size: 23px; } .cr.pres .cr-b { height: 36px; }
.cr.pres .cr-eixo { right: 90px; } .cr.pres .cr-eixo span { font-size: 18px; }
.cr.pres .cr-ano { font-size: 150px; right: 110px; bottom: 10px; }
.cr.pres .cr-ed { font-size: 17px; padding-top: 24px; } .cr.pres .cr-trilho { height: 52px; }

/* realce: o amarelo USF-AN das apresentações (caixa à volta do que o orador destaca) */
.hs { --realce: #F5B91E; }
.hs .hs-realce { fill: color-mix(in srgb, var(--realce) 13%, transparent); stroke: var(--realce); stroke-width: 3; pointer-events: none; }
.hs.hs-necessidades[data-passo="2"] .hs-realce, .hs.hs-necessidades[data-passo="3"] .hs-c-barras .hs-realce { opacity: 0; }
/* falhas: a caixa amarela só contorna a coluna atual (sem tingir as cores); legendas com a mesma altura para alinhar os dois gráficos */
.hs-falhas .hs-realce { fill: none; }
.hs-falhas .hs-col.cur rect { stroke: #fff; stroke-width: .6; }
.hs-falhas .hs-grade.dois .hs-leg.sq { min-height: 3.1em; align-content: flex-start; }
.hs-pres.hs-falhas { position: relative; }
.hs-pres.hs-falhas .hs-fl-48 { position: absolute; left: 0; right: 0; top: 0; }
.hs-pres.hs-falhas .hs-fl-col { transition: opacity .5s; }
.hs-pres.hs-falhas[data-passo="4"] .hs-fl-col { opacity: 0; }
.hs-pres .hs-realce { stroke-width: 4; }

/* tabela com os dados de cada cena */
.hs-tabela { margin-top: 18px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.hs-tabela summary { cursor: pointer; list-style: none; position: relative; display: flex; align-items: center; min-height: 46px; padding: 0 34px 0 10px; font: 600 14px/1.3 var(--f-head); color: var(--navy); }
.hs-tabela summary::-webkit-details-marker { display: none; }
.hs-tabela summary::after { content: ''; position: absolute; right: 8px; top: 16px; width: 8px; height: 8px; border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy); transform: rotate(45deg); transition: transform .25s; }
.hs-tabela[open] summary::after { transform: rotate(-135deg); top: 20px; }
.hs-tabela .tb { overflow: auto; max-height: 70vh; padding: 0 0 12px; -webkit-overflow-scrolling: touch; }
.hs-tabela table { border-collapse: collapse; min-width: 100%; font-size: 13px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.hs-tabela caption { caption-side: top; text-align: left; font-size: 12.5px; color: var(--ink-3); padding: 4px 10px 10px; }
.hs-tabela th, .hs-tabela td { padding: 6px 10px; border-bottom: 1px solid var(--rule); text-align: right; vertical-align: top; }
.hs-tabela thead th { position: sticky; top: 0; background: #fff; font: 600 12.5px/1.3 var(--f-head); color: var(--navy); text-align: right; min-width: 6em; }
.hs-tabela thead th:first-child, .hs-tabela tbody th { text-align: left; }
.hs-tabela tbody th { font-weight: 500; color: var(--ink); min-width: 9em; }
.hs-tabela td { white-space: nowrap; color: var(--ink-2); }
.hs-tabela small { color: var(--ink-3); font-size: 11.5px; }
#cCorrida .hs-tabela td { white-space: normal; text-align: left; min-width: 11em; }

/* ecrãs largos: o gráfico ocupa a largura toda; os controlos e o texto do passo ficam numa barra por cima,
   presa ao topo enquanto o gráfico está no ecrã (os passos veem-se sempre) */

@media (min-width: 1200px) {
  .hs-cena.lado, .hs-cena.lado > .hs-fixo { display: flex; flex-direction: column; }
  /* texto do passo, botões e play logo por baixo do gráfico; presos ao fundo do ecrã enquanto o gráfico for mais alto do que ele */
  .hs-cena.lado > .hs-fixo > .hs-lado { position: sticky; bottom: 0; z-index: 6; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 28px; align-items: center;
    margin: 12px 0 0; padding: 12px 0; background: var(--sec-bg, var(--page)); border-top: 1px solid var(--rule); }
  .hs-cena.lado .hs-ctrl { margin: 0; gap: 4px; flex-wrap: nowrap; }
  .hs-cena.lado .hs-pontos button { width: 26px; }
  .hs-cena.lado .hs-play { margin-left: 10px; }
  /* texto do passo à esquerda (logo por baixo do título), controlos à direita */
  .hs-cena.lado .hs-texto { order: -1; margin: 0; min-height: 3.2em; font-size: 15px; line-height: 1.6; }
}


/* telemóvel: nenhum texto dos gráficos abaixo de 12px */
@media (max-width: 639px) {
  .hs:not(.hs-pres) .hs-tick, .hs:not(.hs-pres) .hs-per-t, .hs:not(.hs-pres) .hs-gov-t, .hs:not(.hs-pres) .hs-marco-t,
  .hs:not(.hs-pres) .hs-ud-v, .hs:not(.hs-pres) .hs-fim-t .ed, .hs:not(.hs-pres) .hs-db-l .esc, .hs:not(.hs-pres) .hs-anot,
  .hs:not(.hs-pres) .hs-bar-v, .hs:not(.hs-pres) .hs-nac-t, .hs:not(.hs-pres) .hs-db-v, .hs:not(.hs-pres) .hs-ud-l .rk, .hs:not(.hs-pres) .hs-ud-v .n { font-size: 12px !important; }
  .hs:not(.hs-pres) .hs-ud-v { font-weight: 700; }
}

.hs-pres .hs-nota { max-width: none; }

/* falhas: sub-títulos das linhas das 48 h (alinhadas com as colunas de cima) */
.hs-sub { margin: 0 0 2px; font: 600 12.5px/1.3 var(--f-head); color: var(--ink-2); }
.hs-fl-48 { margin-top: 26px; }
.hs-fl-48 .hs-grade { margin-top: 0; }
/* zonas rurais: as duas figuras de barras têm a mesma altura e a nota fica na mesma linha */
.hs-grade.dois > .hs-fig-b { display: flex; flex-direction: column; }
.hs-grade.dois > .hs-fig-b .hs-nota { margin-top: auto; padding-top: 10px; }

/* corrida (site): nomes alinhados à esquerda, valor no fim da barra, ano na linha da legenda */
.cr-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.cr-cab .hs-leg { margin: 0; flex: 1 1 auto; }
.cr.site .cr-ano { position: static; font-size: 40px; line-height: 1; color: color-mix(in srgb, var(--navy) 60%, transparent); margin: 0; }
.cr.site .cr-l { grid-template-columns: var(--cr-lbl, 34%) 1fr; padding-right: 58px; }
.cr.site .cr-eixo { left: var(--cr-lbl, 34%); right: 58px; }
.cr.site .cr-n { text-align: left; }
.cr.site .cr-b { position: relative; }
.cr.site .cr-v { position: absolute; top: 50%; transform: translateY(-50%); padding-left: 8px; white-space: nowrap; }
.cr.site.estreito { --cr-lbl: 44%; }
.cr.site.estreito .cr-ano { font-size: 30px; }

/* telemóvel (≤ 768 px): gráfico, passos e texto num bloco; preso por baixo do cabeçalho quando cabe no ecrã */
@media (max-width: 768px) {
  .hs-cena-m .hs-fixo { background: var(--sec-bg, var(--page)); }
  .hs-cena-m.pin .hs-fixo { position: sticky; top: var(--hs-top, 108px); z-index: 6; padding-bottom: 4px; }
  .hs-cena-m:not(.pin) .hs-lado { position: sticky; bottom: 0; z-index: 6; background: var(--sec-bg, var(--page)); border-top: 1px solid var(--rule);
    margin: 0 calc(-1 * clamp(16px, 3vw, 48px)); padding: 0 clamp(16px, 3vw, 48px) calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 14px rgba(15, 23, 42, .06); }
  .hs-cena-m .hs-ctrl { margin-top: 8px; gap: 2px; flex-wrap: nowrap; }
  .hs-cena-m .hs-pontos { flex: 1; justify-content: center; }
  .hs-cena-m .hs-pontos button { width: 26px; }
  .hs-cena-m .hs-play { order: 0; width: 44px; margin-left: 4px; padding: 0; justify-content: center; }
  .hs-cena-m .hs-play span { display: none; }
  .hs-cena-m .hs-texto { font-size: 14.5px; line-height: 1.5; min-height: 4.5em; margin-top: 2px; }
  .hs-cena-m:not(.pin) .hs-texto { min-height: 3em; margin-bottom: 4px; }
  /* as camadas dos passos seguintes não reservam espaço vazio */
  .hs-cena-m :is(.hs-fig, .hs-camada, .hs-grade, .hs-marcos-l, .hs-leg-b button)[data-p]:not(.on) { display: none; }
  .hs-cena-m .hs-leg-b { margin-top: 4px; margin-bottom: 0; }
  .hs-abaixo .hs-marcos-l { margin-top: 14px; }
}
.hs-abaixo:empty { display: none; }
/* telemóvel e tablet: texto dos governos e períodos nunca abaixo de 12 px */
@media (max-width: 768px) { .hs:not(.hs-pres) .hs-gov-t, .hs:not(.hs-pres) .hs-per-t { font-size: 12px; } }
.cr.site .cr-n { -webkit-line-clamp: 3; line-height: 1.15; }

/* legenda da grelha do top 5: por baixo, com etiqueta explícita */
.hs .gr-leg { margin: 12px 0 0; align-items: center; }
.hs .gr-leg .gr-leg-t { font-weight: 600; color: var(--ink-2); }
/* palco: legenda numa só linha e grelha mais baixa, para o diapositivo caber em 1080 px */
.hs-pres .gr-leg { font-size: 19px; gap: 6px 22px; flex-wrap: nowrap; white-space: nowrap; margin-top: 10px; } .hs-pres .gr-leg i.sq { width: 14px; height: 14px; }
.hs-pres .hs-grelha .gr-cx { line-height: 1.12; padding-top: 4px; padding-bottom: 4px; }

/* texto do passo: realce discreto para se distinguir do texto corrido da página */
.hs:not(.hs-pres) ~ .hs-lado .hs-texto, .hs-cena .hs-texto { background: color-mix(in srgb, var(--navy) 6%, #fff); border: 1px solid color-mix(in srgb, var(--navy) 14%, transparent); border-radius: 6px; padding: 10px 14px; }
/* falhas lado a lado: título, legenda e gráfico nas mesmas linhas da grelha, para os dois eixos ficarem alinhados */
.hs-falhas .hs-fl-col.dois { grid-template-rows: auto auto auto; row-gap: 0; }
.hs-falhas .hs-fl-col.dois > .hs-fig { display: grid; grid-row: span 3; grid-template-rows: subgrid; align-items: end; margin: 0; }
.hs-falhas .hs-fl-col.dois > .hs-fig > figcaption { align-self: start; }
.hs-falhas .hs-fl-col.dois > .hs-fig > .hs-leg { align-self: start; min-height: 0; }
