/* Course statistics share the workspace palette; charts own only their series colors. */
.statistics-dashboard{padding:20px;container-type:inline-size;min-width:0}
.statistics-dashboard :is(h3,h4,p){margin:0}
.statistics-controls{padding-bottom:18px;border-bottom:1px solid var(--line)}
.statistics-control-top,.statistics-period-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.statistics-scope{display:flex;gap:4px}
.statistics-scope button{padding:8px 14px;border-radius:20px;color:var(--muted);font-size:12px;font-weight:600}
.statistics-scope button[aria-pressed=true]{background:var(--nav-selected);color:var(--ink)}
.statistics-sample-label{font-size:10px;color:var(--muted);border:1px solid var(--line);border-radius:5px;padding:2px 7px;white-space:nowrap}
.statistics-selectors{display:flex;gap:14px;flex-wrap:wrap;margin:18px 0}
.statistics-selectors label{flex:1;min-width:150px;max-width:340px;display:flex;flex-direction:column;gap:7px;font-size:11px;color:var(--muted)}
.statistics-selectors label>span,.statistics-all-scope{display:flex;align-items:center;gap:6px}
.statistics-selectors .icon{width:15px;height:15px}
.statistics-selectors select{width:100%;min-height:40px;color:var(--ink);background-color:var(--paper);border-color:var(--line)}
.statistics-selectors .statistics-all-scope{color:var(--muted);font-size:12px;min-height:64px}
.statistics-periods{display:flex;padding:3px;background:var(--wash);border:1px solid var(--line);border-radius:8px;gap:2px}
.statistics-periods button{border-radius:5px;padding:5px 11px;color:var(--muted);font-size:11px;white-space:nowrap;min-height:30px}
.statistics-periods button[aria-pressed=true]{color:var(--ink);background:var(--paper);box-shadow:0 1px 3px #0000000d;font-weight:600}
.statistics-periods button:hover,.statistics-scope button:hover{background:var(--nav-hover);color:var(--ink)}
.statistics-dashboard :is(button,summary,[tabindex]):focus-visible{outline:2px solid var(--blue);outline-offset:3px}
.statistics-date-range{font-size:10px;color:var(--muted);font-variant-numeric:tabular-nums}
.statistics-dashboard .statistics-context{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:14px 0 4px;font-size:11px;color:var(--muted)}
.statistics-context>span{font-size:10px}
.statistics-section-title{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin:22px 0 12px}
.statistics-section-title h3{font-size:13px;font-weight:600}
.statistics-section-title>span{font-size:10px;color:var(--muted)}
.statistics-momentum{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.statistics-metric,.statistics-panel{min-width:0;border:1px solid var(--line);border-radius:10px;background:var(--paper);padding:18px}
.statistics-metric-top{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.statistics-metric h4{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:600}
.statistics-metric h4 .icon{width:15px;height:15px;color:var(--metric-color)}
.statistics-change{position:relative;font-size:10px;font-variant-numeric:tabular-nums;color:var(--muted);background:var(--wash);border-radius:5px;padding:2px 6px;cursor:help}
.statistics-change-tip{display:none;position:absolute;z-index:5;right:0;bottom:calc(100% + 8px);width:205px;max-width:65vw;padding:10px 12px;background:var(--paper);color:var(--ink);box-shadow:0 5px 24px #00000018;border:1px solid var(--line);border-radius:8px;font-size:11px;line-height:1.7}
.statistics-change:hover .statistics-change-tip,.statistics-change:focus .statistics-change-tip{display:block}
.statistics-value{display:flex;gap:8px;align-items:baseline;font-size:30px;font-weight:700;line-height:1.3;letter-spacing:-.6px;margin:14px 0 10px;font-variant-numeric:tabular-nums;flex-wrap:wrap}
.statistics-value small{font-size:10px;letter-spacing:0;color:var(--muted);font-weight:400}
.statistics-metric>p{font-size:11px;color:var(--muted);line-height:1.8;min-height:40px}
.statistics-mini-chart{height:78px;margin:14px -2px 0;position:relative}
.statistics-chart-endpoints{display:flex;justify-content:space-between;font-size:9px;color:var(--muted);margin-top:4px;font-variant-numeric:tabular-nums}
.statistics-retention{display:grid;grid-template-columns:minmax(190px,.8fr) minmax(0,1.2fr);gap:14px}
.statistics-panel h4{font-size:12px;font-weight:600;margin-bottom:6px}
.statistics-description{font-size:11px;color:var(--muted);line-height:1.8}
.statistics-donut-wrap{width:152px;height:152px;position:relative;margin:18px auto}
.statistics-donut{height:100%;position:relative}
.statistics-donut-total{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;pointer-events:none;line-height:1.4}
.statistics-donut-total strong{font-size:25px;font-variant-numeric:tabular-nums}
.statistics-donut-total span{font-size:10px;color:var(--muted)}
.statistics-distribution-legend{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:7px;font-size:10px}
.statistics-distribution-legend li,.statistics-distribution-legend li>span{display:flex;align-items:center;gap:7px}
.statistics-distribution-legend li{justify-content:space-between}
.statistics-distribution-legend i,.statistics-member-summary i{width:7px;height:7px;display:inline-block;border-radius:2px;background:var(--legend-color);flex-shrink:0}
.statistics-distribution-legend strong{font-weight:600;font-size:11px;font-variant-numeric:tabular-nums}
.statistics-distribution-legend small{margin-left:4px;font-size:9px;font-weight:400;color:var(--muted)}
.statistics-panel-value{font-size:27px;font-weight:700;margin:18px 0 12px;font-variant-numeric:tabular-nums;line-height:1.4;display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}
.statistics-panel-value small{font-size:11px;font-weight:400;color:var(--muted)}
.statistics-panel-value>span{font-size:10px;font-weight:400;color:var(--muted);margin-left:auto}
.statistics-large-chart{height:195px;position:relative}
.statistics-dashboard .statistics-chart-note{font-size:10px;color:var(--muted);margin-top:14px;line-height:1.8}
.statistics-member-summary{display:flex;gap:24px;flex-wrap:wrap;margin-bottom:24px}
.statistics-member-summary>div>span{display:flex;gap:5px;align-items:center;font-size:10px;color:var(--muted)}
.statistics-member-summary strong{display:block;font-size:23px;font-weight:600;font-variant-numeric:tabular-nums;margin-top:6px}
.statistics-member-summary small{font-size:10px;color:var(--muted);font-weight:400;margin-left:5px}
.statistics-members-chart{height:260px;position:relative}
.statistics-heat-scroll{overflow-x:auto;margin-top:20px;padding:4px;scrollbar-width:thin}
.statistics-heat-grid{min-width:480px;display:grid;grid-template-columns:20px repeat(24,minmax(0,1fr));gap:4px;align-items:center}
.statistics-heat-hour{font-size:9px;white-space:nowrap;text-align:center;color:var(--muted);height:20px}
.statistics-heat-day{font-size:10px;color:var(--muted)}
.statistics-heat-cell{display:block;padding:0;width:100%;height:22px;border-radius:3px;border:1px solid transparent}
.statistics-heat-cell.is-selected{outline:2px solid var(--ink);outline-offset:1px}
.statistics-heat-level-0{background:#edf2f7}
.statistics-heat-level-1{background:#d2e2f2}
.statistics-heat-level-2{background:#9fc3e5}
.statistics-heat-level-3{background:#639cd0}
.statistics-heat-level-4{background:#3378b8}
.statistics-heat-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-top:14px;font-size:10px;color:var(--muted)}
.statistics-heat-footer>p{min-height:18px;font-variant-numeric:tabular-nums}
.statistics-heat-scale{display:flex;gap:4px;align-items:center}
.statistics-heat-scale i{display:block;width:12px;height:12px;border-radius:2px}
.statistics-data-table{margin-top:20px;color:var(--muted);font-size:11px}
.statistics-data-table summary{cursor:pointer;padding:8px 0}
.statistics-table-scroll{overflow:auto;max-height:360px;margin-top:10px;border:1px solid var(--line);border-radius:8px}
.statistics-table-scroll table{color:var(--ink);font-variant-numeric:tabular-nums}
.statistics-table-scroll th{background:var(--wash)}
.statistics-table-scroll td{text-align:right}
.statistics-table-scroll thead{position:sticky;top:0}
.statistics-dashboard .statistics-footnote{font-size:10px;color:var(--muted);line-height:1.9;border-top:1px solid var(--line);padding-top:16px;margin-top:22px}
.statistics-empty{text-align:center;padding:60px 12px;font-size:13px}
.statistics-empty p{font-size:12px;color:var(--muted);margin-top:8px}
.statistics-chart-error{font-size:12px;color:var(--ink);padding:10px;background:var(--wash)}
.account-dark .statistics-heat-level-0{background:#252830}
.account-dark .statistics-heat-level-1{background:#293f55}
.account-dark .statistics-heat-level-2{background:#365f87}
.account-dark .statistics-heat-level-3{background:#4b8cc5}
.account-dark .statistics-heat-level-4{background:#83b9e9}
@container (min-width:1050px){.statistics-momentum{grid-template-columns:repeat(4,minmax(0,1fr))}}
@container (max-width:530px){
  .statistics-retention{grid-template-columns:1fr}
  .statistics-metric{padding:14px}
  .statistics-metric-top{align-items:flex-start;flex-direction:column;gap:6px}
  .statistics-change-tip{left:0;right:auto;width:180px}
  .statistics-value{font-size:27px;gap:4px;align-items:flex-start;flex-direction:column}
  .statistics-value small{font-size:9px}
  .statistics-metric>p{min-height:60px;font-size:10px}
  .statistics-distribution-legend{max-width:300px;margin:auto}
  .statistics-period-row{gap:10px}
  .statistics-large-chart{height:190px}
  .statistics-member-summary{gap:16px;justify-content:space-between}
}
@media(max-width:800px){
  .statistics-dashboard{padding:16px 0}
  .statistics-periods button{min-height:36px;padding:5px 12px}
  .statistics-selectors select{min-height:44px}
  .statistics-scope button{min-height:40px}
}
@media(max-width:380px){
  .statistics-momentum{gap:10px}
  .statistics-metric{padding:12px}
  .statistics-selectors{gap:10px}
  .statistics-selectors label{min-width:125px}
  .statistics-sample-label{font-size:9px}
}
