:root {
  --bg: #0b0e14;
  --bg-soft: #111621;
  --card: #151b26;
  --line: #232b3a;
  --text: #e8edf6;
  --muted: #93a0b5;
  --accent: #7c9cff;
  --accent-dim: #2a3a66;
  --user: #2b3a5e;
  --ok: #4ec9a0;
  --warn: #f0b860;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

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

/* ------------------------------- topbar ------------------------------- */

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(11, 14, 20, .86);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  font-size: 20px;
  line-height: 1;
}

.brand strong { display: block; font-size: 15px; }
.brand small { display: block; color: var(--muted); font-size: 12px; }

.topbar-cta {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  border: 1px solid var(--accent-dim);
  padding: 7px 13px;
  border-radius: 999px;
  white-space: nowrap;
}
.topbar-cta:hover { background: var(--accent-dim); }

/* -------------------------------- hero -------------------------------- */

.hero { padding: 44px 0 8px; }

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(24px, 4.4vw, 34px);
  line-height: 1.22;
  letter-spacing: -.5px;
}

.lede {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
  font-size: 15px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero-badges span {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
}

/* ------------------------------ chat shell ---------------------------- */

.chat-shell {
  margin: 26px 0;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .34);
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-dim);
  font-size: 17px;
}

.chat-head-text { flex: 1; min-width: 0; }
.chat-head-text strong { display: block; font-size: 14px; }
.chat-head-text small { display: block; color: var(--muted); font-size: 11.5px; }

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.ghost:hover { color: var(--text); border-color: var(--accent-dim); }

.chat-log {
  flex: 1;
  padding: 18px 16px;
  max-height: 52vh;
  min-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.msg { display: flex; }
.msg.user { justify-content: flex-end; }

.bubble {
  max-width: min(78%, 520px);
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14.5px;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.bot .bubble {
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.msg.user .bubble {
  background: var(--user);
  border-bottom-right-radius: 4px;
}

.msg.note .bubble {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

.typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1.1s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }

@keyframes blink {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.chat-suggest {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 16px 12px;
}

.chip {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
}
.chip:hover { color: var(--text); border-color: var(--accent-dim); }

.chat-form {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--card);
  align-items: flex-end;
}

#input {
  flex: 1;
  resize: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14.5px;
  max-height: 120px;
  line-height: 1.45;
}
#input:focus { outline: none; border-color: var(--accent-dim); }

#send {
  background: var(--accent);
  color: #0a0e16;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
#send:disabled { opacity: .45; cursor: not-allowed; }

.chat-foot {
  margin: 0;
  padding: 0 16px 12px;
  color: var(--muted);
  font-size: 11px;
}

/* ------------------------------- catalog ------------------------------ */

.catalog { padding: 8px 0 40px; }

.catalog h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--muted);
  margin: 0 0 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card h3 {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.35;
}

.price { margin: 0; color: var(--accent); font-weight: 600; font-size: 14px; }
.desc { margin: 0; color: var(--muted); font-size: 12.5px; flex: 1; }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.stock { font-size: 11.5px; color: var(--muted); }

/* -------------------------------- foot -------------------------------- */

.foot {
  border-top: 1px solid var(--line);
  padding: 20px 0 34px;
  color: var(--muted);
  font-size: 12.5px;
}
.foot p { margin: 0 0 4px; }
.foot .muted a { color: var(--accent); text-decoration: none; }

@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .hero { padding-top: 28px; }
  .chat-log { max-height: 56vh; min-height: 240px; }
  .bubble { max-width: 88%; }
}