/* ── tool.css — Charakter „YAML ⇄ JSON“ ───────────────────────────────────────────────────────────────────────
   WAS:   Akzente (Smaragd · Cyan · Orange = Eingabe/Fokus · Ausgabe/Kopplung · Fallen), Syntaxfarben (--s-*), das Hauptbild: zwei gleich hohe
          Textflächen nebeneinander mit Zeilennummern-Rinne und Kopplungsbalken, dazu Status mit Fehlerauszug und die Fallen-Tafel.
   WARUM: Das Werkzeug lebt davon, dass man sieht, welche Zeile links zu welcher Zeile rechts wird. Darum haben beide Seiten dieselbe feste Zeilenhöhe
          (--lh, in px — Pflicht: die Balken links werden aus scrollTop und Zeilennummer berechnet, nicht aus dem Text gemessen).
   WIE ÄNDERN: Akzente und --s-* nur oben in :root (dunkel, hell per Medienabfrage UND data-thema — beide Blöcke gleich halten); Grundbausteine in
          ../_werk/werk.css. Zeilenhöhe --lh und Innenabstand --pad müssen zu js/main.js (LH, PAD werden aus den Variablen gelesen) passen.
          Klassen: .yj-text (Eingabe-Textarea) · .yj-balken/.bar (Hervorhebungen links) · .yj-ausgabe/.zl (Zeilen rechts, .kopp = gekoppelt).
   LAYOUT (Lauf 2, 27.10.): EINE Spalte in voller Breite: Hauptbild (Richtung, Eingabe | Ausgabe in gleichen Hälften, Status, Beispiele), darunter die
          eingeklappten Kästen Einstellungen und Fallen, dann „Über dieses Tool“ und „Hilfe & Infos“. Alte Zweispalten-Aufteilung (5fr Fallen | 7fr Einstellungen)
          ist unten als (alt) auskommentiert. Eine Einspalten-Ansicht gilt bis 900 px (Handy: Eingabe zuerst, dann Ausgabe, Status, Beispiele, Kästen);
          Desktop- und Handy-Feinschliff stehen in getrennten Medienblöcken am Ende. */
:root {
  --a1: #34d399; --a2: #22d3ee; --a3: #fb923c; --a1-tinte: #04231a;
  --s-key: #7dd3fc; --s-str: #86efac; --s-num: #d8b4fe; --s-bool: #fdba74; --s-null: #94a3b8; --s-p: #8b95a5; --s-komm: #6f7887;
  --lh: 22px; --pad: 10px;
}
@media (prefers-color-scheme: light) { :root:not([data-thema="dunkel"]) {
  --a1: #047857; --a2: #0e7490; --a3: #c2410c; --a1-tinte: #ffffff;
  --s-key: #0369a1; --s-str: #15803d; --s-num: #7e22ce; --s-bool: #c2410c; --s-null: #64748b; --s-p: #6b7280; --s-komm: #8a919c; } }
:root[data-thema="hell"] {
  --a1: #047857; --a2: #0e7490; --a3: #c2410c; --a1-tinte: #ffffff;
  --s-key: #0369a1; --s-str: #15803d; --s-num: #7e22ce; --s-bool: #c2410c; --s-null: #64748b; --s-p: #6b7280; --s-komm: #8a919c;
}

.yj-raster { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
/* (alt) .yj-raster { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } .yj-haupt, .yj-werte-box { grid-column: 1 / -1; } */
.tafel-kopf { flex-wrap: wrap; }
.kopf-glyphe { width: 82px; background: var(--flaeche-3); box-shadow: inset 0 0 0 1px var(--linie), 0 10px 30px -14px var(--a1); }   /* Original-Icon (breit, transparent) auf neutralem Grund, hell und dunkel erkennbar */
.kopf-glyphe img { display: block; width: 68px; height: auto; max-height: 46px; object-fit: contain; }

/* Chips, Haken */
.chip[aria-pressed="true"] { background: color-mix(in srgb, var(--a1) 16%, var(--flaeche)); border-color: var(--a1); }
.yj-haken { width: 18px; height: 18px; flex: none; border-radius: 6px; border: 2px solid var(--linie-stark); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.chip[aria-pressed="true"] .yj-haken { background: var(--a1); border-color: var(--a1); }
.chip[aria-pressed="true"] .yj-haken::after { content: ""; width: 9px; height: 5px; border: solid var(--a1-tinte); border-width: 0 0 2.4px 2.4px; transform: translateY(-1px) rotate(-45deg); }
.chip.versteckt { display: none !important; }
.chip:disabled, .ikon-knopf:disabled, .kopier:disabled { opacity: .45; cursor: default; }

/* Kopfzeile des Hauptbilds */
.yj-kopfzeile { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 22px; }
/* (alt, Lauf 2: Versionsschalter und Erklärsatz sind in den Kasten „Einstellungen“ gezogen)
.yj-schema { display: flex; align-items: center; gap: 10px; } .yj-schema .feld-label { margin: 0; }
[data-richtung="jy"] .yj-schema { display: none; } */
.yj-schema-satz { margin: 10px 0 0; color: var(--leise); font-size: 14.5px; line-height: 1.5; }
.yj-beispiele { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.yj-beispiele .feld-label { margin: 0; }
.yj-beispiele .chip { min-height: 38px; padding: 4px 12px; }

/* Zweispalter */
.yj-paar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.yj-seite { min-width: 0; display: flex; flex-direction: column; }
.yj-seitenkopf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 48px; margin-bottom: 8px; }   /* Lauf 2: Umbruch erlaubt (vorher nowrap: bei 900–1100 px abgeschnitten) */
.yj-seitentitel { margin: 0; min-width: 0; font: 700 14px/1.2 var(--schrift); letter-spacing: .08em; text-transform: uppercase; color: var(--a1); display: flex; align-items: center; gap: 8px; }
.yj-seitentitel.a2 { color: var(--a2); }
.yj-pos { font: 500 13px var(--mono); color: var(--sehr-leise); }
.yj-knoepfe { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.yj-form button { padding: 6px 12px; min-height: 36px; }
[data-richtung="jy"] .yj-form { display: none; }   /* Formatiert|Kompakt gibt es nur für JSON-Ausgabe */
.yj-knoepfe .ikon-knopf, .yj-kopier-platz .kopier.breit { height: 38px; padding: 0 11px; }
.yj-kopier-platz { display: contents; }
.yj-kopier-platz .kopier.breit { background: var(--a2); border-color: var(--a2); color: var(--a1-tinte); }   /* Hauptaktion: Kopieren der Ausgabe */
.yj-kopier-platz .kopier.breit:hover { filter: brightness(1.08); color: var(--a1-tinte); }
.yj-kopier-platz .kopier.breit.ok { background: color-mix(in srgb, var(--ok) 16%, var(--flaeche)); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, transparent); }

.yj-editor { position: relative; display: flex; height: clamp(300px, 46vh, 560px); border: 1.5px solid var(--linie-stark); border-radius: var(--r); background: var(--flaeche-2); overflow: hidden;
  transition: border-color .15s, box-shadow .15s, background .15s; }
.yj-editor:focus-within { border-color: var(--a1); box-shadow: var(--fokus); background: var(--flaeche); }
.yj-aus-box { background: color-mix(in srgb, var(--a2) 5%, var(--flaeche-2)); }
.yj-aus-box:focus-within { border-color: var(--a2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a2) 50%, transparent); }
.yj-rinne { flex: none; width: 3.6em; overflow: hidden; border-right: 1px solid var(--linie); background: color-mix(in srgb, var(--flaeche-3) 45%, transparent); }
.yj-rinne-innen { padding: var(--pad) 10px var(--pad) 4px; font: 500 13px/var(--lh) var(--mono); color: var(--sehr-leise); text-align: right; white-space: pre; user-select: none; will-change: transform; }
.yj-rinne-innen .fz { color: var(--fehler); font-weight: 700; }
.yj-feld { position: relative; flex: 1; min-width: 0; }
.yj-balken { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.yj-balken .bar { position: absolute; left: 0; right: 0; }
.yj-balken .bar.koppel { background: color-mix(in srgb, var(--a2) 24%, transparent); box-shadow: inset 4px 0 0 var(--a2); }
.yj-balken .bar.fehler { background: var(--fehler-grund); box-shadow: inset 3px 0 0 var(--fehler); }
.yj-text { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; resize: none; border: 0; outline: none; background: transparent; color: var(--text);
  padding: var(--pad) 14px; font: 500 14.5px/var(--lh) var(--mono); white-space: pre; overflow: auto; tab-size: 2; caret-color: var(--a1); }
.yj-text::placeholder { color: var(--sehr-leise); }
.yj-ablage { position: absolute; inset: 0; display: none; place-items: center; border: 2.5px dashed var(--a1); border-radius: var(--r); background: color-mix(in srgb, var(--a1) 14%, var(--flaeche)); font: 700 20px var(--titel); pointer-events: none; }
.zieht .yj-ablage { display: grid; }

/* Ausgabe: Zeile für Zeile */
.yj-ausgabe { position: relative; flex: 1; min-width: 0; overflow: auto; padding: var(--pad) 0; outline: none; font: 500 14.5px/var(--lh) var(--mono); }
.yj-zeilen { display: block; min-width: 100%; width: max-content; }
.zl { display: flex; height: var(--lh); white-space: pre; cursor: default; }
.zl .nr { flex: none; position: sticky; left: 0; z-index: 1; width: 3.6em; box-sizing: border-box; padding: 0 10px 0 4px; text-align: right; font-size: 13px; color: var(--sehr-leise); background: color-mix(in srgb, var(--flaeche-3) 70%, var(--flaeche-2)); border-right: 1px solid var(--linie); user-select: none; }
.zl .tx { padding: 0 14px 0 12px; }
.zl:hover .tx { background: color-mix(in srgb, var(--flaeche-3) 55%, transparent); }
.zl.kopp .tx { background: color-mix(in srgb, var(--a2) 24%, transparent); box-shadow: inset 4px 0 0 var(--a2); width: 100%; }
:root[data-thema="hell"] .yj-balken .bar.koppel, :root[data-thema="hell"] .zl.kopp .tx { background: color-mix(in srgb, var(--a2) 30%, transparent); }
@media (prefers-color-scheme: light) { :root:not([data-thema="dunkel"]) .yj-balken .bar.koppel, :root:not([data-thema="dunkel"]) .zl.kopp .tx { background: color-mix(in srgb, var(--a2) 30%, transparent); } }
.zl.kopp .nr { color: var(--a2); font-weight: 700; }
.zl.rest { height: auto; padding: 8px 14px; color: var(--hinweis); font: 400 14px var(--schrift); white-space: normal; }
.yj-ausgabe:focus-visible .zl.fokus .tx { outline: 2px solid var(--a2); outline-offset: -2px; }
.yj-leer { position: absolute; left: 0; right: 0; top: 0; margin: 0; padding: 18px 20px; color: var(--leise); }
.yj-leer:empty { display: none; }
.s-key { color: var(--s-key); } .s-str { color: var(--s-str); } .s-num { color: var(--s-num); } .s-bool { color: var(--s-bool); } .s-null { color: var(--s-null); }
.s-p { color: var(--s-p); } .s-komm { color: var(--s-komm); font-style: italic; } .s-blk { color: var(--s-str); }
.yj-koppel { margin: 8px 2px 0; min-height: 1.5em; font-size: 14.5px; color: var(--leise); }

/* Status */
.yj-status { margin-top: 10px; }
.yj-badge-zeile .fb-info { margin-left: auto; }
.yj-status-knoepfe .yj-fallen-hinweis { border-color: color-mix(in srgb, var(--a3) 60%, transparent); background: color-mix(in srgb, var(--a3) 11%, var(--flaeche)); }
.yj-badge-zeile { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.yj-badge { font: 700 13px/1 var(--schrift); letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--linie-stark); color: var(--leise); }
.yj-badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.yj-badge.warn { color: var(--hinweis); border-color: color-mix(in srgb, var(--hinweis) 55%, transparent); background: color-mix(in srgb, var(--hinweis) 12%, transparent); }
.yj-badge.fehler { color: var(--fehler); border-color: color-mix(in srgb, var(--fehler) 55%, transparent); background: var(--fehler-grund); }
.yj-badge-text { font-weight: 700; font-size: 16px; }
.yj-status .meldung { font-size: 15.5px; }
.yj-ausschnitt { margin-top: 10px; padding: 8px 0; border-radius: var(--r); background: var(--flaeche-2); border: 1px solid var(--linie); overflow: auto; font: 500 14.5px/1.6 var(--mono); }
.yj-ausschnitt .az { display: flex; white-space: pre; padding: 0 12px; min-width: max-content; }
.yj-ausschnitt .az.fehler { background: var(--fehler-grund); }
.yj-ausschnitt .tx { white-space: pre; }
.yj-ausschnitt .nr { flex: none; margin-right: 12px; color: var(--sehr-leise); text-align: right; user-select: none; min-width: 2ch; }
.yj-ausschnitt .fehler .nr { color: var(--fehler); font-weight: 700; }
.yj-ausschnitt mark { background: var(--fehler); color: var(--grund); border-radius: 3px; padding: 0 2px; font-weight: 700; }
.yj-status-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.yj-status-knoepfe:not(:has(.chip:not(.versteckt))) { display: none; }
.yj-status-knoepfe .chip { min-height: 38px; padding: 4px 13px; background: var(--flaeche-2); }
.yj-hinweise { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.yj-hinweise:empty { display: none; }
.yj-hinweise li { padding: 8px 12px; border-radius: 11px; font-size: 14.5px; line-height: 1.45; background: color-mix(in srgb, var(--hinweis) 12%, transparent); border: 1px solid color-mix(in srgb, var(--hinweis) 40%, transparent); }
.yj-hinweise li.gut { background: color-mix(in srgb, var(--ok) 11%, transparent); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.yj-hinweise li.schlecht { background: var(--fehler-grund); border-color: color-mix(in srgb, var(--fehler) 50%, transparent); }

/* Fallen */
.fb-faltbar .fb-inhalt { margin-top: 14px; }
.yj-fallenliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 460px; overflow: auto; }
.yj-fallenliste .leer { color: var(--leise); font-size: 15px; padding: 4px 2px; }
.yj-fall { display: grid; width: 100%; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; text-align: left; padding: 10px 12px; border-radius: var(--r); background: var(--flaeche-2); border: 1px solid var(--linie); color: var(--text); transition: border-color .15s, background .15s; }
.yj-fall:hover { border-color: var(--a3); }
.yj-fall .fz { grid-row: 1 / span 3; align-self: start; font: 700 12.5px var(--mono); padding: 3px 8px; border-radius: 8px; background: color-mix(in srgb, var(--a3) 16%, transparent); color: var(--a3); white-space: nowrap; }
.yj-fall code { font: 700 17px var(--mono); overflow-wrap: anywhere; }
.yj-fall .werte-zeile { font: 500 14px var(--mono); color: var(--leise); overflow-wrap: anywhere; }
.yj-fall .werte-zeile b { color: var(--text); font-weight: 700; }
.yj-fall .erkl { font-size: 14px; color: var(--leise); line-height: 1.45; }
.yj-fall.geschuetzt .fz { background: color-mix(in srgb, var(--a1) 16%, transparent); color: var(--a1); }

/* Einstellungen */
.yj-gruppen { display: grid; gap: 18px; }
.yj-gruppe[hidden], .yj-gruppe.versteckt { display: none; }
[data-richtung="yj"] .yj-gruppe[data-fuer="jy"], [data-richtung="jy"] .yj-gruppe[data-fuer="yj"] { display: none; }
.yj-gruppentitel { margin: 0 0 8px; font: 700 13px/1.2 var(--schrift); letter-spacing: .08em; text-transform: uppercase; color: var(--sehr-leise); }
.yj-opt-zeile { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; }
.yj-opt .feld-label { margin-bottom: 5px; }
.yj-opt-zeile .chip { min-height: 44px; }

/* Kennzahlen — Lauf 2 entfernt
.yj-werte-box .werte { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); } */

/* Über dieses Tool (Tool-Profil, SEO/GEO) und Hilfe & Infos */
.tool-profil { margin-top: 18px; padding: 20px; border-radius: var(--r-gross); background: var(--flaeche); border: 1px solid var(--linie); box-shadow: var(--schatten); min-width: 0; }
.tool-profil-titel { margin: 0 0 10px; font: 700 15px/1.2 var(--schrift); letter-spacing: 0.08em; text-transform: uppercase; color: var(--leise); display: flex; align-items: center; gap: 9px; }
.tool-profil-titel::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--a1); }
.tool-profil h3 { margin: 18px 0 8px; font: 700 16px/1.3 var(--schrift); color: var(--text); }
.tool-profil p { margin: 0 0 10px; color: var(--leise); line-height: 1.6; }
.tool-profil-einl { color: var(--text); }
.tool-profil-liste { margin: 0; padding: 0 0 0 20px; color: var(--leise); line-height: 1.55; display: grid; gap: 4px; }
.tool-profil-faq { display: grid; gap: 8px; margin-top: 8px; }
.tool-profil-faq details { background: var(--flaeche-2); border: 1px solid var(--linie); border-radius: var(--r); padding: 0 16px; }
.tool-profil-faq summary { list-style: none; cursor: pointer; padding: 13px 0; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.tool-profil-faq summary::-webkit-details-marker { display: none; }
.tool-profil-faq summary::after { content: "+"; margin-left: auto; font: 500 22px/1 var(--mono); color: var(--sehr-leise); transition: transform 0.25s var(--kurve); }
.tool-profil-faq details[open] summary::after { transform: rotate(45deg); }
.tool-profil-faq details p { margin: 0 0 14px; }
.wissen-raster { grid-template-columns: minmax(0, 1fr); }
.wissen details p + p { margin-top: -6px; }

/* ── Einspaltig bis 900 px: Eingabe, Ausgabe untereinander; DOM-Reihenfolge = Handy-Reihenfolge (Eingabe zuerst), keine Umsortierung nötig ── */
@media (max-width: 900px) {
  .yj-paar { grid-template-columns: minmax(0, 1fr); }
  .yj-editor { height: clamp(260px, 44vh, 460px); }
}
/* ── Desktop (≥ 901 px): beide Seitenköpfe teilen sich eine Zeile (Subgrid), damit die Textflächen auch bei umbrechenden Knöpfen auf gleicher Höhe beginnen ── */
@media (min-width: 901px) {
  .yj-paar { grid-template-rows: auto auto; }
  .yj-seite { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
}
.yj-pos:empty { display: none; }
/* ── Desktop (≥ 901 px): Paar in gleichen Hälften; Beschriftungen der Knöpfe weg, wenn eine Hälfte zu schmal wird (Symbol + title) ── */
@media (min-width: 901px) and (max-width: 1180px) {
  .yj-knoepfe .ikon-knopf:not(#download) .knopf-text { display: none; }
  .yj-knoepfe .ikon-knopf { padding: 0 10px; }
}
/* ── Handy (≤ 640 px) ── */
@media (max-width: 640px) {
  .yj-editor { height: clamp(240px, 40vh, 380px); }
  .yj-text, .yj-ausgabe { font-size: 13.5px; }
  .yj-badge-text { font-size: 15px; }
  .yj-knoepfe .ikon-knopf .knopf-text { display: inline; font-size: 14px; }
  .yj-knoepfe .ikon-knopf { padding: 0 10px; }
  .yj-rinne { width: 3em; }
  .zl .nr { width: 3em; }
  .kopf-glyphe { width: 70px; }
  .kopf-glyphe img { width: 58px; max-height: 40px; }
  .tool-profil { padding: 16px; border-radius: 18px; }
  /* (alt) Umsortierung per order erst unter 640 px — überflüssig, die DOM-Reihenfolge stimmt schon:
  .yj-haupt { display: flex; flex-direction: column; }
  .yj-haupt > .tafel-kopf { order: 0; } .yj-haupt > .yj-paar { order: 1; } .yj-haupt > .yj-koppel { order: 2; } .yj-haupt > .yj-status { order: 3; }
  .yj-haupt > .yj-schema-satz { order: 4; margin-top: 12px; } .yj-haupt > .yj-beispiele { order: 5; }
  .yj-werte-box .werte { grid-template-columns: 1fr 1fr; } */
}
