.panel {
  display: flex;
  flex-direction: column;
  flex: 1;          /* fill scenarioWrap entirely */
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-3);
}

.emptyIcon { font-size: 40px; opacity: 0.2; }
.emptyTitle { font-size: 16px; font-weight: 700; color: var(--text-2); }
.emptySub { font-size: 13px; }

/* Header */
.scenarioHeader {
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.scenarioMeta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.category {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
}

.diff {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
}
.diff.easy   { background: var(--green-dim); color: var(--green); border-color: color-mix(in srgb, currentColor 30%, transparent); }
.diff.medium { background: var(--amber-dim); color: var(--amber); border-color: color-mix(in srgb, currentColor 30%, transparent); }
.diff.hard   { background: var(--red-dim);   color: var(--red);   border-color: color-mix(in srgb, currentColor 30%, transparent); }

.typeTag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--blue);
  background: var(--blue-dim);
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
}

.weight {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
}

.scenarioTitle {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
  line-height: 1.3;
  flex: 1;
}

.titleRow {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 2px;
}

.resetBtn {
  flex-shrink: 0;
  background: var(--amber-dim);
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  border-radius: 6px;
  color: var(--amber);
  font-size: 12px;
  font-family: var(--sans);
  font-weight: 700;
  padding: 5px 12px;
  cursor: pointer;
  margin-top: 2px;
  white-space: nowrap;
  letter-spacing: 0.2px;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.resetBtn:hover {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 50%, transparent);
  background: var(--red-dim);
}

.completedBanner {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid rgba(57,217,138,0.25);
  padding: 4px 10px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  padding: 0 16px;
}

.tab {
  padding: 10px 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  transition: all 0.12s;
  margin-bottom: -1px;
}

.tab:hover { color: var(--text-2); }

.activeTab {
  color: var(--text);
  border-bottom-color: var(--green);
}

/* Content */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.tabPane { animation: fadeIn 0.2s ease; }

/* Setup box */
.setupBox {
  background: var(--amber-dim);
  border: 1px solid rgba(252,196,25,0.25);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.setupHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.setupLabel {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--amber);
}

.setupBtn {
  background: var(--amber);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  transition: opacity 0.15s;
}
.setupBtn:hover { opacity: 0.85; }

.setupBtnRetry {
  composes: setupBtn;
  background: var(--red);
  color: white;
}

.setupRunning {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--amber);
}

.setupDone { font-size: 12px; color: var(--green); font-weight: 600; }

.setupNote { font-size: 12px; color: var(--text-2); }

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* MCQ */
.mcqSection { margin-top: 24px; }

.mcqLabel {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}

.options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  text-align: left;
  transition: all 0.12s;
}

.option:hover:not(:disabled) { border-color: var(--border2); background: var(--surface2); }

.option:disabled { cursor: default; }

.optionSelected { border-color: var(--blue); background: var(--blue-dim); }
.optionCorrect  { border-color: var(--green) !important; background: var(--green-dim) !important; }
.optionWrong    { border-color: var(--red) !important; background: var(--red-dim) !important; }

.optionLetter {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  flex-shrink: 0;
}

.optionSelected .optionLetter { border-color: var(--blue); color: var(--blue); background: var(--blue-dim); }
.optionCorrect  .optionLetter { border-color: var(--green); color: var(--green); }
.optionWrong    .optionLetter { border-color: var(--red); color: var(--red); }

.optionText { flex: 1; line-height: 1.5; color: var(--text-2); }
.optionMark { font-size: 14px; font-weight: 700; flex-shrink: 0; }
.optionCorrect .optionMark { color: var(--green); }
.optionWrong   .optionMark { color: var(--red); }

.submitBtn {
  background: var(--green);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  transition: opacity 0.15s;
}
.submitBtn:hover:not(:disabled) { opacity: 0.85; }
.submitBtn:disabled { opacity: 0.4; cursor: not-allowed; }

.mcqResult {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid;
}

.mcqCorrect { background: var(--green-dim); border-color: rgba(57,217,138,0.3); }
.mcqWrong   { background: var(--red-dim);   border-color: rgba(255,107,107,0.3); }

.mcqResultTitle {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.mcqExplanation { font-size: 13px; color: var(--text-2); line-height: 1.6; }

/* Hints */
.hintCard {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--surface);
}

.hintHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.12s;
}

.hintHeader:hover { background: var(--surface2); }

.hintLeft { display: flex; align-items: center; gap: 10px; }

.hintNum {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
  background: var(--amber-dim);
  padding: 2px 7px;
  border-radius: 3px;
}

.hintTitle { font-size: 13px; font-weight: 600; color: var(--text); }

.hintChevron { color: var(--text-3); font-size: 12px; }

.hintBody {
  padding: 4px 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.hintText { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-bottom: 10px; margin-top: 10px; }

.noHints { font-size: 13px; color: var(--text-3); padding: 20px 0; text-align: center; }

.cmdBlock {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cmdPre {
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  padding-right: 70px;
}

.copyBtn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.12s;
}
.copyBtn:hover { color: var(--text); border-color: var(--green); }

/* Validate */
.validateHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.validateDesc { font-size: 13px; color: var(--text-2); line-height: 1.6; flex: 1; }

.validateBtn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.validateBtn:hover:not(:disabled) { opacity: 0.85; }
.validateBtn:disabled { opacity: 0.5; cursor: not-allowed; }

.checks { display: flex; flex-direction: column; gap: 6px; }

.checksSummary {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.allPassed  { background: var(--green-dim); color: var(--green); border: 1px solid rgba(57,217,138,0.3); }
.someFailed { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(255,107,107,0.3); }

.attempts { font-family: var(--mono); font-size: 11px; opacity: 0.7; }

.check {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  align-items: flex-start;
}

.checkPass { border-color: rgba(57,217,138,0.2); }
.checkFail { border-color: rgba(255,107,107,0.2); background: rgba(255,107,107,0.03); }

.checkIcon {
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.checkPass .checkIcon { color: var(--green); }
.checkFail .checkIcon { color: var(--red); }

.checkContent { flex: 1; min-width: 0; }
.checkDesc { font-size: 13px; color: var(--text); margin-bottom: 4px; }
.checkDetail {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-3);
}
.checkDetail code {
  font-family: var(--mono);
  background: var(--surface3);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--amber);
  font-size: 11px;
}

.validateError {
  padding: 12px 14px;
  background: var(--amber-dim);
  border: 1px solid rgba(252,196,25,0.3);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--amber);
}

@keyframes fadeIn { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:none} }
@keyframes spin { to{transform:rotate(360deg)} }
