/* Compact Q&A layout. Vue and Tailwind are loaded directly in index.html. */
:root {
  font-family: 'DM Sans', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  color: #303b32;
  background: #f6f7f4;
  font-synthesis: none;
  --line: #e3e7dd;
  --muted: #788471;
  --orange: #c65b37;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
button, input, textarea, select, a { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--orange); }
svg { display: block; flex-shrink: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[v-cloak] { display: none; }
#app { height: 100dvh; display: flex; flex-direction: column; }
.text-muted { color: var(--muted); font-size: 12px; }
.demo-banner {
  min-height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 20px;
  background: #e9ecdf;
  border-bottom: 1px solid #d9dfcc;
  color: #647555;
  font-size: 12px;
}
.demo-tag { border: 1px solid #bbc8ab; border-radius: 4px; font-size: 10px; padding: 2px 6px; }
select { background: #fff; border: 1px solid #d7dfcd; border-radius: 5px; color: #46573d; padding: 6px 24px 6px 9px; font-size: 12px; }
.demo-banner select { background: #f8faf3; }
.icon-button { border: 0; background: transparent; color: #77886a; border-radius: 4px; padding: 6px; }
.icon-button:hover { background: #e6ebde; }
.app-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.app-header { flex-shrink: 0; height: 55px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #fff; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand strong { font-size: 24px; font-weight: 750; letter-spacing: -.8px; color: var(--orange); }
.brand > span { color: #59674f; font-size: 14px; font-weight: 600; }
.language-select { padding: 5px 20px 5px 8px; font-size: 12px; }
.main-content { flex: 1; min-height: 0; padding: 0; }
.course-field { display: flex; align-items: center; gap: 8px; }
.course-field label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.course-field select { flex: 1; min-width: 0; width: 100%; }
.sidebar-filters { display: flex; flex-direction: column; gap: 8px; margin: 0 12px 10px; }
.sidebar-filters label { width: 64px; flex-shrink: 0; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 5px; padding: 8px 12px; font-size: 12px; white-space: nowrap; }
.primary-button { border: 1px solid var(--orange); background: var(--orange); color: #fff; }
.primary-button:hover { background: #b64d2c; }
.secondary-button { border: 1px solid #dbe2d2; background: #fff; color: #647756; }
.secondary-button:hover { background: #f0f4e9; }
.workspace { display: grid; grid-template-columns: 285px minmax(0, 1fr); height: 100%; min-height: 420px; overflow: hidden; background: #fff; }
.conversation-panel { display: flex; flex-direction: column; min-height: 0; background: #fafbf7; border-right: 1px solid var(--line); }
.list-heading { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px 12px; gap: 8px; }
.list-heading h1 { font-size: 14px; font-weight: 600; }
.list-heading .primary-button { padding: 7px 9px; font-size: 11px; }
.list-heading h1 > span { color: #859079; font-size: 12px; font-weight: 400; margin-left: 6px; }
.search-box { display: flex; align-items: center; gap: 7px; margin: 0 12px 10px; padding: 8px 9px; border: 1px solid #e0e6d7; background: #f2f5ec; border-radius: 5px; color: #8a967d; }
.search-box:focus-within { border-color: #afc09c; }
.search-box input { border: 0; outline: none; background: transparent; min-width: 0; width: 100%; font-size: 12px; color: #54664a; }
.search-box input::placeholder { color: #8e9982; }
.filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; padding: 0 11px 10px; border-bottom: 1px solid var(--line); }
.filter-button { display: flex; align-items: center; gap: 4px; padding: 5px 7px; border: 0; background: transparent; color: #7d8971; border-radius: 4px; font-size: 11px; }
.filter-button:hover { background: #edf1e5; }
.filter-button.active { background: #e4ebd9; color: #4e6540; font-weight: 600; }
.filter-count { padding: 0 4px; border-radius: 3px; background: #d5e0c7; font-size: 10px; }
.conversation-list { overflow-y: auto; padding: 0; flex: 1; }
.conversation-item { display: block; text-align: left; width: 100%; padding: 12px 16px; background: transparent; border: 0; border-bottom: 1px solid #e9eee1; }
.conversation-item:hover { background: #f0f4e8; }
.conversation-item.selected { background: #eaf0e1; box-shadow: inset 3px 0 #a8ba92; }
.conversation-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.conversation-status { font-size: 11px; }
.status-ai { color: #7b886b; }
.status-human { color: #ad7846; }
.status-resolved { color: #6f927b; }
.conversation-time { color: #8a967c; font-size: 10px; white-space: nowrap; }
.conversation-item h3 { font-size: 13px; font-weight: 600; color: #3e5036; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-preview { font-size: 12px; color: #839176; line-height: 1.7; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-person { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 10px; color: #859475; margin-top: 7px; }
.needs-dot { width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: #ca925e; }
.empty-list { padding: 30px 12px; font-size: 12px; text-align: center; color: var(--muted); line-height: 1.8; }
.empty-list button { border: 0; background: transparent; color: var(--orange); font-size: 12px; margin-top: 8px; }
.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.thread-header { display: flex; align-items: center; gap: 12px; min-height: 69px; padding: 12px 20px; border-bottom: 1px solid #edf0e7; }
.thread-title { flex: 1; min-width: 0; }
.thread-course { color: #82916f; font-size: 11px; }
.thread-title h2 { margin-top: 4px; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resolve-button { padding: 6px 9px; font-size: 11px; }
.mode-strip { display: flex; align-items: center; gap: 7px; background: #f5f8ef; border-bottom: 1px solid #edf1e5; color: #829270; padding: 8px 20px; font-size: 11px; }
.human-strip { background: #fcf4e9; color: #a48257; border-color: #f3e9d8; }
.resolved-strip { background: #f1f7ec; color: #769065; }
.messages-area { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 12px; }
.date-divider { text-align: center; color: #9aa68c; font-size: 11px; padding: 12px 0 2px; }
.message { display: flex; align-items: flex-start; gap: 9px; margin: 16px 0; }
.message-avatar { flex-shrink: 0; width: 29px; height: 29px; display: grid; place-items: center; margin-top: 24px; border-radius: 8px; font-size: 10px; }
.ai-avatar { background: #efecdd; color: #9d8c5f; }
.human-avatar { background: #e0ebdc; color: #637d57; }
.message-content { min-width: 0; max-width: min(85%, 880px); }
.message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; font-size: 11px; color: #6d7d60; }
.message-meta time { color: #99a48d; font-size: 10px; }
.message-bubble { padding: 11px 14px; border: 1px solid #e6ebdd; border-radius: 0 7px 7px 7px; background: #f4f7ed; color: #54664a; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.student-message { justify-content: flex-end; }
.student-message .message-meta { justify-content: flex-end; }
.student-message .message-bubble { background: #fbf0e5; color: #89694c; border-color: #f0dfcb; border-radius: 7px 0 7px 7px; }
.assistant-label { font-size: 10px; background: #e9f1e1; color: #829870; padding: 1px 5px; border-radius: 3px; }
.system-message { text-align: center; padding: 8px; margin: 14px 0; font-size: 11px; color: #8b9a7a; line-height: 1.7; }
.typing-indicator { font-size: 12px; color: #889b74; padding: 8px 0 14px 38px; }
.handoff-row, .takeover-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; margin: 0 20px; border-top: 1px solid #edf0e6; color: #879578; font-size: 12px; }
.handoff-row button { color: #a47343; }
.handoff-row .secondary-button, .takeover-row .secondary-button { font-size: 11px; padding: 6px 9px; }
.resolved-notice { padding: 9px 20px; color: #869d72; font-size: 12px; line-height: 1.6; }
.composer { padding: 0 20px 12px; }
.composer-input { display: flex; align-items: flex-end; gap: 12px; border: 1px solid #dbe3ce; border-radius: 6px; padding: 10px; }
.composer-input:focus-within { border-color: #a5ba8b; }
.composer-input textarea { background: transparent; width: 100%; min-width: 0; outline: none; border: 0; resize: none; line-height: 1.7; color: #55694a; font-size: 14px; }
.composer-input textarea::placeholder { color: #9aa68e; }
.composer-disabled { background: #f7f9f2; }
.send-button { border: 0; border-radius: 5px; width: 31px; height: 31px; flex-shrink: 0; display: grid; place-items: center; background: var(--orange); color: #fff; }
.send-button:disabled { background: #ccd4be; }
.composer-caption { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; color: #9ba68e; padding-top: 7px; }
.welcome-state, .no-selection { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; min-height: 100%; padding: 28px 16px; color: #829471; }
.welcome-state h2 { font-size: 20px; font-weight: 600; color: #4b6140; }
.welcome-state p, .no-selection p { font-size: 13px; line-height: 1.8; }
.no-selection { flex: 1; }
.starter-questions { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; width: min(100%, 340px); }
.starter-questions button { display: flex; align-items: center; justify-content: space-between; text-align: left; gap: 10px; border: 1px solid #e0e8d5; border-radius: 5px; padding: 10px; background: #fafcf6; color: #788d65; font-size: 12px; }
.starter-questions button:hover { background: #edf4e4; }
.mobile-back { display: none; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #344c37; color: #f4f6e9; padding: 12px 16px; border-radius: 6px; font-size: 13px; max-width: calc(100% - 24px); z-index: 20; box-shadow: 0 3px 15px #25311a20; }
.modal-dialog { position: fixed; inset: 0; margin: auto; border: 1px solid #dae3cf; border-radius: 8px; background: #fff; padding: 24px; width: min(420px, calc(100% - 32px)); color: #43553a; }
.modal-dialog::backdrop { background: #253c2955; }
.modal-dialog h2 { font-size: 19px; font-weight: 600; }
.modal-dialog p { margin-top: 10px; font-size: 13px; line-height: 1.8; color: #7f9071; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: #d6dfcb; border-radius: 4px; }
@media (max-width: 900px) {
  .main-content { padding: 0; }
  .app-header { padding: 0 14px; }
  .workspace { grid-template-columns: 245px minmax(0, 1fr); }
  .course-field { gap: 5px; }
  .course-field select { min-width: 80px; }
  .message-bubble { font-size: 13px; }
}
@media (max-width: 680px) {
  .demo-banner { padding: 5px 12px; gap: 8px; font-size: 11px; }
  .demo-banner select { min-width: 0; max-width: 225px; font-size: 11px; }
  .demo-banner label { display: none; }
  .app-header { height: 49px; }
  .brand strong { font-size: 22px; }
  .brand > span { font-size: 13px; }
  .main-content { padding: 0; }
  .course-field label { font-size: 11px; }
  .course-field select { padding: 6px 18px 6px 7px; font-size: 12px; }
  .workspace { display: flex; height: 100%; min-height: 390px; }
  .conversation-panel { width: 100%; border: 0; }
  .thread { display: none; width: 100%; }
  .mobile-thread .conversation-panel { display: none; }
  .mobile-thread .thread { display: flex; }
  .mobile-back { display: block; padding: 4px; }
  .thread-header { padding: 10px; gap: 7px; min-height: 65px; }
  .thread-title h2 { font-size: 13px; }
  .thread-course { font-size: 10px; }
  .resolve-button { padding: 5px 6px; font-size: 10px; gap: 3px; }
  .mode-strip { padding: 7px 12px; font-size: 10px; }
  .messages-area { padding: 0 12px 8px; }
  .message { gap: 6px; margin: 13px 0; }
  .message-avatar { width: 24px; height: 24px; margin-top: 22px; font-size: 9px; }
  .message-content { max-width: 90%; }
  .message-meta { font-size: 10px; gap: 5px; }
  .message-meta time { font-size: 9px; }
  .message-bubble { font-size: 13px; padding: 9px 11px; }
  .handoff-row, .takeover-row { margin: 0 12px; font-size: 11px; gap: 8px; }
  .handoff-row .secondary-button, .takeover-row .secondary-button { font-size: 10px; }
  .composer { padding: 0 10px 10px; }
  .composer-input textarea { font-size: 16px; }
  .composer-caption { font-size: 9px; }
  .composer-caption > span:last-child { display: none; }
  .resolved-notice { font-size: 11px; padding: 8px 12px; }
}

.status-dismissed { color: #a26959; }
.dismiss-button { color: #a0614f; border-color: #ead5cc; }
.dismiss-button:hover { background: #faf0ea; }
.dismissed-strip { background: #faf0eb; color: #a06d5b; border-color: #f0e1d9; }
.dismissed-notice { display: flex; flex-direction: column; gap: 6px; padding: 14px 20px; border-top: 1px solid #ebddd4; background: #fcf7f3; color: #a07360; font-size: 12px; line-height: 1.6; }
.dismissed-notice strong { font-weight: 600; }
.danger-button { border: 1px solid #a8604c; background: #a8604c; color: #fff; border-radius: 5px; padding: 8px 12px; font-size: 12px; }
.modal-dialog form > label { display: block; margin: 16px 0 6px; font-size: 12px; }
.modal-dialog form > select { width: 100%; }
.attachment-preview { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; color: #718165; }
.attachment-preview img { width: 74px; height: 60px; object-fit: contain; background: #f3f6ee; border: 1px solid #e3e9da; }
.attachment-preview > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-button { flex-shrink: 0; }
.message-image { display: block; width: 360px; max-width: 100%; padding: 0; margin-top: 6px; border: 1px solid #e1e7d8; background: #f6f8f2; border-radius: 4px; overflow: hidden; cursor: zoom-in; }
.message-image img { display: block; width: 100%; max-height: 280px; object-fit: contain; }
.image-dialog { position: fixed; inset: 0; margin: auto; max-width: 94vw; max-height: 92dvh; padding: 32px 12px 12px; border: 0; border-radius: 6px; background: #fff; }
.image-dialog::backdrop { background: #182119aa; }
.image-dialog > button { position: absolute; top: 3px; right: 4px; }
.image-dialog > img { display: block; max-width: 88vw; max-height: 80dvh; object-fit: contain; }
@media (max-width: 680px) {
  .dismiss-button { font-size: 10px; padding: 5px 6px; }
  .dismissed-notice { padding: 12px; font-size: 11px; }
}
