:root {
  color-scheme: light;
  --ink: #2b2229;
  --muted: #73636e;
  --surface: #fff;
  --paper: #fffdfd;
  --rail: #f8f2f5;
  --line: #ebdfe6;
  --wash: #f6e8ef;
  --accent: #963b66;
  --accent-strong: #75324f;
  --error: #913750;
  --chat-width: 754px;
}
* {box-sizing:border-box}
[hidden],.symbols {display:none !important}
body {margin:0; color:var(--ink); background:var(--paper); font:15px/1.6 -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",system-ui,sans-serif; -webkit-font-smoothing:antialiased}
button,input,textarea,select,a {font:inherit; color:inherit}
button {cursor:pointer}
button:disabled {cursor:default; opacity:.52}
button:not(:disabled),a {touch-action:manipulation}
:focus-visible {outline:2px solid #a64c78; outline-offset:3px}
h1,h2,p {margin:0}
a {text-decoration:none}
label {display:grid; gap:6px}
input,textarea,select {min-width:0}
.icon {width:19px; height:19px; display:inline-block; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linejoin:round; stroke-linecap:round}
.sr {position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap}
.primary,.secondary,.quiet,.icon-button,.attach,.new-chat {display:inline-flex; align-items:center; justify-content:center; gap:7px; border-radius:8px; min-height:38px; font-weight:620; font-size:13px}
.primary {color:white; background:var(--accent); border:1px solid var(--accent); padding:8px 14px}
.primary:hover:not(:disabled),.send:hover:not(:disabled) {background:var(--accent-strong)}
.secondary {background:white; padding:6px 11px; border:1px solid var(--line); color:var(--accent-strong)}
.quiet,.icon-button,.attach {border:1px solid transparent; background:transparent; padding:6px 9px; color:var(--muted)}
.quiet:hover:not(:disabled),.icon-button:hover:not(:disabled),.attach:hover:not(:disabled),.secondary:hover:not(:disabled) {background:var(--wash); color:var(--accent-strong)}
.icon-button {width:36px; min-height:36px; padding:0}
.shell {height:100dvh; display:grid; grid-template-columns:252px minmax(0,1fr); overflow:hidden}
.rail {display:flex; flex-direction:column; gap:13px; padding:21px 13px 11px; min-height:0; background:var(--rail); border-right:1px solid var(--line)}
.brand {display:flex; align-items:center; gap:11px; color:#3c2b37; font-size:21px; font-weight:750; line-height:1.12; letter-spacing:.035em}
.rail .brand {padding:0 8px 6px}
.brand span:last-child {display:grid; gap:4px}
.brand small {font-size:11px; color:var(--muted); font-weight:520; letter-spacing:0}
.brand-mark {width:35px; height:35px; display:grid; place-items:center; color:white; background:var(--accent-strong); border-radius:9px}
.brand-mark .icon {width:23px; height:23px}
.new-chat {justify-content:flex-start; padding:8px 10px; color:var(--accent-strong); background:#fffafb; border:1px solid #e7d1df; margin:0 1px; min-height:42px}
.new-chat:hover:not(:disabled) {background:var(--wash)}
.navigate {display:grid; gap:3px}
.navigate button,.thread-link {width:100%; min-width:0; text-align:left; border:0; border-radius:7px; background:transparent; display:flex; align-items:center; gap:9px; padding:8px 10px; color:#524652}
.navigate button {min-height:38px; font-size:13px; font-weight:610}
.navigate button:hover:not(:disabled),.thread-link:hover:not(:disabled) {background:#fff9fc}
.navigate button[aria-current],.thread-link[aria-current] {color:var(--accent-strong); background:var(--wash); font-weight:670}
.recent {min-height:0; overflow:auto; padding-top:7px; border-top:1px solid var(--line); scrollbar-width:thin}
.recent h2 {font-size:11px; font-weight:620; color:var(--muted); padding:6px 10px; margin:0}
.thread-link {padding:7px 10px; min-height:34px; font-size:12px}
.thread-link span {overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.thread-link .icon {width:15px; height:15px}
.account {margin-top:auto; min-height:53px; padding:9px 6px 0; display:flex; align-items:center; gap:8px; border-top:1px solid var(--line); color:#4e3d4a}
.account strong,.account small {display:block; text-overflow:ellipsis; overflow:hidden; white-space:nowrap}
.account strong {font-size:12px}
.account small {font-size:10px; color:var(--muted)}
.account>div {flex:1; min-width:0}
.account button {min-height:30px; font-size:11px; padding:4px}
.avatar {width:30px; height:30px; display:grid; place-items:center; border-radius:50%; background:#ead6e2; color:var(--accent-strong); font-size:12px; font-weight:680; flex:none}
.stage {min-width:0; min-height:0; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:63px minmax(0,1fr)}
.stage-head {position:relative; min-width:0; display:flex; align-items:center; gap:10px; justify-content:space-between; padding:0 25px; border-bottom:1px solid var(--line); background:var(--paper)}
.stage-title {min-width:0; flex:1; color:#44303f; font-weight:670; font-size:14px; text-overflow:ellipsis; white-space:nowrap; overflow:hidden}
.head-actions {margin-left:auto; flex:0 0 auto; display:flex; align-items:center; gap:10px}
.context {min-height:32px; padding:4px 8px; font-size:12px}
.context .icon {width:16px; height:16px}
.context span {max-width:170px; text-overflow:ellipsis; overflow:hidden; white-space:nowrap}
.sandbox {color:#765d6e; font-size:11px; white-space:nowrap; border-left:1px solid var(--line); padding-left:10px}
.conversation {min-height:0; min-width:0; display:flex; flex-direction:column; height:100%}
.conversation[data-empty="true"] {justify-content:center; padding-bottom:clamp(26px,9dvh,108px)}
.conversation[data-empty="true"] .messages {display:none}
.conversation[data-empty="false"] #welcome {display:none}
.messages {min-height:0; flex:1; overflow:auto; scrollbar-width:thin; overscroll-behavior:contain}
.transcript,.composing {width:min(var(--chat-width),100% - 50px); margin-inline:auto}
.transcript {padding:29px 0 25px; display:grid; gap:27px}
.composing {padding:9px 0 13px}
#welcome {font-size:clamp(25px,3.4vw,38px); font-weight:660; line-height:1.27; letter-spacing:-.045em; color:#392a36; margin:0 0 22px}
.composer {position:relative; background:#fff; border:1px solid #e4d3df; border-radius:17px; padding:12px 12px 9px; box-shadow:0 3px 12px #3d1c3911}
.composer:focus-within {border-color:#c197ae; box-shadow:0 3px 14px #50203b16}
.composer.is-drop {background:#fff7fb; outline:2px dashed #a64c78; outline-offset:3px}
.composer textarea {display:block; padding:2px 5px 7px; width:100%; min-height:47px; max-height:185px; resize:none; border:0; outline:0; background:transparent; font-size:15px; field-sizing:content}
.composer textarea::placeholder {color:#877883}
.compose-tools {display:flex; align-items:center; gap:8px}
.attach {min-height:34px; padding:5px 7px}
.attach .icon {width:18px; height:18px}
.at-sign {font:650 16px/1 system-ui,sans-serif; color:var(--accent-strong)}
.composer-context {display:flex; flex-wrap:wrap; gap:5px 8px; align-items:center; min-width:0; margin:0 0 8px; padding:5px 8px; border:1px solid var(--line); border-radius:7px; background:#fcf6fa; color:var(--accent-strong); font-size:12px}
.context-name {font-weight:650; overflow-wrap:anywhere}
.context-fields {color:var(--muted)}
.composer-context a {margin-left:auto; text-decoration:underline; text-underline-offset:2px}
.composer-context .icon-button {width:24px; min-height:25px}
.composer-context .icon-button .icon {width:14px; height:14px}
.mention-menu {position:absolute; inset:auto auto calc(100% + 7px) 0; width:min(380px,100%); max-height:min(245px,45dvh); overflow:auto; background:#fff; border:1px solid #e4d3df; border-radius:11px; z-index:2; padding:5px; box-shadow:0 8px 23px #41253f22}
.mention-menu button {display:flex; flex-direction:column; gap:1px; width:100%; text-align:left; border:0; background:transparent; border-radius:6px; padding:7px 10px; color:var(--ink); font-size:13px}
.mention-menu button[aria-selected="true"],.mention-menu button:hover {background:var(--wash)}
.mention-menu small,.mention-empty {color:var(--muted); font-size:11px}
.mention-empty {padding:8px 10px}
.mode {position:relative; display:inline-flex}
.mode select {appearance:none; min-height:34px; padding:3px 25px 3px 8px; border:0; border-radius:6px; background:transparent; color:var(--muted); font-size:13px; cursor:pointer}
.mode .icon {position:absolute; pointer-events:none; right:5px; top:8px; width:16px; height:16px; color:var(--muted)}
.send {display:grid; place-items:center; margin-left:auto; width:38px; height:38px; border:0; border-radius:10px; color:#fff; background:var(--accent)}
.send:disabled {background:#e8d9e2; color:#7a5e71; opacity:1}
.send .icon {width:19px; height:19px}
.compose-state {font-size:12px; color:var(--muted); min-height:18px; padding:3px 3px 0}
.compose-state.is-error,.error {color:var(--error)}
.message {min-width:0}
.message.user {justify-self:end; max-width:min(86%,620px); display:grid; justify-items:end; gap:8px}
.message.assistant {display:grid; grid-template-columns:30px minmax(0,1fr); column-gap:12px}
.message.assistant>.assistant-mark {width:28px; height:28px; color:var(--accent-strong); background:var(--wash); border-radius:8px; display:grid; place-items:center}
.assistant-mark .icon {width:16px; height:16px}
.response-body {min-width:0; padding:2px 0}
.response-body h3 {margin:9px 0 4px; font-size:16px}
.response-body p + p {margin-top:9px}
.response-body p,.message-bubble {white-space:pre-wrap; overflow-wrap:anywhere}
.message-bubble {max-width:100%; border-radius:14px 14px 4px 14px; padding:9px 13px; background:#f4eaf0; color:#362831}
.message-actions {display:flex; align-items:center; gap:8px; margin-top:7px}
.message-actions button {min-height:27px; font-size:11px; padding:2px 5px}
.message-actions .icon {width:14px; height:14px}
.citations {display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin-top:11px}
.citations .secondary {min-height:31px; font-size:12px; padding:3px 8px; text-align:left}
.citation-label {font-size:11px; color:var(--muted)}
.composer-files,.message-files {display:flex; flex-wrap:wrap; gap:8px}
.composer-files:not(:empty) {margin-bottom:9px}
.file-card {min-width:0; max-width:min(240px,100%); min-height:47px; display:inline-flex; gap:8px; align-items:center; padding:6px 8px; border:1px solid var(--line); background:#fff; border-radius:8px; text-align:left}
.file-card button {background:transparent; border:0; min-width:0; text-align:left; color:var(--ink)}
.file-card.file-link {color:var(--ink); cursor:pointer}
.file-card.file-link:hover {background:#faf4f8}
.file-card .preview-thumb {width:39px; height:35px; object-fit:cover; border-radius:5px; background:#f8f1f5}
.file-card .file-mark {color:var(--accent-strong); display:grid; place-items:center; flex:none; width:31px; height:31px; border-radius:6px; background:var(--wash)}
.file-details {display:grid; min-width:0}
.file-details strong {text-overflow:ellipsis; overflow:hidden; white-space:nowrap; font-size:12px}
.file-details small {font-size:10px; color:var(--muted)}
.file-card .remove-file {display:grid; place-items:center; width:22px; height:25px; padding:2px; border-radius:4px; flex:none}
.file-card .remove-file:hover {background:var(--wash)}
.remove-file .icon {width:15px; height:15px}
.pending {font-size:13px; color:var(--muted)}
.pending .assistant-mark {animation:pulse 1.5s ease-in-out infinite alternate}
@keyframes pulse {from{opacity:.6}to{opacity:1}}
.library-view {min-width:0; min-height:0; overflow:auto; width:min(1240px,100%); padding:30px clamp(21px,5vw,62px); margin-inline:auto}
.page-head {display:flex; flex-wrap:wrap; justify-content:space-between; align-items:end; gap:12px; margin-bottom:23px}
.page-head h1 {font-size:30px; line-height:1.3; letter-spacing:-.04em; font-weight:670}
.page-head p {color:var(--muted); font-size:12px; margin-top:5px}
.search {width:min(330px,100%); display:flex; align-items:center; border:1px solid var(--line); border-radius:8px; background:white; color:var(--muted); padding:0 9px; margin-bottom:14px}
.search input {border:0; padding:7px; width:100%; background:transparent}
.table-shell {border:1px solid var(--line); border-radius:11px; background:white; overflow:auto}
table {width:100%; min-width:560px; border-collapse:collapse; text-align:left}
th,td {padding:12px 15px; vertical-align:middle; border-bottom:1px solid #f0e6ed}
th {background:#faf5f8; color:var(--muted); font-size:12px; font-weight:650}
td {font-size:13px}
tbody tr:last-child td {border-bottom:0}
td:first-child {font-weight:650}
td:last-child {white-space:nowrap}
.table-action {color:var(--accent-strong); font-weight:620; font-size:12px}
.table-action.secondary {min-height:29px}
.row-tools {display:flex; align-items:center; flex-wrap:wrap; gap:7px}
dialog {width:min(580px,100% - 28px); max-height:calc(100dvh - 38px); border:1px solid var(--line); padding:0; border-radius:13px; color:var(--ink); background:#fff; box-shadow:0 20px 65px #5b294739}
dialog::backdrop {background:#30203262}
.dialog-head {display:flex; justify-content:space-between; gap:10px; align-items:center; padding:12px 17px; border-bottom:1px solid var(--line)}
.dialog-head h2 {font-size:16px; line-height:1.4; overflow-wrap:anywhere}
.dialog-body {padding:17px; overflow-wrap:anywhere}
.dialog-actions {display:flex; justify-content:flex-end; gap:9px; padding:0 17px 15px}
.dialog-actions:empty {display:none}
.fields-form {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px}
.full {grid-column:1/-1}
.fields-form .dialog-actions {padding:0}
.fields-form input,.fields-form textarea,.context-content select,.login-card input {width:100%; padding:8px 9px; border:1px solid #e4d5df; border-radius:7px; background:#fff; font-size:14px}
.fields-form label,.context-content label,.login-card label {font-size:13px; font-weight:600}
.context-content {display:grid; gap:12px}
.context-detail {font-size:13px; color:var(--muted); white-space:pre-line}
.context-detail:empty,.error:empty {display:none}
.context-content .primary,.context-content .secondary {justify-self:start}
.preview-image {max-width:100%; max-height:64vh; object-fit:contain; margin:auto; display:block; border-radius:7px}
.file-excerpt {font:inherit; font-size:13px; white-space:pre-wrap; overflow-wrap:anywhere; color:#443640; margin:10px 0 0; padding:11px; background:#fcf7fa; border-radius:7px}
.preview-note {font-size:12px; color:var(--muted); margin-top:8px}
.proposal-profile {padding:9px 11px; margin-top:10px; border-radius:7px; background:var(--rail)}
.dialog-body h3 {font-size:14px; margin:12px 0 4px}
.proposal-cite {min-height:33px; margin-top:6px}
.toast {position:fixed; z-index:5; bottom:20px; right:20px; max-width:min(90vw,380px); padding:9px 14px; border-radius:8px; background:#5e3049; color:#fff; font-size:13px}
.login-screen {min-height:100dvh; display:grid; place-items:center; padding:20px; background:#f8f1f5}
.login-card {width:min(410px,100%); padding:31px; border:1px solid var(--line); border-radius:15px; background:#fff}
.login-card h1 {font-size:23px; font-weight:670; margin:19px 0 15px}
.login-card form {display:grid; gap:12px}
.login-card form .primary {justify-self:start}
.login-card .fill-account {margin-top:12px}
.menu,.rail-overlay {display:none}
@media (max-width:760px) {
  .shell {grid-template-columns:minmax(0,1fr)}
  .rail {display:none; position:fixed; inset:0 auto 0 0; width:min(272px,82vw); z-index:3}
  .shell.drawer-open .rail,.shell.drawer-open .rail-overlay {display:flex}
  .rail-overlay {position:fixed; z-index:2; inset:0; border:0; background:#34213455}
  .menu {display:inline-flex; flex:0 0 auto}
  .stage {grid-template-rows:53px minmax(0,1fr)}
  .stage-head {padding:0 11px; justify-content:flex-start; gap:5px}
  .head-actions {gap:4px}
  .context span {max-width:86px}
  .context .icon {display:none}
  .transcript,.composing {width:calc(100% - 27px)}
  .conversation[data-empty="true"] {padding-bottom:11dvh}
  .transcript {padding-top:17px; gap:19px}
  .message.assistant {grid-template-columns:25px minmax(0,1fr); gap:8px}
  .message.assistant>.assistant-mark {width:24px; height:24px}
  .composer {padding:8px}
  .composer textarea {min-height:40px}
  .library-view {padding:20px 13px}
}
@media (prefers-reduced-motion:reduce) {.pending .assistant-mark {animation:none}}
