/* Kerstens Messenger (29.10.2026) – schwebend im Portal, bildschirmfüllend in chat-app.html */
.ms { --ms-ink: #3b3b3b; --ms-muted: #77716a; --ms-line: #e4dfd8; --ms-bg: #f5f2ee; --ms-rot: #d12f39; --ms-ich: #fbe9e6; font-family: inherit; color: var(--ms-ink); }
.ms [hidden] { display: none !important; }
.ms-knopf { position: fixed; right: 16px; bottom: var(--ms-unten, 72px); z-index: 31; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--ms-line); border-radius: 999px; background: #fff; color: var(--ms-ink); font: 600 13px/1 inherit; font-family: inherit; padding: 5px 14px 5px 5px; box-shadow: 0 4px 16px rgba(0,0,0,.18); cursor: pointer; }
.ms-knopf:hover { border-color: var(--ms-ink); }
.ms-ico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #fdecee; border: 1px solid #f3c2c6; font-size: 17px; }
.ms-zahl { background: var(--ms-rot); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 2px 7px; line-height: 1.3; }
.ms-offen .ms-knopf { display: none; }
.ms-panel { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40; width: min(780px, calc(100vw - 32px)); height: min(560px, calc(100vh - 100px));
  display: grid; grid-template-columns: 260px 1fr; background: #fff; border: 1px solid var(--ms-line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.25); overflow: hidden; }
.ms-voll .ms-panel { position: static; width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.ms-liste { display: flex; flex-direction: column; border-right: 1px solid var(--ms-line); background: var(--ms-bg); min-height: 0; }
.ms-kopf { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--ms-line); background: #fff; min-height: 48px; box-sizing: border-box; }
.ms-kopf > b { font-size: 14px; }
.ms-kopf-knoepfe { margin-left: auto; display: flex; gap: 2px; }
.ms-ib { background: none; border: 0; border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 16px; cursor: pointer; color: var(--ms-ink); text-decoration: none; display: inline-flex; align-items: center; }
.ms-ib:hover { background: var(--ms-bg); }
.ms .ms-suche { flex: 0 0 auto; height: auto; min-height: 0; margin: 8px; padding: 8px 10px; border: 1px solid var(--ms-line); border-radius: 8px; font: inherit; font-size: 14px; }
.ms-eintraege { flex: 1; overflow-y: auto; min-height: 0; }
.ms-grp { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ms-muted); padding: 10px 12px 4px; }
.ms-zeile { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; padding: 8px 12px; text-align: left; font: inherit; cursor: pointer; color: inherit; }
.ms-zeile:hover { background: #fff; } .ms-zeile.an { background: #fff; box-shadow: inset 3px 0 0 var(--ms-rot); }
.ms-av { position: relative; flex: 0 0 34px; height: 34px; border-radius: 50%; background: #fff; border: 1px solid var(--ms-line); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.ms-on { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #2e9d55; border: 2px solid #fff; }
.ms-zt { flex: 1; min-width: 0; display: flex; flex-direction: column; } .ms-zt b { font-size: 14px; font-weight: 600; }
.ms-zt small { font-size: 12px; color: var(--ms-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-zeit { font-size: 11px; color: var(--ms-muted); white-space: nowrap; }
.ms-neu { margin: 2px 12px 6px; border: 1px dashed var(--ms-line); background: none; border-radius: 8px; padding: 6px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ms-muted); }
.ms-hinweis { font-size: 11px; color: var(--ms-muted); padding: 8px 12px; margin: 0; border-top: 1px solid var(--ms-line); }
.ms-gespraech { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.ms-gespraech.ms-drop::after { content: 'Foto hier ablegen'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(209,47,57,.08); border: 2px dashed var(--ms-rot); font-weight: 600; pointer-events: none; }
.ms-gname { font-size: 14px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-gname small { font-weight: 400; color: var(--ms-muted); } .ms-onl { color: #2e9d55 !important; }
.ms-zurueck { display: none; font-size: 24px; padding: 0 8px; }
.ms-zu2 { display: none; }
.ms-verlauf { flex: 1; overflow-y: auto; padding: 10px 14px; background: #fcfbf9; min-height: 0; }
.ms-leer { color: var(--ms-muted); font-size: 13px; text-align: center; margin: 24px 8px; }
.ms-tag { text-align: center; font-size: 11px; color: var(--ms-muted); margin: 12px 0 6px; }
.ms-msg { max-width: 78%; margin: 4px 0; padding: 7px 10px 5px; background: #fff; border: 1px solid var(--ms-line); border-radius: 12px 12px 12px 4px; width: fit-content; word-wrap: break-word; overflow-wrap: anywhere; }
.ms-msg.ich { margin-left: auto; background: var(--ms-ich); border-color: #f1cdc7; border-radius: 12px 12px 4px 12px; }
.ms-von { display: block; font-size: 12px; color: #8a5a1f; margin-bottom: 2px; }
.ms-text { font-size: 14px; line-height: 1.4; } .ms-text a { color: inherit; }
.ms-meta { display: block; text-align: right; font-size: 10.5px; color: var(--ms-muted); margin-top: 2px; }
.ms-bild { display: block; border: 0; padding: 0; background: none; cursor: zoom-in; margin: 2px 0 4px; }
.ms-bild img { display: block; max-width: min(260px, 100%); max-height: 260px; width: auto; height: auto; border-radius: 8px; }
.ms-eingabe { display: flex; align-items: flex-end; gap: 4px; padding: 8px; border-top: 1px solid var(--ms-line); background: #fff; flex-wrap: wrap; position: relative; }
.ms .ms-eingabe textarea { flex: 1 1 auto; height: auto; min-height: 38px; margin: 0; min-width: 120px; resize: none; border: 1px solid var(--ms-line); border-radius: 18px; padding: 8px 12px; font: inherit; font-size: 15px; line-height: 1.35; max-height: 140px; box-sizing: border-box; }
.ms-senden { flex: 0 0 38px; height: 38px; border: 0; border-radius: 50%; background: var(--ms-rot); color: #fff; font-size: 17px; cursor: pointer; }
.ms-senden:disabled { opacity: .5; }
.ms-emojis { position: absolute; bottom: 100%; left: 8px; right: 8px; background: #fff; border: 1px solid var(--ms-line); border-radius: 10px; padding: 6px; display: flex; flex-wrap: wrap; gap: 2px; box-shadow: 0 6px 20px rgba(0,0,0,.12); max-height: 180px; overflow-y: auto; }
.ms-emojis button { border: 0; background: none; font-size: 22px; padding: 4px; cursor: pointer; border-radius: 6px; } .ms-emojis button:hover { background: var(--ms-bg); }
.ms-vorschau { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ms-vorschau img { height: 56px; border-radius: 6px; border: 1px solid var(--ms-line); }
/* Bild groß (Inhaber 30.10.2026): die Portal-Regel „dialog { width: min(560px, …) }“ hier aufheben – Bild so groß wie möglich, ganz sichtbar, ohne Scrollen */
dialog.ms-gross { border: 0; padding: 0; background: transparent; box-shadow: none; width: auto; max-width: 98vw; max-height: 98vh; overflow: visible; }
dialog.ms-gross img { width: auto; height: auto; max-width: 98vw; max-height: calc(98vh - 56px); object-fit: contain; }
.ms-gross::backdrop { background: rgba(0,0,0,.8); }
.ms-gross img { display: block; max-width: 96vw; max-height: 86vh; border-radius: 6px; }
.ms-gross div { display: flex; justify-content: center; gap: 8px; margin-top: 8px; } .ms-gross .ms-ib { background: #fff; }
.ms-dlg { border: 1px solid #e4dfd8; border-radius: 12px; padding: 16px; width: min(420px, calc(100vw - 32px)); }
.ms-dlg h3 { margin: 0 0 10px; } .ms-dlg label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; margin-bottom: 10px; }
.ms-dlg input[name=name] { padding: 8px; border: 1px solid #e4dfd8; border-radius: 8px; font: inherit; font-size: 16px; }
.ms-dlg fieldset { border: 1px solid #e4dfd8; border-radius: 8px; max-height: 50vh; overflow-y: auto; }
.ms-dlg .ms-check { flex-direction: row; align-items: center; gap: 8px; margin: 4px 0; }
.ms-dk { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.ms-senden-t { background: #d12f39; color: #fff; border: 0; border-radius: 8px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.ms-fehler { color: #c62828; font-size: 13px; }
/* schmal (Handy, iPad hochkant im Portal): Liste oder Gespräch, bildschirmfüllend */
@media (max-width: 700px) {
  .ms-panel { right: 0; bottom: 0; left: 0; top: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; grid-template-columns: 1fr; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box; }
  .ms-gespraech { display: none; } .ms-im-gespraech .ms-gespraech { display: flex; } .ms-im-gespraech .ms-liste { display: none; }
  .ms-zurueck, .ms-zu2 { display: inline-flex; }
  .ms-knopf .ms-titel { display: none; } .ms-knopf { padding: 4px 8px 4px 4px; right: 10px; }
  .ms-msg { max-width: 86%; }
  /* iPhone: unter 16 px zoomt Safari beim Antippen hinein und die Seite verrutscht (Philipp 29.10.2026) */
  .ms .ms-eingabe textarea, .ms .ms-suche, .ms-dlg input, .ms-dlg textarea { font-size: 16px; }
  .ms-panel, .ms-gespraech, .ms-verlauf { overflow-x: hidden; max-width: 100vw; }
}
@media print { .ms { display: none !important; } }
/* portal.js packt Suchfelder in .suche-wrap (Löschen-Knopf) – der Rahmen darf in der Spalte nicht wachsen */
.ms-liste > .suche-wrap { flex: 0 0 auto; margin: 8px; } .ms-liste > .suche-wrap .ms-suche { margin: 0; width: 100%; box-sizing: border-box; }
/* Schritt 2: @-Verweise und Vorschläge; Schritt 3: Chat-Protokolle */
.ms-ref { display: inline-block; padding: 0 6px; border-radius: 6px; background: #f3ece2; color: #6c4b1f; text-decoration: none; font-weight: 600; }
a.ms-ref:hover { background: #ead9c2; } .ms-ref-m { background: #e8eef7; color: #2c4a7a; } .ms-ref-ich { background: #fbe0a8; color: #6a4b00; }
.ms-at { background: #c27c0e; }
.ms-vorschlag { position: absolute; bottom: 100%; left: 8px; right: 8px; background: #fff; border: 1px solid var(--ms-line); border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.14); max-height: 260px; overflow-y: auto; z-index: 2; }
.ms-vz { display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; column-gap: 6px; width: 100%; border: 0; background: none; padding: 7px 10px; text-align: left; font: inherit; cursor: pointer; color: inherit; }
.ms-vz span { grid-row: 1 / 3; align-self: center; text-align: center; } .ms-vz b { font-size: 14px; font-weight: 600; } .ms-vz small { font-size: 12px; color: var(--ms-muted); }
.ms-vz.an, .ms-vz:hover { background: var(--ms-bg); }
.ms-prot-liste { padding-left: 40px; font-size: 14px; } .ms-prot-liste li { margin: 3px 0; } .ms-prot-liste small { color: #77716a; }
.ms-prot-karte { margin-top: 10px; } .ms-prot-ein { margin-top: 10px; }
.ms-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ms-dienst { margin: 0; padding: 5px 12px; font-size: 11.5px; color: #6c4b1f; background: #fbf3e6; border-bottom: 1px solid var(--ms-line); }   /* Hinweis im Gespräch (Inhaber 29.10.2026) */
.ms-bildwahl { display: flex; align-items: center; gap: 10px; } .ms-bildwahl img, .ms-bildwahl .ms-av { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; object-fit: cover; }
/* Emoji-Auswahl mit Reitern (29.10.2026) */
.ms .ms-emojis { display: flex; flex-direction: column; gap: 0; padding: 0; max-height: none; height: 300px; overflow: hidden; flex-wrap: nowrap; }
.ms-emo-reiter { display: flex; flex: 0 0 auto; border-bottom: 1px solid var(--ms-line); overflow-x: auto; }
.ms-emo-reiter button { flex: 1 0 auto; border: 0; background: none; font-size: 20px; padding: 6px 8px; cursor: pointer; border-bottom: 2px solid transparent; opacity: .6; }
.ms-emo-reiter button.an { opacity: 1; border-bottom-color: var(--ms-rot); }
.ms-emo-titel { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ms-muted); padding: 6px 10px 2px; }
.ms-emo-feld { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); padding: 2px 6px 8px; align-content: start;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.ms-emo-feld button { border: 0; background: none; font-size: 26px; line-height: 1; padding: 6px 0; cursor: pointer; border-radius: 8px; }
.ms-emo-feld button:hover { background: var(--ms-bg); }
.ms-text.ms-gross-emo { font-size: 38px; line-height: 1.15; }
.ms-schluessel { font-size: 12px; word-break: break-all; background: #f5f2ee; padding: 4px 8px; border-radius: 6px; } .ms-369 input.ms-z-a { width: 100%; box-sizing: border-box; }
/* Kein Zoom im Chat (29.10.2026): Pinch und Doppeltipp im Chatfenster aus, Wischen bleibt */
.ms-panel, .ms-panel * { touch-action: pan-x pan-y; }
/* 29.10.2026: neue Nachricht sichtbar machen, Push-Leiste, Schalter „aufklappen“ */
.ms-knopf.ms-neu-da { border-color: var(--ms-rot); box-shadow: 0 0 0 3px rgba(237,41,57,.25), 0 6px 18px rgba(0,0,0,.18); animation: ms-wackeln 2.4s ease-in-out 3; } /* Audit 10.11.2026 (U11): wackelt dreimal, dann Ruhe */
.ms-knopf.ms-neu-da .ms-zahl { font-size: 13px; padding: 3px 8px; }
@keyframes ms-wackeln { 0%, 80%, 100% { transform: none; } 84% { transform: rotate(-8deg) scale(1.08); } 88% { transform: rotate(7deg) scale(1.08); } 92% { transform: rotate(-4deg); } 96% { transform: rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .ms-knopf.ms-neu-da { animation: none; } }
.ms-ib.ms-aus { opacity: .4; filter: grayscale(1); }
.ms-push { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 10px; padding: 8px 10px; border-radius: 10px; background: #fff6e0; border: 1px solid #f1d58a; font-size: 13px; line-height: 1.35; }
.ms-push[hidden] { display: none; }
.ms-push > span { flex: 1; min-width: 0; } .ms-push small { flex-basis: 100%; color: #77716a; }
.ms-push-an { flex: 1; border: 0; border-radius: 8px; background: #363534; color: #fff; font: inherit; font-weight: 600; padding: 8px 10px; cursor: pointer; text-align: left; }
/* 29.10.2026: „Messenger“ und „Ideen & Fehler“ gleich groß (Maß des Messengers) und per Haken an den rechten Rand klappbar */
@media (min-width: 701px) {
  .fb-btn, .ms-knopf { font-size: 13px; font-weight: 600; line-height: 1; padding: 5px 14px 5px 5px; gap: 8px; }
  .fb-ico, .ms-ico { width: 34px; height: 34px; font-size: 17px; }
}
.kk-rand-griff { position: fixed; right: 0; z-index: 32; width: 22px; height: 30px; padding: 0; border: 1px solid #e4dfd8; border-right: 0; border-radius: 10px 0 0 10px; background: #fff; color: #77716a; font: 700 18px/1 system-ui, sans-serif; box-shadow: 0 2px 8px rgba(0,0,0,.15); cursor: pointer; }
.kk-rand-griff:hover { color: #363534; } .kk-rand-griff[hidden] { display: none; }
html.kk-rand .ms-knopf, html.kk-rand .fb-btn { right: 0 !important; padding: 4px 6px 4px 4px !important; gap: 0 !important; border-right: 0; border-radius: 999px 0 0 999px; }
html.kk-rand .ms-knopf .ms-titel, html.kk-rand .fb-btn > span:nth-child(2) { display: none; }
html.kk-rand .ms-knopf .ms-zahl, html.kk-rand .fb-btn .fb-zahl { position: absolute; top: -6px; left: -6px; margin: 0; }
@media print { .kk-rand-griff { display: none !important; } }
/* Seitlicher Griff auf Touch-Geräten (Audit 07.11.2026 C3): größere Trefferfläche 44 × 44 px, sichtbar nur wenig breiter – ragt kaum in den Inhalt */
@media (pointer: coarse) {
  .kk-rand-griff { width: 30px; height: 44px; }
  .kk-rand-griff::before { content: ''; position: absolute; top: 0; bottom: 0; left: -14px; width: 14px; }
}
