.dialogue { min-width: 0; }
.chat-workflow { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); list-style: none; padding: 0 0 14px; margin: 0 0 16px; gap: 8px; border-bottom: 1px solid var(--line); }
.chat-workflow li { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; color: #849098; min-width: 0; }
.chat-workflow li span { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: #e9eef1; font-size: 11px; flex-shrink: 0; }
.chat-workflow li.current { color: #9b3444; font-weight: 600; }
.chat-workflow li.current span { color: #fff; background: #a52f3d; }
.chat-fallback-note { padding: 8px 0; font-size: 12px; line-height: 1.8; color: #805f25; }
@media (max-width: 780px) { .chat-workflow { gap: 3px; } .chat-workflow li { flex-direction: column; font-size: 10px; gap: 5px; } }
.chat-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.chat-toolbar label { font-size: 13px; color: var(--muted); }
.chat-toolbar select { max-width: 240px; min-width: 0; font-size: 13px; }
.chat-mode { display: inline-flex; align-items: center; gap: 7px; color: #22685d; font-size: 12px; white-space: nowrap; }
.chat-mode > span { width: 6px; height: 6px; border-radius: 50%; background: #348372; }
.chat-toolbar-actions { display: flex; gap: 6px; margin-left: auto; }
.dialogue-layout { display: grid; grid-template-columns: minmax(0, 1fr) 246px; gap: 26px; align-items: start; }
.dialogue-main { border: 1px solid var(--line); border-radius: 6px; background: #fff; min-width: 0; overflow: hidden; }
.chat-transcript { height: clamp(220px, calc(100dvh - 510px), 490px); min-height: 220px; overflow-y: auto; overscroll-behavior: contain; padding: 24px; scrollbar-gutter: stable; }
.chat-welcome { max-width: 550px; margin: 26px auto 20px; text-align: center; }
.chat-emblem { display: inline-flex; align-items: center; justify-content: center; width: 50px; height: 50px; background: #f7ecef; color: var(--red); border-radius: 8px; margin-bottom: 16px; }
.chat-emblem svg { width: 25px; height: 25px; }
.chat-welcome h2 { font-size: 25px; margin-bottom: 12px; }
.chat-welcome > p { font-size: 15px; line-height: 1.8; color: #64707a; }
.chat-starters { display: flex; flex-direction: column; gap: 0; margin: 24px auto 0; text-align: left; }
.chat-starters button { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: 14px; line-height: 1.7; text-align: left; color: #333c43; }
.chat-starters button svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--red); }
.chat-starters button:hover { color: var(--red); }
.chat-message { min-width: 0; margin-bottom: 26px; overflow-wrap: anywhere; }
.chat-identity { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 32px; margin-bottom: 10px; }
.chat-identity > svg { width: 17px; height: 17px; color: #53657b; }
.chat-identity small { font-size: 11px; font-weight: 400; color: var(--muted); }
.chat-agent-icon { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 4px; background: var(--red-soft); color: var(--red); }
.chat-agent-icon svg { width: 15px; height: 15px; }
.chat-copy { margin-left: auto; width: 30px; height: 30px; }
.chat-copy svg { width: 14px; height: 14px; }
.chat-user { margin-left: 18%; }
.chat-user .chat-identity { justify-content: flex-end; color: #4c6178; }
.chat-user > p { background: #edf2f7; color: #283f56; border-radius: 6px; padding: 13px 16px; font-size: 15px; line-height: 1.8; white-space: pre-wrap; }
.chat-assistant { border-bottom: 1px solid #edf0f2; padding-bottom: 25px; }
.chat-answer p { font-size: 15px; line-height: 1.95; margin: 0 0 12px; }
.chat-facts { margin: 18px 0; }
.chat-facts summary { display: flex; align-items: center; gap: 7px; color: #36666b; cursor: pointer; font-size: 13px; list-style: none; }
.chat-facts summary::after { content: '+'; margin-left: auto; font-size: 16px; }
.chat-facts[open] summary::after { content: '-'; }
.chat-facts summary svg { width: 15px; height: 15px; }
.chat-facts summary span { font-size: 11px; margin-left: 3px; color: var(--muted); }
.chat-facts ul { list-style: none; padding: 0; margin: 12px 0 0; border-left: 2px solid #b7d2cd; }
.chat-facts li { padding: 0 0 12px 13px; }
.chat-fact-label { color: #75827f; font-size: 11px; }
.chat-facts li p { font-size: 13px; line-height: 1.9; margin-top: 3px; }
.chat-citation { display: inline-flex; align-items: flex-start; gap: 4px; font-size: 11px; line-height: 1.8; color: #3d6b68; margin-top: 3px; }
.chat-citation svg { width: 11px; height: 11px; margin-top: 4px; flex-shrink: 0; }
.chat-followup { margin: 16px 0 12px; padding-left: 13px; border-left: 2px solid #bb6975; }
.chat-followup strong { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--red); }
.chat-followup svg { width: 14px; height: 14px; }
.chat-followup p { font-size: 14px; line-height: 1.85; margin-top: 6px; }
.chat-next { display: flex; flex-wrap: wrap; gap: 7px 15px; }
.chat-next button { display: inline-flex; align-items: center; gap: 5px; text-align: left; border: 0; background: transparent; color: #536b82; font-size: 12px; line-height: 1.8; padding: 4px 0; max-width: 100%; overflow-wrap: anywhere; }
.chat-next button svg { width: 12px; height: 12px; flex-shrink: 0; }
.chat-composer { border-top: 1px solid var(--line); padding: 14px 18px; }
.chat-composer textarea { display: block; width: 100%; resize: vertical; min-height: 60px; max-height: 150px; border: 0; background: #fff; padding: 6px 0; font-size: 15px; line-height: 1.8; border-radius: 0; }
.chat-composer textarea:focus { outline: none; box-shadow: none; }
.chat-composer:focus-within { box-shadow: inset 0 2px 0 #ad4350; }
.chat-composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.chat-composer-bottom > small { font-size: 11px; color: var(--muted); line-height: 1.7; }
.chat-send { min-width: 75px; min-height: 38px; padding: 7px 13px; gap: 6px; flex-shrink: 0; }
.chat-send svg { width: 15px; height: 15px; }
.chat-pending { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; padding-bottom: 15px; }
.chat-pending svg { width: 15px; height: 15px; animation: chat-spin 1.4s linear infinite; }
.chat-evidence { min-width: 0; border-left: 1px solid var(--line); padding-left: 22px; }
.chat-evidence h2 { font-size: 14px; display: flex; gap: 8px; align-items: center; margin: 4px 0 20px; }
.chat-evidence h2 svg { width: 17px; height: 17px; color: #396d66; }
.chat-source-link { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; line-height: 1.85; color: #324b5a; margin-bottom: 18px; overflow-wrap: anywhere; }
.chat-source-link > svg { flex-shrink: 0; width: 14px; height: 14px; margin-top: 4px; color: #8b9aa3; }
.chat-source-link small { display: block; color: var(--muted); font-size: 11px; line-height: 1.8; margin-top: 5px; }
.chat-source-empty, .chat-boundary { color: var(--muted); font-size: 12px; line-height: 1.9; }
.chat-question-bank { margin: 22px 0; border-top: 1px solid var(--line); padding-top: 16px; }
.chat-question-bank summary { font-size: 13px; cursor: pointer; }
.chat-question-bank summary span { font-size: 11px; color: var(--muted); margin-left: 6px; }
.chat-question-bank > div { max-height: 350px; overflow-y: auto; }
.chat-question-bank button { border: 0; border-bottom: 1px solid #edf0f2; background: transparent; text-align: left; display: block; width: 100%; font-size: 12px; line-height: 1.85; padding: 12px 0; }
.chat-question-bank button small { display: block; color: var(--muted); font-size: 10px; }
.node-material { padding: 20px 0 0; border-top: 2px solid #8cacaa; }
.node-material h4 { font-size: 15px; margin: 0 0 10px; }
.node-material p { font-size: 13px; line-height: 1.85; }
.research-preview img.node-photo { height: auto; object-fit: contain; background: #f0f3f3; }
@keyframes chat-spin { to { transform: rotate(360deg); } }
@media (max-width: 1150px) { .dialogue-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; } .chat-evidence { border-left: 0; border-top: 1px solid var(--line); padding: 20px 0 0; } .chat-evidence h2 { margin-bottom: 12px; } }
@media (max-width: 780px) { .chat-transcript { height: clamp(160px, calc(100dvh - 600px), 390px); min-height: 160px; padding: 16px 12px; } .chat-toolbar { gap: 8px; } .chat-toolbar select { max-width: 150px; } .chat-toolbar label { display: none; } .chat-toolbar-actions { gap: 3px; } .chat-welcome { margin-top: 12px; } .chat-welcome h2 { font-size: 23px; } .chat-user { margin-left: 10%; } .chat-composer { padding: 12px; } .chat-composer-bottom > small { font-size: 10px; } .chat-identity small { font-size: 10px; } .chat-answer p { font-size: 14px; } .chat-welcome > p { font-size: 13px; } }
@media (max-width: 360px) { .chat-mode { font-size: 10px; gap: 4px; } .chat-toolbar select { max-width: 125px; } .chat-toolbar-actions .icon-button { width: 30px; height: 32px; } .chat-send { min-width: 40px; width: 40px; padding: 7px; } .chat-send span { display: none; } .chat-identity { gap: 5px; } }
@media (prefers-reduced-motion: reduce) { .chat-pending svg { animation: none; } }
@media print { .chat-toolbar, .chat-composer, .chat-next, .chat-copy { display: none; } .chat-transcript { height: auto; overflow: visible; } .dialogue-layout { display: block; } }
