/* =========================================================
   TYPECODE - VIEW: TAHAP 3 PENILAIAN DEBUGGING CODE
   Full-Screen Responsive Grading Workspace (100vw × 100vh)
   Theme: Handcrafted Charcoal & Paper Sketch Design System
   Layout: Editor-First Side-by-Side (50:50) Workspace
   ========================================================= */

:root {
  --bugfix-bg: var(--bg-base, #161615);
  --bugfix-surface: var(--bg-surface, #22211f);
  --bugfix-surface-elevated: var(--bg-elevated, #1c1c1a);
  --bugfix-surface-hover: var(--bg-hover, #2c2a26);
  --bugfix-surface-active: var(--bg-active, #383530);

  --bugfix-editor-bg: var(--bg-editor, #121211);
  --bugfix-editor-border: var(--border-editor, #3d3a35);

  --bugfix-line: var(--border-subtle, rgba(245, 242, 235, 0.08));
  --bugfix-line-strong: var(--border-strong, #3d3a35);

  --bugfix-text: var(--text-primary, #f5f2eb);
  --bugfix-text-secondary: var(--text-secondary, #aba396);
  --bugfix-text-tertiary: var(--text-tertiary, #736c61);

  --bugfix-brand: var(--brand-indigo, #e6ac4b);
  --bugfix-emerald: var(--accent-emerald, #5eb886);
  --bugfix-amber: var(--accent-amber, #e6ac4b);
  --bugfix-rose: var(--accent-rose, #e05a47);
}

/* ================= FULLSCREEN APP CONTAINER ================= */

.bugfix-fullscreen-app {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 9999;
  background: var(--bugfix-bg);
  color: var(--bugfix-text);
  font-family: var(--font-ui, system-ui, sans-serif);
  overflow: hidden;
  box-sizing: border-box;
}

.bugfix-fullscreen-app.hidden {
  display: none !important;
}

.bugfix-fullscreen-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* ================= 1. HEADER (TOPBAR) ================= */

.bugfix-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 20px;
  background: var(--bugfix-surface);
  border-bottom: 1px solid var(--bugfix-line);
  box-sizing: border-box;
  z-index: 10;
  gap: 12px;
  flex-shrink: 0;
  min-height: 52px;
}

.bugfix-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.bugfix-title-wrap h2 {
  font-size: clamp(14px, 1.2vw, 16px);
  font-weight: 700;
  color: var(--bugfix-text);
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
}

.bugfix-title-wrap p {
  font-size: clamp(11.5px, 0.95vw, 12.5px);
  color: var(--bugfix-text-secondary);
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.bugfix-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.bugfix-nav-group {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bugfix-surface-elevated);
  border: 1px solid var(--bugfix-line);
  border-radius: var(--radius-md, 8px);
  padding: 2px;
}

.bugfix-nav-group button {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm, 6px);
  background: var(--bugfix-surface);
  border: 1px solid var(--bugfix-line);
  color: var(--bugfix-text-secondary);
  cursor: pointer;
  transition: var(--transition-fast, 140ms ease);
}

.bugfix-nav-group button:hover:not(:disabled) {
  background: var(--bugfix-surface-hover);
  border-color: var(--bugfix-line-strong);
  color: var(--bugfix-text);
}

.bugfix-nav-group button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bugfix-nav-counter {
  font-size: 11.5px;
  font-family: var(--font-mono, monospace);
  color: var(--bugfix-text-tertiary);
  padding: 0 6px;
  min-width: 56px;
  text-align: center;
  user-select: none;
  font-weight: 600;
}

.bugfix-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-xs, 4px);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  border: 1px solid var(--bugfix-line);
  user-select: none;
  vertical-align: middle;
}

.bugfix-status-badge.graded {
  background: var(--bugfix-surface-elevated);
  color: var(--bugfix-emerald);
  border-color: rgba(94, 184, 134, 0.35);
}

.bugfix-status-badge.pending {
  background: var(--bugfix-surface-elevated);
  color: var(--bugfix-amber);
  border-color: rgba(230, 172, 75, 0.35);
}

/* Button styles */
.bugfix-btn {
  padding: 6px 13px;
  border: 1px solid var(--bugfix-line);
  border-radius: var(--radius-md, 8px);
  background: var(--bugfix-surface-elevated);
  color: var(--bugfix-text);
  cursor: pointer;
  font-family: var(--font-ui, inherit);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: var(--transition-fast, 140ms ease);
  user-select: none;
}

.bugfix-btn:hover:not(:disabled) {
  background: var(--bugfix-surface-hover);
  border-color: var(--bugfix-line-strong);
  color: var(--bugfix-text);
  transform: translateY(-1px);
}

.bugfix-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.bugfix-btn.btn-secondary {
  background: var(--bugfix-surface);
  border: 1px solid var(--bugfix-line);
  color: var(--bugfix-text-secondary);
}

.bugfix-btn.btn-secondary:hover:not(:disabled) {
  background: var(--bugfix-surface-hover);
  border-color: var(--bugfix-line-strong);
  color: var(--bugfix-text);
}

.bugfix-btn.success {
  background: var(--bugfix-emerald);
  border-color: var(--bugfix-emerald);
  color: #ffffff;
}

.bugfix-btn.success:hover:not(:disabled) {
  filter: brightness(1.08);
}

/* ================= 2. INFO BAR (Sticky) ================= */

.bugfix-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  background: var(--bugfix-surface-elevated);
  border-bottom: 1px solid var(--bugfix-line);
  box-sizing: border-box;
  font-size: 12px;
  min-height: 36px;
  flex-shrink: 0;
}

.bugfix-info-case {
  color: var(--bugfix-brand);
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.03em;
}

.bugfix-info-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bugfix-q-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bugfix-q-tab {
  padding: 3px 10px;
  border-radius: var(--radius-sm, 6px);
  font-size: 11.5px;
  font-family: var(--font-mono, monospace);
  background: var(--bugfix-surface);
  border: 1px solid var(--bugfix-line);
  color: var(--bugfix-text-secondary);
  cursor: pointer;
  transition: var(--transition-fast, 140ms ease);
}

.bugfix-q-tab:hover {
  background: var(--bugfix-surface-hover);
  border-color: var(--bugfix-line-strong);
  color: var(--bugfix-text);
}

.bugfix-q-tab.active {
  background: var(--bugfix-surface-active);
  border-color: var(--bugfix-brand);
  color: var(--bugfix-brand);
  font-weight: 700;
}

.bugfix-blank-badge {
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  color: var(--bugfix-text-secondary);
  background: var(--bugfix-surface);
  border: 1px solid var(--bugfix-line);
  padding: 2px 8px;
  border-radius: var(--radius-xs, 4px);
}

/* ================= 3. WORKSPACE (2 PANEL SEJAJAR 50:50) ================= */

.bugfix-workspace {
  display: flex !important;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  padding: 10px 20px;
  overflow-x: auto;
  overflow-y: hidden;
  box-sizing: border-box;
  background: var(--bugfix-bg);
  flex: 1 1 0%;
  min-height: 0;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.bugfix-workspace::-webkit-scrollbar {
  height: 12px;
}

.bugfix-workspace::-webkit-scrollbar-track {
  background: var(--bugfix-bg, #161615);
  border-radius: 6px;
}

.bugfix-workspace::-webkit-scrollbar-thumb {
  background: rgba(245, 242, 235, 0.35);
  border-radius: 6px;
  border: 2px solid var(--bugfix-bg, #161615);
}

.bugfix-workspace::-webkit-scrollbar-thumb:hover {
  background: var(--bugfix-brand, #e6ac4b);
}

.bugfix-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 50%;
  min-width: 280px;
  background: var(--bugfix-surface);
  border: 1px solid var(--bugfix-line);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  box-sizing: border-box;
  min-height: 0;
  height: 100%;
  transition: flex 60ms ease;
}

/* Draggable Splitter Divider between Left & Right Panel */
.bugfix-splitter,
.stage4-splitter {
  width: 14px;
  flex: 0 0 14px;
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  z-index: 10;
  background: transparent;
  transition: background var(--transition-fast, 140ms ease);
}

.bugfix-splitter:hover,
.bugfix-splitter.is-dragging,
.stage4-splitter:hover,
.stage4-splitter.is-dragging {
  background: rgba(230, 172, 75, 0.18);
}

.bugfix-splitter-handle {
  width: 4px;
  height: 44px;
  background: var(--bugfix-line, #3a3a38);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bugfix-text-secondary);
  font-size: 9px;
  transition: all var(--transition-fast, 140ms ease);
}

.bugfix-splitter:hover .bugfix-splitter-handle,
.bugfix-splitter.is-dragging .bugfix-splitter-handle,
.stage4-splitter:hover .bugfix-splitter-handle,
.stage4-splitter.is-dragging .bugfix-splitter-handle {
  background: var(--bugfix-brand, #e6ac4b);
  color: #121211;
  width: 6px;
  height: 56px;
}

.bugfix-panel-header {
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bugfix-surface-elevated);
  border-bottom: 1px solid var(--bugfix-line);
  box-sizing: border-box;
  flex-shrink: 0;
}

.bugfix-panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bugfix-panel-header h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--bugfix-text);
  margin: 0;
  letter-spacing: 0.02em;
}

.bugfix-panel-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-xs, 4px);
  border: 1px solid var(--bugfix-line);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.02em;
}

.bugfix-panel-tag.student {
  color: var(--bugfix-amber, #e6ac4b);
  background: rgba(230, 172, 75, 0.12);
  border-color: rgba(230, 172, 75, 0.35);
}

.bugfix-panel-tag.reference {
  color: var(--bugfix-emerald, #5eb886);
  background: rgba(94, 184, 134, 0.12);
  border-color: rgba(94, 184, 134, 0.35);
}

/* Code Editor Container with Line Numbers */
.bugfix-editor-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
  background: var(--bugfix-editor-bg, #121211);
  box-sizing: border-box;
}

.bugfix-code-scroll {
  flex: 1 1 0%;
  min-height: 0;
  overflow-x: auto !important;
  overflow-y: auto;
  padding: 10px 0;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.bugfix-code-scroll.is-grabbing {
  cursor: grabbing !important;
  user-select: none !important;
}

.bugfix-code-scroll::-webkit-scrollbar {
  width: 10px;
  height: 12px;
}

.bugfix-code-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
}

.bugfix-code-scroll::-webkit-scrollbar-thumb {
  background: rgba(245, 242, 235, 0.4);
  border-radius: 6px;
  border: 2px solid var(--bugfix-editor-bg, #121211);
}

.bugfix-code-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--bugfix-brand, #e6ac4b);
}

.bugfix-code-lines {
  display: table;
  min-width: 100%;
  width: max-content;
  border-collapse: collapse;
}

.bugfix-code-row {
  display: table-row;
  min-height: 24px;
  transition: background var(--transition-fast, 140ms ease);
}

.bugfix-code-row:hover {
  background: rgba(245, 242, 235, 0.035);
}

.bugfix-line-num {
  display: table-cell;
  width: 44px;
  min-width: 44px;
  padding: 0 12px 0 0;
  text-align: right;
  color: var(--bugfix-text-tertiary, #736c61);
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  border-right: 1px solid var(--bugfix-line, rgba(245, 242, 235, 0.08));
  vertical-align: top;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 14px;
  line-height: 1.7;
}

.bugfix-line-num::before {
  content: attr(data-line);
}

.bugfix-code-row:hover .bugfix-line-num {
  color: var(--bugfix-text-secondary, #aba396);
}

.bugfix-line-code {
  display: table-cell;
  padding: 0 16px;
  white-space: pre !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  color: var(--bugfix-text, #f5f2eb);
  vertical-align: top;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 17px;
  line-height: 1.7;
  tab-size: 4;
  -moz-tab-size: 4;
}

/* Highlighted answer inside code */
mark.bugfix-answer-inline {
  background: rgba(230, 172, 75, 0.18);
  color: var(--bugfix-brand, #e6ac4b);
  border: 1px solid rgba(230, 172, 75, 0.45);
  padding: 1px 7px;
  border-radius: var(--radius-xs, 4px);
  font-weight: 700;
  font-family: inherit;
}

mark.bugfix-answer-inline.is-empty {
  background: rgba(224, 90, 71, 0.12);
  color: var(--bugfix-rose, #e05a47);
  border: 1px dashed rgba(224, 90, 71, 0.5);
  font-style: italic;
  font-weight: 500;
  padding: 1px 6px;
}

mark.bugfix-answer-inline.bugfix-ref-mark {
  background: rgba(94, 184, 134, 0.16);
  color: var(--bugfix-emerald, #5eb886);
  border: 1px solid rgba(94, 184, 134, 0.45);
  padding: 1px 7px;
  border-radius: var(--radius-xs, 4px);
  font-weight: 700;
  font-family: inherit;
}

mark.bugfix-marker {
  background: rgba(148, 163, 184, 0.12);
  color: var(--bugfix-text-secondary);
  border: 1px dashed var(--bugfix-line-strong);
  padding: 1px 6px;
  border-radius: var(--radius-xs, 4px);
  font-weight: 600;
}

/* Reference notes container in right panel */
.bugfix-ref-notes {
  border-top: 2px solid var(--bugfix-line-strong, #3d3a35);
  background: var(--bugfix-surface-elevated, #1c1c1a);
  display: flex;
  flex-direction: column;
  min-height: 140px;
  height: clamp(160px, 30vh, 280px);
  max-height: 50vh;
  flex-shrink: 0;
  box-sizing: border-box;
  resize: vertical;
  overflow: hidden;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.25);
}

.bugfix-ref-notes-header {
  padding: 8px 16px;
  background: var(--bugfix-surface, #22211f);
  border-bottom: 1px solid var(--bugfix-line, rgba(245, 242, 235, 0.08));
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.bugfix-ref-notes-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--bugfix-text, #f5f2eb);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-ui, system-ui, sans-serif);
  display: flex;
  align-items: center;
}

.bugfix-ref-notes-hint {
  font-size: 11px;
  color: var(--bugfix-text-tertiary, #736c61);
  display: flex;
  align-items: center;
  gap: 4px;
}

.bugfix-ref-notes-body {
  padding: 12px 18px;
  overflow-y: auto;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--bugfix-text, #f5f2eb);
  white-space: pre-wrap;
  font-family: var(--font-ui, system-ui, sans-serif);
  box-sizing: border-box;
  flex: 1 1 auto;
}

.bugfix-ref-notes-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.bugfix-ref-notes-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.bugfix-ref-notes-body::-webkit-scrollbar-thumb {
  background: rgba(245, 242, 235, 0.25);
  border-radius: 4px;
}

.bugfix-ref-notes-body::-webkit-scrollbar-thumb:hover {
  background: var(--bugfix-brand, #e6ac4b);
}

/* ================= 4. PENJELASAN MAHASISWA ================= */

.bugfix-explanation {
  padding: 5px 20px 6px;
  background: var(--bugfix-surface);
  border-top: 1px solid var(--bugfix-line);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  flex-shrink: 0;
  max-height: clamp(55px, 9.5vh, 85px);
  overflow: hidden;
}

.bugfix-explanation-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
  flex-shrink: 0;
}

.bugfix-explanation-head h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--bugfix-text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bugfix-explanation-head span {
  font-size: 11px;
  color: var(--bugfix-text-tertiary);
}

.bugfix-explanation-box {
  width: 100%;
  flex: 1 1 0%;
  min-height: 0;
  border: 1px solid var(--bugfix-editor-border);
  border-radius: var(--radius-sm, 6px);
  background: var(--bugfix-editor-bg);
  color: var(--bugfix-text);
  padding: 5px 12px;
  font-family: var(--font-ui, inherit);
  font-size: 18px;
  line-height: 1.45;
  overflow-y: auto;
  box-sizing: border-box;
}

/* ================= 5. SCORING SECTION (RUBRIK) ================= */

/* ================= 5. SCORING SECTION (RUBRIK PROPORSIONAL) ================= */

.bugfix-scoring {
  padding: 8px 24px;
  border-top: 1px solid var(--bugfix-line);
  background: var(--bugfix-surface-elevated);
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.bugfix-scoring-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Bagian Kiri: Info & Label */
.bugfix-scoring-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 220px;
}

.bugfix-scoring-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md, 8px);
  background: rgba(230, 172, 75, 0.12);
  border: 1px solid rgba(230, 172, 75, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bugfix-brand, #e6ac4b);
  font-size: 15px;
  flex-shrink: 0;
}

.bugfix-scoring-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.bugfix-scoring-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--bugfix-text, #f5f2eb);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.bugfix-scoring-subtitle {
  font-size: 11px;
  color: var(--bugfix-text-tertiary, #736c61);
  white-space: nowrap;
}

/* Bagian Tengah: Slider & 10 Angka Proporsional */
.bugfix-scoring-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1 1 480px;
  max-width: 580px;
  min-width: 260px;
  box-sizing: border-box;
}

.bugfix-likert-range {
  width: 100%;
  margin: 0;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bugfix-bg, #121211);
  border: 1px solid var(--bugfix-line, rgba(245, 242, 235, 0.12));
  border-radius: var(--radius-full, 999px);
  outline: none;
  cursor: pointer;
  accent-color: var(--bugfix-brand, #e6ac4b);
  box-sizing: border-box;
}

.bugfix-likert-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bugfix-brand, #e6ac4b);
  border: 2px solid var(--bugfix-surface, #1e1e1d);
  cursor: pointer;
  transition: transform 0.1s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.bugfix-likert-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.bugfix-numbers {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  box-sizing: border-box;
}

.bugfix-tick-btn {
  text-align: center;
  padding: 4px 0 !important;
  background: var(--bugfix-surface) !important;
  border: 1px solid var(--bugfix-line);
  border-radius: var(--radius-sm, 6px);
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono, monospace);
  color: var(--bugfix-text-secondary) !important;
  cursor: pointer;
  transition: var(--transition-fast, 140ms ease);
  min-width: 0 !important;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.2;
  user-select: none;
  overflow: hidden;
  text-overflow: clip;
}

.bugfix-tick-btn:hover:not(:disabled) {
  background: var(--bugfix-surface-hover) !important;
  color: var(--bugfix-text) !important;
  border-color: var(--bugfix-line-strong);
  transform: translateY(-1px);
}

.bugfix-tick-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bugfix-tick-btn.active {
  background: var(--bugfix-brand) !important;
  border-color: var(--bugfix-brand) !important;
  color: #121211 !important;
  font-weight: 700;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(230, 172, 75, 0.35);
}

.bugfix-tick-btn.active::before {
  display: none !important;
}

/* Bagian Kanan: Badge Poin & Tombol Simpan */
.bugfix-scoring-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.bugfix-scoring-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bugfix-surface, #1e1e1d);
  border: 1px solid var(--bugfix-line, rgba(245, 242, 235, 0.12));
  border-radius: var(--radius-md, 8px);
  padding: 6px 12px;
  box-sizing: border-box;
}

.bugfix-scoring-badge-label {
  font-size: 11.5px;
  color: var(--bugfix-text-tertiary, #736c61);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.bugfix-scoring-badge-val {
  font-family: var(--font-mono, monospace);
  font-size: 15px;
  color: var(--bugfix-emerald, #5eb886);
  font-weight: 700;
}

.bugfix-scoring-save-btn {
  font-size: 12.5px !important;
  padding: 7px 16px !important;
  white-space: nowrap;
}

/* Clickable T3 Badge Chip */
.chip-clickable-t3 {
  cursor: pointer !important;
  transition:
    transform var(--transition-fast, 140ms ease),
    filter var(--transition-fast, 140ms ease);
}

.chip-clickable-t3:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}

/* ================= RESPONSIVE (WIDTH & HEIGHT OPTIMIZATIONS) ================= */

/* Compact topbar on intermediate desktop widths */
@media (max-width: 1200px) {
  .bugfix-topbar {
    padding: 5px 14px;
    gap: 8px;
  }

  .bugfix-topbar-actions {
    gap: 5px;
  }

  .bugfix-btn {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  .bugfix-nav-group button {
    padding: 4px 8px;
    font-size: 11px;
  }

  .bugfix-nav-counter {
    min-width: 48px;
    font-size: 11px;
  }
}

/* Laptops with standard 768p / 720p height (1366x768, 1280x720, 1280x800) */
@media (max-height: 720px) {
  .bugfix-topbar {
    padding: 4px 16px;
    min-height: 46px;
  }

  .bugfix-info {
    min-height: 32px;
    padding: 0 16px;
    font-size: 11.5px;
  }

  .bugfix-workspace {
    padding: 6px 16px;
    gap: 12px;
  }

  .bugfix-panel-header {
    padding: 6px 12px;
  }

  .bugfix-panel-header h3 {
    font-size: 12.5px;
  }

  .bugfix-explanation {
    padding: 4px 16px 5px;
    max-height: 64px;
  }

  .bugfix-explanation-box {
    padding: 4px 10px;
    font-size: 18px;
  }

  .bugfix-scoring {
    padding: 6px 16px;
  }

  .bugfix-scoring-inner {
    gap: 12px;
  }

  .bugfix-scoring-left {
    min-width: 170px;
  }

  .bugfix-scoring-title {
    font-size: 12px;
  }

  .bugfix-scoring-subtitle {
    display: none;
  }

  .bugfix-scoring-center {
    max-width: 440px;
    gap: 3px;
  }

  .bugfix-likert-range {
    height: 5px;
  }

  .bugfix-tick-btn {
    padding: 3px 0 !important;
    font-size: 11px;
  }

  .bugfix-scoring-save-btn {
    padding: 6px 12px !important;
    font-size: 11.5px !important;
  }
}

/* Short screens fallback (height <= 540px) */
@media (max-height: 540px) {
  .bugfix-fullscreen-app {
    overflow-y: auto;
  }

  .bugfix-fullscreen-inner {
    height: auto;
    min-height: 540px;
  }
}

/* Tablets & Mobile Screens (width <= 860px) */
@media (max-width: 860px) {
  .bugfix-fullscreen-app {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  .bugfix-fullscreen-inner {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .bugfix-topbar {
    padding: 8px 14px;
    flex-wrap: wrap;
    gap: 8px;
    min-height: auto;
  }

  .bugfix-topbar-actions {
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-between;
  }

  .bugfix-info {
    padding: 6px 14px;
    flex-wrap: wrap;
    gap: 6px;
    min-height: auto;
  }

  .bugfix-workspace {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
    overflow: visible;
  }

  .bugfix-panel {
    min-height: 280px;
  }

  .bugfix-explanation {
    padding: 10px 14px;
    max-height: none;
  }

  .bugfix-scoring {
    padding: 8px 12px;
  }

  .bugfix-scoring-inner {
    flex-direction: column;
    gap: 8px;
  }

  .bugfix-scoring-left {
    width: 100%;
    min-width: auto;
    justify-content: space-between;
  }

  .bugfix-scoring-center {
    width: 100%;
    max-width: 100%;
  }

  .bugfix-scoring-right {
    width: 100%;
    justify-content: space-between;
  }

  .bugfix-numbers {
    gap: 3px;
  }

  .bugfix-tick-btn {
    padding: 4px 0 !important;
    font-size: 11px;
  }
}

/* ================= TAHAP 4: FULLSCREEN STUDI KASUS WORKSPACE ================= */

.stage4-fullscreen-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.stage4-main-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  background: var(--bugfix-bg);
  width: 100%;
  max-width: 100%;
}

.stage4-case-banner {
  background: var(--bugfix-surface);
  border: 1px solid var(--bugfix-line);
  border-radius: var(--radius-lg, 12px);
  padding: 14px 20px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.stage4-case-banner-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.stage4-case-banner-header h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--bugfix-text);
  margin: 0;
  letter-spacing: 0.02em;
}

.stage4-case-banner-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--bugfix-text-secondary);
  white-space: pre-wrap;
}

.stage4-workspace-tabs-card {
  background: var(--bugfix-surface);
  border: 1px solid var(--bugfix-line);
  border-radius: var(--radius-lg, 12px);
  padding: 10px 16px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.stage4-workspace-tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.stage4-tabs-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--bugfix-text);
}

.stage4-tabs-title i {
  color: var(--bugfix-brand, #e0a96d);
}

.stage4-file-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.stage4-file-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--bugfix-surface-elevated, #1c1c1a);
  border: 1px solid var(--bugfix-line, rgba(245, 242, 235, 0.12));
  color: var(--bugfix-text-secondary, #b8b3a8);
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast, 140ms ease);
}

.stage4-file-tab:hover {
  background: var(--bugfix-surface-hover, #242422);
  color: var(--bugfix-text, #f5f2eb);
  border-color: rgba(245, 242, 235, 0.25);
}

.stage4-file-tab.active {
  background: rgba(224, 169, 109, 0.15);
  border-color: var(--bugfix-brand, #e0a96d);
  color: var(--bugfix-brand, #e0a96d);
  font-weight: 700;
}

.stage4-tab-missing-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-family: var(--font-sans, sans-serif);
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-weight: 600;
  text-transform: uppercase;
}

.stage4-workspace {
  display: flex !important;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  height: 540px;
  min-height: 400px;
  max-height: 70vh;
  box-sizing: border-box;
  width: 100%;
}

.stage4-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 50%;
  min-width: 280px;
  height: 100%;
  background: var(--bugfix-surface);
  border: 1px solid var(--bugfix-line);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  box-sizing: border-box;
  transition: flex 60ms ease;
}

.stage4-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bugfix-surface-elevated);
  border-bottom: 1px solid var(--bugfix-line);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* File Pills in Panel Header */
.stage4-panel-file-pills {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.stage4-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-family: var(--font-mono, monospace);
  color: var(--bugfix-text-secondary);
  background: var(--bugfix-surface);
  border: 1px solid var(--bugfix-line);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast, 140ms ease);
}

.stage4-pill-btn:hover {
  background: var(--bugfix-surface-hover);
  color: var(--bugfix-text);
  border-color: rgba(245, 242, 235, 0.25);
}

.stage4-pill-btn.active {
  background: rgba(230, 172, 75, 0.18);
  border-color: var(--bugfix-brand, #e6ac4b);
  color: var(--bugfix-brand, #e6ac4b);
  font-weight: 700;
}

.stage4-pill-btn.pill-ref.active {
  background: rgba(94, 184, 134, 0.18);
  border-color: var(--bugfix-emerald, #5eb886);
  color: var(--bugfix-emerald, #5eb886);
}

.stage4-active-file-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: var(--bugfix-text-secondary);
  background: var(--bugfix-surface-elevated);
  padding: 2px 10px;
  border-radius: 4px;
  border: 1px solid var(--bugfix-line);
}

.stage4-panes-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  padding: 8px;
  box-sizing: border-box;
}

.stage4-panes-wrap::-webkit-scrollbar {
  width: 10px;
}

.stage4-panes-wrap::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
}

.stage4-panes-wrap::-webkit-scrollbar-thumb {
  background: rgba(245, 242, 235, 0.3);
  border-radius: 6px;
}

.stage4-panes-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--bugfix-brand, #e6ac4b);
}

/* Stacked Multi-File View */
.stage4-stacked-file-card {
  margin-bottom: 14px;
  background: var(--bugfix-editor-bg, #121211);
  border: 1px solid var(--bugfix-line);
  border-radius: var(--radius-sm, 6px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  flex-shrink: 0;
}

.stage4-stacked-file-card:last-child {
  margin-bottom: 0;
}

.stage4-stacked-file-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bugfix-surface-elevated, #242422);
  border-bottom: 1px solid var(--bugfix-line);
  font-size: 12px;
  user-select: none;
}

.stage4-stacked-file-name {
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  color: var(--bugfix-text);
  display: flex;
  align-items: center;
  gap: 7px;
}

.stage4-stacked-file-meta {
  font-size: 11px;
  color: var(--bugfix-text-tertiary);
  font-family: var(--font-mono, monospace);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Minimalist Copy Code Button per file (Tahap 4 & Tahap 3) */
.stage4-copy-btn,
.bugfix-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 242, 235, 0.04);
  border: 1px solid var(--bugfix-line, rgba(245, 242, 235, 0.12));
  border-radius: var(--radius-xs, 4px);
  color: var(--bugfix-text-secondary, #b8b3a8);
  font-family: var(--font-ui, sans-serif);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  cursor: pointer;
  transition: var(--transition-fast, 140ms ease);
  line-height: 1.3;
  user-select: none;
}

.stage4-copy-btn:hover,
.bugfix-copy-btn:hover {
  background: var(--bugfix-surface-hover, #2a2a28);
  color: var(--bugfix-text, #f5f2eb);
  border-color: var(--bugfix-brand, #e6ac4b);
}

.stage4-copy-btn.copied,
.bugfix-copy-btn.copied {
  background: rgba(94, 184, 134, 0.18) !important;
  border-color: var(--bugfix-emerald, #5eb886) !important;
  color: var(--bugfix-emerald, #5eb886) !important;
}

/* Minimalist Copy All Files Button in Panel Header */
.stage4-copy-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px dashed var(--bugfix-line, rgba(245, 242, 235, 0.18));
  border-radius: var(--radius-xs, 4px);
  color: var(--bugfix-text-secondary, #b8b3a8);
  font-family: var(--font-ui, sans-serif);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  cursor: pointer;
  transition: var(--transition-fast, 140ms ease);
  line-height: 1.3;
  user-select: none;
  margin-left: 6px;
}

.stage4-copy-all-btn:hover {
  background: var(--bugfix-surface-hover, #2a2a28);
  color: var(--bugfix-text, #f5f2eb);
  border-color: var(--bugfix-brand, #e6ac4b);
  border-style: solid;
}

.stage4-copy-all-btn.copied {
  background: rgba(94, 184, 134, 0.18) !important;
  border-color: var(--bugfix-emerald, #5eb886) !important;
  color: var(--bugfix-emerald, #5eb886) !important;
  border-style: solid;
}

.stage4-stacked-file-body {
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.stage4-stacked-file-card .bugfix-editor-container {
  min-height: 100px;
  max-height: 480px;
}

.stage4-stacked-file-card.is-single-view {
  height: 100%;
  flex: 1 1 auto;
  margin-bottom: 0;
}

.stage4-stacked-file-card.is-single-view .bugfix-editor-container {
  max-height: none;
  height: 100%;
}

.stage4-file-pane {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.stage4-file-pane.active {
  display: flex;
}

.stage4-file-pane .bugfix-editor-container {
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

.stage4-empty-file-notice {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: var(--bugfix-editor-bg, #121211);
  color: var(--bugfix-text-secondary);
  font-size: 13px;
  text-align: center;
}

.stage4-empty-file-notice.warning {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.04);
}

.stage4-empty-file-notice.info {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.04);
}

.stage4-empty-file-icon {
  font-size: 28px;
  opacity: 0.8;
}

.stage4-empty-file-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.stage4-empty-file-text code {
  font-family: var(--font-mono, monospace);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--bugfix-text);
}

/* Dedicated Side-by-Side Section Cards (Output, Terminal, Run) */
.stage4-section-card {
  background: var(--bugfix-surface);
  border: 1px solid var(--bugfix-line);
  border-radius: var(--radius-lg, 12px);
  padding: 16px 20px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.stage4-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bugfix-line);
}

.stage4-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stage4-section-title h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--bugfix-text);
  margin: 0;
}

.stage4-section-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bugfix-surface-elevated);
  border: 1px solid var(--bugfix-line);
  color: var(--bugfix-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
}

.stage4-section-desc {
  font-size: 12px;
  color: var(--bugfix-text-tertiary);
}

.stage4-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  box-sizing: border-box;
}

.stage4-subcard {
  display: flex;
  flex-direction: column;
  background: var(--bugfix-surface-elevated);
  border: 1px solid var(--bugfix-line);
  border-radius: var(--radius-md, 8px);
  padding: 12px;
  box-sizing: border-box;
  gap: 8px;
}

.stage4-subcard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stage4-subcard-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--bugfix-text);
}

.stage4-subcard-title.student {
  color: var(--bugfix-brand, #e0a96d);
  font-size: 18px;
}

.stage4-subcard-title.reference {
  color: var(--bugfix-emerald, #10b981);
  font-size: 18px;
}

/* Output Program Mahasiswa & Output Acuan Tahap 4 Semua Level (Level 1, 2, 3, 4) (18px) */
.stage4-output-pre {
  background: var(--bugfix-editor-bg);
  border: 1px solid var(--bugfix-line);
  border-radius: 6px;
  padding: 12px 16px;
  font-family: var(--font-mono, monospace);
  font-size: 18px;
  line-height: 1.6;
  color: var(--bugfix-text);
  white-space: pre-wrap;
  margin: 0;
  max-height: 280px;
  overflow-y: auto;
  box-sizing: border-box;
}

.stage4-output-pre code {
  font-family: inherit;
  font-size: 18px;
}

.stage4-cmd-pre {
  background: var(--bugfix-editor-bg);
  border: 1px solid var(--bugfix-line);
  border-radius: 6px;
  padding: 10px 14px;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  line-height: 1.55;
  color: var(--bugfix-text);
  white-space: pre-wrap;
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
  box-sizing: border-box;
}

.stage4-fs-tree-panel {
  background: var(--bugfix-editor-bg);
  border: 1px solid var(--bugfix-line);
  border-radius: 6px;
  padding: 10px 14px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: var(--bugfix-text-secondary);
  max-height: 180px;
  overflow-y: auto;
}

.stage4-rubric-card {
  background: var(--bugfix-surface);
  border: 1px solid var(--bugfix-line);
  border-radius: var(--radius-lg, 12px);
  padding: 16px 22px;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.stage4-rubric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--bugfix-line);
  padding-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.stage4-rubric-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.stage4-rubric-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage4-rubric-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--bugfix-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage4-rubric-score-summary {
  font-size: 13px;
  color: var(--bugfix-text-secondary);
}

.stage4-rubric-score-summary strong {
  font-size: 16px;
  color: var(--bugfix-emerald);
  font-family: var(--font-mono, monospace);
  font-weight: 700;
}

.stage4-aspects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.stage4-aspect-box {
  background: var(--bugfix-surface-elevated);
  border: 1px solid var(--bugfix-line);
  border-radius: var(--radius-md, 8px);
  padding: 12px 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  transition: border-color var(--transition-fast, 140ms ease);
}

.stage4-aspect-box:hover {
  border-color: var(--bugfix-line-strong);
}

.stage4-aspect-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.stage4-aspect-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bugfix-text);
  min-width: 0;
  flex: 1;
  line-height: 1.35;
}

.stage4-aspect-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage4-aspect-hint {
  cursor: help;
  color: var(--bugfix-text-tertiary);
  flex-shrink: 0;
  font-size: 11.5px;
}

.stage4-aspect-hint:hover {
  color: var(--bugfix-brand);
}

.stage4-aspect-val {
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 2px 7px;
}

.stage4-aspect-val strong {
  color: var(--bugfix-brand);
}

.stage4-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.stage4-aspect-slider {
  width: 100%;
  max-width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bugfix-bg);
  border: 1px solid var(--bugfix-line);
  border-radius: var(--radius-full, 999px);
  outline: none;
  cursor: pointer;
  accent-color: var(--bugfix-brand);
  margin: 0;
  box-sizing: border-box;
}

.stage4-aspect-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bugfix-brand);
  border: 2px solid var(--bugfix-surface);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.stage4-aspect-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.stage4-ticks {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

.stage4-tick-btn {
  min-width: 0 !important;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 0 !important;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  background: var(--bugfix-surface) !important;
  border: 1px solid var(--bugfix-line);
  border-radius: 4px;
  color: var(--bugfix-text-secondary) !important;
  cursor: pointer;
  text-align: center;
  user-select: none;
  transition: var(--transition-fast, 140ms ease);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: clip;
}

.stage4-tick-btn:hover {
  background: var(--bugfix-surface-hover) !important;
  color: var(--bugfix-text) !important;
  border-color: var(--bugfix-line-strong);
  transform: translateY(-1px);
}

.stage4-tick-btn.active {
  background: var(--bugfix-brand) !important;
  border-color: var(--bugfix-brand) !important;
  color: #121211 !important;
  font-weight: 700;
  transform: translateY(-1px);
}

.stage4-tick-btn.active::before {
  display: none !important;
}

/* Navigasi / Status Tahap 3 & Tahap 4 di Kartu Soal Tahap 2 */
.explain-substage-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  margin-top: 14px;
  background: var(--bugfix-surface-elevated, #1c1c1a);
  border: 1px dashed var(--bugfix-line, rgba(245, 242, 235, 0.12));
  border-radius: var(--radius-md, 8px);
  align-items: center;
}

.explain-substage-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--bugfix-surface, #22211f);
  border: 1px solid var(--bugfix-line, rgba(245, 242, 235, 0.08));
  font-size: 12.5px;
}

.btn-accent {
  background: #244855;
  color: #f5f2eb;
  border: 1px solid rgba(36, 72, 85, 0.5);
}

.btn-accent:hover {
  background: #2d5868;
  color: #ffffff;
}

@media (max-width: 1024px) {
  .stage4-workspace {
    flex-direction: column !important;
    height: auto !important;
    max-height: none !important;
  }
  .stage4-panel {
    min-height: 320px;
    height: 380px;
  }
  .stage4-dual-grid {
    grid-template-columns: 1fr;
  }
  .stage4-aspects-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 640px) {
  .stage4-aspects-grid {
    grid-template-columns: 1fr;
  }
  .stage4-ticks {
    gap: 2px;
  }
  .stage4-tick-btn {
    font-size: 10px;
    padding: 3px 0 !important;
  }
}
