/* Gráficos: marcas finas, grade discreta, dados em evidência */

/* ---- Moldura: o cartão é o painel do gráfico (surface); dentro de um painel, sem caixa própria */
.viz {
  margin: 0; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5) var(--space-3);
}
:is(.panel, .viz) .viz { background: none; border: 0; border-radius: 0; padding: 0; }
.viz-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-3); }
.viz-titles { min-width: 0; }
.viz-title { margin: 0; font-size: calc(20px * var(--type-scale)); line-height: 1.3; font-weight: 600; color: var(--ink); }
.viz-sub { margin: 2px 0 0; font-size: calc(13px * var(--type-scale)); line-height: 1.5; color: var(--ink-2); }
.viz-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.viz-body { min-width: 0; }
.viz-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  margin-top: var(--space-3); padding-top: 11px; border-top: 1px solid var(--line);
}
.viz-legend { flex: 1 1 auto; min-width: 0; }
.viz-note { font-size: calc(12px * var(--type-scale)); line-height: 1.45; font-weight: 500; color: var(--ink-2); }
.viz-toggle {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); font-size: calc(12px * var(--type-scale)); font-weight: 600; color: var(--ink-2); min-height: 24px;
}
.viz-toggle:hover { color: var(--ink); background: var(--surface-2); }
.viz-table { max-height: 420px; overflow: auto; overscroll-behavior: contain; }
.viz-tbl { font-size: calc(13px * var(--type-scale)); }
.viz-table .table-wrap { margin: 0; padding: 0; }
.viz-tbl { min-width: 0; }
.viz-tbl thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.viz-tbl th[scope='row'] { padding: 9px var(--space-3) 9px 0; font-size: calc(13px * var(--type-scale)); font-weight: 500; color: var(--ink-2); white-space: nowrap; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table.viz-tbl td { padding: 9px var(--space-3) 9px 0; }
.viz-tbl tbody tr:hover > * { background: var(--surface-2); }
.viz-tbl td.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 720px) { .viz { padding: var(--space-3) var(--space-3) var(--space-2); } }
@media (max-width: 860px) { .viz-toggle { min-height: var(--touch-min); } }
@media print {
  .viz { break-inside: avoid; }
  .viz-toggle { display: none; }
}

/* ---- Base ---------------------------------------------------------------- */
/* touch-action no contêiner, não só no retângulo de toque do SVG (há navegador que ignora touch-action dentro do SVG):
   o dedo que começa sobre o gráfico rola a página na vertical e amplia com dois dedos; o arrasto na horizontal fica
   para percorrer os meses. */
.chart { position: relative; width: 100%; user-select: none; -webkit-user-select: none; touch-action: pan-y pinch-zoom; }
.chart:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.chart svg { overflow: visible; display: block; }
.chart text { font-family: var(--font-num); font-size: calc(12px * var(--type-scale)); fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart .axis-x text { transition: opacity var(--dur-fast); }
.chart .axis-x text.under { opacity: 0; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .grid line.zero { stroke: var(--axis); }
.chart .axis-title { font-family: var(--font-sans); font-size: calc(12px * var(--type-scale)); font-weight: 600; fill: var(--ink-2); font-variant-numeric: normal; }

/* Linhas, áreas e faixa */
.chart .ln { fill: none; stroke-linecap: round; stroke-linejoin: round; transition: opacity var(--dur), stroke-width var(--dur); }
.chart .ln.dim { opacity: 0.22; }
/* sem cor até o hover: os caminhos que não são o recomendado nem o selecionado (6.3) */
.chart .ln.muted { stroke: var(--s-ref) !important; stroke-width: 1.5px !important; }
.chart .pt.muted { fill: var(--s-ref) !important; }
.chart .ln.ghost { stroke: var(--ink-3) !important; opacity: 0.45; stroke-width: 1.5px !important; stroke-dasharray: 2 4; }
.chart .ln.dashed { stroke-dasharray: 5 5; }
.chart .ln.dotted { stroke-dasharray: 1.5 4; }
.chart .band { fill: var(--band); }
.chart .band-edge { display: none; }
.chart .split .past { fill: var(--ink); opacity: 0.025; }
.chart .split line { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .split .chip { fill: var(--surface); stroke: var(--line-2); }
.chart .split-label { font-family: var(--font-sans); font-size: calc(12px * var(--type-scale)); font-weight: 600; fill: var(--ink-2); font-variant-numeric: normal; }
.chart .ref line { stroke: var(--warn); stroke-width: 1.25; stroke-dasharray: 4 4; }
/* uma meta (não um estado) usa a referência neutra */
.chart .ref.neutral line { stroke: var(--s-ref); }
.chart .ref text {
  font-family: var(--font-sans); fill: var(--ink-2); font-weight: 600; font-size: calc(12px * var(--type-scale)); font-variant-numeric: normal;
  paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round;
}
.chart .pt { stroke: var(--surface); stroke-width: 2; transition: opacity var(--dur); }
.chart .pt.dim { opacity: 0.3; }
.chart .end-dot { stroke: var(--surface); stroke-width: 2; }
.chart .end-label { font-size: calc(13px * var(--type-scale)); font-weight: 600; fill: var(--ink); }
.chart .end-label.muted { font-size: calc(13px * var(--type-scale)); font-weight: 500; fill: var(--ink-2); }
.chart .leader { fill: none; stroke: var(--line-2); stroke-width: 1; }
.chart .anno line { stroke: var(--ink-3); stroke-width: 1; }
.chart .anno circle { fill: var(--surface); stroke-width: 2.5; }
.chart .anno text {
  font-family: var(--font-sans); font-size: calc(12px * var(--type-scale)); font-weight: 600; fill: var(--ink); font-variant-numeric: normal;
  paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round;
}

/* Mira e rótulo do eixo */
.chart .cross line { stroke: var(--ink-3); stroke-width: 1; }
.chart .cross circle { stroke: var(--surface); stroke-width: 2; }
.chart .x-chip rect, .chart .ax-chip rect { fill: var(--ink); }
.chart .x-chip text, .chart .ax-chip text { fill: var(--ink-inverse); font-size: calc(12px * var(--type-scale)); font-weight: 600; }

/* Marcos */
.chart .rail > line { stroke: var(--line); }
.chart .rail-label { font-family: var(--font-sans); font-size: calc(12px * var(--type-scale)); font-weight: 600; fill: var(--ink-2); font-variant-numeric: normal; }
.chart .rail .mk circle { fill: var(--surface); stroke: var(--ink-2); stroke-width: 2; transition: r var(--dur-fast) var(--ease); }
.chart .rail .mk.goal circle { stroke: var(--s1); }
.chart .rail .mk.event circle { stroke: var(--ink-2); }
.chart .rail .mk.relief circle { stroke: var(--ink-2); stroke-dasharray: 2 2; }
.chart .rail .mk.fi circle { fill: var(--s1); stroke: var(--surface); }
.chart .rail .mk.home circle { fill: var(--ink); stroke: var(--surface); }
.chart .rail .mk-stem { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .rail .mk.on .mk-stem { stroke: var(--ink-3); stroke-dasharray: none; }

/* ---- Dica ------------------------------------------------------------------ */
.tip .tk { width: 12px; height: 2.5px; border-radius: 2px; background: var(--c); flex: none; }
.tip .tk.band { height: 9px; background: var(--band); box-shadow: inset 0 0 0 1px var(--line-2); }
.tip .tk.pos { height: 9px; width: 9px; background: var(--s1); }
.tip .tk.neg { height: 9px; width: 9px; background: var(--div-neg); }
.tip .tip-row .v { font-family: var(--font-num); white-space: nowrap; }
.tip .tip-row .v.soft { color: var(--ink-2); font-weight: 500; }
.tip .v .d { margin-left: var(--space-2); font-size: calc(12px * var(--type-scale)); font-weight: 600; color: var(--ink-2); }
.tip .tip-band .v { font-weight: 500; color: var(--ink-2); }
/* a faixa tem rótulo e valor longos: no celular o valor desce para a linha de baixo, à direita, em vez de o rótulo
   quebrar palavra por palavra */
.tip .tip-band { flex-wrap: wrap; row-gap: 1px; }
.tip .tip-band .n { white-space: nowrap; }
.tip .tip-band .v { margin-left: auto; }
.tip .tip-total { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.tip-events { display: grid; gap: 7px; margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--line); }
.tip-event { display: flex; align-items: flex-start; gap: var(--space-2); font-size: calc(12px * var(--type-scale)); line-height: 1.4; color: var(--ink-2); }
.ev-dot { flex: none; width: 9px; height: 9px; margin-top: var(--space-1); border-radius: var(--radius-round); border: 1px solid var(--ink-2); background: var(--surface); }
.ev-dot.goal { border-color: var(--s1); }
.ev-dot.event { border-color: var(--ink-2); }
.ev-dot.relief { border-color: var(--ink-2); border-style: dashed; }
.ev-dot.fi { background: var(--s1); border-color: var(--s1); }
.ev-dot.home { background: var(--ink); border-color: var(--ink); }
.ev-kind { display: block; font-size: calc(12px * var(--type-scale)); line-height: 1.3; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.tip-flag { display: flex; align-items: center; gap: 6px; margin-top: var(--space-2); font-size: calc(12px * var(--type-scale)); font-weight: 600; }
.tip-flag.ok { color: var(--pos); }
.tip-flag.warn { color: var(--warn); }
.tip-flag.no { color: var(--neg); }
.tip-event .n { color: var(--ink-2); font-weight: 500; }

/* ---- Legenda: a amostra tem a forma da marca -------------------------------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: calc(13px * var(--type-scale)); color: var(--ink-2); }
.legend button, .legend span.item { display: inline-flex; align-items: center; gap: var(--space-2); padding: 3px 0; }
.legend button { border-radius: var(--radius-sm); transition: color var(--dur), opacity var(--dur); }
.legend button:hover { color: var(--ink); }
.legend button[aria-pressed='false'] { text-decoration: line-through; }
.legend button[aria-pressed='false'] .lg-sw { opacity: 0.35; }
.legend .key { width: 16px; }
.lg-sw { display: inline-block; flex: none; }
.lg-line { width: 16px; height: 2.5px; border-radius: 2px; background: var(--c); }
.lg-dash { width: 16px; height: 0; border-top: 2px dashed var(--c); }
.lg-dotted { width: 16px; height: 0; border-top: 2px dotted var(--c); }
.lg-area { width: 14px; height: 10px; border-radius: var(--radius-sm); background: var(--band); box-shadow: inset 0 0 0 1px var(--line-2); }
.lg-bar { width: 10px; height: 10px; border-radius: var(--radius-sm); background: var(--c); }
.lg-outline { width: 12px; height: 10px; box-sizing: border-box; border-radius: 2px; border: 1.5px dashed var(--c); }     /* o previsto: contorno, sem preenchimento */
.lg-dot { width: 8px; height: 8px; border-radius: var(--radius-round); background: var(--c); }
.lg-ring { width: 10px; height: 10px; border-radius: var(--radius-round); border: 1px solid var(--c); }
.lg-hollow { width: 8px; height: 8px; border-radius: var(--radius-round); border: 1px solid var(--c); }

/* ---- Ponte de contribuições ------------------------------------------------- */
.hbars { display: grid; grid-template-columns: var(--lbl, 200px) minmax(0, 1fr); column-gap: var(--space-4); }
.hb-row { display: contents; }
.hbars .lbl {
  display: flex; align-items: center; min-height: 34px; padding: 0 var(--space-2);
  font-size: calc(13px * var(--type-scale)); color: var(--ink-2); border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.hbars .track { position: relative; height: 34px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.hb-row:not(.scale):hover > .lbl, .hb-row:not(.scale):hover > .track { background: var(--surface-2); }
.hbars .gl { display: none; position: absolute; top: 0; bottom: 0; width: 1px; }
.hbars .gl.zero { display: block; background: var(--axis); }
.hbars .bar { position: absolute; top: 9px; height: 16px; border-radius: var(--radius-sm); transition: left var(--dur-chart) var(--ease), width var(--dur-chart) var(--ease); }
.hbars .bar.pos { background: var(--div-pos); }
.hbars .bar.neg { background: var(--div-neg); }
.hbars .bar.total { top: var(--space-2); height: 18px; background: var(--ink); }
.hbars .conn { position: absolute; width: 0; border-left: 1px dashed var(--ink-3); opacity: 0.6; }
.hbars .conn.out { top: 25px; bottom: 0; }
.hbars .conn.in { top: 0; height: 9px; }
.hbars .val {
  position: absolute; top: 17px; transform: translateY(-50%);
  font-family: var(--font-num); font-size: calc(13px * var(--type-scale)); font-weight: 600; white-space: nowrap; color: var(--ink);
  font-variant-numeric: tabular-nums; transition: left var(--dur-chart) var(--ease);
}
.hbars .val.out-r { margin-left: 6px; }
.hbars .val.out-l { transform: translate(calc(-100% - 6px), -50%); }
.hbars .val.in-r { transform: translate(calc(-100% - 7px), -50%); color: var(--ink-inverse); }
.hbars .val.in-l { margin-left: 7px; color: var(--ink-inverse); }
.hbars .total .val.in-r, .hbars .total .val.in-l { color: var(--ink-inverse); }
.hb-row.total > .lbl { font-weight: 600; color: var(--ink); }
.hb-row.total > .lbl, .hb-row.total > .track { box-shadow: inset 0 1px 0 var(--line-2); }
.hb-row.scale .lbl { min-height: 24px; }
.hb-row.scale .track { height: 24px; }
.hbars .tk { position: absolute; top: 6px; transform: translateX(-50%); font-family: var(--font-num); font-size: calc(12px * var(--type-scale)); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hbars .tk.first { transform: none; }
.hbars .tk.last { transform: translateX(-100%); }
/* coluna única pela largura do contêiner (classe posta pelo JS), não pela da janela */
.hbars.narrow { grid-template-columns: minmax(0, 1fr); }
.hbars.narrow .lbl { min-height: 0; padding: var(--space-2) 0 0; }
.hbars.narrow .hb-row.scale .lbl { display: none; }
.hbars .val.chip, .hbars .total .val.chip { padding: 0 var(--space-1); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.hbars .val.in-r.chip { transform: translate(calc(-100% - 4px), -50%); }
.hbars .val.in-l.chip { margin-left: 4px; }

/* ---- Barra empilhada --------------------------------------------------------- */
.stackbar-wrap { position: relative; padding: var(--space-2) 0; margin: calc(-1 * var(--space-2)) 0; border-radius: var(--radius-sm); }
.stackbar-wrap:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.stackbar { display: flex; gap: 2px; height: 12px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.stackbar > span { display: block; height: 100%; min-width: 2px; transition: flex-grow var(--dur-chart) var(--ease), opacity var(--dur); }
.stackbar.hovering > span:not(.on) { opacity: 0.4; }
.stackbar.tall { height: 16px; }
.tip.sb-tip { top: auto; bottom: calc(100% + 8px); transform: translateX(-50%); min-width: 160px; }
/* os nomes sob a barra, alinhados ao começo de cada segmento (só os que cabem) */
.sb-names { position: relative; height: 20px; margin-top: var(--space-1); }
.sb-name { position: absolute; top: 0; padding-left: 1px; font-size: calc(12px * var(--type-scale)); line-height: 20px; font-weight: 500; color: var(--ink-2); white-space: nowrap; border-left: 1px solid var(--line-2); transition: color var(--dur); }
.sb-name { padding-left: var(--space-1); }
.sb-name.on { color: var(--ink); font-weight: 600; }

/* ---- Régua de quantis (QuantileRule): P10 a P90, o trecho P25 a P75 em band, a mediana em ink ------------------------ */
.qrule { position: relative; padding: 44px 0 0; margin: var(--space-2) 0 var(--space-3); }
.qr-top { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 1px; white-space: nowrap; }
.qr-top { left: clamp(72px, var(--x, 50%), calc(100% - 72px)); }
.qr-name { font-size: calc(12px * var(--type-scale)); line-height: 1.3; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.qr-top .qr-name { color: var(--accent-ink); }
.qr-value { font-family: var(--font-num); font-size: calc(20px * var(--type-scale)); line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.qr-rail { position: relative; height: 8px; border-radius: var(--radius-round); background: var(--surface-3); }
.qr-iqr { position: absolute; top: 0; bottom: 0; background: var(--band); box-shadow: inset 0 0 0 1px var(--line-2); border-radius: var(--radius-round); }
.qr-tick { position: absolute; top: -3px; width: 2px; height: 14px; margin-left: -1px; border-radius: 1px; background: var(--line-field); }
.qr-end { position: absolute; top: -4px; width: 2px; height: 16px; margin-left: -1px; border-radius: 1px; background: var(--ink-2); }
.qr-median { position: absolute; top: -7px; width: 4px; height: 22px; margin-left: -2px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.qr-ends { display: flex; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-2); font-size: calc(13px * var(--type-scale)); color: var(--ink-2); }
.qr-ends .num { color: var(--ink); font-weight: 600; }
.qr-end-r { text-align: right; }
.qr-none { margin-top: var(--space-2); }

/* ---- Faixa de premissa ----------------------------------------------------- */
.rtrack { position: relative; height: 46px; margin-bottom: 6px; }
.rtrack .rail { position: absolute; left: 0; right: 0; top: var(--space-4); height: 6px; border-radius: var(--radius-md); background: var(--surface-3); }
.rtrack .zone-ok { position: absolute; top: var(--space-4); height: 6px; border-radius: var(--radius-md); background: var(--pos-soft); box-shadow: inset 0 0 0 1px var(--pos); }
.rtrack .now {
  position: absolute; top: 9px; width: 20px; height: 20px; margin-left: -10px; border-radius: var(--radius-round);
  background: var(--surface); border: 5px solid var(--ink); box-shadow: 0 0 0 3px var(--surface), var(--shadow-1);
}
.rtrack .th { position: absolute; top: 10px; width: 3px; height: 18px; margin-left: -1.5px; border-radius: 2px; background: var(--warn); box-shadow: 0 0 0 2px var(--surface); }
.rtrack .tick { position: absolute; top: var(--space-8); transform: translateX(-50%); font-family: var(--font-num); font-size: calc(12px * var(--type-scale)); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rtrack .tick.th-l { color: var(--ink); font-weight: 600; }
.rtrack .tick.start { transform: none; }
.rtrack .tick.end { transform: translateX(-100%); }

/* ---- Mapa de caminhos ------------------------------------------------------- */
.map .pt-ok { fill: var(--s1); opacity: 0.75; }
.map .pt-no { fill: none; stroke: var(--line-field); stroke-width: 1; }
.map .pt-hover { stroke: var(--ink); stroke-width: 2; fill: var(--surface); }
.map .frontier { fill: none; stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; }
.map .fr-pt { fill: var(--ink); }
.map .guides line { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.map .pill { fill: var(--surface); stroke: var(--line-2); }
.map .hl text { font-family: var(--font-sans); font-size: calc(12px * var(--type-scale)); font-weight: 600; fill: var(--ink); font-variant-numeric: normal; }
.map .hl-pt { stroke: var(--surface); stroke-width: 2; }
.map .custom circle { fill: var(--ink); stroke: var(--surface); stroke-width: 3; }
.map .custom .halo { fill: none; stroke: var(--ink); stroke-width: 1.5; opacity: 0.35; }
.map .custom-label {
  font-family: var(--font-sans); font-size: calc(12px * var(--type-scale)); font-weight: 600; fill: var(--ink); font-variant-numeric: normal;
  paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round;
}
.map .rent-line { stroke: var(--s-ref); stroke-width: 1.5; stroke-dasharray: 4 4; }
.map .rent-label {
  font-family: var(--font-sans); fill: var(--ink-2); font-weight: 600; font-size: calc(12px * var(--type-scale)); font-variant-numeric: normal;
  paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round;
}
.map.chart:focus-visible { outline-offset: 4px; }

/* ---- Colunas mensais -------------------------------------------------------- */
.colchart .col { transition: opacity var(--dur-fast); }
.colchart .col.pos { fill: var(--s1); }
.colchart .col.neg { fill: var(--div-neg); }
.colchart .col.dim { opacity: 0.4; }
.colchart .col-hover { fill: var(--ink); opacity: 0.045; }
.colchart .col-val { font-size: calc(12px * var(--type-scale)); font-weight: 600; fill: var(--ink-2); }
.colchart text.on { fill: var(--ink); font-weight: 600; }
.colchart .avg line { stroke: var(--s-ref); stroke-width: 1.25; stroke-dasharray: 4 4; }
.colchart .avg-chip { fill: var(--surface); stroke: var(--line-2); }
.colchart .avg text { font-family: var(--font-sans); fill: var(--ink-2); font-weight: 600; font-size: calc(12px * var(--type-scale)); font-variant-numeric: normal; }

/* ---- Minigráfico ------------------------------------------------------------ */
.spark .sp-line { fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.spark .sp-ref { fill: none; stroke: var(--s-ref); stroke-dasharray: 2 3; stroke-width: 1.25; }
.spark .sp-end { stroke: var(--surface); stroke-width: 1.5; }

/* Pinos numerados dos acontecimentos do plano (LineChart `pins`) e as cores de cada tom */
:root {
  --tone-relief: var(--ink); --tone-spend: var(--ink); --tone-life: var(--ink);
  --tone-gain: var(--ink); --tone-milestone: var(--ink); --tone-alert: var(--neg);
}
.chart .pins .pin { cursor: pointer; }
.chart .pins .pin-hit { fill: transparent; }
.chart .pins .pin .pin-b { fill: var(--c, var(--tone-milestone)); stroke: var(--surface); stroke-width: 2; transition: transform var(--dur-fast) var(--ease); }
.chart .pins .pin text { fill: var(--surface); font-family: var(--font-num); font-size: calc(12px * var(--type-scale)); font-weight: 600; pointer-events: none; }
.chart .pins .pin.on .pin-b, .chart .pins .pin:hover .pin-b { transform: scale(1.18); stroke-width: 2.5; }
.chart .pins .pin.pending .pin-b { fill: var(--surface); stroke: var(--c); stroke-dasharray: 3 2; }
.chart .pins .pin.pending text { fill: var(--c); }
.chart .pins .pin-guide { stroke: var(--c); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.6; }
/* a régua dos acontecimentos abaixo do eixo X (6.3): a linha, o risco que liga cada pino ao eixo e o ponto na curva do pino em foco */
.chart .pins .pin-rail { stroke: var(--line); stroke-width: 1; }
.chart .pins .pin-tick { stroke: var(--line-2); stroke-width: 1; }
.chart .pins .pin-at { fill: var(--c, var(--tone-milestone)); stroke: var(--surface); stroke-width: 2; }
:is(.pin, .pin-dot, .story-n).relief { --c: var(--tone-relief); }
:is(.pin, .pin-dot, .story-n).spend { --c: var(--tone-spend); }
:is(.pin, .pin-dot, .story-n).life { --c: var(--tone-life); }
:is(.pin, .pin-dot, .story-n).gain { --c: var(--tone-gain); }
:is(.pin, .pin-dot, .story-n).milestone { --c: var(--tone-milestone); }
:is(.pin, .pin-dot, .story-n).alert { --c: var(--tone-alert); }
.pin-dot {
  flex: none; min-width: 18px; height: 18px; padding: 0 var(--space-1); border-radius: var(--radius-round); background: var(--c, var(--ink));
  color: var(--surface); font-family: var(--font-num); font-size: calc(12px * var(--type-scale)); font-weight: 600; display: inline-grid; place-items: center;
}
.tip-event .tp-title { display: block; font-weight: 600; color: var(--ink); }

/* ---- Histograma: quantis marcados em ink, com rótulo ------------------------ */
.histo .qmark line { stroke: var(--ink); stroke-width: 1.5; }
.histo .qmark text { font-family: var(--font-sans); font-size: calc(12px * var(--type-scale)); font-weight: 600; fill: var(--ink); font-variant-numeric: normal; }

/* ---- O site público (public_site/charts.py): sem style=, tudo por classe ------ */
.chart .ln.s1, .chart .end-dot.s1, .chart .anno circle.s1 { stroke: var(--s1); }
.chart .ln.s2 { stroke: var(--s2); }
.chart .ln.s3 { stroke: var(--s3); }
.chart .ln.ref { stroke: var(--s-ref); stroke-dasharray: 5 5; }
.chart .ln.s1, .chart .ln.s2, .chart .ln.s3, .chart .ln.ref { stroke-width: 2px; }
.chart .end-dot.s1 { fill: var(--s1); }
.lg-line.s1, .lg-dash.s1 { --c: var(--s1); }
.lg-line.s2, .lg-dash.s2 { --c: var(--s2); }
.lg-line.s3, .lg-dash.s3 { --c: var(--s3); }
.lg-dash.ref { --c: var(--s-ref); }
.lg-bar.pos { --c: var(--div-pos); }
.lg-bar.neg { --c: var(--div-neg); }
.lg-bar.total { --c: var(--ink); }
.key.brand-cyan { color: var(--brand-cyan); }
.key.brand-blue { color: var(--brand-blue); }
.key.brand-violet { color: var(--brand-violet); }
/* o gráfico do servidor tem viewBox: a altura acompanha a largura; duas larguras alternadas por CSS. Só o desenho do
   corpo: o ícone do "Ver tabela" também é um svg e, esticado a 100%, saía do cartão e alargava a página no celular. */
.pub-viz .chart svg, .pub-cascade .viz-body svg { width: 100%; height: auto; }
.only-narrow { display: none; }
@media (max-width: 719px) { .only-wide { display: none; } .only-narrow { display: block; } }
/* a linha se desenha uma vez na entrada; a faixa aparece por trás (só no site) */
.chart .ln.draw { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: chart-draw var(--dur-draw) var(--ease) forwards; }
.chart .band.draw { animation: chart-fade var(--dur-draw) var(--ease) both; }
@keyframes chart-draw { to { stroke-dashoffset: 0; } }
@keyframes chart-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chart .ln.draw { animation: none; stroke-dashoffset: 0; } .chart .band.draw { animation: none; } }
/* a cascata de contribuições em SVG (a versão do app, em HTML, precisa de style=) */
.cascade { display: block; overflow: visible; }
.cascade .cgrid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.cascade .cgrid line.zero { stroke: var(--axis); }
.cascade .bar.pos { fill: var(--div-pos); }
.cascade .bar.neg { fill: var(--div-neg); }
.cascade .bar.total { fill: var(--ink); }
.cascade .conn { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 2 3; }
/* no celular o rótulo fica em cima da barra e as linhas da grade passam por baixo dele: o contorno na cor do cartão
   (o mesmo das anotações dos gráficos do app) mantém as letras inteiras */
.cascade text { font-family: var(--font-sans); font-size: calc(13px * var(--type-scale)); fill: var(--ink-2); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.cascade .val { font-family: var(--font-num); font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
/* a tabela do gráfico sem JavaScript: um <details> com o mesmo alternador */
.viz-details { margin-left: auto; }
.viz-details > summary { list-style: none; cursor: pointer; }
.viz-details > summary::-webkit-details-marker { display: none; }
.viz-details[open] > summary { color: var(--ink); }
.viz-details > .viz-table { margin-top: var(--space-3); }
.viz-foot:has(.viz-details[open]) { flex-wrap: wrap; }
.viz-foot > .viz-details[open] { flex: 1 0 100%; }
