/* Phone layout: keep conversation controls and reveal secondary tools on demand. */
.mobile-control-label { display: none; }
@media (max-width: 620px) {
  .toolbar.mobile-compact-toolbar {
    min-height: 44px; flex-wrap: nowrap; gap: 6px;
    padding: calc(4px + env(safe-area-inset-top)) 8px 4px;
  }
  .toolbar.mobile-compact-toolbar > .project-identity { display: flex; flex: 1; min-width: 0; gap: 6px; }
  .toolbar.mobile-compact-toolbar .project-menu-toggle { min-width: 0; min-height: 34px; max-width: 42%; }
  .toolbar.mobile-compact-toolbar .project-menu-toggle::before { content: none; }
  .toolbar.mobile-compact-toolbar .project-menu-toggle .project-title { display: block; min-height: 0; font-size: 12px; }
  .toolbar.mobile-compact-toolbar .project-conversation-switch { flex: 1; max-width: none; gap: 3px; }
  .toolbar.mobile-compact-toolbar #projectConversationSelect {
    flex: 1; min-width: 32px; max-width: none; width: auto; height:34px; min-height:34px; font-size: 12px; padding-inline: 6px;
  }
  .toolbar.mobile-compact-toolbar .project-conversation-switch > button { height: 34px; min-height: 34px; }
  .toolbar.mobile-compact-toolbar #toolsPanel {
    width: min(360px, calc(100vw - 16px)); max-width: calc(100vw - 16px);
    padding: 10px; overflow-y: auto; overscroll-behavior: contain;
  }
  .mobile-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 6px; }
  .mobile-panel-heading strong { font-size: 13px; color: var(--lm-text-strong); }
  .mobile-panel-heading button { flex: 0 0 auto; min-height: 32px; padding: 4px 10px; background: var(--panel); color: var(--lm-text); font-size: 12px; }
  .mobile-tools-group { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 10px; border-bottom: 1px solid var(--lm-divider); }
  .mobile-tools-group h3 { flex-basis: 100%; margin: 0 0 2px; font-size: 11px; font-weight: 500; color: var(--lm-text-muted); }
  #toolsPanel .mobile-tools-group .toolbar-model-picker {
    display: flex; flex: 1 1 100%; width: 100%; max-width: 100%; min-width: 0; min-height: 36px; padding: 0 8px;
  }
  #toolsPanel .mobile-control-label { display: inline; flex: 0 0 auto; font-size: 12px; }
  #toolsPanel .toolbar-model-picker > i { display: none; }
  #toolsPanel .toolbar-model-picker select { flex: 1; width: 0; min-width: 0; font-size: 13px; }
  #toolsPanel .mobile-tools-group :is(.icon-button, .fast-mode-button) { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 0; min-height: 36px; gap: 6px; padding: 4px 9px; font-size: 12px; color: var(--lm-text); }
  #toolsPanel .mobile-tools-group .fast-mode-button.is-active { color: var(--lm-primary); background: var(--lm-primary-soft); }
  #toolsPanel .mobile-tools-group :is(.icon-button, .fast-mode-button, .view-mode-button) > span { display: inline; position: static; width: auto; height: auto; margin: 0; padding: 0; clip-path: none; overflow: visible; }
  #toolsPanel .view-mode-switch { display: flex; flex: 1; flex-wrap: wrap; gap: 2px; }
  #toolsPanel .view-mode-button { width: auto; min-width: 34px; min-height: 36px; flex: 1 1 auto !important; gap: 4px; padding: 4px 8px; }
  .input-panel.mobile-compact-footer { padding: 4px 10px calc(4px + env(safe-area-inset-bottom)); }
  .mobile-compact-footer #operationTargetBar { min-height: 28px; padding: 3px 8px; margin-bottom: 4px; font-size: 11px; gap: 6px; }
  .mobile-compact-footer .composer { padding: 2px 5px 3px; border-radius: 12px; box-shadow: none; }
  .mobile-compact-footer #commandInput { min-height: 32px; padding: 4px 7px; font-size: 16px; }
  .mobile-compact-footer :is(.composer-action-button, .composer-send, .local-task-menu-toggle) { min-height: 34px; height: 34px; }
  .mobile-compact-footer .composer-action-button { width: 34px; min-width: 34px; }
  .mobile-compact-footer #cameraInputBtn span { display: none; }
  .mobile-compact-footer .composer-actions #stopCommandBtn { min-height: 34px; padding: 0 8px; gap: 4px; font-size: 12px; color: var(--lm-danger); }
  .mobile-compact-footer #runtimeStatusBar { margin-top: 3px; min-height: 28px; gap: 5px; overflow: hidden; }
  .mobile-compact-footer #sessionControlBtn { padding-inline: 6px; min-height: 28px; font-size: 10px; }
  .mobile-compact-footer #connectionStatus[data-connected="true"] > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .mobile-compact-footer #turnStatusBar { flex: 0 1 auto; margin: 0; padding: 3px 5px; min-width: 0; max-width: 42%; border: 0; background: transparent; }
  .mobile-compact-footer #turnStatusBar .turn-status-copy { min-width: 0; }
  .mobile-compact-footer #turnStatusBar strong { font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
  .mobile-compact-footer #turnStatusDetail { display: none; }
  .mobile-compact-footer #actionStatus { font-size: 10px; }
  .mobile-compact-footer #actionStatus::before { display: none; }
  .mobile-details-toggle { flex: 0 0 auto; margin-left: auto; min-height: 28px; padding: 2px 6px; font-size: 11px; color: var(--lm-text-muted); background: transparent; border-color: transparent; }
  .mobile-details-toggle[aria-expanded="true"] { color: var(--lm-primary); background: var(--lm-primary-soft); }
  .mobile-composer-details { position: absolute; z-index: 30; bottom: calc(100% + 6px); left: 8px; right: 8px; padding: 10px; border: 1px solid var(--lm-divider); border-radius: 12px; background: var(--panel); color: var(--lm-text); box-shadow: var(--lm-shadow-float); overflow: auto; overscroll-behavior: contain; }
  .mobile-composer-details .send-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
  .mobile-composer-details .send-row button { min-height: 36px; padding: 5px 10px; border-color: var(--lm-divider); background: var(--panel-soft); color: var(--lm-text); }
  .mobile-runtime-details { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
  .mobile-runtime-details .status { min-width: 0; width: auto; text-align: left; font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
  .mobile-runtime-details .status > i { margin-right: 5px; }
  .mobile-runtime-details button { min-height: 36px; padding: 5px 8px; }
  .mobile-action-detail { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--lm-text-muted); overflow-wrap: anywhere; }
  .mobile-action-detail:empty { display: none; }
}
