/* ================================================================
   Dokumentation & Hilfe (#doku) - Knopf 📖 rechts oben, Ansicht mit
   Inhaltsverzeichnis links und Text rechts.

   Wie ueberall: style.css setzt input/button auf width:100% - hier
   ausdruecklich zurueckgesetzt.
   ================================================================ */

/* ---------- Knopf in der Kopfzeile ---------- */

#dokuBtn {
  width: auto !important;
  margin: 0 !important;
  min-width: 48px;
  height: 40px;
  padding: 0 14px;
  font-size: 19px;
  line-height: 20px;
  border-radius: 12px;
  /* seit 10/2026 alle Kopfzeilen-Knoepfe ohne Abstand unten (einstellungen.css) */
}

/* ---------- Layout ---------- */

.doku-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.doku-seite {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.doku-seite-kopf {
  padding: 14px 14px 10px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
}

.doku-titel {
  font-weight: 700;
  font-size: 16px;
  color: #4f46e5;
  margin-bottom: 8px;
}

.doku-suche {
  width: 100% !important;
  margin: 0 !important;
  padding: 8px 10px !important;
  font-size: 14px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-sizing: border-box;
}

.doku-toc {
  overflow-y: auto;
  padding: 8px 6px;
  flex: 1 1 auto;
}

.doku-toc a {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  color: #334155;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.35;
}

.doku-toc a:hover { background: #f1f5f9; color: #4f46e5; }
.doku-toc a.aktiv { background: #e0e7ff; color: #3730a3; font-weight: 600; }
.doku-toc a.doku-toc-e2 { font-weight: 700; margin-top: 6px; }
.doku-toc a.doku-toc-e3 { padding-left: 22px; }
.doku-toc a.doku-toc-e4 { padding-left: 34px; font-size: 12px; color: #64748b; }
.doku-toc-leer { padding: 12px; font-size: 13px; }

.doku-seite-fuss {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.doku-btn {
  width: auto !important;
  margin: 0 !important;
  flex: 1 1 0;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #4f46e5;
  background: #fff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
}

.doku-btn:hover { background: #eef2ff; }

/* ---------- Inhalt ---------- */

.doku-inhalt {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 28px 36px 60px;
  min-width: 0;
  font-size: 15px;
  line-height: 1.6;
  color: #1e293b;
}

.doku-inhalt h2 {
  font-size: 26px;
  margin: 44px 0 14px;
  padding-top: 14px;
  border-top: 2px solid #e0e7ff;
  color: #1e1b4b;
  scroll-margin-top: 16px;
}

.doku-inhalt h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }

.doku-inhalt h3 {
  font-size: 20px;
  margin: 32px 0 10px;
  color: #3730a3;
  scroll-margin-top: 16px;
}

.doku-inhalt h4 {
  font-size: 16px;
  margin: 22px 0 8px;
  color: #334155;
  scroll-margin-top: 16px;
}

.doku-inhalt p { margin: 0 0 12px; }
.doku-inhalt ul, .doku-inhalt ol { margin: 0 0 14px 22px; }
.doku-inhalt li { margin: 3px 0; }

.doku-inhalt code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: #f1f5f9;
  border-radius: 4px;
  padding: 1px 5px;
}

.doku-inhalt pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.45;
  margin: 0 0 16px;
}

.doku-inhalt pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

.doku-inhalt .ki-tabelle-huelle {
  overflow-x: auto;
  margin: 0 0 18px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.doku-inhalt table.ki-tabelle {
  width: 100% !important;
  min-width: 0;
  margin: 0;
  border-collapse: collapse;
  font-size: 13.5px;
}

.doku-inhalt table.ki-tabelle th {
  background: #f8fafc;
  color: #475569;
  text-align: left;
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.doku-inhalt table.ki-tabelle td {
  padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  white-space: normal;   /* ki-chat.css setzt nowrap - Doku-Tabellen sollen umbrechen */
}

.doku-inhalt table.ki-tabelle td.ki-zahl { text-align: left; }

.doku-inhalt table.ki-tabelle tr:last-child td { border-bottom: none; }
.doku-inhalt table.ki-tabelle tr:hover td { background: #fafbff; }

.doku-inhalt a.ki-link { color: #4f46e5; }

.doku-hervor {
  animation: dokuHervor 1.6s ease-out;
}

@keyframes dokuHervor {
  0%   { background: #fef3c7; }
  100% { background: transparent; }
}

.doku-hoch {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px !important;
  height: 44px;
  margin: 0 !important;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: #4f46e5;
  color: #fff;
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  cursor: pointer;
  z-index: 50;
}

/* ---------- Schmale Bildschirme ---------- */

@media (max-width: 1024px) {
  .doku-shell { grid-template-columns: 1fr; }
  .doku-seite { position: static; max-height: 320px; }
  .doku-inhalt { padding: 18px 16px 50px; }
}

/* ---------- Druck ---------- */

@media print {
  .header, .tabs, .doku-seite, .doku-hoch, .bn-huelle, .ki-huelle { display: none !important; }
  .doku-inhalt { border: none; padding: 0; font-size: 11pt; }
  .doku-inhalt pre { background: #f1f5f9; color: #0f172a; }
  .doku-inhalt h2 { page-break-before: always; border-top: none; }
  .doku-inhalt h2:first-child { page-break-before: auto; }
  .doku-inhalt .ki-tabelle-huelle, .doku-inhalt pre { page-break-inside: avoid; }
}
