/* رایزن — پنل هم‌اندیشی */
.assistant {
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(440px, 100vw); z-index: 55;
  background: var(--surface); border-inline-start: 1px solid var(--line); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; transform: translateX(-104%); transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  visibility: hidden;
}
.assistant.open { transform: none; visibility: visible; }
@media (min-width: 1500px) {
  body.assistant-open .app { margin-inline-end: 440px; }
  body.assistant-open .assistant { box-shadow: none; }
}
.as-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--deep); color: var(--on-deep); }
.as-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.as-brand svg { width: 34px; height: 34px; flex: none; }
.as-brand b { font-family: var(--font-brand); font-size: 24px; font-weight: 700; line-height: 1.2; display: block; color: var(--on-deep); margin-top: -6px; }
.as-brand small { color: var(--on-deep-muted); font-size: 11.5px; display: block; unicode-bidi: plaintext; margin-top: 2px; }
.as-tools { margin-inline-start: auto; display: flex; gap: 6px; }
.as-head .icon-btn { background: transparent; border-color: rgba(255, 255, 255, 0.16); color: var(--on-deep); width: 34px; height: 34px; }
.as-head .icon-btn:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.as-modes { display: flex; gap: 4px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.as-modes button { border: 1px solid transparent; background: transparent; border-radius: 99px; padding: 3px 12px; font-size: 12.5px; color: var(--ink-2); }
.as-modes button[aria-pressed='true'] { background: var(--surface); border-color: var(--line-strong); color: var(--ink); font-weight: 600; }
.as-messages { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.as-empty { text-align: center; color: var(--muted); padding: 30px 12px; display: grid; justify-items: center; gap: 8px; }
.as-empty svg { width: 58px; height: 58px; }
.as-empty h3 { color: var(--ink); font-size: 17px; }
.as-empty p { font-size: 13px; max-width: 34ch; line-height: 1.9; }
.as-msg.user { align-self: flex-start; max-width: 88%; }
.as-msg.user .bubble { background: var(--deep); color: var(--on-deep); padding: 9px 13px; border-radius: 14px 14px 4px 14px; font-size: 13.5px; line-height: 1.85; white-space: pre-wrap; }
:root[data-theme='dark'] .as-msg.user .bubble { background: var(--turq-tint); color: var(--ink); }
.as-msg.bot { align-self: stretch; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); }
.as-msg.bot.error { border-color: var(--amber); }
.as-body { font-size: 13.5px; line-height: 1.95; color: var(--ink-2); }
.as-body h4 { font-size: 14.5px; color: var(--ink); margin: 2px 0 6px; line-height: 1.6; }
.as-body p { margin: 0 0 8px; }
.as-body ul { margin: 0 0 8px; padding-inline-start: 18px; }
.as-body li { margin-bottom: 4px; }
.as-body code { background: var(--surface-3); border-radius: 4px; padding: 0 4px; font-size: 12px; }
.as-body .table { font-size: 12px; margin: 6px 0; }
.as-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 8px 0 10px; }
.as-metrics > div { background: var(--surface-2); border-radius: 10px; padding: 7px 10px; display: grid; }
.as-metrics span { font-size: 11px; color: var(--muted); line-height: 1.5; }
.as-metrics b { font-size: 14px; color: var(--ink); }
.as-foot { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); align-items: center; }
.as-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.as-trace { margin-top: 8px; font-size: 12px; color: var(--muted); }
.as-trace summary { cursor: pointer; display: flex; align-items: center; gap: 6px; list-style: none; }
.as-trace summary svg { width: 14px; height: 14px; }
.as-trace ul { margin: 6px 0 0; padding-inline-start: 20px; }
.as-draft { margin-top: 10px; border: 1px solid var(--brass); background: var(--brass-tint); border-radius: 12px; padding: 10px 12px; }
.as-draft-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.as-draft-head svg { width: 16px; height: 16px; color: var(--brass-strong); }
.as-draft-head .chip { margin-inline-start: auto; }
.as-draft .kv { font-size: 12.5px; }
.as-msg.thinking { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.as-dots { display: flex; gap: 4px; }
.as-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--turq); animation: asDot 1s infinite ease-in-out; }
.as-dots i:nth-child(2) { animation-delay: 0.15s; }
.as-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes asDot { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }
.as-suggest { display: flex; gap: 6px; padding: 8px 14px 0; overflow-x: auto; scrollbar-width: none; }
.as-suggest .chip { cursor: pointer; flex: none; font-size: 12px; height: 28px; }
.as-suggest .chip:hover { border-color: var(--turq); color: var(--turq-strong); }
.as-compose { padding: 10px 14px 14px; display: grid; gap: 6px; }
.as-compose textarea { width: 100%; resize: none; border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; background: var(--surface); line-height: 1.8; font-size: 13.5px; }
.as-compose textarea:focus { outline: 2px solid var(--turq-soft); border-color: var(--turq); }
.as-compose-bar { display: flex; align-items: center; gap: 8px; }
.as-compose-bar small { color: var(--muted); font-size: 11.5px; margin-inline-end: auto; }
@media (max-width: 900px) {
  .assistant { width: 100vw; }
}
