/* ==== Basis-Reset ==== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ==== Body & Grundlayout ==== */
:root {
  --vh: 1vh;
  --input-h: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --close-color: #ff334d;
  --close-hover: #ff6677;
  --close-active: #e32840;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Segoe UI", sans-serif;
  background: #1a1a1a;
  color: #f5f5f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  min-height: 100dvh;
}

#chat {
  width: 95vw;
  max-width: 1400px;
  background: rgba(37, 37, 37, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 0 30px rgba(0, 0, 0, .6);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  height: calc(var(--vh, 1vh) * 100 - var(--input-h) - 160px);
  position: relative;
  transition: box-shadow 0.3s ease;
}

/* ==== Generelles Button Design ==== */
.btn {
  padding: 0.66em 2.1em;
  font-size: 1.0em;
  font-family: 'Segoe UI', Arial, sans-serif;
  font-weight: 600;
  color: #f6fbff;
  background: linear-gradient(180deg, #1767d2 50%, #1351a7 100%);
  border: none;
  border-radius: 1.3em;
  box-shadow: 0 2px 7px rgba(34, 98, 190, 0.11);
  cursor: pointer;
  transition:
    background 0.14s cubic-bezier(.42, 1.1, .46, 1),
    transform 0.09s,
    box-shadow 0.14s;
  outline: none;
  user-select: none;
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  max-width: none;
  min-width: 44px;
  min-height: 38px;
  letter-spacing: 0.02em;
}

.btn:hover {
  background: linear-gradient(180deg, #2b7be6 50%, #2765bb 100%);
  transform: translateY(-1px) scale(1.025);
  box-shadow: 0 5px 13px rgba(22, 102, 209, 0.14);
}

.btn:active,
.btn-pressed {
  background: #184c8f;
  transform: translateY(0.5px) scale(0.98);
  box-shadow: 0 1px 3px rgba(22, 102, 209, 0.11);
}

.send-btn {
  all: unset;
  --size: 48px;
  width: var(--size);
  aspect-ratio: 1 / 1;
  display: inline-grid;
  place-items: center;
  background: #0077cc;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  transform: none;
  transition: background 0.2s ease;
}

.send-btn:hover {
  background: #3399ff;
}

.send-ico {
  color: white;
  transition: color 0.2s ease;
}

/* ==== Chat-Bubbles ==== */
/* === Keyframe-Animation für Pop-in === */
@keyframes bubblePop {
  0% {
    transform: scale(0.85) translateY(10px);
    opacity: 0;
  }

  70% {
    transform: scale(1.05) translateY(0);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Gemeinsame Bubble-Basis */
.bubble {
  position: relative;
  display: inline-block;
  max-width: 75%;
  padding: 12px 14px 36px 14px;
  margin: 6px 0;
  font-size: 15px;
  line-height: 1.4;
  word-wrap: break-word;
  animation: bubblePop 0.35s ease-out;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.bubble:hover {
  transform: translateY(-3px);
  /* kein scale mehr */
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}


/* === Bot-Bubble (links) === */
.bubble.bot {
  margin-right: auto;
  background: rgba(68, 68, 68, 0.9);
  backdrop-filter: blur(4px);
  color: #fff;
  border-radius: 18px;
  border-bottom-left-radius: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.bubble.bot::after {
  content: "";
  position: absolute;
  left: -8px;
  bottom: 0;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 0 solid transparent;
  border-right: 8px solid rgba(68, 68, 68, 0.95);
}

.bubble.bot:hover {
  background: linear-gradient(135deg, rgba(85, 85, 85, 0.95), rgba(60, 60, 60, 0.95));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* === User-Bubble (rechts) === */
.bubble.user {
  align-self: flex-end;
  background: rgba(0, 153, 255, 0.9);
  backdrop-filter: blur(3px);
  color: #fff;
  border-radius: 18px;
  border-bottom-right-radius: 0;
  box-shadow: 0 4px 12px rgba(0, 153, 255, 0.3);
}

.bubble.user::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: 0;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 0 solid transparent;
  border-left: 8px solid #0066cc;
}

.bubble.user:hover {
  background: linear-gradient(135deg, #33aaff, #0077dd);
  box-shadow: 0 8px 22px rgba(0, 153, 255, 0.45);
}

/* === Buttons in der Bubble === */
.bubble-actions {
  position: absolute;
  bottom: 6px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.bubble:hover .bubble-actions {
  opacity: 1;
  transform: translateY(0);
}

.bubble-actions button {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: inherit;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.bubble-actions button:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.1);
}

.bubble-wrapper {
  display: flex;
}

.bubble-wrapper.user-wrapper {
  justify-content: flex-end;
}

/* ==== Bilder in Chatblasen kleiner darstellen ==== */
.bubble img {
  max-width: 480px;
  /* Breite im Chat */
  max-height: 212px;
  /* Höhe im Chat */
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  /* zeigt an, dass man klicken kann */
}

.bubble h1,
.bubble h2,
.bubble h3 {
  margin: 6px 0;
  font-weight: bold;
}

.bubble code {
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 4px;
  border-radius: 4px;
}

/* ===== Markdown-Polish im Chat ===== */

/* 1) Checklisten-Checkboxen: klein & wie Stichpunkte */
.bubble input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: #47b6ff;
  /* Theme-Farbe */
  vertical-align: -1px;
  /* baseline-fit */
  margin: 0 6px 0 2px;
  /* näher an den Text */
  box-shadow: none;
  outline: none;
}

/* 2) Listen-Hierarchie klarer unterscheiden */
.bubble ul,
.bubble ol {
  margin: 6px 0;
  padding-left: 1.25rem;
}

.bubble ul {
  list-style: disc;
}

.bubble ul ul {
  list-style: circle;
  padding-left: 1.15rem;
}

.bubble ul ul ul {
  list-style: square;
  padding-left: 1.1rem;
}

.bubble ol {
  list-style: decimal;
}

.bubble ol ol {
  list-style: lower-alpha;
  padding-left: 1.15rem;
}

.bubble ol ol ol {
  list-style: lower-roman;
  padding-left: 1.1rem;
}

/* etwas mehr Luft je Punkt */
.bubble li {
  margin: 2px 0;
}

/* 3) Zitatblöcke deutlich kennzeichnen */
.bubble blockquote {
  border-left: 4px solid #47b6ff;
  background: rgba(71, 182, 255, 0.08);
  padding: 8px 12px;
  margin: 8px 0;
  color: #d6eaff;
  font-style: italic;
}

.bubble blockquote> :first-child {
  margin-top: 0;
}

.bubble blockquote> :last-child {
  margin-bottom: 0;
}

/* ==== Eingabefeld ==== */
#userInput,
input {
  font-family: inherit;
  resize: none;
  overflow: hidden;
  line-height: 1.4em;
  padding: 10px 14px;
  font-size: 1rem;
  border-radius: 10px;
  background-color: #333;
  color: white;
  border: 1px solid #444;
  min-height: 40px;
  max-height: 80px;
  width: 100%;
  transition: border 0.2s ease;
}

#userInput:focus,
input:focus {
  border: 1px solid #0077cc;
  outline: none;
}

/* ==== Einheitliche Buttons ==== */
button,
.secondary-btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: bold;
  background-color: #005fa3;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

button:hover,
.secondary-btn:hover {
  background-color: #0077cc;
  transform: scale(1.03);
}

/* ==== Modell-Dropdown ==== */
#modelDropdown {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translate(-50%, -5px);
  max-height: 50vh;
  overflow-y: auto;
  background-color: #1e1e1e;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 6px 0;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  /* statt display:none */
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  min-width: 260px;
  width: max-content;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#modelDropdown.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

#modelDropdown div {
  padding: 8px 12px;
  cursor: pointer;
  color: white;
  border-radius: 6px;
  transition: background-color 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

#modelDropdown div:hover {
  background-color: #333;
}

#currentModel {
  background-color: #2a2a2a;
  /* helleres Grau */
  color: #ffffff;
  border: none;
  border-radius: 0;
  /* eckig */
  padding: 10px 20px;
  font-size: 0.8em;
  /* größere Schrift */
  font-weight: 500;
  cursor: pointer;
  display: inline-block;
  transition: background-color 0.2s ease;
}

#currentModel:hover {
  background-color: #3a3a3a;
  /* Hover-Farbe */
}

/* ==== Modell-Labels (Farbcodes) ==== */
.model-label {
  margin-left: auto;
  text-align: right;
  min-width: 80px;
  font-size: 0.85em;
}

.model-label.green {
  color: #00cc66;
}

.model-label.teal {
  color: #0b7070;
}

.model-label.blue {
  color: #3399ff;
}

.model-label.lightblue {
  color: #47b6ff;
}

.model-label.orange {
  color: #ff9900;
}

.model-label.violet {
  color: #a466fa;
}

.model-label.gray {
  color: #aaa;
}

.model-label.red {
  color: #ff4d4d;
}

.model-label.pink {
  color: #fd5cd6;
}


/* ==== Hinweistext unter Nachrichten ==== */
.model-hint {
  font-size: 0.75em;
  color: #aaa;
  margin-top: 5px;
  font-style: italic;
}

/* ==== TTS-Button-Stil (einheitlich mit Button-Theme) ==== */
.tts-button-row {
  margin-top: 6px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-left: 12px;
}

.tts-button {
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  background-color: #606060;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, transform 0.15s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tts-button:hover {
  background-color: #0056d2;
  transform: scale(1.05);
}

.tts-button.tts-stop {
  background-color: #d10000;
}

.tts-button.tts-stop:hover {
  background-color: #a60000;
}

.input-area {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(16px + var(--safe-bottom));
  background: rgba(30, 30, 30, 0.9);
  backdrop-filter: blur(8px);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, .35);
  border-radius: 16px;
  width: 100%;
  margin: 0 auto;
  max-width: 1600px;
  box-sizing: border-box;
}

/* iOS Safari Fix: Keyboard-Overlay */
@supports (-webkit-touch-callout: none) {
  .input-area {
    position: fixed;
  }
}

/* ==== Upload-Symbol ==== */
.upload-button {
  font-size: 1.5em;
  cursor: pointer;
  user-select: none;
  color: #aaa;
  transition: color 0.2s ease;
}

.upload-button:hover {
  color: #fff;
}


/* ==== Bildvorschau ==== */
#imagePreview img {
  max-width: 220px;
  margin-top: 10px;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

/* ==== Overlays (Start, Hilfe, Changelog etc.) ==== */

.changelog-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 300px;
  overflow-y: auto;
}

.changelog-box>* {
  width: 100%;
}

/* ==== Push-Benachrichtigungen ==== */
.push-notification {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: #0048ff;
  color: white;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 250px;
  max-width: 90vw;
  transition: top 0.4s ease, opacity 0.4s ease;
  opacity: 0;
  cursor: pointer;
}

.push-notification.visible {
  top: 20px;
  opacity: 1;
}

.push-notification .close-push,
.push-notification .close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.2em;
  cursor: pointer;
}

.push-notification .close-push:hover,
.push-notification .close-btn:hover {
  color: #ffaaaa;
}

/* ==== Modal zur Bildanzeige ==== */
.image-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: #111;
  color: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  max-width: 90vw;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-content img {
  max-width: 90vw;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
  margin-top: 10px;
}

.modal-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-btn {
  background: #222;
  color: white;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.95em;
  transition: background 0.2s ease;
}

.modal-btn:hover {
  background: #444;
}

/* ==== Session und Limit info ==== */
#sessionInfo {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--input-h) + 54px + var(--safe-bottom));
  width: min(95vw, 1400px);
  font-size: .8em;
  color: #888;
  text-align: center;
  margin: 0;
  pointer-events: none;
  z-index: 10;
}

#modelLimitInfo {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--input-h) + 28px + var(--safe-bottom));
  width: min(95vw, 1400px);
  font-size: .9em;
  color: #aaa;
  text-align: center;
  margin: 0;
  pointer-events: none;
  z-index: 10;
}

.pro-badge {
  color: #FFD700;
  font-weight: 700;
  text-shadow: 0 0 10px #FFD700, 0 0 1px #FFD700;
  margin-left: .4rem;
}

/* ==== Versionsanzeige unten links ==== */
#versionDisplayMain {
  position: fixed;
  bottom: 8px;
  left: 12px;
  font-size: 0.7em;
  color: #aaa;
  background: rgba(30, 30, 30, 0.8);
  padding: 4px 8px;
  border-radius: 8px;
  z-index: 9999;
  pointer-events: none;
}

/* ==== Scrollbar-Styling ==== */
*::-webkit-scrollbar {
  width: 6px;
}

*::-webkit-scrollbar-thumb {
  background-color: #444;
  border-radius: 3px;
}

*::-webkit-scrollbar-track {
  background-color: #222;
}

html,
body {
  scrollbar-width: thin;
  scrollbar-color: #444 #222;
}

hr {
  border: none;
  border-top: 1px solid #ffffff;
  margin: 12px 0;
  width: 100%;
}

/* ==== Codeblock ==== */

.codeblock-container {
  background: #181c23;
  border-radius: 10px;
  margin: 16px 0 18px 0;
  box-shadow: 0 2px 14px #0004;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.codeblock-langbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #212638;
  color: #82b1ff;
  font-family: 'Fira Mono', monospace;
  font-size: 0.98em;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0 12px;
  height: 32px;
  border-bottom: 1px solid #20253d;
}

.codeblock {
  background: none;
  color: #cfeaff;
  font-size: 0.97em;
  border-radius: 0 0 8px 8px;
  padding: 15px 18px 14px 18px;
  margin: 0;
  font-family: 'Fira Mono', 'Consolas', monospace;
  line-height: 1.35em;
  overflow-x: auto;
}

.copy-btn {
  margin-left: 8px;
  background: #262e49;
  color: #91c7ff;
  border: none;
  border-radius: 7px;
  padding: 5px 16px;
  font-size: 1em;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px #0002;
  transition: background 0.2s, color 0.2s;
  height: 28px;
  line-height: 1em;
  display: flex;
  align-items: center;
}

.copy-btn:hover:not(:disabled) {
  background: #3459c5;
  color: #fff;
}

.copy-btn:disabled {
  background: #27344d;
  color: #92e3ff;
  cursor: default;
}

/* ==== Profil Overlay === */

.user-entry:hover {
  background: #222;
  box-shadow: 0 1px 5px #0002;
}

/* ==== Start Menü ==== */

/* ========================== */
/*   MCB AI Startmenü-Style   */
/* ========================== */

#infoOverlay {
  display: none;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 32, 0.90);
  z-index: 9999;
}

.info-box.startmenu {
  width: 96vw;
  max-width: 820px;
  background: linear-gradient(115deg, #232e3e 80%, #1e334e 130%);
  box-shadow: 0 10px 48px #0008;
  border-radius: 22px;
  padding: 40px 28px 32px 28px;
  border: 2.5px solid #25354c;
  position: relative;
  min-height: 0;
  margin: 16px;
  animation: fadeInUpStartmenu 0.25s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes fadeInUpStartmenu {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive! */
@media (max-width: 700px) {
  .info-box.startmenu {
    max-width: 99vw;
    padding: 24px 8vw 24px 8vw;
    border-radius: 13px;
  }
}

@media (max-width: 400px) {
  .info-box.startmenu {
    padding: 14px 1vw 18px 1vw;
    border-radius: 7px;
  }
}

.startmenu-close {
  position: absolute;
  top: 20px;
  right: 25px;
  width: 38px;
  height: 38px;
  background: none;
  border: none;
  cursor: pointer;
  color: transparent;
  font-size: 0;
  line-height: 0;
  padding: 0;
}

.startmenu-close::before,
.startmenu-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 3px;
  /* etwas größer im Startmenü */
  background: #ff334d;
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.startmenu-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.startmenu-close:hover::before,
.startmenu-close:hover::after {
  background: #ff6677;
}

.startmenu-title {
  text-align: center;
  font-size: 2.18em;
  color: #00bcff;
  font-family: 'Segoe UI', 'Arial', sans-serif;
  font-weight: 900;
  margin-bottom: 14px;
  margin-top: 0;
  letter-spacing: 0.04em;
}

.startmenu-title span {
  color: #fff;
  font-weight: 700;
}

.startmenu-hinweis {
  background: #1c2636;
  color: #fff;
  border-radius: 10px;
  padding: 16px 18px 14px 18px;
  margin-bottom: 22px;
  font-size: 1.06em;
  box-shadow: 0 3px 13px #0053ad28;
  border-left: 6px solid #00cfff;
}

.startmenu-list {
  margin-bottom: 28px;
  color: #c9e7fa;
  font-size: 1.08em;
  padding-left: 1.3em;
  line-height: 1.7;
}

.startmenu-btn-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  width: 100%;
  margin: 0 auto 14px auto;
  max-width: 350px;
}

@media (min-width: 600px) {
  .startmenu-btn-group {
    grid-template-columns: 1fr 1fr;
    gap: 20px 24px;
    max-width: 620px;
  }
}

/* Button-Style bleibt class="btn" – aber im Startmenü leicht angepasst */
#infoOverlay .btn {
  width: 100%;
  max-width: 350px;
  min-width: 120px;
  border-radius: 16px;
  padding: 17px 0;
  font-size: 1.14em;
  font-weight: 600;
  margin: 0 auto;
  background: linear-gradient(95deg, #1dafff 50%, #1be6c2 100%);
  color: #162340;
  border: none;
  box-shadow: 0 1px 10px #00e4ff18;
  transition: background 0.17s, color 0.18s, transform 0.13s;
  outline: none;
}

#infoOverlay .btn:hover,
#infoOverlay .btn:focus {
  background: linear-gradient(92deg, #16f0e1 20%, #12cbf3 85%);
  color: #141933;
  transform: scale(1.045);
}

/* Fußzeile */
.startmenu-footer {
  font-size: 0.97em;
  color: #b2c3d3;
  margin-top: 36px;
  text-align: center;
  border-top: 1.2px solid #2d4e72;
  padding-top: 14px;
  opacity: 0.97;
  word-break: break-word;
}

/* scrollbar-Design für modernes feeling */
#infoOverlay .info-box::-webkit-scrollbar {
  width: 12px;
  background: #1b2738;
  border-radius: 8px;
}

#infoOverlay .info-box::-webkit-scrollbar-thumb {
  background: #284361;
  border-radius: 8px;
}

/* ==== Sidebar Button ==== */

.sidebar-toggle-btn {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 1.5em;
  height: 40px;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-right: 0;
}

.sidebar-toggle-btn:hover {
  background: none;
  border: none;
}

/* ==== OpenAI News ==== */

.openai-status-item {
  border-radius: 12px;
  margin-bottom: 18px;
  padding: 18px 22px 14px 22px;
  background: #242a36;
  border-left: 8px solid #00bfff;
  box-shadow: 0 2px 18px #0018;
  transition: background 0.12s;
  max-width: 900px;
  /* Kartenbreite */
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  max-height: 85vh;
  overflow-y: auto;
}

.openai-status-item.status-warning {
  border-color: #ffa51d;
}

.openai-status-item.status-critical {
  border-color: #ff4e4e;
}

.openai-status-title {
  font-weight: bold;
  color: #00bfff;
  font-size: 1.07em;
  margin-bottom: 3px;
}

.openai-status-date {
  color: #aaa;
  font-size: 0.97em;
  margin-bottom: 5px;
  display: block;
}

.openai-status-desc {
  color: #eee;
  font-size: 0.99em;
}

.openai-status-item.status-warning .openai-status-title {
  color: #ffa51d;
}

.openai-status-item.status-critical .openai-status-title {
  color: #ff4e4e;
}

/* ==== Warning Overlay ==== */
.warning-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 32, 0.96);
  /* exakt wie infoOverlay */
  z-index: 99999;
  align-items: center;
  justify-content: center;
}

.warning-box {
  background: linear-gradient(115deg, #292e39 80%, #203b58 140%);
  border: 2.8px solid #ffae42;
  box-shadow: 0 10px 48px #0009;
  border-radius: 22px;
  padding: 40px 28px 32px 28px;
  min-width: 320px;
  max-width: 600px;
  width: 96vw;
  color: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInUpStartmenu 0.24s;
}

.warning-title {
  color: #ffae42;
  margin-top: 0;
  margin-bottom: 18px;
  text-align: center;
  font-size: 2.08em;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px #0006;
}

.warning-text {
  font-size: 1.12em;
  color: #fff2d1;
  margin-bottom: 24px;
  white-space: pre-line;
  text-align: center;
  width: 100%;
}

.warning-btn {
  width: 100%;
  font-weight: 700;
  font-size: 1.11em;
  background: linear-gradient(90deg, #ffae42 70%, #ffd482 100%);
  color: #482a00;
  border-radius: 14px;
  margin-top: 10px;
  box-shadow: 0 2px 16px #ffae4235;
}

.warning-btn:hover,
.warning-btn:focus {
  background: linear-gradient(90deg, #ffd482 20%, #ffae42 90%);
  color: #3b1d00;
}

@media (max-width: 700px) {
  .warning-box {
    max-width: 99vw;
    padding: 18px 2vw 22px 2vw;
    border-radius: 11px;
  }
}

/* ==== NEUES EINHEITLICHES OVERLAY SYSTEM ==== */

/* ===== Unified Overlay System ===== */
.overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .82);
  z-index: 9999;
  padding: clamp(8px, 2vw, 24px);
  overscroll-behavior: contain;
}

.overlay.is-open {
  display: flex;
}

/* Dialog-Container (Basis) */
.overlay .info-box {
  width: min(96vw, 820px);
  max-height: min(88vh, 100%);
  background: #1f1f1f;
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px #0009;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Größen-Modifier (normal) */
.overlay.size-md .info-box {
  width: min(98vw, 980px);
  max-height: min(90vh, 100%);
  min-height: 60vh;
}

.overlay.size-lg .info-box {
  width: min(98vw, 1200px);
  max-height: min(92vh, 100%);
  min-height: 74vh;
}

.overlay.size-xl .info-box {
  width: min(98vw, 1400px);
  max-height: min(94vh, 100%);
  min-height: 84vh;
}

/* ===== Oversized / Fullscreen ===== */
/* ===== Oversized / Fullscreen ===== */
.overlay.size-full,
.overlay.oversized {
  padding: 0;
  /* randlos */
}

.overlay.size-full .info-box,
.overlay.oversized .info-box {
  display: grid;
  /* Grid statt nur flex */
  grid-template-rows: auto 1fr;
  /* Header auto, Body füllt Rest */
  width: 100vw;
  height: 100dvh;
  /* echtes Vollbild */
  max-height: none;
  border-radius: 0;
  box-shadow: none;
}

.overlay.size-full .overlay__header,
.overlay.oversized .overlay__header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding-left: clamp(12px, 2vw, 32px);
  padding-right: clamp(12px, 2vw, 32px);
}

.overlay.size-full .overlay__body,
.overlay.oversized .overlay__body {
  padding: 0;
  /* kein extra Padding mehr, damit iframe bündig */
  overflow: hidden;
  /* Scrollbars übernimmt das Iframe */
  min-height: 0;
  /* wichtig im Grid */
  flex: 1 1 auto;
}

/* Iframe flächig machen */
#changelogDetailText {
  position: relative;
  width: 100%;
  height: 100%;
}

#changelogDetailText iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

/* Inhalte im Oversize dürfen wachsen */
.overlay.size-full .changelog-box,
.overlay.oversized .changelog-box {
  max-height: none;
}

/* Header, Body, Footer */
.overlay__header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 48px 14px 18px;
  background: linear-gradient(0deg, #232323, #262626);
  border-bottom: 1px solid #2f2f2f;
}

.overlay__title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #00bfff;
}

.overlay__body {
  padding: 14px 18px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.overlay__footer {
  position: sticky;
  bottom: 0;
  padding: 10px 18px;
  background: #1b1b1b;
  border-top: 1px solid #2a2a2a;
}

/* Close-Button */
.overlay__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  cursor: pointer;
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.overlay__close::before,
.overlay__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(45deg);
}

.overlay__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.overlay__close:hover {
  background: #334;
  transform: scale(1.04);
}

.overlay__close:active {
  transform: scale(.97);
}

/* Kleine Screens */
@media (max-width: 520px) {

  .overlay .info-box,
  .overlay.size-md .info-box,
  .overlay.size-lg .info-box,
  .overlay.size-xl .info-box,
  .overlay.size-full .info-box,
  .overlay.oversized .info-box {
    width: 100vw;
    height: 100dvh;
    /* wirklich voll */
    border-radius: 0;
    /* auch mobil randlos */
  }
}

/* Body lock, wenn Overlay offen */
body.modal-open {
  overflow: hidden;
}

/* rote Striche (Overlay + Startmenü) */
.overlay__close::before,
.overlay__close::after,
.startmenu-close::before,
.startmenu-close::after {
  background: var(--close-color);
}

.overlay__close:hover::before,
.overlay__close:hover::after,
.startmenu-close:hover::before,
.startmenu-close:hover::after {
  background: var(--close-hover);
}

.overlay__close:active::before,
.overlay__close:active::after,
.startmenu-close:active::before,
.startmenu-close:active::after {
  background: var(--close-active);
}

/* optional: dezente rote Hover-Fläche beim Overlay-Button */
.overlay__close:hover {
  background: rgb(51, 17, 17);
  border-color: rgb(85, 51, 51);
}

#helpOverlayText,
#infoDetailsOverlayText {
  position: relative;
  width: 100%;
  height: 100%;
}

#helpOverlayText iframe,
#infoDetailsOverlayText iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

/* ==== ... ==== */

/* System-Memory-Bubbles */
/* Memory-Bubble im Chat (grün, links) */
.bubble.memory {
  margin-left: 0;
  margin-right: auto;
  max-width: 72%;
  background: rgba(102, 255, 102, .12);
  color: #66ff66;
  border: 1px solid rgba(102, 255, 102, .35);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(102, 255, 102, .15);
}

/* Overlay-Karten */
.memory-item {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #2d2d2d;
  border-radius: 10px;
  background: #171a1c;
}

.memory-item .nid {
  font-weight: 700;
  color: #7cff7c;
}

.memory-item .meta {
  color: #9aa;
  font-size: .86em;
}

.memory-item .tags {
  color: #9fd;
  font-size: .86em;
}

.memory-item .actions {
  display: flex;
  gap: 8px;
}

.memory-item textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  background: #111;
  color: #e8ffe8;
  border: 1px solid #2a2;
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.35;
}

.memory-item input.tag-input {
  width: 100%;
  background: #0f1212;
  color: #aff;
  border: 1px solid #265;
  border-radius: 8px;
  padding: 6px 8px;
  margin-top: 6px;
}

.memory-empty {
  color: #888;
  text-align: center;
  padding: 16px 0;
}

.btn.btn--danger {
  background: #b00020;
}