/* File > Ask a question: the questions on the left, the one picked and its answer on the right, the question box under it. */
#card.chat-card { width: min(980px, 100%); height: min(680px, calc(100vh - 32px)); overflow: hidden; }
#card .chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
#card .chat-head .new {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
#card .chat-head .new:hover { background: var(--surface-2); color: var(--fg); }
#card .chat-tools { flex: none; display: flex; align-items: center; gap: 6px; }
#card .chat-head .close { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
#card .chat-head .close:hover { background: var(--surface-2); color: var(--fg); }
#card .chat-body { flex: 1; min-height: 0; display: flex; gap: 16px; }
#card .chat-list {
  list-style: none;
  margin: 0;
  padding: 0 12px 0 0;
  width: 240px;
  flex: none;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#card .chat-list button {
  width: 100%;
  padding: 8px 30px 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#card .chat-list li:hover button { background: var(--surface-2); }
#card .chat-list button.on { background: var(--surface-2); color: var(--accent); font-weight: 500; }
#card .chat-list button.busy { color: var(--muted); font-style: italic; }
#card .chat-list li { position: relative; }
#card .chat-list .chat-del { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); width: 22px; height: 22px; padding: 0; border-radius: 6px; color: var(--muted); font-size: 11px; text-align: center; }
#card .chat-list .chat-del:hover:not(:disabled) { color: var(--danger); }
#card .chat-list .chat-del:disabled { opacity: 0.4; background: none; cursor: default; }
#card .chat-list .none { padding: 8px 10px; color: var(--muted); font-size: 13px; }
#card .chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
#card .chat-thread { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; user-select: text; }
#card .chat-q {
  align-self: flex-end;
  max-width: 85%;
  padding: 9px 13px;
  border-radius: 12px;
  background: var(--surface-2);
  white-space: pre-wrap;
  word-break: break-word;
}
#card .chat-a { font-size: 14px; line-height: 1.55; word-break: break-word; }
#card .chat-a p { margin: 0 0 10px; }
#card .chat-a pre { margin: 0 0 10px; padding: 10px 12px; border-radius: 8px; background: var(--bg); overflow-x: auto; font-size: 12.5px; }
#card .chat-a code { font-family: var(--mono); }
#card .chat-a.busy { color: var(--muted); font-style: italic; }
#card .chat-a.err { color: var(--danger); }
#card .chat-ask {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-right: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
#card .chat-ask:focus-within { border-color: var(--accent); }
#card .chat-ask textarea {
  flex: 1;
  resize: none;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  outline: 0;
}
#card .chat-ask button {
  padding: 9px 16px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-fg);
  cursor: pointer;
}
#card .chat-ask button:hover { filter: brightness(1.05); }
@media (max-width: 640px) {
  #card .chat-body { flex-direction: column; }
  #card .chat-list { width: auto; max-height: 30%; padding: 0 0 8px; border-right: 0; border-bottom: 1px solid var(--border); }
}
