/* pyps-analyze.css — PYPs > Analyze tab (subject analysis: bar / line / mixed charts per subject).
 * Colours/fonts come from tokens.css (--vx-*). Mango California heading = same as .py-h / .pr-title. Layout flips on WIDTH (<=1024px), never orientation. */

/* The Analyze sidebar subject list uses the shared sidebar rows (.dk-it in the dock, .it in the drawer) - no page-specific sidebar styles. */

/* ---- page ---- */
.an { --an-soft: color-mix(in srgb, var(--vx-red) 20%, transparent); --an-soft-hot: color-mix(in srgb, var(--vx-red) 34%, transparent); width: 100%; margin: 0; padding: 0 32px; box-sizing: border-box; text-align: left; }
.an-head { display: flex; align-items: center; justify-content: space-between; gap: 20px 32px; margin: 16px 0 26px; }
.an-hl { min-width: 0; flex: 1 1 auto; }
.an-h { margin: 0; font-family: 'Mango California', 'Poppins', serif; font-weight: 400; font-size: 52px; line-height: 1.1; color: var(--vx-text); text-align: left; }
.an-d { margin: 10px 0 0; max-width: 640px; font-size: 15px; line-height: 1.55; color: #8a8a8a; }
.an-pat { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-left: auto; }
.an-chk { height: 28px; display: inline-flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; font-family: inherit; font-size: 15px; font-weight: 500; color: var(--vx-text); cursor: pointer; white-space: nowrap; }
.an-chk .pf-cb { transition: background .2s ease, border-color .2s ease; }
.an-chk em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--vx-muted, #8f8f8f); }
.an-chk:focus-visible, .an-tab:focus-visible { outline: 2px solid var(--vx-red); outline-offset: 2px; }

/* chart cards */
.an-card { border: 1px solid var(--vx-border); border-radius: 16px; background: var(--vx-bg); padding: 22px 28px 20px; }
.an-ch { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px 20px; }
.an-ct { font-size: 18px; line-height: 26px; font-weight: 500; color: var(--vx-title, #3f3f3f); }
.an-cs { margin-top: 2px; font-size: 13.5px; line-height: 20px; color: var(--vx-muted, #8f8f8f); }
.an-plot { position: relative; width: 100%; margin-top: 14px; }
.an-main .an-plot { height: 420px; }
.an-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.an-svg text { font-family: inherit; }
.an-gl { stroke: var(--vx-divider, #dcdcdc); stroke-width: 1; stroke-dasharray: 3 5; opacity: .75; }
.an-ax { stroke: var(--vx-border-btn, #cecece); stroke-width: 1; }
.an-yl { font-size: 11.5px; fill: var(--vx-muted, #8f8f8f); text-anchor: end; }
.an-xl { font-size: 12.5px; fill: var(--vx-muted, #8f8f8f); text-anchor: middle; }
.an-vl { font-size: 12.5px; font-weight: 600; fill: var(--vx-text); text-anchor: middle; }
.an-vl.z { fill: var(--vx-muted-2, #aeaeae); font-weight: 500; }
.an-sm .an-xl, .an-sm .an-yl { font-size: 11px; } .an-sm .an-vl { font-size: 11.5px; }
.an-bar { fill: var(--vx-red); transition: fill .2s ease; }
.an-mixed .an-bar { fill: var(--an-soft); }
.an-band.hot .an-bar { fill: var(--vx-red-dk); }
.an-mixed .an-band.hot .an-bar { fill: var(--an-soft-hot); }
.an-ln { fill: none; stroke: var(--vx-red); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.an-mixed .an-ln { stroke: var(--vx-red-dk); }
.an-ar { fill: url(#anAr); stroke: none; }
.an-pt { fill: var(--vx-bg); stroke: var(--vx-red); stroke-width: 2.5; transition: r .15s ease; }
.an-mixed .an-pt { stroke: var(--vx-red-dk); }
.an-band.hot .an-pt { stroke-width: 3; }
.an-hit { fill: transparent; cursor: pointer; }
.an-tip { position: absolute; z-index: 3; pointer-events: none; min-width: 120px; max-width: 240px; padding: 9px 12px; border-radius: 10px; background: #1d1d1f; color: #fff; font-size: 12.5px; line-height: 1.45; box-shadow: 0 8px 24px rgba(0,0,0,.18); opacity: 0; transform: translate(-50%, -100%) translateY(-6px); transition: opacity .12s ease; }
.an-tip.on { opacity: 1; }
.an-tip b { display: block; font-size: 13px; font-weight: 600; }
.an-tip span { display: flex; justify-content: space-between; gap: 14px; color: #d6d6d8; }
.an-tip span i { font-style: normal; color: #fff; }
.an-tip .an-tn { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255,255,255,.16); }

/* tappable charts: tapping the per-year chart or a topic card opens the Filter tab on those questions */
.an-open { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.an-open:focus-visible { outline: 2px solid var(--vx-red); outline-offset: 3px; border-radius: 16px; }
.an-main .an-plot.an-open:focus-visible { outline-offset: 2px; border-radius: 10px; }
.an-tc.an-open { transition: border-color .2s ease, box-shadow .2s ease; }
@media (hover: hover) { .an-tc.an-open:hover { border-color: var(--vx-border-btn, #cecece); box-shadow: 0 2px 14px rgba(0,0,0,.05); } }
.an-tc.an-open:active { border-color: var(--vx-red); }
.an-tn2 svg, .an-view svg { flex: none; margin-left: 4px; }
.an-tn2 { gap: 0; }
.an-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.an-view { display: inline-flex; align-items: center; height: 32px; padding: 0 12px 0 14px; border-radius: 999px; background: var(--vx-sel, #f1f1f1); color: var(--vx-text); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: background .2s ease; }
@media (hover: hover) { .an-view:hover { background: var(--vx-hover, #ececec); } }
.an-view:focus-visible { outline: 2px solid var(--vx-red); outline-offset: 2px; }

/* motion (first paint, mode switch, pattern change) — .an-go on the svg */
@keyframes anGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes anDraw { to { stroke-dashoffset: 0; } }
@keyframes anFade { from { opacity: 0; } to { opacity: 1; } }
.an-go .an-bar { transform-box: fill-box; transform-origin: 50% 100%; animation: anGrow .6s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
.an-go .an-ln { stroke-dasharray: 1; stroke-dashoffset: 1; animation: anDraw .9s cubic-bezier(.45,.05,.25,1) .1s forwards; }
.an-go .an-ar { animation: anFade .8s ease .35s both; }
.an-go .an-pt, .an-go .an-vl { animation: anFade .4s ease both; animation-delay: calc(var(--i, 0) * 45ms + .25s); }

/* the bar/line/mixed switch: the site-wide segmented toggle (grey track, white sliding pill) */
.an-toggle { --an-px: 0px; --an-pw: 0px; position: relative; flex: none; display: flex; width: max-content; max-width: 100%; padding: 4px; gap: 2px; box-sizing: border-box; background: var(--vx-seg-track, #ebebee); box-shadow: inset 0 0 0 1px var(--vx-seg-line, rgba(0,0,0,.04)), inset 0 1px 2px rgba(0,0,0,.05); border-radius: 999px; }
.an-pill { position: absolute; top: 4px; left: 0; height: 34px; width: var(--an-pw); transform: translate3d(var(--an-px), 0, 0); background: var(--vx-seg-thumb, #fff); box-shadow: var(--vx-seg-sh); border-radius: 999px; pointer-events: none; will-change: transform, width; transition: transform .34s var(--vx-seg-ease), width .34s var(--vx-seg-ease); }
.an-toggle.is-pre .an-pill { transition: none; }
.an-tab { position: relative; z-index: 1; padding: 0 18px; height: 34px; display: inline-flex; align-items: center; border-radius: 999px; font-family: inherit; font-size: 13.5px; font-weight: 500; color: var(--vx-seg-tx, #6b6b70); background: transparent; cursor: pointer; transition: color .2s ease; white-space: nowrap; }
@media (hover:hover) {
.an-tab:hover { color: var(--vx-seg-tx-on, #1f1f1f); } }
.an-tab[aria-selected="true"] { color: var(--vx-seg-tx-on, #1f1f1f); }

/* topic section */
.an-sec { margin: 38px 0 14px; }
.an-sh { font-size: 20px; line-height: 28px; font-weight: 500; color: var(--vx-title, #3f3f3f); }
.an-ss { margin-top: 2px; font-size: 14px; line-height: 21px; color: var(--vx-muted, #8f8f8f); }
.an-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.an-tc { padding: 20px 22px 14px; min-width: 0; }
.an-tc .an-ct { font-size: 17px; }
.an-tc .an-plot { height: 230px; margin-top: 10px; }
.an-tn2 { flex: none; display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 999px; background: var(--vx-sel, #f1f1f1); color: var(--vx-pill-text, #5a5a5a); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.an-empty { padding: 56px 20px; text-align: center; font-size: 15px; line-height: 1.6; color: var(--vx-muted, #8f8f8f); border: 1px dashed var(--vx-border-btn); border-radius: 16px; }
.an-empty b { display: block; margin-bottom: 4px; font-size: 17px; font-weight: 500; color: var(--vx-text); }

@media (prefers-reduced-motion: reduce) { .an-go * { animation: none !important; } .an-pill, .an-tab, .an-bar, .an-chk { transition: none !important; } }
@media (max-width: 1024px) {
  .an { padding: 0; }
  .an-head { flex-direction: column; align-items: stretch; margin: 6px 12px 20px; gap: 16px; }
  .an-h { font-size: 40px; } .an-d { font-size: 14.5px; }
  .an-pat { flex-direction: row; flex-wrap: wrap; gap: 8px 22px; margin-left: 0; } .an-chk { height: 36px; font-size: 14px; }
  .an-card { padding: 16px 14px 12px; border-radius: 12px; margin: 0 6px; }
  .an-ch { flex-direction: column; gap: 12px; } .an-toggle { width: 100%; } .an-tab { flex: 1 1 0; justify-content: center; padding: 0 6px; }
  .an-main .an-plot { height: 300px; }
  .an-sec { margin: 28px 12px 12px; }
  .an-grid { grid-template-columns: 1fr; gap: 10px; padding: 0 6px; }
  .an-tc .an-plot { height: 210px; }
  .an-empty { margin: 0 12px; }
}
@media (max-width: 1024px) { .an-grid .an-card { margin: 0; } .an-main { margin: 0 6px; } .an-main.an-card { margin: 0 6px; } }

/* phones / compact: slimmer toggle */
@media (max-width: 1024px) {
  .an-toggle { padding: 3px; }
  .an-pill { top: 3px; height: 28px; }
  .an-tab { height: 28px; }
}
