:root {
  --demo-card: rgba(12, 23, 37, 0.9);
  --demo-line: rgba(125, 226, 255, 0.24);
  --demo-text: #e7f4ff;
  --demo-muted: #9fb8ca;
  --demo-accent: #1dd1ff;
  --demo-accent-2: #9eff5f;
  --demo-danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--demo-text);
  font-family: "Mozilla Text", "Segoe UI", sans-serif;
}

.demo-shell {
  width: min(1200px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.demo-hero {
  margin-bottom: 2rem;
  padding: 1.75rem;
  border: 1px solid var(--demo-line);
  border-radius: 24px;
  background: rgba(3, 12, 20, 0.7);
  backdrop-filter: blur(4px);
}

.demo-kicker {
  margin: 0;
  color: var(--demo-accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.demo-hero h1 {
  margin: 0.6rem 0 0.8rem;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1;
}

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

.demo-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.demo-section {
  border-radius: 20px;
  border: 1px solid var(--demo-line);
  background: var(--demo-card);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: stretch;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  min-width: 0;
}

.demo-section > * {
  min-width: 0;
}

.demo-section h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.3;
}

.demo-section p {
  margin: 0;
  color: var(--demo-muted);
  line-height: 1.6;
}

.demo-form,
.chatbot-form {
  display: grid;
  gap: 0.65rem;
}

label {
  display: grid;
  gap: 0.32rem;
}

label span {
  font-size: 0.82rem;
  color: var(--demo-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input,
textarea,
button {
  font-family: "Anonymous Pro", monospace;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(199, 230, 255, 0.22);
  border-radius: 10px;
  padding: 0.68rem 0.75rem;
  background: rgba(4, 10, 16, 0.8);
  color: var(--demo-text);
}

input::placeholder,
textarea::placeholder {
  color: rgba(159, 184, 202, 0.65);
}

.demo-btn {
  border: 1px solid rgba(29, 209, 255, 0.5);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(29, 209, 255, 0.18), rgba(29, 209, 255, 0.08));
  color: var(--demo-text);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease;
}

.demo-btn:hover {
  transform: translateY(-1px);
  border-color: var(--demo-accent);
}

.demo-btn.ghost {
  border-color: rgba(158, 255, 95, 0.4);
  background: linear-gradient(180deg, rgba(158, 255, 95, 0.14), rgba(158, 255, 95, 0.06));
}

.demo-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.chart-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chart-layout {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  align-items: stretch;
}

.chart-controls {
  flex: 0 0 360px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-width: 0;
}

.chart-visual {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
}

#chart-surface {
  width: 100%;
  min-height: 320px;
  height: 100%;
  border-radius: 14px;
  border: 1px solid rgba(199, 230, 255, 0.38);
  background: #ffffff;
}

.chart-data-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--demo-muted);
  line-height: 1.6;
}

.demo-status {
  min-height: 1.4rem;
  font-size: 0.92rem;
}

.demo-status.error {
  color: var(--demo-danger);
}

.demo-status.success {
  color: var(--demo-accent-2);
}

.demo-code {
  margin: 0;
  border-radius: 10px;
  border: 1px solid rgba(199, 230, 255, 0.18);
  background: rgba(3, 8, 13, 0.92);
  color: #b4f3ff;
  overflow: auto;
  padding: 0.7rem;
  font-size: 0.8rem;
  line-height: 1.45;
}

.chatbot-window {
  height: 260px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(199, 230, 255, 0.2);
  background: rgba(2, 8, 14, 0.8);
  padding: 0.75rem;
  display: grid;
  gap: 0.45rem;
}

.chat-row {
  max-width: 88%;
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  line-height: 1.5;
  font-size: 0.92rem;
}

.chat-row.user {
  justify-self: end;
  background: rgba(29, 209, 255, 0.18);
  border: 1px solid rgba(29, 209, 255, 0.32);
}

.chat-row.bot {
  justify-self: start;
  background: rgba(158, 255, 95, 0.14);
  border: 1px solid rgba(158, 255, 95, 0.3);
}

.chatbot-quick-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chip {
  border-radius: 999px;
  border: 1px solid rgba(199, 230, 255, 0.28);
  background: rgba(7, 18, 28, 0.9);
  color: var(--demo-text);
  padding: 0.35rem 0.68rem;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  #chart-surface,
  .chatbot-window {
    height: 300px;
    min-height: 300px;
  }
}

@media (max-width: 640px) {
  .demo-shell {
    width: min(1200px, calc(100% - 1.2rem));
    padding-top: 1.5rem;
  }

  .demo-hero,
  .demo-section {
    border-radius: 16px;
  }
}
