main.shell { padding-bottom:16px }
.team-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:0 12px }
#modelControl { display:flex; align-items:center; gap:8px; margin:6px 0 }
#modelControl label { font-size:.9rem; font-weight:600; color:var(--navy) }
#teamModel { max-width:100%; min-height:38px; padding:6px 10px; border:1px solid #a6b9c8; border-radius:8px; background:white; color:var(--navy); font:inherit; font-size:.9rem }
#teamModel:focus-visible { outline:3px solid #11858a; outline-offset:2px }
main h1 { font-size:clamp(1.8rem,3vw,2.4rem); margin:18px 0 14px }
#workspace { display:grid; grid-template-columns:minmax(205px,26%) minmax(0,1fr); height:clamp(420px,calc(100dvh - 172px),960px); border:1px solid var(--line); border-radius:14px; overflow:hidden; background:white; box-shadow:0 5px 20px #17365d09 }
#teamDirectory { overflow:auto; background:#f8fafc; border-right:1px solid var(--line); padding:18px 10px }
#directoryTitle { font-size:1rem; margin:0 10px 14px }
#members { display:grid; gap:2px }
.member { display:flex; align-items:center; gap:10px; padding:6px 10px; border:1px solid transparent; border-radius:8px; text-align:left; background:transparent; color:var(--navy); font-size:.92rem; line-height:1.25; text-decoration:none }
.member:hover { background:#edf3f6 }
.member[aria-pressed="true"] { background:#deeee9; border-color:#b4d8cc; color:#124a43 }
.member:disabled { opacity:.73; cursor:default }
.member,.message { --wash:#f1f4f7; --edge:#b7c2d0; --accent:#45586e }
[data-sender="user"] { --wash:#e5f6e8; --edge:#aad5b4; --accent:#25603b }
[data-sender="project-coordinator"] { --wash:#edf4ff; --edge:#abc9f0; --accent:#285688 }
[data-sender="developer"] { --wash:#f2edff; --edge:#c9b8eb; --accent:#634494 }
[data-sender="executive-assistant"] { --wash:#fff5d9; --edge:#dfc477; --accent:#745613 }
[data-sender="administration-officer"] { --wash:#e6f6f5; --edge:#96ceca; --accent:#17666c }
[data-sender="bca-technical-analyst"] { --wash:#fff0e2; --edge:#e6b38c; --accent:#88471c }
[data-sender="independent-technical-reviewer"] { --wash:#f9edf6; --edge:#d9afcf; --accent:#803c73 }
[data-sender="fee-proposal-manager"] { --wash:#ffedec; --edge:#e4b0ac; --accent:#923f45 }
[data-sender="planning-approvals-analyst"] { --wash:#f0f4df; --edge:#c0cc92; --accent:#536420 }
[data-sender="payroll-officer"] { --wash:#eaf0f4; --edge:#acc1ce; --accent:#3c596b }
.avatar { display:grid; place-items:center; flex:0 0 32px; height:32px; border-radius:10px; border:1px solid var(--edge); background:var(--wash); color:var(--accent); font-weight:700; font-size:.76rem }
.member[aria-pressed="true"] .avatar { background:var(--accent); border-color:var(--accent); color:white }
.member-name { flex:1; min-width:0; font-weight:600 }
.member-name small { display:block; margin-top:2px; font-size:.73rem; font-weight:400 }
#conversation { display:grid; grid-template-rows:auto minmax(0,1fr) auto; min-height:0; min-width:0 }
.chat-head { display:flex; align-items:center; gap:10px; padding:14px 22px; border-bottom:1px solid #dde5eb }
.identity { flex:1; min-width:0 }
.identity h2 { margin:0; font-size:1.18rem }
.identity p { color:var(--muted); margin:3px 0 0; font-size:.86rem }
#newChat,#backToTeam { flex:none; font-size:.85rem; padding:7px 10px }
#backToTeam { display:none }
.scroll-area { overflow-y:auto; padding:20px clamp(12px,2.7vw,32px); background:#fafbfd; overscroll-behavior:contain; scrollbar-gutter:stable }
#emptyChat { color:var(--muted); margin:clamp(32px,12vh,100px) auto 20px; text-align:center }
#messages { display:flex; flex-direction:column; gap:14px }
.message { box-sizing:border-box; min-width:0; max-width:min(92%,76ch); align-self:flex-start; padding:11px 15px 13px; background:var(--wash); border:1px solid var(--edge); border-inline-start:3px solid var(--accent); border-radius:4px 15px 15px 15px }
.message.user { max-width:min(84%,70ch); align-self:flex-end; border-inline-start:1px solid var(--edge); border-inline-end:3px solid var(--accent); border-radius:15px 4px 15px 15px }
.message-meta { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:2px 18px; margin-bottom:5px; line-height:1.35 }
.byline { display:flex; flex-wrap:wrap; align-items:baseline; gap:0 .38em; min-width:0; overflow-wrap:anywhere }
.author { color:var(--accent); font-size:.89rem; font-weight:700 }
.recipients,.message time { color:#465668; font-size:.78rem }
.message time { white-space:nowrap; font-variant-numeric:tabular-nums }
.message-body { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.58; color:var(--ink) }
.message pre { padding:12px; background:#f3f6f8; border:1px solid #dce5ea; border-radius:8px; white-space:pre-wrap; margin:8px 0; tab-size:2 }
.citation { font-size:.9em; font-weight:600 }
.partial,.pending { color:var(--muted); font-size:.85rem; margin-top:6px }
#taskForm { padding:12px clamp(12px,2.7vw,32px) 14px; border-top:1px solid #dde5eb; background:white }
#task { min-height:48px; max-height:18vh; resize:vertical; font:inherit; margin:0 0 8px; padding:9px 12px }
.composer-actions { display:flex; align-items:center; justify-content:space-between; gap:12px }
.composer-actions { flex-wrap:wrap }
.file-format { display:flex; align-items:center; gap:6px; font-size:.86rem }
#fileMode { max-width:52vw; min-height:36px; padding:4px 7px; border:1px solid #a6b9c8; border-radius:7px; background:white; color:var(--navy); font:inherit }
.file-download { display:inline-block; max-width:100%; margin-top:8px; padding:7px 10px; border:1px solid var(--edge); border-radius:7px; background:white; color:var(--navy); font-size:.9rem; font-weight:600; overflow-wrap:anywhere }
#researchControl { font-size:.86rem; display:inline-flex; align-items:center; gap:6px; color:var(--navy); cursor:pointer }
#research { accent-color:var(--teal) }
#run { margin-left:auto; min-height:40px; padding:7px 16px }
#run span { margin-left:5px }
#taskStatus { margin:6px 0 0; color:var(--muted); font-size:.86rem }
#taskStatus:empty { display:none }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap }
#createGroup { display:block; width:100%; margin:0 0 9px }
#roomList:not(:empty) { display:grid; gap:2px; padding:0 0 10px; margin-bottom:8px; border-bottom:1px solid var(--line) }
#roomList .member { overflow-wrap:anywhere }
.room-link { display:block; margin:6px 0; font-size:.84rem }
#assistantWorkspace { font-size:.84rem }
#continueRound { margin-top:6px }
#groupDialog { width:min(92vw,420px); max-height:90dvh; overflow:auto; border:1px solid var(--line); border-radius:14px; padding:22px; color:var(--ink) }
#groupDialog::backdrop { background:#142c3f63 }
#groupName { width:100%; padding:9px; margin:4px 0 12px; border:1px solid var(--line); border-radius:7px; font:inherit }
#groupForm fieldset { border:0; margin:0; padding:0 }
#groupForm legend { font-weight:600; margin-bottom:6px }
#groupMembers label { display:flex; gap:9px; align-items:center; min-height:32px; font-weight:400 }
#groupMembers input { accent-color:var(--teal) }
.group-actions { display:flex; justify-content:flex-end; gap:8px }
#groupStatus { font-size:.86rem; color:var(--muted) }
@media (max-width:700px) {
  #modelControl { gap:5px; min-width:0 }
  #teamModel { max-width:49vw }
  .topline { min-height:48px }
  main h1 { font-size:1.65rem; margin:10px 0 }
  #workspace { display:block; height:auto }
  #workspace[data-view="team"] #conversation,#workspace[data-view="chat"] #teamDirectory { display:none }
  #teamDirectory { border:0; padding:14px 8px }
  #workspace[data-view="chat"] #conversation { height:clamp(235px,calc(100dvh - 130px),960px) }
  #backToTeam { display:block }
  .chat-head { padding:10px; gap:8px }
  .identity h2 { font-size:1.02rem }
  .identity p { display:none }
  .scroll-area { padding:14px 12px }
  #taskForm { padding:9px 10px max(9px,env(safe-area-inset-bottom)) }
  .message { max-width:96%; padding:9px 11px 11px }
  .message.user { max-width:90% }
  .message-meta { column-gap:10px }
}
