:root {
  --ink: #17201f;
  --muted: #66716f;
  --soft: #f5f7f4;
  --paper: #ffffff;
  --line: #dfe6e1;
  --green: #0f6a4f;
  --mint: #dff5ea;
  --blue: #245b92;
  --blue-soft: #e8f1fb;
  --amber: #a66b00;
  --amber-soft: #fff3d7;
  --red: #a43a2e;
  --red-soft: #ffe8e3;
  --shadow: 0 22px 52px rgba(24, 37, 34, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #eef3f0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 24px;
  align-items: stretch;
  min-height: 420px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(15, 106, 79, 0.94), rgba(21, 54, 77, 0.86)),
    url("assets/hero-support.svg");
  background-size: cover;
  background-position: center;
  color: #fff;
  box-shadow: var(--shadow);
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 22px;
  padding: clamp(28px, 5vw, 56px);
}

.badge-row,
.hero-actions,
.sample-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.badge-light {
  background: #fff;
  color: var(--green);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  max-width: 760px;
  font-size: clamp(3rem, 8vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-text {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.primary-link,
.secondary-button,
.small-button,
.composer button,
.sample-row button,
select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 900;
  text-decoration: none;
}

.primary-link {
  background: #fff;
  color: var(--green);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.impact-strip {
  display: grid;
  align-content: end;
  gap: 12px;
  padding: clamp(22px, 4vw, 38px);
  background: rgba(6, 25, 22, 0.26);
}

.impact-strip div {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.impact-strip strong {
  display: block;
  font-size: 2rem;
}

.impact-strip span {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.story {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.usage-section {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow);
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.usage-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.usage-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
}

.usage-grid p {
  color: var(--muted);
  line-height: 1.45;
}

.story article,
.chat-card,
.ai-card,
.winner-section,
.pipeline-section,
.impact-section,
dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow);
}

.story article {
  display: grid;
  gap: 9px;
  padding: 18px;
}

.story span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--mint);
  color: var(--green);
  font-weight: 900;
}

.story h2 {
  font-size: 1.05rem;
}

.story p,
.winner-grid p,
.pipeline-copy p,
.pipeline-grid p,
.impact-grid p,
.ticket-box p,
.resolution-box p {
  color: var(--muted);
  line-height: 1.55;
}

.demo {
  scroll-margin-top: 18px;
}

.demo-header,
.dialog-title,
.card-title,
.ticket-box,
.winner-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.demo-header {
  margin: 28px 0 14px;
}

.demo-header h2,
.winner-section h2 {
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  letter-spacing: 0;
}

.section-label {
  display: block;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.small-button {
  background: var(--ink);
  color: #fff;
}

.demo-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.select-control,
.knowledge-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

select {
  min-width: 160px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.demo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 18px;
}

.chat-card,
.ai-card {
  padding: 18px;
}

.card-title h3 {
  margin-top: 4px;
  font-size: 1.2rem;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.state-pill.green {
  background: var(--mint);
  color: var(--green);
}

.sample-row {
  margin: 18px 0 12px;
}

.sample-row button {
  min-height: 36px;
  padding: 0 12px;
  background: var(--blue-soft);
  color: var(--blue);
}

.sample-row button.selected {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(36, 91, 146, 0.18);
}

.sample-status {
  margin: -2px 0 12px;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 800;
}

.chat-log {
  display: grid;
  align-content: start;
  gap: 12px;
  height: 390px;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.88)),
    url("assets/chat-pattern.svg");
}

.message {
  max-width: 84%;
  padding: 13px 14px;
  border-radius: 8px;
  line-height: 1.45;
}

.message.customer {
  justify-self: end;
  background: var(--blue);
  color: #fff;
}

.message.bot {
  justify-self: start;
  background: var(--mint);
  color: #12372d;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
}

.composer button {
  background: var(--green);
  color: #fff;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.signal-grid div {
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.signal-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.signal-grid strong {
  font-size: 1.1rem;
}

.resolution-box,
.ticket-box,
.handoff-box {
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.resolution-box p {
  margin-top: 8px;
}

.ticket-box h4 {
  margin-top: 4px;
  font-size: 1.12rem;
}

pre {
  white-space: pre-wrap;
  margin: 8px 0 0;
  color: #263331;
  font: inherit;
  line-height: 1.5;
}

.winner-section {
  align-items: stretch;
  margin-top: 18px;
  padding: 22px;
}

.pipeline-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  margin-top: 18px;
  padding: 22px;
}

.pipeline-copy {
  display: grid;
  align-content: center;
  gap: 10px;
}

.pipeline-copy h2,
.impact-section h2 {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pipeline-grid article,
.impact-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.pipeline-grid span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 12px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
}

.pipeline-grid h3 {
  margin-bottom: 8px;
}

.winner-section > div:first-child {
  max-width: 430px;
}

.winner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.winner-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.winner-grid h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.ops-section {
  margin-top: 18px;
}

.impact-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
  padding: 22px;
}

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

.impact-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 1.02rem;
}

.ops-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.ops-header h2 {
  max-width: 760px;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
}

.ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.9fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.ops-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow);
}

.ticket-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.ticket-item {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.ticket-item strong {
  color: var(--green);
}

.ticket-item span {
  color: var(--muted);
  line-height: 1.4;
}

.knowledge-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.knowledge-form textarea {
  min-height: 136px;
}

.api-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.api-card p {
  color: var(--muted);
  line-height: 1.55;
}

.api-card code {
  display: block;
  overflow-wrap: anywhere;
  padding: 12px;
  border-radius: 8px;
  background: #102521;
  color: #dff5ea;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  padding: 18px;
}

dialog::backdrop {
  background: rgba(19, 30, 28, 0.5);
}

#summaryOutput {
  min-height: 360px;
  margin-top: 16px;
}

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

@media (max-width: 940px) {
  .hero,
  .demo-grid,
  .winner-section,
  .pipeline-section,
  .pipeline-grid,
  .impact-section,
  .impact-grid,
  .ops-grid {
    grid-template-columns: 1fr;
  }

  .impact-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .story,
  .usage-grid,
  .winner-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .hero-copy,
  .chat-card,
  .ai-card,
  .winner-section {
    padding: 14px;
  }

  .impact-strip,
  .signal-grid,
  .composer {
    grid-template-columns: 1fr;
  }

  .demo-header,
  .dialog-title,
  .card-title,
  .ticket-box,
  .winner-section,
  .impact-section,
  .ops-header {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-log {
    height: 360px;
  }

  .message {
    max-width: 100%;
  }
}
