/* Project pages: the code editor and the verdict list. */

.editor-card { overflow: hidden; }

/* A textarea and a line-number gutter, sharing exact font metrics so the
   numbers stay aligned with the lines they label. */
.ed-wrap {
  display: flex;
  align-items: stretch;
  background: #FDFDFB;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-height: 320px;
  max-height: 52vh;
}
.ed-wrap.busy { opacity: 0.72; }

.ed-gutter,
.ed-area {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 14px 0;
  margin: 0;
  border: 0;
}

.ed-gutter {
  display: flex;
  flex-direction: column;
  padding-left: 14px;
  padding-right: 10px;
  color: var(--text-faint);
  text-align: right;
  user-select: none;
  overflow: hidden;
  background: #F6F6F3;
  border-right: 1px solid var(--border);
  min-width: 44px;
}

.ed-area {
  flex: 1;
  /* Same trap as the grid: a flex item will not shrink below its intrinsic
     width, and a textarea with white-space: pre has a wide one. Without this
     the editor pushes the page off the side of a phone. */
  min-width: 0;
  padding-left: 12px;
  padding-right: 14px;
  resize: none;
  outline: none;
  background: transparent;
  color: var(--text);
  tab-size: 4;
  white-space: pre;
  overflow: auto;
}
.ed-area:focus { box-shadow: inset 2px 0 0 var(--accent); }

.editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  flex-wrap: wrap;
}
.editor-actions .spacer { flex: 1; }
.ed-status,
.run-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); }

/* --- verdicts --- */

.verdict-head {
  padding: 11px 16px;
  font-weight: 700;
  font-size: 13px;
  border-top: 1px solid var(--border);
}
.verdict-head.ok  { color: var(--accent-2); background: rgba(0, 184, 169, 0.07); }
.verdict-head.bad { color: var(--accent);   background: rgba(255, 77, 109, 0.06); }

.verdict {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 2px 8px;
  padding: 9px 16px;
  font-size: 13px;
  border-top: 1px solid var(--border);
  align-items: start;
}
.verdict-mark { font-weight: 700; }
.verdict.ok  .verdict-mark { color: var(--accent-2); }
.verdict.bad .verdict-mark { color: var(--accent); }
.verdict-name { font-weight: 500; }
.verdict-why,
.verdict-cmp {
  grid-column: 2;
  font-size: 12px;
  color: var(--text-dim);
}
.verdict-cmp {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  /* got/want are JSON and can be a single long token. */
  overflow-wrap: anywhere;
}

.verdict-note {
  padding: 11px 16px;
  font-size: 12.5px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}
.verdict-note.bad { color: var(--accent); }

/* Learner output. Always populated with textContent, never innerHTML. */
.run-console {
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #F6F6F3;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
}

/* --- brief-side pieces --- */

pre.sample {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: #F6F6F3;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  overflow-x: auto;
}

.hint-list { list-style: none; padding: 0; margin: 0; }
.hint { margin-bottom: 8px; }
.hint-toggle {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  cursor: pointer;
}
.hint-toggle:hover { background: rgba(255, 77, 109, 0.05); }
/* Hints stay hidden until asked for: a hint you did not want is a spoiler. */
.hint-text { display: none; margin-top: 6px; font-size: 13px; color: var(--text-dim); }
.hint.open .hint-text { display: block; }
.hint.open .hint-toggle { border-style: solid; }

@media (max-width: 900px) {
  .ed-wrap { max-height: none; min-height: 260px; }
  /* Reclaim horizontal room on a phone: the gutter and the generous padding
     matter less than fitting a line of code. */
  .ed-gutter { min-width: 34px; padding-left: 8px; padding-right: 6px; }
  .ed-area { padding-left: 8px; padding-right: 8px; }
  .editor-actions { padding: 12px; }
}

/* A project in the module list: a sibling of a lesson row, marked so it does
   not read as just another lesson. */
.project-row .module-mark { color: #fff; font-size: 13px; }
.project-row { border-style: dashed; }
.project-row:hover { border-style: solid; }

/* ---------- projects in the sidebar and on the dashboard ---------- */

/* A project in the curriculum list. Same shape as a lesson button so the list
   reads as one sequence, with the accent mark and tag saying "this one is
   different". */
.project-btn .project-num {
  color: var(--accent-3);
  font-weight: 700;
}
.project-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-3);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
  opacity: 0.85;
}
.project-btn.active .project-tag { color: inherit; }

.module-card.project-card .module-mark { color: #fff; }
.module-card.project-card .module-card-foot { justify-content: space-between; }
