/* «دستیار مبحث ۱۷» — chat page. Uses the tokens from elevate.css. */
.as-hero-inner { max-width: 820px; }
.as-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--rule, #c7d4cd); background: var(--sheet, #fbfcfa); }
.as-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--steel, #4b5f59); }
.as-status.is-live i { background: var(--emerald, #0a7350); box-shadow: 0 0 0 4px rgb(10 115 80 / .15); }

.as-shell { max-width: 860px; display: flex; flex-direction: column; gap: 14px; }
.as-thread { display: flex; flex-direction: column; gap: 14px; }
.as-thread:empty { display: none; }
.as-msg { border-radius: 14px; padding: 14px 18px; line-height: 1.95; font-size: 15px; max-width: 100%; overflow-wrap: anywhere; }
.as-msg p { margin: 0 0 8px; }
.as-msg p:last-child { margin-bottom: 0; }
.as-msg ul { margin: 4px 0 10px; padding-inline-start: 20px; }
.as-msg h3 { font-size: 15.5px; margin: 10px 0 6px; }
.as-msg--user { align-self: flex-end; background: var(--ink, #0f2b25); color: #fff; max-width: 85%; border-end-end-radius: 4px; }
.as-msg--bot { align-self: stretch; background: var(--sheet, #fbfcfa); border: 1px solid var(--rule, #c7d4cd); border-end-start-radius: 4px; }
.as-badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .02em; color: var(--emerald-deep, #075a3e); background: var(--emerald-tint, #e2f1e9); border-radius: 6px; padding: 2px 8px; margin-bottom: 8px; }
.as-cite { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin: 0 2px; border-radius: 6px; background: var(--emerald-tint, #e2f1e9); color: var(--emerald-deep, #075a3e); font-size: 11.5px; font-weight: 800; text-decoration: none; vertical-align: 2px; }
.as-cite:hover, .as-cite:focus-visible { background: var(--emerald, #0a7350); color: #fff; }
.as-fallback { color: var(--ink-2, #2c4a42); font-weight: 600; }
.as-error { color: #b42318; font-weight: 600; }

.as-sources, .as-notes { margin-top: 12px; border-top: 1px dashed var(--rule, #c7d4cd); padding-top: 10px; }
.as-sources summary, .as-notes h4 { cursor: pointer; font-size: 13px; font-weight: 800; color: var(--steel, #4b5f59); margin: 0 0 8px; }
.as-sources ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.as-source { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 10px; border-radius: 10px; background: #fff; border: 1px solid var(--rule-soft, #dfe7e2); font-size: 13px; line-height: 1.85; transition: box-shadow .3s; }
.as-source > b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--ink, #0f2b25); color: #fff; font-size: 11.5px; }
.as-source-label { font-weight: 800; color: var(--emerald-deep, #075a3e); font-size: 12.5px; }
.as-source p { margin: 4px 0 0; color: var(--ink-2, #2c4a42); white-space: pre-line; }
.as-source.is-flash { box-shadow: 0 0 0 3px var(--emerald-glow, #22c287); }
.as-note { border: 1px solid var(--rule-soft, #dfe7e2); border-radius: 10px; background: #fff; padding: 8px 12px; margin-bottom: 6px; font-size: 13.5px; }
.as-note summary { cursor: pointer; font-weight: 700; }
.as-note p { margin: 8px 0 0; white-space: pre-line; line-height: 1.9; }
.as-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.as-actions button { min-height: 34px; padding: 4px 12px; border-radius: 8px; border: 1px solid var(--rule, #c7d4cd); background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.as-actions button:hover:not(:disabled) { border-color: var(--ink, #0f2b25); }
.as-actions button:disabled { opacity: .55; cursor: default; }
.as-thanks { font-size: 12.5px; color: var(--emerald-deep, #075a3e); }
.as-typing { display: inline-flex; align-items: center; gap: 4px; color: var(--steel, #4b5f59); }
.as-typing span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: as-dot 1s infinite ease-in-out; }
.as-typing span:nth-child(2) { animation-delay: .15s; } .as-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes as-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.as-examples h2 { font-size: 14px; color: var(--steel, #4b5f59); margin: 0 0 10px; }
.as-example-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.as-example { text-align: start; min-height: 48px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--rule, #c7d4cd); background: var(--sheet, #fbfcfa); font: inherit; font-size: 14px; color: var(--ink, #0f2b25); cursor: pointer; }
.as-example:hover { border-color: var(--emerald, #0a7350); background: #fff; }

.as-composer { position: sticky; bottom: 12px; display: flex; gap: 10px; align-items: flex-end; background: #fff; border: 1.5px solid var(--ink, #0f2b25); border-radius: 14px; padding: 10px; box-shadow: 0 20px 40px -28px rgb(6 26 21 / .55); }
.as-composer textarea { flex: 1; border: 0; resize: vertical; min-height: 48px; max-height: 220px; font: inherit; font-size: 15px; line-height: 1.8; background: transparent; color: var(--ink, #0f2b25); padding: 6px 8px; }
.as-composer textarea:focus { outline: none; }
.as-composer:focus-within { box-shadow: 0 0 0 3px rgb(10 115 80 / .2), 0 20px 40px -28px rgb(6 26 21 / .55); }
.as-fineprint { margin: 0; font-size: 12.5px; color: var(--steel, #4b5f59); line-height: 1.8; }
.as-fineprint a { color: var(--emerald-deep, #075a3e); }
.as-example:focus-visible, .as-actions button:focus-visible, .as-sources summary:focus-visible, .as-note summary:focus-visible { outline: 2px solid var(--emerald, #0a7350); outline-offset: 2px; }

@media (max-width: 640px) {
  .as-example-list { grid-template-columns: 1fr; }
  .as-msg--user { max-width: 92%; }
  .as-composer { bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { .as-typing span { animation: none; opacity: .7; } .as-source { transition: none; } }
