/* Final Task Manager phone/tablet cascade. Loaded after components.css so
   legacy and Phase C rules cannot reintroduce desktop widths in RTL views. */
@media (max-width: 767px) {
  .task-v2-shell,
  .task-v2-shell .task-v2-workspace,
  .task-v2-shell .task-v2-list-pane,
  .task-v2-shell .task-pipeline-view,
  .task-v2-shell #task-v2-rows-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .task-v2-shell { overflow-x: clip; }
  .task-v2-shell .task-v2-workspace {
    display: block !important;
    grid-template-columns: minmax(0, 1fr) !important;
    overflow: visible;
  }

  .task-v2-shell .task-v2-lists {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    border-inline-end: 0;
    border-bottom: 1px solid var(--color-border);
  }
  .task-v2-shell .task-v2-lists > ul,
  .task-v2-shell .task-v2-lists > ul[style] {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    width: max-content;
    max-width: none;
    min-width: 0;
    gap: .35rem !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .task-v2-shell .task-v2-lists li {
    flex: 0 0 auto;
    width: auto;
    max-width: 13rem;
    min-height: 36px;
    white-space: normal;
  }

  .task-v2-shell .task-v2-toolbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible !important;
    box-sizing: border-box;
  }
  .task-v2-shell .task-v2-toolbar-left {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 0 1 auto;
    flex-wrap: unset !important;
  }
  .task-v2-shell .task-v2-toolbar-left .task-v2-search {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .task-v2-shell .task-v2-toolbar-left > select,
  .task-v2-shell .task-v2-toolbar-left > select.form-control,
  .task-v2-shell .task-v2-toolbar-left .task-v2-date-control,
  .task-v2-shell .task-v2-toolbar-left .task-v2-date-filter {
    width: 100% !important;
    max-width: 100%;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  .task-v2-shell .task-v2-toolbar-left .task-v2-date-control { display: flex; }

  .task-v2-shell .task-v2-toolbar-right {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-shrink: 1;
  }
  .task-v2-shell .task-v2-view-toggles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
  }
  .task-v2-shell .task-v2-view-toggles .view-toggle-btn,
  .task-v2-shell .task-v2-toolbar-right > .btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .task-v2-shell .task-pipeline-health {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible !important;
    box-sizing: border-box;
  }
  .task-v2-shell .task-health-heading {
    grid-column: 1 / -1;
    min-width: 0;
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: break-word;
  }
  .task-v2-shell .task-health-item,
  .task-v2-shell .task-health-item > span:last-child,
  .task-v2-shell .task-health-item strong {
    display: flex;
    align-items: center;
    width: auto;
    max-width: 100%;
    min-width: 0;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    overflow: visible;
    text-overflow: clip;
  }

  .task-v2-shell .task-health-item {
    gap: .45rem;
    min-height: 42px;
    padding: .5rem .55rem;
  }

  .task-v2-shell .task-health-item .task-health-dot {
    display: block !important;
    width: 8px !important;
    height: 8px;
    flex: 0 0 8px;
  }

  .task-v2-shell .task-health-item .task-health-icon {
    display: block !important;
    width: 18px !important;
    height: 18px;
    flex: 0 0 18px;
    stroke-width: 2.25;
  }

  .task-v2-shell .task-health-item strong {
    flex: 0 0 auto;
    font-size: .82rem;
  }

  .task-v2-shell .task-health-item > span:last-child {
    display: block;
    flex: 1 1 auto;
    overflow-wrap: normal;
  }
  .task-v2-shell .task-health-new-task {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-inline-start: 0;
    justify-content: center;
    white-space: normal !important;
  }

  .task-v2-shell .task-pipeline-view { overflow: hidden; padding-inline: .55rem; }
  .task-v2-shell .task-pipeline-view .task-board-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .task-v2-shell .task-pipeline-view .task-board {
    width: max-content;
    min-width: 100%;
    max-width: none;
  }
  .task-v2-shell .task-pipeline-view .task-board-column {
    flex: 0 0 min(84vw, 284px);
    min-width: min(84vw, 284px);
    max-width: min(84vw, 284px);
  }

  .task-v2-shell .task-pipeline-card,
  .task-v2-shell .task-pipeline-card-head,
  .task-v2-shell .task-pipeline-card h4,
  .task-v2-shell .task-pipeline-card-footer,
  .task-v2-shell .task-card-signals,
  .task-v2-shell .task-assignee,
  .task-v2-shell .task-v2-row-content,
  .task-v2-shell .task-v2-row-content h4,
  .task-v2-shell .task-focus-people,
  .task-v2-shell .task-focus-people strong {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }
  .task-v2-shell #task-v2-rows-container .task-v2-table-header,
  .task-v2-shell #task-v2-rows-container .task-v2-row,
  .task-v2-shell #task-v2-rows-container .task-v2-row[style] {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .task-v2-shell #task-v2-rows-container .task-v2-table-header { display: none; }
  .task-v2-shell #task-v2-rows-container .task-v2-row-left,
  .task-v2-shell #task-v2-rows-container .task-v2-row-content,
  .task-v2-shell #task-v2-rows-container .task-v2-row-status,
  .task-v2-shell #task-v2-rows-container .task-v2-row-creator,
  .task-v2-shell #task-v2-rows-container .task-v2-row-actions {
    grid-column: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .task-v2-shell #task-v2-rows-container .task-v2-row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    overflow: visible;
  }
}
