/* A single quiet toolbar, with the rest of the viewport reserved for the chat. */
body:is([data-route-mode="project"], [data-route-mode="task"]) .workspace > .topbar { display: none; }
.project-page { height: 100%; }
body[data-route-mode="legacy-chat"] .topbar { height: 48px; padding: 0 24px; border-bottom: 0; background: var(--paper); box-shadow: none; }
body[data-route-mode="legacy-chat"] #globalUpload { display: none; }
body[data-route-mode="legacy-chat"] .breadcrumbs { font-size: 14px; }
body[data-route-mode="legacy-chat"] .breadcrumbs strong { font-weight: 500; }
body[data-route-mode="legacy-chat"] .context-button { min-height: 36px; height: 36px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font-size: 13px; }
body[data-route-mode="legacy-chat"] .context-spark,
body[data-route-mode="legacy-chat"] #contextCount { display: none; }
.chat-accessible-heading,
.scoped-messages .message-meta { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.scope-chat-head { min-height: 64px; height: 64px; padding: 0 28px; gap: 16px; border-bottom: 1px solid var(--line); background: var(--paper); }
.scope-heading-copy h1 { font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1.4; }
.scope-head-actions .secondary-button,
.scope-head-actions .text-button { min-height: 36px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.scope-head-actions .secondary-button:hover,
.scope-head-actions .text-button:hover { background: var(--surface-soft); color: var(--ink); }
.mobile-scope-actions .chat-context-action { display: none; }
.project-nav-head { padding: 20px 16px 20px 20px; align-items: flex-start; }
.project-nav-head h1 { white-space: normal; overflow-wrap: anywhere; }
.project-nav-head .project-direction { margin-bottom: 8px; }
.scope-nav-list { padding: 16px 16px 24px; }
.scope-section-head { min-height: 36px; padding: 0 10px; }
.project-chats-heading { margin-top: 24px; padding-top: 20px; padding-bottom: 10px; }
.project-chat-list { gap: 4px; }
.project-chat-item { min-height: 48px; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 10px; border-radius: 8px; }
.project-chat-item.active { color: #17483d; background: #dce8e1; }
.project-chat-item .scope-nav-copy strong { white-space: normal; overflow-wrap: anywhere; }
.project-chat-item .scope-nav-mark.main { width: 22px; height: 22px; font-size: 20px; color: #57786a; }
.project-chat-item.active .scope-nav-mark.main { color: #326650; }
.scope-nav-list .add-task-card { min-height: 44px; padding: 9px 10px; gap: 10px; background: transparent; }
.scope-nav-list .add-task-card span { flex: 0 0 22px; text-align: center; color: #61786d; }
.scope-nav-list .add-task-card strong { min-width: 0; }
.scope-nav-list .no-tasks { min-height: 40px; padding: 0 10px; }
.scoped-messages { padding: 24px max(28px, calc((100% - 960px) / 2)) 16px; scrollbar-gutter: stable both-edges; overscroll-behavior: contain; }
.scoped-messages .message { position: relative; display: block; margin: 0 0 28px; }
.scoped-messages .message-avatar { display: none; }
.scoped-messages .message.user { display: flex; justify-content: flex-end; margin-left: 0; }
.scoped-messages .message.user > div:not(.message-avatar) { min-width: 0; max-width: 85%; }
.scoped-messages .message.user .message-body { padding: 12px 18px; border-radius: 20px; background: #eaece7; }
.scoped-messages .message-body { overflow-wrap: anywhere; }
.scoped-messages .message-body pre { max-width: 100%; overflow-x: auto; }
.scoped-messages .message-actions:empty { display: none; }
.scoped-messages .chat-empty { min-height: 100%; padding: 24px 0; }
.scoped-messages .chat-empty > span { display: none; }
.scoped-messages .chat-empty > strong { color: var(--ink); font-size: 28px; font-weight: 500; letter-spacing: -.02em; }
.scoped-messages .chat-empty > p { margin-top: 10px; color: var(--muted); }
.scoped-composer-wrap { padding: 8px max(28px, calc((100% - 960px) / 2)) 18px; border-top: 0; background: var(--paper); }
.scoped-composer { grid-template-columns: 40px minmax(0, 1fr) 40px 40px; gap: 4px 8px; padding: 12px; border-color: #d9ddd6; border-radius: 24px; box-shadow: 0 3px 16px rgba(26, 40, 35, .05); }
.scoped-composer .composer-main { display: contents; }
.scoped-composer .composer-main textarea { grid-column: 1 / -1; grid-row: 1; min-height: 48px; max-height: min(170px, 30dvh); padding: 6px 8px 12px; background: transparent; }
.scoped-composer .attach-button { grid-column: 1; grid-row: 2; }
.scoped-composer .chat-model-picker { grid-column: 2; grid-row: 2; justify-self: start; align-self: center; min-height: 36px; margin: 0; padding: 0 4px; background: transparent; }
.scoped-composer .chat-model-picker > span { display: none; }
.scoped-composer .chat-model-picker select { font-weight: 500; color: var(--muted); }
.scoped-composer .voice-button { grid-column: 3; grid-row: 2; }
.scoped-composer .send-button { grid-column: 4; grid-row: 2; }
.scoped-composer :is(.attach-button, .voice-button, .send-button) { width: 40px; height: 40px; border-radius: 50%; }
.scoped-composer .attach-button,
.scoped-composer .voice-button:not(.recording):not(.transcribing) { border: 0; background: transparent; }
.scoped-composer .attach-button:hover,
.scoped-composer .voice-button:not(.recording):not(.transcribing):hover { background: var(--surface-soft); }

@media (max-width: 900px) {
  body[data-route-mode="legacy-chat"] .workspace { padding-bottom: 0; }
  body[data-route-mode="legacy-chat"] .mobile-bottom-nav { display: none; }
  body[data-route-mode="legacy-chat"] .topbar { height: calc(52px + env(safe-area-inset-top)); min-height: calc(52px + env(safe-area-inset-top)); grid-template-columns: 44px minmax(0, 1fr) auto; padding: env(safe-area-inset-top) 8px 0; color: var(--ink); }
  body[data-route-mode="legacy-chat"] .mobile-topbar-leading .icon-button { color: var(--ink); }
  body[data-route-mode="legacy-chat"] .mobile-route-title { color: var(--ink); font-size: 14px; font-weight: 500; }
  body[data-route-mode="legacy-chat"] .topbar #openContext { display: inline-flex !important; width: auto; min-height: 44px; padding: 0 6px; }
  body[data-route-mode="legacy-chat"] .context-button > span:nth-child(2) { display: inline; }
  .scope-chat-head { min-height: calc(52px + env(safe-area-inset-top)); height: calc(52px + env(safe-area-inset-top)); grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 4px; padding: env(safe-area-inset-top) 6px 0; }
  .scope-heading-copy h1 { font-size: 14px; }
  .project-nav-head { padding: calc(16px + env(safe-area-inset-top)) 12px 16px 16px; background: #f5f7f4; }
  .project-nav-head .mobile-scope-close,
  .project-nav-head .project-action-menu > summary { color: var(--ink); }
  .project-nav-head .project-action-menu > summary:hover,
  .project-nav-head .project-action-menu[open] > summary { color: var(--ink); background: var(--surface-soft); }
  .scope-nav-list { padding: 12px 12px 24px; }
  .project-chat-item { min-height: 48px; }
  .scoped-messages { padding: 18px 16px 12px; scrollbar-gutter: auto; }
  .scoped-messages .message.user > div:not(.message-avatar) { max-width: 90%; }
  .scoped-messages .chat-empty > strong { font-size: 24px; }
  .scoped-composer-wrap { padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); }
  .scoped-composer { grid-template-columns: 44px minmax(0, 1fr) 44px 44px; gap: 4px; padding: 10px; border-radius: 22px; }
  .scoped-composer :is(.attach-button, .voice-button, .send-button) { width: 44px; height: 44px; }
  .scoped-composer .composer-main textarea { min-height: 44px; max-height: min(144px, 30dvh); }
}
/* Saved changes share the answer width and remain readable on narrow screens. */
.message-workspace-changes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.message-workspace-changes a { display: inline-block; max-width: 100%; padding: 5px 9px; border: 1px solid #d8e5df; border-radius: 8px; background: #f0f6f2; color: #315a4d; font-size: 12px; line-height: 1.5; text-decoration: none; overflow-wrap: anywhere; }
.message-workspace-changes a:hover { background: #e5efe9; }
.message-workspace-changes a:focus-visible { outline: 2px solid #315a4d; outline-offset: 2px; }
