/**
 * Dokumentation – Feinschliff im Stil von Preise/Funktionen.
 * Nur Optik (Typografie, Karten, Seitenleiste); Struktur & Skripte bleiben unverändert.
 */

/* ---------- Seitenleiste ---------- */
html body .sidebar a {
    border-radius: 10px;
    transition: background-color 0.15s ease, color 0.15s ease;
}
html body .sidebar a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}
html body .sidebar a.active {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.28), rgba(47, 107, 255, 0.1)) !important;
    color: #fff !important;
    box-shadow: inset 0 0 0 1px rgba(130, 150, 255, 0.35);
}
html body .sidebar a.active i { color: #a9b6ff; }

/* ---------- Überschriften & Text ---------- */
html body .content .section > h2,
html body .content h2 {
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
    background: linear-gradient(135deg, #ffffff 0%, #c9d1ff 60%, #8b98ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
html body .content h2 i {
    -webkit-text-fill-color: #8b98ff;
}
html body .content .section > p,
html body .content .section > ul,
html body .content .section > ol {
    max-width: 780px;
}
html body .content p {
    line-height: 1.7;
    color: rgba(235, 237, 245, 0.8);
}
html body .content li {
    line-height: 1.7;
    color: rgba(235, 237, 245, 0.8);
}
html body .content .section {
    scroll-margin-top: calc(var(--kynx-navbar-offset, 72px) + 16px);
}
html body .content .section + .section {
    margin-top: 3.2rem;
    padding-top: 2.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---------- Code ---------- */
html body .content .code-inline,
html body .content code {
    padding: 0.12em 0.45em;
    border-radius: 6px;
    background: rgba(88, 101, 242, 0.14);
    border: 1px solid rgba(130, 150, 255, 0.2);
    color: #d4dbff;
    font-size: 0.88em;
}

/* ---------- Karten ---------- */
html body .content .info-card,
html body .content .feature-card {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(22, 24, 38, 0.62);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}
html body .content .feature-card:hover {
    border-color: rgba(130, 150, 255, 0.35);
}
html body .content .info-card.success { border-color: rgba(87, 242, 135, 0.28); }
html body .content .info-card.warning { border-color: rgba(254, 231, 92, 0.3); }
html body .content .feature-title { font-size: 1rem; }
html body .content .feature-description { font-size: 0.88rem; line-height: 1.55; }

/* ---------- Link-Pillen & Ablauf-Schritte ---------- */
html body .content .doc-link-pill {
    border-radius: 999px;
    border: 1px solid rgba(130, 150, 255, 0.25);
    background: rgba(88, 101, 242, 0.1);
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
html body .content .doc-link-pill:hover {
    background: rgba(88, 101, 242, 0.2);
    border-color: rgba(130, 150, 255, 0.45);
    transform: translateY(-1px);
}
html body .content .doc-flow-step {
    border-radius: 14px;
}
html body .content .doc-flow-num {
    background: linear-gradient(135deg, #5865f2, #2f6bff);
    color: #fff;
    box-shadow: 0 6px 16px rgba(64, 96, 255, 0.35);
}

/* ---------- Tabellen ---------- */
html body .content .variables-table {
    border-radius: 14px;
    overflow: hidden;
}

/* Hinweis-Box (z. B. Schnellsuche) */
.doc-tip { margin: 0.9rem 0 0; padding: 0.7rem 0.9rem; border-radius: 12px; border: 1px solid rgba(88, 101, 242, 0.35); background: rgba(88, 101, 242, 0.1); color: #dfe2ff; font-size: 0.92rem; }

/* ---------- Einführung: kompakte Übersichtskarten im Raster ---------- */
html body #introduction .feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.75rem;
}
html body #introduction .feature-card,
html body #introduction .feature-card.intro-card--grow {
    flex: none;
    min-height: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 0.85rem;
    row-gap: 0.15rem;
    align-items: start;
    text-align: left;
    padding: 0.95rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}
html body #introduction .feature-card .feature-icon {
    grid-row: 1 / 3;
    width: 42px !important;
    height: 42px !important;
    margin: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 1.1rem;
    background: rgba(88, 101, 242, 0.22) !important;
    color: #a5acff;
}
html body #introduction .feature-card .feature-title { margin: 0; font-size: 0.98rem; font-weight: 700; color: #fff; }
html body #introduction .feature-card .feature-description { margin: 0; font-size: 0.84rem; line-height: 1.5; color: rgba(220, 224, 240, 0.66); }
html body #introduction .feature-card:hover,
html body #introduction .feature-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(130, 150, 255, 0.45);
    background: rgba(88, 101, 242, 0.08);
    outline: none;
}
html body #introduction .feature-card:focus-visible { box-shadow: 0 0 0 2px rgba(139, 147, 255, 0.8); }
html body #introduction .intro-dash-subtitle {
    margin: 1.6rem 0 0.7rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(165, 172, 255, 0.85);
}
@media (prefers-reduced-motion: reduce) {
    html body #introduction .feature-card { transition: none; }
}
/* Handy: Abschnitts-Überschriften kompakter, Symbol-Kästchen mit runden Ecken */
@media (max-width: 600px) {
    html body .content .section > h1 { font-size: clamp(1.45rem, 6.4vw, 1.9rem) !important; line-height: 1.2 !important; }
    html body .content .section > h1 i { font-size: 0.9em; }
}
html body #introduction .feature-card .feature-icon { border-radius: 12px !important; }/* Handy: Doku-Menüknopf unten links, damit er nicht über dem Hilfe-Chat (unten rechts) liegt */
@media (max-width: 1024px) {
    html body .mobile-menu-toggle { left: 16px !important; right: auto !important; }
}

html body #introduction .feature-card,
html body #introduction .feature-card.intro-card--grow { align-content: start; }

/* Handy: breite Tabellen als gestapelte Einträge statt abgeschnittener Spalten */
@media (max-width: 600px) {
    html body .content table.variables-table[data-kx-stack],
    html body .content table.variables-table[data-kx-stack] tbody,
    html body .content table.variables-table[data-kx-stack] tr,
    html body .content table.variables-table[data-kx-stack] td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    /* Nur den Tabellenkopf ausblenden – die erste Datenzeile muss sichtbar bleiben */
    html body .content table.variables-table[data-kx-stack] thead { display: none; }
    html body .content table.variables-table[data-kx-stack] tr {
        padding: 10px 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }
    html body .content table.variables-table[data-kx-stack] td {
        padding: 2px 0;
        border: 0;
        overflow-wrap: anywhere;
    }
    html body .content table.variables-table[data-kx-stack] td:first-child { padding-bottom: 4px; }
    html body .content table.variables-table[data-kx-stack] td[data-label]::before {
        content: attr(data-label) ': ';
        font-weight: 600;
        font-size: 0.78rem;
        color: rgba(220, 224, 240, 0.55);
    }
}

/* Code-Beispiele (z. B. API) */
.section pre {
    margin: 0.8rem 0 1.2rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 10, 20, 0.85);
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.6;
}
.section pre code {
    padding: 0;
    background: none;
    border: 0;
    color: #d6d9f0;
    white-space: pre;
}

/* ── Changelog & Patchnotes (live aus /api/public/changelog) ── */
.docs-cl-navlink { position: relative; font-weight: 600; }
.docs-cl-meta { font-size: 0.82rem; color: var(--text-muted, #949ba4); margin: -0.25rem 0 1rem; }
.docs-cl-list { display: grid; gap: 0.35rem; margin-bottom: 1.25rem; }
.docs-cl-day {
    font-size: 0.78rem !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8b95ff !important;
    margin: 1rem 0 0.4rem !important;
    padding: 0 !important;
    border: 0 !important;
}
.docs-cl-group {
    display: grid;
    gap: 0.55rem;
    border-left: 2px solid rgba(88, 101, 242, 0.35);
    padding-left: 0.9rem;
}
.docs-cl-entry {
    position: relative;
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.docs-cl-entry::before {
    content: '';
    position: absolute;
    left: calc(-0.9rem - 6px);
    top: 1.05rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #5865f2;
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
}
.docs-cl-head { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.docs-cl-title { font-weight: 600; color: #fff; flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.docs-cl-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(35, 165, 90, 0.18);
    border: 1px solid rgba(35, 165, 90, 0.45);
    color: #57d58b;
}
.docs-cl-time { font-size: 0.75rem; color: var(--text-muted, #949ba4); margin-left: auto; }
.docs-cl-body { margin-top: 0.4rem; font-size: 0.9rem; color: #c4c9d0; line-height: 1.55; }
.docs-cl-body p { margin: 0 0 0.35rem; }
.docs-cl-body p:last-child { margin-bottom: 0; }
.docs-cl-body ul { margin: 0.2rem 0 0.35rem 1.1rem; padding: 0; }
.docs-cl-empty { color: var(--text-muted, #949ba4); font-size: 0.9rem; }
.docs-cl-empty i { color: #57d58b; margin-right: 0.3rem; }
.docs-cl-empty--error { color: #f0b232; }
.docs-cl-more {
    justify-self: start;
    margin-top: 0.5rem;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(88, 101, 242, 0.45);
    background: rgba(88, 101, 242, 0.12);
    color: #c9cdfb;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
}
.docs-cl-more:hover { background: rgba(88, 101, 242, 0.22); }
@media (max-width: 600px) {
    .docs-cl-entry { padding: 0.65rem 0.75rem; }
    .docs-cl-time { margin-left: 0; }
}
