/* Handy-Darstellung (bis 720 px): kompakte Kopfzeile, Menü als Leiste unten wie in einer App,
 * Startseite nach Wichtigkeit sortiert. Wird als letztes geladen; Desktop bleibt unberührt. */
@media (max-width: 720px) {
  /* Kopfzeile: eine Zeile mit Logo und Symbolen */
  .topbar__inner { flex-wrap: nowrap; gap: 8px; min-height: 54px; padding-block: 6px; }
  .brand-text span { display: none; }
  .brand-text strong { font-size: .95rem; }
  .topbar__tools { flex-wrap: nowrap; gap: 2px; }
  .topbar .global-search { display: none; }
  .user-switch { padding: 2px; border: 0; }
  .user-switch .dd-button { max-width: 38px; padding: 4px 2px; }
  .user-switch .dd-button .dd-label { display: none; }
  .icon-link { width: 36px; height: 36px; }
  .user-session__name { display: none; }

  /* Menü als Leiste unten, mit dem Daumen erreichbar */
  .topnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; order: 0; width: auto; display: flex; gap: 0; justify-content: space-around; overflow: visible;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(11, 18, 32, .96); backdrop-filter: blur(10px); border-top: 1px solid rgba(255, 255, 255, .1); }
  .topnav a { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 2px; border-radius: 10px; font-size: .74rem; text-align: center; white-space: nowrap; }
  .topnav a .nav-count { display: none; }
  .topnav a .nav-count-warn { display: inline-grid; position: absolute; top: 2px; right: 8px; min-width: 16px; height: 16px; font-size: .6rem; }
  .topnav a.active::after { top: 0; bottom: auto; left: 30%; right: 30%; }
  .page { padding-top: 16px; padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

  /* Startseite: zuerst was offen ist, dann Gehirn und Abteilungen, dann Erledigtes */
  .welcome-bar { gap: 10px; margin-bottom: 12px; }
  .welcome-bar h1 { font-size: 1.25rem; }
  .welcome-bar .btn { flex: 1 1 auto; justify-content: center; }
  .welcome-bar__search { flex: 1 1 100%; order: 3; }
  .cockpit { display: flex; flex-direction: column; gap: 12px; }
  .cockpit-open { order: 1; }
  .cockpit-center { order: 2; }
  .cockpit-done { order: 3; }
  .cockpit-col, .cockpit-center { height: auto; }
  .cockpit-done { display: none; }
  .cockpit-klapp { cursor: pointer; min-height: 32px; }
  .cockpit-klapp-hinweis { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .74rem; font-weight: 700; }
  .cockpit-klapp-pfeil { display: block; width: 18px; height: 18px; color: var(--muted); transition: transform .2s ease; }
  .cockpit-open:not(.is-zu) .cockpit-klapp-pfeil { transform: rotate(180deg); }
  .cockpit-open.is-zu .cockpit-scroll, .cockpit-open.is-zu .cockpit-foot { display: none; }
  .cockpit-open.is-zu { padding-bottom: 14px; }
  .cockpit-col { padding: 14px 14px 12px; }
  .cockpit-scroll { overflow: visible; margin: 0; padding: 0; }
  .cockpit-sub { position: static; background: none; }
  .cockpit-center { padding: 14px 12px 12px; }
  .cockpit-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; height: auto; }
  .cockpit-core { grid-column: 1 / -1; position: static; transform: none; margin-bottom: 4px; }
  .cockpit-core .hirn3d { --hirn: .85; }
  .cockpit-snippet, .cockpit-lines, .cockpit-orbits { display: none; }
  .cockpit-dept { position: static; transform: none; width: auto; padding: 10px; animation: none; }
  .cockpit-dept .dept-agents { display: none; }
  .cockpit-dept .dept-head strong { font-size: .8rem; }
  .cockpit-dept .dept-status { font-size: .62rem; }
  .cockpit-dept .dept-task { font-size: .72rem; }
  .cockpit-dept .dept-report { font-size: .66rem; }
  .cockpit-dept:hover, .cockpit-dept:focus-visible { scale: 1; }

  /* Wissen: normale Seite zum Scrollen statt fester Bühne */
  .kn-buehne { height: auto; min-height: 0; }
  .kn-inhalt-scroll { overflow: visible; padding: 14px 12px 24px; }
  .kn-inhalt-scroll.mit-panel { padding-right: 12px; }
  .kn-leiste { gap: 8px; padding: 10px 12px; }
  .kn-auswahl { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .kn-auswahl .chip { flex: none; }
  .kn-suche { flex: 1 1 100%; max-width: none; margin-left: 0; order: 3; }
  .kn-panel { position: fixed; top: auto; left: 8px; right: 8px; bottom: calc(70px + env(safe-area-inset-bottom)); width: auto; max-height: 72vh; z-index: 45; }

  /* Kennzahlen zwei pro Zeile */
  .stats, .stats-five { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stat { padding: 12px; }

  /* Ticket-Tabellen: nur das Wichtigste je Ticket */
  .data-table td[data-label="Eingestellt"], .data-table td[data-label="Größe"], .data-table td[data-label="Angaben"] { display: none; }

  /* Tickets und Board */
  .view-toggle { width: 100%; justify-content: stretch; }
  .view-toggle button { flex: 1; justify-content: center; }
  .chip-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chip-row > * { flex: none; }

  /* Einstieg: Schrift etwas kleiner */
  .einstieg-text strong { font-size: 1.6rem; }
}
