/* huelle-widgets.css, X2 (Welle 7, 24.09.2026): Reiter aus Kacheln und die Kacheln
   im Dialog „Reiter anpassen" (Bauplan Widgets, Abschnitte 1 und 3).

   Das Raster: vier Spalten am Schreibtisch, zwei ab 900 Pixeln, eine ab 600; die
   Grenzen stehen gleich in widgets-raster.js (`spaltenFuer`), das die Anordnung
   nachrechnet. Die Reihenfolge der Liste ist die Reihenfolge im Raster, der Browser
   füllt Lücken selbst (`dense`). Alle Maße stehen hier, nicht im JavaScript
   (Haus-Regel „Anwendungs-Standards" §6). Ein Reiter in Kurzform trägt keines der
   Merkmale unten und sieht aus wie vorher. */

.kwLesesaal[data-raster] { display: flex; flex-direction: column; }
.kwLesesaal[data-raster] > .prommKopf { flex: none; }

.wgRaster { --wgReihe: 250px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: row dense; gap: 14px; margin-bottom: 18px; flex: none; }

.wgKachel { grid-column: 1 / -1; display: flex; flex-direction: column; min-width: 0;
  height: var(--wgReihe); border: 1px solid var(--linie); border-radius: var(--rundKlein, 8px);
  background: var(--panel); overflow: hidden; }
.wgKachel[data-groesse="klein"] { grid-column: span 1; }
.wgKachel[data-groesse="mittel"] { grid-column: span 2; }
.wgKachel[data-groesse="breit"] { grid-column: 1 / -1; }
/* Baukasten Welle 6 (E-19, 13.10.2026): Breite in Spalten und Höhe in Reihen. Die Hülle setzt
   beide an jeder Kachel (widgets-raster.js `masse`); sie gelten vor dem Größen-Wort. Eine
   Kachel über mehrere Reihen ist so hoch wie ihre Reihen samt den Lücken dazwischen. */
.wgKachel[data-breite="1"] { grid-column: span 1; }
.wgKachel[data-breite="2"] { grid-column: span 2; }
.wgKachel[data-breite="3"] { grid-column: span 3; }
.wgKachel[data-breite="4"] { grid-column: 1 / -1; }
.wgKachel[data-hoehe="2"] { grid-row: span 2; height: calc(2 * var(--wgReihe) + 14px); }
.wgKachel[data-hoehe="3"] { grid-row: span 3; height: calc(3 * var(--wgReihe) + 28px); }
.wgKachel[data-gross], .wgKachel[data-fenster] { cursor: pointer; }
.wgKachel[data-gross]:hover, .wgKachel[data-fenster]:hover { border-color: var(--randStark, var(--linie)); }
[data-anordnen] .wgKachel[data-fenster] { cursor: grab; }

.wgKopf { display: flex; align-items: center; gap: 8px; flex: none;
  padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--linie); }
.wgTitel { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wgKopf .navZahl { margin-left: 0; }
.wgKopf .zAktion { flex: none; }

/* Der Leib einer Kachel unter voll ist eine Vorschau: er rollt, sein Inhalt ist
   träge (`inert`), ein Klick auf die Kachel zeigt sie groß. Die Schrift ist eine
   Stufe kleiner als im Lesesaal, damit in einer Reihe etwas zu sehen ist. */
.wgLeib { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px; font-size: 12.5px;
  line-height: 1.5; }
.wgLeib h1 { margin: 2px 0 6px; font-size: 15px; }
.wgLeib h2 { margin: 12px 0 6px; font-size: 13.5px; }
.wgLeib h3, .wgLeib h4 { margin: 10px 0 4px; font-size: 12.5px; }
.wgLeib .tafelLeer { padding: 12px 4px; font-size: 12.5px; }
.wgListe { margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--linie); }
.wgListe .kwZeile { padding-top: 2px; padding-bottom: 2px; }

/* Die voll-Kachel steht zuletzt und nimmt den Rest des Reiters. Sie ist der
   Lesesaal ihres Reiters: ohne eigenen Rahmen, sie trägt den Kopf ihrer Art. */
.wgVoll { flex: 1 0 auto; display: flex; flex-direction: column; min-height: 420px; }
.wgVollLeib { flex: 1; min-height: 0; padding: 0; font-size: inherit; line-height: inherit;
  overflow: visible; }
.wgVollLeib h1 { margin: 4px 0 10px; font-size: 21px; }
.wgVollLeib h2 { margin: 22px 0 8px; font-size: 16px; }
.wgVollLeib h3, .wgVollLeib h4 { margin: 16px 0 6px; font-size: 14px; }
/* Dasselbe wie `.kwLesesaal[data-editor]` in huelle.css, für den geliehenen Saal. */
.wgVollLeib[data-editor] { overflow: hidden; display: flex; padding-bottom: 22px; }

/* Der Weg zurück aus der großen Ansicht zeigt nach links. */
.wgZurueck .ikon { transform: rotate(180deg); }

@media (max-width: 900px) {
  .wgRaster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wgKachel[data-breite="3"] { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .wgRaster { grid-template-columns: minmax(0, 1fr); }
  .wgKachel[data-groesse="mittel"], .wgKachel[data-groesse="klein"],
  .wgKachel[data-breite="1"], .wgKachel[data-breite="2"] { grid-column: span 1; }
  /* In einer Spalte ist eine Kachel höchstens zwei Reihen hoch (widgets-raster.js `masseBei`). */
  .wgKachel[data-hoehe="3"] { grid-row: span 2; height: calc(2 * var(--wgReihe) + 14px); }
  .wgVoll { min-height: 320px; }
  /* X5 (Welle 7b): Ein Widget klein ist auf dem Telefon nur so hoch wie sein Inhalt;
     in einer Reihe von 250 Pixeln schwamm die Zahl in einem leeren Kasten. */
  .wgKachel[data-groesse="klein"] { height: auto; min-height: 110px; }
  /* Welle 7 brachte lange Inhalte in ein Widget klein (Text): es wächst höchstens bis zu einer Reihe. */
  .wgKachel[data-groesse="klein"] { max-height: var(--wgReihe); }
  /* Welle 6: Mit einer Höhe von mehr als einer Reihe gilt die Höhe, auch für ein Widget klein;
     ein langer Text wuchs sonst ohne Grenze. */
  .wgKachel[data-groesse="klein"][data-hoehe="2"], .wgKachel[data-groesse="klein"][data-hoehe="3"] {
    height: calc(2 * var(--wgReihe) + 14px); max-height: none; }
}

/* --- Die Kacheln im Dialog „Reiter anpassen" ------------------------------------ */

#reiterAnpassenModal .raZeile.mitKacheln { grid-template-columns: 18px 34px minmax(0, 1fr) 104px 30px 30px 30px; }
#reiterAnpassenModal .raListe.mitNeu .raZeile.mitKacheln {
  grid-template-columns: 18px 34px minmax(0, 1fr) 104px 30px 30px 30px 30px; }
.kdFeld { display: flex; flex-direction: column; gap: 4px; margin: -2px 0 8px 34px;
  padding: 8px 0 8px 10px; border-left: 2px solid var(--linie); }
/* Feste Spalten wie bei den Reitern: Haken, Bauform, Aufschrift, Größe, Quelle, Einstellungen, hoch, runter. */
.kdZeile { display: grid; align-items: center; gap: 8px; padding: 5px 8px;
  grid-template-columns: 18px 96px minmax(0, 1fr) 92px 104px 30px 30px 30px;
  border: 1px solid var(--linie); border-radius: var(--rundKlein, 8px); }
.kdZeile.mitNeu { grid-template-columns: 18px 96px minmax(0, 1fr) 92px 104px 30px 30px 30px 30px; }
.kdZeile .raSichtbar { margin: 0; justify-self: center; }
.kdZeile select.kdGroesse { width: 100%; }
.kdZeile.aus { opacity: .55; }
.kdZeile select, .kdZeile input.raTitelFeld, .kdNeu input, .kdNeu select, .kdSpalten input {
  min-width: 0; background: var(--bg); border: 1px solid var(--linie); border-radius: 7px;
  color: var(--text); padding: 6px 8px; font: inherit; font-size: 13px; }
.kdZeile select:focus, .kdZeile input.raTitelFeld:focus, .kdNeu input:focus, .kdNeu select:focus,
.kdSpalten input:focus { outline: none; border-color: var(--blau); }
.kdArt { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--dim); font-size: 12px; }
.kdArt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kdArt .ikon { width: 15px; height: 15px; flex: none; }
.kdQuelle { min-width: 0; color: var(--dim); font-size: 11.5px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.kdSpalten { margin: 0 0 4px 22px; padding: 6px 10px; border-radius: var(--rundKlein, 8px);
  background: var(--zeile); }
.kdHinweis { margin: 4px 0; color: var(--dim); font-size: 12px; line-height: 1.5; }
.kdDazu { margin-top: 4px; }
.kdDazuKnopf { display: inline-flex; align-items: center; gap: 6px; }
.kdDazuKnopf .ikon { width: 14px; height: 14px; }
.kdFormen { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px;
  margin: 6px 0 8px; }
.kdForm { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: start; gap: 2px 8px;
  padding: 8px 10px; text-align: left; background: var(--panel); color: var(--text);
  border: 1px solid var(--linie); border-radius: var(--rundKlein, 8px); cursor: pointer; font: inherit; }
.kdForm:hover, .kdForm:focus-visible { border-color: var(--blau); outline: none; }
.kdForm .ikon { width: 18px; height: 18px; grid-row: 1 / span 2; color: var(--goldText, var(--dim)); }
.kdFormTitel { font-size: 13px; font-weight: 600; }
.kdFormKurz { font-size: 11.5px; color: var(--dim); line-height: 1.4; }
.kdNeu { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--linie);
  border-radius: var(--rundKlein, 8px); }
.kdNeuKopf { font: 600 13px var(--schrift); color: var(--kopf); margin: 2px 0 6px; }
.kdNeuFuss { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

@media (max-width: 560px) {
  #reiterAnpassenModal .raZeile.mitKacheln { display: flex; flex-wrap: wrap; }
  .kdFeld { margin-left: 8px; }
  .kdZeile { display: flex; flex-wrap: wrap; }
  .kdZeile input.raTitelFeld { flex: 1 1 140px; }
  .kdQuelle { flex: 1 1 100%; }
}

/* --- X4 (Welle 7b, 24.09.2026): die Widgets Zahl und Liste (huelle-widget-zahl.js) ----
   Die Zahl trägt die Schrift der Kacheln des alten Projektüberblicks (.zkWert, .zkFuss
   in huelle.css), eine Stufe größer; die Liste ist eine Zeile je Eintrag mit Datum. */
.wzZahl { display: flex; flex-direction: column; justify-content: center; min-height: 100%; }
.wzZahl .zkWert { font-size: 40px; }
.wzEinheit { font-size: 12px; color: var(--dim); }
.wzListe { list-style: none; margin: 0; padding: 0; }
.wzZeile { display: flex; align-items: baseline; gap: 10px; padding: 5px 0;
  border-top: 1px solid var(--linie); }
.wzZeile:first-child { border-top: 0; }
.wzTitel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wzDatum { flex: none; font-size: 11.5px; color: var(--dim); }
.wzZeile.verpasst .wzDatum { color: #E24B4A; font-weight: 600; }
.wzMehr { margin-top: 6px; font-size: 11.5px; color: var(--dim); }
