/* apxda: Data Studio, chart and calculator answers, quizzes and practice tests (PRSXA + Pearl AI). Prefix apxda-.
   Loaded after every other pack. Keeps the current look; uses the existing --pxs-* / --app-* tokens. */

/* ---------- Data Studio ---------- */
@media (prefers-reduced-motion:reduce){.pds-ov,.pds-ov *,.apxda-fsov,.apxda-fsov *{animation:none!important;transition:none!important}} /* TOOLS-22 */
.pds-ov .pds-h,.pds-ov .pds-tbl .pds-rn{color:var(--pxs-dim)} /* light: faint grey was under 4.5:1 */
.apxda-sort{display:inline-flex;vertical-align:-2px;margin-left:2px;color:var(--pxs-acc)}
.apxda-sort svg{width:13px;height:13px}
.pds-tbl thead th[data-c]:focus-visible{outline:2px solid var(--pxs-acc);outline-offset:-2px}
.pds-pane:focus{outline:0}
.pds-tab:focus-visible,.apxda-colbtn:focus-visible{outline:2px solid var(--pxs-acc);outline-offset:-2px;border-radius:8px}
.apxda-help{padding:0;width:36px}
.apxda-help svg{width:17px;height:17px}
@media (pointer:coarse){.apxda-help{display:none}}
/* tab strip on narrow screens: a fade shows there is more (TOOLS-16) */
.apxda-colbtn{display:none;white-space:nowrap;flex-shrink:0;align-items:center;gap:6px;border:0;background:none;font:inherit;font-size:13px;font-weight:600;color:var(--pxs-dim);padding:8px 12px 10px;border-bottom:2px solid transparent;cursor:pointer;margin-left:auto}
.apxda-colbtn svg{width:15px;height:15px}
.pds-ov:not(.apxda-has) .apxda-colbtn{opacity:.45;cursor:not-allowed}
.apxda-colx{display:none}
.apxda-scrim{position:absolute;inset:0;z-index:7;background:rgba(5,10,24,.38)}
.apxda-scrim[hidden]{display:none}
@media (max-width:900px){
  .pds-tabs{scroll-snap-type:x proximity;-webkit-mask-image:linear-gradient(90deg,#000 82%,transparent);mask-image:linear-gradient(90deg,#000 82%,transparent);scrollbar-width:none;padding-right:28px}
  .pds-tabs::-webkit-scrollbar{display:none}
  .pds-tab,.apxda-colbtn{scroll-snap-align:start}
  .apxda-colbtn{display:inline-flex;margin-left:0}
  .pds.apxda-cols-open .pds-cols{display:block;position:absolute;left:0;right:0;bottom:0;top:auto;max-height:72%;width:auto;z-index:8;border-right:0;border-top:1px solid var(--pxs-line);border-radius:18px 18px 0 0;padding:10px 10px calc(14px + env(safe-area-inset-bottom));box-shadow:0 -20px 60px rgba(5,10,24,.3);background:var(--pxs-panel)}
  .pds.apxda-cols-open .apxda-colx{display:flex;position:absolute;right:10px;top:auto;z-index:9;width:44px;height:44px;border-radius:12px;border:0;background:var(--pxs-hover);color:var(--pxs-text);align-items:center;justify-content:center;cursor:pointer}
  .pds.apxda-cols-open .pds-body{position:static}
  .pds.apxda-cols-open .pds-cols>.pds-h{padding:16px 8px 14px}
  .pds-col summary{min-height:44px}
  .pds-acts{flex-wrap:nowrap;gap:6px;padding-right:0}
  .pds-acts .pxs-btn{flex:1 1 auto;padding:0 9px;white-space:nowrap;min-width:0}
  .pds-acts .pxs-btn svg{flex:none}
  .pds-tt{padding-right:44px}
}
@media (pointer:coarse){ /* TOOLS-13: 40px+ targets */
  .pds-top .pxs-btn{min-height:42px}
  .pds-top .pxs-x{width:44px;height:44px}
  .pds-tab,.apxda-colbtn{min-height:44px}
  .pds-chip button{width:36px;height:36px}
  .pds-form .pxs-sel,.pds-fform .pxs-sel,.pds-fform .pxs-in,.pds-bar .pxs-btn{min-height:42px}
  .pds-tbl thead th{height:42px}
}
/* empty state extras */
.apxda-extra{display:flex;flex-direction:column;align-items:center;gap:10px;margin-top:2px}
.apxda-again-w:empty{display:none}
.apxda-again-w .pxs-btn small{font-weight:500;color:var(--pxs-dim);margin-left:4px}
.apxda-again-w .pxs-btn b{font-weight:650}
.apxda-kbdhint{font-size:12px;color:var(--pxs-dim)}
@media (pointer:coarse){.apxda-kbdhint{display:none}}
.pds-empty.apxda-err b{color:var(--pxs-bad)}
.apxda-erri{display:flex;width:46px;height:46px;border-radius:14px;align-items:center;justify-content:center;background:rgba(208,69,58,.1);color:var(--pxs-bad)}
.apxda-inerr{display:flex;align-items:flex-start;gap:6px;font-size:12.5px;line-height:1.45;color:var(--pxs-bad);font-weight:600}
.apxda-inerr svg{flex:none;margin-top:1px}
.apxda-inerr[hidden]{display:none}
/* sheets: Ask and shortcuts */
.apxda-sheet{position:absolute;z-index:9;top:64px;right:14px;width:min(440px,calc(100% - 28px));max-height:calc(100% - 80px);overflow:auto;padding:16px;border-radius:16px;background:var(--pxs-panel);color:var(--pxs-text);border:1px solid var(--pxs-line-hi);box-shadow:0 24px 70px rgba(5,10,24,.32);display:flex;flex-direction:column;gap:10px;animation:apxdaIn .18s ease}
.apxda-sheet[hidden]{display:none}
.apxda-sheet[data-k="help"]{width:min(400px,calc(100% - 28px))}
@keyframes apxdaIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.apxda-sh-h{display:flex;align-items:center;gap:8px}
.apxda-sh-h b{flex:1;display:flex;align-items:center;gap:8px;font-size:15px;font-weight:650}
.apxda-sh-h b svg{color:var(--pxs-acc)}
.apxda-shx{width:36px;height:36px;border-radius:10px;border:0;background:none;color:var(--pxs-dim);display:flex;align-items:center;justify-content:center;cursor:pointer;flex:none}
.apxda-shx:hover{background:var(--pxs-hover);color:var(--pxs-text)}
.apxda-sh-d{margin:0;font-size:12.5px;line-height:1.5;color:var(--pxs-dim)}
.apxda-chips{display:flex;flex-wrap:wrap;gap:6px}
.apxda-chip{border:1px solid var(--pxs-line-hi);background:none;color:var(--pxs-text);border-radius:999px;padding:6px 11px;font:inherit;font-size:12.5px;cursor:pointer;text-align:left;line-height:1.35}
.apxda-chip:hover,.apxda-chip:focus-visible{border-color:var(--pxs-acc);color:var(--pxs-acc);outline:0;background:var(--pxs-acc-soft)}
.apxda-lab{font-size:12.5px;font-weight:600;color:var(--pxs-dim)}
.apxda-q{width:100%;min-height:78px;resize:vertical;font:inherit;font-size:14px;line-height:1.5;padding:9px 11px}
.apxda-q.has-err{border-color:var(--pxs-bad)!important;box-shadow:0 0 0 3px rgba(208,69,58,.14)}
.apxda-keepn{display:flex;align-items:center;gap:6px;margin:0;font-size:12.5px;color:var(--pxs-dim)}
.apxda-keepn svg{color:var(--pxs-good)}
.apxda-sh-a{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.apxda-keys{display:grid;grid-template-columns:auto 1fr;gap:8px 14px;margin:0;font-size:13px;align-items:center}
.apxda-keys dt{white-space:nowrap;color:var(--pxs-dim);font-size:12px}
.apxda-keys dd{margin:0}
.apxda-keys kbd,.apxda-fsov kbd{display:inline-block;min-width:22px;padding:2px 6px;border-radius:6px;border:1px solid var(--pxs-line-hi);border-bottom-width:2px;font:600 11.5px/1.4 var(--pxs-mono);color:var(--pxs-text);text-align:center;background:var(--pxs-side)}
.apxda-tips{margin:0;padding-left:18px;font-size:12.5px;line-height:1.55;color:var(--pxs-dim)}
@media (max-width:900px){
  .apxda-sheet{top:auto;bottom:0;left:0;right:0;width:auto!important;max-height:86%;border-radius:18px 18px 0 0;padding:16px 16px calc(16px + env(safe-area-inset-bottom));animation-name:apxdaUp}
  .apxda-sh-a .pxs-btn{min-height:44px;flex:1}
  .apxda-sh-a .pxs-btn.ghost{flex:0 0 auto}
  .apxda-shx{width:44px;height:44px}
  .apxda-chip{min-height:40px}
}
@keyframes apxdaUp{from{transform:translateY(24px);opacity:0}to{transform:none;opacity:1}}
/* Data Studio chart: Data Studio's own controls pick the type, so the card's type switch and code button are hidden there */
.pds-chart .apxda-dschart{margin:0}
.pds-chart .apxda-dschart .pvz-seg,.pds-chart .apxda-dschart .pvz-src{display:none}

/* ---------- chart and calculator answers ---------- */
.pvz-tt small,.pvz-note,.pvz-wait,.pvz-mm,.pvz-in small,.pvz-box i{color:var(--pxs-dim,#475467)} /* CHAT-21: notes at 4.5:1+ */
.pvz-b{color:var(--pxs-dim,#475467)}
.pvz-seg button{color:var(--pxs-dim,#475467)}
html[data-theme="dark"] .pvz-seg button[aria-pressed="true"],html[data-theme="dark"] .pvz-b:hover,html[data-theme="dark"] .pvz-b:focus-visible,html[data-theme="dark"] .pvz-b[aria-pressed="true"]{color:#8fb0ff}
.pvz-body:focus{outline:0}
.pvz-body:focus-visible{outline:2px solid var(--pxs-acc,#3161E8);outline-offset:-2px;border-radius:10px}
.pvz-lg:focus-visible,.pvz-seg button:focus-visible{outline:2px solid var(--pxs-acc,#3161E8);outline-offset:1px}
@media (max-width:700px){ /* CHAT-12: PNG / CSV stay labelled on phones; full screen and table stay icons with names for screen readers */
  .pvz-b[data-pvz-a="png"] span,.pvz-b[data-pvz-a="csv"] span{display:inline}
}
@media (pointer:coarse){
  .pvz-b{height:40px;min-width:40px;justify-content:center}
  .pvz-seg button{width:40px;height:38px}
  .pvz-lg{height:36px}
  .pvz-box{height:40px}
  .pvz-in select{height:42px}
}
/* full screen chart */
.apxda-fsov{position:fixed;inset:0;z-index:2147482500;display:flex;flex-direction:column;background:var(--app-bg,#fff);color:var(--app-text,#101828);opacity:0;transition:opacity .16s}
.apxda-fsov.is-in{opacity:1}
.apxda-fsbar{display:flex;align-items:center;gap:10px;padding:10px 14px;padding-top:calc(10px + env(safe-area-inset-top));border-bottom:1px solid var(--pxs-line,#e4e7ec)}
.apxda-fsbar b{flex:1;min-width:0;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.apxda-fsx{display:inline-flex;align-items:center;gap:6px;height:40px;padding:0 14px;border-radius:10px;border:1px solid var(--pxs-line-hi,#d0d5dd);background:none;color:inherit;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.apxda-fsx:hover,.apxda-fsx:focus-visible{border-color:var(--pxs-acc,#3161E8);color:var(--pxs-acc,#3161E8);outline:0}
.apxda-fsin{flex:1;min-height:0;overflow:auto;padding:18px;display:flex;justify-content:center;align-items:flex-start}
.apxda-fsin .pvz.apxda-full{width:min(1200px,100%);margin:0}
.pvz.apxda-full .pvz-svg{max-height:calc(100vh - 230px)}
.pvz.apxda-full .apxda-fsb{display:none}
.apxda-ph{border:1px dashed var(--pxs-line,#e4e7ec);border-radius:16px;margin:12px 0}
@media (max-width:700px){.apxda-fsx span{display:none}.apxda-fsx{width:44px;height:44px;padding:0;justify-content:center}.apxda-fsin{padding:10px}.apxda-fsb span{display:none}}

/* ---------- quizzes ---------- */
.apxda-rev{border:1px solid var(--app-border,#e5e7eb);border-radius:12px;margin-top:2px}
.apxda-rev summary{display:flex;align-items:center;gap:7px;padding:10px 12px;cursor:pointer;font-weight:600;font-size:13.5px;color:var(--pqz-ac);list-style:none;border-radius:12px}
.apxda-rev summary::-webkit-details-marker{display:none}
.apxda-rev summary:focus-visible{outline:2px solid var(--pqz-ac);outline-offset:-2px}
.apxda-rev ol{margin:0;padding:0 12px 12px 32px;display:grid;gap:10px}
.apxda-rev li{font-size:13.5px;line-height:1.5;padding-left:2px}
.apxda-rq{font-weight:600}
.apxda-pill{display:inline-flex;align-items:center;gap:3px;margin-right:6px;padding:1px 7px;border-radius:999px;font-size:11.5px;font-weight:700;vertical-align:1px}
.apxda-rev .is-right .apxda-pill{background:var(--pqz-ok-bg);color:var(--pqz-ok)}
.apxda-rev .is-wrong .apxda-pill{background:var(--pqz-no-bg);color:var(--pqz-no)}
.apxda-ra{color:var(--app-text-dim,#6b7280)}
.apxda-rok{color:var(--pqz-ok);font-weight:600}
.apxda-rw{margin-top:3px;padding:7px 10px;border-radius:9px;background:var(--pqz-soft)}
.pqz .pqz-tt small,.pqz-prog,.pqz-score p,.pqz-big span{color:var(--app-text-dim,#5b6474)}
@media (pointer:coarse){
  .pqz-b,.pqz-seg button{min-height:44px}
  .pqz-ico,.pqz-acts .pqz-b{min-width:44px}
  .pqz-opt{min-height:48px}
  .pqz-link{min-height:40px}
}
@media (max-width:640px){.pqz-acts .apxda-qrst span{display:none}.pqz-acts .apxda-qrst{width:34px;padding:0;justify-content:center}}

/* ---------- practice tests ---------- */
@media (pointer:coarse){
  .ptst-kbd{display:none} /* CHAT-18: no key instructions on touch screens */
  .ptst-b,.ptst-tab{min-height:44px}
  .ptst-ico,.ptst-acts .ptst-b,.ptst-sub{min-width:44px}
  .ptst-g{height:44px}
  .ptst-grid{grid-template-columns:repeat(auto-fill,minmax(44px,1fr))}
  .ptst-opt{min-height:48px}
  .ptst-seg button{min-height:40px}
}
.ptst-clock.is-paused{color:var(--app-text-dim,#6b7280);border-style:dashed}
.apxda-pz[hidden]{display:none}
.apxda-pz[aria-pressed="true"]{border-color:var(--ptst-ac);color:var(--ptst-ac);background:var(--ptst-soft)}
.ptst.apxda-paused .ptst-body{display:none}
.ptst.apxda-paused .ptst-sub{display:none}
.apxda-pzv{display:flex;flex-direction:column;align-items:center;gap:8px;padding:28px 18px 26px;text-align:center}
.apxda-pzv[hidden]{display:none}
.apxda-pzv b{font-size:16px}
.apxda-pzv p{margin:0;max-width:44ch;font-size:13.5px;line-height:1.5;color:var(--app-text-dim,#6b7280)}
.apxda-pzi{display:flex;width:48px;height:48px;border-radius:14px;align-items:center;justify-content:center;background:var(--ptst-soft);color:var(--ptst-ac)}
.apxda-pzv .ptst-b{margin-top:6px}
.ptst-tt small,.ptst-fact small,.ptst-qh,.ptst-legend,.ptst-kbd,.ptst-score p{color:var(--app-text-dim,#5b6474)}

/* ---------- contrast and touch sizes found by the apxda probe ---------- */
.pqz-pri,.ptst-pri{background:#2b66f5;border-color:#2b66f5} /* white text 4.9:1 (was 4.49:1); hover stays #1f57e6 */
html:not([data-theme="dark"]) .pqz-seg button.is-on,html:not([data-theme="dark"]) .pqz-link,html:not([data-theme="dark"]) .ptst-tab.is-on,html:not([data-theme="dark"]) .ptst-link{color:#1f57e6}
@media (pointer:coarse){
  .pds-bar .pxs-search input,.pds-bar .pxs-search{min-height:44px}
  .pds-ov .pxs-sw{position:relative}
  .pds-ov .pxs-sw::after{content:"";position:absolute;inset:-10px -4px}
  .pds-types .pxs-sel{min-height:42px}
  .pvz-seg button{height:40px}
  .pvz-lg{height:40px}
  .pvz-box input{height:100%}
  .pvz-range{height:32px}
  .ptst-navt{min-height:44px}
}
