/* Supportvox – gemeinsames Stylesheet. CSP ohne 'unsafe-inline': keine style-Attribute, alles ueber Klassen. */

:root {
  --seite-max: 1920px;
  --seite-rand: clamp(1rem, 2.5vw, 2.5rem);
  --hintergrund: #f4f6f9;
  --flaeche: #ffffff;
  --flaeche-2: #f9fafc;
  --rand: #dfe3ea;
  --text: #1c2430;
  --text-2: #5b6574;
  --primaer: #1f5fa8;
  --primaer-dunkel: #174a84;
  --primaer-hell: #e7f0fa;
  --gut: #1e7a46;
  --gut-hell: #e3f4ea;
  --warn: #9a6200;
  --warn-hell: #fff3d6;
  --schlecht: #b42318;
  --schlecht-hell: #fde8e6;
  --neutral-hell: #eef0f4;
  --lila: #6b3fa0;
  --lila-hell: #f1eafa;
  --radius: 8px;
  --schatten: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --hintergrund: #11151b;
    --flaeche: #1a2029;
    --flaeche-2: #1f2631;
    --rand: #2e3744;
    --text: #e6e9ee;
    --text-2: #9aa4b2;
    --primaer: #5b9be0;
    --primaer-dunkel: #7ab0ea;
    --primaer-hell: #1c2c40;
    --gut: #5cc48a;
    --gut-hell: #173325;
    --warn: #e0b04f;
    --warn-hell: #3a2e14;
    --schlecht: #f07a6e;
    --schlecht-hell: #3d1d1a;
    --neutral-hell: #262e3a;
    --lila: #b896e6;
    --lila-hell: #2c2240;
    --schatten: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--schrift);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--hintergrund);
}
a { color: var(--primaer); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
.versteckt { display: none !important; }
.leise { color: var(--text-2); }
.klein { font-size: .85rem; }
.fett { font-weight: 600; }
.umbruch { white-space: pre-wrap; overflow-wrap: anywhere; }
.rechts { text-align: right; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

/* ---------- Kopf ---------- */
.kopf {
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
  position: sticky;
  top: 0;
  z-index: 20;
}
.kopf-innen {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 var(--seite-rand);
  height: 56px;
  max-width: var(--seite-max);
  margin: 0 auto;
}
.marke-logo { font-weight: 700; font-size: 1.1rem; color: var(--text); white-space: nowrap; }
.marke-logo span { color: var(--primaer); }
.marke-logo small { font-weight: 400; color: var(--text-2); font-size: .8rem; margin-left: .4rem; }
.navigation { display: flex; gap: .25rem; flex: 1; overflow-x: auto; }
.navigation a {
  color: var(--text-2);
  padding: .4rem .7rem;
  border-radius: 6px;
  white-space: nowrap;
}
.navigation a:hover { background: var(--neutral-hell); text-decoration: none; color: var(--text); }
.navigation a.aktiv { background: var(--primaer-hell); color: var(--primaer); font-weight: 600; }
.kopf-rechts { display: flex; align-items: center; gap: .75rem; white-space: nowrap; }
.kopf-rechts select { width: auto; padding: .25rem .4rem; }

/* ---------- Inhalt ---------- */
/* Seitenbreite passt sich dem Fenster an (bis --seite-max); Formularseiten bleiben bewusst schmal */
.inhalt { max-width: var(--seite-max); margin: 0 auto; padding: 1.5rem var(--seite-rand) 3rem; }
.inhalt.breit { max-width: none; }
.inhalt.schmal { max-width: 960px; }
.inhalt form > input:not([type="checkbox"]):not([type="radio"]), .inhalt form > select { max-width: 760px; }
.titelzeile { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.titelzeile h1 { margin: 0; }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.raster { display: grid; gap: 1rem; }
.raster-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.raster-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.raster-seite { grid-template-columns: minmax(0, 1fr) clamp(300px, 24vw, 460px); align-items: start; }
@media (max-width: 900px) {
  .raster-2, .raster-3, .raster-seite { grid-template-columns: minmax(0, 1fr); }
}
.kennzahl { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.kennzahl-text { color: var(--text-2); font-size: .9rem; }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin: .75rem 0 .3rem; }
label.inline { display: inline-flex; align-items: center; gap: .4rem; font-weight: 400; margin: .5rem 1rem .5rem 0; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 6px;
  padding: .5rem .65rem;
}
input[type="checkbox"], input[type="radio"] { width: auto; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--primaer);
  outline-offset: 1px;
}
.feldzeile { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
.filterzeile { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.filterzeile input, .filterzeile select { width: auto; min-width: 160px; }
.filterzeile input[type="search"] { min-width: 240px; flex: 1; }
.filterzeile input[type="checkbox"] { min-width: 0; }
#kontaktSuche { margin-bottom: .5rem; }
.warnung { color: var(--warn); }
.hinweis { font-size: .85rem; color: var(--text-2); margin-top: .25rem; }

button, .knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font: inherit;
  font-weight: 600;
  border-radius: 6px;
  padding: .5rem 1rem;
  border: 1px solid var(--primaer);
  background: var(--primaer);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
button:hover, .knopf:hover { background: var(--primaer-dunkel); text-decoration: none; }
button:disabled { opacity: .55; cursor: default; }
button.zweit, .knopf.zweit { background: var(--flaeche); color: var(--text); border-color: var(--rand); }
button.zweit:hover, .knopf.zweit:hover { background: var(--neutral-hell); }
button.gefahr { background: var(--schlecht); border-color: var(--schlecht); }
button.link { background: none; border: none; color: var(--primaer); padding: 0; font-weight: 400; }
button.link:hover { text-decoration: underline; background: none; }
button.klein, .knopf.klein { padding: .25rem .6rem; font-size: .85rem; }
.knopfzeile { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }

/* ---------- Tabellen ---------- */
.tabelle-huelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--flaeche); }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--rand); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); background: var(--flaeche-2); }
tr.klickbar { cursor: pointer; }
tr.klickbar:hover td { background: var(--primaer-hell); }
tr.hervor td { font-weight: 600; }
.leer { padding: 2rem; text-align: center; color: var(--text-2); }

/* ---------- Marken (Status, Prioritaet, Art) ---------- */
.marke {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: var(--neutral-hell);
  color: var(--text-2);
  white-space: nowrap;
}
.marke.s-neu { background: var(--primaer-hell); color: var(--primaer); }
.marke.s-in_bearbeitung { background: var(--lila-hell); color: var(--lila); }
.marke.s-warten_auf_kunde { background: var(--warn-hell); color: var(--warn); }
.marke.s-geloest { background: var(--gut-hell); color: var(--gut); }
.marke.p-hoch { background: var(--warn-hell); color: var(--warn); }
.marke.p-kritisch { background: var(--schlecht-hell); color: var(--schlecht); }
.marke.a-fehler { background: var(--schlecht-hell); color: var(--schlecht); }
.marke.a-feature { background: var(--gut-hell); color: var(--gut); }
.marke.a-aufgabe { background: var(--primaer-hell); color: var(--primaer); }
.marke.a-kundenwunsch { background: var(--lila-hell); color: var(--lila); }
.marke.e-in_entwicklung, .marke.e-im_test { background: var(--lila-hell); color: var(--lila); }
.marke.e-behoben, .marke.e-ausgeliefert { background: var(--gut-hell); color: var(--gut); }

/* ---------- Verlauf / Nachrichten ---------- */
.nachricht {
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  background: var(--flaeche);
  margin-bottom: .75rem;
}
.nachricht-kopf {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem .9rem;
  border-bottom: 1px solid var(--rand);
  background: var(--flaeche-2);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: .9rem;
}
.nachricht-text { padding: .75rem .9rem; }
.nachricht.vom-support { border-left: 3px solid var(--primaer); }
.nachricht.vom-kunden { border-left: 3px solid var(--gut); }
.nachricht.notiz { border-left: 3px solid var(--warn); background: var(--warn-hell); }
.nachricht.notiz .nachricht-kopf { background: transparent; }
.anhaenge { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 .9rem .75rem; }
.anhaenge a { font-size: .85rem; border: 1px solid var(--rand); border-radius: 6px; padding: .15rem .5rem; background: var(--flaeche-2); }
.verlauf { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.verlauf li { padding: .3rem 0; border-bottom: 1px dashed var(--rand); color: var(--text-2); }

.eigenschaften { display: grid; grid-template-columns: auto 1fr; gap: .4rem .9rem; font-size: .92rem; margin: 0; }
.eigenschaften dt { color: var(--text-2); }
.eigenschaften dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Board ---------- */
.board {
  display: flex;
  gap: .9rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  align-items: flex-start;
}
.spalte {
  flex: 0 0 280px;
  background: var(--neutral-hell);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 190px);
}
.spalte-kopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem .75rem;
  font-weight: 600;
  font-size: .9rem;
}
.spalte-kopf .zahl { font-weight: 400; color: var(--text-2); }
.spalte.ueber-limit .spalte-kopf .zahl { color: var(--schlecht); font-weight: 700; }
.spalte-karten { padding: 0 .5rem .5rem; overflow-y: auto; min-height: 60px; flex: 1; }
.spalte-karten.ziel { outline: 2px dashed var(--primaer); outline-offset: -4px; border-radius: var(--radius); }
.kartchen {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 6px;
  padding: .55rem .65rem;
  margin-bottom: .5rem;
  cursor: grab;
  box-shadow: var(--schatten);
}
.kartchen:hover { border-color: var(--primaer); }
.kartchen.zieht { opacity: .45; }
.kartchen-titel { font-size: .92rem; margin: .25rem 0 .4rem; color: var(--text); display: block; }
.kartchen-fuss { display: flex; justify-content: space-between; align-items: center; gap: .4rem; font-size: .78rem; color: var(--text-2); }
.einfuegemarke { height: 3px; background: var(--primaer); border-radius: 2px; margin: -2px 0 .35rem; }
.kuerzel {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primaer-hell); color: var(--primaer); font-weight: 700; font-size: .7rem;
}

/* ---------- Anmeldung ---------- */
.anmelde-huelle { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.anmelde-karte { width: 100%; max-width: 420px; }
.anmelde-karte .marke-logo { display: block; font-size: 1.5rem; margin-bottom: .25rem; }
.trenner { display: flex; align-items: center; gap: .75rem; color: var(--text-2); font-size: .85rem; margin: 1.25rem 0; }
.trenner::before, .trenner::after { content: ""; flex: 1; border-top: 1px solid var(--rand); }
.breit-knopf { width: 100%; margin-top: .5rem; }
.sprachwahl { display: flex; justify-content: flex-end; gap: .5rem; margin-bottom: .5rem; }
.qr { display: block; width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 6px; margin: .5rem 0; }

/* ---------- Meldungen ---------- */
.meldung { border-radius: 6px; padding: .6rem .85rem; margin: .75rem 0; font-size: .92rem; }
.meldung.fehler { background: var(--schlecht-hell); color: var(--schlecht); }
.meldung.erfolg { background: var(--gut-hell); color: var(--gut); }
.meldung.info { background: var(--primaer-hell); color: var(--primaer); }
.toast-bereich { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 100; }
.toast { background: var(--text); color: var(--flaeche); padding: .6rem 1rem; border-radius: 6px; box-shadow: var(--schatten); max-width: 380px; }
.toast.fehler { background: var(--schlecht); color: #fff; }

/* ---------- Dialog ---------- */
dialog {
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  width: min(560px, 94vw);
  background: var(--flaeche);
  color: var(--text);
}
dialog::backdrop { background: rgba(10, 15, 25, .45); }
dialog h2 { margin-top: 0; }

.reiter { display: flex; gap: .25rem; border-bottom: 1px solid var(--rand); margin-bottom: 1rem; flex-wrap: wrap; }
.reiter button { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-2); border-radius: 0; padding: .5rem .8rem; }
.reiter button.aktiv { color: var(--primaer); border-bottom-color: var(--primaer); }
.reiter button:hover { background: var(--neutral-hell); }

.spaltenliste .spaltenzeile { display: grid; grid-template-columns: 1fr 1fr 150px 90px minmax(200px, auto) auto; gap: .5rem; align-items: center; margin-bottom: .5rem; }
@media (max-width: 700px) { .spaltenliste .spaltenzeile { grid-template-columns: 1fr 1fr; } }

/* ---------- Ergaenzungen ---------- */
.schnellfilter { margin-bottom: 1rem; }
.schnellfilter .karte { margin: 0; justify-content: flex-start; gap: .75rem; text-align: left; font-weight: 400; color: var(--text); }
.schnellfilter .karte:hover { border-color: var(--primaer); background: var(--primaer-hell); }
form.notiz textarea { background: var(--warn-hell); }
textarea.gross { min-height: 220px; }
a.karte { display: block; color: var(--text); }
a.karte:hover { text-decoration: none; border-color: var(--primaer); }

/* ---------- Stufe 2: Versionen, Downloads, Wuensche ---------- */
.abstand-oben { margin-top: 1rem; }
.klein-zahl { font-size: 1.2rem; }
.warnung { color: var(--warn); font-weight: 600; }
.versionseintrag { border-bottom: 1px solid var(--rand); padding: .6rem 0; }
.versionseintrag:last-child { border-bottom: none; }
.versionseintrag summary { cursor: pointer; padding: .2rem 0; }
.release-notes { background: var(--flaeche-2); border-radius: 6px; padding: .6rem .8rem; margin: .5rem 0; font-size: .92rem; }
.dateiliste { list-style: none; padding: 0; margin: .5rem 0 0; }
.dateiliste li { margin-bottom: .6rem; }
.pruefsumme { overflow-wrap: anywhere; margin-top: .15rem; }
.codeblock { background: var(--flaeche-2); border: 1px solid var(--rand); border-radius: 6px; padding: .6rem .8rem; font-size: .8rem; overflow-x: auto; white-space: pre; }
progress { width: 100%; height: 10px; margin-top: .75rem; }
.wunsch { display: flex; gap: 1rem; align-items: flex-start; }
.wunsch-inhalt { flex: 1; min-width: 0; }
.wunsch-inhalt h3 { margin-bottom: .2rem; }
.stimmknopf {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 64px; padding: .4rem .5rem; border-radius: 8px;
  background: var(--flaeche-2); color: var(--text); border: 1px solid var(--rand); font-weight: 600;
}
button.stimmknopf:hover { background: var(--primaer-hell); border-color: var(--primaer); }
.stimmknopf.aktiv { background: var(--primaer); color: #fff; border-color: var(--primaer); }
.stimmknopf .zahl { font-size: 1.2rem; }
.inline-form { margin: 0; }
.inline-form input { min-width: 110px; width: 110px; }
@media (max-width: 1150px) {
  .marke-logo small { display: none; }
  .navigation a { padding: .4rem .45rem; }
  .kopf-innen { gap: .75rem; }
}
button.umbrechbar { white-space: normal; text-align: right; }
td.aktionsspalte { min-width: 110px; }

/* ---------- Stufe 3: Vertraege, Lizenzen, Zeiten, Rechnungen ---------- */
.lizenz { border: 1px solid var(--rand); border-radius: var(--radius); padding: .6rem .8rem; margin-bottom: .6rem; background: var(--flaeche-2); }
.lizenz .mono { overflow-wrap: anywhere; }
.vertragseintrag { border-bottom: 1px solid var(--rand); padding-bottom: .8rem; margin-bottom: .8rem; }
.vertragseintrag:last-child { border-bottom: none; }
.vertragseintrag h3 { margin: 0; }
table.positionen input, table.positionen select { min-width: 70px; padding: .3rem .4rem; }
input.kurz { width: 90px; }
.zeitformular { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.zeitformular input, .zeitformular select { width: auto; flex: 1 1 110px; padding: .35rem .5rem; }
.zeitformular .zeit-dauer { flex: 0 0 90px; }
.budget { display: inline-flex; align-items: center; gap: .3rem; }
.budgetbalken { display: inline-block; width: 90px; height: 8px; border-radius: 4px; background: var(--neutral-hell); overflow: hidden; vertical-align: middle; }
.budgetbalken .fuellung { display: block; height: 100%; width: 0; background: var(--gut); }
.budgetbalken.warn .fuellung { background: var(--warn); }
.budgetbalken.voll .fuellung { background: var(--schlecht); }
tfoot td { border-bottom: none; }

/* Stufe 4: Eingangskorb, KI-Assistent, Integrationen */
.fehlertext { color: var(--schlecht); }
.karte.eingang .titelzeile h3 { margin: 0; }
.karte.eingang .nachricht-text { margin: .5rem 0; max-height: 24rem; overflow: auto; }
ul.aehnliche { list-style: none; margin: 0; padding: 0; }
ul.aehnliche li { padding: .35rem 0; border-bottom: 1px solid var(--rand); }
ul.aehnliche li:last-child { border-bottom: 0; }
.navigation .zaehler, .unternavigation .zaehler { display: inline-block; min-width: 1.2rem; margin-left: .3rem; padding: 0 .35rem; border-radius: 999px;
  background: var(--schlecht); color: #fff; font-size: .72rem; line-height: 1.2rem; text-align: center; }
#zKunde { width: 100%; margin-top: .4rem; }

/* ---------- Paket A: Navigation in Bereichen, Ticketalltag ---------- */
.unternavigation { border-top: 1px solid var(--rand); background: var(--flaeche-2); }
.unternavigation .kopf-innen { height: 40px; gap: .25rem; }
.unternavigation a { color: var(--text-2); padding: .3rem .7rem; border-radius: 6px; font-size: .92rem; white-space: nowrap; }
.unternavigation a:hover { background: var(--neutral-hell); text-decoration: none; color: var(--text); }
.unternavigation a.aktiv { background: var(--flaeche); color: var(--primaer); font-weight: 600; box-shadow: inset 0 -2px 0 var(--primaer); }
.schnellfilter.raster-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .schnellfilter.raster-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .schnellfilter.raster-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.schnellfilter .karte.hervor .kennzahl { color: var(--primaer); }
a.karte { display: flex; align-items: center; text-decoration: none; }
.ticketkopf { display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: center; margin: -.5rem 0 1rem; color: var(--text-2); }
.ticketkopf a.fett { color: var(--text); }
.titelzeile .rechts { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.speicherhinweis { color: var(--gut); font-size: .8rem; min-height: 1.1rem; }
button.entfernen { padding: 0 .35rem; line-height: 1.2; color: var(--text-2); background: none; border: 1px solid transparent; }
button.entfernen:hover { color: var(--schlecht); border-color: var(--rand); }
#nKundeSuche { margin-bottom: .35rem; }

/* ---------- Paket B/C ---------- */
.meldung.warnung { background: var(--warn-hell); color: var(--warn); }
.kundennotiz { white-space: pre-wrap; background: var(--flaeche-2); border-left: 3px solid var(--warn); padding: .4rem .6rem; margin: .5rem 0; }
#kontext .meldung { margin: 0 0 .5rem; }
#kontext dl.eigenschaften { margin: .5rem 0 0; }
.antwortwerkzeuge { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.antwortwerkzeuge select { width: auto; max-width: 100%; }
.spalte-fuss { display: block; padding: .4rem .6rem; text-align: center; }
.sammelleiste { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .6rem .85rem; margin-bottom: .75rem; }
.sammelleiste select { width: auto; }
td.wahl, th.wahl { width: 2rem; }
.kunde-reiter { margin-bottom: 1rem; }
.reiter-aus { display: none !important; }

/* ---------- Paket D: Handy und Tablet ---------- */
.menueknopf { display: none; font-size: 1.15rem; line-height: 1; padding: .35rem .6rem; }
.navigation .nur-mobil { display: none; }
a.karte { flex-direction: column; align-items: flex-start; }
.schnellfilter a.karte { flex-direction: row; align-items: center; }
details.hilfe { margin: -.25rem 0 1rem; font-size: .9rem; color: var(--text-2); }
details.hilfe summary { cursor: pointer; color: var(--primaer); }
details.hilfe p { margin: .4rem 0; }
@media (max-width: 900px) {
  .kopf-innen { gap: .5rem; padding: 0 .75rem; }
  .marke-logo small { display: none; }
  .kopf-rechts { order: 2; margin-left: auto; gap: .4rem; }
  .kopf-rechts .konto-link { display: none; }
  .menueknopf { display: inline-flex; order: 3; }
  .kopf .navigation { display: none; }
  .kopf.menue-offen .navigation {
    display: flex; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; z-index: 30;
    background: var(--flaeche); border-bottom: 1px solid var(--rand); box-shadow: var(--schatten);
    padding: .5rem .75rem; gap: .1rem; overflow: visible;
  }
  .kopf.menue-offen .navigation a { padding: .7rem .8rem; }
  .kopf.menue-offen .navigation .nur-mobil { display: block; border-top: 1px solid var(--rand); margin-top: .25rem; }
  .unternavigation .kopf-innen { overflow-x: auto; }
}
/* Tabellen als Karten auf schmalen Bildschirmen */
@media (max-width: 700px) {
  .karten-mobil table, .karten-mobil tbody, .karten-mobil tr, .karten-mobil td { display: block; width: 100%; }
  .karten-mobil thead { display: none; }
  .karten-mobil tr { border-bottom: 1px solid var(--rand); padding: .55rem 0; }
  .karten-mobil tr:last-child { border-bottom: 0; }
  .karten-mobil td { border: 0; padding: .1rem 0; text-align: left; }
  .karten-mobil td.mono, .karten-mobil td.wahl { display: inline-block; width: auto; margin-right: .5rem; }
  .karten-mobil td.betreffzelle { display: inline; }
  .karten-mobil td.betreffzelle a { font-weight: 600; }
  .karten-mobil td[data-label] { font-size: .88rem; }
  .karten-mobil td[data-label]::before { content: attr(data-label) ": "; color: var(--text-2); }
  .karten-mobil td[data-label]:empty { display: none; }
  .karten-mobil td.leer { text-align: center; }
}
.schnellfilter .karte { white-space: normal; min-width: 0; }
dialog.breit { width: min(1000px, 96vw); }
.inhalt .feldzeile { max-width: 1100px; }

/* ---------- HTML-Mails ---------- */
.mailinhalt { margin: .25rem 0; }
.mailwerkzeuge { display: flex; gap: .75rem; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-bottom: .25rem; }
iframe.mailrahmen { display: block; width: 100%; height: 160px; border: 0; background: #fff; border-radius: 4px; }

/* ---------- Antwortfeld mit eingefuegten Bildern ---------- */
.editor {
  min-height: 140px; max-height: 60vh; overflow-y: auto; padding: .55rem .7rem; white-space: pre-wrap; overflow-wrap: anywhere;
  border: 1px solid var(--rand); border-radius: 6px; background: var(--flaeche); color: var(--text); font: inherit; line-height: 1.45;
}
.editor:focus { outline: 2px solid var(--primaer); outline-offset: 1px; }
.editor.leer { padding: .55rem .7rem; text-align: left; color: var(--text); }
.editor.leer::before { content: attr(data-platzhalter); color: var(--text-2); pointer-events: none; }
.formatiert { overflow-wrap: anywhere; }
.formatiert ul, .formatiert ol { margin: .3rem 0 .3rem 1.4rem; padding: 0; white-space: normal; }
.formatiert img.editor-bild, .editor img.editor-bild { display: block; max-width: min(100%, 720px); height: auto; margin: .4rem 0; border: 1px solid var(--rand); border-radius: 4px; }
form.notiz .editor { background: var(--warn-hell); }
.editor-hinweis { margin: .25rem 0 .5rem; }
/* Leiste ueber dem Feld: Fett, Aufzaehlung, Nummerierung, Link */
.editor-leiste { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .25rem; }
.editor-leiste button { min-width: 2rem; }
.editor-leiste button[aria-pressed="true"] { background: var(--primaer-hell); border-color: var(--primaer); color: var(--primaer); }
.editor ul, .editor ol { margin: .25rem 0; padding-left: 1.6rem; white-space: normal; }
.editor li { white-space: pre-wrap; }
.editor a { color: var(--primaer); text-decoration: underline; }
.nachricht.notiz iframe.mailrahmen { background: transparent; }

/* Arbeitskorb: Ansichten links mit Zaehlern, Liste rechts */
.arbeitskorb { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.ansichten { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .1rem; }
.ansichten h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-2); margin: .9rem 0 .2rem .6rem; }
.ansichten button, .ansichten a {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem; width: 100%;
  background: none; border: 0; border-radius: 6px; padding: .4rem .6rem;
  color: var(--text); font-weight: 400; font-size: .95rem; text-align: left; white-space: nowrap;
}
.ansichten button:hover, .ansichten a:hover { background: var(--neutral-hell); text-decoration: none; }
.ansichten button.aktiv { background: var(--primaer-hell); color: var(--primaer); font-weight: 600; }
.ansichten .zahl { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--text-2); }
.ansichten button.hervor .zahl { color: var(--primaer); font-weight: 700; }
@media (max-width: 1000px) {
  .arbeitskorb { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .ansichten { position: static; flex-direction: row; flex-wrap: wrap; gap: .25rem; }
  .ansichten h2 { display: none; }
  .ansichten button, .ansichten a { width: auto; border: 1px solid var(--rand); background: var(--flaeche); }
}
.marke.l-kundenantwort { background: var(--primaer); color: var(--flaeche); }
.marke.l-neu { background: var(--primaer-hell); color: var(--primaer); }
.marke.l-in_arbeit { background: var(--primaer-hell); color: var(--primaer); }
.marke.l-rueckmeldung { background: var(--gut-hell); color: var(--gut); }
.marke.l-entwicklung { background: var(--lila-hell); color: var(--lila); }
.marke.l-warten_auf_kunde { background: var(--warn-hell); color: var(--warn); }
td.auffaellig { color: var(--schlecht); font-weight: 600; white-space: nowrap; }
details.mehr summary { cursor: pointer; font-weight: 600; padding: .2rem 0; }
form details.mehr { margin-top: .75rem; }
.arbeitskorb td.klein, .arbeitskorb td a.mono { white-space: nowrap; }

/* Katalog: Preise je Vertragsart als Abschnitte einer Seite */
.preisart { padding: 1rem 0; border-top: 1px solid var(--rand); }
.preisart:first-child { border-top: 0; padding-top: .25rem; }
.preisart .titelzeile { margin-bottom: .5rem; justify-content: flex-start; align-items: baseline; }
.preisart .titelzeile h3 { margin: 0; }
.preisart .knopfzeile { margin-top: .5rem; }
.preise-fuss { position: sticky; bottom: 0; background: var(--flaeche); padding: .75rem 0; border-top: 1px solid var(--rand); }
span.auffaellig { color: var(--schlecht); font-weight: 600; }

/* Vorgaenge: Umschalter Liste | Board | Sprints als Verweise, Kundenbezug, Sammelantwort */
.reiter a { border-bottom: 2px solid transparent; color: var(--text-2); padding: .5rem .8rem; font-weight: 600; }
.reiter a.aktiv { color: var(--primaer); border-bottom-color: var(--primaer); }
.reiter a:hover { background: var(--neutral-hell); text-decoration: none; }
.kundenbezug { color: var(--lila); font-weight: 600; white-space: nowrap; }
fieldset.empfaenger { border: 1px solid var(--rand); border-radius: var(--radius); margin: 0 0 .75rem; padding: .5rem .75rem; max-height: 14rem; overflow: auto; }
fieldset.empfaenger legend { font-size: .85rem; color: var(--text-2); padding: 0 .3rem; }
fieldset.empfaenger label { display: flex; margin: .2rem 0; }

/* Kundenakte: Uebersicht */
#uebersichtBereich .karte { margin: 0; }
#uebersichtBereich .karte h3 { margin-top: 0; }
#uebersichtBereich .titelzeile { margin-bottom: .5rem; }
#uebersichtBereich .meldung { margin: 0 0 .5rem; }
details.mehr > form, details.mehr > dl { margin-top: .5rem; }
#uebersichtBereich .raster { align-items: start; }

/* Einstellungen: linke Navigation mit Suche, kurze Karten je Thema */
.einst-nav input[type="search"] { margin-bottom: .5rem; }
.einst-nav .hinweis { margin: 1rem .6rem 0; }
.einst-inhalt .karte h2 { margin-top: 0; font-size: 1.1rem; }
.einst-inhalt .karte .titelzeile { margin-bottom: .5rem; }
.einst-inhalt .karte .titelzeile h2 { margin: 0; }
.karte.treffer { outline: 2px solid var(--primaer); outline-offset: 2px; }
#einstTreffer button { white-space: normal; }
@media (max-width: 1000px) { .einst-nav input[type="search"] { flex-basis: 100%; } }

/* Arbeitskorb: Vorschau des gewaehlten Tickets neben der Liste */
.arbeitskorb.mit-vorschau { grid-template-columns: 200px minmax(0, 1fr) minmax(480px, 46%); }
.arbeitskorb.mit-vorschau .sp-weit { display: none; }
.vorschau { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; margin: 0; }
.vorschau h2 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.vorschau .titelzeile { align-items: flex-start; flex-wrap: nowrap; margin-bottom: .5rem; }
.vorschau .titelzeile .rechts { flex-wrap: nowrap; flex-shrink: 0; }
.vorschau .ticketkopf { margin: 0 0 .75rem; }
.vorschau .filterzeile { margin-bottom: .75rem; }
.vorschau .filterzeile select { min-width: 0; }
.vorschau .meldung { margin: 0 0 .75rem; }
.vorschau-vorgaenge { margin-bottom: .75rem; }
tr.gewaehlt td { background: var(--primaer-hell); }

/* Einstellungen: Einrichtungsliste */
.einrichtung { border-left: 3px solid var(--primaer); }
.einrichtung-liste { list-style: none; margin: 0; padding: 0; }
.einrichtung-liste li { padding: .3rem 0; }
.einrichtung-liste .haken { display: inline-block; width: 1.4rem; color: var(--text-2); }
.einrichtung-liste li.erledigt { color: var(--text-2); }
.einrichtung-liste li.erledigt .haken { color: var(--gut); font-weight: 700; }

/* Arbeitskorb: sortierbare Spaltenkoepfe, Blaettern, eigene Ansichten */
th[data-sort], th.sortierbar { cursor: pointer; user-select: none; white-space: nowrap; }
th[data-sort]:hover, th[data-sort]:focus-visible, th.sortierbar:hover, th.sortierbar:focus-visible { color: var(--primaer); }
thead th[aria-sort="ascending"]::after { content: " ▲"; color: var(--primaer); }
thead th[aria-sort="descending"]::after { content: " ▼"; color: var(--primaer); }
thead th[aria-sort] { color: var(--primaer); }
.blaettern { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .75rem .25rem 0; }
.ansichten .ansicht-weg { visibility: hidden; padding: 0 .3rem; border-radius: 4px; color: var(--text-2); }
.ansichten button.eigene:hover .ansicht-weg, .ansichten button.eigene:focus-within .ansicht-weg { visibility: visible; }
.ansichten .ansicht-weg:hover { color: var(--schlecht); background: var(--flaeche); }
.ansichten button.ansicht-speichern { color: var(--primaer); font-size: .88rem; }
.ansichten #eigeneAnsichten .hinweis { margin: 0 .6rem .2rem; }
@media (max-width: 1000px) { .ansichten #eigeneAnsichten { display: contents; } .ansichten #eigeneAnsichten .hinweis { display: none; } .ansichten .ansicht-weg { visibility: visible; } }

/* Vorschau mit voller Bearbeitung: die Ticketseite im Rahmen */
.vorschau { padding: .5rem .5rem 0; overflow: hidden; }
.vorschau .vorschau-kopf { margin: 0 .25rem .4rem; align-items: center; }
.ticketrahmen { display: block; width: 100%; height: calc(100vh - 6rem); border: 0; background: var(--hintergrund); border-radius: 6px; }

/* Ticketseite eingebettet (?eingebettet=1): ohne Kopf, einspaltig, erst Verlauf und Antwort, dann die Bearbeitung */
body.eingebettet .kopf, body.eingebettet .inhalt > p:first-child { display: none; }
body.eingebettet .inhalt { padding: .75rem .75rem 2rem; }
body.eingebettet h1 { font-size: 1.15rem; }
body.eingebettet .titelzeile { margin-bottom: .5rem; }
body.eingebettet .ticketkopf { margin-top: 0; }
body.eingebettet .ticket-arbeit { grid-template-columns: minmax(0, 1fr); }
body.eingebettet .ticket-seite { position: static; max-height: none; overflow: visible; }

/* Schmale Bildschirme: Einstellungs-Navigation als Knopfreihe, Sortierwahl statt Spaltenkoepfen */
@media (max-width: 1000px) {
  .einst-nav #einstGruppen, .einst-nav #einstTreffer { display: contents; }
  .einst-nav #einstGruppen.versteckt, .einst-nav #einstTreffer.versteckt { display: none; }
  .einst-nav .hinweis { flex-basis: 100%; margin: .25rem 0 0; }
  .einst-nav .hinweis a { display: inline; width: auto; border: 0; padding: 0; background: none; color: var(--primaer); }
}
#sortWahl { display: none; }
@media (max-width: 700px) { #sortWahl { display: block; } }
/* Rasterkinder duerfen schmaler werden als ihr Inhalt, sonst schieben breite Tabellen die Seite ueber den Bildschirm */
.raster > *, .arbeitskorb > * { min-width: 0; }
#doStandard, .einst-inhalt .hinweis, .einst-inhalt td.mono { overflow-wrap: anywhere; }

/* Kundenportal: Sprungmarken auf langen Seiten */
.sprungmarken { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: -.25rem 0 1rem; font-size: .92rem; }
.sprungmarken span { display: contents; }

/* Kundenportal: Kachel "warten auf Ihre Antwort" faellt nur auf, wenn etwas zu tun ist */
a.karte.achtung { border-color: var(--warn); background: var(--warn-hell); }
a.karte.achtung .kennzahl { color: var(--warn); }

/* Korrekturvorschlag der KI: Diff mit gefaerbten Zeilen */
pre.diff { background: var(--flaeche-2); border: 1px solid var(--rand); border-radius: 6px; padding: .4rem 0; margin: .4rem 0 .8rem; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .8rem; overflow-x: auto; }
pre.diff span { display: block; white-space: pre; padding: 0 .7rem; min-width: max-content; }
pre.diff .diff-plus { background: var(--gut-hell); color: var(--gut); }
pre.diff .diff-minus { background: var(--schlecht-hell); color: var(--schlecht); }
pre.diff .diff-kopf { color: var(--text-2); }
/* Korrekturvorschlag: je Aenderung die Stelle (Objekt > Block) und die Gegenueberstellung "Bisher | Neu" */
.aenderung { border: 1px solid var(--rand); border-radius: 8px; padding: .75rem .9rem; margin: .9rem 0; }
.aenderung-kopf { display: grid; gap: .25rem; margin-bottom: .5rem; }
.stelle-pfad { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .5rem; font-size: 1.02rem; }
.stelle-art { color: var(--text-2); font-size: .8rem; }
.stelle-pfeil { color: var(--text-2); }
.vergleich-rahmen { border: 1px solid var(--rand); border-radius: 6px; overflow: hidden; margin: .5rem 0; }
table.vergleich { width: 100%; table-layout: fixed; border-collapse: collapse; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .78rem; line-height: 1.45; }
table.vergleich col.vgl-spalte-nr { width: 3.4rem; }
table.vergleich th { text-align: left; font-family: inherit; font-weight: 600; padding: .3rem .6rem; background: var(--flaeche-2); border-bottom: 1px solid var(--rand); color: var(--text-2); }
table.vergleich th + th, table.vergleich td:nth-child(3) { border-left: 1px solid var(--rand); }
table.vergleich td { padding: 0 .5rem; vertical-align: top; border: 0; }
table.vergleich .vgl-nr { text-align: right; color: var(--text-2); user-select: none; font-variant-numeric: tabular-nums; }
table.vergleich .vgl-code { white-space: pre-wrap; overflow-wrap: anywhere; }
table.vergleich .vgl-minus { background: var(--schlecht-hell); }
table.vergleich .vgl-plus { background: var(--gut-hell); }
table.vergleich .vgl-leer { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--flaeche-2) 6px 12px); }
table.vergleich mark { color: inherit; border-radius: 2px; padding: 0 1px; }
table.vergleich .vgl-minus mark { background: color-mix(in srgb, var(--schlecht) 30%, transparent); }
table.vergleich .vgl-plus mark { background: color-mix(in srgb, var(--gut) 32%, transparent); }
@media (max-width: 700px) { table.vergleich { font-size: .7rem; } table.vergleich col.vgl-spalte-nr { width: 2.6rem; } }
.ticketbezug + .ticketbezug { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--rand); }
.rueckweg { margin: 0 0 .5rem; }
.pflichtstern { color: var(--schlecht); font-weight: 700; }
/* Board: Bearbeiter auf der Karte, freie Vorgaenge, Sicht je Person */
.bearbeiter { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.bearbeiter-name { max-width: 6.5rem; overflow: hidden; text-overflow: ellipsis; }
.marke.frei { background: var(--warn-hell); color: var(--warn); }
.spalte-frei { outline: 1px dashed var(--warn); outline-offset: -1px; }

/* Ticketseite: Bearbeitungsleiste unter dem Betreff, links das Gespraech, rechts Analyse und Kontext in Reitern */
.bearbeitungsleiste { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: flex-end; padding: .7rem 1rem; margin-bottom: 1rem; }
.bearbeitungsleiste > div { flex: 1 1 140px; max-width: 230px; min-width: 0; }
.bearbeitungsleiste > .leiste-voll { flex-basis: 100%; max-width: none; }
.bearbeitungsleiste label { font-size: .76rem; font-weight: 400; color: var(--text-2); margin: 0 0 .15rem; }
.bearbeitungsleiste select, .bearbeitungsleiste input { width: 100%; max-width: none; }
.bearbeitungsleiste #eBetreff { max-width: none; font-weight: 600; }
.bearbeitungsleiste .leiste-wv { display: flex; gap: .4rem; align-items: center; }
.bearbeitungsleiste > .speicherhinweis { flex: 0 0 auto; max-width: none; align-self: center; min-height: 0; }
.feldmarken { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding-top: .5rem; border-top: 1px solid var(--rand); }
.ticket-arbeit { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.ticket-seite { position: sticky; top: .75rem; max-height: calc(100vh - 1.5rem); overflow-y: auto; }
.ticket-seite .reiter { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 0 .4rem; margin-bottom: .75rem; }
.ticket-seite .reiter button { padding: .55rem .7rem; }
@media (max-width: 1100px) {
  .ticket-arbeit { grid-template-columns: minmax(0, 1fr); }
  .ticket-seite { position: static; max-height: none; overflow: visible; }
}

/* Korrekturvorschlag: Gegenpruefung und Syntaxpruefung als abgesetzte Bloecke */
.gegenpruefung { border-left: 3px solid var(--rand); padding: .1rem 0 .1rem .75rem; margin: .75rem 0; }
.gegenpruefung p, .gegenpruefung ul { margin: .35rem 0; }

/* KI-Agent und SAP (intern/agent-sap.html) */
.marke.m-fehler { background: var(--schlecht-hell); color: var(--schlecht); }
fieldset.gruppe { border: 1px solid var(--rand); border-radius: var(--radius); margin: .5rem 0; padding: .25rem .75rem; }
fieldset.gruppe legend { font-size: .85rem; color: var(--text-2); padding: 0 .3rem; }
.stand-liste { margin: 0; padding-left: 1rem; }
.protokoll-text { max-height: 16rem; overflow: auto; white-space: pre-wrap; font-size: .8rem; }
