/* MoD Studio Support-Chat — eigenständig, ohne globale Seitenregeln. */
.msc {
  --msc-ink: #202326;
  --msc-muted: #656c70;
  --msc-line: #e2e7e5;
  --msc-bottom: 22px;
  --msc-available-height: calc(100dvh - 112px);
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(var(--msc-bottom), env(safe-area-inset-bottom));
  z-index: 1000;
  font: 400 14px/1.55 var(--font-sans, Inter, system-ui, sans-serif);
  color: var(--msc-ink);
  color-scheme: light;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

.msc *,
.msc *::before,
.msc *::after {
  box-sizing: border-box;
}
.msc [hidden] {
  display: none !important;
}
.msc :is(button, textarea, input) {
  font: inherit;
  letter-spacing: normal;
}
.msc button {
  margin: 0;
  cursor: pointer;
}
.msc :is(button, a, input, textarea):focus-visible {
  outline: 2px solid #087c56;
  outline-offset: 3px;
}
.msc a {
  color: #08714f;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.msc svg {
  display: block;
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.msc__launcher-row {
  display: flex;
  justify-content: flex-end;
}
.msc__launcher {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid #ffffff25;
  border-radius: 50%;
  background: #16191a;
  color: #50dca8;
  box-shadow: 0 6px 22px #0002;
  transition:
    background-color 0.18s ease,
    transform 0.18s ease;
}
.msc__launcher svg {
  width: 25px;
  height: 25px;
}
.msc[data-open="true"] .msc__launcher {
  color: #fff;
}

.msc__panel {
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 44px));
  height: min(620px, var(--msc-available-height));
  min-height: 0;
  margin: 0 0 12px;
  overflow: hidden;
  border: 1px solid var(--msc-line);
  border-radius: 20px;
  background: #fff;
  box-shadow:
    0 20px 64px #18282024,
    0 4px 14px #1828200a;
  animation: msc-enter 0.18s ease-out;
}
.msc__header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px 16px 16px 20px;
  border-bottom: 1px solid var(--msc-line);
  flex-shrink: 0;
  background: #18181a;
}
.msc__avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #e9f7f0;
  color: #08754f;
}
.msc__identity {
  flex: 1;
  min-width: 0;
}
.msc__identity h2 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 1.4;
}
.msc__identity p {
  margin: 2px 0 0;
  color: #aaa;
  font-size: 12px;
  line-height: 1.4;
}
.msc__icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #92a09a;
  transition: color 0.15s ease;
}

.msc__conversation {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 17px 20px 20px;
  background: #fafbfa;
  scrollbar-width: thin;
  scrollbar-color: #c9d0cc transparent;
}
.msc__eyebrow {
  margin: 0 0 17px;
  text-align: center;
  color: #747c77;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
.msc__message {
  margin: 0 0 18px;
}
.msc__message-label {
  margin: 0 0 5px;
  color: var(--msc-muted);
  font-size: 11px;
  line-height: 1.4;
}
.msc__bubble {
  width: fit-content;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid #e7ebe8;
  border-radius: 3px 14px 14px;
  background: #fff;
  color: var(--msc-ink);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.msc__message--user {
  margin-left: 24px;
}
.msc__message--user .msc__message-label {
  text-align: right;
}
.msc__message--user .msc__bubble {
  margin-left: auto;
  border-color: #d7eddf;
  border-radius: 14px 3px 14px 14px;
  background: #eaf6ef;
  color: #17422f;
}
.msc__sources {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.msc__sources a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid #dce6df;
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.msc__sources svg {
  width: 13px;
  height: 13px;
}
.msc__suggestions {
  display: grid;
  gap: 7px;
  margin: 2px 0 18px;
}
.msc__suggestions button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #dce4df;
  border-radius: 8px;
  background: #fff;
  color: #365446;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease;
}
.msc__consent {
  padding-top: 14px;
  border-top: 1px solid var(--msc-line);
  color: var(--msc-muted);
  font-size: 11px;
  line-height: 1.65;
}
.msc__consent p {
  margin: 0;
}
.msc__consent label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 10px;
  padding-block: 3px;
  color: #39453e;
  cursor: pointer;
}
.msc__consent input {
  appearance: auto;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin: 1px 0 0;
  accent-color: #008a5b;
  cursor: pointer;
}
.msc__typing {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 12px 0;
  color: var(--msc-muted);
  font-size: 11px;
}
.msc__typing span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #54816b;
  animation: msc-dot 1.2s ease-in-out infinite;
}
.msc__typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.msc__typing span:nth-child(3) {
  margin-right: 5px;
  animation-delay: 0.3s;
}
.msc__notice {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e5d7bd;
  border-radius: 10px;
  background: #fffbf3;
  color: #655032;
  font-size: 12px;
  line-height: 1.6;
}
.msc__notice p {
  margin: 0 0 5px;
}

.msc__composer {
  flex-shrink: 0;
  margin: 0;
  padding: 13px 16px 5px;
  border-top: 1px solid var(--msc-line);
  background: #fff;
}
.msc__input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 5px;
  border: 1px solid #bcc9c0;
  border-radius: 12px;
  background: #fff;
}
.msc__input-wrap:focus-within {
  border-color: #008a5b;
  box-shadow: 0 0 0 2px #00b37714;
}
.msc__input-wrap textarea {
  display: block;
  flex: 1;
  min-width: 0;
  min-height: 42px;
  max-height: 112px;
  margin: 0;
  padding: 10px 7px;
  resize: none;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--msc-ink);
  font-size: 13px;
  line-height: 22px;
  box-shadow: none;
}
.msc__input-wrap textarea:focus {
  outline: 0;
}
.msc__input-wrap textarea::placeholder {
  color: #737b76;
  opacity: 1;
}
.msc__input-wrap textarea:read-only {
  color: #727973;
}
.msc__send {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: #008a5b;
  color: #fff;
  transition: background-color 0.18s ease;
}
.msc__send:disabled {
  cursor: default;
  background: #edf1ee;
  color: #8a958e;
}
.msc__input-hint {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-height: 21px;
  padding: 5px 2px 0;
  color: #707971;
  font-size: 10px;
  line-height: 1.5;
}
.msc__count {
  flex-shrink: 0;
}
.msc__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  padding: 0 18px;
  background: #fff;
  color: #767c78;
  font-size: 10px;
  line-height: 1.5;
}
.msc__footer > span {
  text-align: right;
}
.msc__end {
  min-height: 40px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: #646d66;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.msc__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.modal-open .msc {
  visibility: hidden;
}

@media (hover: hover) {
  .msc__launcher:hover {
    background: #25372e;
    transform: translateY(-2px);
  }
  .msc__icon-button:hover {
    color: #f7f8f7;
  }
  .msc__suggestions button:hover {
    border-color: #76a58b;
    background: #f3faf6;
  }
  .msc__sources a:hover {
    background: #eef7f1;
  }
  .msc__send:hover:not(:disabled) {
    background: #00764e;
  }
}
@media (max-width: 600px) {
  .msc {
    right: max(12px, env(safe-area-inset-right));
  }
  .msc__panel {
    width: calc(100vw - 24px - env(safe-area-inset-right));
    border-radius: 16px;
  }
  .msc__launcher {
    width: 50px;
    height: 50px;
    border-radius: 50%;
  }
  .msc__header {
    padding: 12px 12px 12px 16px;
  }
  .msc__conversation {
    padding: 14px 16px 16px;
  }
  .msc__input-wrap textarea {
    font-size: 16px;
  }
  .msc__composer {
    padding-inline: 12px;
  }
  .msc__footer {
    padding-inline: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .msc *,
  .msc *::before,
  .msc *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media (forced-colors: active) {
  .msc__panel,
  .msc__bubble,
  .msc__suggestions button,
  .msc__launcher,
  .msc__send {
    border: 1px solid ButtonText;
  }
  .msc__message--user .msc__bubble {
    border: 2px solid Highlight;
  }
}
@media print {
  .msc {
    display: none !important;
  }
}
@keyframes msc-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes msc-dot {
  0%,
  70%,
  100% {
    opacity: 0.35;
  }
  35% {
    opacity: 1;
  }
}
