/* Navigation V2 – wird nach allen Design-Stylesheets geladen (design_head)
 * Desktop: feste Seitenleiste (Start, Favoriten, „Weitere Apps“), Unterseiten als Reiter über dem Inhalt.
 * Handy:   oben nur der Name der App (kein zweiter App-Wechsler), Wechsel über „Apps“ in der Leiste unten.
 */

/* ---------- Reiter über dem Inhalt (nur Desktop) ---------- */
.apptabs { display: none; }
@media (min-width: 760px) {
    .apptabs {
        display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 18px; padding: 4px;
        background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; width: fit-content; max-width: 100%;
    }
    .apptabs > a, .apptabs-more > summary {
        position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 10px;
        color: var(--muted); font-weight: 600; font-size: .92rem; text-decoration: none; white-space: nowrap; min-height: 36px;
    }
    .apptabs > a:hover, .apptabs-more > summary:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); text-decoration: none; }
    .apptabs > a.active, .apptabs-more > summary.active {
        background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    }
    .apptabs > a.active .ni, .apptabs-more > summary.active .ni { color: var(--nav-accent); }
    .apptabs .ni { display: inline-flex; padding: 0; background: none; }
    .apptabs .ni .ic { color: inherit; }
    .apptabs .ni .i { width: 1.05rem; height: 1.05rem; }
    .apptabs .nbadge { position: static; margin-left: 2px; }
    .apptabs-more { position: relative; }
    .apptabs-more > summary { list-style: none; cursor: pointer; user-select: none; }
    .apptabs-more > summary::-webkit-details-marker { display: none; }
    .apptabs-more > .menu-panel { z-index: 50; }
}

/* ---------- Seitenleiste: feste Struktur ---------- */
@media (min-width: 760px) {
    .side-more > summary {
        display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; margin-top: 6px;
        font-size: .95rem; font-weight: 600; color: var(--muted); cursor: pointer; list-style: none; user-select: none;
    }
    .side-more > summary::-webkit-details-marker { display: none; }
    .side-more > summary:hover { background: var(--card-2); color: var(--text); }
    .side-more > summary .ni { display: inline-flex; padding: 0; }
    .side-more > summary .ni .ic { color: inherit; }
    .side-more > summary .ni .i { width: 1.2rem; height: 1.2rem; }
    .side-more > summary .nl { flex: 1; min-width: 0; }
    .side-count {
        font-size: .75rem; font-weight: 700; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px;
        display: inline-flex; align-items: center; justify-content: center; background: var(--card-2); color: var(--muted);
    }
    .side-more > summary .chev { transition: transform .15s; }
    .side-more[open] > summary .chev { transform: rotate(180deg); }
    .side-more > .side-group { margin-top: 2px; }
    .appnav-side a.side-edit { font-size: .82rem; font-weight: 600; color: var(--muted); padding: 6px 12px 6px 44px; }
    .appnav-side a.side-edit:hover { color: var(--nav-accent); background: none; }
}

/* ---------- Handy: kein zweiter App-Wechsler in der Kopfzeile ---------- */
@media (max-width: 759px) {
    /* Der Name bleibt als Titel stehen; geöffnet wird das App-Raster nur über „Apps“ unten (portal.js öffnet dasselbe Element) */
    .topbar .menu.switcher > summary { pointer-events: none; }
    .topbar .menu.switcher > summary .chev { display: none; }
    .topbar .menu.switcher > summary.brand-btn { padding-left: 0; background: none; }
    .topbar:has(.menu.switcher[open]) .menu.switcher > summary { background: none; }
    /* Raster öffnet ohne spürbare Verzögerung */
    html .menu.switcher > .menu-panel { animation-duration: .14s; }
}
