:root {
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: #18202a;
  background: #f3f5f7;
}
* { box-sizing: border-box; }
body { margin: 0; }
.shell { width: min(1100px, calc(100% - 28px)); margin: 28px auto 56px; }
.card {
  background: white;
  border: 1px solid #dfe4ea;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 18px;
}
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
h1 { font-size: clamp(28px, 5vw, 44px); margin: 4px 0 8px; }
h2 { margin: 4px 0 12px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .12em; margin: 0; color: #51606f; }
.muted, small { color: #667482; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; }
.form-grid.one { grid-template-columns: 1fr; }
.full { grid-column: 1 / -1; }
label { display: grid; gap: 7px; font-weight: 650; }
input, textarea, select {
  width: 100%;
  font: inherit;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid #bac4cf;
  background: white;
}
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  border: 0;
  border-radius: 10px;
  background: #18202a;
  color: white;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.secondary { background: #e9edf1; color: #18202a; }
.optional { font-size: 12px; color: #7a8794; font-weight: 500; }
.actions { display: flex; justify-content: flex-end; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.center { text-align: center; }
.qr { width: min(260px, 80%); height: auto; image-rendering: crisp-edges; }
.code { font-size: 28px; font-weight: 800; letter-spacing: .1em; }
.small-break { overflow-wrap: anywhere; color: #667482; }
.page-head, .row-between { display: flex; gap: 16px; justify-content: space-between; align-items: center; }
.participant-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 18px; }
.participant { border: 1px solid #e1e6eb; border-radius: 10px; padding: 12px; display: grid; gap: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { background: #edf1f4; border-radius: 999px; padding: 7px 11px; font-weight: 650; }
.status-box { margin-top: 22px; padding: 18px; border-radius: 12px; background: #edf1f4; font-weight: 700; }
@media (max-width: 700px) {
  .form-grid, .grid.two { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .actions button { width: 100%; }
  .shell { width: min(100% - 18px, 1100px); margin-top: 10px; }
  .card { padding: 18px; }
}

.upload-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.upload-row input[type="file"] { flex: 1 1 320px; }
.course-list { display: grid; gap: 10px; margin-top: 16px; }
.course-row {
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 15px 16px; border: 1px solid #e1e6eb; border-radius: 12px;
  color: inherit; text-decoration: none;
}
.course-row div { display: grid; gap: 4px; min-width: 0; }
.module-list { display: grid; gap: 10px; margin: 18px 0 24px; }
.module-option {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px;
  border: 1px solid #e1e6eb; border-radius: 12px;
}
.module-option input { width: auto; margin-top: 3px; transform: scale(1.2); }
.module-option span { display: grid; gap: 4px; }
.compact-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status-pill {
  display: inline-flex; align-items: center; min-height: 34px; padding: 6px 10px;
  border-radius: 999px; background: #edf1f4; font-size: 12px; font-weight: 800;
}
.live-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0; }
.live-stats > div { border: 1px solid #e1e6eb; border-radius: 12px; padding: 14px; display: grid; gap: 4px; }
.live-stats strong { font-size: 24px; }
.control-bar { display: flex; flex-wrap: wrap; gap: 8px; }
button.danger { background: #7a2525; }
.error-text { color: #9c2d2d; min-height: 20px; }
.distribution, .present-results { display: grid; gap: 12px; margin-top: 22px; }
.distribution > div, .present-results > div {
  display: grid; grid-template-columns: 28px 1fr 38px; gap: 10px; align-items: center;
}
.bar { height: 14px; background: #e8edf1; border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #4d5d6c; border-radius: inherit; transition: width .25s ease; }
.training-image { width: 100%; max-height: 280px; object-fit: contain; border-radius: 12px; margin: 12px 0; background: #f6f7f8; }
.situation { font-size: 20px; line-height: 1.5; white-space: pre-line; margin: 18px 0; }
.choice-list { display: grid; gap: 12px; }
.choice {
  width: 100%; justify-content: flex-start; text-align: left; background: white; color: #18202a;
  border: 1px solid #bac4cf; padding: 14px; line-height: 1.4;
}
.choice span {
  flex: 0 0 36px; display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: 50%; background: #18202a; color: white; margin-right: 10px;
}
.choice:disabled { opacity: .55; cursor: default; }
.answer-card { border: 1px solid #dfe4ea; border-radius: 12px; padding: 18px; white-space: pre-line; }
.answer-result { padding: 12px; border-radius: 10px; margin: 12px 0; font-weight: 800; }
.answer-result.correct { background: #e8f4ea; }
.answer-result.wrong { background: #f7ecec; }
.score-box { display: grid; place-items: center; gap: 4px; margin-top: 24px; padding: 24px; background: #edf1f4; border-radius: 14px; }
.score-box strong { font-size: 44px; }
.presentation-shell { width: 100%; }
.presentation-head {
  display: flex; justify-content: space-between; gap: 24px; align-items: center;
  padding: 0 4px 18px; border-bottom: 1px solid #dfe4ea;
}
.present-stat { display: grid; text-align: center; min-width: 110px; }
.present-stat strong { font-size: 36px; }
.presentation-content { padding-top: 24px; }
.present-center { min-height: 420px; display: grid; place-items: center; align-content: center; text-align: center; }
.present-center h2 { font-size: clamp(36px, 6vw, 70px); }
.present-grid { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(0, 1.5fr); gap: 34px; align-items: start; }
.presentation-image { width: 100%; max-height: 520px; object-fit: contain; border-radius: 14px; background: #f6f7f8; }
.content-items { display: grid; gap: 14px; }
.content-item {
  white-space: pre-line; font-size: clamp(20px, 2vw, 30px); line-height: 1.45;
  border-left: 5px solid #6a7784; padding: 12px 16px; background: white; border-radius: 8px;
}
.stop-rule { white-space: pre-line; margin-top: 18px; padding: 16px; border: 2px solid #7d3f3f; border-radius: 10px; font-size: clamp(18px, 1.7vw, 26px); font-weight: 700; }
.global-rule { margin-top: 24px; padding: 14px 18px; background: #18202a; color: white; border-radius: 10px; text-align: center; font-size: clamp(18px, 1.8vw, 28px); font-weight: 800; }
.big-situation { white-space: pre-line; font-size: clamp(26px, 3vw, 42px); line-height: 1.35; margin: 14px 0 24px; }
.present-choices { display: grid; gap: 12px; }
.present-choice {
  display: grid; grid-template-columns: 54px 1fr; gap: 14px; align-items: center;
  padding: 14px; border: 1px solid #cdd5dd; border-radius: 12px; font-size: clamp(18px, 1.8vw, 28px);
}
.present-choice span {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: #18202a; color: white; font-weight: 800;
}
.correct-letter { width: 90px; height: 90px; border-radius: 50%; display: grid; place-items: center; background: #18202a; color: white; font-size: 48px; font-weight: 900; margin: 14px 0; }
.answer-text { white-space: pre-line; font-size: clamp(22px, 2.4vw, 36px); line-height: 1.4; }
.why { margin-top: 20px; font-size: clamp(18px, 1.7vw, 26px); line-height: 1.4; }
.why p { margin-top: 6px; }
@media (max-width: 800px) {
  .live-stats { grid-template-columns: 1fr; }
  .present-grid { grid-template-columns: 1fr; }
  .presentation-head { align-items: flex-start; }
  .present-stat { min-width: 80px; }
}

button.mini { min-height: 32px; padding: 5px 9px; font-size: 12px; justify-self: start; margin-top: 5px; }

/* Guided trainer controls */
.trainer-step-hint {
  margin: 8px 0 0;
  padding: 9px 12px;
  border-left: 4px solid #2563eb;
  background: #eff6ff;
  border-radius: 8px;
  color: #1e3a8a;
  font-weight: 700;
}
.control-bar button {
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease, background .12s ease;
}
.control-bar button:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
  opacity: .72;
}
.control-bar button.recommended-action {
  background: #0f766e;
  color: white;
  box-shadow: 0 0 0 4px rgba(15,118,110,.12);
}
.control-bar button.recommended-action:not(:disabled):hover {
  transform: translateY(-1px);
}
.control-bar button.action-busy {
  opacity: .8;
}
#module-menu .module-option {
  justify-content: space-between;
  align-items: center;
}
#module-menu .module-option > span:first-child {
  flex: 1;
}
#module-menu .module-option small {
  display: block;
  margin-top: 4px;
}
.course-main-link {
  display: flex;
  flex: 1;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.course-row > button {
  flex: 0 0 auto;
}

/* More visual hierarchy for presentation mode */
.presentation-content.mode-question {
  background: linear-gradient(180deg, #fff7ed 0%, #fff 42%);
  border-radius: 20px;
  padding: 28px;
}
.presentation-content.mode-answer {
  background: linear-gradient(180deg, #ecfdf5 0%, #fff 42%);
  border-radius: 20px;
  padding: 28px;
}
.presentation-content.mode-content {
  background: linear-gradient(180deg, #eff6ff 0%, #fff 42%);
  border-radius: 20px;
  padding: 28px;
}
.presentation-content.mode-menu {
  background: linear-gradient(180deg, #f5f3ff 0%, #fff 55%);
  border-radius: 20px;
}
.presentation-content.mode-question .eyebrow { color: #c2410c; }
.presentation-content.mode-answer .eyebrow { color: #047857; }
.presentation-content.mode-content .eyebrow { color: #1d4ed8; }
.presentation-content.mode-question .present-choice {
  background: rgba(255,255,255,.92);
  border-width: 2px;
}
.presentation-content.mode-question .present-choice:nth-child(1) span { background: #2563eb; }
.presentation-content.mode-question .present-choice:nth-child(2) span { background: #d97706; }
.presentation-content.mode-question .present-choice:nth-child(3) span { background: #7c3aed; }
.presentation-content.mode-answer .correct-letter { background: #059669; }
.presentation-content.mode-content .content-item { border-left-color: #2563eb; }
.presentation-content.mode-content .global-rule { background: #1e3a8a; }
.present-progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(37,99,235,.1);
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
}

/* Class summary */
.summary-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.summary-kpi {
  background: white;
  border: 1px solid #dfe4ea;
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 6px;
}
.summary-kpi strong { font-size: 28px; }
.focus-grid { display: grid; gap: 12px; margin-top: 18px; }
.focus-card {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid #dfe4ea;
  border-radius: 14px;
  background: #fff;
}
.focus-rank {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  background: #f3f4f6;
}
.focus-copy { display: grid; gap: 4px; min-width: 0; }
.focus-copy span { color: #4b5563; }
.performance-scroll {
  max-height: 460px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 16px;
  padding-right: 8px;
  scrollbar-gutter: stable;
}
.performance-row {
  padding: 16px 4px 18px;
  border-bottom: 1px solid #e5e7eb;
}
.performance-row:last-child { border-bottom: 0; }
.performance-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.performance-head > div:first-child { display: grid; gap: 4px; min-width: 0; }
.performance-score {
  flex: 0 0 auto;
  min-width: 72px;
  text-align: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 900;
}
.performance-score.attention { background: #fee2e2; color: #991b1b; }
.performance-score.review { background: #fef3c7; color: #92400e; }
.performance-score.good { background: #dcfce7; color: #166534; }
.performance-bar {
  margin-top: 10px;
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.performance-bar i {
  display: block;
  height: 100%;
  background: #475569;
  border-radius: inherit;
}
.retrain-result {
  margin-top: 10px;
  padding: 9px 11px;
  background: #ecfdf5;
  border-radius: 9px;
  color: #065f46;
}
.retrain-result span { margin-left: 8px; font-weight: 800; }
.summary-table-wrap { overflow-x: auto; margin-top: 16px; }
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table th, .summary-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  white-space: nowrap;
}
.summary-table th { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: .05em; }
.summary-actions { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
@media (max-width: 1000px) {
  .summary-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .summary-kpis { grid-template-columns: repeat(2, 1fr); }
  .focus-card { grid-template-columns: 44px 1fr; }
  .focus-card form { grid-column: 1 / -1; }
  .focus-card button { width: 100%; }
  .summary-actions { flex-direction: column; align-items: stretch; }
}
