:root {
    --ink: #101b35;
    --muted: #71809a;
    --line: #dce5f1;
    --soft: #edf4ff;
    --blue: #1267ff;
    --blue-2: #004ef5;
    --green: #11b978;
    --wenya-assistant-width: 900px;
    --wenya-user-width: 480px;
    --wenya-chat-width: 1440px;
    --danger: #ef4444;
    --canvas: #f5f9ff;
    --shadow: 0 18px 46px rgba(36, 59, 97, .08);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    color: var(--ink);
}
* { box-sizing: border-box; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
:where(button, input, textarea, select, [tabindex]):focus-visible { outline: 2px solid #1267ff; outline-offset: 2px; }
body { margin: 0; min-width: 1080px; background: linear-gradient(180deg, #fbfdff 0%, var(--canvas) 100%); }
button, input, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
[hidden] { display: none !important; }

.assistant-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 72px 258px minmax(0, 1fr);
    transition: grid-template-columns .18s ease;
}
.assistant-shell.sidebar-collapsed { grid-template-columns: 72px 0 minmax(0, 1fr); }
.product-rail {
    position: sticky; top: 0; z-index: 30; height: 100vh; padding: 18px 12px;
    border-right: 1px solid #e5edf8; background: #fff; display: flex; flex-direction: column;
    align-items: center; gap: 10px; color: #556780;
}
.brand-mark { width: 42px; height: 42px; margin-bottom: 14px; display: grid; place-items: center; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.rail-link {
    position: relative; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
    color: inherit; text-decoration: none; transition: .16s ease;
}
.rail-link svg { width: 20px; height: 20px; }
.rail-link span {
    position: absolute; left: 68px; z-index: 80; width: max-content; padding: 7px 10px; border-radius: 9px;
    color: #fff; background: #15223a; font-size: 11px; font-weight: 800; opacity: 0;
    pointer-events: none; transform: translateX(-5px); transition: .16s ease;
}
.rail-link:hover, .rail-link.active { color: var(--blue); background: #eef5ff; }
.rail-link:hover span { opacity: 1; transform: translateX(0); }
.rail-link.active::before {
    content: ""; position: absolute; left: -12px; width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--blue);
}
.account-anchor { position: relative; margin-top: auto; }
.account-button {
    width: 42px; height: 42px; padding: 0; border: 2px solid #dce7f6; border-radius: 50%;
    background: linear-gradient(145deg, #2d70ff, #554fe8); color: #fff; display: grid; place-items: center;
    overflow: hidden; font-weight: 850; box-shadow: 0 10px 24px rgba(18, 103, 255, .12);
}
.account-button.has-avatar { color: var(--ink); background: #fff; }
.account-button > #accountAvatar { width: 100%; height: 100%; border-radius: inherit; display: grid; place-items: center; background-size: cover; background-position: center; }
.account-popover {
    position: absolute; left: 56px; bottom: 0; z-index: 120; width: 336px; padding: 14px;
    border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 22px 58px rgba(23,36,59,.16);
}
.account-summary { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding-bottom: 11px; border-bottom: 1px solid #eaf0f7; }
.account-avatar-large { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--soft); background-size: cover; background-position: center; font-weight: 850; }
.account-summary strong, .account-summary span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.popover-action { width: 100%; min-height: 38px; margin-top: 8px; border: 0; border-radius: 11px; background: transparent; display: flex; align-items: center; gap: 9px; }
.popover-action:hover { background: #f4f7fb; }
.popover-action.danger { color: var(--danger); }

.conversation-sidebar {
    height: 100vh; position: sticky; top: 0; padding: 28px 20px 24px; border-right: 1px solid #e5edf8;
    background: rgba(255,255,255,.88); backdrop-filter: blur(14px); display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr); gap: 16px;
    overflow: hidden;
    transition: padding .18s ease;
}
.sidebar-heading { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mobile-sidebar-close { display: none; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: transparent; place-items: center; }
.mobile-sidebar-close svg { width: 18px; height: 18px; }
.title-row { min-width: 0; display: flex; align-items: center; gap: 7px; }
.title-row h1 { margin: 0; font-size: 21px; letter-spacing: 0; line-height: 1.15; font-weight: 900; white-space: nowrap; }
.title-row span {
    height: 24px; padding: 0 8px; border-radius: 999px; background: #eff4fb; color: #314158;
    display: inline-flex; align-items: center; font-size: 11px; font-weight: 800; line-height: 1.1; text-align: center;
}
.sidebar-toggle-button {
    width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid #dce6f5; border-radius: 10px;
    background: #fff; color: #61718a; display: grid; place-items: center;
}
.sidebar-toggle-button:hover { color: var(--blue); background: #f5f9ff; }
.new-chat-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.new-chat-button {
    min-height: 46px; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(180deg, #166dff 0%, #0053fb 100%);
    display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 15px; font-weight: 850;
    box-shadow: 0 18px 36px rgba(18, 103, 255, .2);
}
.new-chat-button svg { width: 20px; height: 20px; }
.conversation-search {
    height: 42px; padding: 0 10px 0 12px; border: 1px solid #dde7f5; border-radius: 12px; background: #fff;
    display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 10px; box-shadow: 0 12px 26px rgba(31, 52, 84, .035);
}
.conversation-search svg { color: #65748d; width: 20px; }
.conversation-search input { min-width: 0; border: 0; outline: 0; color: var(--ink); font-size: 13px; background: transparent; }
.conversation-search input::placeholder { color: #97a5b8; }
.folder-group { display: grid; grid-template-rows: auto minmax(0, 1fr); align-content: start; gap: 8px; min-height: 0; }
.folder-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.folder-heading h2, .conversation-group h2 { margin: 0 0 2px; font-size: 14px; font-weight: 900; }
.folder-heading-actions { display: inline-flex; align-items: center; gap: 2px; }
.folder-heading-actions button {
    width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: #64748b;
    display: grid; place-items: center;
}
.folder-heading-actions button:hover { color: var(--blue); background: #eef5ff; }
.folder-heading-actions button svg { width: 17px; height: 17px; }
.folder-list { display: grid; align-content: start; gap: 8px; min-height: 0; overflow: auto; padding-right: 2px; }
.folder-item {
    display: grid; gap: 4px; align-items: start;
}
.folder-row {
    position: relative; min-width: 0;
}
.folder-main {
    width: 100%; min-width: 0; min-height: 36px; padding: 0 66px 0 6px; border: 1px solid transparent; border-radius: 9px;
    background: transparent; color: #53647d; display: grid; grid-template-columns: 14px 18px minmax(0, 1fr);
    align-items: center; gap: 6px; text-align: left; font-size: 13px; font-weight: 820;
}
.folder-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-main .folder-chevron { width: 14px; height: 14px; color: #96a4b8; transition: transform .16s ease; }
.folder-main .folder-icon { width: 17px; height: 17px; }
.folder-item.expanded .folder-chevron { transform: rotate(90deg); }
.folder-main:hover { border-color: #dbe8fb; background: #f0f5ff; color: var(--blue); }
.folder-item.active .folder-main { border-color: transparent; background: transparent; color: #53647d; }
.folder-action {
    position: absolute; top: 4px; z-index: 2; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: #8090a8;
    display: grid; place-items: center; opacity: 0; transition: opacity .12s ease, background .12s ease;
}
.folder-action.rename { right: 31px; }
.folder-action.delete { right: 2px; }
.folder-row:hover .folder-action, .folder-action:focus-visible { opacity: 1; }
.folder-action:hover { color: var(--blue); background: #eef5ff; }
.folder-action.danger:hover { color: var(--danger); background: #fff1f2; }
.folder-conversations { display: grid; gap: 3px; margin-left: 8px; padding: 2px 0 5px 10px; border-left: 1px solid #dce7f5; }
.conversation-group { display: none; }
.conversation-list { min-height: 0; overflow: auto; display: grid; align-content: start; gap: 9px; padding-right: 2px; }
.conversation-item {
    position: relative; width: 100%; padding: 0; border: 0; border-radius: 9px; background: transparent;
    display: block; text-align: left;
}
.conversation-main {
    width: 100%; min-width: 0; min-height: 34px; padding: 0 7px; border: 1px solid transparent; border-radius: 9px;
    background: transparent; display: grid; grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px; align-items: center; text-align: left;
}
.conversation-item:hover .conversation-main {
    border-color: #e6eefb; background: #eef4ff;
}
.conversation-item.active .conversation-main { border-color: transparent; background: transparent; color: var(--ink); }
.conversation-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 820; }
.conversation-main time { color: #8b98aa; font-size: 12px; transition: opacity .12s ease; }
.conversation-main small {
    display: none;
}
.conversation-actions { position: absolute; top: 3px; right: 3px; z-index: 4; }
.conversation-menu-trigger {
    width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: #64748b; opacity: 0;
    display: grid; place-items: center; transition: opacity .12s ease, background .12s ease, color .12s ease;
}
.conversation-item:hover .conversation-main time,
.conversation-item:focus-within .conversation-main time { opacity: 0; }
.conversation-item:hover .conversation-menu-trigger,
.conversation-actions.open .conversation-menu-trigger,
.conversation-menu-trigger:focus-visible { opacity: 1; }
.conversation-menu-trigger:hover,
.conversation-actions.open .conversation-menu-trigger {
    color: var(--blue); background: #eef5ff; opacity: 1;
}
.conversation-menu {
    position: absolute; top: 34px; right: 0; z-index: 45; width: 132px; padding: 6px; border: 1px solid #dfe8f5;
    border-radius: 10px; background: #fff; box-shadow: 0 16px 34px rgba(23, 36, 59, .14); display: none;
}
.conversation-actions.open .conversation-menu { display: grid; gap: 3px; }
.conversation-menu button {
    width: 100%; min-height: 30px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: #52617a;
    display: flex; align-items: center; gap: 7px; text-align: left; font-size: 12px; font-weight: 820;
}
.conversation-menu button:hover { color: var(--blue); background: #eef5ff; }
.conversation-menu .delete:hover { color: var(--danger); background: #fff1f2; }
.conversation-menu svg, .conversation-menu-trigger svg { width: 16px; height: 16px; }

.sidebar-collapsed .conversation-sidebar {
    padding: 0;
    border-right: 0;
    grid-template-rows: auto;
    gap: 0;
    overflow: hidden;
}
.sidebar-collapsed .sidebar-heading { display: none; }
.sidebar-collapsed .title-row,
.sidebar-collapsed .new-chat-row,
.sidebar-collapsed .conversation-search,
.sidebar-collapsed .folder-group,
.sidebar-collapsed .conversation-group {
    display: none;
}

.chat-stage { min-height: 100vh; padding: 0; background: linear-gradient(180deg, #f9fcff 0%, #f3f8ff 100%); }
.chat-card {
    width: 100%; height: 100vh; min-height: 600px; margin: 0; border: 0; border-radius: 0;
    background: rgba(255,255,255,.94); box-shadow: 0 18px 46px rgba(35, 58, 92, .075);
    display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 56px minmax(0, 1fr) auto; overflow: hidden;
}
.chat-topbar {
    position: relative; min-width: 0; border-bottom: 1px solid #edf2f8; background: rgba(255,255,255,.9);
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
}
.topbar-sidebar-toggle, .topbar-more-button {
    width: 38px; height: 38px; margin: auto; padding: 0; border: 0; border-radius: 12px;
    background: transparent; color: #0f172a; display: grid; place-items: center;
}
.topbar-sidebar-toggle:hover, .topbar-more-button:hover { color: var(--blue); background: #eef5ff; }
.topbar-left {
    grid-column: 1; min-width: 0; justify-self: start; padding-left: 10px;
    display: flex; align-items: center; gap: 9px;
}
.topbar-left .topbar-sidebar-toggle { margin: 0; flex: 0 0 auto; }
.chat-title-button {
    grid-column: 2; justify-self: center; width: min(520px, 34vw); min-width: 120px;
    padding: 0 8px; border: 0; border-radius: 8px;
    background: transparent; color: #111827; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 17px; line-height: 24px; font-weight: 500;
}
.chat-title-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-title-button svg { width: 15px; height: 15px; color: #9aa4b2; opacity: 0; transition: opacity .14s ease; }
.chat-title-button:hover { background: #f3f5f8; }
.chat-title-button:hover svg, .chat-title-button:focus-visible svg { opacity: 1; }
.chat-topbar > .usage-strip {
    grid-column: 3; justify-self: end; min-width: 0; max-width: 360px; min-height: 24px;
    margin-right: 16px; padding: 0; overflow: hidden; color: #718096;
    font-size: 11px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-ai-notice {
    min-width: 0; overflow: hidden; color: #a3acb9; font-size: 10px; line-height: 14px;
    font-weight: 400; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 1280px) {
    .topbar-left { gap: 6px; padding-left: 7px; }
    .topbar-ai-notice { max-width: 170px; font-size: 9px; }
    .chat-title-button { width: min(400px, 32vw); }
    .chat-topbar > .usage-strip { max-width: 300px; margin-right: 10px; font-size: 10px; }
}
.message-stream { min-height: 0; overflow: auto; padding: 24px clamp(22px, 4vw, 44px) 12px; display: grid; align-content: start; gap: 14px; }
.empty-state { display: grid; min-height: 100%; place-items: center; padding: 38px 18px 60px; }
.empty-guide { width: min(640px, 100%); display: grid; justify-items: center; gap: 12px; text-align: center; }
.empty-guide-logo {
    width: 62px; height: 62px; border: 1px solid #e3ecf8; border-radius: 18px; display: grid; place-items: center;
    background: #fff; box-shadow: 0 14px 34px rgba(31, 52, 84, .08);
}
.empty-guide-logo img { width: 46px; height: 46px; object-fit: contain; }
.empty-guide h2 { margin: 6px 0 0; font-size: 24px; line-height: 1.2; letter-spacing: 0; }
.empty-guide p { margin: 0; color: var(--muted); font-size: 14px; }
.empty-guide-prompts { margin-top: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.empty-guide-prompts button {
    min-height: 34px; padding: 0 13px; border: 1px solid #d7e5fb; border-radius: 999px; color: #1165f5;
    background: #f4f8ff; font-size: 12px; font-weight: 850;
}
.empty-guide-prompts button:hover { border-color: #9fc2ff; background: #edf4ff; }

:root[data-theme="dark"] .chat-title-button {
    color: #e8f0ff;
}
:root[data-theme="dark"] .chat-title-button:hover,
:root[data-theme="dark"] .chat-title-button:focus-visible {
    color: #ffffff;
    background: #151f2d;
}
:root[data-theme="dark"] .chat-title-button svg {
    color: #8fbaff;
}
:root[data-theme="dark"] .chat-topbar > .usage-strip {
    color: #a9b8cd;
}
:root[data-theme="dark"] .topbar-ai-notice {
    color: #8792a2;
}
:root[data-theme="dark"] .empty-guide-prompts button {
    color: #a9c7ff;
    border-color: #354d72;
    background: #15233a;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
:root[data-theme="dark"] .empty-guide-prompts button:hover,
:root[data-theme="dark"] .empty-guide-prompts button:focus-visible {
    color: #ffffff;
    border-color: #5f8ed2;
    background: #1c3150;
}
.demo-user-row, .message.user { display: flex; justify-content: flex-end; align-items: flex-start; gap: 10px; }
.demo-user-bubble, .message.user .bubble {
    max-width: min(var(--wenya-user-width), 72vw); padding: 10px 14px; border-radius: 12px; color: var(--ink);
    background: #edf3ff; box-shadow: inset 0 1px 0 rgba(255,255,255,.65); font-size: 14px; line-height: 1.65;
}
.demo-user-bubble time { display: block; color: #63728a; font-size: 12px; margin-bottom: 2px; font-weight: 500; }
.demo-user-bubble strong { font-weight: 850; }
.demo-avatar, .message-avatar.user-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden;
    background: #eef4ff; color: #1d4ed8; background-size: cover; background-position: center; font-weight: 850;
}
.demo-ai-row, .message.assistant { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; }
.ai-avatar, .message-avatar.ai-avatar {
    width: 44px; height: 44px; border: 1px solid #e3ecf8; border-radius: 50%; background: #fff; display: grid; place-items: center;
    box-shadow: 0 10px 24px rgba(31, 52, 84, .06); overflow: hidden;
}
.ai-avatar img, .message-avatar.ai-avatar img { width: 33px; height: 33px; object-fit: contain; }
.demo-answer, .message-body { min-width: 0; display: grid; gap: 10px; }
.message.user .message-body { justify-items: end; }
.assistant-meta, .message-label {
    min-height: 28px; display: flex; align-items: center; gap: 10px; color: #6b7a93; font-size: 13px;
}
.assistant-meta strong, .message-label strong { color: var(--ink); font-weight: 900; }
.assistant-meta span::before, .message-label span::before { content: ""; width: 4px; height: 4px; margin-right: 12px; border-radius: 50%; background: #96a4b9; display: inline-block; vertical-align: middle; }
.message-label.user-label { justify-content: flex-end; }
.demo-answer-card, .message.assistant .bubble {
    width: min(var(--wenya-assistant-width), 100%); padding: 12px 18px; border: 1px solid #dce6f3; border-radius: 12px;
    background: rgba(255,255,255,.96); box-shadow: 0 10px 24px rgba(35,58,92,.035);
    color: var(--ink); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere;
}
.demo-answer-card { white-space: normal; }
.message.assistant .bubble { white-space: normal; }
.message.assistant .bubble.is-empty {
    width: auto; max-width: max-content; min-width: 132px; min-height: 38px; padding: 9px 13px;
    justify-self: start; display: inline-flex; align-items: center;
}
.thinking-line { display: inline-flex; align-items: center; gap: 7px; color: #7f8ca2; font-size: 13px; font-weight: 760; }
.thinking-line b {
    width: 6px; height: 6px; border-radius: 50%; background: var(--blue); opacity: .45;
    animation: thinkingPulse 1.05s infinite ease-in-out;
}
.thinking-panel.complete .thinking-line b { animation: none; opacity: .75; }
.thinking-panel.complete .thinking-line b:nth-child(1) { background: #93c5fd; }
.thinking-panel.complete .thinking-line b:nth-child(2) { background: #60a5fa; }
.thinking-panel.complete .thinking-line b:nth-child(3) { background: #2563eb; }
.thinking-line b:nth-child(2) { animation-delay: .15s; }
.thinking-line b:nth-child(3) { animation-delay: .3s; }
.thinking-line em { font-style: normal; }
.thinking-panel {
    margin: 0 0 10px; padding: 0 0 9px; border-bottom: 1px solid #edf2f8; color: #73829a;
}
.thinking-panel summary {
    min-height: 24px; max-width: 100%; cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px;
    user-select: none;
}
.thinking-panel summary::-webkit-details-marker { display: none; }
.thinking-panel summary svg { width: 14px; height: 14px; transition: transform .14s ease; }
.thinking-panel[open] summary svg { transform: rotate(180deg); }
.thinking-summary-text {
    min-width: 0; max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: inherit; font-size: 12px; line-height: 1.6;
}
.thinking-panel .thinking-body {
    margin: 8px 0 4px; padding: 10px 12px; border-left: 3px solid #93c5fd; border-radius: 0 8px 8px 0;
    background: #f6f9ff; color: #5b6b84; font-size: 12.5px; line-height: 1.75;
    white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow-y: auto;
}
.thinking-panel.active .thinking-body { border-left-color: #2a76ff; color: #4a5a75; }
.thinking-panel ol { margin: 6px 0 0 22px; padding: 0; color: #64748b; font-size: 12px; line-height: 1.7; }
.thinking-panel li { margin: 2px 0; }
.answer-content:empty { display: none; }
.answer-content.streaming-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; }
@keyframes thinkingPulse {
    0%, 80%, 100% { transform: translateY(0); opacity: .35; }
    40% { transform: translateY(-3px); opacity: 1; }
}
.demo-answer-card p { margin: 0 0 8px; }
.demo-answer-card ul { margin: 0 0 12px 18px; padding: 0; }
.demo-answer-card li { margin: 4px 0; }
.demo-answer-card label { display: block; margin: 6px 0; }
.demo-answer-card input { width: 14px; height: 14px; margin-right: 10px; vertical-align: -2px; }
.demo-answer-card b { color: var(--blue); font-weight: 900; }
.generating-dots { margin-top: 9px; display: inline-flex; align-items: center; gap: 7px; color: #99a7bb; font-size: 13px; }
.generating-dots b { width: 8px; height: 8px; border-radius: 50%; background: #2a76ff; display: inline-block; }
.citation-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.citation-chip {
    min-height: 30px; padding: 0 12px; border: 1px solid #d7e5fb; border-radius: 999px; color: #1165f5; background: #f4f8ff;
    display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 850;
}
.citation-chip:hover { border-color: #9fc2ff; background: #edf4ff; }
.inline-charts { display: flex; flex-direction: column; gap: 14px; margin: 12px 0 4px; }
.inline-chart { width: 100%; height: 300px; }
.inline-chart-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.chart-download {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid #d7e5fb;
    border-radius: 999px; color: #1165f5; background: #f4f8ff; font-size: 12px; font-weight: 700; cursor: pointer;
}
.chart-download:hover { border-color: #9fc2ff; background: #edf4ff; }
.chart-download svg { width: 13px; height: 13px; }
.chart-missing { padding: 10px 12px; border-radius: 8px; background: #fef2f2; color: #b91c1c; font-size: 12.5px; }
.file-card {
    display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px;
    border: 1px solid #d7e5fb; border-radius: 10px; background: #f8fbff;
}
.file-card-icon {
    flex: none; width: 42px; height: 42px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    background: #e8f0ff; color: #1165f5; font-size: 11px; font-weight: 900; letter-spacing: .5px;
}
.file-card-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.file-card-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.file-card-info strong { font-size: 13.5px; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card-info span { font-size: 12px; color: #7b8aa3; }
.file-card-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.file-card-actions a {
    text-decoration: none; font-size: 12.5px; font-weight: 700; color: #1165f5;
    display: inline-flex; align-items: center; gap: 5px;
}
.file-card-actions .file-card-download {
    padding: 5px 12px; border: 1px solid #d7e5fb; border-radius: 999px; background: #f4f8ff;
}
.file-card-actions .file-card-download:hover { border-color: #9fc2ff; background: #edf4ff; }
.file-card-actions svg { width: 13px; height: 13px; }
.message { max-width: 100%; }
.message.user { flex-direction: row; }
.message.user .message-body { order: 1; }
.message.user .user-avatar { order: 2; }
.message-tool-row {
    min-height: 30px; display: flex; align-items: center; gap: 8px; justify-self: start;
}
.message-actions {
    display: flex; align-items: center; gap: 6px; opacity: 0; transform: translateY(-2px);
    transition: opacity .14s ease, transform .14s ease;
}
.message:hover .message-actions, .message:focus-within .message-actions, .message-tool-row:focus-within .message-actions { opacity: 1; transform: translateY(0); }
.message.user .message-actions { justify-content: flex-end; }
.message-actions button {
    min-height: 28px; padding: 0 9px; border: 1px solid #dce7f6; border-radius: 999px; background: #fff;
    color: #61718a; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800;
}
.message-actions button:hover { color: var(--blue); background: #f5f9ff; border-color: #bfd5fb; }
.message-actions button:disabled { display: none; }
.message-actions svg { width: 14px; height: 14px; }
.message-version-bar {
    display: flex; align-items: center; gap: 6px; color: #66758f; font-size: 12px; font-weight: 820;
}
.message-version-bar button {
    width: 26px; height: 26px; padding: 0; border: 1px solid #dce7f6; border-radius: 50%; background: #fff;
    color: #61718a; display: grid; place-items: center;
}
.message-version-bar button:hover:not(:disabled) { color: var(--blue); background: #f5f9ff; border-color: #bfd5fb; }
.message-version-bar button:disabled { opacity: .36; cursor: not-allowed; }
.message-version-bar svg { width: 13px; height: 13px; }

.markdown-body :where(p, ul, ol, blockquote, pre, table) { margin-top: 0; }
.markdown-body :where(p, ul, ol, blockquote, pre, table):last-child { margin-bottom: 0; }
.markdown-body p { margin: 0 0 10px; }
.markdown-body ul, .markdown-body ol { margin: 6px 0 12px 20px; padding: 0; }
.markdown-body li { margin: 4px 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    margin: 14px 0 8px; color: var(--ink); line-height: 1.35; letter-spacing: 0;
}
.markdown-body h1 { font-size: 19px; }
.markdown-body h2 { font-size: 17px; }
.markdown-body h3 { font-size: 15px; }
.markdown-body blockquote {
    margin: 10px 0; padding: 8px 10px; border-left: 3px solid #9bbcff; border-radius: 8px;
    background: #f6f9ff; color: #4c5d77;
}
.markdown-body pre {
    margin: 10px 0; padding: 11px 12px; overflow: auto; border-radius: 10px;
    background: #101827; color: #eef4ff; font-size: 12px; line-height: 1.65;
}
.markdown-body code {
    padding: 2px 5px; border-radius: 5px; background: #edf4ff; color: #0f56d9;
    font-family: Consolas, Menlo, Monaco, monospace; font-size: .92em;
}
.markdown-body pre code { padding: 0; background: transparent; color: inherit; }
.markdown-body a { color: var(--blue); font-weight: 800; }
.markdown-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
.markdown-body th, .markdown-body td { padding: 7px 9px; border: 1px solid #dfe8f5; text-align: left; }
.markdown-body th { background: #f4f8ff; }
.markdown-body table { display: block; max-width: 100%; overflow-x: auto; }

.composer { margin: 0 clamp(18px, 3vw, 34px) clamp(14px, 2vh, 20px); border: 1px solid #dfe8f5; border-radius: 16px; background: #fff; box-shadow: 0 14px 34px rgba(35,58,92,.06); padding: 6px; }
.prompt-toolbar { min-height: 32px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.reference-button, .icon-action, .model-switch, .capability-toggle {
    min-height: 30px; border: 1px solid #dfe8f5; border-radius: 999px; background: #fff; color: #43536b;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 830;
}
.model-switch { position: relative; padding: 0 7px 0 10px; }
.model-provider-logo { width: 18px; height: 18px; object-fit: contain; display: block; }
.model-picker-button {
    height: 28px; max-width: 250px; padding: 0; border: 0; background: transparent; color: inherit;
    display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 850;
}
.model-picker-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-picker-button svg { width: 15px; height: 15px; }
.model-picker-menu {
    position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 70; width: min(320px, 80vw);
    padding: 7px; border: 1px solid #dce7f6; border-radius: 12px; background: #fff;
    box-shadow: 0 18px 42px rgba(23, 36, 59, .16); display: grid; gap: 4px;
}
.model-picker-option {
    width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent;
    color: #43536b; display: grid; grid-template-columns: 20px minmax(0, 1fr) 16px; align-items: center; gap: 8px;
    text-align: left; font-size: 12px; font-weight: 850;
}
.model-picker-option:hover, .model-picker-option.active { background: #eef5ff; color: var(--blue); }
.model-picker-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-picker-option img { width: 18px; height: 18px; object-fit: contain; }
.model-picker-option svg { width: 14px; height: 14px; }
.model-picker-empty { padding: 10px; color: var(--muted); font-size: 12px; }
.reference-button { padding: 0 10px; cursor: pointer; }
.reference-button.active { color: var(--blue); border-color: #a9c8ff; background: #f3f7ff; }
.capability-toggle { height: 30px; padding: 0 9px 0 7px; cursor: pointer; opacity: .58; }
.capability-toggle img { width: 18px; height: 18px; object-fit: contain; display: block; }
.capability-toggle.active { opacity: 1; color: var(--blue); border-color: #a9c8ff; background: #f3f7ff; }
.capability-toggle:not(.active) span { color: #708199; }
.expand-button { margin-left: auto; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #fff; color: #64748b; }
.expand-button:hover, .icon-action:hover { background: #eef5ff; color: var(--blue); }
.composer-box { padding: 2px 6px 0; display: grid; gap: 5px; }
.composer textarea {
    width: 100%; height: 32px; min-height: 32px; max-height: 130px; border: 0; outline: 0; resize: none; color: var(--ink);
    font-size: 14px; line-height: 1.55; background: transparent; overflow-y: hidden;
}
.composer textarea::placeholder { color: #8c99ad; }
.attachment-status {
    justify-self: start; max-width: 100%; color: #64748b; font-size: 12px; font-weight: 760;
}
.attachment-status.ready { color: inherit; background: transparent; }
.attachment-status.busy { padding: 6px 10px; border-radius: 8px; color: #1d4ed8; background: #eff6ff; }
.message-attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.message.user .message-attachments { justify-content: flex-end; }
.message-attachment-card {
    display: grid; width: min(360px, 100%); min-width: 230px; grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid #dce6f3; border-radius: 10px; background: #f8fbff;
    text-align: left;
}
.message-attachment-card:hover { border-color: #a9c8ff; background: #f2f7ff; }
.message-attachment-icon { display: grid; width: 46px; height: 46px; place-items: center; overflow: hidden; border-radius: 8px; background: #edf4ff; }
.message-attachment-icon img { width: 38px; height: 38px; object-fit: contain; display: block; }
.message-attachment-card.image .message-attachment-icon img { width: 100%; height: 100%; object-fit: cover; }
.message-attachment-copy, .message-attachment-copy strong, .message-attachment-copy small { display: block; min-width: 0; }
.message-attachment-copy strong, .message-attachment-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-attachment-copy strong { font-size: 13px; line-height: 1.25; }
.message-attachment-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.message-attachment-card > button { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }
.message-attachment-card > button:hover { color: #d14343; background: #fff0f0; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.send-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.usage-strip {
    min-height: 30px; padding: 0 8px; color: #7b8aa2; font-size: 12px; font-weight: 780;
    display: inline-flex; align-items: center; white-space: nowrap;
}
.icon-action { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
#sendButton {
    min-height: 36px; padding: 0 16px; border: 0; border-radius: 12px; color: #fff;
    background: linear-gradient(180deg, #166dff 0%, #0053fb 100%);
    display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 900; box-shadow: 0 12px 20px rgba(18,103,255,.2);
}
#sendButton:disabled { opacity: .62; cursor: not-allowed; }
.stream-retry-button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin-top: 10px; padding: 0 11px; border: 1px solid #c9daf5; border-radius: 8px; color: var(--blue); background: #f5f9ff; font-size: 12px; font-weight: 800; }
.stream-retry-button svg { width: 15px; height: 15px; }
.composer.expanded textarea { height: 130px; min-height: 130px; overflow-y: auto; resize: vertical; }
.inline-message-editor {
    width: min(var(--wenya-user-width), 72vw); padding: 10px; border-radius: 14px; background: #f1f3f5;
    display: grid; gap: 8px;
}
.inline-message-editor textarea {
    width: 100%; min-height: 42px; max-height: 146px; padding: 0 2px; border: 0; outline: 0; resize: none;
    background: transparent; color: var(--ink); font-size: 14px; line-height: 1.65;
}
.inline-message-editor footer { display: flex; justify-content: flex-end; gap: 8px; }
.inline-message-editor button {
    min-height: 34px; padding: 0 14px; border-radius: 10px; font-size: 13px; font-weight: 850;
}
.inline-message-editor .cancel-edit { border: 1px solid #d8dee8; background: #fff; color: #334155; }
.inline-message-editor .submit-edit { border: 1px solid var(--blue); background: var(--blue); color: #fff; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 8px; }
.toast { max-width: 340px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 12px 30px rgba(18,32,57,.14); font-size: 13px; font-weight: 750; }
.toast.error { color: #b91c1c; border-color: #fecaca; background: #fff5f5; }
.inline-confirm {
    position: fixed; z-index: 220; width: min(320px, calc(100vw - 24px)); padding: 14px; border: 1px solid #f2c6c6;
    border-radius: 12px; background: #fff; box-shadow: 0 20px 54px rgba(23, 36, 59, .18); color: var(--ink);
}
.inline-confirm strong { display: block; font-size: 13px; font-weight: 900; }
.inline-confirm p { margin: 6px 0 12px; color: #66758f; font-size: 12px; line-height: 1.55; }
.inline-confirm div { display: flex; justify-content: flex-end; gap: 8px; }
.inline-confirm button { min-height: 30px; padding: 0 11px; border-radius: 8px; font-size: 12px; font-weight: 850; }
.confirm-cancel { border: 1px solid #dce7f6; background: #fff; color: #52617a; }
.confirm-danger { border: 1px solid #ef4444; background: #ef4444; color: #fff; }
.action-dialog { width: min(430px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 16px; background: transparent; box-shadow: 0 28px 80px rgba(15,23,42,.24); }
.action-dialog::backdrop { background: rgba(15,23,42,.42); backdrop-filter: blur(4px); }
.action-dialog form { margin: 0; overflow: hidden; border: 1px solid #e2e9f4; border-radius: inherit; background: #fff; }
.action-dialog header { display: grid; grid-template-columns: 38px minmax(0,1fr) 34px; align-items: center; gap: 11px; padding: 17px 18px 14px; border-bottom: 1px solid #edf1f7; }
.action-dialog-icon { width: 38px; height: 38px; border-radius: 10px; background: #edf4ff; color: var(--blue); display: grid; place-items: center; }
.action-dialog-icon svg { width: 18px; height: 18px; }
.action-dialog header strong { display: block; font-size: 15px; font-weight: 900; }
.action-dialog header small { display: block; margin-top: 3px; color: #78879c; font-size: 11px; line-height: 1.45; }
.action-dialog header > button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #7b8aa0; display: grid; place-items: center; }
.action-dialog header > button:hover { color: var(--ink); background: #f2f5f9; }
.action-dialog-body { padding: 17px 18px 19px; }
.action-dialog-body label { display: grid; gap: 7px; color: #42526a; font-size: 12px; font-weight: 850; }
.action-dialog-body [hidden] { display: none; }
.action-dialog-body input, .action-dialog-body select, .action-dialog-body textarea { width: 100%; border: 1px solid #d9e3f1; border-radius: 10px; outline: 0; background: #fff; color: var(--ink); font: inherit; font-weight: 700; }
.action-dialog-body input, .action-dialog-body select { height: 42px; padding: 0 12px; }
.action-dialog-body textarea { min-height: 116px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.action-dialog-body :is(input, select, textarea):focus { border-color: #8eb8ff; box-shadow: 0 0 0 3px rgba(22,109,255,.11); }
.action-dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px 16px; border-top: 1px solid #edf1f7; background: #fafcff; }
.action-dialog footer button { min-width: 72px; min-height: 36px; padding: 0 14px; border-radius: 9px; font-size: 12px; font-weight: 850; }
.action-dialog-cancel { border: 1px solid #dbe4f1; background: #fff; color: #53637a; }
.action-dialog-confirm { border: 1px solid var(--blue); background: var(--blue); color: #fff; }
.action-dialog-confirm.danger { border-color: #ef4444; background: #ef4444; }
.privacy-dialog { width: min(470px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 12px; box-shadow: 0 28px 80px rgba(15,23,42,.24); }
.privacy-dialog::backdrop { background: rgba(15,23,42,.48); backdrop-filter: blur(4px); }
.privacy-dialog article { overflow: hidden; background: #fff; }
.privacy-dialog header { display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 11px; padding: 18px 18px 14px; border-bottom: 1px solid #edf1f7; }
.privacy-dialog-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: #edf4ff; }
.privacy-dialog header strong, .privacy-dialog header small { display: block; }
.privacy-dialog header strong { font-size: 15px; }
.privacy-dialog header small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.privacy-dialog p { margin: 0; padding: 18px; color: #4b5d77; font-size: 13px; line-height: 1.7; }
.privacy-dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px 16px; border-top: 1px solid #edf1f7; background: #fafcff; }
.privacy-dialog footer button { min-height: 36px; padding: 0 14px; border: 1px solid #dbe4f1; border-radius: 8px; background: #fff; font-size: 12px; font-weight: 800; }
#acceptCapabilitiesButton { color: #fff; border-color: var(--blue); background: var(--blue); }
.citation-dialog, .attachment-preview-dialog { width: min(760px, calc(100vw - 32px)); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 28px 80px rgba(15,23,42,.25); }
.citation-dialog::backdrop, .attachment-preview-dialog::backdrop { background: rgba(15,23,42,.45); backdrop-filter: blur(5px); }
.citation-dialog article, .attachment-preview-dialog article { background: #fff; }
.citation-dialog header, .attachment-preview-dialog header { display: flex; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid #e7edf6; }
.citation-dialog small, .attachment-preview-dialog small { display: block; margin-top: 4px; color: var(--muted); }
.citation-dialog button, .attachment-preview-dialog header button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.citation-dialog pre, .attachment-preview-body pre { max-height: 62vh; margin: 0; padding: 18px; overflow: auto; white-space: pre-wrap; font-family: inherit; line-height: 1.7; }
.attachment-preview-body { min-height: 180px; display: grid; place-items: center; }
.attachment-preview-image { display: block; max-width: 100%; max-height: 70vh; object-fit: contain; }
.reference-dialog { width: min(640px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 48px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 28px 80px rgba(15,23,42,.25); }
.reference-dialog::backdrop { background: rgba(15,23,42,.5); backdrop-filter: blur(5px); }
.reference-dialog article { display: grid; max-height: inherit; grid-template-rows: auto minmax(0,1fr) auto; background: #fff; }
.reference-dialog header, .reference-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.reference-dialog header small { display: block; margin-top: 4px; color: var(--muted); }
.reference-dialog header button { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.reference-dialog-body { min-height: 0; padding: 14px 18px; overflow: auto; }
.reference-search { display: flex; height: 38px; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; }
.reference-search svg { width: 16px; color: var(--muted); }
.reference-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; }
.reference-list { display: grid; gap: 10px; margin-top: 12px; }
.reference-group { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.reference-group-heading, .reference-document { display: grid; grid-template-columns: 18px 20px minmax(0,1fr); align-items: center; gap: 8px; padding: 9px 11px; }
.reference-group-heading { background: #f6f9fe; font-size: 12px; font-weight: 850; }
.reference-document { border-top: 1px solid #edf1f7; cursor: pointer; }
.reference-document:hover { background: #f8fbff; }
.reference-document-icon { color: var(--blue); }
.reference-document strong, .reference-document small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference-document strong { font-size: 12px; }
.reference-document small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.reference-empty { padding: 30px; color: var(--muted); text-align: center; }
.reference-dialog footer { justify-content: flex-end; border-top: 1px solid var(--line); border-bottom: 0; }
.reference-dialog footer button { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-weight: 800; }
.reference-dialog footer .reference-confirm { color: #fff; border-color: var(--blue); background: var(--blue); }

@media (max-width: 1280px) {
    body { min-width: 980px; }
    .assistant-shell { grid-template-columns: 72px 244px minmax(0, 1fr); }
    .assistant-shell.sidebar-collapsed { grid-template-columns: 72px 0 minmax(0, 1fr); }
    .product-rail { padding-inline: 12px; }
    .rail-link.active::before { left: -12px; }
    .conversation-sidebar { padding-inline: 20px; }
    .title-row { align-items: flex-start; flex-direction: column; gap: 7px; }
    .new-chat-row { grid-template-columns: 1fr 44px; }
    .chat-stage { padding-inline: 0; }
    .sidebar-collapsed .conversation-sidebar { padding-inline: 10px; }
}
@media (max-width: 980px) {
    body { min-width: 0; }
    .assistant-shell { grid-template-columns: 70px minmax(0, 1fr); }
    .assistant-shell.sidebar-collapsed { grid-template-columns: 70px minmax(0, 1fr); }
    .product-rail { grid-row: 1 / span 2; padding: 18px 10px; gap: 12px; }
    .conversation-sidebar { position: fixed; z-index: 45; top: 0; bottom: 0; left: 70px; width: min(320px, calc(100vw - 70px)); height: 100dvh; border-right: 1px solid #e5edf8; box-shadow: 18px 0 42px rgba(23,36,59,.14); transform: translateX(0); transition: transform .18s ease, visibility .18s ease; }
    .mobile-sidebar-close { display: grid; }
    .assistant-shell.sidebar-collapsed .conversation-sidebar { visibility: hidden; transform: translateX(calc(-100% - 2px)); }
    .chat-stage { grid-column: 2; min-height: 0; padding: 0; }
    .chat-card { height: auto; min-height: 680px; }
    .chat-topbar { grid-column: 1 / -1; }
    .demo-ai-row, .message.assistant { grid-template-columns: 42px minmax(0, 1fr); }
    .ai-avatar, .message-avatar.ai-avatar { width: 42px; height: 42px; }
    .composer-box, .composer-actions, .prompt-toolbar, .send-actions { min-width: 0; width: 100%; }
    .composer-actions { align-items: stretch; flex-direction: column; }
    .prompt-toolbar { flex-wrap: nowrap; overflow-x: auto; padding: 2px 1px 5px; scrollbar-width: thin; }
    .usage-strip { flex: 0 0 auto; justify-content: flex-start; padding-inline: 4px; }
    .expand-button { margin-left: 0; }
}
@media (max-width: 680px) {
    .assistant-shell { grid-template-columns: 58px minmax(0, 1fr); }
    .assistant-shell.sidebar-collapsed { grid-template-columns: 58px minmax(0, 1fr); }
    .rail-link { width: 44px; height: 44px; border-radius: 14px; }
    .conversation-sidebar { left: 58px; width: min(310px, calc(100vw - 58px)); padding: 18px 14px; }
    .title-row h1 { font-size: 24px; }
    .new-chat-row { grid-template-columns: 1fr; }
    .message-stream { padding: 16px 12px; }
    .demo-user-bubble, .message.user .bubble { max-width: 88%; }
    .demo-answer-card, .message.assistant .bubble { padding: 16px; }
    .composer { margin: 0 10px 10px; }
    .send-actions { width: 100%; justify-content: space-between; }
    .model-switch { flex: 0 1 138px; min-width: 0; padding-left: 6px; }
    .model-picker-button { min-width: 0; max-width: 108px; padding-inline: 4px; }
    .model-provider-logo { width: 18px; height: 18px; }
    .reference-button { width: 32px; padding: 0; justify-content: center; }
    .reference-button span, .reference-button svg:last-child { display: none; }
    .capability-toggle span { display: none; }
    .capability-toggle { width: 32px; padding: 0; }
    .usage-strip { display: none; }
    .topbar-ai-notice { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ===== 对话缩略导航基础样式 ===== */
.chat-card { position: relative; }
.conversation-navigator {
    position: absolute; z-index: 28; top: 70px; right: 14px; bottom: 126px; width: 38px;
    color: #172640; pointer-events: none;
}
.conversation-navigator[hidden] { display: none; }
.conversation-navigator button, .conversation-navigator input { font: inherit; }
.conversation-navigator-toggle {
    position: absolute; z-index: 3; inset: 0 0 auto auto; width: 38px; height: 40px; padding: 0; border: 1px solid #dce7f5;
    border-radius: 13px; background: rgba(255,255,255,.96); color: #53647d; box-shadow: 0 10px 28px rgba(34,60,96,.12);
    display: grid; place-items: center; pointer-events: auto; transition: opacity .16s ease, transform .16s ease, border-color .16s ease, color .16s ease;
}
.conversation-navigator-toggle:hover { color: #0b63f6; border-color: #bcd2f5; transform: translateY(-1px); }
.conversation-navigator-toggle svg { width: 17px; height: 17px; transform: translateY(-4px); }
.conversation-navigator-toggle-count {
    position: absolute; left: 50%; bottom: 3px; min-width: 18px; transform: translateX(-50%); color: #7c8ba1;
    font-size: 9px; font-weight: 800; line-height: 10px;
}
.conversation-navigator-rail {
    position: absolute; top: 48px; right: 8px; bottom: 0; width: 22px; border: 1px solid #e3ebf6; border-radius: 11px;
    background: rgba(248,251,255,.94); box-shadow: 0 8px 20px rgba(33,55,86,.07); overflow: hidden; pointer-events: auto;
}
.conversation-navigator-rail::before { content: ''; position: absolute; top: 10px; bottom: 10px; left: 10px; width: 1px; background: #d9e4f3; }
.conversation-navigator-viewport {
    position: absolute; z-index: 1; top: var(--navigator-viewport-top, 0); right: 3px; width: 14px; height: var(--navigator-viewport-size, 22%);
    min-height: 12px; border: 1px solid rgba(17,105,255,.34); border-radius: 7px; background: rgba(22,110,255,.10);
    transition: top .08s linear, height .16s ease;
}
.conversation-navigator-nodes { position: absolute; z-index: 2; inset: 10px 0; }
.conversation-navigator-node {
    position: absolute; top: var(--navigator-node-position); left: 50%; width: 7px; height: 7px; padding: 0; border: 1.5px solid #a9bad0;
    border-radius: 50%; background: #fff; transform: translate(-50%, -50%); cursor: pointer; transition: width .14s ease, height .14s ease, border-color .14s ease, background .14s ease;
}
.conversation-navigator-node:hover, .conversation-navigator-node.is-active { width: 10px; height: 10px; border-color: #1169ff; background: #1169ff; }
.conversation-navigator-panel {
    position: absolute; inset: 0 0 0 auto; width: 286px; min-height: 320px; border: 1px solid #dce7f5; border-radius: 18px;
    background: rgba(255,255,255,.98); box-shadow: 0 22px 56px rgba(31,52,84,.18); display: grid; grid-template-rows: auto auto minmax(0,1fr) auto;
    opacity: 0; visibility: hidden; transform: translateX(10px) scale(.98); transform-origin: top right; pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.conversation-navigator.is-expanded { width: 286px; pointer-events: auto; }
.conversation-navigator.is-expanded .conversation-navigator-toggle,
.conversation-navigator.is-expanded .conversation-navigator-rail { opacity: 0; visibility: hidden; pointer-events: none; }
.conversation-navigator.is-expanded .conversation-navigator-panel { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.conversation-navigator-panel > header { min-height: 58px; padding: 12px 12px 10px 16px; border-bottom: 1px solid #edf2f8; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.conversation-navigator-panel > header div { min-width: 0; display: grid; gap: 2px; }
.conversation-navigator-panel > header strong { font-size: 14px; font-weight: 900; }
.conversation-navigator-panel > header span { color: #7a899e; font-size: 11px; }
.conversation-navigator-panel > header button { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 10px; background: #f3f7fc; color: #67778e; display: grid; place-items: center; cursor: pointer; }
.conversation-navigator-panel > header button:hover { background: #eaf2ff; color: #0d63ef; }
.conversation-navigator-panel > header svg { width: 16px; height: 16px; }
.conversation-navigator-search { height: 38px; margin: 10px 12px 8px; padding: 0 10px; border: 1px solid #e1e9f4; border-radius: 11px; background: #f8faff; display: grid; grid-template-columns: 17px 1fr; align-items: center; gap: 7px; }
.conversation-navigator-search:focus-within { border-color: #a8c8ff; box-shadow: 0 0 0 3px rgba(17,105,255,.09); }
.conversation-navigator-search svg { width: 15px; height: 15px; color: #8493a7; }
.conversation-navigator-search input { min-width: 0; border: 0; outline: 0; background: transparent; color: #1a2941; font-size: 12px; }
.conversation-navigator-list { min-height: 0; padding: 2px 8px 8px; overflow: auto; overscroll-behavior: contain; }
.conversation-navigator-item {
    width: 100%; padding: 10px 9px; border: 0; border-radius: 12px; background: transparent; color: inherit; display: grid;
    grid-template-columns: 27px minmax(0,1fr); gap: 8px; text-align: left; cursor: pointer; transition: background .14s ease, box-shadow .14s ease;
}
.conversation-navigator-item + .conversation-navigator-item { margin-top: 2px; }
.conversation-navigator-item:hover { background: #f4f8fe; }
.conversation-navigator-item.is-active { background: #edf5ff; box-shadow: inset 2px 0 #126cff; }
.conversation-navigator-number { color: #94a2b6; font: 800 10px/18px ui-monospace, SFMono-Regular, Consolas, monospace; }
.conversation-navigator-item.is-active .conversation-navigator-number { color: #126cff; }
.conversation-navigator-copy { min-width: 0; display: grid; gap: 3px; }
.conversation-navigator-copy strong, .conversation-navigator-copy small { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; }
.conversation-navigator-copy strong { color: #1a2941; font-size: 12px; line-height: 17px; font-weight: 800; -webkit-line-clamp: 2; }
.conversation-navigator-copy small { color: #7b8a9f; font-size: 11px; line-height: 16px; -webkit-line-clamp: 2; }
.conversation-navigator-empty { margin: 20px 12px; color: #8492a6; font-size: 12px; text-align: center; }
.conversation-navigator-latest {
    height: 38px; margin: 0 10px 10px; border: 1px solid #cfe0fb; border-radius: 11px; background: #f2f7ff; color: #0d63ef;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 800; cursor: pointer;
}
.conversation-navigator-latest[hidden] { display: none; }
.conversation-navigator-latest:hover { background: #e8f1ff; }
.conversation-navigator-latest svg { width: 15px; height: 15px; }
.message.navigator-target .message-body { animation: navigator-target-pulse 1.1s ease; }
@keyframes navigator-target-pulse {
    0%, 100% { filter: none; }
    24% { filter: drop-shadow(0 0 0 rgba(17,105,255,0)); }
    42% { filter: drop-shadow(0 8px 16px rgba(17,105,255,.20)); }
}
.message.navigator-target .bubble { outline: 2px solid rgba(17,105,255,.26); outline-offset: 4px; }

:root[data-theme="dark"] .conversation-navigator-toggle,
:root[data-theme="dark"] .conversation-navigator-panel { background: rgba(16,24,37,.98); border-color: #2b3c55; color: #edf4ff; }
:root[data-theme="dark"] .conversation-navigator-rail { background: rgba(18,27,41,.96); border-color: #2b3c55; }
:root[data-theme="dark"] .conversation-navigator-rail::before { background: #34455e; }
:root[data-theme="dark"] .conversation-navigator-node { background: #152033; border-color: #64748c; }
:root[data-theme="dark"] .conversation-navigator-panel > header { border-color: #25354c; }
:root[data-theme="dark"] .conversation-navigator-panel > header button,
:root[data-theme="dark"] .conversation-navigator-search { background: #172339; border-color: #2b3c55; }
:root[data-theme="dark"] .conversation-navigator-search input,
:root[data-theme="dark"] .conversation-navigator-copy strong { color: #edf4ff; }
:root[data-theme="dark"] .conversation-navigator-item:hover { background: #192840; }
:root[data-theme="dark"] .conversation-navigator-item.is-active { background: #182d4c; }
:root[data-theme="dark"] .conversation-navigator-latest { background: #172b49; border-color: #2f507c; color: #77aaff; }

@media (max-width: 760px) {
    .conversation-navigator { top: auto; right: 10px; bottom: 104px; height: 42px; }
    .conversation-navigator-rail { display: none; }
    .conversation-navigator.is-expanded { width: min(300px, calc(100vw - 80px)); height: min(50vh, 450px); }
    .conversation-navigator-panel { width: min(300px, calc(100vw - 80px)); height: min(50vh, 450px); min-height: 280px; }
}


/* ===== DeepSeek Harness-style chat layout ===== */
.message-stream {
    gap: 18px;
    padding: 28px clamp(18px, 4vw, 44px) 16px;
}
.message {
    display: block;
    width: min(var(--wenya-assistant-width), 100%);
    margin: 0 auto;
    max-width: 100%;
}
.message.user {
    display: flex;
    justify-content: flex-end;
    width: min(var(--wenya-assistant-width), 100%);
}
.message.assistant {
    display: block;
    width: min(var(--wenya-assistant-width), 100%);
    margin: 0 auto;
}
.message-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.message.user .message-body {
    align-items: flex-end;
    max-width: min(var(--wenya-user-width), 82%);
}
.message.assistant .message-body {
    align-items: flex-start;
    max-width: var(--wenya-assistant-width);
}
.message-avatar,
.message-label {
    display: none !important;
}
.message-status {
    min-height: 18px;
    color: #6b7a93;
    font-size: 12px;
    font-weight: 800;
    line-height: 18px;
}
.message.user .bubble {
    max-width: 100%;
    padding: 10px 16px;
    border-radius: 22px;
    color: var(--ink);
    background: #edf3ff;
    box-shadow: none;
    font-size: 15px;
    line-height: 24px;
}
.message.assistant .bubble,
.message.assistant .bubble.is-empty {
    width: auto;
    max-width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 15px;
    line-height: 1.7;
}
.message-actions {
    gap: 8px;
}
.message-time {
    color: #94a0b3;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.message.user .message-actions {
    justify-content: flex-end;
}
.message-tool-row {
    min-height: 28px;
}
.composer {
    max-width: min(var(--wenya-assistant-width), calc(100% - 40px));
    margin: 0 auto clamp(14px, 2vh, 20px);
}


/* ===== Composer single-line send actions ===== */
.composer-actions { gap: 10px; }
.prompt-toolbar { flex: 1 1 auto; min-width: 0; }
.usage-strip { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.send-actions { flex: 0 0 auto; flex-wrap: nowrap; }

/* ===== DeepSeek Harness-style Think disclosure row ===== */
.thinking-panel {
    width: min(100%, 680px);
    margin: 0 0 8px;
    padding: 0;
    border-bottom: 0;
    color: #8a97aa;
}
.thinking-summary {
    position: relative;
    overflow: hidden;
    width: fit-content;
    max-width: 100%;
    min-height: 30px;
    padding: 2px 10px;
    border: 1px solid #dce7f6;
    border-radius: 9px;
    background: #f7faff;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}
.thinking-summary::-webkit-details-marker { display: none; }
.thinking-leading { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex: 0 0 auto; }
.thinking-leading svg { width: 14px; height: 14px; }
.thinking-title { font-size: 13px; font-weight: 700; color: #52647e; flex: 0 0 auto; }
.thinking-separator { width: 2px; height: 2px; margin: 0 6px; border-radius: 1px; background: #c3cbd8; flex: 0 0 auto; }
.thinking-summary-text {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #94a0b3;
    font-size: 13px;
    line-height: 24px;
}
.thinking-panel.active .thinking-summary-text { text-overflow: clip; }
.thinking-chevron { flex: 0 0 auto; color: #94a0b3; transition: transform .14s ease; }
.thinking-panel[open] .thinking-chevron { transform: rotate(180deg); }
.thinking-body {
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #e2eaf5;
    border-radius: 10px;
    background: #f8faff;
    color: #7c8aa0;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
}
.thinking-panel.active .thinking-summary::after {
    content: '';
    position: absolute;
    inset-block: 0;
    left: -300px;
    width: 300px;
    background: linear-gradient(90deg, transparent 0%, rgba(61,126,245,.10) 55%, transparent 100%);
    animation: dsh-thinking-sweep 2.6s ease-out infinite;
    pointer-events: none;
}
@keyframes dsh-thinking-sweep {
    0% { left: -300px; }
    90%, 100% { left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .thinking-panel.active .thinking-summary::after { animation: none; }
}

/* Night-mode contrast fixes for the chat chrome and quoted/highlighted answers. */
:root[data-theme="dark"] .topbar-sidebar-toggle,
:root[data-theme="dark"] .sidebar-toggle-button,
:root[data-theme="dark"] .mobile-sidebar-close {
    color: #a9c7ff !important;
    border: 1px solid #36557f !important;
    background: #142033 !important;
    box-shadow: 0 0 0 1px rgba(91, 147, 247, .08), 0 6px 16px rgba(0, 0, 0, .18);
}

:root[data-theme="dark"] .topbar-sidebar-toggle:hover,
:root[data-theme="dark"] .sidebar-toggle-button:hover,
:root[data-theme="dark"] .mobile-sidebar-close:hover,
:root[data-theme="dark"] .topbar-sidebar-toggle:focus-visible,
:root[data-theme="dark"] .sidebar-toggle-button:focus-visible,
:root[data-theme="dark"] .mobile-sidebar-close:focus-visible {
    color: #fff !important;
    border-color: #6d9fe8 !important;
    background: #1b3150 !important;
    outline: 3px solid rgba(91, 147, 247, .2);
    outline-offset: 2px;
}

:root[data-theme="dark"] .topbar-sidebar-toggle svg,
:root[data-theme="dark"] .sidebar-toggle-button svg,
:root[data-theme="dark"] .mobile-sidebar-close svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
}

:root[data-theme="dark"] .markdown-body blockquote {
    border-color: #5b93f7 !important;
    background: #151f2d !important;
    color: #c4d2e6 !important;
    box-shadow: inset 0 0 0 1px rgba(91, 147, 247, .1);
}

:root[data-theme="dark"] .markdown-body blockquote :where(p, li, strong, em) {
    color: inherit !important;
}

/* 2026-08-20 · 问鸭新建会话按钮 */
#newConversationButton {
    border: 1px solid #c8d9ef; border-radius: 14px; color: #18385f;
    background: linear-gradient(180deg, #fff 0%, #f2f7fd 100%);
    box-shadow: 0 8px 20px rgba(42,72,111,.10), inset 0 1px 0 rgba(255,255,255,.96);
    font-weight: 850; letter-spacing: .01em;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease, color .16s ease;
}
#newConversationButton svg { color: #1169ff; stroke-width: 2.15; }
#newConversationButton:hover {
    color: #0b3978; border-color: #8eb4ea; background: linear-gradient(180deg, #fff 0%, #eaf3ff 100%);
    box-shadow: 0 11px 24px rgba(42,87,145,.14); transform: translateY(-1px);
}
#newConversationButton:active { transform: translateY(0); box-shadow: 0 5px 12px rgba(42,72,111,.10); }
#newConversationButton:focus-visible { outline: 3px solid rgba(17,105,255,.18); outline-offset: 2px; }

/* ===== B 方案：对话区左侧悬停预览导航 ===== */
.conversation-navigator {
    top: 86px; right: auto; bottom: 142px; left: 18px; width: 36px;
    color: #172640; pointer-events: auto; overflow: visible;
}
.conversation-navigator-rail {
    inset: 0 auto 0 0; width: 36px; border: 0; border-radius: 0;
    background: transparent; box-shadow: none; overflow: visible;
}
.conversation-navigator-rail::before { display: none; }
.conversation-navigator-nodes { inset: 8px 0; overflow: visible; }
.conversation-navigator-node {
    left: 0; width: 36px; height: 14px; padding: 0; border: 0; border-radius: 0; background: transparent;
    transform: translateY(-50%); display: flex; align-items: center; cursor: pointer;
}
.conversation-navigator-node:hover,
.conversation-navigator-node:focus-visible,
.conversation-navigator-node.is-previewed,
.conversation-navigator-node.is-active {
    width: 36px; height: 14px; border: 0; border-radius: 0; outline: 0; background: transparent; box-shadow: none;
}
.conversation-navigator-stroke {
    display: block; width: 8px; height: 2px; border-radius: 999px; background: #aeb6c0;
    transition: width .12s ease, background-color .12s ease;
}
.conversation-navigator-node.is-near-2 .conversation-navigator-stroke { width: 14px; background: #929ba6; }
.conversation-navigator-node.is-near-1 .conversation-navigator-stroke { width: 20px; background: #747e89; }
.conversation-navigator-node.is-previewed .conversation-navigator-stroke { width: 30px; background: #303943; }
.conversation-navigator-node:focus-visible { outline: 0; }
.conversation-navigator-preview {
    position: absolute; z-index: 6; top: var(--navigator-preview-top, 0); left: 44px; width: 400px; padding: 11px 13px 12px;
    border: 1px solid rgba(28,39,54,.10); border-radius: 14px; background: rgba(255,255,255,.97); box-shadow: 0 10px 28px rgba(31,43,58,.12);
    display: grid; gap: 4px; opacity: 0; visibility: hidden; transform: translateX(-5px); transform-origin: left center;
    pointer-events: none; transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}
.conversation-navigator-preview::before { display: none; }
.conversation-navigator.is-previewing .conversation-navigator-preview { opacity: 1; visibility: visible; transform: none; }
.conversation-navigator-preview > strong {
    color: #182130; font-size: 14px; line-height: 20px; font-weight: 800; display: block; overflow: hidden;
    white-space: nowrap; text-overflow: ellipsis;
}
.conversation-navigator-preview > p {
    margin: 0; color: #8a939e; font-size: 13px; line-height: 19px; display: -webkit-box; overflow: hidden;
    -webkit-box-orient: vertical; -webkit-line-clamp: 3;
}
:root[data-theme="dark"] .conversation-navigator-stroke { background: #62676d; }
:root[data-theme="dark"] .conversation-navigator-rail {
    border: 0; background: transparent; box-shadow: none;
}
:root[data-theme="dark"] .conversation-navigator-rail::before { display: none; }
:root[data-theme="dark"] .conversation-navigator-node,
:root[data-theme="dark"] .conversation-navigator-node:hover,
:root[data-theme="dark"] .conversation-navigator-node:focus-visible,
:root[data-theme="dark"] .conversation-navigator-node.is-previewed,
:root[data-theme="dark"] .conversation-navigator-node.is-active {
    border: 0; background: transparent; box-shadow: none;
}
:root[data-theme="dark"] .conversation-navigator-node.is-near-2 .conversation-navigator-stroke { background: #858b91; }
:root[data-theme="dark"] .conversation-navigator-node.is-near-1 .conversation-navigator-stroke { background: #a9adb1; }
:root[data-theme="dark"] .conversation-navigator-node.is-previewed .conversation-navigator-stroke { background: #f3f4f5; }
:root[data-theme="dark"] .conversation-navigator-preview { color: #f4f4f5; background: rgba(45,45,45,.98); border-color: transparent; box-shadow: 0 10px 28px rgba(0,0,0,.28); }
:root[data-theme="dark"] .conversation-navigator-preview > strong { color: #edf4ff; }
:root[data-theme="dark"] .conversation-navigator-preview > p { color: #a9a9aa; }
@media (max-width: 760px) {
    .chat-card { height: 100dvh; min-height: 0; }
    .composer { margin-bottom: max(10px, env(safe-area-inset-bottom)); }
    .conversation-navigator { position: fixed; top: 76px; right: auto; bottom: 112px; left: 76px; width: 30px; height: auto; }
    .conversation-navigator-rail { display: block; width: 30px; }
    .conversation-navigator-node { width: 30px; }
    .conversation-navigator-preview { left: 36px; width: min(282px, calc(100vw - 118px)); }
}
@media (max-width: 680px) {
    .conversation-navigator { left: 65px; }
}
