:root {
  --page-bg: #f4f5fa;
  --surface: #ffffff;
  --border: #dbdade;
  --text: #4b465c;
  --muted: #8c8799;
  --primary: #7367f0;
  --primary-dark: #5e50ee;
  --shadow: 0 14px 40px rgba(75, 70, 92, 0.18);
  --radius: 14px;
  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(--text);
  background: var(--page-bg);
}

body.modal-open {
  overflow: hidden;
}

.demo-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 64px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(75, 70, 92, 0.06);
}

.chat-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(115, 103, 240, 0.28);
  cursor: pointer;
}

.chat-launcher:hover {
  background: var(--primary-dark);
}

.chat-launcher svg {
  width: 22px;
  height: 22px;
}

.chat-launcher img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.demo-content {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 24px;
}

.demo-content h1 {
  margin: 0 0 12px;
  font-size: 1.6rem;
}

.demo-content p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 24px;
  background: rgba(31, 34, 48, 0.42);
  z-index: 20;
}

.modal-backdrop.is-open {
  display: flex;
}

.chat-modal {
  position: relative;
  width: min(1120px, 100%);
  height: min(780px, calc(100vh - 48px));
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(219, 218, 222, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 20px rgba(75, 70, 92, 0.14);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.modal-close:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.chat-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
}

@media (max-width: 720px) {
  .demo-nav {
    padding: 0 16px;
  }

  .modal-backdrop {
    padding: 0;
  }

  .chat-modal {
    width: 100%;
    height: 100vh;
    border: 0;
    border-radius: 0;
  }
}
