/* Anpassung für Tafeln mit dem Standardgerüst (.app > header.topbar + main.sheet + footer.actions) im gemeinsamen Layout.
   Wird von umbau.py zusammen mit layout.css in die Tafelkopie gelegt. Nur Übersteuerungen des Bestands, keine Kartenstile. */
html .app.tk, html .app.tk.is-scroll {
  display: grid !important; grid-template-areas: none !important;
  grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: var(--tk-luecke); width: 100%; height: 100vh; height: 100dvh; min-height: 0; max-width: none; margin: 0; overflow: hidden;
  padding: max(var(--tk-rand), env(safe-area-inset-top)) max(var(--tk-rand), env(safe-area-inset-right)) 0 max(var(--tk-rand), env(safe-area-inset-left));
}
/* Zone A */
html .app.tk .tk-auftrag {
  position: relative; top: auto; grid-row: 1; grid-column: 1; display: grid; grid-template-columns: minmax(0, 1fr);
  justify-items: center; align-items: center; margin: 0; min-height: var(--tk-auftrag-min);
}
html .app.tk .tk-auftrag > .task { justify-self: center; grid-column: 1; grid-row: 1; }
/* Zone B */
.app.tk > .tk-flaeche { display: block; grid-row: 2; grid-column: 1; min-width: 0; min-height: 0; }
.app.tk > .tk-flaeche > * { height: 100%; min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.app.tk.is-scroll > .tk-flaeche > * { overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
/* Zone C */
.app.tk > .tk-bedienung { grid-row: 3; grid-column: 1; }
.tk-eingabe > footer, .tk-eingabe > .actions { margin: 0; }
.tk-leiste { z-index: 30; }
.tk-leiste .tools { position: static; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.tk-leiste .chip-btn.icon-only, .tk-leiste .chip-btn.has-label { min-height: var(--tk-ziel); }
.tk-leiste .chip-btn.icon-only { display: inline-grid; place-items: center; flex: none; width: var(--tk-ziel); height: var(--tk-ziel); min-width: var(--tk-ziel); padding: 0; color: var(--ink); text-decoration: none; }
.tk-leiste .chip-btn.icon-only svg { width: 24px; height: 24px; }
.tk-leiste .segmented { flex: none; }
.tk-leiste-recht { color: var(--muted, #6b7385); }
.tk-leiste:has(.tk-fenster:not([hidden])) { z-index: 90; }
.tk-fenster .segmented { display: flex; flex-wrap: wrap; gap: 6px; }
html.ist-vollbild .tk-leiste-recht { display: none; }

/* Rückmeldung: Überlagerung am unteren Rand der Fläche, nur sichtbar mit Meldung */
.app.tk .tk-flaeche > .tk-rueckmeldung { opacity: 1; pointer-events: none; display: grid; justify-items: center; }
.app.tk .tk-flaeche > .tk-rueckmeldung:has(.feedback:not(.is-right):not(.is-wrong):not(.is-hint)) { display: none; }
.tk-rueckmeldung .feedback {
  flex: none; pointer-events: auto; justify-self: center; max-width: 100%; box-sizing: border-box; margin: 0;
  padding: 6px 16px 6px 8px; border: 2px solid var(--ink, #1c2230); border-radius: 999px; background: var(--soft, #f0f1f6);
  box-shadow: 0 10px 28px -12px rgba(20, 27, 45, .4);
}
.tk-rueckmeldung .feedback.is-right { background: var(--ok-soft, #dcfce7); }
.tk-rueckmeldung .feedback.is-wrong { background: var(--warn-soft, #ffedd5); }
.tk-rueckmeldung .feedback.is-hint { background: var(--hint-soft, #fef3c7); }
/* Eingabeleiste: Knöpfe mittig, umbrechend */
.tk-eingabe > footer.actions { justify-content: center; flex-wrap: wrap; }

/* Zusatzkinder der .app (Hinweise, Dialoge, versteckte Helfer): belegen keine eigene Zeile und nehmen keine Breite */
.app.tk > :not(.tk-auftrag):not(.tk-flaeche):not(.tk-bedienung):not(.gsr-auftrag-kopfbereich) { grid-area: 1 / 1 / -1 / -1; }
.app.tk > .tk-auftrag, .app.tk > .tk-flaeche, .app.tk > .tk-bedienung { width: auto; max-width: none; justify-self: stretch; }

/* Werkzeuge rechts in der Aufgabenzeile (Lautsprecher) */
html .app.tk .tk-auftrag > .tk-auftrag-werkzeuge { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: flex; gap: 8px; }

/* Live-Skript auftrag.js legt um die Kopfzeile einen Rahmen (.gsr-auftrag-kopfbereich) mit der Arbeitsanweisung:
   Der Rahmen ist die Aufgabenzone (Zone A), Kopfzeile und Anweisung stehen darin untereinander. */
html .app.tk > .gsr-auftrag-kopfbereich { grid-row: 1; grid-column: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--tk-luecke); min-width: 0; min-height: 0; }
html .app.tk > .gsr-auftrag-kopfbereich > .tk-auftrag { grid-row: auto; }

/* Rückmeldung (Alex 11.10.2026: „viel zu groß, muss verschwinden, wenn ich weitermache“):
   so hoch wie der Text, nie gestreckt, nicht über die halbe Fläche; verschwindet beim nächsten Antippen. */
.app.tk .tk-flaeche > .tk-rueckmeldung { align-content: end; align-items: end; height: auto; max-height: min(34%, 14rem); max-width: min(100% - 17px, 40rem); }
.tk-rueckmeldung .feedback { align-self: end; height: auto !important; min-height: 0 !important; max-height: none; flex: none;
  font-size: clamp(1rem, 2.3vh, 1.35rem); line-height: 1.3; border-radius: 22px; padding: 10px 18px 10px 10px; gap: 10px; }
.tk-rueckmeldung .feedback .fb-icon { flex: none; width: 36px; height: 36px; }
.app.tk .tk-flaeche > .tk-rueckmeldung.tk-rueck-weg { visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }
