/* eCI-Design: angelehnt an die bisherige GitBook-Dokumentation (dunkel, Akzent #96c121) */
:root {
    --eci-bg: #1d1d1d;
    --eci-bg-header: rgba(35, 35, 35, 0.88);
    --eci-bg-elevated: #2c2c2c;
    --eci-bg-code: #2b2c2d;
    --eci-text: #fffffe;
    --eci-muted: rgba(255, 255, 254, 0.64);
    --eci-subtle: rgba(255, 255, 254, 0.08);
    --eci-border: #434343;
    --eci-accent: #96c121;
    --eci-header-h: 64px;
    --eci-sidebar-w: 288px;
    --eci-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --eci-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

html, body { background: var(--eci-bg); }
body {
    color: var(--eci-text);
    font-family: var(--eci-font);
    font-size: 16px;
    line-height: 1.625;
    letter-spacing: normal;
}
a, #body a { color: var(--eci-accent); text-decoration: none; }
a:hover, #body a:hover { color: var(--eci-accent); text-decoration: underline; }
#body a.highlight:after { display: none; }

/* ---------------------------------------------------------------- Kopfzeile */
#eci-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 300;
    height: var(--eci-header-h);
    display: flex; align-items: center; gap: 24px;
    padding: 0 24px;
    background: var(--eci-bg-header);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--eci-subtle);
}
#eci-header #logo {
    display: flex; align-items: center; gap: 12px;
    color: var(--eci-text); text-decoration: none;
    font-size: 16px; font-weight: 600; line-height: 1.2; white-space: nowrap;
}
#eci-header .eci-logo { display: flex; align-items: center; }
#eci-header .eci-logo svg { height: 26px; width: auto; display: block; }
#eci-header #logo .st0 { fill: var(--eci-text); }
#eci-header .eci-logo-text { padding-left: 12px; border-left: 1px solid var(--eci-border); }
.eci-header-links { margin-left: auto; display: flex; gap: 24px; }
.eci-header-links a { color: var(--eci-text); font-size: 14px; font-weight: 500; }
.eci-header-links a:hover { color: var(--eci-accent); text-decoration: none; }

#eci-header .searchbox {
    position: relative; margin: 0; width: 240px; height: 36px;
    display: flex; align-items: center; gap: 8px; padding: 0 12px;
    background: transparent; border: 1px solid #434441; border-radius: 12px;
}
#eci-header .searchbox label { position: static; color: var(--eci-muted); font-size: 14px; margin: 0; }
#eci-header .searchbox input {
    flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0;
    background: transparent; color: var(--eci-text); font-family: var(--eci-font); font-size: 14px;
}
#eci-header .searchbox input::placeholder { color: var(--eci-muted); }
#eci-header .searchbox > span { position: static; color: var(--eci-muted); cursor: pointer; }
#sidebar-toggle { display: none; color: var(--eci-text); font-size: 18px; }

/* ---------------------------------------------------------------- Sidebar */
#sidebar {
    top: var(--eci-header-h); width: var(--eci-sidebar-w);
    background: var(--eci-bg); font-size: 14px; line-height: 20px;
}
#sidebar .highlightable { padding: 16px 12px 32px 24px; }
#sidebar ul.topics, #sidebar ul.topics ul { margin: 0; padding: 0; list-style: none; }
#sidebar ul.topics li { margin: 0; padding: 0; background: none !important; list-style: none; }
#sidebar ul.topics li a,
#sidebar ul.topics > li.parent > a, #sidebar ul.topics > li.active > a {
    display: block; padding: 6px 6px 6px 12px; border-radius: 6px;
    color: var(--eci-muted); font-size: 14px; line-height: 20px; font-weight: 400;
    background: none;
}
#sidebar ul.topics li a:hover { color: var(--eci-text); background: var(--eci-subtle); text-decoration: none; }
#sidebar ul.topics li.parent > a { color: var(--eci-text); }
#sidebar ul.topics li.active > a, #sidebar ul li.active > a {
    color: var(--eci-accent) !important; font-weight: 600; background: none;
    margin: 0; padding: 6px 6px 6px 12px;
}
#sidebar ul.topics > li.parent, #sidebar ul.topics > li.active { margin: 0; padding: 0; }
#sidebar ul.topics > li > a { font-size: 14px; line-height: 20px; }
#sidebar ul.topics ul { padding-bottom: 0; }
#sidebar ul.topics li.dd-item > ul {
    display: none; margin: 2px 0 2px 12px; padding-left: 4px;
    border-left: 1px solid var(--eci-border);
}
#sidebar ul.topics li.eci-group > ul,
#sidebar ul.topics li.dd-item.parent > ul, #sidebar ul.topics li.dd-item.active > ul,
#sidebar ul.topics li.dd-item.eci-open > ul,
#sidebar ul.topics.searched li.dd-item > ul { display: block; }
/* Suche: Treffer hervorheben, Rest abblenden */
#sidebar ul.topics.searched li a { color: rgba(255, 255, 254, 0.3); }
#sidebar ul.topics.searched li.search-match > a { color: var(--eci-text); }
#sidebar .eci-group-label {
    display: block; padding: 20px 12px 6px;
    color: var(--eci-text); font-size: 12px; font-weight: 600;
    letter-spacing: 0.3px; text-transform: uppercase;
}
#sidebar ul.topics > li.eci-group:first-child .eci-group-label { padding-top: 0; }
#sidebar ul.topics li.dd-item > ul > li.eci-group .eci-group-label { padding-top: 14px; }
#sidebar .read-icon, #sidebar hr, #sidebar #footer { display: none; }

/* Auf-/Zuklapp-Pfeile wie in GitBook */
#sidebar ul.topics li.dd-item > a { display: flex; align-items: center; gap: 8px; }
#sidebar ul.topics li.dd-item > a > span:first-child { flex: 1; min-width: 0; white-space: normal; overflow: visible; text-overflow: clip; }
#sidebar .eci-toggle {
    flex: none; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
    border-radius: 4px; color: var(--eci-muted); font-size: 16px; line-height: 1;
}
#sidebar .eci-toggle:hover { background: var(--eci-subtle); color: var(--eci-text); }
#sidebar .eci-toggle i { display: inline-block !important; margin: 0 !important; font-size: 16px; transition: transform 0.15s ease; }
#sidebar li.dd-item.parent > a .eci-toggle i,
#sidebar li.dd-item.active > a .eci-toggle i,
#sidebar li.dd-item.eci-open > a .eci-toggle i { transform: rotate(90deg); }
#sidebar li.dd-item.eci-closed > ul { display: none !important; }
#sidebar li.dd-item.eci-closed > a .eci-toggle i { transform: none; }

/* ---------------------------------------------------------------- Inhalt */
#body {
    margin-left: var(--eci-sidebar-w); padding-top: var(--eci-header-h);
    background: var(--eci-bg); min-height: 100vh;
}
#body .padding { padding: 40px 64px 64px; }
#body-inner { max-width: 768px; }
#body-inner, #body-inner p, #body-inner li { color: var(--eci-text); font-size: 16px; line-height: 26px; }
#body-inner p { margin: 0 0 16px; }
.eci-crumb { margin: 0 0 4px !important; color: var(--eci-accent) !important; font-size: 12px !important; line-height: 16px !important; }

#body-inner h1, #body-inner h2, #body-inner h3, #body-inner h4, #body-inner h5, #body-inner h6 {
    color: var(--eci-text); font-family: var(--eci-font); text-align: left;
    text-transform: none; letter-spacing: normal; text-rendering: optimizeLegibility;
}
#body-inner h1 { font-size: 36px; line-height: 45px; font-weight: 700; margin: 0 0 24px; border: 0; }
#body-inner h2 { font-size: 30px; line-height: 36px; font-weight: 600; margin: 48px 0 16px; }
#body-inner h3 { font-size: 24px; line-height: 32px; font-weight: 600; margin: 40px 0 12px; }
#body-inner h4 { font-size: 20px; line-height: 28px; font-weight: 600; margin: 32px 0 8px; }
#body-inner h5, #body-inner h6 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; }

#body-inner ul, #body-inner ol { margin: 0 0 16px; padding-left: 24px; }
#body-inner li { margin: 4px 0; }
#body-inner li::marker { color: var(--eci-muted); }
#body-inner hr { border: 0; border-top: 1px solid var(--eci-border); margin: 32px 0; }
#body-inner blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--eci-border); color: var(--eci-muted); }
#body-inner blockquote p { color: var(--eci-muted); }

#body img, #body-inner img {
    display: block; max-width: 100%; height: auto; margin: 16px 0;
    border: 0; border-radius: 4px; box-shadow: none;
}
#body-inner img + em, #body-inner p > em:only-child { color: var(--eci-muted); font-size: 14px; }

/* Code */
#body-inner code, #body-inner kbd {
    font-family: var(--eci-mono); font-size: 14px; color: var(--eci-text);
    background: var(--eci-bg-code); border: 0; border-radius: 4px; padding: 1px 6px;
}
#body-inner pre {
    margin: 16px 0; padding: 16px; overflow: auto;
    background: var(--eci-bg-code); border: 0; border-radius: 8px;
}
#body-inner pre code { padding: 0; background: none; font-size: 14px; line-height: 22px; white-space: pre; }
#body-inner .copy-to-clipboard { display: none !important; }
#body-inner code { border-top-right-radius: 4px !important; border-bottom-right-radius: 4px !important; }

/* Tabellen */
#body-inner table { width: 100%; margin: 16px 0; border-collapse: collapse; font-size: 14px; display: table; }
#body-inner th, #body-inner td { padding: 8px 12px; border: 0; border-bottom: 1px solid var(--eci-border); text-align: left; vertical-align: top; color: var(--eci-text); background: none; }
#body-inner th { background: var(--eci-bg-elevated); font-weight: 600; }
#body-inner tr:nth-child(even) td { background: none; }

/* Hinweisboxen (GitBook-Hints) */
#body .notices {
    position: relative; margin: 16px 0; padding: 12px 16px 12px 44px;
    border: 0; border-radius: 6px; background: var(--eci-bg-elevated);
    color: var(--eci-text); font-size: 14px; line-height: 20px;
}
#body .notices::before {
    position: absolute; left: 16px; top: 12px;
    font-family: FontAwesome; font-size: 16px; line-height: 20px; color: #787878;
    content: "\f05a";
}
#body .notices p, #body .notices li { margin: 6px 0; padding: 0; font-size: 14px; line-height: 20px; color: var(--eci-text); background: none; border: 0; }
#body .notices p:first-child { margin-top: 0; }
#body .notices p:last-child { margin-bottom: 0; }
#body .notices p::before, #body .notices p::after { display: none; content: none; }
#body .notices ul, #body .notices ol { margin: 6px 0; }
#body .notices.yellow { background: rgba(234, 179, 8, 0.12); }
#body .notices.yellow::before { content: "\f071"; color: #eab308; }
#body .notices.red { background: rgba(239, 68, 68, 0.13); }
#body .notices.red::before { content: "\f06a"; color: #ef4444; }
#body .notices.green { background: rgba(150, 193, 33, 0.12); }
#body .notices.green::before { content: "\f058"; color: var(--eci-accent); }

/* Update-Datum im Änderungsprotokoll, Video */
.update-date { color: var(--eci-muted) !important; font-size: 14px !important; margin-bottom: 4px !important; }
.video-embed iframe { max-width: 100%; border: 0; border-radius: 8px; }

/* Vor/Zurück */
#eci-pager { display: flex; gap: 16px; max-width: 768px; margin-top: 56px; }
#eci-pager > * { flex: 1; }
#eci-pager a {
    display: flex; flex-direction: column; gap: 2px; padding: 12px 16px;
    border: 1px solid var(--eci-border); border-radius: 8px; color: var(--eci-text);
}
#eci-pager a:hover { border-color: var(--eci-accent); text-decoration: none; }
#eci-pager a span { color: var(--eci-muted); font-size: 12px; }
#eci-pager a strong { font-weight: 600; font-size: 14px; }
#eci-pager .eci-next { text-align: right; }

/* Suchtreffer-Hervorhebung von Learn2 */
#body .highlight, mark.highlight { background: rgba(150, 193, 33, 0.3); color: inherit; }

/* ---------------------------------------------------------------- Mobil */
@media only all and (max-width: 59.938em) {
    #body .padding { padding: 32px 32px 48px; }
    .eci-header-links { display: none; }
    #eci-header .searchbox { margin-left: auto; }
}
@media only all and (max-width: 47.938em) {
    #sidebar-toggle { display: inline-block; }
    #eci-header { gap: 12px; padding: 0 16px; }
    #eci-header .eci-logo-text { display: none; }
    #eci-header .searchbox { width: 150px; }
    #sidebar { left: calc(-1 * var(--eci-sidebar-w)); }
    #body { margin-left: 0; }
    .sidebar-hidden #sidebar { left: 0; }
    .sidebar-hidden #body { margin-left: var(--eci-sidebar-w); }
    #body .padding { padding: 24px 16px 40px; }
    #body-inner h1 { font-size: 28px; line-height: 36px; }
    #body-inner h2 { font-size: 24px; line-height: 30px; }
}

/* Suche im statischen Export (Pagefind): Trefferliste unter dem Suchfeld */
#eci-header .searchbox input[type="search"]::-webkit-search-cancel-button { display: none; }
.eci-search-results {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 400;
    width: 420px; max-width: calc(100vw - 32px); max-height: 70vh; overflow-y: auto;
    padding: 6px; background: var(--eci-bg-elevated);
    border: 1px solid var(--eci-border); border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.eci-search-results[hidden] { display: none; }
.eci-search-results a {
    display: block; padding: 10px 12px; border-radius: 8px;
    color: var(--eci-text); text-decoration: none; font-size: 14px; line-height: 1.45;
}
.eci-search-results a:hover, .eci-search-results a:focus { background: var(--eci-subtle); text-decoration: none; color: var(--eci-text); }
.eci-search-results .eci-hit-title { color: var(--eci-accent); font-weight: 600; margin-bottom: 2px; }
.eci-search-results .eci-hit-text { color: var(--eci-muted); }
.eci-search-results mark { background: none; color: var(--eci-text); font-weight: 600; }
.eci-search-empty { margin: 0; padding: 10px 12px; color: var(--eci-muted); font-size: 14px; }

/* RSS-Feed-Button auf Update-Seiten */
#body-inner .eci-rss { margin: 0 0 16px; }
#body-inner .eci-rss a {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
    border: 1px solid var(--eci-border); border-radius: 8px;
    color: var(--eci-text); font-size: 14px; text-decoration: none;
}
#body-inner .eci-rss a:hover { border-color: var(--eci-accent); color: var(--eci-accent); text-decoration: none; }
#body-inner .eci-rss .fa-rss { color: var(--eci-accent); }
