/* Werkstatt der Lehrkraft (lehrer-werkstatt.js): #lehrer:werkstatt, #lehrer:eigen:<id|neu>, Ansicht #eigen:<id>.
   Nur Tokens aus design.css/styles.css (hell und dunkel ohne eigene Dunkel-Regeln); Klassen der Kachelansicht (k-layout, prose, example, check, merke) werden mitbenutzt. */

/* Reiter: vier Einträge passen auf schmale Handys nur ohne Symbole */
@media (max-width:440px){ .lk-reiter a svg{display:none} .lk-reiter a{padding:0 4px;font-size:.92rem} }

/* KI-Werkstatt */
.ew-ki{padding:clamp(18px,3vw,24px);border-radius:var(--r-l);display:flex;flex-direction:column;gap:10px;border:1.5px solid color-mix(in srgb,var(--brand) 30%,var(--line))}
.ew-ki-kopf{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 12px}
.ew-ki h2{font-family:var(--f-display);font-size:1.2rem;margin:0}
.ew-ki p{margin:0}
.ew-ki-form{max-width:760px}
.ew-ki-laeuft:empty{display:none}
.ew-ki-laeuft{color:var(--ink-2)}
.ew-ki-hinweis b{display:block}
.lk-tag.warte{background:var(--sun-soft)}

/* Editor: Formular links, Vorschau rechts (schmal: untereinander) */
.ew-editor{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);gap:16px;align-items:start}
.ew-form{display:flex;flex-direction:column;gap:16px;min-width:0}
.ew-form .lk-form{gap:12px}
.ew-form textarea,.ew-form input:not([type="radio"]):not([type="checkbox"]),.ew-form select{width:100%;min-width:0;box-sizing:border-box}
.ew-form textarea{resize:vertical;font:inherit;line-height:1.45}
.ew-felder3{grid-template-columns:minmax(0,1.3fr) minmax(0,1.2fr) minmax(0,.7fr)}
.ew-status{flex-direction:row;flex-wrap:wrap}
.ew-status > legend{width:100%}
.ew-status .lk-regel{flex:1 1 200px}
.ew-tipp{margin:0;overflow-wrap:anywhere}
.ew-form .btn.small,.ew-ki .btn{min-height:44px}
.ew-bloecke,.ew-fragen,.ew-karten{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.ew-zeile{display:flex;gap:8px;align-items:flex-end;min-width:0}
.ew-zeile > .field,.ew-zeile > .ew-karte-felder{flex:1 1 auto;min-width:0}
.ew-zeile .lk-ed-knoepfe{padding-bottom:2px}
.ew-karte-felder{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
.ew-frage > fieldset{border:1px solid var(--line);border-left:4px solid var(--fc,var(--brand));border-radius:14px;margin:0;padding:10px 12px 12px;min-width:0}
.ew-frage > fieldset > legend{font-weight:700;padding:0 6px}
.ew-antworten{border:0;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;min-width:0}
.ew-antworten > legend{font-weight:700;font-size:.92rem;padding:0;margin-bottom:4px}
.ew-antwort{display:flex;align-items:center;gap:8px;min-width:0}
.ew-antwort input:not([type="radio"]){flex:1 1 auto;min-height:44px}
.ew-richtig{flex:none;display:inline-grid;place-items:center;width:44px;height:44px;border-radius:12px;border:1.5px solid var(--line);background:var(--surface);cursor:pointer}
.ew-richtig input{width:22px;height:22px;margin:0;accent-color:var(--good);cursor:pointer}
.ew-richtig:has(input:checked){border-color:var(--good);background:color-mix(in srgb,var(--good) 16%,var(--surface))}
.ew-richtig:has(input:focus-visible){outline:3px solid var(--brand);outline-offset:2px}

.ew-vorschau{position:sticky;top:calc(88px + env(safe-area-inset-top,0px));max-height:calc(100vh - 110px);overflow:auto;padding:clamp(14px,2.4vw,20px);border-radius:var(--r-l);min-width:0}
.ew-v-kopf{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:2px 10px;margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid var(--line)}
.ew-v-kopf h2{font-family:var(--f-display);font-size:1.1rem;margin:0}
.ew-vorschau .ew-layout{grid-template-columns:minmax(0,1fr);gap:16px;padding-block:12px 0}
.ew-vorschau .k-side{position:static}
.ew-vorschau .ew-titel{font-size:1.45rem}
.ew-vorschau h4{font-family:var(--f-display);font-size:1.05rem;margin:0 0 8px}

/* Ansicht einer eigenen Kachel */
.ew-seite{padding-block:clamp(16px,3vw,28px) 40px;display:flex;flex-direction:column;gap:12px}
.ew-kachel{min-width:0}
.ew-kopf{display:flex;flex-direction:column;gap:6px;padding:clamp(18px,3vw,26px);border-radius:var(--r-l);background:linear-gradient(135deg,var(--fs),var(--surface) 70%);border:1px solid var(--line)}
.ew-kopf .eyebrow{color:var(--fc)}
.ew-titel{font-family:var(--f-display);font-size:clamp(1.7rem,4vw,2.5rem);line-height:1.1;margin:0;overflow-wrap:break-word;hyphens:auto}
.ew-kopf .lead{margin:0}
.ew-pills{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 0}
.ew-ki-pill{background:var(--brand-soft);color:var(--ink)}
.ew-entwurf-pill{background:var(--sun-soft);color:var(--ink)}
.ew-layout h2{font-family:var(--f-display)}
.ew-layout section{display:flex;flex-direction:column;gap:10px;margin-bottom:22px}
.ew-notiz{gap:8px}
.ew-notiz textarea{width:100%;box-sizing:border-box;font:inherit;resize:vertical;border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:var(--surface);color:var(--ink)}
.ew-notiz p{margin:0}
.ew-notiz p:empty{display:none}
.ew-kachel .prose{overflow-wrap:break-word}

@media (max-width:1000px){
  .ew-editor{grid-template-columns:minmax(0,1fr)}
  .ew-vorschau{position:static;max-height:none}
}
@media (max-width:560px){
  .ew-felder3{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .ew-felder3 > .field:first-child{grid-column:1 / -1}
  .ew-karte-felder{grid-template-columns:minmax(0,1fr)}
  .ew-zeile{flex-direction:column;align-items:stretch}
  .ew-zeile .lk-ed-knoepfe{justify-content:flex-end}
  .ew-aktionen{width:100%}
  .ew-aktionen .btn{flex:1 1 auto}
}
.ew-form input[type=number]{width:100%;padding:12px 14px;border-radius:12px;border:1.5px solid var(--line);background:var(--surface);color:var(--ink);min-height:44px}
