/* M1: mobile presentation of the existing Pilot components. */
.app-shell #voiceCancelButton[hidden] { display: none; }
.app-shell .aida-rename-button { display: none; }
.app-shell .aida-row-actions { display: contents; }
.app-shell .aida-tree-row:has(> .aida-tree-item-editor) { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 767px), (max-height: 500px) and (pointer: coarse) and (max-width: 1024px) {
  html, body { background: #14171a; overscroll-behavior-y: none; }
  body.mobile-workspace-active { overflow: hidden; }
  .app-shell {
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    --mobile-nav-height: var(--mobile-nav-live-height, calc(64px + var(--mobile-safe-bottom)));
    --mobile-header-height: var(--mobile-header-live-height, calc(56px + env(safe-area-inset-top, 0px)));
    --mobile-composer-bottom: calc(var(--mobile-nav-height) + 8px);
    --workspace-content-width: calc(100% - 24px);
    --workspace-content-axis-x: 50%;
    --workspace-content-area-width: 100%;
    --prompt-max-height: min(9rem, calc(var(--mobile-viewport-height, 100dvh) * .3));
    position: fixed; inset: var(--mobile-viewport-top, 0px) 0 auto;
    width: 100%; height: var(--mobile-viewport-height, 100dvh); min-height: 0;
    grid-template-columns: minmax(0, 1fr); overflow: clip;
  }
  .app-shell .workspace, .app-shell.agents-catalogue-active .workspace {
    height: 100%; min-height: 0; width: 100%; border: 0; border-radius: 0;
    grid-template-rows: var(--mobile-header-height) minmax(0, 1fr);
  }
  .app-shell .workspace > .workspace-header {
    height: auto; min-height: calc(56px + env(safe-area-inset-top, 0px)); justify-content: flex-start;
    padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px));
    background: rgb(35 39 41 / .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); gap: 8px; z-index: 8;
  }
  .app-shell .workspace-title { display: block; min-width: 0; flex: 1; }
  .app-shell .workspace-title h1 { font-size: 1rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-shell .workspace-title p { display: block; margin-top: 1px; font-size: 0.75rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-shell #mobileMenuButton { display: grid; width: 44px; height: 44px; flex: 0 0 44px; padding: 11px; border: 0; background: transparent; color: var(--workspace-text); }
  .app-shell #mobileMenuButton svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; }
  .app-shell .workspace-sidebar-toggle { display: none !important; }
  .app-shell .workflow-switcher {
    position: fixed; top: calc(var(--mobile-viewport-top, 0px) + var(--mobile-viewport-height, 100dvh) - var(--mobile-nav-height)); bottom: auto; left: 0; right: 0;
    width: 100%; height: auto; transform: none;
    padding: 4px max(6px, env(safe-area-inset-right, 0px)) var(--mobile-safe-bottom) max(6px, env(safe-area-inset-left, 0px));
    border-radius: 0; border-width: 1px 0 0; background: rgb(35 39 41 / .7);
    box-shadow: inset 0 1px rgb(231 237 239 / .04); z-index: 10;
  }
  .app-shell .workflow-switcher-tabs { display: flex; width: 100%; height: auto; min-height: 59px; }
  .app-shell .workflow-switcher-tab {
    flex: 1 1 0; flex-direction: column; justify-content: center;
    gap: 3px; height: auto; min-height: 56px; min-width: 0; padding: 4px 2px; font-size: 0.75rem;
    line-height: 1.2; border-radius: 12px; border: 1px solid transparent;
  }
  .app-shell .workflow-switcher-tab span { min-width: 0; white-space: normal; overflow-wrap: anywhere; text-align: center; }
  .app-shell .workflow-switcher-tab svg { width: 22px; height: 22px; flex: 0 0 22px; }
  .app-shell .workflow-switcher-tab[aria-selected="true"] {
    border-color: color-mix(in srgb, var(--tab-accent) 26%, transparent);
    background: color-mix(in srgb, var(--tab-accent) 6%, transparent); color: var(--workspace-text);
  }
  .app-shell .workflow-switcher-indicator { display: none; }
  /* Current Timings hides the desktop switcher. Keep the compact navigation
     outside its scrolling content, except while the keyboard owns that space. */
  body.timings-open .app-shell:not(.mobile-keyboard-open) #workflowSwitcher { display: flex !important; }
  /* These existing agent surfaces scroll the workspace itself. Reserve the
     same viewport navigation without changing their internal layouts. */
  body.calendar-open .app-shell .workspace,
  body.timings-open .app-shell .workspace,
  .app-shell.agent-workspace-active .workspace {
    padding-bottom: calc(var(--mobile-nav-height) + 24px);
    scroll-padding-bottom: calc(var(--mobile-nav-height) + 24px);
  }
  /* Portfolio supplies its own toolbar. Remove the old desktop switcher gap
     and reserve the same visible viewport and navigation as the other tools. */
  body.portfolio-open .app-shell .workspace {
    height: 100%;
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 0 calc(var(--mobile-nav-height) + 12px);
  }
  .app-shell .composer-wrap {
    bottom: var(--mobile-composer-bottom); left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
    width: calc(100% - max(12px, env(safe-area-inset-left, 0px)) - max(12px, env(safe-area-inset-right, 0px)));
    height: auto; min-height: 0; transform: none; transition: none;
  }
  .app-shell .composer { position: relative; min-height: 0; border-radius: 23px; padding: 5px; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .app-shell .prompt-box { min-height: 0; padding: 10px 6px 0; border-radius: 18px; }
  .app-shell textarea, .app-shell input, .app-shell select, .app-shell [contenteditable="true"] { font-size: 1rem; }
  .app-shell #promptInput { min-height: 1.75rem; line-height: 1.5; padding: 0 6px; max-height: var(--prompt-max-height); }
  .app-shell .prompt-action-row { display: flex; flex-wrap: wrap; gap: 0; padding-top: 4px; }
  .app-shell .composer-main-actions { display: flex; flex: 1 1 calc(100% - 96px); flex-wrap: wrap; gap: 0; }
  .app-shell .composer-icon-button, .app-shell .composer-icon-button.compact, .app-shell .prompt-attach-button,
  .app-shell .send-button { width: 44px; height: 44px; min-height: 44px; border-radius: 12px; }
  .app-shell .composer-icon-button svg { width: 22px; height: 22px; transform: none; }
  .app-shell .send-button { width: 48px; height: 48px; min-height: 48px; border: 0; background: transparent; box-shadow: none; isolation: isolate; overflow: visible; }
  .app-shell .send-button::before { content: ""; position: absolute; inset: 6px; border-radius: 12px; z-index: -1; border: 1px solid var(--settings-accent-border); background: linear-gradient(180deg, var(--settings-accent), var(--workspace-accent-strong)); box-shadow: inset 0 1px rgb(255 255 255 / .2), 0 6px 18px var(--settings-accent-glow); }
  .app-shell .send-button:disabled::before { background: rgb(255 255 255 / .06); border-color: transparent; box-shadow: none; }
  .app-shell .openwebui-cancel-button::before { background: linear-gradient(180deg, #c76464, #8f3f48); border-color: rgb(239 139 139 / .52); }
  .app-shell .send-button:not(:disabled):hover { transform: none; box-shadow: none; }
  .app-shell .voice-mic-button, .app-shell .voice-stop-button { background: transparent; border: 0; }
  .app-shell .voice-mic-button::before, .app-shell .voice-stop-button::before { content: ""; position: absolute; inset: 4px; border-radius: 12px; background: var(--settings-accent-soft); z-index: -1; }
  .app-shell .composer-chip-button { height: 44px; min-height: 44px; font-size: 0.8125rem; padding-inline: 9px; border-color: transparent; background: transparent; box-shadow: none; }
  .app-shell .composer-model-chip { max-width: min(170px, 42vw); }
  .app-shell .composer-settings-chip { max-width: 140px; }
  .app-shell .composer-bottom { display: flex; min-height: 22px; padding: 2px 12px 4px; gap: 8px; }
  .app-shell .composer-hint { display: inline; max-width: none; font-size: 0.75rem; line-height: 1.35; white-space: normal; }
  .app-shell .composer-prompt-counter { margin-left: auto; flex: 0 0 auto; }
  .app-shell .sent-thread {
    --sent-thread-content-width: 100%;
    --sent-thread-column-width: calc(100% - max(12px, env(safe-area-inset-left, 0px)) - max(12px, env(safe-area-inset-right, 0px)));
    --sent-thread-column-before: max(12px, env(safe-area-inset-left, 0px));
    --sent-thread-top-safe: calc(var(--mobile-header-height) + 16px);
    --sent-thread-bottom-safe: calc(var(--mobile-composer-bottom) + var(--composer-live-height, 150px) + 16px);
    overflow-x: hidden; transition: none; gap: 20px 0;
  }
  .app-shell .sent-message { max-width: 100%; min-width: 0; }
  .app-shell .sent-message.has-result { grid-template-columns: minmax(0, 1fr); }
  .app-shell .assistant-result-preview { position: relative; min-width: 0; }
  .app-shell .assistant-result-preview img, .app-shell .assistant-result-preview video { position: absolute; inset: 0; max-width: 100%; }
  .app-shell .assistant-result-meta, .app-shell .assistant-result-meta-copy { min-width: 0; max-width: 100%; flex-wrap: wrap; }
  .app-shell .assistant-result-meta-copy span, .app-shell .assistant-result-meta-copy strong { white-space: normal; overflow-wrap: anywhere; }
  .app-shell .assistant-markdown code, .app-shell .assistant-markdown table { font-size: .8125rem; }
  .app-shell .sent-message.from-user { width: min(90%, 560px); }
  .app-shell .sent-message.from-assistant { max-width: 100%; }
  .app-shell .assistant-markdown, .app-shell .assistant-stream-text, .app-shell .sent-text { font-size: 1rem; line-height: 1.55; }
  .app-shell .assistant-markdown pre, .app-shell .assistant-markdown table { max-width: 100%; overflow-x: auto; }
  .app-shell .assistant-markdown table { display: block; }
  .app-shell .sent-actions button, .app-shell .sent-action-button { min-width: 44px; min-height: 44px; }
  .app-shell .upload-list { flex-wrap: wrap; max-height: min(160px, 22dvh); overflow-y: auto; }
  .app-shell .upload-chip { width: 100%; max-width: 100%; height: 58px; justify-content: flex-start; padding: 4px 48px 4px 4px; gap: 8px; }
  .app-shell .upload-chip img { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 8px; }
  .app-shell .upload-chip .upload-chip-name { display: block !important; font-size: 0.8125rem; text-align: left; min-width: 0; overflow-wrap: anywhere; white-space: normal; }
  .app-shell .upload-chip button, .app-shell .reference-chip button, .app-shell .packed-text-chip button, .app-shell #composerDocumentTargetClear { width: 44px; height: 44px; min-width: 44px; top: 4px; right: 2px; background: transparent; }

  .app-shell .composer-bottom:has(#composerHint:empty):has(#promptCharacterCounter:empty) { display: none; }
  .app-shell .prompt-action-row { display: grid; grid-template-columns: 44px 44px 44px minmax(0, 1fr) 44px 48px; align-items: start; }
  .app-shell .composer-main-actions { display: contents; }
  .app-shell #attachButton { grid-column: 1; grid-row: 1; }
  .app-shell .composer-chip-wrap:has(> #composerModelChip) { grid-column: 2 / 5; grid-row: 1; }
  .app-shell #composerModelChip { width: 100%; max-width: none; justify-content: flex-start; }
  .app-shell #composerModelChip > svg { margin-left: auto; }
  .app-shell #voiceMicButton, .app-shell #voiceStopButton { grid-column: 5; grid-row: 1; }
  .app-shell #voiceCancelButton { grid-column: 6; grid-row: 1; }
  .app-shell #submitButton, .app-shell #openWebUICancelButton { grid-column: 6; grid-row: 1; }
  .app-shell #composerSettingsWrap { grid-column: 1 / 5; grid-row: 2; }
  .app-shell #composerReasoningWrap { grid-column: 1; grid-row: 2; }
  .app-shell #composerWebButton { grid-column: 2; grid-row: 2; }
  .app-shell #composerArtifactButton { grid-column: 3; grid-row: 2; }
  .app-shell.mobile-sheet-open .stream, .app-shell.mobile-sheet-open .workspace-header { filter: brightness(.4); }
  .app-shell .composer-popover {
    position: fixed; left: max(12px, env(safe-area-inset-left, 0px)) !important; right: max(12px, env(safe-area-inset-right, 0px)) !important;
    /* When the composer leaves too little room, overlap its inert surface instead
       of pushing the sheet beyond the viewport. Keep 180px for scrollable controls. */
    --mobile-sheet-bottom: min(calc(var(--mobile-composer-bottom) + var(--composer-live-height, 150px) + 8px), max(calc(var(--mobile-nav-height) + 8px), calc(var(--mobile-viewport-height, 100dvh) - var(--mobile-header-height) - 200px)));
    bottom: var(--mobile-sheet-bottom);
    width: auto; max-height: max(0px, calc(var(--mobile-viewport-height, 100dvh) - var(--mobile-sheet-bottom) - var(--mobile-header-height) - 20px));
    transform: none !important; overscroll-behavior: contain; border-radius: 18px; background: rgb(35 39 41 / .95); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  }
  .app-shell .composer-popover button { min-height: 44px; font-size: 0.875rem; }
  .app-shell .mobile-sheet-close { position: sticky; top: 0; justify-self: end; min-width: 44px; color: var(--workspace-text); background: rgb(35 39 41 / .95); border: 1px solid var(--liquid-glass-border); border-radius: 12px; padding: 8px; }
  .app-shell .sidebar { position: absolute; top: 0; bottom: 0; left: 0; width: min(100%, 430px); height: 100%; z-index: 30; transform: translateX(-105%); }
  .app-shell .sidebar.open { transform: translateX(0); }
  .app-shell .aida-sidebar { padding: calc(env(safe-area-inset-top, 0px) + 12px) max(12px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 12px) max(12px, env(safe-area-inset-left, 0px)); }
  .app-shell .mobile-projects-close { min-height: 44px; min-width: 44px; position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; background: transparent; border: 0; color: var(--workspace-text); font-size: 24px; }
  .app-shell .aida-project-toggle, .app-shell .aida-tree-item, .app-shell .aida-more-button { min-height: 44px; font-size: 0.875rem; }
  .app-shell .aida-project-add-chat, .app-shell .aida-move-button, .app-shell .aida-delete-button { min-width: 44px; width: 44px; min-height: 44px; opacity: 1; }
  .app-shell .aida-project-name { min-width: 0; overflow-wrap: anywhere; }
  .app-shell .artifact-panel { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; max-width: none; z-index: 35; border-radius: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); grid-template-rows: auto auto minmax(0, 1fr); }
  .app-shell .artifact-panel-workbar { gap: 4px; padding-inline: 8px; min-height: 56px; }
  .app-shell .artifact-panel-heading strong { font-size: 1rem; line-height: 1.3; }
  .app-shell .artifact-panel-heading span { font-size: 0.75rem; line-height: 1.35; }
  .app-shell .artifact-panel-tab { min-height: 44px; font-size: 0.875rem; }
  .app-shell .artifact-panel-version-control, .app-shell #artifactPanelVersionSelect { min-height: 44px; }
  .app-shell .artifact-panel-action { min-width: 44px; min-height: 44px; }
  .app-shell .artifact-panel-resize-handle, .app-shell #artifactPanelFullscreen { display: none; }
  .app-shell.artifact-panel-open .workflow-switcher { visibility: hidden; }
  .app-shell .artifact-panel-preview iframe { width: 100%; max-width: 100%; }
  .app-shell .agents-catalogue { overflow: auto; padding-bottom: calc(var(--mobile-nav-height) + 20px); }
  .app-shell #drawerBackdrop { inset: 0; z-index: 29; }
  .app-shell .mobile-latest { position: absolute; bottom: calc(var(--mobile-composer-bottom) + var(--composer-live-height, 150px) + 12px); left: 50%; transform: translateX(-50%); z-index: 8; min-height: 44px; padding: 8px 14px; border: 1px solid var(--settings-accent-border); border-radius: 999px; background: rgb(35 39 41 / .95); color: var(--workspace-text); font-size: 0.875rem; }

  .app-shell { font-size: .875rem; }
  .app-shell .sent-time, .app-shell .sent-model, .app-shell .sent-meta button { font-size: .75rem; }
  .app-shell .sent-meta-right { min-width: 0; max-width: 100%; flex-wrap: wrap; }
  .app-shell .composer-popover .composer-popover-title,
  .app-shell .composer-popover .composer-popover-note,
  .app-shell .composer-popover .composer-model-kind,
  .app-shell .composer-popover .composer-model-detail-chip { font-size: .75rem; }
  .app-shell .composer-popover .composer-model-option strong,
  .app-shell .composer-popover .composer-reasoning-value { font-size: .875rem; }
  .app-shell .composer-popover .composer-model-option-main { flex-wrap: wrap; }
  .app-shell .composer-popover .composer-model-option strong { white-space: normal; overflow-wrap: anywhere; }
  .app-shell .composer-popover .composer-model-detail-chip { max-width: 100%; min-height: 1.5em; white-space: normal; }
  .app-shell .aida-nav-item, .app-shell .aida-tree-item, .app-shell .aida-project-toggle { font-size: .875rem; }
  .app-shell .aida-empty-note { font-size: .8125rem; }
  .app-shell .aida-tree-row, .app-shell .aida-project-row { display: flex; flex-wrap: wrap; align-items: center; }
  .app-shell .aida-project-toggle, .app-shell .aida-tree-row > .aida-tree-item { flex: 1 0 min(100%, 10rem); min-width: 0; max-width: 100%; }
  .app-shell .aida-row-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; margin-left: auto; }
  .app-shell .aida-row-actions > button { flex: 0 0 44px; }
  .app-shell .aida-rename-button { display: grid; color: var(--workspace-muted); }
  .app-shell .aida-project-toggle, .app-shell .aida-tree-item { height: auto; white-space: normal; overflow-wrap: anywhere; }
  .app-shell .aida-project-name { white-space: normal; overflow-wrap: anywhere; }
  .app-shell .artifact-panel-workbar { padding-block: 6px; }
  .app-shell .artifact-panel-browser { min-height: 52px; padding-block: 4px; flex-wrap: wrap; }
  .app-shell .artifact-panel-action { font-size: .875rem; }

  .app-shell .workspace-title p, .app-shell textarea::placeholder { color: var(--workspace-muted); }
  .app-shell #composerModelChipLabel { color: inherit; font-size: inherit; }
  .app-shell .workflow-switcher-tab:not([aria-selected="true"]) { color: var(--workspace-muted); }
  .app-shell .composer-popover .composer-popover-title, .app-shell .composer-popover .composer-popover-note { color: var(--workspace-muted); }
  .app-shell .composer-popover .composer-model-option strong, .app-shell .composer-popover .composer-model-kind,
  .app-shell .composer-popover .composer-model-detail-chip { color: var(--workspace-text); }
  .app-shell :is(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--workspace-accent-text); outline-offset: 2px; }
  .app-shell .composer-wrap::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: 23px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .app-shell #composerModelChip { isolation: isolate; }
  .app-shell #composerModelChip::before { content: ""; position: absolute; inset: 4px 0; z-index: -1; border-radius: 999px; border: 1px solid var(--liquid-glass-border); background: #2d323454; pointer-events: none; }
  .app-shell .workspace > .mobile-empty-chat { display: grid !important; position: absolute; z-index: 2; top: calc(var(--mobile-header-height) + 18px); left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); gap: 12px; max-height: calc(var(--mobile-viewport-height, 100dvh) - var(--mobile-header-height) - var(--mobile-composer-bottom) - var(--composer-live-height, 154px) - 40px); overflow: auto; overscroll-behavior: contain; }
  .app-shell .workspace > .mobile-empty-chat[hidden] { display: none !important; }
  .app-shell .mobile-empty-chat h2, .app-shell .mobile-empty-chat h3 { margin: 0; color: var(--workspace-text); font-size: 1.25rem; line-height: 1.3; }
  .app-shell .mobile-empty-chat h3 { margin-top: 2px; }
  .app-shell .mobile-empty-chat p { margin: 0; color: var(--workspace-muted); font-size: 1rem; line-height: 1.5; }
  .app-shell .mobile-empty-chat button { min-height: 48px; padding: 10px 14px; border: 1px solid var(--liquid-glass-border); border-radius: 999px; background: rgb(255 255 255 / .045); color: var(--workspace-text); font-size: .875rem; line-height: 1.35; }
  .attachment-viewer { padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
  .attachment-viewer-panel { width: 100%; }
  .attachment-viewer-title { font-size: 1rem; }
  .attachment-viewer-close { width: 44px; height: 44px; }
  .attachment-viewer-close:focus-visible { outline: 2px solid #cbb6e2; outline-offset: 2px; }
  /* The viewer is a body sibling, outside workspace-scoped color tokens. */
  .attachment-viewer-open {
    display: inline-flex; align-items: center; min-height: 44px; max-width: 100%;
    padding: 10px 8px; border-radius: 8px; color: var(--aida-text);
    font-size: .875rem; line-height: 1.35; text-decoration: underline; text-underline-offset: .2em;
  }
  .attachment-viewer-open:hover { color: var(--aida-text); }
  .attachment-viewer-open:focus-visible { outline: 2px solid var(--aida-text); outline-offset: 2px; }

  .app-shell #composerHint.error { color: #eda6a3; }
  .app-shell .upload-chip { display: grid; grid-template-columns: minmax(0, 1fr) 44px; grid-template-rows: auto auto; min-height: 58px; height: auto; padding: 4px; gap: 2px 8px; }
  .app-shell .upload-chip.has-preview { grid-template-columns: 48px minmax(0, 1fr) 44px; }
  .app-shell .upload-chip img { grid-column: 1; grid-row: 1 / 3; }
  .app-shell .upload-chip .upload-chip-name { grid-column: 1; grid-row: 1; padding: 0 4px; color: var(--workspace-text); display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
  .app-shell .upload-chip .upload-chip-meta { display: flex !important; flex-wrap: wrap; gap: 4px 8px; grid-column: 1; grid-row: 2; padding: 0 4px; }
  .app-shell .upload-chip .upload-chip-size, .app-shell .upload-chip .upload-chip-type, .app-shell .upload-chip .upload-chip-state { display: inline !important; font-size: .75rem; line-height: 1.35; color: var(--workspace-muted); }
  .app-shell .upload-chip .upload-chip-type::before, .app-shell .upload-chip .upload-chip-state::before { content: '· '; }
  .app-shell .upload-chip.has-preview .upload-chip-name, .app-shell .upload-chip.has-preview .upload-chip-meta { grid-column: 2; }
  .app-shell .upload-chip button { position: static; grid-column: 2; grid-row: 1 / 3; justify-self: end; }
  .app-shell .upload-chip.has-preview button { grid-column: 3; }
  .app-shell .composer-reasoning-range { min-height: 44px; }
  .app-shell .composer-popover .composer-reasoning-labels { display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
  .app-shell .composer-popover .composer-reasoning-label { position: static; min-width: 0; font-size: .75rem; line-height: 1.35; overflow-wrap: anywhere; color: var(--workspace-muted); }
  .app-shell .composer-popover .composer-reasoning-label.is-selected { color: var(--workspace-accent-text); }
  .app-shell .composer-popover .composer-reasoning-save-state { font-size: .75rem; line-height: 1.35; color: var(--workspace-muted); }
  .app-shell .mobile-latest[hidden] { display: none; }
  .app-shell.mobile-keyboard-open { --mobile-nav-height: 0px; --mobile-safe-bottom: 0px; --mobile-composer-bottom: 6px; }
  .app-shell.mobile-keyboard-open .workspace > .workflow-switcher { display: none !important; }
  .login-screen { min-height: 100dvh; padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(16px, env(safe-area-inset-left, 0px)); }
  .login-screen .login-visual { display: none; }
  .login-screen .login-auth { width: 100%; min-height: 100dvh; padding: 24px 0; }
  .login-screen .login-card { width: 100%; margin: auto; }
  .transfer-dialog { max-width: calc(100vw - 24px); max-height: calc(var(--mobile-viewport-height, 100dvh) - 24px); overflow-y: auto; overscroll-behavior: contain; }
  .transfer-dialog input, .transfer-dialog select, .transfer-dialog textarea { font-size: 1rem; }
  .transfer-dialog button { min-height: 44px; }
}
.mobile-projects-close, .mobile-sheet-close, .mobile-latest { display: none; }
@media (max-width: 767px), (max-height: 500px) and (pointer: coarse) and (max-width: 1024px) {
  .app-shell .mobile-projects-close, .app-shell .mobile-sheet-close { display: block; }
  .app-shell .workspace > .mobile-latest:not([hidden]) { display: block !important; }
}
@media (max-height: 500px) and (pointer: coarse) and (max-width: 1024px) {
  .app-shell { --prompt-max-height: min(4.5rem, 22dvh); }
  .app-shell .workspace > .workspace-header { min-height: calc(44px + env(safe-area-inset-top, 0px)); }
  .app-shell .workspace-title p { display: none; }
  .app-shell .composer-bottom { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell .mobile-latest, .app-shell .sidebar { transition: none; }
}

.app-shell .aida-rename-field { display: grid; gap: 4px; min-width: 0; }
.app-shell .aida-rename-status { font-size: .75rem; line-height: 1.35; color: var(--workspace-muted); overflow-wrap: anywhere; white-space: normal; }
.app-shell .aida-rename-status.error { color: #efb2ba; }
.app-shell .aida-rename-button:disabled { opacity: .4; cursor: wait; }
/* Creation feedback keeps the existing transparent sidebar controls. */
.app-shell .aida-create-status {
  margin: 0 12px 10px 40px;
  color: var(--workspace-muted);
  font-size: .75rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.app-shell .aida-create-status.error { color: #efb2ba; }
#aidaNewProjectButton:disabled,
[data-aida-project-add-chat]:disabled { opacity: .55; cursor: wait; }
