
/* Chapter trends UI — scoped to the student dashboard, 99 Percentiler */
#workspace-main:has(.cp-workspace){padding:35px 39px 48px}
.cp-workspace{--cp-orange:#ff9256;--cp-teal:#51ccbf;--cp-bg:#080b0f;--cp-ink:#f4f5f8;--cp-muted:#a1a9b5;--cp-stroke:#292e37;max-width:1390px;margin:0 auto;color:var(--cp-ink);font-family:Inter,system-ui,sans-serif;font-size:13px}
.cp-workspace *{box-sizing:border-box}
.cp-header{display:flex;justify-content:space-between;align-items:flex-end;gap:22px;margin-bottom:20px}
.cp-kicker{font-size:10px;letter-spacing:.17em;font-weight:790;color:#b7bcc6;margin-bottom:12px}
.cp-header h1{margin:0;color:#f8f9fb;font-size:clamp(30px,2.5vw,38px);font-weight:760;letter-spacing:-.05em;line-height:1.15}
.cp-header p{margin:10px 0 0;color:#aab1bc;font-size:13px;line-height:1.5}
.cp-start{display:flex;align-items:center;justify-content:space-between;gap:28px;min-height:45px;padding:0 17px 0 19px;background:linear-gradient(105deg,#34383e 0%,#15191f 42%,#090c10 100%);border:1px solid #515761;border-radius:11px;text-decoration:none;color:#f9fafb;font-size:12px;font-weight:720;white-space:nowrap;box-shadow:inset 0 1px #ffffff22,0 8px 18px #0005;transition:transform .16s,border-color .16s}
.cp-start:hover{color:#fff;border-color:#979da7;transform:translateY(-1px)}
.cp-start svg,.cp-analytics-link svg,.cp-foot a svg,.cp-empty a svg{width:17px;height:17px;color:#ffab79}
.cp-context{display:flex;align-items:center;gap:18px;margin-bottom:21px;color:#a3acbb;font-size:12px;letter-spacing:0}
.cp-context b{color:#e5e9ef;font-weight:800;font-variant-numeric:tabular-nums}
.cp-sep{height:13px;width:1px;background:#393f4b}
.cp-global-note{border:1px solid #51432f;background:#21180b;color:#f4be85;padding:9px 14px;border-radius:9px;margin:0 0 15px;font-size:12px}
.cp-card{background:linear-gradient(145deg,#101419 0%,#0a0d12 60%,#080a0e 100%);border:1px solid #303640;border-radius:18px;padding:25px 28px 23px;box-shadow:0 15px 38px #0005}
.cp-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:22px}
.cp-kicker.cp-soft{font-size:9px;color:#929ba9;margin-bottom:11px}
.cp-card-top h2{color:#f5f7f9;font-size:19px;font-weight:745;line-height:1.25;letter-spacing:-.034em;margin:0}
.cp-card-top p{font-size:12px;color:#a6afbb;margin:7px 0 0;line-height:1.5}
.cp-legend{display:flex;align-items:center;gap:17px;color:#aeb6c1;font-size:11px;flex-shrink:0;padding-top:15px}
.cp-legend span{display:flex;align-items:center;gap:7px}
.cp-legend i{display:inline-block;width:17px;height:3px;border-radius:8px}
.cp-score-key{background:var(--cp-orange);box-shadow:0 0 12px #ff925633}
.cp-accuracy-key{background:var(--cp-teal)}
.cp-controls{display:grid;grid-template-columns:minmax(110px,.6fr) minmax(185px,1.5fr) auto;gap:13px;align-items:end;margin:24px 0 0}
.cp-field,.cp-period-box{display:flex;flex-direction:column;gap:8px;min-width:0}
.cp-field>span,.cp-period-box>span{font-size:10px;font-weight:760;color:#98a4b1;letter-spacing:.07em;text-transform:uppercase}
.cp-field select{appearance:none;width:100%;height:43px;min-width:0;border-radius:10px;padding:0 33px 0 13px;border:1px solid #383f4b;background-color:#151b23;color:#f5f6f9;font-family:inherit;font-size:12px;font-weight:670;outline:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23afb8c3' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-position:right 11px center;background-repeat:no-repeat}
.cp-field select:disabled{opacity:.6}
.cp-field select:focus-visible{border-color:#ff9256;box-shadow:0 0 0 3px #ff925622}
.cp-periods{display:flex;gap:3px;padding:4px;border:1px solid #333b46;border-radius:10px;background:#0c1015;min-height:43px;align-items:center}
.cp-periods button{font:700 11px Inter,system-ui,sans-serif;white-space:nowrap;border:0;cursor:pointer;background:transparent;color:#a5adba;border-radius:7px;padding:8px 11px;min-height:32px}
.cp-periods button:hover{color:#f4f4f6}
.cp-periods button[aria-pressed=true]{background:#343b44;color:#f5f7fa;box-shadow:inset 0 1px #ffffff15}
.cp-custom{display:flex;align-items:center;justify-content:flex-end;gap:14px;margin-top:14px;color:#c6cbd3;font-size:11px}
.cp-custom label{white-space:nowrap}.cp-custom strong{color:var(--cp-orange)}
.cp-custom input[type=range]{accent-color:#ff9256;width:190px;cursor:pointer}
.cp-chart-subheading{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;margin:25px 0 7px}
.cp-chart-subheading>div{display:flex;flex-direction:column;gap:5px}
.cp-chart-subheading strong{font-size:14px;color:#f2f3f5;font-weight:740}
.cp-chart-subheading span{font-size:11px;color:#9ba5b2}
.cp-analytics-link{display:inline-flex;align-items:center;gap:7px;color:#e9a67e;text-decoration:none;font-weight:675;font-size:11px;white-space:nowrap}
.cp-analytics-link:hover{color:#ffc49c}
.cp-plot{position:relative;width:100%;min-height:255px}
.cp-plot>svg{width:100%;height:auto;max-height:330px;display:block;overflow:visible}
.cp-gridline{stroke:#292f38;stroke-width:1;stroke-dasharray:3 5;opacity:.9}
.cp-axis{font-size:11px;font-weight:550;fill:#929cab;font-family:Inter,system-ui,sans-serif}
.cp-score-line{fill:none;stroke:#ff9256;stroke-width:3;stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke}
.cp-accuracy-line{fill:none;stroke:#51ccbf;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke;opacity:.93}
.cp-score-dot{fill:#101318;stroke:#ff9f68;stroke-width:2.5;cursor:help}
.cp-accuracy-dot{fill:#0d1516;stroke:#52d2c5;stroke-width:2;cursor:help}
.cp-score-dot:focus,.cp-accuracy-dot:focus{outline:none;fill:#ff9256;stroke:#fff}
.cp-tooltip{position:absolute;z-index:5;width:226px;padding:13px 15px;background:#20262f;border:1px solid #64717e;border-radius:12px;box-shadow:0 12px 35px #000b;font-size:11px;pointer-events:none;letter-spacing:0}
.cp-tooltip[hidden]{display:none}
.cp-tip-date{font-size:10px;color:#b4bec9;margin-bottom:8px}
.cp-tooltip>strong{display:block;font-size:13px;color:#f6f7fa;margin-bottom:11px;line-height:1.4}
.cp-tip-grid{display:grid;grid-template-columns:1fr auto;gap:8px 10px;font-size:10px;color:#b8c0c9}
.cp-tip-grid b{color:#fff;font-variant-numeric:tabular-nums;font-weight:720}
.cp-tip-breakdown{display:flex;gap:7px;flex-wrap:wrap;margin-top:12px;padding-top:11px;border-top:1px solid #3b424a;font-size:10px;color:#d5dbe3}
.cp-tip-warning{margin-top:10px;color:#c4a48d;font-size:10px}
.cp-chart-note{color:#a6b0bd;font-size:11px;margin:7px 0 18px;min-height:17px;line-height:1.4}
.cp-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding-top:19px;border-top:1px solid #2b323d}
.cp-metric{padding:10px 11px 9px;border:1px solid #2c333d;border-radius:11px;background:#10161d;min-width:0}
.cp-metric>span{display:block;font-size:10px;font-weight:620;color:#a9b2bf;line-height:1.35}
.cp-metric>strong{display:block;font-size:24px;font-weight:750;color:#f7f8f9;letter-spacing:-.055em;margin-top:9px;font-variant-numeric:tabular-nums;white-space:nowrap}
.cp-metric>small{display:block;font-size:10px;color:#95a1b0;margin-top:7px;min-height:16px}
.cp-foot{display:flex;align-items:center;justify-content:space-between;gap:17px;padding:19px 6px 0;color:#a5aebb;font-size:11px;line-height:1.5}
.cp-last{display:inline-block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cp-last b{color:#cdd1d8;font-weight:760}.cp-last span{color:#8e98a5}
.cp-foot a{display:inline-flex;gap:6px;align-items:center;color:#eca578;text-decoration:none;font-weight:680;white-space:nowrap}
.cp-foot a:hover{color:#ffd2aa}
.cp-foot a svg{width:14px;height:14px}
.cp-loading,.cp-empty{display:flex;align-items:center;justify-content:center;gap:12px;flex-direction:column;text-align:center;min-height:250px;color:#a5afbb;font-size:12px}
.cp-empty strong{font-size:15px;color:#d9e0e9}
.cp-empty p{font-size:12px;color:#9da6b4;max-width:350px;line-height:1.6}
.cp-empty a{display:flex;gap:7px;align-items:center;color:#ffaf7b;text-decoration:none;font-weight:700}
.cp-loader{width:21px;height:21px;border:2px solid #424b56;border-top-color:#ff995f;border-radius:50%;animation:cp-spin .75s linear infinite}
@keyframes cp-spin{to{transform:rotate(360deg)}}
.cp-workspace button:focus-visible,.cp-workspace a:focus-visible,.cp-workspace input:focus-visible{outline:2px solid #ffa36c;outline-offset:3px}
@media(max-width:1170px){#workspace-main:has(.cp-workspace){padding:25px}.cp-controls{grid-template-columns:minmax(95px,.6fr) minmax(160px,1fr)}.cp-period-box{grid-column:1/-1}.cp-periods{justify-content:flex-start;width:max-content}}
@media(max-width:700px){#workspace-main:has(.cp-workspace){padding:21px 14px 40px}.cp-header{flex-direction:column;align-items:stretch;gap:16px}.cp-start{min-height:41px}.cp-context{gap:10px;flex-wrap:wrap}.cp-card{padding:18px 14px;border-radius:13px}.cp-card-top{flex-wrap:wrap;gap:9px}.cp-card-top h2{font-size:17px}.cp-legend{padding:0}.cp-controls{grid-template-columns:1fr;gap:12px;margin-top:20px}.cp-period-box{grid-column:1}.cp-periods{width:100%;overflow-x:auto;justify-content:space-between}.cp-periods button{padding:7px 10px}.cp-chart-subheading{margin-top:22px;align-items:flex-start}.cp-chart-subheading strong{font-size:12px}.cp-plot{min-height:180px}.cp-chart-note{margin:0 0 12px}.cp-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.cp-metric>strong{font-size:21px}.cp-foot{align-items:flex-start;flex-direction:column;gap:7px}.cp-last{white-space:normal}.cp-custom{justify-content:space-between}.cp-custom input[type=range]{max-width:60vw}}
@media(prefers-reduced-motion:reduce){.cp-loader{animation:none}.cp-workspace *{transition:none!important}}


.cp-retry{margin-left:8px;padding:3px 9px;border:1px solid #565461;border-radius:7px;color:#ffb08a;background:#18181c;cursor:pointer;font-size:11px;font-weight:680}.cp-retry:hover{border-color:#ff9256}.cp-axis-name{font-size:9px;letter-spacing:.075em;fill:#b1b9c4;font-weight:700}
