/* Chat: conversation with the composer pinned, right rail with what the AI uses right now. */
.scroll:has(> .chat) { overflow: hidden; }
.chat { display: grid; grid-template-columns: minmax(0, 1fr) 300px; height: 100%; min-height: 0; }
.chat-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 24px 0; flex: none; }
.chat-head .sp { flex: 1; }
.threads { left: 0; right: auto; width: 340px; max-height: 60vh; overflow-y: auto; }
.threads .trow { display: flex; align-items: center; gap: 2px; }
.threads .trow > a { flex: 1; min-width: 0; }
.threads .trow > button, .threads .trow-ask button { width: auto; flex: none; }
.threads .trow-ask { display: inline-flex; gap: 4px; flex: none; }
.rail-mini { display: none; margin-bottom: 8px; }
.rail-mini summary { cursor: pointer; }
.rail-mini .railist { margin: 8px 0; }
.threads .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 290px; }
.d-block { display: block; }
.grow { flex: 1; min-width: 0; }
.thread { flex: 1; min-height: 0; overflow-y: auto; padding: 18px max(24px, calc((100% - 760px) / 2)) 24px; display: flex; flex-direction: column; gap: 26px; }
.chat-start { margin: auto 0; padding: 18px 0; display: flex; flex-direction: column; gap: 10px; }
.suggestions { margin-top: 12px; }
.sugg { padding: 12px 16px; text-align: left; font-size: 14.5px; font-weight: 500; transition: border-color var(--duration-quick); }
.sugg:hover { border-color: var(--line); }
.turn.user { display: flex; justify-content: flex-end; }
.bubble { max-width: 78%; padding: 10px 16px; border-radius: 18px 18px 4px 18px; background: var(--surface); border: 1.5px solid var(--line-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.composer { position: relative; flex: none; padding: 8px max(24px, calc((100% - 760px) / 2)) 16px; }
.composer-foot { display: flex; align-items: center; gap: 12px; padding: 8px 4px 0; flex-wrap: wrap; }
.chipselect { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border: 1.5px solid var(--line-soft); border-radius: var(--radius-pill); }
.chipselect select { border: 0; background: transparent; font-size: 13px; font-weight: 600; padding: 3px 0; max-width: 200px; }
.chipselect:focus-within { border-color: var(--line); }
.picker { left: max(24px, calc((100% - 760px) / 2)); right: auto; top: auto; bottom: calc(100% - 4px); width: min(420px, calc(100% - 48px)); max-height: 280px; overflow-y: auto; }
.picker .label { padding: 4px 10px 6px; }
.picker button.picked { background: var(--surface-sunken); }
.sp-l { margin-left: auto; }
.rail { display: flex; flex-direction: column; gap: 22px; padding: 22px 20px; border-left: 1.5px solid var(--line-soft); background: var(--surface); overflow-y: auto; min-height: 0; }
.rail section { display: flex; flex-direction: column; gap: 8px; }
.railist { display: flex; flex-direction: column; gap: 8px; }
.railist li { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; line-height: 1.3; }
.railist .dot { margin-top: 5px; }
@media (max-width: 1080px) {
  .chat { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .rail-mini { display: block; }
}
@media (max-width: 820px) {
  .thread, .composer { padding-left: 16px; padding-right: 16px; }
  .chat-head { padding: 8px 12px 0; }
  .bubble { max-width: 90%; }
  .picker { left: 16px; width: calc(100% - 32px); }
}
