/* Claude chat drawer on basket, outline, and draft pages */
.chat-tab {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 6;
  writing-mode: vertical-rl; background: var(--ink); color: #fff; padding: 12px 6px;
  border-radius: 8px 0 0 8px; font-size: 13px;
}
.chat-tab .pill { writing-mode: horizontal-tb; margin-top: 6px; }
.chat-drawer {
  display: none; position: fixed; right: 0; top: 49px; bottom: 0; width: 400px; z-index: 7;
  background: var(--card); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.06);
  flex-direction: column; padding: 0 16px 12px;
}
.chat-drawer:target, .chat-drawer.open { display: flex; }
.chat-drawer.closed { display: none; }
@media (min-width: 1240px) {
  body.chat-open main { margin-right: 410px; margin-left: auto; }
}
@media (max-width: 860px) { .chat-drawer { width: 100%; } }
.chat-head h2 { margin: 12px 0 4px; }
.chat-log { list-style: none; padding: 0; margin: 4px 0 8px; overflow: auto; flex: 1; display: grid; gap: 10px; align-content: start; }
.msg { border-radius: 8px; padding: 8px 10px; }
.msg-user { background: #f1efe9; }
.msg-assistant { background: #fff; border: 1px solid var(--line); }
.msg-body { white-space: pre-wrap; font-size: 14px; margin-top: 2px; }
.msg details { margin-top: 6px; }
.chat-form { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.chat-form textarea { width: 100%; resize: vertical; }
.proposal { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 8px; background: #faf9f6; font-size: 13px; }
.proposal.status-pending { border-color: #e8b44a; }
.proposal.status-applied, .proposal.status-rejected, .proposal.status-stale { opacity: .75; }
.proposal ul, .proposal ol { margin: 4px 0; padding-left: 20px; }
.proposal p { margin: 4px 0; }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0; }
.diff-side { border-radius: 6px; padding: 4px 8px; }
.diff-side.old { background: #fbe4e2; }
.diff-side.new { background: #e1f3e8; }
.diff-quote { font-style: italic; }
.proposal ins { background: #e1f3e8; text-decoration: none; font-weight: 600; }
.proposal del { background: #fbe4e2; }
