/* Animierte Erklärgrafiken für Content-Seiten – erzeugt von app/services/content_animation.py (docs/CONTENT_ANIMATION.md).
   Regeln: Grundzustand = fertiges Bild; Animationen laufen nur hinein (fill-mode backwards). Kein Skript nötig.
   „Bewegung reduzieren“ → keine Animation. Farben: Design 34f12b (docs/DESIGN.md) über die Archos-Variablen,
   mit denselben Werten als Rückfall (öffentliche Seiten laden design_teamnoah.css nicht). */
@font-face { font-family: "TNA Archivo"; src: url(../fonts/design/archivo-latin-var.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "TNA Lora"; src: url(../fonts/design/lora-italic-var.ttf) format("truetype"); font-style: italic; font-weight: 400 700; font-display: swap; }

.tna {
  --tna-navy: var(--tn-navy, #05173D);
  --tna-stahl: var(--tn-stahl, #3D6189);
  --tna-porzellan: var(--tn-porzellan, #EEEBE3);
  --tna-sand: var(--tn-sand, #E0CCA6);
  --tna-sanddunkel: var(--tn-sanddunkel, #796B44);
  --tna-linie: #E6E1D6;
  --tna-linie2: #D9D2C0;
  --tna-knopfrand: var(--tn-knopfrand, #C7BEA4);
  --tna-flaeche: #F7F5F0;
  --tna-gitter: #F1EEE7;
  --tna-text2: #56677D;
  --tna-ease: cubic-bezier(.2, .7, .2, 1);
  --tna-schrift: "Archivo", "TN Archivo", "TNA Archivo", system-ui, sans-serif;
  --tna-zahl: "Lora", "TN Lora", "TNA Lora", Georgia, serif;
  box-sizing: border-box; margin: 28px 0; padding: 24px 26px 20px; max-width: 100%;
  background: #FFFFFF; color: var(--tna-navy); border: 1px solid var(--tna-linie); border-radius: 16px;
  box-shadow: 0 0 0 4px #F4F2EC; font-family: var(--tna-schrift); font-size: 16px; line-height: 1.45;
  container-type: inline-size;   /* Layout richtet sich nach der Breite der Grafik, nicht des Bildschirms */
}
.tna *, .tna *::before, .tna *::after { box-sizing: border-box; }
:where(.tna) p, :where(.tna) ul, :where(.tna) ol, :where(.tna) li { margin: 0; padding: 0; }
:where(.tna) ul, :where(.tna) ol { list-style: none; }
.tna-titel { font-size: 1.15rem; font-weight: 500; letter-spacing: -.02em; margin: 0 0 18px; line-height: 1.3; }
.tna-quelle, .tna-hinweis { margin-top: 14px; font-size: .8rem; color: var(--tna-text2); }
.tna-hinweis + .tna-quelle { margin-top: 4px; }
.tna-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.tna svg { display: block; width: 100%; height: auto; overflow: visible; }
.tna-svg-zahl, .tna-zahl, .tna-wert, .tna-bzahl { font-family: var(--tna-zahl); font-style: italic; font-variant-numeric: tabular-nums; }
.tna-kopf strong { font-weight: 600; }
.tna-chip { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; margin-top: 5px; }

/* ---------- Bewegungs-Bausteine ---------- */
@keyframes tna-auf { from { opacity: 0; transform: translateY(10px); } }
@keyframes tna-ein { from { opacity: 0; } }
@keyframes tna-breit { from { transform: scaleX(0); } }
@keyframes tna-hoch { from { transform: scaleY(0); } }
@keyframes tna-pop { from { opacity: 0; transform: scale(.4); } }
@keyframes tna-pin { from { transform: translateX(var(--x0, 24px)); } }
@keyframes tna-fluss { to { stroke-dashoffset: -36; } }

/* ---------- (a) Ablauf ---------- */
.tna-schritte { position: relative; display: grid; gap: 14px; }
.tna-schritte::before { content: ""; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px;
  background: var(--tna-linie2); transform-origin: top; animation: tna-hoch calc(var(--n, 4) * .45s) var(--tna-ease) .2s backwards; }
.tna-schritt { position: relative; display: flex; gap: 14px; align-items: flex-start;
  animation: tna-auf .55s var(--tna-ease) backwards; animation-delay: calc(var(--i, 0) * .45s + .25s); }
.tna-nr { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; position: relative; z-index: 1;
  background: var(--tna-navy); color: #FFFFFF; font-family: var(--tna-zahl); font-style: italic; font-weight: 600; font-size: 1.05rem;
  box-shadow: 0 0 0 4px #FFFFFF; animation: tna-pop .45s var(--tna-ease) backwards; animation-delay: calc(var(--i, 0) * .45s + .25s); }
.tna-sinhalt { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px 10px; flex: 1;
  background: var(--tna-flaeche); border: 1px solid var(--tna-linie); border-radius: 12px; }
.tna-stitel { font-weight: 600; }
.tna-dauer { font-size: .8rem; color: var(--tna-sanddunkel); font-family: var(--tna-zahl); font-style: italic; }
.tna-stext { color: var(--tna-text2); font-size: .95rem; }
@container (min-width: 700px) {    /* breit: Schritte nebeneinander, Linie waagerecht */
  .tna-schritte { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 12px; }
  .tna-schritte::before { left: 18px; right: 18px; top: 17px; bottom: auto; width: auto; height: 2px; transform-origin: left;
    animation-name: tna-breit; }
  .tna-schritt { flex-direction: column; gap: 10px; }
  .tna-sinhalt { width: 100%; }
}

.tna-schritte.tna-viele { grid-template-columns: 1fr; }
@container (min-width: 700px) {
  .tna-viele::before { left: 17px; right: auto; top: 18px; bottom: 18px; width: 2px; height: auto; transform-origin: top; animation-name: tna-hoch; }
  .tna-viele .tna-schritt { flex-direction: row; gap: 14px; }
}

/* ---------- Balken (auch Unterart „balken“) ---------- */
.tna-bwert-einzeln { grid-template-columns: minmax(110px, 38%) 1fr auto; animation: tna-auf .45s var(--tna-ease) backwards;
  animation-delay: calc(var(--i, 0) * .3s + .2s); }
.tna-bwert-einzeln .tna-bname { white-space: normal; color: var(--tna-navy); display: flex; flex-direction: column; }
.tna-bzusatz { color: var(--tna-text2); font-size: .8rem; }
.tna-bwert-einzeln .tna-bfill { animation-delay: calc(var(--i, 0) * .3s + .4s); }
.tna-balken.tna-balken-solo { margin-top: 0; }

/* ---------- (b) Vergleich ---------- */
.tna-vs { display: grid; gap: 12px; grid-template-columns: 1fr; align-items: stretch; }
@container (min-width: 600px) { .tna-vs { grid-template-columns: 1fr auto 1fr; } }
.tna-seite { position: relative; padding: 16px 18px; border: 1px solid var(--tna-linie); border-radius: 14px; background: var(--tna-flaeche);
  animation: tna-auf .55s var(--tna-ease) backwards; animation-delay: calc(var(--i, 0) * .3s + .15s); }
.tna-seite.tna-empfohlen { background: var(--tna-porzellan); border-color: var(--tna-knopfrand); }
.tna-badge { position: absolute; top: -11px; right: 14px; padding: 2px 10px; border-radius: 99px; background: var(--tna-navy);
  color: #FFFFFF; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.tna-seite .tna-kopf { display: flex; flex-direction: column; margin-bottom: 10px; font-size: 1.05rem; }
.tna-untertitel { font-size: .85rem; color: var(--tna-text2); }
.tna-punkte { display: grid; gap: 7px; }
.tna-punkte li { display: flex; gap: 8px; align-items: flex-start; font-size: .95rem;
  animation: tna-auf .45s var(--tna-ease) backwards; animation-delay: calc(var(--i, 0) * .22s + .5s); }
.tna-haken { flex: 0 0 18px; width: 18px !important; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--tna-navy); }
.tna-haken path { fill: none; stroke: #FFFFFF; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* 18.11.2026: Nachteil ✗ (Signalfarbe Fehler, gedämpft), neutral – ; nur Vorteile bekommen den Haken */
.tna-kreuz { flex: 0 0 18px; width: 18px !important; height: 18px; margin-top: 2px; border-radius: 50%; background: #B3412E; }
.tna-kreuz path { fill: none; stroke: #FFFFFF; stroke-width: 2; stroke-linecap: round; }
.tna-neutral { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 1px solid var(--tna-linie2);
  color: var(--tna-text2); font-size: .8rem; line-height: 16px; text-align: center; }
.tna-p-minus > span:last-child { color: var(--tna-text2); }
.tna-oder { align-self: center; justify-self: center; font-family: var(--tna-zahl); font-style: italic; color: var(--tna-sanddunkel);
  animation: tna-ein .4s ease .4s backwards; }
.tna-balken { display: grid; gap: 14px; margin-top: 18px; }
.tna-bzeile { animation: tna-auf .45s var(--tna-ease) backwards; animation-delay: calc(var(--i, 0) * .3s + .8s); }
.tna-blabel { font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.tna-bwert { display: grid; grid-template-columns: minmax(70px, 28%) 1fr auto; gap: 10px; align-items: center; font-size: .85rem; }
.tna-bname { color: var(--tna-text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tna-bspur { height: 12px; border-radius: 99px; background: var(--tna-gitter); overflow: hidden; }
.tna-bfill { display: block; height: 100%; width: calc(var(--w, 1) * 100%); border-radius: 99px; background: var(--tna-stahl);
  transform-origin: left; animation: tna-breit .9s var(--tna-ease) backwards; animation-delay: calc(var(--i, 0) * .3s + 1s); }
.tna-bwert-b .tna-bfill { background: var(--tna-sanddunkel); }
.tna-bzahl { min-width: 4.5em; text-align: right; font-size: 1rem; }
.tna-fazit { margin-top: 16px; padding: 10px 14px; border-left: 3px solid var(--tna-stahl); background: var(--tna-flaeche);
  border-radius: 0 10px 10px 0; animation: tna-ein .5s ease 1.4s backwards; }

/* ---------- (c) Kennzahl / Schwellenwert ---------- */
.tna-kennzahl { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 4px; }
.tna-wert { font-size: 2.3rem; line-height: 1.1; font-weight: 600; color: var(--tna-sanddunkel); animation: tna-auf .6s var(--tna-ease) .1s backwards; }
.tna-groesse { color: var(--tna-text2); }
.tna-skala { max-width: 680px; }
.tna-spur { fill: var(--tna-gitter); }
.tna-zone-unter { fill: var(--tna-porzellan); stroke: var(--tna-knopfrand); stroke-width: 1; }
.tna-zone-ueber { fill: var(--tna-stahl); transform-box: fill-box; transform-origin: left;
  animation: tna-breit .9s var(--tna-ease) .7s backwards; }
.tna-schwelle-linie { stroke: var(--tna-navy); stroke-width: 3; stroke-linecap: round; animation: tna-ein .4s ease .5s backwards; }
.tna-schwelle-zahl { fill: var(--tna-navy); font-size: 22px; font-weight: 600; animation: tna-ein .4s ease .5s backwards; }
.tna-pin { transform: translateX(var(--x, 0)); animation: tna-pin 1.4s var(--tna-ease) 1.3s backwards; }
.tna-pin-stiel { stroke: var(--tna-navy); stroke-width: 2; }
.tna-pin-kopf { fill: var(--tna-navy); stroke: #FFFFFF; stroke-width: 3; }
.tna-pin-zahl { fill: var(--tna-sanddunkel); font-size: 18px; animation: tna-ein .4s ease 2.5s backwards; }
.tna-legende { display: grid; gap: 8px; margin-top: 10px; }
@container (min-width: 600px) { .tna-legende { grid-template-columns: 1fr 1fr; gap: 16px; } }
.tna-legende li { display: block; padding-left: 20px; position: relative; font-size: .95rem; }
.tna-legende .tna-chip { position: absolute; left: 0; top: 0; }
.tna-legende strong { white-space: nowrap; margin-right: 4px; }
.tna-l-unter .tna-chip { background: var(--tna-porzellan); box-shadow: inset 0 0 0 1px var(--tna-knopfrand); }
.tna-l-ueber .tna-chip { background: var(--tna-stahl); }
.tna-beispiel { display: block; margin-top: 12px; padding: 10px 14px; background: var(--tna-flaeche);
  border-radius: 10px; animation: tna-ein .5s ease 2.6s backwards; }
.tna-punkt { display: inline-block; margin-right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--tna-navy); }

/* ---------- (d) Wärmefluss: Heizlast ---------- */
.tna-bild { max-width: 640px; margin: 0 auto; }
.tna-himmel { fill: #FFFFFF; }
.tna-boden { stroke: var(--tna-linie2); stroke-width: 2; }
.tna-innen { fill: var(--tna-porzellan); }
.tna-dachflaeche { fill: var(--tna-flaeche); stroke: var(--tna-navy); stroke-width: 3; stroke-linejoin: round; }
.tna-wand { fill: none; stroke: var(--tna-navy); stroke-width: 6; }
.tna-fenster { fill: #FFFFFF; stroke: var(--tna-stahl); stroke-width: 3; }
.tna-sprosse { stroke: var(--tna-stahl); stroke-width: 2; }
.tna-tuer { fill: var(--tna-flaeche); stroke: var(--tna-navy); stroke-width: 3; }
.tna-heizkoerper rect { fill: #FFFFFF; stroke: var(--tna-sanddunkel); stroke-width: 2; }
.tna-heizkoerper line { stroke: var(--tna-sanddunkel); stroke-width: 2; }
.tna-platte { fill: var(--tna-linie2); }
.tna-innen-text, .tna-aussen-text { font-size: 13px; fill: var(--tna-text2); font-family: var(--tna-schrift); }
.tna-pfeil { animation: tna-ein .5s ease backwards; animation-delay: calc(var(--i, 0) * .35s + .4s); }
.tna-pfeil-linie { stroke: var(--tna-sanddunkel); stroke-width: var(--sw, 6); stroke-linecap: round; stroke-dasharray: 22 14;
  animation: tna-fluss 1.6s linear infinite; }
.tna-pfeil-spitze { fill: var(--tna-sanddunkel); }
.tna-pfeil-text { font-size: 16px; font-weight: 600; fill: var(--tna-navy); font-family: var(--tna-schrift); }
.tna-pfeil-text .tna-svg-zahl { fill: var(--tna-sanddunkel); font-weight: 600; }
.tna-legende.tna-legende-verluste { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 14px; }
.tna-legende-verluste li { animation: tna-ein .4s ease backwards; animation-delay: calc(var(--i, 0) * .35s + .5s); }
.tna-chip-waerme { background: var(--tna-sanddunkel); }
.tna-legende .tna-zahl { color: var(--tna-sanddunkel); }

/* ---------- (d) Wärmefluss: hydraulischer Abgleich ---------- */
.tna-panels { display: grid; gap: 16px; }
@container (min-width: 700px) { .tna-panels { grid-template-columns: 1fr 1fr; } }
.tna-panel { padding: 14px 14px 12px; border: 1px solid var(--tna-linie); border-radius: 14px; background: var(--tna-flaeche); }
.tna-panel-mit { background: var(--tna-porzellan); border-color: var(--tna-knopfrand); }
.tna-panel .tna-kopf { margin-bottom: 6px; }
.tna-ptext { margin-top: 6px; font-size: .92rem; color: var(--tna-text2); }
.tna-erzeuger { fill: var(--tna-navy); }
.tna-erzeuger-text { fill: #FFFFFF; font-size: 14px; font-weight: 600; font-family: var(--tna-schrift); }
.tna-rohr { stroke-width: 8; stroke-linecap: round; }
.tna-vorlauf { stroke: var(--tna-sanddunkel); }
.tna-ruecklauf { stroke: var(--tna-stahl); }
.tna-fluss { stroke: #FFFFFF; stroke-width: 3; stroke-dasharray: 8 28; stroke-linecap: round; opacity: .85;
  animation: tna-fluss 1.2s linear infinite; }
.tna-zweig { stroke: var(--tna-sanddunkel); stroke-width: var(--sw, 4); stroke-linecap: round; }
.tna-zweig-rueck { stroke: var(--tna-stahl); }
.tna-hk-rahmen { fill: #FFFFFF; stroke: var(--tna-navy); stroke-width: 2.5; }
.tna-hk-waerme { fill: var(--tna-sanddunkel); opacity: calc(.15 + var(--f, 1) * .75); transform-box: fill-box; transform-origin: bottom;
  transform: scaleY(var(--f, 1)); animation: tna-hoch 1.2s var(--tna-ease) backwards; animation-delay: calc(var(--i, 0) * .25s + .5s); }
.tna-hk-zahl { fill: var(--tna-navy); font-size: 16px; animation: tna-ein .4s ease backwards; animation-delay: calc(var(--i, 0) * .25s + 1.4s); }

/* ---------- Handy: SVG-Schrift größer (sie schrumpft mit der Grafik); Haus-Beschriftung steht in der Legende ---------- */
@media (max-width: 520px) { .tna { padding: 18px 16px 16px; } }
@container (max-width: 480px) {
  .tna-schwelle-zahl { font-size: 34px; }
  .tna-pin-zahl { font-size: 30px; }
  .tna-hk-zahl { font-size: 24px; }
  .tna-erzeuger-text { font-size: 18px; }
  .tna-pfeil-text, .tna-innen-text, .tna-aussen-text { display: none; }
  .tna-legende.tna-legende-verluste { grid-template-columns: 1fr 1fr; }
}

/* ---------- Scrollgesteuert (wo der Browser es kann): Einblenden erst, wenn die Grafik ins Bild kommt ---------- */
@supports (animation-timeline: view()) {
  body:not(.tna-zeit) .tna-schritt, body:not(.tna-zeit) .tna-nr, body:not(.tna-zeit) .tna-seite,
  body:not(.tna-zeit) .tna-punkte li, body:not(.tna-zeit) .tna-bzeile, body:not(.tna-zeit) .tna-bfill,
  body:not(.tna-zeit) .tna-pfeil, body:not(.tna-zeit) .tna-legende-verluste li, body:not(.tna-zeit) .tna-hk-waerme,
  body:not(.tna-zeit) .tna-hk-zahl, body:not(.tna-zeit) .tna-bwert-einzeln {
    animation-timeline: view(); animation-delay: 0s; animation-duration: auto;
    animation-range: entry calc(min(var(--i, 0), 5) * 10%) entry 100%;   /* fertig, sobald das Teil ganz sichtbar ist */
  }
  body:not(.tna-zeit) .tna-schritte::before, body:not(.tna-zeit) .tna-zone-ueber, body:not(.tna-zeit) .tna-pin,
  body:not(.tna-zeit) .tna-wert, body:not(.tna-zeit) .tna-schwelle-linie, body:not(.tna-zeit) .tna-schwelle-zahl,
  body:not(.tna-zeit) .tna-pin-zahl, body:not(.tna-zeit) .tna-beispiel, body:not(.tna-zeit) .tna-fazit,
  body:not(.tna-zeit) .tna-oder {
    animation-timeline: view(); animation-delay: 0s; animation-duration: auto; animation-range: entry 20% entry 100%;
  }
}

/* ---------- Bewegung reduzieren: sofort das fertige Bild ---------- */
@media (prefers-reduced-motion: reduce) {
  .tna *, .tna *::before, .tna *::after { animation: none !important; transition: none !important; }
}

/* ---------- Vorschau- und Video-Seite (vorschau_html) ---------- */
.tna-seite-vorschau, .tna-seite-video { margin: 0; background: #F7F5F0; font-family: "TNA Archivo", system-ui, sans-serif; }
.tna-seite-vorschau .tna-buehne { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.tna-seite-video { width: 100vw; height: 100vh; overflow: hidden; display: grid; place-items: center; }
.tna-seite-video .tna-buehne { --z: 1.9; width: calc(92vw / var(--z)); zoom: var(--z); }
.tna-fmt-quadrat .tna-buehne { --z: 1.45; }
.tna-fmt-hoch .tna-buehne { --z: 2.05; }
.tna-seite-video .tna { margin: 0; box-shadow: none; }
.tna-fehler { padding: 10px 14px; border-radius: 10px; background: #FBEAEA; color: #8A1C1C; }
