:root{--plate:#fff;--plate-2:#F8FAFE;--ink:#0C1A2B;--ink-2:#46586E;--ink-3:#7B8CA3;--rule:#DCE4F0;--rule-soft:#EBF0F8;--accent:#1554F0;--accent-deep:#0B3FC4;--accent-soft:#E9EFFE;--accent-line:#BBD0FC;--r-sm:8px;--r:12px;--r-lg:18px;--r-pill:999px;--sans:"Archivo","Helvetica Neue",Arial,sans-serif;--serif:"Source Serif 4",Georgia,serif;--shadow-sm:0 1px 2px rgba(12,26,43,.05);--shadow-lg:0 2px 4px rgba(12,26,43,.04),0 24px 56px -20px rgba(21,84,240,.22)}
/* ---------- chat demo ---------- */

.demo {
  background: var(--plate); border: 1px solid var(--rule); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto;
  /* fixed height: the stage must never resize the box, or the whole hero reflows */
  height: 33rem;
}
@media (max-width: 1000px) { .demo { height: 35rem; } }
@media (max-width: 520px)  { .demo { height: 36rem; } }
.demo-bar {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1.05rem; border-bottom: 1px solid var(--rule-soft); background: var(--plate-2);
}
.demo-dots { display: flex; gap: 6px; }
.demo-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--rule); display: block; }
.demo-title {
  font-family: var(--sans); font-size: .8rem; font-weight: 600; color: var(--ink-2);
  margin-left: .35rem;
}
.demo-tabs { margin-left: auto; display: flex; gap: .25rem; }
.demo-tab {
  font-family: var(--sans); font-size: .7rem; font-weight: 600;
  color: var(--ink-3); padding: .25rem .55rem .28rem; border-radius: var(--r-pill);
  transition: background .25s ease, color .25s ease;
}
.demo-tab[data-on="true"] { background: var(--accent); color: #fff; }
@media (max-width: 420px) { .demo-tab { font-size: .64rem; padding: .22rem .42rem; } }

.demo-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.demo-tile {
  background: var(--plate-2); border: 1px solid var(--rule-soft); border-radius: var(--r-sm);
  padding: .6rem .7rem; display: grid; gap: .12rem;
  animation: fadeUp .45s cubic-bezier(.2,.7,.3,1) both;
}
.demo-tile span {
  font-family: var(--sans); font-size: .62rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3);
}
.demo-tile b {
  font-family: var(--sans); font-weight: 700; font-size: 1.15rem; letter-spacing: -.025em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.demo-tile i {
  font-style: normal; font-family: var(--sans); font-size: .68rem; font-weight: 600;
}
.demo-tile i.up { color: #0F7B3D; }
.demo-tile i.down { color: #A62B22; }

.demo-doc { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; align-items: center; }
@media (max-width: 460px) { .demo-doc { grid-template-columns: 1fr; } }
.demo-doc-page {
  background: #fff; border: 1px solid var(--rule); border-radius: var(--r-sm);
  padding: .8rem .75rem; display: grid; gap: .38rem; box-shadow: var(--shadow-sm);
}
.demo-doc-page .ln { height: 6px; border-radius: 3px; background: var(--rule-soft); display: block; }
.demo-doc-page .w60 { width: 60%; } .demo-doc-page .w90 { width: 90%; }
.demo-doc-page .w75 { width: 75%; } .demo-doc-page .w80 { width: 80%; }
.demo-doc-page .w55 { width: 55%; }
.demo-doc-page .blk {
  height: 46px; border-radius: 4px; margin: .2rem 0; display: block;
  background: linear-gradient(120deg, var(--accent-soft), var(--accent-line));
}
.demo-doc-title { margin: 0; font-family: var(--sans); font-weight: 700; font-size: .95rem; }
.demo-doc-sub { margin: .1rem 0 .65rem; font-family: var(--sans); font-size: .78rem; color: var(--ink-3); }
.demo-dl {
  display: flex; align-items: center; gap: .45rem; margin-bottom: .4rem;
  font-family: var(--sans); font-size: .8rem; font-weight: 600; color: var(--accent-deep);
  background: var(--accent-soft); border-radius: var(--r-pill); padding: .42rem .8rem;
}
.demo-dl svg { width: 14px; height: 14px; flex: none; }

.demo-stage {
  padding: 1.15rem 1.2rem; display: flex; flex-direction: column; gap: .8rem;
  overflow: hidden; justify-content: flex-start;
  min-height: 0;
}
.demo-stage.demo-stage--chat { justify-content: flex-end; }   /* messages stack up from the bottom */
/* without this the flex items shrink and the chart gets cut off mid-bar */
.demo-stage > * { flex: 0 0 auto; }
.demo-q {
  align-self: flex-end; background: var(--accent); color: #fff;
  border-radius: var(--r) var(--r) 4px var(--r); padding: .6rem .9rem;
  font-family: var(--sans); font-size: .88rem; max-width: 30ch;
  box-shadow: 0 6px 16px -8px rgba(21,84,240,.6);
}
.demo-q .caret {
  display: inline-block; width: 2px; height: 1em; background: #fff;
  vertical-align: -.15em; margin-left: 1px; animation: caret 1s steps(1) infinite;
}
@keyframes caret { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }
.demo-a {
  background: var(--plate-2); border: 1px solid var(--rule-soft);
  border-radius: var(--r) var(--r) var(--r) 4px; padding: .85rem 1rem;
  font-size: .95rem; line-height: 1.5; max-width: 58ch;
}
.demo-a b { font-weight: 600; }
.demo-a .src {
  display: block; margin-top: .5rem; padding-top: .45rem; border-top: 1px solid var(--rule-soft);
  font-family: var(--sans); font-size: .7rem; color: var(--ink-3);
}
.demo-chart {
  border: 1px solid var(--rule-soft); border-radius: var(--r); background: var(--plate);
  padding: .8rem .9rem .5rem; overflow: hidden;
}
.demo-chart-title {
  font-family: var(--sans); font-size: .78rem; font-weight: 600; color: var(--ink-2);
  margin: 0 0 .4rem;
}
.demo-chart svg {
  display: block; width: 100%; height: auto;
  /* hold the chart at its design size so a full-width demo does not
     balloon it and push the question out of the frame */
  max-width: 470px; margin-inline: auto;
}
.demo-think { display: inline-flex; gap: 4px; align-items: center; padding: .3rem 0; }
.demo-think i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3);
  animation: blip 1.1s infinite ease-in-out;
}
.demo-think i:nth-child(2) { animation-delay: .16s; }
.demo-think i:nth-child(3) { animation-delay: .32s; }
@keyframes blip { 0%,60%,100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.demo-foot {
  border-top: 1px solid var(--rule-soft); padding: .75rem 1.05rem;
  display: flex; align-items: center; gap: .6rem; background: var(--plate-2);
}
.demo-input {
  flex: 1; background: var(--plate); border: 1px solid var(--rule); border-radius: var(--r-pill);
  padding: .5rem .9rem; font-family: var(--sans); font-size: .82rem; color: var(--ink-3);
}
.demo-send {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; flex: none;
}
.demo-send svg { width: 15px; height: 15px; }

.fade-in { animation: fadeUp .45s cubic-bezier(.2,.7,.3,1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

