:root {
  --ink: #172033;
  --muted: #637083;
  --line: #d9e2ec;
  --brand: #1f6feb;
  --brand-soft: #e8f1ff;
  --surface: #ffffff;
  --page: #f3f6fa;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.site-preview {
  min-height: 100vh;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 0;
}

.topbar strong {
  font-size: 20px;
}

.topbar nav {
  display: flex;
  gap: 24px;
}

.topbar a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.hero {
  max-width: 1120px;
  margin: 68px auto 48px;
  padding: 58px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand);
  font-weight: 700;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: 48px;
  line-height: 1.18;
  letter-spacing: 0;
}

.summary {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.content-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
}

.content-band article {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.content-band h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.content-band p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.kaina-chat {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
}

.chat-launcher {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #cad5e2;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(23, 32, 51, 0.22);
  cursor: pointer;
}

.chat-launcher:hover {
  border-color: var(--brand);
}

.avatar-face {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 999px;
  background: #f7d8c8;
  border: 3px solid #ffffff;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.08);
}

.avatar-face.small {
  width: 30px;
  height: 30px;
  border-width: 2px;
}

.avatar-hair {
  position: absolute;
  inset: 0 0 16px;
  background: #2b211d;
  border-radius: 999px 999px 45% 45%;
}

.avatar-head {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 5px;
  height: 27px;
  border-radius: 50% 50% 45% 45%;
  background: #f4c5ad;
}

.avatar-eye {
  position: absolute;
  top: 22px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #241f1b;
}

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

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

.avatar-smile {
  position: absolute;
  left: 18px;
  top: 29px;
  width: 8px;
  height: 4px;
  border-bottom: 2px solid #8b3c30;
  border-radius: 0 0 999px 999px;
}

.small .avatar-hair {
  bottom: 11px;
}

.small .avatar-head {
  left: 6px;
  right: 6px;
  bottom: 4px;
  height: 20px;
}

.small .avatar-eye {
  top: 16px;
  width: 3px;
  height: 3px;
}

.small .avatar-eye.left {
  left: 11px;
}

.small .avatar-eye.right {
  right: 11px;
}

.small .avatar-smile {
  left: 13px;
  top: 21px;
  width: 6px;
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(560px, calc(100vw - 32px));
  height: min(610px, calc(100vh - 112px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d3dce8;
  border-radius: 12px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.kaina-chat.open .chat-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.kaina-chat.open .chat-launcher {
  display: none;
}

.chat-top {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid #eef2f7;
}

.window-actions,
.contact-actions,
.composer-tools,
.left-tools {
  display: flex;
  align-items: center;
}

.window-actions,
.contact-actions {
  gap: 6px;
}

.icon-button,
.tool-button,
.voice-button {
  border: 0;
  background: transparent;
  color: #111827;
  cursor: pointer;
  font: inherit;
}

.icon-button {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
}

.icon-button:hover,
.tool-button:hover,
.voice-button:hover {
  background: #f1f5f9;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 16px;
  background: #fff;
}

.assistant-card {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  max-width: 440px;
}

.assistant-card strong {
  display: block;
  margin-bottom: 6px;
}

.assistant-card p,
.message-bubble {
  margin: 0;
  line-height: 1.65;
  color: #344054;
}

.mini-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef4ff;
}

.message-row {
  display: flex;
  margin: 14px 0 0;
}

.message-row.user {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 14px;
  background: #f2f5f9;
}

.message-row.user .message-bubble {
  background: var(--brand);
  color: #fff;
}

.chat-composer {
  margin: 0 14px 14px;
  padding: 12px 14px 10px;
  border: 1px solid #9ec5ff;
  border-radius: 18px;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.06);
}

.chat-composer textarea {
  width: 100%;
  min-height: 32px;
  max-height: 96px;
  resize: none;
  border: 0;
  outline: 0;
  font: inherit;
  line-height: 1.55;
}

.composer-tools {
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.left-tools {
  flex-wrap: wrap;
  gap: 4px;
}

.tool-button {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 13px;
}

.voice-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 18px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .site-preview {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    gap: 14px;
    flex-direction: column;
  }

  .topbar nav {
    flex-wrap: wrap;
    gap: 12px;
  }

  .hero {
    margin-top: 34px;
    padding: 36px 0;
  }

  .hero h1 {
    font-size: 32px;
  }

  .summary {
    font-size: 16px;
  }

  .content-band {
    grid-template-columns: 1fr;
  }

  .kaina-chat {
    right: 16px;
    bottom: 16px;
  }

  .chat-panel {
    position: fixed;
    inset: 10px;
    width: auto;
    height: auto;
  }

  .chat-body {
    padding: 18px 16px 12px;
  }
}
