/* AP2-Lerntool – Paket A: Schreibtischtest, Fehler finden, Format-Kacheln (Diagramm-Editor: fmt_diagram.css) */

/* Code mit Zeilennummern */
.fmt-code { list-style: none; margin: 8px 0 12px; padding: 8px 0; background: var(--code-bg); color: var(--code-text); border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; font-family: var(--mono); font-size: 0.86rem; line-height: 1.5; }
.fmt-code li { display: flex; min-width: max-content; padding: 0 12px 0 0; }
.fmt-code .ln { flex: 0 0 2.6em; text-align: right; padding-right: 10px; color: var(--muted); user-select: none; }
.fmt-code code { white-space: pre; background: none; padding: 0; font-size: inherit; color: inherit; }
.fmt-code.small { font-size: 0.8rem; }
.fmt-code code, .fmt-bug code { border: 0; border-radius: 0; box-shadow: none; }

/* Trace-Tabelle */
.fmt-trace { border-collapse: collapse; font-size: 0.88rem; min-width: 100%; }
.fmt-trace th, .fmt-trace td { border: 1px solid var(--border); padding: 3px 4px; text-align: center; vertical-align: top; }
.fmt-trace thead th { background: var(--surface-2); font-family: var(--mono); font-weight: 600; padding: 6px 8px; white-space: nowrap; }
.fmt-trace th.lbl { background: var(--surface-2); font-weight: 500; color: var(--muted); font-size: 0.8rem; text-align: left; white-space: nowrap; padding: 6px 8px; }
.fmt-trace td.given { font-family: var(--mono); color: var(--muted); background: var(--surface-2); padding: 6px 8px; }
.fmt-trace td.none { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--surface-2) 6px 8px); }
.fmt-cell { width: 100%; min-width: 4.2em; padding: 5px 6px; font-family: var(--mono); font-size: 0.88rem; text-align: center; border-radius: 6px; }
.fmt-trace td.cell.ok { background: var(--good-weak); }
.fmt-trace td.cell.ok .fmt-cell { border-color: var(--good); color: var(--good); }
.fmt-trace td.cell.bad { background: var(--bad-weak); }
.fmt-trace td.cell.bad .fmt-cell { border-color: var(--bad); color: var(--bad); text-decoration: line-through; }
.fmt-trace .exp { display: block; font-family: var(--mono); font-size: 0.8rem; font-weight: 650; color: var(--good); padding-top: 2px; }
.fmt-trace td.reveal { padding: 6px 8px; }

/* Fehler finden */
.fmt-bug { list-style: none; margin: 8px 0 12px; padding: 6px 0; background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; font-family: var(--mono); font-size: 0.86rem; }
.fmt-bug .bline { padding: 0 8px; border-left: 3px solid transparent; }
.fmt-bug .bl { display: flex; align-items: center; gap: 8px; margin: 0; padding: 3px 0; font-weight: 400; cursor: pointer; min-width: 0; }
.fmt-bug .bl input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.fmt-bug .ln { flex: 0 0 1.8em; text-align: right; color: var(--muted); user-select: none; }
.fmt-bug code { white-space: pre; background: none; padding: 0; font-size: inherit; color: var(--code-text); overflow-x: auto; }
.fmt-bug .bline.marked { background: var(--mid-weak); border-left-color: var(--mid); }
.fmt-bug .bfix { padding: 2px 0 8px 54px; }
.fmt-bug .bfix input { width: 100%; font-family: var(--mono); font-size: 0.86rem; padding: 6px 8px; }
.fmt-bug .bline.found { background: var(--good-weak); border-left-color: var(--good); }
.fmt-bug .bline.missed { background: var(--mid-weak); border-left-color: var(--mid); }
.fmt-bug .bline.wrong { background: var(--bad-weak); border-left-color: var(--bad); }
.fmt-bug .bsol { padding: 2px 0 8px 54px; font-family: var(--font); font-size: 0.84rem; }
.fmt-bug .bsol .tag { font-weight: 600; }
.fmt-bug .bsol code { white-space: pre-wrap; font-family: var(--mono); }
.input.mono { font-family: var(--mono); }

/* Kacheln im Training */
.fmt-tiles .topicgrid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.fmt-tile { display: flex; flex-direction: column; gap: 6px; }
.fmt-tile .btnrow { margin-top: auto; padding-top: 4px; }
.fmt-ico { display: inline-flex; align-items: center; justify-content: center; width: 1.6em; height: 1.6em; border-radius: 6px; background: var(--accent-weak); color: var(--accent); font-size: 0.95rem; }
.fmt-mistakes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.fmt-dg.sol { margin-top: 6px; }

/* Lernkarten: keine Eingaben */
.flashcard .fmt-trace input, .flashcard .fmt-bug input, .flashcard .bfix { pointer-events: none; }

@media (max-width: 600px) {
  .fmt-code, .fmt-bug { font-size: 0.8rem; }
  .fmt-bug .bfix, .fmt-bug .bsol { padding-left: 8px; }
  .fmt-cell { min-width: 3.6em; font-size: 0.82rem; padding: 4px; }
  .fmt-trace th.lbl { font-size: 0.74rem; padding: 4px; white-space: normal; min-width: 4.5em; }
}
