.btn-primary,
.btn-outline-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: #2962FA;
  --bs-btn-border-color: #2962FA;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #29184F;
  --bs-btn-hover-border-color: #29184F;
  --bs-btn-focus-shadow-rgb: 0, 165, 153;
  --bs-btn-active-color: #aaa;
  --bs-btn-active-color-hover: #aaa !important;
  --bs-btn-active-bg: var(--bubble-assistant-bg-color);
  --bs-btn-active-border-color: var(--bubble-assistant-bg-color);
  --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: #ddd;
  --bs-gradient: none;
}

:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --primary: #4f86c6;
  /* helles Blau für Bubbles */
  --primary-strong: #2e5f99;
  /* dunkles Blau für Nutzerbubble */
  --text-on-primary: #fff;
  --muted: #93a4b7;
  --accent: #0BDA7D;
  --accentHover: #14e788;
  /* Orange (Auswahl + runde Buttons) */
  --sidebar: #ffffff;
  --shadow: 0 4px 16px rgba(0, 0, 0, .08);
  --radius: 18px;
  --chatbot-avatar-img-width: 60px !important;
  --chatbot-avatar-img-height: 60px !important;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  background: var(--bg);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #1e2a35;
}

iframe {
  border-radius: 0px !important;
}


.app {
  height: 100%;
  display: grid;
  grid-template-columns: 280px 1fr;
}

/* Sidebar */
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid #e5ebf3;
  padding: 16px 12px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#navigation {
  flex: 20;
  overflow-y: auto;
  max-height: 280px;
  height: 280px;
}

#spacer {
  flex: 1;
  margin: -1rem;
}

.achievements {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  max-height: 230px;
  min-height: 50px;
  flex: 3;
  overflow-y: auto;
}

.achievement-badge {
  width: 50px;
  height: 50px;
  opacity: 0.3;
  cursor: pointer;
}

.achievement-granted {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.feedback {
  flex: 0;
}

.spacer {
  height: 14px
}



.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--accent);
  color: #fff;
  padding: 12px;
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  font-weight: 600;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #fff3;
  border: 2px solid #fff8;
  display: grid;
  text-align: center;
  align-content: center;
  font-weight: 600;
  font-size: 14px;
}

.contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  background-color: #f4f4f4;
  min-height: 40px;
}

.contact:hover {
  background: #eaf0f7
}

.contact .meta {
  flex: 1;
}

.contact .meta_sub {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  height: 35px
}

.contact .name {
  width: 100%;
  border-radius: 6px;
  font-size: 14px;
}

.contact .subname {
  height: 16px;
  width: 60%;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}

.contact .sub {
  margin-top: 8px;
  height: 10px;
  width: 80%;
  background: #e6edf7;
  border-radius: 5px;
}

.contact.active {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
  transition: background-color 1.5s ease;
}

.contact.active:hover {
  background: var(--accentHover);
}

.contact.active .name {
  font-weight: 600;
}

.contact.active .sub {
  background: #ffffff55;
  font-weight: 600;
  height: 40px;
}



.spacertopic {
  margin: 14px 20px;
}


.materialSearch {
  background-color: #2962FA;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  min-height: 40px;
  color: white;
  width: 255px;
  flex: 0;
}

.materialSearch:hover:not(.active) {
  background-color: #29184F;
}

/* Main / Chat */
.main {
  position: relative;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
}

.thread {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.msg {
  display: flex;
  gap: 10px;
}

.msg .avatar {
  background: #cfe0f5;
  border: none
}

.bubble {
  position: relative;
  max-width: min(720px, 90%);
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-family: 'Sora';
}

.bubble.small {
  max-width: 560px
}

/* Bubbles von "Tim" (links, blau) */
.from-them .bubble {
  background: var(--primary);
  color: var(--text-on-primary);
  border-radius: 16px 16px 16px 8px;
}

/* Antwort des Nutzers (zentriert, dunkler Balken) */
.from-me {
  justify-content: center;
}

.from-me .bubble {
  background: var(--primary-strong);
  color: var(--text-on-primary);
  border-radius: 12px;
  text-align: center;
  font-weight: 500;
  width: clamp(260px, 55%, 620px);
}

/* Liste im blauen Bubble */
.bubble ul {
  margin: 8px 0 0 18px;
}

.bubble li {
  margin: 6px 0
}

.bubble li::marker {
  color: #eaf2ff
}

/* Eingabebereich */
.composer {
  position: sticky;
  bottom: 0;
  background: transparent;
  padding: 0;
  margin-top: 6px;
}

.input {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.input .field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #dfe7f2;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  border-radius: 12px;
}

.input input {
  border: 0;
  outline: 0;
  width: 100%;
  font: inherit;
  background: transparent;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  border: 0;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.icon-btn:hover {
  filter: brightness(.95)
}

/* Runde Navigationsbuttons (links & unten rechts) */
.floating-left,
.floating-right {
  position: absolute;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}

.floating-left {
  left: 8px;
  bottom: 18px
}

.floating-right {
  right: 8px;
  bottom: 18px
}


.navigation-tooltip {
  display: none;
}

.achievement-tooltip,
.navigation-tooltip {
  --bs-tooltip-color: black;
  --bs-tooltip-bg: #f4f4f4;
}


@media (max-width: 980px) {
  .app {
    grid-template-columns: 86px 1fr
  }

  .contact {
    justify-content: center;
  }

  .brand {
    padding: 10px
  }

  .brand span {
    display: none
  }

  .contact .meta,
  .contact .meta_sub {
    display: none
  }

  .logo {
    background-position: top left;
    background-size: 350%;
    min-height: 64px;
  }

  .materialSearch {
    width: 60px;
  }

  .achievements {
    min-height: 35px;
  }

  .achievements>span {
    display: none;
  }

  .achievements>div {
    text-align: center;
  }

  .achievements>div>img {
    width: 35px;
    height: 35px;
  }

  .navigation-tooltip {
    display: block;
  }
}

@media (max-width: 640px) {
  .materialSearch {
    width: 60px;
  }

  .app {
    grid-template-columns: 86px 1fr
  }

  .from-me .bubble {
    width: 100%
  }

  .navigation-tooltip {
    display: block;
  }
}


#loadScreen {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100dvh;
  width: 100dvw;
  background-color: #999c;
  z-index: 11000;
}

.loader {
  width: 20px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 0 0 #0004;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  100% {
    box-shadow: 0 0 0 20px #0000
  }
}

.title {
  font-size: 0.9rem;
}

.subtitle {
  font-size: 0.8rem;
}