/* Workbench-Prototyp. Alle Farben, Schriften und Radien kommen aus dem Profil (app.js setzt die Variablen).
   Hier stehen nur Regeln, keine Markenwerte. Formsystem: Knopf (primär, sekundär, Text) und Pille (Auswahl, Vorschlag). */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("assets/schrift/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("assets/schrift/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600 700; font-display: swap; src: url("assets/schrift/inter-700.woff2") format("woff2"); }

:root {
  --r-s: 6px; --r-l: 12px; --r-voll: 999px;
  --schrift-text: Inter, system-ui, sans-serif; --schrift-titel: var(--schrift-text);
  --basis: 15px; --griff: 2.5rem;
  --dauer: 140ms; --kurve: cubic-bezier(.2,0,0,1);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--papier); color: var(--tinte); font: 400 var(--basis)/1.5 var(--schrift-text); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--schrift-titel); line-height: 1.25; margin: 0; }
h1 { font-size: 1.45rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0 0 .6em; }
a { color: var(--akzent-text); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.leise { color: var(--tinte-2); }
.klein { font-size: .82rem; }
.versteckt { display: none !important; }
svg.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Vorführleiste (nur Prototyp) ---------- */
.vorfuehr { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .4rem 1rem; background: #2A2927; color: #FAF8F5; font: 500 .78rem/1.3 Inter, system-ui, sans-serif; }
.vorfuehr b { letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: #F4D35E; }
.vorfuehr .gruppe { display: flex; align-items: center; gap: .3rem; }
.vorfuehr .gruppe > span { opacity: .75; margin-right: .2rem; }
.vorfuehr button { background: transparent; border: 1px solid #615B56; color: #FAF8F5; border-radius: 999px; padding: .15rem .65rem; cursor: pointer; }
.vorfuehr button[aria-pressed="true"] { background: #FAF8F5; color: #2A2927; border-color: #FAF8F5; }
.vorfuehr .datei { opacity: .7; font-family: ui-monospace, monospace; }

/* ---------- Grundgerüst ---------- */
.app { --leiste-breite: 15.5rem; display: grid; grid-template-columns: var(--leiste-breite) minmax(0,1fr); height: calc(100vh - 2.1rem); }
.app.mit-seite { grid-template-columns: var(--leiste-breite) minmax(0,1fr) 23rem; }
.leiste { background: var(--flaeche); border-right: 1px solid var(--linie); display: flex; flex-direction: column; padding: 1rem .75rem; gap: 1rem; min-height: 0; }
/* Wortmarke: Logo und Zusatz skalieren gemeinsam über --marke-h (web/app.js markeEinpassen setzt es aus dem Platz
   neben den Knöpfen), höchstens --marke-max. Ohne Skript schrumpft das Logo im Flex-Layout mit. */
.marke { --marke-max: 2rem; --marke-h: 1.6rem; display: flex; align-items: center; gap: .55rem; padding: 0 .4rem; min-height: 2.4rem; min-width: 0; max-width: 100%; }
.marke img.logo { height: var(--marke-h); width: auto; max-width: 100%; display: block; min-width: 0; flex: 0 1 auto; object-fit: contain; object-position: left center; }
.marke .zusatz { flex: none; }
/* Wortmarke mit Zusatz als Text (bertha.KI): eine Einheit auf der Grundlinie der Schrift im Logo */
.marke:has(> .zusatz:not(.schild)) { gap: calc(var(--marke-h) * .03); align-items: baseline; min-height: 0; }
.marke .zusatz:not(.schild) { font-size: calc(var(--marke-h) * .78); letter-spacing: -.01em; position: relative; top: -.12em; }
/* Zu schmal für die ganze Wortmarke: nur die Bildmarke links im Logo */
.marke.nur-bildmarke .zusatz { display: none; }
.marke.nur-bildmarke img.logo { width: calc(var(--marke-h) * var(--bildmarke-v)); object-fit: cover; object-position: left center; }
.marke .maske { height: 1.55rem; aspect-ratio: 200 / 30; background: var(--logo-farbe); -webkit-mask: var(--logo-url) no-repeat left center / contain; mask: var(--logo-url) no-repeat left center / contain; }
.marke .zusatz { font: 700 1.1rem/1 var(--schrift-titel); color: var(--tinte); }
.marke .zusatz.schild { background: var(--akzent-text); color: var(--auf-akzent); font-size: max(.62rem, calc(var(--marke-h) * .36)); padding: .2rem .4rem; border-radius: var(--r-s); letter-spacing: .04em; }
.motto { font-style: italic; font-weight: 600; color: var(--zweit-text); font-size: .8rem; padding: 0 .4rem; margin-top: -.6rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .verlauf a { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: var(--r-s); color: var(--tinte); text-decoration: none; }
.nav a:hover, .verlauf a:hover { background: var(--flaeche-2); }
.nav a[aria-current="page"] { background: var(--akzent-weich); color: var(--akzent-text); font-weight: 600; }
.verlauf { flex: 1; overflow: auto; min-height: 0; }
.verlauf h3 { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tinte-2); padding: 0 .6rem; margin: .6rem 0 .25rem; }
.verlauf a { font-size: .87rem; padding: .3rem .6rem; color: var(--tinte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.person { display: flex; align-items: center; gap: .6rem; padding: .5rem .4rem 0; border-top: 1px solid var(--linie); font-size: .85rem; }
.kuerzel { width: 2rem; height: 2rem; border-radius: 50%; background: var(--zweit-weich); color: var(--zweit-text); display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }

main { overflow: auto; min-width: 0; display: flex; flex-direction: column; }
.seite { background: var(--flaeche); border-left: 1px solid var(--linie); overflow: auto; padding: 1.25rem; }
.seite > h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--tinte-2); margin-bottom: 1rem; }
.inhalt { width: 100%; max-width: 52rem; margin: 0 auto; padding: 1.75rem 1.5rem 3rem; }
.kopfzeile { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.kopfzeile .rechts { margin-left: auto; display: flex; gap: .5rem; }

/* ---------- Formsystem ---------- */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: var(--griff); padding: 0 1rem; border-radius: var(--r-button, var(--r-s)); cursor: pointer; font-weight: 600; font-size: .9rem; background: var(--flaeche); color: var(--tinte); border: var(--knopf-kontur-b) solid var(--knopf-kontur); box-shadow: var(--knopf-versatz); transition: transform var(--dauer) var(--kurve), box-shadow var(--dauer) var(--kurve), background var(--dauer); text-decoration: none; white-space: nowrap; }
.knopf:hover { background: var(--flaeche-2); transform: var(--knopf-hebung); box-shadow: var(--knopf-versatz-hoch); }
.knopf:active { transform: var(--knopf-druck); box-shadow: none; }
.knopf.primaer { background: var(--akzent-text); color: var(--auf-akzent); border-color: var(--knopf-kontur-primaer); }
.knopf.primaer:hover { background: var(--akzent-tief); }
.knopf.text { background: none; border-color: transparent; box-shadow: none; color: var(--akzent-text); padding: 0 .5rem; min-height: 2rem; }
.knopf.text:hover { background: var(--flaeche-2); transform: none; }
.knopf.rund { width: var(--sw-action-size, var(--griff)); min-height: var(--sw-action-size, var(--griff)); padding: 0; border-radius: var(--sw-action-radius, var(--sw-radius-round, 50%)); }
.knopf[disabled] { opacity: .45; pointer-events: none; }
html[data-knopf="versatz"] { --knopf-kontur: var(--tinte); --knopf-kontur-primaer: var(--tinte); --knopf-kontur-b: 2px; --knopf-versatz: 2px 2px 0 var(--tinte); --knopf-versatz-hoch: 3px 3px 0 var(--tinte); --knopf-hebung: translate(-1px,-1px); --knopf-druck: translate(2px,2px); }
html[data-knopf="flach"] { --knopf-kontur: var(--linie-stark); --knopf-kontur-primaer: var(--akzent-text); --knopf-kontur-b: 1px; --knopf-versatz: none; --knopf-versatz-hoch: none; --knopf-hebung: none; --knopf-druck: scale(.97); }

.pillen { display: flex; flex-wrap: wrap; gap: .4rem; }
.pille { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--linie-stark); background: var(--flaeche); color: var(--tinte); border-radius: var(--r-voll); padding: .3rem .8rem; font-size: .85rem; cursor: pointer; line-height: 1.3; }
.pille:hover { background: var(--flaeche-2); }
.pille[aria-pressed="true"] { background: var(--akzent-weich); border-color: var(--akzent-text); color: var(--akzent-text); font-weight: 600; }
.pille.vorschlag { color: var(--akzent-text); }
.pille .x { opacity: .6; }

.feld { display: block; margin-bottom: 1.1rem; }
label.feld > span, .feldname { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .35rem; }
.feld small, .hilfe { display: block; color: var(--tinte-2); font-size: .8rem; margin-top: .3rem; }
input[type=text], input[type=url], input[type=number], textarea, select { width: 100%; border: 1px solid var(--linie-stark); background: var(--flaeche); border-radius: var(--r-s); padding: .55rem .7rem; }
textarea { resize: vertical; min-height: 5rem; line-height: 1.45; }
input[type=color] { width: 2.4rem; height: 2.4rem; border: 1px solid var(--linie-stark); border-radius: var(--r-s); padding: 2px; background: var(--flaeche); cursor: pointer; }
.zeile { display: flex; gap: .75rem; align-items: center; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

.schalter { position: relative; display: inline-block; width: 2.3rem; height: 1.3rem; flex: none; }
.schalter input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.schalter i { position: absolute; inset: 0; border-radius: 999px; background: var(--linie-stark); transition: background var(--dauer); }
.schalter i::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.3rem - 4px); height: calc(1.3rem - 4px); border-radius: 50%; background: var(--flaeche); transition: transform var(--dauer) var(--kurve); }
.schalter input:checked + i { background: var(--akzent-text); }
.schalter input:checked + i::after { transform: translateX(1rem); }
.schalter input:disabled + i { opacity: .4; }

hr.trenner { border: 0; border-top: 1px solid var(--linie); margin: 1.5rem 0; }
.hinweis { background: var(--akzent-weich); color: var(--tinte); border-radius: var(--r-s); padding: .6rem .8rem; font-size: .87rem; display: flex; gap: .5rem; align-items: flex-start; }
.hinweis.warn { background: var(--zweit-weich); }
.ok { color: var(--akzent-text); font-weight: 600; }
.warn-text { color: var(--warnung); font-weight: 600; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chatkopf { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.5rem; border-bottom: 1px solid var(--linie); background: var(--papier); flex-wrap: wrap; }
.chatkopf .wer { display: flex; align-items: center; gap: .55rem; font-weight: 600; }
.avatar { width: 1.9rem; height: 1.9rem; border-radius: 50%; flex: none; object-fit: cover; }
.avatar.bot { display: grid; place-items: center; background: var(--akzent-weich); color: var(--akzent-text); font-weight: 700; font-size: .8rem; }
.kontext { margin-left: auto; display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--tinte-2); }
.faden { flex: 1; overflow: auto; padding: 1.5rem 1.5rem 1rem; }
.faden-innen { max-width: 46rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1.25rem; }
.laedt { text-align: center; padding: 4rem 1rem 1rem; }
.leer { text-align: center; padding: 4rem 1rem 1rem; }
.leer h1 { margin: .8rem 0 .3rem; }
.leer .avatar { width: 3.2rem; height: 3.2rem; margin: 0 auto; }
.nachricht { display: flex; gap: .75rem; align-items: flex-start; }
.nachricht.ich { justify-content: flex-end; }
.nachricht.ich .text { background: var(--flaeche-2); border-radius: var(--r-l); padding: .6rem .9rem; max-width: 80%; }
.nachricht .koerper { min-width: 0; flex: 1; }
:is(.nachricht, .gemeldet-text) .text :is(ul,ol) { margin: .3rem 0 .6rem; padding-left: 1.25rem; }
:is(.nachricht, .gemeldet-text) .text table { border-collapse: collapse; margin: .4rem 0 .8rem; font-size: .88rem; }
:is(.nachricht, .gemeldet-text) .text th, :is(.nachricht, .gemeldet-text) .text td { border-bottom: 1px solid var(--linie); padding: .3rem .8rem .3rem 0; text-align: left; }
.formel { font-family: "Cambria Math", "STIX Two Math", serif; font-size: 1.05rem; padding: .4rem 0; display: block; }
.status { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--tinte-2); margin-bottom: .4rem; }
.status .punkt { width: .55rem; height: .55rem; border-radius: 50%; background: var(--akzent); animation: puls 1s ease-in-out infinite; }
@keyframes puls { 50% { opacity: .3; transform: scale(.8); } }
details.schritte { font-size: .8rem; color: var(--tinte-2); margin-bottom: .35rem; }
details.schritte summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: .35rem; }
details.schritte summary::-webkit-details-marker { display: none; }
details.schritte ol { margin: .35rem 0 0; padding-left: 1.2rem; }
.aktionen { display: flex; gap: .25rem; margin-top: .2rem; }
.aktionen .knopf.text { font-size: .8rem; color: var(--tinte-2); font-weight: 500; }
.eingabe { padding: .6rem 1.5rem 1rem; background: var(--papier); }
.eingabe-innen { max-width: 46rem; margin: 0 auto; }
.eingabe .pillen { margin-bottom: .55rem; }
.feldrahmen { display: flex; align-items: flex-end; gap: .4rem; border: 1px solid var(--linie-stark); background: var(--flaeche); border-radius: var(--r-l); padding: .4rem; }
.feldrahmen > .knopf { flex: none; position: relative; min-height: var(--griff); }
/* Trefferfläche mindestens 2.75rem (44 px), auch wenn der Knopf kleiner gezeichnet ist; sie reicht in den Innenabstand des Felds */
.feldrahmen > .knopf::after { content: ""; position: absolute; inset: min(0px, calc((100% - 2.75rem) / 2)); }
.feldrahmen textarea { flex: 1; min-width: 0; border: 0; min-height: 2.5rem; max-height: 10rem; resize: none; padding: .55rem .4rem; background: transparent; }
.feldrahmen textarea:focus { outline: none; }
/* Platzhalter bleibt einzeilig (den passenden Text wählt web/app.js nach der Feldbreite) */
.feldrahmen textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feldrahmen:focus-within { border-color: var(--akzent); }
.fuss { text-align: center; font-size: .75rem; color: var(--tinte-2); margin-top: .45rem; }
.anhang { display: inline-flex; gap: .4rem; align-items: center; font-size: .82rem; background: var(--flaeche-2); border-radius: var(--r-s); padding: .25rem .55rem; margin-bottom: .3rem; }

/* Einwilligung im Gesprächsfaden */
.einwilligung { border-top: 1px solid var(--linie); border-bottom: 1px solid var(--linie); padding: 1.1rem 0; }
.einwilligung h2 { margin-bottom: .6rem; display: flex; gap: .5rem; align-items: center; }
.einwilligung ul { margin: 0 0 .8rem; padding-left: 1.2rem; }
.einwilligung li { margin-bottom: .2rem; }
.einwilligung details { font-size: .85rem; color: var(--tinte-2); margin-bottom: 1rem; }
.einwilligung .zeile { gap: .5rem; }

/* ---------- Listen (Bots, Modelle) ---------- */
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; padding: .9rem .25rem; border-bottom: 1px solid var(--linie); }
.liste > li:first-child { border-top: 1px solid var(--linie); }
.liste .titel { font-weight: 600; }
.liste .meta { font-size: .8rem; color: var(--tinte-2); }
.liste .rechts { display: flex; gap: .3rem; align-items: center; }
.botzeichen { width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--akzent-text); background: var(--akzent-weich); }
.botzeichen.zweit { color: var(--zweit-text); background: var(--zweit-weich); }
.filter { display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.filter input { max-width: 16rem; }
.marke-schild { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--zweit-text); }

/* ---------- Bot bauen ---------- */
.abschnitt { margin-bottom: 1.75rem; }
.abschnitt > h2 { margin-bottom: .8rem; }
.dateien { list-style: none; padding: 0; margin: 0 0 .5rem; font-size: .88rem; }
.dateien li { display: flex; gap: .5rem; align-items: center; padding: .3rem 0; }
.pruefung { list-style: none; padding: 0; margin: .6rem 0 0; font-size: .87rem; }
.pruefung li { display: flex; gap: .5rem; align-items: flex-start; padding: .2rem 0; }
.fussleiste { position: sticky; bottom: 0; background: var(--papier); border-top: 1px solid var(--linie); padding: .8rem 0; display: flex; gap: .6rem; justify-content: flex-end; }

/* ---------- Vorschau rechts ---------- */
.mini { border: 1px solid var(--linie); border-radius: var(--r-l); background: var(--papier); overflow: hidden; font-size: .85rem; }
.mini .minikopf { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.mini .minikopf img.logo { max-height: 1.3rem; max-width: 7rem; }
.mini .minikopf .maske { height: 1.05rem; }
.mini .miniinhalt { padding: .9rem .8rem; display: flex; flex-direction: column; gap: .7rem; }
.mini .nachricht.ich .text { font-size: .82rem; }
.mini .knopf { min-height: 2rem; font-size: .8rem; padding: 0 .7rem; }
.mini .pille { font-size: .76rem; padding: .2rem .6rem; }
.vorschau-titel { font-weight: 700; font-size: 1rem; margin-top: .2rem; }

/* ---------- Einstellungen ---------- */
.reiter { margin-bottom: 1.5rem; }
table.matrix { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.matrix th { text-align: left; font-size: .75rem; color: var(--tinte-2); text-transform: uppercase; letter-spacing: .05em; padding: .4rem .5rem; border-bottom: 1px solid var(--linie-stark); }
table.matrix td { padding: .6rem .5rem; border-bottom: 1px solid var(--linie); vertical-align: middle; }
table.matrix td:not(:first-child), table.matrix th:not(:first-child) { text-align: center; width: 6.5rem; }
table.matrix td small { display: block; color: var(--tinte-2); font-size: .78rem; }
.farbreihe { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center; padding: .35rem 0; }
.farbreihe code { font-size: .78rem; color: var(--tinte-2); }
.kontrast { font-size: .78rem; }
pre.json { background: var(--flaeche-2); border-radius: var(--r-s); padding: 1rem; font-size: .78rem; overflow: auto; max-height: 60vh; }
input[type=range] { width: 100%; accent-color: var(--akzent-text); }

@media (max-width: 70rem) { .app.mit-seite { --leiste-breite: 13rem; grid-template-columns: var(--leiste-breite) minmax(0,1fr) 19rem; } }
@media (max-width: 60rem) { .app { --leiste-breite: 13rem; } }
.mini .minikopf .motto { font-size: .68rem; white-space: nowrap; }
