/* CODISH Nova – Grundgerüst (immer geladen).
 *
 * NUR Aufbau: Position, Fensterteile, Scrollen, Abstände, schmale Schirme,
 * Bewegung. KEINE Farben, KEINE Schriften, KEIN Aussehen von Knöpfen und
 * Feldern – das kommt aus dem Theme (Anpassung in nova-theme.css).
 *
 * Fenster: drei Teile, einer scrollt (`.cn-verlauf`). `100dvh` statt `100vh`,
 * sonst schneidet der Mobilbrowser genau den Eingabebereich ab.
 */

.cn{
  position:fixed;right:16px;bottom:16px;z-index:99990;
  display:flex;flex-direction:column;align-items:flex-end;gap:12px;
  pointer-events:none;text-align:left;
}
.cn *,.cn *::before,.cn *::after{box-sizing:border-box}
.cn>*{pointer-events:auto}
.cn [hidden]{display:none!important}
.cn p{margin:0;padding:0}
.cn-symbol{display:block;flex:0 0 auto;width:auto;height:1.1em}
.cn-sr{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.cn-hp{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
.cn-noscript{max-width:320px;padding:12px 14px;font-size:13px;line-height:1.5}

/* Bei offenem Fenster tritt der Knopf zurück: er stünde sonst über dem
   Fenster im Seitenkopf. Schließen geht über ×, ESC – der Fokus kehrt danach
   auf den Knopf zurück. */
.cn .cn-opener[aria-expanded="true"]{display:none}
.cn-opener,.cn-senden{display:inline-flex;align-items:center;justify-content:center;gap:8px;cursor:pointer}

/* Fenster */
.cn-win{
  display:flex;flex-direction:column;
  width:min(520px,calc(100vw - 48px));height:min(760px,calc(100dvh - 112px));max-height:calc(100dvh - 112px);
  overflow:hidden;transform-origin:bottom right;
  transition:opacity 220ms cubic-bezier(.2,0,0,1),transform 220ms cubic-bezier(.2,0,0,1);
}
.cn-win.cn-ein{opacity:0;transform:translateY(8px) scale(.98)}

.cn-kopf{position:sticky;top:0;z-index:2;flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px}
.cn .cn-titel{display:flex;align-items:center;gap:10px;margin:0;padding:0;border:0;font-size:1.2rem;line-height:1.15;letter-spacing:normal;text-transform:none}
.cn-titel:focus{outline:none}
.cn-titel:focus-visible{outline:2px solid currentColor;outline-offset:4px}
.cn-titel-text{display:flex;flex-direction:column;gap:1px;min-width:0}
.cn-name{overflow-wrap:anywhere}
.cn-rolle{font-size:12px;font-weight:400;line-height:1.3;letter-spacing:.06em;text-transform:uppercase}

.cn .cn-zu{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:44px;height:44px;min-width:0;min-height:0;margin:0;padding:0;cursor:pointer}

.cn-verlauf{display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 20px}
.cn-verlauf:focus-visible{outline:2px solid currentColor;outline-offset:-2px}

.cn-msg{margin:0;padding:12px 14px;font-size:.875em;line-height:1.6;overflow-wrap:anywhere}
.cn-msg p+p,.cn-msg p+ul,.cn-msg ul+p,.cn-msg p+ol,.cn-msg ol+p{margin-top:8px}
.cn-msg ul,.cn-msg ol{margin:0;padding:0 0 0 1.25em}
.cn-msg li{margin:0 0 2px;padding:0}
.cn-msg strong{font-weight:600}
.cn-msg-ich{align-self:flex-end;max-width:88%;white-space:pre-wrap}
.cn-msg-laedt::after{content:"";display:inline-block;width:6px;height:6px;margin-left:8px;border-radius:50%;background:currentColor;animation:cn-puls 1.1s cubic-bezier(.2,0,0,1) infinite}
@keyframes cn-puls{0%,100%{opacity:.25}50%{opacity:1}}

.cn-quellen{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:4px;font-size:.75em}
.cn-quellen li{margin:0;padding:0}
.cn-quellen li::before{content:"– "}

/* Eingabebereich */
.cn-form{position:sticky;bottom:0;z-index:2;flex:0 0 auto;display:flex;flex-direction:column;gap:10px;margin:0;padding:12px 20px 16px}
.cn-fld{display:flex;flex-direction:column;gap:8px}
.cn .cn-fld label{display:block;margin:0;font-size:12px;font-weight:600;line-height:1.3;letter-spacing:.08em;text-transform:uppercase}
.cn .cn-fld textarea{display:block;width:100%;min-height:64px;max-height:40dvh;margin:0;resize:vertical;font-family:inherit;font-size:16px;line-height:1.5}
.cn-fehler{font-size:13px}
.cn-zaehler,.cn-ds-zeile{font-size:12px;line-height:1.4}

.cn-leiste{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.cn-ds{display:flex;align-items:center}
.cn .cn-ds-knopf{display:inline-flex;align-items:center;min-height:32px;margin:0;padding:4px 10px;font-size:12px;line-height:1.3;cursor:pointer}
.cn-ds-text{position:absolute;right:20px;bottom:calc(100% + 10px);z-index:3;width:min(320px,calc(100vw - 72px));max-height:50dvh;overflow-y:auto;padding:12px 14px;font-size:12px;line-height:1.5}
.cn-ds-text p+p{margin-top:8px}

/* Schmale Schirme: volle Fläche */
@media (max-width:599px){
  .cn{left:0;right:0;bottom:0;align-items:stretch;padding:0 16px 16px}
  .cn-opener{width:100%}
  .cn-win{position:fixed;inset:0;width:auto;height:100dvh;max-height:100dvh;border:0!important;border-radius:0!important}
  .cn-kopf{padding:12px 16px}
  .cn-verlauf{padding:14px 16px}
  .cn-form{padding:10px 16px calc(12px + env(safe-area-inset-bottom))}
  .cn .cn-zu{width:48px;height:48px}
  .cn .cn-ds-knopf{min-height:44px}
  .cn-ds-text{left:16px;right:16px;width:auto}
}

/* Sehr niedrige Fenster (Querformat am Handy) */
@media (max-height:520px){
  .cn-win{height:calc(100dvh - 16px);max-height:calc(100dvh - 16px)}
  .cn-kopf{padding:8px 16px}
  .cn-verlauf{padding:10px 16px;gap:8px}
  .cn-form{padding:8px 16px 10px;gap:8px}
  .cn .cn-fld textarea{min-height:44px}
  .cn-rolle{display:none}
}
@media (max-width:599px) and (max-height:520px){
  .cn-win{height:100dvh;max-height:100dvh}
}

@media (prefers-reduced-motion:reduce){
  .cn-msg-laedt::after{animation:none;opacity:1}
  .cn-win,.cn button{transition:none!important}
  .cn-win.cn-ein{opacity:1;transform:none}
}
