/* Python-Editor (python-editor.js) – vom Lernbuch, von OOPventure und ProgVenture genutzt. */
.python-editor { display: grid; gap: .85rem; }
.python-editor-toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.python-code-shell {
  position: relative; min-height: 360px; border: 1px solid #cbd5e1; border-radius: 8px;
  overflow: hidden; background: #0f172a;
}
.python-code-input {
  width: 100%; min-height: 360px; max-height: 70vh; margin: 0; padding: 1rem 1.1rem;
  border: 0; overflow: auto; white-space: pre; tab-size: 4; line-height: 1.55;
  font: 15px/1.55 Consolas, 'Cascadia Code', ui-monospace, Menlo, 'Courier New', monospace;
  color: #dbeafe; caret-color: #f8fafc; background: transparent; outline: none;
}
.python-code-input::selection { background: rgba(96,165,250,.38); }
/* inline-block statt block: Sonst erzeugt der Zeilenumbruch zwischen den Zeilen eine Leerzeile. */
.python-line { display: inline-block; width: 100%; vertical-align: top; min-height: 1.55em; padding: 0 .35rem; margin: 0 -.35rem; border-radius: 4px; }
.python-line:empty::before { content: '\200B'; }  /* Höhe für den Cursor, zählt nicht als Text */
/* Zeilennummern als CSS-Zähler: Sie stehen nicht im Text, zählen also nicht bei der
   Cursorposition mit und lassen sich weder markieren noch kopieren. */
.python-code-input { counter-reset: zeile; padding-left: 3.6rem; }
.python-line { position: relative; counter-increment: zeile; }
.python-line::after {
  content: counter(zeile); position: absolute; right: 100%; top: 0; padding-right: .9rem;
  color: #56657d; font-weight: 400; font-style: normal; user-select: none; pointer-events: none;
}
.python-line.active-block::after { color: #93a4bf; }
.python-line.error-line::after { color: #fca5a5; }
.python-line.active-block { background: rgba(96,165,250,.11); box-shadow: inset 2px 0 0 rgba(96,165,250,.55); }
/* Die gerade abgespielte Zeile. Steht vor error-line, damit eine Fehlerzeile die Markierung gewinnt. */
.python-line.run-line { background: rgba(251,191,36,.20); box-shadow: inset 3px 0 0 #fbbf24; }
.python-line.error-line { background: rgba(248,113,113,.24); box-shadow: inset 3px 0 0 #f87171; }
.indent-guide { display: inline-block; width: 1ch; border-left: 1px solid rgba(148,163,184,.32); color: transparent; }
.tok-keyword { color: #93c5fd; font-weight: 700; }
.tok-builtin { color: #fbbf24; }
.tok-self { color: #f0abfc; font-style: italic; }
.tok-string { color: #86efac; }
.tok-number { color: #fca5a5; }
.tok-comment { color: #94a3b8; font-style: italic; }
/* Luecke aus der Palette: ein Klick markiert sie ganz, Tippen ersetzt sie. */
.platzhalter { background: rgba(251,191,36,.16); outline: 1px dashed rgba(251,191,36,.75); outline-offset: -1px; border-radius: 4px; color: #fde68a; font-style: italic; cursor: pointer; }
.platzhalter-rand { opacity: .5; font-style: normal; }
.python-console-wrap { border: 1px solid #d8dee6; border-radius: 8px; overflow: hidden; background: #fff; }
.python-console-title { padding: .45rem .75rem; background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-weight: 700; font-size: .85rem; color: #475569; }
.python-console { min-height: 130px; max-height: 320px; overflow: auto; padding: .85rem; white-space: pre-wrap; color: #0f172a; font: 14px/1.5 Consolas, 'Cascadia Code', ui-monospace, Menlo, 'Courier New', monospace; }
.python-console-error { color: #991b1b; background: #fff7f7; }

/* Passende Klammer zur Klammer am Cursor (python-editor.js, markiereKlammern) */
::highlight(klammer-paar) { background-color: rgba(250, 204, 21, .6); color: inherit; text-decoration: underline 2px #facc15; }
::highlight(klammer-allein) { background-color: rgba(229, 62, 62, .45); color: inherit; }

/* Suchen & Ersetzen (Strg + H, OOPventure 43A mit eigenem Knopf) */
.python-suche { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .4rem .5rem; border-radius: 8px; margin: 0 0 .3rem;
  background: #1e293b; color: #e2e8f0; }
.python-suche[hidden] { display: none; }
.python-suche input { font: 16px/1.3 Consolas, "Cascadia Code", monospace; padding: .25rem .45rem; border-radius: 6px;
  border: 1px solid #475569; background: #0f172a; color: #f8fafc; min-width: 0; flex: 1 1 9rem; }
.python-suche button { font-size: .9rem; padding: .25rem .6rem; border-radius: 6px; border: 1px solid #475569;
  background: #334155; color: #f8fafc; cursor: pointer; }
.python-suche button:hover { background: #475569; }
.python-suche .python-suche-zu { margin-left: auto; background: transparent; border: 0; font-size: 1.2rem; line-height: 1; }
.python-suche-info { font-size: .85rem; color: #cbd5e1; }
