/* AFANDI – eine einzige mobile Ebene für Ansichten bis 700 px. */
@media (max-width: 700px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  /* Die Tab-Bar ersetzt am Handy das Burger-Menü. */
  .hamburger,
  .nav-links {
    display: none !important;
  }

  .af-mobile-tabs {
    position: fixed;
    z-index: 2000;
    right: 9px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 9px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 6px;
    border: 1px solid rgba(195, 215, 225, .94);
    border-radius: 16px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 14px 40px rgba(0, 46, 72, .22);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .af-mobile-tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 4px 1px;
    border-radius: 10px;
    color: #6b8290;
    font-size: 9.5px;
    font-weight: 650;
    line-height: 1.1;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .af-mobile-tabs i {
    display: grid;
    place-items: center;
    width: 33px;
    height: 30px;
    border-radius: 9px;
    background: #f1f6f8;
    color: #607d8b;
    font-style: normal;
  }

  .af-mobile-tabs svg {
    width: 19px;
    height: 19px;
  }

  .af-mobile-tabs a:nth-child(1) i { background: #e8f3f8; color: #12627f; }
  .af-mobile-tabs a:nth-child(2) i { background: #e8f6f2; color: #278c7c; }
  .af-mobile-tabs a:nth-child(3) i { background: #fff5de; color: #b67b12; }
  .af-mobile-tabs a:nth-child(4) i { background: #eeeafd; color: #6d5bd0; }
  .af-mobile-tabs a:nth-child(5) i { background: #fff0ec; color: #d26455; }

  .af-mobile-tabs a.active {
    color: #002e48;
  }

  .af-mobile-tabs a.active i {
    background: linear-gradient(145deg, #002e48, #12627f);
    color: #fff;
    box-shadow: 0 6px 15px rgba(0, 46, 72, .25);
  }

  /* Wird per JS direkt nach dem Einleitungstext eingesetzt. */
  .hero-home {
    min-height: auto;
  }

  .hero-home__content > .hero-home__visual {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
    justify-content: center;
    margin: 0;
    padding: 58px 8px 42px;
    overflow: visible;
  }

  .hero-home__visual .pHeroWrap,
  .hero-home__visual .hero-panel {
    width: 100%;
    max-width: 390px;
  }

  .hero-panel__main {
    padding: 18px;
    border-radius: 22px;
  }

  .hero-panel__title { font-size: 22px; }
  .hero-panel__sub { font-size: 12.5px; }
  .hero-panel__focus { padding: 13px; border-radius: 16px; }
  .hero-panel__item { padding: 9px 10px; }
  .hero-panel__tags { gap: 5px; }
  .hero-panel__tags span { padding: 5px 8px; font-size: 10px; }

  /* Der Cookie-Bereich bekommt den Bildschirm allein. */
  body.af-cookie-open {
    padding-bottom: 0;
  }

  body.af-cookie-open .af-mobile-tabs {
    display: none !important;
  }

  #cookie-bar {
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 3000;
    max-height: calc(100vh - 20px);
    max-height: calc(100svh - 20px - env(safe-area-inset-bottom));
    padding: 16px;
    overflow-y: auto;
    border: 1px solid #d8e5ec;
    border-radius: 16px;
    overscroll-behavior: contain;
  }

  #cookie-bar:not(.show) {
    transform: translateY(calc(100% + 30px));
  }

  #cookie-bar .cookie-btns {
    width: 100%;
    gap: 7px;
  }

  #cookie-modal {
    inset: 0;
    z-index: 3001;
    padding: 12px;
    align-items: center;
  }

  #cookie-modal .cookie-modal-box {
    max-height: calc(100vh - 24px);
    max-height: calc(100svh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  #totop {
    bottom: calc(96px + env(safe-area-inset-bottom));
    z-index: 1900;
  }

  /* Firefox: Das Seitenende bleibt vollständig über der Tab-Bar. */
  .footer {
    position: relative;
    padding-bottom: calc(108px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 701px) {
  .af-mobile-tabs {
    display: none !important;
  }
}
