/* Q&A with Code: a /cloudaeye:ask session laid out like the CodeCortex chat,
   with the conversation on the left and the files the answer rests on at
   the right. Builds on solutions/index.css and command-page.css. */
.qa-app {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 18px;
  padding: 24px;
}

/* Conversation */
.qa-chat {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.qa-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}
.qa-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}
.ri-page .qa-chip svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}
.qa-thread {
  display: grid;
  gap: 18px;
  padding: 20px 18px;
}
.qa-q {
  display: flex;
  justify-self: end;
  align-items: flex-start;
  gap: 10px;
  max-width: 88%;
}
.ri-page .qa-q p {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px 10px 2px 10px;
  background: var(--blue-dark);
  color: #fff;
  font-size: 14px;
  line-height: 1.55;
}
.ri-page .qa-q code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgb(255 255 255 / 16%);
  color: #fff;
  font-size: 13px;
}
.qa-avatar,
.qa-mark {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
}
.qa-avatar {
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
}
.qa-mark {
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
}
.ri-page :is(.qa-avatar, .qa-mark) svg {
  width: 16px;
  height: 16px;
}
.qa-a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.qa-answer {
  min-width: 0;
  flex: 1;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 2px 10px 10px 10px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}
.ri-page .qa-answer h4 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}
.ri-page .qa-answer p {
  margin: 0 0 14px;
}
.ri-page .qa-answer > :last-child {
  margin-bottom: 0;
}
.ri-page .qa-answer code {
  color: var(--ink);
  font-size: 13px;
}
.qa-callers {
  margin: 6px 0 14px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  list-style: none;
}
.qa-callers li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 12px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
}
.qa-callers li:first-child {
  border-top: 0;
}
.ri-page .qa-callers small {
  grid-column: 1;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.qa-callers .cp-pill {
  grid-column: 2;
  grid-row: 1 / span 2;
}
.qa-input {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.qa-input span {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
}
.qa-input b {
  display: grid;
  width: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
}
.ri-page .qa-input svg {
  width: 16px;
  height: 16px;
}

/* Files the answer rests on */
.qa-side {
  align-self: start;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.qa-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.qa-side-head span {
  color: var(--muted);
  font-weight: 500;
}
.qa-sources {
  margin: 0;
  padding: 4px 16px;
  list-style: none;
}
.qa-sources li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 2px 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.qa-sources li:first-child {
  border-top: 0;
}
.ri-page .qa-sources svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: #2f7d55;
}
.ri-page .qa-sources code {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.ri-page .qa-sources small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.ri-page .qa-side-foot {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.ri-page .qa-side-foot svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 2px;
}

@media (max-width: 900px) {
  .qa-app {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 560px) {
  .qa-app {
    padding: 12px;
  }
  .qa-thread {
    padding: 16px 12px;
  }
  .qa-q {
    max-width: 100%;
  }
  .qa-avatar,
  .qa-mark {
    display: none;
  }
  .qa-answer {
    padding: 14px;
  }
  .qa-callers li {
    grid-template-columns: minmax(0, 1fr);
  }
  .qa-callers .cp-pill {
    grid-row: auto;
    grid-column: 1;
    justify-self: start;
  }
}
