body { display: flex; flex-direction: column; height: 100vh; }

.leiste {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 8px 14px;
}
body.embed .leiste { padding: 6px 4px; }

.werkstatt {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 1.15fr 1fr 0.9fr; gap: 10px;
  padding: 0 14px 14px;
}
body.embed .werkstatt { padding: 0 4px 4px; }
.werkstatt.zwei { grid-template-columns: 1.1fr 1fr; }

#editor {
  flex: 1; min-height: 0; resize: none; border: 0; padding: 10px 12px;
  font-size: 0.85em; line-height: 1.45; tab-size: 2; color: var(--text);
  background: #fbfbfb; white-space: pre; overflow: auto;
}

#vorschau { flex: 1; border: 0; width: 100%; background: #fff; }

.probleme {
  margin: 0; padding: 8px 12px 8px 34px; max-height: 42%; overflow: auto;
  border-top: 2px solid var(--rot); background: var(--rot-hell); font-size: 0.8em;
}
.probleme li { margin: 3px 0; }
.probleme li.gut { list-style: none; margin-left: -20px; color: var(--ok); font-weight: 600; }
.probleme .zeile { color: var(--rot-dunkel); font-weight: 700; margin-right: 4px; }
.probleme.ok { background: var(--ok-hell); border-top-color: var(--ok); }

.baum {
  flex: 1; overflow: auto; padding: 8px 10px; font-family: var(--mono); font-size: 0.78em; line-height: 1.55; white-space: nowrap;
}
.baum ul { list-style: none; margin: 0; padding-left: 16px; border-left: 1px dotted #c8c8c8; }
.baum > ul { border-left: 0; padding-left: 0; }
.knoten { cursor: default; border-radius: 4px; padding: 0 4px; display: inline-block; }
.knoten:hover, .knoten.aktiv { background: var(--rot-hell); }
.knoten .tag { color: var(--blau); font-weight: 700; }
.knoten .attr { color: var(--rot-dunkel); }
.knoten .txt { color: var(--grau); font-style: italic; }
.knoten.ergaenzt .tag { color: #9a9a9a; font-weight: 400; }
.knoten.wurzel .tag { color: var(--rot); }

.toast {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  background: var(--blau); color: #fff; border-radius: 8px; padding: 10px 12px;
  font-size: 0.8em; box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
}
.toast pre { margin: 6px 0 0; font-size: 0.95em; white-space: pre-wrap; color: #fff; }
#p-vorschau { position: relative; }

@media (max-width: 860px) {
  body { height: auto; }
  .werkstatt, .werkstatt.zwei { grid-template-columns: 1fr; }
  .panel { min-height: 280px; }
  #editor { min-height: 260px; }
}

/* Line marks for the step-by-step reveal (?aufdecken). */
.marken { position: absolute; left: 0; right: 0; pointer-events: none; overflow: hidden; }
#p-editor { position: relative; }
.marke { position: absolute; left: 0; right: 0; background: rgba(228, 0, 58, .08); border-left: 4px solid rgba(228, 0, 58, .35); }
.marke.jetzt { background: rgba(228, 0, 58, .18); border-left-color: var(--rot); }
.probleme li.jetzt { font-weight: 700; }
