.chat-row {
  --chat-fill:#fffaf1; --chat-edge:#d3c1a6; --chat-base:#dcccaf;
  display:flex; align-items:flex-start; gap:9px; margin:9px 0; min-width:0;
}
.chat-row-right { flex-direction:row-reverse; --chat-fill:#e8e5cb; --chat-edge:#b7af88; --chat-base:#bdb791; }
.chat-avatar {
  display:grid; place-items:center; flex:none; width:32px; height:32px; margin-top:12px;
  border:1px solid #bca585; border-radius:6px; color:#76513b; background:#f4e6cb var(--paper) center/150px;
  font:750 13px/1 var(--font-round, var(--sans)); box-shadow:0 1px 0 #69452a20;
}
.chat-avatar-initial { border-color:#a7ab89; color:#40513b; background:#e4e8d4; }
.chat-avatar :is(picture,img) { display:block; width:100%; height:100%; object-fit:contain; }
.chat-avatar img { border-radius:inherit; }
.chat-content { display:flex; flex-direction:column; align-items:flex-start; min-width:0; max-width:min(calc(100% - 43px),56ch); }
.chat-row-right .chat-content { align-items:flex-end; }
.chat-meta { display:flex; flex-wrap:wrap; gap:5px; align-items:center; margin:0 2px 3px; color:#746450; font-size:10px; line-height:1.3; }
.chat-meta b { font-size:10px; color:#654938; }
.chat-bubble {
  position:relative; min-width:0; max-width:100%; padding:7px 9px; border:1px solid var(--chat-edge);
  border-radius:6px; background:var(--chat-fill); box-shadow:0 2px 0 var(--chat-base); overflow-wrap:anywhere;
}
.chat-bubble::before {
  content:""; position:absolute; bottom:8px; left:-4px; width:7px; height:7px; transform:rotate(45deg);
  background:var(--chat-fill); border:solid var(--chat-edge); border-width:0 0 1px 1px;
}
.chat-row-right .chat-bubble::before { left:auto; right:-4px; border-width:1px 1px 0 0; }
.chat-bubble p { margin:0; font-size:13px; line-height:1.55; }
.chat-bubble p + p,.chat-bubble details,.chat-bubble blockquote { margin-top:8px; }
.chat-bubble blockquote { margin-inline:0; margin-bottom:0; padding:4px 8px; border-inline-start:2px solid var(--chat-edge); }
.chat-bubble :is(button,a) { max-width:100%; }
.chat-thinking { display:inline-flex; align-items:center; gap:8px; color:#745641; font-size:12px; }
.chat-dots { display:inline-flex; gap:3px; align-items:center; height:14px; }
.chat-dots i { width:5px; height:5px; border-radius:50%; background:#a96e4a; animation:chat-bounce 1.1s ease-in-out infinite; }
.chat-dots i:nth-child(2) { animation-delay:.15s; }
.chat-dots i:nth-child(3) { animation-delay:.3s; }
@keyframes chat-bounce { 0%,60%,100% { transform:translateY(0); opacity:.5; } 30% { transform:translateY(-4px); opacity:1; } }
@media(prefers-reduced-motion:reduce) { .chat-dots i { animation:none; opacity:.75; } }
.chat-retry { margin-top:7px; color:#a13f2d; }
.message-card.chat-row { border:0; border-radius:0; padding:0; background:none; }
.message-card.chat-row.target .chat-bubble { outline:2px solid #af795d; outline-offset:2px; }
.message-card .chat-bubble>small { display:block; color:#796b59; margin-bottom:5px; }
.message-card .chat-bubble p,.message-card .chat-bubble blockquote { font-size:13px; line-height:1.55; }
.chat-meta .mail-dot { display:inline-block; }
.chat-log-list { list-style:none; margin:0; padding:0; }
.chat-log-list>li { list-style:none; }
.writing-history .chat-row { margin:9px 0; }
.chat-bubble .writing-suggestion { margin:8px 0 0; }
.chat-bubble .writing-suggestion details { margin-top:0; }
.writing-work-feedback .chat-row { margin:0; }
.writing-assistant-avatar :is(img,picture) { display:block; width:100%; height:100%; object-fit:contain; }
.feedback-thinking[hidden] { display:none; }
.feedback-thinking { margin:6px 0; }
.support-face img { display:block; width:24px; height:24px; object-fit:contain; flex:none; }
.dock-avatar,.dock-avatar img { display:block; width:30px; height:30px; object-fit:contain; }
.post-status { margin-top:5px; color:#734d37; font-size:13px; }
.chat-compose-line,.ai-compose>.chat-compose-line {
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:8px; margin:0;
}
.chat-compose-line :is(textarea,.btn) { min-height:42px; }
.chat-compose-line textarea { min-width:0; resize:vertical; }
.chat-compose-line .btn { white-space:nowrap; }
.ai-compose>.ai-compose-tools { margin:0 0 4px; }
@media(max-width:730px) {
  .support-face img { width:19px; height:19px; }
  .chat-avatar { width:29px; height:29px; }
  .chat-content { max-width:calc(100% - 39px); }
  .chat-bubble { padding:6px 8px; }
  .chat-bubble p,.message-card .chat-bubble p,.message-card .chat-bubble blockquote { font-size:12.5px; }
  .chat-compose-line textarea,.ai-compose .chat-compose-line textarea { font-size:16px; }
  .writing-agent-form { scroll-margin-block-end:14px; }
  .studio-paper .page-studio .writing-complete-block .creation-foot {
    position:static; height:auto; min-height:0; margin:0; padding:4px 0 0; border:0; background:transparent;
  }
}
