/* Schrift, Seitenfläche, Karten und Abstände kommen seit G10 aus Prismamed.Ui (prismamed-gestaltung.css, Vorbild Termin):
   keine eigene Schrift und keine eigene Seitenfarbe mehr. Unten nur Bausteine, die es in Prismamed.Ui nicht gibt. */

/* Eigene Farben des Wikis (UI-Einheit, Dark Mode): hell wie bisher, dunkel unter data-p-farbschema="dunkel" (setzt
   farbschema.js aus Prismamed.Ui). Flächen, Ränder und Schrift folgen im Dunkeln dem Theme, Markierungen haben eigene
   dunkle Töne mit Kontrast nach WCAG AA zur hellen Schrift. Auch genutzt von TranslationTab und TranslationMarkup. */
:root {
    --wiki-flaeche: #fff;
    --wiki-flaeche-leise: #fafafa;
    --wiki-rand: #e6e6e6;
    --wiki-rand-stark: #d0d0d0;
    --wiki-text: #1f2937;
    --wiki-text-leise: #6b7280;
    --wiki-schatten: rgba(0, 0, 0, 0.18);
    --wiki-auswahl: #eff6ff;
    --wiki-akzent: #1e88e5;
    --wiki-markierung: #fde68a;
    --wiki-entfernt-flaeche: #fde2e1;
    --wiki-entfernt-text: #8a1c1c;
    --wiki-eingefuegt-flaeche: #dcfce7;
    --wiki-eingefuegt-text: #14532d;
    --wiki-geaendert-rand: #f59e0b;
    --wiki-geaendert-flaeche: #fffbeb;
    --wiki-neu-rand: #16a34a;
    --wiki-neu-flaeche: #f0fdf4;
    --wiki-fremd-text: #b45309;
}

:root[data-p-farbschema="dunkel"] {
    --wiki-flaeche: var(--kendo-color-surface);
    --wiki-flaeche-leise: var(--kendo-color-surface-alt);
    --wiki-rand: var(--kendo-color-border);
    --wiki-rand-stark: var(--kendo-color-border-alt);
    --wiki-text: var(--kendo-color-on-app-surface);
    --wiki-text-leise: var(--kendo-color-subtle);
    --wiki-schatten: rgba(0, 0, 0, 0.5);
    --wiki-auswahl: #1e3a5f;
    --wiki-akzent: #60a5fa;
    --wiki-markierung: #854d0e;
    --wiki-entfernt-flaeche: #5f1d1d;
    --wiki-entfernt-text: #fecaca;
    --wiki-eingefuegt-flaeche: #14432a;
    --wiki-eingefuegt-text: #bbf7d0;
    --wiki-geaendert-rand: #fbbf24;
    --wiki-geaendert-flaeche: #3b2a07;
    --wiki-neu-rand: #4ade80;
    --wiki-neu-flaeche: #0f2e1c;
    --wiki-fremd-text: #fbbf24;
}


.snippet-tool-panel {
    position: fixed;
    top: 80px;
    right: 16px;
    bottom: 80px;
    width: min(760px, calc(100vw - 32px));
    z-index: 1199;
    border: 1px solid var(--wiki-rand-stark);
    border-radius: 8px;
    background-color: var(--wiki-flaeche);
    box-shadow: 0 14px 28px var(--wiki-schatten);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.snippet-tool-header {
    padding: 12px 14px 8px 14px;
    border-bottom: 1px solid var(--wiki-rand);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.snippet-tool-hint {
    font-size: 12px;
    color: var(--wiki-text-leise);
}

.snippet-tool-toolbar {
    padding: 10px 14px;
    border-bottom: 1px solid var(--wiki-rand);
    display: grid;
    grid-template-columns: 1fr 170px auto;
    gap: 8px;
}

.snippet-tool-input,
.snippet-tool-select {
    border: 1px solid var(--wiki-rand-stark);
    border-radius: 4px;
    padding: 6px 8px;
    min-height: 32px;
    width: 100%;
}

.snippet-tool-status {
    padding: 8px 14px;
    border-bottom: 1px solid var(--wiki-rand);
    font-size: 12px;
    color: var(--wiki-text-leise);
}

.snippet-tool-loading {
    padding: 18px 14px;
    color: var(--wiki-text-leise);
    font-size: 14px;
}

.snippet-tool-grid {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.snippet-tool-text {
    white-space: pre-wrap;
    line-height: 1.3;
}

@media (max-width: 920px) {
    .snippet-tool-panel {
        top: 60px;
        right: 8px;
        left: 8px;
        width: auto;
        bottom: 72px;
    }

    .snippet-tool-toolbar {
        grid-template-columns: 1fr;
    }
}

.snippet-mention-popover {
    position: absolute;
    z-index: 2000;
    width: min(420px, calc(100vw - 24px));
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--wiki-rand-stark);
    border-radius: 8px;
    background: var(--wiki-flaeche);
    box-shadow: 0 12px 28px var(--wiki-schatten);
}

.snippet-mention-list {
    display: flex;
    flex-direction: column;
}

.snippet-mention-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 0;
    border-bottom: 1px solid var(--wiki-rand);
    padding: 8px 10px;
    background: transparent;
    text-align: left;
    width: 100%;
    cursor: pointer;
}

.snippet-mention-item:last-child {
    border-bottom: 0;
}

.snippet-mention-item:hover,
.snippet-mention-item.selected {
    background: var(--wiki-auswahl);
}

/* Übersetzungen (Schritt 8): Tab einer Übersetzung. Die Markierung geänderter Blöcke im Original setzt der Tab als
   eigene Regeln über data-block-id (PBlockRenderer); hier nur gemeinsame Formen. */
.tr-flash {
    outline: 3px solid var(--wiki-akzent) !important;
    outline-offset: 2px;
}

.tr-diff del {
    background-color: var(--wiki-entfernt-flaeche);
    color: var(--wiki-entfernt-text);
}

.tr-diff ins {
    background-color: var(--wiki-eingefuegt-flaeche);
    color: var(--wiki-eingefuegt-text);
    text-decoration: none;
}

.tr-changes {
    border: 1px solid var(--wiki-rand);
    border-radius: 6px;
    margin: 6px 0;
}

.tr-change {
    padding: 6px 10px;
    border-bottom: 1px solid var(--wiki-rand);
}

.tr-change:last-child {
    border-bottom: 0;
}

.snippet-mention-text {
    font-size: 13px;
    color: var(--wiki-text);
    white-space: pre-wrap;
    line-height: 1.35;
    width: 100%;
}

/* #-Suche (Schritt 9, Paket 7): Artikel vor den Snippets, mit Untertitel, Art und Fundstelle; Hinweis zum Einfügen */
.snippet-mention-article .snippet-mention-text {
    font-weight: 600;
}

.snippet-mention-detail {
    font-size: 11px;
    color: var(--wiki-text-leise);
    line-height: 1.3;
    width: 100%;
}

.snippet-mention-hint {
    font-size: 11px;
    color: var(--wiki-text-leise);
    padding: 6px 10px;
    background: var(--wiki-flaeche-leise);
}

/* Kopf der Artikelseite und des Übersetzungs-Tabs (PScrollBereich aus Prismamed.Ui): Sie stehen im Register auf der
   Seitenfläche, nicht in einer Karte - Grund und Schattenabdeckung darum in der Seitenfläche (hell und dunkel) */
.wiki-kopfbereich {
    --p-scrollbereich-grund: var(--p-flaeche);
}

/* Suche (Schritt 9): getroffene Wörter in der Vorschau auf /search. scripts/search.js setzt sie als Bereiche der CSS Custom
   Highlight API (ohne <mark>-Elemente im DOM von Blazor); wie <mark> im Ausschnitt der Trefferliste. */
::highlight(wiki-search) {
    background-color: var(--wiki-markierung);
    color: inherit;
}

/* Pflichtschritt „Postfach für den Versand“ (MainLayout, PostfachFormular). Seite und Karte kommen aus Prismamed.Ui
   (p-seite p-seite-schmal, p-karte); hier nur die Fläche über die ganze Höhe ohne Seitenleiste, die Karte senkrecht mittig */
.postfach-einrichtung {
    height: 100dvh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background: var(--p-flaeche);
}

.postfach-einrichtung > .p-seite {
    width: 100%;
    margin-block: auto;
}

.postfach-einrichtung h1 {
    margin: 0 0 8px;
    font-size: 1.6rem;
}

.postfach-schritt {
    margin: 0 0 4px;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--kendo-color-primary, green);
}

/* Link „Hilfe und Handbuch“ unten in der Seitenleiste (wie Prismamed.Termin) */
.nav-hilfe {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    margin-bottom: 8px;
    border-radius: var(--p-rund-m, 8px);
    color: var(--p-tinte-2);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
}

.nav-hilfe:hover {
    background: var(--p-flaeche);
    color: var(--p-tinte);
}
