/* ==========================================================================
   AUTOGRADING - SPEEDGRADER BENTO SPLIT STUDIO
   Bento Grid & Neo-Minimalism Visual Grading Workspace
   Strictly <= 500 LOC, Separation of Concerns
   ========================================================================== */

/* SpeedGrader Container Layout - 3-Column Bento Split Studio */
.speedgrader-studio-layout {
  display: grid;
  grid-template-columns: 240px 1fr 380px;
  gap: 1.15rem;
  min-height: calc(100vh - 220px);
  align-items: stretch;
  background: var(--bento-bg);
  border-radius: var(--bento-radius-card);
}

/* Left Column: Student Roster Tray */
.speedgrader-roster {
  background: var(--bento-surface);
  border: 1px solid var(--bento-border);
  border-radius: var(--bento-radius-card);
  box-shadow: var(--bento-shadow-flat);
  display: flex;
  flex-direction: column;
  padding: 0.85rem;
  gap: 0.45rem;
  overflow-y: auto;
  position: relative;
  transition: var(--bento-transition);
}

.speedgrader-roster::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--bento-inner-highlight);
  pointer-events: none;
}

/* Center Column: Visual Paper Viewer */
.speedgrader-center-pane,
.speedgrader-left-pane {
  background: var(--bento-surface);
  border: 1px solid var(--bento-border);
  border-radius: var(--bento-radius-card);
  box-shadow: var(--bento-shadow-flat);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: var(--bento-transition);
}

.speedgrader-center-pane::before,
.speedgrader-left-pane::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--bento-inner-highlight);
  pointer-events: none;
}

/* SpeedGrader Canvas Toolbar - Anti-Clipping Responsive Design */
.speedgrader-canvas-toolbar {
  min-height: 44px;
  height: auto;
  background: var(--bento-surface);
  border-bottom: 1px solid var(--bento-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.85rem;
  flex-wrap: nowrap;
  gap: 0.45rem;
  position: relative;
  z-index: 5;
}
.sg-toolbar-identity { display: flex; align-items: center; gap: 0.45rem; min-width: 0; flex: 0 1 auto; }
.sg-identity-icon { flex-shrink: 0; color: var(--bento-text-muted); }
.sg-student-title-text { font-weight: 700; font-size: 0.82rem; color: var(--bento-text-title); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-page-indicator-pill { font-size: 0.72rem; font-weight: 600; color: var(--bento-text-muted); background: var(--bento-surface-subtle); border: 1px solid var(--bento-border); padding: 0.15rem 0.5rem; border-radius: var(--bento-radius-pill); white-space: nowrap; flex-shrink: 0; }
.sg-toolbar-controls-cluster { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
.sg-ctrl-group { display: inline-flex; align-items: center; gap: 0.2rem; }
.sg-btn-icon { min-width: 26px; height: 26px; padding: 0 0.4rem !important; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.sg-select-layer { font-size: 0.75rem; padding: 0.2rem 0.5rem; background: var(--bento-surface); border-color: var(--bento-border); color: var(--bento-text-main); cursor: pointer; width: auto; min-width: 130px; }
@media (max-width: 1280px) { .sg-student-title-text { max-width: 130px; } .sg-btn-label { display: none; } }

/* Canvas Viewport */
.speedgrader-canvas-viewport {
  flex: 1;
  background: var(--bento-canvas-bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  position: relative;
  padding: 1rem;
  min-height: 480px;
}

.speedgrader-canvas-viewport canvas,
.speedgrader-canvas-viewport img {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  max-width: 100%;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .speedgrader-canvas-viewport canvas,
body.dark-mode .speedgrader-canvas-viewport canvas,
[data-theme="dark"] .speedgrader-canvas-viewport img,
body.dark-mode .speedgrader-canvas-viewport img {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

/* Right Pane: Bento Rubric & AI Commentary Studio */
.speedgrader-right-pane {
  background: var(--bento-surface);
  border: 1px solid var(--bento-border);
  border-radius: var(--bento-radius-card);
  box-shadow: var(--bento-shadow-flat);
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.25rem;
  gap: 0.85rem;
  overflow-y: auto;
  position: relative;
}

.speedgrader-right-pane::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--bento-inner-highlight);
  pointer-events: none;
}

/* Score Pill Squircle */
.score-pill,
#sg-live-score {
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums !important;
  font-size: 1.15rem !important;
  padding: 0.35rem 0.85rem !important;
  border-radius: var(--bento-radius-tile) !important;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32) !important;
  border: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

/* AI Copilot Commentary Tile */
.sg-copilot-commentary-box {
  background: var(--bento-surface-subtle);
  border: 1px solid var(--bento-border);
  border-radius: var(--bento-radius-tile);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: relative;
}

.sg-copilot-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bento-accent-primary);
}

.sg-copilot-sparkle {
  color: var(--bento-accent-amber);
}

#sg-ai-comment {
  font-size: 0.82rem;
  color: var(--bento-text-body);
  line-height: 1.5;
}

/* Bento Rubric Item Tiles */
.sg-rubric-item-card {
  background: var(--bento-surface);
  border: 1px solid var(--bento-border);
  border-radius: var(--bento-radius-tile);
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: var(--bento-transition);
}

.sg-rubric-item-card:hover {
  border-color: var(--bento-border-hover);
  box-shadow: var(--bento-shadow-hover);
}

.sg-rubric-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sg-rubric-criterion-name {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--bento-text-title);
}

.sg-rubric-score-badge {
  font-family: monospace;
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--bento-accent-primary);
  background: var(--bento-accent-primary-light);
  border: 1px solid var(--bento-accent-primary-border);
  padding: 0.15rem 0.45rem;
  border-radius: var(--bento-radius-pill);
}

/* Progress track in Rubric */
.sg-criterion-progress-track {
  width: 100%;
  height: 4px;
  background: var(--bento-surface-subtle);
  border-radius: var(--bento-radius-pill);
  overflow: hidden;
}

.sg-criterion-progress-fill {
  height: 100%;
  background: var(--bento-accent-emerald);
  border-radius: var(--bento-radius-pill);
  transition: width 0.3s ease;
}

/* Tactile Action Bar in SpeedGrader */
.sg-action-bar {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--bento-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-sg-action {
  flex: 1;
  padding: 0.55rem 0.85rem;
  border-radius: var(--bento-radius-tile);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: var(--bento-transition);
  border: 1px solid transparent;
}

.btn-sg-action-save {
  background: var(--bento-accent-emerald);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
}

.btn-sg-action-save:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-sg-action-rework {
  background: var(--bento-surface-subtle);
  border-color: var(--bento-border);
  color: var(--bento-accent-amber);
}

.btn-sg-action-rework:hover {
  background: var(--bento-surface-hover);
  border-color: var(--bento-accent-amber-border);
}

.btn-sg-action-next {
  background: var(--bento-surface-subtle);
  border-color: var(--bento-border);
  color: var(--bento-text-title);
}

.btn-sg-action-next:hover {
  background: var(--bento-surface-hover);
  border-color: var(--bento-border-hover);
}

/* Responsive SpeedGrader */
@media (max-width: 1024px) {
  .speedgrader-studio-layout,
  .speedgrader-split-container {
    grid-template-columns: 1fr;
  }
  .speedgrader-right-pane {
    max-height: 520px;
  }
}

@media (max-width: 767px) {
  .sg-viewer-toolbar {
    padding: 0.5rem 0.75rem;
  }
  .speedgrader-canvas-viewport {
    min-height: 360px;
    padding: 0.5rem;
  }
  .speedgrader-right-pane {
    padding: 0.85rem 1rem;
  }
  .sg-action-bar {
    flex-direction: column;
  }
  .btn-sg-action {
    width: 100%;
  }
}

/* ==========================================================================
   SMART WORKSPACE CONTEXT CAPSULE (SIDEBAR STREAMLINING)
   ========================================================================== */
.sidebar-smart-context-capsule {
  margin: 0.65rem 0.85rem; padding: 0.55rem 0.75rem; background: var(--bento-surface, #ffffff);
  border: 1px solid var(--bento-border, #e2e8f0); border-radius: var(--bento-radius-tile, 12px);
  box-shadow: var(--bento-shadow-flat, 0 1px 3px rgba(0,0,0,0.05)); position: relative;
  z-index: 100; transition: all 0.2s ease; cursor: pointer;
}
.sidebar-smart-context-capsule.popover-open,
.sidebar-smart-context-capsule[aria-expanded="true"] {
  z-index: 1200 !important;
}
.sidebar-smart-context-capsule:hover {
  border-color: var(--bento-border-hover, #cbd5e1); box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}
.smart-context-header-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.smart-context-title-group { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.smart-context-class-name {
  font-weight: 800; font-size: 0.88rem; color: var(--bento-text-title, #0f172a);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.smart-context-chevron { color: var(--bento-text-muted, #64748b); transition: transform 0.2s ease; }
.smart-context-sub-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.25rem; font-size: 0.72rem; color: var(--bento-text-muted, #64748b);
}
.smart-context-school-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.btn-smart-context-gear {
  background: transparent; border: none; color: var(--bento-text-muted, #64748b);
  cursor: pointer; padding: 2px 4px; border-radius: 4px; font-size: 0.75rem; transition: all 0.15s ease;
}
.btn-smart-context-gear:hover { color: var(--bento-accent-primary, #00c5df); background: var(--bento-surface-subtle, #f8fafc); }

/* Smart Context Docked Inline Class Directory & Popover Menu */
.smart-context-popover {
  position: relative; top: 0; left: 0; right: 0; margin-top: 0.45rem;
  background: var(--bento-surface, #ffffff); border: 1px solid var(--bento-border, #e2e8f0);
  border-radius: var(--bento-radius-tile, 12px); box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  padding: 0.5rem; z-index: 1200 !important; display: flex; flex-direction: column; gap: 0.35rem; cursor: default;
}
.smart-context-popover.open { display: flex !important; }
.smart-context-popover.collapsed { display: none !important; }

.smart-context-grade-chips {
  display: flex; align-items: center; gap: 4px; overflow-x: auto; padding: 0.1rem 0.5rem 0.25rem 0.5rem;
  scrollbar-width: none;
}
.smart-context-grade-chips::-webkit-scrollbar { display: none; }
.smart-context-grade-chip {
  flex-shrink: 0; padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 700;
  border: 1px solid var(--bento-border, #cbd5e1); background: #f8fafc; color: #475569;
  cursor: pointer; transition: all 0.15s ease; line-height: 1.4;
}
.smart-context-grade-chip:hover { border-color: #38bdf8; color: #0284c7; background: #f0f9ff; }
.smart-context-grade-chip.active { background: #0284c7; color: #ffffff; border-color: #0284c7; }
.smart-context-count-badge { font-size: 0.68rem; font-weight: 700; color: #0284c7; }

#smart-context-classes-list {
  display: flex; flex-direction: column; gap: 3px;
  max-height: 240px; overflow-y: auto; overscroll-behavior: contain;
}
#smart-context-classes-list::-webkit-scrollbar { width: 4px; }
#smart-context-classes-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

.smart-context-section-label {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--bento-text-muted, #64748b); padding: 0.2rem 0.45rem 0.1rem 0.45rem;
}
.smart-context-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.4rem 0.6rem; border-radius: 8px; font-size: 0.8rem; font-weight: 500;
  color: var(--bento-text-body, #334155); cursor: pointer; border: none; background: transparent;
  width: 100%; text-align: left; transition: all 0.15s ease;
}
.smart-context-item:hover,
.smart-context-item.keyboard-focused {
  background: var(--bento-surface-subtle, #f1f5f9) !important;
  color: var(--bento-accent-primary, #00c5df) !important;
}
.smart-context-item.active { background: #ecfeff !important; color: #082850 !important; font-weight: 700 !important; }
.smart-context-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.smart-context-item .smart-context-item-label { font-weight: 700; font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.smart-context-item-meta { font-size: 0.7rem; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.smart-context-item.active .smart-context-item-meta { color: #3b82f6; }
.smart-context-item .smart-context-check { color: #2563eb; font-weight: 800; margin-left: 0.5rem; flex-shrink: 0; }
#smart-context-select-school {
  box-sizing: border-box !important; height: 32px !important; line-height: 1.4 !important;
  font-size: 0.78rem !important; padding: 0.2rem 0.5rem !important;
}

/* ==========================================================================
   COMPACT ASSESSMENT BAR (EXAM DETAIL STREAMLINING)
   ========================================================================== */
.compact-assessment-bar {
  position: relative;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1.15rem;
  background: var(--bento-surface, #ffffff);
  border: 1px solid var(--bento-border, #e2e8f0);
  border-radius: var(--bento-radius-card, 16px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  margin-bottom: 0.85rem;
  gap: 0.65rem;
}

.assessment-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.assessment-identity-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.identity-divider {
  width: 1px;
  height: 20px;
  background: var(--bento-border, #e2e8f0);
}

.assessment-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex-wrap: wrap;
}

.compact-assessment-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--bento-text-title, #0f172a);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.btn-compact-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  background: var(--bento-surface-subtle, #f8fafc);
  border: 1px solid var(--bento-border, #e2e8f0);
  border-radius: var(--bento-radius-pill, 9999px);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--bento-text-body, #334155);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-compact-back:hover {
  background: var(--bento-surface, #ffffff);
  border-color: var(--bento-accent-primary, #00c5df);
  color: var(--bento-accent-primary, #00c5df);
}

/* Compact Actions Group */
.assessment-actions-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

.btn-submit-hero {
  background: var(--primary-gradient, linear-gradient(135deg, #00c5df 0%, #00b4d8 50%, #0099b8 100%)) !important;
  color: #082850 !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(0, 197, 223, 0.28) !important;
  font-weight: 750 !important;
}

.btn-submit-hero:hover {
  filter: brightness(1.06);
  box-shadow: 0 4px 12px rgba(0, 197, 223, 0.4) !important;
}

.assessment-more-dropdown {
  position: relative;
  display: inline-flex;
}
.assessment-more-dropdown.open { z-index: 2550 !important; }

.assessment-more-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 240px;
  max-height: min(400px, calc(100vh - 160px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: var(--bento-surface, #ffffff);
  border: 1px solid var(--bento-border, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  padding: 0.45rem;
  z-index: 2600;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.assessment-more-popover.popover-placement-top {
  top: auto;
  bottom: calc(100% + 6px);
  box-shadow: 0 -12px 30px rgba(0,0,0,0.12);
}

.assessment-more-dropdown.open .assessment-more-popover {
  display: flex !important;
}

.dropdown-item-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.65rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--bento-text-body, #334155);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.dropdown-item-btn:hover {
  background: var(--bento-surface-subtle, #f1f5f9);
  color: var(--bento-accent-primary, #00c5df);
}

.dropdown-item-btn.dropdown-item-danger {
  color: #ef4444;
}

.dropdown-item-btn.dropdown-item-danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.dropdown-separator {
  height: 1px;
  background: var(--bento-border, #e2e8f0);
  margin: 0.3rem 0;
}

/* Tier 2: Sub Row */
.assessment-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(226, 232, 240, 0.7);
  flex-wrap: wrap;
}

.assessment-meta-pill {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--bento-text-muted, #64748b);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bento-surface-subtle, #f8fafc);
  padding: 0.2rem 0.6rem;
  border-radius: var(--bento-radius-pill, 9999px);
  border: 1px solid var(--bento-border, #e2e8f0);
}

.assessment-meta-pill strong {
  color: var(--bento-text-title, #0f172a);
  font-weight: 700;
}

.meta-dot {
  color: #cbd5e1;
  font-weight: 400;
}

.studio-sub-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.variant-filter-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.variant-filter-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--bento-text-muted, #64748b);
}

/* ==========================================================================
   SPEEDGRADER COLLAPSIBLE ROSTER STUDIO
   ========================================================================== */
.speedgrader-split-container,
.speedgrader-studio-layout {
  transition: grid-template-columns 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.speedgrader-split-container.roster-collapsed,
.speedgrader-studio-layout.roster-collapsed {
  grid-template-columns: 56px 1fr 380px !important;
}

.btn-roster-collapse-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--bento-border, #e2e8f0);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  color: var(--bento-text-muted, #64748b);
  transition: all 0.15s ease;
  padding: 0;
}

.btn-roster-collapse-toggle:hover {
  background: var(--bento-surface-subtle, #f1f5f9);
  color: var(--bento-accent-primary, #00c5df);
  border-color: var(--bento-accent-primary, #00c5df);
}

.speedgrader-studio-layout.roster-collapsed .student-meta-details,
.speedgrader-studio-layout.roster-collapsed .roster-header-text,
.speedgrader-studio-layout.roster-collapsed .sg-roster-progress-card,
.speedgrader-studio-layout.roster-collapsed .sg-roster-search-box,
.speedgrader-studio-layout.roster-collapsed .btn-roster-delete-sub,
.speedgrader-split-container.roster-collapsed .speedgrader-roster-pane .student-meta-details,
.speedgrader-split-container.roster-collapsed .speedgrader-roster-pane .roster-header-text,
.speedgrader-split-container.roster-collapsed .speedgrader-roster-pane .sg-roster-progress-card,
.speedgrader-split-container.roster-collapsed .speedgrader-roster-pane .sg-roster-search-box {
  display: none !important;
}

.speedgrader-studio-layout.roster-collapsed .sg-roster-header {
  padding: 0 0 0.35rem 0 !important;
  border-bottom: 1px solid var(--bento-border, #e2e8f0) !important;
  margin-bottom: 0.35rem !important;
}

.speedgrader-studio-layout.roster-collapsed .sg-roster-title-row {
  justify-content: center !important;
}

.speedgrader-studio-layout.roster-collapsed .speedgrader-roster-item,
.speedgrader-split-container.roster-collapsed .student-item {
  padding: 0.35rem 0 !important;
  justify-content: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.speedgrader-studio-layout.roster-collapsed .student-score-badge {
  justify-content: center !important;
  width: 100% !important;
}

.speedgrader-studio-layout.roster-collapsed .score-pill {
  min-width: 34px !important;
  padding: 0.15rem 0.2rem !important;
  font-size: 0.72rem !important;
  text-align: center !important;
  margin: 0 auto !important;
}

.speedgrader-studio-layout.roster-collapsed .speedgrader-roster {
  padding: 0.5rem 0.25rem !important;
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

/* Floating Canvas Controls */
.sg-floating-canvas-toolbar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--bento-radius-pill, 9999px);
  padding: 0.3rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}

[data-theme="dark"] .sg-floating-canvas-toolbar,
body.dark-mode .sg-floating-canvas-toolbar {
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(51, 65, 85, 0.9);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

.sticky-rubric-top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bento-surface, #ffffff);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--bento-border, #e2e8f0);
}

