/* V9.3.4 LOADING + CRISP CHART CONVERGENCE
 * Visual/runtime feedback only. No API, scoring, persistence, permission, case-data or LLM changes.
 */

/* ---------- Route loading feedback ---------- */
#v934RouteLoading{
  position:fixed;
  inset:0;
  z-index:118000;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(246,249,252,.84);
  backdrop-filter:blur(1.5px);
  -webkit-backdrop-filter:blur(1.5px);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .12s ease, visibility 0s linear .12s;
}
#v934RouteLoading[data-open="1"]{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transition:opacity .08s ease;
}
#v934RouteLoading .v934-load-card{
  min-width:220px;
  max-width:min(420px,calc(100vw - 40px));
  border:1px solid #d9e5ed;
  border-radius:16px;
  background:#fff;
  box-shadow:0 18px 50px rgba(28,68,96,.12);
  padding:18px 22px;
  display:flex;
  align-items:center;
  gap:14px;
  color:#183b56;
}
#v934RouteLoading .v934-load-spinner{
  width:24px;
  height:24px;
  flex:0 0 24px;
  border:3px solid #dce7ef;
  border-top-color:#2f80c5;
  border-radius:50%;
  animation:v934spin .72s linear infinite;
}
#v934RouteLoading .v934-load-copy b{
  display:block;
  font-size:15px;
  line-height:1.25;
  margin-bottom:4px;
  color:#143b5a;
}
#v934RouteLoading .v934-load-copy span{
  display:block;
  font-size:12px;
  line-height:1.45;
  color:#71889a;
}
@keyframes v934spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){
  #v934RouteLoading .v934-load-spinner{animation:none;border-top-color:#dce7ef}
}
html.v934-route-loading,
html.v934-route-loading body,
html.v934-route-loading #mainLayout,
html.v934-route-loading #contentPanel{
  scroll-behavior:auto!important;
  overflow-anchor:none!important;
}
body.v934-route-busy #contentPanel *{
  animation-play-state:paused!important;
  transition-duration:0s!important;
}

/* ---------- Crisp analytics charts: text is HTML, not canvas/SVG text ---------- */
#contentPanel .v934-chart-host{
  width:100%;
  min-width:0;
}
#contentPanel .v934-chart-empty{
  min-height:180px;
  border:1px dashed #d8e3eb;
  border-radius:12px;
  background:#f8fbfd;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
  color:#718698;
  font-size:13px;
  line-height:1.6;
  text-align:center;
}

/* vertical bars */
#contentPanel .v934-vbar{
  display:grid;
  grid-template-columns:54px minmax(0,1fr);
  gap:10px;
  min-height:245px;
  padding:8px 4px 0;
}
#contentPanel .v934-vbar-y{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  align-items:flex-end;
  padding:0 0 36px;
  color:#718698;
  font-size:12px;
  line-height:1;
}
#contentPanel .v934-vbar-plot{
  position:relative;
  display:grid;
  grid-template-columns:repeat(var(--v934-n),minmax(42px,1fr));
  gap:8px;
  align-items:end;
  min-height:220px;
  padding-bottom:36px;
  background:repeating-linear-gradient(to bottom,#e6edf2 0,#e6edf2 1px,transparent 1px,transparent 25%);
}
#contentPanel .v934-vbar-item{
  height:184px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  align-items:center;
  position:relative;
}
#contentPanel .v934-vbar-value{
  min-height:20px;
  margin-bottom:5px;
  font-size:12px;
  font-weight:700;
  color:#315b79;
}
#contentPanel .v934-vbar-bar{
  width:min(52px,70%);
  min-height:1px;
  height:calc(var(--v934-ratio) * 1%);
  border-radius:7px 7px 3px 3px;
  background:#5a91c7;
}
#contentPanel .v934-vbar-label{
  position:absolute;
  top:190px;
  left:50%;
  transform:translateX(-50%);
  white-space:nowrap;
  font-size:12.5px;
  line-height:1.2;
  color:#607789;
}

/* horizontal bars */
#contentPanel .v934-hbar{
  display:grid;
  gap:11px;
  padding:8px 4px 2px;
}
#contentPanel .v934-hbar-row{
  display:grid;
  grid-template-columns:minmax(118px,190px) minmax(120px,1fr) 42px;
  align-items:center;
  gap:12px;
}
#contentPanel .v934-hbar-label{
  font-size:13px;
  line-height:1.35;
  color:#526b7d;
  text-align:right;
  overflow-wrap:anywhere;
}
#contentPanel .v934-hbar-track{
  height:16px;
  border-radius:999px;
  background:#edf2f6;
  overflow:hidden;
}
#contentPanel .v934-hbar-fill{
  height:100%;
  width:calc(var(--v934-ratio) * 1%);
  min-width:var(--v934-minw,0px);
  border-radius:999px;
  background:#5a91c7;
}
#contentPanel .v934-hbar-value{
  font-size:12px;
  font-weight:700;
  color:#315b79;
}

/* radar: grid/polygon stay vector, all labels are native HTML for Windows/Chrome clarity */
#contentPanel .v934-radar-shell{
  position:relative;
  width:min(760px,100%);
  height:360px;
  margin:0 auto;
  overflow:visible;
}
#contentPanel .v934-radar-svg{
  position:absolute;
  left:50%;
  top:50%;
  width:330px;
  height:330px;
  transform:translate(-50%,-50%);
  overflow:visible;
}
#contentPanel .v934-radar-label{
  position:absolute;
  left:var(--x);
  top:var(--y);
  transform:translate(-50%,-50%);
  z-index:2;
  padding:2px 5px;
  border-radius:5px;
  background:rgba(255,255,255,.72);
  color:#536b7c;
  font-family:Inter,system-ui,-apple-system,"Segoe UI","Microsoft YaHei",sans-serif;
  font-size:15px;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
#contentPanel .v934-radar-label[data-missing="1"]{
  color:#98a6b0;
  font-weight:500;
}
#contentPanel .v934-radar-label small{
  display:block;
  margin-top:2px;
  font-size:10px;
  font-weight:600;
  color:#7f93a3;
  text-align:center;
}

/* Keep the profile card compact; avoid giant empty radar canvas. */
#contentPanel #v66ProfWrap.v934-chart-host,
#contentPanel #v66AiWrap.v934-chart-host,
#contentPanel #v62ProfWrap.v934-chart-host,
#contentPanel #v62AiWrap.v934-chart-host,
#contentPanel #v78ProfWrap.v934-chart-host,
#contentPanel #v78AiWrap.v934-chart-host{
  min-height:360px!important;
  height:auto!important;
}

@media(max-width:900px){
  #contentPanel .v934-hbar-row{grid-template-columns:120px minmax(90px,1fr) 34px;gap:8px}
  #contentPanel .v934-radar-shell{height:330px}
  #contentPanel .v934-radar-svg{width:290px;height:290px}
  #contentPanel .v934-radar-label{font-size:13px}
  #contentPanel .v934-vbar-plot{gap:4px}
  #contentPanel .v934-vbar-label{font-size:11px}
}

/* ---------- Teacher management navigation must remain available in teacher role ---------- */
body.v803-review-teacher #teacherSidebar [data-module="teacherClasses"],
body.v803-review-teacher #teacherSidebar [data-module="teacherStudents"],
#teacherSidebar [data-module="teacherClasses"],
#teacherSidebar [data-module="teacherStudents"]{
  display:flex!important;
}

/* Avoid GPU blur and extra compositing while a slow route is loading. */
#v934RouteLoading{
  background:rgba(246,249,252,.94);
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
#v934RouteLoading .v934-load-card{
  box-shadow:0 12px 34px rgba(28,68,96,.10);
}

/* Radar labels use native HTML text on an opaque surface: sharper under Windows scaling. */
#contentPanel .v934-radar-svg{
  shape-rendering:geometricPrecision;
}
#contentPanel .v934-radar-label{
  background:#fff;
  color:#3f596d;
  font-size:15px;
  font-weight:650;
  -webkit-font-smoothing:auto;
  text-rendering:geometricPrecision;
}

/* ===== V9.3.6 workspace sidebar viewport correction =====
   The workspace starts below the top bar, so a raw `100vh - 32px` sidebar
   can extend below the visible viewport.  Keep the bottom edge inside the
   viewport and leave real scroll room for the last navigation item. */
@media(min-width:1051px){
  body:not(.v803-review-teacher) #mainLayout > .sidebar:not(.hidden){
    max-height:var(--v936-sidebar-max-height, calc(100dvh - 112px))!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable;
    scroll-padding-bottom:24px;
  }
}


/* ===== V9.3.7 reviewer class lock + larger seven-dimension radar ===== */
#contentPanel .chart-container.radar-container{
  height:460px!important;
  min-height:460px!important;
}
#contentPanel .v934-radar-shell{
  width:min(900px,100%);
  height:450px;
}
#contentPanel .v934-radar-svg{
  width:410px;
  height:410px;
}
#contentPanel .v934-radar-label{
  font-size:16px;
}
#contentPanel #v66ProfWrap.v934-chart-host,
#contentPanel #v62ProfWrap.v934-chart-host,
#contentPanel #v78ProfWrap.v934-chart-host{
  min-height:450px!important;
}
#contentPanel .v937-review-class-select:disabled{
  opacity:1!important;
  cursor:default!important;
  color:#183b5b!important;
  -webkit-text-fill-color:#183b5b!important;
  background:#f5f9fd!important;
  border-color:#c8d9e8!important;
  font-weight:700;
}
#contentPanel .v937-review-class-lock{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:38px;
  padding:0 14px;
  border:1px solid #c8d9e8;
  border-radius:10px;
  background:#f5f9fd;
  color:#183b5b;
  font-weight:800;
  white-space:nowrap;
}
@media(max-width:900px){
  #contentPanel .chart-container.radar-container{height:380px!important;min-height:380px!important}
  #contentPanel .v934-radar-shell{height:370px}
  #contentPanel .v934-radar-svg{width:340px;height:340px}
  #contentPanel .v934-radar-label{font-size:14px}
}

/* ===== V9.3.8 teacher sidebar: independent scrolling in both normal and reviewer-teacher modes ===== */
@media(min-width:1051px){
  #mainLayout > #teacherSidebar.sidebar:not(.hidden),
  body.v803-review-teacher #mainLayout > #teacherSidebar.sidebar:not(.hidden){
    position:sticky!important;
    top:12px!important;
    align-self:flex-start!important;
    height:auto!important;
    max-height:var(--v936-sidebar-max-height, calc(100dvh - 112px))!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    scrollbar-width:thin!important;
    scrollbar-gutter:stable!important;
    scroll-padding-top:10px!important;
    scroll-padding-bottom:28px!important;
  }
  body.v803-review-teacher #teacherSidebar.sidebar::-webkit-scrollbar{
    display:block!important;
    width:8px!important;
  }
  body.v803-review-teacher #teacherSidebar.sidebar::-webkit-scrollbar-thumb{
    background:#a8b4bf!important;
    border-radius:999px!important;
  }
  body.v803-review-teacher #teacherSidebar.sidebar::-webkit-scrollbar-track{
    background:transparent!important;
  }
}


/* ===== V9.3.9 reviewer-teacher sidebar final convergence =====
   Reviewer mode historically reintroduced a page-flow sidebar from V9.3.2.
   The final rule below makes the left navigation a real scroll viewport again. */
@media(min-width:1051px){
  body.v803-review-teacher #mainLayout{
    min-height:0!important;
    align-items:flex-start!important;
  }
  body.v803-review-teacher #mainLayout > #teacherSidebar.sidebar:not(.hidden){
    display:flex!important;
    flex-direction:column!important;
    flex:0 0 250px!important;
    width:250px!important;
    min-width:250px!important;
    min-height:0!important;
    position:sticky!important;
    top:12px!important;
    max-height:var(--v936-sidebar-max-height, calc(100dvh - 112px))!important;
    overflow-y:scroll!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    touch-action:pan-y!important;
    scrollbar-width:thin!important;
    scrollbar-gutter:stable both-edges!important;
  }
  body.v803-review-teacher #mainLayout > #teacherSidebar.sidebar:not(.hidden)::-webkit-scrollbar{
    display:block!important;
    width:9px!important;
  }
  body.v803-review-teacher #mainLayout > #teacherSidebar.sidebar:not(.hidden)::-webkit-scrollbar-thumb{
    background:#9eacb8!important;
    border-radius:999px!important;
    border:2px solid #fff!important;
  }
  body.v803-review-teacher #mainLayout > #teacherSidebar.sidebar:not(.hidden)::-webkit-scrollbar-track{
    background:#f3f6f8!important;
    border-radius:999px!important;
  }
}
