/* 单一咨询：标题占一行，正文滚动，输入固定在卡片底部。 */
.report-main .side-panel { scroll-margin-block: 88px 24px; height: var(--report-chat-height, calc(100dvh - 88px)); }
.report-main #vip-chat-section { min-height: 0; max-height: none; }
.report-main #vip-chat-section [hidden] { display: none !important; }
.report-main .chat-header {
    display: flex; align-items: center; gap: 8px; padding: 12px 16px;
    position: relative; overflow: visible;
}
.report-main .chat-header .section-title {
    flex: 0 1 auto; min-width: 0; margin: 0; font-size: 17px; line-height: 1.5;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-quota {
    margin-inline-start: auto; flex-shrink: 0; font-size: 13px;
    font-variant-numeric: tabular-nums; color: var(--report-soft-text); white-space: nowrap;
}
.chat-help { flex-shrink: 0; }
.chat-help summary { list-style: none; cursor: pointer; color: var(--report-muted-text, #8191a0); font-size: 16px; }
.chat-help summary::-webkit-details-marker { display: none; }
.chat-help p {
    display: none;
    position: absolute; z-index: 3; top: 100%; inset-inline: 12px; margin: 0;
    padding: 12px; border: 1px solid var(--report-line); border-radius: 9px;
    background: var(--report-paper); box-shadow: 0 6px 20px rgb(0 0 0 / .1);
    color: var(--report-soft-text); font-size: 12px; line-height: 1.7;
}
.chat-help details[open] + p, .chat-help:has(summary:focus-visible) p { display: block; }
@media (hover: hover) {
    .chat-help:hover p { display: block; }
}
.report-main .unified-chat {
    display: flex; flex-direction: column; flex: 1; container-type: inline-size; min-height: 0; min-width: 0; overflow: hidden;
}
.report-main .unified-chat .chat-container {
    flex: 1 1 0; min-height: 0; max-height: none; overflow-y: auto; overflow-x: hidden;
    padding: 16px; gap: 12px; overscroll-behavior-y: contain;
}
.report-main .unified-chat .chat-message {
    max-width: 94%; box-sizing: border-box; font-size: 14px; line-height: 1.75;
    overflow-wrap: anywhere; padding: 10px 12px; flex-shrink: 0;
}
.report-main .unified-chat .chat-message p { margin: 0; white-space: pre-wrap; }
.report-main .unified-chat .chat-message.system { margin: 0; }
.report-main .unified-chat .chat-status {
    flex-shrink: 0; margin: 0; padding: 0 16px; font-size: 11px; line-height: 1.6;
    max-height: 50px; overflow-y: auto; color: var(--report-soft-text);
}
.report-main .unified-chat .chat-status:empty { display: none; }
.report-main .unified-chat .chat-input-area {
    margin: 0; padding: 12px 16px; min-height: 0; max-height: 65%; overflow-y: auto;
    box-sizing: border-box; border-top: 1px solid var(--report-line);
}
.report-main .unified-chat textarea {
    display: block; width: 100%; min-height: 88px; max-height: 160px; resize: vertical;
    margin-top: 10px; box-sizing: border-box; padding: 8px 10px; font-size: 14px;
}
.chat-focus-options { display: flex; flex-wrap: wrap; gap: 5px; }
.report-main .chat-focus-options button {
    min-height: 30px; padding: 4px 9px; border: 1px solid var(--report-line); border-radius: 16px;
    color: var(--report-soft-text); background: transparent; font: inherit; font-size: 12px; cursor: pointer;
}
.report-main .chat-focus-options button[aria-pressed="true"] {
    border-color: var(--report-accent); color: var(--report-accent-dark); background: var(--report-soft);
}
.chat-suggestions { display: grid; gap: 7px; align-self: stretch; }
.report-main .chat-suggestions button {
    width: 100%; padding: 9px 11px; border: 1px solid var(--report-line); border-radius: 8px;
    background: var(--report-paper); color: var(--report-accent-dark); font: inherit;
    font-size: 13px; line-height: 1.6; text-align: start; overflow-wrap: anywhere; cursor: pointer;
}
.chat-keyboard-options { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; }
.chat-keyboard-options label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.chat-keyboard-options label, .chat-keyboard-options select { font: inherit; font-size: 11px; }
.report-main .chat-keyboard-options select {
    width: auto; max-width: 100%; min-height: 26px; padding: 2px 5px; margin: 0;
    border: 1px solid var(--report-line); border-radius: 5px; color: var(--report-ink); background: var(--report-paper);
}
.chat-keyboard-help { color: var(--report-muted-text, #8191a0); }
.chat-keyboard-help summary { list-style: none; cursor: pointer; padding: 5px; }
.chat-keyboard-help summary::-webkit-details-marker { display: none; }
.chat-keyboard-help p {
    position: absolute; z-index: 4; inset-inline: 0; bottom: calc(100% + 6px);
    margin: 0; padding: 8px 10px; border: 1px solid var(--report-line); border-radius: 8px;
    background: var(--report-paper); color: var(--report-soft-text); font-size: 11px; line-height: 1.6;
    box-shadow: 0 4px 16px rgb(0 0 0 / .08);
}
.chat-composer-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 6px 8px; margin-top: 8px; position: relative; }
.chat-composer-actions .chat-keyboard-options { min-width: 0; flex-wrap: nowrap; }
.chat-composer-actions .chat-keyboard-options select { min-width: 0; }
.report-main .chat-composer-actions .chat-send-btn { grid-column: 1 / -1; width: auto; min-width: 90px; min-height: 36px; margin: 0; }
.chat-memory { min-width: 0; font-size: 12px; color: var(--report-soft-text); }
.chat-memory summary { cursor: pointer; padding: 5px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-memory[open] { grid-column: 1 / -1; order: 2; }
.chat-memory-content { padding: 8px 0; }
.chat-memory-content .experience-note { font-size: 11px; margin: 5px 0; line-height: 1.6; }
.chat-memory-consent { display: flex; align-items: flex-start; gap: 5px; line-height: 1.6; }
.chat-memory-consent input { width: auto; margin: 3px 0; }
.report-main .chat-memory-content textarea { min-height: 50px; font-size: 12px; }
.report-main .chat-memory-content button, .report-main .chat-history-delete, .report-main [data-explore-skip] {
    padding: 5px 7px; border: 1px solid var(--report-line); border-radius: 6px;
    background: var(--report-paper); color: var(--report-soft-text); font: inherit; font-size: 11px; cursor: pointer;
}
.chat-memory-content pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.report-main .unified-chat button:disabled { opacity: .55; cursor: not-allowed; }
@container (min-width: 500px) {
    .chat-composer-actions { display: flex; flex-wrap: wrap; }
    .report-main .chat-composer-actions .chat-send-btn { flex: 1; }
    .chat-memory[open] { flex-basis: 100%; }
}
@media (max-width: 1100px) {
    .report-main .side-panel { position: static; min-width: 0; }
    .report-main .main-container-flex { min-width: 0; }
}
@media (max-height: 500px) {
    .report-main .unified-chat .chat-input-area { padding: 8px 12px; max-height: 70%; }
    .report-main .unified-chat textarea { min-height: 44px; }
}

/* 可用高度很小时压紧工具条，避免发送按钮藏进输入区的滚动条。 */
.report-main .report-chat-constrained .chat-header { padding: 8px 12px; }
.report-main .report-chat-constrained .unified-chat .chat-input-area {
    padding: 6px 10px; max-height: none; flex-shrink: 0;
}
.report-main .report-chat-constrained .chat-focus-options { flex-wrap: nowrap; overflow-x: auto; }
.report-main .report-chat-constrained .chat-focus-options button { flex-shrink: 0; }
.report-main .report-chat-constrained .unified-chat textarea { min-height: 44px; max-height: 72px; margin-top: 6px; }
.report-main .report-chat-constrained .chat-composer-actions {
    display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.report-main .report-chat-constrained .chat-composer-actions .chat-send-btn {
    flex: 1; min-width: 70px; min-height: 30px;
}
.report-main .report-chat-constrained .chat-memory { flex: 0 1 auto; max-width: 110px; }
.report-main .report-chat-constrained .chat-memory[open] { flex-basis: 100%; max-width: none; }
