.demo-page {
  min-height: 100vh;
}

.demo-topbar {
  position: relative;
  z-index: 5;
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
  min-height: 64px;
  padding: 10px 12px 10px 18px;
  border: 1px solid rgba(255, 46, 62, 0.18);
  border-radius: 999px;
  background: rgba(14, 8, 10, 0.76);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 12px 40px -12px rgba(255, 46, 62, 0.24);
}

[data-theme="light"] .demo-topbar {
  background: rgba(255, 255, 255, 0.82);
}

.demo-brand {
  display: flex;
  flex-direction: column;
  line-height: 1;
  min-width: 0;
}

.demo-brand__mark {
  font-weight: 900;
  letter-spacing: 0;
  font-size: 18px;
}

.demo-brand__mark span,
.demo-dot {
  color: var(--accent);
}

.demo-brand__sub {
  margin-top: 5px;
  color: var(--text-dim);
  font: 500 11px/1 var(--font-mono);
  text-transform: uppercase;
}

.demo-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 14px;
  white-space: nowrap;
}

.demo-lang {
  position: relative;
}

.demo-lang .lang {
  min-height: 40px;
}

.demo-lang .lang-dd {
  right: 0;
  left: auto;
}

.demo-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
}

.demo-nav a:hover,
.demo-nav__cta {
  color: var(--text);
  background: var(--accent-soft);
}

.demo-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) 0 80px;
}

.demo-hero {
  min-height: calc(100vh - 120px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 430px);
  align-items: center;
  gap: clamp(28px, 6vw, 72px);
}

.demo-copy {
  max-width: 660px;
  min-width: 0;
}

.demo-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font: 600 13px/1 var(--font-mono);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.demo-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
}

.demo-copy h1 {
  font-size: clamp(38px, 7vw, 82px);
  line-height: 0.94;
  letter-spacing: 0;
  max-width: 760px;
}

.demo-copy p {
  max-width: 620px;
  color: var(--text-dim);
  font-size: clamp(17px, 2vw, 21px);
  margin-top: 24px;
}

.demo-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.demo-hero-actions .btn {
  min-width: min(100%, 230px);
  justify-content: center;
}

.demo-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 34px;
  max-width: 590px;
}

.demo-proof div {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

[data-theme="light"] .demo-proof div {
  background: rgba(255, 255, 255, 0.68);
}

.demo-proof b {
  font-size: 26px;
  color: var(--text);
  letter-spacing: 0;
}

.demo-proof span {
  color: var(--text-dim);
  font-size: 13px;
}

.phone-demo {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.phone-demo__frame {
  width: min(100%, 420px);
  height: min(760px, calc(100vh - 150px));
  min-height: 620px;
  border: 1px solid rgba(255, 46, 62, 0.22);
  border-radius: 34px;
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(255, 46, 62, 0.16), transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  box-shadow:
    0 30px 90px -35px rgba(255, 46, 62, 0.56),
    inset 0 0 0 8px rgba(255, 255, 255, 0.025);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

.phone-demo__status {
  display: flex;
  justify-content: space-between;
  padding: 16px 24px 8px;
  color: var(--text-dim);
  font: 600 12px/1 var(--font-mono);
}

.phone-demo__signal {
  color: #6ee7b7;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px 18px;
  border-bottom: 1px solid var(--line);
}

.chat-head__avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--accent-2), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.chat-head__name {
  font-weight: 800;
  letter-spacing: 0;
}

.chat-head__meta {
  color: var(--text-dim);
  font-size: 12px;
  margin-top: 2px;
}

.chat-progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 12px 22px;
}

.chat-progress span {
  height: 3px;
  border-radius: 999px;
  background: var(--line-2);
}

.chat-progress span.is-active {
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.chat-log {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.chat-msg {
  max-width: 86%;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
  animation: msgIn .22s var(--ease-out) both;
}

.chat-msg--bot {
  align-self: flex-start;
  background: var(--bg-3);
  border: 1px solid var(--line);
}

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

.chat-msg b {
  font-weight: 800;
}

.chat-actions {
  border-top: 1px solid var(--line);
  padding: 14px;
  display: grid;
  gap: 8px;
  background: rgba(0, 0, 0, 0.12);
}

.chat-actions__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.chat-choice {
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  line-height: 1.25;
  transition: transform .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}

.chat-choice:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 46, 62, 0.5);
  background: var(--accent-soft);
}

.chat-choice--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-align: center;
  font-weight: 800;
}

.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.chat-input-row input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg-2);
  padding: 0 12px;
  outline: 0;
}

.chat-input-row input:focus {
  border-color: rgba(255, 46, 62, 0.7);
}

.chat-input-row button {
  height: 48px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: 0 16px;
}

.owner-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 20px;
  align-items: stretch;
  padding-top: 20px;
}

.owner-card,
.demo-lead-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  padding: clamp(22px, 4vw, 34px);
}

.owner-card__eyebrow {
  color: var(--accent);
  font: 700 12px/1 var(--font-mono);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.owner-card h2 {
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.02;
  letter-spacing: 0;
  max-width: 720px;
}

.owner-card p {
  margin-top: 18px;
  color: var(--text-dim);
  max-width: 680px;
  font-size: 17px;
}

.owner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.owner-grid div {
  min-height: 110px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-dim);
}

.owner-grid em {
  display: block;
  font-style: normal;
}

.owner-grid span {
  display: block;
  color: var(--accent);
  font: 800 13px/1 var(--font-mono);
  margin-bottom: 18px;
}

.demo-lead-form {
  display: grid;
  gap: 14px;
}

.demo-lead-form label {
  display: grid;
  gap: 7px;
  color: var(--text-dim);
  font-size: 13px;
}

.demo-lead-form input,
.demo-lead-form textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  padding: 13px 14px;
  font: inherit;
  outline: 0;
  resize: vertical;
}

.demo-lead-form input:focus,
.demo-lead-form textarea:focus {
  border-color: rgba(255, 46, 62, 0.72);
}

.demo-lead-form .btn {
  width: 100%;
  justify-content: center;
}

.demo-form-state {
  min-height: 20px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.4;
}

.demo-form-state.is-ok {
  color: #6ee7b7;
}

.demo-form-state.is-error {
  color: var(--accent-2);
}

.demo-sticky-cta {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 30;
  width: min(460px, calc(100% - 20px));
  transform: translateX(-50%);
  display: none;
  grid-template-columns: 1.25fr .85fr .85fr;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 46, 62, 0.28);
  border-radius: 18px;
  background: rgba(12, 7, 9, 0.88);
  box-shadow: 0 20px 60px -24px rgba(255, 46, 62, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

[data-theme="light"] .demo-sticky-cta {
  background: rgba(255, 255, 255, 0.92);
}

.demo-sticky-cta a,
.demo-sticky-cta button {
  min-width: 0;
  min-height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 13px;
  line-height: 1.1;
  text-align: center;
}

.demo-sticky-cta__start {
  color: #fff !important;
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 940px) {
  .demo-hero,
  .owner-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .demo-hero {
    min-height: 0;
    align-items: start;
  }

  .phone-demo__frame {
    height: 720px;
  }
}

@media (max-width: 680px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .demo-topbar {
    width: calc(100% - 20px);
    border-radius: 20px;
    align-items: flex-start;
  }

  .demo-nav a:not(.demo-nav__cta) {
    display: none;
  }

  .demo-lang .lang {
    display: inline-flex;
    min-height: 40px;
    padding: 0 10px;
  }

  .demo-lang .lang-dd {
    right: -76px;
  }

  .demo-shell {
    width: calc(100% - 20px);
    max-width: calc(100% - 20px);
    padding-top: 28px;
    overflow-x: hidden;
  }

  .demo-copy,
  .phone-demo,
  .owner-card,
  .demo-lead-form {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .demo-copy h1 {
    font-size: clamp(34px, 10.2vw, 42px);
    max-width: 100%;
    overflow-wrap: normal;
    word-break: normal;
  }

  .demo-copy p {
    margin-top: 16px;
    font-size: 16px;
  }

  .demo-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .demo-hero-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .demo-proof,
  .owner-grid {
    grid-template-columns: 1fr;
  }

  .demo-proof {
    display: none;
  }

  .phone-demo__frame {
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    min-height: 620px;
    height: min(680px, calc(100vh - 24px));
  }

  .chat-actions__grid {
    grid-template-columns: 1fr;
  }

  .chat-msg {
    max-width: 94%;
  }

  .demo-sticky-cta {
    display: grid;
  }

  .demo-page {
    padding-bottom: 84px;
  }
}
