/* Additive production states; the supplied Site stylesheet remains unchanged. */
/* The composer takes its own space, so growing drafts never cover the last reply. */
.app-shell > .workspace { height: 100%; min-height: 0; overflow: hidden; }
/* One frame follows the visual viewport; the document cannot leave a second scroll area behind the keyboard. */
html:has(#app-shell[data-chat-viewport]:not([hidden])), html:has(#app-shell[data-chat-viewport]:not([hidden])) body { height: 100%; min-height: 0; overflow: clip; }
#app-shell[data-chat-viewport] { position: fixed; top: var(--chat-viewport-top); right: 0; bottom: auto; left: 0; height: var(--chat-viewport-height); min-height: 0; overflow: hidden; }
.conversation { padding-bottom: 24px; scroll-behavior: auto; overflow-anchor: auto; -webkit-overflow-scrolling: touch; }
.composer-zone { position: relative; flex: 0 0 auto; min-width: 0; }
.composer-zone .jump-to-latest { position:absolute; z-index:14; left:50%; bottom:calc(100% + 8px); transform:translateX(-50%); display:grid; place-items:center; width:44px; height:44px; padding:0; border:1px solid var(--line); border-radius:50%; color:var(--ink); background:var(--surface,#fff); box-shadow:var(--shadow-md); font-size:22px; line-height:1; cursor:pointer; }
.composer-zone .jump-to-latest:active { transform:translateX(-50%); }
.composer-zone .jump-to-latest:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.composer { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px 44px; gap: 4px; align-items: center; }
.composer-size-controls { grid-column: 1 / -1; grid-row: 1; justify-self: start; display: flex; align-items: center; gap: 0; width: max-content; max-width: calc(100% - 64px); min-width: 0; color: var(--muted, #667085); font-size: 11px; }
.composer-size-controls > span { min-width: 0; max-width: 62px; margin: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-size-controls button { min-width: 44px; min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; font-size: inherit; }
.composer-size-controls .composer-size-step { display: grid; place-items: center; padding: 0; }
.composer-size-step svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.composer-size-controls button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-dark); }
.composer-size-controls button:disabled { opacity: .35; cursor: default; }
.composer #message-input { grid-column: 1 / -1; grid-row: 2; box-sizing: border-box; width: 100%; min-height: 44px; height: 52px; padding: 12px; font-size: 16px; overflow-y: auto; overscroll-behavior: contain; }
.composer #message-input { border: 0; border-radius: 10px; background: transparent; }
.composer #message-input:focus-visible { outline: none; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(91,92,226,.12), 0 8px 26px rgba(23,32,51,.09); }
.composer #attach-button { grid-column: 1; grid-row: 3; }
.composer #voice-button { grid-column: 3; grid-row: 3; }
.composer #send-button { grid-column: 4; grid-row: 3; justify-self: end; }
.composer[data-composer-size="compact"][data-composer-auto="false"] #message-input { grid-column: 2 / 4; padding: 8px; }
.composer[data-composer-size="compact"][data-composer-auto="false"] #attach-button,
.composer[data-composer-size="compact"][data-composer-auto="false"] #send-button { grid-row: 2; }
.composer[data-composer-size="compact"][data-composer-auto="false"] #voice-button { display: none; }
.composer[data-composer-tight="true"] #message-input { padding: 8px; }
[hidden] { display: none !important; }
.pa-file-drop-target { outline: 2px dashed #635bdb; outline-offset: -8px; background-color: #f6f5ff; }
.attachment-chip span { min-width: 0; overflow-wrap: anywhere; }
.attachment-chip .attachment-thumbnail { width: 64px; height: 48px; flex: 0 0 auto; object-fit: cover; border: 1px solid #dce1e9; border-radius: 7px; background: #f2f4f8; }
.attachment-chip { max-width: calc(100% - 20px); align-items: flex-start; }
.attachment-chip > #attachment-name { display: flex; flex-wrap: wrap; gap: 6px; white-space: normal; overflow: visible; }
.composer-file { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #f8f9fc; }
.composer-file-name { overflow-wrap: anywhere; }
.composer-file small { flex-shrink: 0; color: #667085; }
.attachment-chip button { flex-shrink: 0; min-width: 28px; min-height: 28px; }
.attachment-chip button:disabled { opacity: .45; cursor: default; }
.message-metadata-toggle { border: 0; cursor: pointer; }
.message-metadata-toggle:focus-visible, .message-time-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.message-metadata { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 7px 14px; margin: 12px 0 0; padding: 12px; border: 1px solid #dce1e9; border-radius: 10px; font-size: 12px; line-height: 1.5; background: #f7f8fa; color: #435067; text-align: left; }
.message-metadata dt { font-weight: 600; }
.message-metadata dd { margin: 0; overflow-wrap: anywhere; }
.message-time-toggle { margin-top: 6px; }
.message-actions { opacity: 1; flex-wrap: wrap; gap: 6px; }
.message-actions button { width: auto; min-height: 36px; height: auto; padding: 7px 9px; font-size: 12px; }
.artifact-card { flex-wrap: wrap; gap: 8px; }
.artifact-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.inline-file-preview { flex: 0 0 100%; min-width: 0; max-height: 60dvh; overflow: auto; }
.inline-file-preview img { display: block; max-width: 100%; max-height: 55dvh; object-fit: contain; border-radius: 8px; }
.inline-file-preview .production-preview { margin: 0; padding: 14px; max-height: 55dvh; }
.text-file-preview { min-width: 0; }
.file-preview-tools { display: flex; padding: 8px 14px; border-bottom: 1px solid #dce1e9; }
.file-preview-content { padding: 14px; min-width: 0; }
.file-preview-content > .production-preview { padding: 0; margin: 0; }
.result-file-details { margin: 8px 0; color: var(--muted, #667085); font-size: 13px; }
.result-file-details > summary { cursor: pointer; min-height: 44px; display: list-item; align-content: center; }
.message-files .chat-file-answer, .dated-file-delivery .chat-file-answer { border: 0; background: transparent; box-shadow: none; padding: 0; }
.chat-file-answer > .artifact-icon { display: none; }
.chat-file-answer > .artifact-copy { font-size: 12px; }
.chat-file-answer > .inline-file-preview { order: -1; max-height: 60dvh; }
.chat-file-text { padding: 4px 0; line-height: 1.6; color: var(--ink, #202938); }
.chat-file-plain { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.forward-content { display: grid; gap: 10px; padding: 20px; }
.forward-content label { font-size: 13px; font-weight: 600; }
.forward-content select, .forward-content textarea { width: 100%; min-width: 0; border: 1px solid #dce1e9; border-radius: 8px; padding: 10px; font: inherit; }
.forward-content textarea { min-height: 100px; resize: vertical; }
.forward-dialog .primary-button { margin: 0 20px 20px; }
.file-connections { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #dce1e9; }
.file-connections h3 { flex-basis: 100%; }
@media (max-width: 480px) { .message-metadata { grid-template-columns: 1fr; gap: 2px; } .message-metadata dd { margin-bottom: 7px; } }
.auth-surface { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: #f6f7fa; }
.auth-card { width: min(100%, 420px); padding: 36px; background: white; border: 1px solid #e1e5ec; border-radius: 20px; box-shadow: 0 16px 60px #1720330a; }
.auth-card h1 { font-size: 26px; letter-spacing: -.8px; margin: 16px 0; }
.auth-card p { color: #697589; line-height: 1.5; }
.auth-card label { display: grid; gap: 7px; font-size: 13px; font-weight: 600; margin: 18px 0; }
.auth-card input { width: 100%; border: 1px solid #dce1e9; border-radius: 9px; padding: 12px; font: inherit; font-size: 16px; }
.auth-card .primary-button { width: 100%; justify-content: center; }
#auth-status { min-height: 2.8em; font-size: 13px; }
#auth-status[data-error="true"], #connection-status[data-error="true"] { color: #a22639; }
.message-body .safe-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.production-empty { color: #798496; padding: 32px 12px; line-height: 1.6; }
.production-run { margin: 12px 0 24px; }
.production-run .run-status-row { align-items: flex-start; line-height: 1.5; }
.production-run .run-title { min-width: 0; }
.production-run .run-title strong { overflow-wrap: anywhere; }
.paperclip-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 8px 0; padding: 10px 12px; border: 1px solid #dce1e9; border-radius: 10px; background: #f8f9fc; color: #435067; font-size: 12px; }
.paperclip-summary strong { color: #20293a; }
.paperclip-phase, .paperclip-observed { color: #647187; }
.paperclip-links { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.paperclip-link { color: #5147c7; text-decoration: underline; text-underline-offset: 2px; }
.paperclip-progress { width: 140px; height: 8px; accent-color: #635bdb; }
.production-preview { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 65dvh; overflow: auto; padding: 24px; font: 13px/1.6 ui-monospace, monospace; }
.production-signout { margin-top: 8px; padding: 6px 8px; font-size: 12px; color: #647187; }
button:disabled, input:disabled { cursor: not-allowed; opacity: .48; }
.system-section .capacity-bar { display: none; }
#connection-status { display: block; padding: 12px 16px; font-size: 13px; line-height: 1.5; }
.task-input-shell { padding: 24px; }
.task-question { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.6; }
.task-input-status, .task-input-hint, .task-answer-label { font-size: 14px; line-height: 1.5; }
.task-answer-label { display: block; margin: 16px 0 6px; font-weight: 600; }
.task-answer { box-sizing: border-box; width: 100%; resize: vertical; min-height: 110px; padding: 12px; border: 1px solid #dce1e9; border-radius: 9px; font-family: inherit; font-size: 16px; line-height: 1.5; }
.task-input-hint { color: #647187; }
.markdown-content { min-width: 0; max-width: 100%; overflow-wrap: anywhere; line-height: 1.65; }
.markdown-content > :first-child { margin-top: 0; }
.markdown-content > :last-child { margin-bottom: 0; }
.markdown-content p { margin: .6em 0 1em; }
.markdown-content h1, .markdown-content h2, .markdown-content h3 { margin: 1.25em 0 .5em; line-height: 1.3; }
.markdown-content h1 { font-size: 1.5em; } .markdown-content h2 { font-size: 1.3em; } .markdown-content h3 { font-size: 1.15em; }
.markdown-content ul, .markdown-content ol { padding-inline-start: 1.5em; margin: .7em 0; }
.markdown-content li { margin: .35em 0; }
.markdown-content li > p { margin: .25em 0; }
.markdown-content a { color: #5146c9; text-decoration: underline; text-underline-offset: .18em; }
.markdown-content pre { max-width: 100%; overflow-x: auto; padding: 14px; border-radius: 8px; background: #f2f4f8; white-space: pre; font-size: .85em; }
.markdown-content code { font-family: ui-monospace, monospace; }
.markdown-content :not(pre) > code { background: #f2f4f8; padding: .1em .3em; border-radius: 4px; }
.markdown-content blockquote { margin: 1em 0; padding-left: 1em; border-left: 3px solid #c6c2ef; color: #526074; }
.markdown-table { max-width: 100%; overflow-x: auto; margin: 1em 0; }
.markdown-table table { border-collapse: collapse; min-width: 100%; font-size: .92em; }
.markdown-table th, .markdown-table td { border: 1px solid #dce1e9; padding: .6em .8em; text-align: left; min-width: 6em; }
.markdown-table th { background: #f2f4f8; }
.task-input-dialog .task-input-shell { display: flex; flex-direction: column; padding: 0; max-height: min(84dvh, 760px); overflow: hidden; }
.task-input-shell .dialog-header { flex: 0 0 auto; padding: 16px; gap: 16px; }
.task-input-shell .dialog-header h2 { font-size: 21px; }
.task-input-content { overflow-y: auto; min-height: 0; padding: 0 16px 12px; overscroll-behavior: contain; }
.task-input-shell > .run-card-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid #dce1e9; background: white; }
.task-input-shell > .run-card-actions button { min-height: 44px; }
.task-answer:disabled { background: #f2f4f8; color: #647187; cursor: not-allowed; }
.task-answer:focus-visible { outline: 2px solid #635bdb; outline-offset: 2px; }
.folio-paste-button { border: 0; background: transparent; color: #635bdb; font: inherit; font-size: 13px; font-weight: 650; padding: 7px 0; cursor: pointer; text-align: left; }
.folio-paste-button:focus-visible { outline: 2px solid #635bdb; outline-offset: 3px; }
.folio-collection-dialog { border: 1px solid #dce1e9; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 28px)); max-height: 90vh; box-shadow: 0 22px 80px #14203a40; }
.folio-collection-dialog::backdrop { background: #18223891; }
.folio-collection-inner { padding: 24px; display: grid; gap: 13px; }
.folio-collection-inner h2 { margin: 0; }
.folio-collection-inner p { margin: 0; color: #5e6a7b; }
.folio-collection-inner label { display: grid; gap: 5px; font-weight: 600; }
.folio-collection-inner input { box-sizing: border-box; width: 100%; border: 1px solid #cbd3df; border-radius: 9px; padding: 12px; font: inherit; }
.folio-collection-inner ul { max-height: 170px; overflow: auto; padding-left: 23px; }
.folio-collection-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.folio-collection-actions button { border: 1px solid #cbd3df; border-radius: 9px; padding: 10px 14px; background: white; cursor: pointer; font: inherit; }
.folio-collection-actions button.primary { background: #635bdb; color: white; border-color: #635bdb; }
.folio-collection-actions button:disabled { opacity: .55; cursor: not-allowed; }
.paperclip-question-panel { margin: 10px 0; padding: 12px; border: 1px solid #dce1e9; border-radius: 10px; background: #fbfbfe; }
.paperclip-question-panel > strong { display: block; margin-bottom: 8px; color: #20293a; }
.paperclip-question-form { display: grid; gap: 10px; }
.paperclip-question { min-width: 0; margin: 0; padding: 10px; border: 1px solid #e2e5ed; border-radius: 8px; }
.paperclip-question legend { padding: 0 4px; font-weight: 600; line-height: 1.5; }
.paperclip-question-option { display: flex; align-items: flex-start; gap: 8px; padding: 7px 2px; cursor: pointer; }
.paperclip-question-option input { margin-top: 4px; accent-color: #635bdb; }
.paperclip-question-other { box-sizing: border-box; width: 100%; margin: 4px 0 4px 24px; max-width: calc(100% - 24px); padding: 9px; border: 1px solid #dce1e9; border-radius: 7px; font: inherit; }
.paperclip-question-status { color: #5d687a; font-size: 13px; line-height: 1.5; }
.paperclip-question-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }

.artifact-image-preview { grid-column: 1 / -1; width: 100%; min-width: 0; padding-top: 8px; }
.artifact-image-preview img { display: block; width: auto; height: auto; max-width: 100%; max-height: 420px; object-fit: contain; border-radius: 8px; background: #f2f4f8; }
.artifact-copy { min-width: 0; overflow-wrap: anywhere; }
.run-status-row { flex-wrap: wrap; }
.run-observation { flex-basis: 100%; font-size: 12px; color: #647187; }
@media(max-width: 600px) { .artifact-image-preview img { max-height: 300px; } .artifact-actions { flex-wrap: wrap; } }

.artifact-with-preview { flex-wrap: wrap; }
.message-files, .dated-file-delivery { min-width: 0; max-width: 100%; }
.message-files .artifact-card, .dated-file-delivery .artifact-card, .conversation-files-list .artifact-card { margin: 12px 0; width: 100%; box-sizing: border-box; }
.dated-file-delivery { margin: 20px 0; }
.dated-file-delivery > p { color: #647187; font-size: 12px; }
.conversation-files-dialog { width: min(680px, calc(100vw - 24px)); }
.conversation-files-dialog .share-shell { max-height: 85dvh; display: flex; flex-direction: column; overflow: hidden; }
.conversation-files-list { overflow-y: auto; min-height: 0; padding: 0 16px 16px; }
.conversation-files-dialog button { min-height: 44px; }
.conversation-file-controls { padding: 12px 16px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.conversation-file-controls input, .conversation-file-controls select { min-height: 44px; min-width: 0; box-sizing: border-box; padding: 8px; border: 1px solid #cbd2df; border-radius: 8px; background: white; color: #182039; font: inherit; }
.conversation-file-controls input { flex: 1 1 100%; }
.conversation-file-controls select { flex: 1 1 180px; }
.conversation-file-count { width: 100%; margin: 0 0 8px; font-size: 12px; color: #647187; }
.conversation-files-dialog .file-connections { margin: 0 16px 16px; }
.artifact-with-preview .artifact-image-preview { flex-basis: 100%; }
.task-notes-dialog { width: min(620px, calc(100vw - 24px)); }
.task-notes-shell { max-height: 85dvh; overflow-y: auto; }
.task-notes-shell > p, .task-notes-shell > label, .task-notes-history, .task-notes-actions { margin: 16px; }
.task-notes-shell > label { display: block; }
.task-notes-shell textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 8px; padding: 12px; }
.task-note-entry { padding: 12px 0; border-bottom: 1px solid #dfe3eb; overflow-wrap: anywhere; }
.task-note-entry .safe-text { white-space: pre-wrap; }
.task-note-state { font-weight: 600; }
.task-notes-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.task-notes-actions button { min-height: 44px; }

@media(max-width: 600px) { .artifact-card { margin-left: 0; box-sizing: border-box; max-width: 100%; } }

/* Native details keeps secondary navigation available to touch and keyboard. */
#header-more { position: relative; flex: 0 0 auto; }
#header-more > summary { display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); cursor: pointer; list-style: none; }
#header-more > summary::-webkit-details-marker { display: none; }
#header-more > summary svg { width: 20px; height: 20px; }
#header-more > .header-more-menu { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; display: grid; gap: 4px; width: max-content; min-width: 180px; max-width: calc(100vw - 24px); padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-md); }
#header-more .header-more-menu > :is(button, a) { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; min-height: 44px; height: auto; padding: 8px 10px; border: 0; box-shadow: none; color: var(--ink); font: inherit; font-size: 14px; text-decoration: none; white-space: normal; }
#header-more .header-more-menu .share-button span { display: inline; }
#header-more .header-more-menu .mobile-system { display: flex; }
.header-full-title { margin: 0; padding: 8px 10px; max-width: 260px; overflow-wrap: anywhere; color: var(--muted); font-size: 14px; }
#header-more > summary:focus-visible, .run-card-actions summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.message-actions { align-items: center; }
.message-action-menu { position: relative; }
.message-action-menu > summary, .run-details > summary { display: flex; align-items: center; min-height: 36px; padding: 7px 9px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; }
.message-action-menu > summary::-webkit-details-marker, .run-details > summary::-webkit-details-marker { display: none; }
.message-action-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.message-action-menu[open] { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.run-details { flex: 1 1 100%; min-width: 0; }
.run-secondary-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.run-provenance { display: block; overflow-wrap: anywhere; color: var(--muted); }

/* Activity stays visible after a short acknowledgement instead of looping. */
.activity-bars i, .pulse-dot { animation-iteration-count: 2; }
.milestone-track > span { animation: none; left: 0; width: 100%; opacity: .35; }
button, #header-more > summary { transition: background-color 120ms ease, transform 120ms ease; }
button:not(:disabled):active, #header-more > summary:active { transform: scale(.98); }
@media (prefers-reduced-motion: no-preference) {
  #header-more[open] > .header-more-menu { animation: pa-details-in 180ms ease-out both; }
}
@keyframes pa-details-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* One compact mobile header; auto height allows text zoom to reflow. */
@media (max-width: 620px) {
  body { font-size: 16px; }
  .topbar { flex: 0 0 auto; flex-wrap: wrap; gap: 4px; min-height: 64px; padding: max(10px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 10px max(8px, env(safe-area-inset-left)); background: var(--surface); }
  .topbar-left { flex: 1 1 100px; overflow: visible; }
  .topbar-right { flex: 0 0 auto; width: auto; gap: 4px; justify-content: flex-end; }
  .conversation-heading { flex: 1; overflow: visible; }
  .conversation-heading h1 { max-width: 100%; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .icon-button, .topbar .jobs-button, .topbar .share-button { min-width: 44px; width: 44px; height: auto; min-height: 44px; padding: 0; justify-content: center; }
  .menu-button { margin-right: 4px; }
  .jobs-button > span:not(.jobs-count), .topbar-right > .share-button > span { display: none; }
  #header-more .header-more-menu > :is(button, a) { width: 100%; padding: 8px 10px; justify-content: flex-start; }
  .workspace { min-width: 0; }
  .conversation { padding: 18px max(12px, env(safe-area-inset-right)) 24px max(12px, env(safe-area-inset-left)); overscroll-behavior-y: contain; }
  .composer-zone { position: static; flex: 0 0 auto; min-width: 0; padding: 10px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .composer { min-width: 0; min-height: 58px; }
  .composer-tool, .send-button { width: 44px; height: 44px; }
  .composer textarea, input, select, textarea { font-size: 16px; }
  .composer textarea { max-height: min(180px, 30dvh); }
  .message-body { min-width: 0; font-size: 16px; overflow-wrap: anywhere; }
  .user-message { padding-left: 20px; }
  .run-card { margin-left: 0; max-width: 100%; }
  .run-card-top { flex-wrap: wrap; }
  .run-title { flex: 1 1 120px; min-width: 0; }
  .run-title strong, .run-title span { white-space: normal; overflow-wrap: anywhere; }
  .state-pill { max-width: 100%; white-space: normal; }
  .artifact-copy { min-width: 0; flex: 1 1 100px; overflow-wrap: anywhere; }
  .artifact-actions { flex-basis: 100%; margin-left: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .artifact-actions button { min-width: 44px; width: 100%; min-height: 44px; height: auto; white-space: normal; overflow-wrap: normal; }
  .message-actions button, .message-action-menu > summary, .run-card-actions button, .run-card-actions summary, .paperclip-question-actions button, .attachment-chip button, .folio-paste-button, .drawer-job-actions button, .icon-button { min-width: 44px; min-height: 44px; height: auto; }
  .run-card-actions button { white-space: normal; overflow-wrap: anywhere; }
  .paperclip-question-option { min-height: 44px; }
  .message-metadata, .paperclip-summary, .paperclip-question-panel { max-width: 100%; }
  .auth-surface { padding: 16px; }
  .auth-card { padding: 24px; }
  .jobs-drawer { padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
}
@media (prefers-reduced-motion: reduce) {
  .activity-bars i, .pulse-dot, .milestone-track > span { animation: none; }
  button:active, #header-more > summary:active { transform: none; }
}

/* Completed task controls belong beside their same-chat result. */
.message-stack > .production-run { margin-top: 12px; max-width: 100%; }
.task-identity { color: var(--muted); font-weight: 600; }
.empty-chat-prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.empty-chat-prompts button { min-height: 44px; text-align: left; }

.conversation-overview-dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); }
.conversation-overview-shell { min-width: 0; overflow: auto; }
.conversation-overview-controls { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.conversation-overview-controls label { flex: 1 1 160px; min-width: 0; }
.conversation-overview-dialog input, .conversation-overview-dialog select, .conversation-overview-dialog button { min-height: 44px; font-size: 16px; max-width: 100%; }
.conversation-overview-dialog input, .conversation-overview-dialog select { width: 100%; box-sizing: border-box; }
.conversation-overview-list { max-height: 55dvh; overflow: auto; overscroll-behavior: contain; }
.conversation-overview-row { border: 1px solid var(--line); border-inline-start: 3px solid var(--group-accent, var(--line)); border-radius: 12px; padding: 12px; margin-bottom: 10px; overflow-wrap: anywhere; }
.conversation-overview-row p { color: var(--muted); margin: 6px 0; }
.conversation-overview-row button { margin: 4px 8px 4px 0; }
.conversation-accent-slate { --group-accent: #718096; }
.conversation-accent-indigo { --group-accent: #7865d8; }
.conversation-accent-green { --group-accent: #438d72; }
.conversation-accent-amber { --group-accent: #b38635; }
.conversation-accent-rose { --group-accent: #ac667c; }
@media (max-width: 620px) { .conversation-overview-dialog { width: calc(100vw - 16px); padding: 12px; } .conversation-overview-controls label { flex-basis: 100%; } }

/* Overview controls share the existing calm, touch-sized action language. */
.conversation-overview-dialog button { border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); color: var(--ink); padding: 10px 14px; font-weight: 600; cursor: pointer; }
.conversation-overview-dialog button:hover:not(:disabled) { background: var(--hover, #f5f4fb); }
.conversation-overview-dialog button:disabled { cursor: default; opacity: .5; }
.conversation-overview-dialog input, .conversation-overview-dialog select { border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); color: var(--ink); padding: 10px 12px; }
.conversation-overview-row small { display: block; color: var(--muted); margin: 4px 0; font-size: 14px; }
.conversation-overview-row h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.45; }
.conversation-overview-controls label { display: flex; flex-direction: column; gap: 6px; }

/* Readable names and one clear row action; accents remain decorative. */
.conversation-overview-dialog .overview-open { background: var(--accent); color: #fff; border-color: var(--accent); }
.conversation-overview-dialog .overview-open:hover:not(:disabled) { background: var(--accent-dark); }
.conversation-overview-dialog :is(button,input,select):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.conversation-overview-row :is(h3,p,small,details) { overflow-wrap: anywhere; min-width: 0; }
.conversation-overview-dialog .dialog-header { flex-wrap: wrap; gap: 8px; }
.conversation-overview-editor { max-width: calc(100vw - 24px); }
.conversation-overview-editor input, .conversation-overview-editor select { max-width: 100%; min-height: 44px; font-size: 16px; }
@media (prefers-reduced-motion: no-preference) {
 .conversation-overview-dialog[open] { animation: pa-details-in 160ms ease-out both; }
}

/* Everyday navigation: compact controls above a directly selectable list. */
.sidebar-search-wrap { display:flex; flex:1; min-height:0; flex-direction:column; overflow:hidden; }
.sidebar-conversation-controls { display:grid; grid-template-columns:minmax(0, 1.2fr) minmax(0, 1fr); gap:8px; padding:4px 12px; }
.sidebar-conversation-controls label { display:grid; gap:3px; min-width:0; color:#cbd5e1; font-size:12px; }
.sidebar-conversation-controls label:first-child { grid-column:1/-1; }
.sidebar-conversation-controls input, .sidebar-conversation-controls select { width:100%; min-width:0; min-height:44px; padding:8px; border:1px solid #526078; border-radius:8px; color:#edf2f7; background:#212c43; font-size:16px; }
.sidebar-conversation-controls input::placeholder { color:#bac3d0; }
.sidebar-conversation-controls button { grid-column:1/-1; justify-self:end; min-height:44px; padding:5px 10px; border:0; border-radius:8px; color:#cbd5e1; background:transparent; cursor:pointer; }
.sidebar-conversation-controls button:hover { color:white; background:#212c43; }
.sidebar-conversation-status { margin:0 14px 5px; color:#bac3d0; font-size:12px; }
.sidebar-conversation-list { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:0 8px 12px; scrollbar-width:thin; scrollbar-color:#526078 transparent; }
.sidebar-conversation-row { margin:3px 0 7px; border-radius:9px; }
.sidebar-conversation-row:has([aria-current="page"]) { background:#212c43; }
.sidebar-conversation-title { display:block; width:100%; min-height:44px; padding:8px; border:0; border-radius:8px; text-align:left; font-size:14px; line-height:1.4; color:#edf2f7; background:transparent; cursor:pointer; overflow-wrap:anywhere; }
.sidebar-conversation-title:hover { background:#212c43; }
.sidebar-conversation-metadata { display:block; padding:0 8px 7px; font-size:11px; color:#bac3d0; overflow-wrap:anywhere; }
.sidebar .sidebar-action { margin:0; width:100%; min-height:44px; }
.sidebar select:focus-visible { outline-color:#c4c5ff; }
.auth-surface { height:100dvh; overflow-y:auto; }
@media (max-width:900px) {
  .sidebar { width:min(320px, calc(100vw - 32px)); padding-top:env(safe-area-inset-top); padding-bottom:env(safe-area-inset-bottom); }
  .sidebar-close { width:44px; height:44px; }
}
@media (prefers-reduced-motion:reduce) { .sidebar { transition:none; } }

/* Mobile density: navigation earns its space; controls expand only on request. */
.sidebar-conversation-controls { display:block; padding:0 12px; }
.sidebar-conversation-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:4px; }
.sidebar-conversation-toolbar button { min-height:44px; padding:6px 8px; font-size:13px; white-space:nowrap; }
.sidebar-conversation-toolbar .sidebar-conversation-refresh { margin-left:auto; font-size:21px; min-width:44px; }
.sidebar-conversation-toolbar .sidebar-conversation-reset { padding:6px; }
.sidebar-conversation-toggle[data-active="true"] { background:#303654; color:#fff; }
.sidebar-conversation-search-panel { padding:4px 0 8px; }
.sidebar-conversation-filter-panel { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); gap:6px; padding:4px 0 8px; }
.sidebar-conversation-title { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; padding:6px 8px; min-height:44px; line-height:1.35; }
.sidebar-conversation-metadata { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding-bottom:3px; }
.sidebar-conversation-row { margin:1px 0 4px; }
.sidebar-conversation-status { font-size:11px; margin:2px 14px 4px; }

/* One recognizable category marker; readable titles remain the primary signal. */
.conversation-label, .sidebar-conversation-title { display:flex; align-items:center; gap:9px; min-width:0; }
.conversation-label-icon { display:inline-flex; align-items:center; justify-content:center; flex:0 0 32px; height:32px; font-size:24px; line-height:1; border-radius:9px; background:color-mix(in srgb, var(--group-accent,#718096) 13%, transparent); }
.conversation-label-text { display:block; min-width:0; overflow:hidden; overflow-wrap:anywhere; }
.sidebar-conversation-row { border-inline-start:3px solid var(--group-accent,#718096); }
.sidebar-conversation-title { padding:6px 7px; -webkit-line-clamp:unset; -webkit-box-orient:unset; }
.sidebar-conversation-title .conversation-label-text { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.sidebar-conversation-metadata { padding-inline-start:48px; }
#conversation-title.conversation-label { max-width:100%; }
#conversation-title .conversation-label-icon { flex-basis:28px; height:28px; font-size:23px; }
#conversation-title .conversation-label-text { white-space:nowrap; text-overflow:ellipsis; }
.conversation-overview-row .conversation-label-icon { flex-basis:36px; height:36px; font-size:26px; }
.sidebar-footer { padding:7px 12px max(7px,env(safe-area-inset-bottom)); }
.profile-settings-button { width:100%; min-height:48px; display:flex; align-items:center; gap:9px; padding:6px 8px; border:0; border-radius:9px; background:transparent; color:#edf2f7; text-align:left; cursor:pointer; }
.profile-settings-button:hover { background:#212c43; }
#profile-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.profile-settings-icon { font-size:20px; flex-shrink:0; }
.profile-settings-label { margin-left:auto; color:#bac3d0; font-size:12px; }
.pa-settings-page { flex:1; min-height:0; overflow:auto; background:var(--surface,#fff); }
.pa-settings-header { position:sticky; top:0; z-index:2; display:flex; flex-wrap:wrap; align-items:center; gap:8px 20px; padding:12px max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left)); background:var(--surface,#fff); border-bottom:1px solid var(--line); }
.pa-settings-header h1 { margin:0; font-size:21px; }
.pa-settings-header button { min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:9px; color:var(--ink); cursor:pointer; }
.pa-settings-body { width:min(100%,760px); margin:0 auto; padding:16px; }
.pa-settings-body > :is(button,.account-row) { margin:0 0 10px; }
.pa-settings-body > button { display:flex; align-items:center; gap:8px; width:100%; min-height:48px; padding:12px; border:1px solid var(--line); border-radius:9px; background:var(--surface,#fff); color:var(--ink); text-align:left; cursor:pointer; }
.pa-settings-body .account-row { color:var(--ink); border:0; }
.pa-settings-body .account-copy small { color:var(--muted); }
.pa-settings-body .system-link-copy strong { color:var(--ink); }
.pa-settings-body .system-link-copy small { color:var(--muted); }
.pa-settings-body .online-dot { display:none; }
.conversation-settings-view { min-width:0; }
.conversation-settings-view .conversation-overview-shell { padding:0; }
.conversation-settings-view .conversation-overview-list { max-height:none; overflow:visible; }
.conversation-settings-view .dialog-header { display:none; }
.conversation-settings-view button { min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:9px; background:var(--surface,#fff); color:var(--ink); cursor:pointer; }
.conversation-settings-view input,.conversation-settings-view select { min-height:44px; width:100%; padding:8px; border:1px solid var(--line); border-radius:9px; font-size:16px; }
.conversation-settings-view .conversation-overview-controls { margin-top:0; }
.conversation-settings-view .settings-filter-disclosure > summary { min-height:44px; cursor:pointer; display:flex; align-items:center; font-weight:600; }
.conversation-settings-view .conversation-overview-row { margin-bottom:12px; }
.conversation-settings-view .conversation-overview-row .overview-open { background:var(--accent); color:white; }
.conversation-settings-editor { border:1px solid var(--line); border-radius:12px; padding:16px; margin-bottom:16px; }
.conversation-settings-editor label { display:grid; gap:6px; font-weight:600; }
.conversation-settings-editor button { margin:8px 8px 0 0; }
.conversation-settings-editor h2 { margin:0 0 12px; font-size:19px; }
.message-actions { margin-top:1px; gap:2px; align-items:center; }
.message-time-toggle { margin-top:0; }
.message-action-menu > summary, .message-actions > button { height:36px; min-height:36px; padding:6px 8px; line-height:20px; font-size:12px; }
.message-action-menu[open] { border:0; background:transparent; }
.message-action-options { position:absolute; z-index:18; left:0; top:100%; display:grid; min-width:180px; max-width:calc(100vw - 30px); padding:5px; border:1px solid var(--line); border-radius:10px; background:var(--surface,#fff); box-shadow:var(--shadow-md); }
.message-action-options button { display:block; text-align:left; min-height:44px; padding:8px 10px; }
.message-timestamp { display:block; margin:0; padding:4px 8px; border:0; background:transparent; font-size:12px; }
.message-timestamp dt { display:none; }
.message-timestamp dd { margin:0; }
.message-details-dialog { width:min(560px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow:auto; padding:16px; }
.message-details-dialog h2 { margin:0 0 12px; }
.message-details-close { min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:8px; cursor:pointer; }
.message-details-fields { margin-top:8px; }
.attachment-options { position:absolute; z-index:30; left:16px; bottom:calc(100% - 8px); min-width:200px; padding:6px; border:1px solid var(--line); border-radius:12px; background:var(--surface,#fff); box-shadow:var(--shadow-md); }
.attachment-options button { display:block; width:100%; min-height:44px; padding:8px 12px; border:0; border-radius:8px; background:transparent; color:var(--ink); text-align:left; cursor:pointer; }
.attachment-options button:hover { background:#f3f4f8; }
@media (max-width:620px) {
  .sidebar-brand { margin-bottom:8px; min-height:44px; }
  .new-chat-button { min-height:44px; margin:0 12px 4px; padding:8px 12px; }
  .new-chat-button kbd { display:none; }
  .topbar { min-height:56px; padding-top:max(6px,env(safe-area-inset-top)); padding-bottom:6px; flex-wrap:nowrap; }
  .topbar-left { flex:1 1 auto; }
  .conversation-heading h1 { display:flex; align-items:center; white-space:normal; line-height:1.25; max-height:none; overflow:visible; }
  #conversation-title .conversation-label-text { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; white-space:normal; max-height:2.5em; }
  .topbar-right { gap:2px; }
  .topbar :is(.jobs-button,#header-more > summary) { border-color:transparent; box-shadow:none; background:transparent; }
  .conversation { padding-top:8px; padding-bottom:12px; }
  #connection-status[data-error="false"] { border:0; background:transparent; margin:0 0 8px; padding:0 2px; font-size:11px; }
  .message { margin-bottom:12px; }
  .user-message { padding-left:12px; }
  .user-message-content { min-width:0; max-width:100%; }
  .user-message .message-body { padding:9px 12px; line-height:1.5; }
  .message-action-menu > summary,.message-actions > button { min-height:44px; height:44px; padding:4px 8px; }
  .composer-zone { position:relative; padding-top:2px; padding-bottom:max(2px,env(safe-area-inset-bottom)); }
  .composer { min-height:52px; padding:4px; row-gap:2px; }
  .composer-hint { display:none; }
  .pa-settings-body { padding:12px; }
}

.task-confirmation-panel{display:grid;gap:.5rem;margin-block:.75rem;padding:.75rem;border:1px solid var(--border-color,#a4a1dc);border-radius:12px;min-width:0}
.task-confirmation-panel h3,.task-confirmation-panel p{margin:0;overflow-wrap:anywhere}
.task-proposal-objective{max-height:10rem;overflow:auto;white-space:pre-wrap}
.task-proposal-hint{font-size:.875rem;line-height:1.4;opacity:.85}
.task-confirmation-actions{display:flex;flex-wrap:wrap;gap:.5rem}
.task-confirmation-actions button{min-height:44px;white-space:normal}
.keyboard-diagnostics { max-width: min(560px, calc(100vw - 24px)); }
.keyboard-diagnostics .share-shell { max-height: 85dvh; overflow: auto; }
.keyboard-diagnostic-actions { display: flex; flex-wrap: wrap; gap: 8px; }
