:root {
  --bg: #f3f0e8;
  --bg-2: #17306f;
  --card: #fffdf8;
  --ink: #1f2430;
  --muted: #556070;
  --brand: #2f6bff;
  --brand-ink: #ffffff;
  --ok: #22c55e;
  --bad: #b42318;
  --c-red: #e21b3c;
  --c-blue: #2f6bff;
  --c-yellow: #f2c94c;
  --c-green: #26890c;
  --radius: 0px;
  --border: 2px solid #1f2430;
  --shadow: 8px 8px 0 #1f2430;
  --btn-shadow: 4px 4px 0 #1f2430;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(31, 36, 48, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 36, 48, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: -1;
}

body.home-landing {
  position: relative;
  background: #f3f0e8;
  color: #1f2430;
  display: block;
  overflow-x: hidden;
}

.home-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(31, 36, 48, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 36, 48, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: 0;
}

.home-header,
.home-shell {
  position: relative;
  z-index: 1;
}

.home-header {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px 0;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 22px;
}

.home-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.home-wordmark-mark {
  width: 44px;
  height: 44px;
  border: 2px solid #1f2430;
  background: #f2c94c;
  box-shadow: 4px 4px 0 #1f2430;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* sotaque retro só no selo (design-direction): pixel na marca "CP" */
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
}

.home-wordmark-text {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.home-featured-link {
  justify-self: center;
  min-width: min(100%, 300px);
  max-width: 360px;
  min-height: 48px;
  padding: 7px 12px 7px 9px;
  border: 2px solid #1f2430;
  background: #ffffff;
  box-shadow: 4px 4px 0 #1f2430;
  color: #1f2430;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.home-featured-link:hover {
  background: #fff8d8;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #1f2430;
}

.home-featured-link:focus-visible {
  outline: 3px solid #2f6bff;
  outline-offset: 4px;
}

.home-featured-badge {
  flex: 0 0 auto;
  padding: 6px 7px;
  background: #f2c94c;
  border: 2px solid #1f2430;
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 0.48rem;
  line-height: 1;
  text-transform: uppercase;
}

.home-featured-copy {
  min-width: 0;
  display: grid;
  line-height: 1.12;
}

.home-featured-copy strong {
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.home-featured-copy small {
  margin-top: 3px;
  color: #556070;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.home-featured-arrow {
  flex: 0 0 auto;
  font-size: 1.15rem;
  font-weight: 900;
}

.home-header-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-link {
  color: #495365;
  text-decoration: none;
  font-weight: 700;
  padding: 10px 12px;
}

.home-link-strong {
  border: 2px solid #1f2430;
  background: #ffffff;
  box-shadow: 4px 4px 0 #1f2430;
}

.home-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 20px 40px;
}

.home-hero {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
}

.home-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 800;
  color: #556070;
}

.home-hero h1 {
  margin: 0;
  font-size: clamp(2.1rem, 6vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.home-subtitle {
  margin: 14px auto 0;
  max-width: 620px;
  font-size: 1.02rem;
  line-height: 1.6;
  color: #556070;
}

.video-embed-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border: 2px solid #1f2430;
  background: #111827;
  box-shadow: 4px 4px 0 #1f2430;
}

.video-embed-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.home-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.home-stage,
.home-side {
  min-width: 0;
}

.home-card,
.home-side-card {
  background: #fffdf8;
  border: 2px solid #1f2430;
  box-shadow: 8px 8px 0 #1f2430;
}

.home-card {
  padding: 24px;
}

.home-card-secondary h2,
.home-side-card h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.home-card-primary {
  padding: 28px;
}

.home-label {
  display: block;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  font-weight: 800;
  color: #556070;
}

.home-code-input {
  width: 100%;
  min-height: 74px;
  padding: 18px 20px;
  border: 3px solid #1f2430;
  background: #ffffff;
  color: #1f2430;
  outline: none;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 2px #e7e1d2;
  margin-bottom: 14px;
}

.home-code-input::placeholder {
  letter-spacing: 0.04em;
  font-weight: 700;
  font-size: 0.95rem;
  color: #7a8699;
}

.home-code-input:focus,
.home-name-input:focus {
  border-color: #2f6bff;
  box-shadow: inset 0 0 0 2px #dbe7ff;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 12px 18px;
  border: 2px solid #1f2430;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.18s ease, opacity 0.18s ease;
}

.home-btn:hover { filter: brightness(1.04); }
.home-btn:active { transform: translateY(2px); }
.home-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.home-btn-primary {
  width: 100%;
  background: #2f6bff;
  color: #fff;
  box-shadow: 5px 5px 0 #1f2430;
}

.home-btn-secondary {
  background: #ffffff;
  color: #1f2430;
  box-shadow: 4px 4px 0 #1f2430;
}

.home-btn-ghost {
  min-width: 110px;
  background: #f2c94c;
  color: #1f2430;
  box-shadow: 4px 4px 0 #1f2430;
}

.home-btn-block {
  width: 100%;
}

.home-status {
  margin: 14px 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.home-status-neutral { color: #556070; }
.home-status-error { color: #b42318; font-weight: 700; }

.home-chip {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 2px solid #1f2430;
  background: #f2c94c;
  box-shadow: 4px 4px 0 #1f2430;
  /* selo de "fase": sotaque pixel, pequeno e legível */
  font-family: "Press Start 2P", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0;
}

.home-helper {
  margin: 0 0 16px;
  color: #556070;
  line-height: 1.5;
}

.home-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.home-name-input {
  margin: 0;
  min-height: 56px;
}

.home-inline-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 16px;
}

.home-side {
  display: grid;
  gap: 18px;
}

.home-side-card {
  padding: 20px;
}

.home-list {
  margin: 0;
  padding-left: 18px;
  color: #495365;
  line-height: 1.7;
}

.home-list li + li {
  margin-top: 4px;
}

.wrap {
  width: 100%;
  max-width: 720px;
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.brand {
  color: var(--ink);
  text-align: center;
  padding: 24px 0 8px;
}
.brand h1 { margin: 0; font-size: 2rem; letter-spacing: 1px; font-weight: 800; }
.brand p { margin: 6px 0 0; color: var(--muted); font-weight: 700; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
  margin: 16px 0;
}

h2 { margin: 0 0 16px; }

input, button, select {
  font: inherit;
}

.field {
  width: 100%;
  padding: 14px 16px;
  border: var(--border);
  border-radius: var(--radius);
  font-size: 1.1rem;
  outline: none;
  margin-bottom: 12px;
  background: #ffffff;
  color: var(--ink);
}
.field:focus { border-color: var(--c-blue); box-shadow: inset 0 0 0 2px #dbe7ff; }

.btn {
  width: 100%;
  padding: 14px 16px;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: var(--btn-shadow);
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.18s ease;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(2px); box-shadow: 2px 2px 0 #1f2430; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: var(--border); box-shadow: var(--btn-shadow); }

.pin-display {
  text-align: center;
  color: #fff;
}
.pin-display .label { opacity: 0.75; margin-bottom: 4px; }
.pin-display .pin {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 16px;
  display: inline-block;
}

.muted { color: var(--muted); }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

/* Player chips (lobby) */
.players {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.chip {
  background: var(--brand);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  animation: pop 0.2s ease;
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Answer grid (Kahoot style) */
.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.answer {
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 28px 16px;
  cursor: pointer;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 0.08s, opacity 0.2s;
}
.answer:active { transform: scale(0.98); }
.answer.a0 { background: var(--c-red); }
.answer.a1 { background: var(--c-blue); }
.answer.a2 { background: var(--c-yellow); }
.answer.a3 { background: var(--c-green); }
.answer.dim { opacity: 0.35; }
.answer.correct { outline: 5px solid #fff; }

.timer {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
}
.qmeta { color: var(--muted); text-align: center; opacity: 0.85; }
.qtext {
  color: var(--ink);
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 12px 0;
}
/* In the editor the question input must be readable on a white card */
input.qtext {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
}
textarea.qtext {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  line-height: 1.5;
  min-height: 96px;
  resize: vertical;
}

/* leaderboard */
.lb { list-style: none; padding: 0; margin: 8px 0 0; }
.lb li {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 10px;
  background: #f3f4f6;
  margin-bottom: 8px;
  font-weight: 700;
}
.lb li .pos { color: var(--brand); margin-right: 10px; }

/* Kahoot-style extras */
.badge {
  display: inline-block;
  background: #fbbf24;
  color: #1a1a2e;
  font-weight: 800;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
  animation: pop 0.2s ease;
}
.qr-box {
  flex: 0 0 auto !important;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  line-height: 0;
}
.qr-box img { width: 140px; height: 140px; }
.answer.tf { min-height: 120px; font-size: 1.4rem; }
.gained {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ok);
  margin: 4px 0;
  animation: pop 0.25s ease;
}
.streak {
  font-size: 1.1rem;
  font-weight: 800;
  color: #d97706;
  margin: 4px 0;
}

/* Tabs (teacher dashboard) */
.tabs { display: flex; gap: 8px; margin: 8px 0; }
.tab {
  flex: 1;
  border: var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  box-shadow: 4px 4px 0 #1f2430;
  transition: transform 0.08s;
}
.tab.active { background: var(--card); box-shadow: inset 0 -4px 0 var(--brand); transform: translateY(2px); }

/* Report tables */
.rtable { width: 100%; border-collapse: collapse; margin-top: 8px; }
.rtable th, .rtable td { text-align: left; padding: 10px 12px; }
.rtable th { background: #f3f4f6; font-size: 0.85rem; text-transform: uppercase; color: var(--muted); }
.rtable tr:nth-child(even) td { background: #fafafa; }
.rtable td { border-bottom: 1px solid #f0f0f0; }

/* Selectable turma chips (launch form) */
.chip.selectable { cursor: pointer; background: #e5e7eb; color: var(--ink); user-select: none; }
.chip.selectable:has(input:checked) { background: var(--brand); color: #fff; }
.chip.selectable input { accent-color: #fff; margin-right: 4px; }

@media (max-width: 900px) {
  .home-header {
    grid-template-columns: auto 1fr;
  }

  .home-featured-link {
    grid-column: 1 / -1;
    grid-row: 2;
    width: min(100%, 440px);
  }

  .home-entry {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .home-grid {
    background-size: 22px 22px;
  }

  .home-header {
    padding: 14px 16px 0;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .home-wordmark,
  .home-featured-link,
  .home-header-links {
    justify-self: stretch;
  }

  .home-featured-link {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    max-width: none;
  }

  .home-header-links {
    justify-content: stretch;
  }

  .home-link,
  .home-link-strong {
    text-align: center;
  }

  .home-shell {
    padding: 20px 16px 32px;
  }

  .home-card,
  .home-side-card {
    box-shadow: 6px 6px 0 #1f2430;
  }

  .home-card-primary,
  .home-card,
  .home-side-card {
    padding: 18px;
  }

  .home-name-row,
  .home-inline-actions {
    grid-template-columns: 1fr;
  }
}

/* Teacher area: library + editor */
.quiz-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--bg);
  border: var(--border);
  box-shadow: 4px 4px 0 var(--ink);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.quiz-item-info { display: flex; flex-direction: column; }
.quiz-item-actions { display: flex; gap: 6px; }
.mini {
  border: none;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
}
.mini.ghost { background: #e5e7eb; color: var(--ink); }
.mini.danger { background: #fee2e2; color: var(--bad); }
.mini:hover { opacity: 0.85; }

.qcard {
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.ans-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding-left: 10px;
  border-left: 6px solid #e5e7eb;
  border-radius: 4px;
}
.ans-row.a0 { border-left-color: var(--c-red); }
.ans-row.a1 { border-left-color: var(--c-blue); }
.ans-row.a2 { border-left-color: var(--c-yellow); }
.ans-row.a3 { border-left-color: var(--c-green); }
.ans-row .acorrect { width: 20px; height: 20px; accent-color: var(--ok); cursor: pointer; }
.ans-row .atext { flex: 1; }

/* Scoring model selector in question card */
.qscore-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.qscore-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.qscore-select {
  flex: 1;
  min-width: 160px;
  padding: 6px 10px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background: #f9fafb;
  cursor: pointer;
  outline: none;
}
.qscore-select:focus { border-color: var(--brand); }
.qscore-select.model-speed  { border-left: 4px solid var(--brand); }
.qscore-select.model-fixed  { border-left: 4px solid var(--ok); }
.qscore-select.model-none   { border-left: 4px solid var(--muted); }

/* Google Forms question kinds */
.answer.multi { opacity: 0.75; }
.answer.multi.picked {
  opacity: 1;
  outline: 4px solid #fff;
  outline-offset: -4px;
}

.answer.picked:not(.multi) {
  outline: 5px solid var(--ink);
  outline-offset: -5px;
}

.diagnostic-reflection {
  margin-top: 14px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.diagnostic-reflection .confidence-options,
.diagnostic-reflection .clue-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

.diagnostic-reflection [data-confidence].picked {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.diagnostic-reflection [data-clue].picked {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}
.confirm-answer { margin-top: 4px; }
.confirm-answer:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==== Imagens nas alternativas (inclusão) ================================= */
/* Alternativa com imagem: empilha ícone + imagem grande + texto, centralizado. */
.answer.has-img {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  min-height: 120px;
}
.answer .answer-icon { flex: 0 0 auto; }
.answer.has-img .answer-icon { font-size: 1.3rem; }
.answer .answer-img {
  max-height: 140px;
  max-width: 100%;
  object-fit: contain;
  pointer-events: none;
}
.answer .answer-txt { word-break: break-word; }
/* miniatura no editor */
.ans-row .athumb {
  height: 40px;
  max-width: 70px;
  object-fit: contain;
  border: 2px solid var(--ink);
  background: #fff;
  flex: 0 0 auto;
}
.ans-row .aimg-btn { flex: 0 0 auto; cursor: pointer; }

/* ==== LIGAR (match): tabuleiro do aluno ==================================== */
/* Cores dos pares: cor + número juntos (não depende só de cor). */
.match-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
}
.match-col { display: flex; flex-direction: column; gap: 10px; }
.match-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 10px;
  min-height: 84px;
  background: var(--card);
  border: 3px solid var(--ink);
  box-shadow: var(--btn-shadow);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  transition: transform 0.06s;
}
.match-card:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.match-card.sel {
  outline: 4px dashed var(--brand);
  outline-offset: 3px;
  animation: matchPulse 0.9s ease-in-out infinite;
}
@keyframes matchPulse { 50% { transform: scale(1.02); } }
.match-card .match-img {
  width: 100%;
  max-height: 110px;
  object-fit: contain;
  pointer-events: none;
}
.match-card .match-txt { font-size: 1.05rem; text-align: center; }
.match-badge {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}
/* cor por par (borda + selo) — junto com o número, acessível a daltônicos */
.match-card[data-pair="0"] { border-color: var(--c-red); }
.match-card[data-pair="0"] .match-badge { background: var(--c-red); border-color: var(--c-red); }
.match-card[data-pair="1"] { border-color: var(--c-blue); }
.match-card[data-pair="1"] .match-badge { background: var(--c-blue); border-color: var(--c-blue); }
.match-card[data-pair="2"] { border-color: var(--c-yellow); }
.match-card[data-pair="2"] .match-badge { background: var(--c-yellow); border-color: var(--c-yellow); }
.match-card[data-pair="3"] { border-color: var(--c-green); }
.match-card[data-pair="3"] .match-badge { background: var(--c-green); border-color: var(--c-green); }
.match-card[data-pair="4"] { border-color: #7059d9; }
.match-card[data-pair="4"] .match-badge { background: #7059d9; border-color: #7059d9; }

/* ==== LIGAR (match): editor do professor =================================== */
.match-edit-row {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line, #d8d2c2);
}
.match-num { font-weight: 800; color: var(--muted); padding-top: 10px; white-space: nowrap; }
.match-arrow { font-weight: 800; padding-top: 10px; }
.match-cell .mtext { margin: 0 0 6px; }
.match-img-row { display: flex; align-items: center; gap: 8px; }
.match-img-row .mthumb {
  height: 44px;
  max-width: 90px;
  object-fit: contain;
  border: 2px solid var(--ink);
  background: #fff;
}
@media (max-width: 560px) {
  .match-edit-row { grid-template-columns: auto 1fr; }
  .match-arrow { display: none; }
}

/* Hub computacao.pro */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.hub-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 12px;
  transition: border-color 0.15s, transform 0.08s;
}
.hub-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.hub-icon { font-size: 1.8rem; }

/* COMPUTPLAN */
.ia-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: #f5f3ff;
  border-radius: 10px;
  padding: 12px;
  margin: 16px 0 4px;
}
.plan-field { margin-top: 12px; }
.plan-field label { font-weight: 700; }
.plan-field textarea { margin-top: 6px; }
.plan-quiz-box {
  background: #f9fafb;
  border: 2px dashed #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}
.linked-quiz {
  display: inline-block;
  background: #ede9fe;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  padding: 6px 14px;
  margin: 4px 6px 0 0;
  font-size: 0.9rem;
}
.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

/* Turma roster */
.roster {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.roster code { background: #eef2ff; padding: 2px 6px; border-radius: 6px; }
.cred-box {
  background: #fef9c3;
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 12px;
}

/* Grading panel (dissertativas) */
#gradingPanel {
  border-top: 2px dashed #e5e7eb;
  margin-top: 20px;
  padding-top: 16px;
}
.grade-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}
.grade-row-main { flex: 1; min-width: 0; }
.grade-text {
  margin: 6px 0 0;
  white-space: pre-wrap;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid #f0f0f0;
}
.grade-comment { margin: 6px 0 0; color: var(--muted); font-size: 0.85rem; }
.grade-verdict { display: flex; gap: 6px; flex: 0 0 auto; }
.grade-verdict .mini { background: #e5e7eb; font-size: 1rem; }
.grade-verdict .v-ok.on  { background: var(--ok); }
.grade-verdict .v-bad.on { background: var(--bad); }
.grade-btn { margin-left: 6px; padding: 4px 10px; font-size: 0.78rem; }

/* Report: expandable student answers */
.student-row { cursor: pointer; }
.student-row:hover td { background: #f5f3ff !important; }
.expand-cell { color: var(--brand); font-weight: 800; width: 20px; }
.answer-detail { padding: 4px 8px; }
.answer-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 6px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}
.answer-line:last-child { border-bottom: none; }
.answer-mark { flex: 0 0 auto; }

.status-big {
  color: #fff;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
  margin: 24px 0;
}
.emoji { font-size: 3rem; }

/* Feedback banner in quiz editor (AI modal) */
.import-banner {
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.import-banner.ok   { background: #dcfce7; color: #166534; }
.import-banner.warn { background: #fef9c3; color: #854d0e; }
.import-banner.err  { background: #fee2e2; color: #991b1b; }

/* Images */
.q-image {
  display: block;
  max-width: 100%;
  max-height: 250px;
  margin: 12px auto;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(0,0,0,0.05);
}
@media (min-width: 768px) {
  .q-image { max-height: 350px; }
}

.img-uploader {
  display: flex;
  gap: 8px;
  margin: 8px 0;
  align-items: center;
}
.img-preview-box {
  position: relative;
  display: inline-block;
  margin-top: 8px;
}
.img-preview-box img {
  max-width: 200px;
  max-height: 120px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.img-preview-box .rm-img {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--bad);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

/* ── Fullscreen async code overlay ──────────────────────────────────────────── */
.code-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(1200px 700px at 50% -10%, var(--bg-2), var(--bg));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.code-overlay .co-title {
  color: rgba(255,255,255,.7);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.code-overlay .co-quiz {
  color: #fff;
  font-size: 1.7rem;
  font-weight: 800;
  text-align: center;
  max-width: 700px;
  line-height: 1.2;
  padding: 0 20px;
}
.code-overlay .co-code {
  font-size: clamp(4rem, 16vw, 9rem);
  font-weight: 900;
  letter-spacing: .18em;
  color: #fff;
  background: rgba(255,255,255,.1);
  border: 3px solid rgba(255,255,255,.25);
  border-radius: 24px;
  padding: 20px 48px;
  margin: 8px 0;
  line-height: 1;
  text-shadow: 0 4px 30px rgba(0,0,0,.4);
  animation: pulse-code 2.5s ease-in-out infinite;
}
@keyframes pulse-code {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.15); }
  50%       { box-shadow: 0 0 0 20px rgba(255,255,255,0); }
}
.code-overlay .co-url {
  color: rgba(255,255,255,.6);
  font-size: 1rem;
  text-align: center;
}
.code-overlay .co-url b { color: rgba(255,255,255,.9); }

.code-overlay .co-info-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.code-overlay .co-badge {
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 12px;
  padding: 8px 20px;
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
}
.code-overlay .co-badge.due {
  background: rgba(251,191,36,.2);
  border-color: rgba(251,191,36,.5);
  color: #fbbf24;
}
.code-overlay .co-badge.expired {
  background: rgba(239,68,68,.18);
  border-color: rgba(239,68,68,.45);
  color: #fca5a5;
}
.code-overlay .co-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.code-overlay .co-close:hover { background: rgba(255,255,255,.25); }
.code-overlay .co-clock {
  font-size: 1.2rem;
  font-weight: 800;
  color: rgba(255,255,255,.85);
  text-align: center;
  letter-spacing: .03em;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
  padding: 4px 8px;
  transition: color 0.1s;
}
.nav-link:hover {
  color: var(--ink);
}

/* ── Projetos colaborativos / MARATONATECH ───────────────────────────────── */
.project-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, #fff 0%, #edf7ff 58%, #fff3d6 100%);
  border-color: #156b89;
}
.project-hero h2 { margin: 7px 0; font-size: clamp(1.6rem, 4vw, 2.5rem); }
.project-hero p { max-width: 720px; margin-bottom: 0; }
.project-hero > .btn { flex: 0 0 auto; width: auto; }
.project-kicker {
  color: #0d6884;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.simulachat-btn { background: linear-gradient(135deg, #005a78, #008bb5); }
.project-material-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}
.project-material {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  gap: 7px;
  padding: 16px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.project-material:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.project-material > span { color: #0d6884; font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.project-material > b { font-size: 1.05rem; }
.project-material > small { color: var(--muted); line-height: 1.45; }
.project-layout { display: grid; grid-template-columns: minmax(250px, .78fr) minmax(0, 2fr); gap: 16px; }
.project-sidebar, .project-main { margin: 0; }
.project-list-item {
  width: 100%;
  margin-top: 10px;
  padding: 13px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.project-list-item:hover, .project-list-item.active { border-color: var(--brand); background: #f2f6ff; }
.project-list-item b, .project-list-item span, .project-list-item small { display: block; }
.project-list-item span { margin-top: 4px; font-size: .84rem; color: var(--muted); }
.project-list-item small { margin-top: 3px; color: #0d6884; }
.project-empty { min-height: 430px; display: grid; place-content: center; text-align: center; }
.project-empty-icon { font-size: 4rem; }
.field-label { display: block; margin: 13px 0 5px; font-size: .88rem; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.project-fieldset { margin: 16px 0; padding: 14px; border: 2px solid var(--border); border-radius: 12px; }
.project-fieldset legend { padding: 0 7px; font-weight: 900; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.project-check { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.project-check input { width: 19px; height: 19px; }
.project-check small { color: var(--muted); }
.project-manager-head { align-items: flex-start; }
.project-general-code {
  flex: 0 0 auto;
  min-width: 166px;
  padding: 11px 15px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  text-align: center;
}
.project-general-code span, .project-general-code small { display: block; color: var(--muted); font-size: .75rem; font-weight: 800; }
.project-general-code strong { display: block; color: var(--brand); font-size: 1.7rem; letter-spacing: .12em; }
.project-create-group { padding: 16px; border: 2px dashed #0d6884; border-radius: 13px; background: #f2fbff; }
.project-create-group h3 { margin-top: 0; }
.project-create-group > .btn { width: auto; }
.project-group-code-help {
  display: flex;
  align-items: center;
  gap: 10px 16px;
  margin: 15px 0;
  padding: 13px 15px;
  border: 2px solid #0d6884;
  border-radius: 11px;
  background: #eaf8ff;
}
.project-group-code-help b { flex: 0 0 auto; color: #075a78; }
.project-group-code-help span { color: #405066; line-height: 1.45; }
.project-group-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
.project-group-list-head h3 { margin: 0; }
.project-group-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.project-group-card { margin: 12px 0; border: 2px solid var(--ink); border-radius: 12px; background: #fff; overflow: hidden; }
.project-group-card summary { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 14px; cursor: pointer; }
.project-group-card summary span:first-child b, .project-group-card summary span:first-child small { display: block; }
.project-group-card summary small { color: var(--muted); margin-top: 3px; }
.project-group-card summary code { padding: 7px 10px; border-radius: 8px; background: #edf3ff; color: var(--brand); font-size: 1.05rem; font-weight: 900; letter-spacing: .1em; }
.project-group-body { padding: 0 15px 18px; border-top: 1px solid var(--border); }
.project-status { padding: 5px 8px; border-radius: 999px; font-size: .72rem; font-weight: 900; }
.status-draft { background: #fff3cd; color: #765500; }
.status-sent { background: #d8f2ff; color: #075a78; }
.status-done { background: #d9f7e2; color: #17662d; }
.member-chip-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.member-chip-list span { padding: 7px 10px; border: 1px solid var(--border); border-radius: 999px; background: #f8fafc; font-size: .87rem; }
#copyGroupCodeBtn { flex: 0 0 auto; }
.project-submission-review { padding: 12px; border-radius: 10px; background: #f7f8fb; }
.project-submission-review p { white-space: pre-line; }
.project-file-list { display: flex; flex-direction: column; gap: 7px; margin: 9px 0; }
.project-file-list a { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; overflow-wrap: anywhere; }
.project-grading { margin-top: 16px; padding-top: 8px; border-top: 2px solid var(--border); }
.project-member-grade-head, .project-member-grade { display: grid; grid-template-columns: minmax(110px, 1fr) repeat(3, 90px); gap: 8px; align-items: center; margin-top: 8px; }
.project-member-grade-head { color: var(--muted); font-size: .72rem; font-weight: 800; }
.project-member-grade > .field { margin: 0; }
.project-member-grade > [data-member-comment] { grid-column: 1 / -1; }
.member-score { text-align: center; }
.project-code-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 17px;
  padding: 24px;
  background: radial-gradient(circle at top, #147b9e, #092d4a 72%);
  color: #fff;
  text-align: center;
}
.project-code-overlay.hidden { display: none; }
.project-code-overlay > button { position: absolute; top: 18px; right: 22px; border: 0; background: transparent; color: #fff; font-size: 3rem; cursor: pointer; }
.project-code-overlay > span { font-size: clamp(1.2rem, 3vw, 2rem); font-weight: 900; }
.project-code-overlay > strong { padding: 20px 30px; border: 3px solid #fff; border-radius: 18px; font-size: clamp(4rem, 18vw, 9rem); letter-spacing: .17em; line-height: 1; }
.project-code-overlay p { font-size: 1.1rem; }

/* Espaço compartilhado do grupo */
.group-workspace-page .project-hero { align-items: flex-start; }
.project-code-form { display: flex; gap: 10px; max-width: 520px; margin: 18px auto 0; }
.project-code-form .field { margin: 0; font-size: 1.6rem; font-weight: 900; letter-spacing: .15em; text-align: center; }
.project-code-form .btn { flex: 0 0 auto; width: auto; }
.project-stage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.project-stage-grid article { padding: 13px; border: 2px solid var(--ink); border-radius: 11px; background: #fff; }
.project-stage-grid article > span { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 8px; border-radius: 50%; background: #0d6884; color: #fff; font-weight: 900; }
.project-stage-grid article b { display: block; }
.project-stage-grid article p { margin: 5px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.4; }
.project-resource-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.project-resource-actions .btn { width: auto; }
.project-notice { margin: 12px 0; padding: 13px; border: 2px solid #996c00; border-radius: 10px; background: #fff4cc; color: #614500; font-weight: 800; }
.project-field-hint { margin: 0 0 5px; font-size: .84rem; }
.project-deliverable { margin: 14px 0; padding: 15px; border: 2px solid var(--border); border-radius: 12px; background: #fbfcff; }
.project-deliverable h3 { margin: 0; }
.project-upload-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.project-upload-row input { flex: 1 1 260px; min-width: 0; max-width: 100%; }
.project-upload-row .mini { flex: 0 0 auto; }
.project-member-result { margin: 10px 0; padding: 11px; border-left: 4px solid #0d6884; background: #f2fbff; }
.project-member-result b, .project-member-result span { display: block; }
.project-member-result span { margin-top: 4px; color: var(--muted); }
.project-save-help { margin: 5px 0 14px; font-size: .9rem; color: #405066; }
.project-submit-dialog {
  width: min(620px, calc(100% - 32px));
  padding: 24px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}
.project-submit-dialog::backdrop { background: rgba(10,18,32,.72); }
.project-submit-dialog h2 { margin: 7px 0 8px; }
.project-submit-dialog p { color: var(--muted); line-height: 1.55; }
.project-submit-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.project-submit-actions .btn { flex: 1 1 160px; width: auto; }

/* Galeria dos 30 prints e formulários digitais da MaratonaTech */
.scenario-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.scenario-filters .mini.active {
  border-color: #0d6884;
  background: #0d6884;
  color: #fff;
}
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.scenario-option {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .12s, box-shadow .12s, opacity .12s;
}
.scenario-option:hover:not(:disabled) { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.scenario-option img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top;
  border-bottom: 2px solid var(--ink);
  background: #edf2f7;
}
.scenario-option span, .scenario-option b, .scenario-option small { display: block; margin: 0 11px; }
.scenario-option span { margin-top: 10px; color: #0d6884; font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.scenario-option b { min-height: 2.8em; margin-top: 3px; line-height: 1.35; }
.scenario-option small { margin-top: 4px; margin-bottom: 11px; color: var(--muted); }
.scenario-option.selected { border-color: #0d6884; outline: 4px solid rgba(13,104,132,.18); }
.scenario-option.unavailable { opacity: .4; cursor: not-allowed; filter: grayscale(.8); }
.scenario-option.unavailable::after {
  content: 'Escolhido';
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #202431;
  color: #fff;
  font-size: .68rem;
  font-weight: 900;
}
.selected-scenario-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 390px);
  align-items: center;
  gap: 22px;
  border-color: #0d6884;
  background: linear-gradient(135deg, #fff, #edf9ff);
}
.selected-scenario-card.hidden { display: none; }
.selected-scenario-image {
  overflow: hidden;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  cursor: zoom-in;
  box-shadow: 5px 5px 0 var(--ink);
}
.selected-scenario-image img { display: block; width: 100%; max-height: 300px; object-fit: contain; }
.teacher-scenario-choice {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 16px 0;
  padding: 12px;
  border: 2px solid #0d6884;
  border-radius: 11px;
  background: #f2fbff;
}
.teacher-scenario-choice img { display: block; width: 100%; max-height: 125px; object-fit: cover; object-position: top; border-radius: 8px; }
.teacher-scenario-choice b { display: block; margin: 4px 0 10px; }
.project-awaiting-print { margin: 16px 0; padding: 12px; border: 2px dashed #8b95a7; border-radius: 10px; color: var(--muted); }
.project-member-editor { margin: 14px 0 18px; padding: 16px; border: 2px dashed #0d6884; border-radius: 12px; background: #f2fbff; }
.project-member-editor.hidden { display: none; }
.project-member-editor-head { align-items: flex-start; }
.project-member-editor-head h4 { margin: 4px 0 0; }
.project-member-editor > .btn { width: auto; }
.questionnaire-section { margin: 18px 0; padding: 18px; border: 2px solid var(--ink); border-radius: 13px; background: #fff; box-shadow: 4px 4px 0 var(--ink); }
.questionnaire-heading { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 16px; padding-bottom: 11px; border-bottom: 2px solid var(--border); }
.questionnaire-heading > span { display: grid; flex: 0 0 auto; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: #0d6884; color: #fff; font-weight: 900; }
.questionnaire-heading h3 { margin: 0 0 4px; }
.questionnaire-heading p { margin: 0; color: var(--muted); }
.question-text { margin: 15px 0; }
.question-checks { margin: 12px 0 17px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
.question-checks legend { padding: 0 6px; font-weight: 800; }
.question-checks label { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: #f8fafc; }
.question-checks input { flex: 0 0 auto; width: 19px; height: 19px; margin-top: 1px; }
.question-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.question-pair > b { grid-column: 1 / -1; }
.scenario-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 60px 24px 24px;
  background: rgba(10,18,32,.92);
}
.scenario-lightbox.hidden { display: none; }
.scenario-lightbox img { max-width: min(1100px, 96vw); max-height: calc(100vh - 90px); object-fit: contain; border-radius: 10px; background: #fff; }
.scenario-lightbox button { position: absolute; top: 12px; right: 20px; border: 0; background: transparent; color: #fff; font-size: 3rem; cursor: pointer; }

@media (max-width: 800px) {
  .project-layout { grid-template-columns: 1fr; }
  .project-material-grid, .project-stage-grid { grid-template-columns: repeat(2, 1fr); }
  .scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .selected-scenario-card { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 560px) {
  .project-hero { align-items: stretch; flex-direction: column; }
  .project-hero > .btn { width: 100%; }
  .project-material-grid, .project-stage-grid, .check-grid { grid-template-columns: 1fr; }
  .project-manager-head { flex-direction: column; }
  .project-group-code-help { align-items: flex-start; flex-direction: column; }
  .project-group-list-head { align-items: flex-start; flex-direction: column; }
  .project-group-filters { justify-content: flex-start; }
  .project-general-code { width: 100%; }
  .project-group-card summary { grid-template-columns: 1fr auto; }
  .project-group-card summary .project-status { grid-column: 1 / -1; width: max-content; }
  .project-code-form { flex-direction: column; }
  .project-code-form .btn { width: 100%; }
  .project-member-grade-head { display: none; }
  .project-member-grade { grid-template-columns: repeat(3, 1fr); }
  .project-member-grade > b, .project-member-grade > [data-member-comment] { grid-column: 1 / -1; }
  .scenario-grid, .question-pair { grid-template-columns: 1fr; }
  .teacher-scenario-choice { grid-template-columns: 1fr; }
}
