/* PSG Funktionsbaum (0196) · Werkzeugseite /wissen/sql-server-funktionsbaum/ und /en/knowledge/sql-server-function-tree/
   Alles Werkzeugspezifische steht unter .fb; Schriften, Farben, Knöpfe (.btn), Seitenkopf und Abstände kommen aus site.css.
   Der Druckbericht (.bericht) ist ein direktes Kind von <body>, damit der Druck alles andere ausblenden kann. */
.fb{--k-tf:#f07d1a;--k-if:#5fa7d6;--k-fn:#2f9e8b;--k-fn-no:#c8463c;--k-v:#8aa1b1;--k-p:#0a2b42;--k-tr:#6d5aa6;--k-clr:#9aa5ad;--k-x:#ffffff}
.fb .vh,.bericht .vh{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.fb .klein{font-size:.9rem;color:var(--ink-2)}
.fb code{font-family:var(--mono);font-size:.86em;background:var(--blue-50);border:1px solid var(--line);border-radius:5px;padding:1px 5px}
.fb h2{font-size:clamp(1.35rem,2vw,1.7rem);margin:0 0 .5em}
.fb h3{font-size:1.15rem;margin:0 0 .4em}
.fb-hero-knoepfe{display:flex;flex-wrap:wrap;gap:12px;margin-top:26px}

/* Datenschutz-Kasten: bewusst groß und vorn */
.fb .privat{display:flex;gap:22px;align-items:flex-start;background:var(--paper);border:2px solid var(--blue);border-radius:var(--radius);padding:24px 28px;margin:0 0 26px;box-shadow:0 8px 28px rgba(0,68,107,.08)}
.fb .privat h2{margin:.05em 0 .35em;font-size:1.4rem}
.fb .privat p{margin:.3em 0;max-width:78ch}
.fb .privat details{margin-top:.4em}
.fb .privat summary{cursor:pointer;color:var(--blue-700);font-weight:600}
.fb .schloss{flex:0 0 auto;width:58px;height:58px;border-radius:16px;background:var(--blue);color:#fff;display:grid;place-items:center}

.fb .schrittliste{list-style:none;margin:0 0 26px;padding:0;display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.fb .schrittliste li{display:flex;gap:14px;background:var(--paper);border:1px solid var(--line);border-radius:var(--radius-sm);padding:16px 18px;font-size:.95rem}
.fb .nr{flex:0 0 auto;width:30px;height:30px;border-radius:50%;background:var(--orange);color:#fff;font-weight:700;display:grid;place-items:center}

.fb .eingabe{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:24px 28px;margin-bottom:26px}
.fb .ablage{position:relative;border:2px dashed var(--line);border-radius:var(--radius-sm);transition:border-color .2s,background .2s}
.fb .ablage.ueber{border-color:var(--orange);background:var(--orange-100)}
.fb #text{display:block;width:100%;min-height:150px;resize:vertical;border:0;background:transparent;padding:14px 16px;font:13px/1.5 var(--mono);color:var(--ink)}
.fb #text:focus{outline:none}
.fb .ablage:focus-within{border-color:var(--blue-300)}
.fb .ablage-hinweis{margin:0;padding:0 16px 10px;font-size:.82rem;color:var(--muted)}
.fb .knoepfe{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.fb .fb-leise{font:inherit;font-size:.92rem;border:0;background:none;border-radius:999px;padding:.45em .8em;cursor:pointer;color:var(--ink-2)}
.fb .fb-leise:hover{color:var(--blue)}
.fb button:focus-visible,.fb a:focus-visible,.fb label.btn:focus-within{outline:3px solid var(--blue-300);outline-offset:2px}
.fb label.btn{cursor:pointer}
.fb .meldung{min-height:1.4em;margin:.8em 0 0;font-size:.92rem}
.fb .meldung.fehler{color:#a3291f}
.fb .meldung.ok{color:var(--blue-700)}
.fb .eingabe-zeigen{display:none;margin-top:4px}
.fb .eingabe.eingelesen .ablage,.fb .eingabe.eingelesen .knoepfe{display:none}
.fb .eingabe.eingelesen .eingabe-zeigen{display:inline-flex}
.fb .eingabe.eingelesen{padding-bottom:14px}

.fb .ergebnis{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);padding:24px 28px;margin-bottom:26px}
.fb .ergebnis-kopf{display:flex;justify-content:space-between;align-items:baseline;gap:16px;flex-wrap:wrap}
.fb .quelle{margin:0;font-size:.85rem;color:var(--muted)}

.fb .suche{display:flex;gap:10px;margin:8px 0 16px}
.fb .suche input{flex:1;font:inherit;padding:.5em .9em;border:1.5px solid var(--line);border-radius:999px}
.fb .startliste{list-style:none;margin:0;padding:0;border-top:1px solid var(--line)}
.fb .startliste li{border-bottom:1px solid var(--line)}
.fb .startliste button{width:100%;text-align:left;font:inherit;background:none;border:0;padding:10px 4px;cursor:pointer;display:flex;gap:12px;align-items:center}
.fb .startliste button:hover{background:var(--blue-50)}
.fb .startliste .m{margin-left:auto;font-size:.85rem;color:var(--ink-2);white-space:nowrap}

.fb .pfad{font-size:.9rem;color:var(--ink-2);margin-bottom:6px}
.fb .kennzahlen{list-style:none;margin:6px 0 16px;padding:0;display:flex;flex-wrap:wrap;gap:10px}
.fb .kennzahlen li{background:var(--blue-50);border-radius:var(--radius-sm);padding:10px 16px;min-width:120px}
.fb .kennzahlen b{display:block;font-family:var(--display);font-size:1.6rem;color:var(--navy);line-height:1.1}
.fb .kennzahlen span{font-size:.8rem;color:var(--ink-2)}
.fb .kennzahlen li.warn{background:var(--orange-100)}

.fb .leiste{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;margin-bottom:10px}
.fb .umschalter{display:inline-flex;flex-wrap:wrap;background:var(--blue-50);border-radius:999px;padding:3px}
.fb .umschalter button{font:inherit;font-size:.92rem;border:0;background:none;border-radius:999px;padding:.4em 1.1em;cursor:pointer;color:var(--ink-2)}
.fb .umschalter button[aria-selected="true"]{background:var(--navy);color:#fff}
.fb .schalter{font-size:.9rem;display:inline-flex;gap:.4em;align-items:center;cursor:pointer}

.fb .legende{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:.82rem;color:var(--ink-2);margin:4px 0 14px}
.fb .legende span{display:inline-flex;align-items:center;gap:.4em}
.fb .farbe{display:inline-block;width:12px;height:12px;border-radius:3px}
.fb .farbe.tf,.fb .pill.tf,.bericht .pill.tf{background:var(--k-tf,#f07d1a)}
.fb .farbe.if,.fb .pill.if,.bericht .pill.if{background:var(--k-if,#5fa7d6)}
.fb .farbe.fn,.fb .pill.fn,.bericht .pill.fn{background:var(--k-fn,#2f9e8b)}
.fb .farbe.fn-no,.fb .pill.fn-no,.bericht .pill.fn-no{background:var(--k-fn-no,#c8463c)}
.fb .farbe.v,.fb .pill.v,.bericht .pill.v{background:var(--k-v,#8aa1b1)}
.fb .farbe.p,.fb .pill.p,.bericht .pill.p{background:var(--k-p,#0a2b42)}
.fb .pill.tr,.bericht .pill.tr{background:var(--k-tr,#6d5aa6)}
.fb .pill.clr,.bericht .pill.clr{background:var(--k-clr,#9aa5ad)}
.fb .farbe.x,.fb .pill.x,.bericht .pill.x{background:#fff;border:1.5px dashed var(--muted)}

.fb .flaeche{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:18px;align-items:start}
.fb .detail{position:sticky;top:96px;background:var(--blue-50);border-radius:var(--radius-sm);padding:14px 16px;font-size:.9rem;min-height:120px}
.fb .detail h4{font-family:var(--display);font-size:1.05rem;margin:.1em 0 .4em;word-break:break-word;color:var(--navy)}
.fb .detail dl{display:grid;grid-template-columns:auto 1fr;gap:2px 10px;margin:.4em 0}
.fb .detail dt{color:var(--muted)}
.fb .detail dd{margin:0}
.fb .flaeche.unten{grid-template-columns:minmax(0,1fr)}
.fb .flaeche.unten .detail{position:static;min-height:0}
.fb .flaeche.unten .detail dl{grid-template-columns:repeat(4,auto 1fr);gap:2px 12px}

/* Baum */
.fb .baum{font-size:.93rem;overflow-x:auto;padding-bottom:6px}
.fb .baum ul{list-style:none;margin:0;padding:0 0 0 22px;border-left:1px solid var(--line)}
.fb .baum > ul{padding-left:0;border-left:0}
.fb .baum li{margin:0;padding:0}
.fb .baum li::before{content:none}
.fb .zeile{display:flex;align-items:center;gap:8px;padding:3px 6px;border-radius:8px;white-space:nowrap;cursor:default}
.fb .zeile:hover{background:var(--blue-50)}
.fb .zeile.aktiv{background:var(--blue-100)}
.fb .zeile.blitz{animation:fb-blitz 1.2s var(--ease)}
@keyframes fb-blitz{0%{background:var(--orange-100)}100%{background:transparent}}
.fb .auf{width:22px;height:22px;border:0;background:none;cursor:pointer;color:var(--ink-2);border-radius:6px;font-size:.8rem;flex:0 0 auto;transition:transform .2s var(--ease);padding:0}
.fb .auf[aria-expanded="true"]{transform:rotate(90deg)}
.fb .auf:hover{background:var(--blue-100)}
.fb .auf-leer{width:22px;flex:0 0 auto}
.fb .pill,.bericht .pill{display:inline-block;font-size:.7rem;font-weight:600;color:#fff;border-radius:999px;padding:.1em .6em;min-width:54px;text-align:center}
.fb .pill.x,.bericht .pill.x{color:var(--ink-2)}
.fb .name{font-family:var(--mono);font-size:.86rem;cursor:pointer;background:none;border:0;padding:0;color:inherit;text-align:left}
.fb button.name:focus-visible{outline:2px solid var(--blue-300);outline-offset:2px;border-radius:4px}
.fb .name:hover{text-decoration:underline}
.fb .marken{display:inline-flex;gap:4px}
.fb .mk,.bericht .mk{font-size:.7rem;border:1px solid var(--line);border-radius:6px;padding:0 .4em;color:var(--ink-2);background:var(--paper)}
.fb .mk.warn,.bericht .mk.warn{border-color:var(--orange);color:var(--orange-600)}
.fb .mk.rot,.bericht .mk.rot{border-color:#e3a39d;color:#a3291f}
.fb .meta{font-size:.78rem;color:var(--muted)}
.fb .zeile.zyklus .name,.fb .zeile.extern .name{font-style:italic}

/* Kettenbild, Sunburst, Netz */
.fb .kette-svg{overflow:auto;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--paper)}
.fb .kette-svg svg,.fb .netz-svg svg{display:block}
.fb .kette-svg rect{cursor:pointer}
.fb .kette-pfad{font-size:.88rem;margin-bottom:8px;display:flex;flex-wrap:wrap;gap:4px;align-items:center}
.fb .kette-pfad button{font:inherit;font-size:.85rem;border:0;background:var(--blue-50);border-radius:999px;padding:.15em .7em;cursor:pointer;color:var(--blue-700)}
.fb .kette-pfad button:hover{background:var(--blue-100)}
.fb .sonne-svg{display:flex;justify-content:center;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--paper);padding:10px 0}
.fb .sonne-svg svg{display:block;max-width:100%;height:auto}
.fb .sonne-svg path,.fb .sonne-svg circle{cursor:pointer}
.fb .sonne-svg g:focus-visible path,.fb .kette-svg g:focus-visible rect,.fb .netz-svg g:focus-visible rect{stroke:#051c2c;stroke-width:2.5}
.fb .netz-svg{overflow:auto;max-height:820px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--paper)}
.fb .netz-svg g[role="button"]{cursor:pointer}

/* Strukturampel */
.fb .ampel,.bericht .ampel{display:flex;gap:18px;align-items:flex-start;border-radius:var(--radius-sm);padding:16px 20px;margin:0 0 18px;border:1.5px solid var(--line);background:var(--paper)}
.fb .ampel .licht,.bericht .ampel .licht{flex:0 0 auto;display:flex;flex-direction:column;gap:5px;background:var(--navy);border-radius:12px;padding:7px}
.fb .ampel .licht i,.bericht .ampel .licht i{display:block;width:16px;height:16px;border-radius:50%;background:#2a4457}
.fb .ampel.stufe-0 .licht i.g,.bericht .ampel.stufe-0 .licht i.g{background:#2f9e8b}
.fb .ampel.stufe-1 .licht i.o,.bericht .ampel.stufe-1 .licht i.o{background:#f0b41a}
.fb .ampel.stufe-2 .licht i.r,.bericht .ampel.stufe-2 .licht i.r{background:#e0503f}
.fb .ampel.stufe-1{border-color:#f0b41a}
.fb .ampel.stufe-2{border-color:#e0503f}
.fb .ampel h3,.bericht .ampel h3{margin:0 0 .25em;font-size:1.15rem}
.fb .ampel p,.bericht .ampel p{margin:.2em 0;font-size:.93rem;color:var(--ink-2);max-width:90ch}
.fb .ampel ul,.bericht .ampel ul{margin:.3em 0 .5em;padding-left:1.1em;font-size:.9rem;color:var(--ink-2)}
.fb .ampel .angebot{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:8px}
.fb .ampel .angebot a{text-decoration:none}
.fb .ampel .luecke,.bericht .ampel .luecke{color:#8a4b00;font-weight:600}
.fb .ampel .kette-zeile code{background:none;border:0;padding:0;font-size:.85rem}

/* Hinweise und Gesprächsangebot */
.fb .hinweise{margin-top:22px;border-top:1px solid var(--line);padding-top:18px}
.fb .hinweisliste{list-style:none;margin:10px 0 0;padding:0}
.fb .hinweisliste > li{border-bottom:1px solid var(--line);padding:12px 0}
.fb .hinweisliste h4{margin:0 0 .25em;font:650 1rem/1.35 var(--text);letter-spacing:0;color:var(--navy)}
.fb .hinweise h3{font:650 1.15rem/1.3 var(--text);letter-spacing:0}
.fb .hinweisliste p{margin:.2em 0;font-size:.92rem;color:var(--ink-2);max-width:90ch}
.fb .chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.fb .chips button{font:12px/1.4 var(--mono);border:1px solid var(--line);background:var(--paper);border-radius:999px;padding:.15em .7em;cursor:pointer}
.fb .chips button:hover{border-color:var(--blue);color:var(--blue)}
.fb .gespraech{display:flex;flex-wrap:wrap;gap:12px 20px;align-items:center;justify-content:space-between;margin-top:18px;padding:16px 20px;border-radius:var(--radius-sm);background:var(--blue-50)}
.fb .gespraech p{margin:0;max-width:70ch;font-size:.95rem}

.fb .grenzen{padding:6px 0 10px}
.fb .fb-liste{list-style:none;margin:0;padding:0;border-top:1px solid var(--line);max-width:90ch}
.fb .fb-liste li{border-bottom:1px solid var(--line);padding:10px 0;color:var(--ink-2)}

/* Druckbericht: am Bildschirm unsichtbar */
.bericht{display:none}

@media (max-width:900px){
  .fb .schrittliste{grid-template-columns:1fr}
  .fb .flaeche{grid-template-columns:1fr}
  .fb .detail{position:static}
  .fb .privat{flex-direction:column}
  .fb .privat,.fb .eingabe,.fb .ergebnis{padding:18px}
  .fb .flaeche.unten .detail dl{grid-template-columns:auto 1fr}
  .fb .umschalter{border-radius:var(--radius-sm)}
  .fb .ampel .licht{display:none}
}
@media (prefers-reduced-motion:reduce){.fb *{animation:none!important;transition:none!important}}

/* ---------- PDF-Bericht (Drucken → Als PDF speichern). Englische Randtexte in fbaum-en.css ---------- */
@page{size:A4;margin:16mm 14mm 20mm;
  @bottom-left{content:"Automatisch erstellt mit dem PSG Funktionsbaum, lokal im Browser · keine Prüfung durch PSG · www.psg.de";font:7.5pt "Segoe UI",system-ui,sans-serif;color:#6c7c88;vertical-align:top;padding-top:4mm}
  @bottom-right{content:"Seite " counter(page) " von " counter(pages);font:7.5pt "Segoe UI",system-ui,sans-serif;color:#6c7c88;vertical-align:top;padding-top:4mm}
}
@media print{
  html,body{background:#fff}
  body > *{display:none!important}
  body > .bericht{display:block!important}
  *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .bericht{font:10pt/1.45 var(--text);color:var(--ink)}
  .bericht h1{font-size:20pt;margin:0 0 2mm;font-family:var(--display);color:var(--navy)}
  .bericht h2{font-size:13pt;margin:7mm 0 2.5mm;break-after:avoid;font-family:var(--display);color:var(--navy)}
  .bericht h3{font-family:var(--display);color:var(--navy)}
  .bericht code{font-family:var(--mono)}
  .bericht .b-kopf{display:flex;justify-content:space-between;align-items:center;border-bottom:3px solid var(--orange);padding-bottom:4mm;margin-bottom:5mm}
  .bericht .b-marke{display:flex;align-items:center;gap:3mm;font-family:var(--display);font-size:13pt;color:var(--navy)}
  .bericht .b-logo{background:var(--orange);color:#fff;border-radius:2mm;padding:.5mm 2.2mm;font-weight:700}
  .bericht .b-meta{font-size:8.5pt;color:var(--ink-2);text-align:right}
  .bericht .b-unter{color:var(--ink-2);margin:0 0 4mm}
  .bericht .b-herkunft{font-size:8.5pt;color:var(--ink-2);border-left:1mm solid var(--orange);padding-left:2.5mm;margin:0 0 4mm}
  .bericht .b-zahlen{display:grid;grid-template-columns:repeat(6,1fr);gap:2.5mm;margin:3mm 0}
  .bericht .b-zahlen div{background:var(--blue-50);border-radius:2mm;padding:2.5mm}
  .bericht .b-zahlen b{display:block;font-family:var(--display);font-size:15pt;color:var(--navy)}
  .bericht .b-zahlen span{font-size:7.5pt;color:var(--ink-2)}
  .bericht .ampel{break-inside:avoid;padding:3.5mm 4.5mm;margin:0}
  .bericht .ampel.stufe-2,.bericht .ampel.stufe-1{border-color:var(--line);border-left:1.5mm solid var(--orange)}
  .bericht .ampel h3{font-size:11.5pt}
  .bericht .ampel p,.bericht .ampel li{font-size:9pt;line-height:1.45}
  .bericht .ampel .licht i{width:3.2mm;height:3.2mm}
  .bericht .b-oben{display:grid;grid-template-columns:minmax(0,1fr) 64mm;gap:5mm;align-items:start;break-inside:avoid}
  .bericht figure{margin:2mm 0;break-inside:avoid}
  .bericht figure svg{width:100%;height:auto;max-height:84mm;border:0.3mm solid var(--line);border-radius:2mm}
  .bericht figure.b-netz svg{max-height:150mm}
  .bericht figure.b-sonne{margin:0}
  .bericht figure.b-sonne svg{max-height:72mm;border:0}
  .bericht figcaption{font-size:8pt;color:var(--ink-2);margin-top:1mm}
  .bericht .b-pfadbox{border:0.3mm solid var(--line);border-radius:2mm;padding:3.5mm 4mm;break-inside:avoid}
  .bericht .b-pfadbox h3{font-size:10.5pt;margin:0 0 2.5mm}
  .bericht .b-pfad{list-style:none;margin:0;padding:0}
  .bericht .b-pfad li{position:relative;display:flex;align-items:center;gap:2mm;font-size:9pt;padding:1.2mm 0}
  .bericht .b-pfad li + li{margin-top:3mm}
  .bericht .b-pfad li + li::before{content:"\2193";position:absolute;top:-3.6mm;left:5mm;color:#6c7c88;font-size:8pt}
  .bericht .b-pfad code{font-size:8.5pt;word-break:break-all}
  .bericht .b-klein{font-size:7.5pt;color:var(--ink-2);margin:2mm 0 0}
  .bericht .b-hinweis{break-inside:avoid;border-bottom:0.3mm solid var(--line);padding:2mm 0}
  .bericht .b-hinweis h3{font-size:10.5pt;margin:0 0 1mm}
  .bericht .b-hinweis p{margin:0 0 1mm;color:var(--ink-2)}
  .bericht .b-hinweis code,.bericht .b-baum code{font-size:8pt;background:none;padding:0}
  .bericht .b-baum div{font-size:9.5pt;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .bericht .b-baum .pill{font-size:6.5pt;min-width:12mm;padding:0 1.5mm;margin-right:1.5mm}
  .bericht .b-baum .mk{font-size:6.5pt;margin-left:1mm}
  .bericht .b-kontakt{break-inside:avoid;background:var(--navy);color:#fff;border-radius:3mm;padding:3.5mm 5mm;margin-top:5mm}
  .bericht .b-kontakt p{margin:0;font-size:9pt}
  .bericht .b-kontakt a{color:#fff}
  .bericht .seitenumbruch{break-before:page}
}
