/* Responsive Shell:
   Mobile  → einspaltig, fixe Bottom-Nav, daumenfreundliche Ziele (≥48px)
   Desktop → zweispaltig, sticky Sidebar links, Tastatur-Hinweise sichtbar */

.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-shell.chromeless .sidebar,
.app-shell.chromeless .bottom-nav {
  display: none;
}

/* ── Hauptbereich ── */
main.view {
  flex: 1;
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 20px 18px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom));
}

/* Sanfter, gestaffelter Einstieg pro View */
main.view > * {
  animation: fade-up 0.4s ease both;
}
main.view > :nth-child(2) { animation-delay: 0.05s; }
main.view > :nth-child(3) { animation-delay: 0.1s; }
main.view > :nth-child(4) { animation-delay: 0.15s; }
main.view > :nth-child(5) { animation-delay: 0.2s; }
main.view > :nth-child(6) { animation-delay: 0.25s; }

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Sidebar (Desktop) ── */
.sidebar {
  display: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.side-link:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.side-link.active {
  background: var(--azul-tint);
  color: var(--azul-deep);
}

.side-link .icon {
  font-size: 1.1rem;
  width: 1.4em;
  text-align: center;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* ── Bottom-Nav (Mobile) ── */
.bottom-nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 40;
  display: flex;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--card) 90%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

.bottom-link {
  /* `flex: 1` allein genügt nicht: Flex-Elemente schrumpfen per Vorgabe nicht
     unter ihre Inhaltsbreite. Der längste Eintrag („Portugal-Modus") hielt
     deshalb seine Breite und drückte die übrigen auf gemessene 22 px — unter
     die 24 px aus SC 2.5.8. `min-width` setzt beides: gleichmäßige Aufteilung
     und eine harte Untergrenze. */
  flex: 1 1 0;
  min-width: 24px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.62rem;
  font-weight: 600;
}

.bottom-link .label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-link .icon {
  font-size: 1.3rem;
  line-height: 1.2;
}

.bottom-link.active {
  color: var(--azul);
}

/* Tastatur-Hinweise nur auf Desktop */
.kb-hint {
  display: none;
}

/* ── Desktop ── */
@media (min-width: 900px) {
  .app-shell {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
  }

  .app-shell.chromeless {
    display: block;
  }

  .bottom-nav {
    display: none;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 26px 18px 22px;
    background: var(--paper-2);
    border-right: 1px solid var(--line);
  }

  main.view {
    padding: 44px 48px 72px;
  }

  .kb-hint {
    display: block;
    margin-top: 14px;
    font-size: 0.78rem;
    color: var(--ink-soft);
  }
}

/* ── Brand ── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-tile {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 2px solid var(--azul-deep);
  background: conic-gradient(
    from 45deg,
    var(--azul) 25%,
    var(--card) 0 50%,
    var(--azul) 0 75%,
    var(--card) 0
  );
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.15;
}

.brand-sub {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}
