/* Kundenportal (/portal/…, docs/KUNDENPORTAL.md) – Aufbau wie der freigegebene Prototyp docs/kundenportal_prototyp.html.
   Farben/Schriften = Design „Team Noah“ (design_teamnoah.css, docs/DESIGN.md): gleiche Variablen-Namen und Werte, nur hell.
   Signalfarben (Grün/Orange) nur für Status mit Bedeutung. Kein Inline-Skript, keine Fremdquellen. */
@font-face { font-family: "TN Archivo"; src: url("../fonts/design/archivo-latin-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "TN Lora"; src: url("../fonts/design/lora-italic-var.ttf") format("truetype"); font-style: italic; font-weight: 400 700; font-display: swap; }

body.tn-portal {
  color-scheme: light;
  /* 19.19 Design 34f12b (docs/DESIGN.md): Navy, Stahlblau-Verlauf, Porzellan, Sand */
  --tn-navy: #05173D; --accent: #796B44; --tn-petrol: #796B44; --tn-hell: #E0CCA6; --accent-soft: #EEEBE3;
  --tn-schiene: #F4F2EC; --surface: #FFFFFF; --surface-2: #F7F5F0; --tn-gitter: #F1EEE7;
  --line: #E6E1D6; --line-2: #D9D2C0; --ink-2: #56677D; --ink-3: #6E6857;
  --tn-stahl: #3D6189; --tn-porzellan: #EEEBE3; --tn-knopfrand: #C7BEA4;
  --tn-verlauf: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(100deg, #102035 0%, #102035 30%, #3B5878 70%, #4F7196 100%);
  --ok: #1F7A47; --ok-soft: #E4F4EA; --warn: #B4470F; --warn-soft: #FFF1E6;
  --f-text: "TN Archivo", "Segoe UI", Arial, sans-serif; --f-akzent: "TN Lora", Georgia, serif;
  margin: 0; background: var(--tn-schiene); color: var(--tn-navy); font-family: var(--f-text); font-size: 15px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  overflow-x: hidden;
}
.tn-portal *, .tn-portal *::before, .tn-portal *::after { box-sizing: border-box; }
.tn-portal [hidden] { display: none !important; }
.tn-portal em, .tn-portal .akz { font-family: var(--f-akzent); font-style: italic; font-weight: 400; }
.tn-portal h1 em, .tn-portal h2 em { color: var(--accent); }
.tn-portal h1 { font-weight: 400; letter-spacing: -.035em; font-size: clamp(26px, 4vw, 36px); line-height: 1.15; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
.tn-portal h2 { font-weight: 500; letter-spacing: -.02em; font-size: 19px; margin: 0; }
.tn-portal button, .tn-portal input, .tn-portal select, .tn-portal textarea { font: inherit; color: inherit; }
.tn-portal :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tn-portal a { color: var(--accent); }
.muted { color: var(--ink-2); } .klein { font-size: 13px; }
.lbl { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }

/* Kopf mit Reitern */
.kopf { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line);
  margin-left: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(16px, env(safe-area-inset-right, 0px))); }
.kopf-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); }
.kopf .logo { height: 22px; width: auto; display: block; }
.reiter { display: flex; gap: 4px; order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.reiter::-webkit-scrollbar { display: none; }
.reiter a { padding: 7px 13px; border-radius: 99px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; flex: none; }
.reiter a:hover { background: var(--surface-2); color: var(--tn-navy); }
.reiter a.an { background: var(--accent-soft); color: var(--tn-navy); }
.reiter .zahl { background: var(--accent); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 6px; font-weight: 600; }
.kopf-r { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.kopf-r form { margin: 0; }
@media (min-width: 1180px) { .reiter { order: 0; width: auto; overflow: visible; } }
@media (max-width: 560px) { .kopf-r .pille, .kopf-r .abmelden-text { display: none; } .kopf-r .btn { padding: 9px 14px; } }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--tn-navy); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: 0 0 auto; border: 0; cursor: pointer; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 99px; background: var(--tn-navy); color: #fff !important; font-weight: 600; border: 0; cursor: pointer; text-decoration: none; font-size: 14px; }
.btn:hover { background: #102035; }
.btn .punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--tn-hell); }
.btn.hell { background: var(--surface); color: var(--tn-navy) !important; border: 1px solid var(--line-2); }
.btn.hell:hover { background: var(--surface-2); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.pille { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.p-petrol { background: var(--accent-soft); color: var(--accent); } .p-gruen { background: var(--ok-soft); color: var(--ok); }
.p-orange { background: var(--warn-soft); color: var(--warn); } .p-grau { background: var(--tn-gitter); color: var(--ink-2); }

/* Inhalt */
.inhalt { max-width: 1240px; margin: 0 auto; padding: 28px 0 60px; display: grid; gap: 22px; min-width: 0; }
.karte { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; min-width: 0; }
@media (max-width: 560px) { .karte { padding: 16px; } }
.raster { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.raster > * { min-width: 0; }
@media (min-width: 900px) { .r-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .r-3-2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .r-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .r-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
@media (min-width: 560px) and (max-width: 899px) { .r-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kopfzeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.kpi .wert { font-family: var(--f-akzent); font-style: italic; font-size: 36px; line-height: 1.1; margin-top: 6px; }
.kpi.dunkel { background-color: #102035; background-image: var(--tn-verlauf); background-size: 32px 32px, 32px 32px, auto; border-color: #102035; color: #fff; }
.kpi.dunkel .lbl { color: var(--tn-hell); } .kpi.dunkel .muted { color: rgba(255, 255, 255, .78); }
.balken { height: 9px; border-radius: 99px; background: var(--tn-gitter); overflow: hidden; }
.balken i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--tn-hell)); }
.kpi.dunkel .balken { background: rgba(255, 255, 255, .16); }
.tabelle { overflow-x: auto; }
.tn-portal table { width: 100%; border-collapse: collapse; }
.tn-portal th, .tn-portal td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tn-portal th { font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
tr.klick { cursor: pointer; } tr.klick:hover td { background: var(--surface-2); }
td a.zeilenlink { color: inherit; text-decoration: none; font-weight: 700; }
/* Handy: Tabellen als Karten (kein waagerechtes Scrollen) */
@media (max-width: 640px) {
  .tabelle.karten table, .tabelle.karten tbody, .tabelle.karten tr, .tabelle.karten td { display: block; width: 100%; }
  .tabelle.karten thead { display: none; }
  .tabelle.karten tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .tabelle.karten td { border: 0; padding: 3px 0; }
  .tabelle.karten td[data-l]::before { content: attr(data-l) " "; color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
}
.zeile { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.zeile:last-child { border-bottom: 0; }
.ico { width: 38px; height: 38px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; font-size: 12px; }
.ico.or { background: var(--warn-soft); color: var(--warn); }
.flex1 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.link { color: var(--accent); font-weight: 600; text-decoration: none; cursor: pointer; background: none; border: 0; padding: 0; }
.meldung { border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.meldung.ok { background: var(--ok-soft); color: var(--ok); } .meldung.fehler { background: var(--warn-soft); color: var(--warn); }
.tipp { background: var(--accent-soft); border-color: var(--line-2); }

/* Zeitleiste */
.zeit { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; position: relative; }
.zeit::before { content: ""; position: absolute; left: 10%; right: 10%; top: 15px; height: 2px; background: var(--line-2); }
.schritt { text-align: center; position: relative; font-size: 13px; min-width: 0; }
.schritt .k { width: 32px; height: 32px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--surface); border: 2px solid var(--line-2); color: var(--ink-3); position: relative; }
.schritt.fertig .k { background: var(--tn-navy); border-color: var(--tn-navy); color: #fff; }
.schritt.jetzt .k { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 6px var(--accent-soft); }
.schritt .kurz { display: none; }
@media (max-width: 600px) { .schritt b { font-size: 11px; display: block; } .schritt .lang { display: none; } .schritt .kurz { display: block; } .schritt .muted { display: none; } }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 12px; max-height: 420px; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 14.5px; overflow-wrap: anywhere; }
.msg p { margin: 0; }
.msg.wir { background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.ich { background: var(--tn-navy); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.ich a { color: var(--tn-hell); }
.msg .meta { font-size: 11.5px; opacity: .7; margin-top: 4px; }
.eingabe { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.eingabe textarea { flex: 1 1 220px; min-width: 0; min-height: 46px; border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 13px; resize: vertical; background: var(--surface); }
.dateiknopf { position: relative; overflow: hidden; }
.dateiknopf input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.chatliste a.zeile { text-decoration: none; color: inherit; border-radius: 10px; padding: 10px; border-bottom: 0; }
.chatliste a.zeile:hover, .chatliste a.zeile.an { background: var(--accent-soft); }

/* Felder / Upload */
.feld { display: grid; gap: 6px; min-width: 0; }
.feld input, .feld select, .feld textarea { border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 13px; background: var(--surface); width: 100%; }
.ablage { border: 2px dashed var(--line-2); border-radius: 14px; padding: 22px; text-align: center; color: var(--ink-2); position: relative; }
.ablage input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ablage.over { border-color: var(--accent); background: var(--accent-soft); }
.erfolg { background: var(--ok-soft); border: 1px solid #bfe3cc; border-radius: 16px; padding: 22px; }

/* Stufen */
.stufe .proz { font-family: var(--f-akzent); font-style: italic; font-size: 46px; color: var(--accent); line-height: 1.1; margin: 6px 0; }
.stufe ul { padding-left: 18px; margin: 0; color: var(--ink-2); } .stufe li { margin: 6px 0; }
.stufe.dunkel { background-color: #102035; background-image: var(--tn-verlauf); background-size: 32px 32px, 32px 32px, auto; border-color: #102035; color: #fff; }
.stufe.dunkel .proz { color: var(--tn-hell); } .stufe.dunkel ul { color: rgba(255, 255, 255, .82); } .stufe.dunkel .lbl { color: var(--tn-hell); }
.stufe.ihre { outline: 3px solid var(--tn-hell); outline-offset: -1px; }
.ablauf { display: grid; gap: 18px; }
@media (min-width: 900px) { .ablauf { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.ablauf .n { font-family: var(--f-akzent); font-style: italic; font-size: 28px; color: var(--accent); }

/* Anmelden */
.anmelden { max-width: 460px; margin: 8vh auto 0; display: grid; gap: 18px; }
.anmelden .logo { height: 26px; width: auto; }
.tnf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Eingebettetes B2B-Bestellformular (forms/_canvas_felder.html) im Portal-Aussehen */
.portal-form .s_website_form_rows { display: grid; gap: 18px; }
.portal-form .tnc-field { display: grid; gap: 6px; min-width: 0; }
.portal-form .tnc-label { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.portal-form .tnc-input { border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 13px; background: var(--surface); width: 100%; min-width: 0; }
.portal-form .tnc-textarea { min-height: 90px; resize: vertical; }
.portal-form .tnc-input.tnc-gesperrt { background: var(--surface-2); border-style: dashed; color: var(--tn-navy); font-weight: 600; }
.portal-form .tnc-help { font-size: 13px; color: var(--ink-2); }
.portal-form .tnc-err { font-size: 13px; color: var(--warn); }
.portal-form .o_has_error .tnc-input { border-color: var(--warn); }
.portal-form .tnc-options { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-form .tnc-opt { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: 14px; }
.portal-form .tnc-opt:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.portal-form .tnc-file { display: block; position: relative; border: 2px dashed var(--line-2); border-radius: 14px; padding: 18px; text-align: center; color: var(--ink-2); }
.portal-form .tnc-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.portal-form .tnc-file-btn { color: var(--accent); font-weight: 600; margin-right: 6px; }
.portal-form .tnc-star { color: var(--accent); }
.portal-form .tnc-h2 { font-size: 17px; }
.portal-form .tnc-price { border: 0; padding: 0; }
.portal-form .tnc-price-title { margin: 0 0 6px; font-size: 19px; font-weight: 500; }
.portal-form .tnc-price-total { font-family: var(--f-akzent); font-style: italic; font-size: 34px; }
.portal-form .tnc-price-pos { font-size: 14px; color: var(--ink-2); margin-top: 8px; line-height: 1.8; }
.portal-form .pc-minus { color: var(--accent); }
.portal-form .pc-error { color: var(--warn); }
.portal-form .tnc-price-note { color: var(--ink-3); font-size: 12px; }
.portal-form .tnf-alert { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 12px 16px; }
.portal-form .tnf-result .text-danger { color: var(--warn); }
.portal-form .tnc-agb { font-size: 12.5px; color: var(--ink-2); }
.portal-form .tnc-agb p { margin: 0 0 8px; }
.portal-form .tnc-submit .btn { width: 100%; justify-content: center; }
.portal-form .tnc-box { max-height: 200px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
@media (min-width: 900px) { .portal-form .preis-spalte { position: sticky; top: 130px; align-self: start; } }

/* 19.17: Karte „Termin mit Jeremias“ (obere Partnerstufen) */
.termin-karte { border-color: var(--tn-hell); }
.termin-kopf { display: flex; gap: 16px; align-items: center; }
.termin-bild { flex: none; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--accent-soft, #EEEBE3); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--tn-hell); }
.termin-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.termin-bild.ini { background: var(--accent); color: #fff; font-weight: 700; font-size: 22px; }
/* 19.19 Bestellen im Portal: Objektauswahl, Endkunden-Preis mit Förderhinweis (orange wie ein Rabatt) – nur Variablen */
.tn-portal .portal-objekt { margin-bottom: 4px; }
.tn-portal .portal-ek-preis ul { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.tn-portal .portal-ek-preis li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.tn-portal .portal-ek-preis .ek-minus, .tn-portal .portal-ek-preis .ek-foerd { color: var(--warn); }
.tn-portal .portal-ek-preis .ek-nach { font-weight: 600; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
.tn-portal .portal-ek-preis .ek-fehler { color: var(--warn); font-size: 13px; margin: 8px 0 0; }

/* 15.11.2026: PDF-Erfassungsbögen (wie auf der Bestellformular-Seite, rotes PDF-Zeichen) */
.portal-boegen .pb-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.portal-boegen .pb-dl { display: flex; align-items: center; gap: 11px; padding: 7px 8px; border-radius: 10px; color: var(--tn-navy); text-decoration: underline; text-decoration-color: #D9D2C0; text-underline-offset: 3px; }
.portal-boegen .pb-dl:hover { background: var(--accent-soft); text-decoration-color: currentColor; }
.portal-boegen .pb-dl span { flex: 1 1 auto; min-width: 0; }
.portal-boegen .pb-pdf { flex: 0 0 auto; }
.portal-boegen .pb-pdf text { font-family: inherit; }
.portal-boegen .pb-pfeil { flex: 0 0 auto; fill: currentColor; opacity: .7; }
