.course-chat-launcher { position: fixed; right: 1rem; bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 60; border: 1px solid #b9dad6; border-radius: 999px; padding: .85rem 1.2rem; background: #173e42; color: #fff; box-shadow: 0 4px 18px #10272b24; cursor: pointer; font: 600 .95rem/1.2 system-ui, sans-serif; }
.course-chat-nav-entry { flex-shrink: 0; min-height: 44px; padding: .45rem .8rem; border: 1px solid #adc8ca; border-radius: 9px; background: #edf5f3; color: #173e42; cursor: pointer; font: 600 .9rem/1.3 system-ui, sans-serif; }
.course-chat-panel { position: fixed; inset: 1rem 1rem auto auto; z-index: 65; width: min(480px, calc(100vw - 2rem)); height: calc(100dvh - 2rem); display: flex; flex-direction: column; overflow: hidden; background: #fff; color: #18383c; border: 1px solid #c5d7d2; border-radius: 18px; box-shadow: 0 10px 50px #0d232733; font: 16px/1.55 system-ui, sans-serif; text-align: left; }
.course-chat-panel, .course-chat-panel * { box-sizing: border-box; }
.course-chat-panel[hidden], .course-chat-panel [hidden] { display: none !important; }
.course-chat-panel h2, .course-chat-panel h3, .course-chat-panel h4, .course-chat-panel p { margin: 0; }
.course-chat-panel h2 { font-size: 18px; line-height: 1.3; }
.course-chat-panel h3 { font-size: 16px; }
.course-chat-panel button { min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid transparent; background: #edf4f0; color: #173e42; cursor: pointer; font: 500 14px/1.4 system-ui, sans-serif; }
.course-chat-panel button:disabled { opacity: .55; cursor: default; }
.course-chat-panel :is(button, summary, textarea, a, [tabindex]):focus-visible, .course-chat-launcher:focus-visible, .course-chat-nav-entry:focus-visible { outline: 3px solid #087e83; outline-offset: 2px; }
.course-chat-panel a { color: #176877; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.course-chat-header { flex: none; padding: 8px 12px; border-bottom: 1px solid #e5eeeb; }
.course-chat-title-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.course-chat-title-row button { background: transparent; }
.course-chat-subtitle { color: #557075; font-size: 12px; text-align: center; margin: 0 0 4px !important; }
.course-chat-transcript, .course-chat-details { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 20px 18px; overflow-anchor: none; }
.course-chat-welcome { margin: 24px 0 20px; }
.course-chat-welcome h3 { font-size: 20px; margin-bottom: 10px; }
.course-chat-welcome p { color: #557075; }
.course-chat-starters { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.course-chat-starters button { background: white; border-color: #ceddd8; text-align: left; }
.course-chat-earlier { display: block; margin: 0 auto 20px; }
.course-chat-turn { margin: 0 0 24px; }
.course-chat-message { overflow-wrap: anywhere; min-width: 0; }
.course-chat-role { display: block; font-size: 12px; font-weight: 650; color: #456468; margin-bottom: 8px; }
.course-chat-user { margin: 0 0 24px 28px; padding: 12px 16px; background: #edf4f0; border-radius: 16px 16px 4px 16px; }
.course-chat-user .course-chat-role { font-weight: 450; margin-bottom: 4px; }
.course-chat-plain-text { white-space: pre-wrap; }
.course-chat-message-body > :first-child { margin-top: 0 !important; }
.course-chat-message-body > :last-child { margin-bottom: 0 !important; }
.course-chat-message-body p { margin: 0 0 14px; }
.course-chat-message-body :is(h3,h4,h5,h6) { line-height: 1.35; margin: 20px 0 10px; }
.course-chat-message-body h3 { font-size: 18px; }
.course-chat-message-body :is(h4,h5,h6) { font-size: 16px; }
.course-chat-message-body :is(ul,ol) { margin: 12px 0 16px; padding-left: 24px; }
.course-chat-message-body li { margin: 7px 0; }
.course-chat-message-body li > p { margin: 4px 0; }
.course-chat-message-body blockquote { border-left: 3px solid #a8c8bf; margin: 16px 0; padding: 3px 0 3px 14px; color: #426168; }
.course-chat-message-body code { font: .88em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #eef3f1; border-radius: 4px; padding: 2px 4px; }
.course-chat-message-body pre { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; white-space: pre; background: #f1f5f3; border: 1px solid #dce6e1; border-radius: 10px; padding: 14px; margin: 16px 0; }
.course-chat-message-body pre code { background: none; padding: 0; white-space: pre; overflow-wrap: normal; }
.course-chat-message-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.course-chat-message-body :is(th,td) { text-align: left; padding: 8px 12px; border: 1px solid #dce6e1; min-width: 88px; }
.course-chat-message-body th { background: #f1f5f3; color: #18383c; }
.course-chat-message-body hr { border: 0; border-top: 1px solid #dce6e1; margin: 20px 0; }
.course-chat-reply-context { font-size: 12px; color: #5b7377; margin: 12px 0 0; }
.course-chat-reply-context summary { cursor: pointer; padding: 4px 0; }
.course-chat-reply-context small { display: block; padding: 4px 0; font-size: inherit; }
.course-chat-thinking, .course-chat-turn-status { font-size: 14px; color: #557075; padding: 8px 0; }
.course-chat-footer { flex: none; padding: 12px 16px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid #e5eeeb; background: #fff; }
.course-chat-composer { margin: 0; }
.course-chat-input-row { display: flex; align-items: flex-end; gap: 8px; border: 1px solid #a9c3bf; border-radius: 15px; padding: 4px 5px 4px 12px; background: #fff; }
.course-chat-composer textarea { display: block; min-width: 0; width: 100%; height: 44px; min-height: 44px; max-height: 144px; resize: none; padding: 10px 0; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #18383c; font: 16px/24px system-ui, sans-serif; }
.course-chat-input-row button[type=submit] { flex: none; min-width: 60px; background: #173e42; color: white; }
.course-chat-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
.course-chat-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.course-chat-status { font-size: 14px; color: #49666a; padding: 0 0 10px; }
.course-chat-status[data-tone=error] { color: #795321; }
.course-chat-first-send, .course-chat-page-changed { color: #557075; font-size: 12px; margin: 0 0 10px !important; }
.course-chat-first-send .course-chat-text-button { padding: 0 4px; min-height: 28px; background: transparent; text-decoration: underline; font-size: inherit; }
.course-chat-jump { display: block; margin: 0 auto 10px; box-shadow: 0 2px 8px #18383c14; }
.course-chat-conflict { max-height: min(calc(var(--course-chat-viewport-height, 100dvh) * .32), 240px); overflow: auto; padding: 12px; margin-bottom: 12px; border: 1px solid #d9bb87; background: #fff8e9; border-radius: 10px; font-size: 14px; }
.course-chat-conflict button { margin-top: 8px; background: white; border-color: #d9bb87; }
.course-chat-conflict details { margin-top: 12px; }
.course-chat-conflict h4 { margin: 12px 0 4px; }
.course-chat-conflict p { white-space: pre-wrap; overflow-wrap: anywhere; }
.course-chat-details > h3 { font-size: 16px; margin: 24px 0 8px; }
.course-chat-details > h3:first-child { margin-top: 0; }
.course-chat-details > p { font-size: 14px; color: #476367; }
.course-chat-context { margin: 12px 0; font-size: 14px; }
.course-chat-context summary, .course-chat-erase summary { cursor: pointer; min-height: 44px; padding: 10px 0; }
.course-chat-context p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 14px; }
.course-chat-context details { border-bottom: 1px solid #e5eeeb; }
.course-chat-erase { font-size: 14px; }
.course-chat-erase > div { display: flex; flex-wrap: wrap; gap: 8px; }
.course-chat-erase button { border-color: #d9bab6; background: white; color: #8b382f; }
.course-chat-erase p { margin: 12px 0; }
@media (min-width: 1001px) { body:has(.course-chat-panel:not([hidden])) > main { width: min(1040px, calc(100% - 528px)); margin-left: 24px; margin-right: 504px; } }
@media (max-width: 1000px) { .course-chat-panel { inset: 0; width: 100%; height: 100dvh; border: 0; border-radius: 0; } .course-chat-header { padding-top: max(8px, env(safe-area-inset-top)); } .course-chat-launcher { right: .75rem; font-size: .9rem; } }
@media (max-height: 520px) { .course-chat-subtitle { display: none; } .course-chat-footer { padding-top: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); } .course-chat-composer textarea { max-height: 96px; } .course-chat-first-send, .course-chat-page-changed { font-size: 11px; } }
.course-chat-compact .course-chat-subtitle { display: none; }
.course-chat-compact .course-chat-footer { padding-top: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.course-chat-compact .course-chat-composer textarea { max-height: 96px; }
.course-chat-compact :is(.course-chat-first-send, .course-chat-page-changed) { font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .course-chat-panel, .course-chat-transcript { scroll-behavior: auto; } }
