/* ═══ bastix1-Baukasten ═══════════════════════════════════════════
   Gemeinsame Grundlage aller bastix1-Unterseiten.
   Farben nach den Adernpaaren eines Netzwerkkabels (T568B),
   AP-Trainer nach der LWL-Mantelfarbe OM4.
   ════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-600.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans Condensed";
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-condensed-600.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-500.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* Flächen und Text – helles Thema */
  --bx-bg:       #f3f4f1;
  --bx-surface:  #ffffff;
  --bx-sunken:   #e9ebe7;
  --bx-line:     #d5d9d3;
  --bx-line-2:   #b9c0b9;
  --bx-text:     #18212b;
  --bx-muted:    #55626f;

  /* Adernpaare */
  --bx-blau:     #1f66c9;
  --bx-orange:   #c9630a;
  --bx-gruen:    #1f8a52;
  --bx-braun:    #8a5a36;
  --bx-violett:  #7446b8;

  /* Zustände */
  --bx-ok:       #1f8a52;
  --bx-warn:     #a86a00;
  --bx-bad:      #c2372e;

  /* Akzent der jeweiligen Seite – pro Seite überschreiben */
  --bx-accent:      var(--bx-blau);
  --bx-accent-ink:  #ffffff;
  --bx-accent-soft: color-mix(in srgb, var(--bx-accent) 12%, var(--bx-surface));

  --bx-sans:  "IBM Plex Sans", system-ui, "Segoe UI", Roboto, sans-serif;
  --bx-head:  "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, "Segoe UI", sans-serif;
  --bx-mono:  "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --bx-r-s:   4px;   /* Knöpfe, Felder, Chips */
  --bx-r-m:   8px;   /* Kästen */
  --bx-bar-h: 56px;
  --bx-shadow: 0 1px 2px rgba(24, 33, 43, 0.06), 0 6px 20px rgba(24, 33, 43, 0.06);
}

/* Dunkles Thema: Systemvorgabe … */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bx-bg:       #12171d;
    --bx-surface:  #1a2129;
    --bx-sunken:   #0d1116;
    --bx-line:     #2b3540;
    --bx-line-2:   #3d4a58;
    --bx-text:     #e7ecf0;
    --bx-muted:    #9daab7;
    --bx-blau:     #5b9cf0;
    --bx-orange:   #f0953f;
    --bx-gruen:    #4cc088;
    --bx-braun:    #c79468;
    --bx-violett:  #a986e6;
    --bx-ok:       #4cc088;
    --bx-warn:     #e2b04a;
    --bx-bad:      #f07068;
    --bx-accent-ink: #0d1116;
    --bx-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}
/* … oder per Schalter erzwungen */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bx-bg:       #12171d;
  --bx-surface:  #1a2129;
  --bx-sunken:   #0d1116;
  --bx-line:     #2b3540;
  --bx-line-2:   #3d4a58;
  --bx-text:     #e7ecf0;
  --bx-muted:    #9daab7;
  --bx-blau:     #5b9cf0;
  --bx-orange:   #f0953f;
  --bx-gruen:    #4cc088;
  --bx-braun:    #c79468;
  --bx-violett:  #a986e6;
  --bx-ok:       #4cc088;
  --bx-warn:     #e2b04a;
  --bx-bad:      #f07068;
  --bx-accent-ink: #0d1116;
  --bx-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bx-bar-h) + 16px);
}

body {
  margin: 0;
  background: var(--bx-bg);
  color: var(--bx-text);
  font-family: var(--bx-sans);
  font-size: 1rem;
  line-height: 1.6;
}

h1,
h2,
h3,
h4 {
  font-family: var(--bx-head);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0;
  text-wrap: balance;
}

code,
kbd,
pre,
samp {
  font-family: var(--bx-mono);
  font-size: 0.92em;
}

a {
  color: var(--bx-accent);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 2px solid var(--bx-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Kopfleiste mit Patchfeld ─────────────────────────────────── */
.bx-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--bx-bar-h);
  padding: 0 20px;
  background: var(--bx-surface);
  border-bottom: 1px solid var(--bx-line);
}

.bx-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: none;
  color: var(--bx-text);
  font-family: var(--bx-head);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.bx-brand small {
  color: var(--bx-muted);
  font-family: var(--bx-sans);
  font-size: 0.8125rem;
  font-weight: 400;
}

/* Das Patchfeld: jede Buchse ist eine bastix1-Seite,
   die Link-LED der aktuellen Seite leuchtet. */
.bx-panel {
  display: flex;
  align-items: stretch;
  gap: 2px;
  margin: 0;
  padding: 3px;
  overflow-x: auto;
  background: var(--bx-sunken);
  border: 1px solid var(--bx-line);
  border-radius: 6px;
  scrollbar-width: none;
}
.bx-panel::-webkit-scrollbar {
  display: none;
}

.bx-port {
  --pair: var(--bx-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 7px;
  border-radius: var(--bx-r-s);
  color: var(--bx-muted);
  font-size: 0.8125rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.bx-port[data-pair="blau"]    { --pair: var(--bx-blau); }
.bx-port[data-pair="orange"]  { --pair: var(--bx-orange); }
.bx-port[data-pair="gruen"]   { --pair: var(--bx-gruen); }
.bx-port[data-pair="braun"]   { --pair: var(--bx-braun); }
.bx-port[data-pair="violett"] { --pair: var(--bx-violett); }

/* Buchse: RJ45-Umriss mit Rastnase unten, LED oben links */
.bx-jack {
  position: relative;
  flex: none;
  width: 18px;
  height: 14px;
  background: var(--bx-surface);
  border: 1.5px solid var(--bx-line-2);
  border-radius: 2px;
}
.bx-jack::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1.5px;
  width: 7px;
  height: 4px;
  transform: translateX(-50%);
  background: var(--bx-sunken);
  border: 1.5px solid var(--bx-line-2);
  border-bottom: 0;
  border-radius: 1px 1px 0 0;
}
.bx-jack::after {
  content: "";
  position: absolute;
  top: 1.5px;
  left: 1.5px;
  width: 4px;
  height: 3px;
  background: var(--bx-line-2);
  border-radius: 1px;
}

.bx-port:hover {
  background: var(--bx-surface);
  color: var(--bx-text);
}
.bx-port:hover .bx-jack::after {
  background: var(--pair);
}
.bx-port[aria-current="page"] {
  background: var(--bx-surface);
  color: var(--bx-text);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--pair);
}
.bx-port[aria-current="page"] .bx-jack {
  border-color: var(--pair);
}
.bx-port[aria-current="page"] .bx-jack::after {
  background: var(--pair);
  box-shadow: 0 0 5px var(--pair);
}

.bx-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: none;
}

/* ─── Bausteine ────────────────────────────────────────────────── */
.bx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  background: var(--bx-surface);
  border: 1px solid var(--bx-line-2);
  border-radius: var(--bx-r-s);
  color: var(--bx-text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.bx-btn:hover {
  border-color: var(--bx-accent);
  color: var(--bx-accent);
}
.bx-btn.is-primary {
  background: var(--bx-accent);
  border-color: var(--bx-accent);
  color: var(--bx-accent-ink);
}
.bx-btn.is-primary:hover {
  background: color-mix(in srgb, var(--bx-accent) 86%, var(--bx-text));
  color: var(--bx-accent-ink);
}
.bx-btn.is-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--bx-muted);
}
.bx-btn.is-icon {
  width: 36px;
  padding: 0;
}

.bx-card {
  background: var(--bx-surface);
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-r-m);
}

.bx-field {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  background: var(--bx-surface);
  border: 1px solid var(--bx-line-2);
  border-radius: var(--bx-r-s);
  color: var(--bx-text);
  font: inherit;
}
.bx-field:focus {
  border-color: var(--bx-accent);
  outline: 2px solid color-mix(in srgb, var(--bx-accent) 35%, transparent);
  outline-offset: 0;
}

/* Etikett wie am Beschriftungsstreifen: nur für echte Kennungen
   (Port, VLAN, Schicht), nicht als Schmuck über Überschriften. */
.bx-tag {
  display: inline-block;
  padding: 1px 7px;
  background: var(--bx-accent-soft);
  border-radius: 3px;
  color: var(--bx-accent);
  font-family: var(--bx-mono);
  font-size: 0.8125rem;
  font-weight: 500;
}

@media (max-width: 860px) {
  .bx-bar {
    gap: 12px;
    padding: 0 12px;
  }
  .bx-brand small {
    display: none;
  }
  .bx-port {
    padding: 5px 8px 5px 6px;
  }
}
@media (max-width: 560px) {
  /* nur die Buchsen, Name der aktuellen Seite bleibt lesbar */
  .bx-port:not([aria-current="page"]) .bx-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .bx-port:not([aria-current="page"]) {
    padding: 8px;
  }
}

/* ═══ AP-Trainer-Portal ═══════════════════════════════════════════
   Anmeldung, Konto anlegen, Übersicht. Oben steht der Baukasten,
   ab hier die Regeln dieser Seiten.
   ════════════════════════════════════════════════════════════════ */

:root {
  --bx-accent: var(--bx-violett);
  --ok-soft:   color-mix(in srgb, var(--bx-ok) 12%, var(--bx-surface));
  --bad-soft:  color-mix(in srgb, var(--bx-bad) 10%, var(--bx-surface));
}

/* hidden muss auch gegen display: flex aus eigenen Klassen gewinnen */
[hidden] {
  display: none !important;
}

body {
  display:        flex;
  flex-direction: column;
  min-height:     100vh;
}

h1,
h2,
h3 {
  margin: 0 0 8px;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.375rem;
}

h3 {
  font-size: 1.125rem;
}

p {
  margin: 0 0 12px;
}

.leise {
  color: var(--bx-muted);
}

input[type="checkbox"] {
  accent-color: var(--bx-accent);
}

.bx-btn:disabled {
  opacity: 0.55;
  cursor:  default;
}

.bx-btn.klein {
  min-height: 30px;
  padding:    3px 10px;
  font-size:  0.8125rem;
}

.bx-btn.gefahr {
  border-color: var(--bx-bad);
  color:        var(--bx-bad);
}

.bx-btn.gefahr:hover {
  background:   var(--bad-soft);
  border-color: var(--bx-bad);
  color:        var(--bx-bad);
}

/* ─── Meldungen: Fehler und Erfolg als eigener Kasten ──────────── */
.meldung {
  margin:    16px 0 0;
  font-size: 0.9375rem;
}

.meldung:empty {
  margin: 0;
}

.meldung.fehler,
.meldung.gut {
  padding:       10px 12px;
  border:        1px solid var(--bx-line-2);
  border-radius: var(--bx-r-s);
  font-weight:   600;
}

.meldung.fehler {
  background:   var(--bad-soft);
  border-color: var(--bx-bad);
  color:        var(--bx-bad);
}

.meldung.gut {
  background:   var(--ok-soft);
  border-color: var(--bx-ok);
  color:        var(--bx-ok);
}

/* ─── Anmeldung und Konto anlegen ──────────────────────────────── */
.mitte {
  display:         flex;
  flex:            1;
  align-items:     center;
  justify-content: center;
  padding:         32px 16px;
}

.anmeldung {
  width:      100%;
  max-width:  26rem;
  padding:    28px;
  box-shadow: var(--bx-shadow);
}

.anmeldung h1 {
  margin-bottom: 4px;
  font-size:     2rem;
}

label {
  display:     block;
  margin:      18px 0 6px;
  font-size:   0.875rem;
  font-weight: 600;
}

.feldhilfe {
  margin:      6px 0 0;
  color:       var(--bx-muted);
  font-size:   0.8125rem;
  line-height: 1.4;
}

.anmeldung .bx-btn {
  width:      100%;
  min-height: 44px;
  margin-top: 24px;
  font-size:  1rem;
}

.konto-hinweis {
  margin-top: 10px;
}

.wechsel {
  margin:      20px 0 0;
  padding-top: 16px;
  border-top:  1px solid var(--bx-line);
  font-size:   0.9375rem;
  text-align:  center;
}

.wechsel a {
  font-weight: 600;
}

/* ─── Übersicht ────────────────────────────────────────────────── */
.seitenkopf {
  background:    var(--bx-surface);
  border-bottom: 1px solid var(--bx-line);
}

.seitenkopf-innen {
  display:         flex;
  flex-wrap:       wrap;
  align-items:     center;
  justify-content: space-between;
  gap:             10px 16px;
  max-width:       68rem;
  margin:          0 auto;
  padding:         14px 20px;
}

.seitentitel {
  display:     flex;
  flex-wrap:   wrap;
  align-items: baseline;
  gap:         4px 12px;
}

.seitentitel h1 {
  margin:    0;
  font-size: 1.5rem;
}

.seitentitel .leise {
  font-size: 0.875rem;
}

.konto-leiste {
  display:     flex;
  flex-wrap:   wrap;
  align-items: center;
  gap:         8px;
}

.wer {
  margin-right:  4px;
  color:         var(--bx-muted);
  font-size:     0.875rem;
  overflow-wrap: anywhere;
}

main.inhalt {
  flex:      1;
  width:     100%;
  max-width: 68rem;
  margin:    0 auto;
  padding:   8px 20px 48px;
}

main.inhalt section {
  margin-top: 32px;
}

main.inhalt section > .leise {
  max-width: 72ch;
}

.stufen-paar {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr));
  gap:                   0 24px;
}

.kacheln {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr));
  gap:                   16px;
}

.kacheln:not(:empty) {
  margin-top: 16px;
}

.kachel {
  display:        flex;
  flex-direction: column;
  padding:        20px;
}

.kachel .beschreibung {
  flex:  1;
  color: var(--bx-muted);
}

.kachel .bx-btn {
  align-self: flex-start;
  min-height: 40px;
  margin-top: 8px;
}

.eckdaten {
  display:               grid;
  grid-template-columns: auto 1fr;
  gap:                   2px 12px;
  margin:                8px 0 0;
  font-size:             0.875rem;
}

.eckdaten dt {
  color: var(--bx-muted);
}

.eckdaten dd {
  margin: 0;
}

.summe-voll {
  display:     inline-block;
  max-width:   100%;
  color:       var(--bx-muted);
  font-size:   0.75rem;
  line-height: 1.35;
  word-break:  break-all;
  cursor:      pointer;
}

.summe-voll:hover {
  color: var(--bx-text);
}

.leiste {
  display:     flex;
  flex-wrap:   wrap;
  align-items: center;
  gap:         10px;
  margin:      8px 0 12px;
}

.filter {
  max-width: 20rem;
}

.haken {
  display:     flex;
  align-items: center;
  gap:         6px;
  margin:      0;
  font-weight: 400;
}

/* ─── Tabellen ─────────────────────────────────────────────────── */
.tabelle-rahmen {
  overflow-x:    auto;
  background:    var(--bx-surface);
  border:        1px solid var(--bx-line);
  border-radius: var(--bx-r-m);
}

table {
  width:           100%;
  border-collapse: collapse;
  font-size:       0.9375rem;
}

th,
td {
  padding:       9px 12px;
  border-bottom: 1px solid var(--bx-line);
  text-align:    left;
  white-space:   nowrap;
}

th {
  background:  var(--bx-sunken);
  color:       var(--bx-muted);
  font-size:   0.8125rem;
  font-weight: 600;
}

td:first-child {
  white-space: normal;
  word-break:  break-all;
}

/* SHA-Spalte darf umbrechen, die übrigen bleiben einzeilig */
td:nth-child(4) {
  min-width:   15rem;
  white-space: normal;
}

tr:last-child td {
  border-bottom: 0;
}

.rechts {
  text-align: right;
}

.aktionen {
  display: flex;
  gap:     6px;
}

/* Rolle und Status eines Kontos */
.marke {
  display:       inline-block;
  padding:       1px 8px;
  border:        1px solid var(--bx-line-2);
  border-radius: 3px;
  color:         var(--bx-muted);
  font-size:     0.8125rem;
}

.marke.admin {
  border-color: var(--bx-accent);
  color:        var(--bx-accent);
}

.marke.gesperrt {
  border-color: var(--bx-bad);
  color:        var(--bx-bad);
}

/* ─── Konto ────────────────────────────────────────────────────── */
.hinweis {
  display:      flex;
  flex-wrap:    wrap;
  align-items:  center;
  gap:          10px;
  margin:       16px 0 12px;
  padding:      16px 20px;
  background:   var(--ok-soft);
  border-color: var(--bx-ok);
}

.hinweis p {
  flex-basis: 100%;
  margin:     0;
}

.passwort {
  padding:       4px 8px;
  background:    var(--bx-surface);
  border:        1px solid var(--bx-line-2);
  border-radius: var(--bx-r-s);
  font-size:     1.0625rem;
  user-select:   all;
}

.pw-form {
  max-width: 26rem;
  padding:   4px 20px 20px;
}

.pw-form .bx-btn {
  min-height: 40px;
  margin-top: 20px;
}

.aufklapp {
  margin-top: 32px;
}

.aufklapp summary {
  color:       var(--bx-muted);
  font-weight: 600;
  cursor:      pointer;
}

.aufklapp[open] summary {
  margin-bottom: 8px;
}

/* Inhaltsliste eines Pakets */
details.inhalt {
  margin:    8px 0 12px;
  font-size: 0.875rem;
}

details.inhalt summary {
  color:  var(--bx-accent);
  cursor: pointer;
}

details.inhalt ul {
  max-height:   260px;
  margin:       6px 0 0;
  padding-left: 18px;
  overflow-y:   auto;
}

details.inhalt li {
  overflow-wrap: anywhere;
}

details.inhalt li.ordner {
  margin-left: -18px;
  font-weight: 600;
  list-style:  none;
}

.fuss {
  padding:    20px 16px 24px;
  color:      var(--bx-muted);
  font-size:  0.875rem;
  text-align: center;
}

.fuss a {
  color: inherit;
}

/* Discord „Trainer IT": Karte statt nacktem Einladungslink */
.dc-karte {
  display:         inline-flex;
  align-items:     center;
  gap:             12px;
  max-width:       100%;
  padding:         10px 12px 10px 10px;
  background:      var(--bx-surface);
  border:          1px solid var(--bx-line);
  border-radius:   var(--bx-r-m);
  box-shadow:      var(--bx-shadow);
  color:           var(--bx-text);
  text-align:      left;
  text-decoration: none;
  transition:      border-color .15s, transform .15s;
}
.fuss .dc-karte {
  color: var(--bx-text);
}
.dc-karte:hover,
.dc-karte:focus-visible {
  border-color: #5865f2;
  transform:    translateY(-1px);
}
.dc-logo {
  width:  44px;
  height: 44px;
  flex:   none;
}
.dc-text {
  display:        flex;
  flex-direction: column;
  gap:            2px;
  min-width:      0;
}
.dc-name {
  font-weight: 600;
  font-size:   1rem;
  line-height: 1.2;
}
.dc-marke {
  margin-left:    4px;
  padding:        1px 6px;
  border-radius:  3px;
  background:     color-mix(in srgb, #5865f2 15%, var(--bx-surface));
  color:          #5865f2;
  font-size:      0.6875rem;
  font-weight:    600;
  vertical-align: 2px;
}
.dc-zeile {
  color:     var(--bx-muted);
  font-size: 0.8125rem;
}
.dc-knopf {
  flex:          none;
  margin-left:   6px;
  padding:       7px 14px;
  border-radius: var(--bx-r-s);
  background:    #5865f2;
  color:         #fff;
  font-size:     0.875rem;
  font-weight:   600;
}
.dc-karte:hover .dc-knopf {
  background: #4752c4;
}
.fuss-zeile {
  margin-top: 10px;
}
@media (max-width: 480px) {
  .dc-zeile {
    display: none;
  }
}

/* ─── Schmal ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .seitenkopf-innen {
    padding: 12px 16px;
  }

  main.inhalt {
    padding: 4px 16px 40px;
  }

  .anmeldung {
    padding: 22px 18px;
  }

  th:nth-child(3),
  td:nth-child(3) {
    display: none;
  }
}

@media (max-width: 480px) {
  .bx-bar {
    gap:     8px;
    padding: 0 10px;
  }

  .mitte {
    align-items: flex-start;
    padding:     20px 12px;
  }
}


/* ---------- Unterlagen (/bfw) ---------- */

.bfw-suche {
  width: 100%;
  max-width: 34rem;
}

.bfw-pfad {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 14px 0 10px;
  font-weight: 600;
}

.bfw-trenner {
  color: var(--bx-muted);
}

.bfw-ordner {
  font-weight: 600;
}

.bfw-ordner::before {
  content: "▸ ";
  color: var(--bx-muted);
}

.bfw-datei {
  overflow-wrap: anywhere;
}

.bfw-ort {
  display: block;
  color: var(--bx-muted);
  font-size: 0.8125rem;
}

.bfw-knopf {
  min-height: 30px;
  padding: 3px 10px;
  font-size: 0.8125rem;
  text-decoration: none;
  white-space: nowrap;
}


/* ---------- Chat auf der Unterlagen-Seite ---------- */

.chat {
  margin:        8px 0 20px;
  padding:       12px 14px;
  background:    var(--bx-surface);
  border:        1px solid var(--bx-line);
  border-radius: var(--bx-r-m);
}

.chat-kopf {
  display:         flex;
  flex-wrap:       wrap;
  align-items:     center;
  justify-content: space-between;
  gap:             6px 16px;
  margin-bottom:   10px;
}

.chat-kopf h2 {
  margin:    0;
  font-size: 1.0625rem;
}

.chat-da {
  display:     flex;
  flex-wrap:   wrap;
  align-items: center;
  gap:         6px;
  font-size:   0.8125rem;
}

.chat-da-titel {
  color: var(--bx-muted);
}

.chat-person {
  display:       inline-flex;
  align-items:   center;
  gap:           6px;
  padding:       2px 9px;
  background:    var(--ok-soft);
  border:        1px solid var(--bx-ok);
  border-radius: 999px;
  font-weight:   600;
}

.chat-person::before {
  content:       "";
  width:         7px;
  height:        7px;
  background:    var(--bx-ok);
  border-radius: 50%;
}

.chat-verlauf {
  display:        flex;
  flex-direction: column;
  gap:            8px;
  height:         16rem;
  padding:        10px;
  overflow-y:     auto;
  background:     var(--bx-sunken);
  border:         1px solid var(--bx-line);
  border-radius:  var(--bx-r-s);
}

.chat-zeile {
  align-self:    flex-start;
  max-width:     min(85%, 40rem);
  padding:       6px 10px;
  background:    var(--bx-surface);
  border:        1px solid var(--bx-line);
  border-radius: var(--bx-r-m);
}

.chat-zeile.ist-ich {
  align-self:   flex-end;
  background:   var(--bx-accent-soft);
  border-color: var(--bx-accent);
}

.chat-wer {
  display:     flex;
  align-items: baseline;
  gap:         8px;
  font-size:   0.8125rem;
}

.chat-name {
  font-weight: 600;
}

.chat-zeit {
  color: var(--bx-muted);
}

.chat-text {
  overflow-wrap: anywhere;
  white-space:   pre-wrap;
}

.chat-leer {
  margin: auto;
}

.chat-form {
  display:    flex;
  gap:        8px;
  margin-top: 10px;
}

.chat-form .bx-field {
  flex:      1;
  min-width: 0;
}
