:root { color-scheme: light; --ink: #252525; --muted: #858585; --line: #e6e6e6; --green: #17563a; --sidebar-width: 280px; }
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: #fff; font-family: 'Segoe UI', Arial, sans-serif; font-size: 14px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
a { color: inherit; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.65; flex-shrink: 0; }
.chat-app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f8f8f8; border-right: 1px solid var(--line); padding: 12px; overflow: hidden; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 42px; margin-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 9px; padding-left: 6px; text-decoration: none; font-size: 19px; font-weight: 600; }
.brand img { object-fit: contain; }
.brand-tools { display: flex; gap: 2px; }
.icon-button { width: 34px; height: 34px; flex-shrink: 0; display: inline-grid; place-items: center; padding: 0; background: transparent; border: 0; border-radius: 6px; color: #666; }
.icon-button:hover { background: #ededed; color: #252525; }
.sidebar-command { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 10px; background: transparent; border: 0; border-radius: 6px; text-align: left; }
.sidebar-command:hover { background: #ececec; }
.sidebar-search { display: flex; align-items: center; gap: 7px; margin: 10px 0 4px; border: 1px solid #ddd; border-radius: 6px; background: #fff; padding: 8px; }
.sidebar-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; }
.sidebar-search > svg { width: 15px; color: var(--muted); }
.conversation-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0 20px; scrollbar-width: thin; scrollbar-color: #d7d7d7 transparent; }
.session-group-label { margin: 20px 10px 8px; font-size: 12px; font-weight: 600; color: #929292; }
.session-row { display: flex; align-items: center; height: 38px; border-radius: 6px; position: relative; }
.session-row:hover { background: #eee; }
.session-row.active { background: #eaeaea; }
.session-select { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 0; background: transparent; text-align: left; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.session-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.session-select .lucide { width: 13px; height: 13px; color: #888; }
.session-options { opacity: 0; width: 30px; height: 30px; margin-right: 3px; }
.session-row:hover .session-options, .session-row:focus-within .session-options, .session-row.active .session-options { opacity: 1; }
.session-row.menu-open { z-index: 3; }
.session-menu { position: absolute; left: 12px; right: 4px; top: 34px; padding: 5px; z-index: 5; border: 1px solid #ddd; border-radius: 8px; background: #fff; box-shadow: 0 6px 20px #00000012; }
.session-menu button { width: 100%; display: flex; gap: 9px; align-items: center; text-align: left; border: 0; border-radius: 5px; padding: 9px; background: transparent; font-size: 13px; }
.session-menu button:hover { background: #f4f4f4; }
.session-menu .danger { color: #b53838; }
.sidebar-empty { color: #929292; padding: 18px 10px; font-size: 13px; }
.sidebar-footer { padding-top: 8px; border-top: 1px solid var(--line); }
.office-label { display: block; color: #939393; font-size: 11px; padding: 6px 10px 2px; }
.workspace { display: flex; flex-direction: column; height: 100%; min-width: 0; min-height: 0; overflow: hidden; position: relative; background: #fff; }
.workspace-header { height: 62px; min-height: 62px; display: grid; grid-template-columns: minmax(130px, 1fr) minmax(0, 2fr) minmax(100px, 1fr); align-items: center; gap: 16px; padding: 0 24px; }
.header-start { display: flex; align-items: center; gap: 10px; }
.workspace-name { color: #777; font-size: 17px; font-weight: 500; }
.active-chat-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; text-align: center; color: #888; }
.university-link { justify-self: end; display: flex; align-items: center; gap: 7px; text-decoration: none; font-size: 12px; color: #888; }
.university-link .lucide { width: 14px; height: 14px; }
#sidebarOpen { display: none; }
.conversation-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.welcome { display: none; text-align: center; padding: 0 24px; }
.welcome-university { display: block; font-size: 14px; color: #989898; margin-bottom: 12px; }
.welcome h1 { font-size: 28px; line-height: 1.25; font-weight: 400; margin: 0; }
.chat-scroll { flex: 1 1 0; min-height: 0; min-width: 0; overflow-x: hidden; overflow-y: auto; overflow-anchor: none; overscroll-behavior-y: contain; padding: 25px max(24px, calc((100% - 800px) / 2)) 20px; scrollbar-width: thin; }
.chat-scroll:focus-visible { outline: 2px solid #b9ccc1; outline-offset: -2px; }
.message { margin: 0 0 26px; }
.message-wrapper { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.message-avatar { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; color: var(--green); font-size: 15px; font-weight: 600; }
.message-avatar img { width: 26px; height: 26px; object-fit: contain; }
.message-content { min-width: 0; flex: 1; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.message.user .message-wrapper { justify-content: flex-end; }
.message.user .message-content { flex: none; max-width: 85%; background: #f3f3f3; border-radius: 8px; padding: 11px 16px; white-space: pre-wrap; }
.message-content p { margin: 0 0 14px; }
.message-content p:last-child { margin-bottom: 0; }
.message-content ul, .message-content ol { padding-left: 23px; margin: 10px 0 18px; }
.message-content li { margin: 5px 0; }
.message-content h1, .message-content h2, .message-content h3 { font-size: 18px; line-height: 1.5; margin: 20px 0 10px; font-weight: 600; }
.message-content strong { color: inherit; font-weight: 600; }
.message-content a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.message-content pre { max-width: 100%; overflow-x: auto; padding: 12px; background: #f6f6f6; border-radius: 6px; }
.message-content code { background: #f3f3f3; font-size: 13px; padding: 2px 4px; border-radius: 3px; }
.message-content blockquote { border-left: 2px solid #ddd; margin-left: 0; padding-left: 16px; color: #777; }
.message-content table { display: block; overflow-x: auto; border-collapse: collapse; max-width: 100%; }
.message-content td, .message-content th { border: 1px solid #ddd; padding: 8px; min-width: 90px; text-align: left; }
.message-tools { display: flex; align-items: center; gap: 3px; margin-top: 10px; }
.message-tools .icon-button { width: 28px; height: 28px; }
.message-tools .lucide { width: 15px; height: 15px; }
.message-note { font-size: 12px; color: #999; margin-top: 8px; }
.pending-answer { display: flex; align-items: center; gap: 8px; color: #999; font-size: 13px; }
.response-activity { margin-bottom: 10px; }
.answer-content.is-streaming > :last-child:not(ul):not(ol):not(pre):not(table)::after { content: ''; display: inline-block; width: 2px; height: 15px; margin-left: 3px; vertical-align: -2px; background: #68776e; animation: var(--typing-animation, cursor-blink .8s steps(2, start) infinite); }
@keyframes cursor-blink { to { visibility: hidden; } }
.spinning { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.thinking-panel { border-left: 2px solid #ddd; margin-bottom: 14px; padding-left: 12px; font-size: 12px; color: #999; }
.thinking-panel pre { font: inherit; white-space: pre-wrap; background: transparent; max-height: 120px; overflow: auto; padding: 8px 0; }
.composer-area { flex: 0 0 auto; width: min(800px, calc(100% - 48px)); margin: 0 auto; padding: 12px 0 0; }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 10px 10px 10px 20px; border: 1px solid #e6e6e6; border-radius: 28px; background: #fff; box-shadow: 0 2px 12px #00000006; }
.composer:focus-within { border-color: #c9cecb; }
#userInput { display: block; flex: 1; min-width: 0; width: 100%; min-height: 32px; max-height: 160px; padding: 5px 0; resize: none; border: 0; outline: none; box-shadow: none; background: transparent; font-size: 15px; line-height: 22px; }
#userInput::placeholder { color: #989898; }
.send-button { display: grid; place-items: center; height: 34px; width: 34px; flex-shrink: 0; background: var(--green); color: #fff; border: 0; border-radius: 50%; }
.send-button:hover { background: #12472f; }
.send-button:disabled { color: #a7a7a7; background: #eee; }
.send-button .lucide { width: 18px; height: 18px; stroke-width: 2; }
.suggestions { display: none; margin-top: 28px; }
.suggestions button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 44px; text-align: left; padding: 10px 17px; border: 0; border-radius: 6px; background: transparent; color: #909090; font-size: 14px; }
.suggestions button:hover { background: #f8f8f8; color: #555; }
.suggestions button > .lucide:first-child { color: #729281; width: 17px; }
.suggestions button > .lucide:last-child { margin-left: auto; color: #b7b7b7; width: 15px; }
.workspace.is-empty .conversation-stage { justify-content: center; padding-bottom: 8vh; }
.workspace.is-empty .welcome { display: block; margin-bottom: 24px; }
.workspace.is-empty .chat-scroll { display: none; }
.workspace.is-empty .composer-area { padding-top: 0; }
.workspace.is-empty .suggestions { display: block; }
.workspace-footer { height: 40px; min-height: 40px; display: grid; place-items: center; text-align: center; font-size: 11px; color: #999; padding: 5px 24px; }
.jump-latest { position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%); background: #fff; border: 1px solid #ddd; border-radius: 50%; box-shadow: 0 2px 6px #0000000a; z-index: 2; }
.history-older { display: block; margin: 0 auto 26px; border: 0; background: transparent; color: #777; font-size: 12px; padding: 8px 12px; }
.chat-app.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar-collapsed .sidebar { visibility: hidden; padding: 0; border: 0; }
.sidebar-collapsed #sidebarOpen { display: inline-grid; }
.chat-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); border: 1px solid #ddd; border-radius: 8px; padding: 22px; color: var(--ink); }
.chat-dialog::backdrop { background: #00000035; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.dialog-heading h2 { font-size: 18px; font-weight: 600; margin: 0; }
.chat-dialog label { display: block; margin: 8px 0; font-size: 13px; }
.chat-dialog input { padding: 10px; width: 100%; border: 1px solid #ccc; border-radius: 6px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.text-button, .primary-button { padding: 9px 16px; border: 1px solid #ddd; border-radius: 6px; background: #fff; }
.primary-button { background: var(--green); color: #fff; border-color: var(--green); }
.trash-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.trash-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-empty { font-size: 14px; color: #999; padding: 14px 0; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); padding: 11px 18px; background: #303030; color: #fff; font-size: 13px; border-radius: 6px; z-index: 20; max-width: calc(100% - 32px); }
@media (prefers-reduced-motion: reduce) {
    .spinning { animation: none; }
    .answer-content.is-streaming { --typing-animation: none; }
}
@media (max-width: 800px) {
    .chat-app, .chat-app.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: min(280px, calc(100vw - 48px)); z-index: 12; transform: translateX(-100%); transition: transform .18s ease; visibility: visible !important; padding: 12px !important; border-right: 1px solid var(--line) !important; }
    .chat-app.sidebar-visible .sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 11; background: #00000025; }
    #sidebarOpen { display: inline-grid; }
    .workspace-header { height: 56px; min-height: 56px; padding: 0 14px; grid-template-columns: 90px minmax(0,1fr) 62px; gap: 10px; }
    .workspace-name { font-size: 16px; }
    .university-link span { font-size: 11px; }
    .university-link .lucide { display: none; }
    .active-chat-title { font-size: 12px; }
    .welcome { padding: 0 22px; }
    .welcome-university { font-size: 12px; }
    .welcome h1 { font-size: 25px; }
    .chat-scroll { padding: 20px 16px; }
    .message-content { font-size: 15px; }
    .message-wrapper { gap: 9px; }
    .message.user .message-content { max-width: 90%; }
    .composer-area { width: calc(100% - 28px); }
    .composer { padding-left: 16px; }
    #userInput { font-size: 16px; }
    .suggestions button { padding-left: 9px; padding-right: 9px; font-size: 13px; gap: 10px; }
    .suggestions button > .lucide:last-child { display: none; }
    .workspace.is-empty .conversation-stage { padding-bottom: 5vh; }
    .workspace-footer { height: 34px; min-height: 34px; font-size: 10px; }
    .session-options { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
