/* Parity build, leg analytics: /mi-progreso (progress.html, _progress_chart.html), the review's item statistics
   (_review_item_stats.html), the result's pace (_result_pace.html) and /admin/preguntas (admin/items.html).
   Colours from style.css tokens only; every rule starts from .an- (tests/test_leg_css_scope.py). */

/* Page rhythm: sections with air, an in-page jump row that scrolls sideways on a phone */
.an-page h2 { scroll-margin-top: var(--s6); }
.an-plan { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); }
.an-plan p, .an-plan form { margin: 0; }
.an-jump { display: flex; gap: var(--s2); margin: 0 0 var(--s5); overflow-x: auto; scrollbar-width: none; }
.an-jump a { flex: none; display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 var(--s4); border: 1px solid var(--regla-2); border-radius: var(--pill); color: var(--grafito); font: 600 .9375rem/1 var(--sans); text-decoration: none; }
.an-jump a:hover, .an-jump a:focus-visible { border-color: var(--tinta); color: var(--tinta); }
.an-sec { margin: var(--s6) 0; scroll-margin-top: var(--s6); }
.an-sec > h2 { margin: 0 0 var(--s3); }
.an-lead { margin: 0 0 var(--s4); max-width: 44rem; color: var(--grafito); line-height: 1.5; font-variant-numeric: tabular-nums; }
.an-two { display: grid; gap: var(--s4); margin-top: var(--s4); }
.an-card { min-width: 0; margin: 0; }
.an-card .h-card { margin: 0 0 var(--s3); font-size: 1.125rem; line-height: 1.3; }
.an-wide { padding-bottom: var(--s3); }
.an-rule { margin: var(--s3) 0 0; max-width: 44rem; }
.an-h { margin: 0 0 var(--s3); font-size: 1.25rem; }
.an-big { margin: 0 0 var(--s2); font: 700 1.5rem/1.25 var(--sans); color: var(--titulo); font-variant-numeric: tabular-nums; }
.an-line { margin: 0 0 var(--s2); line-height: 1.5; color: var(--grafito); font-variant-numeric: tabular-nums; }

/* The estimate: the ring beside its words; the meter toward the threshold below it */
.an-est { margin: 0 0 var(--s6); scroll-margin-top: var(--s6); }
.an-est-body { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s6); }
.an-est-text { flex: 1 1 16rem; min-width: 0; }
.an-tag { display: inline-block; margin: 0 0 var(--s2); padding: .2rem .6rem; border-radius: var(--pill); background: var(--pizarra); color: var(--grafito); font: 600 var(--t-caption)/1.4 var(--sans); }
.an-meter { display: block; width: 100%; max-width: 28rem; height: .625rem; margin: var(--s2) 0 var(--s3); }
.an-meter-track { fill: var(--regla); }
.an-meter-fill { fill: var(--tinta-2); }
.an-cmp { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--regla); }

/* Week by week and the time histogram: drawn like round 1's .p-chart */
.an-trend, .an-hist { display: block; width: 100%; overflow: visible; }
.an-trend text, .an-hist text { font: 500 .6875rem/1 var(--sans); fill: var(--gris); font-variant-numeric: tabular-nums; }
.an-trend .c-grid, .an-hist .c-grid { stroke: var(--regla); stroke-width: 1; }
.an-trend .c-axis, .an-hist .c-axis { stroke: var(--regla-2); stroke-width: 1; }
.an-trend .c-y { text-anchor: end; }
.an-trend .c-x, .an-trend .c-val, .an-hist .c-x, .an-hist .c-val { text-anchor: middle; }
.an-trend .c-val, .an-hist .c-val { fill: var(--grafito); font-weight: 600; }
.an-trend .an-dim { fill: var(--gris); font-weight: 500; }
.an-trend .an-n { fill: var(--gris); }
.an-col:not(.is-thin) { fill: var(--tinta-2); }
.an-col.is-thin { stroke: var(--gris-2); stroke-width: 1; }
.an-hatch-bg { fill: var(--papel); }
.an-hatch-line { stroke: var(--gris-2); }
.an-key { display: flex; align-items: center; gap: var(--s2); margin: var(--s2) 0 0; }
.an-swatch { flex: none; width: .875rem; height: .875rem; border: 1px solid var(--gris-2); border-radius: 2px; background: repeating-linear-gradient(135deg, var(--papel) 0 3px, var(--gris-2) 3px 5px); }
.an-bin { fill: var(--tinta-2); }
.an-bin.is-slow { fill: var(--gris-2); }
.an-pace { stroke: var(--grafito); stroke-width: 2; stroke-dasharray: 5 4; }
.an-hist .an-pace-t { fill: var(--grafito); font-weight: 600; text-anchor: middle; }
.an-hist .an-unit { text-anchor: end; }

/* By area: small rings in a grid; skills and levels as heat cells */
.an-rings { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: var(--s4) var(--s3); }
.an-rings .ch-ring { width: 100%; }
.an-heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: var(--s2); }
.an-heat-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* The review: this question in numbers */
.an-item { margin: var(--s5) 0 0; padding: var(--s4) 0 0; border-top: 1px solid var(--regla); }
.an-item-t { margin: 0 0 var(--s3); font: 600 1.0625rem/1.35 var(--sans); color: var(--titulo); }
.an-item-facts { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6); margin: 0 0 var(--s3); }
.an-fact { margin: 0; }
.an-fact dt { font-size: var(--t-caption); color: var(--gris); }
.an-fact dd { margin: .1rem 0 0; color: var(--grafito); font-variant-numeric: tabular-nums; }
.an-fact b { font-weight: 600; color: var(--titulo); }
.an-vs { font-size: var(--t-caption); color: var(--gris); }
.an-vs.is-slow { color: var(--rojo); font-weight: 600; }
.an-item-sub { margin: var(--s3) 0 var(--s2); font-weight: 600; color: var(--grafito); }

/* The result: the set's pace */
.an-rpace { margin: var(--s5) 0; padding: var(--s4) var(--s5); border: 1px solid var(--regla); border-radius: var(--rad); background: var(--papel); }

/* /admin/preguntas */
.an-items { font-variant-numeric: tabular-nums; }
.an-items .an-num { text-align: end; white-space: nowrap; }
.an-items .an-shares { white-space: nowrap; }
.an-items .an-shares span { display: inline-block; margin-right: var(--s2); }
.an-items .an-key { font-weight: 700; color: var(--titulo); }
.an-items .an-over { color: var(--rojo); font-weight: 700; }
.an-items .an-flag { display: inline-block; margin: 0 var(--s1) var(--s1) 0; padding: .1rem .45rem; border-radius: var(--pill); background: var(--rojo-suave); color: var(--rojo); font-size: var(--t-caption); font-weight: 600; }
.an-items .an-thin-tag { font-size: var(--t-caption); color: var(--gris); }
.an-items .an-thin td { color: var(--gris); }
.an-admin .an-sorted { font-weight: 700; }

@media (min-width: 48rem) {
  .an-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 40rem) {
  .an-trend .c-x.is-odd, .an-hist .c-x.is-odd { display: none; }
  .an-rings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-est-body { justify-content: center; text-align: center; }
}
.an-est-ring { display: block; flex: none; width: 9.5rem; height: 9.5rem; }
.an-est-track { stroke: var(--regla); }
.an-est-arc { stroke: var(--tinta-2); }
.an-est-num { fill: var(--titulo); font: 700 2.5rem var(--sans); font-variant-numeric: tabular-nums; }
.an-est-of { fill: var(--gris); font: 500 .8125rem var(--sans); }
.an-rings .an-cap-line { display: block; white-space: nowrap; }
.an-rule.caption { color: var(--gris); }
.an-card .ch-ref-key { font-size: 1rem; }
.an-page .small-link { font-size: 1rem; }
.an-first { margin-top: var(--s5); }
.an-first > .h-card { margin: 0 0 var(--s2); }
.an-first > p { margin: 0 0 var(--s4); }
.an-first > p:last-child { margin-bottom: 0; }
