/* AufgabenplanerPlus — Hilfe im Programm
 *
 * Zwei Spalten: Inhaltsverzeichnis links (steht), Abschnitte rechts (scrollen).
 * Der Inhalt scrollt in einem EIGENEN Kasten, nicht im Fenster — sonst läuft die
 * mitlaufende Markierung im Verzeichnis der Kopfleiste hinterher und das
 * Springen zu einer Sprungmarke landet unter der klebenden Werkzeugleiste.
 *
 * Farben ausschließlich über die Tokens aus styles.css, damit die Hilfe
 * mitzieht, wenn die Palette sich ändert.
 */

.hilfe-kopf .hilfe-kopf-info { font-size: 12px; }

.hilfe-buehne {
  display: flex; align-items: stretch; gap: 0;
  height: calc(100vh - 113px);
  background: var(--bg);
}

/* ---- Inhaltsverzeichnis ---- */
.hilfe-nav {
  flex: 0 0 268px; width: 268px; padding: 18px 14px 24px;
  border-right: 1px solid var(--border); background: #fff;
  display: flex; flex-direction: column; gap: 8px; overflow-y: auto;
}
.hilfe-nav .hilfe-suche {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border-input);
  border-radius: 8px; font-size: 13px;
}
.hilfe-nav .hilfe-suche:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,139,163,.14);
}
.hilfe-status { font-size: 11px; color: var(--muted); min-height: 14px; }
.hilfe-nav-titel {
  font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: .6px; text-transform: uppercase; margin-top: 6px;
}
.hilfe-nav-liste { display: flex; flex-direction: column; gap: 2px; }
.hilfe-nav-eintrag {
  display: block; padding: 7px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text); text-decoration: none;
  border-left: 3px solid transparent;
}
.hilfe-nav-eintrag:hover { background: #F2F4F9; }
.hilfe-nav-eintrag.aktiv {
  background: #EAF6F9; color: var(--primary); font-weight: 600;
  border-left-color: var(--primary);
}

/* ---- Inhalt ---- */
.hilfe-inhalt {
  flex: 1; min-width: 0; overflow-y: auto; scroll-behavior: smooth;
  /* position: relative ist PFLICHT, nicht Kosmetik: nur so ist dieser Kasten
     der offsetParent der Abschnitte. Sonst zaehlt offsetTop ab dem Seitenanfang,
     und das Springen landet um die Hoehe von Kopf- und Werkzeugleiste zu tief. */
  position: relative;
  padding: 22px 34px 60vh;   /* viel Luft unten: sonst lässt sich der letzte
                                Abschnitt nicht nach oben scrollen */
}
.hilfe-abschnitt { max-width: 820px; margin: 0 0 30px; }
.hilfe-abschnitt h2 {
  color: var(--navy); font-size: 21px; margin: 26px 0 10px;
  padding-bottom: 7px; border-bottom: 2px solid var(--border);
}
.hilfe-abschnitt:first-child h2 { margin-top: 4px; }
.hilfe-abschnitt .hilfe-unter {
  color: var(--navy); font-size: 15px; margin: 22px 0 6px; font-weight: 700;
}
.hilfe-abschnitt p { line-height: 1.62; margin: 9px 0; color: var(--text); }
.hilfe-abschnitt ul, .hilfe-abschnitt ol { margin: 9px 0; padding-left: 22px; }
.hilfe-abschnitt li { line-height: 1.58; margin: 5px 0; }

/* Wörtlich einzutragende Werte — abgesetzt, damit man sie abtippen kann */
.hilfe-abschnitt p.hilfe-code {
  font-family: "Consolas", "Courier New", monospace; font-size: 13px;
  background: #F4F6FA; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; margin: 6px 0 12px; overflow-x: auto; word-break: break-all;
}

/* ---- Fallen-Kasten: hier steht das Warum ---- */
.hilfe-falle {
  background: var(--gelb-bg); border: 1px solid var(--gelb-rand);
  border-left-width: 4px; border-radius: 10px;
  padding: 11px 14px; margin: 14px 0; line-height: 1.58; font-size: 13.5px;
}
.hilfe-falle::before {
  content: "Achtung"; display: block; font-weight: 700; font-size: 11px;
  letter-spacing: .5px; text-transform: uppercase; color: #8A5A00; margin-bottom: 3px;
}

/* ---- Tabellen ---- */
.hilfe-tab-rahmen { overflow-x: auto; margin: 13px 0; }
.hilfe-tab {
  border-collapse: collapse; width: 100%; font-size: 13.5px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
}
.hilfe-tab th {
  background: var(--navy); color: #fff; text-align: left; font-weight: 600;
  padding: 8px 12px; font-size: 12.5px;
}
.hilfe-tab td { padding: 8px 12px; border-top: 1px solid var(--grid); line-height: 1.5; vertical-align: top; }
.hilfe-tab td.erste { font-weight: 600; color: var(--navy); white-space: nowrap; }
.hilfe-tab.ohne-kopf tr:first-child td { border-top: none; }
.hilfe-tab tr:nth-child(even) td { background: #FAFBFD; }

/* ---- Bilder ---- */
.hilfe-bild {
  margin: 16px 0; padding: 0; cursor: zoom-in;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow-card);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.hilfe-bild:hover { border-color: var(--primary); box-shadow: var(--shadow-lift); }
.hilfe-bild img { display: block; width: 100%; height: auto; }
.hilfe-bild figcaption {
  padding: 8px 12px; font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--border); line-height: 1.5;
}

/* Bildlupe (im Overlay aus app.js) */
.hilfe-lupe { width: 100%; max-width: 1500px; cursor: zoom-out; text-align: center; }
/* Hoehe deckeln, damit die Bildunterschrift im Bild bleibt und nicht unter die
   Fensterkante rutscht — das Overlay scrollt zwar, aber niemand sucht dort. */
.hilfe-lupe img {
  display: block; margin: 0 auto; max-width: 100%;
  max-height: calc(100vh - 180px); width: auto; height: auto;
  object-fit: contain; border-radius: 12px;
  box-shadow: 0 24px 70px rgba(16,24,64,.5);
}
.hilfe-lupe .lupe-text { color: #fff; font-size: 13px; margin-top: 10px; line-height: 1.5; }
.hilfe-lupe .lupe-hinweis { color: rgba(255,255,255,.65); font-size: 11px; margin-top: 4px; }

/* ---- Suche ---- */
.hilfe-inhalt mark {
  background: #FFE9A3; color: inherit; border-radius: 3px; padding: 0 1px;
}
.hilfe-leer { max-width: 820px; padding: 30px 0; }

/* ---- Schmale Fenster: Verzeichnis wandert nach oben ---- */
@media (max-width: 900px) {
  .hilfe-buehne { flex-direction: column; height: auto; }
  .hilfe-nav {
    flex: 0 0 auto; width: 100%; border-right: none;
    border-bottom: 1px solid var(--border); max-height: 46vh;
  }
  .hilfe-nav-liste { flex-direction: row; flex-wrap: wrap; }
  .hilfe-nav-eintrag { border-left: none; border-bottom: 3px solid transparent; }
  .hilfe-nav-eintrag.aktiv { border-left-color: transparent; border-bottom-color: var(--primary); }
  .hilfe-inhalt { overflow: visible; padding: 16px 16px 40px; }
  .hilfe-abschnitt h2 { font-size: 19px; }
}
