/*
 * Brain-Resonance: "Hilfe & Fragen" mit einheitlichem Abstand zum Fensterrand (Silko, 11.11.2026).
 * Kopfbereich (Titel, Beschreibung, Suche, Einfach/Details), Filter-Chips, Karten und Versionszeile
 * stehen auf derselben Einrücklinie. Nur Abstände, keine Farben. BR-Overlay, Portal-CSS bleibt unverändert.
 */
#view-help {
  --br-help-inset: clamp(18px, 3.4vw, 36px);
}
#view-help .help-sticky {
  padding: 18px var(--br-help-inset) 14px;
}
#view-help .help-view-header {
  margin-bottom: 14px;
}
#view-help .help-view-header h2 {
  margin-top: 0;
}
#view-help .help-locale-note,
#view-help .help-toolbar {
  margin-bottom: 12px;
}
#view-help .help-cats {
  gap: 8px;
}
#view-help .help-scroll {
  padding: 16px var(--br-help-inset) 24px;
}
#view-help > .br-version {
  margin: 0;
  padding: 10px var(--br-help-inset) 16px;
}

/*
 * iPhone/schmale Geräte (QA #31, 11.11.2026, 390×844): Der feste Hilfe-Kopf war höher als das Fenster
 * (619 px Kopf bei 613 px Layout → 40 px für die Antworten, Überlappung mit der Versionszeile).
 * Bis 600 px Breite: Kopf nicht sticky, keine innere Scrollbox – die Seite scrollt normal, die Versionszeile
 * steht hinter der letzten Antwort. Themen-Chips in einer waagrecht wischbaren Zeile statt 5–6 Zeilen.
 */
@media (max-width: 600px) {
  #view-help.view-help.active,
  #view-help.view-help:not([hidden]) {
    display: block;
    min-height: 0;
    max-height: none;
  }
  #view-help .help-layout {
    display: block;
    max-height: none;
  }
  #view-help .help-sticky {
    position: static;
  }
  #view-help .help-scroll {
    overflow: visible;
    max-height: none;
    min-height: 0;
  }
  #view-help .help-cats {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: calc(-1 * var(--br-help-inset));
    margin-right: calc(-1 * var(--br-help-inset));
    padding: 2px var(--br-help-inset) 4px;
    scroll-padding-left: var(--br-help-inset);
  }
  #view-help .help-cats::-webkit-scrollbar {
    display: none;
  }
  #view-help .help-cats > * {
    flex: 0 0 auto;
  }
  /* Suchfeld: Platzhalter endet sauber mit "…" statt hart abgeschnitten (Schrift bleibt 16 px: kein iOS-Zoom). */
  #view-help .help-search {
    padding-left: 12px;
    padding-right: 12px;
    text-overflow: ellipsis;
  }
  #view-help .help-search::placeholder {
    text-overflow: ellipsis;
  }
}

/*
 * Kopfleiste bis 480 px (QA #31: Sprachwahl angeschnitten, Hilfe/Profil rechts außerhalb – war schon vor #31 so).
 * Die Buttons dürfen in eine zweite Zeile umbrechen; nichts ragt mehr aus dem Bildschirm.
 */
@media (max-width: 480px) {
  .topbar {
    max-width: 100%;
    min-width: 0;
  }
  .topbar .topbar-actions {
    flex-wrap: wrap;
    max-width: 100%;
    min-width: 0;
    row-gap: 8px;
  }
  .topbar .topbar-actions > * {
    flex-shrink: 1;
    min-width: 0;
  }
  .topbar #btn-profile {
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
