/* kristall_style.css - Optik der MindMap-Viewer-Seite:
   jsmind-Container, Knoten (jmnode), Link-Pfeile, Auswahl-Markierung,
   Hilfe-FAB und Hilfe-Overlay. */
body, html {
    margin: 0; padding: 0; width: 100%; height: 100%; 
    background-color: #FAFAFA; 
}
#jsmind_container {
    width: 100vw; height: 100vh; background-color: #FAFAFA; border: none;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; overflow: auto;
    outline: none;
}
jmnode {
    box-sizing: border-box;
    display: block; 
    background-color: #FAFAFA !important; 
    color: #000000 !important;
    border: 1px solid #555 !important; 
    border-radius: 6px !important; 
    padding: 4px 8px !important; 
    font-size: 13px !important;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.1) !important; 
    width: max-content !important;
    max-width: 450px !important;
    white-space: normal !important;
    line-height: 1.3 !important; 
    text-align: left; 
}
jmnode p {
    display: inline;
    margin: 0 !important;
    padding: 0 !important;
}
jmnodes svg path { stroke: #555 !important; }

/* Link-Pfeile: Rot (extern), Gelb (eigene Domains), Grün (intern) */
jmnode .ext-link { color: #CC0000 !important; font-weight: bold; font-size: 16px; margin-left: 8px; cursor: pointer; display: inline-block; }
jmnode .org-link { color: #FFD500 !important; font-weight: bold; font-size: 16px; margin-left: 8px; cursor: pointer; display: inline-block; }
jmnode .int-link { color: #008800 !important; font-weight: bold; font-size: 16px; margin-left: 8px; cursor: pointer; display: inline-block; }

jmnode.selected { background-color: #e6f7ff !important; border-color: #0066cc !important; }

/* Highlight-Optik fuer Deep-Link-Ziele (und Alt+Enter-interne Spruenge) */
jmnode.jump-highlight { background-color: #40e0d0 !important; border-color: #008b8b !important; box-shadow: 0 0 10px rgba(0,139,139,0.7) !important; }

/* Wurzelknoten-Fokus (nach dem Schließen des Hilfsdialogs) ohne Browser-Standardring */
jmnode:focus { outline: none; }

/* ===== Hilfe-Overlay: FAB ("?") unten links, öffnet Bedienungshilfe (auch per Taste h) ===== */
#mm_help_fab {
    position: fixed; left: 16px; bottom: 16px; z-index: 9999;
    width: 48px; height: 48px; border-radius: 50%;
    border: 1px solid #0066cc; background-color: #e6f7ff; color: #000000;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 26px; font-weight: bold; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 0; cursor: pointer;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.35);
}
#mm_help_fab:hover, #mm_help_fab:focus {
    background-color: #87CEEB;
}
#mm_help_overlay {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 9998;
    background: rgba(0,0,0,0.45);
    display: none; align-items: center; justify-content: center;
    padding: 16px;
}
#mm_help_overlay.mm-open { display: flex; }
#mm_help_dialog {
    position: relative;
    background-color: #FAFAFA; color: #000000;
    border: 1px solid #555; border-radius: 6px;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.35);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px; line-height: 1.45;
    max-width: 560px; width: 100%; max-height: 85vh; overflow-y: auto;
    padding: 18px 44px 18px 20px;
}
#mm_help_dialog h2 { margin: 0 0 8px 0; font-size: 18px; }
#mm_help_dialog h3 { margin: 14px 0 4px 0; font-size: 15px; color: #000000; }
#mm_help_dialog table { border-collapse: collapse; width: 100%; }
#mm_help_dialog th, #mm_help_dialog td {
    text-align: left; vertical-align: top;
    border: 1px solid #999; padding: 4px 8px;
}
#mm_help_dialog th { white-space: nowrap; font-weight: bold; }

/* Legenden-Pfeile in der Links-Tabelle: gleiche Farben wie die Link-Pfeile in der Map */
#mm_help_dialog .legende-gelb { color: #FFD500; }
#mm_help_dialog .legende-rot { color: #CC0000; }
#mm_help_dialog .legende-gruen { color: #008800; }
#mm_help_dialog kbd {
    font-family: monospace; font-size: 12px;
    background-color: #FFFFFF; border: 1px solid #999; border-radius: 3px;
    padding: 0 4px; white-space: nowrap;
}
#mm_help_close {
    position: absolute; top: 10px; right: 10px;
    width: 30px; height: 30px; border-radius: 6px;
    border: 1px solid #555; background-color: #FAFAFA; color: #000000;
    font-size: 18px; line-height: 1; padding: 0; cursor: pointer;
}
#mm_help_close:hover { background-color: #e6f7ff; border-color: #0066cc; }

/* ===== Darkmode (P-003 R6): dark palette of the MindMap page =====
   [P-003 R13, 2026-11-10: this block's comments translated to English —
   owner: "english even if content is german, ffs, follow the rules"
   (standing rule: artifacts and code comments stay in English). Wording
   and values unchanged; two state updates folded in where the old text
   is stale.]
   Three states: auto (system preference, the @media block below — works
   without JavaScript), dark/light = set manually via <html data-theme="...">
   by js/custom_theme.js, persisted per origin in localStorage — the state
   is shared with the exported pages. The theme FAB (lower right) lives in
   THIS file since P-003 R13 (owner: "the css of the button has not to be
   in the index either" — its block is at the file end); through R12 it was
   served from css/custom_theme.css, which the export pages still link.
   All rules here are appends: the light values further up stay unchanged.
   The nodes never separated from the ground in the light design (#FAFAFA
   on #FAFAFA, separation via border + shadow) — the dark design mirrors
   that (#1e1e1e on #1e1e1e, border #888). The jump-highlight turquoise
   (#40e0d0) stays unchanged — it reads just as well on the dark ground.
   [P-003 R12 correction, 2026-11-10: that sentence is superseded for
   the dark states — owner directive "take the same darker version as
   for the glowing footnotes" puts the dark chip at #006d6d (the R8
   flash-chip hold color); light mode keeps #40e0d0. See the R11/R12
   jump-highlight blocks below.] */

html[data-theme="dark"] body,
html[data-theme="dark"] #jsmind_container { background-color: #1e1e1e; }
html[data-theme="dark"] jmnode {
    background-color: #1e1e1e !important;
    color: #e8e8e8 !important;
    border-color: #888888 !important;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.55) !important;
}
/* the connectors render as <svg class="jsmind"> DIRECTLY under a div —
   the existing "jmnodes svg path" rule never matched (dead selector); the
   dark block targets the real structure so the stroke attribute (#555)
   is actually overridden */
html[data-theme="dark"] svg.jsmind path { stroke: #999999 !important; }
html[data-theme="dark"] jmnode .ext-link { color: #ff5c5c !important; }
html[data-theme="dark"] jmnode .int-link { color: #4caf50 !important; }
html[data-theme="dark"] jmnode.selected {
    background-color: #123a63 !important;
    border-color: #66a3ff !important;
}
/* P-003 R11: the jump-highlight look must SURVIVE the dark blocks. The
   generic dark node rule above (0,1,2) outranks the light
   jmnode.jump-highlight rule ((0,1,1), same !important), and the dark
   selected rule (0,2,2) wins on top — so in the dark states a jumped-to
   node kept the plain/selected dark look and the turquoise chip + glow
   were never painted (owner report: "I got the feeling in darkmode the
   glow in the mindmap does not work at all anymore"). Re-asserted here,
   after the selected rule (same (0,2,2), later wins — the light rule's
   relation to jmnode.selected is preserved).
   P-003 R12 CORRECTION of the R11 state: R11 re-asserted the look with
   BYTE-IDENTICAL values and recorded "NOT a dark treatment: the owner's
   closure stands, colors untouched" — the owner has since REOPENED the
   color question and ruled the dark chip darker: "that also needs to be
   darker, since it has the same problem with the light letters. take
   the same darker version as for the glowing footnotes." The dark chip
   is therefore #006d6d — the R8 flash-chip hold color (re-measured for
   this page's ink #e8e8e8: 1.34:1 on #40e0d0, 5.03:1 on #006d6d; chip
   vs dark ground 2.71:1, exactly the R8 flash number). ONLY the
   background moves: border #008b8b and the glow 0 0 10px
   rgba(0,139,139,0.7) stay byte-identical (standing glow constraint).
   Light mode keeps #40e0d0. */
html[data-theme="dark"] jmnode.jump-highlight {
    background-color: #006d6d !important;
    border-color: #008b8b !important;
    box-shadow: 0 0 10px rgba(0,139,139,0.7) !important;
}
html[data-theme="dark"] #mm_help_dialog {
    background-color: #252526; color: #e8e8e8; border-color: #888888;
}
html[data-theme="dark"] #mm_help_dialog h3 { color: #e8e8e8; }
html[data-theme="dark"] #mm_help_dialog th,
html[data-theme="dark"] #mm_help_dialog td { border-color: #777777; }
html[data-theme="dark"] #mm_help_dialog kbd {
    background-color: #1e1e1e; border-color: #777777; color: #e8e8e8;
}
html[data-theme="dark"] #mm_help_close {
    background-color: #252526; color: #e8e8e8; border-color: #888888;
}
html[data-theme="dark"] #mm_help_close:hover {
    background-color: #123a63; border-color: #66a3ff;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) body,
    html:not([data-theme="light"]) #jsmind_container { background-color: #1e1e1e; }
    html:not([data-theme="light"]) jmnode {
        background-color: #1e1e1e !important;
        color: #e8e8e8 !important;
        border-color: #888888 !important;
        box-shadow: 1px 1px 3px rgba(0,0,0,0.55) !important;
    }
    html:not([data-theme="light"]) svg.jsmind path { stroke: #999999 !important; }
    html:not([data-theme="light"]) jmnode .ext-link { color: #ff5c5c !important; }
    html:not([data-theme="light"]) jmnode .int-link { color: #4caf50 !important; }
    html:not([data-theme="light"]) jmnode.selected {
        background-color: #123a63 !important;
        border-color: #66a3ff !important;
    }
    /* P-003 R11: same re-assertion as in the manual dark block above —
       the auto-dark media rules (0,1,2) also outrank the light
       jmnode.jump-highlight rule.
       P-003 R12: same dark chip #006d6d as the manual dark block (owner
       directive, the R8 flash-chip color); border + glow byte-unchanged,
       light keeps #40e0d0. */
    html:not([data-theme="light"]) jmnode.jump-highlight {
        background-color: #006d6d !important;
        border-color: #008b8b !important;
        box-shadow: 0 0 10px rgba(0,139,139,0.7) !important;
    }
    html:not([data-theme="light"]) #mm_help_dialog {
        background-color: #252526; color: #e8e8e8; border-color: #888888;
    }
    html:not([data-theme="light"]) #mm_help_dialog h3 { color: #e8e8e8; }
    html:not([data-theme="light"]) #mm_help_dialog th,
    html:not([data-theme="light"]) #mm_help_dialog td { border-color: #777777; }
    html:not([data-theme="light"]) #mm_help_dialog kbd {
        background-color: #1e1e1e; border-color: #777777; color: #e8e8e8;
    }
    html:not([data-theme="light"]) #mm_help_close {
        background-color: #252526; color: #e8e8e8; border-color: #888888;
    }
    html:not([data-theme="light"]) #mm_help_close:hover {
        background-color: #123a63; border-color: #66a3ff;
    }
}

/* ===== P-003 R13: color-scheme + theme FAB, moved here from css/custom_theme.css =====
   Owner directive (2026-11-10): "the css of the button has not to be in the
   index either" — the mindmap index.html no longer links css/custom_theme.css
   (the R6 delivery had also dropped the page's head metadata; the index is
   repaired separately). What this page took from custom_theme.css lives here
   now: the color-scheme signal and the FAB styles, byte-identical values.
   The export pages keep linking custom_theme.css, which serves them the same
   rules — a future FAB change must touch BOTH blocks. The R9 svg-geometry
   pin rides along in that copy (inert here: this page never links
   custom_brat.css, whose unscoped svg frame is what the pin repels).
   Same append-only model as the dark blocks above.
   [P-003 R15, 2026-11-10: the owner had this split reviewed by a QA model
   ("Die Knopf-Styles liegen jetzt an zwei Orten — kristall_style.css
   (Hauptseite) und custom_theme.css (Exportseiten)") and ACCEPTS it as the
   standing architecture, "if it is properly documented" — this is that
   documentation. The twin of this block is the region from the
   color-scheme marker to the end of the package's css/custom_theme.css
   (served to the exported pages, which still link that file): same
   selectors, same declarations, same order (only the comments differ).
   THE SYNC RULE IS BINDING: a FAB or color-scheme change lands in BOTH
   files in the same turn — one edit without the other is a defect. The
   twin is machine-checked value-identical by
   scripts/p003_r15_fab_sync_probe.py.] */

/* --- color-scheme follows the theme (form controls, scrollbars, frames) --- */
html { color-scheme: light; }
html[data-theme="light"] { color-scheme: only light; }
html[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) { color-scheme: dark; }
}

/* --- the FAB: fixed lower right; 48px circle like the mindmap's help FAB
   (#mm_help_fab, bottom left) so the two corners read as a pair --- */
#custom_theme_fab {
    position: fixed; right: 16px; bottom: 16px; z-index: 9999;
    width: 48px; height: 48px; border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.25);
    background-color: #2E7D32; color: #FFFFFF;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 20px; font-weight: bold; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 0; cursor: pointer;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.35);
}
#custom_theme_fab .ctf-i { display: none; line-height: 1; }
#custom_theme_fab .ctf-i svg { display: block; }
#custom_theme_fab svg {
    width: 22px;
    height: 22px;
    border: none;
    margin: 0;
}
/* default (auto): the "A" — correct icon from first paint, no JS needed */
#custom_theme_fab .ctf-auto { display: block; }
html[data-theme="dark"] #custom_theme_fab {
    background-color: #1E3A5F; color: #E8E8E8;
    border-color: rgba(255, 255, 255, 0.35);
}
html[data-theme="dark"] #custom_theme_fab .ctf-auto { display: none; }
html[data-theme="dark"] #custom_theme_fab .ctf-dark { display: block; }
html[data-theme="light"] #custom_theme_fab {
    background-color: #F5C518; color: #1A1A1A;
    border-color: rgba(0, 0, 0, 0.25);
}
html[data-theme="light"] #custom_theme_fab .ctf-auto { display: none; }
html[data-theme="light"] #custom_theme_fab .ctf-light { display: block; }

/* print: the control is chrome, not content — hidden. The palette is the
   reader's choice and is deliberately NOT forced to light for print. */
@media print {
    #custom_theme_fab { display: none !important; }
}
