/* Frühe Simulationen · gemeinsame Gestaltung (wie das KI Lab: Geist, feine Linien, ein Akzent, dunkel als Voreinstellung)
   Prof. Dr. Reinhard König in Zusammenarbeit mit Claude von Anthropic · CC BY 4.0 */
:root {
  --paper: #000000; --surface: #0f0f10; --ink: #ffffff; --ink-2: #c9c9ce; --muted: #8e8e96;
  --line: #2a2a2e; --accent: #4649e1; --accent-text: #9ea0f3;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --g: max(16px, env(safe-area-inset-left, 0px));
  --kopf-h: 57px;   /* Höhe der festen Kopfzeile (56 px + Linie): Maß für die Seitenleiste */
  color-scheme: dark;
}
:root[data-theme="light"] {
  --paper: #ffffff; --surface: #f2f2f2; --ink: #171717; --ink-2: #424242; --muted: #75757d;
  --line: #dededf; --accent-text: #4649e1;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--sans); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
html[lang="en"] [lang="de"], html[lang="de"] [lang="en"] { display: none !important; }

/* Kopfzeile: Rückweg zum Lab und zum Bereich, Titel, Sprache, Hell/Dunkel */
.kopf { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: stretch; min-height: 56px; }
.kopf > * { display: flex; align-items: center; padding: 0 var(--g); border-right: 1px solid var(--line); }
.kopf .marke { gap: 10px; flex: 0 0 auto; }
.kopf .marke b { font-weight: 300; font-size: 20px; letter-spacing: .01em; text-transform: uppercase; }
.kopf .pill { border: 1px solid var(--accent-text); color: var(--accent-text); border-radius: 999px; padding: 1px 10px; font-weight: 300; font-size: 14px; text-transform: uppercase; line-height: 1.3; }
.kopf .bereich { color: var(--muted); gap: 8px; }
.kopf .bereich:hover, .kopf .marke:hover b { color: var(--ink); }
.kopf h1 { flex: 1; margin: 0; font-weight: 300; font-size: 20px; text-transform: uppercase; min-width: 0; }
.kopf h1 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kopf .werkzeug { gap: 4px; border-right: 0; }
.sprache { font-weight: 300; font-size: 20px; text-transform: uppercase; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 0 3px; }
.sprache[aria-pressed="true"] { color: var(--accent-text); }
.sprache-trenn { font-weight: 300; font-size: 20px; color: var(--muted); }
.theme-btn { display: flex; align-items: center; gap: 6px; margin-left: 12px; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.theme-btn svg { width: 14px; height: 14px; }
.theme-btn:hover { border-color: var(--ink); }

/* Bühne und Steuerung */
.sim { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); border-bottom: 1px solid var(--line); }
.buehne { position: relative; padding: 16px var(--g); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.buehne canvas { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: var(--surface); touch-action: none; }
.buehne .unterzeile { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; color: var(--muted); }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 10px; height: 10px; border: 1px solid var(--line); display: inline-block; }
.hinweis { color: var(--muted); }
/* Regel für alle Apps (Nutzer 26.11.2026): Seitenleisten mit Reglern scrollen auf breiten Bildschirmen getrennt vom Hauptteil,
   damit die Bühne beim Einstellen weiter unten liegender Regler im Blick bleibt. Doppelte Linie (Bühne rechts, Leiste links, −1 px)
   hält die Trennlinie durchgehend, gleich welche Spalte länger ist. */
.buehne { border-right: 1px solid var(--line); }
.steuerung { border-left: 1px solid var(--line); margin-left: -1px; min-width: 0; position: sticky; top: var(--kopf-h); align-self: start; max-height: calc(100vh - var(--kopf-h)); max-height: calc(100dvh - var(--kopf-h)); overflow-y: auto; scrollbar-width: thin; }
.block { border-bottom: 1px solid var(--line); padding: 14px var(--g) 16px; display: flex; flex-direction: column; gap: 10px; }
.block:last-child { border-bottom: 0; }
.block h2 { margin: 0; color: var(--muted); font-weight: 400; }
.knoepfe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.knopf { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 6px; cursor: pointer; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.knopf:hover { border-color: var(--ink); }
.knopf.haupt { border-color: var(--accent-text); color: var(--accent-text); }
.knopf[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 10px; }
.zeile label, .zeile .name { color: var(--ink-2); }
.zeile output, .zeile .wert { font-family: var(--mono); font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.zeile input[type="range"] { grid-column: 1 / -1; width: 100%; margin: 2px 0 0; accent-color: var(--accent-text); }
.zeile select, .zeile input[type="number"] { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; font-family: var(--mono); font-size: 12px; max-width: 150px; }
.zeile input[type="number"] { width: 100px; }
.zeile input[type="checkbox"] { accent-color: var(--accent-text); width: 16px; height: 16px; margin: 0; }
.gruppe { color: var(--muted); margin-top: 4px; }
.kennzahlen { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
.kennzahlen dt { color: var(--ink-2); }
.kennzahlen dd { margin: 0; font-family: var(--mono); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }

/* Text, Quelle, Weiterentwickeln */
.text-teil { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); border-bottom: 1px solid var(--line); }
.text-teil > aside { padding: 24px var(--g); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.text-teil > aside a { color: var(--accent-text); }
.text-teil .text { padding: 24px var(--g) 36px; max-width: calc(72ch + 2 * var(--g)); font-size: 16px; line-height: 1.65; }
.text p { margin: 0 0 14px; }
.text h2 { font-weight: 500; font-size: 17px; margin: 22px 0 8px; }
.text a { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.text code { font-family: var(--mono); font-size: 13px; }
.weiter { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--accent-text); color: var(--accent-text); border-radius: 999px; padding: 7px 14px; width: fit-content; }
.weiter:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.fuss { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 18px var(--g) 32px; color: var(--muted); }
.fuss a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .sim { grid-template-columns: 1fr; }
  .buehne { border-right: 0; }
  .steuerung { border-left: 0; margin-left: 0; border-top: 1px solid var(--line); position: static; max-height: none; overflow: visible; }
  .text-teil { grid-template-columns: 1fr; }
  .text-teil > aside { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .kopf { flex-wrap: wrap; }
  .kopf .marke { flex: 1; height: 48px; border-right: 0; }
  .kopf .marke b { font-size: 16px; } .kopf .pill { font-size: 12px; }
  .kopf .werkzeug { height: 48px; }
  .kopf .bereich { order: 3; height: 40px; border-top: 1px solid var(--line); }
  .kopf h1 { order: 4; flex: 1 0 100%; height: 44px; border-top: 1px solid var(--line); border-right: 0; font-size: 17px; }
  .kopf .bereich { flex: 1 0 100%; border-right: 0; }
  .sprache, .sprache-trenn { font-size: 16px; }
  .theme-btn .t-txt { display: none; }
}
