/* Kupfersaal KI-Assistent – bewusst eigenständig gekapselt, damit der bestehende Auftritt unverändert bleibt. */
.ks-ai-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9000;
  border: 1px solid rgba(65, 54, 45, 0.22);
  border-radius: 999px;
  padding: 0.85rem 1.15rem;
  background: #3e352e;
  color: #fffaf3;
  box-shadow: 0 14px 35px rgba(49, 38, 29, 0.22);
  cursor: pointer;
  font: 600 0.82rem/1.1 "DM Sans", system-ui, sans-serif;
  letter-spacing: 0.01em;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.restaurant-page .ks-ai-launcher {
  background: #713f35;
}

.ks-ai-launcher:hover,
.ks-ai-launcher:focus-visible {
  background: #2d2722;
  box-shadow: 0 18px 42px rgba(49, 38, 29, 0.28);
  transform: translateY(-2px);
}

.restaurant-page .ks-ai-launcher:hover,
.restaurant-page .ks-ai-launcher:focus-visible {
  background: #5b3029;
}

.ks-ai-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.5rem;
  z-index: 9001;
  display: flex;
  width: min(395px, calc(100vw - 2rem));
  max-height: min(700px, calc(100vh - 7rem));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(65, 54, 45, 0.16);
  border-radius: 1.15rem;
  background: #fffaf3;
  box-shadow: 0 24px 70px rgba(49, 38, 29, 0.27);
  color: #3e352e;
  font-family: "DM Sans", system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transition: opacity 160ms ease, transform 160ms ease;
}

.ks-ai-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.ks-ai-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.2rem 1rem;
  background: #ede7de;
  border-bottom: 1px solid rgba(65, 54, 45, 0.11);
}

.restaurant-page .ks-ai-header {
  background: #f2d2c4;
}

.ks-ai-kicker {
  margin: 0 0 0.3rem;
  color: #866e5c;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ks-ai-title {
  margin: 0;
  color: #3e352e;
  font: 600 1.2rem/1.1 "Cormorant Garamond", Georgia, serif;
}

.ks-ai-close {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  color: #3e352e;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.ks-ai-close:hover,
.ks-ai-close:focus-visible {
  background: #fffaf3;
}

.ks-ai-messages {
  display: flex;
  min-height: 180px;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  padding: 1rem;
  overscroll-behavior: contain;
}

.ks-ai-message {
  max-width: 91%;
  border-radius: 0.9rem;
  padding: 0.72rem 0.82rem;
  font-size: 0.82rem;
  line-height: 1.52;
  white-space: normal;
}

.ks-ai-message p {
  margin: 0;
}

.ks-ai-message ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.ks-ai-message--assistant {
  align-self: flex-start;
  background: #f1ece5;
}

.restaurant-page .ks-ai-message--assistant {
  background: #fae9e2;
}

.ks-ai-message--user {
  align-self: flex-end;
  background: #3e352e;
  color: #fffaf3;
}

.restaurant-page .ks-ai-message--user {
  background: #713f35;
}

.ks-ai-typing {
  display: inline-flex;
  gap: 0.22rem;
  align-items: center;
  min-height: 1rem;
}

.ks-ai-typing span {
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 50%;
  background: #8d7868;
  animation: ks-ai-bounce 900ms infinite ease-in-out;
}

.ks-ai-typing span:nth-child(2) { animation-delay: 120ms; }
.ks-ai-typing span:nth-child(3) { animation-delay: 240ms; }

@keyframes ks-ai-bounce {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.ks-ai-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1rem 0.85rem;
}

.ks-ai-choice,
.ks-ai-action {
  border: 1px solid rgba(65, 54, 45, 0.22);
  border-radius: 999px;
  background: transparent;
  color: #3e352e;
  cursor: pointer;
  font: 600 0.72rem/1.2 "DM Sans", system-ui, sans-serif;
}

.ks-ai-choice {
  padding: 0.48rem 0.68rem;
}

.ks-ai-choice:hover,
.ks-ai-choice:focus-visible,
.ks-ai-action:hover,
.ks-ai-action:focus-visible {
  border-color: #3e352e;
  background: #ede7de;
}

.restaurant-page .ks-ai-choice:hover,
.restaurant-page .ks-ai-choice:focus-visible,
.restaurant-page .ks-ai-action:hover,
.restaurant-page .ks-ai-action:focus-visible {
  border-color: #713f35;
  background: #f2d2c4;
}

.ks-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1rem 0.85rem;
}

.ks-ai-action {
  display: inline-flex;
  padding: 0.52rem 0.72rem;
  text-decoration: none;
}

.ks-ai-action--primary,
.ks-ai-lead-submit {
  border-color: #3e352e;
  background: #3e352e;
  color: #fffaf3;
}

.ks-ai-action--primary:hover,
.ks-ai-action--primary:focus-visible,
.ks-ai-lead-submit:hover,
.ks-ai-lead-submit:focus-visible {
  border-color: #2d2722;
  background: #2d2722;
  color: #fffaf3;
}

.restaurant-page .ks-ai-action--primary,
.restaurant-page .ks-ai-lead-submit {
  border-color: #713f35;
  background: #713f35;
  color: #fffaf3;
}

.restaurant-page .ks-ai-action--primary:hover,
.restaurant-page .ks-ai-action--primary:focus-visible,
.restaurant-page .ks-ai-lead-submit:hover,
.restaurant-page .ks-ai-lead-submit:focus-visible {
  border-color: #5b3029;
  background: #5b3029;
}

.ks-ai-lead {
  margin: 0 1rem 0.9rem;
  border: 1px solid rgba(65, 54, 45, 0.14);
  border-radius: 0.95rem;
  padding: 0.85rem;
  background: #f7f2eb;
}

.restaurant-page .ks-ai-lead {
  background: #fff1eb;
}

.ks-ai-lead-heading h3 {
  margin: 0.32rem 0 0.25rem;
  color: #3e352e;
  font: 600 1.02rem/1.15 "Cormorant Garamond", Georgia, serif;
}

.ks-ai-lead-heading > p {
  margin: 0 0 0.75rem;
  color: #76685d;
  font-size: 0.72rem;
  line-height: 1.42;
}

.ks-ai-lead-progress {
  display: inline-flex;
  border-radius: 999px;
  padding: 0.25rem 0.48rem;
  background: #ede7de;
  color: #866e5c;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.restaurant-page .ks-ai-lead-progress {
  background: #f2d2c4;
}

.ks-ai-lead-form {
  display: grid;
  gap: 0.65rem;
}

.ks-ai-lead-form label {
  display: grid;
  gap: 0.28rem;
  color: #5c4e43;
  font-size: 0.7rem;
  font-weight: 600;
}

.ks-ai-lead-form label em {
  color: #958477;
  font-style: normal;
  font-weight: 400;
}

.ks-ai-lead-form input:not([type="checkbox"]),
.ks-ai-lead-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(65, 54, 45, 0.2);
  border-radius: 0.62rem;
  padding: 0.62rem 0.68rem;
  background: #fffdf9;
  color: #3e352e;
  font: 400 0.78rem/1.3 "DM Sans", system-ui, sans-serif;
}

.ks-ai-lead-form textarea {
  min-height: 5.1rem;
  resize: vertical;
}

.ks-ai-lead-form input:not([type="checkbox"]):focus,
.ks-ai-lead-form textarea:focus {
  border-color: #86705d;
  outline: 2px solid rgba(134, 112, 93, 0.2);
  outline-offset: 1px;
}

.ks-ai-lead-submit {
  display: inline-flex;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.62rem 0.76rem;
  cursor: pointer;
  font: 600 0.72rem/1.2 "DM Sans", system-ui, sans-serif;
}

.ks-ai-lead-submit:disabled {
  cursor: wait;
  opacity: 0.58;
}

.ks-ai-consent {
  display: flex !important;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto;
  grid-auto-flow: column;
  align-items: flex-start;
  gap: 0.48rem !important;
  color: #796b60 !important;
  font-size: 0.62rem !important;
  font-weight: 400 !important;
  line-height: 1.35;
}

.ks-ai-consent input {
  width: 0.9rem;
  height: 0.9rem;
  flex: 0 0 auto;
  margin: 0.08rem 0 0;
  accent-color: #3e352e;
}

.restaurant-page .ks-ai-consent input {
  accent-color: #713f35;
}

.ks-ai-consent a,
.ks-ai-lead-switch {
  color: #6d5949;
}

.ks-ai-consent a:hover,
.ks-ai-consent a:focus-visible,
.ks-ai-lead-switch:hover,
.ks-ai-lead-switch:focus-visible {
  color: #3e352e;
}

.ks-ai-lead-switch {
  margin-top: 0.72rem;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font: 500 0.65rem/1.2 "DM Sans", system-ui, sans-serif;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.ks-ai-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(65, 54, 45, 0.13);
  background: #fffdf9;
}

.ks-ai-input {
  min-width: 0;
  flex: 1 1 auto;
  border: 1px solid rgba(65, 54, 45, 0.22);
  border-radius: 999px;
  padding: 0.7rem 0.85rem;
  background: #fffaf3;
  color: #3e352e;
  font: 400 0.8rem/1.2 "DM Sans", system-ui, sans-serif;
}

.ks-ai-input:focus {
  border-color: #86705d;
  outline: 2px solid rgba(134, 112, 93, 0.2);
  outline-offset: 1px;
}

.ks-ai-submit {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #3e352e;
  color: #fffaf3;
  cursor: pointer;
  font-size: 1rem;
}

.restaurant-page .ks-ai-submit {
  background: #713f35;
}

.ks-ai-submit:disabled,
.ks-ai-input:disabled {
  cursor: wait;
  opacity: 0.58;
}

.ks-ai-note {
  padding: 0 1rem 0.72rem;
  color: #867568;
  font-size: 0.64rem;
  line-height: 1.35;
}

.ks-ai-note a {
  color: #6d5949;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

@media (max-width: 560px) {
  .ks-ai-launcher {
    right: 0.8rem;
    bottom: 0.8rem;
    padding: 0.75rem 0.9rem;
  }

  .ks-ai-panel {
    right: 0.5rem;
    bottom: 4.65rem;
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 5.4rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ks-ai-launcher,
  .ks-ai-panel,
  .ks-ai-typing span {
    animation: none;
    transition: none;
  }
}
