*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#f7f8fa;color:#202939;font-family:system-ui,-apple-system,sans-serif}button,textarea{font:inherit}button{cursor:pointer}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}#app{position:fixed;display:grid;grid-template-columns:280px minmax(0,1fr);background:#fff;overflow:hidden}#history{min-width:0;border-right:1px solid #dce0e7;display:flex;flex-direction:column;overflow:hidden;background:#f7f8fa}.history-head{display:flex;align-items:center;gap:8px;padding:16px;border-bottom:1px solid #dce0e7}.history-head strong{font-size:18px}.history-head button{margin-left:auto;min-height:44px;padding:8px 12px;border:1px solid #b7c0d0;border-radius:10px;background:#fff;color:#254eb3}.history-more{margin:10px 12px 0;min-height:44px;border:1px solid #b7c0d0;border-radius:10px;background:#fff}.history-head+ .history-more{flex:none}#conversation-list{padding:8px;overflow:auto;overscroll-behavior:contain}.conversation{display:block;width:100%;min-height:56px;padding:10px 12px;margin-bottom:4px;text-align:left;border:0;border-radius:10px;background:transparent;color:inherit}.conversation:hover,.conversation[aria-current=true]{background:#e9eefb}.conversation small{display:block;color:#677184;margin-top:3px}.workspace{min-width:0;min-height:0;display:grid;grid-template-rows:64px minmax(0,1fr) auto}header{display:flex;align-items:center;gap:10px;padding:8px 20px;border-bottom:1px solid #dce0e7}header h1{font-size:19px;margin:0}header .badge{margin-left:auto;font-size:11px;color:#677184}.icon-button,#back{display:grid;place-items:center;width:44px;height:44px;border:0;background:transparent;color:inherit;text-decoration:none;font-size:22px}.icon-button{display:none}.thread{min-height:0;overflow:auto;padding:20px 7%;overscroll-behavior:contain}.muted{color:#677184}.thread #error{color:#ac2430}.message{max-width:780px;margin:0 auto 16px}.bubble{padding:13px 16px;border-radius:16px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55}.question .bubble{margin-left:auto;background:#e9eefb}.answer .bubble{background:#f0f2f5}.meta{margin:7px 4px;font-size:12px;color:#677184}.stage{color:#254eb3}.citation-chip{display:inline-flex;align-items:center;min-height:24px;min-width:24px;justify-content:center;margin:0 2px;padding:2px 5px;border:0;border-radius:6px;background:#e4e8ef;color:#59677d;font-size:11px;font-weight:600;line-height:1;vertical-align:baseline}.citation-chip:hover,.citation-chip:focus-visible{background:#e9eefb;border-color:#254eb3}.source-modal{position:fixed;z-index:20;inset:0;display:grid;place-items:center;padding:20px;background:#20293999}.source-modal[hidden]{display:none}.source-modal-card{width:min(680px,100%);max-height:min(80vh,720px);display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden;border-radius:16px;background:#fff;box-shadow:0 16px 48px #20293955}.source-modal-head{display:flex;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid #dce0e7}.source-modal-head h2{margin:0;font-size:18px}.source-modal-close{margin-left:auto;min-width:44px;min-height:44px;padding:4px;border:0;border-radius:10px;background:transparent;font-size:28px;line-height:1}.source-modal-close:hover,.source-modal-close:focus-visible{background:#f0f2f5}.source-modal-content{margin:0;padding:18px 20px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55}.modal-open{overflow:hidden}form{display:grid;grid-template-columns:minmax(0,1fr) 48px;gap:8px;padding:12px max(16px,7%) max(12px,env(safe-area-inset-bottom));border-top:1px solid #dce0e7;background:#fff}textarea{display:block;width:100%;height:48px;min-width:0;resize:none;overflow:auto;padding:11px 13px;border:1px solid #aeb8c9;border-radius:14px;outline:0}textarea:focus{box-shadow:0 0 0 3px #cbd8ff}#send{width:48px;height:48px;border:0;border-radius:50%;background:#254eb3;color:#fff;font-size:24px}#send:disabled{opacity:.45}#access-error{position:fixed;inset:0;display:grid;place-items:center;padding:24px;color:#ac2430;text-align:center;pointer-events:none}@media(max-width:899px){#app{grid-template-columns:minmax(0,1fr)}#history{position:absolute;z-index:3;inset:0 auto 0 0;width:min(88vw,320px);transform:translateX(-102%);transition:transform .18s ease;box-shadow:8px 0 24px #0002}#history.open{transform:none}.icon-button{display:grid}header{padding-inline:8px}.thread{padding:16px}.message{max-width:none}form{padding-inline:12px}}@media(prefers-reduced-motion:reduce){#history{transition:none}}
/* A fresh chat is the default; history is an explicit drawer at every width. */
[hidden]{display:none!important}
#app{grid-template-columns:minmax(0,1fr)}
#history{position:absolute;z-index:3;inset:0 auto 0 0;width:min(340px,calc(100% - 48px));transform:none;transition:none;box-shadow:8px 0 32px #17203322}
#history-backdrop{position:absolute;z-index:2;inset:0;background:#17203366}
.icon-button{display:grid;flex-shrink:0;border-radius:10px}
.icon-button:hover{background:#e9eefb}
#history-close{margin-left:auto;font-size:28px}
#new-chat{flex:none;min-height:48px;margin:12px;padding:10px 16px;border:1px solid #c5cede;border-radius:12px;background:#fff;color:#254eb3;text-align:left}
#conversation-list{flex:1;min-height:0}
#history-error{margin:0 12px;color:#ac2430}
#history #back{display:flex;width:auto;height:auto;min-height:48px;margin:8px 12px 16px;padding:10px 12px;border-top:1px solid #dce0e7;font-size:14px;line-height:1.4}
#status:empty,#error:empty{display:none}
#status{max-width:780px;margin:16px auto 24px}
button:focus-visible,a:focus-visible{outline:2px solid #254eb3;outline-offset:-2px}
/* Constrain mobile titles and source sheets to the visible viewport. */
.workspace>header h1{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.workspace>header .icon-button,.workspace>header #back,.workspace>header .badge{flex-shrink:0}.conversation{overflow-wrap:anywhere}.source-modal-card{max-height:100%;min-height:0}.source-modal-content{overscroll-behavior:contain}textarea:focus{box-shadow:inset 0 0 0 2px #254eb3}.resume{min-height:44px;padding:8px 12px;border:1px solid #b7c0d0;border-radius:10px;background:#fff;color:#254eb3}@media(max-width:599px){.source-modal{padding:12px;align-items:end}.source-modal-card{border-radius:18px}.source-modal-content{padding:16px}.workspace>header h1{font-size:17px}}

/* Long content must not widen implicit grid columns on phones. */
.workspace,.source-modal-card{grid-template-columns:minmax(0,1fr)}
.thread,#messages,.bubble,.source-modal-content{min-width:0;max-width:100%}.message{min-width:0}
.thread,.source-modal-content{overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:touch}
.bubble,.source-modal-content{overflow-wrap:anywhere;word-break:break-word}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
@media(max-width:599px){.thread{padding:12px}.bubble{padding:12px;font-size:16px;line-height:1.6}.source-modal-content{font-size:16px;line-height:1.6}.source-modal-card{width:100%}textarea{font-size:16px}}
.people-access-link{display:flex;align-items:center;min-height:48px;margin:0 12px 8px;padding:10px 16px;border:1px solid #c5cede;border-radius:12px;background:#fff;color:#254eb3;text-decoration:none}
