:root {
  --ink: #161616;
  --muted: #626262;
  --line: #ded8cf;
  --paper: #faf8f4;
  --surface: #ffffff;
  --brand: #235b55;
  --brand-dark: #173d39;
  --accent: #c88b3d;
  --user: #173d39;
  --bot: #f0ebe3;
  --danger: #8a2f1d;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

.klaus-page {
  background:
    linear-gradient(180deg, rgb(35 91 85 / 8%), transparent 42%),
    var(--paper);
}

.demo-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px 110px;
}

.demo-copy {
  width: min(680px, 100%);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(2.1rem, 8vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.demo-copy p:last-child {
  max-width: 54ch;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.demo-link-line {
  margin-top: 18px;
}

.demo-link-line a {
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.klaus-landing {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 28px;
  padding: 34px 18px 108px;
}

.klaus-hero {
  width: min(720px, 100%);
  margin: 0 auto;
}

.klaus-hero-avatar {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f7efe2, #d9efe9);
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--line), 0 12px 28px rgb(0 0 0 / 10%);
}

.klaus-hero-avatar .avatar-face {
  width: 42px;
  height: 36px;
}

.klaus-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(3rem, 16vw, 6.4rem);
  line-height: 0.94;
}

.hero-copy {
  max-width: 58ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 3.8vw, 1.18rem);
  line-height: 1.62;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.primary-action,
.secondary-action {
  min-height: 52px;
  border-radius: 8px;
  padding: 0 18px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.primary-action {
  border: 0;
  color: #fff;
  background: var(--brand);
}

.secondary-action {
  border: 1px solid var(--line);
  color: var(--brand-dark);
  background: #fff;
}

.klaus-info {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0 auto;
}

.klaus-info article {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.klaus-info h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  letter-spacing: 0;
}

.klaus-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.chat-launcher {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  min-height: 52px;
  min-width: 132px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 12px 26px rgb(0 0 0 / 18%);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.chat-window {
  position: fixed;
  inset: auto 10px 10px 10px;
  z-index: 30;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  height: calc(100dvh - 20px);
  max-height: calc(100dvh - 20px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 24px 60px rgb(0 0 0 / 22%);
}

.chat-window[hidden] {
  display: none;
}

.chat-header {
  min-height: 72px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #f7efe2, #d9efe9);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.avatar-face {
  position: relative;
  width: 30px;
  height: 26px;
  border: 2px solid var(--brand);
  border-radius: 8px;
  background: #fff;
}

.avatar-eye {
  position: absolute;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand-dark);
}

.avatar-eye.left {
  left: 7px;
}

.avatar-eye.right {
  right: 7px;
}

.avatar-mouth {
  position: absolute;
  left: 10px;
  bottom: 6px;
  width: 8px;
  height: 4px;
  border-bottom: 2px solid var(--accent);
  border-radius: 0 0 8px 8px;
}

.chat-title-group {
  min-width: 0;
}

.chat-title-group h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.chat-title-group p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.chat-messages {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 14px;
  background: #fbfaf7;
}

.message {
  width: fit-content;
  max-width: min(82%, 560px);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.96rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.bot {
  align-self: flex-start;
  background: var(--bot);
}

.message.user {
  align-self: flex-end;
  color: #fff;
  background: var(--user);
}

.message.error {
  align-self: flex-start;
  color: var(--danger);
  background: #fff1ec;
  border: 1px solid #efc7bb;
}

.chat-actions {
  padding: 10px 12px 0;
  background: #fff;
}

.contact-button {
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brand-dark);
  text-decoration: none;
  font-weight: 800;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
}

textarea {
  width: 100%;
  min-height: 46px;
  max-height: 128px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  line-height: 1.35;
}

textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(35 91 85 / 28%);
  outline-offset: 2px;
}

.send-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.send-button:disabled,
textarea:disabled {
  opacity: 0.62;
  cursor: wait;
}

.chat-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 0 12px 12px;
  background: #fff;
  font-size: 0.82rem;
}

.chat-footer a {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 720px) {
  .klaus-landing {
    padding-inline: 36px;
  }

  .klaus-info {
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
  }

  .chat-window {
    right: 22px;
    bottom: 22px;
    left: auto;
    width: 420px;
    height: min(700px, calc(100vh - 44px));
  }

  .chat-launcher {
    right: 22px;
    bottom: 22px;
  }
}
