/* iPhone-Navigation: Tab-Leiste unten + "Mehr"-Blatt (nur schmale Bildschirme). */
.tabbar, .mehr-sheet, .mehr-backdrop { display: none; }

@media (max-width: 760px) {
  body { -webkit-tap-highlight-color: transparent; }
  .sidebar { display: none !important; }

  /* Kopf wie eine iPhone-App: grosser Titel, unter der Statusleiste */
  .topbar {
    position: sticky; top: 0 !important; z-index: 30;
    height: auto !important; min-height: 64px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px !important;
    background: rgba(7, 7, 7, 0.92);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  }
  .topbar .eyebrow { font-size: 10px; }
  .topbar h1 { font-size: 26px !important; line-height: 1.1; letter-spacing: -0.01em; }
  .topbar .icon-btn { width: 44px; height: 44px; font-size: 20px; }
  .main-content { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)) !important; }

  /* Lesbare Groessen und Fingerflaechen */
  .metric__label { font-size: 10px !important; }
  .btn, .text-btn { min-height: 44px; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(8, 8, 8, 0.94);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .tab {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 50px; padding: 4px 2px; border: 0; background: none;
    color: var(--faint); font: inherit; font-size: 10.5px; letter-spacing: 0.02em;
    touch-action: manipulation; cursor: pointer;
  }
  .tab svg { width: 25px; height: 25px; }
  .tab.is-active { color: var(--paper); }
  .tab:focus-visible { outline: 2px solid var(--line2); outline-offset: -2px; }
  .tab__zahl {
    position: absolute; top: 1px; left: calc(50% + 7px);
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--danger); color: #fff; font-style: normal; font-size: 10.5px; font-weight: 700;
    display: grid; place-items: center; line-height: 1;
  }
  .tab__zahl[hidden], .tab__punkt[hidden] { display: none; }
  .tab__punkt { position: absolute; top: 5px; left: calc(50% + 9px); width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }

  .mehr-backdrop.is-open { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, 0.55); }
  .mehr-sheet.is-open {
    display: block; position: fixed; z-index: 71;
    left: 8px; right: 8px; bottom: calc(76px + env(safe-area-inset-bottom));
    padding: 6px 0; border-radius: 16px;
    background: var(--panel3); border: 1px solid var(--line2);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
  }
  .mehr-item {
    display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 0 18px;
    border: 0; border-bottom: 1px solid var(--line); background: none;
    color: var(--paper); font: inherit; font-size: 16px; text-align: left; cursor: pointer;
  }
  .mehr-item:last-child { border-bottom: 0; }
  .mehr-item svg { width: 22px; height: 22px; color: var(--muted); flex: none; }
  .mehr-item span { flex: 1; }
  .mehr-item::after { content: "›"; color: var(--faint); font-size: 22px; line-height: 1; }
  .mehr-item.is-active { background: var(--panel2); }
  .mehr-item--weg { color: var(--danger); }
  .mehr-item--weg::after { content: none; }
  .mehr-item--weg svg { color: var(--danger); }
}

@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  .mehr-sheet.is-open { animation: mehr-rein 0.18s ease-out; }
  @keyframes mehr-rein { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
}
