.courses-page .subject-nav { padding-bottom: 16px; border-bottom: 0; }
.course-assistant { overflow: clip; border: 1px solid #dce1eb; border-radius: 12px; background: var(--surface); }
.course-assistant [hidden] { display: none !important; }
.assistant-bar { display: flex; align-items: center; min-height: 54px; }
.assistant-trigger { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; min-height: 54px; padding: 12px 18px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .875rem; text-align: left; cursor: pointer; }
.assistant-trigger:hover { color: var(--ink); background: #fafbfe; }
.assistant-spark { width: 20px; height: 20px; color: var(--blue); }
.assistant-plus { margin-left: auto; width: 18px; height: 18px; }
.assistant-open-title { color: var(--ink); font-weight: 650; }
.assistant-close { display: flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 44px; padding: 8px 14px; margin-right: 6px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: .8125rem; cursor: pointer; }
.assistant-close:hover { color: var(--ink); background: #f1f3f8; }
.assistant-close .icon { width: 17px; height: 17px; }
.course-assistant[data-state="open"] { border-color: #cbd4f1; }
.course-assistant[data-state="open"] .assistant-bar { border-bottom: 1px solid #edf0f5; }
.course-assistant[data-state="open"] .assistant-trigger { cursor: default; }
.course-assistant[data-state="open"] .assistant-trigger:hover { background: transparent; }
.assistant-panel { height: 0; overflow: hidden; }
.assistant-panel-inner { width: min(100%, 960px); margin-inline: auto; padding: 22px 24px 16px; }
.assistant-messages { max-height: min(480px, 48dvh, var(--assistant-log-max, 480px)); min-height: 80px; overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain; padding: 2px 6px 6px; outline-offset: 0; }
.assistant-welcome > p { font-size: .9375rem; color: var(--ink); line-height: 1.8; }
.assistant-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.assistant-suggestions > button { min-height: 38px; padding: 8px 12px; border: 1px solid #e0e5ef; border-radius: 9px; background: #f8f9fc; color: #566278; font: inherit; font-size: .8125rem; line-height: 1.5; cursor: pointer; }
.assistant-suggestions > button:hover { color: var(--blue); background: #eef1ff; border-color: #c6d0f5; }
.assistant-message { margin-bottom: 24px; font-size: .9375rem; line-height: 1.85; overflow-wrap: anywhere; }
.assistant-message:last-child { margin-bottom: 2px; }
.assistant-message-user { display: flex; justify-content: flex-end; }
.assistant-message-user .message-body { max-width: 85%; padding: 11px 16px; border-radius: 16px 16px 4px 16px; background: #edf0f7; color: var(--ink); white-space: pre-wrap; }
.assistant-message-agent { padding: 0 4px; }
.message-author { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; font-size: .75rem; color: var(--muted); }
.message-author .icon { width: 17px; height: 17px; color: var(--blue); }
.message-body > p { margin: 0 0 10px; }
.message-body > p:last-child { margin-bottom: 0; }
.message-body strong { font-weight: 750; }
.message-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.message-body a:hover { color: #243bc7; }
.message-heading { font-weight: 750; }
.message-list-line { padding-left: 20px; text-indent: -20px; }
.assistant-waiting { display: flex; align-items: center; gap: 5px; min-height: 28px; }
.assistant-waiting > span { width: 5px; height: 5px; border-radius: 50%; background: #929cb4; animation: assistant-pulse 1.1s ease-in-out infinite; }
.assistant-waiting > span:nth-child(2) { animation-delay: .15s; }
.assistant-waiting > span:nth-child(3) { animation-delay: .3s; }
@keyframes assistant-pulse { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.assistant-notice { margin: 12px 6px 0; padding: 10px 12px; border-radius: 8px; background: #f5f6fa; color: #626e82; font-size: .8125rem; line-height: 1.65; }
.assistant-notice a { color: var(--blue); text-decoration: underline; }
.assistant-form { margin-top: 18px; }
.assistant-composer { display: flex; align-items: flex-end; gap: 12px; padding: 10px 10px 10px 16px; border: 1px solid #dce1eb; border-radius: 16px; background: #f9fafc; transition: border-color 180ms ease, box-shadow 180ms ease; }
.assistant-composer:focus-within { border-color: #94a5f2; box-shadow: 0 0 0 3px #edf0ff; }
.assistant-composer textarea { display: block; flex: 1; min-width: 0; max-height: 132px; padding: 8px 0; margin: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1rem; line-height: 1.6; resize: none; outline: none; scrollbar-width: thin; }
.assistant-composer textarea::placeholder { color: #788397; }
.assistant-send, .assistant-stop { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: var(--blue); cursor: pointer; transition: background 150ms ease, transform 150ms ease; }
.assistant-send:disabled { color: #8c96aa; background: #e7ebf3; cursor: default; }
.assistant-send:enabled:hover { background: #2441e2; }
.assistant-send:enabled:active, .assistant-stop:active { transform: scale(.92); }
.assistant-send .icon, .assistant-stop .icon { width: 21px; height: 21px; stroke-width: 2; }
.assistant-stop { color: var(--ink); background: #e6eaf2; }
.assistant-stop .icon { fill: currentColor; stroke: none; }
.assistant-form-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; padding-inline: 4px; color: var(--muted); font-size: .75rem; line-height: 1.65; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.assistant-noscript { padding: 0 18px 12px; font-size: .8125rem; color: var(--muted); }
@media (max-width: 599px) {
  .assistant-trigger { gap: 9px; padding: 12px; font-size: .8125rem; line-height: 1.6; }
  .assistant-invitation { flex: 1; }
  .assistant-close { padding-inline: 10px; }
  .assistant-close > span { display: none; }
  .assistant-panel-inner { padding: 18px 12px 12px; }
  .assistant-messages { max-height: min(420px, 43dvh, var(--assistant-log-max, 420px)); padding-inline: 2px; }
  .assistant-suggestions { gap: 7px; }
  .assistant-suggestions > button { font-size: .75rem; padding: 7px 10px; }
  .assistant-form-meta > span:last-child { font-size: .6875rem; }
  .assistant-message-user .message-body { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  .assistant-waiting > span { animation: none; }
  .assistant-send:active, .assistant-stop:active { transform: none; }
}
