/* ChartMogul AI page. Shared layout comes from /platform/feature.css. */
:root {
  --accent: #007DF1;
  --accent-soft: #ECF6FE;
  --accent-line: #9FD0FF;
}

/* Hero: a question, the tools used, and an answer */
#chat {
  p { font-size: .9rem; }
  .label { font-size: .75rem; }
  .question {
    align-self: flex-end;
    max-width: 85%;
    padding: .65rem .9rem;
    color: white;
    background: #13283F;
    border-radius: 1rem 1rem .25rem 1rem;
  }
  .steps {
    color: #626E89;
    font-size: .78rem;
    &::before { content: "✓ "; color: #149A57; }
  }
  .answer {
    display: flex;
    flex-flow: column;
    gap: .9rem;
    padding: 1rem 1.1rem;
    background: var(--accent-soft);
    border-radius: 1rem;
  }
  .source {
    color: #007DF1;
    font-weight: 600;
    font-size: .82rem;
  }
}
.compare {
  display: flex;
  flex-flow: column;
  gap: .6rem;
  li {
    display: grid;
    grid: auto / 4.5rem 1fr 2.5rem;
    align-items: center;
    gap: .6rem;
  }
  span { color: #626E89; }
  i {
    height: .7rem;
    width: calc(var(--v) * 1%);
    background: var(--accent);
    border-radius: 1rem;
  }
  li + li i { background: var(--accent-line); }
  b { text-align: right; color: #091121; }
}

/* A report with the Ask AI panel open beside it */
#panel {
  display: grid;
  grid: auto / 1.4fr 1fr;
  gap: 1rem;
  .report {
    display: flex;
    flex-flow: column;
    gap: 1rem;
    justify-content: flex-end;
  }
  .bars { height: 9rem; }
  .side {
    display: flex;
    flex-flow: column;
    gap: .7rem;
    padding: .9rem;
    background: #F4F7FB;
    border-radius: 1rem;
  }
  .tag {
    color: var(--accent);
    font: 500 .75rem "Noto Sans Mono", monospace;
    text-transform: uppercase;
  }
  .question {
    align-self: flex-end;
    padding: .45rem .7rem;
    color: white;
    background: #13283F;
    border-radius: .8rem .8rem .2rem .8rem;
  }
  @media (width < 30rem){ grid: auto / 1fr; }
}
.split-bars {
  display: flex;
  flex-flow: column;
  gap: .45rem;
  li {
    position: relative;
    height: 1.4rem;
    background: white;
    border-radius: .4rem;
    overflow: hidden;
    &::before {
      content: "";
      position: absolute;
      inset: 0 auto 0 0;
      width: calc(var(--v) * 1%);
      background: var(--accent-line);
    }
  }
  span {
    position: relative;
    padding-left: .5rem;
    line-height: 1.4rem;
    font-size: .75rem;
    font-weight: 600;
    color: #091121;
  }
}

/* An AI-made Sankey chart */
#sankey {
  svg {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;
  }
  rect { fill: #13283F; }
  .keep { fill: var(--accent-line); }
  .grow { fill: #8FD9B0; }
  .lose { fill: #F59E8B; }
}
.legend {
  display: flex;
  flex-flow: column;
  gap: .4rem;
  li {
    display: flex;
    align-items: center;
    gap: .5rem;
    &::before {
      content: "";
      width: .7rem;
      height: .7rem;
      border-radius: 2px;
      background: var(--c);
    }
    b { flex: 1; font-weight: 500; color: #29303E; }
  }
  .keep { --c: var(--accent-line); }
  .grow { --c: #8FD9B0; }
  .lose { --c: #F59E8B; }
}

#why header { max-width: 52rem; }
