/* Gerüst: PC = Seitenleiste + Mitte + Detail rechts. Handy = untere Leiste. */

#app { min-height: 100%; }

.seite { padding: var(--abstand); }

.mitte {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--abstand);
}

.huelle {
  display: flex;
  min-height: 100vh;
}

.inhalt {
  flex: 1;
  min-width: 0;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.seitenleiste { display: none; }
.detail { display: none; }

/* Handy: untere Leiste */
.untenleiste {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--flaeche);
  border-top: 1px solid var(--rand);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 100;
}

.nav-unten {
  flex: 1;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
  color: var(--text-leise);
  text-decoration: none;
}

.nav-unten.aktiv {
  color: var(--text);
  font-weight: 700;
  box-shadow: inset 0 3px 0 var(--gruppe);
}

.nav-icon { font-size: 20px; line-height: 1; }

@media (max-width: 959px) {
  .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

/* PC ab 960 px */
@media (min-width: 960px) {
  .untenleiste { display: none; }
  .inhalt { padding-bottom: 0; }

  .seitenleiste {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 230px;
    flex: none;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 16px 12px;
    background: var(--flaeche);
    border-right: 1px solid var(--rand);
    overflow-y: auto;
  }

  .seiten-kopf {
    font-weight: 700;
    padding: 8px 12px 16px;
    border-left: 6px solid var(--gruppe);
    margin-bottom: 8px;
  }

  .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
  }

  .nav-link:hover { background: var(--gruen-hell); }

  /* „Mehr ▾“: Reiter, die in der Leiste keinen Platz mehr haben (seit 0.34.7) */
  .nav-mehr > summary { list-style: none; cursor: pointer; }
  .nav-mehr > summary::-webkit-details-marker { display: none; }
  .nav-mehr-pfeil { margin-left: auto; }
  .nav-mehr[open] .nav-mehr-pfeil { transform: rotate(180deg); }
  .nav-mehr-liste { display: grid; gap: 4px; margin-top: 4px; padding-left: 12px; }

  .nav-link.aktiv {
    background: var(--gruen-hell);
    color: var(--text);
    font-weight: 600;
    box-shadow: inset 4px 0 0 var(--gruppe);
  }

  .seiten-fuss {
    margin-top: auto;
    display: grid;
    gap: 8px;
  }

  .detail {
    display: block;
    width: 340px;
    flex: none;
    border-left: 1px solid var(--rand);
    background: var(--flaeche);
    padding: var(--abstand);
  }

  .detail:empty { display: none; }
}

/* ---- Detailbereich: Vollbild am Handy, rechts am PC ---- */

.detail.offen {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: var(--flaeche);
  overflow-y: auto;
  padding: calc(var(--abstand) + env(safe-area-inset-top, 0px))
           var(--abstand)
           calc(var(--abstand) + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 960px) {
  .detail.offen {
    position: sticky;
    inset: auto;
    top: 0;
    z-index: auto;
    align-self: flex-start;
    max-height: 100vh;
    padding: var(--abstand);
  }
}
