/* =============================================
   Schreibtisch (schreibtisch.js, Regeln: DESIGN.md 7 und 8): Symbole und Widgets auf der Tapete, hinter den Fenstern.
   Am PC liegen sie auf Zellen (schreibtisch.js setzt left, top, width, height aus --st-…), am Handy fließen sie in vier
   Spalten und sind nur ohne Fenster zu sehen. Schrift direkt auf der Tapete: --tapete-text, --tapete-schatten.
   ============================================= */
.heim {
  --st-b: 124px;             /* eine Zelle (schreibtisch.js liest die Werte): Breite, Höhe */
  --st-h: 108px;
  --st-abstand: var(--a2);   /* zwischen den Zellen */
  --st-rand: var(--a4);      /* um das Raster */
  position: absolute;
  inset: 0;
  overflow: auto;
  outline: none;
}
/* Aus dem Explorer bzw. aus Dateien hereinziehen */
.heim.st-ablegen { box-shadow: inset 0 0 0 2px var(--akzent); }

.st-eintrag {
  position: absolute;
  border-radius: var(--r-menue);
  color: var(--tapete-text);
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}
.st-eintrag:focus-visible { outline: 2px solid var(--akzent); outline-offset: var(--a0); }
.st-symbol[aria-selected="true"] { background: var(--auswahl-flaeche); box-shadow: inset 0 0 0 1px var(--auswahl-rand); }

/* Symbol: Kachel, Ordner oder Datei, darunter der Name (zwei Zeilen) */
.st-symbol { display: flex; flex-direction: column; align-items: center; gap: var(--a1); padding: var(--a2) var(--a1) var(--a1); text-align: center; }
.st-symbol:hover:not([aria-selected="true"]) { background: var(--akzent-hover); }
.st-symbol .bild { display: grid; flex: none; place-items: center; width: 64px; height: 58px; }
.st-symbol .name {
  display: -webkit-box;
  max-width: 100%;
  padding: 1px var(--a1);
  overflow: hidden;
  border-radius: var(--r-klein);
  font-size: var(--s-klein);
  font-weight: 400;   /* wie in Dateien und im Startmenü */
  line-height: 1.35;   /* Unterlängen bleiben in der zweiten Zeile ganz */
  text-shadow: var(--tapete-schatten);
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.st-symbol[aria-selected="true"] .name { background: var(--akzent); color: var(--auf-akzent); text-shadow: none; }
.st-schloss { position: absolute; top: var(--a2); left: var(--a3); display: grid; place-items: center; width: 20px; height: 20px; border-radius: var(--r-rund); background: var(--glas-stark); color: var(--text-2); }
.st-schloss .ic { width: 12px; height: 12px; }
.st-umbenennen.feld { width: 100%; min-width: 0; height: auto; padding: 1px var(--a1); font-size: var(--s-klein); text-align: center; }

/* ---------- Widgets: Glas über mehrere Zellen, Schrift wie im Fenster (nicht auf der Tapete) ---------- */
.st-widget { padding: var(--a3) var(--a4); border-radius: var(--r-tafel); color: var(--text); }
.st-widget[aria-selected="true"] { box-shadow: inset 0 0 0 2px var(--auswahl-rand), var(--schatten-glas); }

/* Uhr (os.js osUhr stellt sie) */
.st-uhr { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--a1); height: 100%; text-align: center; }
.st-uhr-zeit { font-size: var(--s-gross); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.st-uhr-tag { color: var(--text-2); font-size: var(--s-klein); font-weight: 500; }

/* Aufgaben (To-do): Kopf mit der Zahl der offenen, die Liste (rollt), unten das Feld für eine neue */
.st-todo { display: flex; flex-direction: column; gap: var(--a2); height: 100%; min-height: 0; }
.st-todo-kopf { display: flex; flex: none; align-items: baseline; justify-content: space-between; gap: var(--a2); }
.st-todo-kopf b { font-size: var(--s-titel); font-weight: 600; }
.st-todo-kopf span { color: var(--text-2); font-size: var(--s-klein); }
.st-todo-liste { display: flex; flex: 1; flex-direction: column; gap: 1px; min-height: 0; margin: 0; padding: 0; overflow: auto; list-style: none; }
.st-todo-zeile { display: flex; flex: none; align-items: center; gap: var(--a2); min-height: var(--h-klein); padding: 0 var(--a1); border-radius: var(--r-knopf); }
.st-todo-zeile:hover { background: var(--akzent-hover); }
.st-todo-zeile .t { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.st-todo-zeile.fertig .t { color: var(--text-2); text-decoration: line-through; }
.st-todo-haken { display: grid; flex: none; place-items: center; width: 18px; height: 18px; padding: 0; border: 1.5px solid var(--linie-stark); border-radius: 50%; background: transparent; color: var(--auf-akzent); cursor: default; }
.st-todo-haken:hover, .st-todo-haken:focus-visible { border-color: var(--akzent); outline: none; }
.st-todo-zeile.fertig .st-todo-haken { border-color: var(--akzent); background: var(--akzent); }
.st-todo-haken .ic { width: 12px; height: 12px; stroke-width: 3; }
.st-todo-weg { display: grid; flex: none; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: var(--r-knopf); background: transparent; color: var(--text-2); opacity: 0; cursor: default; }
.st-todo-zeile:hover .st-todo-weg, .st-todo-weg:focus-visible { opacity: 1; }
.st-todo-weg:hover { background: var(--flaeche-3); color: var(--text); }
.st-todo-weg .ic { width: 12px; height: 12px; }
.st-todo-leer { flex: 1; margin: 0; color: var(--text-2); font-size: var(--s-klein); }
.st-todo-neu.feld { flex: none; width: 100%; }
@media (hover: none) { .st-todo-weg { opacity: 1; } }   /* mit dem Finger gibt es kein Darüberfahren */

/* Kalender: Kopf mit Monat und ‹ ›, darunter KW und Mo–So */
.st-kalender { display: flex; flex-direction: column; gap: var(--a2); height: 100%; }
.st-kal-kopf { display: flex; align-items: center; gap: var(--a1); }   /* wie .datumwahl-kopf: ‹ Monat › */
.st-kal-monat {
  flex: 1;
  min-width: 0;
  height: var(--h-klein);
  padding: 0 var(--a2);
  border: 0;
  border-radius: var(--r-knopf);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--s-titel);
  font-weight: 600;
  text-align: center;
  cursor: default;
}
.st-kal-monat:hover { background: var(--akzent-hover); }
.st-kal-raster {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  font-size: var(--s-klein);
  font-variant-numeric: tabular-nums;
}
.st-kal-raster .kopf { color: var(--text-2); font-size: var(--s-hinweis); font-weight: 600; }
.st-kal-raster .kw { color: var(--text-2); font-size: var(--s-hinweis); }
/* Tage sind Knöpfe (Klick: die Einträge des Tages an der Taskleiste); unten bis zu vier Punkte: eigene Einträge in
   Akzent, geplante Arbeiten in der Farbe ihres Balkens aus der Planung (--kf, sonst grau) */
.st-kal-raster .tag { position: relative; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--r-rund); background: transparent; color: inherit; font: inherit; cursor: default; }
.st-kal-raster .tag:hover { background: var(--akzent-hover); }
.st-kal-raster .tag:focus-visible { outline: 2px solid var(--akzent); outline-offset: 1px; }
.st-kal-raster .tag.gewaehlt { box-shadow: inset 0 0 0 1.5px var(--akzent); }
.st-kal-raster .punkte { position: absolute; bottom: 1px; left: 50%; display: flex; gap: 2px; transform: translateX(-50%); pointer-events: none; }
.st-kal-raster .punkte i { width: 4px; height: 4px; border-radius: 50%; background: var(--kf, var(--text-2)); }
.st-kal-raster .punkte i.eigen { background: var(--akzent); }
.st-kal-raster .heute .punkte i.eigen { background: var(--auf-akzent); }
.st-kal-raster .anders { opacity: 0.4; }
.st-kal-raster .frei { color: var(--gefahr); }   /* Sonntag, Feiertag (Name im Hinweis) */
.st-kal-raster .feiertag { font-weight: 600; }
.st-kal-raster .heute, .st-kal-raster .heute:hover { background: var(--akzent); color: var(--auf-akzent); font-weight: 600; }

/* ---------- Schmales Fenster und Handy: in vier Spalten, nur ohne Fenster; Widgets oben über die ganze Breite ---------- */
@media (max-width: 899px) {
  .heim { display: none; }
  .schreibtisch:not(:has(.fenster.aktiv:not(.min))) .heim {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--a4) var(--a1);
    align-content: start;
    padding: var(--a5) max(var(--a4), env(safe-area-inset-right, 0px)) var(--a5) max(var(--a4), env(safe-area-inset-left, 0px));
  }
  /* die Plätze vom PC (schreibtisch.js setzt sie am Element) gelten hier nicht, auch nicht im Augenblick des Umschaltens */
  .heim .st-eintrag { position: relative; inset: auto !important; width: auto !important; height: auto !important; }
  .heim .st-widget { grid-column: 1 / -1; }
  .heim .st-kal-raster { grid-auto-rows: 36px; }
  .heim .st-todo-liste { max-height: 260px; }
}
