/* Mobile-only workspace switcher. Desktop and landscape tablet rules stay in layout.css. */
.mobile-tabbar {
  display: none;
}

@media (max-width: 760px) {
  html,
  body {
    overflow: hidden;
  }

  .topbar {
    gap: 6px;
    padding: 6px 8px;
  }

  .brand-mark {
    display: none;
  }

  .brand-title {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
  }

  .topbar-actions {
    flex: 1;
    flex-wrap: nowrap;
    gap: 5px;
    overflow-x: auto;
    justify-content: flex-end;
    scrollbar-width: none;
  }

  .topbar-actions::-webkit-scrollbar,
  .panel-head-actions::-webkit-scrollbar,
  .chat-compose-actions::-webkit-scrollbar {
    display: none;
  }

  .topbar-actions .btn,
  .settings-btn {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  .workspace,
  .workspace-4 {
    display: grid;
    flex: 1;
    min-height: 0;
    padding: 4px 6px;
    overflow: hidden;
  }

  .panel {
    display: none;
    height: 100%;
    min-height: 0;
    border-radius: 8px;
  }

  body.mobile-view-compose .workspace {
    grid-template-columns: minmax(210px, 0.82fr) minmax(260px, 1.18fr);
  }

  body.mobile-view-workspace .workspace {
    grid-template-columns: 1fr;
  }

  body.mobile-view-compose .todo-panel,
  body.mobile-view-compose .chat-panel,
  body.mobile-view-workspace .workspace-panel {
    display: flex;
  }

  body:not(.mobile-view-compose):not(.mobile-view-workspace) .todo-panel,
  body:not(.mobile-view-compose):not(.mobile-view-workspace) .chat-panel {
    display: flex;
  }

  .panel-head {
    min-height: 36px;
    padding: 7px 9px;
  }

  .panel-head h2 {
    font-size: 13px;
  }

  .panel-head-actions {
    min-width: 0;
    gap: 5px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .panel-head-actions .btn,
  .panel-head-actions .tab {
    white-space: nowrap;
  }

  .todo-panel .panel-body,
  .workspace-preview-pane {
    padding: 6px;
  }

  .todo-panel .panel-head,
  .chat-panel .panel-head {
    min-height: 30px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .todo-panel .panel-body {
    font-size: 12px;
  }

  .field {
    gap: 3px;
    margin-bottom: 7px;
  }

  .field span {
    font-size: 11px;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 30px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .chat-messages {
    padding: 6px 7px;
    gap: 6px;
  }

  .chat-bubble {
    max-width: 96%;
    padding: 6px 8px;
    font-size: 12px;
  }

  .chat-compose {
    padding: 4px 6px;
  }

  .chat-input {
    min-height: 30px;
    max-height: 46px;
    padding: 5px 8px;
    margin-bottom: 4px;
    border-radius: 8px;
    font-size: 12px;
  }

  .chat-compose-actions {
    flex-wrap: nowrap;
    gap: 5px;
    overflow-x: auto;
  }

  .chat-compose-actions .btn {
    flex: 1 0 auto;
    min-height: 28px;
    padding: 4px 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  #btnChatSend {
    min-width: 58px;
  }

  .workspace-split {
    flex-direction: row;
  }

  .file-tree {
    width: min(152px, 26%);
    min-width: 0;
    max-height: none;
    border-right: 1px solid var(--border);
    border-bottom: none;
    padding: 6px;
  }

  .file-editor-area {
    min-height: 0;
  }

  .workflow-hint {
    padding: 4px 8px;
    font-size: 10px;
  }

  .todo-output-summary {
    display: none;
  }

  .mobile-tabbar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    flex-shrink: 0;
    gap: 3px;
    padding: 3px 8px 4px;
    border-top: 1px solid var(--border);
    background: rgba(26, 29, 39, 0.98);
  }

  .mobile-tabbar button {
    min-height: 28px;
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 11px;
  }

  .mobile-tabbar button.active {
    background: rgba(236, 72, 153, 0.16);
    color: var(--text);
  }
}
