/* Infofactory-Tokens, übernommen aus Firma/Design/Infofactory/styles.css und motion.css (Stand 24.09.2026) */
:root {
  --if-blue: #1A4FA0;
  --if-blue-soft: #2E6BC0;
  --if-blue-night: #082247;
  --if-blue-hint: #E8EFF8;
  --if-grau: #E7E7E7;
  --if-text: #404040;
  --if-muted: #5A6373;
  --if-line: #D9DCE2;
  --if-bg: #FFFFFF;
  --if-cta: #6FB52C;
  --if-blue-deep: #0E3470;
  --if-ink: #0B1320;
  --if-ink2: #2C3340;
  --if-paper: #F4F4F1;
  --if-orange: #E07B3D;
  --if-flag: #9A4715;       /* 5.5:1 auf --if-flag-bg; #B4561F aus gen.py hätte nur 4.20:1 (Gate 1 B2) */
  --if-flag-bg: #FBEBDD;
  --if-flag-line: #EFC3A0;
  --kachel-1: #B7D6E6;      /* glass-sky aus dem IF-Farbraster */
  --kachel-2: #2E6BC0;      /* if-blue-soft; weisse Schrift 5.3:1 */
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --r-1: 0;
  --r-2: 0;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --if-dur-1: 200ms;
  --if-dur-2: 400ms;
  --if-dur-3: 600ms;
  --ease-soft: cubic-bezier(.22,.61,.36,1);
  --ease-rise: cubic-bezier(.16,.84,.32,1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 var(--font-sans); color: var(--if-text); background: var(--if-bg); }
.nur-vorlesen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.kopf { display: flex; justify-content: space-between; align-items: center; height: 56px; padding: 0 var(--s-4); border-bottom: 1px solid var(--if-line); }
.kopf h1 { margin: 0; font-size: 18px; font-weight: 600; color: var(--if-blue); }
.logo { height: 32px; width: auto; }

input, select, textarea, button { font: inherit; border-radius: var(--r-2); }
/* IF-Formregel: Feld ist Fläche ohne Rahmen; der Fokus ist die einzige Kontur (nie Doppelrahmen) */
input, select, textarea { border: 0; padding: var(--s-2); color: var(--if-text); background: var(--if-grau); }
button { border: 0; padding: var(--s-2) var(--s-4); background: var(--if-blue); color: #fff; cursor: pointer; transition: background-color var(--if-dur-1) var(--ease-soft); }
button:hover { background: var(--if-blue-soft); color: #FFFFFF; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--if-blue); outline-offset: 2px; }
input:not([type=radio]):not([type=checkbox]):focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--if-blue); }

.zugang { max-width: 360px; margin: var(--s-5) auto; padding: var(--s-4); }
.zugang form { display: grid; gap: var(--s-2); }
.fehler { color: #A3320B; margin: 0; }

.raster { display: grid; grid-template-columns: minmax(320px, 2fr) 3fr; height: calc(100vh - 56px); }
.chat { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--if-line); }
.start-hinweis { margin: 0; padding: var(--s-2) var(--s-4); background: var(--if-blue-hint); font-size: 13px; }
.verlauf { flex: 1; overflow-y: auto; padding: var(--s-4); }
.block { margin-bottom: var(--s-5); animation: auftritt var(--if-dur-3) var(--ease-rise) both; }
.frage { margin: 0 0 var(--s-1); font-weight: 600; }
.vertrag { margin: 0 0 var(--s-1); font-size: 13px; color: var(--if-blue); }
.antwort { white-space: pre-wrap; }
.fuss { margin-top: var(--s-2); font-size: 13px; }
.marke { display: inline-block; margin: 0; padding: 2px var(--s-2); border-radius: var(--r-1); }
.marke-ok { background: #E7F3DC; color: #2F5E0F; }
.marke-abweichung { background: #FBE6D9; color: #8A3D0D; }
.marke-offen, .marke-keine { background: var(--if-grau); color: var(--if-text); }
.hinweis { margin: var(--s-1) 0 0; }
.quellen-titel { margin: var(--s-2) 0 0; font-weight: 600; }
.quellen { margin: var(--s-1) 0 0; padding-left: var(--s-4); }
.quelle { padding: 0; background: none; color: var(--if-blue); text-decoration: underline; text-align: left; vertical-align: top; }
.quelle:hover { background: none; color: var(--if-blue-soft); }
.stand { color: var(--if-muted); }
.frage-form { display: flex; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-top: 1px solid var(--if-line); }
.frage-form textarea { flex: 1; resize: none; }

.rechts { display: flex; flex-direction: column; min-height: 0; }
.reiter { display: flex; border-bottom: 1px solid var(--if-line); }
.reiter button { background: none; color: var(--if-text); border-radius: 0; border-bottom: 2px solid transparent; }
.reiter button[aria-selected="true"] { color: var(--if-blue); border-bottom-color: var(--if-blue); }
.ansicht { flex: 1; min-height: 0; overflow: auto; }
.karte { position: relative; overflow: hidden; background: var(--if-blue-night); }
.karte canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.karte canvas.ziehen { cursor: grabbing; }
.karte-hinweis { position: absolute; right: var(--s-3); top: var(--s-2); margin: 0; font-size: 11px; color: #B7C3D6; pointer-events: none; }
.artikel, .rechner { padding: var(--s-4) var(--s-5); }
.leer { color: var(--if-muted); }

.rechner h2, .artikel-kopf h2 { margin: 0 0 var(--s-3); font-size: 18px; font-weight: 600; color: var(--if-blue); }
.rechner-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); max-width: 640px; }
.rechner-form select { width: 100%; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.rechner-form .feld, .rechner-form .zeile span, .rechner-form fieldset { min-width: 0; }
.rechner-form fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: var(--s-4); }
.rechner-form legend { font-weight: 600; margin-bottom: var(--s-1); padding: 0; }
.rechner-form .feld { display: grid; gap: var(--s-1); }
.rechner-form .zeile { grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.rechner-form .zeile span { display: grid; gap: var(--s-1); }
.rechner-form button { justify-self: start; }
#rechner-resultat { margin-top: var(--s-4); max-width: 640px; }
/* Grundlohn als Umschalter wie .modus; das Radio liegt unsichtbar über dem Segment und bleibt per Tastatur bedienbar */
.rechner-form .art-wahl { display: grid; grid-template-columns: repeat(2, var(--knopf-b)); gap: 0; }
.rechner-form .klassen { display: block; }
.art-wahl label { position: relative; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 var(--s-4); border: 1px solid var(--if-blue); color: var(--if-blue); cursor: pointer; transition: background-color var(--if-dur-1) var(--ease-soft); }
.art-wahl label + label { border-left: 0; }
.art-wahl input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.art-wahl label:hover { background: var(--if-blue-hint); }
.art-wahl label:has(input:checked) { background: var(--if-blue); color: #FFFFFF; }
.art-wahl label:has(input:focus-visible) { outline: 2px solid var(--if-blue); outline-offset: 2px; }
.kaskade { width: 100%; border-collapse: collapse; }
.kaskade td { padding: var(--s-1) 0; border-bottom: 1px solid var(--if-line); }
.kaskade td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.brutto-zeile { margin: var(--s-3) 0 var(--s-2); }
.brutto { font-size: 18px; color: var(--if-blue); }
.artikel-kopf { border-bottom: 1px solid var(--if-line); margin-bottom: var(--s-3); }
.artikel-kopf p { margin: 0 0 var(--s-1); font-size: 13px; color: var(--if-muted); }
.artikel-text table { border-collapse: collapse; margin: var(--s-3) 0; }
.artikel-text th, .artikel-text td { border: 1px solid var(--if-line); padding: var(--s-1) var(--s-2); text-align: left; }
.artikel-text a { color: var(--if-blue); }

@keyframes auftritt { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.textseite .text, .admin { max-width: 1100px; margin: 0 auto; padding: var(--s-4) var(--s-5); }
.textseite .text { max-width: 720px; }
.textseite h2, .admin h2 { font-size: 16px; font-weight: 600; color: var(--if-blue); margin: var(--s-5) 0 var(--s-2); }
.admin-leiste { text-align: right; margin: 0; }
.neu-form { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: end; }
.neu-form label { display: grid; gap: var(--s-1); font-size: 13px; }
.tabelle { overflow-x: auto; }
.admin table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin th, .admin td { border-bottom: 1px solid var(--if-line); padding: var(--s-1) var(--s-2); text-align: left; vertical-align: top; }
.admin td button { padding: 2px var(--s-2); font-size: 12px; }
.frage-eintrag { border-bottom: 1px solid var(--if-line); padding: var(--s-2) 0; }
.frage-eintrag summary { cursor: pointer; }

/* Redesign 2026-09: Start, Reiter, Gesamtkarte */
.verlauf:empty { flex: 0 0 0; padding: 0; }
.start { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--s-5) var(--s-4) var(--s-4); }
.start-titel { margin: 0 0 var(--s-2); font-size: 26px; line-height: 1.2; font-weight: 700; color: var(--if-ink); }
.start-unter { margin: 0 0 var(--s-4); color: var(--if-ink2); }
.einstiege { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); margin-bottom: var(--s-4); }
.einstieg { display: grid; align-content: start; gap: var(--s-1); min-height: 104px; padding: var(--s-3); text-align: left; background: var(--if-bg); color: var(--if-ink); border: 1px solid var(--if-line); border-radius: var(--r-2); }
.einstieg:hover { background: var(--if-blue-hint); color: var(--if-ink); border-color: var(--if-blue); }
.einstieg-titel { font-weight: 600; color: var(--if-blue); }
.einstieg-text { font-size: 13px; color: var(--if-muted); }
.start-label { margin: 0 0 var(--s-1); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--if-muted); }
.beispiele { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.beispiel { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); width: 100%; min-height: 44px; text-align: left; background: var(--if-paper); color: var(--if-ink2); }
.beispiel::after { content: "→"; color: var(--if-blue); }
.beispiel:hover { background: var(--if-blue-hint); color: var(--if-ink2); }
.frage-form button { min-height: 44px; }
.reiter button { min-height: 44px; }
.uebersicht { padding: var(--s-4) var(--s-5); background: var(--if-paper); }
.karte-zeile { margin: var(--s-4) 0 0; }
.karte-oeffnen { min-height: 44px; }
.karte-leiste { position: absolute; left: var(--s-3); top: var(--s-2); display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.karte-zurueck { min-height: 44px; background: rgba(8, 34, 71, .85); border: 1px solid #4A5E82; }
.karte :focus-visible { outline-color: #FFFFFF; }

/* Übersicht */
.uebersicht-titel, .liste-titel { margin: 0 0 var(--s-3); font-size: 18px; color: var(--if-ink); }
.kacheln { display: grid; grid-template-columns: repeat(8, minmax(44px, 1fr)); grid-template-rows: repeat(5, 52px); gap: 4px; max-width: 520px; }
.kachel { display: grid; place-content: center; gap: 0; min-height: 44px; padding: 0; border: 1px solid transparent; border-radius: var(--r-1); color: var(--if-ink); font-size: 12px; line-height: 1.2; }
.kachel-kuerzel { font-weight: 600; }
.kachel-zahl { font-size: 15px; font-weight: 700; }
.stufe-1 { background: var(--if-blue-hint); }
.stufe-2 { background: var(--kachel-1); }
.stufe-3 { background: var(--kachel-2); color: #FFFFFF; }
.stufe-4 { background: var(--if-blue); color: #FFFFFF; }
.kachel:hover { border-color: var(--if-blue-deep); }
.kachel[aria-pressed="true"] { border: 2px solid var(--if-blue-deep); box-shadow: inset 0 0 0 2px #FFFFFF; }
.legende { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; margin: var(--s-2) 0 0; padding: 0; font-size: 12px; }
.legende-stufe { padding: 2px var(--s-2); border-radius: var(--r-1); }
.schweizweit-hinweis { margin: var(--s-2) 0 0; color: var(--if-ink2); }
.branchen { margin-top: var(--s-4); }
.branchen-titel, .gruppe-titel { margin: 0 0 var(--s-2); font-size: 14px; font-weight: 600; color: var(--if-ink2); }
.branchen-liste, .vertrag-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.branche { display: grid; grid-template-columns: minmax(140px, 1fr) 2fr 40px; align-items: center; gap: var(--s-2); width: 100%; min-height: 44px; text-align: left; background: var(--if-bg); color: var(--if-ink); }
.branche:hover { background: var(--if-blue-hint); color: var(--if-ink); }
.branche-balken { height: 8px; background: var(--if-line); border-radius: var(--r-1); overflow: hidden; }
.branche-fuellung { display: block; height: 100%; background: var(--if-blue); }
.branche-zahl { text-align: right; font-weight: 600; }
.rahmen-satz { margin: var(--s-3) 0 0; color: var(--if-ink2); }
.link-knopf { min-height: 44px; padding: 0 var(--s-1); background: transparent; color: var(--if-blue); text-decoration: underline; }
.kantonsliste { margin-top: var(--s-4); }
.liste-kopf { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
.liste-kopf .liste-titel { margin: 0; }
.liste-unter { margin: 0 0 var(--s-2); color: var(--if-muted); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-bottom: var(--s-3); }
.chip { min-height: 44px; padding: 0 var(--s-3); background: var(--if-bg); color: var(--if-ink2); border: 1px solid var(--if-line); border-radius: var(--r-2); }
.chip[aria-pressed="true"] { background: var(--if-blue); color: #FFFFFF; border-color: var(--if-blue); }
.gruppe { margin-bottom: var(--s-3); }
.vertrag-zeile { display: grid; gap: 2px; width: 100%; min-height: 44px; text-align: left; background: var(--if-bg); color: var(--if-ink); }
.vertrag-zeile:hover { background: var(--if-blue-hint); color: var(--if-ink); }
.zeile-titel { font-weight: 600; }
.zeile-meta { font-size: 12px; color: var(--if-muted); }

/* Reiter Vertrag */
.artikel-meta { margin: var(--s-1) 0 0; font-weight: 600; color: var(--if-blue); }
.themen { display: flex; flex-wrap: wrap; gap: var(--s-1); margin: var(--s-3) 0; }
.thema-chip { min-height: 44px; padding: 0 var(--s-3); background: var(--if-blue-hint); color: var(--if-blue-deep); border-radius: var(--r-2); }
.blick, .lohnliste-block, .umfeld-block { margin: var(--s-3) 0; padding: var(--s-3); background: var(--if-paper); border: 1px solid var(--if-line); border-radius: var(--r-2); }
.blick h3, .lohnliste-block h3, .umfeld-block h3 { margin: 0 0 var(--s-2); font-size: 14px; color: var(--if-ink2); }
.blick dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-1) var(--s-3); margin: 0; }
.blick dt { color: var(--if-muted); }
.blick dd { margin: 0; color: var(--if-ink); }
.blick-aktionen { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.aktion { min-height: 44px; }
.lohnliste { list-style: none; margin: 0; padding: 0; }
.lohnliste li { display: flex; justify-content: space-between; gap: var(--s-2); padding: var(--s-1) 0; border-bottom: 1px solid var(--if-line); }
.lohn-wert { font-variant-numeric: tabular-nums; font-weight: 600; }
.umfeld-karte { width: 100%; max-width: 320px; height: auto; display: block; }
.umfeld-linie { stroke: var(--if-line); stroke-width: 1.5; }
.umfeld-mitte { fill: var(--if-blue); }
.umfeld-knoten { fill: var(--kachel-2); }
.umfeld-knoten.typ-hub { fill: var(--if-blue-deep); }
.umfeld-knoten.typ-thema { fill: var(--if-cta); }
.umfeld-liste { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1); }

/* Antwortkarte */
.antwort-aktionen { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }
.antwort-aktionen .aktion { background: var(--if-bg); color: var(--if-blue); border: 1px solid var(--if-blue); }
.antwort-aktionen .aktion:hover { background: var(--if-blue-hint); color: var(--if-blue); }
.kopier-status { min-height: 1.4em; margin: var(--s-1) 0 0; font-size: 12px; color: var(--if-muted); }
.folgefragen { margin-top: var(--s-2); }
.folgefragen-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }

/* Rechner */
/* Beide Umschalter und «Rechnen» teilen eine Knopfbreite: gleiche Segmente, gleiche linke Flucht */
.rechner { --knopf-b: 168px; }
.modus { display: inline-grid; grid-template-columns: 1fr 1fr; width: calc(2 * var(--knopf-b)); margin-bottom: var(--s-4); border: 1px solid var(--if-blue); border-radius: var(--r-2); overflow: hidden; }
.modus-knopf { min-height: 44px; padding: 0 var(--s-4); border-radius: 0; background: var(--if-bg); color: var(--if-blue); }
.modus-knopf[aria-pressed="true"] { background: var(--if-blue); color: #FFFFFF; }
.klassen { margin: var(--s-2) 0 0; }
/* Rund sechs Zeilen sichtbar; der Rahmen zeigt, wo die Liste endet */
.klassen-liste { max-height: 330px; overflow-y: auto; border: 1px solid var(--if-line); }
.klassen-tabelle { position: sticky; top: 0; z-index: 1; margin: 0; padding: var(--s-1) var(--s-3); font-size: 12px; font-weight: 600; color: var(--if-muted); background: var(--if-paper); border-bottom: 1px solid var(--if-line); }
.klasse-wahl { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: var(--s-3); min-height: 48px; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--if-line); border-left: 3px solid transparent; cursor: pointer; line-height: 1.35; }
.klasse-wahl:last-child { border-bottom: 0; }
.klasse-wahl input { margin: 0; }
.klasse-betrag { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--if-ink2); }
.klasse-wahl:hover { background: var(--if-blue-hint); }
.klasse-wahl:has(input:checked) { background: var(--if-blue-hint); border-left-color: var(--if-blue); }
.klasse-wahl:has(input:checked) .klasse-betrag { color: var(--if-blue); }
#rechner-klasse-stand { margin: var(--s-1) 0 0; font-size: 12px; }
#rechner-rechnen { min-height: 44px; width: var(--knopf-b); margin-top: var(--s-2); }
.signal { margin-bottom: var(--s-3); padding: var(--s-3); border-radius: var(--r-2); border: 1px solid; }
.signal-titel { margin: 0; font-size: 18px; font-weight: 700; }
.signal-detail { margin: var(--s-1) 0 0; font-size: 13px; }
.signal-ok { background: #EEF6E6; border-color: var(--if-cta); color: #2F5A10; }
.signal-flag { background: var(--if-flag-bg); border-color: var(--if-flag-line); color: var(--if-flag); }

/* Gesamtkarte: Filter, Legende, Seitenkarte */
.karte-leiste select { min-height: 44px; max-width: 200px; padding: 0 var(--s-2); background: rgba(8, 34, 71, .85); color: #FFFFFF; border: 1px solid #4A5E82; border-radius: var(--r-1); }
.karte-leiste select:focus-visible { box-shadow: inset 0 0 0 2px #FFFFFF; }
.karte-legende { position: absolute; right: var(--s-3); bottom: var(--s-2); margin: 0; padding: var(--s-2); list-style: none; display: grid; gap: 2px; font-size: 11px; color: #B7C3D6; background: rgba(8, 34, 71, .7); border-radius: var(--r-1); pointer-events: none; }
.karte-legende li { display: flex; align-items: center; gap: 6px; }
.farbfleck { width: 8px; height: 8px; border-radius: 0; }
.karte-seite { position: absolute; right: var(--s-3); top: 40px; width: 260px; padding: var(--s-3); background: #FFFFFF; color: var(--if-ink); border-top: 3px solid var(--if-blue); border-radius: var(--r-2); }
.karte-seite h3 { margin: 0 0 var(--s-1); font-size: 15px; }
.karte-seite p { margin: 0 0 var(--s-3); font-size: 13px; color: var(--if-muted); }
.karte-seite-aktionen { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.karte-seite-aktionen button { min-height: 44px; }
.karte .karte-seite :focus-visible { outline-color: var(--if-blue); }

@media (max-width: 900px) {
  .raster { grid-template-columns: 1fr; height: auto; }
  .chat { min-height: 60vh; border-right: 0; }
  .karte { height: 60vh; flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}
