/* ==========================================================================
   Fachwerte – Design-System
   Alle globalen Klassen sind mit fw- präfixiert, damit sie in den Tool-Seiten
   nicht mit Tailwind oder tool-eigenem CSS kollidieren.
   ========================================================================== */

/* ─── Tokens ────────────────────────────────────────────────────────────── */
:root {
    --fw-white:      #ffffff;
    --fw-bg:         #ffffff;
    --fw-surface:    #f7f7f5;
    --fw-surface-2:  #f0f0ed;
    --fw-border:     #e6e6e3;
    --fw-border-str: #d4d4d0;
    --fw-text:       #111111;
    --fw-text-2:     #4a4a48;
    --fw-muted:      #85857f;
    --fw-accent:     #0057b8;
    --fw-accent-dk:  #003d82;
    --fw-accent-sf:  #eef4fc;
    --fw-invert-bg:  #111111;
    --fw-invert-tx:  #ffffff;

    /* Gattungsfarben. Blau/Bernstein bleibt auch bei Rot-Grün-Schwäche
       unterscheidbar – anders als etwa Blau/Grün. */
    --fw-calc:       #0057b8;
    --fw-calc-sf:    #eff5fd;
    --fw-proto:      #9a5200;
    --fw-proto-sf:   #fdf4ea;

    --fw-max:        1280px;
    --fw-pad:        2.5rem;
    --fw-radius:     4px;
    --fw-radius-lg:  8px;
    --fw-shadow:     0 8px 32px rgba(0, 0, 0, .10);
    --fw-font:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                     system-ui, 'Helvetica Neue', Arial, sans-serif;
    --fw-mono:       ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --fw-bg:        #121211;
        --fw-surface:   #1a1a19;
        --fw-surface-2: #232322;
        --fw-border:    #2c2c2a;
        --fw-border-str:#3a3a38;
        --fw-text:      #f2f2f0;
        --fw-text-2:    #c8c8c4;
        --fw-muted:     #8d8d87;
        --fw-accent:    #5a9df5;
        --fw-accent-dk: #8ab9f8;
        --fw-accent-sf: #16233a;
        --fw-calc:      #5a9df5;
        --fw-calc-sf:   #16233a;
        --fw-proto:     #eaa956;
        --fw-proto-sf:  #33260f;
        --fw-invert-bg: #f2f2f0;
        --fw-invert-tx: #111111;
        --fw-shadow:    0 8px 32px rgba(0, 0, 0, .55);
    }
}

:root[data-theme="dark"] {
    --fw-bg:        #121211;
    --fw-surface:   #1a1a19;
    --fw-surface-2: #232322;
    --fw-border:    #2c2c2a;
    --fw-border-str:#3a3a38;
    --fw-text:      #f2f2f0;
    --fw-text-2:    #c8c8c4;
    --fw-muted:     #8d8d87;
    --fw-accent:    #5a9df5;
    --fw-accent-dk: #8ab9f8;
    --fw-accent-sf: #16233a;
    --fw-calc:      #5a9df5;
    --fw-calc-sf:   #16233a;
    --fw-proto:     #eaa956;
    --fw-proto-sf:  #33260f;
    --fw-invert-bg: #f2f2f0;
    --fw-invert-tx: #111111;
    --fw-shadow:    0 8px 32px rgba(0, 0, 0, .55);
}

/* ─── Reset (nur auf der Portalseite aktiv, s. .fw-page) ─────────────────── */
.fw-page *,
.fw-page *::before,
.fw-page *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Sprungziele nicht unter den klebenden Kopf schieben */
.fw-page [id] { scroll-margin-top: 84px; }
/* Die Gattungsabschnitte liegen zusätzlich unter der klebenden Filterleiste */
.fw-page .fw-section { scroll-margin-top: 170px; }

.fw-page {
    font-family: var(--fw-font);
    background: var(--fw-bg);
    color: var(--fw-text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Buttons ausnehmen – sie setzen ihre Farbe selbst und würden sonst
   von dieser spezifischeren Regel überschrieben (schwarz auf schwarz). */
.fw-page a:not(.fw-btn) { color: inherit; }
.fw-page img { max-width: 100%; display: block; }

.fw-sr {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Sichtbarer Fokus für Tastaturnutzung */
.fw-page :focus-visible,
.fw-header :focus-visible,
.fw-footer :focus-visible {
    outline: 2px solid var(--fw-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

.fw-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--fw-accent);
    color: #fff;
    padding: .7rem 1.2rem;
    z-index: 2000;
    font-size: .85rem;
    border-radius: 0 0 var(--fw-radius) 0;
}
.fw-skip:focus { left: 0; }

.fw-inner {
    max-width: var(--fw-max);
    margin: 0 auto;
    padding-inline: var(--fw-pad);
}

/* ─── Wortmarke ─────────────────────────────────────────────────────────── */
.fw-logo {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--fw-text);
    text-decoration: none;
    font-family: var(--fw-font);
}
.fw-logo-mark { width: 20px; height: 20px; flex: none; display: block; }

/* ─── Header (wird von site.js injiziert) ───────────────────────────────── */
.fw-header {
    position: sticky;
    top: 0;
    z-index: 1100;                 /* über Leaflet-Controls (max 1000) */
    background: color-mix(in srgb, var(--fw-bg) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--fw-border);
    font-family: var(--fw-font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--fw-text);
}
.fw-header *, .fw-header *::before, .fw-header *::after { box-sizing: border-box; }

.fw-header-inner {
    max-width: var(--fw-max);
    margin: 0 auto;
    padding: 0 var(--fw-pad);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.fw-nav { display: flex; align-items: center; gap: .15rem; }
.fw-nav a {
    position: relative;
    font-size: .82rem;
    color: var(--fw-muted);
    text-decoration: none;
    padding: .4rem .85rem;
    border-radius: var(--fw-radius);
    white-space: nowrap;
    transition: color .4s;
}
.fw-nav a::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--fw-radius);
    background: var(--fw-accent);
    opacity: 0;
    transition: opacity .4s;
}
/* Die beiden Gattungslinks tragen ihre Farbe auch in der Navigation */
.fw-nav a[data-kind="rechner"]::before    { background: var(--fw-calc); }
.fw-nav a[data-kind="protokolle"]::before { background: var(--fw-proto); }
.fw-nav a:hover { color: #fff; transition: color .12s; }
.fw-nav a:hover::before { opacity: 1; transition: opacity .12s; }
.fw-nav a > span { position: relative; z-index: 1; }
.fw-nav a[aria-current="page"] { color: var(--fw-text); font-weight: 500; }

.fw-nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--fw-border-str);
    border-radius: var(--fw-radius);
    padding: .45rem .6rem;
    cursor: pointer;
    color: var(--fw-text);
    line-height: 0;
}

@media (max-width: 800px) {
    :root { --fw-pad: 1.25rem; }
    .fw-nav-toggle { display: block; }
    .fw-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--fw-bg);
        border-bottom: 1px solid var(--fw-border);
        padding: .5rem var(--fw-pad) 1rem;
        display: none;
    }
    .fw-nav[data-open="true"] { display: flex; }
    .fw-nav a { padding: .75rem .5rem; font-size: .95rem; }
}

/* ─── Footer (wird von site.js injiziert) ───────────────────────────────── */
.fw-footer {
    background: var(--fw-bg);
    border-top: 1px solid var(--fw-border);
    font-family: var(--fw-font);
    font-size: 16px;
    color: var(--fw-text);
}
.fw-footer *, .fw-footer *::before, .fw-footer *::after { box-sizing: border-box; }

.fw-footer-inner {
    max-width: var(--fw-max);
    margin: 0 auto;
    padding: 3.5rem var(--fw-pad) 2rem;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 2.5rem;
}
.fw-footer h3 {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--fw-muted);
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.fw-footer h3::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--fw-border-str);
    flex: none;
}
.fw-footer h3[data-kind="rechner"]::before    { background: var(--fw-calc); }
.fw-footer h3[data-kind="protokolle"]::before { background: var(--fw-proto); }
.fw-footer ul { list-style: none; margin: 0; padding: 0; }
.fw-footer li { margin-bottom: .55rem; }
.fw-footer li a {
    font-size: .85rem;
    color: var(--fw-text-2);
    text-decoration: none;
    transition: color .15s;
}
.fw-footer li a:hover { color: var(--fw-accent); }
.fw-footer-about p {
    font-size: .85rem;
    color: var(--fw-muted);
    line-height: 1.7;
    margin-top: 1rem;
    max-width: 34ch;
}
.fw-footer-bottom {
    max-width: var(--fw-max);
    margin: 0 auto;
    padding: 1.5rem var(--fw-pad) 2.5rem;
    border-top: 1px solid var(--fw-border);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    font-size: .78rem;
    color: var(--fw-muted);
}
.fw-footer-bottom nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.fw-footer-bottom a { color: var(--fw-muted); text-decoration: none; }
.fw-footer-bottom a:hover { color: var(--fw-accent); }

@media (max-width: 900px) {
    .fw-footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .fw-footer-about { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
    .fw-footer-inner { grid-template-columns: 1fr; }
}

/* ─── Haftungshinweis unter Tools ───────────────────────────────────────── */
.fw-disclaimer {
    background: var(--fw-surface);
    border-top: 1px solid var(--fw-border);
    font-family: var(--fw-font);
    color: var(--fw-text);
}
.fw-disclaimer-inner {
    max-width: 72ch;
    margin: 0 auto;
    padding: 2.5rem var(--fw-pad);
    font-size: .82rem;
    line-height: 1.75;
    color: var(--fw-muted);
}
.fw-disclaimer-inner strong { color: var(--fw-text-2); font-weight: 600; }

/* ─── Typografie-Bausteine der Portalseiten ─────────────────────────────── */
.fw-eyebrow {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .11em;
    color: var(--fw-muted);
    font-weight: 500;
    margin-bottom: 1rem;
}
.fw-h1 {
    font-size: clamp(2.1rem, 5.2vw, 3.6rem);
    font-weight: 300;
    line-height: 1.08;
    letter-spacing: -.035em;
}
.fw-h1 strong { font-weight: 600; }
.fw-h2 {
    font-size: clamp(1.55rem, 3.2vw, 2.3rem);
    font-weight: 300;
    line-height: 1.18;
    letter-spacing: -.028em;
}
.fw-h2 strong { font-weight: 600; }
.fw-lead {
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--fw-text-2);
    max-width: 62ch;
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.fw-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    font-weight: 500;
    padding: .7rem 1.3rem;
    border-radius: var(--fw-radius);
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .18s, color .18s, border-color .18s;
    font-family: inherit;
}
.fw-btn-primary { background: var(--fw-invert-bg); color: var(--fw-invert-tx); }
.fw-btn-primary:hover { background: var(--fw-accent); color: #fff; }
.fw-btn-ghost {
    background: transparent;
    color: var(--fw-text);
    border-color: var(--fw-border-str);
}
.fw-btn-ghost:hover { border-color: var(--fw-text); }
.fw-btn svg { flex: none; }

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.fw-hero {
    position: relative;
    max-width: var(--fw-max);
    margin: 0 auto;
    padding: clamp(3.5rem, 9vw, 6.5rem) var(--fw-pad) clamp(2.5rem, 5vw, 4rem);
    overflow: hidden;
}
.fw-hero > * { position: relative; z-index: 1; }

/* Fachwerk-Motiv – nimmt die Wortmarke auf, bleibt dezent im Hintergrund */
.fw-hero-motif {
    position: absolute;
    top: 0;
    right: calc(var(--fw-pad) * -1);
    width: 460px;
    height: 100%;
    z-index: 0;
    color: var(--fw-border);
    -webkit-mask-image: linear-gradient(to left, #000 20%, transparent 92%);
    mask-image: linear-gradient(to left, #000 20%, transparent 92%);
    pointer-events: none;
}
@media (max-width: 1080px) { .fw-hero-motif { display: none; } }

.fw-hero .fw-lead { margin-top: 1.6rem; }
.fw-hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.2rem; }

.fw-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 3.5rem;
    border-top: 1px solid var(--fw-border);
}
.fw-stat {
    flex: 1 1 150px;
    padding: 1.4rem 1.5rem;
    border-right: 1px solid var(--fw-border);
}
.fw-stat:first-child { padding-left: 0; }
.fw-stat:last-child { border-right: 0; }
.fw-stat b {
    display: block;
    font-size: 1.9rem;
    font-weight: 300;
    letter-spacing: -.03em;
    line-height: 1;
}
.fw-stat[data-kind="rechner"] b    { color: var(--fw-calc); }
.fw-stat[data-kind="protokolle"] b { color: var(--fw-proto); }
.fw-stat span {
    display: block;
    margin-top: .5rem;
    font-size: .78rem;
    color: var(--fw-muted);
    letter-spacing: .02em;
}

/* ─── Werkzeug-Filter ───────────────────────────────────────────────────── */
.fw-tools { padding-bottom: clamp(3rem, 6vw, 5rem); }

.fw-toolbar {
    position: sticky;
    top: 64px;
    z-index: 40;
    background: color-mix(in srgb, var(--fw-bg) 94%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--fw-border);
    margin-bottom: 3rem;
}
.fw-toolbar-inner {
    max-width: var(--fw-max);
    margin: 0 auto;
    padding: .9rem var(--fw-pad);
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.25rem;
    align-items: center;
}
.fw-search {
    position: relative;
    flex: 0 1 300px;
}
.fw-search svg {
    position: absolute;
    left: .8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fw-muted);
    pointer-events: none;
}
.fw-search input {
    width: 100%;
    font: inherit;
    font-size: .87rem;
    padding: .55rem .8rem .55rem 2.3rem;
    border: 1px solid var(--fw-border-str);
    border-radius: var(--fw-radius);
    background: var(--fw-bg);
    color: var(--fw-text);
}
.fw-search input::placeholder { color: var(--fw-muted); }
.fw-search input:focus {
    outline: 2px solid var(--fw-accent);
    outline-offset: -1px;
    border-color: transparent;
}

.fw-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.fw-filter {
    font: inherit;
    font-size: .78rem;
    padding: .45rem .9rem;
    border: 1px solid var(--fw-border-str);
    border-radius: 100px;
    background: transparent;
    color: var(--fw-text-2);
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    transition: background .15s, color .15s, border-color .15s;
}
.fw-filter:hover { border-color: var(--fw-text); color: var(--fw-text); }
.fw-filter[aria-pressed="true"] {
    background: var(--fw-invert-bg);
    color: var(--fw-invert-tx);
    border-color: var(--fw-invert-bg);
}
/* Gattungsfilter tragen im aktiven Zustand ihre eigene Farbe */
.fw-filter[data-filter="rechner"][aria-pressed="true"] {
    background: var(--fw-calc); border-color: var(--fw-calc); color: #fff;
}
.fw-filter[data-filter="protokolle"][aria-pressed="true"] {
    background: var(--fw-proto); border-color: var(--fw-proto); color: #fff;
}
:root[data-theme="dark"] .fw-filter[data-filter="rechner"][aria-pressed="true"],
:root[data-theme="dark"] .fw-filter[data-filter="protokolle"][aria-pressed="true"] { color: #111; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .fw-filter[data-filter="rechner"][aria-pressed="true"],
    :root:not([data-theme="light"]) .fw-filter[data-filter="protokolle"][aria-pressed="true"] { color: #111; }
}
.fw-filter-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex: none;
}
.fw-filter[data-filter="rechner"]    .fw-filter-dot { background: var(--fw-calc); }
.fw-filter[data-filter="protokolle"] .fw-filter-dot { background: var(--fw-proto); }
.fw-filter[aria-pressed="true"] .fw-filter-dot { background: currentColor; }

.fw-count {
    font-size: .75rem;
    color: var(--fw-muted);
    font-family: var(--fw-mono);
    margin-left: auto;
    white-space: nowrap;
}

/* Auf schmalen Geräten würde die Leiste mit umgebrochenen Chip-Reihen einen
   großen Teil des Bildschirms belegen – die Filter laufen dort in einer
   waagerecht scrollbaren Zeile bis an den Rand. */
@media (max-width: 800px) {
    .fw-toolbar-inner {
        padding-inline: 0;
        gap: .65rem 0;
    }
    .fw-search {
        flex: 1 1 100%;
        margin-inline: var(--fw-pad);
    }
    .fw-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        width: 100%;
        padding-inline: var(--fw-pad);
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .fw-filters::-webkit-scrollbar { display: none; }
    .fw-filter { flex: none; }
    .fw-count { margin-left: var(--fw-pad); }
    /* Kopf + Filterleiste stapeln sich hier höher als am Desktop */
    .fw-page .fw-section { scroll-margin-top: 190px; }
}

/* ─── Gattungsabschnitte ────────────────────────────────────────────────── */
.fw-section { margin-bottom: 3.5rem; }
.fw-section[hidden] { display: none; }

.fw-section-head {
    width: calc(100% - 2 * var(--fw-pad));
    max-width: calc(var(--fw-max) - 2 * var(--fw-pad));
    margin: 0 auto 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .7rem 1rem;
    padding-bottom: .9rem;
    border-bottom: 2px solid var(--k, var(--fw-border));
}
.fw-section[data-kind="rechner"]    { --k: var(--fw-calc);  --k-sf: var(--fw-calc-sf); }
.fw-section[data-kind="protokolle"] { --k: var(--fw-proto); --k-sf: var(--fw-proto-sf); }

.fw-section-head h2 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -.022em;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.fw-section-head h2::before {
    content: '';
    width: 10px; height: 10px;
    border-radius: 2px;
    background: var(--k);
    flex: none;
}
.fw-section-count {
    font-family: var(--fw-mono);
    font-size: .72rem;
    color: var(--k);
    background: var(--k-sf);
    border-radius: 100px;
    padding: .22rem .6rem;
}
.fw-section-desc {
    font-size: .87rem;
    color: var(--fw-muted);
    margin-left: auto;
    max-width: 46ch;
    line-height: 1.6;
}
@media (max-width: 760px) {
    .fw-section-desc { margin-left: 0; }
}

/* ─── Werkzeug-Raster ───────────────────────────────────────────────────── */
.fw-grid {
    /* fluchtet mit dem übrigen Inhalt: Innenbreite minus der seitlichen Polsterung */
    width: calc(100% - 2 * var(--fw-pad));
    max-width: calc(var(--fw-max) - 2 * var(--fw-pad));
    margin-inline: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    /* Hairlines hängen an den Karten, nicht am Rasterhintergrund – sonst
       schimmern beim Filtern leere Zellen grau durch. */
    gap: 1px;
    background: transparent;
}

.fw-card {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    background: var(--fw-bg);
    padding: 1.8rem 1.7rem 1.5rem;
    text-decoration: none;
    color: inherit;
    position: relative;
    min-height: 200px;
    box-shadow: 0 0 0 1px var(--fw-border);
    transition: background .18s, box-shadow .18s;
}
.fw-card[data-kind="rechner"]    { --k: var(--fw-calc);  --k-sf: var(--fw-calc-sf); }
.fw-card[data-kind="protokoll"]  { --k: var(--fw-proto); --k-sf: var(--fw-proto-sf); }
.fw-card[hidden] { display: none; }

/* Farbige Kante links – das durchgehende Erkennungsmerkmal der Gattung */
.fw-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--k);
    opacity: .32;
    transition: opacity .18s;
}
.fw-card:hover {
    background: var(--k-sf);
    box-shadow: 0 0 0 1px var(--k);
    z-index: 1;
}
.fw-card:hover::before { opacity: 1; }
.fw-card:hover .fw-card-title { color: var(--k); }
.fw-card:hover .fw-card-arrow { transform: translateX(3px); opacity: 1; }

.fw-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.fw-card-icon {
    width: 32px;
    height: 32px;
    flex: none;
    color: var(--k);
}
.fw-card-tag {
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--fw-muted);
    border: 1px solid var(--fw-border);
    border-radius: 100px;
    padding: .2rem .6rem;
    white-space: nowrap;
}
.fw-card-title {
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: -.015em;
    line-height: 1.3;
    transition: color .18s;
    margin-top: .25rem;
}
.fw-card-desc {
    font-size: .845rem;
    line-height: 1.65;
    color: var(--fw-muted);
}
.fw-card-foot {
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.fw-card-kind {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--k);
}
.fw-card-kind::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--k);
    flex: none;
}
.fw-card-arrow {
    color: var(--k);
    opacity: 0;
    transition: transform .18s, opacity .18s;
    flex: none;
}

.fw-empty {
    width: calc(100% - 2 * var(--fw-pad));
    max-width: calc(var(--fw-max) - 2 * var(--fw-pad));
    margin: 0 auto;
    padding: 4rem 1rem;
    text-align: center;
    color: var(--fw-muted);
    font-size: .9rem;
    border: 1px dashed var(--fw-border-str);
    border-radius: var(--fw-radius-lg);
}
.fw-empty[hidden] { display: none; }
.fw-empty button {
    font: inherit;
    font-size: .82rem;
    margin-top: 1rem;
    padding: .5rem 1.1rem;
    border: 1px solid var(--fw-border-str);
    border-radius: var(--fw-radius);
    background: transparent;
    color: var(--fw-text);
    cursor: pointer;
}
.fw-empty button:hover { border-color: var(--fw-text); }

/* ─── Inhaltsblock / Wissen-Teaser ──────────────────────────────────────── */
.fw-band {
    border-top: 1px solid var(--fw-border);
    padding: clamp(3.5rem, 7vw, 6rem) 0;
}
.fw-band-surface { background: var(--fw-surface); }
.fw-band-inner {
    max-width: var(--fw-max);
    margin: 0 auto;
    padding: 0 var(--fw-pad);
}
.fw-band-head { max-width: 60ch; margin-bottom: 3rem; }
.fw-band-head .fw-lead { margin-top: 1.2rem; }

.fw-list { display: grid; gap: 0; border-top: 1px solid var(--fw-border); }
.fw-list a {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.5rem;
    padding: 1.3rem .5rem;
    border-bottom: 1px solid var(--fw-border);
    text-decoration: none;
    color: inherit;
    transition: padding-left .2s, background .2s;
}
.fw-list a:hover { padding-left: 1rem; background: var(--fw-bg); }
.fw-list a:hover .fw-list-title { color: var(--fw-accent); }
.fw-list a:hover .fw-list-arrow { transform: translateX(3px); }
.fw-list-num {
    font-family: var(--fw-mono);
    font-size: .72rem;
    color: var(--fw-muted);
    min-width: 2ch;
}
.fw-list-title { font-size: .98rem; font-weight: 500; transition: color .18s; }
.fw-list-sub { font-size: .82rem; color: var(--fw-muted); margin-top: .25rem; }
.fw-list-arrow { color: var(--fw-muted); flex: none; transition: transform .18s; }

/* ─── YouTube-Sektion ───────────────────────────────────────────────────── */
.fw-yt {
    background: #0f0f0f;
    color: #fff;
    padding: clamp(3.5rem, 7vw, 5.5rem) 0;
}
.fw-yt-inner {
    max-width: var(--fw-max);
    margin: 0 auto;
    padding: 0 var(--fw-pad);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}
.fw-yt .fw-eyebrow { color: #ff4444; }
.fw-yt .fw-h2 { color: #fff; }
.fw-yt p { color: #a8a8a8; font-size: .95rem; line-height: 1.75; margin-top: 1.2rem; max-width: 50ch; }
.fw-yt-btn {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    margin-top: 2rem;
    background: #ff0000;
    color: #fff;
    font-size: .85rem;
    font-weight: 500;
    padding: .75rem 1.4rem;
    border-radius: var(--fw-radius);
    text-decoration: none;
    transition: background .18s;
}
.fw-yt-btn:hover { background: #cc0000; }
.fw-yt-btn.is-disabled {
    background: #2a2a2a;
    color: #6f6f6f;
    cursor: not-allowed;
    pointer-events: none;
}
.fw-yt-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #1c1c1c;
    border: 1px solid #2a2a2a;
    border-radius: var(--fw-radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    color: #6f6f6f;
    font-size: .82rem;
}
.fw-yt-play {
    width: 56px;
    height: 40px;
    border-radius: 10px;
    background: #2a2a2a;
    display: grid;
    place-items: center;
}
.fw-yt-play::after {
    content: '';
    border-left: 14px solid #6f6f6f;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    margin-left: 3px;
}
@media (max-width: 820px) {
    .fw-yt-inner { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ─── Datenschutz-/Vertrauensblock ──────────────────────────────────────── */
.fw-trust {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}
.fw-trust-item h3 {
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: .6rem;
    display: flex;
    align-items: center;
    gap: .55rem;
}
.fw-trust-item p { font-size: .86rem; line-height: 1.7; color: var(--fw-muted); }
.fw-trust-item svg { color: var(--fw-accent); flex: none; }

/* ─── Fließtext-Seiten (Wissen, Über, Rechtliches) ──────────────────────── */
.fw-prose {
    max-width: 72ch;
    margin: 0 auto;
    padding: clamp(3rem, 7vw, 5rem) var(--fw-pad) clamp(4rem, 8vw, 6rem);
}
.fw-prose h1 {
    font-size: clamp(1.9rem, 4.5vw, 2.9rem);
    font-weight: 300;
    letter-spacing: -.032em;
    line-height: 1.12;
    margin-bottom: 1.5rem;
}
.fw-prose h1 strong { font-weight: 600; }
.fw-prose h2 {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -.015em;
    margin: 2.8rem 0 .9rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--fw-border);
}
.fw-prose h3 { font-size: .98rem; font-weight: 600; margin: 1.8rem 0 .6rem; }
.fw-prose p,
.fw-prose li { font-size: .95rem; line-height: 1.8; color: var(--fw-text-2); }
.fw-prose p { margin-bottom: 1.1rem; }
.fw-prose ul, .fw-prose ol { margin: 0 0 1.3rem 1.2rem; }
.fw-prose li { margin-bottom: .5rem; }
.fw-prose a { color: var(--fw-accent); text-decoration: underline; text-underline-offset: 3px; }
.fw-prose .fw-lead { font-size: 1.05rem; margin-bottom: 2rem; }
.fw-prose address { font-style: normal; line-height: 1.9; font-size: .95rem; color: var(--fw-text-2); }
.fw-prose hr { border: 0; border-top: 1px solid var(--fw-border); margin: 2.5rem 0; }

/* Platzhalter für noch fehlende Angaben – im Text nicht zu übersehen */
.fw-todo {
    background: #fff4d6;
    color: #6b4c00;
    border: 1px dashed #d9a521;
    border-radius: var(--fw-radius);
    padding: .1rem .45rem;
    font-family: var(--fw-mono);
    font-size: .85em;
}
:root[data-theme="dark"] .fw-todo { background: #3a2f10; color: #f0cf7a; border-color: #7a6220; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .fw-todo { background: #3a2f10; color: #f0cf7a; border-color: #7a6220; }
}

.fw-note {
    background: var(--fw-accent-sf);
    border-left: 3px solid var(--fw-accent);
    border-radius: 0 var(--fw-radius) var(--fw-radius) 0;
    padding: 1.1rem 1.3rem;
    margin: 1.8rem 0;
}
.fw-note p { margin: 0; font-size: .89rem; }

/* ─── Wissensbeitrag ────────────────────────────────────────────────────── */
.fw-article {
    max-width: var(--fw-max);
    margin: 0 auto;
    padding: clamp(2.5rem, 5vw, 4rem) var(--fw-pad) clamp(4rem, 8vw, 6rem);
}

.fw-crumbs {
    font-size: .78rem;
    color: var(--fw-muted);
    margin-bottom: 1.6rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
}
.fw-crumbs a { text-decoration: none; }
.fw-crumbs a:hover { color: var(--fw-accent); }
.fw-crumbs span[aria-hidden] { color: var(--fw-border-str); }

.fw-article-head { max-width: 56ch; }
.fw-article-head h1 {
    font-size: clamp(1.9rem, 4.4vw, 3rem);
    font-weight: 300;
    letter-spacing: -.032em;
    line-height: 1.1;
    max-width: 30ch;
}
.fw-article-head h1 strong { font-weight: 600; }

.fw-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--k, var(--fw-accent));
    background: var(--k-sf, var(--fw-accent-sf));
    border-radius: 100px;
    padding: .28rem .75rem;
    margin-bottom: 1.2rem;
}
.fw-chip[data-kind="rechner"]   { --k: var(--fw-calc);  --k-sf: var(--fw-calc-sf); }
.fw-chip[data-kind="protokoll"] { --k: var(--fw-proto); --k-sf: var(--fw-proto-sf); }

.fw-article-meta {
    margin-top: 1.4rem;
    font-size: .78rem;
    color: var(--fw-muted);
    font-family: var(--fw-mono);
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .9rem;
}

/* Kurzantwort ganz oben – der Kasten, den Praktiker als einziges lesen */
.fw-keypoints {
    margin: 2.5rem 0 0;
    max-width: 68ch;
    border: 1px solid var(--fw-border);
    border-left: 3px solid var(--fw-accent);
    border-radius: 0 var(--fw-radius-lg) var(--fw-radius-lg) 0;
    background: var(--fw-surface);
    padding: 1.5rem 1.7rem;
}
.fw-keypoints h2 {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--fw-muted);
    font-weight: 500;
    margin-bottom: .9rem;
    border: 0;
    padding: 0;
}
.fw-keypoints ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.fw-keypoints li {
    font-size: .9rem;
    line-height: 1.6;
    color: var(--fw-text-2);
    padding-left: 1.4rem;
    position: relative;
}
.fw-keypoints li::before {
    content: '';
    position: absolute;
    left: 0; top: .55em;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--fw-accent);
}

/* Zweispaltiger Hauptteil: klebendes Inhaltsverzeichnis + Lesespalte */
.fw-article-body {
    margin-top: 3.5rem;
    display: grid;
    grid-template-columns: 210px minmax(0, 68ch);
    gap: 4rem;
    align-items: start;
}

.fw-toc {
    position: sticky;
    top: 88px;
    border-top: 2px solid var(--fw-text);
    padding-top: .9rem;
}
.fw-toc h2 {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--fw-muted);
    font-weight: 500;
    margin-bottom: .9rem;
    border: 0;
    padding: 0;
}
.fw-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.fw-toc li { counter-increment: toc; margin-bottom: .1rem; }
.fw-toc a {
    display: flex;
    gap: .6rem;
    font-size: .82rem;
    line-height: 1.45;
    color: var(--fw-muted);
    text-decoration: none;
    padding: .4rem .5rem .4rem 0;
    border-left: 2px solid transparent;
    padding-left: .7rem;
    margin-left: -.7rem;
    transition: color .15s, border-color .15s;
}
.fw-toc a::before {
    content: counter(toc, decimal-leading-zero);
    font-family: var(--fw-mono);
    font-size: .68rem;
    color: var(--fw-border-str);
    flex: none;
    padding-top: .1em;
}
.fw-toc a:hover { color: var(--fw-text); }
.fw-toc a[aria-current="true"] {
    color: var(--fw-text);
    font-weight: 500;
    border-left-color: var(--fw-accent);
}
.fw-toc a[aria-current="true"]::before { color: var(--fw-accent); }

.fw-article-content > * + * { margin-top: 1.15rem; }
.fw-article-content p,
.fw-article-content li { font-size: .95rem; line-height: 1.8; color: var(--fw-text-2); }
.fw-article-content h2 {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--fw-text);
    margin-top: 3.2rem;
    padding-top: 1.8rem;
    border-top: 1px solid var(--fw-border);
    scroll-margin-top: 90px;
}
.fw-article-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--fw-text);
    margin-top: 2rem;
}
.fw-article-content ul,
.fw-article-content ol { padding-left: 1.3rem; }
.fw-article-content li { margin-bottom: .5rem; }
.fw-article-content a:not(.fw-toolcta) { color: var(--fw-accent); text-decoration: underline; text-underline-offset: 3px; }
.fw-article-content strong { color: var(--fw-text); font-weight: 600; }

/* Formel- und Rechenkasten */
.fw-formula {
    background: var(--fw-surface);
    border: 1px solid var(--fw-border);
    border-radius: var(--fw-radius-lg);
    padding: 1.4rem 1.6rem;
    overflow-x: auto;
}
.fw-formula-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--fw-muted);
    font-weight: 500;
    display: block;
    margin-bottom: .8rem;
}
.fw-formula code,
.fw-formula pre {
    font-family: var(--fw-mono);
    font-size: .88rem;
    line-height: 1.9;
    color: var(--fw-text);
    white-space: pre;
    display: block;
}
.fw-formula .fw-formula-note {
    margin-top: .9rem;
    font-size: .8rem;
    line-height: 1.65;
    color: var(--fw-muted);
    white-space: normal;
    font-family: var(--fw-font);
}
.fw-formula-result { color: var(--fw-accent); font-weight: 600; }

/* Normbezug */
.fw-normbox {
    border: 1px solid var(--fw-border);
    border-radius: var(--fw-radius-lg);
    padding: 1.3rem 1.6rem;
    display: grid;
    gap: .8rem;
}
.fw-normbox dl { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1.2rem; margin: 0; }
.fw-normbox dt {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--fw-muted);
    font-weight: 500;
    padding-top: .15em;
    white-space: nowrap;
}
.fw-normbox dd { margin: 0; font-size: .88rem; line-height: 1.6; color: var(--fw-text-2); }
.fw-normbox dd b { color: var(--fw-text); font-weight: 600; }

/* Hinweis auf das passende Werkzeug */
.fw-toolcta {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
    background: var(--fw-bg);
    border: 1px solid var(--fw-border);
    border-radius: var(--fw-radius-lg);
    padding: 1.4rem 3rem 1.4rem 1.7rem;
    overflow: hidden;
    transition: background .18s, border-color .18s;
}
.fw-toolcta[data-kind="rechner"]   { --k: var(--fw-calc);  --k-sf: var(--fw-calc-sf); }
.fw-toolcta[data-kind="protokoll"] { --k: var(--fw-proto); --k-sf: var(--fw-proto-sf); }
.fw-toolcta::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--k);
}
.fw-toolcta:hover { background: var(--k-sf); border-color: var(--k); }
.fw-toolcta:hover .fw-toolcta-arrow { transform: translateX(3px); }
.fw-toolcta-label {
    display: block;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--k);
    font-weight: 500;
    margin-bottom: .5rem;
}
.fw-toolcta-title {
    display: block;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: -.015em;
    margin-bottom: .3rem;
}
.fw-toolcta-desc { display: block; font-size: .85rem; line-height: 1.6; color: var(--fw-muted); }
.fw-toolcta-arrow {
    position: absolute;
    right: 1.4rem;
    top: 50%;
    margin-top: -8px;
    color: var(--k);
    transition: transform .18s;
}

/* Praxisfehler */
.fw-pitfalls { list-style: none; padding: 0; display: grid; gap: 0; }
.fw-pitfalls li {
    padding: 1.1rem 0 1.1rem 2.2rem;
    border-bottom: 1px solid var(--fw-border);
    position: relative;
    margin: 0;
}
.fw-pitfalls li:first-child { border-top: 1px solid var(--fw-border); }
.fw-pitfalls li::before {
    content: '!';
    position: absolute;
    left: 0; top: 1.15rem;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--fw-proto-sf);
    color: var(--fw-proto);
    font-size: .72rem;
    font-weight: 700;
    display: grid;
    place-items: center;
}
.fw-pitfalls b { display: block; color: var(--fw-text); font-weight: 600; margin-bottom: .2rem; }

/* FAQ */
.fw-faq { display: grid; gap: 0; }
.fw-faq details {
    border-bottom: 1px solid var(--fw-border);
}
.fw-faq details:first-of-type { border-top: 1px solid var(--fw-border); }
.fw-faq summary {
    cursor: pointer;
    list-style: none;
    padding: 1.1rem 2.2rem 1.1rem 0;
    font-size: .95rem;
    font-weight: 500;
    color: var(--fw-text);
    position: relative;
}
.fw-faq summary::-webkit-details-marker { display: none; }
.fw-faq summary::after {
    content: '';
    position: absolute;
    right: .4rem; top: 1.5rem;
    width: 9px; height: 9px;
    border-right: 1.6px solid var(--fw-muted);
    border-bottom: 1.6px solid var(--fw-muted);
    transform: rotate(45deg);
    transition: transform .18s;
}
.fw-faq details[open] summary::after { transform: rotate(-135deg); top: 1.7rem; }
.fw-faq details[open] summary { color: var(--fw-accent); }
.fw-faq-answer { padding: 0 0 1.3rem; }
.fw-faq-answer p { margin-top: 0; }

/* Videoplatz im Beitrag */
.fw-videoslot {
    aspect-ratio: 16 / 9;
    background: var(--fw-surface);
    border: 1px dashed var(--fw-border-str);
    border-radius: var(--fw-radius-lg);
    display: grid;
    place-items: center;
    gap: .6rem;
    color: var(--fw-muted);
    font-size: .85rem;
    text-align: center;
    padding: 1rem;
}

.fw-article-foot {
    margin-top: 3.5rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--fw-border);
    font-size: .8rem;
    line-height: 1.75;
    color: var(--fw-muted);
}

@media (max-width: 980px) {
    .fw-article-body { grid-template-columns: 1fr; gap: 2.5rem; }
    .fw-toc {
        position: static;
        border: 1px solid var(--fw-border);
        border-radius: var(--fw-radius-lg);
        padding: 1.2rem 1.4rem;
    }
    .fw-toc a { border-left: 0; margin-left: 0; padding-left: 0; }
    .fw-toc a[aria-current="true"] { border-left: 0; }
    .fw-article-head, .fw-article-head h1 { max-width: none; }
}

/* ─── Wissens-Übersicht ─────────────────────────────────────────────────── */
.fw-posts { display: grid; gap: 0; border-top: 1px solid var(--fw-border); }
.fw-posts > a {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem .5rem;
    border-bottom: 1px solid var(--fw-border);
    text-decoration: none;
    color: inherit;
    transition: padding-left .2s, background .2s;
}
.fw-posts > a:hover { padding-left: 1rem; background: var(--fw-surface); }
.fw-posts > a:hover .fw-post-title { color: var(--fw-accent); }
.fw-post-num { font-family: var(--fw-mono); font-size: .72rem; color: var(--fw-muted); min-width: 2ch; }
.fw-post-title { font-size: 1rem; font-weight: 600; letter-spacing: -.012em; transition: color .18s; }
.fw-post-sub { font-size: .85rem; color: var(--fw-muted); margin-top: .3rem; line-height: 1.55; }
.fw-post-meta { font-size: .72rem; color: var(--fw-muted); font-family: var(--fw-mono); white-space: nowrap; }

.fw-planned { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 0; }
.fw-planned li {
    padding: .95rem .5rem;
    border-bottom: 1px solid var(--fw-border);
    font-size: .9rem;
    color: var(--fw-muted);
    display: flex;
    align-items: baseline;
    gap: .9rem;
}
.fw-planned li:first-child { border-top: 1px solid var(--fw-border); }
.fw-planned li::before {
    content: 'geplant';
    font-family: var(--fw-mono);
    font-size: .64rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--fw-border-str);
    border: 1px solid var(--fw-border);
    border-radius: 100px;
    padding: .15rem .5rem;
    flex: none;
}

/* ─── Print ─────────────────────────────────────────────────────────────── */
@media print {
    .fw-header, .fw-footer, .fw-toolbar, .fw-yt, .fw-hero-motif { display: none !important; }
}
