/* Compact, teacher-facing class summaries. Scope excludes home and teaching tools. */
#classesView .class-detail { container:class-detail / inline-size; }
/* Column sizes are already defined by the UI. Avoid measuring every score on updates. */
#classesView .class-grade-scroll .grade-matrix {
  --grade-id-width:60px; --grade-name-width:100px; --grade-score-width:108px; --grade-total-width:96px;
  table-layout:fixed;
  width:max(100%,calc(var(--grade-id-width) + var(--grade-name-columns,1)*var(--grade-name-width) + var(--grade-project-columns,1)*var(--grade-score-width) + var(--grade-total-columns,0)*var(--grade-total-width)));
}
#classesView .class-record-tabs {
  display:flex; width:max-content; max-width:calc(100% - 44px); gap:3px;
  margin:18px 22px 0; padding:4px; overflow-x:auto;
  border:1px solid var(--border); border-radius:12px; background:var(--surface-2);
  scrollbar-width:thin;
}
#classesView .class-record-tab {
  display:block; position:relative; flex:none; min-height:36px; padding:8px 17px;
  border:1px solid transparent; border-radius:8px; background:transparent;
  color:var(--muted); font-size:12px; font-weight:550; line-height:1.5;
  white-space:nowrap; transition:color .15s ease,background .15s ease,border-color .15s ease;
}
#classesView .class-record-tab:hover { color:var(--primary); background:color-mix(in srgb,var(--primary) 4%,transparent); }
#classesView .class-record-tab.active {
  color:var(--primary); background:var(--surface);
  border-color:color-mix(in srgb,var(--border) 75%,transparent);
  box-shadow:0 2px 5px color-mix(in srgb,var(--primary) 6%,transparent); font-weight:700;
}
/* Shared slide behavior keeps each navigation/filter group's existing selection colors. */
#classesView .class-tab-motion-ready { position:relative; isolation:isolate; }
#classesView .class-tab-indicator {
  position:absolute; z-index:-1; left:0; top:0; pointer-events:none; transform-origin:0 0;
  border:1px solid var(--class-tab-border,color-mix(in srgb,var(--border) 75%,transparent));
  border-radius:var(--class-tab-radius,8px); background:var(--class-tab-bg,var(--surface));
  box-shadow:var(--class-tab-shadow,0 2px 5px color-mix(in srgb,var(--primary) 6%,transparent));
}
#classesView .grade-folder-tabs.class-tab-motion-ready {
  --class-tab-bg:var(--primary); --class-tab-border:var(--primary); --class-tab-radius:7px;
  --class-tab-shadow:0 2px 4px color-mix(in srgb,var(--primary) 12%,transparent);
}
#classesView .objective-scope-tabs.class-tab-motion-ready {
  --class-tab-bg:var(--surface-3); --class-tab-border:color-mix(in srgb,var(--primary) 40%,var(--border));
  --class-tab-radius:10px; --class-tab-shadow:0 5px 15px color-mix(in srgb,var(--primary) 12%,transparent);
}
#classesView :is(.exam-comparison-filters,.dictation-change-tools > div).class-tab-motion-ready {
  --class-tab-bg:var(--surface-3); --class-tab-border:var(--primary); --class-tab-shadow:none;
}
#classesView .class-tab-motion-ready > button { background:transparent; }
#classesView .class-tab-motion-ready > :is(.class-record-tab,.grade-folder-tab,.objective-scope-tab,button).class-tab-selected {
  background:transparent; border-color:transparent; box-shadow:none;
}
/* A single aligned control row keeps analysis and record selection together. */
#classesView .learning-toolbar {
  display:grid; grid-template-columns:auto minmax(0,400px); align-items:center; justify-content:space-between;
  gap:24px; padding:12px 14px; border:1px solid color-mix(in srgb,var(--border) 72%,var(--surface)); border-radius:14px;
  background:var(--surface); box-shadow:0 2px 6px color-mix(in srgb,var(--primary) 3%,transparent);
}
#classesView .learning-kind-tabs {
  --learning-kind-index:0;
  position:relative; isolation:isolate;
  display:inline-grid; grid-template-columns:repeat(3,minmax(0,1fr)); justify-self:start; align-self:center;
  width:312px; max-width:100%; gap:3px; padding:4px;
  border:0; border-radius:10px; background:var(--surface-2);
  box-shadow:none; overflow:visible;
}
#classesView .learning-kind-tabs[data-learning-active="dictation"] { --learning-kind-index:1; }
#classesView .learning-kind-tabs[data-learning-active="homework"] { --learning-kind-index:2; }
#classesView .learning-kind-indicator {
  position:absolute; z-index:-1; top:4px; bottom:4px; left:4px; width:calc((100% - 14px)/3);
  border:1px solid color-mix(in srgb,var(--border) 45%,var(--surface)); border-radius:7px;
  background:var(--surface); box-shadow:0 1px 3px color-mix(in srgb,var(--primary) 8%,transparent);
  pointer-events:none; transform:translate3d(calc(var(--learning-kind-index)*(100% + 3px)),0,0);
  transition:transform 260ms cubic-bezier(.22,1,.36,1);
}
#classesView .learning-kind-tab {
  position:relative;
  display:flex; align-items:center; justify-content:center; min-width:0; min-height:36px; padding:7px 12px;
  border:1px solid transparent; border-radius:7px; background:transparent; color:var(--muted);
  font:inherit; font-size:13px; font-weight:550; line-height:1.5; white-space:nowrap;
  box-shadow:none; transform:none;
  transition:color 160ms ease-out,background 160ms ease-out;
}
#classesView .learning-kind-tab:hover {
  color:var(--primary); background:color-mix(in srgb,var(--primary) 4%,transparent);
}
#classesView .learning-kind-tab.active {
  color:var(--primary); background:transparent; border-color:transparent; font-weight:700; box-shadow:none;
}
#classesView .learning-kind-tab:focus-visible {
  position:relative; z-index:1; outline:2px solid var(--primary); outline-offset:2px;
}
#classesView .learning-project-picker {
  display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:0;
  width:100%; min-width:0; height:44px; padding:0; border:1px solid var(--border); border-radius:10px;
  background:var(--surface); color:var(--muted); font-size:11px; font-weight:550;
  transition:border-color 160ms ease,box-shadow 160ms ease;
}
#classesView .learning-project-label {
  display:flex; align-items:center; gap:7px; height:20px; margin-left:13px; padding-right:13px;
  border-right:1px solid var(--border); white-space:nowrap; color:var(--muted); font-size:12px;
}
#classesView .learning-project-label svg {
  flex:none; width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.65;
  stroke-linecap:round; stroke-linejoin:round;
}
#classesView .learning-project-field { display:block; position:relative; min-width:0; height:100%; }
#classesView .learning-project-chevron {
  position:absolute; right:12px; top:50%; width:14px; height:14px; pointer-events:none;
  fill:none; stroke:var(--muted); stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round;
  transform:translateY(-50%);
}
#classesView .learning-project-picker select {
  display:block; width:100%; height:100%; min-height:0; margin:0; padding:9px 35px 9px 13px;
  border:0; border-radius:0 9px 9px 0; background:transparent; color:var(--text);
  font-family:inherit; font-size:13px; font-weight:600; line-height:1.5; font-variant-numeric:tabular-nums;
  appearance:none; -webkit-appearance:none; box-shadow:none; cursor:pointer; text-overflow:ellipsis;
}
#classesView .learning-project-picker:hover { border-color:color-mix(in srgb,var(--primary) 35%,var(--border)); }
#classesView .learning-project-picker:focus-within {
  border-color:var(--primary); box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 10%,transparent);
}
#classesView .learning-project-picker select:focus { outline:none; }
#classesView .learning-project-picker:has(select:disabled) {
  color:var(--muted); border-color:var(--border); box-shadow:none; background:var(--surface-2);
}
#classesView .learning-project-picker select:disabled {
  cursor:default; color:var(--muted); opacity:1; -webkit-text-fill-color:var(--muted);
}
#classesView .grade-folder-strip {
  display:flex; align-items:center; gap:12px; margin:16px 0; padding:7px 8px;
  border:1px solid var(--border); border-radius:11px; background:var(--surface-2);
}
#classesView .grade-folder-tabs { display:flex; min-width:0; gap:4px; padding:1px; overflow-x:auto; scrollbar-width:thin; }
#classesView .grade-folder-tab {
  display:inline-flex; flex:none; align-items:center; gap:7px; min-height:34px; padding:7px 11px;
  border:1px solid transparent; border-radius:7px; color:var(--muted); background:transparent;
  font-size:12px; font-weight:550; line-height:1.4; white-space:nowrap;
  transition:color .15s ease,background .15s ease,border-color .15s ease;
}
#classesView .grade-folder-tab span {
  display:inline-grid; place-items:center; min-width:20px; height:20px; margin:0; padding:0 5px;
  border-radius:5px; color:var(--muted); background:color-mix(in srgb,var(--border) 45%,var(--surface));
  font-size:10px; font-weight:600; font-variant-numeric:tabular-nums;
}
#classesView .grade-folder-tab:hover { color:var(--primary); background:var(--surface); }
#classesView .grade-folder-tab.active {
  color:var(--primary-text); background:var(--primary); border-color:var(--primary);
  box-shadow:0 2px 4px color-mix(in srgb,var(--primary) 12%,transparent); font-weight:650;
}
#classesView .grade-folder-tab.active span { color:inherit; background:color-mix(in srgb,var(--primary-text) 16%,transparent); }
#classesView .grade-folder-manage {
  display:inline-flex; position:static; flex:none; align-items:center; justify-content:center; gap:6px;
  min-height:34px; margin-left:auto; padding:7px 11px; border:1px solid var(--border); border-radius:7px;
  background:var(--surface); color:var(--primary); font-size:11px; font-weight:550; box-shadow:none;
}
#classesView .grade-folder-manage:hover { border-color:color-mix(in srgb,var(--primary) 35%,var(--border)); background:var(--surface); }
#classesView .grade-folder-manage .ui-icon { width:14px; height:14px; }
#classesView .grade-analysis {
  margin:0 0 18px; padding:18px; border:1px solid var(--border); border-radius:13px;
  background:var(--surface-2); box-shadow:none;
}
#classesView .grade-analysis-head { display:flex; flex-direction:row; align-items:center; justify-content:space-between; gap:20px; margin-bottom:16px; }
#classesView .grade-analysis-title { min-width:0; }
#classesView .grade-analysis-title h3 { margin:0; color:var(--text); font-size:17px; font-weight:700; line-height:1.5; letter-spacing:0; }
#classesView .grade-analysis-title p { margin:4px 0 0; color:var(--muted); font-size:11px; line-height:1.65; overflow-wrap:anywhere; }
#classesView .grade-analysis-actions { display:flex; flex:0 1 auto; flex-direction:row; align-items:flex-end; gap:8px; min-width:0; }
#classesView .grade-project-picker { display:grid; flex:1 1 auto; gap:5px; min-width:0; color:var(--muted); font-size:10px; font-weight:500; }
#classesView .grade-analysis-select {
  width:210px; min-width:0; max-width:100%; min-height:36px; padding:7px 30px 7px 11px;
  border:1px solid var(--border); border-radius:7px; background:var(--surface); color:var(--text);
  font:inherit; font-size:12px; font-weight:600; text-overflow:ellipsis;
}
#classesView .grade-analysis-actions .button { flex:none; width:auto; min-height:36px; padding:7px 11px; border-radius:7px; font-size:11px; font-weight:550; white-space:nowrap; box-shadow:none; }
#classesView .grade-stage-grid,
#classesView .homework-summary-grid { display:grid; gap:10px; align-items:stretch; grid-auto-rows:1fr; }
#classesView .grade-stage-grid.levels-4 { grid-template-columns:repeat(4,minmax(0,1fr)); }
#classesView .grade-stage-grid.levels-3 { grid-template-columns:repeat(3,minmax(0,1fr)); }
#classesView .grade-stage-grid.levels-2,
#classesView .homework-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
#classesView :is(.grade-stage,.homework-summary-card) {
  --summary-tone:var(--primary); --summary-tint:var(--surface-3);
  position:relative; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto 3px; gap:13px;
  min-width:0; height:100%; min-height:126px; padding:17px 18px 0; overflow:hidden;
  border:1px solid color-mix(in srgb,var(--summary-tone) 18%,var(--border)); border-radius:12px;
  background:linear-gradient(145deg,color-mix(in srgb,var(--summary-tint) 38%,var(--surface)),var(--surface) 62%);
  color:var(--summary-tone); text-align:left;
  box-shadow:0 4px 14px color-mix(in srgb,var(--text) 4%,transparent),inset 0 1px rgba(255,255,255,.74);
  transition:border-color .16s ease,background .16s ease,box-shadow .16s ease;
}
#classesView .stage-excellent { --summary-tone:#496da1; --summary-tint:#eaf1fc; }
#classesView .stage-good { --summary-tone:var(--stage-good-text); --summary-tint:var(--stage-good-bg); }
#classesView .stage-pass { --summary-tone:var(--stage-pass-text); --summary-tint:var(--stage-pass-bg); }
#classesView .stage-fail { --summary-tone:var(--stage-fail-text); --summary-tint:var(--stage-fail-bg); }
#classesView .stage-fail.dictation-final { --summary-tone:var(--stage-follow-text); --summary-tint:var(--stage-follow-bg); }
#classesView .homework-summary-card.submitted { --summary-tone:var(--success); --summary-tint:color-mix(in srgb,var(--success) 8%,var(--surface)); }
#classesView .homework-summary-card.missing { --summary-tone:var(--danger); --summary-tint:color-mix(in srgb,var(--danger) 8%,var(--surface)); }
#classesView :is(.grade-stage,.homework-summary-card):hover {
  border-color:color-mix(in srgb,var(--summary-tone) 48%,var(--border));
  background:linear-gradient(145deg,color-mix(in srgb,var(--summary-tint) 54%,var(--surface)),var(--surface) 68%);
  box-shadow:0 7px 18px color-mix(in srgb,var(--summary-tone) 8%,transparent),inset 0 1px rgba(255,255,255,.78); transform:none;
}
#classesView :is(.grade-stage,.homework-summary-card).active {
  border-color:color-mix(in srgb,var(--summary-tone) 60%,var(--border));
  background:linear-gradient(145deg,color-mix(in srgb,var(--summary-tint) 68%,var(--surface)),var(--surface) 72%);
  box-shadow:0 6px 18px color-mix(in srgb,var(--summary-tone) 9%,transparent),inset 0 0 0 1px color-mix(in srgb,var(--summary-tone) 16%,transparent); transform:none;
}
#classesView :is(.grade-stage,.homework-summary-card)::after { content:none; }
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-main { display:flex; align-items:center; justify-content:space-between; gap:18px; min-width:0; }
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-identity { display:flex; flex:1 1 auto; align-items:center; gap:11px; min-width:0; }
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-icon {
  display:grid; flex:none; place-items:center; width:34px; height:34px;
  border:1px solid color-mix(in srgb,var(--summary-tone) 13%,transparent); border-radius:10px;
  background:color-mix(in srgb,var(--summary-tone) 7%,var(--surface));
}
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-icon svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; }
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-copy { display:grid; flex:1 1 auto; gap:3px; min-width:0; }
#classesView .grade-stage-copy b { color:var(--text); font-size:15px; font-weight:700; line-height:1.35; white-space:nowrap; }
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-range { display:block; overflow:visible; color:var(--muted); font-size:11px; font-weight:400; line-height:1.55; white-space:normal; overflow-wrap:anywhere; }
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-count { display:flex; flex:none; align-items:baseline; justify-content:flex-end; gap:5px; min-width:72px; color:var(--summary-tone); white-space:nowrap; text-align:right; }
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-value { display:inline; font-size:30px; font-weight:660; line-height:1; letter-spacing:-1px; font-variant-numeric:tabular-nums; }
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-unit { display:inline; font-size:11px; font-weight:500; }
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-meta { display:flex; align-items:center; justify-content:space-between; gap:12px; min-width:0; }
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-share { color:var(--muted); font-size:10px; font-weight:450; line-height:1.4; white-space:nowrap; }
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-share b { color:var(--summary-tone); font-size:11px; font-weight:650; }
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-action { display:inline-flex; align-items:center; gap:4px; color:color-mix(in srgb,var(--summary-tone) 72%,var(--muted)); font-size:10px; font-weight:550; white-space:nowrap; }
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-action svg { width:13px; height:13px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; transition:transform .16s ease; }
#classesView :is(.grade-stage,.homework-summary-card).active .grade-stage-action { color:var(--summary-tone); }
#classesView :is(.grade-stage,.homework-summary-card).active .grade-stage-action svg { transform:rotate(180deg); }
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-meter { display:block; height:3px; margin:0 -18px; overflow:hidden; background:color-mix(in srgb,var(--summary-tone) 7%,transparent); }
#classesView :is(.grade-stage,.homework-summary-card) .grade-stage-meter i { display:block; width:var(--stage-progress); height:100%; border-radius:0 999px 999px 0; background:color-mix(in srgb,var(--summary-tone) 72%,transparent); transition:width .25s ease; }

/* Expanded lists stay neutral; stage color is limited to precise accents. */
#classesView .grade-stage-detail-stack { gap:9px; margin-top:12px; }
#classesView .grade-stage-detail {
  --detail-tone:var(--primary);
  position:relative; overflow:hidden; border:1px solid color-mix(in srgb,var(--detail-tone) 18%,var(--border));
  border-radius:12px; background:var(--surface);
  box-shadow:0 5px 16px color-mix(in srgb,var(--text) 4%,transparent);
}
#classesView .grade-stage-detail::before { content:""; position:absolute; inset:0 0 auto; height:3px; background:color-mix(in srgb,var(--detail-tone) 68%,transparent); }
#classesView .grade-stage-detail.stage-excellent { --detail-tone:#496da1; }
#classesView .grade-stage-detail.stage-good { --detail-tone:var(--stage-good-text); }
#classesView .grade-stage-detail.stage-pass { --detail-tone:var(--stage-pass-text); }
#classesView .grade-stage-detail.stage-fail { --detail-tone:var(--stage-fail-text); }
#classesView .grade-stage-detail.stage-fail.dictation-final { --detail-tone:var(--stage-follow-text); }
#classesView .grade-stage-detail-head {
  display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:54px; padding:10px 12px 9px;
  border-bottom:1px solid color-mix(in srgb,var(--detail-tone) 10%,var(--border));
  background:linear-gradient(90deg,color-mix(in srgb,var(--detail-tone) 4%,var(--surface)),var(--surface) 42%);
}
#classesView .grade-stage-detail-title { display:flex; flex:1 1 auto; align-items:center; gap:10px; min-width:0; }
#classesView .grade-stage-detail-symbol {
  display:grid; flex:none; place-items:center; width:29px; height:29px;
  border:1px solid color-mix(in srgb,var(--detail-tone) 20%,var(--border)); border-radius:8px;
  background:color-mix(in srgb,var(--detail-tone) 9%,var(--surface)); color:var(--detail-tone);
  font-size:13px; font-weight:800; line-height:1;
}
#classesView .grade-stage-detail-copy { display:grid; gap:2px; min-width:0; }
#classesView .grade-stage-detail-copy strong { color:var(--text); font-size:14px; font-weight:720; line-height:1.35; }
#classesView .grade-stage-detail-copy span { overflow:hidden; color:var(--muted); font-size:10px; line-height:1.45; text-overflow:ellipsis; white-space:nowrap; }
#classesView .grade-stage-detail-count {
  display:inline-flex; flex:none; align-items:baseline; gap:3px; margin-left:2px; padding:4px 7px;
  border:1px solid color-mix(in srgb,var(--detail-tone) 14%,var(--border)); border-radius:999px;
  background:color-mix(in srgb,var(--detail-tone) 6%,var(--surface)); color:var(--detail-tone);
  font-size:10px; font-weight:600; white-space:nowrap;
}
#classesView .grade-stage-detail-count b { font-size:12px; font-weight:750; font-variant-numeric:tabular-nums; }
#classesView .grade-stage-detail-close {
  display:inline-flex; flex:none; align-items:center; gap:5px; min-height:30px; padding:5px 8px;
  border:1px solid transparent; border-radius:7px; background:transparent; color:var(--muted); font-size:10px; font-weight:550;
}
#classesView .grade-stage-detail-close svg { width:13px; height:13px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#classesView .grade-stage-detail-close:hover { border-color:var(--border); background:var(--surface-2); color:var(--detail-tone); }
#classesView .grade-name-list { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:7px; padding:10px 12px 11px; background:var(--surface); }
#classesView .grade-name-chip {
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:6px; min-width:0; min-height:42px; padding:6px 8px;
  border:1px solid color-mix(in srgb,var(--border) 82%,transparent); border-radius:8px;
  background:color-mix(in srgb,var(--surface-2) 72%,var(--surface)); color:var(--text); text-align:left;
  box-shadow:0 1px 2px color-mix(in srgb,var(--text) 2%,transparent);
  transition:border-color .16s ease,background .16s ease,box-shadow .16s ease;
}
#classesView .grade-name-chip:hover,
#classesView .grade-name-chip:focus-visible { border-color:color-mix(in srgb,var(--detail-tone) 30%,var(--border)); background:var(--surface-2); box-shadow:0 3px 9px color-mix(in srgb,var(--text) 5%,transparent); transform:none; }
#classesView .grade-name-main { display:grid; grid-template-columns:23px minmax(0,1fr); align-items:center; gap:6px; min-width:0; }
#classesView .grade-name-status { display:none; }
#classesView .has-status .grade-name-main { grid-template-columns:12px 23px minmax(0,1fr); }
#classesView .has-status .grade-name-status { display:grid; place-items:center; width:12px; height:20px; }
#classesView .grade-name-id {
  display:inline-grid; place-items:center; width:23px; min-width:23px; height:20px; padding:0; border-radius:5px;
  background:color-mix(in srgb,var(--border) 38%,var(--surface)); color:var(--muted);
  font-size:9px; font-weight:650; line-height:1; font-variant-numeric:tabular-nums;
}
#classesView .grade-name-name { overflow:hidden; color:inherit; font-size:11px; font-weight:620; line-height:1.3; text-overflow:ellipsis; white-space:nowrap; }
#classesView .grade-name-outcome { display:flex; flex:none; align-items:center; justify-content:flex-end; gap:4px; color:color-mix(in srgb,var(--text) 84%,var(--muted)); font-size:10px; font-weight:760; line-height:1.25; letter-spacing:.01em; text-align:right; white-space:nowrap; }
#classesView .grade-name-outcome-compact { display:none; }
#classesView .grade-name-outcome:has(.dictation-correction-badge) { display:grid; justify-items:end; gap:2px; }
#classesView .grade-name-chip .fail-alert { display:grid; place-items:center; width:12px; height:20px; margin:0; font-size:12px; font-weight:850; line-height:1; }
#classesView .grade-name-chip .dictation-correction-badge { margin-left:0; padding:1px 5px; font-size:8px; line-height:1.2; }

/* Preserve the existing teaching-state colors inside the redesigned list. */
#classesView .grade-name-chip.dictation-warning { border-color:#ead9a8; background:#fff7df; color:#8a6415; font-weight:700; }
#classesView .grade-name-chip.dictation-warning .grade-name-id { background:#f8eabf; color:#8a6415; }
#classesView .grade-name-chip.dictation-warning .grade-name-outcome { color:#8a6415; font-weight:780; }
#classesView .grade-name-chip.dictation-passed { border-color:color-mix(in srgb,var(--success) 24%,var(--border)); background:color-mix(in srgb,var(--success) 10%,var(--surface)); color:var(--success); font-weight:700; }
#classesView .grade-name-chip.dictation-passed .grade-name-id { background:color-mix(in srgb,var(--success) 13%,var(--surface)); color:var(--success); }
#classesView .grade-name-chip.dictation-passed .grade-name-outcome { color:var(--success); font-weight:780; }
#classesView .grade-name-chip.dictation-uncorrected { border-color:#dfd3f0; background:color-mix(in srgb,#8b6fbd 13%,var(--surface)); color:#7251a8; font-weight:700; }
#classesView .grade-name-chip.dictation-uncorrected .grade-name-outcome { color:#7251a8; font-weight:780; }
#classesView .grade-name-chip.dictation-warning:hover,
#classesView .grade-name-chip.dictation-warning:focus-visible { border-color:#d9bd72; background:#fff4d4; }
#classesView .grade-name-chip.dictation-passed:hover,
#classesView .grade-name-chip.dictation-passed:focus-visible { border-color:color-mix(in srgb,var(--success) 40%,var(--border)); background:color-mix(in srgb,var(--success) 13%,var(--surface)); }
#classesView .grade-name-empty { margin:14px 15px 15px; padding:24px; border:1px dashed var(--border); border-radius:9px; background:var(--surface-2); }
#classesView :is(.class-record-tab,.grade-folder-tab,.grade-folder-manage,.grade-stage,.homework-summary-card,.grade-analysis-select,.grade-stage-detail-close):focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
@container class-detail (max-width:1300px) {
  #classesView .grade-name-list { grid-template-columns:repeat(6,minmax(0,1fr)); }
}
@container class-detail (max-width:980px) {
  #classesView .grade-stage-grid.levels-4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #classesView .grade-name-list { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@container class-detail (max-width:720px) {
  #classesView .learning-toolbar { grid-template-columns:minmax(0,1fr); gap:10px; }
  #classesView .learning-kind-tabs { width:100%; }
  #classesView .grade-analysis-head { flex-direction:column; align-items:stretch; gap:12px; }
  #classesView .grade-analysis-actions { width:100%; }
  #classesView .grade-analysis-select { width:100%; }
  #classesView .grade-name-list { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@container class-detail (max-width:610px) {
  #classesView .grade-stage-grid:is(.levels-2,.levels-3,.levels-4),
  #classesView .homework-summary-grid { grid-template-columns:1fr; gap:8px; }
  #classesView :is(.grade-stage,.homework-summary-card) { min-height:118px; padding:15px 15px 0; }
  #classesView :is(.grade-stage,.homework-summary-card) .grade-stage-meter { margin-inline:-15px; }
  #classesView .grade-folder-strip { gap:7px; padding:5px; }
  #classesView .grade-folder-tab { min-height:40px; }
  #classesView .grade-folder-manage { min-height:40px; padding:7px 8px; }
  #classesView .grade-analysis-actions .button,
  #classesView .grade-analysis-select { min-height:42px; }
  #classesView .grade-stage-detail-head { padding-inline:10px; }
  #classesView .grade-name-list { padding:9px 10px 10px; }
  #classesView .grade-name-chip { min-height:40px; }
}
@container class-detail (max-width:430px) {
  #classesView .learning-project-label { margin-left:9px; padding-right:9px; }
  #classesView .learning-project-label > span { display:none; }
  #classesView .learning-project-label svg { width:14px; height:14px; }
  #classesView .learning-project-picker select { padding-inline:10px 24px; }
  #classesView .learning-project-chevron { width:12px; height:12px; right:9px; }
  #classesView .grade-name-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #classesView .grade-name-chip { gap:4px; padding-inline:6px; }
  #classesView .grade-name-main { grid-template-columns:20px minmax(0,1fr); gap:4px; }
  #classesView .has-status .grade-name-main { grid-template-columns:10px 20px minmax(0,1fr); }
  #classesView .grade-name-id { width:20px; min-width:20px; }
  #classesView .has-status .grade-name-status,
  #classesView .grade-name-chip .fail-alert { width:10px; }
  #classesView .grade-stage-detail-title { gap:8px; }
  #classesView .grade-stage-detail-count { margin-left:0; }
  #classesView .grade-stage-detail-close span { display:none; }
  #classesView .grade-name-outcome-value { display:none; }
  #classesView .grade-name-outcome-compact { display:inline; }
}
@container class-detail (max-width:340px) {
  #classesView .grade-name-list { grid-template-columns:1fr; }
}
@media(max-width:600px) {
  #classesView .learning-toolbar { grid-template-columns:minmax(0,1fr); gap:10px; padding:10px; border-radius:12px; }
  #classesView .learning-kind-tabs { width:100%; }
  #classesView .learning-kind-tab { min-height:40px; padding:8px 5px; }
  #classesView .class-record-tabs { max-width:calc(100% - 28px); margin:14px 14px 0; }
  #classesView .class-record-tab { min-height:40px; padding:8px 13px; }
  #classesView .grade-folder-strip { margin:13px 0; }
  #classesView .grade-analysis { padding:14px; border-radius:11px; }
  #classesView .grade-analysis-title h3 { font-size:16px; }
  #classesView .grade-analysis-title p { font-size:11px; }
}
@media(max-width:900px) {
  #classesView .class-grade-scroll .grade-matrix { --grade-id-width:52px; --grade-name-width:82px; --grade-score-width:100px; --grade-total-width:82px; }
}
@media(prefers-reduced-motion:reduce) {
  #classesView :is(.class-record-tab,.learning-kind-tab,.learning-kind-indicator,.learning-project-picker,.grade-folder-tab,.grade-stage,.homework-summary-card,.grade-stage-action svg,.grade-stage-meter i) { transition:none; }
}

/* A perfect-only excellent roster shares its result in the heading. Keep the
   people list light, cap wide screens at eight columns, and preserve long names. */
#classesView .grade-name-list.is-perfect {
  grid-template-columns:repeat(auto-fill,minmax(min(100%,max(96px,calc((100% - 49px)/8))),1fr));
}
#classesView .grade-name-list.is-perfect .grade-name-chip {
  grid-template-columns:minmax(0,1fr); min-height:36px; padding:6px 8px;
  border-color:color-mix(in srgb,var(--border) 56%,transparent); box-shadow:none;
}
#classesView .grade-name-list.is-perfect .grade-name-chip:has(.grade-name-outcome) { grid-template-columns:minmax(0,1fr) auto; }
#classesView .grade-name-list.is-perfect .grade-name-name { overflow:visible; white-space:normal; overflow-wrap:anywhere; text-overflow:clip; line-height:1.4; }
#classesView .grade-name-list.is-perfect .grade-name-chip:hover,
#classesView .grade-name-list.is-perfect .grade-name-chip:focus-visible { border-color:color-mix(in srgb,var(--detail-tone) 38%,var(--border)); background:var(--surface-2); }
#classesView .grade-name-list.is-perfect .grade-name-chip:focus-visible { outline:2px solid var(--detail-tone); outline-offset:2px; }
@media(pointer:coarse) { #classesView .grade-name-list.is-perfect .grade-name-chip { min-height:40px; } }
